|
|
@@ -1,5 +1,6 @@
|
|
|
package cn.iocoder.yudao.module.system.service.biz;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.date.ChineseDate;
|
|
|
import cn.hutool.core.util.RandomUtil;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
@@ -60,6 +61,8 @@ import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exceptionCustomMsg;
|
|
|
+import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.COMMON_ERROR;
|
|
|
import static cn.iocoder.yudao.module.system.enums.LogRecordConstants.*;
|
|
|
|
|
|
import java.lang.reflect.Field;
|
|
|
@@ -200,6 +203,12 @@ public class ElderlyInfoServiceImpl implements ElderlyInfoService {
|
|
|
@Autowired
|
|
|
private DepositService depositService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ElderlyContractService elderlyContractService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ExpenseOrderService expenseOrderService;
|
|
|
+
|
|
|
// 定义一个静态的线程池
|
|
|
private static final ExecutorService executorService = Executors.newFixedThreadPool(10);
|
|
|
private static final ScheduledExecutorService timeoutExecutor = Executors.newScheduledThreadPool(10);
|
|
|
@@ -2314,6 +2323,35 @@ public class ElderlyInfoServiceImpl implements ElderlyInfoService {
|
|
|
return "success";
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public String miniGetElderInfo(String elderName, Long tenantId) {
|
|
|
+ List<ElderlyInfoDO> elderlyInfoDOS = elderlyInfoMapper.selectList(new LambdaQueryWrapperX<ElderlyInfoDO>()
|
|
|
+ .like(ElderlyInfoDO::getElderName, elderName)
|
|
|
+ .eq(ElderlyInfoDO::getTenantId, tenantId));
|
|
|
+ if(CollectionUtil.isEmpty(elderlyInfoDOS)){
|
|
|
+ throw exceptionCustomMsg(COMMON_ERROR,"不存在该长者:" + elderName);
|
|
|
+ }
|
|
|
+ if(elderlyInfoDOS.size() > 1){
|
|
|
+ String multiName = elderlyInfoDOS.stream().map(e -> e.getElderName()).collect(Collectors.joining(","));
|
|
|
+ throw exceptionCustomMsg(COMMON_ERROR,"该长者名称存在多个:" + multiName);
|
|
|
+ }
|
|
|
+ ElderlyInfoDO elderlyInfo = elderlyInfoDOS.get(0);
|
|
|
+ Long elderId = elderlyInfo.getId();
|
|
|
+ JSONObject data = new JSONObject();
|
|
|
+ ElderlyInfoDO detailById = findDetailById(elderId);
|
|
|
+ ElderlyContractResVO contractByElderId = elderlyContractService.getContractByElderId(elderId);
|
|
|
+ ExpenseBillPageReqVO expenseBillPageReqVO = new ExpenseBillPageReqVO();
|
|
|
+ expenseBillPageReqVO.setPageSize(1000);
|
|
|
+ expenseBillPageReqVO.setElderId(elderId);
|
|
|
+ PageResult<ExpenseOrderDO> expenseOrderPageByElderId = expenseOrderService.getExpenseOrderPageByElderId(expenseBillPageReqVO);
|
|
|
+ Map<String, Object> expenseOrderAmountByElderId = expenseOrderService.getExpenseOrderAmountByElderId(elderId);
|
|
|
+ data.put("elderInfo",detailById);
|
|
|
+ data.put("contractInfo",contractByElderId);
|
|
|
+ data.put("expenseOrder",expenseOrderPageByElderId);
|
|
|
+ data.put("ExpenseOrderAmount",expenseOrderAmountByElderId);
|
|
|
+ return data.toString();
|
|
|
+ }
|
|
|
+
|
|
|
ElderlySanChart getSexAndNcdSan(ElderlyInfoHomeDataReqVO reqVO) {
|
|
|
|
|
|
ElderlySanChart elderlySanChart = new ElderlySanChart();
|