diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java index 842a17eb5..30ac7da2e 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java @@ -102,7 +102,7 @@ public class AftersalesWorkOrderController extends BladeController { IPage pages = aftersalesWorkOrderService.page(Condition.getPage(query), Condition.getQueryWrapper(aftersalesWorkOrder, AftersalesWorkOrderEntity.class)); return R.data(AftersalesWorkOrderWrapper.build().pageVO(pages)); }catch (Exception e ){ - log.info("工单查询系统异常》》》{}",e.getMessage()); + log.error("工单查询系统异常》》》{}",e.getMessage()); return R.fail("系统异常!"); } @@ -120,7 +120,7 @@ public class AftersalesWorkOrderController extends BladeController { IPage pages = aftersalesWorkOrderService.pageListOwn(aftersalesWorkOrder, Condition.getPage(query)); return R.data(AftersalesWorkOrderWrapper.build().pageVO(pages)); }catch (Exception e){ - log.info("工单查询系统异常》》》{}",e.getMessage()); + log.error("工单查询系统异常》》》{}",e.getMessage()); return R.fail("系统异常!"); } @@ -143,7 +143,7 @@ public class AftersalesWorkOrderController extends BladeController { IPage pages = aftersalesWorkOrderService.getListSettlement(aftersalesWorkOrder, Condition.getPage(query)); return R.data(pages); }catch(Exception e){ - log.info("查询异常工单理赔信息>>{}",e.getMessage()); + log.error("查询异常工单理赔信息>>{}",e.getMessage()); return R.fail("系统异常"); } @@ -165,8 +165,10 @@ public class AftersalesWorkOrderController extends BladeController { } try { return R.status(aftersalesWorkOrderService.addProcessingResults(aftersalesWorkOrderDTO)); + }catch (ServiceException s){ + return R.fail(s.getMessage()); }catch(Exception e){ - log.info("营业部提交异常工单处理结果>>>{}",e.getMessage()); + log.error("营业部提交异常工单处理结果>>>{}",e.getMessage()); return R.fail("系统异常!!"); } @@ -211,7 +213,7 @@ public class AftersalesWorkOrderController extends BladeController { List list = aftersalesWorkOrderService.getCustomerServicePersonnel(); return R.data(list); }catch(Exception e){ - log.info("查询客服人员信息>>>>{}",e.getMessage()); + log.error("查询客服人员信息>>>>{}",e.getMessage()); return R.fail("系统异常!!"); } @@ -237,11 +239,10 @@ public class AftersalesWorkOrderController extends BladeController { throw new ServiceException("内容不能为空!!"); } return R.status(aftersalesWorkOrderService.savaSurveyRecord(aftersalesWorkOrderDTO)); - }catch (RuntimeException e ){ - log.info("内容不能为空!!"); - throw new ServiceException("内容不能为空!!"); + }catch (ServiceException s){ + return R.fail(s.getMessage()); }catch (Exception e){ - log.info(">新增调查记录>>{}",e.getMessage()); + log.error(">新增调查记录>>{}",e.getMessage()); return R.fail("系统异常!!"); } } @@ -262,7 +263,7 @@ public class AftersalesWorkOrderController extends BladeController { AftersalesWorkOrderVO list = aftersalesWorkOrderService.getSurveyRecord(aftersalesWorkOrderDTO); return R.data(list); }catch(Exception e){ - log.info("查询调查记录>>>{}",e.getMessage()); + log.error("查询调查记录>>>{}",e.getMessage()); return R.fail("系统异常!!!"); } @@ -285,7 +286,7 @@ public class AftersalesWorkOrderController extends BladeController { AftersalesWorkOrderVO list = aftersalesWorkOrderService.getTrackRecord(aftersalesWorkOrderDTO); return R.data(list); }catch (Exception e){ - log.info("查询全部跟踪记录>>>{}",e.getMessage()); + log.error("查询全部跟踪记录>>>{}",e.getMessage()); return R.fail("系统异常!!!"); } } @@ -302,7 +303,7 @@ public class AftersalesWorkOrderController extends BladeController { List list = aftersalesWorkOrderService.getBusinessDepartmentUser(warehouseId); return R.data(list); }catch(Exception e){ - log.info("查询营业部责任人人员信息》》{}",e.getMessage()); + log.error("查询营业部责任人人员信息》》{}",e.getMessage()); return R.fail("系统异常!!!"); } @@ -325,8 +326,10 @@ public class AftersalesWorkOrderController extends BladeController { try{ R r = aftersalesWorkOrderService.updateAssignCustomerService(aftersalesWorkOrderDTO); return R.success("提交成功!"); + }catch (ServiceException s){ + return R.fail(s.getMessage()); }catch (Exception e){ - log.info("异常工单分配处理客服信息》》》{}",e.getMessage()); + log.error("异常工单分配处理客服信息》》》{}",e.getMessage()); return R.fail("系统异常!!"); } @@ -349,8 +352,10 @@ public class AftersalesWorkOrderController extends BladeController { try { R r = aftersalesWorkOrderService.updateAssignArbitrateService(aftersalesWorkOrderDTO); return R.success("提交成功!"); + }catch (ServiceException s){ + return R.fail(s.getMessage()); }catch (Exception e){ - log.info("异常工单仲裁 分配处理客服信息>>{}",e.getMessage()); + log.error("异常工单仲裁 分配处理客服信息>>{}",e.getMessage()); return R.fail("系统异常!!"); } @@ -389,8 +394,10 @@ public class AftersalesWorkOrderController extends BladeController { public R addCompletionEnd(@Valid @RequestBody List aftersalesWorkOrder) { try { return R.status(aftersalesWorkOrderService.addCompletionEnd(aftersalesWorkOrder)); + }catch (ServiceException s){ + return R.fail(s.getMessage()); }catch (Exception e){ - log.info("客服完结处理>>>{}",e.getMessage()); + log.error("客服完结处理>>>{}",e.getMessage()); return R.fail("系统异常!!"); } @@ -409,8 +416,10 @@ public class AftersalesWorkOrderController extends BladeController { } try { return R.status(aftersalesWorkOrderService.updateCompletionEnd(aftersalesWorkOrder)); - }catch (Exception e){ - log.info("修改完结处理》》》{}",e.getMessage()); + } catch (ServiceException s){ + return R.fail(s.getMessage()); + } catch (Exception e){ + log.error("修改完结处理》》》{}",e.getMessage()); return R.fail("系统异常!!!"); } @@ -432,8 +441,10 @@ public class AftersalesWorkOrderController extends BladeController { } try { return R.status(aftersalesWorkOrderService.updateByIdAppel(aftersalesAppeal)); + }catch (ServiceException s){ + return R.fail(s.getMessage()); }catch (Exception e){ - log.info("客服操作确定修改》》》{}",e.getMessage()); + log.error("客服操作确定修改》》》{}",e.getMessage()); return R.fail("系统异常!!"); } @@ -453,7 +464,7 @@ public class AftersalesWorkOrderController extends BladeController { AftersalesWorkOrderVO workOrderVO = aftersalesWorkOrderService.getProcessingResults(aftersalesWorkOrder); return R.data(workOrderVO); }catch (Exception e){ - log.info("查询详情全部信息数据》》》{}",e.getMessage()); + log.error("查询详情全部信息数据》》》{}",e.getMessage()); return R.fail("系统异常!!!"); } @@ -472,8 +483,10 @@ public class AftersalesWorkOrderController extends BladeController { } try { return R.status(aftersalesWorkOrderService.updateArbitrate(aftersalesWorkOrder)); + }catch (ServiceException s){ + return R.fail(s.getMessage()); }catch (Exception e){ - log.info("申请仲裁》》》{}",e.getMessage()); + log.error("申请仲裁》》》{}",e.getMessage()); return R.fail("系统异常!!!"); } @@ -492,8 +505,10 @@ public class AftersalesWorkOrderController extends BladeController { } try { return R.status(aftersalesWorkOrderService.addArbitrateEnd(aftersalesWorkOrder)); + }catch (ServiceException s){ + return R.fail(s.getMessage()); }catch (Exception e){ - log.info("客服仲裁完结操作》》》{}",e.getMessage()); + log.error("客服仲裁完结操作》》》{}",e.getMessage()); return R.fail("系统异常!!"); } @@ -510,7 +525,7 @@ public class AftersalesWorkOrderController extends BladeController { try { return R.status(aftersalesWorkOrderService.updateById(aftersalesWorkOrder)); }catch (Exception e){ - log.info("工单修改异常》》》{}",e.getMessage()); + log.error("工单修改异常》》》{}",e.getMessage()); return R.fail("系统异常!!"); } @@ -530,8 +545,10 @@ public class AftersalesWorkOrderController extends BladeController { } try { return R.status( aftersalesWorkOrderService.updateManagerConfirmed(aftersalesWorkOrder) ); + }catch (ServiceException s){ + return R.fail(s.getMessage()); }catch (Exception e){ - log.info("客服经理确定数据》》》{}",e.getMessage()); + log.error("客服经理确定数据》》》{}",e.getMessage()); return R.fail("系统异常!!!"); } @@ -550,8 +567,10 @@ public class AftersalesWorkOrderController extends BladeController { } try { return R.status(aftersalesWorkOrderService.updateWorkOrderStatus(aftersalesWorkOrder)); + }catch (ServiceException s){ + return R.fail(s.getMessage()); }catch (Exception e){ - log.info("批量修改工单状态为已处理>>{}",e.getMessage()); + log.error("批量修改工单状态为已处理>>{}",e.getMessage()); return R.fail("系统异常!!!"); } @@ -570,8 +589,10 @@ public class AftersalesWorkOrderController extends BladeController { } try{ return aftersalesWorkOrderService.getUpdateWorkList(aftersalesWorkOrder); + }catch (ServiceException s){ + return R.fail(s.getMessage()); }catch (Exception e){ - log.info("填写钉钉流程号异常》》{}",e.getMessage()); + log.error("填写钉钉流程号异常》》{}",e.getMessage()); return R.fail("系统异常!!!"); } @@ -600,8 +621,10 @@ public class AftersalesWorkOrderController extends BladeController { try { aftersalesWorkOrder.setInitiationIdentification("PC"); return R.status(aftersalesWorkOrderService.saveOrUpdateOwn(aftersalesWorkOrder)); + }catch (ServiceException s){ + return R.fail(s.getMessage()); }catch (Exception e){ - log.info("工单提交异常》》》{}",e.getMessage()); + log.error("工单提交异常》》》{}",e.getMessage()); return R.fail("系统异常!!!"); } @@ -624,8 +647,10 @@ public class AftersalesWorkOrderController extends BladeController { try { IPage list= aftersalesWorkOrderService.getPendingWorkOrder(aftersalesWorkOrder,Condition.getPage(query)); return R.data(list); + }catch (ServiceException s){ + return R.fail(s.getMessage()); }catch (Exception e){ - log.info("仓库查询待处理的异常工单》》》{}",e.getMessage()); + log.error("仓库查询待处理的异常工单》》》{}",e.getMessage()); return R.fail("系统异常!!!"); } diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAppealMapper.xml b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAppealMapper.xml index 7d35a05b6..04d16d8a6 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAppealMapper.xml +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAppealMapper.xml @@ -51,6 +51,7 @@ lawo.discovery_node discoveryNode, laa.types_of typesOf, laa.work_order_id workOrderId + FROM logpm_aftersales_appeal laa LEFT JOIN logpm_aftersales_completion_record lacr on laa.work_order_id = lacr.work_order_id diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesOvertimeFineServiceImpl.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesOvertimeFineServiceImpl.java index 057b6573a..4dcce75fc 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesOvertimeFineServiceImpl.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesOvertimeFineServiceImpl.java @@ -17,12 +17,16 @@ package com.logpm.aftersales.service.impl; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.logpm.aftersales.dto.AftersalesOvertimeFineDTO; import com.logpm.aftersales.entity.AftersalesOvertimeFineEntity; import com.logpm.aftersales.vo.AftersalesOvertimeFineVO; import com.logpm.aftersales.excel.AftersalesOvertimeFineExcel; import com.logpm.aftersales.mapper.AftersalesOvertimeFineMapper; import com.logpm.aftersales.service.IAftersalesOvertimeFineService; +import com.logpm.basicdata.entity.BasicdataWarehouseEntity; +import com.logpm.basicdata.feign.IBasicdataWarehouseClient; +import lombok.AllArgsConstructor; import org.springblade.common.constant.DictBizConstant; import org.springblade.system.cache.DictBizCache; import org.springframework.stereotype.Service; @@ -39,8 +43,11 @@ import java.util.Map; * @since 2023-11-17 */ @Service +@AllArgsConstructor public class AftersalesOvertimeFineServiceImpl extends BaseServiceImpl implements IAftersalesOvertimeFineService { + private final IBasicdataWarehouseClient basicdataWarehouseClient; + @Override public IPage selectAftersalesOvertimeFinePage(IPage page, AftersalesOvertimeFineVO aftersalesOvertimeFine) { return page.setRecords(baseMapper.selectAftersalesOvertimeFinePage(page, aftersalesOvertimeFine)); @@ -65,7 +72,11 @@ public class AftersalesOvertimeFineServiceImpl extends BaseServiceImpl pageOwn(IPage page, Map queryWrapper) { + BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); + if(ObjectUtils.isNotNull(myCurrentWarehouse)){ + queryWrapper.put("businessId",myCurrentWarehouse.getId()); + } AftersalesOvertimeFineDTO aftersalesOvertimeFineDTO = JSONObject.parseObject(JSONObject.toJSONString(queryWrapper), AftersalesOvertimeFineDTO.class); IPage overtimeFineVOIPage = baseMapper.pageListOwn(page,aftersalesOvertimeFineDTO); //todo 处理数据 diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java index 351dea2b1..6af138330 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java @@ -680,7 +680,9 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl processorEntities = new ArrayList<>(); + String tenantId = null; for (AftersalesProcessorEntity i : processorEntityList) { + tenantId = i.getTenantId(); // 获取当前时间 LocalDateTime now = LocalDateTime.now(); // 获取48小时前的时间 @@ -692,11 +694,10 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl 0) { //已超时 processorEntities.add(i); - } else { - continue; } } if(!processorEntities.isEmpty()){ + String finalTenantId = tenantId; processorEntities.forEach(i ->{ // 假设有两个时间戳(秒数) @@ -743,6 +744,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl