Browse Source

Merge branch 'dev' of xwm1000.com:topone/qkyxzx-mini-app into dev

dev
wangzijian 1 year ago
parent
commit
db59cbc845

+ 2
- 2
src/main/java/com/cirle/scientific/controller/miniapp/LoginController.java View File

@@ -44,8 +44,8 @@ public class LoginController {
44 44
     WeixinService weixinService;
45 45
 
46 46
     private static final String phones = "13621173040,13390906112,13390906112,15011407616,18515368686,13911906973,18618427271,13501103018,13611127040,13716327458,15901176537,13520544504,13683131351,18600651891,13693161027" +
47
-            "1346638946,18510351280,18518272962,13581972813,13811592600,13699283983,18801077506,18810482487,18101318590,13718237252,18810766386,15652790935,18911615130,13810921141,13581866981,13381003887,15738268948,18911615067,18518156226," +
48
-            "18501363756,13006052378,13691241031";
47
+            "1346638946,18510351280,18518272962,13581972813,13811592600,13699283983,18801077506,18810482487,18101318590,13718237252,18810766386,15652790935,18911615130,13810921141,13581866981,13381003887,18911615067,18518156226," +
48
+            "18501363756,13006052378,13691241031,13811408269";
49 49
 
50 50
 
51 51
     @RequestMapping(value = "/mobileLogin", method = {RequestMethod.GET})

+ 2
- 0
src/main/java/com/cirle/scientific/controller/miniapp/SuperviseController.java View File

@@ -8,6 +8,7 @@ import com.cirle.scientific.pojo.BizCodeEnum;
8 8
 import com.cirle.scientific.pojo.Result;
9 9
 import com.cirle.scientific.service.SuperviseAppService;
10 10
 import io.swagger.annotations.Api;
11
+import io.swagger.annotations.ApiOperation;
11 12
 import io.swagger.annotations.ApiParam;
12 13
 import org.springframework.beans.factory.annotation.Autowired;
13 14
 import org.springframework.stereotype.Controller;
@@ -29,6 +30,7 @@ public class SuperviseController {
29 30
     }
30 31
 
31 32
     @GetMapping("/findSupervise")
33
+    @ApiOperation("获取督导结果接口")
32 34
     @ResponseBody
33 35
     public Result findSupervise(@ApiParam(name = "memCard", value = "用户唯一标识")  @RequestAttribute(name = "memCard", required = false)  String memCard
34 36
             , @RequestParam(name = "type") Integer type){

+ 1
- 1
src/main/java/com/cirle/scientific/dao/QkjPatientAppDao.java View File

@@ -17,7 +17,7 @@ public interface QkjPatientAppDao extends PagingAndSortingRepository<QkjPatientA
17 17
     @Query(value = "select * from qkj_patient_app where mem_card = ?1 and id = ?2 and obj_type = ?3 and obj_id = ?4 and status = 0",nativeQuery = true)
18 18
     QkjPatientApp findAllByMemCard(String memCard, Integer patientId,  Integer objType, Integer objId);
19 19
 
20
-    @Query(value = "select * from qkj_patient_app where mem_card = ?1 and patient_name = ?2 and status = 0 order by id desc limit 1 ",nativeQuery = true)
20
+    @Query(value = "select * from qkj_patient_app where mem_card = ?1 and patient_name = ?2 and status = 0 and is_accomplish_question = 1 order by id desc limit 1 ",nativeQuery = true)
21 21
     QkjPatientApp findAllByMemCardAndName(String memCard, String patientName);
22 22
 
23 23
     @Query(value = "select * from qkj_patient_app where mem_card = ?1 and obj_type = ?2 and obj_id = ?3 and phone = ?4 and status = 0 order by id desc limit 1 ",nativeQuery = true)

+ 23
- 0
src/main/java/com/cirle/scientific/dao/QkjSuperviseResultDao.java View File

@@ -0,0 +1,23 @@
1
+package com.cirle.scientific.dao;/*
2
+ *24901
3
+ *2023/1/11
4
+ *14:33
5
+ */
6
+
7
+import com.cirle.scientific.po.QkjSuperviseResultApp;
8
+import org.springframework.data.jpa.repository.JpaRepository;
9
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
10
+import org.springframework.data.jpa.repository.Query;
11
+
12
+import java.util.List;
13
+
14
+/**
15
+ * @author 24901
16
+ */
17
+public interface QkjSuperviseResultDao extends JpaRepository<QkjSuperviseResultApp, Long>, JpaSpecificationExecutor<QkjSuperviseResultApp> {
18
+
19
+
20
+    @Query(value = "select * from qkj_supervise_result_app where mem_card= ?1 and type = ?2 and year = ?3 and month = ?4 and status = 0",nativeQuery = true)
21
+    List<QkjSuperviseResultApp> selectAllByMemCardAndTypeAndYearAndMonth(String memCard, Integer type, Integer year, Integer month);
22
+
23
+}

+ 60
- 0
src/main/java/com/cirle/scientific/po/QkjSuperviseResultApp.java View File

@@ -0,0 +1,60 @@
1
+package com.cirle.scientific.po;/*
2
+ *24901
3
+ *2023/1/11
4
+ *14:28
5
+ */
6
+
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import org.springframework.data.annotation.CreatedDate;
11
+import org.springframework.data.annotation.LastModifiedDate;
12
+import org.springframework.data.jpa.domain.support.AuditingEntityListener;
13
+
14
+import javax.persistence.*;
15
+import java.time.LocalDateTime;
16
+
17
+/**
18
+ * @author 24901
19
+ */
20
+@Entity
21
+@Table(name = "qkj_supervise_result_app")
22
+@Data
23
+@ApiModel
24
+@EntityListeners(AuditingEntityListener.class)
25
+public class QkjSuperviseResultApp {
26
+
27
+    @Id
28
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
29
+    @ApiModelProperty(value = "督导标准内容id")
30
+    private Long id;
31
+
32
+    @ApiModelProperty(value = "用户唯一表示")
33
+    private String memCard;
34
+
35
+    @ApiModelProperty(value = "0: 线上督导结果, 1:线下督导结果, 2:质控结果")
36
+    private Integer type;
37
+
38
+    @ApiModelProperty(value = "标准判断内容")
39
+    private String criteria;
40
+
41
+    @ApiModelProperty(value = "0:未通过 1:通过")
42
+    private Integer isPass;
43
+
44
+    @ApiModelProperty(value = "上传当前的年")
45
+    private Integer year;
46
+
47
+    @ApiModelProperty(value = "上传的月份")
48
+    private Integer month;
49
+
50
+    @ApiModelProperty(value = "状态 0:未删除 1删除")
51
+    private Integer status;
52
+
53
+    @CreatedDate
54
+    @Column(nullable = false, updatable = false)
55
+    private LocalDateTime createTime;
56
+
57
+    @LastModifiedDate
58
+    @Column()
59
+    private LocalDateTime updateTime;
60
+}

+ 2
- 0
src/main/java/com/cirle/scientific/service/impl/PatientAppServiceImpl.java View File

@@ -52,6 +52,8 @@ public class PatientAppServiceImpl implements PatientAppService {
52 52
             }
53 53
             qkjPatientApp.setStatus(0);
54 54
             qkjPatientApp.setIsAccomplishQuestion(0);
55
+            qkjPatientApp.setOneQuestionnaireScore(0);
56
+            qkjPatientApp.setTowQuestionnaireScore(0);
55 57
             qkjPatientApp.setCreateTime(new Date());
56 58
             QkjPatientApp qkjPatientApp1 = qkjPatientAppDao.save(qkjPatientApp);
57 59
             return qkjPatientApp1.getId();

+ 33
- 10
src/main/java/com/cirle/scientific/service/impl/SuperviseAppServiceImpl.java View File

@@ -5,15 +5,14 @@ package com.cirle.scientific.service.impl;/*
5 5
  */
6 6
 
7 7
 import com.cirle.scientific.dao.QkjSuperviseAppDao;
8
+import com.cirle.scientific.dao.QkjSuperviseResultDao;
8 9
 import com.cirle.scientific.po.QkjSuperviseApp;
10
+import com.cirle.scientific.po.QkjSuperviseResultApp;
9 11
 import com.cirle.scientific.service.SuperviseAppService;
10 12
 import lombok.extern.slf4j.Slf4j;
11 13
 import org.springframework.beans.factory.annotation.Autowired;
12 14
 import org.springframework.stereotype.Service;
13
-import java.util.Calendar;
14
-import java.util.HashMap;
15
-import java.util.LinkedList;
16
-import java.util.Map;
15
+import java.util.*;
17 16
 
18 17
 /**
19 18
  * @author 24901
@@ -24,6 +23,13 @@ public class SuperviseAppServiceImpl implements SuperviseAppService {
24 23
 
25 24
     private QkjSuperviseAppDao qkjSuperviseAppDao;
26 25
 
26
+    private QkjSuperviseResultDao qkjSuperviseResultDao;
27
+
28
+    @Autowired
29
+    public void setQkjSuperviseResultDao(QkjSuperviseResultDao qkjSuperviseResultDao) {
30
+        this.qkjSuperviseResultDao = qkjSuperviseResultDao;
31
+    }
32
+
27 33
     @Autowired
28 34
     public void setQkjSuperviseAppDao(QkjSuperviseAppDao qkjSuperviseAppDao) {
29 35
         this.qkjSuperviseAppDao = qkjSuperviseAppDao;
@@ -39,15 +45,32 @@ public class SuperviseAppServiceImpl implements SuperviseAppService {
39 45
             LinkedList<QkjSuperviseApp> resultFile = qkjSuperviseAppDao.findResultFileByYearAndTypeAndMemCard(memCard, year, type);
40 46
             for (QkjSuperviseApp qkjSuperviseApp : resultFile) {
41 47
                 Map<String,Object> map = new HashMap<>();
42
-                map.put("month", qkjSuperviseApp.getMonth());
43
-                if(null != qkjSuperviseApp.getResultFile()){
44
-                    if(qkjSuperviseApp.getResultFile().endsWith(".xlsx") || qkjSuperviseApp.getResultFile().endsWith(".xls")){
45
-                        map.put("result", qkjSuperviseApp.getWordFileResult());
48
+                //如果是线下督导
49
+                if(type == 1){
50
+                    if(qkjSuperviseApp.getMonth() <= 3){
51
+                        map.put("month", 1);
52
+                    }else if(qkjSuperviseApp.getMonth() >= 3 && qkjSuperviseApp.getMonth() <= 6){
53
+                        map.put("month", 2);
54
+                    }else if(qkjSuperviseApp.getMonth() >= 6 && qkjSuperviseApp.getMonth() <= 9){
55
+                        map.put("month", 3);
56
+                    }else if(qkjSuperviseApp.getMonth() >= 9 && qkjSuperviseApp.getMonth() <= 12){
57
+                        map.put("month", 4);
46 58
                     }
47
-                    if(qkjSuperviseApp.getResultFile().endsWith(".jpg") || qkjSuperviseApp.getResultFile().endsWith(".png")){
48
-                        map.put("result", qkjSuperviseApp.getResultFile());
59
+                }else{
60
+                    map.put("month", qkjSuperviseApp.getMonth());
61
+                }
62
+                List<QkjSuperviseResultApp> qkjSuperviseResultApps = qkjSuperviseResultDao.selectAllByMemCardAndTypeAndYearAndMonth(memCard, type, year, qkjSuperviseApp.getMonth());
63
+                List<String> list = new ArrayList<>();
64
+                for (QkjSuperviseResultApp qkjSuperviseResultApp : qkjSuperviseResultApps) {
65
+                    String criteria = null;
66
+                    if(null != qkjSuperviseResultApp.getIsPass() && qkjSuperviseResultApp.getIsPass() == 1){
67
+                        criteria = qkjSuperviseResultApp.getCriteria()+": "+"是";
68
+                    }else if(null == qkjSuperviseResultApp.getIsPass() || qkjSuperviseResultApp.getIsPass() == 0){
69
+                        criteria = qkjSuperviseResultApp.getCriteria()+": "+"否";
49 70
                     }
71
+                    list.add(criteria);
50 72
                 }
73
+                map.put("result", list);
51 74
                 data.add(map);
52 75
             }
53 76
         }catch (Exception e){

Loading…
Cancel
Save