bug修复
This commit is contained in:
parent
de0957f63b
commit
b66eb4b9fe
|
|
@ -134,4 +134,10 @@ public class BmAgreementInfo extends BaseEntity
|
|||
|
||||
@ApiModelProperty(value = "附件列表")
|
||||
private List<BmFileInfo> bmFileInfos;
|
||||
|
||||
@ApiModelProperty(value = "分布工程列表")
|
||||
private int[] branchProIds;
|
||||
|
||||
@ApiModelProperty(value = "分布工程字符串")
|
||||
private String branchProIdsStr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,4 +70,6 @@ public interface BmAgreementInfoMapper
|
|||
* @return
|
||||
*/
|
||||
int selectByagreementId(Long agreementId);
|
||||
|
||||
String getDictLabel(int id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.material.basic.service.impl;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
|
@ -46,6 +47,23 @@ public class BmAgreementInfoServiceImpl implements IBmAgreementInfoService
|
|||
public BmAgreementInfo selectBmAgreementInfoByAgreementId(Long 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)) {
|
||||
BmFileInfo bmFileInfo = new BmFileInfo();
|
||||
bmFileInfo.setModelId(bmAgreementInfo.getAgreementId());
|
||||
|
|
@ -65,7 +83,26 @@ public class BmAgreementInfoServiceImpl implements IBmAgreementInfoService
|
|||
@Override
|
||||
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.setSignTime(DateUtils.getNowDate());
|
||||
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);
|
||||
if (count > 0) {
|
||||
if (CollectionUtils.isEmpty(bmAgreementInfo.getBmFileInfos())) {
|
||||
|
|
@ -136,6 +186,21 @@ public class BmAgreementInfoServiceImpl implements IBmAgreementInfoService
|
|||
}
|
||||
}
|
||||
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);
|
||||
if (count > 0) {
|
||||
BmFileInfo bmFileInfoToDelete = new BmFileInfo();
|
||||
|
|
|
|||
|
|
@ -37,10 +37,10 @@ public class PurchaseMacodeInfoController extends BaseController {
|
|||
@ApiOperation(value = "查询新购验收编号管理列表")
|
||||
@RequiresPermissions("purchase:info:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(PurchaseMacodeInfo purchaseMacodeInfo) {
|
||||
startPage();
|
||||
public AjaxResult list(PurchaseMacodeInfo purchaseMacodeInfo) {
|
||||
// startPage();
|
||||
List<PurchaseMacodeInfo> list = purchaseMacodeInfoService.selectPurchaseMacodeInfoList(purchaseMacodeInfo);
|
||||
return getDataTable(list);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -53,7 +53,8 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
|||
*/
|
||||
@Override
|
||||
public List<PurchaseMacodeInfo> selectPurchaseMacodeInfoList(PurchaseMacodeInfo purchaseMacodeInfo) {
|
||||
return purchaseMacodeInfoMapper.selectPurchaseMacodeInfoList(purchaseMacodeInfo);
|
||||
List<PurchaseMacodeInfo> list = purchaseMacodeInfoMapper.selectPurchaseMacodeInfoList(purchaseMacodeInfo);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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 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,
|
||||
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
|
||||
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_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 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,
|
||||
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
|
||||
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_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,
|
||||
plan_start_time, contract_code, auth_person,
|
||||
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},
|
||||
#{projectId,jdbcType=INTEGER}, #{createBy,jdbcType=VARCHAR}, #{leaseDay,jdbcType=INTEGER},
|
||||
#{planStartTime,jdbcType=TIMESTAMP}, #{contractCode,jdbcType=VARCHAR}, #{authPerson,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>
|
||||
|
||||
|
|
@ -109,6 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="status != null">status = #{status},</if>
|
||||
<if test="protocol != null">protocol = #{protocol},</if>
|
||||
<if test="isSlt != null">is_slt = #{isSlt},</if>
|
||||
<if test="branchProIdsStr != null">branch_project = #{branchProIdsStr},</if>
|
||||
</trim>
|
||||
where agreement_id = #{agreementId}
|
||||
</update>
|
||||
|
|
@ -142,4 +145,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE
|
||||
agreement_id = #{agreementId}
|
||||
</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>
|
||||
|
|
@ -243,6 +243,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and mm.ma_status in (1)
|
||||
GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt1.type_id
|
||||
WHERE bscd.config_id = #{configId}) a
|
||||
where a.storageNum !=0
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -61,7 +61,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
task_id,
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by,
|
||||
create_by,bind_user,
|
||||
</if>
|
||||
<if test="outFacCode != null">
|
||||
out_fac_code,
|
||||
</if>
|
||||
create_time,
|
||||
del_flag,
|
||||
|
|
@ -84,7 +87,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{taskId},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
#{createBy},
|
||||
#{createBy},#{createBy},
|
||||
</if>
|
||||
<if test="outFacCode != null">
|
||||
#{outFacCode},
|
||||
</if>
|
||||
NOW(),
|
||||
0,
|
||||
|
|
|
|||
|
|
@ -37,10 +37,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join sys_user su on pmi.bind_user = su.user_id
|
||||
</sql>
|
||||
|
||||
<select id="selectPurchaseMacodeInfoList" parameterType="com.bonus.material.purchase.domain.PurchaseMacodeInfo" resultMap="PurchaseMacodeInfoResult">
|
||||
<include refid="selectPurchaseMacodeInfoVo"/>
|
||||
<where>
|
||||
<if test="taskId != null "> and pmi.task_id = #{taskId}</if>
|
||||
<select id="selectPurchaseMacodeInfoList" parameterType="com.bonus.material.purchase.domain.PurchaseMacodeInfo" resultType="com.bonus.material.purchase.domain.PurchaseMacodeInfo">
|
||||
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,
|
||||
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="typeId != null "> and pmi.type_id = #{typeId}</if>
|
||||
<if test="maCode != null and maCode != ''"> and pmi.ma_code = #{maCode}</if>
|
||||
<if test="outFacCode != null and outFacCode != ''"> and pmi.out_fac_code = #{outFacCode}</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}, '%'))
|
||||
</if>
|
||||
and pmi.ma_code is not null
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectPurchaseMacodeInfoById" parameterType="Long" resultMap="PurchaseMacodeInfoResult">
|
||||
|
|
|
|||
Loading…
Reference in New Issue