Commit c09eff5e authored by zhangwanglin's avatar zhangwanglin

结算

parent 5b82c8d8
......@@ -109,7 +109,7 @@ public class AccountController {
@PostMapping("/organAccountTaskExecute")
public Result organAccountTaskExecute(AccountTaskReqVO accountTaskReqVO){
List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS = accountTaskReqVO.getAccountTaskList();
Result result = accountService.organAccountTaskExecute(accountTaskExecuteReqVOS);
Result result = accountService.accountTaskExecute(accountTaskExecuteReqVOS);
return result;
}
......@@ -257,12 +257,18 @@ public class AccountController {
/**
* 查询护理记录
*
* @param taskDetailId 结算详情id
* @param nursingReqVO
* @return
*/
@GetMapping("/queryNursingRecords")
public Result<Page<NursingRecordsRespVO>> queryNursingRecords(Integer pageNum, Integer pageSize, String taskDetailId) {
Page<NursingRecordsRespVO> nursingRecordsRespVOList = accountService.queryNursingRecords(pageNum,pageSize,taskDetailId);
public Result<Page<NursingRecordsRespVO>> queryNursingRecords(NursingReqVO nursingReqVO) {
if (StringUtils.isBlank(nursingReqVO.getModeName())
||StringUtils.isBlank(nursingReqVO.getAccountsTime())
||StringUtils.isBlank(nursingReqVO.getDisabInfoId())
||StringUtils.isBlank(nursingReqVO.getSrvOrganId())) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
Page<NursingRecordsRespVO> nursingRecordsRespVOList = accountService.queryNursingRecords(nursingReqVO);
return Result.success(nursingRecordsRespVOList);
}
......
......@@ -4,9 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.account.*;
import com.hungraim.ltc.pojo.vo.account.AccountExportDetailListResp;
import com.hungraim.ltc.pojo.vo.account.AccountTaskExecuteReqVO;
import com.hungraim.ltc.pojo.vo.account.OrganAccountsVO;
import com.hungraim.ltc.pojo.vo.account.SrvOrganListReq;
import com.hungraim.ltc.util.DateUtils;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
......@@ -28,7 +28,7 @@ public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAcc
Page<ChDisabDetailAccountsResp> queryOrganAccountsDetail(Page page,SrvOrganListReq req);
Page<NursingRecordsRespVO> queryNursingRecords(Page page, String taskDetailId);
Page<NursingRecordsRespVO> queryNursingRecords(Page page, NursingReqVO req);
OverallEduceDecreaseCostRespVO queryOverallCostRecords(OverallCostReqVO req);
......@@ -39,6 +39,11 @@ public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAcc
ChDisabDetailAccounts queryDisabDetailAccounts(String srvOrganId, String accountsTime,String disabInfoId,String srvModeName);
List<OrganAccountsVO> queryPlanInfoByDetailId(String taskDetailId);
int updateByPlanId(String planId);
int selectByCondition(AccountTaskExecuteReqVO accountTaskExecuteReqVO);
}
\ No newline at end of file
......@@ -35,7 +35,7 @@ public interface AccountService extends IService<ChDisabAccounts> {
Page<NursingRecordsRespVO> queryNursingRecords(Integer pageNum, Integer pageSize, String taskDetailId);
Page<NursingRecordsRespVO> queryNursingRecords(NursingReqVO nursingReqVO);
OverallEduceDecreaseCostRespVO queryOverallCostRecords(OverallCostReqVO req);
......@@ -49,6 +49,8 @@ public interface AccountService extends IService<ChDisabAccounts> {
Result organAccountTaskExecute(List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS);
Result accountTaskExecute(List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS);
void otherPlaceHandler(String programId);
int deleteAccountsDetail(Long accountsDetailId,Long freeRdId);
......
......@@ -474,8 +474,20 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override
public Page<NursingRecordsRespVO> queryNursingRecords(Integer pageNum, Integer pageSize, String taskDetailId) {
return chDisabAccountsDetailMapper.queryNursingRecords(new Page<>(pageNum, pageSize),taskDetailId);
public Page<NursingRecordsRespVO> queryNursingRecords(NursingReqVO nursingReqVO) {
String modeName = nursingReqVO.getModeName();
String modeId = "";
if("医疗".equals(modeName)){
modeId = "1";
}else if("养老".equals(modeName)) {
modeId = "2";
}else if ("上门".equals(modeName)){
modeId = "3";
}else if ("异地".equals(modeName)){
modeId = "4";
}
nursingReqVO.setModeId(modeId);
return chDisabAccountsDetailMapper.queryNursingRecords(new Page<>(nursingReqVO.getPageNum(), nursingReqVO.getPageSize()),nursingReqVO);
}
@Override
......@@ -552,6 +564,123 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override
@Transactional(rollbackFor = Exception.class)
public Result accountTaskExecute(List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS) {
log.info("organAccountTaskExecute.accountTaskExecuteReqVOS:{}",accountTaskExecuteReqVOS);
if (CollectionUtil.isEmpty(accountTaskExecuteReqVOS)) {
return Result.failed("参数不能为空");
}
// 根据任务id分组,一个任务下会有多个项目,任务id相同
Map<String, List<AccountTaskExecuteReqVO>> accountTaskMap = accountTaskExecuteReqVOS.stream().collect(Collectors.groupingBy(AccountTaskExecuteReqVO::getTaskDetailId));
for(Map.Entry<String, List<AccountTaskExecuteReqVO>> entry:accountTaskMap.entrySet()) {
String taskDetailId = entry.getKey();
// 已完成的任务,一个任务下有服务完成就产生结算,多个服务完成算一条服务的结算(实际上结算详情有一条记录就产生结算费用)
List<AccountTaskExecuteReqVO> accountTaskList = entry.getValue();
// 处理具体的服务项目
try {
for (AccountTaskExecuteReqVO accountTaskExecuteReqVO : accountTaskList) {
// 已申报的任务不允许再执行任务
String srvDateYm = DateUtils.dateToStrYm(DateUtils.strToDate(accountTaskExecuteReqVO.getSrvDate()));
accountTaskExecuteReqVO.setSrvDateYm(srvDateYm);
int count = chDisabAccountsDetailMapper.selectByCondition(accountTaskExecuteReqVO);
if(count>0){
return Result.failed("此任务已提交申报,不可再操作,请联系管理员");
}
// 已完成的任务更新ch_srv_plan状态
String planId = accountTaskExecuteReqVO.getPlanId();
Integer integer = chSrvTaskDetailMapper.updateSrvPlanById(planId);
if(integer == 0) {
log.info("更新任务计划表失败");
}
ChSrvTaskDetail ca = new ChSrvTaskDetail();
ca.setStatus((short) 4);
ca.setTaskDetailId(Long.valueOf(accountTaskExecuteReqVO.getTaskDetailId()));
chSrvTaskDetailMapper.updateById(ca);
}
accountSave1(taskDetailId,accountTaskList);
} catch (Exception e) {
log.info("=====accountSave error:{}",e);
return Result.failed("服务异常");
}
}
return Result.success();
}
private void accountSave1(String taskDetailId,List<AccountTaskExecuteReqVO> accountTaskList) {
// 已完成任务 已结算
List<OrganAccountsVO> accountsList = chDisabAccountsDetailMapper.queryPlanInfoByDetailId(taskDetailId);
if (CollectionUtil.isNotEmpty(accountsList)) {
return;
}
AccountTaskExecuteReqVO accountsVO = accountTaskList.get(0);
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
String srvOrganId = accountsVO.getSrvOrganId();
// 结算时间为任务时间
Date accountsTime = DateUtils.strToDate(accountsVO.getSrvDate());
String disabInfoId = accountsVO.getDisabInfoId();
//要判断是养老还是医疗,因为费用不一样
BigDecimal limit = BigDecimal.valueOf(0);
BigDecimal overallPercent = BigDecimal.valueOf(0.7);
BigDecimal personalPercent = BigDecimal.valueOf(0.3);
String srvModeName = accountsVO.getSrvModeName();
// 养老机构护理,其限额为 50 元/人/天 由长期护理保险基金支付 70% 个人支付 30%
if ("养老".equals(srvModeName)) {
limit = BigDecimal.valueOf(50);
// 医疗机构护理,原则上收治医疗护理需求为主的重度失能人员一级及以下医疗机构其限额为 80 元/人/天,由长期护理保险基金支付 70%,个人支付 30%;
} else if ("医疗".equals(srvModeName) && "1".equals(accountsVO.getLevelCode())) {
limit = BigDecimal.valueOf(80);
// 二级及以上医疗机构其限额为 100 元/人/天,由长期护理保险基金支付 70%,个人支付 30%;
} else if ("医疗".equals(srvModeName) && (!"1".equals(accountsVO.getLevelCode()))) {
limit = BigDecimal.valueOf(100);
}
// 根据护理机构、结算月份、失能人员id和服务方式查询表里是否有值
ChDisabDetailAccounts chDisabDetailAccountsDTO = chDisabAccountsDetailMapper.queryDisabDetailAccounts(srvOrganId, DateUtils.dateToStrYm(accountsTime), disabInfoId, srvModeName);
BigDecimal overallCost = limit.multiply(overallPercent);
BigDecimal personalCost = limit.multiply(personalPercent);
if(Objects.isNull(chDisabDetailAccountsDTO)){
chDisabDetailAccounts.setAccountsAllCost(limit);
chDisabDetailAccounts.setAccountsOverallCost(overallCost);
chDisabDetailAccounts.setAccountsPersonalCost(personalCost);
chDisabDetailAccounts.setModeName(accountsVO.getSrvModeName());
chDisabDetailAccounts.setSrvOrganId(srvOrganId);
chDisabDetailAccounts.setEmpId(accountsVO.getEmpId());
chDisabDetailAccounts.setCreationTime(new Date());
chDisabDetailAccounts.setAccountsTime(accountsTime);
chDisabDetailAccounts.setAccountsStartTime(DateUtils.getFirstDayOfMonth(DateUtils.strToDate(accountsVO.getSrvDate())));
chDisabDetailAccounts.setAccountsEndTime(DateUtils.getlastDayOfMonth(DateUtils.strToDate(accountsVO.getSrvDate())));
chDisabDetailAccounts.setMedicalArea(accountsVO.getMedicalArea());
chDisabDetailAccounts.setDisabInfoId(disabInfoId);
chDisabDetailAccounts.setStatus((short)0);
chDisabDetailAccounts.setReissueAmount(BigDecimal.valueOf(0));
chDisabDetailAccounts.setDeductionAmount(BigDecimal.valueOf(0));
ChDisabAccounts chDisabAccounts = getChDisabAccounts1(accountsVO);
chDisabDetailAccounts.setAccountsId(chDisabAccounts.getAccountsId());
chDisabAccountsDetailMapper.insert(chDisabDetailAccounts);
String planId = accountsVO.getPlanId();
// 更新
chDisabAccountsDetailMapper.updateByPlanId(planId);
}else {
BigDecimal accountsAllCost = chDisabDetailAccountsDTO.getAccountsAllCost();
BigDecimal accountsOverallCost = chDisabDetailAccountsDTO.getAccountsOverallCost();
BigDecimal accountsPersonalCost = chDisabDetailAccountsDTO.getAccountsPersonalCost();
chDisabDetailAccountsDTO.setAccountsAllCost(accountsAllCost.add(limit));
chDisabDetailAccountsDTO.setAccountsOverallCost(accountsOverallCost.add(overallCost));
chDisabDetailAccountsDTO.setAccountsPersonalCost(accountsPersonalCost.add(personalCost));
chDisabAccountsDetailMapper.updateById(chDisabDetailAccountsDTO);
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result organAccountTaskExecute(List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS) {
log.info("organAccountTaskExecute.accountTaskExecuteReqVOS:{}",accountTaskExecuteReqVOS);
if (CollectionUtil.isEmpty(accountTaskExecuteReqVOS)) {
......@@ -659,6 +788,27 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
}
}
private ChDisabAccounts getChDisabAccounts1(AccountTaskExecuteReqVO accountsVO) {
// 结算表 根据机构和结算时间 服务方式
ChDisabAccounts chDisabAccounts = disabAccountsMapper.queryAccountByCondition(DateUtils.dateToStrYm(DateUtils.strToDate(accountsVO.getSrvDate())), accountsVO.getSrvModeName(), accountsVO.getSrvOrganId(),null);
if(chDisabAccounts == null) {
chDisabAccounts = new ChDisabAccounts();
chDisabAccounts.setModeName(accountsVO.getSrvModeName());
chDisabAccounts.setAccountsTime(DateUtils.strToDateMd(accountsVO.getSrvDate()));
chDisabAccounts.setSrvOrganId(Long.valueOf(accountsVO.getSrvOrganId()));
chDisabAccounts.setCreationTime(new Date());
chDisabAccounts.setAccountsStatus((short) 0);
BigDecimal zero = BigDecimal.valueOf(0);
chDisabAccounts.setAllCost(zero);
chDisabAccounts.setOverallCost(zero);
chDisabAccounts.setPersonalCost(zero);
chDisabAccounts.setReissueAmountTotal(zero);
chDisabAccounts.setDeductionAmountTotal(zero);
disabAccountsMapper.insert(chDisabAccounts);
}
return chDisabAccounts;
}
private ChDisabAccounts getChDisabAccounts(OrganAccountsVO accountsVO, BigDecimal limit, BigDecimal overallCost, BigDecimal personalCost) {
// 结算表 根据机构和结算时间 服务方式
......
......@@ -14,7 +14,9 @@
d.TASK_DETAIL_ID taskDetailId,
(select district_name from ch_fnd_district dis where apply.MEDICAL_AREA = dis.district_code) medicalArea,
o.SRV_ORGAN_NAME srvOrganName,
o.SRV_ORGAN_ID srvOrganId,
info.REAL_NAME realName,
info.DISAB_INFO_ID disabInfoId,
d.DEDUCTION_AMOUNT deductionAmount,
d.REISSUE_AMOUNT reissueAmount,
d.ACCOUNTS_DETAIL_ID accountsDetailId,
......@@ -51,12 +53,16 @@
<select id="queryNursingRecords" resultType="com.hungraim.ltc.pojo.entity.account.NursingRecordsRespVO">
select organ.SRV_ORGAN_NAME srvOrganName,
DECODE(plan.MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地') modeName,
to_char(plan.SRV_PLAN_TIME,'yyyy-MM-dd') srvPlanTime,
DECODE(plan.MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地') modeName,
to_char(plan.CREATION_TIME,'yyyy-MM-dd HH24:mi:ss') executionTime,
plan.item_name itemName
from CH_SRV_PLAN plan
left join CH_SRV_ORGAN organ on organ.SRV_ORGAN_ID = plan.SRV_ORGAN_ID
where plan.TASK_DETAIL_ID = #{taskDetailId} and plan.IS_STATUS ='4'
where plan.DISAB_INFO_ID = #{req.disabInfoId}
and plan.SRV_ORGAN_ID = #{req.srvOrganId}
and plan.MODE_ID = #{req.modeId}
and plan.IS_STATUS ='4'
</select>
......@@ -86,7 +92,7 @@
and info.REAL_NAME = #{realName}
</if>
<if test="accountsTime != null and accountsTime != ''">
and to_char(detail.accounts_time,'yyyy-MM-dd') = #{accountsTime}
and to_char(detail.accounts_time,'yyyy-MM') = #{accountsTime}
</if>
<if test="srvOrganName != null and srvOrganName != ''">
and organ.SRV_ORGAN_NAME = #{srvOrganName}
......@@ -137,6 +143,35 @@
</where>
</select>
<select id="queryPlanInfoByDetailId" resultType="com.hungraim.ltc.pojo.vo.account.OrganAccountsVO">
select
plan.TASK_DETAIL_ID taskDetailId,
plan.PLAN_ID planId,
--失能人员姓名
disable.real_name realName,
disable.DISAB_INFO_ID disabInfoId,
--身份证号
disable.CERTI_CODE certiCode,
--所在省市
(select district_name from ch_fnd_district dis where apply.MEDICAL_AREA = dis.district_code) medicalArea,
--服务方式
DECODE(plan.MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地') srvModeName,
--护理机构名称
plan.srv_organ_id srvOrganId,
--护理机构名称
organ.srv_organ_name srvOrganName,
--护理服务人员 Id
plan.EMP_ID empId,
--任务时间
plan.SRV_PLAN_TIME srvDate,
-- 机构等级
organ.LEVEL_CODE levelCode
from CH_SRV_PLAN plan
left join ch_srv_organ organ on plan.srv_organ_id = organ.srv_organ_id
left join ch_disable_info disable on plan.disab_info_id = disable.disab_info_id--失能人员
left join CH_DISABLE_APPLY apply on apply.apply_id = disable.apply_id
where plan.IS_STATUS = '4' and plan.IS_BILL = 1 and plan.TASK_DETAIL_ID = #{taskDetailId}
</select>
<select id="queryAccountByCondition" resultType="com.hungraim.ltc.pojo.entity.account.ChDisabDetailAccounts">
select * from CH_DISAB_ACCOUNTS_DETAIL t where t.MODE_NAME in ('养老','医疗')
......@@ -281,6 +316,16 @@
and d.MODE_NAME = #{srvModeName}
</select>
<update id="updateByPlanId">
update CH_SRV_PLAN set IS_BILL =1 where PLAN_ID = #{planId}
</update>
<select id="selectByCondition" parameterType="com.hungraim.ltc.pojo.vo.account.AccountTaskExecuteReqVO" resultType="java.lang.Integer">
select count(1) from CH_DISAB_ACCOUNTS_DETAIL detail where detail.STATUS = 1 and
detail.SRV_ORGAN_ID = #{srvOrganId} and detail.MODE_NAME=#{srvModeName} and detail.DISAB_INFO_ID = #{disabInfoId}
and to_char(detail.ACCOUNTS_TIME,'yyyy-MM')=#{srvDateYm}
</select>
</mapper>
......@@ -9,12 +9,18 @@
plan.TASK_DETAIL_ID taskDetailId,
plan.ITEM_NAME itemName,
emp.emp_name empName,
emp.emp_id empId,
info.DISAB_INFO_ID disabInfoId,
organ.SRV_ORGAN_NAME srvOrganName,
organ.SRV_ORGAN_ID srvOrganId,
DECODE(plan.MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地') srvModeName,
to_char(plan.SRV_PLAN_TIME,'yyyy-MM-dd') srvDate,
plan.IS_STATUS status
plan.IS_STATUS status,
(select district_name from ch_fnd_district dis where apply.MEDICAL_AREA = dis.district_code) medicalArea,
organ.LEVEL_CODE levelCode
from ch_srv_plan plan
left join ch_disable_info info on plan.DISAB_INFO_ID = info.DISAB_INFO_ID
left join CH_DISABLE_APPLY apply on apply.APPLY_ID = info.APPLY_ID
left join ch_srv_organ_emp emp on plan.emp_id = emp.emp_id
left join CH_SRV_ORGAN organ on organ.SRV_ORGAN_ID = plan.SRV_ORGAN_ID
<where>
......
......@@ -19,7 +19,6 @@ public class ChDisabDetailAccountsResp implements Serializable {
/**
* 结算月份
*/
private String accountsTime;
/**
......@@ -50,6 +49,7 @@ public class ChDisabDetailAccountsResp implements Serializable {
private String srvOrganName;
private String srvOrganId;
private String realName;
......@@ -61,6 +61,8 @@ public class ChDisabDetailAccountsResp implements Serializable {
private String accountsDetailId;
private String disabInfoId;
private Integer status;
private static final long serialVersionUID = 1L;
......
......@@ -23,6 +23,10 @@ public class NursingRecordsRespVO {
/**
*执行日期
**/
private String srvPlanTime;
/**
*执行日期
**/
private String executionTime;
/**
*任务名称
......
package com.hungraim.ltc.pojo.entity.account;
import com.hungraim.ltc.pojo.vo.BaseReq;
import lombok.Data;
/**
* @author zwl
* @ClassName NursingReqVO
* @description
* @date 2023/3/6 18:00
**/
@Data
public class NursingReqVO extends BaseReq {
private String accountsTime;
private String disabInfoId;
private String modeId;
private String modeName;
private String srvOrganId;
}
......@@ -12,6 +12,17 @@ public class AccountTaskExecuteReqVO {
private String itemId;
private String srvOrganId;
private String srvDate;
private String disabInfoId;
private String srvModeName;
private String levelCode;
private Long empId;
private String medicalArea;
private String srvDateYm;
}
......@@ -86,4 +86,6 @@ public class OrganAccountsVO {
private String itemName;
private String planId;
}
......@@ -21,6 +21,8 @@ public class SrvTaskRespVO {
// 护理人员
private String empName;
private String empId;
// 任务时间
private String srvDate;
......@@ -34,4 +36,12 @@ public class SrvTaskRespVO {
private String srvModeName;
private String srvOrganId;
private String disabInfoId;
private String levelCode;
private String medicalArea;
}
......@@ -12,4 +12,5 @@ public class AllocationSrvTaskVO {
private String exitTime;
private String srvDate;
private Long srvTaskId;
private String programId;
}
......@@ -189,7 +189,22 @@ public class DateUtils {
return null;
}
}
/**
* 将短时间格式字符串转换为时间 yyyy-MM-dd HH:mm:ss
*
* @param strDate
* @return
*/
public static Date strToDateMd(String strDate) {
try {
SimpleDateFormat formatter = new SimpleDateFormat(DATE_PATTERN_yyyy_MM_dd);
ParsePosition pos = new ParsePosition(0);
Date strtodate = formatter.parse(strDate, pos);
return strtodate;
} catch (Throwable e) {
return null;
}
}
/**
* 字符串时间戳转日期
*
......
......@@ -11,6 +11,6 @@ import java.util.List;
@Repository
@Mapper
public interface ChSrvPlanMapper extends BaseMapper<ChSrvPlan> {
List<ChSrvPlan> queryPlan(String programId);
List<ChSrvPlan> queryPlan(String programId,String srvPlanTime);
}
......@@ -18,7 +18,7 @@ public class SrvTaskScheduledServiceImpl {
@Autowired
private SrvTaskService srvTaskService;
@Scheduled(cron = "30 30 23 * * ?")
@Scheduled(cron = "30 05 19 * * ?")
public void timeAllocationSrvTask() {
log.info("timeAllocationSrvTask========start");
srvTaskService.timeAllocationSrvTask();
......
......@@ -146,7 +146,7 @@ public class SrvTaskServiceImpl implements SrvTaskService {
//添加服务计划详情
Long newSrvTaskId = chSrvTask.getSrvTaskId();
this.insertTaskDetail(newSrvTaskId, taskDetails);
saveSrvPlan(programId);
saveSrvPlan(programId,null);
//添加附件
// this.updateAttachs(srvTaskInfoVO.getListAttach(), chSrvTask.getSrvTaskId());
} else {
......@@ -169,9 +169,10 @@ public class SrvTaskServiceImpl implements SrvTaskService {
}
public void saveSrvPlan(String programId){
List<ChSrvPlan> chSrvPlans = chSrvPlanMapper.queryPlan(programId);
public void saveSrvPlan(String programId,String srvPlanTime){
List<ChSrvPlan> chSrvPlans = chSrvPlanMapper.queryPlan(programId,srvPlanTime);
for (ChSrvPlan chSrvPlan : chSrvPlans) {
chSrvPlan.setCreationTime(new Date());
chSrvPlanMapper.insert(chSrvPlan);
}
}
......@@ -223,6 +224,10 @@ public class SrvTaskServiceImpl implements SrvTaskService {
chSrvTaskDetail.setSrvDate(DateUtils.strToDate(nextDay));//服务开始时间
chSrvTaskDetail.setStatus((short) 0);//状态 未执行:0;执行中:1;已执行:2;已失效:3已完成4
chSrvTaskDetailMapper.insert(chSrvTaskDetail);
// ch_srv_plan
String programId = chSrvTask.getProgramId();
saveSrvPlan(programId,nextDay);
}
}
}
......@@ -28,6 +28,9 @@
LEFT JOIN CH_SERVICE_TYPE_detailed d on d.service_type_detailed_id = CSOP.item_name
<where>
disable.SRV_MODE_ID in ('1','2') and program.program_id =#{programId}
<if test="srvPlanTime != null">
and to_char(detail.SRV_DATE,'yyyy-MM-dd') = #{srvPlanTime}
</if>
</where>
order by detail.SRV_DATE desc
</select>
......
......@@ -216,7 +216,7 @@
</where>
</select>
<select id="getAllocationSrvTask" resultType="com.hungraim.ltc.pojo.vo.governance.AllocationSrvTaskVO">
select t.SRV_TASK_ID,t.SRV_DATE,info.EXIT_TIME,info.EXIT_FLAG,info.EXIT_REASON_ID from CH_SRV_TASK t
select t.SRV_TASK_ID,t.SRV_DATE,info.EXIT_TIME,info.EXIT_FLAG,info.EXIT_REASON_ID,t.program_id programId from CH_SRV_TASK t
left join CH_DISABLE_INFO info on t.DISAB_INFO_ID = info.DISAB_INFO_ID
left join ch_apr_task aprtask on info.last_task_id = aprtask.task_id--评定任务
left join ch_apr_report report on aprtask.task_id = report.task_id--评定报告
......
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