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

Merge remote-tracking branch 'origin/uat_ch_master_zwl' into dev_20240509_导出加统筹区_dtd

# Conflicts: # apply/apply-service/src/main/java/com/hungraim/ltc/dao/ChSrvTaskDetailMapper.java
parents db059924 32d4093a
...@@ -4,6 +4,7 @@ import org.springframework.boot.SpringApplication; ...@@ -4,6 +4,7 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
/** /**
...@@ -13,6 +14,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; ...@@ -13,6 +14,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableDiscoveryClient @EnableDiscoveryClient
@EnableTransactionManagement @EnableTransactionManagement
@EnableFeignClients @EnableFeignClients
@EnableScheduling
public class AccountApplication { public class AccountApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(AccountApplication.class, args); SpringApplication.run(AccountApplication.class, args);
......
package com.hungraim.ltc.account.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Data
@ConfigurationProperties(prefix = "auditing.role")
public class AuditingRoleConfig {
private List<String> roleId;
}
...@@ -18,6 +18,7 @@ import org.apache.poi.ss.usermodel.Workbook; ...@@ -18,6 +18,7 @@ import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.text.ParseException; import java.text.ParseException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
...@@ -41,7 +42,7 @@ public class AccountController { ...@@ -41,7 +42,7 @@ public class AccountController {
* @return 返回状态 * @return 返回状态
*/ */
@PostMapping("/addOrUpdateAccount") @PostMapping("/addOrUpdateAccount")
public Result addOrUpdateAccount(AccountOperVo accountOperVo) { public Result addOrUpdateAccount(@RequestHeader("Authorization") String token,AccountOperVo accountOperVo) {
/* if (null == accountOperVo.getSrvOrganId() || null == accountOperVo.getAccountsTime() || StringUtils.isBlank(accountOperVo.getTotalExpensesPayable()) || null == accountOperVo.getAccountsStatus()) { /* if (null == accountOperVo.getSrvOrganId() || null == accountOperVo.getAccountsTime() || StringUtils.isBlank(accountOperVo.getTotalExpensesPayable()) || null == accountOperVo.getAccountsStatus()) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}*/ }*/
...@@ -54,6 +55,8 @@ public class AccountController { ...@@ -54,6 +55,8 @@ public class AccountController {
return Result.failed("当前机构当月已存在结算数据"); return Result.failed("当前机构当月已存在结算数据");
} }
} }
Integer userId = TokenParsingUtil.TokenParsing(token, "userId");
accountOperVo.setUserId(userId);
accountService.addOrUpdateAccount(accountOperVo); accountService.addOrUpdateAccount(accountOperVo);
return Result.success(); return Result.success();
} }
...@@ -116,6 +119,17 @@ public class AccountController { ...@@ -116,6 +119,17 @@ public class AccountController {
return result; return result;
} }
/**
* 批量退回
*
* @return
*/
@PostMapping("/batchAccountReturn")
public Result batchAccountReturn(AccountTaskReqVO accountTaskReqVO){
List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS = accountTaskReqVO.getAccountTaskList();
Result result = accountService.batchAccountReturn(accountTaskExecuteReqVOS);
return result;
}
@GetMapping("/getOtherPlace") @GetMapping("/getOtherPlace")
public Result otherPlaceHandler(String programId){ public Result otherPlaceHandler(String programId){
...@@ -142,6 +156,34 @@ public class AccountController { ...@@ -142,6 +156,34 @@ public class AccountController {
/** /**
* 补卡列表
*
* @param srvTaskReqVO 请求参数对象
* @return 返回
*/
@GetMapping("/getApplyCardList")
public Result<Page<SrvTaskRespVO>> getApplyCardList(@RequestHeader("Authorization") String token,SrvTaskReqVO srvTaskReqVO) {
long srvOrganId = TokenParsingUtil.TokenParsing(token, "srvOrganId");
if(srvOrganId != 0) {
srvTaskReqVO.setSrvOrganId(srvOrganId);
}
Integer userId = TokenParsingUtil.TokenParsing(token, "userId");
srvTaskReqVO.setUserId(userId);
return Result.success(accountService.getSrvTaskCardList(srvTaskReqVO));
}
/**
* 补卡详情
*
* @param taskDetailId 请求参数对象
* @return 返回
*/
@GetMapping("/getApplyCardInfo")
public Result<SrvTaskCardRespDTO> getApplyCardInfo(String taskDetailId) {
return Result.success(accountService.getSrvTaskCardInfo(taskDetailId));
}
/**
* 查询机构结算审核列表 * 查询机构结算审核列表
* *
* @param srvOrganListReq 请求参数对象 * @param srvOrganListReq 请求参数对象
...@@ -207,6 +249,7 @@ public class AccountController { ...@@ -207,6 +249,7 @@ public class AccountController {
if (StringUtils.isBlank(accountsId)) { if (StringUtils.isBlank(accountsId)) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
} }
srvOrganListReq.setAccountsStatus("1");
Page<ChDisabDetailAccountsResp> chAssessDetailAccounts = accountService.queryOrganAccountsDetail(pageNum,pageSize,srvOrganListReq); Page<ChDisabDetailAccountsResp> chAssessDetailAccounts = accountService.queryOrganAccountsDetail(pageNum,pageSize,srvOrganListReq);
return Result.success(chAssessDetailAccounts); return Result.success(chAssessDetailAccounts);
} }
...@@ -219,8 +262,11 @@ public class AccountController { ...@@ -219,8 +262,11 @@ public class AccountController {
*/ */
@GetMapping("/queryAccountsDeclareList") @GetMapping("/queryAccountsDeclareList")
public Result<Page<ChDisabDetailAccountsResp>> queryAccountsDeclareList(@RequestHeader("Authorization") String token,Integer pageNum, Integer pageSize,SrvOrganListReq srvOrganListReq) { public Result<Page<ChDisabDetailAccountsResp>> queryAccountsDeclareList(@RequestHeader("Authorization") String token,Integer pageNum, Integer pageSize,SrvOrganListReq srvOrganListReq) {
List<String> accountsStatusList = Arrays.asList("0", "1"); String accountsStatus = srvOrganListReq.getAccountsStatus();
if(StringUtils.isEmpty(accountsStatus)) {
List<String> accountsStatusList = Arrays.asList("0", "1", "2");
srvOrganListReq.setAccountsStatusList(accountsStatusList); srvOrganListReq.setAccountsStatusList(accountsStatusList);
}
long srvOrganId = TokenParsingUtil.TokenParsing(token, "srvOrganId"); long srvOrganId = TokenParsingUtil.TokenParsing(token, "srvOrganId");
if(srvOrganId !=0) { if(srvOrganId !=0) {
srvOrganListReq.setSrvOrganId(srvOrganId); srvOrganListReq.setSrvOrganId(srvOrganId);
...@@ -231,6 +277,28 @@ public class AccountController { ...@@ -231,6 +277,28 @@ public class AccountController {
return Result.success(chAssessDetailAccounts); return Result.success(chAssessDetailAccounts);
} }
/**
* 基金申报导出
* @param
* @return
*/
@GetMapping("/accountsDeclareExport")
public void accountsDeclareExport(@RequestHeader("Authorization") String token,SrvOrganListReq req,HttpServletResponse response){
long srvOrganId = TokenParsingUtil.TokenParsing(token, "srvOrganId");
if(srvOrganId !=0) {
req.setSrvOrganId(srvOrganId);
}
Workbook workbook = accountService.accountsDeclareExport(req);
// 命名表格
String fileName = "accountsDeclare.xlsx";
FileUtils.exportResponse(workbook,fileName,response);
}
/** /**
* 暂缓列表查询 * 暂缓列表查询
* @param * @param
...@@ -240,6 +308,7 @@ public class AccountController { ...@@ -240,6 +308,7 @@ public class AccountController {
public Result<Page<ChDisabDetailAccountsResp>> queryDelayAccountList(@RequestHeader("Authorization") String token,Integer pageNum, Integer pageSize,SrvOrganListReq srvOrganListReq) { public Result<Page<ChDisabDetailAccountsResp>> queryDelayAccountList(@RequestHeader("Authorization") String token,Integer pageNum, Integer pageSize,SrvOrganListReq srvOrganListReq) {
List<String> list = Arrays.asList("1", "2"); List<String> list = Arrays.asList("1", "2");
srvOrganListReq.setAccountsStatusList(list); srvOrganListReq.setAccountsStatusList(list);
srvOrganListReq.setAccountsStatus(srvOrganListReq.getStatus());
long srvOrganId = TokenParsingUtil.TokenParsing(token, "srvOrganId"); long srvOrganId = TokenParsingUtil.TokenParsing(token, "srvOrganId");
if(srvOrganId != 0) { if(srvOrganId != 0) {
srvOrganListReq.setSrvOrganId(srvOrganId); srvOrganListReq.setSrvOrganId(srvOrganId);
...@@ -271,12 +340,7 @@ public class AccountController { ...@@ -271,12 +340,7 @@ public class AccountController {
*/ */
@PostMapping("/accountsFreeCommit") @PostMapping("/accountsFreeCommit")
public Result accountsFreeCommit(Long accountsDetailId) { public Result accountsFreeCommit(Long accountsDetailId) {
int result = accountService.accountsFreeCommit(accountsDetailId); return accountService.accountsFreeCommit(accountsDetailId);
if (result > 0) {
return Result.success();
} else {
return Result.failed("该记录已不可申报,请联系管理员");
}
} }
/** /**
...@@ -387,13 +451,29 @@ public class AccountController { ...@@ -387,13 +451,29 @@ public class AccountController {
} }
@RequestMapping("/accountReturn") @RequestMapping("/accountReturn")
public Result accountReturn(SrvTaskRespVO srvTaskRespVO) { public Result accountReturn(AccountTaskExecuteReqVO srvTaskRespVO) {
Result result = accountService.accountReturn(srvTaskRespVO); Result result = accountService.accountReturn(srvTaskRespVO);
return result; return result;
} }
/**
*驳回基金申报
**/
@RequestMapping("/accountReportReject")
public Result accountReportReject(ReportRejectReqVO reportRejectReqVO) {
log.info("=======accountReportReject:{}",reportRejectReqVO);
if (null == reportRejectReqVO.getAccountsDetailId()&&StringUtils.isEmpty(reportRejectReqVO.getRemarks())) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if(reportRejectReqVO.getDeductionAmount().compareTo(BigDecimal.ZERO) != 0
||reportRejectReqVO.getReissueAmount().compareTo(BigDecimal.ZERO) != 0){
return Result.failed("该失能人员存在费用扣减,请先移步统筹费用扣减进行清除!");
}
Result result = accountService.accountReportReject(reportRejectReqVO);
return result;
}
......
package com.hungraim.ltc.account.controller;
import com.hungraim.ltc.account.service.AccountService;
import com.hungraim.ltc.redis.RedisLock;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.Calendar;
/**
* @author zwl
* @ClassName
* @description
* @date 2024/5/12 15:14
**/
@Component
@EnableAsync
@Slf4j
public class PlaceOtherController {
@Autowired
private RedisLock redisLock;
@Autowired
private AccountService accountService;
public static final String JOB_PLACE_KEY = "redis.job.task:place";
@Scheduled(cron = "0 30 23 28-31 * ?")
public void disablePlaceHandler() {
boolean flag = redisLock.tryLock(JOB_PLACE_KEY, 1000 * 30);
if (flag) {
final Calendar c = Calendar.getInstance();
if (c.get(Calendar.DATE) == c.getActualMaximum(Calendar.DATE)) {
//是最后一天
accountService.placeOtherTaskQuery();
}
}
}
}
...@@ -46,4 +46,7 @@ public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAcc ...@@ -46,4 +46,7 @@ public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAcc
int queryTaskDetailDisable(TaskDetailDisableVO taskDetailDisableVO); int queryTaskDetailDisable(TaskDetailDisableVO taskDetailDisableVO);
List<AccountDeclareExportResp> queryAccountsDeclareExport(SrvOrganListReq req);
} }
\ No newline at end of file
...@@ -6,8 +6,11 @@ import com.hungraim.ltc.pojo.entity.account.ChDisabFreeRdInfo; ...@@ -6,8 +6,11 @@ import com.hungraim.ltc.pojo.entity.account.ChDisabFreeRdInfo;
import com.hungraim.ltc.pojo.entity.account.OverallCostListRespVO; import com.hungraim.ltc.pojo.entity.account.OverallCostListRespVO;
import com.hungraim.ltc.pojo.entity.account.OverallCostReqVO; import com.hungraim.ltc.pojo.entity.account.OverallCostReqVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
/** /**
* @author zwl * @author zwl
* @ClassName ChDisabFreeRdInfoMapper * @ClassName ChDisabFreeRdInfoMapper
...@@ -19,5 +22,7 @@ import org.springframework.stereotype.Repository; ...@@ -19,5 +22,7 @@ import org.springframework.stereotype.Repository;
public interface ChDisabFreeRdInfoMapper extends BaseMapper<ChDisabFreeRdInfo> { public interface ChDisabFreeRdInfoMapper extends BaseMapper<ChDisabFreeRdInfo> {
Page<OverallCostListRespVO> queryFreeRdInfo(Page page, OverallCostReqVO req); Page<OverallCostListRespVO> queryFreeRdInfo(Page page, OverallCostReqVO req);
List<String> selectByAccountsId(@Param("accountsId")Long accountsId,@Param("dealType") int dealType);
} }
...@@ -7,6 +7,7 @@ import com.hungraim.ltc.pojo.vo.account.SrvTaskReqVO; ...@@ -7,6 +7,7 @@ import com.hungraim.ltc.pojo.vo.account.SrvTaskReqVO;
import com.hungraim.ltc.pojo.vo.account.SrvTaskRespVO; import com.hungraim.ltc.pojo.vo.account.SrvTaskRespVO;
import com.hungraim.ltc.pojo.vo.disable.PlaceOtherVO; import com.hungraim.ltc.pojo.vo.disable.PlaceOtherVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -18,6 +19,11 @@ public interface ChSrvTaskDetailMapper extends BaseMapper<ChSrvTaskDetail> { ...@@ -18,6 +19,11 @@ public interface ChSrvTaskDetailMapper extends BaseMapper<ChSrvTaskDetail> {
Page<SrvTaskRespVO> getSrvTaskList(Page page,SrvTaskReqVO req); Page<SrvTaskRespVO> getSrvTaskList(Page page,SrvTaskReqVO req);
Page<SrvTaskRespVO> getSrvTaskCardList(Page page,SrvTaskReqVO req);
List<SrvTaskRespVO> getSrvTaskCardInfo(String taskDetailId);
/** /**
*@desc 更新任务计划表状态为已完成 *@desc 更新任务计划表状态为已完成
**/ **/
...@@ -30,4 +36,6 @@ public interface ChSrvTaskDetailMapper extends BaseMapper<ChSrvTaskDetail> { ...@@ -30,4 +36,6 @@ public interface ChSrvTaskDetailMapper extends BaseMapper<ChSrvTaskDetail> {
List<PlaceOtherVO> placeOtherTaskQuery(); List<PlaceOtherVO> placeOtherTaskQuery();
int getRoleByUserId(@Param("userId") Integer userId, @Param("roleIds") List<String> roleIds );
} }
\ No newline at end of file
...@@ -16,6 +16,8 @@ import java.util.List; ...@@ -16,6 +16,8 @@ import java.util.List;
public interface AccountService extends IService<ChDisabAccounts> { public interface AccountService extends IService<ChDisabAccounts> {
Result accountReportReject(ReportRejectReqVO reportRejectReqVO);
/** /**
* 添加或修改结算记录 * 添加或修改结算记录
*/ */
...@@ -27,6 +29,8 @@ public interface AccountService extends IService<ChDisabAccounts> { ...@@ -27,6 +29,8 @@ public interface AccountService extends IService<ChDisabAccounts> {
Page<SrvTaskRespVO> getSrvTaskList(SrvTaskReqVO srvTaskReqVO); Page<SrvTaskRespVO> getSrvTaskList(SrvTaskReqVO srvTaskReqVO);
Page<SrvTaskRespVO> getSrvTaskCardList(SrvTaskReqVO srvTaskReqVO);
AccountOperVo getSrvOrganDetail(Long accountsId); AccountOperVo getSrvOrganDetail(Long accountsId);
ExpenseVo expenseSettlement(ExpenseSettlementReq req) throws ParseException; ExpenseVo expenseSettlement(ExpenseSettlementReq req) throws ParseException;
...@@ -35,6 +39,8 @@ public interface AccountService extends IService<ChDisabAccounts> { ...@@ -35,6 +39,8 @@ public interface AccountService extends IService<ChDisabAccounts> {
Workbook accountsDeclareExport(SrvOrganListReq req);
Page<NursingRecordsRespVO> queryNursingRecords(NursingReqVO nursingReqVO); Page<NursingRecordsRespVO> queryNursingRecords(NursingReqVO nursingReqVO);
...@@ -49,6 +55,7 @@ public interface AccountService extends IService<ChDisabAccounts> { ...@@ -49,6 +55,7 @@ public interface AccountService extends IService<ChDisabAccounts> {
int updateChDisabAccounts(int id); int updateChDisabAccounts(int id);
SrvTaskCardRespDTO getSrvTaskCardInfo(String taskDetailId);
Result accountTaskExecute(List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS); Result accountTaskExecute(List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS);
...@@ -56,7 +63,7 @@ public interface AccountService extends IService<ChDisabAccounts> { ...@@ -56,7 +63,7 @@ public interface AccountService extends IService<ChDisabAccounts> {
int deleteAccountsDetail(Long accountsDetailId,Long freeRdId); int deleteAccountsDetail(Long accountsDetailId,Long freeRdId);
int accountsFreeCommit(Long accountsDetailId); Result accountsFreeCommit(Long accountsDetailId);
int delayAccountCommit(Long accountsDetailId,Short status); int delayAccountCommit(Long accountsDetailId,Short status);
...@@ -70,5 +77,7 @@ public interface AccountService extends IService<ChDisabAccounts> { ...@@ -70,5 +77,7 @@ public interface AccountService extends IService<ChDisabAccounts> {
void placeOtherTaskQuery(); void placeOtherTaskQuery();
//退回 //退回
Result accountReturn(SrvTaskRespVO srvTaskRespVO); Result accountReturn(AccountTaskExecuteReqVO srvTaskRespVO);
Result batchAccountReturn(List<AccountTaskExecuteReqVO> srvTaskListRespVO);
} }
...@@ -5,9 +5,11 @@ import cn.afterturn.easypoi.excel.entity.ExportParams; ...@@ -5,9 +5,11 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hungraim.ltc.account.config.AuditingRoleConfig;
import com.hungraim.ltc.account.dao.*; import com.hungraim.ltc.account.dao.*;
import com.hungraim.ltc.account.service.AccountService; import com.hungraim.ltc.account.service.AccountService;
import com.hungraim.ltc.account.service.BaseAccountService; import com.hungraim.ltc.account.service.BaseAccountService;
...@@ -27,6 +29,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -27,6 +29,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -57,12 +60,40 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -57,12 +60,40 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
private final ChSrvPlanMapper chSrvPlanMapper; private final ChSrvPlanMapper chSrvPlanMapper;
@Autowired
private AuditingRoleConfig auditingRoleConfig;
private final ChSrvTaskDetailMapper chSrvTaskDetailMapper; private final ChSrvTaskDetailMapper chSrvTaskDetailMapper;
private final ChSrvTaskFinishItemMapper chSrvTaskFinishItemMapper;; private final ChSrvTaskFinishItemMapper chSrvTaskFinishItemMapper;;
@Override
@Transactional(rollbackFor = Exception.class)
public Result accountReportReject(ReportRejectReqVO reportRejectReqVO) {
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
chDisabDetailAccounts.setLcd(new Date());
chDisabDetailAccounts.setAccountsDetailId(reportRejectReqVO.getAccountsDetailId());
chDisabDetailAccounts.setStatus((short)0);
chDisabDetailAccounts.setDealType(0);
int result = chDisabAccountsDetailMapper.updateById(chDisabDetailAccounts);
if (result > 0) {
ChDisabAccounts chDisabAccountDTO = disabAccountsMapper.selectById(reportRejectReqVO.getAccountsId());
BigDecimal allCost = chDisabAccountDTO.getAllCost();
BigDecimal overallCost = chDisabAccountDTO.getOverallCost();
BigDecimal personalCost = chDisabAccountDTO.getPersonalCost();
BigDecimal allCostSubtract = allCost.subtract(reportRejectReqVO.getAccountsAllCost());
BigDecimal overallCostSubtract = overallCost.subtract(reportRejectReqVO.getAccountsOverallCost());
BigDecimal personalCostSubtract = personalCost.subtract(reportRejectReqVO.getAccountsPersonalCost());
chDisabAccountDTO.setAllCost(allCostSubtract);
chDisabAccountDTO.setOverallCost(overallCostSubtract);
chDisabAccountDTO.setPersonalCost(personalCostSubtract);
chDisabAccountDTO.setLcd(new Date());
disabAccountsMapper.updateById(chDisabAccountDTO);
return Result.success();
} else {
return Result.failed("驳回失败");
}
}
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
...@@ -95,6 +126,8 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -95,6 +126,8 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabAccountDTO.setChooseSettle((short) 1); // 是否结算(0未结算,1已结算) chDisabAccountDTO.setChooseSettle((short) 1); // 是否结算(0未结算,1已结算)
disabAccountsMapper.updateById(chDisabAccountDTO); disabAccountsMapper.updateById(chDisabAccountDTO);
} }
chDisabAccounts.setLcd(new Date());
chDisabAccounts.setLcu(accountOperVo.getUserId());
this.saveOrUpdate(chDisabAccounts); this.saveOrUpdate(chDisabAccounts);
} }
...@@ -107,7 +140,30 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -107,7 +140,30 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override @Override
public Page<SrvOrganAccountListResp> searchSrvOrganAccountList(SrvOrganListReq srvOrganListReq) { public Page<SrvOrganAccountListResp> searchSrvOrganAccountList(SrvOrganListReq srvOrganListReq) {
List<Long> organIds = baseAccountService.getOrganIds(srvOrganListReq.getOrganId(), srvOrganListReq.getIsInvolveChild()); List<Long> organIds = baseAccountService.getOrganIds(srvOrganListReq.getOrganId(), srvOrganListReq.getIsInvolveChild());
return disabAccountsMapper.searchSrvOrganAccountList(new Page<>(srvOrganListReq.getPageNum(), srvOrganListReq.getPageSize()), organIds, srvOrganListReq); Page<SrvOrganAccountListResp> srvOrganAccountListRespPage = disabAccountsMapper.searchSrvOrganAccountList(new Page<>(srvOrganListReq.getPageNum(), srvOrganListReq.getPageSize()), organIds, srvOrganListReq);
List<SrvOrganAccountListResp> records = srvOrganAccountListRespPage.getRecords();
for (SrvOrganAccountListResp record : records) {
Short accountsStatus = record.getAccountsStatus();
if(accountsStatus == 4){
Long accountsId = record.getAccountsId();
// 1 补发 2 扣减
List<String> list = chDisabFreeRdInfoMapper.selectByAccountsId(accountsId, 1);
// 补发
record.setReissueReason(list);
List<String> list1 = chDisabFreeRdInfoMapper.selectByAccountsId(accountsId, 2);
// 扣减
record.setDeductionReason(list1);
Date accountsTime = record.getAccountsTime();
String accountsTimeStr = DateUtils.dateToStr(accountsTime);
Date firstDayOfMonth = DateUtils.getFirstDayOfMonth(DateUtils.strToDate(accountsTimeStr));
record.setSvrStartTime(DateUtils.dateToStr(firstDayOfMonth));
Date date = DateUtils.getlastDayOfMonth(DateUtils.strToDate(accountsTimeStr));
record.setSvrEndTime(DateUtils.dateToStr(date));
}
}
return srvOrganAccountListRespPage;
} }
...@@ -459,15 +515,70 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -459,15 +515,70 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
return workbook; return workbook;
} }
@Override
public Workbook accountsDeclareExport(SrvOrganListReq req) {
List<AccountDeclareExportResp> accountDeclareExportResps = chDisabAccountsDetailMapper.queryAccountsDeclareExport(req);
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF); //对应xlsx
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, AccountDeclareExportResp.class, accountDeclareExportResps);
return workbook;
}
@Override @Override
public Page<ChDisabDetailAccountsResp> queryOrganAccountsDetail(Integer pageNum, Integer pageSize,SrvOrganListReq srvOrganListReq) { public Page<ChDisabDetailAccountsResp> queryOrganAccountsDetail(Integer pageNum, Integer pageSize,SrvOrganListReq srvOrganListReq) {
return chDisabAccountsDetailMapper.queryOrganAccountsDetail(new Page<>(pageNum, pageSize),srvOrganListReq); Page<ChDisabDetailAccountsResp> chDisabDetailAccountsRespPage = chDisabAccountsDetailMapper.queryOrganAccountsDetail(new Page<>(pageNum, pageSize), srvOrganListReq);
/* List<ChDisabDetailAccountsResp> records = chDisabDetailAccountsRespPage.getRecords();
for (ChDisabDetailAccountsResp record : records) {
Integer status = record.getStatus();
if(status == 1){
BigDecimal reportableAmount = new BigDecimal(0);
BigDecimal institutionsDeserve = new BigDecimal(0);
BigDecimal personalDeserve = new BigDecimal(0);
String accountsStartTime = record.getAccountsStartTime();
if(StringUtils.isEmpty(accountsStartTime)){
accountsStartTime = record.getAccountsTime()+"-01";
}
Date date = DateUtils.strToDate(accountsStartTime);
int daysOfMonth = getDaysOfMonth(date);
String modeName = record.getModeName();
if ("上门".equals(modeName)) {
reportableAmount = new BigDecimal(1200);
institutionsDeserve = new BigDecimal(960);
personalDeserve = new BigDecimal(240);
} else if ("养老".equals(modeName)) {
reportableAmount = new BigDecimal(50).multiply(new BigDecimal(daysOfMonth));
institutionsDeserve = reportableAmount.multiply(new BigDecimal("0.7"));
personalDeserve = reportableAmount.multiply(new BigDecimal("0.3"));
} else if ("医疗".equals(modeName) && "1".equals(record.getLevelCode())) {
reportableAmount = new BigDecimal(80).multiply(new BigDecimal(daysOfMonth));
institutionsDeserve = reportableAmount.multiply(new BigDecimal("0.7"));
personalDeserve = reportableAmount.multiply(new BigDecimal("0.3"));
// 二级及以上医疗机构其限额为 100 元/人/天,由长期护理保险基金支付 70%,个人支付 30%;
} else if ("医疗".equals(modeName) && (!"1".equals(record.getLevelCode()))) {
reportableAmount = new BigDecimal(100).multiply(new BigDecimal(daysOfMonth));
institutionsDeserve = reportableAmount.multiply(new BigDecimal("0.7"));
personalDeserve = reportableAmount.multiply(new BigDecimal("0.3"));
}
record.setReportableAmount(reportableAmount.toString());
record.setInstitutionsDeserve(institutionsDeserve.toString());
record.setPersonalDeserve(personalDeserve.toString());
} }
}*/
return chDisabDetailAccountsRespPage;
}
public static int getDaysOfMonth(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
return calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
}
@Override @Override
public Page<NursingRecordsRespVO> queryNursingRecords(NursingReqVO nursingReqVO) { public Page<NursingRecordsRespVO> queryNursingRecords(NursingReqVO nursingReqVO) {
String modeName = nursingReqVO.getModeName(); String modeName = nursingReqVO.getModeName();
...@@ -550,6 +661,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -550,6 +661,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public int overallCostSubmit(OverallCostSubmitReqVO req){ public int overallCostSubmit(OverallCostSubmitReqVO req){
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts(); ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
int dealType = req.getDealType(); int dealType = req.getDealType();
...@@ -610,6 +722,64 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -610,6 +722,64 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
} }
@Override @Override
public Page<SrvTaskRespVO> getSrvTaskCardList(SrvTaskReqVO srvTaskReqVO){
Page<SrvTaskRespVO> srvTaskList = taskDetailMapper.getSrvTaskCardList(new Page<>(srvTaskReqVO.getPageNum(), srvTaskReqVO.getPageSize()), srvTaskReqVO);
List<String> roleIds = auditingRoleConfig.getRoleId();
log.info("==========getSrvTaskCardList====roleIds:{}",roleIds);
// 有审核的权限就配置,根据配置的审核角色查询是否满足条件,如果查到返回给前端1 可以审核,为2不展示审核按钮
int count = taskDetailMapper.getRoleByUserId(srvTaskReqVO.getUserId(), roleIds);
List<SrvTaskRespVO> records = srvTaskList.getRecords();
for (SrvTaskRespVO record : records) {
if(count>0){
record.setAuditFlag(true);
}
}
return srvTaskList;
}
@Override
public SrvTaskCardRespDTO getSrvTaskCardInfo(String taskDetailId){
List<SrvTaskRespVO> records = taskDetailMapper.getSrvTaskCardInfo(taskDetailId);
List<ItemRespVO> itemRespVOS = new ArrayList<>();
for (SrvTaskRespVO record : records) {
ItemRespVO itemRespVO = new ItemRespVO();
itemRespVO.setItemId(record.getItemId());
itemRespVO.setItemName(record.getItemName());
itemRespVOS.add(itemRespVO);
}
SrvTaskCardRespDTO srvTaskCardRespDTO = new SrvTaskCardRespDTO();
srvTaskCardRespDTO.setItemsList(itemRespVOS);
List<String> collect = records.stream().map(SrvTaskRespVO::getItemName).collect(Collectors.toList());
String join = StringUtils.join(collect, ",");
srvTaskCardRespDTO.setItemName(join);
srvTaskCardRespDTO.setRealName(records.get(0).getRealName());
srvTaskCardRespDTO.setEmpName(records.get(0).getEmpName());
srvTaskCardRespDTO.setSrvModeName(records.get(0).getSrvModeName());
srvTaskCardRespDTO.setSrvOrganName(records.get(0).getSrvOrganName());
srvTaskCardRespDTO.setSrvDate(records.get(0).getSrvDate());
srvTaskCardRespDTO.setAuditor(records.get(0).getAuditor());
srvTaskCardRespDTO.setStatus(records.get(0).getStatus());
srvTaskCardRespDTO.setReason(records.get(0).getReason());
srvTaskCardRespDTO.setSrvOrganId(records.get(0).getSrvOrganId());
srvTaskCardRespDTO.setModeId(records.get(0).getModeId());
srvTaskCardRespDTO.setEmpId(records.get(0).getEmpId());
srvTaskCardRespDTO.setAuditRemark(records.get(0).getAuditRemark());
srvTaskCardRespDTO.setTaskDetailId(records.get(0).getTaskDetailId());
srvTaskCardRespDTO.setDisabInfoId(records.get(0).getDisabInfoId());
srvTaskCardRespDTO.setSrvTaskId(Long.parseLong(records.get(0).getSrvTaskId()));
Result<List<ChFndAttach>> listResult = attachFeignService.selectAttachs(Long.valueOf(taskDetailId), AttachType.DISABLE.getUploadType());
if (listResult.getCode().equals(ResultCode.SUCCESS.getCode())) {
srvTaskCardRespDTO.setFileDataList(listResult.getData());
} else {
log.info("请求获取附件列表错误:错误码{},错误信息:{}", listResult.getCode(), listResult.getMsg());
}
return srvTaskCardRespDTO;
}
@Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result accountTaskExecute(List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS) { public Result accountTaskExecute(List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS) {
log.info("organAccountTaskExecute.accountTaskExecuteReqVOS:{}",accountTaskExecuteReqVOS); log.info("organAccountTaskExecute.accountTaskExecuteReqVOS:{}",accountTaskExecuteReqVOS);
...@@ -630,7 +800,6 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -630,7 +800,6 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
for (AccountTaskExecuteReqVO accountTaskExecuteReqVO : accountTaskList) { for (AccountTaskExecuteReqVO accountTaskExecuteReqVO : accountTaskList) {
// 已申报的任务不允许再执行任务 // 已申报的任务不允许再执行任务
String srvDateYm = DateUtils.dateToStrYm(DateUtils.strToDate(accountTaskExecuteReqVO.getSrvDate())); String srvDateYm = DateUtils.dateToStrYm(DateUtils.strToDate(accountTaskExecuteReqVO.getSrvDate()));
accountTaskExecuteReqVO.setSrvDateYm(srvDateYm); accountTaskExecuteReqVO.setSrvDateYm(srvDateYm);
int count = chDisabAccountsDetailMapper.selectByCondition(accountTaskExecuteReqVO); int count = chDisabAccountsDetailMapper.selectByCondition(accountTaskExecuteReqVO);
...@@ -672,6 +841,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -672,6 +841,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
// 已完成任务 已结算 // 已完成任务 已结算
List<OrganAccountsVO> accountsList = chDisabAccountsDetailMapper.queryPlanInfoByDetailId(taskDetailId); List<OrganAccountsVO> accountsList = chDisabAccountsDetailMapper.queryPlanInfoByDetailId(taskDetailId);
if (CollectionUtil.isNotEmpty(accountsList)) { if (CollectionUtil.isNotEmpty(accountsList)) {
log.info("该失能人员当天已有执行记录,不在产生费用,taskDetailId:{}",taskDetailId);
return; return;
}else { }else {
// 不同的护理人员同一天对同一个失能人员服务项目只计一条费用 // 不同的护理人员同一天对同一个失能人员服务项目只计一条费用
...@@ -679,13 +849,14 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -679,13 +849,14 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
if (Objects.nonNull(taskDetailDisableVO)) { if (Objects.nonNull(taskDetailDisableVO)) {
int count = chDisabAccountsDetailMapper.queryTaskDetailDisable(taskDetailDisableVO); int count = chDisabAccountsDetailMapper.queryTaskDetailDisable(taskDetailDisableVO);
if(count>0){ if(count>0){
log.info("该失能人员当天已经有护理人员护理过,不在产生费用"); log.info("该失能人员当天已经有护理人员护理过,不在产生费用,taskDetailId:{}",taskDetailId);
return; return;
} }
} }
} }
ChSrvTaskDetail ca = new ChSrvTaskDetail(); ChSrvTaskDetail ca = new ChSrvTaskDetail();
ca.setStatus((short) 4); ca.setStatus((short) 4);
ca.setLcd(new Date());
ca.setTaskDetailId(Long.valueOf(taskDetailId)); ca.setTaskDetailId(Long.valueOf(taskDetailId));
chSrvTaskDetailMapper.updateById(ca); chSrvTaskDetailMapper.updateById(ca);
AccountTaskExecuteReqVO accountsVO = accountTaskList.get(0); AccountTaskExecuteReqVO accountsVO = accountTaskList.get(0);
...@@ -810,27 +981,37 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -810,27 +981,37 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public int accountsFreeCommit(Long accountsDetailId){ public Result accountsFreeCommit(Long accountsDetailId){
log.info("accountsFreeCommit=========accountsDetailId:{}",accountsDetailId);
ChDisabDetailAccounts chDisabDetailAccountsDTO = chDisabAccountsDetailMapper.selectById(accountsDetailId); ChDisabDetailAccounts chDisabDetailAccountsDTO = chDisabAccountsDetailMapper.selectById(accountsDetailId);
log.info("accountsFreeCommit=========chDisabDetailAccountsDTO:{}",JSON.toJSONString(chDisabDetailAccountsDTO));
BigDecimal allCost = chDisabDetailAccountsDTO.getAccountsAllCost(); BigDecimal allCost = chDisabDetailAccountsDTO.getAccountsAllCost();
BigDecimal overallCost = chDisabDetailAccountsDTO.getAccountsOverallCost(); BigDecimal overallCost = chDisabDetailAccountsDTO.getAccountsOverallCost();
BigDecimal personalCost = chDisabDetailAccountsDTO.getAccountsPersonalCost(); BigDecimal personalCost = chDisabDetailAccountsDTO.getAccountsPersonalCost();
Short status = chDisabDetailAccountsDTO.getStatus();
if(status == 1 ){
log.info("{},已完成申报", accountsDetailId);
return Result.failed("已完成申报,请勿重复提交");
}
Long accountsId = chDisabDetailAccountsDTO.getAccountsId(); Long accountsId = chDisabDetailAccountsDTO.getAccountsId();
ChDisabAccounts chDisabAccountDTO = disabAccountsMapper.selectById(accountsId); ChDisabAccounts chDisabAccountDTO = disabAccountsMapper.selectById(accountsId);
log.info("accountsFreeCommit====before=====chDisabAccountDTO:{}",JSON.toJSONString(chDisabAccountDTO));
Short accountsStatus = chDisabAccountDTO.getAccountsStatus(); Short accountsStatus = chDisabAccountDTO.getAccountsStatus();
if(accountsStatus > 1){ if(accountsStatus > 1){
log.info("{},已完成审核",accountsDetailId); log.info("{},已完成审核", accountsDetailId);
return -1; return Result.failed("机构已完成审核,不能再进行申报");
} }
if(chDisabAccountDTO !=null){ if(chDisabAccountDTO !=null){
BigDecimal accountAllCost = chDisabAccountDTO.getAllCost(); BigDecimal accountAllCost = chDisabAccountDTO.getAllCost();
BigDecimal accountOverallCost = chDisabAccountDTO.getOverallCost(); BigDecimal accountOverallCost = chDisabAccountDTO.getOverallCost();
BigDecimal accountPersonalCost = chDisabAccountDTO.getPersonalCost(); BigDecimal accountPersonalCost = chDisabAccountDTO.getPersonalCost();
chDisabAccountDTO.setAllCost(accountAllCost.add(allCost)); BigDecimal addAllCost = accountAllCost.add(allCost);
chDisabAccountDTO.setAllCost(addAllCost);
chDisabAccountDTO.setOverallCost(accountOverallCost.add(overallCost)); chDisabAccountDTO.setOverallCost(accountOverallCost.add(overallCost));
chDisabAccountDTO.setPersonalCost(accountPersonalCost.add(personalCost)); chDisabAccountDTO.setPersonalCost(accountPersonalCost.add(personalCost));
chDisabAccountDTO.setAccountsStatus((short)1); chDisabAccountDTO.setAccountsStatus((short)1);
log.info("accountsFreeCommit====accountsDetailId:{},累加前费用:{},申报费用:{},累加后费用:{}",accountsDetailId,accountAllCost,allCost,addAllCost);
disabAccountsMapper.updateById(chDisabAccountDTO); disabAccountsMapper.updateById(chDisabAccountDTO);
} }
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts(); ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
...@@ -838,15 +1019,23 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -838,15 +1019,23 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabDetailAccounts.setStatus(((short)1)); chDisabDetailAccounts.setStatus(((short)1));
chDisabDetailAccounts.setDeclarationTime(new Date()); chDisabDetailAccounts.setDeclarationTime(new Date());
chDisabDetailAccounts.setLcd(new Date()); chDisabDetailAccounts.setLcd(new Date());
log.info("accountsFreeCommit=====after====chDisabDetailAccountsDTO:{}",JSON.toJSONString(chDisabDetailAccounts));
int result = chDisabAccountsDetailMapper.updateById(chDisabDetailAccounts); int result = chDisabAccountsDetailMapper.updateById(chDisabDetailAccounts);
return result; if (result > 0) {
return Result.success();
} else {
return Result.failed("操作失败");
} }
}
@Override @Override
public int delayAccountCommit(Long accountsDetailId,Short status){ public int delayAccountCommit(Long accountsDetailId,Short status){
// 暂缓需要将当月的钱减掉 // 暂缓需要将当月的钱减掉
ChDisabDetailAccounts chDisabDetailAccountDTO = chDisabAccountsDetailMapper.selectById(accountsDetailId); ChDisabDetailAccounts chDisabDetailAccountDTO = chDisabAccountsDetailMapper.selectById(accountsDetailId);
log.info("delayAccountCommit====before=====chDisabDetailAccountDTO:{}",JSON.toJSONString(chDisabDetailAccountDTO));
Long accountsId = chDisabDetailAccountDTO.getAccountsId(); Long accountsId = chDisabDetailAccountDTO.getAccountsId();
BigDecimal accountsAllCost = chDisabDetailAccountDTO.getAccountsAllCost(); BigDecimal accountsAllCost = chDisabDetailAccountDTO.getAccountsAllCost();
BigDecimal accountsOverallCost = chDisabDetailAccountDTO.getAccountsOverallCost(); BigDecimal accountsOverallCost = chDisabDetailAccountDTO.getAccountsOverallCost();
...@@ -854,6 +1043,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -854,6 +1043,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
BigDecimal deductionAmount = chDisabDetailAccountDTO.getDeductionAmount(); BigDecimal deductionAmount = chDisabDetailAccountDTO.getDeductionAmount();
BigDecimal reissueAmount = chDisabDetailAccountDTO.getReissueAmount(); BigDecimal reissueAmount = chDisabDetailAccountDTO.getReissueAmount();
ChDisabAccounts chDisabAccountDTO = disabAccountsMapper.selectById(accountsId); ChDisabAccounts chDisabAccountDTO = disabAccountsMapper.selectById(accountsId);
log.info("delayAccountCommit====before=====chDisabAccountDTO:{}",JSON.toJSONString(chDisabAccountDTO));
BigDecimal allCost = chDisabAccountDTO.getAllCost(); BigDecimal allCost = chDisabAccountDTO.getAllCost();
BigDecimal overallCost = chDisabAccountDTO.getOverallCost(); BigDecimal overallCost = chDisabAccountDTO.getOverallCost();
BigDecimal personalCost = chDisabAccountDTO.getPersonalCost(); BigDecimal personalCost = chDisabAccountDTO.getPersonalCost();
...@@ -1045,29 +1235,112 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -1045,29 +1235,112 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void placeOtherTaskQuery(){ public void placeOtherTaskQuery(){
List<PlaceOtherVO> placeOtherVOS = taskDetailMapper.placeOtherTaskQuery(); List<PlaceOtherVO> placeOtherVOS = taskDetailMapper.placeOtherTaskQuery();
if(CollectionUtil.isNotEmpty(placeOtherVOS)) {
int num = placeOtherVOS.size();
int days = DateUtils.getDays();
int total = days*20;
BigDecimal limit = BigDecimal.valueOf(total);
BigDecimal zero = BigDecimal.valueOf(0);
ChDisabAccounts chDisabAccounts = updateOtherAccounts(num, limit, zero);
for (PlaceOtherVO placeOtherVO : placeOtherVOS) { for (PlaceOtherVO placeOtherVO : placeOtherVOS) {
Integer disabInfoId = placeOtherVO.getDisabInfoId(); Integer disabInfoId = placeOtherVO.getDisabInfoId();
String otherApplyTime = placeOtherVO.getOtherApplyTime(); Long accountsId = chDisabAccounts.getAccountsId();
placeFreeHandler(disabInfoId,otherApplyTime); placeFreeHandler1(disabInfoId,accountsId,limit,zero);
} }
} }
}
//退回
private Result placeFreeHandler1(Integer disabInfoId,Long accountsId,BigDecimal limit,BigDecimal zero ) {
ChDisabDetailAccounts chDisabDetailAccountsDTO = chDisabAccountsDetailMapper.queryDisabDetailAccounts("1361", DateUtils.dateToStrYm(new Date()), String.valueOf(disabInfoId), "异地");
if (Objects.isNull(chDisabDetailAccountsDTO)) {
// 异地
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
chDisabDetailAccounts.setAccountsAllCost(limit);
chDisabDetailAccounts.setAccountsOverallCost(limit);
chDisabDetailAccounts.setAccountsPersonalCost(zero);
chDisabDetailAccounts.setModeName("异地");
chDisabDetailAccounts.setSrvOrganId("1361");
chDisabDetailAccounts.setCreationTime(new Date());
chDisabDetailAccounts.setAccountsTime(new Date());
chDisabDetailAccounts.setDisabInfoId(String.valueOf(disabInfoId));
chDisabDetailAccounts.setStatus((short) 1);
chDisabDetailAccounts.setReissueAmount(BigDecimal.valueOf(0));
chDisabDetailAccounts.setDeductionAmount(BigDecimal.valueOf(0));
chDisabDetailAccounts.setAccountsId(accountsId);
chDisabAccountsDetailMapper.insert(chDisabDetailAccounts);
} else {
chDisabDetailAccountsDTO.setAccountsAllCost(limit);
chDisabDetailAccountsDTO.setAccountsOverallCost(limit);
chDisabDetailAccountsDTO.setAccountsPersonalCost(zero);
chDisabDetailAccountsDTO.setLcd(new Date());
chDisabAccountsDetailMapper.updateById(chDisabDetailAccountsDTO);
}
return Result.success();
}
private ChDisabAccounts updateOtherAccounts(int num, BigDecimal limit, BigDecimal zero) {
ChDisabAccounts chDisabAccounts = disabAccountsMapper.queryAccountByCondition(DateUtils.dateToStrYm(new Date()), "异地", "1361", null);
BigDecimal numBig = new BigDecimal(num);
BigDecimal cost = limit.multiply(numBig);
if (chDisabAccounts == null) {
chDisabAccounts = new ChDisabAccounts();
chDisabAccounts.setModeName("异地");
chDisabAccounts.setAccountsTime(new Date());
chDisabAccounts.setSrvOrganId(Long.valueOf(1361));
chDisabAccounts.setCreationTime(new Date());
chDisabAccounts.setAccountsStatus((short) 1);
chDisabAccounts.setAllCost(cost);
chDisabAccounts.setOverallCost(cost);
chDisabAccounts.setPersonalCost(zero);
chDisabAccounts.setReissueAmountTotal(zero);
chDisabAccounts.setDeductionAmountTotal(zero);
disabAccountsMapper.insert(chDisabAccounts);
}else {
ChDisabAccounts chDisabAccount = new ChDisabAccounts();
chDisabAccount.setAllCost(cost);
chDisabAccount.setOverallCost(cost);
Long accountsId = chDisabAccounts.getAccountsId();
chDisabAccount.setAccountsId(accountsId);
disabAccountsMapper.updateById(chDisabAccount);
}
return chDisabAccounts;
}
/**
*@desc 退回
* 1、根据服务机构,时间,失能人员,服务方式查询结算明细表
* 2、删除完成项目表的数据
* 3、查询计划表是否还有已完成的任务,有就只更新状态,
* 只有一条记录结算明细表需要退回费用,并更新服务计划详情表状态
**/
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result accountReturn(SrvTaskRespVO srvTaskRespVO){ public Result accountReturn(AccountTaskExecuteReqVO srvTaskRespVO){
Long taskDetailId = srvTaskRespVO.getTaskDetailId(); Result result = accountReturnHandler(srvTaskRespVO);
return result;
}
public Result accountReturnHandler(AccountTaskExecuteReqVO srvTaskRespVO) {
Long taskDetailId = Long.valueOf(srvTaskRespVO.getTaskDetailId());
String disabInfoId = srvTaskRespVO.getDisabInfoId(); String disabInfoId = srvTaskRespVO.getDisabInfoId();
String srvModeName = srvTaskRespVO.getSrvModeName(); String srvModeName = srvTaskRespVO.getSrvModeName();
String srvPlanTime = srvTaskRespVO.getSrvDate(); String srvPlanTime = srvTaskRespVO.getSrvDate();
Date date = DateUtils.strToDate(srvPlanTime); Date date = DateUtils.strToDate(srvPlanTime);
String srvOrganId = srvTaskRespVO.getSrvOrganId(); String srvOrganId = srvTaskRespVO.getSrvOrganId();
Long itemId = srvTaskRespVO.getItemId(); String itemId = srvTaskRespVO.getItemId();
log.info("AccountServiceImpl====accountReturn===taskDetailId:{},disabInfoId:{},srvPlanTime:{},itemId:{}", taskDetailId, disabInfoId, srvPlanTime, itemId);
ChDisabDetailAccounts chDisabDetailAccounts = chDisabAccountsDetailMapper.queryDisabDetailAccounts(String.valueOf(srvOrganId), DateUtils.dateToStrYm(date), disabInfoId, srvModeName); ChDisabDetailAccounts chDisabDetailAccounts = chDisabAccountsDetailMapper.queryDisabDetailAccounts(String.valueOf(srvOrganId), DateUtils.dateToStrYm(date), disabInfoId, srvModeName);
Short status = chDisabDetailAccounts.getStatus(); Short status = chDisabDetailAccounts.getStatus();
if(status != 0){ if (status != 0) {
return Result.failed("此任务已提交申报,不可再操作,请联系管理员"); return Result.failed("此任务已提交申报,不可再操作,请联系管理员");
} }
// 删除 chSrvTaskFinishItemStream // 删除 chSrvTaskFinishItemStream
...@@ -1075,22 +1348,24 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -1075,22 +1348,24 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
.eq(ChSrvTaskFinishItem::getTaskDetailId, taskDetailId) .eq(ChSrvTaskFinishItem::getTaskDetailId, taskDetailId)
.eq(ChSrvTaskFinishItem::getItemId, itemId); .eq(ChSrvTaskFinishItem::getItemId, itemId);
int delete = chSrvTaskFinishItemMapper.delete(chSrvTaskFinishItem); int delete = chSrvTaskFinishItemMapper.delete(chSrvTaskFinishItem);
LambdaQueryWrapper<ChSrvPlan> queryWrapper= new LambdaQueryWrapper<>(); LambdaQueryWrapper<ChSrvPlan> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ChSrvPlan::getTaskDetailId,taskDetailId); // 一个失能人员对应多个护理人员的情况,需要用时间统计
//queryWrapper.eq(ChSrvPlan::getTaskDetailId,taskDetailId);
queryWrapper.eq(ChSrvPlan::getSrvPlanTime, date);
queryWrapper.eq(ChSrvPlan::getDisabInfoId, disabInfoId);
queryWrapper.eq(ChSrvPlan::getIsStatus, (short) 4); queryWrapper.eq(ChSrvPlan::getIsStatus, (short) 4);
List<ChSrvPlan> srvPlanList = chSrvPlanMapper.selectList(queryWrapper); List<ChSrvPlan> srvPlanList = chSrvPlanMapper.selectList(queryWrapper);
int size = srvPlanList.size(); int size = srvPlanList.size();
log.info("accountReturn===paln===size:{}", size);
// 大于1说明还有已完成的任务,不退回,只更新状态 等于1结算退回费用 // 大于1说明还有已完成的任务,不退回,只更新状态 等于1结算退回费用
try {
ChSrvPlan chSrvPlan = new ChSrvPlan(); ChSrvPlan chSrvPlan = new ChSrvPlan();
chSrvPlan.setIsStatus(0L); chSrvPlan.setIsStatus(0L);
chSrvPlan.setPlanID(srvTaskRespVO.getPlanId()); chSrvPlan.setIsBill(0L);
chSrvPlan.setLcd(new Date());
chSrvPlan.setPlanID(Long.valueOf(srvTaskRespVO.getPlanId()));
chSrvPlanMapper.updateById(chSrvPlan); chSrvPlanMapper.updateById(chSrvPlan);
ChSrvTaskDetail ca = new ChSrvTaskDetail(); if (size == 1) {
ca.setStatus((short) 0);
ca.setTaskDetailId(Long.valueOf(taskDetailId));
chSrvTaskDetailMapper.updateById(ca);
if(size == 1){
BigDecimal accountsAllCost = chDisabDetailAccounts.getAccountsAllCost(); BigDecimal accountsAllCost = chDisabDetailAccounts.getAccountsAllCost();
if (accountsAllCost.compareTo(BigDecimal.ZERO) == 0) { if (accountsAllCost.compareTo(BigDecimal.ZERO) == 0) {
return Result.success("当前费用为0,不再进行费用退回"); return Result.success("当前费用为0,不再进行费用退回");
...@@ -1098,7 +1373,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -1098,7 +1373,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
BigDecimal accountsOverallCost = chDisabDetailAccounts.getAccountsOverallCost(); BigDecimal accountsOverallCost = chDisabDetailAccounts.getAccountsOverallCost();
BigDecimal accountsPersonalCost = chDisabDetailAccounts.getAccountsPersonalCost(); BigDecimal accountsPersonalCost = chDisabDetailAccounts.getAccountsPersonalCost();
BigDecimal allCost = new BigDecimal(0); BigDecimal allCost = new BigDecimal(0);
BigDecimal overCost= new BigDecimal(0); BigDecimal overCost = new BigDecimal(0);
BigDecimal personCost = new BigDecimal(0); BigDecimal personCost = new BigDecimal(0);
if ("养老".equals(srvModeName)) { if ("养老".equals(srvModeName)) {
allCost = BigDecimal.valueOf(50); allCost = BigDecimal.valueOf(50);
...@@ -1127,7 +1402,26 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -1127,7 +1402,26 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabDetailAccounts.setAccountsPersonalCost(personCostSubtract); chDisabDetailAccounts.setAccountsPersonalCost(personCostSubtract);
chDisabDetailAccounts.setLcd(new Date()); chDisabDetailAccounts.setLcd(new Date());
chDisabAccountsDetailMapper.updateById(chDisabDetailAccounts); chDisabAccountsDetailMapper.updateById(chDisabDetailAccounts);
ChSrvTaskDetail ca = new ChSrvTaskDetail();
ca.setStatus((short) 0);
ca.setTaskDetailId(Long.valueOf(taskDetailId));
ca.setLcd(new Date());
chSrvTaskDetailMapper.updateById(ca);
}
return Result.success();
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result batchAccountReturn(List<AccountTaskExecuteReqVO> srvTaskListRespVO){
try {
for (AccountTaskExecuteReqVO srvTaskRespVO : srvTaskListRespVO) {
Result result = accountReturnHandler(srvTaskRespVO);
if(!ResultCode.SUCCESS.getCode().equals(result.getCode())){
return result;
}
} }
} catch (Exception e) { } catch (Exception e) {
log.error("==============accountReturn error:{}",e); log.error("==============accountReturn error:{}",e);
...@@ -1137,3 +1431,5 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -1137,3 +1431,5 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
} }
} }
...@@ -15,11 +15,14 @@ ...@@ -15,11 +15,14 @@
o.SRV_ORGAN_NAME srvOrganName, o.SRV_ORGAN_NAME srvOrganName,
o.SRV_ORGAN_ID srvOrganId, o.SRV_ORGAN_ID srvOrganId,
info.REAL_NAME realName, info.REAL_NAME realName,
info.CERTI_CODE certiCode,
info.DISAB_INFO_ID disabInfoId, info.DISAB_INFO_ID disabInfoId,
d.DEDUCTION_AMOUNT deductionAmount, d.DEDUCTION_AMOUNT deductionAmount,
d.REISSUE_AMOUNT reissueAmount, d.REISSUE_AMOUNT reissueAmount,
d.ACCOUNTS_DETAIL_ID accountsDetailId, d.ACCOUNTS_DETAIL_ID accountsDetailId,
d.STATUS d.STATUS,
d.ACCOUNTS_ID accountsId,
o.LEVEL_CODE levelCode
from CH_DISAB_ACCOUNTS_DETAIL d from CH_DISAB_ACCOUNTS_DETAIL d
left join CH_DISABLE_INFO info on d.DISAB_INFO_ID = info.DISAB_INFO_ID left join CH_DISABLE_INFO info on d.DISAB_INFO_ID = info.DISAB_INFO_ID
left join CH_DISABLE_APPLY apply on info.APPLY_ID=apply.APPLY_ID left join CH_DISABLE_APPLY apply on info.APPLY_ID=apply.APPLY_ID
...@@ -41,6 +44,10 @@ ...@@ -41,6 +44,10 @@
<if test="req.realName != null and req.realName != ''"> <if test="req.realName != null and req.realName != ''">
AND info.real_name LIKE CONCAT('%',CONCAT(#{req.realName},'%')) AND info.real_name LIKE CONCAT('%',CONCAT(#{req.realName},'%'))
</if> </if>
<if test="req.certiCode != null and req.certiCode != ''">
AND info.CERTI_CODE = #{req.certiCode}
</if>
<if test="req.srvOrganId != null and req.srvOrganId != '' and req.srvOrganId!=0"> <if test="req.srvOrganId != null and req.srvOrganId != '' and req.srvOrganId!=0">
and d.SRV_ORGAN_ID = #{req.srvOrganId} and d.SRV_ORGAN_ID = #{req.srvOrganId}
</if> </if>
...@@ -56,6 +63,63 @@ ...@@ -56,6 +63,63 @@
</if> </if>
</where> </where>
order by info.DISAB_INFO_ID
</select>
<select id="queryAccountsDeclareExport" resultType="com.hungraim.ltc.pojo.vo.account.AccountDeclareExportResp">
select
d.MODE_NAME modeName,
to_char(d.ACCOUNTS_START_TIME,'yyyy-MM-dd') accountsStartTime,
to_char(d.ACCOUNTS_END_TIME,'yyyy-MM-dd') accountsEndTime,
to_char(d.ACCOUNTS_TIME,'yyyy-MM') accountsTime,
d.ACCOUNTS_ALL_COST accountsAllCost,
d.ACCOUNTS_OVERALL_COST accountsOverallCost,
d.ACCOUNTS_PERSONAL_COST accountsPersonalCost,
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,
DECODE(d.STATUS, '0','未申报','1', '已申报','2','已暂缓') status,
d.ACCOUNTS_ID accountsId
from CH_DISAB_ACCOUNTS_DETAIL d
left join CH_DISABLE_INFO info on d.DISAB_INFO_ID = info.DISAB_INFO_ID
left join CH_DISABLE_APPLY apply on info.APPLY_ID=apply.APPLY_ID
left join CH_SRV_ORGAN o on d.SRV_ORGAN_ID = o.SRV_ORGAN_ID
<where>
d.mode_name <![CDATA[ <>]]> '异地'
<if test="modeId != null and modeId != ''">
and DECODE(d.mode_name, '医疗','1','养老', '2','上门','3', '异地', '4') = #{modeId}
</if>
<if test="accountsStatus != null and accountsStatus != ''">
and d.status = #{accountsStatus}
</if>
<if test="realName != null and realName != ''">
AND info.real_name LIKE CONCAT('%',CONCAT(#{realName},'%'))
</if>
<if test="srvOrganId != null and srvOrganId != '' and srvOrganId!=0">
and d.SRV_ORGAN_ID = #{srvOrganId}
</if>
<if test="accountsTime != null and accountsTime != ''">
AND to_char(d.ACCOUNTS_TIME,'yyyy-MM') = #{accountsTime}
</if>
<if test='accountsStatusList != null and accountsStatusList.size()>0'>
AND d.status IN
<foreach collection="accountsStatusList" open="(" close=")" item="accountsStatusList" separator=",">
#{accountsStatusList}
</foreach>
</if>
</where>
order by info.DISAB_INFO_ID
</select> </select>
<select id="queryNursingRecords" resultType="com.hungraim.ltc.pojo.entity.account.NursingRecordsRespVO"> <select id="queryNursingRecords" resultType="com.hungraim.ltc.pojo.entity.account.NursingRecordsRespVO">
...@@ -75,7 +139,7 @@ ...@@ -75,7 +139,7 @@
and plan.MODE_ID = #{req.modeId} and plan.MODE_ID = #{req.modeId}
and to_char(plan.SRV_PLAN_TIME,'yyyy-MM') = #{req.accountsTime} and to_char(plan.SRV_PLAN_TIME,'yyyy-MM') = #{req.accountsTime}
and plan.IS_STATUS ='4' and plan.IS_STATUS ='4'
order by plan.SRV_PLAN_TIME desc order by plan.SRV_PLAN_TIME desc,plan.PLAN_ID
</select> </select>
<select id="queryNursingRecordsGoDoor" resultType="com.hungraim.ltc.pojo.entity.account.NursingRecordsRespVO"> <select id="queryNursingRecordsGoDoor" resultType="com.hungraim.ltc.pojo.entity.account.NursingRecordsRespVO">
...@@ -98,7 +162,7 @@ from CH_SRV_TASK_FINISH_ITEM item ...@@ -98,7 +162,7 @@ from CH_SRV_TASK_FINISH_ITEM item
LEFT JOIN CH_SRV_ORGAN_PROJECT CSOP ON CSOP.PROJECT_ID = item.ITEM_ID LEFT JOIN CH_SRV_ORGAN_PROJECT CSOP ON CSOP.PROJECT_ID = item.ITEM_ID
left join CH_SERVICE_TYPE_DETAILED service on service.SERVICE_TYPE_DETAILED_ID = CSOP.ITEM_NAME left join CH_SERVICE_TYPE_DETAILED service on service.SERVICE_TYPE_DETAILED_ID = CSOP.ITEM_NAME
where to_char(detail.SRV_DATE, 'yyyy-MM') = #{req.accountsTime} and task.DISAB_INFO_ID = #{req.disabInfoId} where to_char(detail.SRV_DATE, 'yyyy-MM') = #{req.accountsTime} and task.DISAB_INFO_ID = #{req.disabInfoId}
and organ.SRV_ORGAN_ID = #{req.srvOrganId} order by detail.SRV_DATE desc and organ.SRV_ORGAN_ID = #{req.srvOrganId} order by detail.SRV_DATE desc,item.task_finish_item_id
</select> </select>
...@@ -250,7 +314,7 @@ and organ.SRV_ORGAN_ID = #{req.srvOrganId} order by detail.SRV_DATE desc ...@@ -250,7 +314,7 @@ and organ.SRV_ORGAN_ID = #{req.srvOrganId} order by detail.SRV_DATE desc
left join CH_SRV_ORGAN o on d.SRV_ORGAN_ID = o.SRV_ORGAN_ID left join CH_SRV_ORGAN o on d.SRV_ORGAN_ID = o.SRV_ORGAN_ID
LEFT JOIN CH_FND_ORGAN t3 ON o.ORGAN_ID = t3.ORGAN_ID LEFT JOIN CH_FND_ORGAN t3 ON o.ORGAN_ID = t3.ORGAN_ID
<where> <where>
1=1 1=1 and d.status = 1
<if test="accountsId != null and accountsId != ''"> <if test="accountsId != null and accountsId != ''">
and d.ACCOUNTS_ID = #{accountsId} and d.ACCOUNTS_ID = #{accountsId}
</if> </if>
......
...@@ -21,9 +21,14 @@ ...@@ -21,9 +21,14 @@
select * from CH_DISAB_ACCOUNTS t where t.MODE_NAME = #{modeName} select * from CH_DISAB_ACCOUNTS t where t.MODE_NAME = #{modeName}
and to_char(t.ACCOUNTS_TIME,'yyyy-MM') = #{accountsTime} and to_char(t.ACCOUNTS_TIME,'yyyy-MM') = #{accountsTime}
and t.SRV_ORGAN_ID = #{srvOrganId} and t.SRV_ORGAN_ID = #{srvOrganId}
<if test="isDelay !=null"> <choose>
<when test="isDelay != null">
and t.IS_DELAY = 2 and t.IS_DELAY = 2
</if> </when>
<otherwise>
and t.IS_DELAY is null
</otherwise>
</choose>
</select> </select>
...@@ -47,7 +52,8 @@ ...@@ -47,7 +52,8 @@
to_char(t1.SVR_END_TIME,'yyyy-MM-dd') svrEndTime, to_char(t1.SVR_END_TIME,'yyyy-MM-dd') svrEndTime,
t1.TOTAL_ALLOCATED_EXPENSES totalAllocatedExpenses, t1.TOTAL_ALLOCATED_EXPENSES totalAllocatedExpenses,
t1.REISSUE_AMOUNT_TOTAL reissueAmountTotal, t1.REISSUE_AMOUNT_TOTAL reissueAmountTotal,
t1.DEDUCTION_AMOUNT_TOTAL deductionAmountTotal t1.DEDUCTION_AMOUNT_TOTAL deductionAmountTotal,
(select count(1) from CH_DISAB_ACCOUNTS_DETAIL d where d.ACCOUNTS_ID =t1.ACCOUNTS_ID and d.STATUS = 1) personDay
FROM FROM
CH_DISAB_ACCOUNTS t1 CH_DISAB_ACCOUNTS t1
LEFT JOIN CH_SRV_ORGAN t2 ON t1.SRV_ORGAN_ID = t2.SRV_ORGAN_ID LEFT JOIN CH_SRV_ORGAN t2 ON t1.SRV_ORGAN_ID = t2.SRV_ORGAN_ID
......
...@@ -48,5 +48,14 @@ ...@@ -48,5 +48,14 @@
<select id="selectByAccountsId" resultType="java.lang.String">
select f.real_name||':'||i.REMARKS from CH_DISAB_FREE_RD_INFO i left join CH_DISAB_ACCOUNTS_DETAIL d on
i.ACCOUNTS_DETAIL_ID = d.ACCOUNTS_DETAIL_ID left join CH_DISABLE_INFO f
on d.DISAB_INFO_ID = f.DISAB_INFO_ID
where i.ACCOUNTS_ID = #{accountsId} and
i.DEAL_TYPE = #{dealType}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -45,6 +45,78 @@ ...@@ -45,6 +45,78 @@
</select> </select>
<select id="getSrvTaskCardList" resultType="com.hungraim.ltc.pojo.vo.account.SrvTaskRespVO">
select distinct info.REAL_NAME realName,
plan.TASK_DETAIL_ID taskDetailId,
emp.emp_name empName,
emp.emp_id empId,
info.DISAB_INFO_ID disabInfoId,
organ.SRV_ORGAN_NAME srvOrganName,
DECODE(plan.MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地') srvModeName,
to_char(plan.SRV_PLAN_TIME,'yyyy-MM-dd') srvDate,
detail.check_status status
from ch_srv_plan plan
left join ch_disable_info info on plan.DISAB_INFO_ID = info.DISAB_INFO_ID
left join ch_srv_organ_emp emp on plan.emp_id = emp.emp_id
left join CH_SRV_TASK_DETAIL detail on detail.TASK_DETAIL_ID = plan.TASK_DETAIL_ID
left join CH_SRV_ORGAN organ on organ.SRV_ORGAN_ID = plan.SRV_ORGAN_ID
<where>
1=1 and detail.check_status in (1,2,3)
<if test="req.status != null and req.status != ''">
and detail.check_status = #{req.status}
</if>
<if test="req.realName != null and req.realName != ''">
AND info.real_name LIKE CONCAT('%',CONCAT(#{req.realName},'%'))
</if>
<if test="req.srvOrganName != null and req.srvOrganName != ''">
AND organ.SRV_ORGAN_NAME LIKE CONCAT('%',CONCAT(#{req.srvOrganName},'%'))
</if>
<if test="req.srvDate != null and req.srvDate != ''">
AND to_char(plan.SRV_PLAN_TIME,'yyyy-MM-dd') = #{req.srvDate}
</if>
<if test="req.srvOrganId != null and req.srvOrganId != '' and req.srvOrganId!=0">
AND organ.SRV_ORGAN_ID = #{req.srvOrganId}
</if>
</where>
order by status,taskDetailId
</select>
<select id="getSrvTaskCardInfo" resultType="com.hungraim.ltc.pojo.vo.account.SrvTaskRespVO">
select info.REAL_NAME realName,
plan.PLAN_ID planId,
plan.ITEM_ID itemId,
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,
detail.check_status status,
detail.clock_reason reason,
detail.auditor,
detail.srv_task_id srvTaskId,
detail.task_detail_id taskDetailId,
info.srv_mode_id modeId,
detail.audit_remark auditRemark
from ch_srv_plan plan
left join ch_disable_info info on plan.DISAB_INFO_ID = info.DISAB_INFO_ID
left join ch_srv_organ_emp emp on plan.emp_id = emp.emp_id
left join CH_SRV_TASK_DETAIL detail on detail.TASK_DETAIL_ID = plan.TASK_DETAIL_ID
left join CH_SRV_ORGAN organ on organ.SRV_ORGAN_ID = plan.SRV_ORGAN_ID
<where>
1=1 and detail.check_status in (1,2,3)
<if test="taskDetailId != null and taskDetailId != ''">
and detail.TASK_DETAIL_ID = #{taskDetailId}
</if>
</where>
</select>
<update id="updateSrvPlanById"> <update id="updateSrvPlanById">
update CH_SRV_PLAN plan set plan.is_status= '4',plan.creation_time=sysdate where plan.plan_id = #{planId} update CH_SRV_PLAN plan set plan.is_status= '4',plan.creation_time=sysdate where plan.plan_id = #{planId}
</update> </update>
...@@ -84,26 +156,17 @@ ...@@ -84,26 +156,17 @@
<select id="placeOtherTaskQuery" resultType="com.hungraim.ltc.pojo.vo.disable.PlaceOtherVO"> <select id="placeOtherTaskQuery" resultType="com.hungraim.ltc.pojo.vo.disable.PlaceOtherVO">
SELECT distinct info.DISAB_INFO_ID disabInfoId, SELECT distinct info.DISAB_INFO_ID disabInfoId,
report.evaluate_time evaluateTime,
task.ORGAN_ID organId,
report.disable_level_id disableLevelId,
info.REAL_NAME realName, info.REAL_NAME realName,
info.CERTI_CODE certiCode,
(SELECT DISE_TYPE_CODE FROM CH_FND_DISEASE_TYPE WHERE info.DISE_TYPE_S = DISE_TYPE_ID) diseTypeS,
info.disease_desc diseaseDesc,
lev.DISABLE_LEVEL_NAME riskLevel,
report.PUBLICITY_START_TIME publicityStartTime,
report.PUBLICITY_END_TIME publicityEndTime,
report.PUBLICITY_TIME publicityTime,
to_char(info.OTHER_APPLY_TIME,'yyyy-MM-dd') otherApplyTime to_char(info.OTHER_APPLY_TIME,'yyyy-MM-dd') otherApplyTime
FROM CH_DISABLE_INFO info FROM CH_DISABLE_INFO info
LEFT JOIN CH_APR_TASK task ON info.DISAB_INFO_ID = task.DISABLE_INFO_ID where info.SRV_MODE_ID ='4'
LEFT JOIN ch_apr_report report ON report.TASK_ID = task.TASK_ID
left join ch_apr_organ aprOrgan on task.apr_organ_id = aprOrgan.apr_organ_id
LEFT JOIN CH_CFG_SRV_DISABLE_LEVEL lev ON report.DISABLE_LEVEL_ID = lev.DISABLE_LEVEL_ID
where info.SRV_MODE_ID ='4' and sysdate <![CDATA[ > ]]> report.PUBLICITY_END_TIME
and info.OTHER_APPLY_TIME is not null and info.OTHER_APPLY_TIME is not null
and info.OTHER_APPLY_TIME = to_date(to_char(sysdate,'yyyy-MM-dd'),'yyyy-MM-dd') and (info.exit_reason_id !='1' or info.exit_reason_id is null)
and info.OTHER_APPLY_TIME <![CDATA[ <= ]]> to_date(to_char(sysdate,'yyyy-MM-dd'),'yyyy-MM-dd')
and info.DISAB_INFO_ID not in (
select d.disab_info_id from CH_DISAB_ACCOUNTS_detail d where d.mode_name <![CDATA[ <> ]]> '异地' and to_char(d.accounts_time,'yyyy-MM') = to_char(sysdate,'yyyy-MM')
)
</select> </select>
...@@ -113,6 +176,14 @@ ...@@ -113,6 +176,14 @@
</update> </update>
<select id="getRoleByUserId" resultType="java.lang.Integer">
select count(*) from LTC_USER_ROLE r where r.user_id = #{userId}
<if test="roleIds != null">
and r.role_id in
<foreach collection="roleIds" item="roleIds" open="(" close=")" separator=",">
#{roleIds}
</foreach>
</if>
</select>
</mapper> </mapper>
...@@ -37,11 +37,11 @@ public interface ChSrvTaskDetailMapper extends BaseMapper<ChSrvTaskDetail> { ...@@ -37,11 +37,11 @@ public interface ChSrvTaskDetailMapper extends BaseMapper<ChSrvTaskDetail> {
ChDisabDetailAccounts selectAccountsDetail(String disabInfoId, String srvDateStr); ChDisabDetailAccounts selectAccountsDetail(String disabInfoId, String srvDateStr);
void updateChDisabDetailAccounts(Long accountsId, BigDecimal accountsAllCostsub, BigDecimal accountsOverallCostsub, BigDecimal accountsPersonalCostsub);
List<ChSrvTaskDetail2Vo> chSrvTaskDetailExportList(Long empId, String empName,String status,String sevrTime); List<ChSrvTaskDetail2Vo> chSrvTaskDetailExportList(Long empId, String empName,String status,String sevrTime);
void updateChDisabDetailAccounts(Long accountsDetailId, BigDecimal accountsAllCostsub, BigDecimal accountsOverallCostsub, BigDecimal accountsPersonalCostsub);
} }
...@@ -505,6 +505,7 @@ public class DisableServiceImpl implements DisableService { ...@@ -505,6 +505,7 @@ public class DisableServiceImpl implements DisableService {
// 新建disable_info_his表的一条数据,保存历史失能信息记录 // 新建disable_info_his表的一条数据,保存历史失能信息记录
ChDisableInfoHis chDisableInfoHis = new ChDisableInfoHis(); ChDisableInfoHis chDisableInfoHis = new ChDisableInfoHis();
BeanUtil.copyProperties(chDisableInfo, chDisableInfoHis); BeanUtil.copyProperties(chDisableInfo, chDisableInfoHis);
chDisableInfoHis.setLcd(null);
disableInfoHisMapper.insert(chDisableInfoHis); disableInfoHisMapper.insert(chDisableInfoHis);
//更新info //更新info
ChDisableInfo newDisableInfo = new ChDisableInfo(); ChDisableInfo newDisableInfo = new ChDisableInfo();
...@@ -654,25 +655,25 @@ public class DisableServiceImpl implements DisableService { ...@@ -654,25 +655,25 @@ public class DisableServiceImpl implements DisableService {
ChDisableInfo chDisableInfo = new ChDisableInfo(); ChDisableInfo chDisableInfo = new ChDisableInfo();
chDisableInfo.setDisabInfoId(disableInfoId); chDisableInfo.setDisabInfoId(disableInfoId);
chDisableInfo.setExitFlag(1); chDisableInfo.setExitFlag(1);
chDisableInfo.setExitTime(date); chDisableInfo.setExitTime(date);
chDisableInfo.setExitReasonId(exitReasonId); chDisableInfo.setExitReasonId(exitReasonId);
chDisableInfo.setLcd(new Date());
chDisableInfo.setExitSrvOrganId(srvOrganId); chDisableInfo.setExitSrvOrganId(srvOrganId);
int result = disableInfoMapper.updateById(chDisableInfo); int result = disableInfoMapper.updateById(chDisableInfo);
boolean now = DateUtils.isNow(date); // boolean now = DateUtils.isNow(date);
if (now) { // if (now) {
disableExitHanlder(exitReasonId, srvOrganId, disableInfoId, date); disableExitHanlder(exitReasonId, srvOrganId, disableInfoId, date);
} else { // } else {
// 插入历史记录 // // 插入历史记录
ChDisableExit chDisableExit = new ChDisableExit(); // ChDisableExit chDisableExit = new ChDisableExit();
chDisableExit.setDisabInfoId(disableInfoId); // chDisableExit.setDisabInfoId(disableInfoId);
chDisableExit.setExitReasonId(exitReasonId); // chDisableExit.setExitReasonId(exitReasonId);
chDisableExit.setExitTime(date); // chDisableExit.setExitTime(date);
chDisableExit.setSrvOrganId(srvOrganId); // chDisableExit.setSrvOrganId(srvOrganId);
disableExitMapper.insert(chDisableExit); // disableExitMapper.insert(chDisableExit);
return Result.failed("操作成功,退出状态及服务方案和计划将在"+exitTime+"日自动终止"); // return Result.failed("操作成功,退出状态及服务方案和计划将在"+exitTime+"日自动终止");
} // }
if (result > 0) { if (result > 0) {
return Result.success(); return Result.success();
} else { } else {
...@@ -695,6 +696,7 @@ public class DisableServiceImpl implements DisableService { ...@@ -695,6 +696,7 @@ public class DisableServiceImpl implements DisableService {
chSrvProgram.setDisabInfoId(Long.valueOf(disableInfoId)); chSrvProgram.setDisabInfoId(Long.valueOf(disableInfoId));
chSrvProgram.setProgStatus(2); chSrvProgram.setProgStatus(2);
chSrvProgram.setEndReason("失能人员退出,终止方案"); chSrvProgram.setEndReason("失能人员退出,终止方案");
chSrvProgram.setLcd(new Date());
disableInfoMapper.updateSrvProgramById(chSrvProgram); disableInfoMapper.updateSrvProgramById(chSrvProgram);
UpdateWrapper updateWrapper2 = new UpdateWrapper(); UpdateWrapper updateWrapper2 = new UpdateWrapper();
...@@ -708,7 +710,7 @@ public class DisableServiceImpl implements DisableService { ...@@ -708,7 +710,7 @@ public class DisableServiceImpl implements DisableService {
ChSrvSend chSrvSend = new ChSrvSend(); ChSrvSend chSrvSend = new ChSrvSend();
chSrvSend.setDisabInfoId(Long.valueOf(disableInfoId)); chSrvSend.setDisabInfoId(Long.valueOf(disableInfoId));
chSrvSend.setEndTime(date); chSrvSend.setEndTime(date);
chSrvSend.setLcd(new Date());
// 更新已分配为已退出 // 更新已分配为已退出
chSrvSend.setStatus((short)3); chSrvSend.setStatus((short)3);
disableInfoMapper.updateSrvSendById(chSrvSend); disableInfoMapper.updateSrvSendById(chSrvSend);
......
...@@ -45,7 +45,7 @@ public class OrganServiceImpl implements OrganService { ...@@ -45,7 +45,7 @@ public class OrganServiceImpl implements OrganService {
List<Long> organIds = new ArrayList<>(); List<Long> organIds = new ArrayList<>();
if (organId != null && organId != 0) { if (organId != null && organId != 0) {
organIds.add(organId); organIds.add(organId);
if (isInvolveChild) { if (isInvolveChild!=null && isInvolveChild) {
getOrganList(organId, organIds); getOrganList(organId, organIds);
} }
} }
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
SELECT max(T6.SRV_SEND_ID) srvSendId, SELECT max(T6.SRV_SEND_ID) srvSendId,
T2.DISAB_INFO_ID disabInfoId, T2.DISAB_INFO_ID disabInfoId,
T2.REAL_NAME realName, T2.REAL_NAME realName,
max(T2.gender) gender,
DECODE(max(T2.SRV_MODE_ID), '1','医疗','2', '养老','3','上门', '4', '异地') svrModelName, DECODE(max(T2.SRV_MODE_ID), '1','医疗','2', '养老','3','上门', '4', '异地') svrModelName,
max(T2.SRV_MODE_ID) svrModelId,
to_char(max(e.EXIT_TIME),'yyyy-MM-dd') exitTime, to_char(max(e.EXIT_TIME),'yyyy-MM-dd') exitTime,
max(T2.CERTI_CODE) CERTI_CODE, max(T2.CERTI_CODE) CERTI_CODE,
max(e.EXIT_REASON_ID) exitReasonId, max(e.EXIT_REASON_ID) exitReasonId,
......
...@@ -100,6 +100,7 @@ public class ReTaskServiceImpl extends ServiceImpl<TaskMapper, ChAprTask> implem ...@@ -100,6 +100,7 @@ public class ReTaskServiceImpl extends ServiceImpl<TaskMapper, ChAprTask> implem
// 先保存历史失能人员信息 // 先保存历史失能人员信息
ChDisableInfoHis chDisableInfoHis = new ChDisableInfoHis(); ChDisableInfoHis chDisableInfoHis = new ChDisableInfoHis();
BeanUtil.copyProperties(chDisableInfo, chDisableInfoHis); BeanUtil.copyProperties(chDisableInfo, chDisableInfoHis);
chDisableInfoHis.setLcd(null);
disableInfoHisMapper.insert(chDisableInfoHis); disableInfoHisMapper.insert(chDisableInfoHis);
ChDisableInfo newDisableInfo = new ChDisableInfo(); ChDisableInfo newDisableInfo = new ChDisableInfo();
......
...@@ -123,6 +123,12 @@ public class ChDisabAccounts implements Serializable { ...@@ -123,6 +123,12 @@ public class ChDisabAccounts implements Serializable {
private Short isDelay; private Short isDelay;
private Date lcd;
private Integer lcu;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -53,6 +53,8 @@ public class ChDisabDetailAccountsResp implements Serializable { ...@@ -53,6 +53,8 @@ public class ChDisabDetailAccountsResp implements Serializable {
private String realName; private String realName;
private String certiCode;
private String taskDetailId; private String taskDetailId;
private String deductionAmount; private String deductionAmount;
...@@ -63,7 +65,22 @@ public class ChDisabDetailAccountsResp implements Serializable { ...@@ -63,7 +65,22 @@ public class ChDisabDetailAccountsResp implements Serializable {
private String disabInfoId; private String disabInfoId;
private String accountsId;
private Integer status; private Integer status;
// 可报金额
private String reportableAmount;
// 机构应得
private String institutionsDeserve;
// 个人应得
private String personalDeserve;
private String levelCode;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -2,6 +2,8 @@ package com.hungraim.ltc.pojo.entity.account; ...@@ -2,6 +2,8 @@ package com.hungraim.ltc.pojo.entity.account;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* @author mq * @author mq
*/ */
...@@ -21,4 +23,12 @@ public class ChServiceTypeDetailedVO { ...@@ -21,4 +23,12 @@ public class ChServiceTypeDetailedVO {
*/ */
private String serviceTypeDetailedId; private String serviceTypeDetailedId;
private List<String> srvPicList;
private String srvStartPic;
private String srvStartPic2;
private String srvEndPic;
} }
package com.hungraim.ltc.pojo.entity.disable; package com.hungraim.ltc.pojo.entity.disable;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hungraim.ltc.pojo.entity.PageInfo; import com.hungraim.ltc.pojo.entity.PageInfo;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
/** /**
* 护理机构表 * 护理机构表
...@@ -51,6 +49,8 @@ public class ChSrvOrgan extends PageInfo implements Serializable { ...@@ -51,6 +49,8 @@ public class ChSrvOrgan extends PageInfo implements Serializable {
private Integer lcu; private Integer lcu;
private String checkRemarkLp; private String checkRemarkLp;
private String srvType; private String srvType;
@TableField(exist = false)
private List<SrvTypeData> srvTypeData;
private String districtProvincial; private String districtProvincial;
private String checkNameLp; private String checkNameLp;
private Integer cardType; private Integer cardType;
......
package com.hungraim.ltc.pojo.entity.disable;
import lombok.Data;
/**
* @author zwl
* @ClassName SrvTypeData
* @description
* @date 2023/9/13 16:57
**/
@Data
public class SrvTypeData {
private String value;
private String label;
}
package com.hungraim.ltc.pojo.entity.governance; package com.hungraim.ltc.pojo.entity.governance;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
...@@ -24,5 +21,12 @@ public class ChSrvPlan { ...@@ -24,5 +21,12 @@ public class ChSrvPlan {
private Date creationTime; private Date creationTime;
private Date srvPlanTime; private Date srvPlanTime;
private Long isStatus; private Long isStatus;
private Long isBill;
private Date lcd;
@TableField(exist = false)
private String itemWeek;
@TableField(exist = false)
private String planningFrequencyType;
} }
...@@ -154,5 +154,7 @@ public class ChSrvProgramSet implements Serializable { ...@@ -154,5 +154,7 @@ public class ChSrvProgramSet implements Serializable {
*/ */
private String remark; private String remark;
private String itemWeek;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -205,6 +205,11 @@ public class ChSrvTaskDetail implements Serializable { ...@@ -205,6 +205,11 @@ public class ChSrvTaskDetail implements Serializable {
private Date auditDate; private Date auditDate;
/** /**
* 稽核时间
*/
private String auditor;
/**
* 违规类型(全部:0;基础护理:1;日常照护:2) * 违规类型(全部:0;基础护理:1;日常照护:2)
*/ */
private Short illegalType; private Short illegalType;
...@@ -246,6 +251,8 @@ public class ChSrvTaskDetail implements Serializable { ...@@ -246,6 +251,8 @@ public class ChSrvTaskDetail implements Serializable {
private Short isClock; private Short isClock;
private Short checkStatus;
private String clockReason; private String clockReason;
private String clockOperator; private String clockOperator;
......
package com.hungraim.ltc.pojo.vo.account;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
/**
* @author zwl
* @ClassName AccountDeclareExportResp
* @description 基金申报导出
* @date 2023/7/19 17:04
**/
@Data
public class AccountDeclareExportResp {
@Excel(name = "统筹区",width = 20)
private String medicalArea;
@Excel(name = "账单月份",width = 20)
private String accountsTime;
@Excel(name = "失能人员",width = 20)
private String realName;
/**
* 护理机构名称
*/
@Excel(name = "护理机构名称",width = 20)
private String srvOrganName;
/**
* 护理机构名称
*/
@Excel(name = "服务方式",width = 20)
private String modeName;
/**
* 总费用
*/
@Excel(name = "总费用合计",width = 20)
private String accountsAllCost;
/**
* 统筹费用
*/
@Excel(name = "统筹支出合计",width = 20)
private String accountsOverallCost;
/**
* 个人支付
*/
@Excel(name = "自付合计",width = 20)
private String accountsPersonalCost;
@Excel(name = "申报状态")
private String status;
}
...@@ -19,6 +19,8 @@ public class AccountOperVo extends ChDisabAccounts { ...@@ -19,6 +19,8 @@ public class AccountOperVo extends ChDisabAccounts {
**/ **/
private String modeName; private String modeName;
private Integer userId;
/** /**
* 文件列表数据对象 * 文件列表数据对象
*/ */
......
package com.hungraim.ltc.pojo.vo.account;
import lombok.Data;
/**
* @author zwl
* @ClassName ItemRespVO
* @description
* @date 2023/9/21 20:57
**/
@Data
public class ItemRespVO {
// 任务名称
private String itemName;
// 任务名称
private Long itemId;
}
package com.hungraim.ltc.pojo.vo.account;
import lombok.Data;
import java.math.BigDecimal;
/**
* @author zwl
* @ClassName ReportRejectReqVO
* @description
* @date 2023/6/1 16:35
**/
@Data
public class ReportRejectReqVO {
private Long accountsDetailId;
private Long accountsId;
/**
* 应拨总费用
*/
private BigDecimal accountsAllCost;
private BigDecimal accountsOverallCost;
private BigDecimal accountsPersonalCost;
private BigDecimal deductionAmount;
private BigDecimal reissueAmount;
private String remarks;
}
...@@ -7,6 +7,7 @@ import org.springframework.format.annotation.DateTimeFormat; ...@@ -7,6 +7,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List;
@Data @Data
public class SrvOrganAccountListResp { public class SrvOrganAccountListResp {
...@@ -97,5 +98,20 @@ public class SrvOrganAccountListResp { ...@@ -97,5 +98,20 @@ public class SrvOrganAccountListResp {
*/ */
private String reviewRemark; private String reviewRemark;
/**
*人次/人天
*/
private String personDay;
/**
*扣费原因
*/
private List<String> deductionReason;
/**
*补费原因
*/
private List<String> reissueReason;
} }
...@@ -43,8 +43,13 @@ public class SrvOrganListReq extends BaseReq { ...@@ -43,8 +43,13 @@ public class SrvOrganListReq extends BaseReq {
private String realName; private String realName;
private String certiCode;
private List<String> accountsStatusList; private List<String> accountsStatusList;
// 是否展示异地 1 不展示 // 是否展示异地 1 不展示
private String flag; private String flag;
// 检索条件
private String status;
} }
package com.hungraim.ltc.pojo.vo.account;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import lombok.Data;
import java.util.List;
/**
* @author zwl
* @ClassName SrvTaskCardRespDTO
* @description
* @date 2023/8/3 14:03
**/
@Data
public class SrvTaskCardRespDTO {
// 失能人员姓名
private String realName;
// 护理机构
private String srvOrganName;
// 护理人员
private String empName;
private String empId;
private String modeId;
private String disabInfoId;
private String srvOrganId;
private Long srvTaskId;
// 任务时间
private String srvDate;
// 任务名称
private String itemName;
private List<ItemRespVO> itemsList;
private Long status;
// 服务方式
private String srvModeName;
private String auditor;
private String reason;
private String auditRemark;
private Long taskDetailId;
private List<ChFndAttach> fileDataList;
}
...@@ -12,6 +12,8 @@ public class SrvTaskReqVO extends BaseReq { ...@@ -12,6 +12,8 @@ public class SrvTaskReqVO extends BaseReq {
//失能人员姓名 //失能人员姓名
private String realName; private String realName;
private String taskDetailId;
// 任务时间 // 任务时间
private String srvDate; private String srvDate;
...@@ -20,4 +22,6 @@ public class SrvTaskReqVO extends BaseReq { ...@@ -20,4 +22,6 @@ public class SrvTaskReqVO extends BaseReq {
private String srvOrganName; private String srvOrganName;
private Long srvOrganId; private Long srvOrganId;
private Integer userId;
} }
...@@ -18,6 +18,13 @@ public class SrvTaskRespVO { ...@@ -18,6 +18,13 @@ public class SrvTaskRespVO {
// 护理机构 // 护理机构
private String srvOrganName; private String srvOrganName;
private String modeId;
private String srvTaskId;
// 护理人员 // 护理人员
private String empName; private String empName;
...@@ -44,4 +51,13 @@ public class SrvTaskRespVO { ...@@ -44,4 +51,13 @@ public class SrvTaskRespVO {
private String medicalArea; private String medicalArea;
private String auditor;
private String reason;
private String auditRemark;
private boolean auditFlag;
} }
\ No newline at end of file
...@@ -51,4 +51,6 @@ public class ChSrvTaskDetailVo extends BaseReq { ...@@ -51,4 +51,6 @@ public class ChSrvTaskDetailVo extends BaseReq {
*/ */
private String modeName; private String modeName;
private String hospitalFlag;
} }
package com.hungraim.ltc.pojo.vo.governance;
import lombok.Data;
/**
* @author zwl
* @ClassName AuditingCardVO
* @description
* @date 2023/8/2 14:23
**/
@Data
public class AuditingCardVO {
private Long taskDetailId;
private String auditor;
private String auditRemark;
private short status;
}
...@@ -3,6 +3,7 @@ package com.hungraim.ltc.pojo.vo.governance; ...@@ -3,6 +3,7 @@ package com.hungraim.ltc.pojo.vo.governance;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
@Data @Data
public class ProgramSetAndProjectVo { public class ProgramSetAndProjectVo {
...@@ -72,4 +73,9 @@ public class ProgramSetAndProjectVo { ...@@ -72,4 +73,9 @@ public class ProgramSetAndProjectVo {
*/ */
private Short planningFrequencyType = 1; private Short planningFrequencyType = 1;
private String itemWeek;
private List<String> itemWeeks;
} }
package com.hungraim.ltc.pojo.vo.governance; package com.hungraim.ltc.pojo.vo.governance;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @author zwl * @author zwl
...@@ -47,4 +50,10 @@ public class SrvPlanInputVO { ...@@ -47,4 +50,10 @@ public class SrvPlanInputVO {
private Long srvTaskId; private Long srvTaskId;
private Long taskDetailId;
@TableField(exist = false)
private List<ChFndAttach> fileDataList;
} }
...@@ -24,4 +24,6 @@ public class SrvTaskInfoListVO implements Serializable { ...@@ -24,4 +24,6 @@ public class SrvTaskInfoListVO implements Serializable {
* SrvTaskInfoVOs * SrvTaskInfoVOs
*/ */
private List<SrvTaskInfoVO> taskList; private List<SrvTaskInfoVO> taskList;
private Integer userId;
} }
\ No newline at end of file
...@@ -6,6 +6,8 @@ import cn.hutool.core.util.StrUtil; ...@@ -6,6 +6,8 @@ import cn.hutool.core.util.StrUtil;
import java.text.ParseException; import java.text.ParseException;
import java.text.ParsePosition; import java.text.ParsePosition;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.YearMonth;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.GregorianCalendar; import java.util.GregorianCalendar;
...@@ -156,6 +158,20 @@ public class DateUtils { ...@@ -156,6 +158,20 @@ public class DateUtils {
return strtodate; return strtodate;
} }
public static int getDays(){
LocalDate date = LocalDate.now();
// 获取当前年份和月份
YearMonth yearMonth = YearMonth.from(date);
// 获取当前月份的天数
int days = yearMonth.lengthOfMonth();
return days;
}
/** /**
* 将短时间格式字符串转换为时间 yyyyMMdd * 将短时间格式字符串转换为时间 yyyyMMdd
* *
...@@ -964,6 +980,14 @@ public class DateUtils { ...@@ -964,6 +980,14 @@ public class DateUtils {
return day.equals(nowDay); return day.equals(nowDay);
} }
public static int getDaysOfMonth(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
return calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
}
public static void main(String[] args) {
System.out.println(getDaysOfMonth(new Date()));
}
} }
...@@ -2,11 +2,14 @@ package com.hungraim.ltc.util; ...@@ -2,11 +2,14 @@ package com.hungraim.ltc.util;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.util.IOUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.*;
import java.io.IOException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
...@@ -80,4 +83,97 @@ public class FileUtils { ...@@ -80,4 +83,97 @@ public class FileUtils {
} }
} }
public static void downloadPathFile(String path,String fileName, HttpServletRequest request, HttpServletResponse response) {
//设置文件路径
File file = new File(path);
//判断文件是否存在
if (file.exists()) {
FileInputStream fis = null;
OutputStream os = null;
try {
// 取得输出流
os = response.getOutputStream();
// 清空输出流
response.reset();
//response.setContentType("application/force-download");// 设置强制下载不打开
response.setCharacterEncoding("UTF-8");
response.setHeader("content-Type", "application/vnd.ms-excel");
response.setHeader("Content-Disposition","attachment;filename=" + URLEncoder.encode(fileName,"UTF-8"));
fis = new FileInputStream(file);
IOUtils.copy(fis, os);
response.getOutputStream().flush();
/* bis = new BufferedInputStream(fis);
OutputStream os = response.getOutputStream();
int i = bis.read(buffer);
while (i != -1) {
os.write(buffer, 0, i);
i = bis.read(buffer);
}*/
log.info("=========下载成功:{}",fileName);
} catch (Exception e) {
log.error("=====error1:{}",e);
} finally {
try {
if (fis != null) {
fis.close();
}
} catch (IOException e) {
// logger.error(ExceptionUtils.getFullStackTrace(e));
}
try {
if (os != null) {
os.close();
}
} catch (IOException e) {
//logger.error(ExceptionUtils.getFullStackTrace(e));
}
}
}
}
/**
* 文件下载
*
* @param fileName
* @return
* @author 小辰哥哥
*/
public static byte[] downloadFile(String path,String fileName, HttpServletResponse response) {
// 关联文件
File file = new File(path);
byte[] fileBytes = null;
FileInputStream fileInputStream = null;
ByteArrayOutputStream bos = null;
//设置响应头类型,这里可以根据文件类型设置,text/plain、application/vnd.ms-excel等
response.setHeader("content-type", "text/plain;charset=UTF-8");
response.setContentType("application/octet-stream;charset=UTF-8");
//如果不设置响应头大小,可能报错:“Excel 已完成文件级验证和修复。此工作簿的某些部分可能已被修复或丢弃”
response.addHeader("Content-Length", String.valueOf(file.length()));
try {
response.setHeader("Content-Disposition","attachment;filename=" + URLEncoder.encode(fileName,"UTF-8"));
fileInputStream = new FileInputStream(file);
bos = new ByteArrayOutputStream();
byte[] bytes = new byte[1024];
int len ;
while ((len = fileInputStream.read(bytes)) != -1) {
bos.write(bytes, 0, len);
}
fileBytes = bos.toByteArray();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
fileInputStream.close();
bos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return fileBytes;
}
} }
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId> <artifactId>spring-cloud-starter-gateway</artifactId>
<version>2.2.6.RELEASE</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
...@@ -52,7 +52,7 @@ public class ResourceServerConfig { ...@@ -52,7 +52,7 @@ public class ResourceServerConfig {
.jwtAuthenticationConverter(jwtAuthenticationConverter()); .jwtAuthenticationConverter(jwtAuthenticationConverter());
http.authorizeExchange() http.authorizeExchange()
.pathMatchers("/api/oauth/token","/api.system/role/getRoleResource", .pathMatchers("/api/oauth/token","/api.system/role/getRoleResource",
"/api.system/resource/getManinMenu","/oauth/*","/api/oauth/genKeyPair","/api.system/user/updatePassword").permitAll() "/api.system/resource/getManinMenu","/oauth/*","/api/oauth/genKeyPair","/api.system/user/updatePassword","/api.governance/nursing/*").permitAll()
.anyExchange().access(authorizationManager) .anyExchange().access(authorizationManager)
.and() .and()
.exceptionHandling() .exceptionHandling()
......
package com.hungraim.ltc.governance.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Data
@ConfigurationProperties(prefix = "pic.view")
public class PicRoleConfig {
private List<String> roleId;
}
...@@ -13,6 +13,7 @@ import com.hungraim.ltc.governance.service.*; ...@@ -13,6 +13,7 @@ import com.hungraim.ltc.governance.service.*;
import com.hungraim.ltc.pojo.entity.account.ChPunchDetailsVO; import com.hungraim.ltc.pojo.entity.account.ChPunchDetailsVO;
import com.hungraim.ltc.pojo.entity.disable.ChDisableInfo; import com.hungraim.ltc.pojo.entity.disable.ChDisableInfo;
import com.hungraim.ltc.pojo.entity.disable.ChSrvOrgan; import com.hungraim.ltc.pojo.entity.disable.ChSrvOrgan;
import com.hungraim.ltc.pojo.entity.disable.SrvTypeData;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram; import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend; import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend;
import com.hungraim.ltc.pojo.vo.disable.ChSrvTaskDetailVo; import com.hungraim.ltc.pojo.vo.disable.ChSrvTaskDetailVo;
...@@ -21,6 +22,7 @@ import com.hungraim.ltc.pojo.vo.disable.SearchDisableSimpleVo; ...@@ -21,6 +22,7 @@ import com.hungraim.ltc.pojo.vo.disable.SearchDisableSimpleVo;
import com.hungraim.ltc.pojo.vo.governance.*; import com.hungraim.ltc.pojo.vo.governance.*;
import com.hungraim.ltc.util.Result; import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode; import com.hungraim.ltc.util.ResultCode;
import com.hungraim.ltc.util.TokenParsingUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import oracle.sql.DATE; import oracle.sql.DATE;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
...@@ -30,10 +32,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -30,10 +32,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.text.ParseException; import java.text.ParseException;
import java.util.Date; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* @author jiaguokai * @author jiaguokai
...@@ -217,6 +216,29 @@ public class BuildBedController { ...@@ -217,6 +216,29 @@ public class BuildBedController {
// 总记录数 // 总记录数
long total = page.getTotal(); long total = page.getTotal();
List<ChSrvOrgan> records = page.getRecords(); List<ChSrvOrgan> records = page.getRecords();
for (ChSrvOrgan record : records) {
List<SrvTypeData> srvTypeDataList = new ArrayList<>();
String srvType = record.getSrvType();
List<String> list = Arrays.asList(srvType.split(","));
for (String value : list) {
SrvTypeData srvTypeData = new SrvTypeData();
String lable = "";
if(value.equals("1")){
lable = "医疗";
}else if(value.equals("2")){
lable = "养老";
}else if(value.equals("3")){
lable = "上门";
}else {
continue;
}
srvTypeData.setLabel(lable);
srvTypeData.setValue(value);
srvTypeDataList.add(srvTypeData);
}
record.setSrvTypeData(srvTypeDataList);
}
Map map = new HashMap<>(); Map map = new HashMap<>();
map.put("total", total); map.put("total", total);
map.put("recors", records); map.put("recors", records);
...@@ -366,8 +388,12 @@ public class BuildBedController { ...@@ -366,8 +388,12 @@ public class BuildBedController {
* @return * @return
*/ */
@GetMapping("/chSrvTaskDetailQuery") @GetMapping("/chSrvTaskDetailQuery")
public Result chSrvTaskDetailQuery(ChSrvTaskDetailVo vo) throws ParseException { public Result chSrvTaskDetailQuery(@RequestHeader("Authorization") String token,ChSrvTaskDetailVo vo) throws ParseException {
Page<ChSrvTaskDetailVo> page = new Page<>(vo.getPageNum(), vo.getPageSize()); Page<ChSrvTaskDetailVo> page = new Page<>(vo.getPageNum(), vo.getPageSize());
Integer srvOrganId = TokenParsingUtil.TokenParsing(token, "srvOrganId");
if(srvOrganId != null) {
vo.setSrvOrganId(String.valueOf(srvOrganId));
}
page = buildBedService.chSrvTaskDetailQuery(page,vo); page = buildBedService.chSrvTaskDetailQuery(page,vo);
if(page.getSize()>0){ if(page.getSize()>0){
return Result.success(page); return Result.success(page);
...@@ -382,8 +408,9 @@ public class BuildBedController { ...@@ -382,8 +408,9 @@ public class BuildBedController {
* @return * @return
*/ */
@GetMapping("/chPunchDetailsQuery") @GetMapping("/chPunchDetailsQuery")
public Result chPunchDetailsQuery(Long taskDetailId,String certiCode,String sevStarTime,String sevEndTime){ public Result chPunchDetailsQuery(@RequestHeader("Authorization") String token,Long taskDetailId,String certiCode,String sevStarTime,String sevEndTime){
ChPunchDetailsVO chPunchDetailsVO = buildBedService.chPunchDetailsQuery(taskDetailId,certiCode,sevStarTime,sevEndTime); Integer userId = TokenParsingUtil.TokenParsing(token, "userId");
ChPunchDetailsVO chPunchDetailsVO = buildBedService.chPunchDetailsQuery(taskDetailId,certiCode,sevStarTime,sevEndTime,userId);
return Result.success(chPunchDetailsVO); return Result.success(chPunchDetailsVO);
} }
......
...@@ -2,6 +2,7 @@ package com.hungraim.ltc.governance.controller; ...@@ -2,6 +2,7 @@ package com.hungraim.ltc.governance.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.governance.service.SrvTaskService; import com.hungraim.ltc.governance.service.SrvTaskService;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.vo.governance.*; import com.hungraim.ltc.pojo.vo.governance.*;
import com.hungraim.ltc.util.Result; import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode; import com.hungraim.ltc.util.ResultCode;
...@@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 服务计划Controller * 服务计划Controller
...@@ -112,12 +114,14 @@ public class SrvTaskController { ...@@ -112,12 +114,14 @@ public class SrvTaskController {
* 新增或者修改服务计划 * 新增或者修改服务计划
*/ */
@PostMapping("/addOrUpdateSrvTask") @PostMapping("/addOrUpdateSrvTask")
public Result<List<SrvTaskInfoVO>> addSrvTask(SrvTaskInfoListVO param) { public Result<List<SrvTaskInfoVO>> addSrvTask(@RequestHeader("Authorization") String token,SrvTaskInfoListVO param) {
String programId = param.getProgramId(); String programId = param.getProgramId();
List<SrvTaskInfoVO> taskList = param.getTaskList(); List<SrvTaskInfoVO> taskList = param.getTaskList();
if (StringUtils.isBlank(programId) || taskList == null || taskList.size() <= 0) { if (StringUtils.isBlank(programId) || taskList == null || taskList.size() <= 0) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
} }
Integer userId = TokenParsingUtil.TokenParsing(token, "userId");
param.setUserId(userId);
try { try {
for (int i = 0; i < taskList.size(); i++) { for (int i = 0; i < taskList.size(); i++) {
SrvTaskInfoVO srvTaskInfoVO = taskList.get(i); SrvTaskInfoVO srvTaskInfoVO = taskList.get(i);
...@@ -164,12 +168,48 @@ public class SrvTaskController { ...@@ -164,12 +168,48 @@ public class SrvTaskController {
if (srvPlanInputVO.getDisabInfoId() == null) { if (srvPlanInputVO.getDisabInfoId() == null) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
} }
List<ChFndAttach> fileDataList = srvPlanInputVO.getFileDataList();
if(fileDataList.size() < 2 ){
return Result.failed("护理记录单复印件、医疗养老上门补单申请表至少各一张");
}
List<String> collect1 = fileDataList.stream().map(ChFndAttach::getFileName)
.distinct().collect(Collectors.toList());
boolean ss = (collect1.size()!=fileDataList.size())? true: false;
if(ss){
return Result.failed("上传的附件不可重复");
}
Integer userId = TokenParsingUtil.TokenParsing(token, "userId"); Integer userId = TokenParsingUtil.TokenParsing(token, "userId");
srvPlanInputVO.setAdmin(String.valueOf(userId)); srvPlanInputVO.setAdmin(String.valueOf(userId));
return srvTaskService.saveApplyCard(srvPlanInputVO); return srvTaskService.saveApplyCard(srvPlanInputVO);
} }
@PostMapping("/updateApplyCard")
public Result updateApplyCard(@RequestHeader("Authorization") String token,SrvPlanInputVO srvPlanInputVO){
if (srvPlanInputVO.getDisabInfoId() == null) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
List<ChFndAttach> fileDataList = srvPlanInputVO.getFileDataList();
if(fileDataList.size() < 2 ){
return Result.failed("护理记录单复印件、医疗养老上门补单申请表至少各一张");
}
List<String> collect1 = fileDataList.stream().map(ChFndAttach::getFileName)
.distinct().collect(Collectors.toList());
boolean ss = (collect1.size()!=fileDataList.size())? true: false;
if(ss){
return Result.failed("上传的附件不可重复");
}
Integer userId = TokenParsingUtil.TokenParsing(token, "userId");
srvPlanInputVO.setAdmin(String.valueOf(userId));
return srvTaskService.updateApplyCard(srvPlanInputVO);
}
@PostMapping("/auditingCard")
public Result auditingCard(AuditingCardVO auditingCardVO){
return srvTaskService.auditingCard(auditingCardVO);
}
/** /**
* 根据护理机构查询项目 * 根据护理机构查询项目
**/ **/
......
...@@ -45,4 +45,8 @@ public interface BuildBedMapper extends BaseMapper<ChSrvBuildBed> { ...@@ -45,4 +45,8 @@ public interface BuildBedMapper extends BaseMapper<ChSrvBuildBed> {
List<ChServiceTypeVO> selectServiceTypeDetailed(); List<ChServiceTypeVO> selectServiceTypeDetailed();
String selectModeTypeById(@Param("pId")Long pId); String selectModeTypeById(@Param("pId")Long pId);
int getRoleByUserId(@Param("userId") Integer userId,@Param("roleIds") List<String> roleIds );
} }
...@@ -53,5 +53,5 @@ public interface IBuildBedService extends IService<ChSrvBuildBed> { ...@@ -53,5 +53,5 @@ public interface IBuildBedService extends IService<ChSrvBuildBed> {
* 打卡详情 * 打卡详情
* @param taskDetailId * @param taskDetailId
*/ */
ChPunchDetailsVO chPunchDetailsQuery(Long taskDetailId,String certiCode,String sevStarTime,String sevEndTime); ChPunchDetailsVO chPunchDetailsQuery(Long taskDetailId,String certiCode,String sevStarTime,String sevEndTime,Integer userId);
} }
...@@ -41,5 +41,9 @@ public interface SrvTaskService { ...@@ -41,5 +41,9 @@ public interface SrvTaskService {
// 补卡 // 补卡
Result saveApplyCard(SrvPlanInputVO srvPlanInputVO); Result saveApplyCard(SrvPlanInputVO srvPlanInputVO);
Result updateApplyCard(SrvPlanInputVO srvPlanInputVO);
Result auditingCard(AuditingCardVO auditingCardVO);
Result queryItemBySrvOrganId(Long srvOrganId); Result queryItemBySrvOrganId(Long srvOrganId);
} }
...@@ -3,6 +3,7 @@ package com.hungraim.ltc.governance.service.impl; ...@@ -3,6 +3,7 @@ package com.hungraim.ltc.governance.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hungraim.ltc.api.AttachFeignService; import com.hungraim.ltc.api.AttachFeignService;
import com.hungraim.ltc.governance.config.PicRoleConfig;
import com.hungraim.ltc.governance.dao.BuildBedMapper; import com.hungraim.ltc.governance.dao.BuildBedMapper;
import com.hungraim.ltc.governance.dao.ServiceTypeDetailedMapper; import com.hungraim.ltc.governance.dao.ServiceTypeDetailedMapper;
import com.hungraim.ltc.governance.service.IBuildBedService; import com.hungraim.ltc.governance.service.IBuildBedService;
...@@ -24,6 +25,7 @@ import com.hungraim.ltc.util.ResultCode; ...@@ -24,6 +25,7 @@ import com.hungraim.ltc.util.ResultCode;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -44,6 +46,9 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB ...@@ -44,6 +46,9 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB
private final ServiceTypeDetailedMapper serviceTypeDetailed; private final ServiceTypeDetailedMapper serviceTypeDetailed;
@Autowired
private PicRoleConfig picRoleConfig;
@Override @Override
...@@ -94,6 +99,7 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB ...@@ -94,6 +99,7 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB
*/ */
@Override @Override
public Page<ChSrvTaskDetailVo> chSrvTaskDetailQuery(Page<ChSrvTaskDetailVo> page,ChSrvTaskDetailVo vo){ public Page<ChSrvTaskDetailVo> chSrvTaskDetailQuery(Page<ChSrvTaskDetailVo> page,ChSrvTaskDetailVo vo){
Page<ChSrvTaskDetailVo> chSrvTaskDetailVoPage = buildBedMapper.chSrvTaskDetailQuery(page, vo); Page<ChSrvTaskDetailVo> chSrvTaskDetailVoPage = buildBedMapper.chSrvTaskDetailQuery(page, vo);
chSrvTaskDetailVoPage.getRecords().stream().filter(chSrvTaskDetail -> { chSrvTaskDetailVoPage.getRecords().stream().filter(chSrvTaskDetail -> {
if (null != chSrvTaskDetail.getSevStarTime()){ if (null != chSrvTaskDetail.getSevStarTime()){
...@@ -122,7 +128,7 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB ...@@ -122,7 +128,7 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB
* @param taskDetailId * @param taskDetailId
*/ */
@Override @Override
public ChPunchDetailsVO chPunchDetailsQuery(Long taskDetailId,String certiCode, String sevStarTime,String sevEndTime) { public ChPunchDetailsVO chPunchDetailsQuery(Long taskDetailId,String certiCode, String sevStarTime,String sevEndTime,Integer userId) {
List<ChPunchDetailVO> chPunchDetailVOS = new ArrayList<>(); List<ChPunchDetailVO> chPunchDetailVOS = new ArrayList<>();
//获取项目信息 //获取项目信息
List<ChServiceTypeVO> chServiceTypeDetaileds = buildBedMapper.selectServiceTypeDetailed(); List<ChServiceTypeVO> chServiceTypeDetaileds = buildBedMapper.selectServiceTypeDetailed();
...@@ -146,6 +152,26 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB ...@@ -146,6 +152,26 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB
//打卡详情 //打卡详情
String modeType = buildBedMapper.selectModeTypeById(taskDetailId); String modeType = buildBedMapper.selectModeTypeById(taskDetailId);
List<ChServiceTypeDetailedVO> serviceTypeDetailed1s = buildBedMapper.getServiceTypeDetailed(taskDetailId,certiCode,sevStarTime, sevEndTime,modeType); List<ChServiceTypeDetailedVO> serviceTypeDetailed1s = buildBedMapper.getServiceTypeDetailed(taskDetailId,certiCode,sevStarTime, sevEndTime,modeType);
List<String> roleIds = picRoleConfig.getRoleId();
log.info("==========chPunchDetailsQuery====roleIds:{}",roleIds);
int roleByUserId = buildBedMapper.getRoleByUserId(userId,roleIds);
for (ChServiceTypeDetailedVO serviceTypeDetailed1 : serviceTypeDetailed1s) {
String srvStartPic = serviceTypeDetailed1.getSrvStartPic();
String srvStartPic2 = serviceTypeDetailed1.getSrvStartPic2();
String srvEndPic = serviceTypeDetailed1.getSrvEndPic();
List<String> srvPicList = new ArrayList<>();
if(srvStartPic!=null) {
srvPicList.add(srvStartPic);
}
// 机构端能护理人员的拍照和第三张拍照,其他都能看到 等于0角色不是机构端
if(roleByUserId == 0 && srvStartPic2!=null) {
srvPicList.add(srvStartPic2);
}
if(srvEndPic!=null) {
srvPicList.add(srvEndPic);
}
serviceTypeDetailed1.setSrvPicList(srvPicList);
}
log.info("chPunchDetailsQuery打卡详情:"+serviceTypeDetailed1s); log.info("chPunchDetailsQuery打卡详情:"+serviceTypeDetailed1s);
chPunchDetailsVO.setRecordData(chPunchDetailVOS); chPunchDetailsVO.setRecordData(chPunchDetailVOS);
chPunchDetailsVO.setChPunchDetailVOS(serviceTypeDetailed1s); chPunchDetailsVO.setChPunchDetailVOS(serviceTypeDetailed1s);
......
...@@ -22,10 +22,14 @@ import com.hungraim.ltc.util.Result; ...@@ -22,10 +22,14 @@ import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode; import com.hungraim.ltc.util.ResultCode;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import oracle.sql.DATE; import oracle.sql.DATE;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -78,6 +82,19 @@ public class SrvProgramServiceImpl implements SrvProgramService { ...@@ -78,6 +82,19 @@ public class SrvProgramServiceImpl implements SrvProgramService {
List<ChFndAttach> data = listResult.getData(); List<ChFndAttach> data = listResult.getData();
programDetail.setFileDataList(data); programDetail.setFileDataList(data);
} }
List<ProgramSetAndProjectVo> programSetAndProjectVos = programDetail.getProgramSetAndProjectVos();
for (ProgramSetAndProjectVo programSetAndProjectVo : programSetAndProjectVos) {
String itemWeek = programSetAndProjectVo.getItemWeek();
if (StringUtils.isNotEmpty(itemWeek)) {
List<String> itemWeeks = new ArrayList<>();
List<String> list = Arrays.asList(itemWeek.split(","));
for (String s : list) {
itemWeeks.add(s);
}
programSetAndProjectVo.setItemWeeks(itemWeeks);
}
}
return programDetail; return programDetail;
} }
...@@ -134,6 +151,11 @@ public class SrvProgramServiceImpl implements SrvProgramService { ...@@ -134,6 +151,11 @@ public class SrvProgramServiceImpl implements SrvProgramService {
chSrvProgramSet.setPlanningFrequency(programSetAndProjectVo.getPlanningFrequency()); chSrvProgramSet.setPlanningFrequency(programSetAndProjectVo.getPlanningFrequency());
chSrvProgramSet.setPlanningFrequencyType(programSetAndProjectVo.getPlanningFrequencyType()); chSrvProgramSet.setPlanningFrequencyType(programSetAndProjectVo.getPlanningFrequencyType());
chSrvProgramSet.setRemark(programSetAndProjectVo.getRemark()); chSrvProgramSet.setRemark(programSetAndProjectVo.getRemark());
List<String> itemWeeks = programSetAndProjectVo.getItemWeeks();
if (CollectionUtils.isNotEmpty(itemWeeks)) {
String itemWeek = StringUtils.join(itemWeeks,",");
chSrvProgramSet.setItemWeek(itemWeek);
}
chSrvProgramSetMapper.updateById(chSrvProgramSet); chSrvProgramSetMapper.updateById(chSrvProgramSet);
} else { } else {
if (isConf.intValue() == 0) { if (isConf.intValue() == 0) {
...@@ -197,6 +219,11 @@ public class SrvProgramServiceImpl implements SrvProgramService { ...@@ -197,6 +219,11 @@ public class SrvProgramServiceImpl implements SrvProgramService {
chSrvProgramSet.setPlanningFrequency(programSetAndProjectVo.getPlanningFrequency()); chSrvProgramSet.setPlanningFrequency(programSetAndProjectVo.getPlanningFrequency());
chSrvProgramSet.setPlanningFrequencyType(programSetAndProjectVo.getPlanningFrequencyType()); chSrvProgramSet.setPlanningFrequencyType(programSetAndProjectVo.getPlanningFrequencyType());
chSrvProgramSet.setRemark(programSetAndProjectVo.getRemark()); chSrvProgramSet.setRemark(programSetAndProjectVo.getRemark());
List<String> itemWeeks = programSetAndProjectVo.getItemWeeks();
if (CollectionUtils.isNotEmpty(itemWeeks)) {
String itemWeek = StringUtils.join(itemWeeks,",");
chSrvProgramSet.setItemWeek(itemWeek);
}
chSrvProgramSetMapper.insert(chSrvProgramSet); chSrvProgramSetMapper.insert(chSrvProgramSet);
} }
......
...@@ -2,6 +2,7 @@ package com.hungraim.ltc.governance.service.impl; ...@@ -2,6 +2,7 @@ package com.hungraim.ltc.governance.service.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -24,10 +25,15 @@ import com.hungraim.ltc.util.DateUtils; ...@@ -24,10 +25,15 @@ import com.hungraim.ltc.util.DateUtils;
import com.hungraim.ltc.util.Result; import com.hungraim.ltc.util.Result;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import oracle.sql.DATE;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -75,7 +81,7 @@ public class SrvTaskServiceImpl implements SrvTaskService { ...@@ -75,7 +81,7 @@ public class SrvTaskServiceImpl implements SrvTaskService {
*/ */
@Override @Override
public Page<SrvTaskDetailVO> getSrvTaskDetailList(Page<SrvTaskDetailVO> page, Integer organId, String disableName, String disableTel, String empName, String certifNum, String srvDate, Date startTime, Date endTime, String status, String modeId) { public Page<SrvTaskDetailVO> getSrvTaskDetailList(Page<SrvTaskDetailVO> page, Integer organId, String disableName, String disableTel, String empName, String certifNum, String srvDate, Date startTime, Date endTime, String status, String modeId) {
return srvTaskMapper.getSrvTaskDetailList(page, organId, disableName, disableTel, empName, certifNum, srvDate,startTime, endTime, status, modeId); return srvTaskMapper.getSrvTaskDetailList(page, organId, disableName, disableTel, empName, certifNum, srvDate, startTime, endTime, status, modeId);
} }
/** /**
...@@ -147,6 +153,9 @@ public class SrvTaskServiceImpl implements SrvTaskService { ...@@ -147,6 +153,9 @@ public class SrvTaskServiceImpl implements SrvTaskService {
chSrvTask.setStatus((short) 1);//状态 未分配:0;已分配:1;已终止2 chSrvTask.setStatus((short) 1);//状态 未分配:0;已分配:1;已终止2
chSrvTask.setSrvDate(DateUtils.strToDate(taskDetails.get(0))); chSrvTask.setSrvDate(DateUtils.strToDate(taskDetails.get(0)));
chSrvTask.setFcd(new Date()); chSrvTask.setFcd(new Date());
chSrvTask.setLcd(new Date());
chSrvTask.setFcu(param.getUserId().longValue());
chSrvTask.setLcu(param.getUserId().longValue());
srvTaskMapper.insert(chSrvTask); srvTaskMapper.insert(chSrvTask);
// 服务计划制定方案修改为已生效 // 服务计划制定方案修改为已生效
ChSrvProgram chSrvProgram = new ChSrvProgram(); ChSrvProgram chSrvProgram = new ChSrvProgram();
...@@ -156,28 +165,30 @@ public class SrvTaskServiceImpl implements SrvTaskService { ...@@ -156,28 +165,30 @@ public class SrvTaskServiceImpl implements SrvTaskService {
//添加服务计划详情 //添加服务计划详情
Long newSrvTaskId = chSrvTask.getSrvTaskId(); Long newSrvTaskId = chSrvTask.getSrvTaskId();
this.insertTaskDetail(newSrvTaskId, taskDetails); this.insertTaskDetail(newSrvTaskId, taskDetails);
saveSrvPlan(programId,null); saveSrvPlan(programId, taskDetails.get(0));
//添加附件 //添加附件
// this.updateAttachs(srvTaskInfoVO.getListAttach(), chSrvTask.getSrvTaskId()); // this.updateAttachs(srvTaskInfoVO.getListAttach(), chSrvTask.getSrvTaskId());
} else { } else {
// 修改服务计划 // 修改服务计划
// chSrvTaskDetailMapper.delete(new QueryWrapper<ChSrvTaskDetail>().eq("srv_task_id", Long.parseLong(srvTaskId)));//删除原来的计划详情 // chSrvTaskDetailMapper.delete(new QueryWrapper<ChSrvTaskDetail>().eq("srv_task_id", Long.parseLong(srvTaskId)));//删除原来的计划详情
if("2".equals(srvTaskInfoVO.getTaskStatus())){ /* if("2".equals(srvTaskInfoVO.getTaskStatus())){
UpdateWrapper updateWrapper1 = new UpdateWrapper(); UpdateWrapper updateWrapper1 = new UpdateWrapper();
updateWrapper1.eq("SRV_TASK_ID",srvTaskId); updateWrapper1.eq("SRV_TASK_ID",srvTaskId);
updateWrapper1.set("STATUS",3); updateWrapper1.set("STATUS",3);
chSrvTaskDetailMapper.update(null,updateWrapper1); chSrvTaskDetailMapper.update(null,updateWrapper1);
} }*/
// this.insertTaskDetail(Long.parseLong(srvTaskId), taskDetails); // this.insertTaskDetail(Long.parseLong(srvTaskId), taskDetails);
//修改服务计划 //修改服务计划
ChSrvTask chSrvTask = new ChSrvTask(); ChSrvTask chSrvTask = new ChSrvTask();
UpdateWrapper updateWrapper = new UpdateWrapper(); UpdateWrapper updateWrapper = new UpdateWrapper();
updateWrapper.eq("SRV_TASK_ID",srvTaskId); updateWrapper.eq("SRV_TASK_ID", srvTaskId);
//状态 未分配:0;已分配:1;已终止2 //状态 未分配:0;已分配:1;已终止2
updateWrapper.set("STATUS",srvTaskInfoVO.getTaskStatus()); updateWrapper.set("STATUS", srvTaskInfoVO.getTaskStatus());
updateWrapper.set("END_REASON",srvTaskInfoVO.getEndReason()); updateWrapper.set("LCD", new Date());
updateWrapper.set("LCU", param.getUserId());
updateWrapper.set("END_REASON", srvTaskInfoVO.getEndReason());
srvTaskMapper.update(null,updateWrapper); srvTaskMapper.update(null, updateWrapper);
//修改附件 //修改附件
// this.updateAttachs(srvTaskInfoVO.getListAttach(), Long.parseLong(srvTaskId)); // this.updateAttachs(srvTaskInfoVO.getListAttach(), Long.parseLong(srvTaskId));
} }
...@@ -185,17 +196,50 @@ public class SrvTaskServiceImpl implements SrvTaskService { ...@@ -185,17 +196,50 @@ public class SrvTaskServiceImpl implements SrvTaskService {
} }
public void saveSrvPlan(String programId,String srvPlanTime){ public void saveSrvPlan(String programId, String srvPlanTime) {
List<ChSrvPlan> chSrvPlans = chSrvPlanMapper.queryPlan(programId,srvPlanTime); List<ChSrvPlan> chSrvPlans = chSrvPlanMapper.queryPlan(programId, srvPlanTime);
for (ChSrvPlan chSrvPlan : chSrvPlans) { for (ChSrvPlan chSrvPlan : chSrvPlans) {
chSrvPlan.setCreationTime(new Date()); chSrvPlan.setCreationTime(new Date());
String itemWeek = chSrvPlan.getItemWeek();
String planningFrequencyType = chSrvPlan.getPlanningFrequencyType();
// 次周 3
if (StringUtils.isNotEmpty(itemWeek) && "3".equals(planningFrequencyType)) {
String weekDay = getweekDay(srvPlanTime);
if(!itemWeek.contains(weekDay)){
continue;
}
}
chSrvPlanMapper.insert(chSrvPlan); chSrvPlanMapper.insert(chSrvPlan);
} }
} }
public String getweekDay(String date) {
String[] weekDays = {"7", "1", "2", "3", "4", "5", "6"};
//转换为Date类型
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date1 = null;
try {
date1 = sdf.parse(date);
} catch (ParseException e) {
e.printStackTrace();
}
//判断日期是星期几
Calendar cal = Calendar.getInstance();
cal.setTime(date1);
int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
if (w < 0) {
w = 0;
}
System.out.println(weekDays[w]);
return weekDays[w];
}
// mode_id 4 // mode_id 4
@Override @Override
public void otherPlaceHandler(String programId){ public void otherPlaceHandler(String programId) {
accountFeignService.getOtherPlace(programId); accountFeignService.getOtherPlace(programId);
} }
...@@ -235,8 +279,8 @@ public class SrvTaskServiceImpl implements SrvTaskService { ...@@ -235,8 +279,8 @@ public class SrvTaskServiceImpl implements SrvTaskService {
Date programEdnDate = chSrvProgram.getProgramEdnDate(); Date programEdnDate = chSrvProgram.getProgramEdnDate();
String programEdnDateStr = DateUtils.dateToStr(programEdnDate); String programEdnDateStr = DateUtils.dateToStr(programEdnDate);
int i = chSrvSendMapper.updateSrvSendInfo(disabInfoId, programEdnDateStr); int i = chSrvSendMapper.updateSrvSendInfo(disabInfoId, programEdnDateStr);
if(i >0 ){ if (i > 0) {
log.info("服务分配{}终止成功",disabInfoId); log.info("服务分配{}终止成功", disabInfoId);
} }
} }
} }
...@@ -251,7 +295,7 @@ public class SrvTaskServiceImpl implements SrvTaskService { ...@@ -251,7 +295,7 @@ public class SrvTaskServiceImpl implements SrvTaskService {
int chSrvTaskDetailCount = chSrvTaskDetailMapper int chSrvTaskDetailCount = chSrvTaskDetailMapper
.getSrvTaskDetail(String.valueOf(srvTaskId), dateStr); .getSrvTaskDetail(String.valueOf(srvTaskId), dateStr);
if (chSrvTaskDetailCount > 0) { if (chSrvTaskDetailCount > 0) {
log.info("{},已经有计划任务了",srvTaskId); log.info("{},已经有计划任务了", srvTaskId);
continue; continue;
} }
ChSrvTaskDetail chSrvTaskDetail = new ChSrvTaskDetail(); ChSrvTaskDetail chSrvTaskDetail = new ChSrvTaskDetail();
...@@ -262,7 +306,7 @@ public class SrvTaskServiceImpl implements SrvTaskService { ...@@ -262,7 +306,7 @@ public class SrvTaskServiceImpl implements SrvTaskService {
chSrvTaskDetailMapper.insert(chSrvTaskDetail); chSrvTaskDetailMapper.insert(chSrvTaskDetail);
// ch_srv_plan // ch_srv_plan
String programId = chSrvTask.getProgramId(); String programId = chSrvTask.getProgramId();
saveSrvPlan(programId,dateStr); saveSrvPlan(programId, dateStr);
} }
} }
...@@ -270,7 +314,8 @@ public class SrvTaskServiceImpl implements SrvTaskService { ...@@ -270,7 +314,8 @@ public class SrvTaskServiceImpl implements SrvTaskService {
// 补卡 // 补卡
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public Result saveApplyCard(SrvPlanInputVO srvPlanInputVO){ public Result saveApplyCard(SrvPlanInputVO srvPlanInputVO) {
log.info("SrvTaskServiceImpl=======saveApplyCard:{}", JSON.toJSONString(srvPlanInputVO));
Long taskDetailId = null; Long taskDetailId = null;
// 先查询是否有计划,有计划了不再生成计划 // 先查询是否有计划,有计划了不再生成计划
List<ChSrvTaskDetail> chSrvTaskDetailList = chSrvTaskDetailMapper.selectList(new LambdaQueryWrapper<ChSrvTaskDetail>() List<ChSrvTaskDetail> chSrvTaskDetailList = chSrvTaskDetailMapper.selectList(new LambdaQueryWrapper<ChSrvTaskDetail>()
...@@ -280,15 +325,16 @@ public class SrvTaskServiceImpl implements SrvTaskService { ...@@ -280,15 +325,16 @@ public class SrvTaskServiceImpl implements SrvTaskService {
if (CollectionUtil.isNotEmpty(chSrvTaskDetailList)) { if (CollectionUtil.isNotEmpty(chSrvTaskDetailList)) {
ChSrvTaskDetail chSrvTaskDetail = chSrvTaskDetailList.get(0); ChSrvTaskDetail chSrvTaskDetail = chSrvTaskDetailList.get(0);
taskDetailId = chSrvTaskDetail.getTaskDetailId(); taskDetailId = chSrvTaskDetail.getTaskDetailId();
if(modeId == 3){ if (modeId == 3) {
int status = chSrvTaskDetailList.stream().map(ChSrvTaskDetail::getStatus).findFirst().orElse((short)0); int status = chSrvTaskDetailList.stream().map(ChSrvTaskDetail::getStatus).findFirst().orElse((short) 0);
if(status == 1 || status == 4) { if (status == 1 || status == 4) {
return Result.failed("手机app已有任务,不可重复生成"); return Result.failed("手机app已有任务,不可重复生成");
} }
ChSrvTaskDetail chSrvTaskDetailDTO = new ChSrvTaskDetail(); ChSrvTaskDetail chSrvTaskDetailDTO = new ChSrvTaskDetail();
chSrvTaskDetailDTO.setTaskDetailId(taskDetailId); chSrvTaskDetailDTO.setTaskDetailId(taskDetailId);
// 补卡标识 // 补卡标识
chSrvTaskDetailDTO.setIsClock((short) 1); chSrvTaskDetailDTO.setIsClock((short) 1);
chSrvTaskDetailDTO.setCheckStatus((short) 1);
chSrvTaskDetailDTO.setClockReason(srvPlanInputVO.getClockReason()); chSrvTaskDetailDTO.setClockReason(srvPlanInputVO.getClockReason());
chSrvTaskDetailDTO.setClockOperator(srvPlanInputVO.getAdmin()); chSrvTaskDetailDTO.setClockOperator(srvPlanInputVO.getAdmin());
chSrvTaskDetailMapper.updateById(chSrvTaskDetailDTO); chSrvTaskDetailMapper.updateById(chSrvTaskDetailDTO);
...@@ -297,10 +343,10 @@ public class SrvTaskServiceImpl implements SrvTaskService { ...@@ -297,10 +343,10 @@ public class SrvTaskServiceImpl implements SrvTaskService {
.eq(ChSrvPlan::getDisabInfoId, srvPlanInputVO.getDisabInfoId()) .eq(ChSrvPlan::getDisabInfoId, srvPlanInputVO.getDisabInfoId())
.eq(ChSrvPlan::getSrvPlanTime, srvPlanInputVO.getSrvPlanTime()) .eq(ChSrvPlan::getSrvPlanTime, srvPlanInputVO.getSrvPlanTime())
.eq(ChSrvPlan::getModeId, srvPlanInputVO.getModeId())); .eq(ChSrvPlan::getModeId, srvPlanInputVO.getModeId()));
if(CollectionUtil.isNotEmpty(srvPlanList)){ if (CollectionUtil.isNotEmpty(srvPlanList)) {
return Result.failed("任务列表已有计划,不可重复生成"); return Result.failed("任务列表已有计划,不可重复生成");
} }
}else { } else {
// 插入计划表 // 插入计划表
ChSrvTaskDetail chSrvTaskDetail = new ChSrvTaskDetail(); ChSrvTaskDetail chSrvTaskDetail = new ChSrvTaskDetail();
...@@ -312,17 +358,19 @@ public class SrvTaskServiceImpl implements SrvTaskService { ...@@ -312,17 +358,19 @@ public class SrvTaskServiceImpl implements SrvTaskService {
chSrvTaskDetail.setStatus((short) 0); chSrvTaskDetail.setStatus((short) 0);
// 补卡标识 // 补卡标识
chSrvTaskDetail.setIsClock((short) 1); chSrvTaskDetail.setIsClock((short) 1);
chSrvTaskDetail.setCheckStatus((short) 1);
chSrvTaskDetail.setClockReason(srvPlanInputVO.getClockReason()); chSrvTaskDetail.setClockReason(srvPlanInputVO.getClockReason());
chSrvTaskDetail.setClockOperator(srvPlanInputVO.getAdmin()); chSrvTaskDetail.setClockOperator(srvPlanInputVO.getAdmin());
chSrvTaskDetail.setFcd(new Date()); chSrvTaskDetail.setFcd(new Date());
int insert = chSrvTaskDetailMapper.insert(chSrvTaskDetail); int insert = chSrvTaskDetailMapper.insert(chSrvTaskDetail);
if(insert == 0){ if (insert == 0) {
return Result.failed("补卡失败,请重新提交"); return Result.failed("补卡失败,请重新提交");
} }
taskDetailId = chSrvTaskDetail.getTaskDetailId(); taskDetailId = chSrvTaskDetail.getTaskDetailId();
} }
try { try {
log.info("=======SrvTaskServiceImpl.saveApplyCard.taskDetailId:{}",taskDetailId); log.info("=======SrvTaskServiceImpl.saveApplyCard.taskDetailId:{}", taskDetailId);
String[] itemIds = srvPlanInputVO.getItemIds(); String[] itemIds = srvPlanInputVO.getItemIds();
List<ItemDTO> itemDTOS = chSrvPlanMapper.queryItem(srvPlanInputVO.getSrvOrganId()); List<ItemDTO> itemDTOS = chSrvPlanMapper.queryItem(srvPlanInputVO.getSrvOrganId());
...@@ -340,20 +388,109 @@ public class SrvTaskServiceImpl implements SrvTaskService { ...@@ -340,20 +388,109 @@ public class SrvTaskServiceImpl implements SrvTaskService {
chSrvPlan.setEmpId(srvPlanInputVO.getEmpId()); chSrvPlan.setEmpId(srvPlanInputVO.getEmpId());
chSrvPlan.setSrvPlanTime(srvPlanInputVO.getSrvPlanTime()); chSrvPlan.setSrvPlanTime(srvPlanInputVO.getSrvPlanTime());
chSrvPlan.setTaskDetailId(taskDetailId); chSrvPlan.setTaskDetailId(taskDetailId);
chSrvPlan.setIsStatus(Long.valueOf(0));
int insert1 = chSrvPlanMapper.insert(chSrvPlan); int insert1 = chSrvPlanMapper.insert(chSrvPlan);
if(insert1==0){ if (insert1 == 0) {
return Result.failed("补卡失败,请重新提交"); return Result.failed("补卡失败,请重新提交");
} }
} }
srvPlanInputVO.setTaskDetailId(taskDetailId);
this.updateAttachs(srvPlanInputVO);
} catch (Exception e) { } catch (Exception e) {
log.error("=======SrvTaskServiceImpl error {}",e); log.error("=======SrvTaskServiceImpl===saveApplyCard===error {}", e);
return Result.failed("补卡失败"); return Result.failed("补卡失败");
} }
return Result.success(); return Result.success();
} }
@Transactional(rollbackFor = Exception.class)
@Override
public Result updateApplyCard(SrvPlanInputVO srvPlanInputVO) {
Long taskDetailId = srvPlanInputVO.getTaskDetailId();
ChSrvTaskDetail chSrvTaskDetailDTO = new ChSrvTaskDetail();
chSrvTaskDetailDTO.setTaskDetailId(taskDetailId);
// 补卡标识
chSrvTaskDetailDTO.setIsClock((short) 1);
chSrvTaskDetailDTO.setCheckStatus((short) 1);
chSrvTaskDetailDTO.setClockReason(srvPlanInputVO.getClockReason());
chSrvTaskDetailDTO.setClockOperator(srvPlanInputVO.getAdmin());
chSrvTaskDetailDTO.setLcd(new Date());
try {
chSrvTaskDetailMapper.updateById(chSrvTaskDetailDTO);
chSrvPlanMapper.delete(new QueryWrapper<ChSrvPlan>().eq("task_detail_id", taskDetailId));
String[] itemIds = srvPlanInputVO.getItemIds();
List<ItemDTO> itemDTOS = chSrvPlanMapper.queryItem(srvPlanInputVO.getSrvOrganId());
for (String r : itemIds) {
ChSrvPlan chSrvPlan = new ChSrvPlan();
chSrvPlan.setItemId(Long.valueOf(r));
if (CollectionUtil.isNotEmpty(itemDTOS)) {
String itemName = itemDTOS.stream().filter(s -> s.getItemId().equals(r)).map(ItemDTO::getItemName).findFirst().orElse(null);
chSrvPlan.setItemName(itemName);
}
chSrvPlan.setSrvOrganId(srvPlanInputVO.getSrvOrganId());
chSrvPlan.setModeId(srvPlanInputVO.getModeId());
chSrvPlan.setCreationTime(new Date());
chSrvPlan.setDisabInfoId(srvPlanInputVO.getDisabInfoId());
chSrvPlan.setEmpId(srvPlanInputVO.getEmpId());
chSrvPlan.setSrvPlanTime(srvPlanInputVO.getSrvPlanTime());
chSrvPlan.setTaskDetailId(taskDetailId);
int insert1 = chSrvPlanMapper.insert(chSrvPlan);
}
this.updateAttachs(srvPlanInputVO);
} catch (Exception e) {
log.error("=======SrvTaskServiceImpl===updateApplyCard===error {}", e);
return Result.failed("补卡修改失败");
}
return Result.success();
}
@Override
public Result auditingCard(AuditingCardVO auditingCardVO){
log.info("SrvTaskServiceImpl=======auditingCard:{}",JSON.toJSONString(auditingCardVO));
ChSrvTaskDetail chSrvTaskDetailDTO = new ChSrvTaskDetail();
chSrvTaskDetailDTO.setTaskDetailId(auditingCardVO.getTaskDetailId());
chSrvTaskDetailDTO.setCheckStatus(auditingCardVO.getStatus());
chSrvTaskDetailDTO.setAuditRemark(auditingCardVO.getAuditRemark());
chSrvTaskDetailDTO.setAuditDate(new Date());
chSrvTaskDetailDTO.setAuditor(auditingCardVO.getAuditor());
if(auditingCardVO.getStatus() == 2) {
UpdateWrapper updateWrapper = new UpdateWrapper();
updateWrapper.eq("task_detail_id", auditingCardVO.getTaskDetailId());
updateWrapper.set("is_status", 0);
updateWrapper.set("LCD", new DATE());
chSrvPlanMapper.update(null, updateWrapper);
}
int result = chSrvTaskDetailMapper.updateById(chSrvTaskDetailDTO);
if(result>0){
return Result.success();
}else {
return Result.failed("补卡审核失败!");
}
}
/**
* 调用feign api来修改附件数据
*
* @param srvPlanInputVO
*/
private void updateAttachs(SrvPlanInputVO srvPlanInputVO) {
// zhangch 20210525 新增附件修改逻辑
List<ChFndAttach> fileDataList = srvPlanInputVO.getFileDataList();
AttachUpdateVo attachUpdateVo = new AttachUpdateVo();
attachUpdateVo.setCtrlId(srvPlanInputVO.getTaskDetailId());
attachUpdateVo.setAttachType(AttachType.DISABLE.getUploadType());
attachUpdateVo.setChFndAttachs(fileDataList);
attachFeignService.updateAttachs(attachUpdateVo);
}
@Override @Override
public Result queryItemBySrvOrganId(Long srvOrganId){ public Result queryItemBySrvOrganId(Long srvOrganId){
List<ItemDTO> itemDTOS = chSrvPlanMapper.queryItem(srvOrganId); List<ItemDTO> itemDTOS = chSrvPlanMapper.queryItem(srvOrganId);
......
...@@ -28,15 +28,20 @@ ...@@ -28,15 +28,20 @@
<select id="chSrvTaskDetailQuery" parameterType="com.hungraim.ltc.pojo.vo.disable.ChSrvTaskDetailVo" <select id="chSrvTaskDetailQuery" parameterType="com.hungraim.ltc.pojo.vo.disable.ChSrvTaskDetailVo"
resultType="com.hungraim.ltc.pojo.vo.disable.ChSrvTaskDetailVo"> resultType="com.hungraim.ltc.pojo.vo.disable.ChSrvTaskDetailVo">
select A.* from ( select A.*,(case when A.exitReasonId = 4 and A.hospitalFlag1 = 0 then 0
select row_number()over(partition by info.CERTI_CODE order by program.PROGRAM_ID) rn, when A.exitReasonId = 4 and A.hospitalFlag1 > 0 then 1 else 2 end) hospitalFlag
from ( select row_number()over(partition by info.CERTI_CODE order by program.PROGRAM_ID) rn,
program.PROGRAM_ID taskDetailId, program.PROGRAM_ID taskDetailId,
mode1.MODE_NAME modeName, mode1.MODE_NAME modeName,
organ.SRV_ORGAN_NAME srvOrganName,--护理机构名称 organ.SRV_ORGAN_NAME srvOrganName,--护理机构名称
info.REAL_NAME realName,--失能人员名字 info.REAL_NAME realName,--失能人员名字
info.CERTI_CODE certiCode,--失能人员身份证件号码 info.CERTI_CODE certiCode,--失能人员身份证件号码
program.PROGRAM_DATE sevStarTime,--服务开始时间 program.PROGRAM_DATE sevStarTime,--服务开始时间
program.PROGRAM_EDN_DATE sevEndTime--服务结束时间 program.PROGRAM_EDN_DATE sevEndTime,--服务结束时间
(select count(*) from CH_SRV_SEND t where t.DISAB_INFO_ID = info.DISAB_INFO_ID and
t.STATUS = 1) hospitalFlag1,
info.exit_reason_id exitReasonId,
info.DISAB_INFO_ID disabInfoId
from ch_srv_program program from ch_srv_program program
LEFT JOIN ch_cfg_srv_mode mode1 ON program.srv_mode_id = mode1.mode_id --服务方式 LEFT JOIN ch_cfg_srv_mode mode1 ON program.srv_mode_id = mode1.mode_id --服务方式
LEFT JOIN ch_srv_organ organ ON program.srv_organ_id = organ.srv_organ_id --服务机构 LEFT JOIN ch_srv_organ organ ON program.srv_organ_id = organ.srv_organ_id --服务机构
...@@ -46,6 +51,10 @@ ...@@ -46,6 +51,10 @@
<if test="vo.srvOrganName != null and vo.srvOrganName != ''"> <if test="vo.srvOrganName != null and vo.srvOrganName != ''">
AND organ.SRV_ORGAN_NAME LIKE '%' || #{vo.srvOrganName} || '%' AND organ.SRV_ORGAN_NAME LIKE '%' || #{vo.srvOrganName} || '%'
</if> </if>
<if test="vo.srvOrganId != null and vo.srvOrganId != '' and vo.srvOrganId!=0">
and organ.SRV_ORGAN_ID = #{vo.srvOrganId}
</if>
<if test="vo.modeName != null and vo.modeName != ''"> <if test="vo.modeName != null and vo.modeName != ''">
AND mode1.MODE_NAME = #{vo.modeName} AND mode1.MODE_NAME = #{vo.modeName}
</if> </if>
...@@ -55,6 +64,7 @@ ...@@ -55,6 +64,7 @@
<if test="vo.certiCode != null and vo.certiCode != ''"> <if test="vo.certiCode != null and vo.certiCode != ''">
AND info.CERTI_CODE =#{vo.certiCode} AND info.CERTI_CODE =#{vo.certiCode}
</if> </if>
<if test="vo.sevStarTime != null and vo.sevStarTime != ''"> <if test="vo.sevStarTime != null and vo.sevStarTime != ''">
AND program.PROGRAM_DATE &gt;= TO_DATE (#{vo.sevStarTime}, 'yyyy-mm-dd') AND program.PROGRAM_DATE &gt;= TO_DATE (#{vo.sevStarTime}, 'yyyy-mm-dd')
</if> </if>
...@@ -63,7 +73,13 @@ ...@@ -63,7 +73,13 @@
</if> </if>
)A )A
where A.rn =1 where A.rn =1
<if test="vo.hospitalFlag != null and vo.hospitalFlag != ''">
AND (case when A.exitReasonId = 4 and A.hospitalFlag1 = 0 then 0
when A.exitReasonId = 4 and A.hospitalFlag1 > 0 then 1 else 2 end) = #{vo.hospitalFlag}
</if>
</select> </select>
<select id="getsrvOrgan" resultType="com.hungraim.ltc.pojo.entity.account.ChPunchDetailsVO"> <select id="getsrvOrgan" resultType="com.hungraim.ltc.pojo.entity.account.ChPunchDetailsVO">
SELECT SELECT
n.SRV_ORGAN_NAME srvOrganName, n.SRV_ORGAN_NAME srvOrganName,
...@@ -85,10 +101,13 @@ ...@@ -85,10 +101,13 @@
<select id="getServiceTypeDetailed" parameterType="Long" resultType="com.hungraim.ltc.pojo.entity.account.ChServiceTypeDetailedVO"> <select id="getServiceTypeDetailed" parameterType="Long" resultType="com.hungraim.ltc.pojo.entity.account.ChServiceTypeDetailedVO">
SELECT SELECT
case when mode1.MODE_NAME='上门' then to_char(detail.SRV_START_TIME, 'dd' ) case when mode1.MODE_NAME='上门' then to_char(detail.SRV_DATE, 'dd' )
else to_char(item.FCD, 'dd' ) end executionTime, else to_char(detail.SRV_DATE, 'dd' ) end executionTime,
service.SERVICE_TYPE_DETAILED_NAME itemName, service.SERVICE_TYPE_DETAILED_NAME itemName,
service.SERVICE_TYPE_DETAILED_ID serviceTypeDetailedId service.SERVICE_TYPE_DETAILED_ID serviceTypeDetailedId,
detail.SRV_START_PIC srvStartPic,
detail.SRV_START_PIC2 srvStartPic2,
detail.SRV_END_PIC srvEndPic
FROM FROM
CH_SRV_TASK_DETAIL detail CH_SRV_TASK_DETAIL detail
inner JOIN ch_srv_task task ON task.srv_task_id = detail.srv_task_id inner JOIN ch_srv_task task ON task.srv_task_id = detail.srv_task_id
...@@ -106,12 +125,20 @@ ...@@ -106,12 +125,20 @@
<if test="sevStarTime != null and sevStarTime != ''"> <if test="sevStarTime != null and sevStarTime != ''">
AND detail.SRV_START_TIME &gt;= TO_DATE (substr(#{sevStarTime},1,10), 'yyyy-mm-dd') AND detail.SRV_START_TIME &gt;= TO_DATE (substr(#{sevStarTime},1,10), 'yyyy-mm-dd')
</if> </if>
<if test="sevEndTime != null and sevEndTime != ''"> <if test="sevEndTime != null and sevEndTime != ''">
AND detail.SRV_END_TIME &lt;= TO_DATE (substr(#{sevEndTime},1,10), 'yyyy-mm-dd') AND detail.SRV_END_TIME &lt;= TO_DATE (substr(#{sevEndTime},1,10), 'yyyy-mm-dd')
</if> </if>
</when> </when>
<otherwise> <otherwise>
AND item.FCD >= TO_DATE (substr(#{sevStarTime},1,10), 'yyyy-mm-dd')
<if test="sevStarTime != null and sevStarTime != ''">
AND detail.SRV_DATE &gt;= TO_DATE (substr(#{sevStarTime},1,10), 'yyyy-mm-dd')
</if>
<if test="sevEndTime != null and sevEndTime != ''">
AND detail.SRV_DATE &lt;= TO_DATE (substr(#{sevEndTime},1,10), 'yyyy-mm-dd')
</if>
</otherwise> </otherwise>
</choose> </choose>
</select> </select>
...@@ -127,6 +154,15 @@ ...@@ -127,6 +154,15 @@
LEFT JOIN CH_SERVICE_TYPE e ON d.PARA_ID = e.SERVICE_TYPE_ID LEFT JOIN CH_SERVICE_TYPE e ON d.PARA_ID = e.SERVICE_TYPE_ID
</select> </select>
<select id="getRoleByUserId" resultType="java.lang.Integer">
select count(*) from LTC_USER_ROLE r where r.user_id = #{userId}
<if test="roleIds != null">
and r.role_id in
<foreach collection="roleIds" item="roleIds" open="(" close=")" separator=",">
#{roleIds}
</foreach>
</if>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
<result column="SRV_ORGAN_ID" property="itemTimes"/> <result column="SRV_ORGAN_ID" property="itemTimes"/>
<result column="ITEM_TIMES_TYPE" property="itemTimesType"/> <result column="ITEM_TIMES_TYPE" property="itemTimesType"/>
<result column="ITEM_PRICE" property="itemPrice"/> <result column="ITEM_PRICE" property="itemPrice"/>
<result column="ITEM_WEEK" property="itemWeek"/>
<result column="IS_NEED" property="isNeed"/> <result column="IS_NEED" property="isNeed"/>
<result column="PLANNING_FREQUENCY" property="planningFrequency"/> <result column="PLANNING_FREQUENCY" property="planningFrequency"/>
<result column="PLANNING_FREQUENCY_TYPE" property="planningFrequencyType"/> <result column="PLANNING_FREQUENCY_TYPE" property="planningFrequencyType"/>
...@@ -63,6 +64,7 @@ ...@@ -63,6 +64,7 @@
PLANNING_FREQUENCY, PLANNING_FREQUENCY,
PLANNING_FREQUENCY_TYPE, PLANNING_FREQUENCY_TYPE,
CH_SRV_PROGRAM_SET.REMARK, CH_SRV_PROGRAM_SET.REMARK,
CH_SRV_PROGRAM_SET.ITEM_WEEK,
NVL(CH_SRV_PROGRAM_SET.IS_CONF, '0') IS_CONF NVL(CH_SRV_PROGRAM_SET.IS_CONF, '0') IS_CONF
</if> </if>
FROM CH_SRV_ORGAN_PROJECT FROM CH_SRV_ORGAN_PROJECT
......
...@@ -15,7 +15,9 @@ ...@@ -15,7 +15,9 @@
detail.TASK_DETAIL_ID taskDetailId, detail.TASK_DETAIL_ID taskDetailId,
d.SERVICE_TYPE_DETAILED_NAME itemName, d.SERVICE_TYPE_DETAILED_NAME itemName,
CSTFI.ITEM_ID itemId, CSTFI.ITEM_ID itemId,
'0' isStatus '0' isStatus,
CSTFI.PLANNING_FREQUENCY_TYPE planningFrequencyType,
CSTFI.item_week itemWeek
from ch_srv_task_detail detail --服务计划 from ch_srv_task_detail detail --服务计划
left join ch_srv_task task on task.srv_task_id = detail.srv_task_id--服务计划详情 left join ch_srv_task task on task.srv_task_id = detail.srv_task_id--服务计划详情
left join ch_disable_info disable on task.disab_info_id = disable.disab_info_id--失能人员 left join ch_disable_info disable on task.disab_info_id = disable.disab_info_id--失能人员
......
...@@ -12,7 +12,10 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -12,7 +12,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
import java.util.Objects;
@RestController @RestController
@RequestMapping("/api.system/resource") @RequestMapping("/api.system/resource")
...@@ -88,4 +91,17 @@ public class FileUploadController { ...@@ -88,4 +91,17 @@ public class FileUploadController {
List<ChFndAttach> chFndAttaches = attachService.selectAttachs(ctrlId, attachType); List<ChFndAttach> chFndAttaches = attachService.selectAttachs(ctrlId, attachType);
return Result.success(chFndAttaches); return Result.success(chFndAttaches);
} }
@GetMapping ("/download")
public void download(Long attachId, HttpServletRequest request, HttpServletResponse response) {
ChFndAttach chFndAttach = attachService.selectById(attachId);
if(Objects.nonNull(chFndAttach)){
String filePath = chFndAttach.getFilePath();
String fileName = chFndAttach.getFileName();
FileUtils.downloadPathFile(filePath, fileName,request,response);
}
}
} }
...@@ -35,4 +35,6 @@ public interface AttachService { ...@@ -35,4 +35,6 @@ public interface AttachService {
* @return 返回对应的数据列表 * @return 返回对应的数据列表
*/ */
List<ChFndAttach> selectAttachs(Long ctrlId, Short attachType); List<ChFndAttach> selectAttachs(Long ctrlId, Short attachType);
ChFndAttach selectById(Long attachId);
} }
...@@ -11,6 +11,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -11,6 +11,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects;
@Service @Service
public class AttachServiceImpl implements AttachService { public class AttachServiceImpl implements AttachService {
...@@ -103,4 +104,11 @@ public class AttachServiceImpl implements AttachService { ...@@ -103,4 +104,11 @@ public class AttachServiceImpl implements AttachService {
public List<ChFndAttach> selectAttachs(Long ctrlId, Short attachType) { public List<ChFndAttach> selectAttachs(Long ctrlId, Short attachType) {
return this.getChFndAttaches(ctrlId, attachType); return this.getChFndAttaches(ctrlId, attachType);
} }
@Override
public ChFndAttach selectById(Long attachId){
ChFndAttach chFndAttach = chFndAttachMapper.selectById(attachId);
return chFndAttach;
}
} }
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