Commit c78fc1fe by jianan

生成pdf后放至oss,ydlife查询经纪人合同

parent 02cf64fd
...@@ -18,8 +18,7 @@ public class PractitionerHiringController { ...@@ -18,8 +18,7 @@ public class PractitionerHiringController {
@Autowired @Autowired
private PractitionerHiringService practitionerHiringService; private PractitionerHiringService practitionerHiringService;
@Autowired
private PractitionerHiringContractService hiringContractService;
/** /**
* 保存报聘经纪人组织关系 * 保存报聘经纪人组织关系
...@@ -236,19 +235,26 @@ public class PractitionerHiringController { ...@@ -236,19 +235,26 @@ public class PractitionerHiringController {
* @param requestVO 请求数据 * @param requestVO 请求数据
* @return 响应数据 * @return 响应数据
*/ */
@RequestMapping("/hiringPDF") @RequestMapping("/generatePDF")
public Object hiringApprove(@RequestBody HiringPDFRequestVO requestVO){ public Object generatePDF(@RequestBody GeneratePDFRequestVO requestVO){
JsonResult result = new JsonResult(); JsonResult result = new JsonResult();
try { GeneratePDFResponseVO responseVO = practitionerHiringService.generatePDF(requestVO);
// PractitionerPDFTest.main(null); result.addResult(responseVO);
Long hiringBasicInfoId = requestVO.getHiringBasicInfoId(); result.setData(responseVO);
hiringContractService.generatePractitionerContract(hiringBasicInfoId); return result;
} catch (Exception e) {
e.printStackTrace();
} }
/**
* 报聘成功后查看经纪人信息
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/queryPractitionerInfo")
public Object queryPractitionerInfo(@RequestBody QueryPractitionerInfoRequestVO requestVO){
JsonResult result = new JsonResult();
QueryPractitionerInfoResponseVO responseVO = practitionerHiringService.queryPractitionerInfo(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result; return result;
} }
} }
\ No newline at end of file
package com.yd.api.practitioner.service; package com.yd.api.practitioner.service;
import com.yd.api.practitioner.vo.hiring.GeneratePDFRequestVO;
import java.util.Map; import java.util.Map;
public interface PractitionerHiringContractService { public interface PractitionerHiringContractService {
String generatePractitionerContract(Long hiringBasicInfoId); String generatePractitionerContract(String practitionerNO, String contractNo, Long hiringBasicInfoId) throws Exception;
Map<String, String> initHiringBasicInfoData(Long hiringBasicInfoId); Map<String, String> initHiringBasicInfoData(Long hiringBasicInfoId);
......
...@@ -53,4 +53,7 @@ public interface PractitionerHiringService { ...@@ -53,4 +53,7 @@ public interface PractitionerHiringService {
SavePayrollPictureResponseVO savePayrollPicture(SavePayRollPictureRequestVO requestVO); SavePayrollPictureResponseVO savePayrollPicture(SavePayRollPictureRequestVO requestVO);
GeneratePDFResponseVO generatePDF(GeneratePDFRequestVO requestVO);
QueryPractitionerInfoResponseVO queryPractitionerInfo(QueryPractitionerInfoRequestVO requestVO);
} }
package com.yd.api.practitioner.service.impl; package com.yd.api.practitioner.service.impl;
import com.yd.api.practitioner.service.PractitionerHiringContractService;
import com.yd.api.practitioner.service.PractitionerHiringService; import com.yd.api.practitioner.service.PractitionerHiringService;
import com.yd.api.practitioner.vo.hiring.*; import com.yd.api.practitioner.vo.hiring.*;
import com.yd.api.result.CommonResult; import com.yd.api.result.CommonResult;
...@@ -47,6 +48,10 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService ...@@ -47,6 +48,10 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
private AclPractitionerHiringContractTermsConfirmsMapper contractTermsConfirmsMapper; private AclPractitionerHiringContractTermsConfirmsMapper contractTermsConfirmsMapper;
@Autowired @Autowired
private AclPractitionerHiringApproveRecordsMapper recordsMapper; private AclPractitionerHiringApproveRecordsMapper recordsMapper;
@Autowired
private PractitionerHiringContractService hiringContractService;
@Autowired
private AclPractitionerMapper aclPractitionerMapper;
private PractitionerHiringDALService practitionerHiringDalService; private PractitionerHiringDALService practitionerHiringDalService;
private SystemConfigService systemConfigService; private SystemConfigService systemConfigService;
...@@ -474,14 +479,14 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService ...@@ -474,14 +479,14 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
//余下的仅有0.不可审批(未到) 1.可审批两种状态 //余下的仅有0.不可审批(未到) 1.可审批两种状态
//approvalIdentity的参数意义0.既是辅导人又是团队长 1.辅导人 2.团队长 //approvalIdentity的参数意义0.既是辅导人又是团队长 1.辅导人 2.团队长
//当approvalIdentity为0,1时,审批状态为可审批 当为2时判断辅导人是否审批 //当approvalIdentity为0,1时,审批状态为可审批 当为2时判断辅导人是否审批
if (approvalIdentity == 0 || approvalIdentity == 1){ if (approvalIdentity == 0 || approvalIdentity == 1) {
hiringApproveStatus = 1L; hiringApproveStatus = 1L;
hiringApproveStepsSeq = 1L; hiringApproveStepsSeq = 1L;
}else { } else {
//判断辅导人是否审批,仅需判断hiringApproveRecordsList.isEmpty(),因为辅导人是第一步,团队长为第二步 //判断辅导人是否审批,仅需判断hiringApproveRecordsList.isEmpty(),因为辅导人是第一步,团队长为第二步
if (hiringApproveRecordsList.isEmpty()) { if (hiringApproveRecordsList.isEmpty()) {
hiringApproveStatus = 0L; hiringApproveStatus = 0L;
}else { } else {
hiringApproveStatus = 1L; hiringApproveStatus = 1L;
hiringApproveStepsSeq = 2L; hiringApproveStepsSeq = 2L;
} }
...@@ -497,15 +502,15 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService ...@@ -497,15 +502,15 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
List<MdPractitionerHiringApproveSteps> hiringApproveStepsList = systemConfigService.findHiringApproveStepsAll(); List<MdPractitionerHiringApproveSteps> hiringApproveStepsList = systemConfigService.findHiringApproveStepsAll();
List<AclPractitionerHiringApproveRecords> hiringApproveRecordsList = new ArrayList<>(); List<AclPractitionerHiringApproveRecords> hiringApproveRecordsList = new ArrayList<>();
//当approvalIdentity=0时需要保存两条记录 //当approvalIdentity=0时需要保存两条记录
if (approvalIdentity == 0L || approvalIdentity == 1L){ if (approvalIdentity == 0L || approvalIdentity == 1L) {
boolean hasStepSeq = addStepToList(requestVO,1,hiringApproveStepsList,hiringApproveRecordsList); boolean hasStepSeq = addStepToList(requestVO, 1, hiringApproveStepsList, hiringApproveRecordsList);
if (!hasStepSeq) { if (!hasStepSeq) {
responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("830025"))); responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("830025")));
return responseVO; return responseVO;
} }
} }
if (approvalIdentity == 0L || approvalIdentity == 2L){ if (approvalIdentity == 0L || approvalIdentity == 2L) {
boolean hasStepSeq = addStepToList(requestVO,2,hiringApproveStepsList,hiringApproveRecordsList); boolean hasStepSeq = addStepToList(requestVO, 2, hiringApproveStepsList, hiringApproveRecordsList);
if (!hasStepSeq) { if (!hasStepSeq) {
responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("830025"))); responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("830025")));
return responseVO; return responseVO;
...@@ -678,6 +683,65 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService ...@@ -678,6 +683,65 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
return resp; return resp;
} }
@Override
public GeneratePDFResponseVO generatePDF(GeneratePDFRequestVO requestVO) {
GeneratePDFResponseVO resp = new GeneratePDFResponseVO();
try {
Long hiringBasicInfoId = requestVO.getHiringBasicInfoId();
Long practitionerId = requestVO.getPractitionerId();
if (hiringBasicInfoId == null) {
resp.setCommonResult(new CommonResult(true, "此经纪人无电子合同"));
return resp;
}
AclPractitioner practitioner = aclPractitionerMapper.selectByPrimaryKey(practitionerId);
String practitionerCode = practitioner == null ? null : practitioner.getPractitionerCode();
String contractNo = practitioner == null ? null : practitioner.getContractNo();
if (StringUtils.isEmpty(practitionerCode) || StringUtils.isEmpty(contractNo)) {
resp.setCommonResult(new CommonResult(true, "内部编号和员工合同编号不能为空,请注意保存"));
return resp;
}
String contractOssPath = hiringContractService.generatePractitionerContract(practitionerCode, contractNo, hiringBasicInfoId);
//4、经纪人表生成经纪人记录ag_acl_practitioner,ag_acl_practitioner.contract_oss_path
// 经纪人经纪人类型级别定义表ag_acl_practitioner_setting
AclPractitioner updateObj = new AclPractitioner();
updateObj.setId(practitionerId);
updateObj.setContractOssPath(contractOssPath);
aclPractitionerMapper.updateByPrimaryKeySelective(updateObj);
resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
resp.setContractOssPath(contractOssPath);
} catch (Exception e) {
e.printStackTrace();
resp.setCommonResult(new CommonResult(false, e.getMessage()));
}
return resp;
}
@Override
public QueryPractitionerInfoResponseVO queryPractitionerInfo(QueryPractitionerInfoRequestVO requestVO) {
QueryPractitionerInfoResponseVO resp = new QueryPractitionerInfoResponseVO();
try {
Long practitionerId = requestVO.getPractitionerId();
if (practitionerId == null) {
resp.setCommonResult(new CommonResult(false, "practitionerId不能为空"));
} else {
AclPractitioner practitioner = aclPractitionerMapper.selectByPrimaryKey(practitionerId);
resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
resp.setPractitioner(practitioner);
}
} catch (Exception e) {
e.printStackTrace();
resp.setCommonResult(new CommonResult(false, e.getMessage()));
}
return resp;
}
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private boolean addStepToList(HiringApproveRequestVO requestVO, private boolean addStepToList(HiringApproveRequestVO requestVO,
int stepSeq, int stepSeq,
...@@ -731,7 +795,7 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService ...@@ -731,7 +795,7 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
private String generateKey(int targetUseFor) { private String generateKey(int targetUseFor) {
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd"); SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
return targetUseFor+sdf.format(new Date()); return targetUseFor + sdf.format(new Date());
} }
} }
...@@ -3,7 +3,7 @@ package com.yd.api.practitioner.vo.hiring; ...@@ -3,7 +3,7 @@ package com.yd.api.practitioner.vo.hiring;
import lombok.Data; import lombok.Data;
@Data @Data
public class HiringPDFRequestVO { public class GeneratePDFRequestVO {
/** /**
* 经纪人id * 经纪人id
*/ */
......
package com.yd.api.practitioner.vo.hiring;
import com.yd.api.result.CommonResult;
import lombok.Data;
@Data
public class GeneratePDFResponseVO {
private CommonResult commonResult;
private String contractOssPath;
}
package com.yd.api.practitioner.vo.hiring;
import lombok.Data;
@Data
public class QueryPractitionerInfoRequestVO {
/**
* 经纪人id
*/
private Long practitionerId;
}
package com.yd.api.practitioner.vo.hiring;
import com.yd.api.result.CommonResult;
import com.yd.dal.entity.customer.AclPractitioner;
import lombok.Data;
@Data
public class QueryPractitionerInfoResponseVO {
private CommonResult commonResult;
private AclPractitioner practitioner;
}
...@@ -202,5 +202,20 @@ public class AclPractitioner implements Serializable { ...@@ -202,5 +202,20 @@ public class AclPractitioner implements Serializable {
*/ */
private Integer gender; private Integer gender;
/**
* 经纪人合同号
*/
private String contractNo;
/**
* 经纪人PDF合同地址
*/
private String contractOssPath;
/**
* 经纪人报聘信息表id
*/
private String hiringBasicInfoId;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -41,6 +41,9 @@ ...@@ -41,6 +41,9 @@
<result column="mentor_id" jdbcType="BIGINT" property="mentorId" /> <result column="mentor_id" jdbcType="BIGINT" property="mentorId" />
<result column="introducer_id" jdbcType="BIGINT" property="introducerId" /> <result column="introducer_id" jdbcType="BIGINT" property="introducerId" />
<result column="gender" jdbcType="INTEGER" property="gender" /> <result column="gender" jdbcType="INTEGER" property="gender" />
<result column="contract_no" jdbcType="VARCHAR" property="contractNo" />
<result column="contract_oss_path" jdbcType="VARCHAR" property="contractOssPath" />
<result column="hiring_basic_info_id" jdbcType="BIGINT" property="hiringBasicInfoId" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, insurer_id, insurer_branch_id, dept_id, subordinate_system_id, practitioner_code, id, insurer_id, insurer_branch_id, dept_id, subordinate_system_id, practitioner_code,
...@@ -48,7 +51,8 @@ ...@@ -48,7 +51,8 @@
practitioner_reg_company, effective_start_date, effective_end_date, remark, customer_id, practitioner_reg_company, effective_start_date, effective_end_date, remark, customer_id,
employee_no, is_active, created_at, created_by, updated_at, updated_by, province_id, employee_no, is_active, created_at, created_by, updated_at, updated_by, province_id,
province_name, city_id, city_name, cert_list, bio_intro, wechat_id, qq_id, is_profile_show, province_name, city_id, city_name, cert_list, bio_intro, wechat_id, qq_id, is_profile_show,
is_name_show, is_mobile_show, education_level, mentor_id, introducer_id, gender is_name_show, is_mobile_show, education_level, mentor_id, introducer_id, gender,
contract_no, contract_oss_path, hiring_basic_info_id
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select select
...@@ -442,6 +446,15 @@ ...@@ -442,6 +446,15 @@
<if test="gender != null"> <if test="gender != null">
gender = #{gender,jdbcType=INTEGER}, gender = #{gender,jdbcType=INTEGER},
</if> </if>
<if test="contractNo != null">
contract_no = #{contractNo,jdbcType=INTEGER},
</if>
<if test="contractOssPath != null">
contract_oss_path = #{contractOssPath,jdbcType=INTEGER},
</if>
<if test="hiringBasicInfoId != null">
hiring_basic_info_id = #{hiringBasicInfoId,jdbcType=INTEGER},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
......
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