From 55b98737d5c4240b8035914a15e6975a9a71b447 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 22 四月 2025 15:45:20 +0800
Subject: [PATCH] 代码初始化
---
server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java | 207 ++++++++++++++++++++++++++++++++-------------------
1 files changed, 129 insertions(+), 78 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 06e4bb2..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
@@ -24,6 +24,7 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.doumee.service.common.EmailService;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.sun.corba.se.spi.orbutil.threadpool.Work;
import lombok.extern.slf4j.Slf4j;
import org.apache.catalina.Manager;
import org.springframework.beans.factory.annotation.Autowired;
@@ -123,6 +124,9 @@
* @param csInfo 鎶勯�佷俊鎭�
*/
public void sendQwMsg(Workorder workorder,String qwIds,Member member,String categoryName,Integer contentType,String csInfo){
+ if(Constants.equalsInteger(workorder.getType(),Constants.TWO)){
+ workorder = workorderMapper.selectById(workorder.getDcaRecordId());
+ }
if(StringUtils.isEmpty(qwIds)){
return;
}
@@ -164,8 +168,10 @@
QywxTextCardMsgRequest textCard = new QywxTextCardMsgRequest();
String message = "";
String url = jumpUrl.replace("{corpId}",systemDictDataBiz.queryByCode(Constants.QYWX,Constants.QYWX_CORPID).getCode());
- String jumpOurUrl = systemDictDataBiz.queryByCode(Constants.QYWX,Constants.JUMP_OUT_URL).getCode().replace("{status}",workorder.getType()+"_"+workorder.getId());
+ String jumpOurUrl = systemDictDataBiz.queryByCode(Constants.QYWX,Constants.JUMP_OUT_URL).getCode().replace("{status}",
+ workorder.getType()+"_"+workorder.getId());
textCard.setUrl(url.replace("{ourUrl}",jumpOurUrl));
+ log.error("浼佸井閾炬帴鍦板潃"+url);
if(Constants.equalsInteger(workorder.getType(),Constants.ZERO)){
textCard.setTitle("銆怱HE浜嬩欢涓婃姤銆�");
if(Constants.equalsInteger(workorder.getMemberType(),Constants.ZERO)){
@@ -183,10 +189,10 @@
message = message + " <div class=\"normal\">"+ DateUtil.formatDate(new Date(),"yyyy-MM-dd HH:mm") +"/"+ workorder.getLocationName() +"/"+ categoryName+"</div>";
}else{
message = message + " <div class=\"normal\">"+ (org.apache.commons.lang3.StringUtils.isNotBlank(userName)?userName:"绯荤粺") + (Constants.equalsInteger(contentType,Constants.ZERO)?"浠诲姟鍒嗛厤缁欎綘":(Constants.equalsInteger(contentType,Constants.ONE)?"瀵硅宸ュ崟杩涜浜嗗偓淇冿紝璇峰敖蹇鐞�":((Constants.equalsInteger(contentType,Constants.TWO)?"鎶勯�佺粰浣�":"宸插鐞嗕竴椤�")))) +"</div>";
- message = message + " <div class=\"normal\">瑙傚療涓婚"+ categoryName +"</div>";
+ message = message + " <div class=\"normal\">瑙傚療涓婚 "+ categoryName +"</div>";
message = message + " <div class=\"normal\">绗﹀悎锛�"+ workorder.getDcaYesNum() +" 涓嶇鍚堬細"+workorder.getDcaNoNum()+"</div>";
if(Constants.equalsInteger(contentType,Constants.TWO)){
- message = message + " <div class=\"normal\">璇存槑锛�"+ csInfo +"</div>";
+ message = message + " <div class=\"normal\">璇存槑 "+ csInfo +"</div>";
}
}
textCard.setDescription(message);
@@ -266,6 +272,10 @@
workorderMapper.insert(dcaWorkOrder);
//瀛樺偍鏃ュ織
this.dealLogData(dcaWorkOrder,workOrderStatus);
+
+ //瀛樺偍寰呭姙浜哄憳淇℃伅
+ this.saveNotice(Arrays.asList(dcaWorkOrder.getQwnoticeMemberIds().split(",")),dcaWorkOrder.getId(),Constants.ZERO,Constants.ZERO);
+
List<Multifile> multifileList = dcaNoProblemDTO.getMultifileList();
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){
for (Multifile multifile:multifileList) {
@@ -392,12 +402,12 @@
* @param afterWorkorder
* @param objType 鎿嶄綔绫诲瀷 0浠诲姟涓婃姤 1浠诲姟鍒嗛厤鐗╀笟涓荤 2浠诲姟鍒嗛厤澶勭悊浜� 3浠诲姟澶勭悊鍏抽棴 4浠诲姟鍌績
* @param memberId
- * @param paramr2 澶勭悊浜�
+ * @param paramr2 杞氦缁欑殑澶勭悊浜�
*/
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));
@@ -490,6 +500,7 @@
if(Objects.isNull(workorder)){
throw new BusinessException(ResponseStatus.DATA_EMPTY);
}
+
this.dealButton(workorder,member);
//鏌ヨ闄勪欢淇℃伅
List<Multifile> multifileList = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda().eq(Multifile::getIsdeleted,Constants.ZERO)
@@ -504,15 +515,21 @@
}
workorder.setMultifileList(multifileList);
}
-
//鏌ヨ鏃ュ織淇℃伅
- workorder.setLogList(this.getLogList(workorder));
+ workorder.setLogList(this.getLogList(workorder,member));
if(Constants.equalsInteger(workorder.getType(),Constants.ONE)){
//濡傛灉鏄疍CA鎻愪氦璁板綍锛屾煡璇㈠瓙宸ュ崟闆嗗悎
Workorder param = new Workorder();
param.setIsdeleted(Constants.ZERO);
param.setDcaRecordId(workorder.getId());
- workorder.setDcaChildList(findList(param));
+ List<Workorder> dcaChildList = findList(param);
+ if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(dcaChildList)){
+ for (Workorder dcaChild:dcaChildList) {
+ this.dealButton(dcaChild,member);
+ }
+ workorder.setManagerId(dcaChildList.stream().filter(i->Objects.nonNull(i.getManagerId())).map(i->i.getManagerId()).collect(Collectors.joining(",")));
+ }
+ workorder.setDcaChildList(dcaChildList);
}
return workorder;
}
@@ -540,10 +557,13 @@
}
List<String> passOnUserList = new ArrayList<>();
//寰呭垎閰嶇姸鎬� 澶勭悊杞氦鎸夐挳
- if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitConfirm.getKey())&&Constants.equalsInteger(workorder.getStatus(),Constants.ZERO)){
+ if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitConfirm.getKey())
+ ){
passOnUserList.addAll(Arrays.asList(workorder.getQwnoticeMemberIds().split(",")));
- }else if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey())&&(Constants.equalsInteger(workorder.getStatus(),Constants.ONE)
- || Constants.equalsInteger(workorder.getStatus(),Constants.TWO))){
+ }
+ if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey())
+ || Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitDeal.getKey())
+ ){
passOnUserList.add(workorder.getManagerId());
}
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(passOnUserList)){
@@ -554,7 +574,7 @@
}
- public List<WorkorderLog> getLogList(Workorder workorder){
+ public List<WorkorderLog> getLogList(Workorder workorder,Member loginMember){
List<WorkorderLog> logList = workorderLogMapper.selectJoinList(WorkorderLog.class,
new MPJLambdaWrapper<WorkorderLog>()
.selectAll(WorkorderLog.class)
@@ -565,30 +585,35 @@
.orderByDesc(WorkorderLog::getId)
);
-
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(logList)){
String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode()
+systemDictDataBiz.queryByCode(Constants.FTP,Constants.WORKORDER_LOG_FILE_PATH).getCode();
Boolean canOpenUrgeButton = true;
for (WorkorderLog workorderLog:logList) {
workorderLog.setUrgeButton(Constants.ZERO);
- //鐗╀笟涓荤澶勭悊涓�
- if(Constants.equalsInteger(workorder.getStatus(),Constants.ONE)){
- Member member = memberMapper.selectById(workorderLog.getParam1());
- if(Objects.nonNull(member) && org.apache.commons.lang3.StringUtils.isNotBlank(member.getQwId())
- && workorder.getQwnoticeMemberIds().indexOf(member.getQwId())>=Constants.ZERO){
- workorderLog.setUrgeButton(Constants.ONE);
+ if(Constants.equalsInteger(workorderLog.getObjType(),Constants.TWO)||Constants.equalsInteger(workorderLog.getObjType(),Constants.ONE)){
+ //鐗╀笟涓荤澶勭悊涓�
+ if(Constants.equalsInteger(workorder.getStatus(),Constants.ONE)){
+ Member member = memberMapper.selectById(workorderLog.getParam1());
+ if(Objects.nonNull(member) && org.apache.commons.lang3.StringUtils.isNotBlank(member.getQwId())
+ && Objects.nonNull(loginMember) && Constants.equalsInteger(member.getId(),loginMember.getId())
+ && workorder.getQwnoticeMemberIds().indexOf(member.getQwId())>=Constants.ZERO){
+ workorderLog.setUrgeButton(Constants.ONE);
+ }
+ }
+ //宸ョ▼甯堝鐞嗕腑
+ if(Constants.equalsInteger(workorder.getStatus(),Constants.TWO)){
+ Member member = memberMapper.selectById(workorderLog.getParam1());
+ if(Objects.nonNull(member) && org.apache.commons.lang3.StringUtils.isNotBlank(member.getQwId())
+ && canOpenUrgeButton
+ && (workorder.getQwnoticeMemberIds().indexOf(member.getQwId()) >= Constants.ZERO || member.getQwId().equals(workorder.getManagerId()) )
+ ){
+ workorderLog.setUrgeButton(Constants.ONE);
+ canOpenUrgeButton = false;
+ }
}
}
- //宸ョ▼甯堝鐞嗕腑
- if(Constants.equalsInteger(workorder.getStatus(),Constants.TWO)){
- Member member = memberMapper.selectById(workorderLog.getParam1());
- if(Objects.nonNull(member) && org.apache.commons.lang3.StringUtils.isNotBlank(member.getQwId())
- && member.getQwId().equals(workorder.getManagerId()) && canOpenUrgeButton){
- workorderLog.setUrgeButton(Constants.ONE);
- canOpenUrgeButton = false;
- }
- }
+
//鏌ヨ闄勪欢淇℃伅
List<Multifile> multifileList = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda()
.eq(Multifile::getIsdeleted,Constants.ZERO)
@@ -832,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(),"宸ュ崟鐘舵�佸凡娴佽浆");
@@ -842,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) {
@@ -902,13 +927,13 @@
workorder.setStatus(Constants.WorkOrderStatus.waitDeal.getKey());
}
workorder.setEditDate(new Date());
- workorder.setUrgeDate(DateUtil.afterHoursDate(new Date(),24));
+ workorder.setUrgeDate(DateUtil.afterMinutesDate(new Date(),10));
workorderMapper.updateById(workorder);
String paramr2 = member.getCompanyName()+"/"+member.getName();
//澶勭悊涓婃姤鏃ュ織
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) {
@@ -923,10 +948,12 @@
Category category = categoryMapper.selectById(workorder.getTypeId());
if(Objects.nonNull(passOnDTO.getMember())&&Objects.nonNull(category)){
// 鍙戦�佷紒寰�氱煡
- this.sendQwMsg(workorder,member.getQwId(),passOnDTO.getMember(),category.getName(),Constants.ZERO,null);
+ this.sendQwMsg(workorder,passOnDTO.getPassOnUserId(),passOnDTO.getMember(),category.getName(),Constants.ZERO,null);
}
//瀛樺偍寰呭姙浜哄憳淇℃伅
- this.saveNotice(Arrays.asList(passOnDTO.getMember().getQwId().split(",")),workorder.getId(),Constants.ZERO,Constants.TWO);
+ this.saveNotice(Arrays.asList(passOnDTO.getPassOnUserId().split(",")),
+ Constants.equalsInteger(workorder.getType(),Constants.TWO)?workorder.getDcaRecordId():workorder.getId(),Constants.ZERO,Constants.TWO);
+
}
@@ -943,16 +970,16 @@
}
List<Member> memberList = memberMapper.selectList(new QueryWrapper<Member>().lambda().eq(Member::getIsdeleted, Constants.ZERO)
.isNotNull(Member::getQwId)
- .in(Member::getId, sendCopyDTO.getUserIds().split(",")));
+ .in(Member::getQwId, sendCopyDTO.getUserIds().split(",")));
if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(memberList)) {
List<String> qwIdList = memberList.stream().map(i -> i.getQwId()).collect(Collectors.toList());
Category category = categoryMapper.selectById(workorder.getTypeId());
if (Objects.nonNull(category)) {
// 鍙戦�佷紒寰�氱煡
- this.sendQwMsg(workorder, String.join(",", qwIdList), sendCopyDTO.getMember(), category.getName(), Constants.ONE, null);
+ this.sendQwMsg(workorder, String.join(",", qwIdList), sendCopyDTO.getMember(), category.getName(), Constants.TWO, sendCopyDTO.getInfo());
}
//瀛樺偍寰呭姙淇℃伅
- this.saveNotice(qwIdList, workorder.getId(), Constants.ONE, Constants.ONE);
+ this.saveNotice(qwIdList, Constants.equalsInteger(workorder.getType(),Constants.TWO)?workorder.getDcaRecordId():workorder.getId(), Constants.ONE, Constants.ONE);
}
}
@@ -1106,7 +1133,7 @@
public void urge(Integer workorderId,Member member){
Workorder workorder = workorderMapper.selectById(workorderId);
workorder.setEditDate(new Date());
- workorder.setUrgeDate(DateUtil.afterHoursDate(new Date(),24));
+ workorder.setUrgeDate(DateUtil.afterMinutesDate(new Date(),10));
workorderMapper.updateById(workorder);
if(Objects.isNull(workorder)){
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌宸ュ崟鏁版嵁");
@@ -1115,7 +1142,7 @@
//濡傛灉宸插垎閰� wts 鍒欐槸鍌績wts
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.getKey())){
+ }else if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitDeal.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(),"鐘舵�佸凡娴佽浆鏃犳硶杩涜璇ユ搷浣�");
@@ -1128,7 +1155,7 @@
Category category = categoryMapper.selectById(workorder.getTypeId());
if(Objects.nonNull(category)){
// 鍙戦�佷紒寰�氱煡
- this.sendQwMsg(workorder,urgeUser.getQwId(),null,category.getName(),Constants.ONE,null);
+ this.sendQwMsg(workorder,urgeUser.getQwId(),member,category.getName(),Constants.ONE,null);
}
}
@@ -1137,13 +1164,13 @@
public void jobUrge(){
List<Workorder> workorderList = workorderMapper.selectList(new QueryWrapper<Workorder>().lambda().eq(Workorder::getIsdeleted,Constants.ZERO)
.in(Workorder::getStatus,Constants.WorkOrderStatus.waitAllocation.getKey(),Constants.WorkOrderStatus.waitDeal.getKey())
- .apply(" urge_time > now() ")
+ .apply(" URGE_DATE < now() ")
);
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(workorderList)){
for (Workorder workorder:workorderList) {
this.autoUrge(workorder);
workorder.setEditDate(new Date());
- workorder.setUrgeDate(DateUtil.afterHoursDate(new Date(),24));
+ workorder.setUrgeDate(DateUtil.afterMinutesDate(new Date(),10));//DateUtil.afterHoursDate(new Date(),24));
workorderMapper.updateById(workorder);
}
}
@@ -1173,7 +1200,7 @@
}
- public void saveNotice(List<String> qwIdList ,Integer workorderId,Integer isSendCopy,Integer type){
+ public void saveNotice(List<String> qwIdList , Integer workorderId, Integer isSendCopy, Integer type){
List<Notices> noticesList = new ArrayList<>();
for (String qwId:qwIdList) {
//瀛樺偍鎶勯�佽褰�
@@ -1303,11 +1330,13 @@
@Override
public WorkorderIndexNumVO getIndexData(Workorder workorder) {
WorkorderIndexNumVO model = new WorkorderIndexNumVO();
- List<WorkOrderDataVO> workOrderDataVOList = new ArrayList<>();
+ 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){
@@ -1326,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){
@@ -1368,20 +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