|
|
|
@ -204,7 +204,7 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl<ZyProductPlanMapp |
|
|
|
|
|
|
|
|
|
SysDepart sysDepart = iSysDepartService.getOne(new LambdaQueryWrapper<SysDepart>() |
|
|
|
|
.eq(SysDepart::getOrgCategory, "2") |
|
|
|
|
.eq(SysDepart::getDepartName, "测试生产企业")); |
|
|
|
|
.eq(SysDepart::getDepartName, "黄淮生产车间")); |
|
|
|
|
if (ObjectUtils.isEmpty(sysDepart)) |
|
|
|
|
throw new JeecgBootException("生产计划自动化-mock-[企业信息]数据异常!"); |
|
|
|
|
|
|
|
|
@ -215,7 +215,7 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl<ZyProductPlanMapp |
|
|
|
|
List<SysUser> sysUserList = iSysUserService.getUserByDepIds(sysDepartIds, null); |
|
|
|
|
//车间负责人
|
|
|
|
|
zyProductPlan.setResponsiblePerson(sysUserList.get(0).getUsername()); |
|
|
|
|
Groupx groupx = iGroupxService.getOne(new LambdaQueryWrapper<Groupx>().eq(Groupx::getDepartId, sysDepart.getId()).eq(Groupx::getGroupName, "测试班组")); |
|
|
|
|
Groupx groupx = iGroupxService.getOne(new LambdaQueryWrapper<Groupx>().eq(Groupx::getDepartId, sysDepart.getId()).eq(Groupx::getGroupName, "生产一组")); |
|
|
|
|
if (ObjectUtils.isEmpty(groupx)) throw new JeecgBootException("生产计划自动化-mock-[班组]数据异常!"); |
|
|
|
|
//班组
|
|
|
|
|
zyProductPlan.setTeamId(groupx.getId()); |
|
|
|
@ -284,9 +284,10 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl<ZyProductPlanMapp |
|
|
|
|
if (ObjectUtils.isEmpty(workOrderList)) return Collections.EMPTY_LIST; |
|
|
|
|
|
|
|
|
|
//2,保存生产计划
|
|
|
|
|
List<ZyProductPlan> productPlanList = this.saveProductPlan(workOrderList); |
|
|
|
|
//TODO
|
|
|
|
|
// List<ZyProductPlan> productPlanList = this.saveProductPlan4Mock(workOrderList);
|
|
|
|
|
// List<ZyProductPlan> productPlanList = this.saveProductPlan(workOrderList);
|
|
|
|
|
//TODO
|
|
|
|
|
List<ZyProductPlan> productPlanList = this.saveProductPlan4Mock(workOrderList); |
|
|
|
|
if (ObjectUtils.isEmpty(productPlanList)) return Collections.EMPTY_LIST; |
|
|
|
|
|
|
|
|
|
//3,同步计划生产工序、同步生产计划工序面料、同步生产计划辅料
|
|
|
|
@ -302,21 +303,21 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl<ZyProductPlanMapp |
|
|
|
|
List<Map<String, List<ZyPlanProcess>>> returnList = new LinkedList<>(); |
|
|
|
|
productPlanList.stream().forEach(k -> { |
|
|
|
|
//TODO 数据不完整,测试时注释
|
|
|
|
|
// boolean b = this.filling4Auto(k.getId());
|
|
|
|
|
// if (b) {
|
|
|
|
|
List<ZyPlanProcess> planProcessList = zyPlanProcessService.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, k.getId())); |
|
|
|
|
Optional.ofNullable(planProcessList).orElse(new LinkedList<>()).forEach(e -> { |
|
|
|
|
// 5,生成物料单
|
|
|
|
|
zyPlanProcessService.createMaterialBill(e); |
|
|
|
|
// 5,发送到仓库
|
|
|
|
|
zyPlanProcessService.sendToRepository(e); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
Map<String, List<ZyPlanProcess>> map = new HashMap<>(); |
|
|
|
|
map.put(k.getProductCode(), planProcessList); |
|
|
|
|
//测试需要返回生产计划工序
|
|
|
|
|
returnList.add(map); |
|
|
|
|
boolean b = this.filling4Auto(k.getId()); |
|
|
|
|
if (b) { |
|
|
|
|
List<ZyPlanProcess> planProcessList = zyPlanProcessService.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, k.getId())); |
|
|
|
|
Optional.ofNullable(planProcessList).orElse(new LinkedList<>()).forEach(e -> { |
|
|
|
|
// 5,生成物料单
|
|
|
|
|
zyPlanProcessService.createMaterialBill(e); |
|
|
|
|
// 5,发送到仓库
|
|
|
|
|
zyPlanProcessService.sendToRepository(e); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
Map<String, List<ZyPlanProcess>> map = new HashMap<>(); |
|
|
|
|
map.put(k.getProductCode(), planProcessList); |
|
|
|
|
//测试需要返回生产计划工序
|
|
|
|
|
returnList.add(map); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return returnList; |
|
|
|
|
} |
|
|
|
|