From bb58e9a07457399f0c554d5dc9328d3c72ae63fa Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Mon, 9 Dec 2024 11:17:17 +0800 Subject: [PATCH 01/37] =?UTF-8?q?=E5=95=86=E5=93=81=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=88=E6=A3=80=E6=B5=8B=E7=B1=BB=E5=9E=8B=EF=BC=89=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE=EF=BC=8C=E5=BA=94=E4=B8=BA?= =?UTF-8?q?=EF=BC=88=E5=B9=B4=E5=AE=A1=E3=80=81=E9=9D=9E=E5=AE=9A=E6=A3=80?= =?UTF-8?q?=E3=80=81=E5=AE=9A=E6=A3=80=E3=80=81=E5=85=B6=E4=BB=96=E7=AD=89?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AppInspectionPartnerServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java index fef39ebb..8fd50073 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java @@ -1458,6 +1458,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl Date: Mon, 9 Dec 2024 15:23:35 +0800 Subject: [PATCH 02/37] =?UTF-8?q?=E5=A4=9A=E4=B8=AA=E5=8F=AF=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E5=86=85=E5=AE=B9=E6=97=B6=E5=8F=AA=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspection/entity/InspectionStepInfo.java | 1 + .../impl/InspectionWorkNodeServiceImpl.java | 3 + .../inspection/InspectionInfoMapper.xml | 134 +++++++++++++----- 3 files changed, 99 insertions(+), 39 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionStepInfo.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionStepInfo.java index bafac7a6..01a127db 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionStepInfo.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionStepInfo.java @@ -37,6 +37,7 @@ public class InspectionStepInfo extends Model { //创建人id private Integer creator; //更新时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") private Date updateTime; //更新人id private Integer updater; diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionWorkNodeServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionWorkNodeServiceImpl.java index 83a3041b..c76fba88 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionWorkNodeServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionWorkNodeServiceImpl.java @@ -28,6 +28,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.io.IOException; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -191,6 +192,8 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl() diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml index 40d93c5f..40357fca 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml @@ -269,56 +269,112 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by ins.start_time desc + + + AND ii.car_num LIKE CONCAT('%', #{inspectionInfo.carNum}, '%') + + + + AND + (ii.lead_man_id = #{inspectionInfo.leadManId} + OR iwn.role_id IN + + #{roleId} + ) + AND ii.status = '0' + AND iwn.status = '0' + -- AND ii.now_order_num = iwn.order_num + ORDER BY ii.create_time DESC + + + + AND ii.status = '0' + AND iwn.status = '1' + AND iwn.deal_user_id = #{inspectionInfo.dealUserId} + ORDER BY iwn.update_time DESC + + + + AND iwn.status = '2' + AND iwn.deal_user_id = #{inspectionInfo.dealUserId} + ORDER BY iwn.update_time DESC + + + ) AS subquery + WHERE rn = 1; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From d5bab8289b76ab19ab89f97324fdd7f58734cf43 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Mon, 9 Dec 2024 16:12:21 +0800 Subject: [PATCH 03/37] =?UTF-8?q?=E5=91=98=E5=B7=A5=E5=90=8C=E6=84=8F?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E8=AE=A2=E5=8D=95=E5=8D=B3=E8=AE=A4=E5=AE=9A?= =?UTF-8?q?=E4=B8=BA=E5=BC=80=E5=A7=8B=E6=A3=80=E6=B5=8B=EF=BC=8C=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=E6=A3=80=E6=B5=8B=E6=97=B6=E5=BA=94=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E6=98=AF=E5=BC=80=E5=A7=8B-=E7=BB=93=E6=9D=9F?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=9A=84=E6=93=8D=E4=BD=9C=E6=97=B6=E9=97=B4?= =?UTF-8?q?=20=20=E6=AF=8F=E4=B8=80=E6=AD=A5=E6=93=8D=E4=BD=9C=E9=83=BD?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E6=98=BE=E7=A4=BA=20=E5=BC=80=E5=A7=8B?= =?UTF-8?q?=E5=92=8C=E7=BB=93=E6=9D=9F=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/InspectionWorkNodeServiceImpl.java | 89 ++++++++++++------- 1 file changed, 59 insertions(+), 30 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionWorkNodeServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionWorkNodeServiceImpl.java index c76fba88..30e1c5cf 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionWorkNodeServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionWorkNodeServiceImpl.java @@ -91,6 +91,21 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl() + .eq(DlInspectionProject::getId, workNode.getProjectId())); + if (ObjectUtil.isNotNull(project)) { + inspectionStepInfo.setTitle(project.getProjectName()); + } else { + inspectionStepInfo.setTitle("检测项目"); + } + inspectionStepInfo.setCreateTime(DateUtil.date()); + inspectionStepInfo.setCreator(Integer.parseInt(SecurityFrameworkUtils.getLoginUserId() + "")); + inspectionStepInfo.setWorkNodeId(workNodeId); + inspectionStepService.save(inspectionStepInfo); + //查询用户 信息 //修改工单表中当前施工人 // inspectionInfo.setWorkId(workerUser.getId()); @@ -144,6 +159,16 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl() + .eq(DlInspectionProject::getId, workNode.getProjectId())); + inspectionStepService.remove(new LambdaQueryWrapper() + .and(i -> + i.eq(InspectionStepInfo::getInspectionInfoId, inspectionId) + .eq(InspectionStepInfo::getWorkNodeId, workNodeId) + .eq(InspectionStepInfo::getTitle, project.getProjectName()) + )); } /** @@ -180,42 +205,46 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(InspectionWorkNode::getInspectionInfoId, workNode.getInspectionInfoId()); //是否还有进行中或者待开始的状态 - queryWrapper.in(InspectionWorkNode::getStatus, "0","1"); + queryWrapper.in(InspectionWorkNode::getStatus, "0", "1"); List inspectionWorkNodes = this.list(queryWrapper); boolean flag = true; //判断是否是最后一个流程 - if (inspectionWorkNodes.size() == 1 && inspectionWorkNodes.get(0).getId().equals(workNode.getId())){ + if (inspectionWorkNodes.size() == 1 && inspectionWorkNodes.get(0).getId().equals(workNode.getId())) { flag = false; } - - // 插入步骤信息 - InspectionStepInfo inspectionStepInfo = new InspectionStepInfo(); - inspectionStepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(workNode.getInspectionInfoId()))); - inspectionStepInfo.setUpdater(Integer.parseInt(String.valueOf(loginUser.getId()))); - inspectionStepInfo.setUpdateTime(DateUtil.date()); - - //根据projectId查询项目名称 + // 更新或插入步骤信息 DlInspectionProject project = inspectionProjectService.getOne(new LambdaQueryWrapper() .eq(DlInspectionProject::getId, workNode.getProjectId())); - String stepTitle = ""; - if (ObjectUtil.isNotNull(project)) { - inspectionStepInfo.setTitle(project.getProjectName()); + InspectionStepInfo stepInfo = inspectionStepService.getOne(new LambdaQueryWrapper() + .and(i -> i.eq(InspectionStepInfo::getInspectionInfoId, workNode.getInspectionInfoId()) + .eq(InspectionStepInfo::getWorkNodeId, workNode.getId()) + .eq(InspectionStepInfo::getTitle, ObjectUtil.isNotEmpty(project) ? project.getProjectName() : workNode.getProjectName()) + )); + if (ObjectUtil.isNotEmpty(stepInfo)) { + stepInfo.setUpdateTime(DateUtil.date()); + stepInfo.setUpdater(Integer.parseInt(SecurityFrameworkUtils.getLoginUserId() + "")); } else { - inspectionStepInfo.setTitle("项目检测完成"); + stepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(workNode.getInspectionInfoId()))); + if (ObjectUtil.isNotNull(project)) { + stepInfo.setTitle(project.getProjectName()); + } else { + stepInfo.setTitle("项目检测完成"); + } + stepInfo.setWorkNodeId(workNode.getId()); + stepInfo.setCreateTime(DateUtil.date()); + stepInfo.setCreator(Integer.parseInt(String.valueOf(loginUser.getId()))); + stepInfo.setUpdater(Integer.parseInt(String.valueOf(loginUser.getId()))); + stepInfo.setUpdateTime(DateUtil.date()); } if (ObjectUtil.isNotEmpty(inspectionWorkNode.getRemark())) { - inspectionStepInfo.setContent(inspectionWorkNode.getRemark()); + stepInfo.setContent(inspectionWorkNode.getRemark()); } if (ObjectUtil.isNotEmpty(inspectionWorkNode.getDealImages())) { - inspectionStepInfo.setImages(inspectionWorkNode.getDealImages()); + stepInfo.setImages(inspectionWorkNode.getDealImages()); } - inspectionStepInfo.setWorkNodeId(workNode.getId()); - inspectionStepInfo.setCreateTime(DateUtil.date()); - inspectionStepInfo.setCreator(Integer.parseInt(String.valueOf(loginUser.getId()))); - inspectionStepService.save(inspectionStepInfo); + inspectionStepService.saveOrUpdate(stepInfo); if (!flag) { - stepTitle = "检测结束"; //设置工单状态为已完成 inspectionInfo.setStatus("1"); //设置工单通过 @@ -226,12 +255,12 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl roleIds = new ArrayList<>(); /*获取所有的角色id*/ - if(CollUtil.isNotEmpty(workNodes.getWorkNodes())){ + if (CollUtil.isNotEmpty(workNodes.getWorkNodes())) { roleIds = workNodes.getWorkNodes().stream().map(inspectionWorkNode -> inspectionWorkNode.getRoleId()).collect(Collectors.toList()); } //根据角色id获取所有用户 @@ -434,7 +463,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl listByUserId = roleService.getListByUserId(roleId); List ids = listByUserId.stream().map(UserDTO::getId).collect(Collectors.toList()); - if (ObjectUtil.isNotNull(info.getLeadManId())){ + if (ObjectUtil.isNotNull(info.getLeadManId())) { ids.add(info.getLeadManId()); } sendSocketMessage(ids); From 853c5913d8f536b92aebc4420e588749fa445523 Mon Sep 17 00:00:00 2001 From: PQZ Date: Mon, 9 Dec 2024 17:17:24 +0800 Subject: [PATCH 04/37] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/property/controller/admin/PropertyPosController.java | 1 - 1 file changed, 1 deletion(-) diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/controller/admin/PropertyPosController.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/controller/admin/PropertyPosController.java index 6b3131d2..3f026f68 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/controller/admin/PropertyPosController.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/controller/admin/PropertyPosController.java @@ -32,7 +32,6 @@ public class PropertyPosController { @PostMapping("/create") @Operation(summary = "创建企业管理-资产存放位置") - @PreAuthorize("@ss.hasPermission('company:property-pos:create')") public CommonResult createPropertyPos(@RequestBody PropertyPosReqVO createReqVO) { return success(propertyPosService.createPropertyPos(createReqVO)); } From e1015c4b040a4d6e6b63edee8d1f2982a0dfbfdc Mon Sep 17 00:00:00 2001 From: Vinjor Date: Mon, 9 Dec 2024 18:10:58 +0800 Subject: [PATCH 05/37] 1 --- .../iocoder/yudao/common/RecordTypeEnum.java | 2 +- .../yudao/common/TicketsStatusEnum.java | 12 ++-- .../tickets/mapper/DlRepairTicketsMapper.java | 4 ++ .../impl/DlRepairTicketsServiceImpl.java | 72 +++++++++++++++++-- .../tickets/vo/DlRepairTicketsReqVO.java | 10 +++ .../mapper/tickets/DlRepairTicketsMapper.xml | 35 ++++++++- 6 files changed, 120 insertions(+), 15 deletions(-) diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java index 9a5c946c..cfaff6de 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java @@ -80,7 +80,7 @@ public enum RecordTypeEnum { /** 删除工单 */ SCGG("scgg", "删除工单"), - /** 删除工单 */ + /** 交车 */ JC("jc", "交车"), /** 内返派工 */ diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/TicketsStatusEnum.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/TicketsStatusEnum.java index ce29b4bb..960db751 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/TicketsStatusEnum.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/TicketsStatusEnum.java @@ -19,18 +19,14 @@ public enum TicketsStatusEnum { * 施工中 */ WORKING("05","施工中"), - /** - * 未结账 - */ - NO_PAY("01","未结账"), /** * 待通知客户取车 */ WAITING_NOTICE("07","待通知客户取车"), /** - * 已交车 + * 未结账 */ - OVER("08","已交车"), + NO_PAY("01","未结账"), /** * 挂单/记账 */ @@ -39,6 +35,10 @@ public enum TicketsStatusEnum { * 已结账 */ CHECK_OUT("02","已结账"), + /** + * 已交车 + */ + OVER("08","已交车"), /** * 已作废 */ diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/mapper/DlRepairTicketsMapper.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/mapper/DlRepairTicketsMapper.java index 0ca90e77..931ea202 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/mapper/DlRepairTicketsMapper.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/mapper/DlRepairTicketsMapper.java @@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 针对表【dl_repair_tickets(维修工单表)】的数据库操作Mapper * @@ -52,6 +54,8 @@ public interface DlRepairTicketsMapper extends BaseMapper { * @return java.lang.Long **/ Long selectCountByParams(@Param("nowDate")String dayDate, @Param("recordCode")String recordCode, @Param("startTime")String startTime, @Param("endTime")String endTime); + + List selectTicketIdByParams( @Param("recordCode")String recordCode, @Param("startTime")String startTime, @Param("endTime")String endTime); } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java index a0170e3d..0dbf8180 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java @@ -1024,7 +1024,57 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl idList = new ArrayList<>(); + if("yijungong".equals(repairTicketsReqVO.getTicketsStatus())){ + //已竣工 + idList = repairTicketsMapper.selectTicketIdByParams(RecordTypeEnum.ZJ.getCode(),startDate,endDate); + }else if("yijiaoche".equals(repairTicketsReqVO.getTicketsStatus())){ + //已交车 + idList = repairTicketsMapper.selectTicketIdByParams(RecordTypeEnum.JC.getCode(),startDate,endDate); + }else { + //进厂 + repairTicketsReqVO.setStartDate(startDate); + repairTicketsReqVO.setEndDate(endDate); + } + if(null!=idList && !idList.isEmpty()){ + repairTicketsReqVO.setIdList(idList); + //时间查询条件置空 + repairTicketsReqVO.setStartDate(null); + repairTicketsReqVO.setEndDate(null); + } + }else { + //否则查询时间不生效,按维修状态查 + List statusList = new ArrayList<>(); + if("weixiuzhong".equals(repairTicketsReqVO.getTicketsStatus())){ + //维修中 + statusList.add(TicketsStatusEnum.WORKING.getCode()); + }else if("weijiesuan".equals(repairTicketsReqVO.getTicketsStatus())){ + //未结算 + statusList = Arrays.asList("04","05","07","01"); + }else if("zaichang".equals(repairTicketsReqVO.getTicketsStatus())){ + //在厂 + statusList = Arrays.asList("04","05","07","01","06","02"); + }else if("jinchang".equals(repairTicketsReqVO.getTicketsStatus())){ + //进厂 + statusList.add(TicketsStatusEnum.NO_WORK.getCode()); + }else if("yijungong".equals(repairTicketsReqVO.getTicketsStatus())){ + //已竣工 + statusList.add(TicketsStatusEnum.WAITING_NOTICE.getCode()); + }else if("yijiaoche".equals(repairTicketsReqVO.getTicketsStatus())){ + //已交车 + statusList.add(TicketsStatusEnum.OVER.getCode()); + } + if(!statusList.isEmpty()){ + repairTicketsReqVO.setStatusList(statusList); + } + } return baseMapper.getPageTypeAll(repairTicketsReqVO, page); } } @@ -1562,10 +1612,17 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl repairTickets = this.list(); if (!repairTickets.isEmpty()) { workingNum = repairTickets.stream().filter(item -> TicketsStatusEnum.WORKING.getCode().equals(item.getTicketsStatus())).count(); - inCompanyNum = repairTickets.stream().filter(item -> TicketsStatusEnum.NO_PAY.getCode().equals(item.getTicketsStatus())).count(); + //只要没交车都算在厂 + List inCompanyCodeList = Arrays.asList("04","05","07","01","06","02"); + inCompanyNum = repairTickets.stream().filter(item -> inCompanyCodeList.contains(item.getTicketsStatus())).count(); + //只要没结算,都是未结算 + List noPayCodeList = Arrays.asList("04","05","07","01"); + noPayNum = repairTickets.stream().filter(item -> noPayCodeList.contains(item.getTicketsStatus())).count(); LocalDateTime currentTime = LocalDateTime.now(); if("today".equals(selectType)){ String nowDayStr = DateUtil.formatDate(new Date()); @@ -1573,15 +1630,15 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl item.getCreateTime().toLocalDate().equals(currentTime.toLocalDate())).count(); //查当日已完成的(总检完成的) overNum = repairTicketsMapper.selectCountByParams(nowDayStr,RecordTypeEnum.ZJ.getCode(),null,null); - //查当日已交车的(已结算的) - giveCusNum = repairTicketsMapper.selectCountByParams(nowDayStr,RecordTypeEnum.JS.getCode(),null,null); + //查当日已交车的 + giveCusNum = repairTicketsMapper.selectCountByParams(nowDayStr,RecordTypeEnum.JC.getCode(),null,null); }else if("all".equals(selectType)){ //查累计进厂数、已完成、已交车 newOrderNum = repairTickets.size(); //查累计已完成的(总检完成的) overNum = repairTicketsMapper.selectCountByParams(null,RecordTypeEnum.ZJ.getCode(),null,null); //查累计已交车的(已结算的) - giveCusNum = repairTicketsMapper.selectCountByParams(null,RecordTypeEnum.JS.getCode(),null,null); + giveCusNum = repairTicketsMapper.selectCountByParams(null,RecordTypeEnum.JC.getCode(),null,null); }else { //查某个时间范围内进厂数、已完成、已交车 LocalDateTime startTime = LocalDateTime.parse(startDate+" 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); @@ -1589,8 +1646,8 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl item.getCreateTime().isAfter(startTime) && item.getCreateTime().isBefore(endTime)).count(); //查某区间范围内已完成的(总检完成的) overNum = repairTicketsMapper.selectCountByParams(null,RecordTypeEnum.ZJ.getCode(), startDate+" 00:00:00", endDate+" 23:59:59"); - //查某区间范围内已交车的(已结算的) - giveCusNum = repairTicketsMapper.selectCountByParams(null,RecordTypeEnum.JS.getCode(), startDate+" 00:00:00", endDate+" 23:59:59"); + //查某区间范围内已交车的 + giveCusNum = repairTicketsMapper.selectCountByParams(null,RecordTypeEnum.JC.getCode(), startDate+" 00:00:00", endDate+" 23:59:59"); } } rtnMap.put("workingNum", workingNum); @@ -1598,6 +1655,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl statusList; + /** 工单id集和 */ + private List idList; } diff --git a/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml b/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml index 02fcf279..19483ced 100644 --- a/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml @@ -369,11 +369,28 @@ ) - and drt.create_time between #{map.searchTimeArray[0]} and #{map.searchTimeArray[1]} + and (drt.create_time between #{map.searchTimeArray[0]} and #{map.searchTimeArray[1]}) + + + and (drt.create_time >= #{map.startDate} and drt.create_time <= #{map.endDate}) AND (drt.repair_type=#{map.repairType}) + + AND (drt.tickets_status IN + + #{item} + + ) + + + AND (drt.id IN + + #{item} + + ) + @@ -424,4 +441,20 @@ AND drr.create_time <= #{endTime} + From 10ea5856b33f28ea2a7a93eae54f8982b4e046da Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Tue, 10 Dec 2024 16:33:57 +0800 Subject: [PATCH 06/37] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E7=A8=8B2/3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/PartnerOwnController.java | 12 ++++++ .../service/AppInspectionPartnerService.java | 9 ++++ .../impl/AppInspectionPartnerServiceImpl.java | 41 +++++++++++++++++++ .../inspection/InspectionInfoMapper.xml | 13 ++++-- 4 files changed, 72 insertions(+), 3 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java index 472801d9..d4e3833b 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java @@ -754,4 +754,16 @@ public class PartnerOwnController extends BaseController { return success(partnerList.staticsTable5(partners.getPartnerId(),startTime,endTime)); } + /** + * 根据inspection_info的id查有的项目名称 + * + * @author 小李 + * @date 14:52 2024/12/10 + * @param ids inspection_info的id + **/ + @GetMapping("/getProjectByIds") + public CommonResult getProjectByIds(Long[] ids) { + return success(partnerList.getProjectByIds(ids)); + } + } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java index 3c998583..e0b6d94d 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java @@ -108,4 +108,13 @@ public interface AppInspectionPartnerService extends IService //新检测金额折线图 JSONObject newChartLineInspectionAmount(String unit); + + /** + * 根据inspection_info的id查有的项目名称 + * + * @author 小李 + * @date 14:52 2024/12/10 + * @param ids inspection_info的id + **/ + Map getProjectByIds(Long[] ids); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java index 8fd50073..86ea8825 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.inspection.service.impl; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; @@ -62,6 +63,8 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.LocalDateTime; @@ -124,6 +127,8 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl partnerList(Page page, PartnerListQuery partnerListQuery) { @@ -1899,4 +1904,40 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl getProjectByIds(Long[] ids){ + List inspectionWorkNodes = inspectionWorkNodeService. + list(new LambdaQueryWrapper() + .in(InspectionWorkNode::getInspectionInfoId, Arrays.asList(ids))); + if (ObjectUtil.isEmpty(inspectionWorkNodes)){ + return null; + } + List projectIds = inspectionWorkNodes.stream().map(InspectionWorkNode::getProjectId).collect(Collectors.toList()); + if (CollUtil.isEmpty(projectIds)){ + return null; + } + List projects = projectService.listByIds(projectIds); + if (CollUtil.isEmpty(projects)){ + return null; + } + Map projectMap = projects.stream().collect(Collectors.toMap(DlInspectionProject::getId, DlInspectionProject::getProjectName)); + Map result = new HashMap<>(); + Map> map = inspectionWorkNodes.stream().collect(Collectors + .groupingBy(InspectionWorkNode::getInspectionInfoId, + Collectors.mapping(InspectionWorkNode::getProjectId, Collectors.toList()))); + for (Long id : ids) { + List values = map.get(id); + String names = values.stream().filter(projectMap::containsKey).map(projectMap::get).collect(Collectors.joining(",")); + result.put(id, names); + } + return result; + } + } diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml index 40357fca..0c1feeb3 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml @@ -277,6 +277,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" iwn.status AS workNodeStatus, oi.order_no AS orderNo, oi.phonenumber AS buyPhone, + oi.goods_title as goodsTitle, + oi.sku_name as skuName, ip.project_name AS projectName, su.nickname AS leadManName, ROW_NUMBER() OVER (PARTITION BY ii.id ORDER BY iwn.update_time DESC) as rn -- 根据需要调整排序逻辑 @@ -295,7 +297,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND ii.car_num LIKE CONCAT('%', #{inspectionInfo.carNum}, '%') - + + + and (oi.pay_time is null) + ORDER BY iwn.update_time DESC + + AND (ii.lead_man_id = #{inspectionInfo.leadManId} @@ -308,7 +315,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -- AND ii.now_order_num = iwn.order_num ORDER BY ii.create_time DESC - + AND ii.status = '0' AND iwn.status = '1' @@ -316,7 +323,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ORDER BY iwn.update_time DESC - + AND iwn.status = '2' AND iwn.deal_user_id = #{inspectionInfo.dealUserId} ORDER BY iwn.update_time DESC From 296eb4f3cb0cb2ceb55549a1d729b132c3a4ca1a Mon Sep 17 00:00:00 2001 From: PQZ Date: Tue, 10 Dec 2024 16:42:39 +0800 Subject: [PATCH 07/37] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../property/controller/admin/PropertyPosController.java | 6 ------ .../module/system/controller/admin/auth/AuthController.java | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/controller/admin/PropertyPosController.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/controller/admin/PropertyPosController.java index 3f026f68..1bb43e24 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/controller/admin/PropertyPosController.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/controller/admin/PropertyPosController.java @@ -38,7 +38,6 @@ public class PropertyPosController { @PutMapping("/update") @Operation(summary = "更新企业管理-资产存放位置") - @PreAuthorize("@ss.hasPermission('company:property-pos:update')") public CommonResult updatePropertyPos(@RequestBody PropertyPosReqVO updateReqVO) { propertyPosService.updatePropertyPos(updateReqVO); return success(true); @@ -47,7 +46,6 @@ public class PropertyPosController { @DeleteMapping("/delete") @Operation(summary = "删除企业管理-资产存放位置") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('company:property-pos:delete')") public CommonResult deletePropertyPos(@RequestParam("id") String id) { propertyPosService.deletePropertyPos(id); return success(true); @@ -56,7 +54,6 @@ public class PropertyPosController { @GetMapping("/get") @Operation(summary = "获得企业管理-资产存放位置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('company:property-pos:query')") public CommonResult getPropertyPos(@RequestParam("id") String id) { PropertyPos propertyPos = propertyPosService.getPropertyPos(id); return success(BeanUtils.toBean(propertyPos, PropertyPosRespVO.class)); @@ -64,7 +61,6 @@ public class PropertyPosController { @GetMapping("/page") @Operation(summary = "获得企业管理-资产存放位置分页") - @PreAuthorize("@ss.hasPermission('company:property-pos:query')") public CommonResult> getPropertyPosPage(PropertyPosReqVO pageReqVO, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { @@ -80,7 +76,6 @@ public class PropertyPosController { **/ @GetMapping("/list") @Operation(summary = "获得企业管理-资产存放位置列表") - @PreAuthorize("@ss.hasPermission('company:property-pos:query')") public CommonResult> getPropertyPosList() { return success(propertyPosService.list()); } @@ -93,7 +88,6 @@ public class PropertyPosController { **/ @GetMapping("/listByCorpId") @Operation(summary = "获得企业管理-资产存放位置列表") - @PreAuthorize("@ss.hasPermission('company:property-deal:query')") public CommonResult> getPositionByCorpId(String id){ return success(propertyPosService.list(new LambdaQueryWrapper().eq(PropertyPos::getCorpId, id))); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java index f9fcd2e9..a378d835 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java @@ -117,7 +117,7 @@ public class AuthController { if (loginBody.getTypes().equals("3") && !roleNames.contains("教练")){ return error(new ErrorCode(2_002_000_005, "当前登录用户未分配教练角色")); } - if (loginBody.getTypes().equals("2") && !roleNames.contains("驾校管理员")){ + if (loginBody.getTypes().equals("2") && !roleNames.contains("驾校业务管理员")){ return error(new ErrorCode(2_002_000_005, "当前登录用户未分配驾校管理员角色")); } From 0221b1073a6cc598783a31ae62a4eb9925ffe8ed Mon Sep 17 00:00:00 2001 From: PQZ Date: Wed, 11 Dec 2024 11:23:44 +0800 Subject: [PATCH 08/37] 1 --- .../payment/service/impl/DriveSchoolPayServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/payment/service/impl/DriveSchoolPayServiceImpl.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/payment/service/impl/DriveSchoolPayServiceImpl.java index 847f0ca9..a39d02c9 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/payment/service/impl/DriveSchoolPayServiceImpl.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/payment/service/impl/DriveSchoolPayServiceImpl.java @@ -99,9 +99,9 @@ public class DriveSchoolPayServiceImpl implements DriveSchoolPayService IPage driveSchoolPayIPage = driveSchoolPayMapper.stuList(driveSchoolPay, page); List driveSchoolPays = driveSchoolPayIPage.getRecords(); - ArrayList collect = driveSchoolPays.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(DriveSchoolPay::getIdentity))), ArrayList::new)); +// ArrayList collect = driveSchoolPays.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(DriveSchoolPay::getIdentity))), ArrayList::new)); - for (DriveSchoolPay schoolPay : collect) { + for (DriveSchoolPay schoolPay : driveSchoolPays) { Long userId = schoolPay.getUserId(); AdminUserRespDTO sysUser = userApi.getUser(userId); //SysUser sysUser = sysUserMapper.selectUserById(userId); @@ -110,8 +110,8 @@ public class DriveSchoolPayServiceImpl implements DriveSchoolPayService } } //根据时间倒序排序 - collect.sort(Comparator.comparing(DriveSchoolPay::getCreateTime).reversed()); - driveSchoolPayIPage.setRecords(collect); + driveSchoolPays.sort(Comparator.comparing(DriveSchoolPay::getCreateTime).reversed()); + driveSchoolPayIPage.setRecords(driveSchoolPays); return driveSchoolPayIPage; } From 5524a0820112c4057899d214b3e3065deee8ad8e Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Wed, 11 Dec 2024 11:46:34 +0800 Subject: [PATCH 09/37] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=80=E5=A7=8B?= =?UTF-8?q?=E6=A3=80=E6=B5=8B->=E9=80=89=E6=8B=A9=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=EF=BC=8C=E6=9C=89=E9=97=AE=E9=A2=98=E5=BE=85=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/InspectionInfoController.java | 14 ++++++ .../service/IInspectionInfoService.java | 10 ++++ .../impl/InspectionInfoServiceImpl.java | 50 +++++++++++++++++-- 3 files changed, 70 insertions(+), 4 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java index b89e8e07..4206cbc5 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java @@ -267,4 +267,18 @@ public class InspectionInfoController extends BaseController { public CommonResult isExamine(){ return success(inspectionInfoService.isExamine()); } + + /** + * 获取某个工单针对当前操作用户,某个状态的项目们 + * + * @author 小李 + * @date 10:48 2024/12/11 + * @param id 工单ID + * @param status 状态 + **/ + @GetMapping("/getWorkNodeByIdAndNow") + public CommonResult getWorkNodeByIdAndNow(Long id, String status){ + return success(inspectionInfoService.getWorkNodeByIdAndNow(id, status)); + } + } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java index c71c609d..64f922eb 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java @@ -109,4 +109,14 @@ public interface IInspectionInfoService extends IService * @return */ Boolean isExamine(); + + /** + * 获取某个工单针对当前操作用户,某个状态的项目们 + * + * @author 小李 + * @date 10:48 2024/12/11 + * @param id 工单ID + * @param status 状态 + **/ + Map getWorkNodeByIdAndNow(Long id, String status); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java index 0d99bf6a..c848ddac 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java @@ -3,10 +3,7 @@ package cn.iocoder.yudao.module.inspection.service.impl; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; import cn.hutool.core.collection.CollUtil; @@ -57,6 +54,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import static cn.iocoder.yudao.framework.common.config.CommonStr.USER_TYPE_CUS; +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0; /** * 【请填写功能名称】Service业务层处理 @@ -99,6 +97,9 @@ public class InspectionInfoServiceImpl extends ServiceImpl getWorkNodeByIdAndNow(Long id, String status){ + Long userId = SecurityFrameworkUtils.getLoginUserId(); + List roles = roleService.getByUserId(userId); + if (CollUtil.isEmpty(roles)){ + throw exception0(500, "查询角色为空"); + } + List roleIds = roles.stream().map(UserRoleDO::getRoleId).collect(Collectors.toList()); + List workNodes = workNodeService.list(new LambdaQueryWrapper() + .and(i -> + i.eq(InspectionWorkNode::getInspectionInfoId, id) + .in(InspectionWorkNode::getRoleId, roleIds) + .eq(InspectionWorkNode::getStatus, status) + )); + if (CollUtil.isEmpty(workNodes)){ + throw exception0(500, "查询节点为空"); + } + List projectIds = workNodes.stream().map(InspectionWorkNode::getProjectId).collect(Collectors.toList()); + if (CollUtil.isEmpty(projectIds)){ + throw exception0(500, "查询项目时为空"); + } + List projects = projectService.listByIds(projectIds); + if (CollUtil.isEmpty(projects)){ + throw exception0(500, "查询项目时为空"); + } + Map map = projects.stream().collect(Collectors.toMap(DlInspectionProject::getId, DlInspectionProject::getProjectName)); + Map result = new HashMap<>(); + workNodes.forEach(item -> { + result.put(item.getId(), map.get(item.getProjectId())); + }); + return result; + } } From fdfaab6ef7b5eed0fc7a368c94a9506627ef04ee Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Wed, 11 Dec 2024 13:40:36 +0800 Subject: [PATCH 10/37] =?UTF-8?q?=E5=BC=95=E8=BD=A6=E5=91=98=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E9=80=89=E6=8B=A9=E6=93=8D=E4=BD=9C=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E6=89=80=E6=9C=89=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/InspectionInfoServiceImpl.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java index c848ddac..c5d09503 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java @@ -573,12 +573,14 @@ public class InspectionInfoServiceImpl extends ServiceImpl roleIds = roles.stream().map(UserRoleDO::getRoleId).collect(Collectors.toList()); - List workNodes = workNodeService.list(new LambdaQueryWrapper() - .and(i -> - i.eq(InspectionWorkNode::getInspectionInfoId, id) - .in(InspectionWorkNode::getRoleId, roleIds) - .eq(InspectionWorkNode::getStatus, status) - )); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(InspectionWorkNode::getInspectionInfoId, id); + wrapper.eq(InspectionWorkNode::getStatus, status); + InspectionInfo inspectionInfo = baseMapper.selectById(id); + if (!inspectionInfo.getLeadManId().equals(userId)){ + wrapper.in(InspectionWorkNode::getRoleId, roleIds); + } + List workNodes = workNodeService.list(wrapper); if (CollUtil.isEmpty(workNodes)){ throw exception0(500, "查询节点为空"); } From f0f0b376d147275248e87c3bd59678aceb45c5db Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Wed, 11 Dec 2024 15:18:50 +0800 Subject: [PATCH 11/37] =?UTF-8?q?=E5=BE=85=E9=87=8D=E6=A3=80=E3=80=81?= =?UTF-8?q?=E5=BE=85=E5=A4=8D=E6=A3=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/InspectionInfoController.java | 5 +-- .../mapper/InspectionWorkNodeMapper.java | 2 +- .../service/IInspectionInfoService.java | 2 +- .../impl/InspectionInfoServiceImpl.java | 32 ++++++++++--------- .../impl/InspectionWorkNodeServiceImpl.java | 20 ++++++++---- .../mapper/InspectionWorkNodeMapper.xml | 2 +- .../inspection/InspectionInfoMapper.xml | 30 +++++++++++++++-- 7 files changed, 65 insertions(+), 28 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java index 4206cbc5..ca7e8803 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java @@ -275,10 +275,11 @@ public class InspectionInfoController extends BaseController { * @date 10:48 2024/12/11 * @param id 工单ID * @param status 状态 + * @param flag 状态字段是否生效,默认生效 **/ @GetMapping("/getWorkNodeByIdAndNow") - public CommonResult getWorkNodeByIdAndNow(Long id, String status){ - return success(inspectionInfoService.getWorkNodeByIdAndNow(id, status)); + public CommonResult getWorkNodeByIdAndNow(Long id, String status, @RequestParam(value = "flag", defaultValue = "true") Boolean flag){ + return success(inspectionInfoService.getWorkNodeByIdAndNow(id, status, flag)); } } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/InspectionWorkNodeMapper.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/InspectionWorkNodeMapper.java index d2bcaf7d..f2287d84 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/InspectionWorkNodeMapper.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/InspectionWorkNodeMapper.java @@ -36,5 +36,5 @@ public interface InspectionWorkNodeMapper extends BaseMapper * 批量修改检测状态 * @param workNodes */ - void recheck(@Param("list") List workNodes); + void recheck(@Param("list") List workNodes, @Param("status") String status); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java index 64f922eb..6fe9625b 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java @@ -118,5 +118,5 @@ public interface IInspectionInfoService extends IService * @param id 工单ID * @param status 状态 **/ - Map getWorkNodeByIdAndNow(Long id, String status); + Map getWorkNodeByIdAndNow(Long id, String status, Boolean flag); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java index c5d09503..ea3c7b64 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java @@ -194,11 +194,11 @@ public class InspectionInfoServiceImpl extends ServiceImpl roleIds = new ArrayList<>(); /*获取所有的角色id*/ - if(CollUtil.isNotEmpty(inspectionWorkNodes)){ + if (CollUtil.isNotEmpty(inspectionWorkNodes)) { roleIds = inspectionWorkNodes.stream().map(inspectionWorkNode -> inspectionWorkNode.getRoleId()).collect(Collectors.toList()); } //根据角色id获取所有用户 @@ -560,37 +560,39 @@ public class InspectionInfoServiceImpl extends ServiceImpl getWorkNodeByIdAndNow(Long id, String status){ + public Map getWorkNodeByIdAndNow(Long id, String status, Boolean flag) { Long userId = SecurityFrameworkUtils.getLoginUserId(); List roles = roleService.getByUserId(userId); - if (CollUtil.isEmpty(roles)){ + if (CollUtil.isEmpty(roles)) { throw exception0(500, "查询角色为空"); } List roleIds = roles.stream().map(UserRoleDO::getRoleId).collect(Collectors.toList()); LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(InspectionWorkNode::getInspectionInfoId, id); - wrapper.eq(InspectionWorkNode::getStatus, status); + if (flag) { + wrapper.eq(InspectionWorkNode::getStatus, status); + } InspectionInfo inspectionInfo = baseMapper.selectById(id); - if (!inspectionInfo.getLeadManId().equals(userId)){ + if (!inspectionInfo.getLeadManId().equals(userId)) { wrapper.in(InspectionWorkNode::getRoleId, roleIds); } List workNodes = workNodeService.list(wrapper); - if (CollUtil.isEmpty(workNodes)){ - throw exception0(500, "查询节点为空"); + if (CollUtil.isEmpty(workNodes)) { + throw exception0(500, "没有项目需要操作"); } List projectIds = workNodes.stream().map(InspectionWorkNode::getProjectId).collect(Collectors.toList()); - if (CollUtil.isEmpty(projectIds)){ - throw exception0(500, "查询项目时为空"); + if (CollUtil.isEmpty(projectIds)) { + throw exception0(500, "没有项目需要操作"); } List projects = projectService.listByIds(projectIds); - if (CollUtil.isEmpty(projects)){ - throw exception0(500, "查询项目时为空"); + if (CollUtil.isEmpty(projects)) { + throw exception0(500, "没有项目需要操作"); } Map map = projects.stream().collect(Collectors.toMap(DlInspectionProject::getId, DlInspectionProject::getProjectName)); Map result = new HashMap<>(); diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionWorkNodeServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionWorkNodeServiceImpl.java index 30e1c5cf..1322311c 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionWorkNodeServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionWorkNodeServiceImpl.java @@ -29,9 +29,7 @@ import org.springframework.transaction.annotation.Transactional; import java.io.IOException; import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -81,7 +79,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl() .eq(DlInspectionProject::getId, workNode.getProjectId())); - InspectionStepInfo stepInfo = inspectionStepService.getOne(new LambdaQueryWrapper() + List stepInfos = inspectionStepService.list(new LambdaQueryWrapper() .and(i -> i.eq(InspectionStepInfo::getInspectionInfoId, workNode.getInspectionInfoId()) .eq(InspectionStepInfo::getWorkNodeId, workNode.getId()) .eq(InspectionStepInfo::getTitle, ObjectUtil.isNotEmpty(project) ? project.getProjectName() : workNode.getProjectName()) )); + InspectionStepInfo stepInfo = new InspectionStepInfo(); + if (CollUtil.isNotEmpty(stepInfos)){ + List sorted = stepInfos.stream() + .sorted(Comparator.comparing(InspectionStepInfo::getCreateTime).reversed()).collect(Collectors.toList()); + stepInfo = sorted.get(0); + } if (ObjectUtil.isNotEmpty(stepInfo)) { stepInfo.setUpdateTime(DateUtil.date()); stepInfo.setUpdater(Integer.parseInt(SecurityFrameworkUtils.getLoginUserId() + "")); @@ -346,7 +350,11 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl UPDATE inspection_work_node - SET status = '0', deal_user_id = null, deal_user_name = null, deal_images = null, remark = null,type = null + SET status = #{status}, deal_user_id = null, deal_user_name = null, deal_images = null, remark = null,type = null WHERE id in ( #{item.id} diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml index 0c1feeb3..11ff1280 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml @@ -299,7 +299,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - and (oi.pay_time is null) + AND (oi.pay_time is null) ORDER BY iwn.update_time DESC @@ -317,11 +317,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - AND ii.status = '0' + AND (ii.status = '0' OR ii.status = '2') AND iwn.status = '1' AND iwn.deal_user_id = #{inspectionInfo.dealUserId} ORDER BY iwn.update_time DESC + + + AND + (ii.lead_man_id = #{inspectionInfo.leadManId} + OR iwn.role_id IN + + #{roleId} + ) + AND ii.status = '2' + -- AND iwn.status = '1' + -- AND ii.now_order_num = iwn.order_num + ORDER BY ii.update_time DESC + + + + AND + (ii.lead_man_id = #{inspectionInfo.leadManId} + OR iwn.role_id IN + + #{roleId} + ) + -- AND ii.status = '2' + AND iwn.status = '3' + -- AND ii.now_order_num = iwn.order_num + ORDER BY ii.update_time DESC + AND iwn.status = '2' From dc6ec5a8dc266b8d4648659f3c3f554ab1f74411 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Wed, 11 Dec 2024 15:44:06 +0800 Subject: [PATCH 12/37] =?UTF-8?q?=E6=9C=89=E9=87=8D=E6=A3=80=E3=80=81?= =?UTF-8?q?=E5=A4=8D=E6=A3=80=E9=A1=B9=E6=97=B6=20=20=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E4=BA=BA=E5=91=98=E6=89=8D=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=95=E8=BD=A6=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/InspectionInfoController.java | 11 ++++++++ .../service/IInspectionInfoService.java | 9 +++++++ .../impl/InspectionInfoServiceImpl.java | 27 +++++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java index ca7e8803..109ece05 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java @@ -282,4 +282,15 @@ public class InspectionInfoController extends BaseController { return success(inspectionInfoService.getWorkNodeByIdAndNow(id, status, flag)); } + /** + * 判断是否可以修改引车员 + * + * @author 小李 + * @date 15:22 2024/12/11 + * @param id 工单ID + **/ + @GetMapping("/judgeUpdateLeadMan") + public CommonResult judgeUpdateLeadMan(Long id){ + return success(inspectionInfoService.judgeUpdateLeadMan(id)); + } } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java index 6fe9625b..83be1a99 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java @@ -119,4 +119,13 @@ public interface IInspectionInfoService extends IService * @param status 状态 **/ Map getWorkNodeByIdAndNow(Long id, String status, Boolean flag); + + /** + * 判断是否可以修改引车员 + * + * @author 小李 + * @date 15:22 2024/12/11 + * @param id 工单ID + **/ + Boolean judgeUpdateLeadMan(Long id); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java index ea3c7b64..70536fd5 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java @@ -601,4 +601,31 @@ public class InspectionInfoServiceImpl extends ServiceImpl list = workNodeService.list(new LambdaQueryWrapper().eq(InspectionWorkNode::getInspectionInfoId, id)); + Set status = list.stream().map(InspectionWorkNode::getStatus).collect(Collectors.toSet()); + if (status.contains("3")){ + result = true; + } + } + if (result){ + result = inspectionInfo.getCreator().equals(SecurityFrameworkUtils.getLoginUserId()+""); + } + return result; + } } From 9e9c793a90ea14f93a91d3d1e57c8658c39537f4 Mon Sep 17 00:00:00 2001 From: PQZ Date: Wed, 11 Dec 2024 18:13:39 +0800 Subject: [PATCH 13/37] 1 --- .../admin/DriveSchoolSwiperController.java | 6 +++++ .../jx/mapper/DriveSchoolSwiperMapper.java | 2 +- .../mapper/jx/DriveSchoolSwiperMapper.xml | 24 +++++++++---------- .../src/main/resources/application.yaml | 3 +++ 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/controller/admin/DriveSchoolSwiperController.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/controller/admin/DriveSchoolSwiperController.java index 5dedb54b..5e0e862a 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/controller/admin/DriveSchoolSwiperController.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/controller/admin/DriveSchoolSwiperController.java @@ -45,6 +45,12 @@ public class DriveSchoolSwiperController extends BaseController @GetMapping("/pclist") @PermitAll public CommonResult pclist(DriveSchoolSwiper driveSchoolSwiper) { + if(driveSchoolSwiper.getPageNum() == null) { + driveSchoolSwiper.setPageNum(1); + } + if(driveSchoolSwiper.getPageSize() == null) { + driveSchoolSwiper.setPageSize(100); + } Page page = new Page<>(driveSchoolSwiper.getPageNum(), driveSchoolSwiper.getPageSize()); IPage driveSchoolSeparateIPage = driveSchoolSwiperService.selectDriveSchoolSwiperPclist(driveSchoolSwiper, page); diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/mapper/DriveSchoolSwiperMapper.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/mapper/DriveSchoolSwiperMapper.java index 4cb51488..4ad813a2 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/mapper/DriveSchoolSwiperMapper.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/mapper/DriveSchoolSwiperMapper.java @@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; -import org.springframework.data.repository.query.Param; +import org.apache.ibatis.annotations.Param; import java.util.List; diff --git a/dl-module-jx/src/main/resources/mapper/jx/DriveSchoolSwiperMapper.xml b/dl-module-jx/src/main/resources/mapper/jx/DriveSchoolSwiperMapper.xml index e5c35404..8318e17c 100644 --- a/dl-module-jx/src/main/resources/mapper/jx/DriveSchoolSwiperMapper.xml +++ b/dl-module-jx/src/main/resources/mapper/jx/DriveSchoolSwiperMapper.xml @@ -111,23 +111,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" FROM drive_school_swiper deleted = 0 - - - AND swiper_name LIKE CONCAT('%', #{driveSchoolSwiper.swiperName}, '%') + + + AND swiper_name LIKE CONCAT('%', #{entity.swiperName}, '%') - - AND swiper_picture = #{driveSchoolSwiper.swiperPicture} + + AND swiper_picture = #{entity.swiperPicture} - - AND jump_url = #{driveSchoolSwiper.jumpUrl} + + AND jump_url = #{entity.jumpUrl} - - AND dept_id = #{driveSchoolSwiper.deptId} + + AND dept_id = #{entity.deptId} - - AND list_order = #{driveSchoolSwiper.listOrder} + + AND list_order = #{entity.listOrder} - + ORDER BY list_order ASC diff --git a/yudao-server/src/main/resources/application.yaml b/yudao-server/src/main/resources/application.yaml index 6ec64c06..da5df3b1 100644 --- a/yudao-server/src/main/resources/application.yaml +++ b/yudao-server/src/main/resources/application.yaml @@ -303,6 +303,9 @@ yudao: - /app-api/** #小程序端接口,不区分租户 - /repair/tickets/print/** - /admin-api/repair/tickets/print/** + - /admin-api/jx/auth/** + - /admin-api/jx/** + - /admin-api/jx/auth/getAppInfo ignore-tables: - system_tenant - system_tenant_package From b1ddfa6c05c9f49d9632715a8b5799ae49ef1385 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Thu, 12 Dec 2024 14:11:01 +0800 Subject: [PATCH 14/37] 1 --- .../tickets/mapper/DlRepairTicketsMapper.java | 9 ++- .../service/DlRepairTicketsService.java | 2 +- .../impl/DlRepairTicketsServiceImpl.java | 60 ++++++++++++++----- .../mapper/tickets/DlRepairTicketsMapper.xml | 21 +------ 4 files changed, 53 insertions(+), 39 deletions(-) diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/mapper/DlRepairTicketsMapper.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/mapper/DlRepairTicketsMapper.java index 931ea202..ba318aed 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/mapper/DlRepairTicketsMapper.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/mapper/DlRepairTicketsMapper.java @@ -45,17 +45,16 @@ public interface DlRepairTicketsMapper extends BaseMapper { **/ IPage getPageTypeAll(@Param("map") DlRepairTicketsReqVO repairTicketsReqVO, Page page); + /** * 根据条件查询指定工单数量 * @author vinjor-M * @date 15:46 2024/11/18 * @param dayDate 某一天日期 - * @param recordCode 操作记录code + * @param recordCode 操作记录code * @return java.lang.Long - **/ - Long selectCountByParams(@Param("nowDate")String dayDate, @Param("recordCode")String recordCode, @Param("startTime")String startTime, @Param("endTime")String endTime); - - List selectTicketIdByParams( @Param("recordCode")String recordCode, @Param("startTime")String startTime, @Param("endTime")String endTime); + **/ + List selectTicketIdByParams(@Param("nowDate")String dayDate, @Param("recordCode")String recordCode, @Param("startTime")String startTime, @Param("endTime")String endTime); } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTicketsService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTicketsService.java index e4d2115f..b7de9700 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTicketsService.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTicketsService.java @@ -173,7 +173,7 @@ public interface DlRepairTicketsService extends IService { * @date 11:30 2024/10/24 * @return java.util.Map **/ - Map getBossNum(String selectType,String startDate,String endDate); + Map getBossNum(String selectType,String startDate,String endDate); /** * 服务顾问通知客户取车 diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java index 0dbf8180..274079a0 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java @@ -978,6 +978,12 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl getPageType(DlRepairTicketsReqVO repairTicketsReqVO, Page page) { String userRoleCode = getUserRole(); + if(null!=repairTicketsReqVO.getIdList() && repairTicketsReqVO.getIdList().size()>0){ + //根据id集和查询 + DlRepairTicketsReqVO queryObj = new DlRepairTicketsReqVO(); + queryObj.setIdList(repairTicketsReqVO.getIdList()); + return baseMapper.getPageTypeAll(queryObj, page); + } if (userRoleCode.equals(RepairRoleEnum.ADMIN.getCode())) { //维修管理员看所有数据 } else if (userRoleCode.equals(RepairRoleEnum.WAREHOUSE.getCode())) { @@ -1034,10 +1040,10 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl idList = new ArrayList<>(); if("yijungong".equals(repairTicketsReqVO.getTicketsStatus())){ //已竣工 - idList = repairTicketsMapper.selectTicketIdByParams(RecordTypeEnum.ZJ.getCode(),startDate,endDate); + idList = repairTicketsMapper.selectTicketIdByParams(null,RecordTypeEnum.ZJ.getCode(),startDate,endDate); }else if("yijiaoche".equals(repairTicketsReqVO.getTicketsStatus())){ //已交车 - idList = repairTicketsMapper.selectTicketIdByParams(RecordTypeEnum.JC.getCode(),startDate,endDate); + idList = repairTicketsMapper.selectTicketIdByParams(null,RecordTypeEnum.JC.getCode(),startDate,endDate); }else { //进厂 repairTicketsReqVO.setStartDate(startDate); @@ -1600,62 +1606,86 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl getBossNum(String selectType,String startDate,String endDate) { - Map rtnMap = new HashMap<>(); + public Map getBossNum(String selectType,String startDate,String endDate) { + Map rtnMap = new HashMap<>(); //维修中---当前这一时刻 long workingNum = 0; + List workingIdList = new ArrayList<>(); //在厂数--当前这一时刻 long inCompanyNum = 0; + List inCompanyIdList = new ArrayList<>(); //进场数 long newOrderNum=0; + List newOrderIdList = new ArrayList<>(); //已完成 long overNum=0; + List overIdList = new ArrayList<>(); //已交车 long giveCusNum=0; + List giveCusIdList = new ArrayList<>(); //未结算 long noPayNum=0; + List noPayIdList = new ArrayList<>(); List repairTickets = this.list(); if (!repairTickets.isEmpty()) { - workingNum = repairTickets.stream().filter(item -> TicketsStatusEnum.WORKING.getCode().equals(item.getTicketsStatus())).count(); + workingIdList = repairTickets.stream().filter(item -> TicketsStatusEnum.WORKING.getCode().equals(item.getTicketsStatus())).map(DlRepairTickets::getId).collect(Collectors.toList()); + workingNum = workingIdList.size(); //只要没交车都算在厂 List inCompanyCodeList = Arrays.asList("04","05","07","01","06","02"); - inCompanyNum = repairTickets.stream().filter(item -> inCompanyCodeList.contains(item.getTicketsStatus())).count(); + inCompanyIdList = repairTickets.stream().filter(item -> inCompanyCodeList.contains(item.getTicketsStatus())).map(DlRepairTickets::getId).collect(Collectors.toList()); + inCompanyNum = inCompanyIdList.size(); //只要没结算,都是未结算 List noPayCodeList = Arrays.asList("04","05","07","01"); - noPayNum = repairTickets.stream().filter(item -> noPayCodeList.contains(item.getTicketsStatus())).count(); + noPayIdList = repairTickets.stream().filter(item -> noPayCodeList.contains(item.getTicketsStatus())).map(DlRepairTickets::getId).collect(Collectors.toList()); + noPayNum = noPayIdList.size(); LocalDateTime currentTime = LocalDateTime.now(); if("today".equals(selectType)){ String nowDayStr = DateUtil.formatDate(new Date()); //查当日进厂数、已完成、已交车 - newOrderNum = repairTickets.stream().filter(item -> item.getCreateTime().toLocalDate().equals(currentTime.toLocalDate())).count(); + newOrderIdList = repairTickets.stream().filter(item -> item.getCreateTime().toLocalDate().equals(currentTime.toLocalDate())).map(DlRepairTickets::getId).collect(Collectors.toList()); + newOrderNum = newOrderIdList.size(); //查当日已完成的(总检完成的) - overNum = repairTicketsMapper.selectCountByParams(nowDayStr,RecordTypeEnum.ZJ.getCode(),null,null); + overIdList = repairTicketsMapper.selectTicketIdByParams(nowDayStr,RecordTypeEnum.ZJ.getCode(),null,null); + overNum = overIdList.size(); //查当日已交车的 - giveCusNum = repairTicketsMapper.selectCountByParams(nowDayStr,RecordTypeEnum.JC.getCode(),null,null); + giveCusIdList = repairTicketsMapper.selectTicketIdByParams(nowDayStr,RecordTypeEnum.JC.getCode(),null,null); + giveCusNum = giveCusIdList.size(); }else if("all".equals(selectType)){ //查累计进厂数、已完成、已交车 + newOrderIdList = repairTickets.stream().map(DlRepairTickets::getId).collect(Collectors.toList()); newOrderNum = repairTickets.size(); //查累计已完成的(总检完成的) - overNum = repairTicketsMapper.selectCountByParams(null,RecordTypeEnum.ZJ.getCode(),null,null); + overIdList = repairTicketsMapper.selectTicketIdByParams(null,RecordTypeEnum.ZJ.getCode(),null,null); + overNum = overIdList.size(); //查累计已交车的(已结算的) - giveCusNum = repairTicketsMapper.selectCountByParams(null,RecordTypeEnum.JC.getCode(),null,null); + giveCusIdList = repairTicketsMapper.selectTicketIdByParams(null,RecordTypeEnum.JC.getCode(),null,null); + giveCusNum = giveCusIdList.size(); }else { //查某个时间范围内进厂数、已完成、已交车 LocalDateTime startTime = LocalDateTime.parse(startDate+" 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); LocalDateTime endTime = LocalDateTime.parse(endDate+" 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); - newOrderNum = repairTickets.stream().filter(item -> item.getCreateTime().isAfter(startTime) && item.getCreateTime().isBefore(endTime)).count(); + newOrderIdList = repairTickets.stream().filter(item -> item.getCreateTime().isAfter(startTime) && item.getCreateTime().isBefore(endTime)).map(DlRepairTickets::getId).collect(Collectors.toList()); + newOrderNum = newOrderIdList.size(); //查某区间范围内已完成的(总检完成的) - overNum = repairTicketsMapper.selectCountByParams(null,RecordTypeEnum.ZJ.getCode(), startDate+" 00:00:00", endDate+" 23:59:59"); + overIdList = repairTicketsMapper.selectTicketIdByParams(null,RecordTypeEnum.ZJ.getCode(), startDate+" 00:00:00", endDate+" 23:59:59"); + overNum = overIdList.size(); //查某区间范围内已交车的 - giveCusNum = repairTicketsMapper.selectCountByParams(null,RecordTypeEnum.JC.getCode(), startDate+" 00:00:00", endDate+" 23:59:59"); + giveCusIdList = repairTicketsMapper.selectTicketIdByParams(null,RecordTypeEnum.JC.getCode(), startDate+" 00:00:00", endDate+" 23:59:59"); + giveCusNum = giveCusIdList.size(); } } rtnMap.put("workingNum", workingNum); + rtnMap.put("workingIdList", workingIdList); rtnMap.put("inCompanyNum", inCompanyNum); + rtnMap.put("inCompanyIdList", inCompanyIdList); rtnMap.put("newOrderNum", newOrderNum); + rtnMap.put("newOrderIdList", newOrderIdList); rtnMap.put("overNum", overNum); + rtnMap.put("overIdList", overIdList); rtnMap.put("giveCusNum", giveCusNum); + rtnMap.put("giveCusIdList", giveCusIdList); rtnMap.put("noPayNum", noPayNum); + rtnMap.put("noPayIdList", noPayIdList); return rtnMap; } diff --git a/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml b/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml index 19483ced..c6bb5534 100644 --- a/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml @@ -422,9 +422,10 @@ GROUP BY drt.id order by drt.update_time desc - SELECT - COUNT(DISTINCT drt.id) + DISTINCT drt.id FROM dl_repair_tickets drt LEFT JOIN dl_repair_records drr ON drt.id = drr.ticket_id @@ -441,20 +442,4 @@ AND drr.create_time <= #{endTime} - From 03e696581f4cd3c277940104b7b8ca294b400c19 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Thu, 12 Dec 2024 18:49:46 +0800 Subject: [PATCH 15/37] =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=AB=AF=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BB=BB=E5=8A=A1=E5=88=97=E8=A1=A899%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/PartnerOwnController.java | 24 ++++++++-- .../mapper/AppInspectionPartnerMapper.java | 15 +++--- .../service/AppInspectionPartnerService.java | 12 +++++ .../impl/AppInspectionPartnerServiceImpl.java | 18 +++++++ .../module/inspection/vo/OrderTable.java | 34 +++++++++++++ .../inspection/AppInspectionPartnerMapper.xml | 48 +++++++++++++++++++ .../src/main/resources/application-local.yaml | 12 ++--- 7 files changed, 147 insertions(+), 16 deletions(-) create mode 100644 dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/vo/OrderTable.java diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java index d4e3833b..efe3bd21 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java @@ -5,7 +5,7 @@ import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; -import cn.iocoder.yudao.module.inspection.vo.SysDictData; +import cn.iocoder.yudao.module.inspection.vo.*; import cn.iocoder.yudao.module.label.vo.LabelRespVO; import cn.iocoder.yudao.module.partner.entity.PartnerBalanceDetail; import cn.iocoder.yudao.module.partner.entity.PartnerWorker; @@ -29,15 +29,13 @@ import com.github.pagehelper.PageHelper; import cn.iocoder.yudao.module.core.controller.BaseController; import cn.iocoder.yudao.module.inspection.entity.*; import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService; -import cn.iocoder.yudao.module.inspection.vo.GoodsVo; -import cn.iocoder.yudao.module.inspection.vo.InspectionInfoVo; -import cn.iocoder.yudao.module.inspection.vo.OrderAppDetail; import cn.iocoder.yudao.module.shop.entity.ShopCouponTemplate; import cn.iocoder.yudao.module.shop.entity.ShopMallPartners; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -766,4 +764,22 @@ public class PartnerOwnController extends BaseController { return success(partnerList.getProjectByIds(ids)); } + /** + * 根据时间查订单 + * + * @author 小李 + * @date 14:39 2024/12/12 + * @param startTime 开始时间 非必传 + * @param endTime 结束时间 非必传 + * @param pageNum 页码 + * @param pageSize 条数 + **/ + @GetMapping("/getOrderByDate") + public CommonResult getOrderByDate(@RequestParam(value = "startTime", required = false) String startTime, + @RequestParam(value = "endTime", required = false) String endTime, + @RequestParam(value = "pageNum", defaultValue = "1")Integer pageNum, + @RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize){ + Page page = new Page<>(pageNum, pageSize); + return success(partnerList.getOrderByDate(startTime, endTime, page)); + } } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/AppInspectionPartnerMapper.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/AppInspectionPartnerMapper.java index bed6cd99..d7395458 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/AppInspectionPartnerMapper.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/AppInspectionPartnerMapper.java @@ -66,10 +66,13 @@ public interface AppInspectionPartnerMapper extends BaseMapper Long getAppointNum(@Param("partnerId") Long partnerId,@Param("formDate") String formDate); Long getPickNum(@Param("partnerId") Long partnerId,@Param("formDate") String formDate); - - - - - - + /** + * 根据时间查订单 + * + * @author 小李 + * @date 14:39 2024/12/12 + * @param startTime 开始时间 非必传 + * @param endTime 结束时间 非必传 + **/ + IPage getOrderByDate(@Param("startTime") String startTime, @Param("endTime") String endTime, Page page); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java index e0b6d94d..40f5de69 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java @@ -16,6 +16,8 @@ import cn.iocoder.yudao.module.inspection.query.PartnerListQuery; import cn.iocoder.yudao.module.inspection.vo.*; import cn.iocoder.yudao.module.shop.entity.ShopCouponTemplate; import cn.iocoder.yudao.module.shop.entity.ShopMallPartners; + +import java.util.Date; import java.util.List; import java.util.Map; @@ -117,4 +119,14 @@ public interface AppInspectionPartnerService extends IService * @param ids inspection_info的id **/ Map getProjectByIds(Long[] ids); + + /** + * 根据时间查订单 + * + * @author 小李 + * @date 14:39 2024/12/12 + * @param startTime 开始时间 非必传 + * @param endTime 结束时间 非必传 + **/ + IPage getOrderByDate(String startTime, String endTime, Page page); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java index 86ea8825..5aa01821 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java @@ -1940,4 +1940,22 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl getOrderByDate(String startTime, String endTime, Page page){ + if (StringUtils.isEmpty(startTime)){ + startTime = DateUtil.format(new Date(), "yyyy-MM-dd"); + endTime = DateUtil.format(new Date(), "yyyy-MM-dd"); + } + startTime = startTime + " 00:00:00"; + endTime = endTime + " 23:59:59"; + return baseMapper.getOrderByDate(startTime, endTime, page); + } } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/vo/OrderTable.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/vo/OrderTable.java new file mode 100644 index 00000000..337fe5bb --- /dev/null +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/vo/OrderTable.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.inspection.vo; + +import lombok.Data; + +/** + * 用于当日订单详情 + * + * @author 小李 + * @date 14:41 2024/12/12 +**/ +@Data +public class OrderTable { + + /** 工单ID */ + private Long id; + + /** 车牌号 */ + private String carNum; + + /** 检测类型 */ + private String type; + + /** 检测状态 */ + private String status; + + /** 检测结果 */ + private String result; + + /** 是否支付 */ + private String pay; + + /** 支付方式 */ + private String payType; +} diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/AppInspectionPartnerMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/AppInspectionPartnerMapper.xml index e19e3ebb..fb8d2378 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/AppInspectionPartnerMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/AppInspectionPartnerMapper.xml @@ -524,4 +524,52 @@ FROM order by pw.create_time desc + + diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index ae71216a..97bf3ad2 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -46,8 +46,8 @@ spring: primary: master datasource: master: - url: jdbc:mysql://122.51.230.86:3306/lanan_platform_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 -# url: jdbc:mysql://122.51.230.86:3306/lanan_platform?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 +# url: jdbc:mysql://122.51.230.86:3306/lanan_platform_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 + url: jdbc:mysql://122.51.230.86:3306/lanan_platform?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai # MySQL Connector/J 5.X 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例 # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 @@ -55,10 +55,10 @@ spring: # url: jdbc:dm://127.0.0.1:5236?schema=RUOYI_VUE_PRO # DM 连接的示例 # url: jdbc:kingbase8://127.0.0.1:54321/test # 人大金仓 KingbaseES 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/postgres # OpenGauss 连接的示例 - username: lanan_dev - password: lighting@2024 -# username: lanan -# password: 123456 +# username: lanan_dev +# password: lighting@2024 + username: lanan + password: 123456 # username: sa # SQL Server 连接的示例 # password: Yudao@2024 # SQL Server 连接的示例 # username: SYSDBA # DM 连接的示例 From 9668ec75797b1caf303f716735232784b6cecd8b Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Thu, 12 Dec 2024 18:50:16 +0800 Subject: [PATCH 16/37] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=94=B9=E5=9B=9E?= =?UTF-8?q?=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-local.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index 97bf3ad2..ae71216a 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -46,8 +46,8 @@ spring: primary: master datasource: master: -# url: jdbc:mysql://122.51.230.86:3306/lanan_platform_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 - url: jdbc:mysql://122.51.230.86:3306/lanan_platform?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 + url: jdbc:mysql://122.51.230.86:3306/lanan_platform_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 +# url: jdbc:mysql://122.51.230.86:3306/lanan_platform?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai # MySQL Connector/J 5.X 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例 # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 @@ -55,10 +55,10 @@ spring: # url: jdbc:dm://127.0.0.1:5236?schema=RUOYI_VUE_PRO # DM 连接的示例 # url: jdbc:kingbase8://127.0.0.1:54321/test # 人大金仓 KingbaseES 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/postgres # OpenGauss 连接的示例 -# username: lanan_dev -# password: lighting@2024 - username: lanan - password: 123456 + username: lanan_dev + password: lighting@2024 +# username: lanan +# password: 123456 # username: sa # SQL Server 连接的示例 # password: Yudao@2024 # SQL Server 连接的示例 # username: SYSDBA # DM 连接的示例 From 409ba7e88eb0420137bafad19c56d32c5794c80d Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Fri, 13 Dec 2024 11:08:30 +0800 Subject: [PATCH 17/37] =?UTF-8?q?=E8=A1=A5=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/inspection/AppInspectionPartnerMapper.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/AppInspectionPartnerMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/AppInspectionPartnerMapper.xml index fb8d2378..d07b911e 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/AppInspectionPartnerMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/AppInspectionPartnerMapper.xml @@ -534,6 +534,7 @@ FROM CASE WHEN t.status = '已完成' AND t.is_pass = 0 THEN '不合格' WHEN t.status = '已完成' AND t.is_pass = 1 THEN '合格' + WHEN t.status = '已完成' THEN '未知' ELSE '' END AS result, t.status @@ -546,6 +547,7 @@ FROM ELSE '已支付' END AS pay, CASE + WHEN oi.pay_type IS NOT NULL THEN '已完成' WHEN has_status_0_or_null THEN '检测中' WHEN (ii.status = 0 OR ii.status = 2) AND has_status_1 THEN '检测中' WHEN (COALESCE(max_iwn_status, 0) = 2 OR ii.status = 1) THEN '已完成' From e1aaa4ac128f05d920f36e11af997a59426d2dc1 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Fri, 13 Dec 2024 15:06:19 +0800 Subject: [PATCH 18/37] =?UTF-8?q?=E8=A1=A5=E6=AD=A3=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/InspectionEquInfoServiceImpl.java | 13 ++++++++++--- .../mapper/inspection/WarnMessageMapper.xml | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionEquInfoServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionEquInfoServiceImpl.java index 664fc4d2..e968e447 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionEquInfoServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionEquInfoServiceImpl.java @@ -4,8 +4,11 @@ import java.util.Arrays; import java.util.Calendar; import java.util.Date; import java.util.List; +import java.util.stream.Collectors; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -13,6 +16,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import cn.iocoder.yudao.util.DateUtils; import cn.iocoder.yudao.module.inspection.entity.WarnMessage; import cn.iocoder.yudao.module.inspection.service.IWarnMessageService; +import io.prometheus.client.CollectorRegistry; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import cn.iocoder.yudao.module.inspection.mapper.InspectionEquInfoMapper; @@ -30,6 +34,7 @@ public class InspectionEquInfoServiceImpl extends ServiceImpl queryWrapper =new LambdaQueryWrapper<>(); queryWrapper.eq(WarnMessage::getType,"equ").eq(WarnMessage::getObjectId,inspectionEquInfo.getId()); - WarnMessage one = messageService.getOne(queryWrapper); - if (ObjectUtil.isNotEmpty(one)){ + List list = messageService.list(queryWrapper); + if (CollUtil.isNotEmpty(list)){ //更新处理 - messageService.removeById(one.getId()); + List ids = list.stream().map(WarnMessage::getId).collect(Collectors.toList()); + messageService.removeBatchByIds(ids); } if (ObjectUtil.isNotEmpty(inspectionEquInfo.getNextCheckTime())){ //同时处理提醒信息 diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/WarnMessageMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/WarnMessageMapper.xml index ce8253bc..eb070d4e 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/WarnMessageMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/WarnMessageMapper.xml @@ -27,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and title = #{warnMessage.title} and partner_id = #{warnMessage.partnerId} and is_read = #{warnMessage.isRead} + and deleted = '0' order by create_time desc From 45c7558e4b596517557f5ab94c8dbcc32fd3ec30 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Fri, 13 Dec 2024 15:36:33 +0800 Subject: [PATCH 19/37] =?UTF-8?q?=E5=85=B3=E4=BA=8E=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=95=86=E5=93=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AppInspectionPartnerServiceImpl.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java index 5aa01821..1139e969 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java @@ -141,11 +141,12 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl categoryList(Long partnerId) { - LoginUser user = SecurityFrameworkUtils.getLoginUser(); - ShopMallPartners partners = baseMapper.selectById(partnerId); - if (!partners.getUserId().equals(user.getId())){ - return null; - } + // 暂时去掉 +// LoginUser user = SecurityFrameworkUtils.getLoginUser(); +// ShopMallPartners partners = baseMapper.selectById(partnerId); +// if (!partners.getUserId().equals(user.getId())){ +// return null; +// } List shopInspectionCategories = baseMapper.partnerCategoryList(partnerId); for (ShopInspectionCategory shopInspectionCategory : shopInspectionCategories) { LambdaQueryWrapper templateLambdaQueryWrapper =new LambdaQueryWrapper<>(); From ec43afe316b7cdf82dc5315e5e2e239925d5a903 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Fri, 13 Dec 2024 18:13:43 +0800 Subject: [PATCH 20/37] =?UTF-8?q?=E8=A1=A5=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ShopInspectionGoodsController.java | 15 ++++++++------- .../impl/AppInspectionPartnerServiceImpl.java | 11 ++++++----- .../inspection/AppInspectionPartnerMapper.xml | 6 ++++-- .../inspection/ShopInspectionGoodsMapper.xml | 7 ++++--- 4 files changed, 22 insertions(+), 17 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/ShopInspectionGoodsController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/ShopInspectionGoodsController.java index 35071c7f..1513affb 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/ShopInspectionGoodsController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/ShopInspectionGoodsController.java @@ -113,13 +113,14 @@ public class ShopInspectionGoodsController extends BaseController */ @GetMapping("/partnerGoodsDetail") public CommonResult partnerGoodsDetail(Long goodsId) throws Exception { - LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); - LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); - queryWrapper.eq(ShopMallPartners::getUserId,loginUser.getId()).eq(ShopMallPartners::getType,"jc").last("limit 1"); - ShopMallPartners one = appInspectionPartnerService.getOne(queryWrapper); - if (ObjectUtils.isEmpty(one)){ - throw new Exception("您不是商户"); - } + // 暂时注掉 +// LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); +// LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); +// queryWrapper.eq(ShopMallPartners::getUserId,loginUser.getId()).eq(ShopMallPartners::getType,"jc").last("limit 1"); +// ShopMallPartners one = appInspectionPartnerService.getOne(queryWrapper); +// if (ObjectUtils.isEmpty(one)){ +// throw new Exception("您不是商户"); +// } return success(appInspectionPartnerService.goodsDetail(goodsId)); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java index 1139e969..287c7e16 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java @@ -1083,11 +1083,12 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl queryWrapper =new LambdaQueryWrapper<>(); queryWrapper.eq(InspectionGoodsSku::getGoodsId,goodsId); List list = skuService.list(queryWrapper); diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/AppInspectionPartnerMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/AppInspectionPartnerMapper.xml index d07b911e..ac3443fa 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/AppInspectionPartnerMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/AppInspectionPartnerMapper.xml @@ -345,8 +345,10 @@ FROM FROM shop_inspection_category cate INNER JOIN inspection_category_template template on template.category_id = cate.id - left JOIN shop_inspection_goods goods ON goods.goods_category_id = cate.id and goods.partner_id = #{partnerId} - where goods.id is null + + left JOIN shop_inspection_goods goods ON goods.goods_category_id = cate.id and goods.partner_id = #{partnerId} + where goods.id is null + group by cate.id ORDER BY cate.order_num diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/ShopInspectionGoodsMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/ShopInspectionGoodsMapper.xml index d0b98301..8ccbdad1 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/ShopInspectionGoodsMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/ShopInspectionGoodsMapper.xml @@ -51,13 +51,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" INNER JOIN shop_mall_partners smp ON smp.partner_id = sig.partner_id AND smp.is_banned = '0' INNER JOIN shop_inspection_category sic ON sic.id = sig.goods_category_id - + and sig.deleted = '0' and smp.deleted = '0' and sic.deleted = '0' and sig.id = #{vo.id} - and sig.title like concat('%', #{vo.title}, '%') + and sig.title like concat('%', #{vo.title}, '%') and sig.goods_category_id = #{vo.goodsCategoryId} and smp.partner_name like concat('%',#{vo.partnerName},'%') and sig.partner_id = #{vo.partnerId} + and sig.is_listing = #{vo.isListing} - ORDER BY FIELD(sig.listing_status,1,2,3,0), create_time desc + ORDER BY sig.is_listing, sig.create_time desc From b0264f1e2ae25e9690dc632999cb4ec8df1ad393 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Sat, 14 Dec 2024 15:41:29 +0800 Subject: [PATCH 21/37] =?UTF-8?q?=E8=B5=84=E6=96=99=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9=E5=8A=A0=E6=95=B0=E9=87=8F=E3=80=81=E8=A1=A5=E6=AD=A3?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/InspectionFileController.java | 17 +++++++++++++ .../service/IInspectionFileService.java | 12 +++++++++ .../impl/InspectionFileServiceImpl.java | 25 ++++++++++++++++--- 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionFileController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionFileController.java index af3c0ae5..ac3409c3 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionFileController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionFileController.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.inspection.controller; +import cn.hutool.core.collection.CollUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.core.controller.BaseController; import cn.iocoder.yudao.module.inspection.entity.InspectionFile; @@ -13,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import java.util.List; /** * inspectionFileController @@ -105,4 +107,19 @@ public class InspectionFileController extends BaseController } return toAjax(inspectionFileService.deleteInspectionFileById(id)); } + + /** + * 根据id统计数量 + * + * @author 小李 + * @date 14:30 2024/12/14 + * @param ids ids + **/ + @GetMapping("/getCountByIds") + public CommonResult getCountByIds(@RequestParam(value = "ids" ,required = false) List ids) { + if (CollUtil.isEmpty(ids)){ + return null; + } + return success(inspectionFileService.getCountByIds(ids)); + } } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionFileService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionFileService.java index f97a3821..f242a637 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionFileService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionFileService.java @@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; +import java.util.Map; + /** * inspectionFileService接口 * @@ -63,4 +66,13 @@ public interface IInspectionFileService extends IService * @return 分页结果 */ IPage selectInspectionFileList(Page page, InspectionFile inspectionFile); + + /** + * 根据id统计数量 + * + * @author 小李 + * @date 14:30 2024/12/14 + * @param ids ids + **/ + Map getCountByIds(List ids); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionFileServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionFileServiceImpl.java index 38349e98..92af6e3f 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionFileServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionFileServiceImpl.java @@ -16,6 +16,8 @@ import org.springframework.stereotype.Service; import java.util.Arrays; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * inspectionFileService业务层处理 @@ -160,12 +162,29 @@ public class InspectionFileServiceImpl extends ServiceImpl selectInspectionFileList(Page page, InspectionFile inspectionFile) { // 创建一个空的 QueryWrapper - QueryWrapper queryWrapper = new QueryWrapper<>(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); if (ObjectUtil.isNotEmpty(inspectionFile.getFatherId())) { - queryWrapper.eq("father_id", inspectionFile.getFatherId()); + queryWrapper.eq(InspectionFile::getFatherId, inspectionFile.getFatherId()); } - + queryWrapper.orderByAsc(InspectionFile::getType); + queryWrapper.orderByDesc(InspectionFile::getCreateTime); // 直接调用 MyBatis-Plus 的 page 方法进行分页查询 return this.page(page, queryWrapper); // 返回符合条件的分页查询结果 } + + /** + * 根据id统计数量 + * + * @author 小李 + * @date 14:30 2024/12/14 + * @param ids ids + **/ + @Override + public Map getCountByIds(List ids){ + List inspectionFiles = baseMapper.selectList(new LambdaQueryWrapper().in(InspectionFile::getFatherId, ids)); + return inspectionFiles.stream().collect(Collectors.groupingBy( + InspectionFile::getFatherId, + Collectors.counting() + )); + } } From 7cc778776e55482135440887d1da7307a4683e1b Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Sat, 14 Dec 2024 16:00:19 +0800 Subject: [PATCH 22/37] =?UTF-8?q?=E8=B5=84=E6=96=99=E5=8A=A0=E4=B8=8A?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspection/service/impl/InspectionFileServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionFileServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionFileServiceImpl.java index 92af6e3f..7ea922ad 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionFileServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionFileServiceImpl.java @@ -168,6 +168,9 @@ public class InspectionFileServiceImpl extends ServiceImpl Date: Sun, 15 Dec 2024 16:53:41 +0800 Subject: [PATCH 23/37] =?UTF-8?q?=E6=A3=80=E6=B5=8B=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=99=BB=E5=BD=95=E7=94=A8=E6=88=B7=E6=9D=83?= =?UTF-8?q?=E9=99=90=E6=9C=80=E5=A4=A7=E7=9A=84=E8=A7=92=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/common/InspectionRoleCommon.java | 77 +++++++++++++++++++ .../controller/InspectionUtilController.java | 74 ++++++++++++++++++ .../controller/admin/SysLoginController.java | 1 - 3 files changed, 151 insertions(+), 1 deletion(-) create mode 100644 dl-module-inspection/src/main/java/cn/iocoder/yudao/common/InspectionRoleCommon.java create mode 100644 dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionUtilController.java diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/common/InspectionRoleCommon.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/common/InspectionRoleCommon.java new file mode 100644 index 00000000..27d9ae1c --- /dev/null +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/common/InspectionRoleCommon.java @@ -0,0 +1,77 @@ +package cn.iocoder.yudao.common; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 检测相关和角色和其对应的权重 + * + * 权重分配如下: + * 检测业务管理员 + * 检测站老板 + * 检测官方 + * 检测商户 + * 经销商 + * 合作商 + * 引车员 + * 环检员 + * 外检员 + * 外检底检 + * 一审 + * 环检预审 + * 检测用户 + * @author 小李 + * @date 15:39 2024/12/15 +**/ +@AllArgsConstructor +@Getter +public enum InspectionRoleCommon { + + /** 检测业务管理员 */ + JIANCE("jiance", 1), + + /** 检测站老板 */ + JCBOSS("jcboss", 1), + + /** 检测官方 */ + JCGF("jcgf", 2), + + /** 检测商户 */ + JCSHOP("jcshop", 2), + + /** 经销商 */ + DEALERS("dealers", 2), + + /** 合作商 */ + PARTNERS("partners", 2), + + /** 引车员 */ + JCYCY("jcycy", 3), + + /** 环检员 */ + JCHJY("jchjy", 4), + + /** 外检员 */ + JCWJY("jcwjy", 4), + + /** 外检底检 */ + JCWJDJ("jcwjdj", 4), + + /** 一审 */ + JCYSZZ("jcyszz", 4), + + /** 环检预审 */ + JCHJYS("jchjys", 4), + + /** 检测用户 */ + JCYH("jcyh", 4), + + /** 检测员工 */ + JCWORKER("jcworker", 4); + + /** 角色Code */ + private final String code; + + /** 角色权重 */ + private final Integer weight; +} diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionUtilController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionUtilController.java new file mode 100644 index 00000000..ae322a10 --- /dev/null +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionUtilController.java @@ -0,0 +1,74 @@ +package cn.iocoder.yudao.module.inspection.controller; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.iocoder.yudao.common.InspectionRoleCommon; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; +import cn.iocoder.yudao.module.system.api.permission.PermissionApi; +import cn.iocoder.yudao.module.system.api.permission.RoleApi; +import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +/** + * 检测用的工具Controller + * + * @author 小李 + * @date 15:36 2024/12/15 +**/ +@RestController +@RequestMapping("/admin-api/inspection/util") +public class InspectionUtilController { + + @Resource + private PermissionApi permissionApi; + + @Resource + private RoleApi roleApi; + + /** + * 根据用户取出当前用户的角色,只针对检测 + * + * @author 小李 + * @date 15:15 2024/12/15 + **/ + @GetMapping("/getRoleName") + public CommonResult getRoleName(){ + String name = "未知岗位"; + List roleIdsByUserId = permissionApi.getRoleIdsByUserId(SecurityFrameworkUtils.getLoginUserId()); + if (CollUtil.isEmpty(roleIdsByUserId)){ + return success(name); + } + List roleList = roleApi.getRoleList(); + List roles = roleList.stream().filter(item -> roleIdsByUserId.contains(item.getId())).collect(Collectors.toList()); + List roleCommons = Arrays.asList(InspectionRoleCommon.values()); + List codes = roleCommons.stream().map(InspectionRoleCommon::getCode).collect(Collectors.toList()); + List inspectionRoles = roles.stream().filter(item -> codes.contains(item.getCode())).collect(Collectors.toList()); + if (CollUtil.isEmpty(inspectionRoles)){ + return success(name); + } + Integer index = Integer.MAX_VALUE; + for (RoleReqDTO inspectionRole : inspectionRoles) { + InspectionRoleCommon inspectionRoleCommon = InspectionRoleCommon.valueOf(inspectionRole.getCode().toUpperCase()); + if (ObjectUtil.isEmpty(inspectionRoleCommon)){ + continue; + } + Integer weight = inspectionRoleCommon.getWeight(); + if (weight < index){ + index = weight; + name = inspectionRole.getName(); + } + } + return success(name); + } +} diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/app/controller/admin/SysLoginController.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/app/controller/admin/SysLoginController.java index bc5b58e4..eee0b6c4 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/app/controller/admin/SysLoginController.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/app/controller/admin/SysLoginController.java @@ -193,7 +193,6 @@ public class SysLoginController { return success(loginService.login(authLoginReqVO)); } - /** * 汽修小程序登录方法 * From 3b5c87b0325fdef6c49c2737d1535d8ccffde842 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Mon, 16 Dec 2024 16:11:37 +0800 Subject: [PATCH 24/37] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AppNewsController.java | 1 - .../controller/WarnMessageController.java | 65 +++++++++++++------ .../mapper/inspection/WarnMessageMapper.xml | 2 +- 3 files changed, 45 insertions(+), 23 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/AppNewsController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/AppNewsController.java index e30ee4f1..501f9830 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/AppNewsController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/AppNewsController.java @@ -314,5 +314,4 @@ public class AppNewsController extends BaseController { IPage news = inspectionNewsService.msgList(page,partnerId); return success(news); } - } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/WarnMessageController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/WarnMessageController.java index 5dd5a138..f27f17c6 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/WarnMessageController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/WarnMessageController.java @@ -5,16 +5,12 @@ import javax.servlet.http.HttpServletResponse; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.util.ExcelUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import cn.iocoder.yudao.module.core.controller.BaseController; import cn.iocoder.yudao.module.inspection.entity.WarnMessage; import cn.iocoder.yudao.module.inspection.service.IWarnMessageService; @@ -27,8 +23,7 @@ import cn.iocoder.yudao.module.inspection.service.IWarnMessageService; */ @RestController @RequestMapping("/admin-api/warnMsg/warnMsg") -public class WarnMessageController extends BaseController -{ +public class WarnMessageController extends BaseController { @Autowired private IWarnMessageService warnMessageService; @@ -42,11 +37,12 @@ public class WarnMessageController extends BaseController } @GetMapping("/pageList") - public CommonResult pageList(WarnMessage warnMessage,Integer pageNo,Integer pageSize) throws Exception { - Page page =new Page(pageNo,pageSize); - IPage list = warnMessageService.pageList(page,warnMessage); + public CommonResult pageList(WarnMessage warnMessage, Integer pageNo, Integer pageSize) throws Exception { + Page page = new Page(pageNo, pageSize); + IPage list = warnMessageService.pageList(page, warnMessage); return success(list); } + @PostMapping("/export") public void export(HttpServletResponse response, WarnMessage warnMessage) throws Exception { List list = warnMessageService.selectWarnMessageList(warnMessage); @@ -58,29 +54,56 @@ public class WarnMessageController extends BaseController * 获取warnMsg详细信息 */ @GetMapping(value = "/{id}") - public CommonResult getInfo(@PathVariable("id") Long id) - { + public CommonResult getInfo(@PathVariable("id") Long id) { + WarnMessage warnMessage = new WarnMessage(); + warnMessage.setId(id); + warnMessage.setIsRead("1"); + warnMessageService.updateById(warnMessage); return success(warnMessageService.selectWarnMessageById(id)); } @PostMapping("/add") - public CommonResult add(@RequestBody WarnMessage warnMessage) - { + public CommonResult add(@RequestBody WarnMessage warnMessage) { return toAjax(warnMessageService.insertWarnMessage(warnMessage)); } @PostMapping("/edit") - public CommonResult edit(@RequestBody WarnMessage warnMessage) - { + public CommonResult edit(@RequestBody WarnMessage warnMessage) { return toAjax(warnMessageService.updateWarnMessage(warnMessage)); } - @DeleteMapping("/{ids}") - public CommonResult remove(@PathVariable Long[] ids) - { + @DeleteMapping("/{ids}") + public CommonResult remove(@PathVariable Long[] ids) { return toAjax(warnMessageService.deleteWarnMessageByIds(ids)); } + + /** + * 获取未读的提醒数量 + * + * @author 小李 + * @date 14:33 2024/12/16 + **/ + @GetMapping("/getCount") + public CommonResult getCount() { + long count = warnMessageService.count(new LambdaQueryWrapper().eq(WarnMessage::getIsRead, "0")); + return success(count); + } + + /** + * 已读全部 + * + * @author 小李 + * @date 15:57 2024/12/16 + **/ + @GetMapping("/readAll") + public CommonResult readAll() { + warnMessageService.update(new LambdaUpdateWrapper() + .set(WarnMessage::getIsRead, "1") + .eq(WarnMessage::getIsRead, "0") + ); + return CommonResult.ok(); + } } diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/WarnMessageMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/WarnMessageMapper.xml index eb070d4e..a0f4914e 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/WarnMessageMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/WarnMessageMapper.xml @@ -8,7 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + From 68512f2e92193b620101564d9bf4b15af553c69f Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Tue, 17 Dec 2024 13:04:26 +0800 Subject: [PATCH 26/37] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/InspectionFileController.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionFileController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionFileController.java index ac3409c3..b80e5bf8 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionFileController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionFileController.java @@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService; import cn.iocoder.yudao.module.inspection.service.IInspectionFileService; import cn.iocoder.yudao.module.shop.entity.ShopMallPartners; import cn.iocoder.yudao.util.ExcelUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.springframework.beans.factory.annotation.Autowired; @@ -122,4 +123,21 @@ public class InspectionFileController extends BaseController } return success(inspectionFileService.getCountByIds(ids)); } + + /** + * 得到使用说明 + * + * @author 小李 + * @date 12:31 2024/12/17 + **/ + @GetMapping("/getPresent") + public CommonResult getPresent(){ + List files = inspectionFileService.list(new LambdaQueryWrapper().eq(InspectionFile::getFileName, "使用说明")); + if (CollUtil.isEmpty(files)){ + return null; + } + InspectionFile inspectionFile = files.get(0); + return success(inspectionFile); + + } } From 8f92fd463fd0265e97a7cd95f613a71915ca90b2 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Tue, 17 Dec 2024 13:52:13 +0800 Subject: [PATCH 27/37] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/InspectionUtilController.java | 28 +++++++++++++++++++ .../module/system/api/permission/RoleApi.java | 7 +++++ .../system/api/permission/RoleApiImpl.java | 17 +++++++++++ 3 files changed, 52 insertions(+) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionUtilController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionUtilController.java index ae322a10..b6fb7646 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionUtilController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionUtilController.java @@ -5,9 +5,16 @@ import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.common.InspectionRoleCommon; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; +import cn.iocoder.yudao.module.inspection.entity.InspectionEquInfo; +import cn.iocoder.yudao.module.inspection.entity.InspectionFile; +import cn.iocoder.yudao.module.inspection.service.IInspectionEquInfoService; +import cn.iocoder.yudao.module.inspection.service.IInspectionFileService; import cn.iocoder.yudao.module.system.api.permission.PermissionApi; import cn.iocoder.yudao.module.system.api.permission.RoleApi; import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -15,7 +22,9 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @@ -36,6 +45,12 @@ public class InspectionUtilController { @Resource private RoleApi roleApi; + @Resource + private IInspectionEquInfoService equInfoService; + + @Resource + private IInspectionFileService fileService; + /** * 根据用户取出当前用户的角色,只针对检测 * @@ -71,4 +86,17 @@ public class InspectionUtilController { } return success(name); } + + @GetMapping("/getTypeCount") + public CommonResult getTypeCount(@RequestParam("partnerId")Long partnerId){ + Map map = new HashMap<>(); + Long staffCount = roleApi.selectListByRoleId(); + map.put("staff", staffCount); + Page page = new Page<>(1, 1000); + IPage equs = equInfoService.selectInspectionEquInfoList(page, new InspectionEquInfo()); + map.put("equ", equs.getTotal()); + long fileCount = fileService.count(new LambdaQueryWrapper().eq(InspectionFile::getType, "2")); + map.put("file", fileCount); + return success(map); + } } diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/RoleApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/RoleApi.java index 28280248..a2aa0bee 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/RoleApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/RoleApi.java @@ -40,4 +40,11 @@ public interface RoleApi { **/ List selectUserListByRoleCode(Long tenantId,String code); + /** + * 通过角色id查询角色 + * + * @author 小李 + * @date 13:21 2024/12/17 + **/ + Long selectListByRoleId(); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/permission/RoleApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/permission/RoleApiImpl.java index 3482f0a0..939dbfa0 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/permission/RoleApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/permission/RoleApiImpl.java @@ -3,8 +3,10 @@ package cn.iocoder.yudao.module.system.api.permission; import cn.hutool.core.bean.BeanUtil; import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO; import cn.iocoder.yudao.module.system.api.user.dto.UserDTO; +import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RolePageReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; import cn.iocoder.yudao.module.system.service.permission.RoleService; +import com.baomidou.mybatisplus.core.metadata.IPage; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -64,4 +66,19 @@ public class RoleApiImpl implements RoleApi { public List selectUserListByRoleCode(Long tenantId,String code) { return roleService.selectByRoleCode(tenantId,code); } + + /** + * 通过角色id查询角色 + * + * @author 小李 + * @date 13:21 2024/12/17 + **/ + @Override + public Long selectListByRoleId(){ + RolePageReqVO rolePageReqVO = new RolePageReqVO(); + rolePageReqVO.setPageNo(1); + rolePageReqVO.setPageSize(1000); + IPage userDTOIPage = roleService.selectListByRoleId(rolePageReqVO); + return userDTOIPage.getTotal(); + } } From 8c68f0b7c05558afedb1bd621849270881519808 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Tue, 17 Dec 2024 14:29:40 +0800 Subject: [PATCH 28/37] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspection/service/impl/InspectionInfoServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java index 8bf4a301..32a4924f 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java @@ -597,7 +597,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl workNodes = workNodeService.list(wrapper); From 2fbbcb0daa37486266c181a0717afdf35094a374 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Tue, 17 Dec 2024 16:09:49 +0800 Subject: [PATCH 29/37] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspection/entity/InspectionEquInfo.java | 3 +++ .../inspection/InspectionEquInfoMapper.xml | 21 ++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionEquInfo.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionEquInfo.java index cc27e940..be2275e7 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionEquInfo.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionEquInfo.java @@ -62,4 +62,7 @@ public class InspectionEquInfo extends TenantBaseDO @TableField(exist = false) private Map params; + /** 设备类别(字典:ins_equ_type) */ + private String type; + } diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/InspectionEquInfoMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/InspectionEquInfoMapper.xml index 19d015dc..0c015507 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/InspectionEquInfoMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/InspectionEquInfoMapper.xml @@ -8,13 +8,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" From a94700e4f656ab1b876cfb4280418f86092c4232 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Tue, 17 Dec 2024 17:18:30 +0800 Subject: [PATCH 30/37] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/InspectionUtilController.java | 61 +++++++++++++++---- 1 file changed, 49 insertions(+), 12 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionUtilController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionUtilController.java index b6fb7646..f39b67ed 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionUtilController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionUtilController.java @@ -21,10 +21,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @@ -34,7 +31,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; * * @author 小李 * @date 15:36 2024/12/15 -**/ + **/ @RestController @RequestMapping("/admin-api/inspection/util") public class InspectionUtilController { @@ -58,10 +55,10 @@ public class InspectionUtilController { * @date 15:15 2024/12/15 **/ @GetMapping("/getRoleName") - public CommonResult getRoleName(){ + public CommonResult getRoleName() { String name = "未知岗位"; List roleIdsByUserId = permissionApi.getRoleIdsByUserId(SecurityFrameworkUtils.getLoginUserId()); - if (CollUtil.isEmpty(roleIdsByUserId)){ + if (CollUtil.isEmpty(roleIdsByUserId)) { return success(name); } List roleList = roleApi.getRoleList(); @@ -69,17 +66,17 @@ public class InspectionUtilController { List roleCommons = Arrays.asList(InspectionRoleCommon.values()); List codes = roleCommons.stream().map(InspectionRoleCommon::getCode).collect(Collectors.toList()); List inspectionRoles = roles.stream().filter(item -> codes.contains(item.getCode())).collect(Collectors.toList()); - if (CollUtil.isEmpty(inspectionRoles)){ + if (CollUtil.isEmpty(inspectionRoles)) { return success(name); } - Integer index = Integer.MAX_VALUE; + Integer index = Integer.MAX_VALUE; for (RoleReqDTO inspectionRole : inspectionRoles) { InspectionRoleCommon inspectionRoleCommon = InspectionRoleCommon.valueOf(inspectionRole.getCode().toUpperCase()); - if (ObjectUtil.isEmpty(inspectionRoleCommon)){ + if (ObjectUtil.isEmpty(inspectionRoleCommon)) { continue; } Integer weight = inspectionRoleCommon.getWeight(); - if (weight < index){ + if (weight < index) { index = weight; name = inspectionRole.getName(); } @@ -88,7 +85,7 @@ public class InspectionUtilController { } @GetMapping("/getTypeCount") - public CommonResult getTypeCount(@RequestParam("partnerId")Long partnerId){ + public CommonResult getTypeCount(@RequestParam("partnerId") Long partnerId) { Map map = new HashMap<>(); Long staffCount = roleApi.selectListByRoleId(); map.put("staff", staffCount); @@ -99,4 +96,44 @@ public class InspectionUtilController { map.put("file", fileCount); return success(map); } + + @GetMapping("/getRoleNameByIds") + public CommonResult getRoleNameByIds(@RequestParam("ids") List ids) { + Map> idToRoleIds = ids.stream().collect(Collectors.toMap(id -> id, id -> permissionApi.getRoleIdsByUserId(id))); + if (CollUtil.isEmpty(idToRoleIds)){ + return null; + } + List roleList = roleApi.getRoleList(); + List roleCommons = Arrays.asList(InspectionRoleCommon.values()); + List codes = roleCommons.stream().map(InspectionRoleCommon::getCode).collect(Collectors.toList()); + return success(idToRoleIds.entrySet().stream().collect(Collectors.toMap( + Map.Entry::getKey, + item -> { + String name = "未知岗位"; + if (CollUtil.isEmpty(item.getValue())){ + return name; + } + List roles = roleList.stream().filter(i -> item.getValue().contains(i.getId())).collect(Collectors.toList()); + if (CollUtil.isEmpty(roles)) { + return name; + } + List inspectionRoles = roles.stream().filter(i -> codes.contains(i.getCode())).collect(Collectors.toList()); + if (CollUtil.isEmpty(inspectionRoles)){ + return name; + } + Integer index = Integer.MAX_VALUE; + for (RoleReqDTO inspectionRole : inspectionRoles) { + InspectionRoleCommon inspectionRoleCommon = InspectionRoleCommon.valueOf(inspectionRole.getCode().toUpperCase()); + if (ObjectUtil.isEmpty(inspectionRoleCommon)) { + continue; + } + Integer weight = inspectionRoleCommon.getWeight(); + if (weight < index) { + index = weight; + name = inspectionRole.getName(); + } + } + return name; + }))); + } } From 18e1ed5e680d97e00e4abaf36e86565f4b61930a Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Wed, 18 Dec 2024 12:07:47 +0800 Subject: [PATCH 31/37] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/common/InspectionRoleCommon.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/common/InspectionRoleCommon.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/common/InspectionRoleCommon.java index 27d9ae1c..2775a758 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/common/InspectionRoleCommon.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/common/InspectionRoleCommon.java @@ -30,6 +30,9 @@ public enum InspectionRoleCommon { /** 检测业务管理员 */ JIANCE("jiance", 1), + /** 站长 */ + JCZZ("jczz", 1), + /** 检测站老板 */ JCBOSS("jcboss", 1), @@ -66,6 +69,30 @@ public enum InspectionRoleCommon { /** 检测用户 */ JCYH("jcyh", 4), + /** 安检外检 */ + JCAJWJ("jcajwj", 4), + + /** 收费登录 */ + JCSFDL("jcsfdl", 4), + + /** 环检外检 */ + JCHJWJ("jchjwj", 4), + + /** 底盘检测 */ + JCDPJC("jcdpjc", 4), + + /** 环检操作 */ + JCHJCZ("jchjcz", 4), + + /** 检测总检 */ + JCZJ("jczj", 4), + + /** 检测资料管理员 */ + JCZLGLY("jczlgly", 4), + + /** 安全检验员 */ + AQJYY("aqjyy", 4), + /** 检测员工 */ JCWORKER("jcworker", 4); From ec37eaf03b46726f6a748468605fe4c966a49b93 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Wed, 18 Dec 2024 16:17:53 +0800 Subject: [PATCH 32/37] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/CompanyStaffController.java | 27 ++++++++++++++ .../controller/InspectionNewsController.java | 36 +++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/controller/admin/CompanyStaffController.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/controller/admin/CompanyStaffController.java index 358c6fcb..c09f5132 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/controller/admin/CompanyStaffController.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/controller/admin/CompanyStaffController.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.staff.controller.admin; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; @@ -15,6 +16,8 @@ import cn.iocoder.yudao.module.staff.vo.CompanyStaffReqVO; import cn.iocoder.yudao.module.staff.vo.CompanyStaffRespVO; import cn.iocoder.yudao.module.staff.vo.StaffLoginBody; import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO; +import cn.iocoder.yudao.module.system.api.user.AdminUserApi; +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; import cn.iocoder.yudao.module.system.controller.admin.auth.vo.AuthLoginReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.service.auth.AdminAuthService; @@ -40,6 +43,7 @@ import java.util.List; import java.util.Map; import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT; +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @@ -63,6 +67,8 @@ public class CompanyStaffController { private AdminAuthService loginService; @Autowired private ApiAppLoginService apiAppLoginService; + @Resource + private AdminUserApi adminUserApi; /** * 分页查询 @@ -326,4 +332,25 @@ public class CompanyStaffController { return error(2_002_000_005,e.getMessage()); } } + + /** + * 根据用户ID获取信息 + * + * @author 小李 + * @date 15:12 2024/12/18 + * @param id 用户ID + **/ + @GetMapping("/getByUserId") + public CommonResult getByUserId(@RequestParam("id")Long id){ + Map map = new HashMap<>(); + List list = staffService.list(new LambdaQueryWrapper().eq(CompanyStaff::getUserId, id)); + if (CollUtil.isNotEmpty(list)){ + map.put("staff", list.get(0)); + } + AdminUserRespDTO user = adminUserApi.getUser(id); + if (ObjectUtil.isNotEmpty(user)){ + map.put("user", user); + } + return success(map); + } } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionNewsController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionNewsController.java index 3189f748..0e81740d 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionNewsController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionNewsController.java @@ -1,11 +1,18 @@ package cn.iocoder.yudao.module.inspection.controller; import java.util.List; +import java.util.stream.Collectors; import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.inspection.entity.InspectionNews; import cn.iocoder.yudao.module.inspection.service.IInspectionNewsService; import cn.iocoder.yudao.module.shop.entity.ShopMallPartners; +import cn.iocoder.yudao.module.system.api.dict.DictDataApi; +import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO; +import cn.iocoder.yudao.module.system.api.permission.PermissionApi; +import cn.iocoder.yudao.module.system.api.permission.RoleApi; +import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.springframework.security.access.prepost.PreAuthorize; @@ -13,6 +20,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import cn.iocoder.yudao.module.core.controller.BaseController; +import javax.annotation.Resource; + /** * 【请填写功能名称】Controller * @@ -26,6 +35,15 @@ public class InspectionNewsController extends BaseController @Autowired private IInspectionNewsService inspectionNewsService; + @Resource + private DictDataApi dataApi; + + @Resource + private PermissionApi permissionApi; + + @Resource + private RoleApi roleApi; + /** * 查询【请填写功能名称】列表 */ @@ -63,4 +81,22 @@ public class InspectionNewsController extends BaseController { return toAjax(inspectionNewsService.deleteInspectionNewsByIds(ids)); } + + /** + * 验证当前登录用户是否可以发布通知 + * + * @author 小李 + * @date 16:00 2024/12/18 + **/ + @GetMapping("/ifSend") + public CommonResult ifSend(){ + List dataList = dataApi.getDictDataList("ins_send_news"); + List values = dataList.stream().map(DictDataRespDTO::getValue).collect(Collectors.toList()); + List roleIds = permissionApi.getRoleIdsByUserId(SecurityFrameworkUtils.getLoginUserId()); + List roles = roleApi.getRoleList(); + List role = roles.stream().filter(item -> roleIds.contains(item.getId())).collect(Collectors.toList()); + List codes = role.stream().map(RoleReqDTO::getCode).collect(Collectors.toList()); + List collect = codes.stream().filter(values::contains).collect(Collectors.toList()); + return success(!collect.isEmpty()); + } } From 324b241e1293fcf545f823c29137dbc4ffb5deb7 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Wed, 18 Dec 2024 17:38:22 +0800 Subject: [PATCH 33/37] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/InspectionInfoController.java | 11 +++ .../service/IInspectionInfoService.java | 8 ++ .../impl/InspectionInfoServiceImpl.java | 78 +++++++++++++++++-- .../inspection/InspectionInfoMapper.xml | 1 - 4 files changed, 90 insertions(+), 8 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java index adf31725..b10a6b04 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java @@ -359,4 +359,15 @@ public class InspectionInfoController extends BaseController { String name = inspectionInfoService.easyPoiExport("template/word/四川省超标排放汽车维护修理告知书.docx", str, map, request, response); return CommonResult.success(name); } + + /** + * 获得不同状态的数据的数量 + * + * @author 小李 + * @date 16:22 2024/12/18 + **/ + @GetMapping("/getCountByType") + public CommonResult getCountByType(@RequestParam("partnerId")Integer partnerId){ + return success(inspectionInfoService.getCountByType(partnerId)); + } } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java index f5532128..4b5e841b 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java @@ -139,4 +139,12 @@ public interface IInspectionInfoService extends IService List getRoleList(); String easyPoiExport(String templatePath, String filename, Map data, HttpServletRequest request, HttpServletResponse response); + + /** + * 获得不同状态的数据的数量 + * + * @author 小李 + * @date 16:22 2024/12/18 + **/ + Map getCountByType(Integer partnerId); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java index 32a4924f..111f4581 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java @@ -9,9 +9,11 @@ import java.time.LocalDateTime; import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.util.*; +import java.util.concurrent.*; import java.util.stream.Collectors; import cn.afterturn.easypoi.word.WordExportUtil; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DateUtil; @@ -623,26 +625,26 @@ public class InspectionInfoServiceImpl extends ServiceImpl list = workNodeService.list(new LambdaQueryWrapper().eq(InspectionWorkNode::getInspectionInfoId, id)); Set status = list.stream().map(InspectionWorkNode::getStatus).collect(Collectors.toSet()); - if (status.contains("3")){ + if (status.contains("3")) { result = true; } } - if (result){ - result = inspectionInfo.getCreator().equals(SecurityFrameworkUtils.getLoginUserId()+""); + if (result) { + result = inspectionInfo.getCreator().equals(SecurityFrameworkUtils.getLoginUserId() + ""); } return result; } @@ -663,6 +665,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl getCountByType(Integer partnerId) { + // 创建线程池 + ExecutorService executor = Executors.newFixedThreadPool(6); + + try { + InspectionInfo inspectionInfo = new InspectionInfo(); + inspectionInfo.setPartnerId(partnerId.longValue()); + + // 获取当前登录人 + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + // 获取当前登陆人的角色 + List byUserId = roleService.getByUserId(loginUser.getId()); + inspectionInfo.setLeadManId(loginUser.getId()); + List roleIds = byUserId.stream().map(UserRoleDO::getRoleId).collect(Collectors.toList()); + if (!"1".equals(inspectionInfo.getStatus())) { + // 进行中 已完成 + inspectionInfo.setDealUserId(loginUser.getId()); + } + + Map result = new ConcurrentHashMap<>(); // 使用ConcurrentHashMap以确保线程安全 + + // 定义一个数组来保存所有的CompletableFuture + CompletableFuture[] futures = new CompletableFuture[6]; + + for (int i = 0; i < 6; i++) { + final String status = String.valueOf(i); + + // 复制一份inspectionInfo对象,避免多线程修改同一个对象导致的问题 + InspectionInfo infoCopy = BeanUtil.toBean(inspectionInfo, InspectionInfo.class); + infoCopy.setStatus(status); + + // 为每个任务创建一个新的Page对象 + Page page = new Page<>(1, 10); + + futures[i] = CompletableFuture.runAsync(() -> { + IPage iPage = baseMapper.selectByUser(page, roleIds, infoCopy); + result.put(status, iPage.getTotal()); + }, executor); + } + + // 等待所有任务完成 + CompletableFuture.allOf(futures).join(); + + return result; + + } catch (Exception e) { + throw new RuntimeException("Failed to execute tasks in parallel", e); + } finally { + // 关闭线程池 + executor.shutdown(); + } + } } diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml index 11ff1280..ef5cb90e 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml @@ -409,5 +409,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - From dbe91094ec2c5b38c85985d2d2ca50c32cc966d4 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Thu, 19 Dec 2024 14:50:52 +0800 Subject: [PATCH 34/37] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AppNewsController.java | 6 ++++ .../inspection/entity/InspectionNews.java | 4 +++ .../mapper/InspectionNewsMapper.java | 2 +- .../impl/InspectionNewsServiceImpl.java | 35 +++++++++++++++++-- .../inspection/InspectionNewsMapper.xml | 10 ++++-- 5 files changed, 51 insertions(+), 6 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/AppNewsController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/AppNewsController.java index 501f9830..8debb7d2 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/AppNewsController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/AppNewsController.java @@ -164,6 +164,12 @@ public class AppNewsController extends BaseController { inspectionNews.setPublishUnit(partners.getPartnerName()); } + if (ObjectUtil.isEmpty(inspectionNews.getType()) || inspectionNews.getType().equals("null")){ + if (ObjectUtil.isNotEmpty(inspectionNews.getIfShow())){ + inspectionNews.setType(inspectionNews.getIfShow().equals("01") ? "staff" : "user"); + } + } + //判断是否为当前登录用户创建的 return toAjax(inspectionNewsService.insertInspectionNews(inspectionNews)); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionNews.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionNews.java index be68946d..df3c6ed1 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionNews.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionNews.java @@ -56,4 +56,8 @@ public class InspectionNews extends TenantBaseDO @TableField(exist = false) private String isRead; + /** 设置可见 */ + @TableField(exist = false) + private String ifShow; + } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/InspectionNewsMapper.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/InspectionNewsMapper.java index f33bfb8a..c87ac3b0 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/InspectionNewsMapper.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/InspectionNewsMapper.java @@ -81,6 +81,6 @@ public interface InspectionNewsMapper extends BaseMapper void addReadNum(Long id); IPage collectionNews(Page page, @Param("userId") Long userId,@Param("newsName")String newsName); Integer newMsgNum(@Param("partnerId") Long partnerId); - IPage msgList(Page page, @Param("partnerId") Long partnerId); + IPage msgList(Page page, @Param("ifShow") String ifShow); List listGfClass(@Param("type") String type); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionNewsServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionNewsServiceImpl.java index ed75df0b..83646bff 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionNewsServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionNewsServiceImpl.java @@ -4,10 +4,15 @@ import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.stream.Collectors; +import cn.hutool.core.collection.CollUtil; import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; +import cn.iocoder.yudao.module.system.api.permission.PermissionApi; +import cn.iocoder.yudao.module.system.api.permission.RoleApi; +import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.service.user.AdminUserService; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -28,6 +33,8 @@ import cn.iocoder.yudao.module.inspection.utils.HtmlFilter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.annotation.Resource; + /** * 【请填写功能名称】Service业务层处理 * @@ -44,6 +51,10 @@ public class InspectionNewsServiceImpl extends ServiceImpl msgList(Page page, Long partnerId) { - IPage news = baseMapper.msgList(page, partnerId); + List roleIdsByUserId = permissionApi.getRoleIdsByUserId(SecurityFrameworkUtils.getLoginUserId()); + List roleList = roleApi.getRoleList(); + List collect = roleList.stream().filter(item -> roleIdsByUserId.contains(item.getId())).collect(Collectors.toList()); + String ifShow = ""; + if (CollUtil.isNotEmpty(collect)){ + List collect1 = collect.stream().map(RoleReqDTO::getCode).collect(Collectors.toList()); + // 检测用户 + if (collect1.contains("jcyh")){ + ifShow = "user"; + } +// else if (collect1.contains("jcgf") || collect1.contains("jcshop") || collect1.contains("dealers") || collect1.contains("partners")){ +// // 检测官方 检测商户 经销商 合作商 +// ifShow = ""; +// } + else { + ifShow = "staff"; + } + } + IPage news = baseMapper.msgList(page, ifShow); news.getRecords().forEach(it->{ it.setNewsContent(HtmlFilter.dealFunction(it.getNewsContent())); }); diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/InspectionNewsMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/InspectionNewsMapper.xml index 487ea400..931e8cb0 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/InspectionNewsMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/InspectionNewsMapper.xml @@ -167,8 +167,14 @@ news.*,IF(ina.id is null,0,1) as isRead FROM inspection_news news - left JOIN inspection_news_association ina ON ina.news_id = news.id and ina.user_id = #{partnerId} and ina.type = 'read' - WHERE news.category = 'jcztz' or news.category = 'zflm' + left JOIN inspection_news_association ina ON ina.news_id = news.id and ina.type = 'read' + WHERE news.category = 'zflm' + + or news.category = 'jcztz' + or news.type = #{ifShow} + or news.type = 'null' + + group by news.id order by isRead,news.create_time desc SELECT info.id,info.worker_name,info.worker_phone,info.worker_avatar,info.`status`,info.is_pass,info.start_time,info.end_time,step.title as lastTitle, - su.nickname buyName,su.mobile as buyPhone,oi.order_no as orderNo,oi.pay_money+oi.balance as realPayMoney,oi.goods_title as goodsName,info.car_num,info.is_retrial + su.nickname buyName,su.mobile as buyPhone,oi.order_no as orderNo,oi.pay_money+oi.balance as realPayMoney,oi.goods_title as goodsName,info.car_num,info.is_retrial, + info.customer_source as customerSource, info.other_phone as otherPhone,oi.sku_id as skuId, oi.sku_name as skuName,oi.goods_price as goodsPrice from inspection_info info LEFT JOIN inspection_step_info step ON info.id = step.inspection_info_id