From a3202d4c62be404247d23f0676e95f8c5d146983 Mon Sep 17 00:00:00 2001
From: 刘小明 <liuxm_a@163.com>
Date: 星期六, 06 七月 2024 09:49:17 +0800
Subject: [PATCH] 添加根据设备号查询生产日志,生命周期,和相关信息;限制上传文档类型
---
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductMapper.java | 2
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceProductionLog.java | 10 +++
pms-parent/pms-global/src/main/resources/mapper/StaWipSnExMapper.xml | 6 ++
pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml | 8 ++
pms-parent/pms-global/src/main/resources/application-global.yml | 1
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/global/WebFileCtrl.java | 7 ++
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLife.java | 10 +++
pms-parent/pms-global/src/main/resources/mapper/StaDeviceProductionLogMapper.xml | 23 +++++--
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java | 24 ++++++++
pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeMapper.xml | 22 +++++-
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLast.java | 10 +++
pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml | 18 ++++++
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoSta/StaWipSnExMapper.java | 3 +
pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml | 6 ++
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java | 22 +++++++
15 files changed, 158 insertions(+), 14 deletions(-)
diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductMapper.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductMapper.java
index c28b029..3defdb5 100644
--- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductMapper.java
+++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductMapper.java
@@ -25,4 +25,6 @@
String selectMaxCode();
boolean exists(String name, Long id);
+
+ PltProduct selectByCode(String productCode);
}
\ No newline at end of file
diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoSta/StaWipSnExMapper.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoSta/StaWipSnExMapper.java
index f78dd38..71830dd 100644
--- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoSta/StaWipSnExMapper.java
+++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoSta/StaWipSnExMapper.java
@@ -3,6 +3,8 @@
import com.dy.pmsGlobal.pojoSta.StaWipSnEx;
import org.apache.ibatis.annotations.Mapper;
+import java.util.List;
+
/**
* @author User
* @description 閽堝琛ㄣ�恠ta_wip_sn_ex(璁惧鍏宠仈琛�)銆戠殑鏁版嵁搴撴搷浣淢apper
@@ -24,4 +26,5 @@
int updateByPrimaryKey(StaWipSnEx record);
+ List<StaWipSnEx> selectByDeviceNo(String deviceNo);
}
diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/global/WebFileCtrl.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/global/WebFileCtrl.java
index a3d3641..c4f59a9 100644
--- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/global/WebFileCtrl.java
+++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/global/WebFileCtrl.java
@@ -36,6 +36,9 @@
@Value("${dy.webFile.fmUrl}")
private String fmUrl ;
+ //鏀寔鐨勬枃浠剁被鍨�
+ @Value("${dy.webFile.supportedFileTypes}")
+ private String supportedFileTypes ;
/**
* 涓婁紶鐓х墖鍥剧墖鏂囦欢 锛堝綋鍓嶅彧瀵筽ng jpg鏍煎紡鍥剧墖鏀寔缂╃暐鍥撅級
@@ -170,6 +173,10 @@
String[] fileNameGrp = fileOp.splitFileName(file) ;
if(fileNameGrp != null && fileNameGrp[0] != null && fileNameGrp[1] != null){
if(!fileNameGrp[1].trim().equals("")){
+ String fileExtName = fileNameGrp[1];
+ if(!supportedFileTypes.contains(fileExtName)){
+ return BaseResponseUtils.buildError("璇蜂笂浼燱ord,Excel,PowerPoint,PDF绫诲瀷鏂囨。");
+ }
FileRestVo frVo = fileOp.saveFile(file,
fmUrl,
FileConstant.fileRequestMapping,
diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLast.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLast.java
index ece7a09..ccf0308 100644
--- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLast.java
+++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLast.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
+import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import jakarta.validation.constraints.NotBlank;
@@ -98,5 +99,12 @@
*/
public String memo;
-
+ @TableField(exist = false)
+ public String planName;
+ @TableField(exist = false)
+ public String stationName;
+ @TableField(exist = false)
+ public String updateUserName;
+ @TableField(exist = false)
+ public String assistantNames;
}
diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLife.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLife.java
index d560b5e..d0a23e4 100644
--- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLife.java
+++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLife.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
+import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import jakarta.validation.constraints.NotBlank;
@@ -99,5 +100,12 @@
*/
public String memo;
-
+ @TableField(exist = false)
+ public String planName;
+ @TableField(exist = false)
+ public String stationName;
+ @TableField(exist = false)
+ public String updateUserName;
+ @TableField(exist = false)
+ public String assistantNames;
}
diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceProductionLog.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceProductionLog.java
index 26b9d94..db96c8e 100644
--- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceProductionLog.java
+++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceProductionLog.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
+import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import jakarta.validation.constraints.NotBlank;
@@ -98,5 +99,12 @@
*/
public String memo;
-
+ @TableField(exist = false)
+ public String planName;
+ @TableField(exist = false)
+ public String stationName;
+ @TableField(exist = false)
+ public String updateUserName;
+ @TableField(exist = false)
+ public String assistantNames;
}
diff --git a/pms-parent/pms-global/src/main/resources/application-global.yml b/pms-parent/pms-global/src/main/resources/application-global.yml
index f4e1add..18aa106 100644
--- a/pms-parent/pms-global/src/main/resources/application-global.yml
+++ b/pms-parent/pms-global/src/main/resources/application-global.yml
@@ -107,6 +107,7 @@
photoZipWidth: 400 #缂╃暐鍥惧昂瀵�
webFile:
fmUrl: http://127.0.0.1:${pms.other.webPort}/other # fm鐨剋eb涓婁笅鏂� URL
+ supportedFileTypes: docx,xlsx,pdf
sv1:
id: dyFile1
absolutePath: E:/java/nginx-1.24.0/html/webfiles/
diff --git a/pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml
index 15c4e52..64e3777 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml
@@ -143,6 +143,14 @@
</if>
</trim>
</select>
+ <select id="selectNamesByAssistants" parameterType="java.lang.String" resultType="java.lang.String">
+ SELECT GROUP_CONCAT(name) AS assistantNames FROM ba_user WHERE id IN
+ <if test="assistants != null">
+ <foreach collection="assistants.split(',')" item="item" separator="," open="(" close=")">
+ #{item,jdbcType=BIGINT}
+ </foreach>
+ </if>
+ </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--@mbg.generated-->
diff --git a/pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml
index b67cae4..af0c699 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml
@@ -201,5 +201,11 @@
and id != #{id}
</if>
</select>
+ <select id="selectByCode" resultType="com.dy.pmsGlobal.pojoPlt.PltProduct">
+ select
+ <include refid="Base_Column_List" />
+ from plt_product p
+ where p.deleted!=1 and p.code = #{code}
+ </select>
</mapper>
\ No newline at end of file
diff --git a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml
index bb8d7bc..66f08c4 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml
@@ -23,6 +23,13 @@
<result property="outTime" column="out_time" jdbcType="TIMESTAMP"/>
<result property="memo" column="memo" jdbcType="VARCHAR"/>
</resultMap>
+ <resultMap id="joinResultMap" type="com.dy.pmsGlobal.pojoSta.StaDeviceLife" extends="BaseResultMap">
+ <result property="planName" column="plan_name" jdbcType="VARCHAR"/>
+ <result property="stationName" column="station_name" jdbcType="VARCHAR"/>
+ <result property="updateUserName" column="update_user_name" jdbcType="VARCHAR"/>
+ <association property="assistantNames" jdbcType="VARCHAR" column="assistants"
+ select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectNamesByAssistants" fetchType="eager" />
+ </resultMap>
<sql id="Base_Column_List">
id,equip_no,work_id,
@@ -33,6 +40,17 @@
updated_by,in_time,out_time,
memo
</sql>
+ <select id="selectByEquipNo" parameterType="java.lang.String" resultMap="joinResultMap">
+ select
+ t.* ,p.`name` plan_name,s.`name` station_name,u.`name` update_user_name
+ FROM
+ sta_device_last t
+ left join pr_assembly_plan p on t.plan_id=p.id
+ left join plt_station s on s.id = t.station_id
+ left JOIN ba_user u on u.id=t.updated_by
+ where t.equip_no = #{equipNo,jdbcType=VARCHAR}
+ ORDER BY t.id DESC
+ </select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
diff --git a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeMapper.xml
index d3936f5..fb8527f 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeMapper.xml
@@ -23,6 +23,13 @@
<result property="updatedBy" column="updated_by" jdbcType="BIGINT"/>
<result property="memo" column="memo" jdbcType="VARCHAR"/>
</resultMap>
+ <resultMap id="joinResultMap" type="com.dy.pmsGlobal.pojoSta.StaDeviceLife" extends="BaseResultMap">
+ <result property="planName" column="plan_name" jdbcType="VARCHAR"/>
+ <result property="stationName" column="station_name" jdbcType="VARCHAR"/>
+ <result property="updateUserName" column="update_user_name" jdbcType="VARCHAR"/>
+ <association property="assistantNames" jdbcType="VARCHAR" column="assistants"
+ select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectNamesByAssistants" fetchType="eager" />
+ </resultMap>
<sql id="Base_Column_List">
id,equip_no,work_id,
@@ -40,14 +47,19 @@
where id = #{id,jdbcType=BIGINT}
</select>
- <select id="selectByEquipNo" parameterType="java.lang.String" resultMap="BaseResultMap">
+ <select id="selectByEquipNo" parameterType="java.lang.String" resultMap="joinResultMap">
select
- <include refid="Base_Column_List" />
- from sta_device_life
- where equip_no = #{equipNo,jdbcType=VARCHAR}
- order by id desc
+ t.* ,p.`name` plan_name,s.`name` station_name,u.`name` update_user_name
+ FROM
+ sta_device_life t
+ left join pr_assembly_plan p on t.plan_id=p.id
+ left join plt_station s on s.id = t.station_id
+ left JOIN ba_user u on u.id=t.updated_by
+ where t.equip_no = #{equipNo,jdbcType=VARCHAR}
+ ORDER BY t.id DESC
</select>
+
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from sta_device_life
where id = #{id,jdbcType=BIGINT}
diff --git a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceProductionLogMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceProductionLogMapper.xml
index 85978a7..df99ea3 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceProductionLogMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceProductionLogMapper.xml
@@ -23,6 +23,13 @@
<result property="updatedBy" column="updated_by" jdbcType="BIGINT"/>
<result property="memo" column="memo" jdbcType="VARCHAR"/>
</resultMap>
+ <resultMap id="joinResultMap" type="com.dy.pmsGlobal.pojoSta.StaDeviceLife" extends="BaseResultMap">
+ <result property="planName" column="plan_name" jdbcType="VARCHAR"/>
+ <result property="stationName" column="station_name" jdbcType="VARCHAR"/>
+ <result property="updateUserName" column="update_user_name" jdbcType="VARCHAR"/>
+ <association property="assistantNames" jdbcType="VARCHAR" column="assistants"
+ select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectNamesByAssistants" fetchType="eager" />
+ </resultMap>
<sql id="Base_Column_List">
id,equip_no,work_id,
@@ -33,19 +40,23 @@
out_time,updated_by,memo
</sql>
+
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sta_device_production_log
where id = #{id,jdbcType=BIGINT}
</select>
-
- <select id="selectByEquipNo" parameterType="java.lang.String" resultMap="BaseResultMap">
+ <select id="selectByEquipNo" parameterType="java.lang.String" resultMap="joinResultMap">
select
- <include refid="Base_Column_List" />
- from sta_device_production_log
- where equip_no = #{equipNo,jdbcType=VARCHAR}
- order by id desc
+ t.* ,p.`name` plan_name,s.`name` station_name,u.`name` update_user_name
+ FROM
+ sta_device_last t
+ left join pr_assembly_plan p on t.plan_id=p.id
+ left join plt_station s on s.id = t.station_id
+ left JOIN ba_user u on u.id=t.updated_by
+ where t.equip_no = #{equipNo,jdbcType=VARCHAR}
+ ORDER BY t.id DESC
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
diff --git a/pms-parent/pms-global/src/main/resources/mapper/StaWipSnExMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/StaWipSnExMapper.xml
index f8568f3..cc8617e 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/StaWipSnExMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/StaWipSnExMapper.xml
@@ -26,6 +26,12 @@
from sta_wip_sn_ex
where id = #{id,jdbcType=BIGINT}
</select>
+ <select id="selectByDeviceNo" resultType="com.dy.pmsGlobal.pojoSta.StaWipSnEx">
+ select
+ <include refid="Base_Column_List" />
+ from sta_wip_sn_ex
+ where device_no = #{deviceNo,jdbcType=VARCHAR}
+ </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from sta_wip_sn_ex
diff --git a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java
index b120df7..a8a4cb7 100644
--- a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java
+++ b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java
@@ -7,12 +7,15 @@
import com.dy.pmsGlobal.pojoPlt.PltProductQualityInspectionItems;
import com.dy.pmsGlobal.pojoPlt.PltProductTestInspectionItems;
import com.dy.pmsGlobal.pojoPr.PrProductionNode;
+import com.dy.pmsGlobal.pojoSta.StaDeviceLife;
+import com.dy.pmsGlobal.pojoSta.StaDeviceProductionLog;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
+import java.util.Map;
/**
*璁板綍缁勮鍚勬楠�
@@ -109,4 +112,25 @@
return BaseResponseUtils.buildSuccess(true);
}
}
+
+ @GetMapping(path = "queryByDeviceNo")
+ public BaseResponse<Map<String,String>> queryByDeviceNo(String deviceNo) {
+ log.info("AssemblyStepCtrl.queryByDeviceNo():"+deviceNo);
+ Map<String,String> result = sv.queryByDeviceNo(deviceNo);
+ return BaseResponseUtils.buildSuccess(result);
+ }
+
+ @GetMapping(path = "queryLifeByDeviceNo")
+ public BaseResponse<?> queryLifeByDeviceNo(String deviceNo) {
+ log.info("AssemblyStepCtrl.queryLifeByDeviceNo():"+deviceNo);
+ List<StaDeviceLife> result = sv.queryLifeByDeviceNo(deviceNo);
+ return BaseResponseUtils.buildSuccess(result);
+ }
+
+ @GetMapping(path = "queryLogByDeviceNo")
+ public BaseResponse<?> queryLogByDeviceNo(String deviceNo) {
+ log.info("AssemblyStepCtrl.queryLogByDeviceNo():"+deviceNo);
+ List<StaDeviceProductionLog> result = sv.queryLogByDeviceNo(deviceNo);
+ return BaseResponseUtils.buildSuccess(result);
+ }
}
diff --git a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java
index 2238604..674443e 100644
--- a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java
+++ b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java
@@ -390,4 +390,26 @@
FileRestVo fileRestVo = fileOperate.parseHashcode(fmUrl, file.hash);
return fileRestVo.fileWebUrl + file.filePath;
}
+
+ public Map<String,String> queryByDeviceNo(String deviceNo) {
+ Map<String,String> map = new HashMap<>();
+ map.put("deviceNo", deviceNo);
+ map.put("proName", "-");
+ map.put("proType", "-");
+
+ PltProduct product = productDao.selectByCode(deviceNo.substring(3,6));
+ if(product != null){
+ map.put("proName", product.getName());
+ map.put("proType", product.getType());
+ }
+ return map;
+ }
+
+ public List<StaDeviceLife> queryLifeByDeviceNo(String deviceNo) {
+ return deviceLifeDao.selectByEquipNo(deviceNo);
+ }
+
+ public List<StaDeviceProductionLog> queryLogByDeviceNo(String devoiceNo) {
+ return deviceProductionLogDao.selectByEquipNo(devoiceNo);
+ }
}
--
Gitblit v1.8.0