更新异常

This commit is contained in:
大米 2024-03-04 19:16:11 +08:00
parent f2bd86937d
commit 0a756abf84
3 changed files with 47 additions and 0 deletions

View File

@ -211,6 +211,14 @@ public class PBomApi extends BaseApi {
return ResultVO.success(bomNewPbomParentService.saveAllocationFactory(params)); return ResultVO.success(bomNewPbomParentService.saveAllocationFactory(params));
} }
@PostMapping("saveAllocationFactoryNew")
@ApiOperation("分工厂-保存")
@LogRecord(success = "PBom-分工厂-保存。操作结果:{{#_ret}}", bizNo = "",type = "PBom-分工厂-保存")
public ResultVO<Boolean> saveAllocationFactory(@Valid @RequestBody AllocationFactoryParam params){
return ResultVO.success(bomNewPbomParentService.saveAllocationFactory(params));
}
@PostMapping("allocationFactoryForRel") @PostMapping("allocationFactoryForRel")
@ApiOperation("分工厂-规则匹配") @ApiOperation("分工厂-规则匹配")
@LogRecord(success = "PBom-分工厂-规则匹配,物料编码:{{#bom.materialNo}}-版本:{{#bom.currentVersion}}-规则编码:{{#params.ruleGroupCode}} 操作结果:{{#_ret}}", bizNo = "{{#params.bomRowId}}",type = "PBom-分工厂-规则匹配") @LogRecord(success = "PBom-分工厂-规则匹配,物料编码:{{#bom.materialNo}}-版本:{{#bom.currentVersion}}-规则编码:{{#params.ruleGroupCode}} 操作结果:{{#_ret}}", bizNo = "{{#params.bomRowId}}",type = "PBom-分工厂-规则匹配")

View File

@ -0,0 +1,19 @@
package com.nflg.product.bomnew.pojo.dto;
import com.nflg.product.bomnew.service.BomNewLogService;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* 分工厂
*/
@Data
public class AllocationFactoryParam {
List<SaveAllocationFactoryDTO> data;
@ApiModelProperty("是否设置下级 0-否 1-是")
private Integer setSubNode;
}

View File

@ -612,6 +612,26 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
return true; return true;
} }
@Transactional(rollbackFor = Exception.class)
public Boolean saveAllocationFactoryNew(AllocationFactoryParam params) {
VUtils.isTure(CollUtil.isEmpty(params.getData())).throwMessage("分配工厂数据为空");
//按分配的工厂分组
if(BooleanEnum.TRUE.equals(params.getSetSubNode()) ){
return saveAllocationFactory(params.getData());
}else {
params.getData().forEach(k->{
});
}
// Map<String, List<SaveAllocationFactoryDTO>> stringListMap = ListCommonUtil.listGroupMap(params.equals(), SaveAllocationFactoryDTO::getProductionFactoryCode);
// for (Map.Entry<String, List<SaveAllocationFactoryDTO>> entry : stringListMap.entrySet()) {
// List<SaveAllocationFactoryDTO> saveList = entry.getValue();
// List<Long> rowIds = saveList.stream().map(u -> u.getRowId()).collect(Collectors.toList());
// pbomChildService.getBaseMapper().setProductionFactoryCode(entry.getKey(), rowIds);
// }
return true;
}
public Boolean allocationFactoryForRel(AllocationFactoryForRelDTO params) throws ExecutionException, InterruptedException { public Boolean allocationFactoryForRel(AllocationFactoryForRelDTO params) throws ExecutionException, InterruptedException {
VUtils.isTure(StrUtil.isBlank(params.getRuleGroupCode())).throwMessage("规则编码不能为空"); VUtils.isTure(StrUtil.isBlank(params.getRuleGroupCode())).throwMessage("规则编码不能为空");