bug修复

This commit is contained in:
hongchao 2025-03-17 16:28:08 +08:00
parent de0957f63b
commit b66eb4b9fe
9 changed files with 114 additions and 17 deletions

View File

@ -134,4 +134,10 @@ public class BmAgreementInfo extends BaseEntity
@ApiModelProperty(value = "附件列表") @ApiModelProperty(value = "附件列表")
private List<BmFileInfo> bmFileInfos; private List<BmFileInfo> bmFileInfos;
@ApiModelProperty(value = "分布工程列表")
private int[] branchProIds;
@ApiModelProperty(value = "分布工程字符串")
private String branchProIdsStr;
} }

View File

@ -70,4 +70,6 @@ public interface BmAgreementInfoMapper
* @return * @return
*/ */
int selectByagreementId(Long agreementId); int selectByagreementId(Long agreementId);
String getDictLabel(int id);
} }

View File

@ -1,6 +1,7 @@
package com.bonus.material.basic.service.impl; package com.bonus.material.basic.service.impl;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@ -46,6 +47,23 @@ public class BmAgreementInfoServiceImpl implements IBmAgreementInfoService
public BmAgreementInfo selectBmAgreementInfoByAgreementId(Long agreementId) public BmAgreementInfo selectBmAgreementInfoByAgreementId(Long agreementId)
{ {
BmAgreementInfo bmAgreementInfo = bmAgreementInfoMapper.selectBmAgreementInfoByAgreementId(agreementId); BmAgreementInfo bmAgreementInfo = bmAgreementInfoMapper.selectBmAgreementInfoByAgreementId(agreementId);
if(bmAgreementInfo.getBranchProIdsStr()!= null && !bmAgreementInfo.getBranchProIdsStr().equals("")){
String[] strArray = bmAgreementInfo.getBranchProIdsStr().split(",");
String branchProIdsStr = "";
int[] intArray = new int[strArray.length];
for (int i = 0; i < strArray.length; i++) {
String dictLabel = bmAgreementInfoMapper.getDictLabel(Integer.parseInt(strArray[i]));
if (i != strArray.length - 1) {
branchProIdsStr += dictLabel + ",";
}else {
branchProIdsStr +=dictLabel;
}
intArray[i] = Integer.parseInt(strArray[i]);
}
bmAgreementInfo.setBranchProIds(intArray);
bmAgreementInfo.setBranchProIdsStr(branchProIdsStr);
}
if (Objects.nonNull(bmAgreementInfo)) { if (Objects.nonNull(bmAgreementInfo)) {
BmFileInfo bmFileInfo = new BmFileInfo(); BmFileInfo bmFileInfo = new BmFileInfo();
bmFileInfo.setModelId(bmAgreementInfo.getAgreementId()); bmFileInfo.setModelId(bmAgreementInfo.getAgreementId());
@ -65,7 +83,26 @@ public class BmAgreementInfoServiceImpl implements IBmAgreementInfoService
@Override @Override
public List<BmAgreementInfo> selectBmAgreementInfoList(BmAgreementInfo bmAgreementInfo) public List<BmAgreementInfo> selectBmAgreementInfoList(BmAgreementInfo bmAgreementInfo)
{ {
return bmAgreementInfoMapper.selectBmAgreementInfoList(bmAgreementInfo); List<BmAgreementInfo> bmAgreementInfoList = new ArrayList<>();
bmAgreementInfoList = bmAgreementInfoMapper.selectBmAgreementInfoList(bmAgreementInfo);
if(!CollectionUtils.isEmpty(bmAgreementInfoList)){
bmAgreementInfoList.forEach(bmAgreementInfo1 -> {
if(bmAgreementInfo1.getBranchProIdsStr()!= null &&!bmAgreementInfo1.getBranchProIdsStr().equals("")){
String[] strArray = bmAgreementInfo1.getBranchProIdsStr().split(",");
String branchProIdsStr = "";
for (int i = 0; i < strArray.length; i++) {
String dictLabel = bmAgreementInfoMapper.getDictLabel(Integer.parseInt(strArray[i]));
if (i != strArray.length - 1) {
branchProIdsStr += dictLabel + ",";
}else {
branchProIdsStr +=dictLabel;
}
}
bmAgreementInfo1.setBranchProIdsStr(branchProIdsStr);
}
});
}
return bmAgreementInfoList;
} }
/** /**
@ -86,6 +123,19 @@ public class BmAgreementInfoServiceImpl implements IBmAgreementInfoService
bmAgreementInfo.setCreateBy(SecurityUtils.getUsername()); bmAgreementInfo.setCreateBy(SecurityUtils.getUsername());
bmAgreementInfo.setSignTime(DateUtils.getNowDate()); bmAgreementInfo.setSignTime(DateUtils.getNowDate());
bmAgreementInfo.setAgreementCode(getAgreementCode()); bmAgreementInfo.setAgreementCode(getAgreementCode());
if(bmAgreementInfo.getBranchProIds() != null){
String branchProIdsStr = "";
int[] split = bmAgreementInfo.getBranchProIds();
for (int i = 0; i < split.length; i++) {
// String dictLabel = bmAgreementInfoMapper.getDictLabel(split[i]);
if (i != split.length - 1) {
branchProIdsStr += split[i] + ",";
}else {
branchProIdsStr += split[i];
}
}
bmAgreementInfo.setBranchProIdsStr(branchProIdsStr);
}
int count = bmAgreementInfoMapper.insertBmAgreementInfo(bmAgreementInfo); int count = bmAgreementInfoMapper.insertBmAgreementInfo(bmAgreementInfo);
if (count > 0) { if (count > 0) {
if (CollectionUtils.isEmpty(bmAgreementInfo.getBmFileInfos())) { if (CollectionUtils.isEmpty(bmAgreementInfo.getBmFileInfos())) {
@ -136,6 +186,21 @@ public class BmAgreementInfoServiceImpl implements IBmAgreementInfoService
} }
} }
bmAgreementInfo.setUpdateTime(DateUtils.getNowDate()); bmAgreementInfo.setUpdateTime(DateUtils.getNowDate());
if(bmAgreementInfo.getBranchProIds() != null){
String branchProIdsStr = "";
int[] split = bmAgreementInfo.getBranchProIds();
for (int i = 0; i < split.length; i++) {
// String dictLabel = bmAgreementInfoMapper.getDictLabel(split[i]);
if (i != split.length - 1) {
branchProIdsStr += split[i] + ",";
}else {
branchProIdsStr += split[i];
}
}
bmAgreementInfo.setBranchProIdsStr(branchProIdsStr);
}else if(bmAgreementInfo.getBranchProIds() == null || bmAgreementInfo.getBranchProIds().length == 0){
bmAgreementInfo.setBranchProIdsStr(null);
}
int count = bmAgreementInfoMapper.updateBmAgreementInfo(bmAgreementInfo); int count = bmAgreementInfoMapper.updateBmAgreementInfo(bmAgreementInfo);
if (count > 0) { if (count > 0) {
BmFileInfo bmFileInfoToDelete = new BmFileInfo(); BmFileInfo bmFileInfoToDelete = new BmFileInfo();

View File

@ -37,10 +37,10 @@ public class PurchaseMacodeInfoController extends BaseController {
@ApiOperation(value = "查询新购验收编号管理列表") @ApiOperation(value = "查询新购验收编号管理列表")
@RequiresPermissions("purchase:info:list") @RequiresPermissions("purchase:info:list")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(PurchaseMacodeInfo purchaseMacodeInfo) { public AjaxResult list(PurchaseMacodeInfo purchaseMacodeInfo) {
startPage(); // startPage();
List<PurchaseMacodeInfo> list = purchaseMacodeInfoService.selectPurchaseMacodeInfoList(purchaseMacodeInfo); List<PurchaseMacodeInfo> list = purchaseMacodeInfoService.selectPurchaseMacodeInfoList(purchaseMacodeInfo);
return getDataTable(list); return success(list);
} }
/** /**

View File

@ -53,7 +53,8 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
*/ */
@Override @Override
public List<PurchaseMacodeInfo> selectPurchaseMacodeInfoList(PurchaseMacodeInfo purchaseMacodeInfo) { public List<PurchaseMacodeInfo> selectPurchaseMacodeInfoList(PurchaseMacodeInfo purchaseMacodeInfo) {
return purchaseMacodeInfoMapper.selectPurchaseMacodeInfoList(purchaseMacodeInfo); List<PurchaseMacodeInfo> list = purchaseMacodeInfoMapper.selectPurchaseMacodeInfoList(purchaseMacodeInfo);
return list;
} }
/** /**

View File

@ -29,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBmAgreementInfoList" parameterType="com.bonus.material.basic.domain.BmAgreementInfo" resultMap="BmAgreementInfoResult"> <select id="selectBmAgreementInfoList" parameterType="com.bonus.material.basic.domain.BmAgreementInfo" resultMap="BmAgreementInfoResult">
SELECT bai.agreement_id, bai.agreement_code , contract_code,sign_time, SELECT bai.agreement_id, bai.agreement_code , contract_code,sign_time,
bu.unit_id,bu.unit_name , bp.pro_id as projectId , bp.pro_name as projectName, bu.unit_id,bu.unit_name , bp.pro_id as projectId , bp.pro_name as projectName,
plan_start_time,lease_day,auth_person,phone,bai.remark,bai.protocol plan_start_time,lease_day,auth_person,phone,bai.remark,bai.protocol,bai.branch_project as branchProIdsStr
FROM bm_agreement_info bai FROM bm_agreement_info bai
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id
LEFT JOIN bm_unit bu ON bu.unit_id = bai.unit_id LEFT JOIN bm_unit bu ON bu.unit_id = bai.unit_id
@ -64,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBmAgreementInfoByAgreementId" parameterType="Long" resultMap="BmAgreementInfoResult"> <select id="selectBmAgreementInfoByAgreementId" parameterType="Long" resultMap="BmAgreementInfoResult">
SELECT bai.agreement_id, bai.agreement_code , contract_code,sign_time, SELECT bai.agreement_id, bai.agreement_code , contract_code,sign_time,
bu.unit_id,bu.unit_name , bp.pro_id as projectId , bp.pro_name as projectName, bu.unit_id,bu.unit_name , bp.pro_id as projectId , bp.pro_name as projectName,
plan_start_time,lease_day,auth_person,phone,bai.remark,bai.protocol,tta.task_id plan_start_time,lease_day,auth_person,phone,bai.remark,bai.protocol,tta.task_id,bai.branch_project as branchProIdsStr
FROM bm_agreement_info bai FROM bm_agreement_info bai
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id
LEFT JOIN bm_unit bu ON bu.unit_id = bai.unit_id LEFT JOIN bm_unit bu ON bu.unit_id = bai.unit_id
@ -78,13 +78,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
project_id, create_by, lease_day, project_id, create_by, lease_day,
plan_start_time, contract_code, auth_person, plan_start_time, contract_code, auth_person,
phone, create_time, update_by, phone, create_time, update_by,
update_time, remark, company_id, protocol update_time, remark, company_id, protocol,
branch_project
) )
values (#{agreementCode,jdbcType=VARCHAR}, #{signTime,jdbcType=VARCHAR}, #{unitId,jdbcType=INTEGER}, values (#{agreementCode,jdbcType=VARCHAR}, #{signTime,jdbcType=VARCHAR}, #{unitId,jdbcType=INTEGER},
#{projectId,jdbcType=INTEGER}, #{createBy,jdbcType=VARCHAR}, #{leaseDay,jdbcType=INTEGER}, #{projectId,jdbcType=INTEGER}, #{createBy,jdbcType=VARCHAR}, #{leaseDay,jdbcType=INTEGER},
#{planStartTime,jdbcType=TIMESTAMP}, #{contractCode,jdbcType=VARCHAR}, #{authPerson,jdbcType=VARCHAR}, #{planStartTime,jdbcType=TIMESTAMP}, #{contractCode,jdbcType=VARCHAR}, #{authPerson,jdbcType=VARCHAR},
#{phone,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{protocol,jdbcType=VARCHAR} #{updateTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{protocol,jdbcType=VARCHAR},
#{branchProIdsStr,jdbcType=VARCHAR}
) )
</insert> </insert>
@ -109,6 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="protocol != null">protocol = #{protocol},</if> <if test="protocol != null">protocol = #{protocol},</if>
<if test="isSlt != null">is_slt = #{isSlt},</if> <if test="isSlt != null">is_slt = #{isSlt},</if>
<if test="branchProIdsStr != null">branch_project = #{branchProIdsStr},</if>
</trim> </trim>
where agreement_id = #{agreementId} where agreement_id = #{agreementId}
</update> </update>
@ -142,4 +145,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE WHERE
agreement_id = #{agreementId} agreement_id = #{agreementId}
</select> </select>
<select id="getDictLabel" resultType="java.lang.String">
select dict_label as dictLabel
from sys_dict_data sdd
where sdd.dict_type="branch_project" and sdd.dict_value = #{id} and sdd.`status` = 0
</select>
</mapper> </mapper>

View File

@ -243,6 +243,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and mm.ma_status in (1) and mm.ma_status in (1)
GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt1.type_id GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt1.type_id
WHERE bscd.config_id = #{configId}) a WHERE bscd.config_id = #{configId}) a
where a.storageNum !=0
</select> </select>
</mapper> </mapper>

View File

@ -61,7 +61,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
task_id, task_id,
</if> </if>
<if test="createBy != null"> <if test="createBy != null">
create_by, create_by,bind_user,
</if>
<if test="outFacCode != null">
out_fac_code,
</if> </if>
create_time, create_time,
del_flag, del_flag,
@ -84,7 +87,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{taskId}, #{taskId},
</if> </if>
<if test="createBy != null"> <if test="createBy != null">
#{createBy}, #{createBy},#{createBy},
</if>
<if test="outFacCode != null">
#{outFacCode},
</if> </if>
NOW(), NOW(),
0, 0,

View File

@ -37,9 +37,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join sys_user su on pmi.bind_user = su.user_id left join sys_user su on pmi.bind_user = su.user_id
</sql> </sql>
<select id="selectPurchaseMacodeInfoList" parameterType="com.bonus.material.purchase.domain.PurchaseMacodeInfo" resultMap="PurchaseMacodeInfoResult"> <select id="selectPurchaseMacodeInfoList" parameterType="com.bonus.material.purchase.domain.PurchaseMacodeInfo" resultType="com.bonus.material.purchase.domain.PurchaseMacodeInfo">
<include refid="selectPurchaseMacodeInfoVo"/> select pmi.id, pmi.task_id as taskId, pmi.type_id as typeId, pmi.ma_code as maCode, pmi.qr_code as qrCode, if(mm.ma_status = '0' or mm.ma_status = '5' or mm.ma_status = '9', 0, 1) as status,
<where> su.nick_name as createBy, pmi.create_time as createTime, pmi.update_by as updateBy, pmi.update_time as updateTime, pmi.remark, pmi.company_id as companyId, pmi.out_fac_code as outFacCode,
mt.type_name as typeName, mt.unit_name as unitName, mtp.type_name as maTypeName, pcd.production_time as productionTime
from bm_qrcode_info pmi
left join ma_type mt on pmi.type_id = mt.type_id
left join ma_type mtp on mt.parent_id = mtp.type_id
left join purchase_check_details pcd on pmi.task_id = pcd.task_id and pmi.type_id = pcd.type_id
left join ma_machine mm on pmi.type_id = mm.type_id and pmi.ma_code = mm.ma_code
left join sys_user su on pmi.bind_user = su.user_id
where
1=1
<if test="taskId != null ">and pmi.task_id = #{taskId}</if> <if test="taskId != null ">and pmi.task_id = #{taskId}</if>
<if test="typeId != null "> and pmi.type_id = #{typeId}</if> <if test="typeId != null "> and pmi.type_id = #{typeId}</if>
<if test="maCode != null and maCode != ''"> and pmi.ma_code = #{maCode}</if> <if test="maCode != null and maCode != ''"> and pmi.ma_code = #{maCode}</if>
@ -53,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and (pmi.ma_code like concat('%', #{keyWord}, '%') or pmi.qr_code like concat('%', #{keyWord}, '%')) and (pmi.ma_code like concat('%', #{keyWord}, '%') or pmi.qr_code like concat('%', #{keyWord}, '%'))
</if> </if>
and pmi.ma_code is not null and pmi.ma_code is not null
</where>
</select> </select>
<select id="selectPurchaseMacodeInfoById" parameterType="Long" resultMap="PurchaseMacodeInfoResult"> <select id="selectPurchaseMacodeInfoById" parameterType="Long" resultMap="PurchaseMacodeInfoResult">