2023-2-22产品工序面料辅料

zhc4dev
lenovo 2 years ago
parent b8f10f894a
commit 29056a3259
  1. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessAccessories.java
  2. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessFabric.java
  3. 11
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/mapper/ZyProductProcessMapper.java
  4. 38
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/impl/WorkOrderServiceImpl.java

@ -67,7 +67,7 @@ public class ZyProcessAccessories implements Serializable {
private String accessoriesId; private String accessoriesId;
@ApiModelProperty(value = "用量") @ApiModelProperty(value = "用量")
private String amount; private Double amount;
@TableField(exist = false) @TableField(exist = false)
private String processCode; private String processCode;
@TableField(exist = false) @TableField(exist = false)

@ -51,7 +51,7 @@ public class ZyProcessFabric implements Serializable {
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date createTime; private Date createTime;
@ApiModelProperty(value = "用量") @ApiModelProperty(value = "用量")
private String amount; private Double amount;
@TableField(exist = false) @TableField(exist = false)
private String processCode; private String processCode;
@TableField(exist = false) @TableField(exist = false)

@ -9,6 +9,8 @@ import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
import org.jeecg.modules.demo.pro.entity.ZyProcessAccessories;
import org.jeecg.modules.demo.pro.entity.ZyProcessFabric;
import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess; import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess;
/** /**
@ -44,4 +46,13 @@ public interface ZyProductProcessMapper extends BaseMapper<ZyProductProcess> {
//按照number降序排列,通过产品id筛选,然后通过processId和processCode筛选 //按照number降序排列,通过产品id筛选,然后通过processId和processCode筛选
@Select("<script>select c.*,a.process_code,b.product_code from zy_process as a,zy_product as b,zy_product_process as c where b.id=c.product_id and c.product_id=#{productId} and c.process_id=a.id and c.process_id in (select id from zy_process <where><if test=\" process != null\">process_name like #{process}</if><if test=\" code != null\">and process_code like #{code}</if></where>) order by number desc</script>") @Select("<script>select c.*,a.process_code,b.product_code from zy_process as a,zy_product as b,zy_product_process as c where b.id=c.product_id and c.product_id=#{productId} and c.process_id=a.id and c.process_id in (select id from zy_process <where><if test=\" process != null\">process_name like #{process}</if><if test=\" code != null\">and process_code like #{code}</if></where>) order by number desc</script>")
IPage<ZyProductProcess> page1(Page<ZyProductProcess> page, @Param("productId") String productId, @Param("process") String processId, @Param("code") String processCode); IPage<ZyProductProcess> page1(Page<ZyProductProcess> page, @Param("productId") String productId, @Param("process") String processId, @Param("code") String processCode);
@Select("select id from zy_product_process where product_id=#{productId} and process_id=#{processId}")
String findProductProcessId(@Param("productId") String productId, @Param("processId") String processId);
//工序面料的全部信息
@Select("select * from zy_process_fabric where process_id =#{processId}")
List<ZyProcessFabric> findFabric(String processId);
//工序辅料的全部信息
@Select("select * from zy_process_accessories where process_id =#{processId}")
List<ZyProcessAccessories> findAccessories(String processId);
} }

@ -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.ordergoodsfabric.mapper.OrderGoodsFabricMapper;
import org.jeecg.modules.demo.ordergoodsmodule.entity.OrderGoodsModule; import org.jeecg.modules.demo.ordergoodsmodule.entity.OrderGoodsModule;
import org.jeecg.modules.demo.ordergoodsmodule.mapper.OrderGoodsModuleMapper; 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.entity.ZyProcessMachine;
import org.jeecg.modules.demo.pro.mapper.ZyProcessMachineMapper; import org.jeecg.modules.demo.pro.mapper.ZyProcessMachineMapper;
import org.jeecg.modules.demo.zyStyleModular.entity.ZyStyleModular; 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.productModule.mapper.ProductModuleMapper;
import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess; import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess;
import org.jeecg.modules.product.zyproductprocess.mapper.ZyProductProcessMapper; 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.WorkOrder;
import org.jeecg.modules.workorder.entity.WorkOrderVo; import org.jeecg.modules.workorder.entity.WorkOrderVo;
import org.jeecg.modules.workorder.mapper.WorkOrderMapper; import org.jeecg.modules.workorder.mapper.WorkOrderMapper;
@ -143,8 +149,10 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
//产品辅料表 //产品辅料表
@Autowired @Autowired
private ProductAccessoriesMapper productAccessoriesMapper; private ProductAccessoriesMapper productAccessoriesMapper;
//产品工序面料
private ProductProcessFabricMapper productProcessFabricMapper;
//产品工序辅料
private ProductProcessAccessoriesMapper productProcessAccessoriesMapper;
/** /**
* 自定义分页查询 * 自定义分页查询
@ -269,6 +277,32 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
zpp.setNumber(item.getSerialnumber());//序号 zpp.setNumber(item.getSerialnumber());//序号
productProcessMapper.insert(zpp);//保存 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()); //ZyProcess =processMapper.selectById(item.getProcessId());
//region 获取工序工具 //region 获取工序工具

Loading…
Cancel
Save