Commit a1af3342 authored by 董天德's avatar 董天德

Merge branch 'uat_ch_master' into dev_ch_master

parents ef64da9e afc08e18
......@@ -13,4 +13,5 @@ import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface DisableInfoMapper extends BaseMapper<ChDisableInfo> {
}
......@@ -3,6 +3,7 @@ package com.hungraim.ltc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.assessment.ChAprTask;
import com.hungraim.ltc.pojo.entity.disable.ChDisableInfo;
import com.hungraim.ltc.pojo.vo.assessment.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -78,4 +79,6 @@ public interface TaskMapper extends BaseMapper<ChAprTask> {
List<AprEmpExportVO> aprEmpExportList(String provincial, String city, String area, String organName, String name, String tel, String certiCode,String isLock,String empType, String groupLeader);
int insertSrvSend(Integer disableInfoId);
ChDisableInfo selectDisableBycertiCode(@Param("certiCode") String certiCode);
}
......@@ -236,8 +236,9 @@ public class TaskServiceImpl implements TaskService {
Integer person2 = reportDetailVo.getPerson2();
String evaluateTime = reportDetailVo.getEvaluateTime();
Date evaluateDate = DateUtils.strToDate(evaluateTime);
List<ChDisableInfo> chDisableInfos = disableInfoMapper.selectList(new LambdaQueryWrapper<ChDisableInfo>().eq(ChDisableInfo::getApplyId, reportDetailVo.getApplyId()));
Integer srvModeId = chDisableInfos.get(0).getSrvModeId();
String certiCode = reportDetailVo.getCertiCode();
ChDisableInfo chDisableInfo = taskMapper.selectDisableBycertiCode(certiCode);
Integer srvModeId = chDisableInfo.getSrvModeId();
// 根据评定机构id和评估结算时间查找表里有没有数据,有数据直接累加费用
// 评定人员结算表插入
if (person1 != null) {
......@@ -247,7 +248,7 @@ public class TaskServiceImpl implements TaskService {
Integer aprOrganId = chAprEmp.getAprOrganId();
chAssessDetailAccounts.setAprOrganId(String.valueOf(aprOrganId));
chAssessDetailAccounts.setApplyId(reportDetailVo.getApplyId());
chAssessDetailAccounts.setApplyId(String.valueOf(chDisableInfo.getApplyId()));
chAssessDetailAccounts.setCreationTime(new Date());
chAssessDetailAccounts.setAccountsTime(evaluateDate);
chAssessDetailAccounts.setAssessTime(evaluateDate);
......@@ -257,8 +258,11 @@ public class TaskServiceImpl implements TaskService {
String assessCost = aprempTypeIdS==1? "100":"150";
chAssessDetailAccounts.setAssessCost(assessCost);
Long assessAccountsId = saveAssess(aprOrganId, assessCost,srvModeId,evaluateDate);
chAssessDetailAccounts.setAssessAccountsId(assessAccountsId);
chAssessAccountsDetailMapper.insert(chAssessDetailAccounts);
if(assessAccountsId != null){
chAssessDetailAccounts.setAssessAccountsId(assessAccountsId);
chAssessAccountsDetailMapper.insert(chAssessDetailAccounts);
}
}
if (person2 != null) {
ChAssessDetailAccounts chAssessDetailAccounts = new ChAssessDetailAccounts();
......@@ -266,7 +270,7 @@ public class TaskServiceImpl implements TaskService {
ChAprEmp chAprEmp = aprEmpMapper.selectById(person2);
Integer aprOrganId = chAprEmp.getAprOrganId();
chAssessDetailAccounts.setAprOrganId(String.valueOf(aprOrganId));
chAssessDetailAccounts.setApplyId(reportDetailVo.getApplyId());
chAssessDetailAccounts.setApplyId(String.valueOf(chDisableInfo.getApplyId()));
chAssessDetailAccounts.setCreationTime(new Date());
chAssessDetailAccounts.setAccountsTime(evaluateDate);
chAssessDetailAccounts.setAssessTime(evaluateDate);
......@@ -276,16 +280,22 @@ public class TaskServiceImpl implements TaskService {
String assessCost = aprempTypeIdS==1? "100":"150";
chAssessDetailAccounts.setAssessCost(assessCost);
Long assessAccountsId = saveAssess(aprOrganId, assessCost,srvModeId,evaluateDate);
chAssessDetailAccounts.setAssessAccountsId(assessAccountsId);
chAssessAccountsDetailMapper.insert(chAssessDetailAccounts);
if(assessAccountsId != null) {
chAssessDetailAccounts.setAssessAccountsId(assessAccountsId);
chAssessAccountsDetailMapper.insert(chAssessDetailAccounts);
}
}
}
private Long saveAssess(Integer aprOrganId, String assessCost,Integer modeId,Date evaluateDate) {
Long assessAccountsId;
Long assessAccountsId = null;
AssessIdAndCostVO assessIdAndCostVO = chAssessAccountsMapper.queryAssessByOrganIdAndTime(String.valueOf(aprOrganId), DateUtils.dateToStrYm(evaluateDate),String.valueOf(modeId));
if(assessIdAndCostVO!=null && assessIdAndCostVO.getAccountsStatus()==2){
log.info("{},已完成审核,不再进行评估结算",assessIdAndCostVO.getAssessAccountsId());
return assessAccountsId;
}
if (assessIdAndCostVO == null) {
ChAssessAccounts chAssessAccounts = new ChAssessAccounts();
chAssessAccounts.setAccountsTime(evaluateDate);
......@@ -356,6 +366,19 @@ public class TaskServiceImpl implements TaskService {
chAprReport.setEvaluateTime(evaluateDate);
chAprReport.setEvaluateType(vo.getEvaluateType());
aprReportMapper.updateById(chAprReport);
// 2023-3-20 新增
// 更新评定任务状态为已完成,并记录完成时间
ChAprTask task = new ChAprTask();
task.setTaskId(chAprReport.getTaskId());
task.setFinishTime(new Date());
task.setTaskStatus(3); // 已完成
taskMapper.updateById(task);
if(2 == vo.getEvaluateType()){
ChAprTask chAprTask = taskMapper.selectById(chAprReport.getTaskId());
Integer disableInfoId = chAprTask.getDisableInfoId();
taskMapper.insertSrvSend(disableInfoId);
}
//附件上传
this.updateAttachs(vo.getFileDataList(), chAprReport.getReportId().longValue());
//修改鉴定报告人员(有就update,没有就insert)
......@@ -410,7 +433,14 @@ public class TaskServiceImpl implements TaskService {
}
}
// 评估结算
ReportDetailVO reportDetailVO = new ReportDetailVO();
reportDetailVO.setCertiCode(vo.getCertiCode());
reportDetailVO.setPerson1(vo.getPerson1());
reportDetailVO.setPerson2(vo.getPerson2());
reportDetailVO.setDisableLevelId(vo.getDisableLevelId());
reportDetailVO.setEvaluateTime(vo.getEvaluateTime());
assessAccount(reportDetailVO);
}
/**
......@@ -460,6 +490,23 @@ public class TaskServiceImpl implements TaskService {
disableInfoMapper.updateById(chDisableInfo);
}
//插入评定任报告 2023-03-20
ChAprReport report = new ChAprReport();
report.setTaskId(task.getTaskId());
report.setEffTime(new Date());
report.setFcd(new Date());
report.setStatus(0);
aprReportMapper.insert(report);
ChAprPersonInfo person1Info = new ChAprPersonInfo();
person1Info.setReportId(report.getReportId());
if(StringUtils.isNotEmpty(empId)) {
person1Info.setEmpId(Integer.parseInt(empId));
}
person1Info.setFcd(new Date());
personInfoMapper.insert(person1Info);
//生成组
ChAprTaskPush taskPush = new ChAprTaskPush();
taskPush.setAssignTime(new Date());
......
......@@ -3,7 +3,7 @@
<mapper namespace="com.hungraim.ltc.dao.ChAssessAccountsMapper">
<select id="queryAssessByOrganIdAndTime" resultType="com.hungraim.ltc.pojo.vo.assessment.AssessIdAndCostVO">
select a.ASSESS_ACCOUNTS_ID assessAccountsId,a.ASSESS_ALL_COST assessAllCost from
select a.ASSESS_ACCOUNTS_ID assessAccountsId,a.ASSESS_ALL_COST assessAllCost,a.ACCOUNTS_STATUS accountsStatus from
CH_ASSESS_ACCOUNTS a where a.APR_ORGAN_ID = #{aprOrganId}
and to_char(a.ACCOUNTS_TIME,'yyyy-MM') = #{accountsTime}
and a.MODE_ID = #{modeId}
......
......@@ -542,4 +542,7 @@
</insert>
<select id="selectDisableBycertiCode" resultType="com.hungraim.ltc.pojo.entity.disable.ChDisableInfo">
select * from CH_DISABLE_INFO info where info.CERTI_CODE = #{certiCode} and rownum = 1 order by info.FCD desc
</select>
</mapper>
\ No newline at end of file
......@@ -22,6 +22,8 @@ public class ReportUpdateVO {
Integer disableLevelId;
String polNo;
String remark;
String certiCode;
String applyId;
Integer evaluateType;
List<ChFndAttach> fileDataList;
List<ChAprReportFraction> chAprReportFractions;
......
......@@ -10,4 +10,6 @@ public class AssessIdAndCostVO {
private Long assessAccountsId;
private BigDecimal assessAllCost;
private Integer accountsStatus;
}
......@@ -20,6 +20,7 @@ public class ReportDetailVO {
*/
String operAddress;
String applyId;
String certiCode;
String polNo;
String remark;
Integer evaluateType;
......
......@@ -75,7 +75,7 @@ public class SrvProgramController {
* @return 返回个人照护方案列表
*/
@RequestMapping("/programSetList")
public Result getProgramSetList(Integer pageNum, Integer pageSize, Long disabInfoId, Long srvOrganId) {
public Result getProgramSetList(Integer pageNum, Integer pageSize, Long disabInfoId, Long srvOrganId,String status) {
if (pageNum == null || pageNum < 1 || disabInfoId == null || disabInfoId == 0 || srvOrganId == null || srvOrganId == 0) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
......@@ -83,7 +83,7 @@ public class SrvProgramController {
pageSize = 10;
}
Page<ProgramListVo> page = new Page<>(pageNum, pageSize);
page = srvProgramService.getProgramSetList(page, disabInfoId, srvOrganId, null);
page = srvProgramService.getProgramSetList(page, disabInfoId, srvOrganId, status);
List<ProgramListVo> records = page.getRecords();
records =records.stream().collect(
Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparingLong(ProgramListVo::getProgramId))), ArrayList::new));
......
......@@ -128,7 +128,9 @@
T4.FINISH_TIME assessDate,
T7.MODE_NAME svrModelName,
T5.SRV_ORGAN_NAME svrOrganName,
T1.PROG_STATUS progStatus,
<if test="programStatus != null and programStatus != ''">
#{programStatus} progStatus,
</if>
T1.EFF_TIME effTime
FROM CH_SRV_PROGRAM T1
INNER JOIN CH_DISABLE_INFO T2 ON T1.DISAB_INFO_ID = T2.DISAB_INFO_ID
......@@ -139,10 +141,10 @@
LEFT JOIN CH_SRV_ORGAN T5 ON T1.SRV_ORGAN_ID = T5.SRV_ORGAN_ID
WHERE T1.DISAB_INFO_ID = #{disabInfoId}
AND T1.SRV_ORGAN_ID = #{srvOrganId}
<!--
<if test="programStatus != null and programStatus != ''">
AND T1.PROG_STATUS = #{programStatus}
</if>
</if>-->
</select>
<select id="getProgramEndProgram" resultType="com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram">
......
......@@ -224,7 +224,7 @@
where <![CDATA[ t.SRV_DATE < sysdate and
(info.EXIT_TIME > sysdate or info.EXIT_TIME is null)
and sysdate < program.PROGRAM_EDN_DATE
and sysdate > report.PUBLICITY_END_TIME and program.PROG_STATUS <>'2' ]]>
and sysdate > report.PUBLICITY_END_TIME and program.PROG_STATUS <>'2' and t.STATUS <>'2' ]]>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment