liyuanyuan 9 ay önce
ebeveyn
işleme
66ee279e54

+ 27 - 8
hjzx-api/src/main/java/api/controller/order/WorkOrderBaseController.java

@@ -187,6 +187,12 @@ public class WorkOrderBaseController extends BaseController {
187 187
                 break;
188 188
             case 4:
189 189
                 qw.eq(WorkOrderBase::getWorkorderstate, EnumOrderStatus.dhf.getValue());
190
+               // qw.eq(WorkOrderBase::getIsYj,null).or().isNull(WorkOrderBase::getIsYj);
191
+                qw.and(wrapper -> wrapper
192
+                        .ne(WorkOrderBase::getIsYj, 1) // is_yj != 1
193
+                        .or()
194
+                        .isNull(WorkOrderBase::getIsYj) // OR is_yj IS NULL
195
+                );
190 196
                 break;
191 197
             //我的回复列表
192 198
             case 5:
@@ -367,16 +373,23 @@ public class WorkOrderBaseController extends BaseController {
367 373
             }
368 374
 
369 375
             //添加操作日志
376
+            String addcon="";
377
+            if(input.getIsYj()!=null &&input.getIsYj()==1){
378
+
379
+                addcon="高危";
380
+            }
370 381
             if (input.getIsend() == 0) {
371
-                boolean logresult = addlog("创建了工单", "创建", CurrentUser().getUserName(), input.getWorkordercode(), CurrentUser().getNickName(), "");
382
+
383
+
384
+                boolean logresult = addlog("创建了"+addcon+"工单", "创建", CurrentUser().getUserName(), input.getWorkordercode(), CurrentUser().getNickName(), "");
372 385
             } else {
373 386
                 //结束了 已完成
374 387
 if(input.getIsNeedVisit()==1){
375
-    boolean logresult = addlog("创建了工单,工单待回访", "创建", CurrentUser().getUserName(), input.getWorkordercode(), CurrentUser().getNickName(), "");
388
+    boolean logresult = addlog("创建了"+addcon+"工单,工单待回访", "创建", CurrentUser().getUserName(), input.getWorkordercode(), CurrentUser().getNickName(), "");
376 389
 
377 390
 }
378 391
 else {
379
-    boolean logresult = addlog("创建并完成了工单" + dealContent, "创建并完成", CurrentUser().getUserName(), input.getWorkordercode(), CurrentUser().getNickName(), "");
392
+    boolean logresult = addlog("创建并完成了"+addcon+"工单" + dealContent, "创建并完成", CurrentUser().getUserName(), input.getWorkordercode(), CurrentUser().getNickName(), "");
380 393
 
381 394
 }
382 395
             }
@@ -1141,7 +1154,7 @@ else {
1141 1154
     @ApiOperation("导出Excel")
1142 1155
     @Log(title = "导出Excel", businessType = BusinessType.EXPORT)
1143 1156
     @PostMapping("/exportExcel")
1144
-    @Anonymous
1157
+
1145 1158
     public void exportExcel( WorkOrderBase input,Integer  listType) {
1146 1159
         LambdaQueryWrapper<WorkOrderBase> qw = new LambdaQueryWrapper<>();
1147 1160
 
@@ -1436,7 +1449,10 @@ else {
1436 1449
     @ApiOperation("移除高危工单")
1437 1450
     @Log(title = "移除高危工单", businessType = BusinessType.UPDATE)
1438 1451
     @PutMapping("/remove")
1439
-    public AjaxResult remove(@RequestParam String code){
1452
+
1453
+    public AjaxResult remove(@RequestBody  HashMap<String,Object> map){
1454
+
1455
+        String code=map.get("code").toString();
1440 1456
         if(StringHelper.isEmpty(code)){
1441 1457
             return  Error("工单编号不能为空");
1442 1458
         }
@@ -1446,15 +1462,18 @@ else {
1446 1462
         //工单状态改
1447 1463
         qw.set(WorkOrderBase::getIsYj,  2L);
1448 1464
         boolean update = workorderbaseService.updateBatch(qw);
1449
-        if(update)
1450
-        return  Success("移除成功");
1465
+        if(update){
1466
+            addlog("移除了高危工单", "移除", CurrentUser().getUserName(), code, CurrentUser().getNickName(), "");
1467
+            return  Success("移除成功");
1468
+
1469
+        }
1451 1470
         else return  Error("移除失败");
1452 1471
     }
1453 1472
 
1454 1473
 
1455 1474
     @ApiOperation("根据工单编号获取填写的问卷")
1456 1475
     @Log(title = "根据工单编号获取填写的问卷", businessType = BusinessType.UPDATE)
1457
-    @PutMapping("/getsurveyinfo")
1476
+    @GetMapping("/getsurveyinfo")
1458 1477
     public AjaxResult getSurveyInfo(@RequestParam String code) {
1459 1478
         if (StringHelper.isEmpty(code)) {
1460 1479
             return Error("code不能为空");

+ 63 - 2
hjzx-api/src/main/java/api/controller/patient/BlackListController.java

@@ -1,11 +1,14 @@
1 1
 package api.controller.patient;
2 2
 
3
+import api.entity.database.call.Blacklist;
3 4
 import api.entity.database.patient.Patient;
4 5
 import api.entity.database.patient.PatientLog;
5 6
 import api.entity.input.patient.AddBlackListInput;
7
+import api.service.call.IBlacklistService;
6 8
 import api.service.patient.IPatientLogService;
7 9
 import api.service.patient.IPatientService;
8 10
 import api.util.enums.PhoneStatus;
11
+import api.util.helper.DateHelper;
9 12
 import api.util.helper.SecretHelper;
10 13
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
11 14
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@@ -27,7 +30,7 @@ import java.util.Arrays;
27 30
 import java.util.Date;
28 31
 import java.util.List;
29 32
 import java.util.Map;
30
-
33
+import api.service.call.IBlacklistService;
31 34
 @Api(value = "黑名单",tags = "黑名单")
32 35
 @RestController
33 36
 @RequestMapping("/patient/black")
@@ -38,6 +41,9 @@ public class BlackListController extends BaseController {
38 41
     private IPatientLogService patientlogService;
39 42
 
40 43
     @Autowired
44
+    private IBlacklistService callblacklistService;
45
+
46
+    @Autowired
41 47
     private IPatientService patientService;
42 48
 
43 49
     @ApiOperation("列表")
@@ -117,6 +123,26 @@ public class BlackListController extends BaseController {
117 123
             wrapper.set(Patient::getPhoneStatus, PhoneStatus.BLACK.getValue());
118 124
           boolean paresult=  patientService.updateBatch(wrapper);
119 125
 
126
+          //同步到通话记录的黑名单表
127
+            Blacklist blacklist=new Blacklist();
128
+            blacklist.setCreateBy(CurrentUser().getUserName());
129
+            blacklist.setCreateTime(new Date());
130
+            blacklist.setDelFlag("0");
131
+            if(input.getStarttime()==null && input.getEndtime()==null){
132
+                blacklist.setBlackType(2L);
133
+            }
134
+             else {
135
+                blacklist.setBlackType(1L);
136
+                blacklist.setStartTime(input.getStarttime());
137
+                blacklist.setEndTime(input.getEndtime());
138
+            }
139
+
140
+            blacklist.setCallNumber(SecretHelper.AesDecrypt(patient.getPhoneNumber()));
141
+
142
+            blacklist.setRemark(input.getReason());
143
+            callblacklistService.insert(blacklist);
144
+
145
+
120 146
             return Success("成功");
121 147
         } else {
122 148
             return Error("新增失败");
@@ -137,15 +163,34 @@ public class BlackListController extends BaseController {
137 163
         qw.set(BlackList::getStarttime, input.getStarttime());
138 164
      //   qw.set(BlackList::getPhoneNumber, input.getPhoneNumber());
139 165
 
166
+
140 167
         boolean result = blacklistService.updateBatch(qw);
141 168
         if (result) {
169
+            BlackList bl=blacklistService.getEntity(input.getBlackId());
170
+            String callnum= SecretHelper.AesDecrypt(  bl.getPhoneNumber());
171
+            LambdaUpdateWrapper<Blacklist> updateWrapper=new LambdaUpdateWrapper<>();
172
+            updateWrapper.eq(Blacklist::getCallNumber,callnum);
173
+            updateWrapper.set(Blacklist::getStartTime,input.getStarttime());
174
+            updateWrapper.set(Blacklist::getEndTime,input.getEndtime());
175
+            updateWrapper.set(Blacklist::getRemark,input.getReason());
176
+            updateWrapper.set(Blacklist::getUpdateBy,CurrentUser().getUserName());
177
+            updateWrapper.set(Blacklist::getUpdateTime,new Date());
178
+
179
+            if(input.getStarttime()==null && input.getEndtime()==null){
180
+                updateWrapper.set(Blacklist::getBlackType,2L);
181
+            }
182
+            else {
183
+                updateWrapper.set(Blacklist::getBlackType,1L);
184
+            }
185
+            callblacklistService.updateBatch(updateWrapper);
186
+
142 187
             return Success("成功");
143 188
         } else {
144 189
             return Error("修改失败");
145 190
         }
146 191
     }
147 192
 
148
-    @ApiOperation("批量解除黑名单,参数是blackid")
193
+    @ApiOperation("批量解除黑名单,参数是blackid,其实只能传1个")
149 194
     @Log(title = "批量解除黑名单p_blacklist",businessType = BusinessType.DELETE)
150 195
     @DeleteMapping("/{ids}")
151 196
     public AjaxResult delete(@PathVariable Long[] ids)  {
@@ -155,6 +200,22 @@ public class BlackListController extends BaseController {
155 200
         lp.set(BlackList::getIsDelete, 1);
156 201
         boolean result = blacklistService.updateBatch(lp);
157 202
         if (result) {
203
+
204
+            for (Long id :ids){
205
+                BlackList bl=blacklistService.getEntity(id);
206
+               String callnum= SecretHelper.AesDecrypt(  bl.getPhoneNumber());
207
+
208
+                LambdaUpdateWrapper<Blacklist> lplp = new LambdaUpdateWrapper<>();
209
+                lplp.eq(Blacklist::getCallNumber,callnum);
210
+                lplp.set(Blacklist::getDelFlag,2L);
211
+                lplp.set(Blacklist::getDelTime,new Date());
212
+                lplp.set(Blacklist::getDelBy,CurrentUser().getUserName());
213
+                callblacklistService.updateBatch(lplp);
214
+            }
215
+
216
+
217
+
218
+
158 219
             //删除标签 存log记录
159 220
             LambdaQueryWrapper<BlackList> qw1 = new LambdaQueryWrapper<>();
160 221
             qw1.in(BlackList::getBlackId, ids).select(BlackList::getPatientId, BlackList::getPatientName);

+ 34 - 18
hjzx-api/src/main/java/api/controller/survey/AnswerSheetController.java

@@ -1,16 +1,12 @@
1 1
 package api.controller.survey;
2 2
 
3 3
 import api.entity.database.patient.Patient;
4
-import api.entity.database.survey.Answer;
5
-import api.entity.database.survey.ScoreRange;
6
-import api.entity.database.survey.Survey;
4
+import api.entity.database.survey.*;
7 5
 import api.entity.view.survey.AnswerSheetView;
8 6
 
9 7
 import api.service.patient.IPatientLogService;
10 8
 import api.service.patient.IPatientService;
11
-import api.service.survey.IAnswerService;
12
-import api.service.survey.IScoreRangeService;
13
-import api.service.survey.ISurveyService;
9
+import api.service.survey.*;
14 10
 import api.util.annotation.Anonymous;
15 11
 import api.util.helper.DateHelper;
16 12
 import api.util.helper.SecretHelper;
@@ -20,10 +16,8 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
20 16
 import com.baomidou.mybatisplus.core.metadata.IPage;
21 17
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
22 18
 import api.controller.BaseController;
23
-import api.entity.database.survey.AnswerSheet;
24 19
 import api.entity.input.PageInput;
25 20
 import api.model.AjaxResult;
26
-import api.service.survey.IAnswerSheetService;
27 21
 import api.util.annotation.Log;
28 22
 import api.util.enums.BusinessType;
29 23
 import api.util.helper.StringHelper;
@@ -32,6 +26,7 @@ import io.swagger.annotations.Api;
32 26
 import io.swagger.annotations.ApiOperation;
33 27
 import org.apache.commons.collections4.map.LinkedMap;
34 28
 import org.springframework.beans.factory.annotation.Autowired;
29
+import org.springframework.transaction.annotation.Transactional;
35 30
 import org.springframework.web.bind.annotation.*;
36 31
 
37 32
 import java.util.*;
@@ -53,11 +48,14 @@ public class AnswerSheetController extends BaseController {
53 48
     private IScoreRangeService scorerangeService;
54 49
     @Autowired
55 50
     private IPatientService patientService;
56
-
51
+    @Autowired
52
+    private IOptionService optionService;
53
+    @Autowired
54
+    private IQuestionService questionService;
57 55
     @ApiOperation("根据surveyid查询用户列表")
58 56
     @Log(title = "查询q_answersheet列表",businessType = BusinessType.QUERY)
59 57
     @GetMapping
60
-    @Anonymous
58
+
61 59
     public AjaxResult getList(AnswerSheet input, PageInput pageInput) {
62 60
 
63 61
        if  (input.getSurveyid() == null || input.getSurveyid() == 0){
@@ -126,13 +124,14 @@ public class AnswerSheetController extends BaseController {
126 124
     @ApiOperation("问卷填写答案")
127 125
     @Log(title = "新增q_answersheet",businessType = BusinessType.INSERT)
128 126
     @PostMapping
129
-    @Anonymous
127
+
128
+    @Transactional
130 129
     public AjaxResult add(@RequestBody AnswerSheetView input) {
130
+
131 131
         Survey s= surveyService.getEntity(input.getSurveyid());
132 132
 
133 133
         if(Objects.equals(s.getStatus(), "1")){
134 134
             return  Error("该问卷未发布");
135
-
136 135
         }
137 136
         else if (Objects.equals(s.getStatus(), "3")){
138 137
         }
@@ -178,6 +177,12 @@ public class AnswerSheetController extends BaseController {
178 177
         answerSheet.setTaskId(input.getTaskId());
179 178
         answerSheet.setCallId(input.getCallId());
180 179
         boolean result = answersheetService.insert(answerSheet);
180
+      LambdaQueryWrapper<Option> asq=new LambdaQueryWrapper<>();
181
+      asq.eq(Option::getSurveyid,input.getSurveyid());
182
+     List<Option> options=   optionService.getList(asq);
183
+
184
+
185
+
181 186
         if (result) {
182 187
             //给suvery更新一下答题的人数
183 188
             LambdaUpdateWrapper<Survey> sqw=new LambdaUpdateWrapper<>();
@@ -193,8 +198,18 @@ public class AnswerSheetController extends BaseController {
193 198
                     as.setCreatetime(currentDate);
194 199
                     as.setDeleteflag(0L);
195 200
                     as.setSheetId(answerSheet.getAnswersheetId());
196
-                    if(as.getScore()!=null  && as.getScore()>0) {
197
-                        totalscore=totalscore+as.getScore();
201
+                    if(as.getOptionid()!=null && as.getOptionid()>0){
202
+                        //这是单选
203
+                        Optional<Long> scoreOptional = options.stream()
204
+                                .filter(x -> Objects.equals(x.getOptionId(), as.getOptionid()))
205
+                                .map(Option::getScore)
206
+                                .filter(Objects::nonNull)  // 过滤掉 null 值
207
+                                .findFirst();
208
+                        Long score = scoreOptional.orElse(0L);  // 如果没有找到 score,返回默认值 0
209
+
210
+                            totalscore=totalscore+score;
211
+
212
+                            as.setScore(score);
198 213
                     }
199 214
                     answerService.insert(as);
200 215
                 }
@@ -204,11 +219,11 @@ public class AnswerSheetController extends BaseController {
204 219
             if ( totalscore >=0) {
205 220
                 //根据总分和surveyid 判断是哪个标签名,存一下
206 221
             Map<String,Object> resmap= scorerangeService.selectLabelColorBySurveyIdTotalScore(input.getSurveyid(),totalscore);
207
-              if( resmap.containsKey("labelName")){
222
+              if( resmap!=null &&  resmap.containsKey("labelName")){
208 223
                   labelname=  resmap.get("labelName").toString();
209 224
 
210 225
               }
211
-                if( resmap.containsKey("color")){
226
+                if(resmap!=null &&  resmap.containsKey("color")){
212 227
                     color=  resmap.get("color").toString();
213 228
 
214 229
                 }
@@ -218,7 +233,8 @@ public class AnswerSheetController extends BaseController {
218 233
                 las.set(AnswerSheet::getLabelName,labelname);
219 234
                 answersheetService.updateBatch(las);
220 235
             }
221
-            if(Objects.equals(s.getSurveyType(), "ldtp") && totalscore>=s.getYjMinScore()){
236
+            //s.getYjMinScore()!=null &&
237
+            if(s.getYjMinScore()!=null && Objects.equals(s.getSurveyType(), "ldtp") && totalscore>=s.getYjMinScore()){
222 238
 
223 239
                 Map<String,Object> map=new LinkedHashMap<>();
224 240
                 map.put("surveyId",input.getSurveyid() );
@@ -290,7 +306,7 @@ public class AnswerSheetController extends BaseController {
290 306
     @ApiOperation("根据问卷id获取问卷填写的有效数量和总数")
291 307
     @Log(title = "根据问卷id获取问卷填写的有效数量和总数",businessType = BusinessType.INSERT)
292 308
     @GetMapping("/getcount")
293
-    @Anonymous
309
+
294 310
     public AjaxResult getcount(@RequestParam long surveyId) {
295 311
 
296 312
         LambdaQueryWrapper<AnswerSheet> lqw=new LambdaQueryWrapper<>();

+ 34 - 19
hjzx-api/src/main/java/api/controller/survey/SurveyController.java

@@ -30,6 +30,7 @@ import lombok.var;
30 30
 import org.checkerframework.checker.nullness.Opt;
31 31
 import org.elasticsearch.cluster.metadata.AliasAction;
32 32
 import org.springframework.beans.factory.annotation.Autowired;
33
+import org.springframework.transaction.annotation.Transactional;
33 34
 import org.springframework.web.bind.annotation.*;
34 35
 
35 36
 import java.text.DecimalFormat;
@@ -139,7 +140,7 @@ public class SurveyController extends BaseController {
139 140
     @ApiOperation("详情 参数是id和分类名")
140 141
     @Log(title = "查询q_survey详情",businessType = BusinessType.QUERY)
141 142
     @GetMapping("/getinfo")
142
-    @Anonymous
143
+
143 144
     public AjaxResult getInfo(   long id,   String classname) {
144 145
         //根据问卷id 获取问题及选项
145 146
         Survey survey=  surveyService.getEntity(id) ;
@@ -181,7 +182,7 @@ public class SurveyController extends BaseController {
181 182
     @ApiOperation("详情")
182 183
     @Log(title = "查询q_survey详情",businessType = BusinessType.QUERY)
183 184
     @GetMapping("/getdetail")
184
-    @Anonymous
185
+
185 186
     public AjaxResult getdetail( @RequestParam long id,
186 187
                                  @RequestParam(required = false) String user,
187 188
                                  @RequestParam(required = false) String patientid,
@@ -254,9 +255,9 @@ public class SurveyController extends BaseController {
254 255
 
255 256
          List<Answer> det=   answerList.stream().filter(x->x.getQuestionid().equals(qs.getQuestionId())  ).collect(Collectors.toList());
256 257
 
257
-         if(sheetid!=null && sheetid>0){
258
-             det=det.stream().filter(x->x.getSheetId()==sheetid).collect(Collectors.toList());
259
-         }
258
+//         if(sheetid!=null && sheetid>0){
259
+//             det=det.stream().filter(x->x.getSheetId()==sheetid).collect(Collectors.toList());
260
+//         }
260 261
          if(det==null || det.stream().count()==0){
261 262
                 qsv.setAnswerdetail("");
262 263
             }
@@ -274,7 +275,10 @@ public class SurveyController extends BaseController {
274 275
             {
275 276
 //              var vv=  answerList.stream().filter(x->x.getQuestionid().equals(qs.getQuestionId())).findAny();
276 277
 //                vv.ifPresent(answer -> qsv.setScore(answer.getScore()));
277
-                qsv.setScore(answerList.stream().filter(x->x.getQuestionid().equals(qs.getQuestionId())).findAny().get().getScore());
278
+
279
+//              try{
280
+//                  qsv.setScore(answerList.stream().filter(x->x.getQuestionid().equals(qs.getQuestionId())).findAny().get().getScore());
281
+//              }catch (){}
278 282
                 qsv.setAnswerdetail(answerList.stream().filter(x->x.getQuestionid().equals(qs.getQuestionId())).findAny().get().getAnswer());
279 283
             }
280 284
             System.out.println(qsv);
@@ -303,7 +307,7 @@ public class SurveyController extends BaseController {
303 307
     @ApiOperation("新增")
304 308
     @Log(title = "新增q_survey",businessType = BusinessType.INSERT)
305 309
     @PostMapping
306
-
310
+    @Transactional
307 311
     public AjaxResult add(@RequestBody SurveyView input) {
308 312
         if (input.getQuestionlist() == null || input.getQuestionlist().stream().count() == 0) {
309 313
             return Error("问题不能为空");
@@ -402,8 +406,9 @@ public class SurveyController extends BaseController {
402 406
                 if(input.getScoreRanges()!=null && !input.getScoreRanges().isEmpty())
403 407
                 {
404 408
                       for (ScoreRange sr : input.getScoreRanges()){
405
-                          if(sr.isCheckin()){
406
-                              LambdaUpdateWrapper<Survey> luw=new LambdaUpdateWrapper<>();
409
+                         // if(sr.isCheckin()){
410
+                          if(StringHelper.isNotEmpty(input.getSurveyScoreLabel()) &&  Objects.equals(sr.getLabelName(), input.getSurveyScoreLabel()))
411
+                          {  LambdaUpdateWrapper<Survey> luw=new LambdaUpdateWrapper<>();
407 412
                               luw.set(Survey::getYjMinScore,sr.getMin());
408 413
                               luw.set(Survey::getSurveyScoreLabel,sr.getLabelName());
409 414
                               luw.eq(Survey::getSurveyId,surveyid);
@@ -411,6 +416,7 @@ public class SurveyController extends BaseController {
411 416
                           }
412 417
                           sr.setSurveyId(surveyid);
413 418
                            sr.setCreateBy(CurrentUser().getUserName());
419
+                          sr.setCreateTime(new Date());
414 420
                           scoreRangeService.insert(sr);
415 421
                       }
416 422
 
@@ -481,7 +487,7 @@ public class SurveyController extends BaseController {
481 487
     @ApiOperation("统计详情")
482 488
     @Log(title = "查询q_survey详情",businessType = BusinessType.QUERY)
483 489
     @GetMapping("/answerstatis/{id}")
484
-    @Anonymous
490
+
485 491
     public AjaxResult getAnswerStatis(@PathVariable long id) {
486 492
         List<AnswerStatisView> statisViewList = answerService.selectAnswerStatis(id);
487 493
         //根据问卷id 获取问题及选项
@@ -534,7 +540,7 @@ public class SurveyController extends BaseController {
534 540
     @ApiOperation("数据导出Excel")
535 541
     @Log(title = "回答数据导出Excel", businessType = BusinessType.EXPORT)
536 542
     @PostMapping("/answerlist/exportExcel")
537
-    @Anonymous
543
+
538 544
     public void answerListExportExcel(Long surveyid) {
539 545
         LambdaQueryWrapper<Question> qw=new LambdaQueryWrapper<>();
540 546
         qw.eq(Question::getSurveyid,surveyid);
@@ -597,7 +603,7 @@ public class SurveyController extends BaseController {
597 603
     @ApiOperation("查询q_survey问题的分类")
598 604
     @Log(title = "查询q_survey问题的分类",businessType = BusinessType.QUERY)
599 605
     @GetMapping("getclassification")
600
-    @Anonymous
606
+
601 607
     public AjaxResult getInfoByType( long id) {
602 608
         LambdaQueryWrapper<Question> qw = new LambdaQueryWrapper();
603 609
         if(id>0){
@@ -661,6 +667,7 @@ public AjaxResult getStatisScoreRange(@PathVariable long id) {
661 667
     @ApiOperation("根据手机号,问卷id 获取填写的sheet数据")
662 668
     @Log(title = "根据工单编号获取填写的问卷", businessType = BusinessType.UPDATE)
663 669
     @GetMapping("/getsurveyinfo")
670
+
664 671
     public AjaxResult getSurveyInfo(@RequestParam String phone,@RequestParam long surveyid){
665 672
         if ( StringHelper.isEmpty( phone)){
666 673
             return  Error("phone不能为空");
@@ -674,19 +681,27 @@ public AjaxResult getStatisScoreRange(@PathVariable long id) {
674 681
         LambdaQueryWrapper<AnswerSheet> lqw=new LambdaQueryWrapper<>();
675 682
         lqw.eq(AnswerSheet::getSurveyid,surveyid);
676 683
         lqw.eq(AnswerSheet::getEnterphone, SecretHelper.AesEncrypt( phone));
684
+        lqw.orderByDesc(AnswerSheet::getCreatetime);
677 685
         List<AnswerSheet> lists=  answerSheetService.getList(lqw);
678 686
          for (AnswerSheet as :lists){
679 687
 
680
-             Optional<String> color = sclist.stream()
681
-                     .filter(scoreRange -> as.getLabelName().equals(scoreRange.getLabelName())) // 过滤 label 为 "张三" 的对象
682
-                     .map(ScoreRange::getColor) // 映射到 color 字段
683
-                     .findFirst(); // 获取第一个匹配的 color
688
+             if(StringHelper.isNotEmpty(as.getLabelName())){
689
+                 Optional<String> color = sclist.stream()
690
+                         .filter(scoreRange -> as.getLabelName().equals(scoreRange.getLabelName())) // 过滤 label 为 "张三" 的对象
691
+                         .map(ScoreRange::getColor)  // 映射到 color 字段
692
+                         .filter(Objects::nonNull)  // 过滤掉 null 值
693
+                         .findFirst();
694
+
695
+
696
+                 if (color.isPresent()) {
697
+                     as.setYjColor(color.get());
698
+                 }
684 699
 
685
-             if (color.isPresent()) {
686
-                 as.setYjColor(color.get());
687 700
              }
688 701
 
689 702
 
703
+
704
+
690 705
              as.setYjName(as.getLabelName());
691 706
 
692 707
          }
@@ -854,7 +869,7 @@ public AjaxResult getStatisScoreRange(@PathVariable long id) {
854 869
     @ApiOperation("根据callid 获取来电弹屏的问卷列表")
855 870
     @Log(title = "根据工单编号获取填写的问卷", businessType = BusinessType.UPDATE)
856 871
     @GetMapping("/getcallsurvey")
857
-    @Anonymous
872
+
858 873
     public AjaxResult getcallsurvey(@RequestParam String callid,@RequestParam(required = false) String phone,@RequestParam (required = false) String part){
859 874
         LambdaQueryWrapper<Survey> surveyLambdaQueryWrapper =new LambdaQueryWrapper<>();
860 875
         surveyLambdaQueryWrapper.eq(Survey::getSurveyType,"ldtp");