From 955873b451cadfbc71bf21f4f7f8717d8a10936a Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期四, 19 十二月 2024 19:27:50 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/dmvisit

---
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformBooksServiceImpl.java |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformBooksServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformBooksServiceImpl.java
index 9f757c2..9c6977e 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformBooksServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformBooksServiceImpl.java
@@ -10,13 +10,19 @@
 import com.doumee.core.utils.DateUtil;
 import com.doumee.core.utils.SmsConstants;
 import com.doumee.core.utils.Utils;
+import com.doumee.core.wx.wxPlat.WxPlatConstants;
+import com.doumee.core.wx.wxPlat.WxPlatNotice;
 import com.doumee.dao.business.*;
+import com.doumee.dao.business.dao.SmsConfigMapper;
 import com.doumee.dao.business.dao.SmsEmailMapper;
 import com.doumee.dao.business.join.ApproveJoinMapper;
 import com.doumee.dao.business.model.*;
 import com.doumee.dao.business.vo.ApproveDataVO;
 
+import com.doumee.dao.system.SystemUserMapper;
 import com.doumee.dao.system.join.NoticesJoinMapper;
+import com.doumee.dao.system.model.Notices;
+import com.doumee.dao.system.model.SystemUser;
 import com.doumee.dao.web.reqeust.PlatformBooksApplyDTO;
 import com.doumee.dao.web.reqeust.PlatformBooksCheckNumDTO;
 import com.doumee.dao.web.reqeust.RevokeDTO;
@@ -35,6 +41,7 @@
 import org.springframework.util.CollectionUtils;
 
 import java.math.BigDecimal;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
 import java.util.Objects;
@@ -66,6 +73,9 @@
     private SystemDictDataBiz systemDictDataBiz;
 
     @Autowired
+    private SystemUserMapper systemUserMapper;
+
+    @Autowired
     private ApproveService approveService;
 
     @Autowired
@@ -85,6 +95,9 @@
 
     @Autowired
     private EmayService emayService;
+
+    @Autowired
+    private WxNoticeConfigMapper wxNoticeConfigMapper;
 
     @Override
     public Integer create(PlatformBooks platformBooks) {
@@ -284,6 +297,21 @@
 
         //鍒涘缓瀹℃壒娴佷俊鎭�
         approveService.createApproveForPlatfrom(approveTempl.getId(),platformBooks.getId(),platformBooks.getDriverId());
+        //鍙戦�佸叕浼楀彿閫氱煡 缁欐彁浜や汉
+        SystemUser driver = systemUserMapper.selectOne(new QueryWrapper<SystemUser>().lambda()
+                .eq(SystemUser::getDeleted, Constants.ZERO)
+                .eq(SystemUser::getType, Constants.ZERO)
+                .eq(SystemUser::getMobile,platformBooks.getDriverPhone())
+                .last(" limit 1 "));
+
+        if(Objects.nonNull(driver)&&StringUtils.isNotBlank(driver.getOpenid())){
+            WxPlatNotice wxPlatNotice = new WxPlatNotice();
+            wxPlatNotice.sendPlatformBookTemplateNotice(systemDictDataBiz,
+                    wxNoticeConfigMapper,platformBooks,
+                    WxPlatConstants.platformBookContent.platformBookUpload,
+                    systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(),
+                    Arrays.asList(driver.getOpenid().split(",")),0);
+        }
         return platformBooks.getId();
     }
 
@@ -365,6 +393,20 @@
             approve.setCheckDate(model.getCancelTime());
             approveList.add(approve);
         }
+
+        Notices notices = noticesJoinMapper.selectOne(new QueryWrapper<Notices>().lambda()
+                .eq(Notices::getObjId,id)
+                .eq(Notices::getType,Constants.noticesObjectType.reason)
+                .eq(Notices::getUserId,memberId)
+                .eq(Notices::getSendacopy,Constants.ZERO)
+                .orderByDesc(Notices::getId).last(" limit 1 "));
+        if(Objects.nonNull(notices)){
+            if(Constants.equalsInteger(notices.getStatus(),Constants.ZERO)){
+                model.setInfo("寰呮垜澶勭悊");
+            }else{
+                model.setInfo(notices.getInfo());
+            }
+        }
         return model;
     }
 

--
Gitblit v1.9.3