Commit 536b3944 authored by zhangwanglin's avatar zhangwanglin

评定结算

parent afc08e18
......@@ -2,12 +2,21 @@ package com.hungraim.ltc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.assessment.ChAssessDetailAccounts;
import com.hungraim.ltc.pojo.entity.assessment.ChAssessDetailAccountsResp;
import com.hungraim.ltc.pojo.vo.account.AssessAccountsExportResp;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import java.util.List;
@Mapper
@Repository
public interface ChAssessAccountsDetailMapper extends BaseMapper<ChAssessDetailAccounts> {
List<ChAssessDetailAccountsResp> queryAssessAccountsDetail(String assessAccountsId);
List<AssessAccountsExportResp> assessAccountDetailExport(String assessAccountsId);
ChAssessDetailAccounts selectAssessDetailInfo(Integer applyId,Integer empId,Integer evaluateType);
}
\ No newline at end of file
package com.hungraim.ltc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.assessment.ChAssessDetailAccounts;
import com.hungraim.ltc.pojo.entity.assessment.ChAssessDetailAccountsResp;
import com.hungraim.ltc.pojo.vo.account.AssessAccountsExportResp;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author mq
*/
@Mapper
@Repository
public interface ChAssessDetailAccountsMapper extends BaseMapper<ChAssessDetailAccounts> {
List<ChAssessDetailAccountsResp> queryAssessAccountsDetail(String assessAccountsId);
List<AssessAccountsExportResp> assessAccountDetailExport(String assessAccountsId);
}
......@@ -67,11 +67,10 @@ public class TaskServiceImpl implements TaskService {
private final ChTaskReportFractionDtlMapper chTaskReportFractionDtlMapper;
private final ChAssessAccountsDetailMapper chAssessAccountsDetailMapper;
private final ChAssessAccountsMapper chAssessAccountsMapper;
private final ChAssessDetailAccountsMapper chAssessDetailAccountsMapper;
private final ChAssessAccountsDetailMapper chAssessDetailAccountsMapper;
......@@ -242,7 +241,9 @@ public class TaskServiceImpl implements TaskService {
// 根据评定机构id和评估结算时间查找表里有没有数据,有数据直接累加费用
// 评定人员结算表插入
if (person1 != null) {
ChAssessDetailAccounts chAssessDetailAccounts = new ChAssessDetailAccounts();
ChAssessDetailAccounts chAssessDetailAccounts = chAssessDetailAccountsMapper.selectAssessDetailInfo(chDisableInfo.getApplyId(), person1, reportDetailVo.getEvaluateType());
if(Objects.isNull(chAssessDetailAccounts)){
chAssessDetailAccounts = new ChAssessDetailAccounts();
chAssessDetailAccounts.setEmpId(String.valueOf(person1));
ChAprEmp chAprEmp = aprEmpMapper.selectById(person1);
......@@ -252,6 +253,7 @@ public class TaskServiceImpl implements TaskService {
chAssessDetailAccounts.setCreationTime(new Date());
chAssessDetailAccounts.setAccountsTime(evaluateDate);
chAssessDetailAccounts.setAssessTime(evaluateDate);
chAssessDetailAccounts.setEvaluateType(reportDetailVo.getEvaluateType());
Integer aprempTypeIdS = chAprEmp.getAprempTypeIdS();
// 1 评估员上门评估,每人次 100 元
// 5 评估专家上门评估,每人次 150 元
......@@ -260,12 +262,18 @@ public class TaskServiceImpl implements TaskService {
Long assessAccountsId = saveAssess(aprOrganId, assessCost,srvModeId,evaluateDate);
if(assessAccountsId != null){
chAssessDetailAccounts.setAssessAccountsId(assessAccountsId);
chAssessAccountsDetailMapper.insert(chAssessDetailAccounts);
chAssessDetailAccountsMapper.insert(chAssessDetailAccounts);
}
}else {
log.info("{},该失能人员已进行评估结算,护理人员:{}",chDisableInfo.getApplyId(),person1);
}
}
if (person2 != null) {
ChAssessDetailAccounts chAssessDetailAccounts = new ChAssessDetailAccounts();
ChAssessDetailAccounts chAssessDetailAccounts = chAssessDetailAccountsMapper.selectAssessDetailInfo(chDisableInfo.getApplyId(), person2, reportDetailVo.getEvaluateType());
if (Objects.isNull(chAssessDetailAccounts)) {
chAssessDetailAccounts = new ChAssessDetailAccounts();
chAssessDetailAccounts.setEmpId(String.valueOf(person2));
ChAprEmp chAprEmp = aprEmpMapper.selectById(person2);
Integer aprOrganId = chAprEmp.getAprOrganId();
......@@ -274,15 +282,19 @@ public class TaskServiceImpl implements TaskService {
chAssessDetailAccounts.setCreationTime(new Date());
chAssessDetailAccounts.setAccountsTime(evaluateDate);
chAssessDetailAccounts.setAssessTime(evaluateDate);
chAssessDetailAccounts.setEvaluateType(reportDetailVo.getEvaluateType());
Integer aprempTypeIdS = chAprEmp.getAprempTypeIdS();
// 1 评估员上门评估,每人次 100 元
// 5 评估专家上门评估,每人次 150 元
String assessCost = aprempTypeIdS==1? "100":"150";
String assessCost = aprempTypeIdS == 1 ? "100" : "150";
chAssessDetailAccounts.setAssessCost(assessCost);
Long assessAccountsId = saveAssess(aprOrganId, assessCost,srvModeId,evaluateDate);
if(assessAccountsId != null) {
Long assessAccountsId = saveAssess(aprOrganId, assessCost, srvModeId, evaluateDate);
if (assessAccountsId != null) {
chAssessDetailAccounts.setAssessAccountsId(assessAccountsId);
chAssessAccountsDetailMapper.insert(chAssessDetailAccounts);
chAssessDetailAccountsMapper.insert(chAssessDetailAccounts);
}
}else {
log.info("{},该失能人员已进行评估结算,护理人员:{}",chDisableInfo.getApplyId(),person2);
}
}
......@@ -440,6 +452,7 @@ public class TaskServiceImpl implements TaskService {
reportDetailVO.setPerson2(vo.getPerson2());
reportDetailVO.setDisableLevelId(vo.getDisableLevelId());
reportDetailVO.setEvaluateTime(vo.getEvaluateTime());
reportDetailVO.setEvaluateType(vo.getEvaluateType());
assessAccount(reportDetailVO);
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hungraim.ltc.dao.ChAssessDetailAccountsMapper">
<mapper namespace="com.hungraim.ltc.dao.ChAssessAccountsDetailMapper">
<select id="queryAssessAccountsDetail"
......@@ -38,5 +38,10 @@ FROM
left join CH_APR_EMP t4 on t4.EMP_ID = t1.EMP_ID
where t1.ASSESS_ACCOUNTS_ID = #{assessAccountsId}
</select>
<select id="selectAssessDetailInfo" resultType="com.hungraim.ltc.pojo.entity.assessment.ChAssessDetailAccounts">
select * from CH_ASSESS_ACCOUNTS_DETAIL d where d.APPLY_ID =#{applyId} and d.EMP_ID = #{empId}
and d.EVALUATE_TYPE = #{evaluateType}
</select>
</mapper>
......@@ -54,6 +54,8 @@ public class ChAssessDetailAccounts implements Serializable {
private String assessCost;
private Integer evaluateType;
private static final long serialVersionUID = 1L;
}
\ 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