liyuanyuan 8 months ago
parent
commit
5271938b72

+ 3 - 6
hjzx-api/src/main/java/api/controller/common/CommonController.java

@@ -262,12 +262,9 @@ public class CommonController extends BaseController {
262 262
             }
263 263
         });
264 264
         Thread thread2 = new Thread(() -> {
265
-            LambdaQueryWrapper<BlackList> blackwrapper=new LambdaQueryWrapper<>();
266
-            blackwrapper.eq(BlackList::getPhoneNumber, SecretHelper.AesEncrypt(phone));
267
-            blackwrapper.ge(BlackList::getEndtime,DateHelper.getNowDate());
268
-            blackwrapper.le(BlackList::getStarttime,DateHelper.getNowDate());
269
-            Boolean isexits=  blacklistService.exists(blackwrapper);
270
-            if(isexits){
265
+
266
+         long res=    blacklistService.existBlackByphone(SecretHelper.AesEncrypt(phone));
267
+            if(res>0){
271 268
                 Map<String,Object> map=new LinkedHashMap<>();
272 269
                 map.put("labelName","黑名单");
273 270
                 maplist.add(map);

+ 43 - 3
hjzx-api/src/main/java/api/controller/order/WorkOrderBaseController.java

@@ -7,8 +7,10 @@ import api.entity.database.patient.Patient;
7 7
 import api.entity.database.survey.*;
8 8
 import api.entity.database.system.*;
9 9
 import api.entity.input.PageInput;
10
+import api.entity.input.order.OrderSearchInput;
10 11
 import api.entity.input.order.TimeOutReportInput;
11 12
 import api.entity.input.order.TransOrderInput;
13
+import api.entity.input.survey.SearchInput;
12 14
 import api.entity.view.order.ExportWorkOrderBaseView;
13 15
 import api.entity.view.order.TimeOutReportView;
14 16
 import api.entity.view.order.WorkOrderBaseView;
@@ -116,9 +118,13 @@ public class WorkOrderBaseController extends BaseController {
116 118
     @Log(title = "查询wo_workorderbase列表", businessType = BusinessType.QUERY)
117 119
     @GetMapping
118 120
 
119
-    public AjaxResult getList(WorkOrderBase input, PageInput pageInput, int listType) {
121
+    public AjaxResult getList(WorkOrderBase input, PageInput pageInput, int listType, OrderSearchInput searchInput) {
120 122
         LambdaQueryWrapper<WorkOrderBase> qw = new LambdaQueryWrapper<>();
121 123
 
124
+
125
+
126
+
127
+        qw.eq( input.getSex()!=null && input.getSex()>-1, WorkOrderBase::getSex, input.getSex());
122 128
         qw.eq(input.getFirsttype() != null && input.getFirsttype() > 0, WorkOrderBase::getFirsttype, input.getFirsttype());
123 129
         qw.like(!StringHelper.isEmpty(input.getCallnum()), WorkOrderBase::getCallnum, input.getCallnum());
124 130
         qw.like(!StringHelper.isEmpty(input.getCaller()), WorkOrderBase::getCaller, input.getCaller());
@@ -165,7 +171,9 @@ public class WorkOrderBaseController extends BaseController {
165 171
         qw.le(input.getEndtime() != null , WorkOrderBase::getCreatetime, input.getEndtime());
166 172
 
167 173
 
168
-
174
+        //ge("age", 18)表示查询年龄大于等于18的记录。
175
+        qw.ge(searchInput.getSage() != null  && searchInput.getSage()>0 , WorkOrderBase::getAge, searchInput.getSage());
176
+        qw.le(searchInput.getEage() != null  && searchInput.getEage()>0, WorkOrderBase::getAge, searchInput.getEage());
169 177
 
170 178
 //        LambdaQueryWrapper<Role> qwrole = new LambdaQueryWrapper<>();
171 179
 //        qwrole.in(Role::getRoleId, CurrentUser().getRoleIds());
@@ -356,6 +364,7 @@ public class WorkOrderBaseController extends BaseController {
356 364
        WorkOrderType typemodel=   workrodertypeService.getEntity(  input.getWorkordercate());
357 365
         input.setAncestor(","+typemodel.getAncestors()+","+input.getWorkordercate()+",");
358 366
 
367
+
359 368
         boolean result = workorderbaseService.insert(input);
360 369
         if ( input.getCallId() !=null && input.getCallId()>0) {
361 370
 
@@ -439,6 +448,8 @@ else {
439 448
                 pt.setName(input.getCaller());
440 449
 
441 450
                 pt.setPatientId(uuid.toString());
451
+                pt.setSex(input.getSex());
452
+                pt.setAge(input.getAge());
442 453
                 try {
443 454
                     if (StringHelper.isNotBlank(input.getCallnum())) {
444 455
                         pt.setPhoneNumber(SecretHelper.AesEncrypt(input.getCallnum()));
@@ -451,6 +462,12 @@ else {
451 462
 
452 463
                 return Success("成功", input.getWorkorderId());
453 464
             } else {
465
+             var pat=    recordList.get(0);
466
+             pat.setAge(input.getAge());
467
+             pat.setSex(input.getSex());
468
+                pat.setUpdateTime(currentDate);
469
+                boolean customeruptresult = patientService.update(pat);
470
+
454 471
                 return Success("成功", input.getWorkorderId());
455 472
             }
456 473
         }
@@ -464,7 +481,7 @@ else {
464 481
         Date currentDate = new Date(System.currentTimeMillis());
465 482
         WorkOrderBase orderBase = workorderbaseService.getEntity(input.getWorkorderId());
466 483
 
467
-        if(!Objects.equals(input.getWorkordercate(), orderBase.getWorkordercate())){
484
+        if(input.getWorkordercate()!=null && input.getWorkordercate()>0 && !Objects.equals(input.getWorkordercate(), orderBase.getWorkordercate())){
468 485
 
469 486
             WorkOrderType typemodel=   workrodertypeService.getEntity(  input.getWorkordercate());
470 487
             input.setAncestor(","+typemodel.getAncestors()+","+input.getWorkordercate()+",");
@@ -489,6 +506,19 @@ else {
489 506
         boolean result = workorderbaseService.update(input);
490 507
         if (result) {
491 508
 
509
+            //判断手机号存在不customer,不存在就添加新用户
510
+            LambdaQueryWrapper<Patient> qw = new LambdaQueryWrapper<>();
511
+            qw.eq(Patient::getPhoneNumber, SecretHelper.AesEncrypt(input.getCallnum()));
512
+            qw.eq(Patient::getIsDelete, 0);
513
+            var  recordList = patientService.getList(qw);
514
+            if(recordList!=null && recordList.size()>0){
515
+                var pat=    recordList.get(0);
516
+                pat.setAge(input.getAge());
517
+                pat.setSex(input.getSex());
518
+                pat.setUpdateTime(currentDate);
519
+                boolean customeruptresult = patientService.update(pat);
520
+            }
521
+
492 522
             boolean logresult = addlog("编辑了工单", "编辑", CurrentUser().getUserName(), orderBase.getWorkordercode(), CurrentUser().getNickName(), "");
493 523
             return Success("成功");
494 524
         } else {
@@ -607,6 +637,14 @@ else {
607 637
     public WorkOrderBaseView trans(WorkOrderBase orderBase) {
608 638
 
609 639
         WorkOrderBaseView ov = JSON.parseObject(JSON.toJSONString(orderBase), WorkOrderBaseView.class);
640
+        if(!StringHelper.isEmpty(orderBase.getHandlingMeasures())){
641
+            String[] targetNames = orderBase.getHandlingMeasures().split(",");
642
+            List<String> targetSet =   Arrays.asList(targetNames);
643
+            String hmn= dictDataService.selectDictLabels("order_handling_measures",targetSet);
644
+            ov.setHandlingMeasuresName( hmn);
645
+        }
646
+
647
+
610 648
         if(orderBase.getWorkorderstate()>EnumOrderStatus.dhf.getValue()){
611 649
             LambdaQueryWrapper<WorkOrderVisitLog> la=new LambdaQueryWrapper<>();
612 650
             la.eq(WorkOrderVisitLog::getWorkordercode,orderBase.getWorkordercode());
@@ -1190,6 +1228,8 @@ else {
1190 1228
     public void exportExcel( WorkOrderBase input,Integer  listType) {
1191 1229
         LambdaQueryWrapper<WorkOrderBase> qw = new LambdaQueryWrapper<>();
1192 1230
 
1231
+        qw.eq( input.getSex()!=null && input.getSex()>-1, WorkOrderBase::getSex, input.getSex());
1232
+
1193 1233
         qw.eq(input.getFirsttype()!=null && input.getFirsttype()>0,WorkOrderBase::getFirsttype, input.getFirsttype());
1194 1234
         qw.like(!StringHelper.isEmpty(input.getCallnum()), WorkOrderBase::getCallnum, input.getCallnum());
1195 1235
         qw.like(!StringHelper.isEmpty(input.getCaller()), WorkOrderBase::getCaller, input.getCaller());

+ 1 - 1
hjzx-api/src/main/java/api/controller/report/WorkReportController.java

@@ -110,7 +110,7 @@ public class WorkReportController extends BaseController {
110 110
                     report.setAnswerRate(String.format("%.2f", Answer*100)+ "%"); ;
111 111
                     if ((report.getSatisfied()+report.getNoSatisfied())>0)
112 112
                     {
113
-                        double  myd = ((double)report.getSatisfied()/(report.getSatisfied()+report.getNoSatisfied()));//结果的百分比
113
+                        double  myd = ((double)report.getSatisfied()+report.getSatisfactory()/(report.getSatisfied()+report.getNoSatisfied()+report.getSatisfactory()));//结果的百分比
114 114
                         report.setMydRate(String.format("%.2f", myd*100)+ "%");
115 115
                     }
116 116
                 }

+ 6 - 2
hjzx-api/src/main/java/api/controller/survey/SurveyController.java

@@ -651,9 +651,13 @@ public AjaxResult getStatisScoreRange(@PathVariable long id) {
651 651
                 sf.setPer("0");
652 652
             } else {
653 653
 
654
-                double percentage = ((double) sf.getTotal() / totalnum) * 100;
654
+              //  double percentage = ((double) sf.getTotal() / totalnum) * 100;
655 655
 
656
-                sf.setPer(percentage + "%");
656
+                double ratio = (double) sf.getTotal() / totalnum;
657
+                DecimalFormat df = new DecimalFormat("0.00%");
658
+                String result = df.format(ratio); // 自动转为30.67%
659
+
660
+                sf.setPer(df.format(ratio));
657 661
             }
658 662
         }
659 663
     }

+ 5 - 1
hjzx-entity/src/main/java/api/entity/database/order/WorkOrderBase.java

@@ -217,5 +217,9 @@ public class WorkOrderBase {
217 217
     @TableField(exist = false)
218 218
     @ApiModelProperty("问卷id")
219 219
     private Long surveyId;
220
-
220
+    @ApiModelProperty("性别,存男、女")
221
+    private Long sex;
222
+    /** 处理措施 */
223
+    @ApiModelProperty("处理措施")
224
+    private String handlingMeasures;
221 225
 }

+ 19 - 0
hjzx-entity/src/main/java/api/entity/input/order/OrderSearchInput.java

@@ -0,0 +1,19 @@
1
+package api.entity.input.order;
2
+
3
+import com.fasterxml.jackson.annotation.JsonFormat;
4
+import io.swagger.annotations.ApiModelProperty;
5
+import lombok.Data;
6
+
7
+import java.util.Date;
8
+import java.util.List;
9
+
10
+@Data
11
+public class OrderSearchInput {
12
+
13
+
14
+    @ApiModelProperty("年龄搜索小值")
15
+    private  Long  sage;
16
+    @ApiModelProperty("年龄搜索大值")
17
+    private  Long  eage;
18
+
19
+}

+ 2 - 0
hjzx-entity/src/main/java/api/entity/view/order/WorkOrderBaseView.java

@@ -61,6 +61,8 @@ public class WorkOrderBaseView extends WorkOrderBase {
61 61
     private Date visitTime;
62 62
     private  String dealmethod;
63 63
 
64
+    @ApiModelProperty("处理措施显示")
65
+    private  String handlingMeasuresName;
64 66
 
65 67
 
66 68
 }

+ 4 - 0
hjzx-entity/src/main/java/api/entity/view/report/RecordReport.java

@@ -29,6 +29,10 @@ public class RecordReport {
29 29
     @ApiModelProperty("满意量")
30 30
     private long satisfied;
31 31
 
32
+    @ApiModelProperty("基本满意量")
33
+    private long satisfactory;
34
+
35
+
32 36
     @ApiModelProperty("不满意量")
33 37
     private long noSatisfied;
34 38
 

+ 2 - 0
hjzx-mapper/src/main/java/api/mapper/patient/BlackListMapper.java

@@ -6,4 +6,6 @@ import org.apache.ibatis.annotations.Mapper;
6 6
 
7 7
 @Mapper
8 8
 public interface BlackListMapper extends BaseMapper<BlackList> {
9
+
10
+    Long  existBlackByphone(String phone) ;
9 11
 }

+ 6 - 0
hjzx-mapper/src/main/java/api/mapper/system/DictDataMapper.java

@@ -4,6 +4,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import api.entity.database.system.DictData;
5 5
 import org.apache.ibatis.annotations.Mapper;
6 6
 
7
+import java.util.List;
8
+
7 9
 @Mapper
8 10
 public interface DictDataMapper extends BaseMapper<DictData> {
11
+    String selectDictLabels(
12
+            String dictType,          // dict_type的变量
13
+            List<String> dictValues         // dict_value的变量(逗号分隔字符串)
14
+    ) ;
9 15
 }

+ 33 - 0
hjzx-mapper/src/main/resources/mapper/patient/BlackListMapper.xml

@@ -0,0 +1,33 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="api.mapper.patient.BlackListMapper">
6
+
7
+
8
+	<select id="existBlackByphone"     resultType="Long"  >
9
+		SELECT COUNT(1) FROM p_blacklist
10
+		<where>
11
+			is_delete = 0
12
+			<if test="phone != null  and phone != '' ">
13
+				and phone_number = #{phone}
14
+			</if>
15
+			AND (
16
+			(starttime &lt; NOW() AND endtime &gt; NOW())
17
+			OR (starttime IS NULL AND endtime IS NULL)
18
+			OR (starttime &lt; NOW() AND endtime IS NULL)
19
+			)
20
+		</where>
21
+
22
+	</select>
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+</mapper> 

+ 5 - 1
hjzx-mapper/src/main/resources/mapper/report/ReportMapper.xml

@@ -37,6 +37,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
37 37
 		<result property="ldCount"     column="ldCount"      />
38 38
 		<result property="noAnswer"     column="noAnswer"      />
39 39
 		<result property="satisfied"     column="satisfied"      />
40
+		<result property="satisfactory"     column="satisfactory"      />
41
+
40 42
 		<result property="noSatisfied"     column="noSatisfied"      />
41 43
 	</resultMap>
42 44
 
@@ -230,7 +232,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
230 232
 		COUNT(1) ldCount,
231 233
 		SUM(CASE `is_answer` WHEN  1 THEN 1 ELSE 0  END ) answer,
232 234
 		SUM(CASE `is_answer` WHEN 0 THEN 1 ELSE 0  END ) noAnswer,
233
-		SUM(CASE WHEN `myd`>0  and `myd` <![CDATA[<]]> 3 THEN 1 ELSE 0  END ) satisfied,
235
+-- 		SUM(CASE WHEN `myd`>0  and `myd` <![CDATA[<]]> 3 THEN 1 ELSE 0  END ) satisfied,
236
+		SUM(CASE WHEN `myd`=1 THEN 1 ELSE 0  END ) satisfied,
237
+		SUM(CASE WHEN `myd`=2 THEN 1 ELSE 0  END ) satisfactory,
234 238
 		SUM(CASE WHEN `myd`=3 THEN 1 ELSE 0  END ) noSatisfied
235 239
 
236 240
 		FROM `rep_record` a

+ 21 - 0
hjzx-mapper/src/main/resources/mapper/system/DictDataMapper.xml

@@ -0,0 +1,21 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="api.mapper.system.DictDataMapper">
6
+
7
+
8
+    <select id="selectDictLabels" resultType="java.lang.String">
9
+        SELECT GROUP_CONCAT(dict_label SEPARATOR ',')
10
+        FROM sys_dict_data
11
+        WHERE dict_type = #{dictType}  <!-- 直接引用变量 -->
12
+        AND dict_value IN
13
+        <foreach item="item" collection="dictValues" open="(" separator="," close=")">
14
+            #{item}
15
+        </foreach>
16
+
17
+    </select>
18
+
19
+
20
+
21
+</mapper> 

+ 1 - 0
hjzx-service/src/main/java/api/service/patient/IBlackListService.java

@@ -4,4 +4,5 @@ import api.entity.database.patient.BlackList;
4 4
 import api.service.IBaseService;
5 5
 
6 6
 public interface IBlackListService extends IBaseService<BlackList> {
7
+    Long  existBlackByphone(String phone);
7 8
 }

+ 9 - 0
hjzx-service/src/main/java/api/service/patient/impl/BlackListServiceImpl.java

@@ -1,14 +1,23 @@
1 1
 package api.service.patient.impl;
2 2
 
3 3
 import api.entity.database.patient.BlackList;
4
+import api.mapper.order.WorkOrderBaseMapper;
4 5
 import api.mapper.patient.BlackListMapper;
5 6
 import api.service.patient.IBlackListService;
6 7
 import api.service.BaseServiceImpl;
8
+import org.springframework.beans.factory.annotation.Autowired;
7 9
 import org.springframework.stereotype.Service;
8 10
 import org.springframework.transaction.annotation.Transactional;
11
+import org.yaml.snakeyaml.LoaderOptions;
9 12
 
10 13
 @Transactional
11 14
 @Service
12 15
 public class BlackListServiceImpl extends BaseServiceImpl<BlackListMapper, BlackList> implements IBlackListService{
13 16
     public BlackListServiceImpl(){ super(false); }
17
+    @Autowired
18
+    private BlackListMapper blackListMapper;
19
+    @Override
20
+     public Long existBlackByphone(String phone) {
21
+          return blackListMapper.existBlackByphone(phone);
22
+    }
14 23
 }

+ 8 - 0
hjzx-service/src/main/java/api/service/system/IDictDataService.java

@@ -3,5 +3,13 @@ package api.service.system;
3 3
 import api.entity.database.system.DictData;
4 4
 import api.service.IBaseService;
5 5
 
6
+import java.util.List;
7
+
6 8
 public interface IDictDataService extends IBaseService<DictData> {
9
+
10
+
11
+    String selectDictLabels(
12
+            String dictType,          // dict_type的变量
13
+            List<String> dictValues       // dict_value的变量(逗号分隔字符串)
14
+    );
7 15
 }

+ 13 - 0
hjzx-service/src/main/java/api/service/system/impl/DictDataServiceImpl.java

@@ -2,13 +2,17 @@ package api.service.system.impl;
2 2
 
3 3
 
4 4
 import api.entity.database.system.DictData;
5
+import api.mapper.system.DeptMapper;
5 6
 import api.mapper.system.DictDataMapper;
6 7
 
7 8
 import api.service.BaseServiceImpl;
8 9
 import api.service.system.IDictDataService;
10
+import org.springframework.beans.factory.annotation.Autowired;
9 11
 import org.springframework.stereotype.Service;
10 12
 import org.springframework.transaction.annotation.Transactional;
11 13
 
14
+import java.util.List;
15
+
12 16
 @Transactional
13 17
 @Service
14 18
 public class DictDataServiceImpl  extends BaseServiceImpl<DictDataMapper, DictData>   implements IDictDataService {
@@ -16,6 +20,15 @@ public class DictDataServiceImpl  extends BaseServiceImpl<DictDataMapper, DictDa
16 20
     public DictDataServiceImpl() {
17 21
         super(true);
18 22
     }
23
+    @Autowired
24
+    private DictDataMapper dictDataMapper;
25
+    @Override
26
+    public   String selectDictLabels(
27
+            String dictType,          // dict_type的变量
28
+            List<String> dictValues         // dict_value的变量(逗号分隔字符串)
29
+    ) {
30
+return  dictDataMapper.selectDictLabels(dictType,dictValues);
31
+    }
19 32
 }
20 33
 
21 34