删除出现异常

This commit is contained in:
jing's 2024-03-26 21:58:18 +08:00
parent 686b65b0ba
commit 10cc77a414
2 changed files with 59 additions and 53 deletions

View File

@ -20,6 +20,7 @@ import com.nflg.product.bomnew.util.VUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import nflg.product.common.constant.STATE;
import nflg.product.common.dto.LoginUserInfoDTO;
import nflg.product.common.vo.ResultVO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
@ -101,7 +102,6 @@ public class EbomApi extends BaseApi {
}
@GetMapping("getChild")
@ApiOperation("获取子级")
public ResultVO<List<BomNewEbomParentVO>> getChild(@RequestParam("bomRowId") Long bomRowId) {
@ -185,7 +185,6 @@ public class EbomApi extends BaseApi {
}
@GetMapping("createBomDownExcelTmp")
@ApiOperation("创建EBOM-导入时模版下载")
public void createBomDownExcelTmp(HttpServletResponse response) throws IOException {
@ -306,7 +305,6 @@ public class EbomApi extends BaseApi {
}
@PostMapping("queryMaterial")
@ApiOperation("查询物料信息")
public ResultVO<BomNewEbomParentVO> queryMaterial(@RequestBody BomNewEbomMaterialQuery query) {
@ -331,9 +329,6 @@ public class EbomApi extends BaseApi {
}
@GetMapping("delete")
@ApiOperation("删除物料")
@LogRecord(success = "Ebom-删除物料,物料编码:{{#bom.materialNo}}-版本:{{#bom.currentVersion}},操作结果:{{#_ret}}", bizNo = "{{#bomRowId}}", type = "Ebom-删除物料")
@ -342,13 +337,12 @@ public class EbomApi extends BaseApi {
}
//temporary
@PostMapping("temporary")
@ApiOperation("暂存")
@LogRecord(success = "Ebom-暂存,物料编码:{{#dto.parent.materialNo}}-版本:{{#dto.parent.currentVersion}},操作结果:{{#_ret}}", bizNo = "{{#dto.parent.rowId}}",type = "Ebom-暂存")
@LogRecord(success = "Ebom-暂存,物料编码:{{#dto.parent.materialNo}}-版本:{{#dto.parent.currentVersion}},操作结果:{{#_ret.state}} {{#_ret.msg}}", bizNo = "{{#dto.parent.rowId}}", type = "Ebom-暂存")
public ResultVO<BomNewEbomParentVO> temporary(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
@ -358,30 +352,31 @@ public class EbomApi extends BaseApi {
@PostMapping("temporaryAdd")
@ApiOperation("暂存添加")
@LogRecord(success = "Ebom-暂存添加,物料编码:{{#dto.parent.materialNo}}-版本:{{#dto.parent.currentVersion}},操作结果:{{#_ret}}", bizNo = "{{#dto.parent.rowId}}",type = "Ebom-暂存添加")
@LogRecord(success = "Ebom-暂存添加,物料编码:{{#dto.parent.materialNo}}-版本:{{#dto.parent.currentVersion}},操作结果:{{#_ret.state}} {{#_ret.msg}}", bizNo = "{{#dto.parent.rowId}}", type = "Ebom-暂存添加")
public ResultVO<BomNewEbomParentVO> temporaryAdd(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
bomNewEbomParentService.deleteBomChild(dto.getDelDatas());
return ResultVO.success(bomNewEbomParentService.temporary(dto));
}
@PostMapping("submitAdd")
@ApiOperation("提交添加")
@LogRecord(success = "Ebom-提交添加,物料编码:{{#dto.parent.materialNo}}-版本:{{#dto.parent.currentVersion}},操作结果:{{#_ret}}", bizNo = "{{#dto.parent.rowId}}",type = "Ebom-提交添加")
@LogRecord(success = "Ebom-提交添加,物料编码:{{#dto.parent.materialNo}}-版本:{{#dto.parent.currentVersion}},操作结果:{{#_ret.state}} {{#_ret.msg}}", bizNo = "{{#dto.parent.rowId}}", type = "Ebom-提交添加")
public ResultVO<Boolean> submitAdd(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
bomNewEbomParentService.deleteBomChild(dto.getDelDatas());
return ResultVO.success(bomNewEbomParentService.submit(dto));
}
@PostMapping("submit")
@ApiOperation("提交")
@LogRecord(success = "Ebom-提交,物料编码:{{#dto.parent.materialNo}}-版本:{{#dto.parent.currentVersion}},操作结果:{{#_ret}}", bizNo = "{{#dto.parent.rowId}}",type = "Ebom-提交")
@LogRecord(success = "Ebom-提交,物料编码:{{#dto.parent.materialNo}}-版本:{{#dto.parent.currentVersion}},操作结果:{{#_ret.state}} {{#_ret.msg}}", bizNo = "{{#dto.parent.rowId}}", type = "Ebom-提交")
public ResultVO<Boolean> submit(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
bomNewEbomParentService.deleteBomChild(dto.getDelDatas());
return ResultVO.success(bomNewEbomParentService.submit(dto));
}
@PostMapping("intiException")
@ApiOperation("初始化错误类型")
@LogRecord(success = "Ebom-初始化错误类型,操作结果:{{#_ret}}", bizNo = "{{#bomRowIds.toString()}}", type = "Ebom-初始化错误类型")
@ -392,7 +387,6 @@ public class EbomApi extends BaseApi {
}
// @GetMapping("getrel")
// @ApiOperation("模糊匹配物料")
// public ResultVO<MaterialMateVO> getRelMaterial(@RequestParam(value = "materialName", required = false) String materialName ,@RequestParam(value = "materialTexture" ,required = false) String materialTexture ){
@ -412,10 +406,21 @@ public class EbomApi extends BaseApi {
}
@GetMapping("loginDebug")
@ApiOperation("模拟登录")
public ResultVO<Boolean> loginDebug() {
LoginUserInfoDTO dto = new LoginUserInfoDTO();
dto.setUserCode("QHI17062100");
dto.setUserName("郑军榕");
dto.setRealName("郑军榕");
dto.setDepartName("信息流程中心/IT支持");
dto.setFullDeptName("信息流程中心/IT支持");
dto.setRowId(1585164668335439881l);
SessionUtil.loginUser.set(dto);
return ResultVO.success();
}
}

View File

@ -1675,14 +1675,15 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
* 用户可以直接删除用户单击暂存或是提交时才会保存至数据库
*/
public void deleteBomChild(List<BomNewEbomParentVO> delList) {
if(CollUtil.isEmpty(delList)){
return;
}
List<Long> rowIds=delList.stream().map(BomNewEbomParentVO::getRowId).collect(Collectors.toList());
QueryWrapper<BomNewEbomChildEntity> queryChildWrapper=new QueryWrapper<>();
queryChildWrapper.lambda().in(BomNewEbomChildEntity::getRowId,delList.stream().map(BomNewEbomParentVO::getRowId));
queryChildWrapper.lambda().in(BomNewEbomChildEntity::getRowId,rowIds);
List<BomNewEbomChildEntity> delChildList=SpringUtil.getBean(BomNewEbomChildService.class).list(queryChildWrapper);
List<BomNewEbomChildEntity> delTagList = new ArrayList<>();
//检查原始bom里过来数据是否包含正常数据