Commit 914627ab by jianan

Merge branch 'dev_20210120_hiringPDF' into dev

# Conflicts:
#	yd-api/src/main/java/com/yd/dal/entity/customer/AclPractitioner.java
parents c093005b 4a9209ab
package com.yd.api.practitioner; package com.yd.api.practitioner;
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.JsonResult; import com.yd.api.result.JsonResult;
...@@ -18,6 +19,7 @@ public class PractitionerHiringController { ...@@ -18,6 +19,7 @@ public class PractitionerHiringController {
@Autowired @Autowired
private PractitionerHiringService practitionerHiringService; private PractitionerHiringService practitionerHiringService;
/** /**
* 保存报聘经纪人组织关系 * 保存报聘经纪人组织关系
* *
...@@ -233,15 +235,24 @@ public class PractitionerHiringController { ...@@ -233,15 +235,24 @@ public class PractitionerHiringController {
* @param requestVO 请求数据 * @param requestVO 请求数据
* @return 响应数据 * @return 响应数据
*/ */
@RequestMapping("/hiringApprove") @RequestMapping("/generatePDF")
public Object hiringApprove(@RequestBody HiringApproveRequestVO requestVO){ public Object generatePDF(@RequestBody GeneratePDFRequestVO requestVO){
JsonResult result = new JsonResult();
GeneratePDFResponseVO responseVO = practitionerHiringService.generatePDF(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
/**
* 报聘成功后查看经纪人信息
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/queryPractitionerInfo")
public Object queryPractitionerInfo(@RequestBody QueryPractitionerInfoRequestVO requestVO){
JsonResult result = new JsonResult(); JsonResult result = new JsonResult();
try { QueryPractitionerInfoResponseVO responseVO = practitionerHiringService.queryPractitionerInfo(requestVO);
PractitionerPDFTest.main(null);
} catch (Exception e) {
e.printStackTrace();
}
HiringApproveResponseVO responseVO = practitionerHiringService.hiringApprove(requestVO);
result.addResult(responseVO); result.addResult(responseVO);
result.setData(responseVO); result.setData(responseVO);
return result; return result;
......
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, String contractNo);
Map<String, String> initHiringImageInfoData(Long hiringBasicInfoId); Map<String, String> initHiringImageInfoData(Long hiringBasicInfoId);
String generatePractitionerPDF(String practitionerNO,Map<String, String> initDatas,Map<String, String> initImages); String generatePractitionerPDF(String practitionerNO,Map<String, String> initDatas,Map<String, String> initImages);
String getNextContractNo();
} }
\ No newline at end of file
...@@ -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.PractitionerHiringContractService;
import com.yd.dal.entity.practitioner.hiring.HiringBasicInfo; import com.yd.dal.entity.customer.*;
import com.yd.dal.entity.practitioner.hiring.HiringMemberShip; import com.yd.dal.mapper.customer.*;
import com.yd.dal.entity.practitioner.hiring.HiringPersonalStatements;
import com.yd.dal.entity.practitioner.hiring.HiringWorkingExperience;
import com.yd.dal.mapper.customer.AclPractitionerHiringBasicInfoMapper;
import com.yd.dal.mapper.customer.AclPractitionerHiringMembershipMapper;
import com.yd.dal.mapper.customer.AclPractitionerHiringPersonalStatementsMapper;
import com.yd.dal.mapper.customer.AclPractitionerHiringWorkingExperienceMapper;
import com.yd.dal.mapper.practitioner.PractitionerHiringMapper; import com.yd.dal.mapper.practitioner.PractitionerHiringMapper;
import com.libs.pdf.*; import com.libs.pdf.*;
import com.yd.rmi.ali.oss.service.OssService; import com.yd.rmi.ali.oss.service.OssService;
import com.yd.util.CommonUtil; import com.yd.util.CommonUtil;
import com.yd.util.HttpUtil;
import com.yd.util.PDFConfiguration; import com.yd.util.PDFConfiguration;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.SimpleDateFormat; import java.io.*;
import java.util.Date; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service("PractitionerHiringContractService") @Service("PractitionerHiringContractService")
public class PractitionerHiringContractServiceImpl implements PractitionerHiringContractService { public class PractitionerHiringContractServiceImpl implements PractitionerHiringContractService {
...@@ -30,47 +22,154 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring ...@@ -30,47 +22,154 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
private OssService ossService; private OssService ossService;
@Resource @Resource
private PractitionerHiringMapper practitionerHiringMapper; private PractitionerHiringMapper practitionerHiringMapper;
@Autowired
private AclPractitionerHiringMembershipMapper membershipMapper;
@Autowired
private AclPractitionerMapper aclPractitionerMapper;
@Autowired
private AclPractitionerHiringBasicInfoMapper basicInfoMapper;
@Autowired
private AclPractitionerHiringWorkingExperienceMapper workingExperienceMapper;
@Autowired
private AclPractitionerHiringApproveRecordsMapper recordsMapper;
@Autowired
private AclPractitionerHiringPersonalStatementsMapper statementsMapper;
/** /**
* 申请经纪人的ID,生成电子合同,在经纪人表中自动生成记录 * 申请经纪人的ID,生成电子合同,在经纪人表中自动生成记录
*
* @param hiringBasicInfoId * @param hiringBasicInfoId
* @return * @return
*/ */
@Override @Override
public String generatePractitionerContract(Long hiringBasicInfoId) { public String generatePractitionerContract(String practitionerNO, String contractNo, Long hiringBasicInfoId) throws Exception {
//1、从DB中按照hiringBasicInfoId,获取经纪人的文字信息 //1、从DB中按照hiringBasicInfoId,获取经纪人的文字信息
Map<String, String> initDatas = new HashMap<String, String>(); Map<String, String> initDatas = new HashMap<String, String>();
initDatas = initHiringBasicInfoData(hiringBasicInfoId); initDatas = initHiringBasicInfoData(hiringBasicInfoId, contractNo);
//2、从DB中按照hiringBasicInfoId,从oss上获取经纪人上传的图片信息,需存本地临时文件 //2、从DB中按照hiringBasicInfoId,从oss上获取经纪人上传的图片信息,需存本地临时文件
Map<String, String> initImages = new HashMap<String, String>(); Map<String, String> initImages = new HashMap<String, String>();
initImages = initHiringImageInfoData(hiringBasicInfoId); initImages = initHiringImageInfoData(hiringBasicInfoId);
//ag_acl_practitioner.employee_no //ag_acl_practitioner.practitioner_code
String practitionerNO = "YDSH00009";
String contractNO = "CTSH00009"; //String practitionerNO = "YDSH00009";
//String contractNO = "CTSH00009";
//3、PDF模板生成合同文件,存本地临时文件后,上传oss //3、PDF模板生成合同文件,存本地临时文件后,上传oss
String contractFile = generatePractitionerPDF(practitionerNO,initDatas,initImages); String contractFile = generatePractitionerPDF(practitionerNO, initDatas, initImages);
//上传至oss ossService //上传至oss ossService
String contractFileOSS = contractFile; String contractFileOSS = this.putContractFileToOSS(contractFile, hiringBasicInfoId);
//4、经纪人表生成经纪人记录ag_acl_practitioner,ag_acl_practitioner.contract_oss_path //4、经纪人表生成经纪人记录ag_acl_practitioner,ag_acl_practitioner.contract_oss_path
// 经纪人经纪人类型级别定义表ag_acl_practitioner_setting // 经纪人经纪人类型级别定义表ag_acl_practitioner_setting
return contractFileOSS; return contractFileOSS;
} }
private String putContractFileToOSS(String contractFile, Long basicInfoId) throws Exception {
StringBuffer directory = new StringBuffer();
directory.append("brokerHiring/").append(basicInfoId).append("/");
File tempFile =new File(contractFile.trim());
//数据源不存在
if(!tempFile.exists()) {
throw new Exception("目标文件地址不存在!");
}
//非文件类型
if(!tempFile.isFile()) {
throw new Exception("目标文件不是文件类型!");
}
InputStream is = null;
String ossPath = null;
try {
is = new BufferedInputStream(new FileInputStream(tempFile));//读取数据源
String fileName = tempFile.getName();
String key = directory.append(fileName).toString();
ossPath = ossService.putFileToOss(null, key, is);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}finally {
if(is != null) {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return ossPath;
}
public static String copyFile(String src, String dest) throws IOException, ClassNotFoundException {
File srcFile = new File(src);//源文件数据源
File desFile = new File(dest);//写入到目标数据源
//数据源不存在
if(!srcFile.exists() || !desFile.exists()) {
throw new ClassNotFoundException("源文件或者拷贝目标文件地址不存在!");
}
//非文件类型
if(!srcFile.isFile() || !desFile.isFile()) {
return "源文件或者目标文件不是文件类型!";
}
InputStream is = null;
OutputStream os = null;
byte[] buf = new byte[1024];//缓存区
int len = 0;//读取长度
try {
is = new BufferedInputStream(new FileInputStream(srcFile));//读取数据源
os = new BufferedOutputStream(new FileOutputStream(desFile));//写入到数据源
while((len = is.read(buf)) != -1) { //读取长度不为-1,继续读取
os.write(buf); //读取内容之后马上写入目标数据源
}
os.flush();//输出
return "文件拷贝成功!查看拷贝文件路径:" + desFile.getPath();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}finally {
if(is != null)
is.close();
if(os != null)
os.close();
}
return "文件拷贝失败";
}
/** /**
* 申请ID的数据列表 * 申请ID的数据列表
*
* @param hiringBasicInfoId * @param hiringBasicInfoId
* @return * @return
*/ */
@Override @Override
public Map<String, String> initHiringBasicInfoData(Long hiringBasicInfoId) { public Map<String, String> initHiringBasicInfoData(Long hiringBasicInfoId, String contractNo) {
//PDF模板中定义的文字key,和值的集合
Map<String, String> data = new HashMap<String, String>(); AclPractitionerHiringBasicInfo basicInfo = basicInfoMapper.selectByPrimaryKey(hiringBasicInfoId);
HiringBasicInfo hiringBasicInfo = practitionerHiringMapper.findHiringBasicInfo(hiringBasicInfoId); AclPractitionerHiringMembership memberShip = membershipMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
AclPractitioner mentor = aclPractitionerMapper.selectByPrimaryKey(memberShip.getMentorPractitionerId());
AclPractitioner introducer = aclPractitionerMapper.selectByPrimaryKey(memberShip.getIntroducerPractitionerId());
AclPractitioner second = aclPractitionerMapper.selectByMobileNo(basicInfo.getMobileNo());
List<AclPractitionerHiringWorkingExperience> workingExperienceList = workingExperienceMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
String mentorName = mentor == null ? "" : mentor.getName();
String mentorIdNo = mentor == null ? "" : mentor.getIdNo();
String mentorMobile = mentor == null ? "" : mentor.getMobileNo();
String introducerName = introducer == null ? "" : introducer.getName();
String introducerIdNo = introducer == null ? "" : introducer.getIdNo();
String introducerMobile = introducer == null ? "" : introducer.getMobileNo();
//模板文件生成零时文件 //模板文件生成零时文件
//甲方 //甲方
String firstParty = PDFConfiguration.getProperty("pdf.firstParty"); String firstParty = PDFConfiguration.getProperty("pdf.firstParty");
...@@ -79,34 +178,410 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring ...@@ -79,34 +178,410 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
//甲方地址 //甲方地址
String firstPartyAddress = PDFConfiguration.getProperty("pdf.firstPartyAddress"); String firstPartyAddress = PDFConfiguration.getProperty("pdf.firstPartyAddress");
//PDF模板中定义的文字key,和值的集合
Map<String, String> data = new HashMap<String, String>();
//1页
data.put("contactNo", contractNo);
data.put("practitionerNo", second.getPractitionerCode());
data.put("subsystem", memberShip.getSubsystem());
data.put("practitioner", basicInfo.getName());
data.put("idNo", basicInfo.getIdNo());
StringBuffer secondResidentAddress = new StringBuffer();
secondResidentAddress.append(basicInfo.getProvinceName()).append(basicInfo.getCityName());
data.put("residentAddress", basicInfo.getResidentAddress());
data.put("mobileNo", basicInfo.getMobileNo());
//7页
data.put("firstParty", firstParty);
data.put("firstPartyResponser", firstPartyResponser);
data.put("firstPartyAddress", firstPartyAddress);
// 设置一些地址
this.setSomeAddress(data, hiringBasicInfoId);
Calendar now = Calendar.getInstance();
data.put("contactYear", now.get(Calendar.YEAR) + "");
data.put("contactMonth", (now.get(Calendar.MONTH) + 1) + "");
data.put("contactDay", now.get(Calendar.DAY_OF_MONTH) + "");
//8页
data.put("secondParty801", basicInfo.getName());
Calendar secondBirthday = Calendar.getInstance();
secondBirthday.setTime(basicInfo.getPractitionerBirthdate());
data.put("secondBirthYear801", secondBirthday.get(Calendar.YEAR) + "");
data.put("secondBirthMonth801", (secondBirthday.get(Calendar.MONTH) + 1) + "");
data.put("secondBirthDay801", secondBirthday.get(Calendar.DAY_OF_MONTH) + "");
data.put("secondPartyIDNo801", basicInfo.getIdNo());
data.put("secondPartyPermanentResidenceAddress", secondResidentAddress.toString());
data.put("secondPartyAddress801", basicInfo.getResidentAddress());
data.put("secondMobileNo801", basicInfo.getMobileNo());
data.put("secondPractitionerRegNo", second.getPractitionerRegNo());
data.put("secondEmail", basicInfo.getEmail());
this.setWorkingExperience(data, workingExperienceList);
data.put("secondBankAccount", basicInfo.getName());
data.put("secondBankAccountOpening", basicInfo.getBankAccountOpening());
data.put("secondBankAccountID", basicInfo.getBankAccountId());
data.put("secondMentor802", mentorName);
data.put("secondIntroducer", introducerName);
data.put("secondMentorIDNo801", mentorIdNo);
data.put("secondIntroducerIDNo", introducerIdNo);
Calendar applyDate = Calendar.getInstance();
applyDate.setTime(basicInfo.getCreatedAt());
data.put("secondEffectiveYear", applyDate.get(Calendar.YEAR) + "");
data.put("secondEffectiveMonth", (applyDate.get(Calendar.MONTH) + 1) + "");
data.put("secondEffectiveDay", applyDate.get(Calendar.DAY_OF_MONTH) + "");
data.put("secondParty802", basicInfo.getName());
data.put("secondMentor801", mentorName);
data.put("secondSubsystem", memberShip.getSubsystem());
data.put("secondSubsystemNo", "");
// 签核人员
this.setApprovepeople(data, hiringBasicInfoId);
//9页
String secondSignatureDate = CommonUtil.dateParseString(basicInfo.getCreatedAt(), "yyyy-MM-dd");
//10页
data.put("secondSignatureDate1001", secondSignatureDate);
//12页
data.put("secondParty1201", basicInfo.getName());
data.put("secondSignatureDate1201", secondSignatureDate);
//14页
data.put("secondParty1401", basicInfo.getName());
data.put("secondSignatureDate1401", secondSignatureDate);
//16页
data.put("secondParty1601", basicInfo.getName());
data.put("secondPartyIDNo1601", basicInfo.getIdNo());
data.put("secondSignatureDate1601", secondSignatureDate);
return data; return data;
} }
private void setSomeAddress(Map<String, String> data, Long hiringBasicInfoId) {
AclPractitionerHiringBasicInfo basicInfo = basicInfoMapper.selectByPrimaryKey(hiringBasicInfoId);
AclPractitionerHiringMembership memberShip = membershipMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
AclPractitioner systemOwner = aclPractitionerMapper.selectByPrimaryKey(memberShip.getSubsystemOwnerId());
AclPractitioner mentor = aclPractitionerMapper.selectByPrimaryKey(memberShip.getMentorPractitionerId());
String mentorName = mentor == null ? "" : mentor.getName();
String mentorIdNo = mentor == null ? "" : mentor.getIdNo();
String mentorMobile = mentor == null ? "" : mentor.getMobileNo();
data.put("secondParty", basicInfo.getName());
data.put("secondPartyIDNo", basicInfo.getIdNo());
StringBuffer secondResidentAddress = new StringBuffer();
secondResidentAddress.append(basicInfo.getProvinceName()).append(basicInfo.getCityName());
data.put("secondPartyAddress", basicInfo.getResidentAddress());
data.put("secondMobileNo", basicInfo.getMobileNo());
data.put("secondSubsystemOwner", memberShip.getSubsystemOwner());
data.put("secondSubsystemSignature", memberShip.getSubsystemOwner());
// 查团队长信息
String systemOwnerIdNo = null;
String systemOwnerMobile = null;
StringBuffer systemOwnerAddress = new StringBuffer();
if (systemOwner == null) {
if (Long.valueOf("30").equals(memberShip.getMdDropOptionId())) {
systemOwnerIdNo = basicInfo.getIdNo();
systemOwnerMobile = basicInfo.getMobileNo();
systemOwnerAddress.append(basicInfo.getResidentAddress());
data.put("secondSubsystemOwner", basicInfo.getName());
data.put("secondSubsystemSignature", basicInfo.getName());
}
} else {
systemOwnerIdNo = systemOwner.getIdNo();
systemOwnerMobile = systemOwner.getMobileNo();
systemOwnerAddress.append(systemOwner.getProvinceName()).append(systemOwner.getCityName());
}
data.put("secondSubsystemIDNo", systemOwnerIdNo);
data.put("secondSubsystemAddress", systemOwnerAddress.toString());
data.put("secondSubsystemMobileNo", systemOwnerMobile);
data.put("secondMentor", mentorName);
data.put("secondMentorIDNo", mentorIdNo);
// 辅导人地址
StringBuffer mentorAddress = new StringBuffer();
if (mentor != null) {
mentorAddress.append(mentor.getProvinceName()).append(mentor.getCityName());
}
data.put("secondMentorAddress", mentorAddress.toString());
data.put("secondMentorMobileNo", mentorMobile);
}
private void setApprovepeople(Map<String, String> data, Long hiringBasicInfoId) {
// 查询审批记录
List<AclPractitionerHiringApproveRecords> recordsList = recordsMapper.queryListByBasicInfoId(hiringBasicInfoId);
AclPractitioner practitioner;
for (AclPractitionerHiringApproveRecords record:recordsList) {
practitioner = aclPractitionerMapper.selectByPrimaryKey(record.getApprovingPractitionerId());
if ("体系负责人".equals(record.getApproveStepName())) {
data.put("secondSubsystemMaster", practitioner.getName());
continue;
}
if ("公司运营主管".equals(record.getApproveStepName())) {
data.put("secondBranchManager", practitioner.getName());
continue;
}
if ("寿险总经理".equals(record.getApproveStepName())) {
data.put("secondBranchMaster", practitioner.getName());
continue;
}
if ("公司总经理".equals(record.getApproveStepName())) {
data.put("secondCenterCEO", practitioner.getName());
continue;
}
}
data.put("secondSubsystemManager", "");
data.put("secondCenterHr", "EVEN");
}
private void setWorkingExperience(Map<String, String> data, List<AclPractitionerHiringWorkingExperience> workingExperienceList) {
String experienceKey = "secondWorkingExperience";
String positionKey = "secondWorkingPosition";
String periodKey = "secondWorkingPeriod";
AclPractitionerHiringWorkingExperience item = null;
for (int i = 0; i <= 4; i++) {
// 每次循环清空数据
String experienceValue = "";
String positionValue = "";
String periodValue = "";
if (i < workingExperienceList.size()) {
item = workingExperienceList.get(i);
experienceValue = item.getWorkingCompany();
positionValue = item.getPosition();
periodValue = item.getWorkingStart() + "~" + item.getWorkingEnd();
}
data.put(experienceKey + (i + 1), experienceValue);
data.put(positionKey + (i + 1), positionValue);
data.put(periodKey + (i + 1), periodValue);
}
}
/** /**
* 申请ID的图片列表,本地地址。从oss上拉到本地 * 申请ID的图片列表,本地地址。从oss上拉到本地
*
* @param hiringBasicInfoId * @param hiringBasicInfoId
* @return * @return
*/ */
@Override @Override
public Map<String, String> initHiringImageInfoData(Long hiringBasicInfoId) { public Map<String, String> initHiringImageInfoData(Long hiringBasicInfoId) {
AclPractitionerHiringBasicInfo basicInfo = basicInfoMapper.selectByPrimaryKey(hiringBasicInfoId);
//PDF模板中定义的文字key,和值的集合 //PDF模板中定义的文字key,和值的集合
Map<String, String> images = new HashMap<String, String>(); Map<String, String> images = new HashMap<String, String>();
//选中 //选中
String check = PDFConfiguration.getProperty("pdf.check"); String check = PDFConfiguration.getProperty("pdf.check");
//未选中 //未选中
String uncheck = PDFConfiguration.getProperty("pdf.uncheck"); String uncheck = PDFConfiguration.getProperty("pdf.uncheck");
//本地图片目录
String localDirectory = PDFConfiguration.getProperty("pdf.temp.path");
// Map赋值
// 个人照片
String personerPicture = this.getImgTolocal(localDirectory,"personerPicture.png", basicInfo.getPersonerPictureOssPath());
images.put("secondPersonerPicture", personerPicture);
//印章从配置文件读
String signImage = PDFConfiguration.getProperty("pdf.signImage");
images.put("yindunESignature1001", signImage);
images.put("yindunESignature1201", signImage);
images.put("yindunESignature1401", signImage);
// 电子签名
String signature = this.getImgTolocal(localDirectory,"signature.png", basicInfo.getPersonalSignOssPath());
images.put("secondSignature1001", signature);
images.put("secondSignature1201", signature);
images.put("secondSignature1401", signature);
images.put("secondSignature1601", signature);
// 证件照
String IDFront = this.getImgTolocal(localDirectory,"IDFront.png", basicInfo.getIdFrontPageOssPath());
String IDBack = this.getImgTolocal(localDirectory,"IDBack.png", basicInfo.getIdBackPageOssPath());
images.put("secondIDFrontPageImage", IDFront);
images.put("secondIDBackPageImage", IDBack);
// images.put("secondBankCardImage", "D:\\pcs12\\bank.jpg");
//选中或不选中从配置文件读
String checkFile = PDFConfiguration.getProperty("pdf.check");
String unCheckFile = PDFConfiguration.getProperty("pdf.uncheck");
// 设置证件类型
this.setIDType(images, basicInfo.getIdType(), checkFile, unCheckFile);
// 设置个人声明
this.setPersonalStatement(images, hiringBasicInfoId, checkFile, unCheckFile);
// 设置报聘职级
this.setPosition(images, hiringBasicInfoId, checkFile, unCheckFile);
return images; return images;
} }
private void setPosition(Map<String, String> images, Long hiringBasicInfoId, String checkFile, String unCheckFile) {
AclPractitionerHiringMembership memberShip = membershipMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
images.put("secondPosition1", unCheckFile);
images.put("secondPosition2", unCheckFile);
images.put("secondPosition3", unCheckFile);
images.put("secondPosition4", unCheckFile);
images.put("secondPosition5", unCheckFile);
images.put("secondPosition6", unCheckFile);
Long mdDropOptionId = memberShip == null ? null : memberShip.getMdDropOptionId();
if (Long.valueOf("30").equals(mdDropOptionId)) {
images.put("secondPosition1", checkFile);
return;
}
if (Long.valueOf("32").equals(mdDropOptionId)) {
images.put("secondPosition2", checkFile);
return;
}
if (Long.valueOf("33").equals(mdDropOptionId)) {
images.put("secondPosition3", checkFile);
return;
}
if (Long.valueOf("34").equals(mdDropOptionId)) {
images.put("secondPosition4", checkFile);
return;
}
if (Long.valueOf("35").equals(mdDropOptionId)) {
images.put("secondPosition5", checkFile);
return;
}
if (Long.valueOf("36").equals(mdDropOptionId)) {
images.put("secondPosition6", checkFile);
return;
}
}
private void setPersonalStatement(Map<String, String> images, Long hiringBasicInfoId, String checkFile, String unCheckFile) {
List<AclPractitionerHiringPersonalStatements> statementsList = statementsMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
images.put("secondPersonalStatement1", unCheckFile);
images.put("secondPersonalStatement2", unCheckFile);
images.put("secondPersonalStatement3", unCheckFile);
images.put("secondPersonalStatement4", unCheckFile);
images.put("secondPersonalStatement5", unCheckFile);
images.put("secondPersonalStatement6", unCheckFile);
String dropOptionCode = "";
Long status;
for (AclPractitionerHiringPersonalStatements statements : statementsList) {
dropOptionCode = statements.getDropOptionCode();
status = statements.getStatus();
if (dropOptionCode.equals("NO_CRIME_RECORD") && Long.valueOf("1").equals(status)) {
images.put("secondPersonalStatement1", checkFile);
continue;
}
if (dropOptionCode.equals("NO_LOST_CREDIT") && Long.valueOf("1").equals(status)) {
images.put("secondPersonalStatement2", checkFile);
continue;
}
if (dropOptionCode.equals("NO_PUBLIC_CREDIT_RECORD") && Long.valueOf("1").equals(status)) {
images.put("secondPersonalStatement3", checkFile);
continue;
}
if (dropOptionCode.equals("NO_REGISTER_SAME_TRADE") && Long.valueOf("1").equals(status)) {
images.put("secondPersonalStatement6", checkFile);
continue;
}
}
}
private void setIDType(Map<String, String> images, String idType, String checkFile, String unCheckFile) {
images.put("secondIDType1", unCheckFile);
images.put("secondIDType2", unCheckFile);
images.put("secondIDType3", unCheckFile);
images.put("secondIDType4", unCheckFile);
if (idType.indexOf("身份证") >= 0) {
images.put("secondIDType1", checkFile);
return;
}
if (idType.indexOf("台胞证") >= 0) {
images.put("secondIDType2", checkFile);
return;
}
if (idType.indexOf("护照") >= 0) {
images.put("secondIDType3", checkFile);
return;
}
images.put("secondIDType4", checkFile);
}
private String getImgTolocal(String localDirectory, String filename, String imgUrl) {
Map<String, Object> input = HttpUtil.getInput(imgUrl);
if (!(boolean) input.get("success")) {
return null;
}
//获取头像流
InputStream inputStream = (InputStream) input.get("is");
String filePath = localDirectory + filename;
byte[] data = new byte[1024];
int len = 0;
FileOutputStream fileOutputStream = null;
try {
fileOutputStream = new FileOutputStream(filePath);
while ((len = inputStream.read(data)) != -1) {
fileOutputStream.write(data, 0, len);
}
return filePath;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
if (fileOutputStream != null) {
try {
fileOutputStream.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
return null;
}
/** /**
* 用采集过来的经纪人数据、图片,生成该经纪人的电子合同 * 用采集过来的经纪人数据、图片,生成该经纪人的电子合同
*
* @param initDatas * @param initDatas
* @param initImages * @param initImages
* @return * @return
*/ */
@Override @Override
public String generatePractitionerPDF(String practitionerNO,Map<String, String> initDatas,Map<String, String> initImages) { public String generatePractitionerPDF(String practitionerNO, Map<String, String> initDatas, Map<String, String> initImages) {
String templatePDF = "D:\\pcs12\\templatePractitionerContract.pdf"; String templatePDF = "D:\\pcs12\\templatePractitionerContract.pdf";
templatePDF = PDFConfiguration.getProperty("pdf.template"); templatePDF = PDFConfiguration.getProperty("pdf.template");
//模板文件生成零时文件 //模板文件生成零时文件
...@@ -115,32 +590,39 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring ...@@ -115,32 +590,39 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
//PDF模板输出结果文件 //PDF模板输出结果文件
String templateResultPDF = tmpPathPDF + practitionerNO + "-template.pdf"; String templateResultPDF = tmpPathPDF + practitionerNO + "-template.pdf";
//按模板填充数据生成结果PDF //按模板填充数据生成结果PDF
PDFTemplate.generatePDF(templatePDF,templateResultPDF,initDatas,initImages); PDFTemplate.generatePDF(templatePDF, templateResultPDF, initDatas, initImages);
//加盖电子印章结果文件 //加盖电子印章结果文件
String signResultPDF = "D:\\pcs12\\signedYD.pdf"; String signResultPDF = "D:\\pcs12\\signedYD.pdf";
signResultPDF = tmpPathPDF + practitionerNO + "-signedYD.pdf"; signResultPDF = tmpPathPDF + practitionerNO + "-signedYD.pdf";
String password="UC645YlB"; String password = "UC645YlB";
password = CommonUtil.readFileTxt(PDFConfiguration.getProperty("pdf.keyPasswordFile")); password = PDFConfiguration.getProperty("pdf.keyPassword");
String keyStorePath="D:\\pcs12\\4929078_m.zuihuibi.cn.pfx"; String keyStorePath = "D:\\pcs12\\4929078_m.zuihuibi.cn.pfx";
keyStorePath = PDFConfiguration.getProperty("pdf.keyStorePath");; keyStorePath = PDFConfiguration.getProperty("pdf.keyStorePath");
//准备加盖电子印章的源文件 //准备加盖电子印章的源文件
String signSourcePDF = templateResultPDF; String signSourcePDF = templateResultPDF;
//电子印章文件 //电子印章文件
String signImage="D:\\pcs12\\上海银盾保险经纪有限公司.png"; String signImage = "D:\\pcs12\\上海银盾保险经纪有限公司.png";
signImage = PDFConfiguration.getProperty("pdf.signImage"); signImage = PDFConfiguration.getProperty("pdf.signImage");
float x = 450; float x = 450;
float y = 150; float y = 150;
x = Float.parseFloat(PDFConfiguration.getProperty("pdf.position.x")); x = Float.parseFloat(PDFConfiguration.getProperty("pdf.position.x"));
y = Float.parseFloat(PDFConfiguration.getProperty("pdf.position.y")); y = Float.parseFloat(PDFConfiguration.getProperty("pdf.position.y"));
try { try {
PDFSign.sign(signResultPDF,password,keyStorePath,signSourcePDF,signImage,x,y); PDFSign.sign(signResultPDF, password, keyStorePath, signSourcePDF, signImage, x, y);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return signResultPDF; return signResultPDF;
} }
@Override
public String getNextContractNo() {
return practitionerHiringMapper.getNextContractNo();
}
} }
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;
...@@ -11,6 +12,7 @@ import com.yd.dal.mapper.customer.*; ...@@ -11,6 +12,7 @@ import com.yd.dal.mapper.customer.*;
import com.yd.dal.service.customer.AclPractitionerHiringApproveRecordsDALService; import com.yd.dal.service.customer.AclPractitionerHiringApproveRecordsDALService;
import com.yd.dal.service.practitioner.PractitionerHiringDALService; import com.yd.dal.service.practitioner.PractitionerHiringDALService;
import com.yd.rmi.ali.oss.service.OssService; import com.yd.rmi.ali.oss.service.OssService;
import com.yd.rmi.ali.send.service.SendService;
import com.yd.rmi.cache.SystemConfigService; import com.yd.rmi.cache.SystemConfigService;
import com.yd.util.CommonUtil; import com.yd.util.CommonUtil;
import com.yd.util.HttpUtil; import com.yd.util.HttpUtil;
...@@ -29,6 +31,7 @@ import java.io.ByteArrayOutputStream; ...@@ -29,6 +31,7 @@ import java.io.ByteArrayOutputStream;
import java.io.InputStream; import java.io.InputStream;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
@Service @Service
...@@ -47,6 +50,12 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService ...@@ -47,6 +50,12 @@ 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;
@Autowired
private SendService sendService;
private PractitionerHiringDALService practitionerHiringDalService; private PractitionerHiringDALService practitionerHiringDalService;
private SystemConfigService systemConfigService; private SystemConfigService systemConfigService;
...@@ -403,12 +412,12 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService ...@@ -403,12 +412,12 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
/** /**
* ydLife经纪人审批详情查询接口 * ydLife经纪人审批详情查询接口
* 基本信息查询同AGMS一致,代码直接copy过来的,以免后期AGMS展示数据与ydLife不一致,修改麻烦 * 基本信息查询同AGMS一致,代码直接copy过来的,以免后期AGMS展示数据与ydLife不一致,修改麻烦
* 有关"查询是否可进行审批操作"说明 * 有关"查询是否可进行审批操作"说明
* 进行到经纪人审批详情查询的经纪人都有权限审批 * 进行到经纪人审批详情查询的经纪人都有权限审批
* 判断相对AGMS简单,因为一个经纪人审批和辅导员/团队长是一对一,不像AGMS为一对多 * 判断相对AGMS简单,因为一个经纪人审批和辅导员/团队长是一对一,不像AGMS为一对多
* 所以只要需要判断ag_md_practitioner_hiring_approve_steps是否有practitionerId即可判断是否审批 * 所以只要需要判断ag_md_practitioner_hiring_approve_steps是否有practitionerId即可判断是否审批
* ydLife审批逻辑不可变更,辅导人审批->团队长审批 * ydLife审批逻辑不可变更,辅导人审批->团队长审批
*/ */
@Override @Override
public HiringDetailQueryResponseVO detailQuery(HiringDetailQueryRequestVO requestVO) { public HiringDetailQueryResponseVO detailQuery(HiringDetailQueryRequestVO requestVO) {
...@@ -474,14 +483,14 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService ...@@ -474,14 +483,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 +506,15 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService ...@@ -497,15 +506,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;
...@@ -688,6 +697,117 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService ...@@ -688,6 +697,117 @@ 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();
if (StringUtils.isEmpty(practitionerCode)) {
resp.setCommonResult(new CommonResult(true, "内部编号不能为空,请注意保存"));
return resp;
}
// if (contractNo != null) {
// resp.setCommonResult(new CommonResult(true, "合同已存在"));
// return resp;
// }
String contractNo = hiringContractService.getNextContractNo();
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.setContractNo(contractNo);
updateObj.setContractOssPath(contractOssPath);
aclPractitionerMapper.updateByPrimaryKeySelective(updateObj);
//合同生成后,发短信通知报聘人,辅导人,团队长
this.sendMsgAfterPDF(hiringBasicInfoId);
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;
}
private void sendMsgAfterPDF(Long hiringBasicInfoId) {
AclPractitionerHiringBasicInfo basicInfo = basicInfoMapper.selectByPrimaryKey(hiringBasicInfoId);
AclPractitionerHiringMembership memberShip = membershipMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
List<String> mobileNoList = new ArrayList<>(3);
mobileNoList.add(basicInfo.getMobileNo());
if (memberShip.getMentorPractitionerId() != null) {
AclPractitioner mentor = aclPractitionerMapper.selectByPrimaryKey(memberShip.getMentorPractitionerId());
mobileNoList.add(mentor.getMobileNo());
}
if (memberShip.getSubsystemOwnerId() != null) {
AclPractitioner system = aclPractitionerMapper.selectByPrimaryKey(memberShip.getSubsystemOwnerId());
mobileNoList.add(system.getMobileNo());
}
// 若辅导人和团队长为同一人,去重
List<String> uniqueList = mobileNoList.stream().distinct().collect(Collectors.toList());
String name = basicInfo.getName();
String system = memberShip.getSubsystem();
String mobileNo;
String templateCode;
String content;
// S2的短信模板
if (Long.valueOf("30").equals(memberShip.getMdDropOptionId())) {
/* 短信提醒 */
templateCode = systemConfigService.getSingleConfigValue("ALI_SMS_CONTRACT_S2");
content = "{\"name\":\""+name+"\"}";
} else {
/* 短信提醒 */
templateCode = systemConfigService.getSingleConfigValue("ALI_SMS_CONTRACT");
content = "{\"system\":\""+system+"\",\"name\":\""+name+"\"}";
}
for (int i = 0; i < uniqueList.size(); i++) {
mobileNo = uniqueList.get(i);
sendService.sendEmailOrSMS("sms", mobileNo, "0", content, templateCode, null, null, "电子报聘合同生成提醒", 99, hiringBasicInfoId);
}
}
@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,
...@@ -741,7 +861,7 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService ...@@ -741,7 +861,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());
} }
} }
package com.yd.api.practitioner.vo.hiring;
import lombok.Data;
@Data
public class GeneratePDFRequestVO {
/**
* 经纪人id
*/
private Long practitionerId;
/**
* 审批经纪人基本资料id
*/
private Long hiringBasicInfoId;
}
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,7 +202,20 @@ public class AclPractitioner implements Serializable { ...@@ -202,7 +202,20 @@ public class AclPractitioner implements Serializable {
*/ */
private Integer gender; private Integer gender;
private Long hiringBasicInfoId; /**
* 经纪人合同号
*/
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
...@@ -29,6 +29,11 @@ public class AclPractitionerHiringPersonalStatements { ...@@ -29,6 +29,11 @@ public class AclPractitionerHiringPersonalStatements {
private String mdDropOptionName; private String mdDropOptionName;
/** /**
* 选项代码
*/
private String dropOptionCode;
/**
* 个人申明条目,用户补充输入 * 个人申明条目,用户补充输入
*/ */
private String userInput; private String userInput;
......
...@@ -74,4 +74,6 @@ public interface AclPractitionerMapper { ...@@ -74,4 +74,6 @@ public interface AclPractitionerMapper {
List<Long> queryMentoredByPractitionerId(Long practitionerId); List<Long> queryMentoredByPractitionerId(Long practitionerId);
PractitionerInfo findPractitionerInfoByPractitionerId(Long practitionerId); PractitionerInfo findPractitionerInfoByPractitionerId(Long practitionerId);
AclPractitioner selectByMobileNo(String mobileNo);
} }
\ No newline at end of file
...@@ -66,4 +66,6 @@ public interface PractitionerHiringMapper { ...@@ -66,4 +66,6 @@ public interface PractitionerHiringMapper {
List<HiringListInfo> queryMentorUnhandledList(Long practitionerId); List<HiringListInfo> queryMentorUnhandledList(Long practitionerId);
List<HiringListInfo> querySystemOwnerUnhandledList(Long practitionerId); List<HiringListInfo> querySystemOwnerUnhandledList(Long practitionerId);
String getNextContractNo();
} }
...@@ -1515,6 +1515,7 @@ public class CommonUtil { ...@@ -1515,6 +1515,7 @@ public class CommonUtil {
while((line=bufr.readLine())!=null) while((line=bufr.readLine())!=null)
{ {
System.out.println(line); System.out.println(line);
break;
} }
bufr.close();//close()中已经包含了flush bufr.close();//close()中已经包含了flush
} catch (IOException e) { } catch (IOException e) {
......
...@@ -25,7 +25,7 @@ public class PDFConfiguration { ...@@ -25,7 +25,7 @@ public class PDFConfiguration {
{ {
in = PDFConfiguration.class.getClassLoader().getResourceAsStream("pdfconfiguration.properties"); in = PDFConfiguration.class.getClassLoader().getResourceAsStream("pdfconfiguration.properties");
props.load(in); props.load(new InputStreamReader(in, "UTF-8"));
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
logger.error("pdfconfiguration.properties文件未找到"); logger.error("pdfconfiguration.properties文件未找到");
} catch (IOException e) { } catch (IOException e) {
......
...@@ -297,11 +297,27 @@ ...@@ -297,11 +297,27 @@
</foreach> </foreach>
</insert> </insert>
<select id="selectByHiringBasicInfoId" resultMap="BaseResultMap"> <resultMap id="BaseResultMap2" type="com.yd.dal.entity.customer.AclPractitionerHiringPersonalStatements">
select <include refid="Base_Column_List" /> <id column="id" jdbcType="BIGINT" property="id" />
from ag_acl_practitioner_hiring_personal_statements <result column="hiring_basic_info_id" jdbcType="BIGINT" property="hiringBasicInfoId" />
<result column="md_drop_option_id" jdbcType="BIGINT" property="mdDropOptionId" />
<result column="md_drop_option_name" jdbcType="VARCHAR" property="mdDropOptionName" />
<result column="status" jdbcType="BIGINT" property="status" />
<result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="user_input" jdbcType="INTEGER" property="userInput" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
<result column="drop_option_code" jdbcType="VARCHAR" property="dropOptionCode" />
</resultMap>
<select id="selectByHiringBasicInfoId" resultMap="BaseResultMap2">
select s.* , o.drop_option_code
from ag_acl_practitioner_hiring_personal_statements s
left join ag_md_drop_options o on o.id = s.md_drop_option_id
where hiring_basic_info_id = #{hiringBasicInfoId,jdbcType=BIGINT} where hiring_basic_info_id = #{hiringBasicInfoId,jdbcType=BIGINT}
</select> </select>
<delete id="deleteBatchByIds"> <delete id="deleteBatchByIds">
delete from ag_acl_practitioner_hiring_personal_statements delete from ag_acl_practitioner_hiring_personal_statements
where id in where id in
......
...@@ -348,6 +348,7 @@ ...@@ -348,6 +348,7 @@
select <include refid="Base_Column_List" /> select <include refid="Base_Column_List" />
from ag_acl_practitioner_hiring_working_experience from ag_acl_practitioner_hiring_working_experience
where hiring_basic_info_id = #{hiringBasicInfoId,jdbcType=BIGINT} where hiring_basic_info_id = #{hiringBasicInfoId,jdbcType=BIGINT}
order by working_end desc
</select> </select>
<delete id="deleteBatchByIds"> <delete id="deleteBatchByIds">
......
...@@ -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
...@@ -443,6 +447,15 @@ ...@@ -443,6 +447,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>
...@@ -967,4 +980,11 @@ ...@@ -967,4 +980,11 @@
where p.id = #{practitionerId} where p.id = #{practitionerId}
</select> </select>
<select id="selectByMobileNo" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner
where mobile_no = #{mobileNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -262,4 +262,8 @@ ...@@ -262,4 +262,8 @@
from ag_md_drop_master from ag_md_drop_master
where scenario_code = 'practitioner_level')) where scenario_code = 'practitioner_level'))
</select> </select>
<select id="getNextContractNo" resultType="java.lang.String" statementType="CALLABLE">
select f_getNextContractNo()
</select>
</mapper> </mapper>
\ No newline at end of file
pdf.template=/opt/tomcat8/conf/ydpdf/pdfres/templatePractitionerContract.pdf pdf.template=/opt/tomcat8/conf/ydpdf/pdfres/templatePractitionerContract.pdf
pdf.signImage=/opt/tomcat8/conf/ydpdf/pdfres/上海银盾保险经纪有限公司.png pdf.signImage=/opt/tomcat8/conf/ydpdf/pdfres/yindunsign.png
pdf.keyStorePath=/opt/tomcat8/conf/ydpdf/pdfres/4929078_m.zuihuibi.cn.pfx pdf.keyStorePath=/opt/tomcat8/conf/ydpdf/pdfres/4929078_m.zuihuibi.cn.pfx
pdf.keyPasswordFile=/opt/tomcat8/conf/ydpdf/pdfres/pfx-password.txt pdf.keyPassword=UC645YlB
pdf.check=/opt/tomcat8/conf/ydpdf/pdfres/check.png pdf.check=/opt/tomcat8/conf/ydpdf/pdfres/check.png
pdf.uncheck=/opt/tomcat8/conf/ydpdf/pdfres/uncheck.png pdf.uncheck=/opt/tomcat8/conf/ydpdf/pdfres/uncheck.png
pdf.temp.path=/opt/tomcat8/temp/ pdf.temp.path=/opt/tomcat8/temp/
pdf.firstParty=上海银盾保险经纪有限公司 pdf.firstParty=上海银盾保险经纪有限公司
pdf.firstPartyResponser=Sharon Wan pdf.firstPartyResponser=Wan Shuang Lian
pdf.firstPartyAddress=上海市浦东新区张杨路560号中融恒瑞国际西楼1706室 pdf.firstPartyAddress=上海市浦东新区张杨路560号中融恒瑞国际西楼1706室
pdf.position.x=450 pdf.position.x=450
pdf.position.y=150 pdf.position.y=150
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