From ae7afcde2558cea8bebff82cf6661f8bd406313f Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Thu, 22 Aug 2024 12:47:51 +0800 Subject: [PATCH 01/20] =?UTF-8?q?=E6=8A=A5=E5=BA=9F=E9=A9=B3=E5=9B=9E?= =?UTF-8?q?=E8=BF=9B=E7=BB=B4=E4=BF=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sgzb/app/service/BackReceiveService.java | 6 ++ .../service/impl/BackReceiveServiceImpl.java | 6 +- .../impl/ScrapApplyDetailsServiceImpl.java | 66 ++++++++++++++----- 3 files changed, 57 insertions(+), 21 deletions(-) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/BackReceiveService.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/BackReceiveService.java index fcef2b9..5fc3e4f 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/BackReceiveService.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/BackReceiveService.java @@ -99,4 +99,10 @@ public interface BackReceiveService { List backReceiveRecordWeb(BackApplyInfo record); List backReceiveRecordWebPt(BackApplyInfo record); + + int insertRad(int taskId, List wxList); + + int insertTt(List hgList, Integer taskType, String createBy); + + int insertTta(int taskId, List list); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java index 49d16ef..1caf9e0 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java @@ -392,7 +392,7 @@ public class BackReceiveServiceImpl implements BackReceiveService { return backApplyInfoList; } - private int insertRad(int taskId, List wxList) { + public int insertRad(int taskId, List wxList) { int result = 0; if (wxList != null) { for (BackApplyInfo wx : wxList) { @@ -414,14 +414,14 @@ public class BackReceiveServiceImpl implements BackReceiveService { return result; } - private int insertTta(int taskId, List list) { + public int insertTta(int taskId, List list) { int res; String agreementId = String.valueOf(list.get(0).getAgreementId()); res = backReceiveMapper.insertTta(taskId, agreementId); return res; } - private int insertTt(List hgList, Integer taskType, String createBy) { + public int insertTt(List hgList, Integer taskType, String createBy) { int newTask; //生成单号 String code = genCodeRule(taskType); diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ScrapApplyDetailsServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ScrapApplyDetailsServiceImpl.java index b209505..a0e13df 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ScrapApplyDetailsServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ScrapApplyDetailsServiceImpl.java @@ -8,6 +8,8 @@ import java.util.List; import java.util.stream.Collectors; import cn.hutool.core.bean.BeanUtil; +import com.bonus.sgzb.app.mapper.BackReceiveMapper; +import com.bonus.sgzb.app.service.BackReceiveService; import com.bonus.sgzb.base.api.domain.BackApplyInfo; import com.bonus.sgzb.common.core.constant.TaskTypeConstants; import com.bonus.sgzb.common.core.enums.ReviewStatusEnum; @@ -56,6 +58,12 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService { @Resource private ScrapAuditorSetMapper scrapAuditorSetMapper; + @Resource + private BackReceiveMapper backReceiveMapper; + + @Resource + BackReceiveService backReceiveService; + /** * 查询报废任务详细scrap_apply_details * @@ -490,11 +498,11 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService { if (notScrapList.size() == scrapApplyDetailsList.size()) { task.setTaskStatus(59); } - } else - { + } else { status = "2"; List backList = new ArrayList<>(); List repairList = new ArrayList<>(); + List wxList = new ArrayList<>(); if (scrapApplyDetailsList.size() > 0) { for (ScrapApplyDetails bean : scrapApplyDetailsList) { if ("1".equals(bean.getScrapSource())) { @@ -502,6 +510,15 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService { } else if ("2".equals(bean.getScrapSource())) { repairList.add(bean); } + BackApplyInfo backApplyInfo = new BackApplyInfo(); + backApplyInfo.setAgreementId(tmTaskAgreement.getAgreementId().intValue()); + backApplyInfo.setMaId(bean.getMaId().intValue()); + backApplyInfo.setTypeId(String.valueOf(bean.getTypeId())); + backApplyInfo.setCompanyId(String.valueOf(bean.getCompanyId())); + backApplyInfo.setRepairedNum(String.valueOf(bean.getScrapNum())); + backApplyInfo.setCreateBy(SecurityUtils.getLoginUser().getUsername()); + backApplyInfo.setUpdateBy(SecurityUtils.getLoginUser().getUsername()); + wxList.add(backApplyInfo); } } if (backList.size() > 0) { @@ -511,23 +528,36 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService { if (backList.get(0).getParentId() != null) { parentId = Math.toIntExact(backList.get(0).getParentId()); } - taskCode = purchaseCodeRule("T", 36); - taskStatus = 38; - taskType = 36; - long backTaskId = genTask(taskCode, taskType, taskStatus, tmTaskAgreement, companyId); - BackApplyInfo backApplyInfo = scrapApplyDetailsMapper.getBackApplyInfo(parentId); - backApplyInfo.setCode(taskCode); - backApplyInfo.setTaskId((int) backTaskId); - backApplyInfo.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); - backApplyInfo.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); - scrapApplyDetailsMapper.addBackInfo(backApplyInfo); - for (ScrapApplyDetails bean : backList) { - bean.setParentId(backApplyInfo.getId()); - bean.setStatus("1"); - bean.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); - bean.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); - scrapApplyDetailsMapper.addBackDetails(bean); + + //维修的创建维修任务,插入任务协议表 + if (wxList != null && wxList.size() > 0) { + BackApplyInfo backApplyInfo = scrapApplyDetailsMapper.getBackApplyInfo(parentId); + wxList = wxList.stream().peek(obj -> obj.setBackId(backApplyInfo.getBackId())).collect(Collectors.toList()); + //插入任务表tm_task + int newTaskId = backReceiveService.insertTt(wxList, TaskTypeEnum.MAINTENANCE_TASK.getCode(), SecurityUtils.getLoginUser().getUsername()); + //插入协议任务表tm_task_agreement + backReceiveService.insertTta(newTaskId, wxList); + //插入维修记录表repair_apply_details + backReceiveService.insertRad(newTaskId, wxList); } + +// taskCode = purchaseCodeRule("T", 36); +// taskStatus = 38; +// taskType = 36; +// long backTaskId = genTask(taskCode, taskType, taskStatus, tmTaskAgreement, companyId); +// BackApplyInfo backApplyInfo = scrapApplyDetailsMapper.getBackApplyInfo(parentId); +// backApplyInfo.setCode(taskCode); +// backApplyInfo.setTaskId((int) backTaskId); +// backApplyInfo.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); +// backApplyInfo.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); +// scrapApplyDetailsMapper.addBackInfo(backApplyInfo); +// for (ScrapApplyDetails bean : backList) { +// bean.setParentId(backApplyInfo.getId()); +// bean.setStatus("1"); +// bean.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); +// bean.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); +// scrapApplyDetailsMapper.addBackDetails(bean); +// } } if (repairList.size() > 0) { if (repairList.get(0).getCompanyId() != null) { From 21656e0515892670939f9fe966f5c8b6bc10da72 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Thu, 22 Aug 2024 13:20:54 +0800 Subject: [PATCH 02/20] =?UTF-8?q?=E6=8A=A5=E5=BA=9F=E9=A9=B3=E5=9B=9E?= =?UTF-8?q?=E8=BF=9B=E7=BB=B4=E4=BF=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ScrapApplyDetailsServiceImpl.java | 46 ++++++++++--------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ScrapApplyDetailsServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ScrapApplyDetailsServiceImpl.java index a0e13df..155d316 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ScrapApplyDetailsServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ScrapApplyDetailsServiceImpl.java @@ -515,32 +515,32 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService { backApplyInfo.setMaId(bean.getMaId().intValue()); backApplyInfo.setTypeId(String.valueOf(bean.getTypeId())); backApplyInfo.setCompanyId(String.valueOf(bean.getCompanyId())); - backApplyInfo.setRepairedNum(String.valueOf(bean.getScrapNum())); - backApplyInfo.setCreateBy(SecurityUtils.getLoginUser().getUsername()); - backApplyInfo.setUpdateBy(SecurityUtils.getLoginUser().getUsername()); + backApplyInfo.setBackNum(bean.getScrapNum().intValue()); + backApplyInfo.setId(bean.getParentId()); + backApplyInfo.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); + backApplyInfo.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); wxList.add(backApplyInfo); } } - if (backList.size() > 0) { - if (backList.get(0).getCompanyId() != null) { - companyId = Math.toIntExact(backList.get(0).getCompanyId()); - } - if (backList.get(0).getParentId() != null) { - parentId = Math.toIntExact(backList.get(0).getParentId()); - } - //维修的创建维修任务,插入任务协议表 - if (wxList != null && wxList.size() > 0) { - BackApplyInfo backApplyInfo = scrapApplyDetailsMapper.getBackApplyInfo(parentId); - wxList = wxList.stream().peek(obj -> obj.setBackId(backApplyInfo.getBackId())).collect(Collectors.toList()); - //插入任务表tm_task - int newTaskId = backReceiveService.insertTt(wxList, TaskTypeEnum.MAINTENANCE_TASK.getCode(), SecurityUtils.getLoginUser().getUsername()); - //插入协议任务表tm_task_agreement - backReceiveService.insertTta(newTaskId, wxList); - //插入维修记录表repair_apply_details - backReceiveService.insertRad(newTaskId, wxList); - } + //维修的创建维修任务,插入任务协议表 + if (wxList != null && wxList.size() > 0) { + //插入任务表tm_task + int newTaskId = backReceiveService.insertTt(wxList, TaskTypeEnum.MAINTENANCE_TASK.getCode(), SecurityUtils.getLoginUser().getUsername()); + //插入协议任务表tm_task_agreement + backReceiveService.insertTta(newTaskId, wxList); + //插入维修记录表repair_apply_details + backReceiveService.insertRad(newTaskId, wxList); + } + +// if (backList.size() > 0) { +// if (backList.get(0).getCompanyId() != null) { +// companyId = Math.toIntExact(backList.get(0).getCompanyId()); +// } +// if (backList.get(0).getParentId() != null) { +// parentId = Math.toIntExact(backList.get(0).getParentId()); +// } // taskCode = purchaseCodeRule("T", 36); // taskStatus = 38; // taskType = 36; @@ -558,7 +558,9 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService { // bean.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); // scrapApplyDetailsMapper.addBackDetails(bean); // } - } +// } + + if (repairList.size() > 0) { if (repairList.get(0).getCompanyId() != null) { companyId = Math.toIntExact(repairList.get(0).getCompanyId()); From 17b9b5c1a6263f1882f1a1eaa2eec7108d460818 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Thu, 22 Aug 2024 13:26:07 +0800 Subject: [PATCH 03/20] =?UTF-8?q?=E6=8A=A5=E5=BA=9F=E9=A9=B3=E5=9B=9E?= =?UTF-8?q?=E8=BF=9B=E7=BB=B4=E4=BF=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ScrapApplyDetailsServiceImpl.java | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ScrapApplyDetailsServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ScrapApplyDetailsServiceImpl.java index 155d316..ffb5d33 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ScrapApplyDetailsServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ScrapApplyDetailsServiceImpl.java @@ -58,9 +58,6 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService { @Resource private ScrapAuditorSetMapper scrapAuditorSetMapper; - @Resource - private BackReceiveMapper backReceiveMapper; - @Resource BackReceiveService backReceiveService; @@ -533,34 +530,6 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService { backReceiveService.insertRad(newTaskId, wxList); } - -// if (backList.size() > 0) { -// if (backList.get(0).getCompanyId() != null) { -// companyId = Math.toIntExact(backList.get(0).getCompanyId()); -// } -// if (backList.get(0).getParentId() != null) { -// parentId = Math.toIntExact(backList.get(0).getParentId()); -// } -// taskCode = purchaseCodeRule("T", 36); -// taskStatus = 38; -// taskType = 36; -// long backTaskId = genTask(taskCode, taskType, taskStatus, tmTaskAgreement, companyId); -// BackApplyInfo backApplyInfo = scrapApplyDetailsMapper.getBackApplyInfo(parentId); -// backApplyInfo.setCode(taskCode); -// backApplyInfo.setTaskId((int) backTaskId); -// backApplyInfo.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); -// backApplyInfo.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); -// scrapApplyDetailsMapper.addBackInfo(backApplyInfo); -// for (ScrapApplyDetails bean : backList) { -// bean.setParentId(backApplyInfo.getId()); -// bean.setStatus("1"); -// bean.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); -// bean.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); -// scrapApplyDetailsMapper.addBackDetails(bean); -// } -// } - - if (repairList.size() > 0) { if (repairList.get(0).getCompanyId() != null) { companyId = Math.toIntExact(repairList.get(0).getCompanyId()); From 0dfd32755a798032e56328f2bc254a0b1161310c Mon Sep 17 00:00:00 2001 From: "liang.chao" <1360241448@qq.com> Date: Thu, 22 Aug 2024 14:44:36 +0800 Subject: [PATCH 04/20] =?UTF-8?q?=E6=88=90=E5=A5=97=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/MaWholeSetController.java | 24 +++- .../bonus/sgzb/material/domain/MaWhole.java | 34 ++++- .../sgzb/material/domain/MaWholeSetDto.java | 15 +- .../material/mapper/MaWholeSetMapper.java | 13 +- .../material/service/MaWholeSetService.java | 5 +- .../service/impl/MaWholeSetServiceImpl.java | 131 ++++++++++-------- .../mapper/material/MaWholeSetMapper.xml | 105 ++++++++------ 7 files changed, 207 insertions(+), 120 deletions(-) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/MaWholeSetController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/MaWholeSetController.java index 963f7c7..baa4262 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/MaWholeSetController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/MaWholeSetController.java @@ -4,10 +4,12 @@ import com.bonus.sgzb.common.core.web.controller.BaseController; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.core.web.page.TableDataInfo; import com.bonus.sgzb.material.config.PageResultVo; +import com.bonus.sgzb.material.domain.LeaseApplyDetails; import com.bonus.sgzb.material.domain.MaWholeSetDto; import com.bonus.sgzb.material.domain.MaWholeTreeVo; import com.bonus.sgzb.material.domain.MaWholeVo; import com.bonus.sgzb.material.service.MaWholeSetService; +import com.github.pagehelper.PageHelper; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.extern.slf4j.Slf4j; @@ -51,11 +53,11 @@ public class MaWholeSetController extends BaseController { * @return */ @ApiOperation("查询整套抱杆管理") - @PostMapping("/selectList") - public AjaxResult selectList(@ApiParam(value = "查询信息") @RequestBody MaWholeSetDto dto) { - log.info("查询整套抱杆管理:{}", dto); - PageResultVo result = maWholeSetService.selectList(dto); - return AjaxResult.success(result); + @GetMapping("/selectList") + public TableDataInfo selectList(MaWholeSetDto dto) { + PageHelper.startPage(dto.getPageNum() == 0 ? 1 : dto.getPageNum(), dto.getPageSize()); + List maWholeVos = maWholeSetService.selectList(dto); + return getDataTable(maWholeVos); } /** @@ -96,4 +98,16 @@ public class MaWholeSetController extends BaseController { log.info("根据id删除整套抱杆:{}", dto); return maWholeSetService.deleteById(dto); } + + /** + * 查询整套抱杆明细 + * @param wholeTypeName + * @return + */ + @ApiOperation("领料申请查询成套抱杆设备") + @GetMapping("/selectListByWholeTypeName") + public AjaxResult selectListByWholeTypeName(MaWholeSetDto wholeTypeName) { + List list = maWholeSetService.selectListByWholeTypeName(wholeTypeName); + return AjaxResult.success(list); + } } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/MaWhole.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/MaWhole.java index c88b336..1bcd1de 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/MaWhole.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/MaWhole.java @@ -1,9 +1,13 @@ package com.bonus.sgzb.material.domain; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; /** * 整套抱杆表单集合实体类 @@ -20,10 +24,38 @@ public class MaWhole { private Integer id; /** 父级ID */ - @ApiModelProperty(value = "父级ID") + @ApiModelProperty(value = "父级类型ID") private Integer parentId; + /** 父级ID */ + @ApiModelProperty(value = "类型ID") + private Integer typeId; + @ApiModelProperty(value = "数量") + private Integer deviceNum; /** 配套数量 */ @ApiModelProperty(value = "配套数量") private Integer totalNum; + /** 设备id */ + @ApiModelProperty(value = "设备id") + private Integer deviceTypeId; + /** 设备类型 */ + @ApiModelProperty(value = "设备类型(1主体设备 2配套设备)") + private Integer ascriptionType; + + /** 配套名称 */ + @ApiModelProperty(value = "配套名称") + private String wholeTypeName; + /** 配套名称 */ + @ApiModelProperty(value = "所属公司") + private String companyId; + + /** 创建时间 */ + @ApiModelProperty(value = "创建时间") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + /** 创建人 */ + @ApiModelProperty(value = "创建人") + private Integer createBy; + } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/MaWholeSetDto.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/MaWholeSetDto.java index 495b010..ecb64f1 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/MaWholeSetDto.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/MaWholeSetDto.java @@ -36,9 +36,22 @@ public class MaWholeSetDto { /** 关键字 */ @ApiModelProperty(value = "关键字") private String keyWord; + /** 配套名称 */ + @ApiModelProperty(value = "配套名称") + private String wholeTypeName; + /** 关键字 */ + @ApiModelProperty(value = "所属公司") + private String companyId; + /** 关键字 */ + @ApiModelProperty(value = "创建人") + private Integer createBy; + @ApiModelProperty(value = "开始时间") + private String startTime; + @ApiModelProperty(value = "结束时间") + private String endTime; /** 表单对象集合 */ @ApiModelProperty(value = "表单对象集合") - private List wholeList; + private List deviceInfo; } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/MaWholeSetMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/MaWholeSetMapper.java index ff532d9..6868a60 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/MaWholeSetMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/MaWholeSetMapper.java @@ -1,10 +1,7 @@ package com.bonus.sgzb.material.mapper; import com.bonus.sgzb.base.api.domain.MaType; -import com.bonus.sgzb.material.domain.MaWhole; -import com.bonus.sgzb.material.domain.MaWholeSetDto; -import com.bonus.sgzb.material.domain.MaWholeVo; -import com.bonus.sgzb.material.domain.TreeSelectId; +import com.bonus.sgzb.material.domain.*; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -46,10 +43,10 @@ public interface MaWholeSetMapper { /** * 根据id删除 - * @param id + * @param * @return */ - int deleteById(@Param("id") Integer id); + int deleteById(MaWholeSetDto dto); /** * 根据id去ma_whole_set表中查询typeid @@ -78,4 +75,8 @@ public interface MaWholeSetMapper { * @return */ List selectId(@Param("typeId") List typeId); + + int selectByWholeTypeName(MaWholeSetDto wholeTypeName); + + List selectListByWholeTypeName(MaWholeSetDto wholeTypeName); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/MaWholeSetService.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/MaWholeSetService.java index e511c21..d1d3e6f 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/MaWholeSetService.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/MaWholeSetService.java @@ -2,6 +2,7 @@ package com.bonus.sgzb.material.service; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.material.config.PageResultVo; +import com.bonus.sgzb.material.domain.LeaseApplyDetails; import com.bonus.sgzb.material.domain.MaWholeSetDto; import com.bonus.sgzb.material.domain.MaWholeTreeVo; import com.bonus.sgzb.material.domain.MaWholeVo; @@ -27,7 +28,7 @@ public interface MaWholeSetService { * @param dto * @return */ - PageResultVo selectList(MaWholeSetDto dto); + List selectList(MaWholeSetDto dto); /** * 查询整套抱杆明细 @@ -56,4 +57,6 @@ public interface MaWholeSetService { * @return */ MaWholeTreeVo selectListTree(Integer id); + + List selectListByWholeTypeName(MaWholeSetDto wholeTypeName); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/MaWholeSetServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/MaWholeSetServiceImpl.java index af24e77..bf30c2d 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/MaWholeSetServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/MaWholeSetServiceImpl.java @@ -39,50 +39,51 @@ public class MaWholeSetServiceImpl implements MaWholeSetService { if (dto == null) { return AjaxResult.error("参数不能为空!!!"); } - if (dto.getParentId() == null) { - return AjaxResult.error("父级id不能为空"); + + //先查询是否有重复的配套名称 + if (selectByWholeTypeName(dto) > 0) { + return AjaxResult.error("成套名称已存在"); } - int count = selectByParentId(dto.getParentId()); - if (count != 0) { - return AjaxResult.error("该物品类型已经绑定相关配件,无法再次绑定,请重新选择!!!"); - } - if (CollectionUtils.isNotEmpty(dto.getWholeList())) { - for (MaWhole maWhole : dto.getWholeList()) { + + if (CollectionUtils.isNotEmpty(dto.getDeviceInfo())) { + for (MaWhole maWhole : dto.getDeviceInfo()) { + maWhole.setCreateBy(dto.getCreateBy()); + maWhole.setCompanyId(dto.getCompanyId()); + maWhole.setTypeId(maWhole.getDeviceTypeId()); + maWhole.setTotalNum(maWhole.getDeviceNum()); + maWhole.setWholeTypeName(dto.getWholeTypeName()); maWhole.setParentId(dto.getParentId()); } - } - int res = 0; - try { - res = insertMaWholeSet(dto.getWholeList()); - if (res == 0) { - log.error("insertMaWholeSet方法插入异常"); - throw new RuntimeException("insertMaWholeSet方法插入异常"); + int res = 0; + try { + res = insertMaWholeSet(dto.getDeviceInfo()); + if (res == 0) { + log.error("insertMaWholeSet方法插入异常"); + throw new RuntimeException("insertMaWholeSet方法插入异常"); + } + } catch (Exception e) { + log.error("新增计划管理异常:{}", e.getMessage()); + return AjaxResult.error(ExceptionEnum.SAVE_TO_DATABASE.getCode(), ExceptionEnum.SAVE_TO_DATABASE.getMsg()); } - } catch (Exception e) { - log.error("新增计划管理异常:{}",e.getMessage()); - return AjaxResult.error(ExceptionEnum.SAVE_TO_DATABASE.getCode(), ExceptionEnum.SAVE_TO_DATABASE.getMsg()); + return AjaxResult.success("新增成功", res); + } else { + return AjaxResult.error("请选择主/配套设备"); } - return AjaxResult.success("新增成功", res); + } + + private int selectByWholeTypeName(MaWholeSetDto wholeTypeName) { + return mapper.selectByWholeTypeName(wholeTypeName); } /** * 查询整套抱杆管理 + * * @param dto * @return */ @Override - public PageResultVo selectList(MaWholeSetDto dto) { - List list = mapper.selectList(dto); - PageHelper.startPage(dto.getPageNum() == 0 ? 1 : dto.getPageNum(), dto.getPageSize()); - PageResultVo pageResult = new PageResultVo(); - // 分页信息 - PageInfo pageInfo = new PageInfo<>(list); - pageResult.setTotalCount(pageInfo.getTotal()); - pageResult.setTotalPageCount(pageInfo.getPages()); - pageResult.setResult(list); - pageResult.setPageNum(dto.getPageNum()); - pageResult.setPageSize(dto.getPageSize()); - return pageResult; + public List selectList(MaWholeSetDto dto) { + return mapper.selectList(dto); } /** @@ -103,17 +104,17 @@ public class MaWholeSetServiceImpl implements MaWholeSetService { @Override @Transactional(rollbackFor = Exception.class) public AjaxResult deleteById(MaWholeSetDto dto) { - if (dto.getId() == null) { + if (dto == null) { return AjaxResult.error("删除标识id为空,无法进行删除"); } int res = 0; try { - res = deleteMaWhole(dto.getId()); + res = deleteMaWhole(dto); if (res == 0) { throw new RuntimeException("删除失败"); } } catch (Exception e) { - log.error("删除异常:{}",e.getMessage()); + log.error("删除异常:{}", e.getMessage()); return AjaxResult.error(ExceptionEnum.DELETE_TO_DATABASE.getCode(), ExceptionEnum.DELETE_TO_DATABASE.getMsg()); } return AjaxResult.success("删除成功", res); @@ -121,11 +122,11 @@ public class MaWholeSetServiceImpl implements MaWholeSetService { /** * 根据id删除整套配件信息 - * @param id + * @param * @return */ - private int deleteMaWhole(Integer id) { - return mapper.deleteById(id); + private int deleteMaWhole(MaWholeSetDto dto) { + return mapper.deleteById(dto); } /** @@ -137,32 +138,34 @@ public class MaWholeSetServiceImpl implements MaWholeSetService { @Transactional(rollbackFor = Exception.class) public AjaxResult update(MaWholeSetDto dto) { log.info("修改整套抱杆管理传参:{}", dto); - int count = selectByParentId(dto.getParentId()); - if (!dto.getId().equals(dto.getParentId()) && count != 0) { - return AjaxResult.error("该物品类型已经配套相关配件,无法再次绑定,请重新提交修改!!!"); - } - if (CollectionUtils.isNotEmpty(dto.getWholeList())) { - for (MaWhole maWhole : dto.getWholeList()) { + if (CollectionUtils.isNotEmpty(dto.getDeviceInfo())) { + for (MaWhole maWhole : dto.getDeviceInfo()) { + maWhole.setCreateBy(dto.getCreateBy()); + maWhole.setTypeId(maWhole.getDeviceTypeId()); + maWhole.setTotalNum(maWhole.getDeviceNum()); + maWhole.setWholeTypeName(dto.getWholeTypeName()); maWhole.setParentId(dto.getParentId()); } - } - int res = 0; - try { - res = deleteMaWhole(dto.getId()); - if (res == 0) { - log.error("deleteById方法删除异常"); - throw new RuntimeException("deleteById方法删除异常"); + int res = 0; + try { + deleteMaWhole(dto); + res = insertMaWholeSet(dto.getDeviceInfo()); + if (res == 0) { + log.error("insertMaWholeSet方法插入异常"); + throw new RuntimeException("insertMaWholeSet方法插入异常"); + } + /* int count = selectByWholeTypeName(dto); + if (count > 1) { + throw new RuntimeException("配套名称已重复,请重新输入"); + }*/ + } catch (Exception e) { + e.printStackTrace(); + return AjaxResult.error(ExceptionEnum.UPDATE_TO_DATABASE.getCode(), ExceptionEnum.UPDATE_TO_DATABASE.getMsg()); } - res = insertMaWholeSet(dto.getWholeList()); - if (res == 0) { - log.error("insertMaWholeSet方法插入异常"); - throw new RuntimeException("insertMaWholeSet方法插入异常"); - } - } catch (Exception e) { - e.printStackTrace(); - return AjaxResult.error(ExceptionEnum.UPDATE_TO_DATABASE.getCode(), ExceptionEnum.UPDATE_TO_DATABASE.getMsg()); + return AjaxResult.success("修改成功", res); + } else { + return AjaxResult.error("请选择主/配套设备"); } - return AjaxResult.success("修改成功", res); } /** @@ -186,12 +189,20 @@ public class MaWholeSetServiceImpl implements MaWholeSetService { return treeVo; } + @Override + public List selectListByWholeTypeName(MaWholeSetDto wholeTypeName) { + return mapper.selectListByWholeTypeName(wholeTypeName); + } + /** * 方法提取,新增ma_whole_set表 + * * @param wholeList * @return */ - private int insertMaWholeSet(List wholeList) { return mapper.insert(wholeList); } + private int insertMaWholeSet(List wholeList) { + return mapper.insert(wholeList); + } /** * 根据parentId查询,去重 diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/MaWholeSetMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/MaWholeSetMapper.xml index ad6ef32..28747aa 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/MaWholeSetMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/MaWholeSetMapper.xml @@ -41,24 +41,13 @@ - insert into ma_whole_set - - type_id, - parent_id, - part_num, - status - - - #{item.id}, - #{item.parentId}, - #{item.totalNum}, - 1 - + insert into ma_whole_set (type_id,parent_id,part_num,whole_type_name,create_by,ascription_type,create_time,status,company_id) + values(#{item.typeId},#{item.parentId},#{item.totalNum},#{item.wholeTypeName},#{item.createBy},#{item.ascriptionType}, now(),1,#{item.companyId}) delete from ma_whole_set - where parent_id = #{id} + where parent_id = #{id} and whole_type_name = #{wholeTypeName} + + \ No newline at end of file From b3cc2cb0c653f46b4831be57d447941b7e920646 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Fri, 23 Aug 2024 09:25:46 +0800 Subject: [PATCH 05/20] add profile --- .../resources/bootstrap-sgzb_cloud_dev.yml | 4 ++ .../resources/bootstrap-sgzb_cloud_local.yml | 4 ++ .../main/resources/bootstrap-sgzb_nw_dev.yml | 41 +++++++++++++++++++ .../resources/bootstrap-sgzb_nw_local.yml | 41 +++++++++++++++++++ .../src/main/resources/bootstrap.yml | 4 -- 5 files changed, 90 insertions(+), 4 deletions(-) create mode 100644 sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_nw_dev.yml create mode 100644 sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_nw_local.yml diff --git a/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_cloud_dev.yml b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_cloud_dev.yml index e250a64..70297e7 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_cloud_dev.yml +++ b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_cloud_dev.yml @@ -1,3 +1,7 @@ +# Tomcat +server: + port: 39302 + # Spring spring: cloud: diff --git a/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_cloud_local.yml b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_cloud_local.yml index af03a82..f3326a0 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_cloud_local.yml +++ b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_cloud_local.yml @@ -1,3 +1,7 @@ +# Tomcat +server: + port: 39302 + # Spring spring: cloud: diff --git a/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_nw_dev.yml b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_nw_dev.yml new file mode 100644 index 0000000..d48619f --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_nw_dev.yml @@ -0,0 +1,41 @@ +# Tomcat +server: + port: 49302 + +# Spring +spring: + cloud: + loadbalancer: + # 关闭Ribbon的负载均衡器 + ribbon: + enabled: false + # 开启Nacos的负载均衡器 + nacos: + enabled: true + nacos: + discovery: + # 服务注册地址 + server-addr: 192.168.0.62:8848 + namespace: sgzb_cloud_dev_nw + config: + # 配置中心地址 + server-addr: 192.168.0.62:8848 + namespace: sgzb_cloud_dev_nw + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + +# 禁用Actuator端点的未经身份验证的访问 +management: + endpoint: + env: + enabled: false + +sgzb: + site: nw + job: + settlementJobDay: 1 + settlementJobCron: "0 0 1 1 * ?" + diff --git a/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_nw_local.yml b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_nw_local.yml new file mode 100644 index 0000000..d0474fe --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_nw_local.yml @@ -0,0 +1,41 @@ +# Tomcat +server: + port: 49302 + +# Spring +spring: + cloud: + loadbalancer: + # 关闭Ribbon的负载均衡器 + ribbon: + enabled: false + # 开启Nacos的负载均衡器 + nacos: + enabled: true + nacos: + discovery: + # 服务注册地址 + server-addr: 127.0.0.1:8848 + namespace: sgzb_cloud_dev_nw + config: + # 配置中心地址 + server-addr: 127.0.0.1:8848 + namespace: sgzb_cloud_dev_nw + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + +# 禁用Actuator端点的未经身份验证的访问 +management: + endpoint: + env: + enabled: false + +sgzb: + site: nw + job: + settlementJobDay: 1 + settlementJobCron: "0 0 1 1 * ?" + diff --git a/sgzb-modules/sgzb-material/src/main/resources/bootstrap.yml b/sgzb-modules/sgzb-material/src/main/resources/bootstrap.yml index 095266e..d0a0f1e 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/bootstrap.yml +++ b/sgzb-modules/sgzb-material/src/main/resources/bootstrap.yml @@ -1,7 +1,3 @@ -# Tomcat -server: - port: 39302 - # Spring spring: application: From 583f632c39a672fabba44a617f0a79da4f349e07 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Fri, 23 Aug 2024 09:39:47 +0800 Subject: [PATCH 06/20] add profile --- .../src/main/resources/bootstrap-sgzb_nw_dev.yml | 4 ++-- .../src/main/resources/bootstrap-sgzb_nw_local.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_nw_dev.yml b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_nw_dev.yml index d48619f..6916ce5 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_nw_dev.yml +++ b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_nw_dev.yml @@ -16,11 +16,11 @@ spring: discovery: # 服务注册地址 server-addr: 192.168.0.62:8848 - namespace: sgzb_cloud_dev_nw + namespace: sgzb_nwjj config: # 配置中心地址 server-addr: 192.168.0.62:8848 - namespace: sgzb_cloud_dev_nw + namespace: sgzb_nwjj # 配置文件格式 file-extension: yml # 共享配置 diff --git a/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_nw_local.yml b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_nw_local.yml index d0474fe..2c378f0 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_nw_local.yml +++ b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_nw_local.yml @@ -16,11 +16,11 @@ spring: discovery: # 服务注册地址 server-addr: 127.0.0.1:8848 - namespace: sgzb_cloud_dev_nw + namespace: sgzb_nwjj config: # 配置中心地址 server-addr: 127.0.0.1:8848 - namespace: sgzb_cloud_dev_nw + namespace: sgzb_nwjj # 配置文件格式 file-extension: yml # 共享配置 From c3c32505af4b228743a8b67e637598829a4676d8 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Fri, 23 Aug 2024 09:56:31 +0800 Subject: [PATCH 07/20] add profile --- .../main/resources/bootstrap-sgzb_cq_dev.yml | 34 +++++++++++++ .../resources/bootstrap-sgzb_cq_local.yml | 34 +++++++++++++ .../main/resources/bootstrap-sgzb_cq_dev.yml | 50 +++++++++++++++++++ .../resources/bootstrap-sgzb_cq_local.yml | 50 +++++++++++++++++++ .../main/resources/bootstrap-sgzb_cq_dev.yml | 35 +++++++++++++ .../resources/bootstrap-sgzb_cq_local.yml | 35 +++++++++++++ .../main/resources/bootstrap-sgzb_cq_dev.yml | 46 +++++++++++++++++ .../resources/bootstrap-sgzb_cq_local.yml | 45 +++++++++++++++++ 8 files changed, 329 insertions(+) create mode 100644 sgzb-auth/src/main/resources/bootstrap-sgzb_cq_dev.yml create mode 100644 sgzb-auth/src/main/resources/bootstrap-sgzb_cq_local.yml create mode 100644 sgzb-gateway/src/main/resources/bootstrap-sgzb_cq_dev.yml create mode 100644 sgzb-gateway/src/main/resources/bootstrap-sgzb_cq_local.yml create mode 100644 sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_cq_dev.yml create mode 100644 sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_cq_local.yml create mode 100644 sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_cq_dev.yml create mode 100644 sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_cq_local.yml diff --git a/sgzb-auth/src/main/resources/bootstrap-sgzb_cq_dev.yml b/sgzb-auth/src/main/resources/bootstrap-sgzb_cq_dev.yml new file mode 100644 index 0000000..10c3cfc --- /dev/null +++ b/sgzb-auth/src/main/resources/bootstrap-sgzb_cq_dev.yml @@ -0,0 +1,34 @@ +# Spring +spring: + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 192.168.0.56:8848 + namespace: sgzb_cqjj + config: + # 配置中心地址 + server-addr: 192.168.0.56:8848 + namespace: sgzb_cqjj + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + +onlineApprove: /lbcloud-oauth/oauth/token +wechatAppId: crhmaxnE +wechatAppsecret: 3893e6ed90d325f00e34583dd970a56580c05549 +getNowPersonDetailData: /lbcloud-user/user/queryLoginUserInfo +baseUrl: https://test-sso.csgmall.com.cn +appAppsecret: d8e6db9fa9bb09da0e270fa739233c823bf9c5f0 +personEasyList: /lbcloud-user/api/user/queryAndPaging/basicInfo +h5Appsecret: 3c4a67b7f6a268b4202a5328e6a1726979d5903b +h5AppId: G3NksDH2 +appsecret: 596e4863c8d112842ce820c130b236001297ea73 +appId: akvVFYgy +appAppId: u8LLfynf +getPersonDetailData: /lbcloud-user/api/user/queryById +registerPhone: /lbcloud-user/api/user/registrationByPhone +userBindUrl: /lbcloud-authority/api/RoleClient/bindDefaultSystemRole +verifyPhoneCode: /lbcloud-mbroker/api/broker/simpleVerificationCode \ No newline at end of file diff --git a/sgzb-auth/src/main/resources/bootstrap-sgzb_cq_local.yml b/sgzb-auth/src/main/resources/bootstrap-sgzb_cq_local.yml new file mode 100644 index 0000000..cee9f5f --- /dev/null +++ b/sgzb-auth/src/main/resources/bootstrap-sgzb_cq_local.yml @@ -0,0 +1,34 @@ +# Spring +spring: + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 127.0.0.1:8848 + namespace: sgzb_cqjj + config: + # 配置中心地址 + server-addr: 127.0.0.1:8848 + namespace: sgzb_cqjj + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + +onlineApprove: /lbcloud-oauth/oauth/token +wechatAppId: crhmaxnE +wechatAppsecret: 3893e6ed90d325f00e34583dd970a56580c05549 +getNowPersonDetailData: /lbcloud-user/user/queryLoginUserInfo +baseUrl: https://test-sso.csgmall.com.cn +appAppsecret: d8e6db9fa9bb09da0e270fa739233c823bf9c5f0 +personEasyList: /lbcloud-user/api/user/queryAndPaging/basicInfo +h5Appsecret: 3c4a67b7f6a268b4202a5328e6a1726979d5903b +h5AppId: G3NksDH2 +appsecret: 596e4863c8d112842ce820c130b236001297ea73 +appId: akvVFYgy +appAppId: u8LLfynf +getPersonDetailData: /lbcloud-user/api/user/queryById +registerPhone: /lbcloud-user/api/user/registrationByPhone +userBindUrl: /lbcloud-authority/api/RoleClient/bindDefaultSystemRole +verifyPhoneCode: /lbcloud-mbroker/api/broker/simpleVerificationCode \ No newline at end of file diff --git a/sgzb-gateway/src/main/resources/bootstrap-sgzb_cq_dev.yml b/sgzb-gateway/src/main/resources/bootstrap-sgzb_cq_dev.yml new file mode 100644 index 0000000..e0e986b --- /dev/null +++ b/sgzb-gateway/src/main/resources/bootstrap-sgzb_cq_dev.yml @@ -0,0 +1,50 @@ +# Spring Boot Actuator V2中风险漏洞处理,禁止远程端口访问 +management: + endpoint: + env: + enabled: false + +# Spring +spring: + cloud: + loadbalancer: + # 关闭Ribbon的负载均衡器 + ribbon: + enabled: false + # 开启Nacos的负载均衡器 + nacos: + enabled: true + nacos: + discovery: + # 服务注册地址 + server-addr: 192.168.0.56:8848 + namespace: sgzb_cqjj + config: + # 配置中心地址 + server-addr: 192.168.0.56:8848 + namespace: sgzb_cqjj + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + sentinel: + # 取消控制台懒加载 + eager: true + transport: + # 控制台地址 + dashboard: 127.0.0.1:8718 + # nacos配置持久化 + datasource: + ds1: + nacos: + server-addr: 192.168.0.56:8848 + dataId: sentinel-sgzb-gateway + groupId: DEFAULT_GROUP + data-type: json + rule-type: gw-flow + +#加密组件 +jasypt: + encryptor: + password: Encrypt diff --git a/sgzb-gateway/src/main/resources/bootstrap-sgzb_cq_local.yml b/sgzb-gateway/src/main/resources/bootstrap-sgzb_cq_local.yml new file mode 100644 index 0000000..fa5b108 --- /dev/null +++ b/sgzb-gateway/src/main/resources/bootstrap-sgzb_cq_local.yml @@ -0,0 +1,50 @@ +# Spring Boot Actuator V2中风险漏洞处理,禁止远程端口访问 +management: + endpoint: + env: + enabled: false + +# Spring +spring: + cloud: + loadbalancer: + # 关闭Ribbon的负载均衡器 + ribbon: + enabled: false + # 开启Nacos的负载均衡器 + nacos: + enabled: true + nacos: + discovery: + # 服务注册地址 + server-addr: 127.0.0.1:8848 + namespace: sgzb_cqjj + config: + # 配置中心地址 + server-addr: 127.0.0.1:8848 + namespace: sgzb_cqjj + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + sentinel: + # 取消控制台懒加载 + eager: true + transport: + # 控制台地址 + dashboard: 127.0.0.1:8718 + # nacos配置持久化 + datasource: + ds1: + nacos: + server-addr: 127.0.0.1:8848 + dataId: sentinel-sgzb-gateway + groupId: DEFAULT_GROUP + data-type: json + rule-type: gw-flow + +#加密组件 +jasypt: + encryptor: + password: Encrypt diff --git a/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_cq_dev.yml b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_cq_dev.yml new file mode 100644 index 0000000..d1d05df --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_cq_dev.yml @@ -0,0 +1,35 @@ +# Tomcat +server: + port: 39302 + +# Spring +spring: + cloud: + loadbalancer: + # 关闭Ribbon的负载均衡器 + ribbon: + enabled: false + # 开启Nacos的负载均衡器 + nacos: + enabled: true + nacos: + discovery: + # 服务注册地址 + server-addr: 192.168.0.56:8848 + namespace: sgzb_cqjj + config: + # 配置中心地址 + server-addr: 192.168.0.56:8848 + namespace: sgzb_cqjj + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + +# 多站点特殊配置 +sgzb: + site: cq + job: + settlementJobDay: 21 + settlementJobCron: "0 0 1 21 * ?" \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_cq_local.yml b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_cq_local.yml new file mode 100644 index 0000000..dc5cd6f --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_cq_local.yml @@ -0,0 +1,35 @@ +# Tomcat +server: + port: 39302 + +# Spring +spring: + cloud: + loadbalancer: + # 关闭Ribbon的负载均衡器 + ribbon: + enabled: false + # 开启Nacos的负载均衡器 + nacos: + enabled: true + nacos: + discovery: + # 服务注册地址 + server-addr: 127.0.0.1:8848 + namespace: sgzb_cqjj + config: + # 配置中心地址 + server-addr: 127.0.0.1:8848 + namespace: sgzb_cqjj + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + +# 多站点特殊配置 +sgzb: + site: cq + job: + settlementJobDay: 21 + settlementJobCron: "0 0 1 21 * ?" \ No newline at end of file diff --git a/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_cq_dev.yml b/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_cq_dev.yml new file mode 100644 index 0000000..b28d1b0 --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_cq_dev.yml @@ -0,0 +1,46 @@ +# Spring +spring: + servlet: + multipart: + max-request-size: 50MB + max-file-size: 30MB + cloud: + loadbalancer: + # 关闭Ribbon的负载均衡器 + ribbon: + enabled: false + # 开启Nacos的负载均衡器 + nacos: + enabled: true + nacos: + discovery: + # 服务注册地址 + server-addr: 192.168.0.56:8848 + namespace: sgzb_cqjj + config: + # 配置中心地址 + server-addr: 192.168.0.56:8848 + namespace: sgzb_cqjj + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} +#腾讯云sms +tencent: + sms: + #api秘钥标识 + accessKeyId: AKIDrreCVaRKDtMcgfU5QW9iEfv67tMfldJn + #api秘钥 + accessKeySecret: OXUgeMo0yhBRTGo6sVu3yiFX4rQtAzc3 + #请求域名 + endpoint: sms.tencentcloudapi.com + #所属区域 + region: ap-guangzhou + #腾讯云申请应用id + sdkAppId: 1400494336 + #签名 + smsSign: 南方电网互联网 + #云平台模板id 2116937-验收通知 2115503-登录验证 + templateId: 2116937,2115503 + diff --git a/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_cq_local.yml b/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_cq_local.yml new file mode 100644 index 0000000..4d4bd4f --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_cq_local.yml @@ -0,0 +1,45 @@ +# Spring +spring: + servlet: + multipart: + max-request-size: 50MB + max-file-size: 30MB + cloud: + loadbalancer: + # 关闭Ribbon的负载均衡器 + ribbon: + enabled: false + # 开启Nacos的负载均衡器 + nacos: + enabled: true + nacos: + discovery: + # 服务注册地址 + server-addr: 127.0.0.1:8848 + namespace: sgzb_cqjj + config: + # 配置中心地址 + server-addr: 127.0.0.1:8848 + namespace: sgzb_cqjj + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} +#腾讯云sms +tencent: + sms: + #api秘钥标识 + accessKeyId: AKIDrreCVaRKDtMcgfU5QW9iEfv67tMfldJn + #api秘钥 + accessKeySecret: OXUgeMo0yhBRTGo6sVu3yiFX4rQtAzc3 + #请求域名 + endpoint: sms.tencentcloudapi.com + #所属区域 + region: ap-guangzhou + #腾讯云申请应用id + sdkAppId: 1400494336 + #签名 + smsSign: 南方电网互联网 + #云平台模板id 2116937-验收通知 2115503-登录验证 + templateId: 2116937,2115503 From 15ccee2af1b62aba96feec91707e39a443f92e08 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Fri, 23 Aug 2024 10:01:55 +0800 Subject: [PATCH 08/20] add profile --- scripts/pipeline.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pipeline.sh b/scripts/pipeline.sh index cfb8ab3..69da07b 100644 --- a/scripts/pipeline.sh +++ b/scripts/pipeline.sh @@ -5,7 +5,7 @@ pipeline { JAVA_HOME = '/usr/lib/jvm/jdk1.8.0_381' JOBNAME="${JOB_NAME}" JENKINS_NODE_COOKIE = "dontKillMe" - SPRING_PROFILES_ACTIVE = "sgzb_cloud_dev" + SPRING_PROFILES_ACTIVE = "sgzb_cq_dev" } stages { stage('Check out') { From 693d3f290725fb7b421d7e70bfc532a5eeca3ce5 Mon Sep 17 00:00:00 2001 From: "liang.chao" <1360241448@qq.com> Date: Fri, 23 Aug 2024 11:20:57 +0800 Subject: [PATCH 09/20] =?UTF-8?q?=E5=8D=97=E7=BD=91=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E5=8A=9F=E8=83=BD=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SltAgreementInfoServiceImpl.java | 24 +---------------- .../material/SltAgreementInfoMapper.xml | 26 +++++++++---------- 2 files changed, 13 insertions(+), 37 deletions(-) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java index b46f9c3..a42bd3f 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java @@ -136,30 +136,8 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { @Override @Transactional public int settlementReview(SltAgreementApply apply) { - Long userid = SecurityUtils.getLoginUser().getUserid(); - apply.setAuditor(String.valueOf(userid)); int i = sltAgreementInfoMapper.updateRelation(apply); - int j = 0; - if (i > 0) { - List relations = sltAgreementInfoMapper.getRelations(apply); - List infos = new ArrayList<>(); - for (SltAgreementRelation bean : relations) { - AgreementInfo info = new AgreementInfo(); - info.setAgreementId(Long.valueOf(bean.getAgreementId())); - infos.add(info); - } - List loseList = getLoseList(infos); - for (SltAgreementInfo agreementInfo : loseList) { - if (agreementInfo.getMaId() != null && agreementInfo.getMaId().isEmpty()) { - sltAgreementInfoMapper.updateMaStatus(agreementInfo); - } - } - j = sltAgreementInfoMapper.updateApply(apply); - } else { - throw new ServiceException("结算审核失败"); - //throw new ServiceException(ExceptionDict.SETTLEMENT_REVIEW_ERROR_MSG,ExceptionDict.SETTLEMENT_REVIEW_ERROR); - } - return j; + return i; } @Override diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml index 2f909d0..358c4c9 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml @@ -70,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update slt_agreement_relation set status = #{status} - where apply_id = #{id} + where agreement_id = #{agreementId} update slt_agreement_apply @@ -265,16 +265,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select count(*) from slt_agreement_apply where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{date},'%y%m') select * from direct_apply_info where id = #{id} - + select ma_status as status from ma_machine where ma_id = #{maId} From a88b68293947055723f7212cb33a7c2048070e5b Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Fri, 23 Aug 2024 13:00:41 +0800 Subject: [PATCH 11/20] =?UTF-8?q?=E9=80=80=E6=96=99=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E5=8F=AA=E6=98=BE=E7=A4=BA=E9=A2=86=E6=96=99=E7=9A=84=E6=9C=BA?= =?UTF-8?q?=E5=85=B7=E7=B1=BB=E5=9E=8B=E5=B1=82=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sgzb/material/mapper/BackApplyMapper.java | 6 ++ .../service/impl/BackApplyServiceImpl.java | 14 +++- .../mapper/material/BackApplyMapper.xml | 76 +++++++++++++++++++ 3 files changed, 95 insertions(+), 1 deletion(-) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/BackApplyMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/BackApplyMapper.java index 02555a5..69b857f 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/BackApplyMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/BackApplyMapper.java @@ -120,6 +120,12 @@ public interface BackApplyMapper { */ List getUseTypeTree(BackApplyInfo bean); + List getUseTypeTreeL4(BackApplyInfo bean); + + List getUseTypeTreeL3(List list); + + List getUseTypeTreeL21(List list); + /** * 退料申请导出 * @param bean diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackApplyServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackApplyServiceImpl.java index 66e71d9..e9eb008 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackApplyServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackApplyServiceImpl.java @@ -19,6 +19,7 @@ import org.springframework.stereotype.Service; import java.text.SimpleDateFormat; import java.util.*; +import java.util.stream.Collectors; /** * @author hay @@ -364,8 +365,19 @@ public class BackApplyServiceImpl implements BackApplyService { public AjaxResult getUseTypeTree(BackApplyInfo bean) { List groupList = new ArrayList<>(); List list = new ArrayList<>(); + List listL4 = new ArrayList<>(); + List listL3 = new ArrayList<>(); + List listL21 = new ArrayList<>(); try { - list = backApplyMapper.getUseTypeTree(bean); + //list = backApplyMapper.getUseTypeTree(bean); + listL4 = backApplyMapper.getUseTypeTreeL4(bean); + List list4ParentIds = listL4.stream().map(o -> o.getParentId()).collect(Collectors.toList()); + listL3 = backApplyMapper.getUseTypeTreeL3(list4ParentIds); + List list3ParentIds = listL3.stream().map(o -> o.getParentId()).collect(Collectors.toList()); + listL21 = backApplyMapper.getUseTypeTreeL21(list3ParentIds); + list.addAll(listL4); + list.addAll(listL3); + list.addAll(listL21); if (CollectionUtils.isNotEmpty(list)) { // 创建树形结构(数据集合作为参数) TypeTreeBuild treeBuild = new TypeTreeBuild(list); diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BackApplyMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BackApplyMapper.xml index e0a9c7c..238721d 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BackApplyMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BackApplyMapper.xml @@ -690,6 +690,82 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEVEL ASC, type_id; + + + + + + SELECT - mt.type_id, - mt.type_name, - mt.parent_id, - mt.unit_name as unitNames, - mt.company_id, - SUM( CASE WHEN sai.agreement_id = #{agreementId} AND sai.STATUS = '0' THEN sai.num ELSE 0 END ) AS num, - mt.LEVEL + t4.type_id, + t4.type_name, + t4.parent_id, + t4.unit_name, + t4.company_id, + COALESCE(SUM(CASE WHEN sai.agreement_id = #{agreementId} AND sai.status = '0' THEN sai.num ELSE 0 END), 0) AS num, + 4 AS LEVEL FROM - ma_type mt - LEFT JOIN slt_agreement_info sai ON mt.type_id = sai.type_id + ma_type t4 + LEFT JOIN slt_agreement_info sai ON t4.type_id = sai.type_id WHERE - EXISTS ( SELECT 1 FROM slt_agreement_info sai2 WHERE sai2.type_id = mt.type_id AND sai2.agreement_id = #{agreementId} AND sai2.STATUS = '0' and sai.lease_type = 0) + t4.level = 4 + AND EXISTS ( + SELECT 1 FROM slt_agreement_info sai2 + WHERE sai2.type_id = t4.type_id AND sai2.agreement_id = #{agreementId} AND sai2.status = '0' + ) GROUP BY - mt.type_id + t4.type_id - -- 查询从第四级到第一级的所有类型及相关信息 - SELECT - t4.type_id, - t4.type_name, - t4.parent_id, - t4.unit_name, - t4.company_id, - COALESCE(SUM(CASE WHEN sai.agreement_id = #{agreementId} AND sai.status = '0' THEN sai.num ELSE 0 END), 0) AS num, - 4 AS LEVEL - FROM - ma_type t4 - LEFT JOIN slt_agreement_info sai ON t4.type_id = sai.type_id - WHERE - t4.level = 4 - AND EXISTS ( - SELECT 1 FROM slt_agreement_info sai2 - WHERE sai2.type_id = t4.type_id AND sai2.agreement_id = #{agreementId} AND sai2.status = '0' - ) - GROUP BY - t4.type_id - - UNION ALL - - SELECT - t3.type_id, - t3.type_name, - t3.parent_id, - t3.unit_name, - t3.company_id, - 0 AS num, - 3 AS LEVEL - FROM - ma_type t3 - INNER JOIN ( - SELECT DISTINCT t4.parent_id - FROM ma_type t4 - WHERE t4.level = 4 - ) AS parent_t4 ON t3.type_id = parent_t4.parent_id - - UNION ALL - - SELECT - t2.type_id, - t2.type_name, - t2.parent_id, - t2.unit_name, - t2.company_id, - 0 AS num, - 2 AS LEVEL - FROM - ma_type t2 - INNER JOIN ( - SELECT DISTINCT t3.parent_id - FROM ma_type t3 - WHERE t3.level = 3 - ) AS parent_t3 ON t2.type_id = parent_t3.parent_id - - UNION ALL - - SELECT - t1.type_id, - t1.type_name, - t1.parent_id, - t1.unit_name, - t1.company_id, - 0 AS num, - 1 AS LEVEL - FROM - ma_type t1 - INNER JOIN ( - SELECT DISTINCT t2.parent_id - FROM ma_type t2 - WHERE t2.level = 2 - ) AS parent_t2 ON t1.type_id = parent_t2.parent_id - - ORDER BY - LEVEL ASC, type_id; - - SELECT - t4.type_id, - t4.type_name, - t4.parent_id, - t4.unit_name, - t4.company_id, - COALESCE(SUM(CASE WHEN sai.agreement_id = #{agreementId} AND sai.status = '0' THEN sai.num ELSE 0 END), 0) AS num, - 4 AS LEVEL + mt.type_id, + mt.type_name, + mt.parent_id, + mt.unit_name as unitNames, + mt.company_id, + SUM( CASE WHEN sai.agreement_id = 78 AND sai.STATUS = '0' THEN sai.num ELSE 0 END ) AS num, + mt.LEVEL FROM - ma_type t4 - LEFT JOIN slt_agreement_info sai ON t4.type_id = sai.type_id + ma_type mt + LEFT JOIN slt_agreement_info sai ON mt.type_id = sai.type_id WHERE - t4.level = 4 - AND EXISTS ( - SELECT 1 FROM slt_agreement_info sai2 - WHERE sai2.type_id = t4.type_id AND sai2.agreement_id = #{agreementId} AND sai2.status = '0' - ) + EXISTS ( SELECT 1 FROM slt_agreement_info sai2 WHERE sai2.type_id = mt.type_id AND sai2.agreement_id = 78 AND sai2.STATUS = '0' and sai.lease_type = 0) GROUP BY - t4.type_id + mt.type_id From e1bde9f1a193baee5b960010eec931dfeb6f7a51 Mon Sep 17 00:00:00 2001 From: "liang.chao" <1360241448@qq.com> Date: Fri, 23 Aug 2024 17:28:42 +0800 Subject: [PATCH 19/20] =?UTF-8?q?=E7=BB=93=E7=AE=97=E5=AF=BC=E5=87=BAsheet?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SltAgreementInfoController.java | 16 ++++++++++------ .../mapper/material/CalMonthlyMapper.xml | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SltAgreementInfoController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SltAgreementInfoController.java index 2899990..6790b9f 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SltAgreementInfoController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SltAgreementInfoController.java @@ -101,6 +101,7 @@ public class SltAgreementInfoController extends BaseController { List sltInfoMonth = sltAgreementInfoService.getSltInfoMonth(list); List> allLists = new ArrayList<>(); for (AgreementInfo agreementInfo : list) { + List list1 = new ArrayList<>(); for (SltAgreementInfo sltAgreementInfo : sltInfoMonth) { // 单个协议导出 if (StringUtils.isNotBlank(agreementInfo.getCodeNum())) { @@ -109,16 +110,19 @@ public class SltAgreementInfoController extends BaseController { if (s.equals(sltAgreementInfo.getCodeNum().toString())) { List node = sltAgreementInfo.getNode(); List leaseInfoList = Convert.toList(MonthRepairInfo.class, node); - allLists.add(leaseInfoList); + list1.addAll(leaseInfoList); } } } else { - // 多个协议导出 - List node = sltAgreementInfo.getNode(); - List leaseInfoList = Convert.toList(MonthRepairInfo.class, node); - allLists.add(leaseInfoList); + if (String.valueOf(agreementInfo.getAgreementId()).equals(sltAgreementInfo.getAgreementId())){ + // 多个协议导出 + List node = sltAgreementInfo.getNode(); + List leaseInfoList = Convert.toList(MonthRepairInfo.class, node); + list1.addAll(leaseInfoList); + } } } + allLists.add(list1); } exportMultipleLists(allLists, response); } @@ -283,7 +287,7 @@ public class SltAgreementInfoController extends BaseController { ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), MonthRepairInfo.class).build(); for (int i = 0; i < lists.size(); i++) { - WriteSheet writeSheet = EasyExcel.writerSheet("Sheet" + (i + 1)).build(); + WriteSheet writeSheet = EasyExcel.writerSheet(lists.get(i).get(0).getProjectName()).build(); excelWriter.write(lists.get(i), writeSheet); } diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/CalMonthlyMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/CalMonthlyMapper.xml index 93dd5e8..2446feb 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/CalMonthlyMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/CalMonthlyMapper.xml @@ -32,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" bui.unit_name AS unitName, bp.lot_name AS projectName, spm.month as month, + pmc.agreement_id as agreementId, pmc.cost_bearing_party as costBearingParty, pmc.costs as costs FROM From ab5b90b85d5db26063b749a2fbc627df6a0cf9ca Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Fri, 23 Aug 2024 17:42:42 +0800 Subject: [PATCH 20/20] =?UTF-8?q?=E5=8A=A0=E4=BF=9D=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/BackApplyServiceImpl.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackApplyServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackApplyServiceImpl.java index cb01580..8a20bb5 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackApplyServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackApplyServiceImpl.java @@ -371,15 +371,17 @@ public class BackApplyServiceImpl implements BackApplyService { try { // 先查第四层类型 listL4 = backApplyMapper.getUseTypeTreeL4(bean); - List list4ParentIds = listL4.stream().map(o -> o.getParentId()).collect(Collectors.toList()); - // 根据第四层parentId 查第三层类型 - listL3 = backApplyMapper.getUseTypeTreeL3(list4ParentIds); - List list3ParentIds = listL3.stream().map(o -> o.getParentId()).collect(Collectors.toList()); - // 根据第三层parentId 查第1.2层类型 - listL21 = backApplyMapper.getUseTypeTreeL21(list3ParentIds); - list.addAll(listL4); - list.addAll(listL3); - list.addAll(listL21); + if (CollectionUtils.isNotEmpty(listL4)) { + List list4ParentIds = listL4.stream().map(o -> o.getParentId()).collect(Collectors.toList()); + // 根据第四层parentId 查第三层类型 + listL3 = backApplyMapper.getUseTypeTreeL3(list4ParentIds); + List list3ParentIds = listL3.stream().map(o -> o.getParentId()).collect(Collectors.toList()); + // 根据第三层parentId 查第1.2层类型 + listL21 = backApplyMapper.getUseTypeTreeL21(list3ParentIds); + list.addAll(listL4); + list.addAll(listL3); + list.addAll(listL21); + } if (CollectionUtils.isNotEmpty(list)) { // 创建树形结构(数据集合作为参数) TypeTreeBuild treeBuild = new TypeTreeBuild(list);