Commit f52d779c authored by zhangwanglin's avatar zhangwanglin

评定结算

parent db176c08
......@@ -80,5 +80,5 @@ public interface TaskMapper extends BaseMapper<ChAprTask> {
int insertSrvSend(Integer disableInfoId);
Integer selectDisableBycertiCode(@Param("certiCode") String certiCode);
ChDisableInfo selectDisableBycertiCode(@Param("certiCode") String certiCode);
}
......@@ -237,7 +237,8 @@ public class TaskServiceImpl implements TaskService {
String evaluateTime = reportDetailVo.getEvaluateTime();
Date evaluateDate = DateUtils.strToDate(evaluateTime);
String certiCode = reportDetailVo.getCertiCode();
Integer srvModeId = taskMapper.selectDisableBycertiCode(certiCode);
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.getAccountsStatus()==2){
log.info("{},已完成审核,不再进行评估结算",assessIdAndCostVO.getAssessAccountsId());
return assessAccountsId;
}
if (assessIdAndCostVO == null) {
ChAssessAccounts chAssessAccounts = new ChAssessAccounts();
chAssessAccounts.setAccountsTime(evaluateDate);
......
......@@ -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,7 +542,7 @@
</insert>
<select id="selectDisableBycertiCode" parameterType="java.lang.String" resultType="java.lang.Integer">
select info.SRV_MODE_ID srvModeId from CH_DISABLE_INFO info where info.CERTI_CODE = #{certiCode} and rownum = 1 order by info.FCD desc
<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
......@@ -10,4 +10,6 @@ public class AssessIdAndCostVO {
private Long assessAccountsId;
private BigDecimal assessAllCost;
private Integer accountsStatus;
}
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