Commit f52d779c authored by zhangwanglin's avatar zhangwanglin

评定结算

parent db176c08
...@@ -80,5 +80,5 @@ public interface TaskMapper extends BaseMapper<ChAprTask> { ...@@ -80,5 +80,5 @@ public interface TaskMapper extends BaseMapper<ChAprTask> {
int insertSrvSend(Integer disableInfoId); 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 { ...@@ -237,7 +237,8 @@ public class TaskServiceImpl implements TaskService {
String evaluateTime = reportDetailVo.getEvaluateTime(); String evaluateTime = reportDetailVo.getEvaluateTime();
Date evaluateDate = DateUtils.strToDate(evaluateTime); Date evaluateDate = DateUtils.strToDate(evaluateTime);
String certiCode = reportDetailVo.getCertiCode(); String certiCode = reportDetailVo.getCertiCode();
Integer srvModeId = taskMapper.selectDisableBycertiCode(certiCode); ChDisableInfo chDisableInfo = taskMapper.selectDisableBycertiCode(certiCode);
Integer srvModeId = chDisableInfo.getSrvModeId();
// 根据评定机构id和评估结算时间查找表里有没有数据,有数据直接累加费用 // 根据评定机构id和评估结算时间查找表里有没有数据,有数据直接累加费用
// 评定人员结算表插入 // 评定人员结算表插入
if (person1 != null) { if (person1 != null) {
...@@ -247,7 +248,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -247,7 +248,7 @@ public class TaskServiceImpl implements TaskService {
Integer aprOrganId = chAprEmp.getAprOrganId(); Integer aprOrganId = chAprEmp.getAprOrganId();
chAssessDetailAccounts.setAprOrganId(String.valueOf(aprOrganId)); chAssessDetailAccounts.setAprOrganId(String.valueOf(aprOrganId));
chAssessDetailAccounts.setApplyId(reportDetailVo.getApplyId()); chAssessDetailAccounts.setApplyId(String.valueOf(chDisableInfo.getApplyId()));
chAssessDetailAccounts.setCreationTime(new Date()); chAssessDetailAccounts.setCreationTime(new Date());
chAssessDetailAccounts.setAccountsTime(evaluateDate); chAssessDetailAccounts.setAccountsTime(evaluateDate);
chAssessDetailAccounts.setAssessTime(evaluateDate); chAssessDetailAccounts.setAssessTime(evaluateDate);
...@@ -257,16 +258,19 @@ public class TaskServiceImpl implements TaskService { ...@@ -257,16 +258,19 @@ public class TaskServiceImpl implements TaskService {
String assessCost = aprempTypeIdS==1? "100":"150"; String assessCost = aprempTypeIdS==1? "100":"150";
chAssessDetailAccounts.setAssessCost(assessCost); chAssessDetailAccounts.setAssessCost(assessCost);
Long assessAccountsId = saveAssess(aprOrganId, assessCost,srvModeId,evaluateDate); Long assessAccountsId = saveAssess(aprOrganId, assessCost,srvModeId,evaluateDate);
if(assessAccountsId != null){
chAssessDetailAccounts.setAssessAccountsId(assessAccountsId); chAssessDetailAccounts.setAssessAccountsId(assessAccountsId);
chAssessAccountsDetailMapper.insert(chAssessDetailAccounts); chAssessAccountsDetailMapper.insert(chAssessDetailAccounts);
} }
}
if (person2 != null) { if (person2 != null) {
ChAssessDetailAccounts chAssessDetailAccounts = new ChAssessDetailAccounts(); ChAssessDetailAccounts chAssessDetailAccounts = new ChAssessDetailAccounts();
chAssessDetailAccounts.setEmpId(String.valueOf(person2)); chAssessDetailAccounts.setEmpId(String.valueOf(person2));
ChAprEmp chAprEmp = aprEmpMapper.selectById(person2); ChAprEmp chAprEmp = aprEmpMapper.selectById(person2);
Integer aprOrganId = chAprEmp.getAprOrganId(); Integer aprOrganId = chAprEmp.getAprOrganId();
chAssessDetailAccounts.setAprOrganId(String.valueOf(aprOrganId)); chAssessDetailAccounts.setAprOrganId(String.valueOf(aprOrganId));
chAssessDetailAccounts.setApplyId(reportDetailVo.getApplyId()); chAssessDetailAccounts.setApplyId(String.valueOf(chDisableInfo.getApplyId()));
chAssessDetailAccounts.setCreationTime(new Date()); chAssessDetailAccounts.setCreationTime(new Date());
chAssessDetailAccounts.setAccountsTime(evaluateDate); chAssessDetailAccounts.setAccountsTime(evaluateDate);
chAssessDetailAccounts.setAssessTime(evaluateDate); chAssessDetailAccounts.setAssessTime(evaluateDate);
...@@ -276,16 +280,22 @@ public class TaskServiceImpl implements TaskService { ...@@ -276,16 +280,22 @@ public class TaskServiceImpl implements TaskService {
String assessCost = aprempTypeIdS==1? "100":"150"; String assessCost = aprempTypeIdS==1? "100":"150";
chAssessDetailAccounts.setAssessCost(assessCost); chAssessDetailAccounts.setAssessCost(assessCost);
Long assessAccountsId = saveAssess(aprOrganId, assessCost,srvModeId,evaluateDate); Long assessAccountsId = saveAssess(aprOrganId, assessCost,srvModeId,evaluateDate);
if(assessAccountsId != null) {
chAssessDetailAccounts.setAssessAccountsId(assessAccountsId); chAssessDetailAccounts.setAssessAccountsId(assessAccountsId);
chAssessAccountsDetailMapper.insert(chAssessDetailAccounts); chAssessAccountsDetailMapper.insert(chAssessDetailAccounts);
} }
}
} }
private Long saveAssess(Integer aprOrganId, String assessCost,Integer modeId,Date evaluateDate) { 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)); 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) { if (assessIdAndCostVO == null) {
ChAssessAccounts chAssessAccounts = new ChAssessAccounts(); ChAssessAccounts chAssessAccounts = new ChAssessAccounts();
chAssessAccounts.setAccountsTime(evaluateDate); chAssessAccounts.setAccountsTime(evaluateDate);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<mapper namespace="com.hungraim.ltc.dao.ChAssessAccountsMapper"> <mapper namespace="com.hungraim.ltc.dao.ChAssessAccountsMapper">
<select id="queryAssessByOrganIdAndTime" resultType="com.hungraim.ltc.pojo.vo.assessment.AssessIdAndCostVO"> <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} CH_ASSESS_ACCOUNTS a where a.APR_ORGAN_ID = #{aprOrganId}
and to_char(a.ACCOUNTS_TIME,'yyyy-MM') = #{accountsTime} and to_char(a.ACCOUNTS_TIME,'yyyy-MM') = #{accountsTime}
and a.MODE_ID = #{modeId} and a.MODE_ID = #{modeId}
......
...@@ -542,7 +542,7 @@ ...@@ -542,7 +542,7 @@
</insert> </insert>
<select id="selectDisableBycertiCode" parameterType="java.lang.String" resultType="java.lang.Integer"> <select id="selectDisableBycertiCode" resultType="com.hungraim.ltc.pojo.entity.disable.ChDisableInfo">
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 * from CH_DISABLE_INFO info where info.CERTI_CODE = #{certiCode} and rownum = 1 order by info.FCD desc
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -10,4 +10,6 @@ public class AssessIdAndCostVO { ...@@ -10,4 +10,6 @@ public class AssessIdAndCostVO {
private Long assessAccountsId; private Long assessAccountsId;
private BigDecimal assessAllCost; 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