|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.jeecg.common.exception.JeecgBootException; |
|
|
|
import org.jeecg.common.exception.JeecgBootException; |
|
|
|
|
|
|
|
import org.jeecg.modules.demo.base.entity.ZyProcess; |
|
|
|
import org.jeecg.modules.demo.base.service.IZyProcessService; |
|
|
|
import org.jeecg.modules.demo.base.service.IZyProcessService; |
|
|
|
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; |
|
|
|
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; |
|
|
|
import org.jeecg.modules.demo.ordergoods.service.IOrderGoodsService; |
|
|
|
import org.jeecg.modules.demo.ordergoods.service.IOrderGoodsService; |
|
|
@ -16,6 +17,7 @@ import org.jeecg.modules.productplan.entity.ZyPlanProcess; |
|
|
|
import org.jeecg.modules.productplan.entity.ZyProductPlan; |
|
|
|
import org.jeecg.modules.productplan.entity.ZyProductPlan; |
|
|
|
import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo; |
|
|
|
import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo; |
|
|
|
import org.jeecg.modules.productplan.entity.vo.ProcessDataVo; |
|
|
|
import org.jeecg.modules.productplan.entity.vo.ProcessDataVo; |
|
|
|
|
|
|
|
import org.jeecg.modules.productplan.enums.ProductPlanStatusEnum; |
|
|
|
import org.jeecg.modules.productplan.mapper.ZyPlanProcessMapper; |
|
|
|
import org.jeecg.modules.productplan.mapper.ZyPlanProcessMapper; |
|
|
|
import org.jeecg.modules.productplan.service.IZyPlanProcessService; |
|
|
|
import org.jeecg.modules.productplan.service.IZyPlanProcessService; |
|
|
|
import org.jeecg.modules.productplan.service.IZyProductPlanService; |
|
|
|
import org.jeecg.modules.productplan.service.IZyProductPlanService; |
|
|
@ -99,7 +101,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z |
|
|
|
//生产计划id
|
|
|
|
//生产计划id
|
|
|
|
String planId = zyPlanProcess.getPlanId(); |
|
|
|
String planId = zyPlanProcess.getPlanId(); |
|
|
|
ZyProductPlan zyProductPlan = iZyProductPlanService.getById(planId); |
|
|
|
ZyProductPlan zyProductPlan = iZyProductPlanService.getById(planId); |
|
|
|
if (ObjectUtils.isEmpty(zyPlanProcess)) { |
|
|
|
if (ObjectUtils.isEmpty(zyProductPlan)) { |
|
|
|
throw new JeecgBootException("生产计划不存在!"); |
|
|
|
throw new JeecgBootException("生产计划不存在!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -110,27 +112,8 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z |
|
|
|
if (ObjectUtils.isEmpty(zyProduct)) { |
|
|
|
if (ObjectUtils.isEmpty(zyProduct)) { |
|
|
|
throw new JeecgBootException("产品不存在!"); |
|
|
|
throw new JeecgBootException("产品不存在!"); |
|
|
|
} |
|
|
|
} |
|
|
|
List<ProcessDataVo> result = new LinkedList<>(); |
|
|
|
|
|
|
|
List<ZyPlanProcess> planProcessList = this.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, planId)); |
|
|
|
List<ZyPlanProcess> planProcessList = this.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, planId)); |
|
|
|
//生产计划工序表没有对应工序时,说明没有制定过该产品的生产工序计划,先把该产品对应的基本工序数据插入到生产计划工序表
|
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(planProcessList)) { |
|
|
|
|
|
|
|
List<ZyProductProcess> productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper<ZyProductProcess>().eq(ZyProductProcess::getProductId, zyProduct.getId())); |
|
|
|
|
|
|
|
if (!ObjectUtils.isEmpty(planProcessList)) { |
|
|
|
|
|
|
|
List<ZyPlanProcess> saveList = new LinkedList<>(); |
|
|
|
|
|
|
|
productProcessesList.forEach(o -> { |
|
|
|
|
|
|
|
ZyPlanProcess en = new ZyPlanProcess(); |
|
|
|
|
|
|
|
en.setProcessId(o.getProcessId()); |
|
|
|
|
|
|
|
en.setPlanId(planId); |
|
|
|
|
|
|
|
saveList.add(en); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.saveBatch(saveList); |
|
|
|
|
|
|
|
//重新查询已录入工序数据
|
|
|
|
|
|
|
|
planProcessList = this.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, planId)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!ObjectUtils.isEmpty(planProcessList)) { |
|
|
|
if (!ObjectUtils.isEmpty(planProcessList)) { |
|
|
|
SysDepart depart = iSysDepartService.getById(departId); |
|
|
|
|
|
|
|
List<Station> stationList = iStationService.list(new LambdaQueryWrapper<Station>().eq(Station::getDepartId, departId)); |
|
|
|
List<Station> stationList = iStationService.list(new LambdaQueryWrapper<Station>().eq(Station::getDepartId, departId)); |
|
|
|
List<StationVo> stationVoList = new LinkedList<>(); |
|
|
|
List<StationVo> stationVoList = new LinkedList<>(); |
|
|
|
if (!ObjectUtils.isEmpty(stationList)) { |
|
|
|
if (!ObjectUtils.isEmpty(stationList)) { |
|
|
@ -143,25 +126,51 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z |
|
|
|
stationVoList.add(stationVo); |
|
|
|
stationVoList.add(stationVo); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!ObjectUtils.isEmpty(planProcessList)) { |
|
|
|
planProcessList.forEach(e -> { |
|
|
|
planProcessList.forEach(e -> { |
|
|
|
// ProcessDataVo vo = new ProcessDataVo();
|
|
|
|
e.setStationIdList(stationVoList); |
|
|
|
// vo.setId(e.getId());
|
|
|
|
|
|
|
|
// vo.setPlanId(planId);
|
|
|
|
|
|
|
|
// vo.setProcessId(e.getProcessId());
|
|
|
|
|
|
|
|
// e.setProcessName(iZyProcessService.getById(e.getProcessId()).getProcessName());
|
|
|
|
|
|
|
|
// vo.setProductName("产品名称");
|
|
|
|
|
|
|
|
// vo.setWorkOrderId(workOrderId);
|
|
|
|
|
|
|
|
// vo.setDepartId(departId);
|
|
|
|
|
|
|
|
// vo.setDepartName(depart.getDepartName());
|
|
|
|
|
|
|
|
// vo.setStationList(stationVoList);
|
|
|
|
|
|
|
|
// vo.setStationId(stationVoList);
|
|
|
|
|
|
|
|
// e.setStationIdList(stationVoList);
|
|
|
|
|
|
|
|
// result.add(vo);
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return planProcessList; |
|
|
|
return planProcessList; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public List<ZyPlanProcess> syncProductBaseProcess(ZyPlanProcess zyPlanProcess) { |
|
|
|
|
|
|
|
List<ZyPlanProcess> planProcessList = this.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, zyPlanProcess.getPlanId())); |
|
|
|
|
|
|
|
//生产计划工序表没有对应工序时,说明没有制定过该产品的生产工序计划,先把该产品对应的基本工序数据插入到生产计划工序表
|
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(planProcessList)) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ZyProductPlan zyProductPlan = iZyProductPlanService.getById(zyPlanProcess.getPlanId()); |
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(zyProductPlan)) { |
|
|
|
|
|
|
|
throw new JeecgBootException(zyProductPlan.getId() + "生产计划不存在"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
ZyProduct zyProduct = iZyProductService.getOne(new LambdaQueryWrapper<ZyProduct>() |
|
|
|
|
|
|
|
.eq(ZyProduct::getWorkOrderId, zyProductPlan.getProductCode()) |
|
|
|
|
|
|
|
.eq(ZyProduct::getProductCode, zyProductPlan.getProductNo())); |
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(zyProduct)) { |
|
|
|
|
|
|
|
throw new JeecgBootException(zyProductPlan.getProductNo() + "产品不存在"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ZyProductProcess> productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper<ZyProductProcess>() |
|
|
|
|
|
|
|
.eq(ZyProductProcess::getProductId, zyProduct.getId())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!ObjectUtils.isEmpty(productProcessesList)) { |
|
|
|
|
|
|
|
List<ZyPlanProcess> saveList = new LinkedList<>(); |
|
|
|
|
|
|
|
productProcessesList.forEach(o -> { |
|
|
|
|
|
|
|
ZyPlanProcess en = new ZyPlanProcess(); |
|
|
|
|
|
|
|
en.setProcessId(o.getProcessId()); |
|
|
|
|
|
|
|
ZyProcess zyProcess = iZyProcessService.getById(o.getProcessId()); |
|
|
|
|
|
|
|
en.setProcessName(zyProcess.getProcessName()); |
|
|
|
|
|
|
|
en.setPlanId(zyPlanProcess.getPlanId()); |
|
|
|
|
|
|
|
saveList.add(en); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.saveBatch(saveList); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Map<String, Object> getPlanInfo(ZyPlanProcess planProcess) { |
|
|
|
public Map<String, Object> getPlanInfo(ZyPlanProcess planProcess) { |
|
|
|
//生产计划id
|
|
|
|
//生产计划id
|
|
|
@ -178,8 +187,6 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z |
|
|
|
if (ObjectUtils.isEmpty(zyProduct)) { |
|
|
|
if (ObjectUtils.isEmpty(zyProduct)) { |
|
|
|
throw new JeecgBootException("产品不存在!"); |
|
|
|
throw new JeecgBootException("产品不存在!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 工单信息
|
|
|
|
// 工单信息
|
|
|
|
WorkOrder workOrder = iWorkOrderService.getOne(new LambdaQueryWrapper<WorkOrder>().eq(WorkOrder::getProductCode, zyProductPlan.getProductCode())); |
|
|
|
WorkOrder workOrder = iWorkOrderService.getOne(new LambdaQueryWrapper<WorkOrder>().eq(WorkOrder::getProductCode, zyProductPlan.getProductCode())); |
|
|
|
if (ObjectUtils.isEmpty(workOrder)) |
|
|
|
if (ObjectUtils.isEmpty(workOrder)) |
|
|
@ -193,27 +200,35 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z |
|
|
|
ZyOrders zyOrders = iZyOrdersService.getOne(new LambdaQueryWrapper<ZyOrders>().eq(ZyOrders::getId, ordersId)); |
|
|
|
ZyOrders zyOrders = iZyOrdersService.getOne(new LambdaQueryWrapper<ZyOrders>().eq(ZyOrders::getId, ordersId)); |
|
|
|
if (ObjectUtils.isEmpty(zyOrders)) throw new JeecgBootException(ordersId + "订单信息不存在"); |
|
|
|
if (ObjectUtils.isEmpty(zyOrders)) throw new JeecgBootException(ordersId + "订单信息不存在"); |
|
|
|
|
|
|
|
|
|
|
|
// ZyClothsStyle zyClothsStyle = iZyClothsStyleService.getById(orderGoods.getStyleId());
|
|
|
|
|
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
|
|
|
|
result.put("productCode", zyProduct.getProductCode()); |
|
|
|
result.put("productName", zyProduct.getProductName()); |
|
|
|
result.put("productName", zyProduct.getProductName()); |
|
|
|
result.put("productOrg", zyProductPlan.getProductOrg()); |
|
|
|
result.put("productOrg", zyProductPlan.getProductOrg()); |
|
|
|
result.put("productName", zyProductPlan.getProductName()); |
|
|
|
result.put("productName", zyProductPlan.getProductName()); |
|
|
|
result.put("productNo", zyProductPlan.getProductNo()); |
|
|
|
result.put("productNo", zyProductPlan.getProductNo()); |
|
|
|
SysDepart depart = iSysDepartService.getById(departId); |
|
|
|
SysDepart depart = iSysDepartService.getById(departId); |
|
|
|
Groupx groupx = iGroupxService.getById(zyProductPlan.getTeamId()); |
|
|
|
Groupx groupx = iGroupxService.getById(zyProductPlan.getTeamId()); |
|
|
|
result.put("Workshop", depart.getDepartName()); |
|
|
|
result.put("workshop", depart.getDepartName()); |
|
|
|
result.put("team", groupx.getGroupName()); |
|
|
|
result.put("team", groupx.getGroupName()); |
|
|
|
result.put("teamLade", groupx.getEnterprisesManager()); |
|
|
|
result.put("teamLade", iSysUserService.getById(groupx.getEnterprisesManager()).getRealname()); |
|
|
|
result.put("productType", groupx.getEnterprisesManager()); |
|
|
|
result.put("productType", groupx.getEnterprisesManager()); |
|
|
|
result.put("workTime", zyProductPlan.getWorkTime()); |
|
|
|
result.put("workTime", zyProductPlan.getWorkTime()); |
|
|
|
result.put("duration", zyProductPlan.getDuration()); |
|
|
|
result.put("duration", zyProductPlan.getDuration()); |
|
|
|
result.put("speedUp", zyProductPlan.getSpeedUp()); |
|
|
|
if ("0".equals(zyProductPlan.getSpeedUp())) { |
|
|
|
|
|
|
|
result.put("speedUp", "否"); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
result.put("speedUp", "是"); |
|
|
|
|
|
|
|
} |
|
|
|
result.put("orderTime", zyOrders.getOrderTime()); |
|
|
|
result.put("orderTime", zyOrders.getOrderTime()); |
|
|
|
SysDepart depart1 = iSysDepartService.getById(zyOrders.getSalesEnterpriseId()); |
|
|
|
SysDepart depart1 = iSysDepartService.getById(zyOrders.getSalesEnterpriseId()); |
|
|
|
//销售门店
|
|
|
|
//销售门店
|
|
|
|
result.put("salesEnterprise", depart1.getDepartName()); |
|
|
|
result.put("salesEnterprise", depart1.getDepartName()); |
|
|
|
result.put("auditBy", zyProductPlan.getAuditBy()); |
|
|
|
SysUser sysUser = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUsername, zyProductPlan.getAuditBy())); |
|
|
|
|
|
|
|
result.put("auditBy", sysUser.getRealname()); |
|
|
|
|
|
|
|
result.put("status", ProductPlanStatusEnum.getValueByCode(zyProductPlan.getStatus().toString())); |
|
|
|
result.put("auditTimr", zyProductPlan.getAuditTimr()); |
|
|
|
result.put("auditTimr", zyProductPlan.getAuditTimr()); |
|
|
|
|
|
|
|
ZyClothsStyle zyClothsStyle = iZyClothsStyleService.getById(orderGoods.getStyleId()); |
|
|
|
|
|
|
|
result.put("productType", zyClothsStyle.getStyleNames()); |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|