From d5bec70961abc46b565b0aaecdb8b21017a8a8ef Mon Sep 17 00:00:00 2001 From: mashuai Date: Mon, 10 Nov 2025 18:07:32 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/domain/lease/LeaseApplyInfo.java | 13 + .../biz/domain/lease/LeasePublishInfo.java | 10 + .../basic/domain/report/LeaseOutInfo.java | 9 +- .../impl/MaterialMachineServiceImpl.java | 6 + .../lease/mapper/LeaseApplyInfoMapper.java | 60 ++++ .../lease/mapper/LeaseOutDetailsMapper.java | 9 +- .../lease/mapper/LeaseTaskMapper.java | 7 + .../impl/LeaseApplyInfoServiceImpl.java | 111 +++++--- .../impl/LeaseOutDetailsServiceImpl.java | 14 +- .../service/impl/LeaseTaskServiceImpl.java | 16 ++ .../material/lease/LeaseApplyInfoMapper.xml | 269 +++++++++++++++--- .../material/lease/LeaseOutDetailsMapper.xml | 15 +- .../mapper/material/lease/LeaseTaskMapper.xml | 13 +- 13 files changed, 459 insertions(+), 93 deletions(-) diff --git a/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/lease/LeaseApplyInfo.java b/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/lease/LeaseApplyInfo.java index 890f4e73..2fb83851 100644 --- a/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/lease/LeaseApplyInfo.java +++ b/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/lease/LeaseApplyInfo.java @@ -3,6 +3,7 @@ package com.bonus.common.biz.domain.lease; import java.math.BigDecimal; import java.util.Date; import java.util.List; +import java.util.Set; import com.bonus.common.biz.domain.BmFileInfo; import com.fasterxml.jackson.annotation.JsonFormat; @@ -369,4 +370,16 @@ public class LeaseApplyInfo extends BaseEntity{ @ApiModelProperty(value = "项目部名称") private String departName; + + @ApiModelProperty(value = "绳索类出库量") + private BigDecimal ropeNum; + + @ApiModelProperty(value = "计件类出库量") + private BigDecimal inCountNum; + + @ApiModelProperty(value = "附件配件类出库量") + private BigDecimal fileTypeNum; + + @ApiModelProperty(value = "附件配件类四级类型id集合") + private Set typeIdSet; } diff --git a/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/lease/LeasePublishInfo.java b/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/lease/LeasePublishInfo.java index be64a845..8ef3c971 100644 --- a/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/lease/LeasePublishInfo.java +++ b/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/lease/LeasePublishInfo.java @@ -276,4 +276,14 @@ public class LeasePublishInfo extends BaseEntity{ @ApiModelProperty(value = "一级类型id") private String firstId; + + @ApiModelProperty(value = "是否授权 0 已授权,1 空") + @Excel(name = "是否授权", readConverterExp = "0=已授权,1=空") + private Integer isAuth; + + @ApiModelProperty(value = "授权书名称") + private String fileName; + + @ApiModelProperty(value = "授权书路径") + private String fileUrl; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/LeaseOutInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/LeaseOutInfo.java index 26ea6e20..855f83a8 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/LeaseOutInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/LeaseOutInfo.java @@ -4,6 +4,7 @@ import com.bonus.common.core.annotation.Excel; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.apache.poi.ss.usermodel.HorizontalAlignment; import java.math.BigDecimal; import java.util.Date; @@ -38,15 +39,15 @@ public class LeaseOutInfo { private String unitName; @ApiModelProperty(value = "领料数量") - @Excel(name = "领料数量") + @Excel(name = "领料数量", cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT) private BigDecimal leaseNum; @ApiModelProperty(value = "出库数量") - @Excel(name = "出库数量") + @Excel(name = "出库数量", cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT) private BigDecimal outNum; @ApiModelProperty(value = "待出库数量") - @Excel(name = "待出库数量") + @Excel(name = "待出库数量", cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT) private BigDecimal pendingOutNum; @ApiModelProperty(value = "领料日期") @@ -64,7 +65,7 @@ public class LeaseOutInfo { private String leaseUnitName; @ApiModelProperty(value = "领料工程") - @Excel(name = "领料工程") + @Excel(name = "领料工程", width = 40) private String leaseProjectName; @ApiModelProperty(value = "领料人") diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialMachineServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialMachineServiceImpl.java index 3f2ef03f..65e2a127 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialMachineServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialMachineServiceImpl.java @@ -1122,6 +1122,12 @@ public class MaterialMachineServiceImpl implements MaterialMachineService { if (!CollectionUtils.isEmpty(projectIdList)) { bean.setProjectIdList(projectIdList); } + } else { + // 根据用户名查询是否为技术员或项目总工,进行项目部条件过滤 + List departList = mapper.getDepartList(username); + if (!CollectionUtils.isEmpty(departList)) { + bean.setDepartIdList(departList); + } } // 部门查询赋值 extractedDept(bean); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseApplyInfoMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseApplyInfoMapper.java index c4f1f8e3..734fac6c 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseApplyInfoMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseApplyInfoMapper.java @@ -1,5 +1,6 @@ package com.bonus.material.lease.mapper; +import java.math.BigDecimal; import java.util.List; import com.bonus.common.biz.domain.lease.LeaseApplyInfo; import com.bonus.common.biz.domain.lease.LeaseConfirmSign; @@ -173,6 +174,8 @@ public interface LeaseApplyInfoMapper { /** * 查询领用单的领用单出库签名 * @param id + * @param leaseSignId + * @param publishTask * @return */ List selectOutList(@Param("id") Long id, @Param("leaseSignId") String leaseSignId, @Param("publishTask") String publishTask); @@ -252,4 +255,61 @@ public interface LeaseApplyInfoMapper { * @return */ int updateLeasePublish(LeaseApplyDetails leaseApplyDetails); + + /** + * 10.29号修改为查询已签名领用发布数据,供于出库 + * @param leaseApplyInfo + * @return + */ + List getSignPublishList(LeaseApplyInfo leaseApplyInfo); + + /** + * 领用签名 + * @param id + * @param publishTask + * @return + */ + List getPublishSign(@Param("id") Long id, @Param("publishTask") String publishTask); + + /** + * 领料签名 + * @param id + * @return + */ + List getLeaseSign(Long id); + + /** + * 根据i8工程id查询项目部 + * @param externalId + * @return + */ + String getDeptName(String externalId); + + /** + * 查询附件配件类四级id + * @param leaseApplyInfo + * @return + */ + String getTypeIds(LeaseApplyInfo leaseApplyInfo); + + /** + * 查询附件配件类出库数量 + * @param leaseApplyInfo + * @return + */ + BigDecimal getTypeNum(LeaseApplyInfo leaseApplyInfo); + + /** + * 查询绳索类出库量出库数量 + * @param leaseApplyInfo + * @return + */ + BigDecimal getRopeNum(LeaseApplyInfo leaseApplyInfo); + + /** + * 查询计件类类出库数量 + * @param leaseApplyInfo + * @return + */ + BigDecimal getInCountNum(LeaseApplyInfo leaseApplyInfo); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseOutDetailsMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseOutDetailsMapper.java index 6d5f360c..25175833 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseOutDetailsMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseOutDetailsMapper.java @@ -105,9 +105,16 @@ public interface LeaseOutDetailsMapper { int updateMachine(LeaseOutDetails record); /** - * 修改领料出库详细 + * 领用电子签名 * @param leaseApplyInfo * @return */ int updateLeaseOutSign(LeaseApplyInfo leaseApplyInfo); + + /** + * 领料电子签名 + * @param leaseApplyInfo + * @return + */ + int updateLeaseSignInfo(LeaseApplyInfo leaseApplyInfo); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseTaskMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseTaskMapper.java index 8f5a4ebd..f04e6ef0 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseTaskMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseTaskMapper.java @@ -349,4 +349,11 @@ public interface LeaseTaskMapper { * @return */ LeaseApplyInfo getIdByBusinessCode(LeaseApplyInfo leaseApplyInfo); + + /** + * 根据id去授权表中查询是否已经授权 + * @param id + * @return + */ + LeasePublishInfo getIsAuth(Long id); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java index e03e0264..5287030d 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java @@ -9,17 +9,14 @@ import java.util.stream.Collectors; import com.bonus.common.biz.constant.GlobalConstants; import com.bonus.common.biz.enums.*; -import com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo; +import com.bonus.material.basic.domain.BmAgreementInfo; +import com.bonus.material.basic.mapper.BmAgreementInfoMapper; import com.bonus.material.common.mapper.SelectMapper; import lombok.extern.slf4j.Slf4j; import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.json.JSONObject; -import com.ah.sbd.SmsTool; -import com.ah.sbd.utils.param.BatchSmsByContentParam; import com.bonus.common.biz.config.DateTimeHelper; import com.bonus.common.biz.config.PoiOutPage; -import com.bonus.common.biz.constant.BmConfigItems; import com.bonus.common.biz.constant.MaterialConstants; import com.bonus.common.biz.domain.BmFileInfo; import com.bonus.common.biz.domain.lease.*; @@ -91,6 +88,9 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { @Resource private SelectMapper selectMapper; + @Resource + private BmAgreementInfoMapper bmAgreementInfoMapper; + /** * 查询领料任务 * @@ -313,6 +313,15 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { // 步骤12: 查询领料人电子签名详情 long step12Start = System.currentTimeMillis(); List signList = leaseApplyInfoMapper.selectOutList(id, null, publishTask); + if (CollectionUtils.isEmpty(signList)) { + if (StringUtils.isNotBlank(publishTask)) { + // 领用签名 + signList = leaseApplyInfoMapper.getPublishSign(id, publishTask); + } else { + // 领料签名 + signList = leaseApplyInfoMapper.getLeaseSign(id); + } + } if (!CollectionUtils.isEmpty(signList)) { for (LeaseOutSign applyInfo : signList) { if (StringUtils.isNotBlank(applyInfo.getOutSignUrl())) { @@ -564,6 +573,15 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { // 步骤12: 查询领料人电子签名详情 long step12Start = System.currentTimeMillis(); List signList = leaseApplyInfoMapper.selectOutList(id, null, publishTask); + if (CollectionUtils.isEmpty(signList)) { + if (StringUtils.isNotBlank(publishTask)) { + // 领用签名 + signList = leaseApplyInfoMapper.getPublishSign(id, publishTask); + } else { + // 领料签名 + signList = leaseApplyInfoMapper.getLeaseSign(id); + } + } if (!CollectionUtils.isEmpty(signList)) { for (LeaseOutSign applyInfo : signList) { if (StringUtils.isNotBlank(applyInfo.getOutSignUrl())) { @@ -764,6 +782,15 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { Set statusSet = CollectionUtils.isEmpty(statusList) ? Collections.emptySet() : new HashSet<>(statusList); + if (!CollectionUtils.isEmpty(statusSet)) { + if ((leaseApplyInfo.getStatusList().contains(3) && !leaseApplyInfo.getStatusList().contains(1)) + || leaseApplyInfo.getStatusList().containsAll(Arrays.asList(3, 4, 5))) { + // 过滤sortedList中leaseSignUrl或者leaseSignId不为空的数据 + sortedList = sortedList.stream() + .filter(item -> StringUtils.isNotBlank(item.getSignUrl()) || item.getSignId() != null) + .collect(Collectors.toList()); + } + } sortedList = sortedList.stream() // 关键词 @@ -807,12 +834,24 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { * @param list */ private void extracted(LeaseApplyInfo leaseApplyInfo, List list) { - // 查询领用出库数据 + //todo 查询领用出库数据, 10.29号修改为查询已签名领用发布数据,供于出库 List leaseApplyOutList = leaseApplyInfoMapper.selectPublishList(leaseApplyInfo); if (!CollectionUtils.isEmpty(leaseApplyOutList)) { list.addAll(leaseApplyOutList); } for (LeaseApplyInfo applyInfo : list) { + // 判断协议号是否为空 + if (StringUtils.isBlank(applyInfo.getAgreementCode())) { + if (applyInfo.getLeaseUnit() != null && applyInfo.getLeaseProjectId() != null) { + BmAgreementInfo bmAgreementInfo = new BmAgreementInfo(); + bmAgreementInfo.setUnitId(Long.valueOf(applyInfo.getLeaseUnitId())); + bmAgreementInfo.setProjectId(Long.valueOf(applyInfo.getLeaseProjectId())); + BmAgreementInfo info = bmAgreementInfoMapper.queryByTeamIdAndProjectId(bmAgreementInfo); + if (info != null) { + applyInfo.setAgreementCode(info.getAgreementCode()); + } + } + } if (applyInfo.getTaskStatus() != null && (applyInfo.getTaskStatus() == 1 || applyInfo.getTaskStatus() == 4)) { continue; } @@ -1031,7 +1070,21 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { */ @Override public LeaseApplyInfo getOutNum(LeaseApplyInfo leaseApplyInfo) { - return leaseApplyInfoMapper.getOutNum(leaseApplyInfo); + LeaseApplyInfo info = leaseApplyInfoMapper.getOutNum(leaseApplyInfo); + // 查询附件配件类四级id + String typeIds = leaseApplyInfoMapper.getTypeIds(leaseApplyInfo); + // 查询附件配件类出库数量 + Set typeIdSet = new HashSet<>(Arrays.asList(typeIds.split(","))); + leaseApplyInfo.setTypeIdSet(typeIdSet); + BigDecimal fileTypeNum = leaseApplyInfoMapper.getTypeNum(leaseApplyInfo); + info.setFileTypeNum(fileTypeNum); + // 查询绳索类出库量出库数量,剔除附件配件类 + BigDecimal ropeNum = leaseApplyInfoMapper.getRopeNum(leaseApplyInfo); + info.setRopeNum(ropeNum); + // 查询计件类类出库数量,剔除附件配件类 + BigDecimal inCountNum = leaseApplyInfoMapper.getInCountNum(leaseApplyInfo); + info.setInCountNum(inCountNum); + return info; } @Override @@ -1706,45 +1759,25 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { @Override public int updateLeaseApplyInfoSign(LeaseApplyInfo leaseApplyInfo) { int result = 0; - Long userid = SecurityUtils.getLoginUser().getUserid(); - String nickName = SecurityUtils.getLoginUser().getSysUser().getNickName(); - leaseApplyInfo.setSignPerson(nickName); - leaseApplyInfo.setCreateBy(userid.toString()); - leaseApplyInfo.setCreateTime(DateUtils.getNowDate()); - // 新增领料签字表lease_sign_info - result = leaseApplyInfoMapper.insertLeaseSign(leaseApplyInfo); - if (result == 0) { - throw new RuntimeException("添加签名信息失败"); - } - // 往lease_out_details表增加新增签字id字段 + // 根据领料或者领用,往相对应表新增签名信息 if (StringUtils.isNotBlank(leaseApplyInfo.getIds())) { String[] ids = leaseApplyInfo.getIds().split(","); for (String id : ids) { leaseApplyInfo.setId(Long.parseLong(id)); - result = leaseOutDetailsMapper.updateLeaseOutSign(leaseApplyInfo); - if (result == 0) { - throw new RuntimeException("修改领料签字信息失败"); + leaseApplyInfo.setCreateTime(DateUtils.getNowDate()); + if (StringUtils.isNotBlank(leaseApplyInfo.getPublishTask())) { + result = leaseOutDetailsMapper.updateLeaseOutSign(leaseApplyInfo); + if (result == 0) { + throw new RuntimeException("修改领料签字信息失败"); + } + } else { + result = leaseOutDetailsMapper.updateLeaseSignInfo(leaseApplyInfo); + if (result == 0) { + throw new RuntimeException("修改领料签字信息失败"); + } } } } - - List userList = leaseApplyInfoMapper.getUserList(leaseApplyInfo); - // 省公司短信发送 - List mobileList = new ArrayList<>(); - if(userList !=null && !userList.isEmpty()) { - for (LeaseApplyInfo item : userList){ - LeaseApplyInfo item1 = leaseApplyInfoMapper.getUserPhoneById(item); - mobileList.add(item1.getPhone()); - } - } - if (!mobileList.isEmpty()){ - JSONObject sendResult = SmsTool.sendSms(new BatchSmsByContentParam(mobileList, "您有一条待确认的领料信息,请尽快登录机具系统进行确认!"), BmConfigItems.ANHUI_COMPANY_SMS_KEY); - if (sendResult != null) { - // 短信发送成功 - result =1; - } - } - return result; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseOutDetailsServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseOutDetailsServiceImpl.java index e021b722..219b4517 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseOutDetailsServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseOutDetailsServiceImpl.java @@ -219,10 +219,13 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService { String taskId = leaseApplyInfoMapper.getTaskId(record.getParentId()); record.setTaskId(taskId); + if (Boolean.FALSE.equals(record.getLeaseUnitIsTeam())) { + record.setSource(DIRECT_RESOURCE); + } // 判断如果是班组领料,则插入原本项目部的协议结算记录 - if (record.getLeaseUnitIsTeam() != null && record.getLeaseUnitIsTeam()) { - // 设置数据来源是2(班组同步) - record.setSource(SYNC_RESOURCE); + if (Boolean.TRUE.equals(record.getLeaseUnitIsTeam())) { + // 设置数据来源是1(项目部数据) + record.setSource(DIRECT_RESOURCE); // 暂存现在出库的班组单位ID Integer thisOutId = record.getLeaseUnitId(); // 查询班组挂靠的项目部协议ID @@ -240,15 +243,14 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService { // 插入项目部领料的结算记录 int inserts = insSltInfo(taskId, record); System.out.println("插入原本项目部领料结算记录" + (inserts > GlobalConstants.INT_0 ? "成功" : "失败")); - + // 班组直领数据赋值2 + record.setSource(SYNC_RESOURCE); // 恢复出库班组单位ID record.setLeaseUnitId(thisOutId); record.setLeaseUnitIsTeam(false); // 设置可退还数量是0,因为默认全部发给班组了,不允许项目部协议直接退,要等班组退还到项目部后才能恢复 record.setReturnNum(BigDecimal.ZERO); } - // 设置数据来源是1(直领) - record.setSource(DIRECT_RESOURCE); res = insSltInfo(taskId, record); if (res == GlobalConstants.INT_0) { throw new RuntimeException("出库失败,插入结算记录失败"); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java index eeff22c9..10f4969e 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java @@ -497,6 +497,11 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService { String sendUnit = leaseApplyInfoMapper.getSendUnit(info); info.setSendUnit(sendUnit); } + // 根据i8工程id查询项目部 + if (StringUtils.isNotBlank(info.getExternalId())) { + String deptName = leaseApplyInfoMapper.getDeptName(info.getExternalId()); + info.setDepartName(deptName); + } /** 设置发料单位 防止代码冲突 **/ leaseApplyRequestVo.setLeaseApplyInfo(info); @@ -973,6 +978,17 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService { }) .collect(Collectors.toList()); } + list.forEach(item -> { + // 根据id去授权表中查询是否已经授权 + LeasePublishInfo info = mapper.getIsAuth(item.getId()); + if (info != null) { + item.setIsAuth(0); + item.setFileName(info.getFileName()); + item.setFileUrl(info.getFileUrl()); + } else { + item.setIsAuth(1); + } + }); String keyWord = leaseApplyInfo.getKeyWord(); // 如果关键字不为空,进行过滤 if (!StringUtils.isBlank(keyWord)) { diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml index 307ec1cb..dd136f43 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml @@ -62,12 +62,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" COALESCE(lai.release_time, lai.create_time) as releaseTime, GROUP_CONCAT(DISTINCT mt3.type_id) as firstId, su.sign_type as lease_sign_type, - su.sign_url as lease_sign_url + su.sign_url as lease_sign_url, + lod.lease_sign_id as signId, + lad.lease_sign_url as signUrl from lease_apply_info lai left join tm_task tt on lai.task_id = tt.task_id left join lease_apply_details lad on lai.id = lad.parent_id - LEFT JOIN (SELECT parent_id,type_id ,IFNULL( sum( out_num ), 0 ) as num FROM lease_out_details + LEFT JOIN (SELECT parent_id,type_id ,IFNULL( sum( out_num ), 0 )as num, lease_sign_id FROM lease_out_details GROUP BY parent_id,type_id) lod ON lai.id = lod.parent_id and lad.type_id = lod.type_id left join tm_task_agreement tta on lai.task_id = tta.task_id left join bm_agreement_info bai on tta.agreement_id = bai.agreement_id @@ -348,12 +350,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" lai.confirm_remark AS confirmRemark, mt3.type_id AS firstId, lpd.create_time AS releaseTime, - lpd.parent_id AS parentId + lpd.parent_id AS parentId, + lpd.lease_sign_url AS signUrl, + lod.lease_sign_id AS signId FROM lease_publish_details lpd LEFT JOIN lease_apply_info lai ON lai.id = lpd.parent_id LEFT JOIN tm_task tt ON lai.task_id = tt.task_id - LEFT JOIN (SELECT IFNULL( sum(out_num ), 0) AS num, parent_id, publish_task from lease_out_details a + LEFT JOIN (SELECT IFNULL( sum(out_num ), 0) AS num, parent_id, publish_task, lease_sign_id from lease_out_details a JOIN ma_type_keeper mtk ON mtk.type_id = a.type_id AND mtk.user_id = #{userId} @@ -557,7 +561,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT - GROUP_CONCAT( DISTINCT lod.id ) AS ids, + GROUP_CONCAT( DISTINCT lpd.id ) AS ids, lai.id AS id, - a.`code` AS CODE, + lpd.`code` AS CODE, lai.create_by AS createBy, lai.create_time AS createTime, - a.lease_person AS leasePerson, + lpd.lease_person AS leasePerson, lai.phone AS phone, - a.unit_id AS leaseUnitId, - a.project_id AS leaseProjectId, + lpd.unit_id AS leaseUnitId, + lpd.project_id AS leaseProjectId, bu.unit_name AS leaseUnit, bp.pro_name AS leaseProject, bai.agreement_code AS agreementCode, - IFNULL( sum( lod.out_num ), 0 ) AS alNum, + IFNULL( sum( lpd.num ), 0 ) AS alNum, GROUP_CONCAT( DISTINCT mt1.type_name ) AS maTypeNames, lai.task_id AS taskId, tt.task_type AS taskType, bp.external_id AS externalId, bu.bzz_idcard AS idCard, mt4.type_id AS firstId, - a.create_time AS releaseTime, - lod.publish_task AS publishTask + lpd.create_time AS releaseTime, + lpd.publish_task AS publishTask FROM - lease_out_details lod - LEFT JOIN lease_apply_info lai ON lai.id = lod.parent_id + lease_publish_details lpd + LEFT JOIN lease_apply_info lai ON lai.id = lpd.parent_id + LEFT JOIN (SELECT parent_id, publish_task, lease_sign_id FROM lease_out_details GROUP BY + parent_id,publish_task) lod ON lpd.parent_id = lod.parent_id + and lod.publish_task = lpd.publish_task LEFT JOIN tm_task tt ON lai.task_id = tt.task_id - LEFT JOIN (SELECT parent_id, unit_id,project_id,create_time,`code`,publish_task,lease_person from lease_publish_details - GROUP BY parent_id,publish_task) a ON a.parent_id = lod.parent_id - and a.publish_task = lod.publish_task - LEFT JOIN bm_unit bu ON bu.unit_id = a.unit_id - LEFT JOIN bm_project bp ON bp.pro_id = a.project_id - LEFT JOIN bm_agreement_info bai ON a.unit_id = bai.unit_id - AND a.project_id = bai.project_id - LEFT JOIN ma_type mt ON lod.type_id = mt.type_id + LEFT JOIN bm_unit bu ON bu.unit_id = lpd.unit_id + LEFT JOIN bm_project bp ON bp.pro_id = lpd.project_id + LEFT JOIN bm_agreement_info bai ON lpd.unit_id = bai.unit_id + AND lpd.project_id = bai.project_id + LEFT JOIN ma_type mt ON lpd.new_type = mt.type_id AND mt.del_flag = '0' LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id AND mt1.del_flag = '0' LEFT JOIN ma_type mt3 ON mt1.parent_id = mt3.type_id and mt3.del_flag = '0' LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id and mt4.del_flag = '0' WHERE - lod.lease_sign_id is null and lai.direct_id is null - and tt.task_type = '19' + lpd.lease_sign_url is null and lai.direct_id is null + and tt.task_type = '19' and lod.lease_sign_id is null GROUP BY - lod.parent_id, - lod.publish_task + lpd.parent_id, + lpd.publish_task ORDER BY - lod.create_time DESC + lpd.create_time DESC SELECT - IFNULL(SUM(out_num), 0) as alNum + IFNULL(SUM(lod.out_num), 0) as alNum FROM - lease_out_details - where 1 = 1 + lease_out_details lod + LEFT JOIN lease_apply_info lai on lod.parent_id = lai.id + where lai.direct_id is null - and create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') + and lod.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') @@ -964,4 +972,185 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" parent_id = #{parentId} and new_type = #{newTypeId} + + + + + + + + + + + + + + + diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseOutDetailsMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseOutDetailsMapper.xml index 6ccc4fd0..32730063 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseOutDetailsMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseOutDetailsMapper.xml @@ -272,10 +272,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{maId} - update lease_out_details + update lease_publish_details update_time = #{createTime}, - lease_sign_id = #{leaseSignId}, + lease_sign_url = #{leaseSignUrl}, + lease_sign_type = #{leaseSignType}, + + where id = #{id} + + + + update lease_apply_details + + update_time = #{createTime}, + lease_sign_url = #{leaseSignUrl}, + lease_sign_type = #{leaseSignType}, where id = #{id} diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml index 0a1894c6..925da796 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml @@ -505,7 +505,8 @@ IFNULL(sum(lad.al_num),0) as alNum, GROUP_CONCAT(DISTINCT mt1.type_name) AS maTypeNames, bp.contract_part as contractPart, - sd.dept_name as impUnitName + sd.dept_name as impUnitName, + bp.external_id as externalId from lease_apply_info lai left join tm_task tt on lai.task_id = tt.task_id @@ -1331,4 +1332,14 @@ WHERE `code`=#{businessCode} + +