From eede50bdd6747778cbda3d1c73dcaa5d5176807e Mon Sep 17 00:00:00 2001 From: mashuai Date: Fri, 13 Jun 2025 14:48:14 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E9=80=80=E6=96=99=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/constant/MaterialConstants.java | 10 -- .../biz/domain/lease/LeaseApplyInfo.java | 5 + .../app/controller/IwsTeamUserController.java | 26 +-- .../material/app/domain/IwsTeamUserVo.java | 35 ++++ .../app/service/IwsTeamUserService.java | 13 +- .../service/impl/IwsTeamUserServiceImpl.java | 93 ++++++++++- .../material/back/domain/BackApplyInfo.java | 5 + .../impl/BackApplyInfoServiceImpl.java | 11 +- .../basic/controller/BmTeamController.java | 2 +- .../controller/ComplexQueryController.java | 28 +++- .../material/basic/domain/BmProject.java | 6 + .../bonus/material/basic/domain/BmTeam.java | 21 +++ .../basic/domain/RetainedEquipmentInfo.java | 22 +++ .../basic/mapper/ComplexQueryMapper.java | 14 ++ .../material/basic/service/BmTeamService.java | 2 + .../basic/service/ComplexQueryService.java | 16 +- .../basic/service/impl/BmTeamServiceImpl.java | 12 ++ .../service/impl/ComplexQueryServiceImpl.java | 152 ++++++++++++++++-- .../common/controller/SelectController.java | 6 + .../material/common/mapper/SelectMapper.java | 2 + .../common/service/SelectService.java | 7 + .../service/impl/SelectServiceImpl.java | 15 ++ .../lease/domain/LeaseApplyDetails.java | 2 +- .../impl/LeaseApplyInfoServiceImpl.java | 38 ++++- .../mapper/material/app/IwsTeamUserMapper.xml | 14 +- .../material/back/BackApplyInfoMapper.xml | 3 + .../mapper/material/basic/BmTeamMapper.xml | 22 ++- .../material/basic/ComplexQueryMapper.xml | 123 ++++++++++++-- .../mapper/material/common/SelectMapper.xml | 25 ++- .../material/lease/LeaseApplyInfoMapper.xml | 3 + 30 files changed, 644 insertions(+), 89 deletions(-) diff --git a/bonus-common-biz/src/main/java/com/bonus/common/biz/constant/MaterialConstants.java b/bonus-common-biz/src/main/java/com/bonus/common/biz/constant/MaterialConstants.java index da2b618b..9878dd81 100644 --- a/bonus-common-biz/src/main/java/com/bonus/common/biz/constant/MaterialConstants.java +++ b/bonus-common-biz/src/main/java/com/bonus/common/biz/constant/MaterialConstants.java @@ -93,14 +93,4 @@ public class MaterialConstants { */ public static final String LEASE_PUBLISH = "LF"; - /** - * 内部单位协议 - */ - public static final String INNER_PROTOCAL = "1"; - - /** - * 外部单位协议 - */ - public static final String OUTER_PROTOCAL = "2"; - } 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 a354f695..7ab333fd 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 @@ -313,4 +313,9 @@ public class LeaseApplyInfo extends BaseEntity{ @ApiModelProperty(value = "是否电子签名 0 是,1 否") private Integer isElectronicSign; + + /** + * 身份证号码 + */ + private String idCard; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/app/controller/IwsTeamUserController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/app/controller/IwsTeamUserController.java index 29e33525..e9736bad 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/app/controller/IwsTeamUserController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/app/controller/IwsTeamUserController.java @@ -1,11 +1,11 @@ package com.bonus.material.app.controller; import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.common.security.utils.SecurityUtils; +import com.bonus.material.app.domain.IwsTeamUserVo; import com.bonus.material.app.service.IwsTeamUserService; import io.swagger.annotations.ApiModelProperty; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -27,18 +27,26 @@ public class IwsTeamUserController { @GetMapping("/selectUserInfoByUserName") public AjaxResult selectUserInfoByUserName(String userName) { if (userName == null || userName.isEmpty()) { - return AjaxResult.error("用户名不能为空"); + userName = SecurityUtils.getLoginUser().getUsername(); } return AjaxResult.success(iwsTeamUserService.selectUserInfoByUserName(userName)); } @ApiModelProperty(value = "根据身份证号码查询班组信息", notes = "根据身份证号码查询班组信息") @GetMapping("/selectProjectTeamInfoByIdCard") - public AjaxResult selectProjectTeamInfoByIdCard(String idCard, String projectIds) { - if (idCard == null || idCard.isEmpty()) { - return AjaxResult.error("身份证号码不能为空"); - } - return AjaxResult.success(iwsTeamUserService.selectProjectTeamInfoByIdCard(idCard, projectIds)); + public AjaxResult selectProjectTeamInfoByIdCard(IwsTeamUserVo dto) { + return AjaxResult.success(iwsTeamUserService.selectProjectTeamInfoByIdCard(dto)); + } + + + /** + * 根据第三方信息修改班组及工程信息 + * @param dto + * @return + */ + @PostMapping("/updateTeamProject") + public AjaxResult updateTeamProject(@RequestBody IwsTeamUserVo dto) { + return iwsTeamUserService.updateTeamProject(dto); } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/app/domain/IwsTeamUserVo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/app/domain/IwsTeamUserVo.java index 0498115a..7aa1cbc7 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/app/domain/IwsTeamUserVo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/app/domain/IwsTeamUserVo.java @@ -5,6 +5,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import java.util.List; + /** * @author : 阮世耀 * @version : 1.0 @@ -58,8 +60,41 @@ public class IwsTeamUserVo extends IwsUserBean{ */ private String projectName; + /** + * 用户id + */ + private String userId; + + /** + * 用户手机号 + */ + private String userPhone; + + /** + * 真实姓名 + */ + private String name; + + /** + * i皖送登陆用户名 + */ + private String userName; + + /** + * 身份证号码 + */ + private String idCard; + /** * 备注 */ private String remark; + + /** + * 工程id集合 + */ + private List projectIds; + + + private List teamList; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/app/service/IwsTeamUserService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/app/service/IwsTeamUserService.java index e89692c9..d7382ce1 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/app/service/IwsTeamUserService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/app/service/IwsTeamUserService.java @@ -1,5 +1,6 @@ package com.bonus.material.app.service; +import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.material.app.domain.IwsTeamUserVo; import java.util.List; @@ -22,8 +23,16 @@ public interface IwsTeamUserService { /** * 根据身份证号码查询用户所属班组及工程信息 - * @param idCard 身份证号码(班组长) + * + * @param dto * @return List集合 */ - List selectProjectTeamInfoByIdCard(String idCard, String projectIds); + List selectProjectTeamInfoByIdCard(IwsTeamUserVo dto); + + /** + * 根据第三方信息修改班组及工程信息 + * @param dto + * @return + */ + AjaxResult updateTeamProject(IwsTeamUserVo dto); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/app/service/impl/IwsTeamUserServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/app/service/impl/IwsTeamUserServiceImpl.java index 2a0b3ff5..d0b2fa19 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/app/service/impl/IwsTeamUserServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/app/service/impl/IwsTeamUserServiceImpl.java @@ -1,15 +1,23 @@ package com.bonus.material.app.service.impl; +import com.alibaba.nacos.common.utils.CollectionUtils; +import com.alibaba.nacos.common.utils.StringUtils; +import com.bonus.common.biz.enums.HttpCodeEnum; +import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.common.security.utils.SecurityUtils; import com.bonus.material.app.domain.IwsTeamUserVo; import com.bonus.material.app.mapper.IwsTeamUserMapper; import com.bonus.material.app.service.IwsTeamUserService; +import com.bonus.material.basic.domain.BmTeam; +import com.bonus.material.basic.mapper.BmTeamMapper; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.lang.reflect.Array; -import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; /** * @author : 阮世耀 @@ -19,11 +27,15 @@ import java.util.List; * @Description: i皖送查询班组信息接口 */ @Service +@Slf4j public class IwsTeamUserServiceImpl implements IwsTeamUserService { @Resource private IwsTeamUserMapper iwsTeamUserMapper; + @Resource + private BmTeamMapper bmTeamMapper; + /** * 根据userName查询用户的身份证号码(idCard) * @@ -32,25 +44,90 @@ public class IwsTeamUserServiceImpl implements IwsTeamUserService { */ @Override public IwsTeamUserVo selectUserInfoByUserName(String userName) { - return iwsTeamUserMapper.selectUserInfoByUserName(userName); + IwsTeamUserVo iwsTeamUserVo = iwsTeamUserMapper.selectUserInfoByUserName(userName); + if (iwsTeamUserVo == null) { + return null; + } + if (StringUtils.isBlank(iwsTeamUserVo.getTeamLeaderIdCard())) { + iwsTeamUserVo.setTeamLeaderIdCard(SecurityUtils.getLoginUser().getUsername()); + } + return iwsTeamUserVo; } /** * 根据身份证号码查询用户所属班组及工程信息 * - * @param idCard 身份证号码(班组长) + * @param dto * @return List集合 */ @Override - public List selectProjectTeamInfoByIdCard(String idCard, String projectIds) { - List iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByIdCard(idCard); + public List selectProjectTeamInfoByIdCard(IwsTeamUserVo dto) { + List iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByIdCard(dto.getIdCard()); if (iwsTeamUserVos.isEmpty()) { - if (projectIds == null || projectIds.isEmpty()) { + if (CollectionUtils.isEmpty(dto.getProjectIds())) { return Collections.emptyList(); } - List ids = Arrays.asList(projectIds.split(",")); + List ids = dto.getProjectIds(); iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByProjectIds(ids); } return iwsTeamUserVos; } + + /** + * 根据第三方信息修改班组及工程信息 + * @param dto + * @return + */ + @Override + public AjaxResult updateTeamProject(IwsTeamUserVo dto) { + log.info("i皖送修改班组信息开始:{}", dto); + // 根据前端传的信息获取班组信息 + if (CollectionUtils.isEmpty(dto.getTeamList())) { + return AjaxResult.error(HttpCodeEnum.TO_PARAM_NULL.getCode(), HttpCodeEnum.TO_PARAM_NULL.getMsg()); + } + try { + // 根据用户名查询班组信息 + BmTeam team = new BmTeam(); + team.setCreateUser(SecurityUtils.getLoginUser().getUserid()); + List list = bmTeamMapper.queryByPage(team); + // 先从dto中提取所有teamName到Set中,提高查找效率 + Set dtoTeamNames = dto.getTeamList().stream() + .map(IwsTeamUserVo::getTeamName) + .collect(Collectors.toSet()); + // 对比2个集合,根据班组名称找出list中有,而dto中没有的元素 + List collect = list.stream().filter(bmTeam -> !dtoTeamNames.contains(bmTeam.getTeamName())).collect(Collectors.toList()); + if (!collect.isEmpty()) { + // 走删除逻辑 + for (BmTeam bmTeam : collect) { + // 将班组状态改为停用 + bmTeam.setStatus("1"); + int result = bmTeamMapper.update(bmTeam); + if (result <= 0) { + return AjaxResult.error(HttpCodeEnum.UPDATE_TO_DATABASE.getCode(), HttpCodeEnum.UPDATE_TO_DATABASE.getMsg()); + } + } + } + for (IwsTeamUserVo iwsTeamUserVo : dto.getTeamList()) { + BmTeam bmTeam = new BmTeam(); + bmTeam.setTeamName(StringUtils.isNotBlank(iwsTeamUserVo.getTeamName()) ? iwsTeamUserVo.getTeamName() : null); + bmTeam.setCreateUser(SecurityUtils.getLoginUser().getUserid()); + bmTeam.setRelName(StringUtils.isNotBlank(iwsTeamUserVo.getTeamLeaderName()) ? iwsTeamUserVo.getTeamLeaderName() : null); + bmTeam.setIdCard(StringUtils.isNotBlank(iwsTeamUserVo.getTeamLeaderIdCard()) ? iwsTeamUserVo.getTeamLeaderIdCard() : null); + bmTeam.setProjectId(StringUtils.isNotBlank(iwsTeamUserVo.getProjectId()) ? iwsTeamUserVo.getProjectId() : null); + bmTeam.setRelPhone(StringUtils.isNotBlank(iwsTeamUserVo.getTeamLeaderPhone()) ? iwsTeamUserVo.getTeamLeaderPhone() : null); + // 根据班组名称去bm_team表查询班组信息 + BmTeam bmTeam1 = bmTeamMapper.selectByName(bmTeam); + if (bmTeam1 == null) { + // 走新增逻辑 + int result = bmTeamMapper.insert(bmTeam); + if (result <= 0) { + return AjaxResult.error(HttpCodeEnum.UPDATE_TO_DATABASE.getCode(), HttpCodeEnum.UPDATE_TO_DATABASE.getMsg()); + } + } + } + } catch (Exception e) { + throw new RuntimeException(e.getMessage()); + } + return AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()); + } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/BackApplyInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/BackApplyInfo.java index cd603f13..a05c9035 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/BackApplyInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/BackApplyInfo.java @@ -192,4 +192,9 @@ public class BackApplyInfo implements Serializable { @ApiModelProperty(value = "计量单位") private String unitNames; + + /** + * 身份证号码 + */ + private String idCard; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/impl/BackApplyInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/impl/BackApplyInfoServiceImpl.java index 6b660d57..c1f6c4ce 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/impl/BackApplyInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/impl/BackApplyInfoServiceImpl.java @@ -89,10 +89,9 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService { //先根据外层id查询上层信息 BackApplyInfo backApplyInfo = backApplyInfoMapper.selectBackApplyInfoById(id); - /** 设置审批人签名url 防止代码冲突 **/ + /* *//** 设置审批人签名url 防止代码冲突 **//* String directAuditUrl = backApplyInfoMapper.getDirectAuditUrl(backApplyInfo); - backApplyInfo.setDirectAuditSignUrl(directAuditUrl); - /** 设置审批人签名url 防止代码冲突 **/ + backApplyInfo.setDirectAuditSignUrl(directAuditUrl);*/ backApplyRequestVo.setBackApplyInfo(backApplyInfo); //查询退料详情信息 @@ -351,7 +350,8 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService { return AjaxResult.error("参数为空,请重新选择后上传!"); } if (StringUtils.isBlank(dto.getBackApplyInfo().getCreateBy())) { - dto.getBackApplyInfo().setCreateBy(createBy); + dto.getBackApplyInfo().setCreateBy(SecurityUtils.getLoginUser().getUsername()); + createBy = SecurityUtils.getLoginUser().getUsername(); } else { createBy = dto.getBackApplyInfo().getCreateBy(); } @@ -605,7 +605,8 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService { } String createBy = ""; if (StringUtils.isBlank(dto.getBackApplyInfo().getCreateBy())) { - dto.getBackApplyInfo().setCreateBy(createBy); + dto.getBackApplyInfo().setCreateBy(SecurityUtils.getLoginUser().getUsername()); + createBy = SecurityUtils.getLoginUser().getUsername(); } else { createBy = dto.getBackApplyInfo().getCreateBy(); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/BmTeamController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/BmTeamController.java index c34ec257..a4b2a446 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/BmTeamController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/BmTeamController.java @@ -37,7 +37,7 @@ public class BmTeamController extends BaseController { public AjaxResult queryByPage(BmTeam tbTeam) { try { if (tbTeam.getIsAll() != null && tbTeam.getIsAll() == 0) { - return AjaxResult.success(bmTeamService.queryByPage(tbTeam)); + return AjaxResult.success(bmTeamService.getList(tbTeam)); } startPage(); List list = bmTeamService.queryByPage(tbTeam); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/ComplexQueryController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/ComplexQueryController.java index 56f39110..2d447f2e 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/ComplexQueryController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/ComplexQueryController.java @@ -60,11 +60,11 @@ public class ComplexQueryController extends BaseController { } /** - * 工器具台账详情--APP + * 工器具预警设备数量查询--APP * @param bean * @return */ - @ApiOperation(value = "工器具台账详情查询") + @ApiOperation(value = "工器具预警设备数量查询") @GetMapping("/getToolsLedgerDetailsList") public AjaxResult getToolsLedgerDetailsList(RetainedEquipmentInfo bean) { return AjaxResult.success(complexQueryService.getToolsLedgerDetailsList(bean)); @@ -447,4 +447,28 @@ public class ComplexQueryController extends BaseController { ExcelUtil util = new ExcelUtil<>(MaTypeSelectInfo.class); util.exportExcel(response, list, "修试查询--导出一机一档案查询"); } + + /** + * 班组库存查询 + * @param bean + * @return + */ + @ApiOperation(value = "班组库存查询") + @GetMapping("/getTeamUseNumList") + public AjaxResult getTeamUseNumList(RetainedEquipmentInfo bean) { + List list = complexQueryService.getTeamUseNumList(bean); + return AjaxResult.success(list); + } + + /** + * 班组预警详情查询 + * @param bean + * @return + */ + @ApiOperation(value = "班组预警详情查询") + @GetMapping("/getTeamWarnDetailsList") + public AjaxResult getTeamWarnDetailsList(RetainedEquipmentInfo bean) { + List list = complexQueryService.getTeamWarnDetailsList(bean); + return AjaxResult.success(list); + } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmProject.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmProject.java index b6b91494..97d22a2d 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmProject.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmProject.java @@ -44,6 +44,9 @@ public class BmProject extends BaseEntity @ApiModelProperty(value = "关联外部(第三方)的工程ID") private String externalId; + @ApiModelProperty(value = "工程ID") + private String projectId; + /** 外部(第三方)的工程详情json */ @ApiModelProperty(value = "外部(第三方)的工程详情json") private String externalInfo; @@ -149,4 +152,7 @@ public class BmProject extends BaseEntity @ApiModelProperty(value = "往来单位ids") private int[] unitIds; + + @ApiModelProperty(value = "班组名称") + private String teamName; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmTeam.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmTeam.java index 0b09383f..48a6ded9 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmTeam.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmTeam.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.util.Date; +import java.util.List; /** * 班组管理 @@ -85,8 +86,28 @@ public class BmTeam { */ private Integer delFlag; + /** + * 班组状态(0正常 1停用) + */ + private String status; + /** * 关键字 */ private String keyWord; + + /** + * 工程名称 + */ + private String projectName; + + /** + * 工程id + */ + private String projectId; + + /** + * 班组长账号 + */ + private String idCard; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/RetainedEquipmentInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/RetainedEquipmentInfo.java index 3b8ce14c..87d309eb 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/RetainedEquipmentInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/RetainedEquipmentInfo.java @@ -185,4 +185,26 @@ public class RetainedEquipmentInfo { */ private String status; + /** 正常设备数量 */ + private long normalNum; + + /** 3个月检测到期设备数量 */ + private long threeMonthNum; + + /** 1个月检测到期设备数量 */ + private long oneMonthNum; + + /** 已过期设备数量 */ + private long expiredNum; + + @ApiModelProperty(value = "班组名称") + private String teamName; + + @ApiModelProperty(value = "班组id") + private String teamId; + + /** + * 班组长账号 + */ + private String teamLeaderIdCard; } \ No newline at end of file diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/mapper/ComplexQueryMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/mapper/ComplexQueryMapper.java index 95ebe18f..2ed4ce1d 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/mapper/ComplexQueryMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/mapper/ComplexQueryMapper.java @@ -188,4 +188,18 @@ public interface ComplexQueryMapper { * @return */ List getToolsDetailsListByTeam(MaCodeVo bean1); + + /** + * 班组库存查询 + * @param bean + * @return + */ + List getTeamUseNumList(RetainedEquipmentInfo bean); + + /** + * 班组库存详情查询 + * @param bean + * @return + */ + List getTeamUseNumDetailsList(RetainedEquipmentInfo bean); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/BmTeamService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/BmTeamService.java index 11ca24f0..f3f2c0e9 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/BmTeamService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/BmTeamService.java @@ -38,4 +38,6 @@ public interface BmTeamService { * @return */ AjaxResult deleteById(BmTeam tbTeam); + + List getList(BmTeam tbTeam); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/ComplexQueryService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/ComplexQueryService.java index 3a12cd34..ee63e412 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/ComplexQueryService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/ComplexQueryService.java @@ -129,5 +129,19 @@ public interface ComplexQueryService { * @param bean * @return */ - List getToolsLedgerDetailsList(RetainedEquipmentInfo bean); + RetainedEquipmentInfo getToolsLedgerDetailsList(RetainedEquipmentInfo bean); + + /** + * 班组库存查询 + * @param bean + * @return + */ + List getTeamUseNumList(RetainedEquipmentInfo bean); + + /** + * 班组预警详情查询 + * @param bean + * @return + */ + List getTeamWarnDetailsList(RetainedEquipmentInfo bean); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmTeamServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmTeamServiceImpl.java index e85dcd74..a04c1fbf 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmTeamServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmTeamServiceImpl.java @@ -1,5 +1,6 @@ package com.bonus.material.basic.service.impl; +import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.PhoneUtil; import com.bonus.common.biz.enums.HttpCodeEnum; import com.bonus.common.core.utils.StringUtils; @@ -106,6 +107,17 @@ public class BmTeamServiceImpl implements BmTeamService { return AjaxResult.error(HttpCodeEnum.UPDATE_TO_DATABASE.getCode(), HttpCodeEnum.UPDATE_TO_DATABASE.getMsg()); } + @Override + public List getList(BmTeam tbTeam) { + List list = bmTeamMapper.queryByPage(tbTeam); + if (CollectionUtil.isNotEmpty(list)) { + return list; + } + tbTeam.setIdCard(null); + list = bmTeamMapper.queryByPage(tbTeam); + return list; + } + /** * 手机号校验方法抽取 * @param tbTeam diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/ComplexQueryServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/ComplexQueryServiceImpl.java index 6112bd7a..8d3d4cea 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/ComplexQueryServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/ComplexQueryServiceImpl.java @@ -8,10 +8,10 @@ import com.bonus.common.security.utils.SecurityUtils; import com.bonus.material.back.domain.vo.MaCodeVo; import com.bonus.material.basic.domain.*; import com.bonus.material.basic.domain.vo.MaTypeSelectInfo; +import com.bonus.material.basic.mapper.BmTeamMapper; import com.bonus.material.basic.mapper.ComplexQueryMapper; import com.bonus.material.basic.service.ComplexQueryService; import lombok.extern.slf4j.Slf4j; -import org.hibernate.validator.internal.util.StringHelper; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; @@ -21,9 +21,7 @@ import java.math.RoundingMode; import java.time.LocalDate; import java.time.Period; import java.time.format.DateTimeFormatter; -import java.time.LocalDate; import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.time.temporal.ChronoUnit; import java.util.*; @@ -41,6 +39,9 @@ public class ComplexQueryServiceImpl implements ComplexQueryService { @Resource private ComplexQueryMapper complexQueryMapper; + @Resource + private BmTeamMapper bmTeamMapper; + /** * 工程机具使用列表 * @param bean @@ -559,7 +560,7 @@ public class ComplexQueryServiceImpl implements ComplexQueryService { public List getToolsDetailsList(RetainedEquipmentInfo bean) { try { //1、获取当前用户Id - String userId = SecurityUtils.getUserId().toString(); + String userId = SecurityUtils.getLoginUser().getUserid().toString(); //2、判断用户是否为班组长,且对应的是否有班组 BmTeam bmTeam=complexQueryMapper.getTeamData(userId); List list = new ArrayList<>(); @@ -620,25 +621,142 @@ public class ComplexQueryServiceImpl implements ComplexQueryService { } @Override - public List getToolsLedgerDetailsList(RetainedEquipmentInfo bean) { - List list =new ArrayList<>(); + public RetainedEquipmentInfo getToolsLedgerDetailsList(RetainedEquipmentInfo bean) { + List list = new ArrayList<>(); try { - list = complexQueryMapper.getToolsLedgerDetailsList(bean); - if (list.size() > 0) { - for (RetainedEquipmentInfo bean1 : list) { - if (!StringHelper.isNullOrEmptyString(bean1.getNextCheckTime())){ - //时间数据处理 - bean1.setCheckStatus(determineCheckStatus(bean1.getNextCheckTime()));; + // 先根据用户名去查班组信息 + String username = SecurityUtils.getLoginUser().getUsername(); + BmTeam bmTeam = new BmTeam(); + bmTeam.setIdCard(username); + List teamList = bmTeamMapper.queryByPage(bmTeam); + if (CollectionUtil.isNotEmpty(teamList)) { + bean.setTeamLeaderIdCard(username); + list = complexQueryMapper.getTeamUseNumDetailsList(bean); + } else { + list = complexQueryMapper.getToolsLedgerDetailsList(bean); + } + if (!CollectionUtil.isEmpty(list)) { + for (RetainedEquipmentInfo retainedEquipmentInfo : list) { + if (StringUtils.isNotBlank(retainedEquipmentInfo.getNextCheckTime())) { + String nextCheckTime = retainedEquipmentInfo.getNextCheckTime(); + // 解析字符串日期(格式:yyyy-MM-dd) + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + LocalDate targetDate = LocalDate.parse(nextCheckTime, formatter); + // 当前日期 + LocalDate currentDate = LocalDate.now(); + boolean isFuture = targetDate.isAfter(currentDate); + if (!isFuture) { + // 已过期 + retainedEquipmentInfo.setStatus("3"); + continue; + } + Period period = Period.between(currentDate, targetDate); + int years = period.getYears(); + int months = period.getMonths(); + int days = period.getDays(); + // 计算累计月份差(向上取整) + int totalMonths = years * 12 + months; + if (days > 0 || targetDate.getDayOfMonth() > currentDate.getDayOfMonth()) { + totalMonths++; + } + if (totalMonths <= 1) { + retainedEquipmentInfo.setStatus("2"); + } else if (totalMonths <= 3) { + retainedEquipmentInfo.setStatus("1"); + } else { + retainedEquipmentInfo.setStatus("0"); + } + } + } + // 获取list集合中状态为0的元素的总数 + RetainedEquipmentInfo retainedEquipmentInfo = new RetainedEquipmentInfo(); + long normalNum = list.stream().filter(item -> "0".equals(item.getStatus())).count(); + retainedEquipmentInfo.setNormalNum(normalNum); + long threeMonthNum = list.stream().filter(item -> "1".equals(item.getStatus())).count(); + retainedEquipmentInfo.setThreeMonthNum(threeMonthNum); + long oneMonthNum = list.stream().filter(item -> "2".equals(item.getStatus())).count(); + retainedEquipmentInfo.setOneMonthNum(oneMonthNum); + long expiredNum = list.stream().filter(item -> "3".equals(item.getStatus())).count(); + retainedEquipmentInfo.setExpiredNum(expiredNum); + return retainedEquipmentInfo; + } + } catch (Exception e){ + log.error("获取设备详情列表失败,参数:{}", bean, e); + } + return new RetainedEquipmentInfo(); + } + + /** + * 班组库存查询 + * @param bean + * @return + */ + @Override + public List getTeamUseNumList(RetainedEquipmentInfo bean) { + List list = complexQueryMapper.getTeamUseNumList(bean); + if (CollectionUtils.isNotEmpty(list)) { + for (RetainedEquipmentInfo retainedEquipmentInfo : list) { + RetainedEquipmentInfo info = new RetainedEquipmentInfo(); + info.setTypeId(retainedEquipmentInfo.getTypeId()); + List teamUseNumDetailsList = complexQueryMapper.getTeamUseNumDetailsList(info); + if (CollectionUtils.isNotEmpty(teamUseNumDetailsList)) { + retainedEquipmentInfo.setModelList(teamUseNumDetailsList); + } + } + } + return list; + } + + /** + * 班组预警详情查询 + * @param bean + * @return + */ + @Override + public List getTeamWarnDetailsList(RetainedEquipmentInfo bean) { + List list = complexQueryMapper.getTeamUseNumDetailsList(bean); + if (!CollectionUtil.isEmpty(list)) { + // 将list中manageType为0的数据过滤出来 + list = list.stream().filter(item -> "0".equals(item.getManageType())).collect(Collectors.toList()); + for (RetainedEquipmentInfo retainedEquipmentInfo : list) { + if (StringUtils.isNotBlank(retainedEquipmentInfo.getNextCheckTime())) { + String nextCheckTime = retainedEquipmentInfo.getNextCheckTime(); + // 解析字符串日期(格式:yyyy-MM-dd) + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + LocalDate targetDate = LocalDate.parse(nextCheckTime, formatter); + // 当前日期 + LocalDate currentDate = LocalDate.now(); + boolean isFuture = targetDate.isAfter(currentDate); + if (!isFuture) { + // 已过期 + retainedEquipmentInfo.setStatus("3"); + continue; + } + Period period = Period.between(currentDate, targetDate); + int years = period.getYears(); + int months = period.getMonths(); + int days = period.getDays(); + // 计算累计月份差(向上取整) + int totalMonths = years * 12 + months; + if (days > 0 || targetDate.getDayOfMonth() > currentDate.getDayOfMonth()) { + totalMonths++; + } + if (totalMonths <= 1) { + retainedEquipmentInfo.setStatus("2"); + } else if (totalMonths <= 3) { + retainedEquipmentInfo.setStatus("1"); } else { - bean1.setCheckStatus(""); + retainedEquipmentInfo.setStatus("0"); } } } - return list; - } catch (Exception e){ - log.error("获取设备详情列表失败,参数:{}", bean, e); - return new ArrayList<>(); + if (StringUtils.isNotBlank(bean.getStatus())) { + return list.stream().filter(item -> { + return item.getStatus().equals(bean.getStatus()); + }).collect(Collectors.toList()); + } } + return list; } /** diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/controller/SelectController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/controller/SelectController.java index 2e6ef5f5..fd42e3ca 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/controller/SelectController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/controller/SelectController.java @@ -36,6 +36,12 @@ public class SelectController { return service.getProjectList(bmProject); } + @ApiOperation(value = "工程下拉选") + @PostMapping("getProjectInfo") + public AjaxResult getProjectInfo(@RequestBody BmProject bmProject) { + return service.getProjectInfo(bmProject); + } + @ApiOperation(value = "机具类型下拉选") @PostMapping("getMaTypeData") public AjaxResult getMaTypeData(@RequestBody SelectDto dto){ diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/mapper/SelectMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/mapper/SelectMapper.java index 0ffe9da5..469b66fe 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/mapper/SelectMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/mapper/SelectMapper.java @@ -178,4 +178,6 @@ public interface SelectMapper { * @return */ List getBranchProject(); + + List getProjectInfo(BmProject bmProject); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/SelectService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/SelectService.java index 6c903114..c364ac74 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/SelectService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/SelectService.java @@ -212,4 +212,11 @@ public interface SelectService { * @return */ AjaxResult getBranchProject(); + + /** + * 工程下拉选 + * @param bmProject + * @return + */ + AjaxResult getProjectInfo(BmProject bmProject); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java index ccbb0b8e..2df3bdfb 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java @@ -126,6 +126,21 @@ public class SelectServiceImpl implements SelectService { } } + /** + * 工程下拉选 + * @param bmProject + * @return + */ + @Override + public AjaxResult getProjectInfo(BmProject bmProject) { + List list = new ArrayList<>(); + if (bmProject.getIsApp() != null && bmProject.getIsApp()) { + list = mapper.getProjectInfo(bmProject); + list.removeIf(Objects::isNull); + } + return AjaxResult.success(list); + } + // @Override // public AjaxResult getDictByPidCbx(SelectDto dto) { // List list = new ArrayList<>(); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyDetails.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyDetails.java index 222bfebb..bdcf9d77 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyDetails.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyDetails.java @@ -125,7 +125,7 @@ public class LeaseApplyDetails extends BaseEntity { * 装备管理方式(0编号 1计数) */ @ApiModelProperty(name = "装备管理方式") - private int manageType; + private String manageType; /** 状态(0待审批,1进行中,2已出库) */ private String status; 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 d268d4fe..7fe7dcc1 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 @@ -278,6 +278,17 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { if (CollectionUtil.isEmpty(leaseApplyRequestVo.getLeaseApplyDetailsList())) { return AjaxResult.error("请先添加领料任务物资明细"); } + Integer isOut = leaseApplyRequestVo.getLeaseApplyInfo().getIsOut(); + // 对于编码出库的设备,进行出库时需校验编码明细 + if (isOut == 1) { + for (LeaseApplyDetails leaseApplyDetails : leaseApplyRequestVo.getLeaseApplyDetailsList()) { + if ("0".equals(leaseApplyDetails.getManageType())) { + if (CollectionUtils.isEmpty(leaseApplyDetails.getMaCodeList())) { + return AjaxResult.error("请先添加领料任务物资编码明细"); + } + } + } + } int res = checkStorageNum(leaseApplyRequestVo.getLeaseApplyDetailsList()); if (res == 0) { return AjaxResult.error("领料出库数量不能大于库存数量"); @@ -285,7 +296,8 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { leaseApplyRequestVo.getLeaseApplyInfo().setCreateTime(DateUtils.getNowDate()); String createBy = ""; if (StringUtils.isBlank(leaseApplyRequestVo.getLeaseApplyInfo().getCreateBy())) { - leaseApplyRequestVo.getLeaseApplyInfo().setCreateBy(createBy); + leaseApplyRequestVo.getLeaseApplyInfo().setCreateBy(SecurityUtils.getLoginUser().getUsername()); + createBy = SecurityUtils.getLoginUser().getUsername(); } else { createBy = leaseApplyRequestVo.getLeaseApplyInfo().getCreateBy(); } @@ -621,7 +633,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { lease.setPreNum(detail.getPreNum()); lease.setStorageNum(detail.getStorageNum()); lease.setOutNum(detail.getOutNum()); - lease.setManageType(detail.getManageType() == 0 ? "数量管理" : "编码管理"); + lease.setManageType("0".equals(detail.getManageType()) ? "数量管理" : "编码管理"); lease.setRemark(detail.getRemark() == null ? "" : detail.getRemark()); leaseOutDetails.add(lease); } @@ -977,12 +989,30 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { @Override @Transactional(rollbackFor = Exception.class) public boolean updateLeaseApplyInfo(LeaseApplyRequestVo leaseApplyRequestVo) { + if (null == leaseApplyRequestVo.getLeaseApplyInfo()) { + throw new ServiceException("请先填写领料任务信息"); + } + if (CollectionUtil.isEmpty(leaseApplyRequestVo.getLeaseApplyDetailsList())) { + throw new ServiceException("请先添加领料任务物资明细"); + } + Integer isOut = leaseApplyRequestVo.getLeaseApplyInfo().getIsOut(); + // 对于编码出库的设备,进行出库时需校验编码明细 + if (isOut == 1) { + for (LeaseApplyDetails leaseApplyDetails : leaseApplyRequestVo.getLeaseApplyDetailsList()) { + if ("0".equals(leaseApplyDetails.getManageType())) { + if (CollectionUtils.isEmpty(leaseApplyDetails.getMaCodeList())) { + throw new ServiceException("请先添加领料任务物资编码明细"); + } + } + } + } try { String createBy = ""; if (StringUtils.isBlank(leaseApplyRequestVo.getLeaseApplyInfo().getCreateBy())) { - leaseApplyRequestVo.getLeaseApplyInfo().setCreateBy(createBy); + leaseApplyRequestVo.getLeaseApplyInfo().setCreateBy(SecurityUtils.getLoginUser().getUsername()); + createBy = SecurityUtils.getLoginUser().getUsername(); } else { - createBy = leaseApplyRequestVo.getLeaseApplyInfo().getCreateBy(); + createBy = leaseApplyRequestVo.getLeaseApplyInfo().getCreateBy(); } // 提取到局部变量中,减少重复代码 LeaseApplyInfo leaseApplyInfo = leaseApplyRequestVo.getLeaseApplyInfo(); diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/app/IwsTeamUserMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/app/IwsTeamUserMapper.xml index 3c6a437c..06d20ae3 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/app/IwsTeamUserMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/app/IwsTeamUserMapper.xml @@ -22,8 +22,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" bzgl_bz.bz as remark, bzgl_bz.bz_status as teamStatus, bzgl_bz.project_id as projectId, bzgl_bz.project_name as projectName, org_user.mobile as teamLeaderPhone from - `micro-tool`.bzgl_bz - left join `uni_org`.org_user on bzgl_bz.bzz_idcard = org_user.id_card + `micro-tool`.bzgl_bz bzgl_bz + left join `uni_org`.org_user org_user on bzgl_bz.bzz_idcard = org_user.id_card and bzgl_bz.bz_status = 3 and bzgl_bz.sfjs = 0 @@ -33,11 +33,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmTeamMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmTeamMapper.xml index d06a6239..540eb9be 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmTeamMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmTeamMapper.xml @@ -12,7 +12,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" rel_phone, create_time, create_by, - del_flag + del_flag, + project_id, + bzz_idcard, #{teamName}, @@ -21,7 +23,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{relPhone}, NOW(), #{createUser}, - 0 + 0, + #{projectId}, + #{idCard}, @@ -33,6 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" rel_name = #{relName}, rel_phone = #{relPhone}, update_by = #{updateUser}, + status = #{status}, update_time = NOW() WHERE id = #{id} @@ -55,13 +60,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" t.create_by as createUser, t.update_time as updateTime, t.update_by as updateUser, - t.del_flag as delFlag + t.del_flag as delFlag, + t.bzz_idcard as teamLeaderIdCard from bm_team t left join bm_pro_depart sd on t.depart_id = sd.id - where t.del_flag = 0 and sd.del_flag = 0 + where t.del_flag = 0 and t.depart_id = #{departId} + + and t.create_by = #{createUser} + + + and t.bzz_idcard = #{idCard} + and ( t.team_name like concat('%', #{keyWord}, '%') or @@ -78,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" rel_phone as relPhone, create_time as createTime, create_by as createUser, update_time as updateTime, update_by as updateUser, del_flag as delFlag from bm_team - where del_flag = 0 + where del_flag = 0 and status = '0' and team_name = #{teamName} diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/ComplexQueryMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/ComplexQueryMapper.xml index 401b45be..def86dea 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/ComplexQueryMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/ComplexQueryMapper.xml @@ -1180,22 +1180,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and mt.del_flag = '0' and mt2.type_name is not null and mt2.type_id is not null + + and (mt2.type_name like concat('%',#{keyWord},'%') + OR mt.type_name like concat('%',#{keyWord},'%') ) + + + + + diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml index 74f83654..7c0ed5fa 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml @@ -345,10 +345,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" WHERE bu.unit_id = #{unitId} AND bu.del_flag = '0' - SELECT pro_id AS proId, - pro_name AS proName - FROM bm_project - WHERE del_flag = '0' + SELECT + bp.pro_id AS proId, + bp.pro_name AS proName + FROM + bm_project bp + LEFT JOIN bm_team bt ON bp.external_id = bt.project_id + WHERE + bp.del_flag = '0' + + AND bt.team_name = #{teamName} + @@ -404,4 +411,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" WHERE dict_type = 'branch_project' and `status` = 0 + 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 5c36faac..98db48bc 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 @@ -103,6 +103,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and lai.estimate_lease_time = #{estimateLeaseTime} and lai.cost_bearing_party = #{costBearingParty} and tt.task_type = '2' and lai.lease_style = '1' + + AND bt.bzz_idcard = #{idCard} + GROUP BY lai.id ORDER BY tt.task_status,tt.create_time desc