姜永辉 3 лет назад
Родитель
Сommit
7e7dea0269

+ 10 - 0
src/main/java/com/dk/mdm/controller/app/mst/AppMouldController.java

@@ -104,5 +104,15 @@ public class AppMouldController {
         return appMouldService.selectMouldByMoldLine(appMouldQuery);
     }
 
+    /**
+     * @desc   : 根据磨具条码查询跟踪数据
+     * @author : 姜永辉
+     * @date   : 2023/03/29 16:10
+     */
+    @PostMapping("select_mould_trace")
+    public ResponseResultVO<List<AppMouldResponse>> selectMouldTraceByCode(@RequestBody AppMouldQuery appMouldQuery) {
+        return appMouldService.selectMouldTraceByCode(appMouldQuery);
+    }
+
 
     }

+ 7 - 0
src/main/java/com/dk/mdm/mapper/app/mst/AppMouldMapper.java

@@ -58,6 +58,13 @@ public interface AppMouldMapper extends BaseMapper<AppMould> {
     AppMouldResponse selectMouldByCode(AppMouldQuery appMouldQuery);
 
     /**
+     * @desc : 查找 uniqueCode 所在数据-磨具跟踪
+     * @author : 王英杰
+     * @date : 2023/02/01 13:12
+     */
+    List<AppMouldResponse> selectMouldTraceByCode(AppMouldQuery appMouldQuery);
+
+    /**
      * 模具报废 函数
      *
      * @param userId

+ 35 - 0
src/main/java/com/dk/mdm/mapper/app/mst/AppMouldMapper.xml

@@ -22,6 +22,18 @@
         sys.f_get_name_i18n_lang(tdk.kind_name_i18n,#{i18n}) as mould_kind_name
     </sql>
 
+    <!-- 磨具跟踪查询列 -->
+    <sql id="Base_Column_List_Mould_Trace">
+        tm.unique_id, tm.unique_code, tm.model_kind, tmo.mould_model_id model_id, tm.remarks, tm.flg_valid, tm.fty_id,
+        tm.flg_auto_uuid, tm.std_num, tm.output_qty, tm.output_std_sum, tm.make_date, tm.make_user_id,
+        tm.material_type, tmo.mould_kind, tm.moldline_id, tm.moldline_group_id, tm.moldline_item_id,
+        tmo.scrap_date, tmo.scrap_user_id ,tmo.opn_time,
+        tmm.model_name, tmm.model_code,tmmi.unused_num,tml.unique_code moldline_code,tu.user_name opn_user_name,
+        tuc.user_name scrap_user_name,
+        sys.f_get_name_i18n_lang(tdk.kind_name_i18n,#{i18n}) as mould_kind_name,
+        sys.f_get_name_i18n_lang(tdkp.kind_name_i18n,#{i18n}) as per_mould_kind_name
+    </sql>
+
     <sql id="Base_Column_List_Join">
         tm.unique_id, tm.unique_code, tm.model_kind, tm.model_id, tm.remarks, tm.flg_valid, tm.fty_id,
         tm.flg_auto_uuid, tm.std_num, tm.output_qty,
@@ -113,6 +125,7 @@
                 typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
         <result column="material_type" property="materialType"/>
         <result column="mould_kind" property="mouldKind"/>
+        <result column="per_mould_kind" property="perMouldKind"/>
         <result column="moldline_group_id" property="moldlineGroupId"/>
         <result column="scrap_date" property="scrapDate"
                 typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
@@ -123,11 +136,15 @@
         <result column="model_name" property="modelName" />
         <result column="model_code" property="modelCode" />
         <result column="mould_kind_name" property="mouldKindName"/>
+        <result column="per_mould_kind_name" property="perMouldKindName"/>
         <result column="moldline_id" property="moldlineId"/>
         <result column="moldline_code" property="moldlineCode"/>
         <result column="unused_num" property="unusedNum"/>
         <result column="make_user_name" property="makeUserName"/>
+        <result column="opn_user_name" property="opnUserName"/>
         <result column="scrap_user_name" property="makeUserName"/>
+        <result column="opn_time" property="opnTime"
+                typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
     </resultMap>
 
 
@@ -327,6 +344,24 @@
         and tm.flg_barcode
         and tm.flg_valid
     </select>
+<!--磨具跟踪-->
+    <select id="selectMouldTraceByCode" resultMap="BaseResultMap_Join_Mould">
+        SELECT
+        <include refid="Base_Column_List_Mould_Trace"/>
+        FROM mst.t_mould_opn tmo
+        inner JOIN  mst.t_mould  tm on tmo.mould_id = tm.unique_id
+        LEFT JOIN mst.t_model_mould tmm on  tmm.model_id = tmo.mould_model_id
+        LEFT JOIN mst.t_moldline tml on  tmo.moldline_id = tml.unique_id
+        LEFT JOIN mst.t_mould_molded tmmi on  tm.unique_id = tmmi.mould_id
+        LEFT JOIN core.t_user tu ON tu.user_id = tmo.opn_user_id
+        LEFT JOIN core.t_user tuc ON tuc.user_id = tmo.scrap_user_id
+        LEFT join sys.t_data_kind tdk on tdk.kind_code = tmo.mould_kind
+        LEFT join sys.t_data_kind tdkp on tdkp.kind_code = tmo.per_mould_kind
+        where  tm.unique_code = #{uniqueCode}
+        AND  tmo.fty_id = #{ftyId}
+        and tm.flg_barcode
+        order by tmo.opn_time DESC
+    </select>
 
     <insert id="insertBatch">
         insert into t_mould

+ 30 - 0
src/main/java/com/dk/mdm/model/app/response/AppMouldResponse.java

@@ -213,6 +213,13 @@ public class AppMouldResponse extends PageInfo<AppMouldResponse> implements Seri
     @ApiModelProperty(value = "模具状态 (【数据种类】模具状态-在库、在产、报废)")
     private String mouldKind;
 
+    /**
+     * 前模具状态 (【数据种类】模具状态-在库、在产、报废)
+     */
+    @Excel(name = "前模具状态 (【数据种类】模具状态-在库、在产、报废)")
+    @ApiModelProperty(value = "前模具状态 (【数据种类】模具状态-在库、在产、报废)")
+    private String perMouldKind;
+
 
     /**
      * 所在成型线 (t_molding)
@@ -298,6 +305,13 @@ public class AppMouldResponse extends PageInfo<AppMouldResponse> implements Seri
     @ApiModelProperty(value = "型模具状态 (【数据种类】模具状态-在库、在产、报废)")
     private String mouldKindName;
 
+    /**
+     * 前模具状态 (【数据种类】模具状态-在库、在产、报废)
+     */
+    @Excel(name = "前模具状态 (【数据种类】模具状态-在库、在产、报废)")
+    @ApiModelProperty(value = "前模具状态 (【数据种类】模具状态-在库、在产、报废)")
+    private String perMouldKindName;
+
 
     /**
      * 所在成型线 (t_moldline【成型线上模、卸模时】)
@@ -334,6 +348,22 @@ public class AppMouldResponse extends PageInfo<AppMouldResponse> implements Seri
     @ApiModelProperty(value = "报废工号")
     private String scrapUserName;
 
+    /**
+     * 操作工号
+     */
+    @Excel(name = "操作工号")
+    @ApiModelProperty(value = "操作工号")
+    private String opnUserName;
+
+    /**
+     * 操作时间
+     */
+    @Excel(name = "操作时间")
+    @ApiModelProperty(value = "操作时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opnTime;
+
     /*
      * 相关属性
      * @TableField(exist = false)

+ 9 - 0
src/main/java/com/dk/mdm/service/app/mst/AppMouldService.java

@@ -150,4 +150,13 @@ public class AppMouldService extends BaseService<AppMould> {
 	public ResponseResultVO<?> selectMouldByMoldLine(AppMouldQuery appMouldQuery){
 		return 	ResponseResultUtil.success( appMouldMapper.selectMouldByMoldLine(appMouldQuery));
 	}
+
+	/**
+	 * @desc   : 根据磨具条码查询跟踪数据
+	 * @author : 姜永辉
+	 * @date   : 2023/03/29 16:09
+	 */
+	public ResponseResultVO<List<AppMouldResponse>> selectMouldTraceByCode(AppMouldQuery appMouldQuery){
+		return 	ResponseResultUtil.success( appMouldMapper.selectMouldTraceByCode(appMouldQuery));
+	}
 }