Commit c666aadd authored by zhangch's avatar zhangch

评定人员页面相关接口

parent adc7107e
......@@ -4,7 +4,9 @@ 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 com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
@Data
@TableName("CH_APR_EMP")
......@@ -19,14 +21,20 @@ public class ChAprEmp {
private String certifTypeCode;
private String eduCode;
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 String gender;
private Integer defineEmp;
private Integer cfgModeId;
private Integer age;
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 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 String realName;
private Integer aprempTypeIdS;
......@@ -38,6 +46,8 @@ public class ChAprEmp {
private String tel;
private String certifTypeId;
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 Integer aprOrganId;
private Integer lcu;
......
......@@ -11,5 +11,7 @@ import java.util.List;
*/
@Data
public class AprEmpInfoVO extends ChAprEmp {
private String organId;
private String unifiedSocialCreditCode;
private List<ChFndAttach> fileDataList;
}
package com.hungraim.ltc.governance.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.governance.service.AprOrganService;
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.ChCfgAprempType;
import com.hungraim.ltc.pojo.entity.serviceManage.ChFndEducation;
......@@ -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
......@@ -221,28 +238,26 @@ public class AprOrganController {
/**
* 获取评定机构人员信息
*
* @param aprEmpId 评定机构人员id
* @param empId 评定机构人员id
* @return 返回相关信息
*/
@GetMapping("/getAprEmpInfo")
public Result<AprEmpInfoVO> getAprEmpInfo(Long aprEmpId) {
if (null == aprEmpId) {
public Result<AprEmpInfoVO> getAprEmpInfo(Long empId) {
if (null == empId) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
AprEmpInfoVO aprEmpInfoVO = aprOrganService.getAprEmpInfo(aprEmpId);
AprEmpInfoVO aprEmpInfoVO = aprOrganService.getAprEmpInfo(empId);
return Result.success(aprEmpInfoVO);
}
/**
* 新增评定机构人员或更新评定机构人员信息(有emp_id就更新,没有就新增)
*/
@DeleteMapping("/addOrUpdateAprEmp")
@PostMapping("/addOrUpdateAprEmp")
public Result addOrUpdateAprEmp(AprEmpInfoVO chAprEmp) {
if (chAprEmp == null) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (chAprEmp.getEmpId() == null) {
//新增
if (chAprEmp.getAprOrganId() == null) {//评定机构id
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
......@@ -264,6 +279,9 @@ public class AprOrganController {
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);
}
......@@ -276,18 +294,7 @@ public class AprOrganController {
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);
}
}
aprOrganService.addOrUpdateAprEmp(chAprEmp);
return Result.success();
}
......
package com.hungraim.ltc.governance.service;
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.serviceManage.ChAprOrgan;
import com.hungraim.ltc.pojo.entity.serviceManage.ChCfgAprOrganType;
import com.hungraim.ltc.pojo.entity.serviceManage.ChCfgAprempType;
import com.hungraim.ltc.pojo.entity.serviceManage.ChFndEducation;
......@@ -19,7 +21,7 @@ import java.util.List;
* @author czz
*/
@Service
public interface AprOrganService {
public interface AprOrganService extends IService<ChAprOrgan> {
Page<AprOrganVO> aprOrganList(Page<AprOrganVO> page, Long organId, Boolean isIncluded, String organName, String code);
void updateAprOrganStatus(String aprOrganId, Short status);
......
......@@ -2,6 +2,7 @@ package com.hungraim.ltc.governance.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.OrganFeignService;
import com.hungraim.ltc.governance.dao.*;
......@@ -35,7 +36,7 @@ import java.util.List;
@Service
@Slf4j
@AllArgsConstructor
public class AprOrganServiceImpl implements AprOrganService {
public class AprOrganServiceImpl extends ServiceImpl<AprOrganMapper, ChAprOrgan> implements AprOrganService {
private final OrganFeignService organFeignService;
private final AprOrganMapper aprOrganMapper;
......@@ -157,13 +158,13 @@ public class AprOrganServiceImpl implements AprOrganService {
aprEmpMapper.insert(chAprEmp);
} else {
//更新
ChAprEmp aprEmp = aprEmpMapper.selectById(chAprEmp.getEmpId());
aprEmp.setTel(chAprEmp.getTel());
aprEmp.setAprempTypeIdF(chAprEmp.getAprempTypeIdF());
aprEmp.setAprempTypeIdS(chAprEmp.getAprempTypeIdS());
aprEmp.setEduId(chAprEmp.getEduId());
aprEmpMapper.updateById(aprEmp);
chAprEmp.setEmpId(aprEmp.getEmpId());
// ChAprEmp aprEmp = aprEmpMapper.selectById(chAprEmp.getEmpId());
// aprEmp.setTel(chAprEmp.getTel());
// aprEmp.setAprempTypeIdF(chAprEmp.getAprempTypeIdF());
// aprEmp.setAprempTypeIdS(chAprEmp.getAprempTypeIdS());
// aprEmp.setEduId(chAprEmp.getEduId());
aprEmpMapper.updateById(chAprEmp);
chAprEmp.setEmpId(chAprEmp.getEmpId());
}
updateAttachs(chAprEmp.getFileDataList(), chAprEmp.getEmpId().longValue(), AttachType.APR_EMP.getUploadType());
}
......@@ -196,21 +197,25 @@ public class AprOrganServiceImpl implements AprOrganService {
@Override
public AprEmpInfoVO getAprEmpInfo(Long 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 {
// 返回对应的附件列表
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())) {
log.info("请求获取附件列表错误:错误码{},错误信息:{}", listResult.getCode(), listResult.getMsg());
}
aprEmpInfoVO.setFileDataList(listResult.getData());
} catch (Exception e) {
log.error(e.getMessage());
log.error("请求获取附件列表错误:,错误信息:{}", e.getMessage());
e.printStackTrace();
}
AprEmpInfoVO aprEmpInfoVO = new AprEmpInfoVO();
BeanUtils.copyProperties(chAprEmp, aprEmpInfoVO);
aprEmpInfoVO.setFileDataList(listResult.getData());
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