更新异常
This commit is contained in:
parent
f2bd86937d
commit
0a756abf84
|
|
@ -211,6 +211,14 @@ public class PBomApi extends BaseApi {
|
|||
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")
|
||||
@ApiOperation("分工厂-规则匹配")
|
||||
@LogRecord(success = "PBom-分工厂-规则匹配,物料编码:{{#bom.materialNo}}-版本:{{#bom.currentVersion}}-规则编码:{{#params.ruleGroupCode}} 操作结果:{{#_ret}}", bizNo = "{{#params.bomRowId}}",type = "PBom-分工厂-规则匹配")
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -612,6 +612,26 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
|||
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 {
|
||||
|
||||
VUtils.isTure(StrUtil.isBlank(params.getRuleGroupCode())).throwMessage("规则编码不能为空");
|
||||
|
|
|
|||
Loading…
Reference in New Issue