@ -17,6 +17,8 @@ import org.jeecg.modules.demo.ordergoodsfabric.entity.OrderGoodsFabric;
import org.jeecg.modules.demo.ordergoodsfabric.mapper.OrderGoodsFabricMapper ;
import org.jeecg.modules.demo.ordergoodsmodule.entity.OrderGoodsModule ;
import org.jeecg.modules.demo.ordergoodsmodule.mapper.OrderGoodsModuleMapper ;
import org.jeecg.modules.demo.pro.entity.ZyProcessAccessories ;
import org.jeecg.modules.demo.pro.entity.ZyProcessFabric ;
import org.jeecg.modules.demo.pro.entity.ZyProcessMachine ;
import org.jeecg.modules.demo.pro.mapper.ZyProcessMachineMapper ;
import org.jeecg.modules.demo.zyStyleModular.entity.ZyStyleModular ;
@ -37,6 +39,10 @@ import org.jeecg.modules.product.productModule.entity.ProductModule;
import org.jeecg.modules.product.productModule.mapper.ProductModuleMapper ;
import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess ;
import org.jeecg.modules.product.zyproductprocess.mapper.ZyProductProcessMapper ;
import org.jeecg.modules.productprocessaccessories.entity.ProductProcessAccessories ;
import org.jeecg.modules.productprocessaccessories.mapper.ProductProcessAccessoriesMapper ;
import org.jeecg.modules.productprocessfabric.entity.ProductProcessFabric ;
import org.jeecg.modules.productprocessfabric.mapper.ProductProcessFabricMapper ;
import org.jeecg.modules.workorder.entity.WorkOrder ;
import org.jeecg.modules.workorder.entity.WorkOrderVo ;
import org.jeecg.modules.workorder.mapper.WorkOrderMapper ;
@ -143,8 +149,10 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
//产品辅料表
@Autowired
private ProductAccessoriesMapper productAccessoriesMapper ;
//产品工序面料
private ProductProcessFabricMapper productProcessFabricMapper ;
//产品工序辅料
private ProductProcessAccessoriesMapper productProcessAccessoriesMapper ;
/ * *
* 自定义分页查询
@ -269,6 +277,32 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
zpp . setNumber ( item . getSerialnumber ( ) ) ; //序号
productProcessMapper . insert ( zpp ) ; //保存
//首先查询到对应的产品工序id,由于产品和工序对应应该唯一
String productprocessId = productProcessMapper . findProductProcessId ( zpp . getProductId ( ) , zpp . getProcessId ( ) ) ;
//然后根据对应的工序id去基本工序关联的辅料和面料表中找到对应的数据
//面料
List < ZyProcessFabric > listFabric = productProcessMapper . findFabric ( zpp . getProcessId ( ) ) ;
//辅料
List < ZyProcessAccessories > listAccessories = productProcessMapper . findAccessories ( zpp . getProcessId ( ) ) ;
//然后将产品工序id和辅料面料绑定
//产品工序面料
for ( ZyProcessFabric zyProcessFabric : listFabric ) {
ProductProcessFabric fabric = new ProductProcessFabric ( ) ;
fabric . setFabricId ( zyProcessFabric . getFabricId ( ) ) ;
fabric . setAmount ( zyProcessFabric . getAmount ( ) ) ;
fabric . setProductProcessId ( productprocessId ) ;
fabric . setId ( null ) ;
productProcessFabricMapper . insert ( fabric ) ;
}
//产品工序辅料
for ( ZyProcessAccessories listAccessory : listAccessories ) {
ProductProcessAccessories accessories = new ProductProcessAccessories ( ) ;
accessories . setAccessoriesId ( listAccessory . getAccessoriesId ( ) ) ;
accessories . setAmount ( listAccessory . getAmount ( ) ) ;
accessories . setProductProcessId ( productprocessId ) ;
accessories . setId ( null ) ;
productProcessAccessoriesMapper . insert ( accessories ) ;
}
//ZyProcess =processMapper.selectById(item.getProcessId());
//region 获取工序工具