Commit 6abd8ed6 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/first' into first

parents a8e3a10d 00ea90b8
package com.mortals.xhx.base.system.upload.web;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.exception.AppException;
......@@ -60,6 +61,7 @@ public class UploadController extends BaseController {
String jsonStr = "";
try {
String filePath = uploadService.saveFileUpload(file, prePath, getCurUser());
filePath = StrUtil.prependIfMissing(filePath, "/");
model.put("url", filePath);
model.put("fileName", file.getOriginalFilename());
model.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
......@@ -122,5 +124,4 @@ public class UploadController extends BaseController {
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.certificate.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.certificate.model.CertificateIndustryEntity;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -9,6 +11,7 @@ import java.util.List;
* @author zxfei
* @date 2022-10-14
*/
@Data
public class CertificateIndustryVo extends BaseEntityLong {
List<CertificateIndustryEntity> children;
}
\ No newline at end of file
......@@ -36,4 +36,12 @@ public class CertificateIndustryServiceImpl extends AbstractCRUDServiceImpl<Cert
throw new AppException("行业名称重复");
}
}
@Override
protected void saveBefore(CertificateIndustryEntity entity, Context context) throws AppException {
super.saveBefore(entity,context);
if(entity.getParentId()==null){
entity.setParentId(-1l);
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.certificate.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.annotation.DataPermission;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.certificate.model.CertificateIndustryEntity;
import com.mortals.xhx.module.certificate.service.CertificateIndustryService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collector;
import java.util.stream.Collectors;
/**
*
* 行业目录
......@@ -40,4 +52,54 @@ public class CertificateIndustryController extends BaseCRUDJsonBodyMappingContro
public Rest<Object> list(CertificateIndustryEntity query) {
return super.list(query);
}
@PostMapping({"treeList"})
@UnAuth
public Rest<Object> treeList(@RequestBody CertificateIndustryEntity query) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "查询" + this.getModuleDesc();
int code;
try {
List<CertificateIndustryEntity> result = this.getService().find(query, context);
if(CollectionUtils.isNotEmpty(result)){
List<CertificateIndustryEntity> collect = result.stream().filter(t -> t.getParentId() == -1).map(
m -> {
m.setChildren(getChildren(m, result));
return m;
}
).collect(Collectors.toList());
model.put("data", collect);
}else {
model.put("data", result);
}
code = this.doListAfter(query, (Map)model, context);
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
this.init(model, context);
ret.setCode(code);
ret.setData(model);
ret.setDict(model.get("dict"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
private static List<CertificateIndustryEntity> getChildren(CertificateIndustryEntity root, List<CertificateIndustryEntity> all) {
List<CertificateIndustryEntity> children = all.stream().filter(t -> {
return Objects.equals(t.getParentId(), root.getId());
}).map(
m -> {
m.setChildren(getChildren(m, all));
return m;
}
).collect(Collectors.toList());
return children;
}
}
\ No newline at end of file
......@@ -5,6 +5,8 @@ import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.annotation.DataPermission;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.base.system.user.model.UserQuery;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.module.certificate.model.CertificateDocumentQuery;
import com.mortals.xhx.module.certificate.service.CertificateDocumentService;
import com.mortals.xhx.module.device.model.DeviceEntity;
......@@ -33,6 +35,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
import static java.util.stream.Collectors.toMap;
import com.mortals.xhx.common.code.*;
......@@ -49,6 +52,8 @@ public class ChildLicenseController extends BaseCRUDJsonBodyMappingController<Ch
@Autowired
private CertificateDocumentService certificateDocumentService;
@Autowired
private UserService userService;
public ChildLicenseController() {
super.setModuleDesc("行业许可子证");
......@@ -62,6 +67,7 @@ public class ChildLicenseController extends BaseCRUDJsonBodyMappingController<Ch
this.addDict(model, "deleted", DeletedEnum.getEnumMap());
this.addDict(model, "documentId", certificateDocumentService.find(new CertificateDocumentQuery())
.stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getDocumentName(), (o, n) -> n)));
this.addDict(model, "createUserId", userService.find(new UserQuery()).stream().collect(toMap(x -> x.getId().toString(), y -> y.getRealName(), (o, n) -> n)));
super.init(model, context);
}
......@@ -80,7 +86,7 @@ public class ChildLicenseController extends BaseCRUDJsonBodyMappingController<Ch
query.setDeptId(deptId);
}
}
query.setChildStatus(ChildStatusEnum.启用.getValue());
super.doListBefore(query, model, context);
}
......
package com.mortals.xhx.module.record.dao.ibatis;
import com.mortals.framework.util.EntityUtil;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.record.dao.ApplyLogDao;
import com.mortals.xhx.module.record.model.ApplyLogEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 证照申请DaoImpl DAO接口
*
......@@ -16,6 +21,19 @@ import java.util.List;
@Repository("applyLogDao")
public class ApplyLogDaoImpl extends BaseCRUDDaoMybatis<ApplyLogEntity,Long> implements ApplyLogDao {
@Override
public int update(ApplyLogEntity entity) {
Map<String,Object> data = new HashMap();
EntityUtil.entityToMap(entity, data);
Map condition = new HashMap();
condition.put(this.getPrimaryKeyLabel(), entity.getId());
if(entity.getValidityStart()==null){
data.put("validityStart",null);
}
if(entity.getValidityEnd()==null){
data.put("validityEnd",null);
}
return this.update((Map)data, (Map)condition);
}
}
......@@ -11,150 +11,158 @@ import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.record.model.vo.ApplyLogVo;
import lombok.Data;
/**
* 证照申请实体对象
*
* @author zxfei
* @date 2024-07-28
*/
* 证照申请实体对象
*
* @author zxfei
* @date 2024-07-31
*/
@Data
public class ApplyLogEntity extends ApplyLogVo {
private static final long serialVersionUID = 1L;
/**
* 站点id
*/
* 站点id
*/
private Long siteId;
/**
* 证照档案ID
*/
* 证照档案ID
*/
private Long recordId;
/**
* 证照目录ID
*/
* 证照目录ID
*/
private Long catalogId;
/**
* 证照目录编号
*/
* 证照目录编号
*/
private String catalogCode;
/**
* 目录名称
*/
* 目录名称
*/
private String catalogName;
/**
* 证件编号
*/
* 证件编号
*/
private String certificateCode;
/**
* 证件名称
*/
* 证件名称
*/
private String certificateName;
/**
* 颁发时间
*/
* 颁发时间
*/
private Date issueTime;
/**
* 取件人姓名
*/
* 取件人姓名
*/
private String pickerName;
/**
* 取件人证件号码
*/
* 取件人证件号码
*/
private String pickerIDCardNo;
/**
* 手机号码
*/
* 手机号码
*/
private String mobile;
/**
* 持有者类型,1:自然人,2:法人,3:自然人法人
*/
* 持有者类型,1:自然人,2:法人,3:自然人法人
*/
private Integer holderType;
/**
* 持有者证件类型,1:身份证,2:组织机构代码等
*/
* 持有者证件类型,1:身份证,2:组织机构代码等
*/
private Integer holderIdType;
/**
* 持有者名称
*/
* 持有者名称
*/
private String holderName;
/**
* 持有者证件号码
*/
* 持有者证件号码
*/
private String holderIDCardNo;
/**
* 市场主体名称
*/
* 市场主体名称
*/
private String enterpriseName;
/**
* 法定代表人
*/
* 法定代表人
*/
private String legalPerson;
/**
* 统一社会信用代码
*/
* 统一社会信用代码
*/
private String socialCode;
/**
* 有效期起始
*/
* 有效期起始
*/
private Date validityStart;
/**
* 有效期截止
*/
* 有效期截止
*/
private Date validityEnd;
/**
* 专网ID
*/
* 专网ID
*/
private String privateID;
/**
* 证件附件地址
*/
* 证件附件地址
*/
private String certificateUrl;
/**
* 证件预览地址
*/
* 证件预览地址
*/
private String previewUrl;
/**
* 证照模板表单内容
*/
* 证照模板表单内容
*/
private String formContent;
/**
* 证照模板表单内容
*/
* 证照模板表单内容
*/
private String formTemplate;
/**
* 生成状态1未生成2已生成
*/
* 生成状态1未生成2已生成
*/
private Integer generateStatus;
/**
* 档案操作类型1新增2变更
*/
* 档案操作类型1新增2变更
*/
private Integer operType;
/**
* 归档状态0否1是
*/
* 归档状态0否1是
*/
private Integer recordStatus;
/**
* 二维码
*/
* 二维码
*/
private String qRCode;
/**
* 行业名称
*/
* 行业名称
*/
private String industryName;
/**
* 经营场所
*/
* 经营场所
*/
private String businessPlace;
/**
* 许可项目
*/
* 许可项目
*/
private String licenseProject;
/**
* 制证机关
*/
* 制证机关
*/
private String authority;
/**
* 附件名称
*/
private String annexName;
/**
* 附件地址
*/
private String annexUrl;
@Override
public int hashCode() {
return this.getId().hashCode();
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
......@@ -162,45 +170,47 @@ public class ApplyLogEntity extends ApplyLogVo {
if (obj instanceof ApplyLogEntity) {
ApplyLogEntity tmp = (ApplyLogEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
return true;
}
}
return false;
}
public void initAttrValue(){
this.siteId = null;
this.recordId = null;
this.catalogId = null;
this.catalogCode = "";
this.catalogName = "";
this.certificateCode = "";
this.certificateName = "";
this.issueTime = null;
this.pickerName = "";
this.pickerIDCardNo = "";
this.mobile = "";
this.holderType = 1;
this.holderIdType = 1;
this.holderName = "";
this.holderIDCardNo = "";
this.enterpriseName = "";
this.legalPerson = "";
this.socialCode = "";
this.validityStart = null;
this.validityEnd = null;
this.privateID = "";
this.certificateUrl = "";
this.previewUrl = "";
this.formContent = "";
this.formTemplate = "";
this.generateStatus = 1;
this.operType = 1;
this.recordStatus = 0;
this.qRCode = "";
this.industryName = "";
this.businessPlace = "";
this.licenseProject = "";
this.authority = "";
this.siteId = null;
this.recordId = null;
this.catalogId = null;
this.catalogCode = "";
this.catalogName = "";
this.certificateCode = "";
this.certificateName = "";
this.issueTime = null;
this.pickerName = "";
this.pickerIDCardNo = "";
this.mobile = "";
this.holderType = 1;
this.holderIdType = 1;
this.holderName = "";
this.holderIDCardNo = "";
this.enterpriseName = "";
this.legalPerson = "";
this.socialCode = "";
this.validityStart = null;
this.validityEnd = null;
this.privateID = "";
this.certificateUrl = "";
this.previewUrl = "";
this.formContent = "";
this.formTemplate = "";
this.generateStatus = 1;
this.operType = 1;
this.recordStatus = 0;
this.qRCode = "";
this.industryName = "";
this.businessPlace = "";
this.licenseProject = "";
this.authority = "";
this.annexName = "";
this.annexUrl = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.record.model;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
......@@ -10,102 +11,142 @@ import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.record.model.vo.RetainLogVo;
import lombok.Data;
/**
* 证照持有实体对象
*
* @author zxfei
* @date 2024-07-28
*/
* 证照持有实体对象
*
* @author zxfei
* @date 2024-08-01
*/
@Data
public class RetainLogEntity extends RetainLogVo {
private static final long serialVersionUID = 1L;
/**
* 站点id
*/
* 站点id
*/
private Long siteId;
/**
* 证照档案ID
*/
* 证照档案ID
*/
private Long recordId;
/**
* 证照目录ID
*/
* 证照目录ID
*/
private Long catalogId;
/**
* 证照目录编号
*/
* 证照目录编号
*/
private String catalogCode;
/**
* 目录名称
*/
* 目录名称
*/
private String catalogName;
/**
* 证照名称
*/
* 证照名称
*/
private String certificateName;
/**
* 证照编号
*/
* 证照编号
*/
private String certificateCode;
/**
* 市场主体名称
*/
* 市场主体名称
*/
private String enterpriseName;
/**
* 法定代表人
*/
* 法定代表人
*/
private String legalPerson;
/**
* 统一社会信用代码
*/
* 统一社会信用代码
*/
private String socialCode;
/**
* 二维码
*/
* 二维码
*/
private String qRCode;
/**
* 持有者姓名
*/
* 持有者姓名
*/
private String holderName;
/**
* 持有者证件号码
*/
* 持有者证件号码
*/
private String holderIDCardNo;
/**
* 手机号码
*/
* 手机号码
*/
private String mobile;
/**
* 证照状态,1正常2注销
*/
* 证照状态,1正常2注销
*/
private Integer certificateStatus;
/**
* 证件附件地址
*/
* 证件附件地址
*/
private String certificateUrl;
/**
* 证件预览地址
*/
* 证件预览地址
*/
private String previewUrl;
/**
* 行业名称
*/
* 行业名称
*/
private String industryName;
/**
* 经营场所
*/
* 经营场所
*/
private String businessPlace;
/**
* 许可项目
*/
* 许可项目
*/
private String licenseProject;
/**
* 制证机关
*/
* 制证机关
*/
private String authority;
/**
* 颁发时间
*/
private Date issueTime;
/**
* 附件名称
*/
private String annexName;
/**
* 附件地址
*/
private String annexUrl;
/**
* 有效期起始
*/
private Date validityStart;
/**
* 有效期截止
*/
private Date validityEnd;
/**
* 持有者类型,1:自然人,2:法人,3:自然人法人
*/
private Integer holderType;
/**
* 持有者证件类型,1:身份证,2:组织机构代码等
*/
private Integer holderIdType;
/**
* 专网ID
*/
private String privateID;
/**
* 申请ID
*/
private Long applyId;
/**
* 打印次数
*/
private Integer total;
@Override
public int hashCode() {
return this.getId().hashCode();
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
......@@ -113,33 +154,43 @@ public class RetainLogEntity extends RetainLogVo {
if (obj instanceof RetainLogEntity) {
RetainLogEntity tmp = (RetainLogEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
return true;
}
}
return false;
}
public void initAttrValue(){
this.siteId = null;
this.recordId = null;
this.catalogId = null;
this.catalogCode = "";
this.catalogName = "";
this.certificateName = "";
this.certificateCode = "";
this.enterpriseName = "";
this.legalPerson = "";
this.socialCode = "";
this.qRCode = "";
this.holderName = "";
this.holderIDCardNo = "";
this.mobile = "";
this.certificateStatus = 1;
this.certificateUrl = "";
this.previewUrl = "";
this.industryName = "";
this.businessPlace = "";
this.licenseProject = "";
this.authority = "";
this.siteId = null;
this.recordId = null;
this.catalogId = null;
this.catalogCode = "";
this.catalogName = "";
this.certificateName = "";
this.certificateCode = "";
this.enterpriseName = "";
this.legalPerson = "";
this.socialCode = "";
this.qRCode = "";
this.holderName = "";
this.holderIDCardNo = "";
this.mobile = "";
this.certificateStatus = 1;
this.certificateUrl = "";
this.previewUrl = "";
this.industryName = "";
this.businessPlace = "";
this.licenseProject = "";
this.authority = "";
this.issueTime = null;
this.annexName = "";
this.annexUrl = "";
this.validityStart = null;
this.validityEnd = null;
this.holderType = 1;
this.holderIdType = 1;
this.privateID = "";
this.applyId = null;
this.total = 1;
}
}
\ No newline at end of file
......@@ -17,4 +17,6 @@ import java.util.List;
public class RetainLogVo extends BaseEntityLong {
/** 查询条件 */
private String query;
/** 子证联报状态 已联报数/子证总数 */
private String processStatus;
}
\ No newline at end of file
......@@ -29,6 +29,7 @@ import com.mortals.xhx.module.certificate.pdu.ApplyLogPdu;
import com.mortals.xhx.module.certificate.service.CertificateCatalogService;
import com.mortals.xhx.module.certificate.service.CertificateClassifyService;
import com.mortals.xhx.module.certificate.service.CertificateDocumentService;
import com.mortals.xhx.module.certificate.service.CertificateIndustryService;
import com.mortals.xhx.module.child.model.ChildLicenseEntity;
import com.mortals.xhx.module.child.model.ChildLicenseQuery;
import com.mortals.xhx.module.child.service.ChildLicenseService;
......@@ -89,6 +90,8 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
private UserService userService;
@Autowired
private ChildLicenseService childLicenseService;
@Autowired
private CertificateIndustryService certificateIndustryService;
@Override
protected void removeAfter(Long[] ids, Context context,int result) throws AppException {
......@@ -184,9 +187,17 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
// if(StringUtils.isEmpty(entity.getAuthority())){
// throw new AppException("制证机关不能为空");
// }
if(StringUtils.isEmpty(entity.getSocialCode())){
entity.setSocialCode(DateUtils.getCurrDateTime("yyyyMMddHHmmss")+RandomUtil.randomNumbers(4));
//throw new AppException("统一社会信用代码不能为空");
if(entity.getId()==null) {
if (StringUtils.isEmpty(entity.getSocialCode())) {
entity.setSocialCode(DateUtils.getCurrDateTime("yyyyMMddHHmmss") + RandomUtil.randomNumbers(4));
//throw new AppException("统一社会信用代码不能为空");
}
ApplyLogEntity temp = this.selectOne(new ApplyLogQuery().socialCode(entity.getSocialCode()).recordStatus(YesNoEnum.NO.getValue()));
if (temp != null) {
throw new AppException("统一社会信用代码重复");
}
}else {
entity.setSocialCode(null);
}
// if(StringUtils.isEmpty(entity.getLicenseProject())){
// throw new AppException("许可项目不能为空");
......@@ -216,9 +227,12 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
// formContentJson.put("i_14_制证机关",applyLogEntity.getAuthority());
formContentJson.put("@qrcode_1_二维码",applyLogEntity.getSocialCode());
if(CollectionUtils.isNotEmpty(applyLogEntity.getChildCertificate())){
int index = 1;
for(int i = 0;i<applyLogEntity.getChildCertificate().size();i++){
int index = i+1;
formContentJson.put("i_"+ index +"_子证",applyLogEntity.getChildCertificate().get(i).getShortName());
if(applyLogEntity.getChildCertificate().get(i).getStatus()==1) {
formContentJson.put("i_" + index + "_子证", applyLogEntity.getChildCertificate().get(i).getShortName());
index++;
}
}
}
applyLogEntity.setFormContent(formContentJson.toJSONString());
......@@ -235,6 +249,8 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
applyLogEntity.setCatalogCode(catalog.getCatalogCode());
applyLogEntity.setCatalogName(catalog.getCatalogName());
applyLogEntity.setFormTemplate(catalog.getFormContent());
CertificateIndustryEntity industryEntity = certificateIndustryService.get(catalog.getIndustryId());
applyLogEntity.setIndustryName(industryEntity==null?"":industryEntity.getIndustryName());
DocTemplateVO docTemplate = new DocTemplateVO(catalog.getTemplateFileUrl(),applyLogEntity.getFormContent());
try {
String rootPath = this.filePath.endsWith("/") ? this.filePath : this.filePath + "/";
......@@ -430,7 +446,7 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
log.info("Image path: " + imagepath);
try {
PictureRenderData pictureRenderData = Pictures.ofStream(new FileInputStream(imagepath), PictureType.JPEG)
.size(100, 120).create();
.size(120, 120).create();
addMap.put(StrUtil.removePrefixIgnoreCase(entry.getKey(),"@"),pictureRenderData);
//entry.setValue(pictureRenderData);
} catch (FileNotFoundException e) {
......
......@@ -19,7 +19,9 @@ import com.mortals.xhx.module.record.dao.PrintLogDao;
import com.mortals.xhx.module.record.dao.PrintWaitQueueDao;
import com.mortals.xhx.module.record.dao.RetainLogDao;
import com.mortals.xhx.module.record.model.*;
import com.mortals.xhx.module.record.service.ApplyLogService;
import com.mortals.xhx.module.record.service.PrintWaitQueueService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -58,6 +60,8 @@ public class PrintWaitQueueServiceImpl extends AbstractCRUDServiceImpl<PrintWait
private CertificateClassifyService certificateClassifyService;
@Autowired
private ParamService paramService;
@Autowired
private ApplyLogService applyLogService;
@Override
protected void findAfter(PrintWaitQueueEntity entity, Context context, List<PrintWaitQueueEntity> list) throws AppException {
......@@ -153,17 +157,10 @@ public class PrintWaitQueueServiceImpl extends AbstractCRUDServiceImpl<PrintWait
}
private void doPrintSuccess(PrintWaitQueueEntity waitQueueEntity){
RetainLogEntity retainLogEntity = new RetainLogEntity();
Date now = new Date();
BeanUtils.copyProperties(waitQueueEntity, retainLogEntity, BeanUtil.getNullPropertyNames(waitQueueEntity));
retainLogEntity.setId(null);
retainLogEntity.setUpdateUserId(null);
retainLogEntity.setUpdateTime(null);
retainLogEntity.setCertificateStatus(CertificateStatus.NORMAL.getValue());
ApplyLogEntity applyLogEntity = applyLogService.get(waitQueueEntity.getApplyId());
Date now = new Date();
retainLogEntity.setCreateUserId(waitQueueEntity.getCreateUserId());
retainLogEntity.setCreateTime(now);
PrintLogEntity printLogEntity = new PrintLogEntity();
BeanUtils.copyProperties(waitQueueEntity, printLogEntity, BeanUtil.getNullPropertyNames(waitQueueEntity));
......@@ -175,7 +172,28 @@ public class PrintWaitQueueServiceImpl extends AbstractCRUDServiceImpl<PrintWait
printLogEntity.setCreateTime(now);
printLogEntity.setPrintStatus(PrintStatus.SUCCESS.getValue());
printLogEntity.setStatusRemark(PrintStatus.SUCCESS.getDesc());
retainLogDao.insert(retainLogEntity);
RetainLogEntity retainLogquery = new RetainLogEntity();
retainLogquery.setApplyId(waitQueueEntity.getApplyId());
List<RetainLogEntity> tempRetainLogList = retainLogDao.getList(retainLogquery);
if(CollectionUtils.isNotEmpty(tempRetainLogList)){
RetainLogQuery updateRetainLog = new RetainLogQuery();
updateRetainLog.setUpdateTime(now);
updateRetainLog.setId(tempRetainLogList.get(0).getId());
updateRetainLog.setTotalIncrement(1);
retainLogDao.update(updateRetainLog);
}else {
RetainLogEntity retainLogEntity = new RetainLogEntity();
BeanUtils.copyProperties(applyLogEntity, retainLogEntity, BeanUtil.getNullPropertyNames(applyLogEntity));
retainLogEntity.setId(null);
retainLogEntity.setUpdateUserId(null);
retainLogEntity.setUpdateTime(null);
retainLogEntity.setCertificateStatus(CertificateStatus.NORMAL.getValue());
retainLogEntity.setCreateUserId(waitQueueEntity.getCreateUserId());
retainLogEntity.setCreateTime(now);
retainLogDao.insert(retainLogEntity);
}
printLogDao.insert(printLogEntity);
CertificateCatalogEntity catalogEntity = certificateCatalogService.get(waitQueueEntity.getCatalogId());
CertificateClassifyQuery query = new CertificateClassifyQuery();
......@@ -183,7 +201,13 @@ public class PrintWaitQueueServiceImpl extends AbstractCRUDServiceImpl<PrintWait
query.setTotalIncrement(1);
query.setUpdateTime(now);
certificateClassifyService.update(query);
ApplyLogEntity updateApply = new ApplyLogEntity();
updateApply.setId(applyLogEntity.getId());
updateApply.setCertificateCode(applyLogEntity.getCertificateCode());
updateApply.setEnterpriseName(applyLogEntity.getEnterpriseName());
updateApply.setCatalogId(applyLogEntity.getCatalogId());
updateApply.setRecordStatus(YesNoEnum.YES.getValue());
updateApply.setUpdateTime(new Date());
applyLogService.update(updateApply);
}
}
\ No newline at end of file
......@@ -4,12 +4,22 @@ import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.common.code.ProcessStatusEnum;
import com.mortals.xhx.common.code.StatusEnum;
import com.mortals.xhx.common.utils.StringUtils;
import com.mortals.xhx.module.certificate.model.CertificateDocumentEntity;
import com.mortals.xhx.module.certificate.model.vo.CertificateDocumentPdu;
import com.mortals.xhx.module.child.model.ChildLicenseEntity;
import com.mortals.xhx.module.child.model.ChildLicenseQuery;
import com.mortals.xhx.module.child.service.ChildLicenseService;
import com.mortals.xhx.module.record.dao.RetainLogDao;
import com.mortals.xhx.module.record.model.ApplyLogEntity;
import com.mortals.xhx.module.record.model.RetainLogEntity;
import com.mortals.xhx.module.record.model.RetainLogQuery;
import com.mortals.xhx.module.record.service.RetainLogService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
......@@ -25,6 +35,9 @@ import java.util.List;
@Service("retainLogService")
public class RetainLogServiceImpl extends AbstractCRUDServiceImpl<RetainLogDao, RetainLogEntity, Long> implements RetainLogService {
@Autowired
private ChildLicenseService childLicenseService;
@Override
protected RetainLogEntity findBefore(RetainLogEntity entity, PageInfo pageInfo, Context context) throws AppException {
RetainLogQuery query = new RetainLogQuery();
......@@ -44,4 +57,39 @@ public class RetainLogServiceImpl extends AbstractCRUDServiceImpl<RetainLogDao,
return query;
}
@Override
protected void findAfter(RetainLogEntity params, PageInfo pageInfo, Context context, List<RetainLogEntity> list) throws AppException {
if(CollectionUtils.isNotEmpty(list)){
for(RetainLogEntity entity:list){
List<ChildLicenseEntity> childLicenseList = childLicenseService.find(new ChildLicenseQuery().applyId(entity.getApplyId()));
// if(CollectionUtils.isEmpty(childLicenseList)){
// entity.setProcessStatus("0/0");
// }else {
// Map<Integer, List<ChildLicenseEntity>> group = childLicenseList.stream().collect(Collectors.groupingBy(x -> x.getProcessStatus()));
// int pCount = CollectionUtils.isEmpty(group.get(1)) ? 0 : group.get(1).size();
// entity.setProcessStatus(pCount + "/" + childLicenseList.size());
// }
int childSum = 0;
int pCount = 0;
List<CertificateDocumentPdu> documentEntityList = new ArrayList<>();
for(ChildLicenseEntity item:childLicenseList){
CertificateDocumentEntity documentEntity = new CertificateDocumentEntity();
BeanUtils.copyProperties(item,documentEntity);
documentEntity.setId(item.getDocumentId());
documentEntity.setStatus(StatusEnum.DISABLE.getValue());
if(item.getChildStatus()==StatusEnum.ENABLE.getValue()){
documentEntity.setStatus(StatusEnum.ENABLE.getValue());
childSum++;
if(item.getProcessStatus()== ProcessStatusEnum.已处理.getValue().intValue()){
pCount++;
}
}
CertificateDocumentPdu pdu = new CertificateDocumentPdu();
BeanUtils.copyProperties(documentEntity, pdu);
documentEntityList.add(pdu);
}
entity.setProcessStatus(pCount + "/" + childSum);
}
}
}
}
\ No newline at end of file
......@@ -9,6 +9,8 @@ import com.mortals.framework.utils.poi.ExcelUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.base.system.user.model.UserQuery;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.common.code.*;
import com.mortals.xhx.common.utils.ImportExcelUtil;
import com.mortals.xhx.common.utils.ReadExcelPictureUtil;
......@@ -39,6 +41,8 @@ import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
import static java.util.stream.Collectors.toMap;
/**
*
* 证照申请
......@@ -55,6 +59,8 @@ public class ApplyLogController extends BaseCRUDJsonBodyMappingController<ApplyL
@Autowired
private CertificateDocumentService certificateDocumentService;
@Autowired
private UserService userService;
public ApplyLogController(){
super.setModuleDesc( "证照申请");
......@@ -66,6 +72,7 @@ public class ApplyLogController extends BaseCRUDJsonBodyMappingController<ApplyL
this.addDict(model,"holderType", IBaseEnum.getEnumMap(HolderType.class));
this.addDict(model,"holderIdType", IBaseEnum.getEnumMap(HolderIdType.class));
this.addDict(model,"generateStatus", IBaseEnum.getEnumMap(GenerateStatus.class));
this.addDict(model, "createUserId", userService.find(new UserQuery()).stream().collect(toMap(x -> x.getId().toString(), y -> y.getRealName(), (o, n) -> n)));
super.init(model, context);
}
......
......@@ -4,6 +4,8 @@ import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.base.system.user.model.UserQuery;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.common.code.PrintStatus;
import com.mortals.xhx.common.code.StatusEnum;
import com.mortals.xhx.module.record.model.PrintLogEntity;
......@@ -13,6 +15,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
import static java.util.stream.Collectors.toMap;
/**
*
* 证照打印记录
......@@ -26,6 +31,8 @@ public class PrintLogController extends BaseCRUDJsonBodyMappingController<PrintL
@Autowired
private ParamService paramService;
@Autowired
private UserService userService;
public PrintLogController(){
super.setModuleDesc( "证照打印记录");
......@@ -35,6 +42,7 @@ public class PrintLogController extends BaseCRUDJsonBodyMappingController<PrintL
protected void init(Map<String, Object> model, Context context) {
this.addDict(model,"status", IBaseEnum.getEnumMap(StatusEnum.class));
this.addDict(model,"printStatus", IBaseEnum.getEnumMap(PrintStatus.class));
this.addDict(model, "createUserId", userService.find(new UserQuery()).stream().collect(toMap(x -> x.getId().toString(), y -> y.getRealName(), (o, n) -> n)));
super.init(model, context);
}
......
......@@ -2,6 +2,8 @@ package com.mortals.xhx.module.record.web;
import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.base.system.user.model.UserQuery;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.common.code.CertificateStatus;
import com.mortals.xhx.common.code.StatusEnum;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -25,6 +27,8 @@ import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
import static java.util.stream.Collectors.toMap;
/**
*
* 证照持有
......@@ -38,6 +42,8 @@ public class RetainLogController extends BaseCRUDJsonBodyMappingController<Retai
@Autowired
private ParamService paramService;
@Autowired
private UserService userService;
public RetainLogController(){
super.setModuleDesc( "证照持有");
......@@ -47,6 +53,7 @@ public class RetainLogController extends BaseCRUDJsonBodyMappingController<Retai
protected void init(Map<String, Object> model, Context context) {
this.addDict(model,"status", IBaseEnum.getEnumMap(StatusEnum.class));
this.addDict(model,"certificateStatus", IBaseEnum.getEnumMap(CertificateStatus.class));
this.addDict(model, "createUserId", userService.find(new UserQuery()).stream().collect(toMap(x -> x.getId().toString(), y -> y.getRealName(), (o, n) -> n)));
super.init(model, context);
}
......
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