Browse Source

2026-06-18

打样申请增加“批次号”和【批量下达】操作
master
fengyuan_yang 3 months ago
parent
commit
83a582de45
  1. 2
      src/main/java/com/spring/modules/proofing/controller/ProofingInformationController.java
  2. 4
      src/main/java/com/spring/modules/proofing/entity/ProofingInformationEntity.java
  3. 2
      src/main/java/com/spring/modules/proofing/mapper/ProofingInformationMapper.java
  4. 9
      src/main/java/com/spring/modules/proofing/service/impl/ProofingInformationServiceImpl.java
  5. 21
      src/main/resources/mapper/proofing/ProofingInformationMapper.xml

2
src/main/java/com/spring/modules/proofing/controller/ProofingInformationController.java

@ -64,7 +64,7 @@ public class ProofingInformationController {
@ResponseBody @ResponseBody
public R proofingInformationService(@RequestBody ProofingInformationEntity data) { public R proofingInformationService(@RequestBody ProofingInformationEntity data) {
String proofingNo = proofingInformationService.proofingInformationSave(data); String proofingNo = proofingInformationService.proofingInformationSave(data);
return R.ok().put("proofingNo",proofingNo);
return R.ok().put("proofingNo", proofingNo).put("proofingBatchNo", data.getProofingBatchNo());
} }
/** /**

4
src/main/java/com/spring/modules/proofing/entity/ProofingInformationEntity.java

@ -28,6 +28,10 @@ public class ProofingInformationEntity extends QueryPage implements Serializable
* 打样编码 * 打样编码
**/ **/
private String proofingNo; private String proofingNo;
/**
* 打样批次号
**/
private String proofingBatchNo;
/** /**
* 项目编码 * 项目编码
**/ **/

2
src/main/java/com/spring/modules/proofing/mapper/ProofingInformationMapper.java

@ -20,6 +20,8 @@ public interface ProofingInformationMapper extends BaseMapper<ProofingInformatio
String getProofingNo(ProofingInformationEntity data); String getProofingNo(ProofingInformationEntity data);
String getProofingBatchNo(@Param("site") String site, @Param("proofingBatchNoPrefix") String proofingBatchNoPrefix);
List<ProofingDelegateAccessVo> searchDelegateAccess(ProofingDelegateAccess delegateAccess); List<ProofingDelegateAccessVo> searchDelegateAccess(ProofingDelegateAccess delegateAccess);
List<ProofingDelegateAccessVo> searchDelegateAccessByUser(@Param("params") ProofingDelegateAccessVo delegateAccess,@Param("roleId")String roleId); List<ProofingDelegateAccessVo> searchDelegateAccessByUser(@Param("params") ProofingDelegateAccessVo delegateAccess,@Param("roleId")String roleId);

9
src/main/java/com/spring/modules/proofing/service/impl/ProofingInformationServiceImpl.java

@ -59,6 +59,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -136,11 +138,18 @@ public class ProofingInformationServiceImpl extends ServiceImpl<ProofingInformat
// 获取项目料号 // 获取项目料号
String[] testPartNoList = data.getTestPartNo().split(";"); String[] testPartNoList = data.getTestPartNo().split(";");
String docNo = ""; String docNo = "";
String proofingBatchNoPrefix = "DY" + LocalDate.now().format(DateTimeFormatter.BASIC_ISO_DATE);
String proofingBatchNo = proofingInformationMapper.getProofingBatchNo(data.getSite(), proofingBatchNoPrefix);
if (!StringUtils.hasText(proofingBatchNo)) {
proofingBatchNo = proofingBatchNoPrefix + "001";
}
data.setProofingBatchNo(proofingBatchNo);
// 新增 // 新增
for (String testPartNo : testPartNoList) { for (String testPartNo : testPartNoList) {
// 获取打样单号 // 获取打样单号
String proofingNo = "DY" + proofingInformationMapper.getProofingNo(data); String proofingNo = "DY" + proofingInformationMapper.getProofingNo(data);
data.setProofingNo(proofingNo); data.setProofingNo(proofingNo);
data.setProofingBatchNo(proofingBatchNo);
data.setTestPartNo(testPartNo); data.setTestPartNo(testPartNo);
data.setStepId(10); data.setStepId(10);
data.setProofingResultStatus(data.getProofingResultStatus()); data.setProofingResultStatus(data.getProofingResultStatus());

21
src/main/resources/mapper/proofing/ProofingInformationMapper.xml

@ -7,6 +7,7 @@
SELECT a.id, SELECT a.id,
a.site, a.site,
a.proofing_no, a.proofing_no,
a.proofing_batch_no,
a.project_id, a.project_id,
dbo.plm_get_project_name(a.site, a.project_id) as projectName, dbo.plm_get_project_name(a.site, a.project_id) as projectName,
a.test_part_no, a.test_part_no,
@ -79,6 +80,9 @@
<if test="query.proofingNo != null and query.proofingNo != ''"> <if test="query.proofingNo != null and query.proofingNo != ''">
AND a.proofing_no like #{query.proofingNo} AND a.proofing_no like #{query.proofingNo}
</if> </if>
<if test="query.proofingBatchNo != null and query.proofingBatchNo != ''">
AND a.proofing_batch_no like #{query.proofingBatchNo}
</if>
<if test="query.customerDesc != null and query.customerDesc != ''"> <if test="query.customerDesc != null and query.customerDesc != ''">
AND dbo.plm_get_customer_desc(a.site, a.customer_no) like #{query.customerDesc} AND dbo.plm_get_customer_desc(a.site, a.customer_no) like #{query.customerDesc}
</if> </if>
@ -145,6 +149,22 @@
WHERE site = #{site} WHERE site = #{site}
</select> </select>
<!-- 获得打样批次号 -->
<select id="getProofingBatchNo" resultType="string">
SELECT CONCAT(
#{proofingBatchNoPrefix},
RIGHT('000' + CONVERT(VARCHAR(10),
ISNULL(MAX(CASE
WHEN ISNUMERIC(RIGHT(proofing_batch_no, 3)) = 1
THEN CONVERT(INT, RIGHT(proofing_batch_no, 3))
ELSE 0
END), 0) + 1), 3)
)
FROM plm_proofing_information
WHERE site = #{site}
AND proofing_batch_no LIKE CONCAT(#{proofingBatchNoPrefix}, '%')
</select>
<select id="searchDelegateAccess" resultType="com.spring.modules.proofing.vo.ProofingDelegateAccessVo"> <select id="searchDelegateAccess" resultType="com.spring.modules.proofing.vo.ProofingDelegateAccessVo">
select select
site, site,
@ -181,6 +201,7 @@
SELECT a.id, SELECT a.id,
a.site, a.site,
a.proofing_no, a.proofing_no,
a.proofing_batch_no,
a.project_id, a.project_id,
dbo.plm_get_project_name(a.site, a.project_id) as projectName, dbo.plm_get_project_name(a.site, a.project_id) as projectName,
a.test_part_no, a.test_part_no,

Loading…
Cancel
Save