Quellcode durchsuchen

Merge remote-tracking branch 'origin/master' into master

yejian016332 vor 3 Jahren
Ursprung
Commit
3f8a3e2884

+ 28 - 11
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionReadyCenter/service/impl/BomProcedureVersionServiceImpl.java

@@ -95,6 +95,9 @@ public class BomProcedureVersionServiceImpl extends SuperServiceImpl<BomProcedur
     @Autowired
     private BomProcedureService procedureService;
 
+    @Autowired
+    private BBomService bomService;
+
 
     @Override
     public Map<String, Object> pageList(Map<String, Object> map) {
@@ -384,6 +387,8 @@ public class BomProcedureVersionServiceImpl extends SuperServiceImpl<BomProcedur
     @Override
     @Transactional(rollbackFor = Exception.class)
     public BomProcedureVersion saveProcessAnalysis(BomProcedureVersion bean) {
+        BBom bBom = bomService.getById(bean.getBomId());
+
         //1.新增可执行设备,因可执行设备对应设置自动化节点,所以不能直接删除
         //查询当前程序下的设备
         List<BomProcedureProductionresource> prList = bomProcedureProductionresourceService.list(Wraps.<BomProcedureProductionresource>lbQ().eq(BomProcedureProductionresource::getProcedureId,bean.getId()));
@@ -430,17 +435,29 @@ public class BomProcedureVersionServiceImpl extends SuperServiceImpl<BomProcedur
         //先删除原材料
         bomProcedureMeterialService.remove(Wraps.<BomProcedureMeterial>lbQ().eq(BomProcedureMeterial::getProcedureId,bean.getId()));
         //2.新增所需原材料
-        if("3".equals(bean.getMeterialConf())){
-            List<BomProcedureMeterial> meterialList = bean.getMeterialList();
-            if(meterialList != null && meterialList.size() > 0){
-                List<BomProcedureMeterial> mList = meterialList.stream().map((map) -> {
-                    BomProcedureMeterial item = new BomProcedureMeterial();
-                    BeanUtil.copyProperties(map, item);
-                    item.setProcedureId(bean.getId());
-                    item.setId(null);
-                    return item;
-                }).collect(Collectors.toList());
-                bomProcedureMeterialService.saveBatch(mList);
+//        if("3".equals(bean.getMeterialConf())){
+//            List<BomProcedureMeterial> meterialList = bean.getMeterialList();
+//            if(meterialList != null && meterialList.size() > 0){
+//                List<BomProcedureMeterial> mList = meterialList.stream().map((map) -> {
+//                    BomProcedureMeterial item = new BomProcedureMeterial();
+//                    BeanUtil.copyProperties(map, item);
+//                    item.setProcedureId(bean.getId());
+//                    item.setId(null);
+//                    return item;
+//                }).collect(Collectors.toList());
+//                bomProcedureMeterialService.saveBatch(mList);
+//            }
+//        }
+
+        //2.原材料的从bom表中获的
+        if(1==1){
+            bean.setMeterialConf("3");//需要原材料
+
+            if(bBom!=null&&bBom.getMeterialId()!=null){
+                BomProcedureMeterial bomProcedureMeterial = new BomProcedureMeterial();
+                bomProcedureMeterial.setMeterialId(bBom.getMeterialId());
+                bomProcedureMeterial.setProcedureId(bean.getId());
+                bomProcedureMeterialService.save(bomProcedureMeterial);
             }
         }
 

+ 5 - 2
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/productionResourceCenter/ZZoneMapper.xml

@@ -9,6 +9,8 @@
         <result column="create_user" jdbcType="BIGINT" property="createUser"/>
         <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
         <result column="update_user" jdbcType="BIGINT" property="updateUser"/>
+        <result column="run_mode" jdbcType="VARCHAR" property="runMode"/>
+        <result column="layout_map" jdbcType="VARCHAR" property="layoutMap"/>
         <result column="no" jdbcType="VARCHAR" property="no"/>
         <result column="name" jdbcType="VARCHAR" property="name"/>
         <result column="remark" jdbcType="VARCHAR" property="remark"/>
@@ -16,14 +18,14 @@
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id,no, name,remark,status,run_mode,create_time,create_user,update_time,update_user,productionResourceName,productionResourceCount,createUserName,org_id
+        id,no, name,remark,status,run_mode,layout_map,img_url,create_time,create_user,update_time,update_user,productionResourceName,productionResourceCount,createUserName,org_id
     </sql>
 
     <select id="findPage" resultMap="BaseResultMap">
         select
         <include refid="Base_Column_List"/>
         from (SELECT
-        z.*,productionResourceName,a.productionResourceCount, u.name as createUserName,u.org_id
+        z.*,productionResourceName,a.productionResourceCount, u.name as createUserName,u.org_id,f.url as img_url
         FROM
         imcs_z_zone z
         LEFT JOIN (
@@ -38,6 +40,7 @@
         zp.zone_id
         ) a ON z.id = a.zone_id
         LEFT JOIN c_auth_user u ON u.id = z.create_user
+        LEFT JOIN f_attachment f ON z.layout_map = f.id
         ) s ${ew.customSqlSegment}
     </select>
 

+ 8 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/dto/ZZonePageDTO.java

@@ -1,6 +1,8 @@
 package com.github.zuihou.business.productionResourceCenter.dto;
 
 import java.time.LocalDateTime;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -22,6 +24,8 @@ import lombok.experimental.Accessors;
 import com.github.zuihou.common.constant.DictionaryType;
 import java.io.Serializable;
 
+import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;
+
 /**
  * <p>
  * 实体类
@@ -62,6 +66,10 @@ public class ZZonePageDTO implements Serializable {
     @Length(max = 512, message = "备注长度不能超过512")
     private String remark;
 
+    @ApiModelProperty(value = "布局图")
+    @Length(max = 255, message = "布局图长度不能超过255")
+    private String layoutMap;
+
     /**
      * 状态(1-启用0-停用)
      */

+ 4 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/dto/ZZoneSaveDTO.java

@@ -68,4 +68,8 @@ public class ZZoneSaveDTO implements Serializable {
     @Length(max = 4, message = "状态(1-启用0-停用)长度不能超过4")
     private String status;
 
+    @ApiModelProperty(value = "布局图")
+    @Length(max = 255, message = "布局图长度不能超过255")
+    private String layoutMap;
+
 }

+ 3 - 2
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/dto/ZZoneUpdateDTO.java

@@ -82,10 +82,11 @@ public class ZZoneUpdateDTO implements Serializable {
      */
     @ApiModelProperty(value = "运行模式(1-自动模式2-手动模式3-半自动模式)")
     @Length(max = 4, message = "运行模式(1-自动模式2-手动模式3-半自动模式)长度不能超过4")
-    @TableField(value = "run_mode", condition = LIKE)
-    @Excel(name = "运行模式(1-自动模式2-手动模式3-半自动模式)")
     private String runMode;
 
+    @ApiModelProperty(value = "布局图")
+    @Length(max = 255, message = "布局图长度不能超过255")
+    private String layoutMap;
 
     @ApiModelProperty(value = "生产资源列表")
     private List<String> resourceList;

+ 9 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/entity/ZZone.java

@@ -89,6 +89,15 @@ public class ZZone extends Entity<Long> {
     @Excel(name = "运行模式(1-自动模式2-手动模式3-半自动模式)")
     private String runMode;
 
+    @ApiModelProperty(value = "布局图")
+    @Length(max = 255, message = "布局图长度不能超过255")
+    @TableField(value = "layout_map", condition = LIKE)
+    @Excel(name = "布局图")
+    private String layoutMap;
+
+    @TableField(exist=false)
+    private String imgUrl;
+
     @TableField(exist=false)
     private String productionResourceName;