Commit 35ca55cb authored by 蔡镇泽's avatar 蔡镇泽

通过报告id查询评定报告人员信息

parent 63252d71
package com.hungraim.ltc.controller; package com.hungraim.ltc.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hungraim.ltc.pojo.entity.assessment.ChAprPersonInfo;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel; import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel;
import com.hungraim.ltc.pojo.vo.assessment.AprEmpVO; import com.hungraim.ltc.pojo.vo.assessment.AprEmpVO;
import com.hungraim.ltc.pojo.vo.assessment.TaskDistributionVO; import com.hungraim.ltc.pojo.vo.assessment.TaskDistributionVO;
...@@ -82,6 +83,17 @@ public class TaskController { ...@@ -82,6 +83,17 @@ public class TaskController {
} }
/** /**
* 通过报告id查询评定报告人员信息
*
* @param reportId 评定报告id
*/
@RequestMapping("/personInfoList")
public Result<List<ChAprPersonInfo>> personInfoList(String reportId) {
List<ChAprPersonInfo> list = taskService.personInfoList(reportId);
return Result.success(list);
}
/**
* 查询评定人员列表 * 查询评定人员列表
* *
* @param organName 评定机构名称 * @param organName 评定机构名称
...@@ -91,8 +103,8 @@ public class TaskController { ...@@ -91,8 +103,8 @@ public class TaskController {
*/ */
@RequestMapping("/aprEmpList") @RequestMapping("/aprEmpList")
public Result<List<AprEmpVO>> aprEmpList(String organName, String name, String tel, String groupLeader) { public Result<List<AprEmpVO>> aprEmpList(String organName, String name, String tel, String groupLeader) {
List<AprEmpVO> aprEmpVOS = taskService.aprEmpList(organName, name, tel, groupLeader); List<AprEmpVO> aprEmpS = taskService.aprEmpList(organName, name, tel, groupLeader);
return Result.success(aprEmpVOS); return Result.success(aprEmpS);
} }
/** /**
......
...@@ -10,5 +10,5 @@ import org.springframework.stereotype.Repository; ...@@ -10,5 +10,5 @@ import org.springframework.stereotype.Repository;
*/ */
@Mapper @Mapper
@Repository @Repository
public interface AprPeronInfoMapper extends BaseMapper<ChAprPersonInfo> { public interface AprPersonInfoMapper extends BaseMapper<ChAprPersonInfo> {
} }
package com.hungraim.ltc.service; package com.hungraim.ltc.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hungraim.ltc.pojo.entity.assessment.ChAprPersonInfo;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel; import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel;
import com.hungraim.ltc.pojo.vo.assessment.AprEmpVO; import com.hungraim.ltc.pojo.vo.assessment.AprEmpVO;
import com.hungraim.ltc.pojo.vo.assessment.TaskDistributionVO; import com.hungraim.ltc.pojo.vo.assessment.TaskDistributionVO;
...@@ -65,4 +66,6 @@ public interface TaskService { ...@@ -65,4 +66,6 @@ public interface TaskService {
Result<Object> taskGroup(Integer pushId, Integer status); Result<Object> taskGroup(Integer pushId, Integer status);
List<ChCfgSrvDisableLevel> cfgSrvDisableLevelList(); List<ChCfgSrvDisableLevel> cfgSrvDisableLevelList();
List<ChAprPersonInfo> personInfoList(String reportId);
} }
...@@ -36,7 +36,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -36,7 +36,7 @@ public class TaskServiceImpl implements TaskService {
@Autowired @Autowired
private TaskEmpMapper taskEmpMapper; private TaskEmpMapper taskEmpMapper;
@Autowired @Autowired
private AprPeronInfoMapper peronInfoMapper; private AprPersonInfoMapper personInfoMapper;
@Autowired @Autowired
private TaskPushMapper taskPushMapper; private TaskPushMapper taskPushMapper;
@Autowired @Autowired
...@@ -81,20 +81,20 @@ public class TaskServiceImpl implements TaskService { ...@@ -81,20 +81,20 @@ public class TaskServiceImpl implements TaskService {
person1Info.setReportId(report.getReportId()); person1Info.setReportId(report.getReportId());
person1Info.setEmpId(person1); person1Info.setEmpId(person1);
person1Info.setFcd(new Date()); person1Info.setFcd(new Date());
peronInfoMapper.insert(person1Info); personInfoMapper.insert(person1Info);
if (person2 != null) { if (person2 != null) {
ChAprPersonInfo personInfo = new ChAprPersonInfo(); ChAprPersonInfo personInfo = new ChAprPersonInfo();
personInfo.setReportId(report.getReportId()); personInfo.setReportId(report.getReportId());
personInfo.setEmpId(person1); personInfo.setEmpId(person1);
personInfo.setFcd(new Date()); personInfo.setFcd(new Date());
peronInfoMapper.insert(personInfo); personInfoMapper.insert(personInfo);
} }
if (person3 != null) { if (person3 != null) {
ChAprPersonInfo personInfo = new ChAprPersonInfo(); ChAprPersonInfo personInfo = new ChAprPersonInfo();
personInfo.setReportId(report.getReportId()); personInfo.setReportId(report.getReportId());
personInfo.setEmpId(person1); personInfo.setEmpId(person1);
personInfo.setFcd(new Date()); personInfo.setFcd(new Date());
peronInfoMapper.insert(personInfo); personInfoMapper.insert(personInfo);
} }
} }
...@@ -108,44 +108,44 @@ public class TaskServiceImpl implements TaskService { ...@@ -108,44 +108,44 @@ public class TaskServiceImpl implements TaskService {
chAprReport.setEvaluateTime(evaluateDate); chAprReport.setEvaluateTime(evaluateDate);
aprReportMapper.updateById(chAprReport); aprReportMapper.updateById(chAprReport);
//修改鉴定报告人员(有就update,没有就insert) //修改鉴定报告人员(有就update,没有就insert)
List<ChAprPersonInfo> personInfos = peronInfoMapper.selectList(new QueryWrapper<ChAprPersonInfo>().eq("report_id", reportId)); List<ChAprPersonInfo> personInfos = personInfoMapper.selectList(new QueryWrapper<ChAprPersonInfo>().eq("report_id", reportId));
if (person1 != null) { if (person1 != null) {
if (personInfos.size() >= 1) { if (personInfos.size() >= 1) {
ChAprPersonInfo personInfo = personInfos.get(0); ChAprPersonInfo personInfo = personInfos.get(0);
personInfo.setEmpId(person1); personInfo.setEmpId(person1);
peronInfoMapper.updateById(personInfo); personInfoMapper.updateById(personInfo);
} else { } else {
ChAprPersonInfo personInfo = new ChAprPersonInfo(); ChAprPersonInfo personInfo = new ChAprPersonInfo();
personInfo.setReportId(chAprReport.getReportId()); personInfo.setReportId(chAprReport.getReportId());
personInfo.setEmpId(person1); personInfo.setEmpId(person1);
personInfo.setFcd(new Date()); personInfo.setFcd(new Date());
peronInfoMapper.insert(personInfo); personInfoMapper.insert(personInfo);
} }
} }
if (person2 != null) { if (person2 != null) {
if (personInfos.size() >= 2) { if (personInfos.size() >= 2) {
ChAprPersonInfo personInfo = personInfos.get(0); ChAprPersonInfo personInfo = personInfos.get(0);
personInfo.setEmpId(person2); personInfo.setEmpId(person2);
peronInfoMapper.updateById(personInfo); personInfoMapper.updateById(personInfo);
} else { } else {
ChAprPersonInfo personInfo = new ChAprPersonInfo(); ChAprPersonInfo personInfo = new ChAprPersonInfo();
personInfo.setReportId(chAprReport.getReportId()); personInfo.setReportId(chAprReport.getReportId());
personInfo.setEmpId(person2); personInfo.setEmpId(person2);
personInfo.setFcd(new Date()); personInfo.setFcd(new Date());
peronInfoMapper.insert(personInfo); personInfoMapper.insert(personInfo);
} }
} }
if (person3 != null) { if (person3 != null) {
if (personInfos.size() >= 3) { if (personInfos.size() >= 3) {
ChAprPersonInfo personInfo = personInfos.get(0); ChAprPersonInfo personInfo = personInfos.get(0);
personInfo.setEmpId(person3); personInfo.setEmpId(person3);
peronInfoMapper.updateById(personInfo); personInfoMapper.updateById(personInfo);
} else { } else {
ChAprPersonInfo personInfo = new ChAprPersonInfo(); ChAprPersonInfo personInfo = new ChAprPersonInfo();
personInfo.setReportId(chAprReport.getReportId()); personInfo.setReportId(chAprReport.getReportId());
personInfo.setEmpId(person3); personInfo.setEmpId(person3);
personInfo.setFcd(new Date()); personInfo.setFcd(new Date());
peronInfoMapper.insert(personInfo); personInfoMapper.insert(personInfo);
} }
} }
} }
...@@ -158,12 +158,14 @@ public class TaskServiceImpl implements TaskService { ...@@ -158,12 +158,14 @@ public class TaskServiceImpl implements TaskService {
return Result.failed("评定人员必须是组长!"); return Result.failed("评定人员必须是组长!");
} }
String[] taskIds = taskId.split(","); String[] taskIds = taskId.split(",");
Date assignTime = new Date();//任务分配日期
for (String id : taskIds) { for (String id : taskIds) {
ChAprTask task = taskMapper.selectById(id); ChAprTask task = taskMapper.selectById(id);
if (task == null) { if (task == null) {
return Result.failed("无效的taskId!"); return Result.failed("无效的taskId!");
} }
task.setAprEmpId(empId); task.setAprEmpId(empId);
task.setAssignTime(assignTime);
int count = taskMapper.updateById(task); int count = taskMapper.updateById(task);
if (count != 1) { if (count != 1) {
return Result.failed("修改失败!"); return Result.failed("修改失败!");
...@@ -201,4 +203,9 @@ public class TaskServiceImpl implements TaskService { ...@@ -201,4 +203,9 @@ public class TaskServiceImpl implements TaskService {
public List<ChCfgSrvDisableLevel> cfgSrvDisableLevelList() { public List<ChCfgSrvDisableLevel> cfgSrvDisableLevelList() {
return cfgSrvDisableLevelMapper.selectList(new QueryWrapper<>()); return cfgSrvDisableLevelMapper.selectList(new QueryWrapper<>());
} }
@Override
public List<ChAprPersonInfo> personInfoList(String reportId) {
return personInfoMapper.selectList(new QueryWrapper<ChAprPersonInfo>().eq("report_id", reportId));
}
} }
\ No newline at end of file
...@@ -113,13 +113,13 @@ ...@@ -113,13 +113,13 @@
LEFT JOIN CH_APR_ORGAN organ ON task.APR_ORGAN_ID = organ.APR_ORGAN_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_DISABLE_RISK_LEVEL lev ON report.DISABLE_LEVEL_ID = lev.DISA_RISK_LEVEL_ID
<where> <where>
<if test="name != null and name == ''"> <if test="name != null and name != ''">
and info.REAL_NAME like CONCAT(CONCAT('%',#{name}) ,'%') and info.REAL_NAME like CONCAT(CONCAT('%',#{name}) ,'%')
</if> </if>
<if test="certiCode != null and certiCode == ''"> <if test="certiCode != null and certiCode != ''">
and info.CERTI_CODE = #{certiCode} and info.CERTI_CODE = #{certiCode}
</if> </if>
<if test="tel != null and tel == ''"> <if test="tel != null and tel != ''">
and info.tel = #{tel} and info.tel = #{tel}
</if> </if>
</where> </where>
...@@ -145,13 +145,13 @@ ...@@ -145,13 +145,13 @@
LEFT JOIN ch_apr_emp emp on task.apr_emp_id = emp.emp_id LEFT JOIN ch_apr_emp emp on task.apr_emp_id = emp.emp_id
LEFT JOIN CH_APR_ORGAN emp_organ on emp.apr_organ_id = emp_organ.apr_organ_id LEFT JOIN CH_APR_ORGAN emp_organ on emp.apr_organ_id = emp_organ.apr_organ_id
<where> <where>
<if test="name != null and name == ''"> <if test="name != null and name != ''">
and emp.REAL_NAME like CONCAT(CONCAT('%',#{name}) ,'%') and emp.REAL_NAME like CONCAT(CONCAT('%',#{name}) ,'%')
</if> </if>
<if test="certiCode != null and certiCode == ''"> <if test="certiCode != null and certiCode != ''">
and emp.CERTI_CODE = #{certiCode} and emp.CERTI_CODE = #{certiCode}
</if> </if>
<if test="tel != null and tel == ''"> <if test="tel != null and tel != ''">
and emp.tel = #{tel} and emp.tel = #{tel}
</if> </if>
</where> </where>
...@@ -176,16 +176,16 @@ ...@@ -176,16 +176,16 @@
LEFT JOIN ch_apr_organ organ ON emp.apr_organ_id = organ.apr_organ_id LEFT JOIN ch_apr_organ organ ON emp.apr_organ_id = organ.apr_organ_id
LEFT JOIN ch_srv_organ srvOrgan ON organ.organ_id = srvOrgan.srv_organ_id LEFT JOIN ch_srv_organ srvOrgan ON organ.organ_id = srvOrgan.srv_organ_id
<where> <where>
<if test="organName != null and organName == ''"> <if test="organName != null and organName != ''">
and organ.organ_name like CONCAT(CONCAT('%',#{organName}) ,'%') and organ.organ_name like CONCAT(CONCAT('%',#{organName}) ,'%')
</if> </if>
<if test="name != null and name == ''"> <if test="name != null and name != ''">
and emp.real_name like CONCAT(CONCAT('%',#{name}) ,'%') and emp.real_name like CONCAT(CONCAT('%',#{name}) ,'%')
</if> </if>
<if test="tel != null and tel == ''"> <if test="tel != null and tel != ''">
and emp.tel = #{tel} and emp.tel = #{tel}
</if> </if>
<if test="groupLeader != null and groupLeader == ''"> <if test="groupLeader != null and groupLeader != ''">
and emp.Group_leader = #{groupLeader} and emp.Group_leader = #{groupLeader}
</if> </if>
</where> </where>
......
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