From 83752d4331f55401616b731a5e87f899b2795c42 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 22 四月 2025 15:50:07 +0800
Subject: [PATCH] 代码初始化
---
server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java | 101 ++++++++++++++++++++++++++++++++------------------
1 files changed, 65 insertions(+), 36 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 9288568..1a32444 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
@@ -406,8 +406,8 @@
*/
public Integer saveLog(String beforeJson,Workorder afterWorkorder,Integer objType,Integer memberId,String title,String content,String paramr2){
WorkorderLog workorderLog = new WorkorderLog();
- workorderLog.setCreateDate(afterWorkorder.getCreateDate());
- workorderLog.setEditDate(afterWorkorder.getCreateDate());
+ workorderLog.setCreateDate(afterWorkorder.getEditDate());
+ workorderLog.setEditDate(afterWorkorder.getEditDate());
workorderLog.setIsdeleted(Constants.ZERO);
workorderLog.setBeforeContent(beforeJson);
workorderLog.setAfterContent(JSONObject.toJSONString(afterWorkorder));
@@ -857,7 +857,7 @@
}
workorder.setStatus(Constants.WorkOrderStatus.wtsClose.getKey());
qwIds.addAll(Arrays.asList(workorder.getQwnoticeMemberIds().split(",")));
- qwIds.add(workorder.getDealerId());
+ qwIds.add(workorder.getManagerId());
qwIds.remove(closeDTO.getMember().getQwId());
}else{
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"宸ュ崟鐘舵�佸凡娴佽浆");
@@ -867,7 +867,7 @@
workorder.setDealInfo(closeDTO.getInfo());
workorderMapper.updateById(workorder);
//澶勭悊涓婃姤鏃ュ織
- Integer logId = this.saveLog(beforeJson,workorder,Constants.THREE,workorder.getMemberId(),"浠诲姟宸插鐞�",closeDTO.getInfo(),null);
+ Integer logId = this.saveLog(beforeJson,workorder,Constants.THREE,closeDTO.getMember().getId(),"浠诲姟宸插鐞�",closeDTO.getInfo(),null);
List<Multifile> multifileList = closeDTO.getMultifileList();
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){
for (Multifile multifile:multifileList) {
@@ -933,7 +933,7 @@
//澶勭悊涓婃姤鏃ュ織
Integer logId = this.saveLog(beforeJson,workorder,
Constants.equalsInteger(passOnDTO.getPassOnType(),Constants.ZERO)?Constants.ONE:Constants.TWO
- ,workorder.getMemberId(),"浠诲姟鍒嗛厤",passOnDTO.getInfo(),paramr2);
+ ,passOnDTO.getMember().getId(),"浠诲姟鍒嗛厤",passOnDTO.getInfo(),paramr2);
List<Multifile> multifileList = passOnDTO.getMultifileList();
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){
for (Multifile multifile:multifileList) {
@@ -1330,10 +1330,13 @@
@Override
public WorkorderIndexNumVO getIndexData(Workorder workorder) {
WorkorderIndexNumVO model = new WorkorderIndexNumVO();
+ Date startdate = getStartDateByType(workorder.getTimeType());
//鏌ヨ浠婂勾鎵�鏈夌殑鏁版嵁
List<Workorder> list = workorderMapper.selectJoinList(Workorder.class,new MPJLambdaWrapper<Workorder>()
.select("type,count(id) as num")
.eq(Workorder::getIsdeleted,Constants.ZERO)
+ .ge(startdate!=null,Workorder::getCreateDate,startdate)
+// .lt(endDate!=null,Workorder::getCreateDate,endDate)
.groupBy(Workorder::getType ));
if(list !=null){
for(Workorder w : list){
@@ -1352,34 +1355,12 @@
}
}
}
- List<Workorder> todays = workorderMapper.selectJoinList(Workorder.class,new MPJLambdaWrapper<Workorder>()
- .select("type,count(id) as num")
- .eq(Workorder::getIsdeleted,Constants.ZERO)
- .apply("to_days(create_date)=to_days(now())")
- .groupBy(Workorder::getType ));
- if(todays !=null){
- for(Workorder w : todays){
- if(Constants.equalsInteger(w.getType(),Constants.ZERO)){
- //SHE
- model.setTodaySheNum(Constants.formatLongNum(w.getNum()));
- }else if(Constants.equalsInteger(w.getType(),Constants.ONE)){
- //DCA鎻愪氦鏁�
- model.setTodayDcaNum(Constants.formatLongNum(w.getNum()));
- }else if(Constants.equalsInteger(w.getType(),Constants.TWO)){
- //DCA瀛愬伐鍗�
- model.setTodayDcaChildNum(Constants.formatLongNum(w.getNum()));
- }else if(Constants.equalsInteger(w.getType(),Constants.THREE)){
- //璺岀粖婊�
- model.setTodayDbhNum(Constants.formatLongNum(w.getNum()));
- }
- }
- }
-
List<Workorder> yeslist = workorderMapper.selectJoinList(Workorder.class,new MPJLambdaWrapper<Workorder>()
.select("type,count(id) as num")
.eq(Workorder::getIsdeleted,Constants.ZERO)
.in(Workorder::getStatus,Constants.THREE,Constants.FOUR,Constants.FIVE)
.in(Workorder::getType,Constants.THREE,Constants.TWO)
+ .ge(startdate!=null,Workorder::getCreateDate,startdate)
.groupBy(Workorder::getType ));
if(yeslist !=null){
for(Workorder w : yeslist){
@@ -1394,16 +1375,64 @@
}
}
}
- Workorder dcaList = workorderMapper.selectJoinOne(Workorder.class,new MPJLambdaWrapper<Workorder>()
- .select("sum(dca_yes_num) as dcaYesNum,sum(dca_no_num) as dcaNoNum")
- .eq(Workorder::getIsdeleted,Constants.ZERO)
- .eq(Workorder::getType,Constants.ONE) );
- if(dcaList !=null){
- //DCA绗﹀悎椤瑰拰涓嶇鍚堥」缁熻
- model.setDcaYesNum((long)Constants.formatIntegerNum(dcaList.getDcaYesNum()));
- model.setDcaNoNum((long)Constants.formatIntegerNum(dcaList.getDcaNoNum()));
+ if(workorder.getTimeType() == null){
+ List<Workorder> todays = workorderMapper.selectJoinList(Workorder.class,new MPJLambdaWrapper<Workorder>()
+ .select("type,count(id) as num")
+ .eq(Workorder::getIsdeleted,Constants.ZERO)
+ .apply("to_days(create_date)=to_days(now())")
+ .groupBy(Workorder::getType ));
+ if(todays !=null){
+ for(Workorder w : todays){
+ if(Constants.equalsInteger(w.getType(),Constants.ZERO)){
+ //SHE
+ model.setTodaySheNum(Constants.formatLongNum(w.getNum()));
+ }else if(Constants.equalsInteger(w.getType(),Constants.ONE)){
+ //DCA鎻愪氦鏁�
+ model.setTodayDcaNum(Constants.formatLongNum(w.getNum()));
+ }else if(Constants.equalsInteger(w.getType(),Constants.TWO)){
+ //DCA瀛愬伐鍗�
+ model.setTodayDcaChildNum(Constants.formatLongNum(w.getNum()));
+ }else if(Constants.equalsInteger(w.getType(),Constants.THREE)){
+ //璺岀粖婊�
+ model.setTodayDbhNum(Constants.formatLongNum(w.getNum()));
+ }
+ }
+ }
+ Workorder dcaList = workorderMapper.selectJoinOne(Workorder.class,new MPJLambdaWrapper<Workorder>()
+ .select("sum(dca_yes_num) as dcaYesNum,sum(dca_no_num) as dcaNoNum")
+ .eq(Workorder::getIsdeleted,Constants.ZERO)
+ .eq(Workorder::getType,Constants.ONE) );
+ if(dcaList !=null){
+ //DCA绗﹀悎椤瑰拰涓嶇鍚堥」缁熻
+ model.setDcaYesNum((long)Constants.formatIntegerNum(dcaList.getDcaYesNum()));
+ model.setDcaNoNum((long)Constants.formatIntegerNum(dcaList.getDcaNoNum()));
+ }
}
+
+
+
return model;
}
+ private Date getStartDateByType(Integer timeType) {
+ Date date = null;
+ if(timeType == null){
+ return null;
+ } else if (timeType == 0) {
+ //鏈懆
+ date = DateUtil.getBeginDayOfWeek(0);
+ }else if (timeType == 1) {
+ //鏈湀
+ date = DateUtil.getBeginDayOfMonth(0);
+ }else if (timeType == 2) {
+ //鏈搴�
+ date = DateUtil.getBeginDayOfSeason(0);
+ }else if (timeType == 3) {
+ //鏈勾
+ date = DateUtil.getBeginDayOfYear(0);
+ }
+
+ return date;
+ }
+
}
--
Gitblit v1.9.3