Pārlūkot izejas kodu

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

yaoyq 4 gadi atpakaļ
vecāks
revīzija
981feaa56b

+ 14 - 14
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/aps/instance/domain/basicdata/Part.java

@@ -22,11 +22,6 @@ public class Part implements Serializable {
 	 */
 	private int operationNum; // 工序数量
 
-	/**
-	 * 紧急插单标记 0 紧急插单 1 正常
-	 */
-	private int rushOrderFlag;
-
 	/**
 	 * 工序列表
 	 */
@@ -60,6 +55,11 @@ public class Part implements Serializable {
 	 */
 	private double totalWorkTime;
 
+	/**
+	 * 订单工件优先级
+	 */
+	private int partPrority;
+
 	public String getId() {
 		return id;
 	}
@@ -98,14 +98,6 @@ public class Part implements Serializable {
 		this.operationNum = operationNum;
 	}
 
-	public int getRushOrderFlag() {
-		return rushOrderFlag;
-	}
-
-	public void setRushOrderFlag(int rushOrderFlag) {
-		this.rushOrderFlag = rushOrderFlag;
-	}
-
 	/**
 	 * @return the opList
 	 */
@@ -212,13 +204,21 @@ public class Part implements Serializable {
 		this.totalWorkTime = totalWorkTime;
 	}
 
+	public int getPartPrority() {
+		return partPrority;
+	}
+
+	public void setPartPrority(int partPrority) {
+		this.partPrority = partPrority;
+	}
+
 	@Override
 	public String toString() {
 		return "Part{" +
 				"id=" + id +
 				", name='" + name + '\'' +
 				", operationNum=" + operationNum +
-				", rushOrderFlag=" + rushOrderFlag +
+				", partPrority=" + partPrority +
 				", opList=" + opList +
 				", start=" + start +
 				", finish=" + finish +

+ 11 - 5
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/aps/rule/OperationPriority.java

@@ -26,12 +26,18 @@ public class OperationPriority extends OperationRule implements Comparator<Opera
 		try {
 			// 优先级数值越小越优先
 			// 先根据是否插单的排序,在根据交期排序,最后按照遗传算法基因(优先级)排序
-			if(operTask1.getPart().getRushOrderFlag() > operTask2.getPart().getRushOrderFlag()){
-				i = 1;
-			}else if(operTask1.getPart().getRushOrderFlag() == operTask2.getPart().getRushOrderFlag()){
-				if (operTask1.getPart().getDueDate() > operTask2.getPart().getDueDate()) {
+			int partPrority = operTask1.getPart().getPartPrority();
+			int comparePartPrority = operTask2.getPart().getPartPrority();
+
+			double partDueDate = operTask1.getPart().getDueDate();
+			double comparePartDueDate = operTask2.getPart().getDueDate();
+
+			if(partPrority > comparePartPrority){
+				i = -1;
+			}else if(partPrority == comparePartPrority){
+				if (partDueDate > comparePartDueDate) {
 					i = 1;
-				}else if(operTask1.getPart().getDueDate() == operTask2.getPart().getDueDate()){
+				}else if(partDueDate == comparePartDueDate){
 					if (operTask1.getOpPriority() > operTask2.getOpPriority()) {
 						i = 1;
 					}else if (operTask1.getOpPriority() == operTask2.getOpPriority()) {

+ 2 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskServiceImpl.java

@@ -317,7 +317,9 @@ public class TaskServiceImpl extends SuperServiceImpl<TTaskMapper, TTask> implem
                 part.setName(orderProduct.getName());
                 part.setOperationNum(bomProcedureList.size());
                 part.setOpList(opList);
+                // 根据最终版本调整交互日期及优先级
                 part.setDueDate(orderProduct.getDeliveryTime().getTime());
+                part.setPartPrority(orderProduct.getPrority());
                 partMap.put(workpiece.getCompleteBatchNo(),part);
             }
         }

+ 2 - 1
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/operationManagementCenter/OrderProductMapper.xml

@@ -14,12 +14,13 @@
         <result column="remark" jdbcType="VARCHAR" property="remark"/>
         <result column="create_user" jdbcType="VARCHAR" property="createUser"/>
         <result column="update_user" jdbcType="VARCHAR" property="updateUser"/>
+        <result column="prority" jdbcType="VARCHAR" property="prority"/>
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
         id,create_time,update_time,
-        order_id, bom_id, bom_num, delivery_time, remark, create_user, update_user
+        order_id, bom_id, bom_num, delivery_time, remark, create_user, update_user, prority
     </sql>
 
     <select id="getList" parameterType="com.github.zuihou.business.operationManagementCenter.entity.OrderProduct" resultType="com.github.zuihou.business.operationManagementCenter.entity.OrderProduct">

+ 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 - 1
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/operationManagementCenter/entity/OrderProduct.java

@@ -96,6 +96,13 @@ public class OrderProduct extends Entity<Long> {
     @Excel(name = "交货时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
     private Date deliveryTime;
 
+    /**
+     * 优先级
+     */
+    @ApiModelProperty(value = "prority")
+    @TableField("prority")
+    private int prority;
+
     /**
      * 备注
      */
@@ -151,7 +158,7 @@ public class OrderProduct extends Entity<Long> {
     private Integer limitNum;
 
     @Builder
-    public OrderProduct(Long id, LocalDateTime createTime, LocalDateTime updateTime, 
+    public OrderProduct(Long id, LocalDateTime createTime, LocalDateTime updateTime,
                     Long orderId, Long bomId, Integer bomNum, Date deliveryTime, String remark) {
         this.id = id;
         this.createTime = createTime;

+ 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;