Commit cb5ff3d6 authored by 蔡镇泽's avatar 蔡镇泽

失能评定报告附件上传

parent d7003e78
......@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.disable.*;
import com.hungraim.ltc.pojo.vo.disable.*;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
......@@ -27,7 +26,6 @@ public interface DisableService {
* @param applyId 申请id
* @return 失能审核信息详情
*/
@Transactional()
DisableExamineInfoVO disableExamineInfo(String applyId);
void addDisable(ChDisableApply chDisableApply);
......
......@@ -91,6 +91,7 @@ public class DisableServiceImpl implements DisableService {
districtCity, districtArea, realName, certiCode, dataFrom, srvOrganName);
}
@Transactional(rollbackFor = Exception.class)
@Override
public DisableExamineInfoVO disableExamineInfo(String applyId) {
DisableExamineInfoVO disableExamineInfoVO = disableApplyMapper.selectDisableExamineInfoByApplyId(applyId);
......
......@@ -23,6 +23,18 @@
<version>2.2.5.RELEASE</version>
</dependency>
<!--feign服务调用-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<!--系统服务api-->
<dependency>
<groupId>com.hungraim.ltc</groupId>
<artifactId>system-api</artifactId>
<version>0.0.1</version>
</dependency>
<!--基础包-->
<dependency>
......
......@@ -3,6 +3,8 @@ package com.hungraim.ltc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* 评定服务: 负责 评定任务管理 评定报告录入
......@@ -11,6 +13,8 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
*/
@SpringBootApplication
@EnableDiscoveryClient
@EnableTransactionManagement
@EnableFeignClients
public class AssessmentApplication {
public static void main(String[] args) {
SpringApplication.run(AssessmentApplication.class, args);
......
package com.hungraim.ltc.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.assessment.ChRefuseReason;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel;
import com.hungraim.ltc.pojo.vo.assessment.*;
......@@ -121,9 +122,10 @@ public class TaskController {
* @param disableLevelId 失能等级id
* @param polNo 保单号
* @param remark 备注
* @param fileDataList 附件
*/
@RequestMapping("/addReport")
public Result addReport(Integer taskId, Integer person1, Integer person2, Integer person3, String evaluateTime, Integer disableLevelId, String polNo, String remark) {
public Result addReport(Integer taskId, Integer person1, Integer person2, Integer person3, String evaluateTime, Integer disableLevelId, String polNo, String remark, List<ChFndAttach> fileDataList) {
if (person1 == null) {
return Result.failed("鉴定人员1不能为空!");
}
......@@ -143,7 +145,7 @@ public class TaskController {
} catch (ParseException e) {
return Result.failed("评估时间格式不正确!");
}
Result<Object> objectResult = taskService.addReport(taskId, person1, person2, person3, evaluateDate, disableLevelId, polNo, remark);
Result<Object> objectResult = taskService.addReport(taskId, person1, person2, person3, evaluateDate, disableLevelId, polNo, remark, fileDataList);
if (!ResultCode.SUCCESS.getCode().equals(objectResult.getCode())) {
//失败
return Result.failed(objectResult.getMsg());
......@@ -162,9 +164,11 @@ public class TaskController {
* @param disableLevelId 失能等级id
* @param polNo 保单号
* @param remark 备注
* @param remark 备注
* @param fileDataList 附件
*/
@RequestMapping("/updateReport")
public Result updateReport(Integer reportId, Integer person1, Integer person2, Integer person3, String evaluateTime, Integer disableLevelId, String polNo, String remark) {
public Result updateReport(Integer reportId, Integer person1, Integer person2, Integer person3, String evaluateTime, Integer disableLevelId, String polNo, String remark, List<ChFndAttach> fileDataList) {
if (disableLevelId == null) {
return Result.failed("失能等级不能为空!");
}
......@@ -181,7 +185,7 @@ public class TaskController {
} catch (ParseException e) {
return Result.failed("评估时间格式不正确!");
}
taskService.updateReport(reportId, person1, person2, person3, evaluateDate, disableLevelId, polNo, remark);
taskService.updateReport(reportId, person1, person2, person3, evaluateDate, disableLevelId, polNo, remark, fileDataList);
return Result.success();
}
......
package com.hungraim.ltc.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.assessment.ChRefuseReason;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel;
import com.hungraim.ltc.pojo.vo.assessment.*;
......@@ -26,9 +27,9 @@ public interface TaskService {
List<AprEmpVO> aprEmpList(String provincial, String city, String area, String organName, String name, String tel, String groupLeader);
Result<Object> addReport(Integer taskId, Integer person1, Integer person2, Integer person3, Date evaluateTime, Integer disableLevelId, String polNo, String remark);
Result<Object> addReport(Integer taskId, Integer person1, Integer person2, Integer person3, Date evaluateTime, Integer disableLevelId, String polNo, String remark, List<ChFndAttach> fileDataList);
void updateReport(Integer reportId, Integer person1, Integer person2, Integer person3, Date evaluateDate, Integer disableLevelId, String polNo, String remark);
void updateReport(Integer reportId, Integer person1, Integer person2, Integer person3, Date evaluateDate, Integer disableLevelId, String polNo, String remark, List<ChFndAttach> fileDataList);
Result<Object> allotTask(String taskId, String empId);
......
......@@ -3,18 +3,24 @@ package com.hungraim.ltc.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.api.AttachFeignService;
import com.hungraim.ltc.dao.*;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.assessment.*;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel;
import com.hungraim.ltc.pojo.entity.disable.ChDisableInfo;
import com.hungraim.ltc.pojo.vo.assessment.*;
import com.hungraim.ltc.pojo.vo.system.AttachUpdateVo;
import com.hungraim.ltc.service.TaskService;
import com.hungraim.ltc.util.AttachType;
import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.SerialNumberUtils;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Date;
......@@ -24,26 +30,20 @@ import java.util.List;
* @author czz
*/
@Service
@Slf4j
@AllArgsConstructor
public class TaskServiceImpl implements TaskService {
@Autowired
private TaskMapper taskMapper;
@Autowired
private AprEmpMapper aprEmpMapper;
@Autowired
private AprReportMapper aprReportMapper;
@Autowired
private AprPersonInfoMapper personInfoMapper;
@Autowired
private TaskPushMapper taskPushMapper;
@Autowired
private TaskPushHisMapper taskPushHisMapper;
@Autowired
private CfgSrvDisableLevelMapper cfgSrvDisableLevelMapper;
@Autowired
private DisableInfoMapper disableInfoMapper;
@Autowired
private RefuseReasonMapper refuseReasonMapper;
private final TaskMapper taskMapper;
private final AprEmpMapper aprEmpMapper;
private final AprReportMapper aprReportMapper;
private final AprPersonInfoMapper personInfoMapper;
private final TaskPushMapper taskPushMapper;
private final TaskPushHisMapper taskPushHisMapper;
private final CfgSrvDisableLevelMapper cfgSrvDisableLevelMapper;
private final DisableInfoMapper disableInfoMapper;
private final RefuseReasonMapper refuseReasonMapper;
private final AttachFeignService attachFeignService;
/**
* 评定任务分配列表
......@@ -121,9 +121,11 @@ public class TaskServiceImpl implements TaskService {
* @param disableLevelId 失能等级id
* @param polNo 保单号
* @param remark 备注
* @param fileDataList 附件
*/
@Transactional(rollbackFor = Exception.class)
@Override
public Result<Object> addReport(Integer taskId, Integer person1, Integer person2, Integer person3, Date evaluateTime, Integer disableLevelId, String polNo, String remark) {
public Result<Object> addReport(Integer taskId, Integer person1, Integer person2, Integer person3, Date evaluateTime, Integer disableLevelId, String polNo, String remark, List<ChFndAttach> fileDataList) {
ChAprTask task = taskMapper.selectById(taskId);
if (task != null) {
return Result.failed("已存在的评定任务报告!");
......@@ -138,6 +140,10 @@ public class TaskServiceImpl implements TaskService {
report.setStatus(0);
report.setEvaluateTime(evaluateTime);
aprReportMapper.insert(report);
//附件上传
if (fileDataList != null && fileDataList.size() > 0) {
updateAttachs(fileDataList, report.getReportId().longValue());
}
//插入评定任务关联人员1.2.3(至少一位,最多三位)
//person1
ChAprPersonInfo person1Info = new ChAprPersonInfo();
......@@ -173,9 +179,11 @@ public class TaskServiceImpl implements TaskService {
* @param disableLevelId 失能等级id
* @param polNo 保单号
* @param remark 备注
* @param fileDataList 附件
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void updateReport(Integer reportId, Integer person1, Integer person2, Integer person3, Date evaluateDate, Integer disableLevelId, String polNo, String remark) {
public void updateReport(Integer reportId, Integer person1, Integer person2, Integer person3, Date evaluateDate, Integer disableLevelId, String polNo, String remark, List<ChFndAttach> fileDataList) {
//update鉴定报告
ChAprReport chAprReport = aprReportMapper.selectById(reportId);
chAprReport.setDisableLevelId(disableLevelId);
......@@ -183,6 +191,10 @@ public class TaskServiceImpl implements TaskService {
chAprReport.setRemark(remark);
chAprReport.setEvaluateTime(evaluateDate);
aprReportMapper.updateById(chAprReport);
//附件上传
if (fileDataList != null && fileDataList.size() > 0) {
this.updateAttachs(fileDataList, chAprReport.getReportId().longValue());
}
//修改鉴定报告人员(有就update,没有就insert)
List<ChAprPersonInfo> personInfos = personInfoMapper.selectList(new QueryWrapper<ChAprPersonInfo>().eq("report_id", reportId).orderByDesc("info_id"));
if (person1 != null) {
......@@ -227,11 +239,24 @@ public class TaskServiceImpl implements TaskService {
}
/**
* 调用feign api来修改附件数据
*/
private void updateAttachs(List<ChFndAttach> fileDataList, Long ctrlId) {
// 新增附件修改逻辑
AttachUpdateVo attachUpdateVo = new AttachUpdateVo();
attachUpdateVo.setCtrlId(ctrlId);
attachUpdateVo.setAttachType(AttachType.TASK.getUploadType());
attachUpdateVo.setChFndAttachs(fileDataList);
attachFeignService.updateAttachs(attachUpdateVo);
}
/**
* 评定任务分配
*
* @param taskId 评定任务id
* @param empId 评定人员id
*/
@Transactional(rollbackFor = Exception.class)
@Override
public Result<Object> allotTask(String taskId, String empId) {
ChAprEmp chAprEmp = aprEmpMapper.selectById(empId);
......@@ -314,6 +339,7 @@ public class TaskServiceImpl implements TaskService {
return taskMapper.taskGroupInfoList(groupNumber);
}
@Transactional(rollbackFor = Exception.class)
@Override
public Result<Object> taskGroup(Integer pushId, Integer status, Short refuseReason, String refuseRemark) {
ChAprTaskPush chAprTaskPush = taskPushMapper.selectById(pushId);
......@@ -340,6 +366,7 @@ public class TaskServiceImpl implements TaskService {
* @param refuseReason 拒绝原因id
* @param refuseRemark 拒绝备注
*/
@Transactional(rollbackFor = Exception.class)
@Override
public Result<Object> taskGroupByGroup(String groupNumber, Integer status, Short refuseReason, String refuseRemark) {
List<ChAprTaskPush> pushList = taskPushMapper.selectList(new QueryWrapper<ChAprTaskPush>().eq("group_number", groupNumber));
......@@ -391,6 +418,7 @@ public class TaskServiceImpl implements TaskService {
* @param timeDate 预约日期
* @param remark 备注
*/
@Transactional(rollbackFor = Exception.class)
@Override
public Result<Object> updatePushTimeAndRemark(String pushId, Date timeDate, String remark) {
ChAprTaskPush chAprTaskPush = taskPushMapper.selectById(pushId);
......
spring:
main:
#允许存在多个Feign调用相同Service的接口
allow-bean-definition-overriding: true
devtools:
restart:
enabled: true
......
......@@ -4,7 +4,6 @@ import cn.hutool.json.JSONArray;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.vo.governance.CfgAprVO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* 失能评定标准service
......@@ -13,7 +12,6 @@ import org.springframework.transaction.annotation.Transactional;
*/
@Service
public interface DisableAssessmentCriteriaService {
@Transactional()
void addOrUpdateDisableAssessmentCriteria(Long aprId, String organId, String estimateName, String remark, Integer status, JSONArray project);
Page<CfgAprVO> getDisableAssessmentCriteriaList(Page<CfgAprVO> page, String organIds, String aprName, String status);
......
......@@ -5,7 +5,6 @@ import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram;
import com.hungraim.ltc.pojo.vo.governance.ProgramDetailVo;
import com.hungraim.ltc.pojo.vo.governance.ProgramListVo;
import com.hungraim.ltc.pojo.vo.governance.SvrSendListVo;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
......@@ -64,7 +63,6 @@ public interface SrvProgramService {
* 添加或者修改服务方案
* @param programDetailVo 包装对象
*/
@Transactional()
void addProgramAndProgramSetList(ProgramDetailVo programDetailVo);
/**
......
......@@ -7,7 +7,6 @@ import com.hungraim.ltc.pojo.entity.disable.ChSrvOrgan;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend;
import com.hungraim.ltc.pojo.vo.governance.DisableInfoTaskVO;
import com.hungraim.ltc.pojo.vo.governance.SrvSendVO;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
......@@ -17,10 +16,8 @@ public interface SrvSendService extends IService<ChSrvSend> {
IPage<SrvSendVO> selectPage(ChDisableInfo disableInfo, ChSrvOrgan chSrvOrgan, ChSrvSend chSrvSend);
@Transactional()
DisableInfoTaskVO selectTaskById(Integer disableInfoId, Integer srvOrganId);
@Transactional()
List<DisableInfoTaskVO> selectBydisableInfoId(Integer disableInfoId);
Long selectMaxId();
......
......@@ -3,7 +3,6 @@ package com.hungraim.ltc.governance.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.vo.governance.*;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
......@@ -26,6 +25,5 @@ public interface SrvTaskService {
/**
* 新增或者修改服务计划
*/
@Transactional()
void addOrUpdateSrvTask(SrvTaskInfoListVO param);
}
......@@ -15,6 +15,7 @@ import com.hungraim.ltc.pojo.entity.assessment.ChCfgAprItemClause;
import com.hungraim.ltc.pojo.vo.governance.CfgAprVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Date;
......@@ -35,6 +36,7 @@ public class DisableAssessmentCriteriaServiceImpl implements DisableAssessmentCr
@Autowired
private ChCfgAprItemClauseMapper chCfgAprItemClauseMapper;
@Transactional(rollbackFor = Exception.class)
@Override
public void addOrUpdateDisableAssessmentCriteria(Long aprId, String organId, String estimateName, String remark, Integer status, JSONArray project) {
Date date = new Date();
......
......@@ -14,6 +14,7 @@ import com.hungraim.ltc.pojo.vo.governance.ProgramSetAndProjectVo;
import com.hungraim.ltc.pojo.vo.governance.SvrSendListVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
......@@ -59,6 +60,7 @@ public class SrvProgramServiceImpl implements SrvProgramService {
return chSrvProgramMapper.getProgramDetailWithAdd(disabInfoId, srvOrganId);
}
@Transactional(rollbackFor = Exception.class)
@Override
public void addProgramAndProgramSetList(ProgramDetailVo programDetailVo) {
Date date = new Date();
......
......@@ -12,6 +12,7 @@ import com.hungraim.ltc.pojo.vo.governance.*;
import com.hungraim.ltc.util.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
......@@ -80,6 +81,7 @@ public class SrvTaskServiceImpl implements SrvTaskService {
return srvTaskInfoList;
}
@Transactional(rollbackFor = Exception.class)
@Override
public void addOrUpdateSrvTask(SrvTaskInfoListVO param) {
String programId = param.getProgramId();
......
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