diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmAgreementInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmAgreementInfo.java index 245a90bc..2798afee 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmAgreementInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmAgreementInfo.java @@ -134,4 +134,10 @@ public class BmAgreementInfo extends BaseEntity @ApiModelProperty(value = "附件列表") private List bmFileInfos; + + @ApiModelProperty(value = "分布工程列表") + private int[] branchProIds; + + @ApiModelProperty(value = "分布工程字符串") + private String branchProIdsStr; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/mapper/BmAgreementInfoMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/mapper/BmAgreementInfoMapper.java index 280e11d0..286921bf 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/mapper/BmAgreementInfoMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/mapper/BmAgreementInfoMapper.java @@ -70,4 +70,6 @@ public interface BmAgreementInfoMapper * @return */ int selectByagreementId(Long agreementId); + + String getDictLabel(int id); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmAgreementInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmAgreementInfoServiceImpl.java index df18089e..2d27f0d3 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmAgreementInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmAgreementInfoServiceImpl.java @@ -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 selectBmAgreementInfoList(BmAgreementInfo bmAgreementInfo) { - return bmAgreementInfoMapper.selectBmAgreementInfoList(bmAgreementInfo); + List 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(); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/purchase/controller/PurchaseMacodeInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/purchase/controller/PurchaseMacodeInfoController.java index b0e4529f..34f63491 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/purchase/controller/PurchaseMacodeInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/purchase/controller/PurchaseMacodeInfoController.java @@ -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 list = purchaseMacodeInfoService.selectPurchaseMacodeInfoList(purchaseMacodeInfo); - return getDataTable(list); + return success(list); } /** diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/purchase/service/impl/PurchaseMacodeInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/purchase/service/impl/PurchaseMacodeInfoServiceImpl.java index 3e93712b..ca79d4a9 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/purchase/service/impl/PurchaseMacodeInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/purchase/service/impl/PurchaseMacodeInfoServiceImpl.java @@ -53,7 +53,8 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService */ @Override public List selectPurchaseMacodeInfoList(PurchaseMacodeInfo purchaseMacodeInfo) { - return purchaseMacodeInfoMapper.selectPurchaseMacodeInfoList(purchaseMacodeInfo); + List list = purchaseMacodeInfoMapper.selectPurchaseMacodeInfoList(purchaseMacodeInfo); + return list; } /** diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmAgreementInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmAgreementInfoMapper.xml index 4c0ca091..e6f78732 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmAgreementInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmAgreementInfoMapper.xml @@ -29,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 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} ) @@ -109,6 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" status = #{status}, protocol = #{protocol}, is_slt = #{isSlt}, + branch_project = #{branchProIdsStr}, where agreement_id = #{agreementId} @@ -142,4 +145,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" WHERE agreement_id = #{agreementId} + + \ No newline at end of file diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/StandardConfigManageMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/StandardConfigManageMapper.xml index abb37a5c..74b6efc5 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/StandardConfigManageMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/StandardConfigManageMapper.xml @@ -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 diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/purchase/PurchaseBindMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/purchase/PurchaseBindMapper.xml index 5f6520a3..7e264ece 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/purchase/PurchaseBindMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/purchase/PurchaseBindMapper.xml @@ -61,7 +61,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" task_id, - create_by, + create_by,bind_user, + + + out_fac_code, create_time, del_flag, @@ -84,7 +87,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{taskId}, - #{createBy}, + #{createBy},#{createBy}, + + + #{outFacCode}, NOW(), 0, diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/purchase/PurchaseMacodeInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/purchase/PurchaseMacodeInfoMapper.xml index 2638e96c..34df1153 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/purchase/PurchaseMacodeInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/purchase/PurchaseMacodeInfoMapper.xml @@ -37,10 +37,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join sys_user su on pmi.bind_user = su.user_id - + 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 + and pmi.task_id = #{taskId} and pmi.type_id = #{typeId} and pmi.ma_code = #{maCode} and pmi.out_fac_code = #{outFacCode} @@ -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 is not null - +