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

失能评定

parent 8ad30bb6
......@@ -2,18 +2,16 @@ package com.hungraim.ltc.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hungraim.ltc.pojo.entity.eval.ChAprEmp;
import com.hungraim.ltc.pojo.entity.eval.ChAprReport;
import com.hungraim.ltc.pojo.vo.assessment.TaskDistributionVO;
import com.hungraim.ltc.pojo.vo.assessment.TaskReportVO;
import com.hungraim.ltc.service.TaskService;
import com.hungraim.ltc.util.Result;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.List;
/**
......@@ -60,15 +58,21 @@ public class TaskController {
/**
* 评定报告录入列表
*
* @param name 失能人员姓名
* @param certiCode 失能人员身份证号码
* @param tel 失能人员手机号码
*/
@RequestMapping("/taskReportList")
public Result<List<TaskReportVO>> taskReportList() {
List<TaskReportVO> taskReportList = taskService.taskReportList();
public Result<List<TaskReportVO>> taskReportList(String name, String certiCode, String tel) {
List<TaskReportVO> taskReportList = taskService.taskReportList(name, certiCode, tel);
return Result.success(taskReportList);
}
/**
* 查询评定人员列表
*
* @param organId 人员所属机构id
*/
@RequestMapping("/aprEmpList")
public Result<List<ChAprEmp>> aprEmpList(Integer organId) {
......@@ -78,40 +82,62 @@ public class TaskController {
/**
* 评定报告新增
*
* @param taskId 评定报告id
* @param person1 鉴定人员1id
* @param person2 鉴定人员2id
* @param person3 鉴定人员3id
* @param disableLevelId 失能等级id
* @param polNo 保单号
* @param remark 备注
*/
@RequestMapping("/addReport")
public Result addReport(@RequestBody ChAprReport chAprReport) {
chAprReport.setEffTime(new Date());
int count = taskService.addReport(chAprReport);
if (count != 1) {
//失败
return Result.failed();
}
public Result addReport(Integer taskId, Integer person1, Integer person2, Integer person3, Integer disableLevelId, String polNo, String remark) {
taskService.addReport(taskId, person1, person2, person3, disableLevelId, polNo, remark);
return Result.success();
}
/**
* 评定报告修改
*
* @param reportId 评定报告id
* @param person1 鉴定人员1id
* @param person2 鉴定人员2id
* @param person3 鉴定人员3id
* @param disableLevelId 失能等级id
* @param polNo 保单号
* @param remark 备注
*/
@RequestMapping("/updateReport")
public Result updateReport(String reportId, Integer disableLevelId, String polNo, String remark) {
int count = taskService.updateReport(reportId, disableLevelId, polNo, remark);
if (count != 1) {
//失败
return Result.failed();
public Result updateReport(Integer reportId, Integer person1, Integer person2, Integer person3, Integer disableLevelId, String polNo, String remark) {
if (disableLevelId == null) {
return Result.failed("失能等级不能为空!");
}
if (polNo == null) {
polNo = "";
}
if (remark == null) {
remark = "";
}
taskService.updateReport(reportId, person1, person2, person3, disableLevelId, polNo, remark);
return Result.success();
}
/**
* 评定任务分配
*
* @param taskId 评定任务id
* @param empId 评定人员id
*/
@RequestMapping("/allotTask")
public Result allotTask(String taskId, String empId) {
int count = taskService.allotTask(taskId, empId);
if (count != 1) {
public Result allotTask(String taskId, Integer empId) {
if (StringUtils.isBlank(taskId)) {
return Result.failed("id不能为空!");
}
Result<Object> objectResult = taskService.allotTask(taskId, empId);
if (!"0".equals(objectResult.getCode())) {
//失败
return Result.failed();
return Result.failed(objectResult.getMsg());
}
return Result.success();
}
......
package com.hungraim.ltc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.eval.ChAprPersonInfo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
/**
* @author czz
*/
@Mapper
@Repository
public interface AprPeronInfoMapper extends BaseMapper<ChAprPersonInfo> {
}
......@@ -40,8 +40,8 @@ public interface TaskMapper extends BaseMapper<ChAprTask> {
String daysRemaining, String status, String isReturn, String area);
/**
* 评定报告录入
* 评定报告录入列表
*/
List<TaskReportVO> taskReportList();
List<TaskReportVO> taskReportList(String name, String certiCode, String tel);
}
......@@ -2,9 +2,9 @@ package com.hungraim.ltc.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hungraim.ltc.pojo.entity.eval.ChAprEmp;
import com.hungraim.ltc.pojo.entity.eval.ChAprReport;
import com.hungraim.ltc.pojo.vo.assessment.TaskDistributionVO;
import com.hungraim.ltc.pojo.vo.assessment.TaskReportVO;
import com.hungraim.ltc.util.Result;
import org.springframework.stereotype.Service;
import java.util.List;
......@@ -42,14 +42,18 @@ public interface TaskService {
/**
* 评定报告录入列表
*
* @param name 失能人员姓名
* @param certiCode 失能人员身份证号码
* @param tel 失能人员手机号码
*/
List<TaskReportVO> taskReportList();
List<TaskReportVO> taskReportList(String name, String certiCode, String tel);
List<ChAprEmp> aprEmpList(Integer organId);
int addReport(ChAprReport chAprReport);
void addReport(Integer taskId, Integer person1, Integer person2, Integer person3, Integer disableLevelId, String polNo, String remark);
int updateReport(String reportId, Integer disableLevelId, String polNo, String remark);
void updateReport(Integer reportId, Integer person1, Integer person2, Integer person3, Integer disableLevelId, String polNo, String remark);
int allotTask(String taskId, String empId);
Result<Object> allotTask(String taskId, Integer empId);
}
......@@ -4,17 +4,15 @@ import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.dao.AprEmpMapper;
import com.hungraim.ltc.dao.AprReportMapper;
import com.hungraim.ltc.dao.TaskEmpMapper;
import com.hungraim.ltc.dao.TaskMapper;
import com.hungraim.ltc.dao.*;
import com.hungraim.ltc.pojo.entity.eval.ChAprEmp;
import com.hungraim.ltc.pojo.entity.eval.ChAprPersonInfo;
import com.hungraim.ltc.pojo.entity.eval.ChAprReport;
import com.hungraim.ltc.pojo.entity.eval.ChAprTask;
import com.hungraim.ltc.pojo.entity.eval.ChAprTaskEmp;
import com.hungraim.ltc.pojo.vo.assessment.TaskDistributionVO;
import com.hungraim.ltc.pojo.vo.assessment.TaskReportVO;
import com.hungraim.ltc.service.TaskService;
import com.hungraim.ltc.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -36,6 +34,8 @@ public class TaskServiceImpl implements TaskService {
private AprReportMapper aprReportMapper;
@Autowired
private TaskEmpMapper taskEmpMapper;
@Autowired
private AprPeronInfoMapper peronInfoMapper;
@Override
public IPage<TaskDistributionVO> taskDistributionList(String organId, String provincial, String city,
......@@ -51,42 +51,118 @@ public class TaskServiceImpl implements TaskService {
}
@Override
public List<TaskReportVO> taskReportList() {
return taskMapper.taskReportList();
public List<TaskReportVO> taskReportList(String name, String certiCode, String tel) {
return taskMapper.taskReportList(name, certiCode, tel);
}
@Override
public List<ChAprEmp> aprEmpList(Integer organId) {
QueryWrapper queryWrapper = new QueryWrapper<ChAprEmp>();
QueryWrapper<ChAprEmp> queryWrapper = new QueryWrapper<ChAprEmp>();
queryWrapper.eq("IS_LOCK", 0);
queryWrapper.eq("apr_organ_id", organId);
return aprEmpMapper.selectList(new QueryWrapper<ChAprEmp>().eq("IS_LOCK", 0));
if (organId != null) {
queryWrapper.eq("apr_organ_id", organId);
}
return aprEmpMapper.selectList(queryWrapper);
}
@Override
public int addReport(ChAprReport chAprReport) {
return aprReportMapper.insert(chAprReport);
public void addReport(Integer taskId, Integer person1, Integer person2, Integer person3, Integer disableLevelId, String polNo, String remark) {
ChAprReport report = new ChAprReport();
report.setTaskId(taskId);
report.setEffTime(new Date());
report.setRemark(remark);
report.setDisableLevelId(disableLevelId);
report.setPolNo(polNo);
report.setStatus(0);
aprReportMapper.insert(report);
if (person1 != null) {
ChAprPersonInfo personInfo = new ChAprPersonInfo();
personInfo.setReportId(report.getReportId());
personInfo.setEmpId(person1);
personInfo.setFCD(new Date());
peronInfoMapper.insert(personInfo);
}
if (person2 != null) {
ChAprPersonInfo personInfo = new ChAprPersonInfo();
personInfo.setReportId(report.getReportId());
personInfo.setEmpId(person1);
personInfo.setFCD(new Date());
peronInfoMapper.insert(personInfo);
}
if (person3 != null) {
ChAprPersonInfo personInfo = new ChAprPersonInfo();
personInfo.setReportId(report.getReportId());
personInfo.setEmpId(person1);
personInfo.setFCD(new Date());
peronInfoMapper.insert(personInfo);
}
}
@Override
public int updateReport(String reportId, Integer disableLevelId, String polNo, String remark) {
public void updateReport(Integer reportId, Integer person1, Integer person2, Integer person3, Integer disableLevelId, String polNo, String remark) {
//update鉴定报告
ChAprReport chAprReport = aprReportMapper.selectById(reportId);
chAprReport.setDisableLevelId(disableLevelId);
chAprReport.setPolNo(polNo);
chAprReport.setRemark(remark);
return aprReportMapper.updateById(chAprReport);
aprReportMapper.updateById(chAprReport);
//修改鉴定报告人员(有就update,没有就insert)
List<ChAprPersonInfo> personInfos = peronInfoMapper.selectList(new QueryWrapper<ChAprPersonInfo>().eq("report_id", reportId));
if (person1 != null) {
if (personInfos.size() >= 1) {
ChAprPersonInfo personInfo = personInfos.get(0);
personInfo.setEmpId(person1);
peronInfoMapper.updateById(personInfo);
} else {
ChAprPersonInfo personInfo = new ChAprPersonInfo();
personInfo.setReportId(chAprReport.getReportId());
personInfo.setEmpId(person1);
personInfo.setFCD(new Date());
peronInfoMapper.insert(personInfo);
}
}
if (person2 != null) {
if (personInfos.size() >= 2) {
ChAprPersonInfo personInfo = personInfos.get(0);
personInfo.setEmpId(person2);
peronInfoMapper.updateById(personInfo);
} else {
ChAprPersonInfo personInfo = new ChAprPersonInfo();
personInfo.setReportId(chAprReport.getReportId());
personInfo.setEmpId(person2);
personInfo.setFCD(new Date());
peronInfoMapper.insert(personInfo);
}
}
if (person3 != null) {
if (personInfos.size() >= 3) {
ChAprPersonInfo personInfo = personInfos.get(0);
personInfo.setEmpId(person3);
peronInfoMapper.updateById(personInfo);
} else {
ChAprPersonInfo personInfo = new ChAprPersonInfo();
personInfo.setReportId(chAprReport.getReportId());
personInfo.setEmpId(person3);
personInfo.setFCD(new Date());
peronInfoMapper.insert(personInfo);
}
}
}
@Override
public int allotTask(String taskId, String empId) {
ChAprTask task = taskMapper.selectById(taskId);
ChAprEmp emp = aprEmpMapper.selectById(empId);
ChAprTaskEmp chAprTaskEmp = new ChAprTaskEmp();
chAprTaskEmp.setTaskId(task.getTaskId());
chAprTaskEmp.setEmpId(emp.getEmpId());
chAprTaskEmp.setIsValid(0);
chAprTaskEmp.setFcd(new Date());
chAprTaskEmp.setAprOrganId(Integer.getInteger(task.getOrganId()));
return taskEmpMapper.insert(chAprTaskEmp);
public Result<Object> allotTask(String taskId, Integer empId) {
String[] taskIds = taskId.split(",");
for (String id : taskIds) {
ChAprTask task = taskMapper.selectById(id);
if (task == null) {
return Result.failed("无效的taskId!");
}
task.setAprEmpId(empId);
int count = taskMapper.updateById(task);
if (count != 1) {
return Result.failed("修改失败!");
}
}
return Result.success();
}
}
\ No newline at end of file
......@@ -95,16 +95,27 @@
(SELECT DISE_TYPE_CODE FROM CH_FND_DISEASE_TYPE WHERE info.DISE_TYPE_F = DISE_TYPE_ID) diseTypeF,
(SELECT DISE_TYPE_CODE FROM CH_FND_DISEASE_TYPE WHERE info.DISE_TYPE_S = DISE_TYPE_ID) diseTypeS,
info.tel tel,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE info.ACPT_PROVINCIAL = dis.DISTRICT_CODE) acptProvincial,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE info.ACPT_CITY = dis.DISTRICT_CODE) acptCity,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE info.ACPT_AREA = dis.DISTRICT_CODE) acptArea,
lev.RISK_LEVEL riskLevel,
report.EFF_TIME effTime
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE info.ACPT_PROVINCIAL = dis.DISTRICT_CODE) acptProvincial,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE info.ACPT_CITY = dis.DISTRICT_CODE) acptCity,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE info.ACPT_AREA = dis.DISTRICT_CODE) acptArea,
lev.RISK_LEVEL riskLevel,
report.EFF_TIME effTime
FROM ch_apr_report report
LEFT JOIN CH_APR_TASK task ON report.TASK_ID = task.TASK_ID
LEFT JOIN CH_DISABLE_INFO info ON task.disable_info_id = info.disab_info_id
LEFT JOIN CH_APR_ORGAN organ ON task.APR_ORGAN_ID = organ.APR_ORGAN_ID
LEFT JOIN CH_DISABLE_RISK_LEVEL lev ON report.DISABLE_LEVEL_ID = lev.DISA_RISK_LEVEL_ID
LEFT JOIN CH_APR_TASK task ON report.TASK_ID = task.TASK_ID
LEFT JOIN CH_DISABLE_INFO info ON task.disable_info_id = info.disab_info_id
LEFT JOIN CH_APR_ORGAN organ ON task.APR_ORGAN_ID = organ.APR_ORGAN_ID
LEFT JOIN CH_DISABLE_RISK_LEVEL lev ON report.DISABLE_LEVEL_ID = lev.DISA_RISK_LEVEL_ID
<where>
<if test="name != null and name == ''">
and info.REAL_NAME = #{name}
</if>
<if test="certiCode != null and certiCode == ''">
and info.CERTI_CODE = #{certiCode}
</if>
<if test="tel != null and tel == ''">
and info.tel = #{tel}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
package com.hungraim.ltc.pojo.entity.eval;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName("CH_APR_PERSON_INFO")
@KeySequence(value = "SEQ_CH_APR_PERSON_INFO")
public class ChAprPersonInfo {
@TableId(value = "info_id", type = IdType.INPUT)
private Integer infoId;
private Integer empId;
private java.util.Date fCD;
private Integer fCU;
private Integer reportId;
}
......@@ -7,11 +7,11 @@ import java.util.Date;
@Data
public class TaskDistributionVO {
//鉴定任务id ch_apr_task
//鉴定任务id
private Integer taskId;
//任务明细id
private Integer applyId;
//适用机构 ch_apr_organ apr_organ_id
//适用机构
private String organName;
//机构代码
private String aprOrganId;
......@@ -19,7 +19,7 @@ public class TaskDistributionVO {
private String districtProvincial;
private String districPity;
private String districtArea;
//失能人员姓名 ch_disable_info
//失能人员姓名
private String realName;
//申请日期
@JsonFormat(pattern = "yyyy-MM-dd")
......@@ -29,7 +29,7 @@ public class TaskDistributionVO {
//年龄
@JsonFormat(pattern = "yyyy-MM-dd")
private Date birthday;//出生年月
//诊断疾病 CH_FND_DISEASE_TYPE
//诊断疾病
private String diseTypeF;//大类
private String diseTypeS;//小类
//失能人员联系电话
......@@ -42,7 +42,7 @@ public class TaskDistributionVO {
private String acptStreet;
//评定截止日期
private Date endTime;
//评定人员 ch_apr_emp emp_id
//评定人员
private String empRealName;
//评定人员手机号码
private String empTel;
......
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