From 1bcb56cdad058478be0d9687d8a8a445de17b6a3 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 10 四月 2025 11:24:11 +0800
Subject: [PATCH] 代码初始化
---
server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java | 51 +++++++++++++++++++++++++--------------------------
1 files changed, 25 insertions(+), 26 deletions(-)
diff --git a/server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java b/server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java
index 6a03643..b9bddd8 100644
--- a/server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java
+++ b/server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java
@@ -80,7 +80,7 @@
//澶勭悊浜哄憳绫讳俊鎭�
this.dealNoticeData(workorder);
//澶勭悊SHE浜嬩欢鐘舵��
- workorder.setStatus(Constants.equalsInteger(workorder.getType(),Constants.ZERO)?Constants.workOrderStatus.close:Constants.workOrderStatus.waitConfirm);
+ workorder.setStatus(Constants.equalsInteger(workorder.getType(),Constants.ZERO)?Constants.WorkOrderStatus.close.getKey():Constants.WorkOrderStatus.waitConfirm.getKey());
workorderMapper.insert(workorder);
//瀛樺偍DCA 闂璁板綍琛�
this.saveProblemData(workorder);
@@ -92,7 +92,6 @@
return workorder.getId();
}
-
public void dealLogData(Workorder workorder){
//澶勭悊涓婃姤鏃ュ織 DCA宸ュ崟 鏃ュ織瀛樺偍鑷冲瓙涓氬姟 涓嶅瓨鍦ㄤ簬鐖剁骇
@@ -284,7 +283,7 @@
.selectAll(Workorder.class)
.selectAs(Member::getPhone,Workorder::getMemberPhone)
.selectAs(Member::getName,Workorder::getMemberName)
- .selectAs(Workorder::getCompanyName,Workorder::getCompanyName)
+ .selectAs(Member::getCompanyName,Workorder::getCompanyName)
.select(" c3.name ",Workorder::getTypeName)
.select(" c4.name ",Workorder::getProblemName)
.leftJoin(Member.class,Member::getId,Workorder::getMemberId)
@@ -513,29 +512,29 @@
if(Constants.equalsInteger(workorder.getType(),Constants.ZERO)){
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"SHE宸ュ崟鏃犳硶杩涜璇ユ搷浣�");
}
- if(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.sheClose)||Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.wtsClose)||Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.close)){
+ if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.sheClose.getKey())||Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.wtsClose.getKey())||Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.close.getKey())){
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"宸ュ崟鐘舵�佸凡娴佽浆");
}
//鎻愪氦鍚庣殑 寰呯‘璁�/寰呭垵瀹$姸鎬� 濡傛灉鍘诲叧闂� 鍙湁宸ュ崟閲岀粦瀹氱殑SHE浜哄憳鍙互鍏抽棴
- if(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitConfirm)){
+ if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitConfirm.getKey())){
//鍒ゆ柇SHE浜哄憳鍐呮槸鍚︽湁褰撳墠鐧诲綍璐﹀彿
if(workorder.getQwnoticeMemberIds().indexOf(closeDTO.getMember().getQwId())<Constants.ZERO){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝褰撳墠宸ュ崟闈炴偍鐨勫伐鍗曪紝鏃犳硶杩涜澶勭悊");
}
- workorder.setStatus(Constants.workOrderStatus.sheClose);
- }else if(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitAllocation)){
+ workorder.setStatus(Constants.WorkOrderStatus.sheClose.getKey());
+ }else if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey())){
//鍒ゆ柇SHE浜哄憳鍐呮槸鍚︽湁褰撳墠鐧诲綍璐﹀彿
if(workorder.getQwnoticeMemberIds().indexOf(closeDTO.getMember().getQwId())<Constants.ZERO && !workorder.getManagerId().equals(closeDTO.getMember().getQwId())){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝褰撳墠宸ュ崟闈炴偍鐨勫伐鍗曪紝鏃犳硶杩涜澶勭悊");
}
- workorder.setStatus(Constants.workOrderStatus.wtsClose);
- }else if(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitDeal)){
+ workorder.setStatus(Constants.WorkOrderStatus.wtsClose.getKey());
+ }else if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitDeal.getKey())){
//鍒ゆ柇SHE浜哄憳鍐呮槸鍚︽湁褰撳墠鐧诲綍璐﹀彿
if(workorder.getQwnoticeMemberIds().indexOf(closeDTO.getMember().getQwId())<Constants.ZERO && !workorder.getManagerId().equals(closeDTO.getMember().getQwId())
&& !workorder.getDealerId().equals(closeDTO.getMember().getQwId()) ){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝褰撳墠宸ュ崟闈炴偍鐨勫伐鍗曪紝鏃犳硶杩涜澶勭悊");
}
- workorder.setStatus(Constants.workOrderStatus.wtsClose);
+ workorder.setStatus(Constants.WorkOrderStatus.wtsClose.getKey());
}else{
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"宸ュ崟鐘舵�佸凡娴佽浆");
}
@@ -578,18 +577,18 @@
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"SHE宸ュ崟鏃犳硶杩涜璇ユ搷浣�");
}
if(Constants.equalsInteger(passOnDTO.getPassOnType(),Constants.ZERO)){
- if(!Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitConfirm)){
+ if(!Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitConfirm.getKey())){
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"宸ュ崟鐘舵�佸凡娴佽浆");
}
workorder.setManagerId(member.getQwId());
- workorder.setStatus(Constants.workOrderStatus.waitAllocation);
+ workorder.setStatus(Constants.WorkOrderStatus.waitAllocation.getKey());
}else{
- if(!(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitAllocation)
- || Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitDeal))){
+ if(!(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey())
+ || Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitDeal.getKey()))){
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"宸ュ崟鐘舵�佸凡娴佽浆");
}
workorder.setDealerId(member.getQwId());
- workorder.setStatus(Constants.workOrderStatus.waitDeal);
+ workorder.setStatus(Constants.WorkOrderStatus.waitDeal.getKey());
}
workorder.setEditDate(new Date());
workorder.setUrgeDate(DateUtil.afterHoursDate(new Date(),24));
@@ -624,9 +623,9 @@
}
Member urgeUser = new Member();
//濡傛灉宸插垎閰� wts 鍒欐槸鍌績wts
- if(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitAllocation)){
+ if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey())){
urgeUser = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getIsdeleted,Constants.ZERO).eq(Member::getQwId,workorder.getManagerId()).last("limit 1 "));
- }else if(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitAllocation)){
+ }else if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey())){
urgeUser = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getIsdeleted,Constants.ZERO).eq(Member::getQwId,workorder.getDealerId()).last("limit 1 "));
}else{
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鐘舵�佸凡娴佽浆鏃犳硶杩涜璇ユ搷浣�");
@@ -642,7 +641,7 @@
@Override
public void jobUrge(){
List<Workorder> workorderList = workorderMapper.selectList(new QueryWrapper<Workorder>().lambda().eq(Workorder::getIsdeleted,Constants.ZERO)
- .in(Workorder::getStatus,Constants.workOrderStatus.waitAllocation,Constants.workOrderStatus.waitDeal)
+ .in(Workorder::getStatus,Constants.WorkOrderStatus.waitAllocation.getKey(),Constants.WorkOrderStatus.waitDeal.getKey())
.apply(" urge_time > now() ")
);
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(workorderList)){
@@ -663,9 +662,9 @@
}
Member urgeUser = new Member();
//濡傛灉宸插垎閰� wts 鍒欐槸鍌績wts
- if(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitAllocation)){
+ if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey())){
urgeUser = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getIsdeleted,Constants.ZERO).eq(Member::getQwId,workorder.getManagerId()).last("limit 1 "));
- }else if(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitAllocation)){
+ }else if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey())){
urgeUser = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getIsdeleted,Constants.ZERO).eq(Member::getQwId,workorder.getDealerId()).last("limit 1 "));
}else{
return;
@@ -702,9 +701,9 @@
workOrderDataVO.setTotal(Constants.ZERO);
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(dataList)){
workOrderDataVO.setTotal(dataList.size());
- workOrderDataVO.setGcsTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.workOrderStatus.close)).collect(Collectors.toList()).size());
- workOrderDataVO.setSheTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.workOrderStatus.sheClose)).collect(Collectors.toList()).size());
- workOrderDataVO.setWtsTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.workOrderStatus.wtsClose)).collect(Collectors.toList()).size());
+ workOrderDataVO.setGcsTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.WorkOrderStatus.close.getKey())).collect(Collectors.toList()).size());
+ workOrderDataVO.setSheTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.WorkOrderStatus.sheClose.getKey())).collect(Collectors.toList()).size());
+ workOrderDataVO.setWtsTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.WorkOrderStatus.wtsClose.getKey())).collect(Collectors.toList()).size());
workOrderDataVO.setUnCloseTotal(workOrderDataVO.getTotal() - workOrderDataVO.getSheTotal() - workOrderDataVO.getWtsTotal() - workOrderDataVO.getGcsTotal());
}
workOrderDataVOList.add(workOrderDataVO);
@@ -735,9 +734,9 @@
workOrderDataVO.setTotal(Constants.ZERO);
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(dataList)){
workOrderDataVO.setTotal(dataList.size());
- workOrderDataVO.setGcsTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.workOrderStatus.close)).collect(Collectors.toList()).size());
- workOrderDataVO.setSheTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.workOrderStatus.sheClose)).collect(Collectors.toList()).size());
- workOrderDataVO.setWtsTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.workOrderStatus.wtsClose)).collect(Collectors.toList()).size());
+ workOrderDataVO.setGcsTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.WorkOrderStatus.close.getKey())).collect(Collectors.toList()).size());
+ workOrderDataVO.setSheTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.WorkOrderStatus.sheClose.getKey())).collect(Collectors.toList()).size());
+ workOrderDataVO.setWtsTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.WorkOrderStatus.wtsClose.getKey())).collect(Collectors.toList()).size());
workOrderDataVO.setUnCloseTotal(workOrderDataVO.getTotal() - workOrderDataVO.getSheTotal() - workOrderDataVO.getWtsTotal() - workOrderDataVO.getGcsTotal());
}
workOrderDataVOList.add(workOrderDataVO);
--
Gitblit v1.9.3