|
|
@@ -5,10 +5,11 @@ import cn.hutool.core.bean.copier.CopyOptions;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
-import com.ydtech.core.page.BaseController;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.core.page.PageRequest;
|
|
|
import com.ydtech.core.page.PageResult;
|
|
|
+import com.ydtech.modules.base.controller.BaseController;
|
|
|
+import com.ydtech.modules.base.model.dto.BaseDto;
|
|
|
import com.ydtech.modules.inv.model.InvChannelsExternalBillsDetails;
|
|
|
import com.ydtech.modules.inv.model.InvChannelsExternalBillsDetailsHistory;
|
|
|
import com.ydtech.modules.inv.model.vo.req.InvInsExternalBillsDetailsReqVO;
|
|
|
@@ -16,13 +17,17 @@ import com.ydtech.modules.inv.service.InvChannelsExternalBillsDetailsHistoryServ
|
|
|
import com.ydtech.modules.inv.service.InvChannelsExternalBillsDetailsService;
|
|
|
import com.ydtech.utils.StringUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.validation.constraints.NotBlank;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
@@ -45,8 +50,6 @@ public class InvChannelsExternalBillsDetailsController extends BaseController {
|
|
|
private InvChannelsExternalBillsDetailsHistoryService icebdhService;
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 分页查询
|
|
|
*
|
|
|
@@ -55,10 +58,10 @@ public class InvChannelsExternalBillsDetailsController extends BaseController {
|
|
|
*/
|
|
|
@ApiOperation(value = "分页查询")
|
|
|
@PostMapping(value = "/queryPage")
|
|
|
- public HttpResult queryPage(@RequestBody InvInsExternalBillsDetailsReqVO reqVo){
|
|
|
+ public HttpResult queryPage(@RequestBody InvInsExternalBillsDetailsReqVO reqVo) {
|
|
|
|
|
|
LambdaQueryWrapper<InvChannelsExternalBillsDetails> lqw = new LambdaQueryWrapper();
|
|
|
- lqw.eq(StringUtils.isNotEmpty(reqVo.getBatchNum()),InvChannelsExternalBillsDetails::getBatchNum,reqVo.getBatchNum());
|
|
|
+ lqw.eq(StringUtils.isNotEmpty(reqVo.getBatchNum()), InvChannelsExternalBillsDetails::getBatchNum, reqVo.getBatchNum());
|
|
|
|
|
|
Page p = PageRequest.buildPageRequestByVo(reqVo);
|
|
|
IPage<InvChannelsExternalBillsDetails> pResult = icebdService.page(p, lqw);
|
|
|
@@ -68,17 +71,20 @@ public class InvChannelsExternalBillsDetailsController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@GetMapping("/detailsById")
|
|
|
@ApiOperation(value = "详情")
|
|
|
public HttpResult detailsById(String id) {
|
|
|
return HttpResult.ok(icebdService.getById(id));
|
|
|
|
|
|
}
|
|
|
- @GetMapping("/aaaaa")
|
|
|
- @ApiOperation(value = "测试用户ID是否获取到")
|
|
|
- public HttpResult aaaa(HttpServletRequest request) {
|
|
|
+
|
|
|
+ @PutMapping("/aaaaa")
|
|
|
+ @ApiOperation(value = "测试用户ID是否获取到", notes = "" +
|
|
|
+ "参数1:列表ID" +
|
|
|
+ "</br>参数2:通过状态(1通过,2失败)" +
|
|
|
+ "</br>参数3:类型(1报价,2核保)")
|
|
|
+ public HttpResult aaaa(@RequestBody BaseDto dto) {
|
|
|
+// public HttpResult aaaa(@ApiIgnore @RequestBody BaseDto dto) {
|
|
|
// log.error("********************");
|
|
|
// log.error("Authorization:"+request.getHeader("Authorization"));
|
|
|
// log.error("token:"+request.getHeader("token"));
|
|
|
@@ -94,35 +100,58 @@ public class InvChannelsExternalBillsDetailsController extends BaseController {
|
|
|
// log.error("测试获取的用户ID 2222:"+getUserId2());
|
|
|
// log.error("测试获取的用户ID 1111:"+getUserId());
|
|
|
// return HttpResult.ok("获取用户ID测试:",getUserId());
|
|
|
- return HttpResult.ok("获取用户部门ID:",getdeptId(request));
|
|
|
-// return HttpResult.ok();
|
|
|
+// return HttpResult.ok("获取用户部门ID:",getdeptId(request));
|
|
|
+ return HttpResult.ok(dto);
|
|
|
|
|
|
}
|
|
|
- @GetMapping("/bbbb")
|
|
|
+
|
|
|
+ @GetMapping(value = "/bbbb")
|
|
|
@ApiOperation(value = "测试用户ID是否获取到2222")
|
|
|
public HttpResult bbbb() {
|
|
|
- return HttpResult.ok("获取用户信息测试:",getUser());
|
|
|
+ return HttpResult.ok("获取用户信息测试:", getUser());
|
|
|
// return HttpResult.ok("获取用户ID测试2222:",getUserId2());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @PostMapping(value = "/demo02")
|
|
|
+ @ApiOperation(value = "数据导入")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "file", value = "excel文件", required = true, dataType = "__file"),
|
|
|
+ @ApiImplicitParam(name = "batchNum", value = "批次号", required = true, dataType = "String")
|
|
|
+ })
|
|
|
+ public HttpResult demo02(@RequestPart MultipartFile file, @RequestParam String batchNum) {
|
|
|
+ //业务代码
|
|
|
+ return HttpResult.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/demo03")
|
|
|
+ @ApiOperation(value = "查询")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "file", value = "excel文件", required = true, dataType = "__file"),
|
|
|
+ @ApiImplicitParam(name = "batchNum", value = "批次号", required = true, dataType = "String")
|
|
|
+ })
|
|
|
+ public HttpResult demo03(@RequestParam @NotBlank(message = "报价号ID不能为空") String quoteNo) {
|
|
|
+ return HttpResult.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@ApiOperation(value = "修改")
|
|
|
@PostMapping(value = "/edit")
|
|
|
@Transactional
|
|
|
public HttpResult edit(@RequestBody InvChannelsExternalBillsDetails icebd, HttpServletRequest request) {
|
|
|
|
|
|
|
|
|
-
|
|
|
List<InvChannelsExternalBillsDetailsHistory> list = icebdhService.gainListByEditId(icebd.getId());
|
|
|
|
|
|
List<InvChannelsExternalBillsDetailsHistory> icebdhList = new ArrayList<>();
|
|
|
InvChannelsExternalBillsDetails icebdOld = icebdService.getById(icebd.getId());
|
|
|
- if(null == list || list.size() < 1){
|
|
|
+ if (null == list || list.size() < 1) {
|
|
|
//初始历史数据
|
|
|
InvChannelsExternalBillsDetailsHistory icebdh = new InvChannelsExternalBillsDetailsHistory();
|
|
|
// BeanUtils.copyProperties(icebdOld, icebdh,"id");
|
|
|
- BeanUtil.copyProperties(icebdOld, icebdh, CopyOptions.create(null, true,"id"));
|
|
|
+ BeanUtil.copyProperties(icebdOld, icebdh, CopyOptions.create(null, true, "id"));
|
|
|
icebdh.setEditId(icebd.getId());
|
|
|
icebdhList.add(icebdh);
|
|
|
}
|
|
|
@@ -134,7 +163,7 @@ public class InvChannelsExternalBillsDetailsController extends BaseController {
|
|
|
BeanUtil.copyProperties(icebd, icebdOld, CopyOptions.create(null, true));
|
|
|
|
|
|
//构造历史数据
|
|
|
- BeanUtil.copyProperties(icebdOld, icebdh, CopyOptions.create(null, true,"id"));
|
|
|
+ BeanUtil.copyProperties(icebdOld, icebdh, CopyOptions.create(null, true, "id"));
|
|
|
|
|
|
// //构造更新数据
|
|
|
// BeanUtils.copyProperties(icebdOld , icebd);
|
|
|
@@ -154,7 +183,4 @@ public class InvChannelsExternalBillsDetailsController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|