|
|
@@ -1,24 +1,15 @@
|
|
|
package com.ygtx.gxt.controller.mobile;
|
|
|
|
|
|
-import cn.hutool.json.JSONUtil;
|
|
|
-import com.alibaba.druid.support.json.JSONUtils;
|
|
|
-import com.ygtx.common.annotation.Log;
|
|
|
-import com.ygtx.common.constant.UserConstants;
|
|
|
+import com.ygtx.common.constant.CacheConstants;
|
|
|
import com.ygtx.common.core.controller.BaseController;
|
|
|
import com.ygtx.common.core.domain.AjaxResult;
|
|
|
-import com.ygtx.common.core.page.TableDataInfo;
|
|
|
import com.ygtx.common.core.redis.RedisCache;
|
|
|
-import com.ygtx.common.enums.BusinessType;
|
|
|
import com.ygtx.common.utils.DateUtils;
|
|
|
import com.ygtx.gxt.domain.GxtNotifyMessage;
|
|
|
import com.ygtx.gxt.domain.GxtRepairOrder;
|
|
|
import com.ygtx.gxt.domain.GxtWorkOrder;
|
|
|
import com.ygtx.gxt.domain.OrderScoreInfo;
|
|
|
-import com.ygtx.gxt.service.IGxtOrderScoreService;
|
|
|
-import com.ygtx.gxt.service.IGxtRepairOrderService;
|
|
|
-import com.ygtx.gxt.service.IGxtWorkOrderService;
|
|
|
-import io.lettuce.core.dynamic.annotation.Param;
|
|
|
-import io.swagger.models.auth.In;
|
|
|
+import com.ygtx.gxt.service.IGxtOrderMineService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
@@ -34,7 +25,7 @@ import java.util.List;
|
|
|
public class GxtMobileNotifyController extends BaseController
|
|
|
{
|
|
|
@Autowired
|
|
|
- private IGxtOrderScoreService gxtOrderScoreService;
|
|
|
+ private IGxtOrderMineService qxtOrderMineService;
|
|
|
@Autowired
|
|
|
private RedisCache redisCache;
|
|
|
/**
|
|
|
@@ -47,30 +38,35 @@ public class GxtMobileNotifyController extends BaseController
|
|
|
System.out.println("请求" + DateUtils.getTime());
|
|
|
if(id != null){
|
|
|
GxtRepairOrder repairOrder = new GxtRepairOrder();
|
|
|
- repairOrder.setWorkOrderStatus("assigned,to_finish,to_approve,suspended");
|
|
|
GxtWorkOrder workOrder = new GxtWorkOrder();
|
|
|
- workOrder.setWorkOrderStatus("assigned,to_finish,to_approve,suspended");
|
|
|
- List<OrderScoreInfo> orderScoreInfos = gxtOrderScoreService.selectMobileUnionOrderList(id, repairOrder,workOrder, null);
|
|
|
+ List<OrderScoreInfo> orderScoreInfos= qxtOrderMineService.selectUnionOrderListMyTodo(repairOrder, workOrder);
|
|
|
boolean isSend = false;
|
|
|
+ boolean isSendBadge = true;
|
|
|
int taskNum = 0;
|
|
|
if(!orderScoreInfos.isEmpty()){
|
|
|
taskNum = orderScoreInfos.size();
|
|
|
- Object taskNumStr = redisCache.lGet(UserConstants.NOTIFY_STORAGE_KEY, id);
|
|
|
+ Object taskNumStr = redisCache.lGet(CacheConstants.NOTIFY_STORAGE_KEY, id);
|
|
|
if(taskNumStr!=null){
|
|
|
int prevTaskNum = Integer.parseInt(taskNumStr.toString());
|
|
|
if(taskNum < prevTaskNum){
|
|
|
isSend = true;
|
|
|
}
|
|
|
+ if(taskNum == prevTaskNum){
|
|
|
+ isSendBadge = false;
|
|
|
+ }
|
|
|
}else{
|
|
|
isSend = true;
|
|
|
}
|
|
|
- redisCache.lPush(UserConstants.NOTIFY_STORAGE_KEY,id, taskNum+"");
|
|
|
+ redisCache.lPush(CacheConstants.NOTIFY_STORAGE_KEY,id, taskNum+"");
|
|
|
}
|
|
|
GxtNotifyMessage notifyMessage = new GxtNotifyMessage();
|
|
|
if(isSend) {
|
|
|
notifyMessage.setTitle(DateUtils.getHourTime() + "收到消息");
|
|
|
notifyMessage.setDesc("您有" + taskNum + "个任务待处理");
|
|
|
}
|
|
|
+ if(!isSendBadge){
|
|
|
+ taskNum = -1;
|
|
|
+ }
|
|
|
notifyMessage.setNum(taskNum);
|
|
|
return success(notifyMessage);
|
|
|
}
|