Browse Source

xielianghe

lange 5 years ago
parent
commit
633e1c0c1b

+ 2 - 2
whepi-ui/templates/home/ribao.ftl

@@ -86,7 +86,7 @@
                                             <p>酸痛</p>
                                         </div>
                                     </label>
-                                    <label class="weui-cell weui-cell_active weui-check__label" for="s14">
+                                    <label class="weui-cell weui-cell_active weui-check__label" for="s15">
                                         <div class="weui-cell__hd">
                                             <input type="checkbox" name="checkbox5" class="weui-check" id="s15">
                                             <i class="weui-icon-checked"></i>
@@ -95,7 +95,7 @@
                                             <p>乏力</p>
                                         </div>
                                     </label>
-                                    <label class="weui-cell weui-cell_active weui-check__label" for="s14">
+                                    <label class="weui-cell weui-cell_active weui-check__label" for="s16">
                                         <div class="weui-cell__hd">
                                             <input type="checkbox" name="checkbox6" class="weui-check" id="s16">
                                             <i class="weui-icon-checked"></i>

+ 1 - 1
whepi-ui/templates/home/ribao.js

@@ -227,7 +227,7 @@ $("#my-input-ribao").calendar({
         }
         else {
           if (data.data.length > 0) {
-            hasData = true;
+            $('#ribao_famliy').empty();
             data.data.forEach(function (v) {
               helpValue1(v);
             });

+ 27 - 10
whepi-web/src/main/java/com/bofeng/service/MsSuspectedService.java

@@ -32,14 +32,14 @@ public class MsSuspectedService {
 
 
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
-    public void addSuspected(String userName, String conditionStatus, Integer medical, String remarks,Long userCreate) {
+    public void addSuspected(String userName, String conditionStatus, Integer medical, String remarks, Long userCreate) {
         Long reportId = 0L;
         //如果是当前日期 已经添加
         Date t = new Date();
         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
         String reportDate = df.format(t);
-        List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate,userCreate);
-        Long houseId=msReportMapper.selectHouseIdByUserId(userCreate);
+        List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate, userCreate);
+        Long houseId = msReportMapper.selectHouseIdByUserId(userCreate);
         if (listReport == null || listReport.size() == 0) {
             MsReport msReport = new MsReport();
             msReport.setReportId(IdWorker.getId());
@@ -55,7 +55,7 @@ public class MsSuspectedService {
             msReport.setTimeUpdate(DateTime.now());
             msReportMapper.insert(msReport);
             reportId = msReport.getReportId();
-        } else{
+        } else {
             reportId = listReport.get(0).getReportId();
         }
 
@@ -75,12 +75,12 @@ public class MsSuspectedService {
         msSuspectedMapper.insert(msSuspected);
 
         //确证人数
-        Integer isTrue=msReportMapper.selectSuspectedNum(reportId,medical);
-        MsReport msReport=msReportMapper.selectById(reportId);
-        if(msReport!=null){
-            if(medical==0)
+        Integer isTrue = msReportMapper.selectSuspectedNum(reportId, medical);
+        MsReport msReport = msReportMapper.selectById(reportId);
+        if (msReport != null) {
+            if (medical == 0)
                 msReport.setSuspectedNum(isTrue);
-            if(medical==1)
+            if (medical == 1)
                 msReport.setSureNum(isTrue);
             msReport.setUserUpdate(userCreate);
             msReport.setTimeUpdate(DateTime.now());
@@ -91,6 +91,23 @@ public class MsSuspectedService {
 
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public void deleteSuspected(Long suspectedId) {
-        msSuspectedMapper.deleteById(suspectedId);
+
+
+        MsSuspected msSuspected = msSuspectedMapper.selectById(suspectedId);
+        if (msSuspected != null) {
+            msSuspectedMapper.deleteById(suspectedId);
+            //确证人数
+            Integer isTrue = msReportMapper.selectSuspectedNum(msSuspected.getReportId(), msSuspected.getMedical());
+            MsReport msReport = msReportMapper.selectById(msSuspected.getReportId());
+            if (msReport != null) {
+                if (msSuspected.getMedical() == 0)
+                    msReport.setSuspectedNum(isTrue);
+                if (msSuspected.getMedical() == 1)
+                    msReport.setSureNum(isTrue);
+                msReport.setUserUpdate(msReport.getUserCreate());
+                msReport.setTimeUpdate(DateTime.now());
+                msReportMapper.updateById(msReport);
+            }
+        }
     }
 }