Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

peiguo 5 lat temu
rodzic
commit
420d361023

+ 1 - 1
admin-ui/app/whepi/home/home.js

@@ -160,7 +160,7 @@ define(function (require) {
                                         }
                                         var uptownId = $form1.formGet().uptownId;
                                         var date = $form1.formGet().date;
-                                        window.open(api('/epi/yeweihui/EXR?uptownId=' + uptownId + '&date=' + date));
+                                        window.open(api('/yeweihui/EXR?uptownId=' + uptownId + '&date=' + date));
                                     }
                                 },
                             ],

+ 10 - 1
whepi-doc/creatYeWeiHui.sql

@@ -35,4 +35,13 @@ select (select ur_id from (
 (select ifnull(max(ur_id+0)+1,1) as ur_id from sys_user_role)
 ) as tmp),user_id, 2,
 (select owner_id from sys_owner where user_create = (select user_id from tp_user order by time_create desc limit 1))
-,user_id,now(),user_id,now() from tp_user order by time_create desc limit 1;
+,user_id,now(),user_id,now() from tp_user order by time_create desc limit 1;
+
+
+select count(1) FROM sys_user_role sur
+inner join sys_uptown_house suh on suh.house_id=sur.property_id
+inner join sys_uptown_unit suu on suu.unit_id=suh.unit_id and suu.uptown_id = 1238790987234
+
+
+select count(1) FROM sys_uptown_house suh
+inner join sys_uptown_unit suu on suu.unit_id=suh.unit_id and suu.uptown_id = 1238790987234

+ 1 - 1
whepi-ui/templates/user/home.ftl

@@ -469,7 +469,7 @@
                         }
                     }
                     $('#unitId').append(html);
-                    $("#unitId").val(data[0].unitId);
+                    $("#unitId").val('0');
                 }
             }
         });

+ 4 - 4
whepi-ui/templates/yeweihui/home.ftl

@@ -94,17 +94,17 @@
 
                 console.log("uptownId:"+ $('#uptownId').val());
                 if ($('#uptownId').val() == '1238790987234') {
-                    $("#exportRiBao").attr('href', "/epi/lun/exportRiBao?userId=" + $('#userId').val() + "&date=" + reportDate);
+                    $("#exportRiBao").attr('href', "/whepi/lun/exportRiBao?userId=" + $('#userId').val() + "&date=" + reportDate);
                     $("#doorplateMsg").attr("style", "display: none");
                 } else {
-                    $("#exportRiBao").attr('href', "/epi/yeweihui/exportRiBao?userId=" + $('#userId').val() + "&date=" + reportDate);
+                    $("#exportRiBao").attr('href', "/whepi/yeweihui/exportRiBao?userId=" + $('#userId').val() + "&date=" + reportDate);
                     $("#doorplateMsg").attr("style", "");
                 }
                 // $("#doorplateMsg").attr("style", "");
-                $("#exportRiBaoLink").val(window.location.hostname + "/epi/yeweihui/exportRiBao?userId=" + $('#userId').val() + "&date=" + reportDate);
+                $("#exportRiBaoLink").val(window.location.hostname + "/whepi/yeweihui/exportRiBao?userId=" + $('#userId').val() + "&date=" + reportDate);
                 var userId = $("#userId").val();
                 $.ajax({
-                    url: '/epi/yeweihui/ribaohuiz',
+                    url: '/whepi/yeweihui/ribaohuiz',
                     data: {
                         "userCreate": userId,
                         "reportDate": reportDate,

+ 50 - 0
whepi-web/src/main/java/com/bofeng/service/EpiTemplateMessageService.java

@@ -0,0 +1,50 @@
+package com.bofeng.service;
+
+import com.bofeng.dao.RbMapper;
+import com.bofeng.dao.UserOpenMapper;
+import com.bofeng.entity.Uptown;
+import com.bofeng.entity.UserOpen;
+import com.google.common.collect.Maps;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+@Service
+@Transactional(readOnly = true)
+public class EpiTemplateMessageService {
+
+    @Autowired
+    private UserOpenMapper userOpenMapper;
+    @Autowired
+    private TemplateMessageService templateMessageService;
+    @Autowired
+    private RbMapper rbMapper;
+
+    public int sendUserMessage(Long userId) {
+        UserOpen userOpen = userOpenMapper.selectByUserId(userId);
+        Map<String, String> map = Maps.newHashMap();
+        List<Uptown> uptownList = rbMapper.selectUptown(userId);
+
+        map.put("uptownName", uptownList.get(0).getUptownName());
+        map.put("tagName", "家人");
+        templateMessageService.sendRemindMessage(userOpen.getOpenId(), "", map);
+
+        return 1;
+    }
+
+    public int sendUptownMessage(Long uptownId) {
+//        UserOpen userOpen = userOpenMapper.selectByUserId(userId);
+//        Map<String, String> map = Maps.newHashMap();
+//        List<Uptown> uptownList = rbMapper.selectUptown(userId);
+//
+//        map.put("uptownName", uptownList.get(0).getUptownName());
+//        map.put("tagName", "家人们");
+//        for ()
+//        templateMessageService.sendRemindMessage(userOpen.getOpenId(), "", map);
+
+        return 1;
+    }
+}

+ 1 - 1
whepi-web/src/main/java/com/bofeng/service/RiBaoService.java

@@ -88,7 +88,7 @@ public class RiBaoService {
         }
 
         ribaoDetail.setSuspectedStatus(suspectedStatus);
-        if (ribaoDetail.getSuspectedId().longValue() > 0L) {
+        if (ribaoDetail.getSuspectedId() != null && ribaoDetail.getSuspectedId().longValue() > 0L) {
             ribaoDetail.setTimeUpdate(dateTime);
             msSuspectedMapper.updateById(ribaoDetail);
         } else {

+ 12 - 14
whepi-web/src/main/java/com/bofeng/service/TemplateMessageService.java

@@ -55,37 +55,35 @@ public class TemplateMessageService {
      * 截止时间:{{endTime.DATA}}
      * */
 
-    @Value("${yvan.wechat.templates.预定信息}")
-    private String newMarkMessageId;
+    @Value("${yvan.wechat.templates.每日提醒}")
+    private String newRemindMessageId;
 
-    @Value("${yvan.wechat.templates.修改预定信息}")
-    private String updateMarkMessageId;
 
-    @Value("${yvan.wechat.templates.结账信息}")
-    private String accountMessageId;
+    @Autowired
+    private WxMpService wxMpService;
 
-    @Value("${yvan.wechat.templates.结算信息}")
-    private String settleMessageId;
 
+    public void sendRemindMessage(String openId, String url, Map<String, String> data) {
+
+        sendTemplateMessage(openId, newRemindMessageId, url, data);
+    }
 
-    @Autowired
-    private WxMpService wxMpService;
 
     public void sendNewMarkMessage(String openId, String url, Map<String, String> data) {
 
-        sendTemplateMessage(openId, newMarkMessageId, url, data);
+//        sendTemplateMessage(openId, newMarkMessageId, url, data);
     }
 
     public void sendUpdateMarkMessage(String openId, String url, Map<String, String> data) {
-        sendTemplateMessage(openId, updateMarkMessageId, url, data);
+//        sendTemplateMessage(openId, updateMarkMessageId, url, data);
     }
 
     public void sendSettleMessage(String openId, String url, Map<String, String> data) {
-        sendTemplateMessage(openId, settleMessageId, url, data);
+//        sendTemplateMessage(openId, settleMessageId, url, data);
     }
 
     public void sendAccountMessage(String openId, String url, Map<String, String> data) {
-        sendTemplateMessage(openId, accountMessageId, url, data);
+//        sendTemplateMessage(openId, accountMessageId, url, data);
     }
 
     public void sendTemplateMessage(String openId, String templateId, String url, Map<String, String> data) {

+ 10 - 4
whepi-web/src/main/java/com/bofeng/wx/controller/RiBaoController.java

@@ -7,9 +7,13 @@ import com.bofeng.service.MsSuspectedService;
 import com.bofeng.service.RiBaoService;
 import com.yvan.Model;
 import com.yvan.ModelOps;
+import com.yvan.mvc.JsonBody;
 import com.yvan.mvc.Pd;
+import com.yvan.platform.JsonWapper;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
 
@@ -87,20 +91,22 @@ public class RiBaoController {
 
     // 新增或者修改日报关联的家人 必须传reportId,userCreate,userUpdate
     @PostMapping("/riBao/addOrEditRibaoDetail")
-    public Model<MsSuspected> addOrEditRibaoDetail(@RequestBody MsSuspected msSuspected) {
+    public Model<MsSuspected> addOrEditRibaoDetail(@JsonBody MsSuspected msSuspected) {
         return ModelOps.newSuccess(riBaoService.addOrEditRibaoDetail(msSuspected));
     }
 
     // 删除日报关联的家人
     @PostMapping("/riBao/delRibaoDetail")
-    public ModelOps delRibaoDetail(@RequestParam("suspectedId") Long suspectedId) {
+    public ModelOps delRibaoDetail(JsonWapper jsonWapper) {
+        Long suspectedId = jsonWapper.asObject(Long.class, "suspectedId");
         return ModelOps.newSuccess(riBaoService.delRibaoDetail(suspectedId));
     }
 
 
     // 完成提交日报
     @PostMapping("/riBao/editRibao")
-    public Model<MsReport> editRibao(@RequestParam("reportId") Long reportId) {
+    public Model<MsReport> editRibao(JsonWapper jsonWapper) {
+        Long reportId = jsonWapper.asObject(Long.class, "reportId");
         MsReport msReport = riBaoService.editRibao(reportId);
 
         return ModelOps.newSuccess(msReport);

+ 4 - 4
whepi-web/src/main/java/com/bofeng/wx/controller/YeWeiHuiController.java

@@ -189,7 +189,7 @@ public class YeWeiHuiController {
         return new ModelAndView("/yeweihui/ribaohuiz.ftl", model);
     }
 
-    @GetMapping("/epi/yeweihui/ribaohuiz")
+    @GetMapping("/whepi/yeweihui/ribaohuiz")
     public Model<Map<String, Object>> yeweihuiRibaohuiz(Long userCreate,String reportDate) {
 //        Long userCreate = 1225321682867105793L;
 
@@ -217,7 +217,7 @@ public class YeWeiHuiController {
     }
 
     @ApiOperation("导出正常家庭上报明细")
-    @GetMapping("/whepi/epi/yeweihui/exportRiBao")
+    @GetMapping("/whepi/yeweihui/exportRiBao")
     @SneakyThrows
     public void exportRiBao(@Pd(name = "uptownId") Long uptownId,
                             @Pd(name = "date") String date,
@@ -235,7 +235,7 @@ public class YeWeiHuiController {
     }
 
     @ApiOperation("导出凌云家庭上报明细")
-    @GetMapping("/whepi/epi/lun/exportRiBao")
+    @GetMapping("/whepi/lun/exportRiBao")
     @SneakyThrows
     public void lunExportRiBao(@Pd(name = "date") String date,
                             HttpServletResponse resp) {
@@ -252,7 +252,7 @@ public class YeWeiHuiController {
     }
 
     @ApiOperation("导出小区家庭上报明细")
-    @GetMapping("/whepi/epi/yeweihui/EXR")
+    @GetMapping("/whepi/yeweihui/EXR")
     @SneakyThrows
     public void exportRiBaoByXiaoQu(@Pd(name = "uptownId") Long uptownId,
                             @Pd(name = "date") String date,