ccj 2 vuotta sitten
vanhempi
commit
ccaf25b5d8

+ 1 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/AppVersionController.java

@@ -46,7 +46,7 @@ public class AppVersionController {
      */
     @GetMapping("/test")
     public void test() {
-        geTuiUtils.pushByCid("推送测试","推送测试内容","84f62127b7384dcdbaeaddfe460329fc");
+        geTuiUtils.pushByCid("工作事项提醒","您有新的易粮易运流程,请及时审核","84f62127b7384dcdbaeaddfe460329fc");
 //       List<CommonUser> list =   commonUserService.selectList(new EntityWrapper<>());
 //       for(CommonUser commonUser:list){
 //           commonUser.setPassword(Md5Crypt.md5Crypt("123456".getBytes(), "$1$" + commonUser.getPhone().substring(0, 7)));

+ 5 - 2
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/NewWorkflowServiceImpl.java

@@ -349,7 +349,9 @@ public class NewWorkflowServiceImpl implements INewWorkflowService {
         List<CommonStaff> list =  getTaskCandidates(workflowId,businessKey);
         for (CommonStaff c :
                 list) {
-            geTuiUtils.pushByCid("审核任务","您有新的审核任务需要处理,请及时处理。",c.getStaffId());
+//            geTuiUtils.pushByCid("审核任务","您有新的审核任务需要处理,请及时处理。",c.getStaffId());
+            geTuiUtils.pushByCid("工作事项提醒","您有新的易粮易运流程,请及时审批",c.getStaffId());
+
         }
         return workflowId;
     }
@@ -1307,8 +1309,9 @@ public class NewWorkflowServiceImpl implements INewWorkflowService {
         List<CommonStaff> commonStaffs = this.getTaskCandidates(workflowId,businessKey);
         if(CollectionUtils.isNotEmpty(commonStaffs)) {
             for (int i = 0; i < commonStaffs.size(); i++) {
-                geTuiUtils.pushByCid("审核任务",type + "有新的审核任务需要处理,请及时处理。",commonStaffs.get(i).getStaffId());
+//                geTuiUtils.pushByCid("审核任务",type + "有新的审核任务需要处理,请及时处理。",commonStaffs.get(i).getStaffId());
 
+                geTuiUtils.pushByCid("工作事项提醒","您有新的易粮易运流程,请及时审批",commonStaffs.get(i).getStaffId());
                 UnimallMessage messageDO = new UnimallMessage();
                 messageDO.setAdminId(commonStaffs.get(i).getStaffId());
                 messageDO.setCustomer(commonStaffs.get(i).getStaffName());

+ 14 - 7
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseBaseInfoServiceImpl.java

@@ -834,11 +834,14 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         if (compId == null || compId.isEmpty()) {
             compId = AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getCompId();
         }
+
+        Calendar calendar = Calendar.getInstance();
+        calendar.add(Calendar.MONTH, -2);
         List<ContractManagementInfo> temp = new ArrayList();
-        List<ContractManagementInfo> listRedis = cacheComponent.getObjList(Const.ADMIN_CONTRACTINFO+compId+flag,ContractManagementInfo.class);
-        if(listRedis != null && listRedis.size() > 0 ){
-            return listRedis;
-        }
+//        List<ContractManagementInfo> listRedis = cacheComponent.getObjList(Const.ADMIN_CONTRACTINFO+compId+flag,ContractManagementInfo.class);
+//        if(listRedis != null && listRedis.size() > 0 ){
+//            return listRedis;
+//        }
         //查所有合同编号
         if (flag == null) {
             List<ContractManagementInfo> contractManagementInfoList = contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
@@ -961,6 +964,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                     .eq("delete_flag", "0")
                     .eq("status_flag", "1")
                     .eq("contract_type", "1")
+                    .ge("update_date",DateUtil.formatDate(calendar.getTime(), DateUtils.DATE_FMT_YYYY_MM_DD))
                     .orderBy("update_date", false));
             for (ContractManagementInfo contractManagementInfo : contractManagementInfoList) {
                 ContractGoodsInfo contractGoodsInfo = contractGoodsInfoService.selectOne(new EntityWrapper<ContractGoodsInfo>()
@@ -997,6 +1001,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                     .eq("delete_flag", "0")
                     .eq("task_type_key", "3")
                     .eq("in_out_flag", "1")
+                    .ge("update_date",DateUtil.formatDate(calendar.getTime(), DateUtils.DATE_FMT_YYYY_MM_DD))
                     .orderBy("update_date", false));
             for (InOutWarehouseTask inOutWarehouseTask : inOutWarehouseTaskList) {
                 ContractManagementInfo contractManagementInfo = new ContractManagementInfo();
@@ -1143,7 +1148,6 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         }
         //查采购合同编号(不包含自运),以及移库任务编号,销售合同
         else if (flag == 7) {
-
 /*****************************************************---------------------------******************************/
             List<ContractManagementInfo> contractManagementInfoList = contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
                     .eq("comp_id", compId)
@@ -1151,6 +1155,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                     .eq("contract_type", "2")
                     .eq("status_flag", "1")
                     .eq("deliver_type", "2")
+                    .ge("update_date",DateUtil.formatDate(calendar.getTime(), DateUtils.DATE_FMT_YYYY_MM_DD))
                     .orderBy("update_date", false));
             for (ContractManagementInfo contractManagementInfo : contractManagementInfoList) {
                 ContractGoodsInfo contractGoodsInfo = contractGoodsInfoService.selectOne(new EntityWrapper<ContractGoodsInfo>()
@@ -1196,6 +1201,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                     .eq("status_flag", "1")
                     .eq("contract_type", "1")
                     .eq("delete_flag", "0")
+                    .ge("update_date",DateUtil.formatDate(calendar.getTime(), DateUtils.DATE_FMT_YYYY_MM_DD))
                     .orderBy("update_date", false));
             for (ContractManagementInfo contractManagementInfo1 : contractManagementInfoList1) {
                 ContractGoodsInfo contractGoodsInfo = contractGoodsInfoService.selectOne(new EntityWrapper<ContractGoodsInfo>()
@@ -1234,6 +1240,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                     .eq("delete_flag", "0")
                     .eq("task_type_key", "3")
                     .eq("in_out_flag", "1")
+                    .ge("update_date",DateUtil.formatDate(calendar.getTime(), DateUtils.DATE_FMT_YYYY_MM_DD))
                     .orderBy("update_date", false));
             for (InOutWarehouseTask inOutWarehouseTask : inOutWarehouseTaskList) {
                 ContractManagementInfo contractManagementInfo1 = new ContractManagementInfo();
@@ -1282,8 +1289,8 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 contractManagementInfo1.setInOutType("移库入库");
                 temp.add(contractManagementInfo1);
             }
-            temp = temp.stream().sorted(Comparator.comparing(ContractManagementInfo::getCreateDate)).collect(Collectors.toList());
-            temp = temp.subList(temp.size()-100,temp.size());
+//            temp = temp.stream().sorted(Comparator.comparing(ContractManagementInfo::getCreateDate)).collect(Collectors.toList());
+//            temp = temp.subList(temp.size()-100,temp.size());
             cacheComponent.putRaw(Const.ADMIN_CONTRACTINFO+compId+flag,JSONObject.toJSONString(temp),60*60*24);
             return temp;
         }

+ 16 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/GeTuiUtils.java

@@ -11,6 +11,7 @@ import com.getui.push.v2.sdk.dto.req.message.PushChannel;
 import com.getui.push.v2.sdk.dto.req.message.PushDTO;
 import com.getui.push.v2.sdk.dto.req.message.PushMessage;
 import com.getui.push.v2.sdk.dto.req.message.android.AndroidDTO;
+import com.getui.push.v2.sdk.dto.req.message.android.GTNotification;
 import com.getui.push.v2.sdk.dto.req.message.android.ThirdNotification;
 import com.getui.push.v2.sdk.dto.req.message.android.Ups;
 import com.getui.push.v2.sdk.dto.req.message.ios.Alert;
@@ -110,8 +111,10 @@ public class GeTuiUtils {
             notification1.setIntent("intent:#Intent;launchFlags=0x04000000;action=android.intent.action.oppopush;component=uni.UNI7297DA2/io.dcloud.PandoraEntry;S.UP-OL-SU=true;S.title="+title+";S.content="+content+";S.payload=test;end");
             ups.setNotification(notification1);
             //各厂商自有功能单项设置
-            //ups.addOption("HW", "/message/android/notification/badge/class", "io.dcloud.PandoraEntry ");
-            //ups.addOption("HW", "/message/android/notification/badge/add_num", 1);
+            ups.addOption("HW", "/message/android/notification/badge/class", "io.dcloud.PandoraEntry ");
+            ups.addOption("HW", "/message/android/notification/badge/add_num", 1);
+            ups.addOption("HW", "/message/android/notification/sound", "/raw/ring");
+            ups.addOption("HW", "/message/android/notification/channel_id", "task1");
             ups.addOption("HW", "/message/android/notification/importance", "HIGH");
             //ups.addOption("VV","classification",1);
             androidDTO.setUps(ups);
@@ -119,7 +122,17 @@ public class GeTuiUtils {
             pushDTO.setPushChannel(pushChannel);
             // PushMessage在线走个推通道才会起作用的消息体
             PushMessage pushMessage = new PushMessage();
-            pushMessage.setTransmission(" {title:\""+title+"\",content:\""+content+"\",payload:\"test\"}");
+            GTNotification gtNotification = new GTNotification();
+            gtNotification.setTitle(title);
+            gtNotification.setBody(content);
+            gtNotification.setRingName("ring");
+            gtNotification.setChannelId("task1");
+            gtNotification.setChannelName("工作事项提醒");
+            gtNotification.setChannelLevel("4");
+            gtNotification.setClickType("startapp");
+            gtNotification.setLogo("logo.png");
+            pushMessage.setNotification(gtNotification);
+//            pushMessage.setTransmission(" {title:\""+title+"\",content:\""+content+"\",payload:\"test\"}");
             pushDTO.setPushMessage(pushMessage);
 //            pushMessage.setTransmission(" {title:\"标题\",content:\"内容\",payload:\"自定义数据\"}");
             // 设置接收人信息