|
@@ -166,6 +166,56 @@ public class PersonalProductionServiceImpl extends ServiceImpl<PersonalProductio
|
|
|
return Boolean.FALSE;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Boolean genFile(Long personalId) {
|
|
|
+ try {
|
|
|
+ //获取提供的证件信息
|
|
|
+ Personal personal = personalService.getOne(new LambdaQueryWrapper<Personal>().select(Personal::getCredentials).eq(BaseEntity::getId, personalId).eq(BaseEntity::getDeleted, Boolean.FALSE));
|
|
|
+ String orderId = personalService.getOne(new LambdaQueryWrapper<Personal>().eq(BaseEntity::getId, personalId).select(Personal::getOrderId).eq(BaseEntity::getDeleted, Boolean.FALSE)).getOrderId();
|
|
|
+ PersonalTarget target = personalTargetService.getOne(new LambdaQueryWrapper<PersonalTarget>().eq(PersonalTarget::getPersonalId, personalId).eq(BaseEntity::getDeleted, Boolean.FALSE));
|
|
|
+ List<CertificateEnum> certificates = JSON.parseArray(personal.getCredentials(), CertificateEnum.class);
|
|
|
+ CertificateEnum certificateEnum = determineCertificate(certificates);
|
|
|
+ Map<String,Object> textMap = new HashMap();
|
|
|
+
|
|
|
+ PersonalSellingAbilityVO sell = JSON.parseObject(target.getSellingAbility(), PersonalSellingAbilityVO.class);
|
|
|
+ PersonalBackgroundInfo bg = JSON.parseObject(target.getBackgroundInfo(), PersonalBackgroundInfo.class);
|
|
|
+ PersonalEntityInfoVO en = JSON.parseObject(target.getEntityInfo(), PersonalEntityInfoVO.class);
|
|
|
+ Field[] sellFields = sell.getClass().getDeclaredFields();
|
|
|
+ Field[] bgFields = bg.getClass().getDeclaredFields();
|
|
|
+ Field[] enFields = en.getClass().getDeclaredFields();
|
|
|
+ for (Field field :sellFields){
|
|
|
+ textMap.put(field.getName(),ReflectUtils.getFieldValue(sell,field.getName()));
|
|
|
+ }
|
|
|
+ for (Field field :bgFields){
|
|
|
+ textMap.put(field.getName(),ReflectUtils.getFieldValue(bg,field.getName()));
|
|
|
+ }
|
|
|
+ for (Field field :enFields){
|
|
|
+ textMap.put(field.getName(),ReflectUtils.getFieldValue(en,field.getName()));
|
|
|
+ }
|
|
|
+ textMap.put("orderId",orderId);
|
|
|
+ textMap.put("nAcreage",target.getAcreage());
|
|
|
+ textMap.put("nPrice",((BigDecimal)target.getPrice()).setScale(0, RoundingMode.HALF_UP));
|
|
|
+ textMap.put("nAmount",target.getAmount());
|
|
|
+ textMap.put("validateCode",target.getValidateCode());
|
|
|
+ addEnvironment(bg,textMap);
|
|
|
+
|
|
|
+ PersonalCalculate calculate = personalCalculateMapper.getByTargetId(target.getId());
|
|
|
+ textMap.put("rightsType",calculate.getRightsType());
|
|
|
+
|
|
|
+ NameUrlDTO statementPath = genStatement(orderId,target,textMap,certificateEnum);
|
|
|
+ createPro(target.getId(),statementPath,1,true);
|
|
|
+ NameUrlDTO technicPath = genTechnic(orderId,target,textMap,calculate,certificateEnum);
|
|
|
+ createPro(target.getId(),technicPath,2,true);
|
|
|
+ NameUrlDTO finalPath = genFinal(orderId,target,textMap,certificateEnum);
|
|
|
+ createPro(target.getId(),finalPath,3,true);
|
|
|
+ return Boolean.TRUE;
|
|
|
+ } catch (SecurityException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private CertificateEnum determineCertificate(List<CertificateEnum> certificates){
|
|
|
if (CollectionUtil.isEmpty(certificates)){
|
|
|
ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"请完善不动产权证或房产证其中一种证件");
|
|
@@ -473,6 +523,7 @@ public class PersonalProductionServiceImpl extends ServiceImpl<PersonalProductio
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 创建文档
|
|
|
* @param originFilePath
|