|
|
@ -11,6 +11,8 @@ import org.jeecg.modules.demo.accessories.entity.ZyAccessories; |
|
|
|
import org.jeecg.modules.demo.accessories.service.IZyAccessoriesService; |
|
|
|
import org.jeecg.modules.demo.accessories.service.IZyAccessoriesService; |
|
|
|
import org.jeecg.modules.demo.base.entity.ZyProcess; |
|
|
|
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.delivery.entity.Delivery; |
|
|
|
|
|
|
|
import org.jeecg.modules.demo.delivery.service.IDeliveryService; |
|
|
|
import org.jeecg.modules.demo.fabric.entity.ZyFabric; |
|
|
|
import org.jeecg.modules.demo.fabric.entity.ZyFabric; |
|
|
|
import org.jeecg.modules.demo.fabric.service.IZyFabricService; |
|
|
|
import org.jeecg.modules.demo.fabric.service.IZyFabricService; |
|
|
|
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; |
|
|
|
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; |
|
|
@ -146,6 +148,9 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private IZyPlanAccessoriesService iZyPlanAccessoriesService; |
|
|
|
private IZyPlanAccessoriesService iZyPlanAccessoriesService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private IDeliveryService iDeliveryService; |
|
|
|
|
|
|
|
|
|
|
|
public List<ZyPlanProcess> getProcessDatalist(ZyPlanProcess zyPlanProcess) { |
|
|
|
public List<ZyPlanProcess> getProcessDatalist(ZyPlanProcess zyPlanProcess) { |
|
|
|
//生产计划id
|
|
|
|
//生产计划id
|
|
|
|
String planId = zyPlanProcess.getPlanId(); |
|
|
|
String planId = zyPlanProcess.getPlanId(); |
|
|
@ -508,6 +513,56 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void sendToRepository(ZyPlanProcess zyPlanProcess) { |
|
|
|
|
|
|
|
String planId = zyPlanProcess.getPlanId(); |
|
|
|
|
|
|
|
ZyProductPlan zyProductPlan = iZyProductPlanService.getById(planId); |
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(zyProductPlan)) { |
|
|
|
|
|
|
|
throw new JeecgBootException("生产计划不存在!"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ZyPlanFabric> fabricList = iZyPlanFabricService.list(new LambdaQueryWrapper<ZyPlanFabric>() |
|
|
|
|
|
|
|
.eq(ZyPlanFabric::getPlanId, zyPlanProcess.getPlanId())); |
|
|
|
|
|
|
|
List<Delivery> deliveryList4Fabric = new LinkedList<>(); |
|
|
|
|
|
|
|
Optional.ofNullable(fabricList).orElse(new LinkedList<>()).forEach(e -> { |
|
|
|
|
|
|
|
Delivery delivery = new Delivery(); |
|
|
|
|
|
|
|
delivery.setDeliveryReason("0"); |
|
|
|
|
|
|
|
delivery.setDeliveryTime(new Date()); |
|
|
|
|
|
|
|
delivery.setItemType("0"); |
|
|
|
|
|
|
|
delivery.setAmount(e.getAmount().doubleValue()); |
|
|
|
|
|
|
|
delivery.setCarrierId("admin"); |
|
|
|
|
|
|
|
delivery.setAdminId("admin"); |
|
|
|
|
|
|
|
delivery.setStorehouseId("TODO"); |
|
|
|
|
|
|
|
ZyFabric zyFabric = iZyFabricService.getById(e.getFabricId()); |
|
|
|
|
|
|
|
if (!ObjectUtils.isEmpty(zyFabric)) { |
|
|
|
|
|
|
|
delivery.setItemCode(zyFabric.getFabricNumber()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
deliveryList4Fabric.add(delivery); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
iDeliveryService.saveBatch(deliveryList4Fabric); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ZyPlanAccessories> accessoriesList = iZyPlanAccessoriesService.list(new LambdaQueryWrapper<ZyPlanAccessories>() |
|
|
|
|
|
|
|
.eq(ZyPlanAccessories::getPlanId, zyPlanProcess.getPlanId())); |
|
|
|
|
|
|
|
List<Delivery> deliveryList4accessories = new LinkedList<>(); |
|
|
|
|
|
|
|
Optional.ofNullable(accessoriesList).orElse(new LinkedList<>()).forEach(e -> { |
|
|
|
|
|
|
|
Delivery delivery2 = new Delivery(); |
|
|
|
|
|
|
|
delivery2.setDeliveryReason("0"); |
|
|
|
|
|
|
|
delivery2.setDeliveryTime(new Date()); |
|
|
|
|
|
|
|
delivery2.setItemType("1"); |
|
|
|
|
|
|
|
delivery2.setAmount(e.getAmount().doubleValue()); |
|
|
|
|
|
|
|
delivery2.setCarrierId("admin"); |
|
|
|
|
|
|
|
delivery2.setAdminId("admin"); |
|
|
|
|
|
|
|
delivery2.setStorehouseId("TODO"); |
|
|
|
|
|
|
|
ZyAccessories zyAccessories = iZyAccessoriesService.getById(e.getAccessoriesId()); |
|
|
|
|
|
|
|
if (!ObjectUtils.isEmpty(zyAccessories)) { |
|
|
|
|
|
|
|
delivery2.setItemCode(zyAccessories.getNums()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
deliveryList4accessories.add(delivery2); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
iDeliveryService.saveBatch(deliveryList4accessories); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Map<String, Object> getWuLiaoDetail(ZyPlanProcess zyPlanProcess) { |
|
|
|
public Map<String, Object> getWuLiaoDetail(ZyPlanProcess zyPlanProcess) { |
|
|
|
String planId = zyPlanProcess.getPlanId(); |
|
|
|
String planId = zyPlanProcess.getPlanId(); |
|
|
|