Commit c666aadd authored by zhangch's avatar zhangch

评定人员页面相关接口

parent adc7107e
...@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.annotation.IdType; ...@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
@Data @Data
@TableName("CH_APR_EMP") @TableName("CH_APR_EMP")
...@@ -19,14 +21,20 @@ public class ChAprEmp { ...@@ -19,14 +21,20 @@ public class ChAprEmp {
private String certifTypeCode; private String certifTypeCode;
private String eduCode; private String eduCode;
private Integer basicEmpId; private Integer basicEmpId;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private java.util.Date endTime; private java.util.Date endTime;
private String gender; private String gender;
private Integer defineEmp; private Integer defineEmp;
private Integer cfgModeId; private Integer cfgModeId;
private Integer age; private Integer age;
private Integer aprempTypeIdF; private Integer aprempTypeIdF;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private java.util.Date fcd; private java.util.Date fcd;
private Integer empType; private Integer empType;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private java.util.Date lcd; private java.util.Date lcd;
private String realName; private String realName;
private Integer aprempTypeIdS; private Integer aprempTypeIdS;
...@@ -38,6 +46,8 @@ public class ChAprEmp { ...@@ -38,6 +46,8 @@ public class ChAprEmp {
private String tel; private String tel;
private String certifTypeId; private String certifTypeId;
private Integer groupLeader; private Integer groupLeader;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private java.util.Date effTime; private java.util.Date effTime;
private Integer aprOrganId; private Integer aprOrganId;
private Integer lcu; private Integer lcu;
......
...@@ -11,5 +11,7 @@ import java.util.List; ...@@ -11,5 +11,7 @@ import java.util.List;
*/ */
@Data @Data
public class AprEmpInfoVO extends ChAprEmp { public class AprEmpInfoVO extends ChAprEmp {
private String organId;
private String unifiedSocialCreditCode;
private List<ChFndAttach> fileDataList; private List<ChFndAttach> fileDataList;
} }
package com.hungraim.ltc.governance.controller; package com.hungraim.ltc.governance.controller;
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.hungraim.ltc.governance.service.AprOrganService; import com.hungraim.ltc.governance.service.AprOrganService;
import com.hungraim.ltc.pojo.entity.assessment.ChCfgAprGroupDetail; import com.hungraim.ltc.pojo.entity.assessment.ChCfgAprGroupDetail;
import com.hungraim.ltc.pojo.entity.serviceManage.ChAprOrgan;
import com.hungraim.ltc.pojo.entity.serviceManage.ChCfgAprOrganType; import com.hungraim.ltc.pojo.entity.serviceManage.ChCfgAprOrganType;
import com.hungraim.ltc.pojo.entity.serviceManage.ChCfgAprempType; import com.hungraim.ltc.pojo.entity.serviceManage.ChCfgAprempType;
import com.hungraim.ltc.pojo.entity.serviceManage.ChFndEducation; import com.hungraim.ltc.pojo.entity.serviceManage.ChFndEducation;
...@@ -51,6 +53,21 @@ public class AprOrganController { ...@@ -51,6 +53,21 @@ public class AprOrganController {
} }
/** /**
* 通过organId获取aprOrgan集合
*
* @param organId 适用机构id
* @return 返回评定机构列表
*/
@GetMapping("/aprOrganListByOrganId")
public Result<List<ChAprOrgan>> getAprOrganListByOrganId(Long organId) {
if (null == organId) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
List<ChAprOrgan> list = aprOrganService.list(new LambdaQueryWrapper<ChAprOrgan>().eq(ChAprOrgan::getOrganId, organId));
return Result.success(list);
}
/**
* 获取评定机构信息 * 获取评定机构信息
* *
* @param aprOrganId 评定机构id * @param aprOrganId 评定机构id
...@@ -221,73 +238,63 @@ public class AprOrganController { ...@@ -221,73 +238,63 @@ public class AprOrganController {
/** /**
* 获取评定机构人员信息 * 获取评定机构人员信息
* *
* @param aprEmpId 评定机构人员id * @param empId 评定机构人员id
* @return 返回相关信息 * @return 返回相关信息
*/ */
@GetMapping("/getAprEmpInfo") @GetMapping("/getAprEmpInfo")
public Result<AprEmpInfoVO> getAprEmpInfo(Long aprEmpId) { public Result<AprEmpInfoVO> getAprEmpInfo(Long empId) {
if (null == aprEmpId) { if (null == empId) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
} }
AprEmpInfoVO aprEmpInfoVO = aprOrganService.getAprEmpInfo(aprEmpId); AprEmpInfoVO aprEmpInfoVO = aprOrganService.getAprEmpInfo(empId);
return Result.success(aprEmpInfoVO); return Result.success(aprEmpInfoVO);
} }
/** /**
* 新增评定机构人员或更新评定机构人员信息(有emp_id就更新,没有就新增) * 新增评定机构人员或更新评定机构人员信息(有emp_id就更新,没有就新增)
*/ */
@DeleteMapping("/addOrUpdateAprEmp") @PostMapping("/addOrUpdateAprEmp")
public Result addOrUpdateAprEmp(AprEmpInfoVO chAprEmp) { public Result addOrUpdateAprEmp(AprEmpInfoVO chAprEmp) {
if (chAprEmp == null) { if (chAprEmp == null) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
} }
if (chAprEmp.getEmpId() == null) { if (chAprEmp.getAprOrganId() == null) {//评定机构id
//新增 return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
if (chAprEmp.getAprOrganId() == null) {//评定机构id }
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); if (StringUtils.isBlank(chAprEmp.getRealName())) {//评定人员姓名
} return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
if (StringUtils.isBlank(chAprEmp.getRealName())) {//评定人员姓名 }
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); if (StringUtils.isBlank(chAprEmp.getCertifTypeId())) {//评定人员证件类型
} return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
if (StringUtils.isBlank(chAprEmp.getCertifTypeId())) {//评定人员证件类型 }
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); if (StringUtils.isBlank(chAprEmp.getCertiCode())) {//评定人员证件号码
} return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
if (StringUtils.isBlank(chAprEmp.getCertiCode())) {//评定人员证件号码 }
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); if (StringUtils.isBlank(chAprEmp.getGender())) {//评定人员性别
} return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
if (StringUtils.isBlank(chAprEmp.getGender())) {//评定人员性别
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (chAprEmp.getAge() == null) {//评定人员年龄
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (StringUtils.isBlank(chAprEmp.getTel())) {//评定人员手机号码
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (StringUtils.isBlank(chAprEmp.getAprempTypeNameF()) || StringUtils.isBlank(chAprEmp.getAprempTypeNameS())) {//评定人员资质
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (chAprEmp.getEmpType() == null) {//评定人员类型
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (chAprEmp.getEduId() == null) {//评定人员文化水平
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (chAprEmp.getGroupLeader() == null) {//评定人员是否是组长
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
} else {
//更新
if (StringUtils.isBlank(chAprEmp.getTel())) {//评定人员手机号码
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (chAprEmp.getAprempTypeIdF() == null || chAprEmp.getAprempTypeIdS() == null) {//评定人员资质
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (chAprEmp.getEduId() == null) {//评定人员文化水平
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
} }
if (chAprEmp.getAge() == null) {//评定人员年龄
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (StringUtils.isBlank(chAprEmp.getTel())) {//评定人员手机号码
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (null == chAprEmp.getAprempTypeIdF() || null == chAprEmp.getAprempTypeIdS()) {//评定人员资质id
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (StringUtils.isBlank(chAprEmp.getAprempTypeNameF()) || StringUtils.isBlank(chAprEmp.getAprempTypeNameS())) {//评定人员资质
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (chAprEmp.getEmpType() == null) {//评定人员类型
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (chAprEmp.getEduId() == null) {//评定人员文化水平
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (chAprEmp.getGroupLeader() == null) {//评定人员是否是组长
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
aprOrganService.addOrUpdateAprEmp(chAprEmp); aprOrganService.addOrUpdateAprEmp(chAprEmp);
return Result.success(); return Result.success();
} }
......
package com.hungraim.ltc.governance.service; package com.hungraim.ltc.governance.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hungraim.ltc.pojo.entity.assessment.ChCfgAprGroupDetail; import com.hungraim.ltc.pojo.entity.assessment.ChCfgAprGroupDetail;
import com.hungraim.ltc.pojo.entity.serviceManage.ChAprOrgan;
import com.hungraim.ltc.pojo.entity.serviceManage.ChCfgAprOrganType; import com.hungraim.ltc.pojo.entity.serviceManage.ChCfgAprOrganType;
import com.hungraim.ltc.pojo.entity.serviceManage.ChCfgAprempType; import com.hungraim.ltc.pojo.entity.serviceManage.ChCfgAprempType;
import com.hungraim.ltc.pojo.entity.serviceManage.ChFndEducation; import com.hungraim.ltc.pojo.entity.serviceManage.ChFndEducation;
...@@ -19,7 +21,7 @@ import java.util.List; ...@@ -19,7 +21,7 @@ import java.util.List;
* @author czz * @author czz
*/ */
@Service @Service
public interface AprOrganService { public interface AprOrganService extends IService<ChAprOrgan> {
Page<AprOrganVO> aprOrganList(Page<AprOrganVO> page, Long organId, Boolean isIncluded, String organName, String code); Page<AprOrganVO> aprOrganList(Page<AprOrganVO> page, Long organId, Boolean isIncluded, String organName, String code);
void updateAprOrganStatus(String aprOrganId, Short status); void updateAprOrganStatus(String aprOrganId, Short status);
......
...@@ -2,6 +2,7 @@ package com.hungraim.ltc.governance.service.impl; ...@@ -2,6 +2,7 @@ package com.hungraim.ltc.governance.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.hungraim.ltc.api.AttachFeignService; import com.hungraim.ltc.api.AttachFeignService;
import com.hungraim.ltc.api.OrganFeignService; import com.hungraim.ltc.api.OrganFeignService;
import com.hungraim.ltc.governance.dao.*; import com.hungraim.ltc.governance.dao.*;
...@@ -35,7 +36,7 @@ import java.util.List; ...@@ -35,7 +36,7 @@ import java.util.List;
@Service @Service
@Slf4j @Slf4j
@AllArgsConstructor @AllArgsConstructor
public class AprOrganServiceImpl implements AprOrganService { public class AprOrganServiceImpl extends ServiceImpl<AprOrganMapper, ChAprOrgan> implements AprOrganService {
private final OrganFeignService organFeignService; private final OrganFeignService organFeignService;
private final AprOrganMapper aprOrganMapper; private final AprOrganMapper aprOrganMapper;
...@@ -157,13 +158,13 @@ public class AprOrganServiceImpl implements AprOrganService { ...@@ -157,13 +158,13 @@ public class AprOrganServiceImpl implements AprOrganService {
aprEmpMapper.insert(chAprEmp); aprEmpMapper.insert(chAprEmp);
} else { } else {
//更新 //更新
ChAprEmp aprEmp = aprEmpMapper.selectById(chAprEmp.getEmpId()); // ChAprEmp aprEmp = aprEmpMapper.selectById(chAprEmp.getEmpId());
aprEmp.setTel(chAprEmp.getTel()); // aprEmp.setTel(chAprEmp.getTel());
aprEmp.setAprempTypeIdF(chAprEmp.getAprempTypeIdF()); // aprEmp.setAprempTypeIdF(chAprEmp.getAprempTypeIdF());
aprEmp.setAprempTypeIdS(chAprEmp.getAprempTypeIdS()); // aprEmp.setAprempTypeIdS(chAprEmp.getAprempTypeIdS());
aprEmp.setEduId(chAprEmp.getEduId()); // aprEmp.setEduId(chAprEmp.getEduId());
aprEmpMapper.updateById(aprEmp); aprEmpMapper.updateById(chAprEmp);
chAprEmp.setEmpId(aprEmp.getEmpId()); chAprEmp.setEmpId(chAprEmp.getEmpId());
} }
updateAttachs(chAprEmp.getFileDataList(), chAprEmp.getEmpId().longValue(), AttachType.APR_EMP.getUploadType()); updateAttachs(chAprEmp.getFileDataList(), chAprEmp.getEmpId().longValue(), AttachType.APR_EMP.getUploadType());
} }
...@@ -196,21 +197,25 @@ public class AprOrganServiceImpl implements AprOrganService { ...@@ -196,21 +197,25 @@ public class AprOrganServiceImpl implements AprOrganService {
@Override @Override
public AprEmpInfoVO getAprEmpInfo(Long aprEmpId) { public AprEmpInfoVO getAprEmpInfo(Long aprEmpId) {
ChAprEmp chAprEmp = aprEmpMapper.selectById(aprEmpId); ChAprEmp chAprEmp = aprEmpMapper.selectById(aprEmpId);
Integer aprOrganId = chAprEmp.getAprOrganId();
ChAprOrgan chAprOrgan = aprOrganMapper.selectById(aprOrganId);
String organId = chAprOrgan.getOrganId();
AprEmpInfoVO aprEmpInfoVO = new AprEmpInfoVO();
BeanUtils.copyProperties(chAprEmp, aprEmpInfoVO);
aprEmpInfoVO.setOrganId(organId);
aprEmpInfoVO.setUnifiedSocialCreditCode(chAprOrgan.getUnifiedSocialCreditCode());
//查询附件列表 //查询附件列表
Result<List<ChFndAttach>> listResult = null;
try { try {
// 返回对应的附件列表 // 返回对应的附件列表 调用文件服务获取对应文件,出错或未获取到就只是相当于没有设置对应的数据,减少系统之间的耦合性
listResult = attachFeignService.selectAttachs(aprEmpId, AttachType.APR_EMP.getUploadType()); Result<List<ChFndAttach>> listResult = attachFeignService.selectAttachs(aprEmpId, AttachType.APR_EMP.getUploadType());
if (!listResult.getCode().equals(ResultCode.SUCCESS.getCode())) { if (!listResult.getCode().equals(ResultCode.SUCCESS.getCode())) {
log.info("请求获取附件列表错误:错误码{},错误信息:{}", listResult.getCode(), listResult.getMsg()); log.info("请求获取附件列表错误:错误码{},错误信息:{}", listResult.getCode(), listResult.getMsg());
} }
aprEmpInfoVO.setFileDataList(listResult.getData());
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage()); log.error("请求获取附件列表错误:,错误信息:{}", e.getMessage());
e.printStackTrace(); e.printStackTrace();
} }
AprEmpInfoVO aprEmpInfoVO = new AprEmpInfoVO();
BeanUtils.copyProperties(chAprEmp, aprEmpInfoVO);
aprEmpInfoVO.setFileDataList(listResult.getData());
return aprEmpInfoVO; return aprEmpInfoVO;
} }
......
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