diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/appBase/controller/AppSwiperController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/appBase/controller/AppSwiperController.java index c4c0152f..61b29578 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/appBase/controller/AppSwiperController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/appBase/controller/AppSwiperController.java @@ -141,7 +141,7 @@ public class AppSwiperController extends BaseController { LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); LoginUser user = SecurityFrameworkUtils.getLoginUser(); - queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0"); + queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1"); ShopMallPartners partner = partnersService.getOne(queryWrapper); if (ObjectUtil.isEmpty(partner)){ return error("信息有误"); diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/appBase/controller/admin/InspectionSocket.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/appBase/controller/admin/InspectionSocket.java index 1554b927..a98cb262 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/appBase/controller/admin/InspectionSocket.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/appBase/controller/admin/InspectionSocket.java @@ -9,7 +9,11 @@ import javax.websocket.*; import javax.websocket.server.PathParam; import javax.websocket.server.ServerEndpoint; import java.io.IOException; +import java.util.Map; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.LinkedBlockingQueue; /**`1 @@ -88,12 +92,36 @@ public class InspectionSocket { * 发送给指定的用户 * @param message */ - public void sendMessage(String message, String userId) throws IOException { - if (sessionMap.containsKey(userId)){ + private final Map> messageQueueMap = new ConcurrentHashMap<>(); + + public void sendMessage(String message, String userId) { + if (sessionMap.containsKey(userId)) { Session session = sessionMap.get(userId); - session.getAsyncRemote().sendText(message); + messageQueueMap.putIfAbsent(userId, new LinkedBlockingQueue<>()); + + // 将消息加入用户的队列 + messageQueueMap.get(userId).offer(message); + + // 异步处理消息队列 + processQueue(session, userId); } } + private void processQueue(Session session, String userId) { + BlockingQueue queue = messageQueueMap.get(userId); + + CompletableFuture.runAsync(() -> { + String nextMessage; + while ((nextMessage = queue.poll()) != null) { + session.getAsyncRemote().sendText(nextMessage, result -> { + if (!result.isOK()) { + System.err.println("Message sending failed for user: " + userId); + } + }); + } + }); + } + + } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionEquInfoController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionEquInfoController.java index 39bfe0fc..3c428f50 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionEquInfoController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionEquInfoController.java @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.inspection.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; +import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService; import cn.iocoder.yudao.module.shop.entity.ShopMallPartners; @@ -43,6 +44,10 @@ public class InspectionEquInfoController extends BaseController public CommonResult list(Integer pageNum,Integer pageSize,InspectionEquInfo inspectionEquInfo) throws Exception { Page page =new Page(pageNum,pageSize); + if (ObjectUtil.isNull(inspectionEquInfo.getPartnerId())) { + ShopMallPartners partners = partnerService.shopInfoByUserId(); + inspectionEquInfo.setPartnerId(partners.getPartnerId()); + } IPage list = inspectionEquInfoService.selectInspectionEquInfoList(page,inspectionEquInfo); return success(list); } 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 adb7f370..e49efba6 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 @@ -63,7 +63,7 @@ public class InspectionInfoController extends BaseController { /** * 获取【请填写功能名称】详细信息 */ - @PreAuthorize("@ss.hasPermi('system:info:query')") +// @PreAuthorize("@ss.hasPermi('system:info:query')") @GetMapping(value = "/{id}") public CommonResult getInfo(@PathVariable("id") Long id) { return success(inspectionInfoService.selectInspectionInfoById(id)); @@ -92,6 +92,10 @@ public class InspectionInfoController extends BaseController { public CommonResult edit(@RequestBody InspectionInfo inspectionInfo) throws Exception { return toAjax(inspectionInfoService.updateInspectionInfo(inspectionInfo)); } + @PostMapping("/updateLeadMan") + public CommonResult updateLeadMan(@RequestBody InspectionInfo inspectionInfo){ + return toAjax(inspectionInfoService.updateLeadMan(inspectionInfo)); + } @PostMapping("/del") @@ -137,6 +141,19 @@ public class InspectionInfoController extends BaseController { return success("接单成功"); } + /** + * 员工取消接单 + * + * @param inspectionId 工单id + * @param workNodeId 节点id (geStelectInspection这个方法中返回了) + * @return + */ + @PostMapping("cancelAnOrder") + public CommonResult cancelAnOrder(Integer inspectionId, String workNodeId) { + inspectionWorkNodeService.cancelAnOrder(inspectionId, workNodeId); + return success("接单成功"); + } + /** * 项目操作(退办理、重审、项目完成) * @@ -229,4 +246,24 @@ public class InspectionInfoController extends BaseController { inspectionWorkNode.setDealUserId(loginUser.getId()); return success(inspectionWorkNodeService.getRoyaltySum(inspectionWorkNode)); } + + /** + * 重新审核 + * @param inspectionWorkNode + * @return + */ + @PostMapping("recheck") + public CommonResult recheck(@RequestBody InspectionWorkNode inspectionWorkNode){ + inspectionWorkNodeService.recheck(inspectionWorkNode); + return success("操作成功"); + } + + /** + * 判断当前登陆人是否有重检、重审、退办理的权限(app) + * @return + */ + @GetMapping("isExamine") + public CommonResult isExamine(){ + return success(inspectionInfoService.isExamine()); + } } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionMallPartnersController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionMallPartnersController.java index 4d5d3018..67e6885a 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionMallPartnersController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionMallPartnersController.java @@ -117,7 +117,7 @@ public class InspectionMallPartnersController extends BaseController { ShopMallPartners partner = new ShopMallPartners(); if (roles.contains("jcshop")){ LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); - queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0"); + queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1"); partner = shopMallPartnersService.getOne(queryWrapper); if (ObjectUtil.isEmpty(partner)){ return error(); @@ -150,7 +150,7 @@ public class InspectionMallPartnersController extends BaseController { ShopMallPartners partner = new ShopMallPartners(); if (roles.contains("jcshop")){ LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); - queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0"); + queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1"); partner = shopMallPartnersService.getOne(queryWrapper); if (ObjectUtil.isEmpty(partner)){ return error(); @@ -183,7 +183,7 @@ public class InspectionMallPartnersController extends BaseController { ShopMallPartners partner = new ShopMallPartners(); if (roles.contains("jcshop")){ LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); - queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0"); + queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1"); partner = shopMallPartnersService.getOne(queryWrapper); if (ObjectUtil.isEmpty(partner)){ return; @@ -270,7 +270,7 @@ public class InspectionMallPartnersController extends BaseController { ShopMallPartners partner = new ShopMallPartners(); if (roles.contains("jcshop")){ LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); - queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0"); + queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1"); partner = shopMallPartnersService.getOne(queryWrapper); if (ObjectUtil.isEmpty(partner)){ return CommonResult.error(-1,"信息有误"); 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 464dea4b..4e15a293 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 @@ -159,8 +159,10 @@ public class PartnerOwnController extends BaseController { * 检测线图 */ @GetMapping("/chartInfoRatio") - public CommonResult chartInfoRatio(Long partnerId,String unit) - { + public CommonResult chartInfoRatio(Long partnerId,String unit) throws Exception { + if (ObjectUtil.isNull(partnerId)) { + partnerId = partnerList.shopInfoByUserId().getPartnerId(); + } return success(partnerList.chartInfoRatio(partnerId, unit)); } /** @@ -539,8 +541,9 @@ public class PartnerOwnController extends BaseController { @RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum, @RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) { LoginUser user = SecurityFrameworkUtils.getLoginUser(); + // .eq(PartnerWorker::getUserId,user.getId()) LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); - queryWrapper.eq(PartnerWorker::getUserId,user.getId()).eq(PartnerWorker::getPartnerId,partnerId); + queryWrapper.eq(PartnerWorker::getPartnerId,partnerId); PartnerWorker worker = partnerWorkerService.getOne(queryWrapper); if (ObjectUtil.isEmpty(worker)){ return null; @@ -600,6 +603,12 @@ public class PartnerOwnController extends BaseController { dictDataService.deleteDictData(dictId); return success(); } + //批量删除客户来源 + @PostMapping("/delCustomerSourceBatch") + public CommonResult delCustomerSourceBatch(@RequestBody List dictIds){ + dictDataService.deleteDictDataBatch(dictIds); + return success(); + } @PostMapping("/vehicleLicenseOCR") public CommonResult vehicleLicenseOCR(String imagePath) throws Exception 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 ce67a2df..35071c7f 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 @@ -186,7 +186,7 @@ public class ShopInspectionGoodsController extends BaseController ShopMallPartners partner = new ShopMallPartners(); if (roles.contains("jcshop")){ LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); - queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0"); + queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1"); partner = appInspectionPartnerService.getOne(queryWrapper); if (ObjectUtil.isEmpty(partner)){ return error(); diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionInfo.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionInfo.java index 5a5f52fd..424cdfd9 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionInfo.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionInfo.java @@ -69,12 +69,12 @@ public class InspectionInfo extends TenantBaseDO private String status; /** 开始时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8") @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm") private Date startTime; /** 结束时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8") @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm") private Date endTime; //是否制证并完成 @@ -161,4 +161,8 @@ public class InspectionInfo extends TenantBaseDO private String workNodeStatus; @TableField(exist = false) private String selectType; + @TableField(exist = false) + private String projectName; + @TableField(exist = false) + private String leadManName; } 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 9fdaa285..bafac7a6 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 @@ -40,6 +40,8 @@ public class InspectionStepInfo extends Model { private Date updateTime; //更新人id private Integer updater; + //检测节点id + private String workNodeId; @TableField(exist = false) private String nickname; } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionWorkNode.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionWorkNode.java index 4c1536fe..8e3a1054 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionWorkNode.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionWorkNode.java @@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.IdType; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableId; import java.io.Serializable; +import java.util.List; + import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -98,4 +100,7 @@ public class InspectionWorkNode extends TenantBaseDO { private String rescueStart; @TableField(exist = false) private String rescueEnd; + /*重检或复检时需要传*/ + @TableField(exist = false) + private List workNodes; } 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 3340c22a..d2bcaf7d 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 @@ -29,4 +29,12 @@ public interface InspectionWorkNodeMapper extends BaseMapper IPage getRoyaltyList(@Param("page")IPage page,@Param("inspectionWorkNode") InspectionWorkNode inspectionWorkNode); Map getRoyaltySum(@Param("inspectionWorkNode") InspectionWorkNode inspectionWorkNode); + + void cancelAnOrder(InspectionWorkNode workNode); + + /** + * 批量修改检测状态 + * @param workNodes + */ + void recheck(@Param("list") List workNodes); } 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 ef2fb65e..c71c609d 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 @@ -49,6 +49,13 @@ public interface IInspectionInfoService extends IService * @return 结果 */ public int updateInspectionInfo(InspectionInfo inspectionInfo) throws Exception; + /** + * 修改引车员 + * + * @param inspectionInfo 【请填写功能名称】 + * @return 结果 + */ + public int updateLeadMan(InspectionInfo inspectionInfo); /** * 批量删除【请填写功能名称】 @@ -96,4 +103,10 @@ public interface IInspectionInfoService extends IService * @return */ List getWeorkNodesById(Integer inspectionId); + + /** + * 判断app当前检测人是否有审核权限 + * @return + */ + Boolean isExamine(); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionWorkNodeService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionWorkNodeService.java index d1d16fb2..526ee66e 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionWorkNodeService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionWorkNodeService.java @@ -23,6 +23,13 @@ public interface IInspectionWorkNodeService extends IService */ void updateInspectionWorkNode(Integer inspectionId, String workNodeId); + /** + * 员工取消接单 + * @param inspectionId + * @param workNodeId + */ + void cancelAnOrder(Integer inspectionId, String workNodeId); + /** * 更新流程图片 步骤信息 * @param inspectionWorkNode @@ -47,4 +54,10 @@ public interface IInspectionWorkNodeService extends IService IPage getRoyaltyList(IPage page, InspectionWorkNode inspectionWorkNode); Map getRoyaltySum(InspectionWorkNode inspectionWorkNode); + + /** + * 重新检测 + * @param workNodes + */ + void recheck(InspectionWorkNode workNodes); } 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 69287197..07dc376f 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 @@ -119,6 +119,8 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl partnerList(Page page, PartnerListQuery partnerListQuery) { @@ -174,7 +176,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl queryWrapper =new LambdaQueryWrapper<>(); - queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0"); + queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1"); partner = this.getOne(queryWrapper); if (ObjectUtil.isEmpty(partner)){ throw new Exception("信息有误"); @@ -182,6 +184,8 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl queryWrapperWork =new LambdaQueryWrapper<>(); queryWrapperWork.eq(PartnerWorker::getUserId,user.getId()); + queryWrapperWork.orderByAsc(PartnerWorker::getPartnerId); + queryWrapperWork.last("limit 1"); PartnerWorker worker = partnerWorkerService.getOne(queryWrapperWork); if (ObjectUtil.isEmpty(worker)){ throw new Exception("信息有误"); @@ -1465,6 +1469,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl workNodes = inspectionWorkNodeService.getWeorkNodesById(Integer.parseInt(String.valueOf(inspectionInfoId))); + res.setWorkNodes(workNodes); return res; } 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 986eb6a0..38349e98 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 @@ -161,6 +161,9 @@ public class InspectionFileServiceImpl extends ServiceImpl selectInspectionFileList(Page page, InspectionFile inspectionFile) { // 创建一个空的 QueryWrapper QueryWrapper queryWrapper = new QueryWrapper<>(); + if (ObjectUtil.isNotEmpty(inspectionFile.getFatherId())) { + queryWrapper.eq("father_id", inspectionFile.getFatherId()); + } // 直接调用 MyBatis-Plus 的 page 方法进行分页查询 return this.page(page, queryWrapper); // 返回符合条件的分页查询结果 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 f8c760a0..12e01f87 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 @@ -14,6 +14,7 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; 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.appBase.controller.admin.InspectionSocket; import cn.iocoder.yudao.module.custom.entity.CustomerMain; import cn.iocoder.yudao.module.custom.service.CustomerMainService; @@ -54,6 +55,8 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import static cn.iocoder.yudao.framework.common.config.CommonStr.USER_TYPE_CUS; + /** * 【请填写功能名称】Service业务层处理 * @@ -137,13 +140,14 @@ public class InspectionInfoServiceImpl extends ServiceImpl listByUserId = roleService.getListByUserId(roleId); List ids = listByUserId.stream().map(UserDTO::getId).collect(Collectors.toList()); - ids.add(inspectionInfo.getLeadManId()); + if (ObjectUtil.isNotNull(inspectionInfo.getLeadManId())) { + ids.add(inspectionInfo.getLeadManId()); + } + //给ids去重 + ids = ids.stream().distinct().collect(Collectors.toList()); // 获取当前共单引车员的id if (CollUtil.isNotEmpty(ids)) { for (Long id : ids) { @@ -267,6 +277,12 @@ public class InspectionInfoServiceImpl extends ServiceImpl workerQueryWrapper = new LambdaQueryWrapper<>(); workerQueryWrapper.eq(PartnerWorker::getUserId, loginUser.getId()).eq(PartnerWorker::getPartnerId, partners.getPartnerId()); - PartnerWorker worker = workerService.getOne(workerQueryWrapper); +// PartnerWorker worker = workerService.getOne(workerQueryWrapper); AdminUserDO workerUser = userService.getUser(loginUser.getId()); // if (ObjectUtils.isNotEmpty(worker)) { inspectionInfo.setWorkId(workerUser.getId()); @@ -305,7 +321,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl getWeorkNodesById(Integer inspectionId) { return workNodeService.getWeorkNodesById(inspectionId); } + + /** + * 判断app当前检测人是否有审核权限 + * + * @return + */ + @Override + public Boolean isExamine() { + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + //获取当前登陆人的所有角色 + List userRoles = roleService.getByUserId(loginUser.getId()); + List userRoleIds = userRoles.stream().map(UserRoleDO::getRoleId).collect(Collectors.toList()); + List roleList = roleService.getRoleList(userRoleIds); + + //判断当前角色集合中的code是否包含jcyszz + if (CollectionUtil.isNotEmpty(roleList)) { + List filteredRoleList = roleList.stream() + .filter(role -> role.getCode().contains("jcsfdl")) + .collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(filteredRoleList)) { + return true; + } + } + return false; + } } 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 892ca88c..5851118f 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,26 +91,57 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl() - .eq(DlInspectionProject::getId, workNode.getProjectId())); +// //新增步骤 +// //根据projectId查询项目名称 +// DlInspectionProject project = inspectionProjectService.getOne(new LambdaQueryWrapper() +// .eq(DlInspectionProject::getId, workNode.getProjectId())); +// +// InspectionStepInfo inspectionStepInfo = new InspectionStepInfo(); +// inspectionStepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(inspectionInfo.getId()))); +// if (ObjectUtil.isNotNull(project)) { +// inspectionStepInfo.setTitle(project.getProjectName() + "项目开始检测"); +// } else { +// inspectionStepInfo.setTitle("项目检测开始"); +// } +// inspectionStepInfo.setCreateTime(DateUtil.date()); +// inspectionStepInfo.setCreator(Integer.parseInt(String.valueOf(workerUser.getId()))); +// inspectionStepService.save(inspectionStepInfo); + } - InspectionStepInfo inspectionStepInfo = new InspectionStepInfo(); - inspectionStepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(inspectionInfo.getId()))); - if (ObjectUtil.isNotNull(project)) { - inspectionStepInfo.setTitle(project.getProjectName() + "项目开始检测"); - } else { - inspectionStepInfo.setTitle("项目检测开始"); + /** + * 员工取消接单 + * + * @param inspectionId + * @param workNodeId + */ + @Override + public void cancelAnOrder(Integer inspectionId, String workNodeId) { + //获取当前登录人 + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + //当前登陆人 就是检测人 + AdminUserDO workerUser = userService.getUser(loginUser.getId()); + //根据工单id获取工单 + InspectionInfo inspectionInfo = inspectionInfoService.getById(inspectionId); + if (ObjectUtil.isNull(inspectionInfo)) { + throw new RuntimeException("工单不存在"); } - inspectionStepInfo.setCreateTime(DateUtil.date()); - inspectionStepInfo.setCreator(Integer.parseInt(String.valueOf(workerUser.getId()))); - inspectionStepService.save(inspectionStepInfo); + //根据流程id获取流程 + InspectionWorkNode workNode = this.getById(workNodeId); + if (ObjectUtil.isNull(workNode)) { + throw new RuntimeException("流程不存在"); + } + //判断当前流程节点的接单员是否是当前登陆人 + if (!workNode.getDealUserId().equals(workerUser.getId())) { + throw new RuntimeException("当前流程不是你接单的"); + } + // 更新流程 +// this.updateById(workNode); + baseMapper.cancelAnOrder(workNode); } /** @@ -142,13 +173,19 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(InspectionWorkNode::getInspectionInfoId, workNode.getInspectionInfoId()); + //是否还有进行中或者待开始的状态 + queryWrapper.in(InspectionWorkNode::getStatus, "0","1"); List inspectionWorkNodes = this.list(queryWrapper); - //判断当前是否是最后一个项目 根据顺序号判断 - boolean flag = hasNextNode(inspectionWorkNodes, workNode); + boolean flag = true; + //判断是否是最后一个流程 + if (inspectionWorkNodes.size() == 1 && inspectionWorkNodes.get(0).getId().equals(workNode.getId())){ + flag = false; + } + // 插入步骤信息 InspectionStepInfo inspectionStepInfo = new InspectionStepInfo(); @@ -159,7 +196,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl listByUserId = roleService.getListByUserId(nextNode.getRoleId()); - List ids = listByUserId.stream().map(UserDTO::getId).collect(Collectors.toList()); - if (ObjectUtil.isNotNull(inspectionInfo.getLeadManId())){ - ids.add(inspectionInfo.getLeadManId()); - } - sendSocketMessage(ids); } +// else { +// //修改工单表当前流程 +// inspectionInfo.setNowOrderNum(workNode.getOrderNum() + 1); +// //获取下一节点 +// InspectionWorkNode nextNode = getNextNode(inspectionWorkNodes, workNode); +// /*给下一单人员发送信息*/ +// List listByUserId = roleService.getListByUserId(nextNode.getRoleId()); +// List ids = listByUserId.stream().map(UserDTO::getId).collect(Collectors.toList()); +// if (ObjectUtil.isNotNull(inspectionInfo.getLeadManId())){ +// ids.add(inspectionInfo.getLeadManId()); +// } +// sendSocketMessage(ids); +// } //将节点状态改为已完成 inspectionWorkNode.setStatus("2"); @@ -264,6 +303,38 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl categoryList() throws Exception { ShopMallPartners one = appInspectionPartnerService.shopInfoByUserId(); List shopInspectionCategories = appInspectionPartnerService.categoryList(one.getPartnerId()); - for (ShopInspectionCategory shopInspectionCategory : shopInspectionCategories) { - LambdaQueryWrapper templateLambdaQueryWrapper =new LambdaQueryWrapper<>(); - templateLambdaQueryWrapper.eq(InspectionCategoryTemplate::getCategoryId,shopInspectionCategory.getId()).orderByAsc(InspectionCategoryTemplate::getSkuPrice); - List list = categoryTemplateService.list(templateLambdaQueryWrapper); - shopInspectionCategory.setTemplates(list); + if (CollectionUtil.isNotEmpty(shopInspectionCategories)) { + for (ShopInspectionCategory shopInspectionCategory : shopInspectionCategories) { + LambdaQueryWrapper templateLambdaQueryWrapper = new LambdaQueryWrapper<>(); + templateLambdaQueryWrapper.eq(InspectionCategoryTemplate::getCategoryId, shopInspectionCategory.getId()).orderByAsc(InspectionCategoryTemplate::getSkuPrice); + List list = categoryTemplateService.list(templateLambdaQueryWrapper); + shopInspectionCategory.setTemplates(list); + } } return shopInspectionCategories; } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/vo/InspectionInfoVo.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/vo/InspectionInfoVo.java index e9f74d4b..d56a29b0 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/vo/InspectionInfoVo.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/vo/InspectionInfoVo.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.inspection.vo; +import cn.iocoder.yudao.module.inspection.entity.InspectionWorkNode; import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; import cn.iocoder.yudao.annotation.Excel; @@ -85,4 +86,8 @@ public class InspectionInfoVo { /*引车员名字*/ private String leadManName; + @TableField(exist = false) + List workNodes; + @TableField(exist = false) + private Long leadManId; } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/service/impl/PartnerCustomerInfoServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/service/impl/PartnerCustomerInfoServiceImpl.java index 1dfda244..4948842b 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/service/impl/PartnerCustomerInfoServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/service/impl/PartnerCustomerInfoServiceImpl.java @@ -65,12 +65,6 @@ public class PartnerCustomerInfoServiceImpl extends ServiceImpl + + UPDATE inspection_work_node + SET status = '0', deal_user_id = null, deal_user_name = null, deal_images = null, remark = null + WHERE id = #{id} AND inspection_info_id = #{inspectionInfoId} + + + UPDATE inspection_work_node + SET status = '0', deal_user_id = null, deal_user_name = null, deal_images = null, remark = null + WHERE id in ( + + #{item.id} + + ) + @@ -45,8 +45,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -267,43 +269,56 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by ins.start_time desc - diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueDriverInfoServiceImpl.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueDriverInfoServiceImpl.java index 73941d43..5a7a7aa1 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueDriverInfoServiceImpl.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueDriverInfoServiceImpl.java @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.rescue.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.CoordinateUtil; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.http.HttpUtil; import cn.iocoder.yudao.module.custom.entity.CarMain; import cn.iocoder.yudao.module.custom.entity.CustomerMain; @@ -591,27 +592,34 @@ public class RescueDriverInfoServiceImpl extends ServiceImpl { int updateSetOpenId(@Param("userId")Long userId,@Param("openId")String openId); int updateCusInfo(@Param("entity") UserInfoVO userInfoVO); + + AdminUserDO getUserByMobileTenantIgnore(String mobile); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java index da700a1d..a5bb2740 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java @@ -123,4 +123,5 @@ public interface DictDataService { **/ List getDictDataListById(List dataIds); + void deleteDictDataBatch(List dictIds); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java index dbabe2ec..67e6fafd 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java @@ -202,4 +202,10 @@ public class DictDataServiceImpl implements DictDataService { return dictDataMapper.selectList(new LambdaQueryWrapperX().in(DictDataDO::getId, dataIds)); } + @Override + public void deleteDictDataBatch(List dictIds) { + // 删除字典数据 + dictDataMapper.deleteByIds(dictIds); + } + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java index f32ed626..501dbc50 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java @@ -145,6 +145,13 @@ public interface AdminUserService extends IService { * @return 用户对象信息 */ AdminUserDO getUserByMobile(String mobile); + /** + * 通过手机号获取用户(不带租户id) + * + * @param mobile 手机号 + * @return 用户对象信息 + */ + AdminUserDO getUserByMobileTenantIgnore(String mobile); /** * 获得用户分页列表 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java index 53b12a1a..ec2e2a17 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java @@ -303,6 +303,11 @@ public class AdminUserServiceImpl extends ServiceImpl getUserPage(UserPageReqVO reqVO) { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/SysUserMapper.xml b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/SysUserMapper.xml index 40cb035c..dfcc0539 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/SysUserMapper.xml +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/SysUserMapper.xml @@ -75,4 +75,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND deleted = 0 limit 1 + diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/UserRoleMapper.xml b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/UserRoleMapper.xml index 7525388f..7e1c4ae1 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/UserRoleMapper.xml +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/UserRoleMapper.xml @@ -21,9 +21,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"