|
@@ -46,8 +46,10 @@ import com.qunzhixinxi.hnqz.common.ding.enums.DingEnum;
|
|
import com.qunzhixinxi.hnqz.common.security.service.HnqzUser;
|
|
import com.qunzhixinxi.hnqz.common.security.service.HnqzUser;
|
|
import com.qunzhixinxi.hnqz.common.security.util.SecurityUtils;
|
|
import com.qunzhixinxi.hnqz.common.security.util.SecurityUtils;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.poi.xssf.extractor.XSSFExportToXml;
|
|
import org.apache.poi.xssf.extractor.XSSFExportToXml;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -57,6 +59,9 @@ import java.time.format.DateTimeFormatter;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
+import static com.qunzhixinxi.hnqz.admin.enums.ReportEnum.REPORT_STATUS_CREATE;
|
|
|
|
+import static com.qunzhixinxi.hnqz.admin.enums.ReportEnum.REPORT_STATUS_SUBMIT;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 积分包
|
|
* 积分包
|
|
*
|
|
*
|
|
@@ -80,6 +85,7 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
private final WmDaDrugEntService wmDaDrugEntService;
|
|
private final WmDaDrugEntService wmDaDrugEntService;
|
|
private final WmScorePackageSettleNoteMapper settleNoteMapper;
|
|
private final WmScorePackageSettleNoteMapper settleNoteMapper;
|
|
private final WmDaDrugEntDrugtableService wmDaDrugEntDrugtableService;
|
|
private final WmDaDrugEntDrugtableService wmDaDrugEntDrugtableService;
|
|
|
|
+ private final WmReportMapper wmReportMapper;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<WmScorePackage> listWmScorePackageAndTask(WmScorePackage wmScorePackage) {
|
|
public List<WmScorePackage> listWmScorePackageAndTask(WmScorePackage wmScorePackage) {
|
|
@@ -744,6 +750,7 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public R getScorePackagePage(Page page, WmScorePackage wmScorePackage) {
|
|
public R getScorePackagePage(Page page, WmScorePackage wmScorePackage) {
|
|
|
|
+
|
|
OrderItem orderItem = new OrderItem();
|
|
OrderItem orderItem = new OrderItem();
|
|
orderItem.setColumn("create_time");
|
|
orderItem.setColumn("create_time");
|
|
orderItem.setAsc(false);
|
|
orderItem.setAsc(false);
|
|
@@ -754,6 +761,10 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
}
|
|
}
|
|
IPage<WmScorePackage> pages = wmScorePackageMapper.getScorePackagekList(page, wmScorePackage);
|
|
IPage<WmScorePackage> pages = wmScorePackageMapper.getScorePackagekList(page, wmScorePackage);
|
|
List<WmScorePackage> records = pages.getRecords();
|
|
List<WmScorePackage> records = pages.getRecords();
|
|
|
|
+
|
|
|
|
+ List<String> reportWaitingCheckStatus = Arrays.asList("0", "1");
|
|
|
|
+
|
|
|
|
+
|
|
for (WmScorePackage wmScorePackage1 : records) {
|
|
for (WmScorePackage wmScorePackage1 : records) {
|
|
|
|
|
|
List<WmScorePackageSettleNote> list =settleNoteMapper.selectList(Wrappers.<WmScorePackageSettleNote>lambdaQuery()
|
|
List<WmScorePackageSettleNote> list =settleNoteMapper.selectList(Wrappers.<WmScorePackageSettleNote>lambdaQuery()
|
|
@@ -778,7 +789,6 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
// 如果是患者教育,则转换积分值 '分'-> '元'
|
|
// 如果是患者教育,则转换积分值 '分'-> '元'
|
|
Integer score = wmScorePackage1.getScore();
|
|
Integer score = wmScorePackage1.getScore();
|
|
String userScore = wmScorePackage1.getUserScore();
|
|
String userScore = wmScorePackage1.getUserScore();
|
|
-// wmScorePackage1.setScore(); TODO 这个怎么转换
|
|
|
|
if (StringUtils.isNumeric(userScore)) {
|
|
if (StringUtils.isNumeric(userScore)) {
|
|
wmScorePackage1.setUserScore(String.format("%.2f", Integer.parseInt(userScore) / 100.0));
|
|
wmScorePackage1.setUserScore(String.format("%.2f", Integer.parseInt(userScore) / 100.0));
|
|
}
|
|
}
|
|
@@ -799,7 +809,7 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
WmScoreTaskType::getTaskTypeName).collect(Collectors.joining(","));
|
|
WmScoreTaskType::getTaskTypeName).collect(Collectors.joining(","));
|
|
wmScorePackage1.setTaskTypes(taskTypes);
|
|
wmScorePackage1.setTaskTypes(taskTypes);
|
|
}
|
|
}
|
|
- //if(wmScorePackage1.getTypeid().equals("3")){
|
|
|
|
|
|
+
|
|
WmScorePackageStatus wmScorePackageStatus = new WmScorePackageStatus();
|
|
WmScorePackageStatus wmScorePackageStatus = new WmScorePackageStatus();
|
|
wmScorePackageStatus.setPackageId(wmScorePackage1.getId());
|
|
wmScorePackageStatus.setPackageId(wmScorePackage1.getId());
|
|
wmScorePackageStatus.setStatus("2");
|
|
wmScorePackageStatus.setStatus("2");
|
|
@@ -812,7 +822,35 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
}
|
|
}
|
|
wmScorePackageStatus.setStatus("1");
|
|
wmScorePackageStatus.setStatus("1");
|
|
wmScorePackage1.setYjddsh(wmScorePackageStatusService.count(Wrappers.query(wmScorePackageStatus)));
|
|
wmScorePackage1.setYjddsh(wmScorePackageStatusService.count(Wrappers.query(wmScorePackageStatus)));
|
|
- //}
|
|
|
|
|
|
+
|
|
|
|
+ // 设置中止状态
|
|
|
|
+ WmScorePackage.PackageStopStatus stopStatus;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ List<WmTask> tasks = wmTaskMapper.selectList(Wrappers.<WmTask>lambdaQuery()
|
|
|
|
+ .eq(WmTask::getScorePackageId, String.valueOf(wmScorePackage1.getId())));
|
|
|
|
+
|
|
|
|
+ //统计发包方还未审核的
|
|
|
|
+ long drugNeedToCheckCount = tasks.stream()
|
|
|
|
+ .filter(t -> "3".equals(t.getTaskStatus()) && "2".equals(t.getReportDrugApprovalStatus()))
|
|
|
|
+ .count();
|
|
|
|
+
|
|
|
|
+ // 统计cso未审核 和审核通过的还未提交到药企的任务数
|
|
|
|
+ long csoNeedToCheckCount = tasks.stream().filter(t -> "2".equals(t.getTaskStatus()) ||
|
|
|
|
+ ("3".equals(t.getTaskStatus()) && reportWaitingCheckStatus.contains(t.getReportDrugApprovalStatus()))).count();
|
|
|
|
+
|
|
|
|
+ // 如果有发包方未审核的不能中止
|
|
|
|
+ if (drugNeedToCheckCount != 0L){
|
|
|
|
+ stopStatus = WmScorePackage.PackageStopStatus.NOTHING;
|
|
|
|
+ } else if (csoNeedToCheckCount != 0){
|
|
|
|
+ // 如果有cso未审核的提示信息
|
|
|
|
+ stopStatus = WmScorePackage.PackageStopStatus.REMAIN_MSG;
|
|
|
|
+ } else {
|
|
|
|
+ // 无提示信息
|
|
|
|
+ stopStatus = WmScorePackage.PackageStopStatus.REMAIN;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ wmScorePackage1.setStopStatus(stopStatus);
|
|
}
|
|
}
|
|
return R.ok(pages);
|
|
return R.ok(pages);
|
|
}
|
|
}
|