Browse Source

Merge branch 'master' of http://192.168.20.122:3000/root/qiyewechatApp

pzc 4 years ago
parent
commit
40de72c23d

+ 28 - 5
mpwechatApp/src/main/java/com/liangjian11/wx/mp/controller/WxMessageController.java

@@ -20,10 +20,11 @@ import me.chanjar.weixin.common.error.WxErrorException;
 import me.chanjar.weixin.mp.bean.template.WxMpTemplate;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+
+import java.text.ParseException;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
 
 /**
  * 消息管理
@@ -41,6 +42,7 @@ public class WxMessageController {
     private final ApplicationPortRefService applicationPortRefService;
     private final TemplateMessageService templateMessageService;
 
+
     public WxMessageController(AppMsgRefService appMsgRefService, MessageService messageService, AppmsgService appmsgService
         , ApplicationPortRefService applicationPortRefService , TemplateMessageService templateMessageService){
         this.appMsgRefService=appMsgRefService;
@@ -217,9 +219,30 @@ public class WxMessageController {
      * 模板消息配置列表页
      */
     @PostMapping("/getTemplateMsgOfPage/{appId}")
-    public ResultInfo getTemplateMsgOfPage(@PathVariable String appId,@RequestBody FiltersData filtersData){
+    public ResultInfo getTemplateMsgOfPage(@PathVariable String appId,@RequestBody FiltersData filtersData) throws ParseException {
         if(StringUtils.isEmpty(appId))
             return new ResultInfo(ResultInfo.TYPE_RESULT_FAIL,20002,"appId不能为空");
+        Iterator<FiltersUtils> iterator = filtersData.getFilters().iterator();
+        FiltersUtils newFilter=null;
+        while (iterator.hasNext()){
+            FiltersUtils f=iterator.next();
+            if(!StringUtils.isEmpty(f.getValue())){
+                if("sendTime".equals(f.getField())){
+                    if("equal".equals(f.getOperate())){
+                        f.setOperate("greaterorequal");
+                        DateTimeFormatter dateTimeFormatter= DateTimeFormatter.ofPattern("yyyy-MM-dd");
+                        LocalDate localDay=LocalDate.parse(f.getValue(), dateTimeFormatter);
+                        localDay=localDay.plusDays(1L);
+                        newFilter=new FiltersUtils();
+                        newFilter.setField("sendTime");
+                        newFilter.setOperate("less");
+                        newFilter.setValue(localDay.format(dateTimeFormatter));
+                    }
+                }
+            }
+        }
+        if(newFilter!=null)
+            filtersData.getFilters().add(newFilter);
         String filterSql=filtersData.getFilterString();
         List<TemplateMessage>list= templateMessageService.getListOfPage(filterSql,appId,(filtersData.getPageIndex()-1)*filtersData.getPageSize(),filtersData.getPageSize());
         int count=0;

+ 2 - 2
ymall/src/main/java/com/liangjian11/ymall/controller/video/VideoController.java

@@ -42,7 +42,7 @@ public class VideoController {
     if(start > 0 && pageSize > 0){
     pageSql = "LIMIT "+pageSize+" offset "+start;
     }
-    String filterSql = "where 1=1 ";
+    String filterSql = "where 1=1 and recommend_status != 1 ";
     if(!CollectionUtils.isEmpty(filtersData.getFilters())){
       for (FiltersUtils filter : filtersData.getFilters()) {
         if(filter.getField().equals("id") && !"".equals(filter.getValue())){
@@ -58,7 +58,7 @@ public class VideoController {
       }
     }
     if (!CollectionUtils.isEmpty(filtersData.getFilters())) {
-      filterSql = filtersData.getFilterSqlCap();
+      filterSql = filtersData.getFilterSqlCap()+" and recommend_status != 1 ";
     }
     String filterSortSql = filterSql + " order by id desc ";
     if (!StringUtils.isEmpty(filtersData.getSortField()) && filtersData.getSortDirection() != null) {

+ 1 - 1
ymall/src/main/java/com/liangjian11/ymall/service/impl/video/VideoServiceImpl.java

@@ -627,7 +627,7 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
     DefaultAcsClient client = RAMConnectUtils.initVodClient();
     int start = (selectDTO.getPageIndex() - 1) * selectDTO.getPageSize();
     int pageSize = selectDTO.getPageSize();
-    String filterSql = " and v.doctor_id::uuid='"+doctorId+"' and (v.recommend_status =0 or v.recommend_status =2) ";
+    String filterSql = " and v.doctor_id::uuid='"+doctorId+"' and ( v.recommend_status = 0 or v.recommend_status = 2 ) ";
     List<Video> videoList = videoMapper.getVideoByHome(userId, filterSql, start, pageSize);
     for (Video video : videoList) {
       GetPlayInfoResponse playInfo = PlayUtils.getPlayInfo(client, video.getVideoId());