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; package com.mortals.xhx.base.system.upload.web;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
...@@ -60,6 +61,7 @@ public class UploadController extends BaseController { ...@@ -60,6 +61,7 @@ public class UploadController extends BaseController {
String jsonStr = ""; String jsonStr = "";
try { try {
String filePath = uploadService.saveFileUpload(file, prePath, getCurUser()); String filePath = uploadService.saveFileUpload(file, prePath, getCurUser());
filePath = StrUtil.prependIfMissing(filePath, "/");
model.put("url", filePath); model.put("url", filePath);
model.put("fileName", file.getOriginalFilename()); model.put("fileName", file.getOriginalFilename());
model.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); model.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
...@@ -122,5 +124,4 @@ public class UploadController extends BaseController { ...@@ -122,5 +124,4 @@ public class UploadController extends BaseController {
} }
} }
} }
\ No newline at end of file
package com.mortals.xhx.module.certificate.model.vo; package com.mortals.xhx.module.certificate.model.vo;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.certificate.model.CertificateIndustryEntity; import com.mortals.xhx.module.certificate.model.CertificateIndustryEntity;
import lombok.Data;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -9,6 +11,7 @@ import java.util.List; ...@@ -9,6 +11,7 @@ import java.util.List;
* @author zxfei * @author zxfei
* @date 2022-10-14 * @date 2022-10-14
*/ */
@Data
public class CertificateIndustryVo extends BaseEntityLong { public class CertificateIndustryVo extends BaseEntityLong {
List<CertificateIndustryEntity> children;
} }
\ No newline at end of file
...@@ -36,4 +36,12 @@ public class CertificateIndustryServiceImpl extends AbstractCRUDServiceImpl<Cert ...@@ -36,4 +36,12 @@ public class CertificateIndustryServiceImpl extends AbstractCRUDServiceImpl<Cert
throw new AppException("行业名称重复"); 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; package com.mortals.xhx.module.certificate.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context; 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.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.annotation.DataPermission; import com.mortals.xhx.annotation.DataPermission;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.certificate.model.CertificateIndustryEntity; import com.mortals.xhx.module.certificate.model.CertificateIndustryEntity;
import com.mortals.xhx.module.certificate.service.CertificateIndustryService; import com.mortals.xhx.module.certificate.service.CertificateIndustryService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; 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.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map; 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 ...@@ -40,4 +52,54 @@ public class CertificateIndustryController extends BaseCRUDJsonBodyMappingContro
public Rest<Object> list(CertificateIndustryEntity query) { public Rest<Object> list(CertificateIndustryEntity query) {
return super.list(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; ...@@ -5,6 +5,8 @@ import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.annotation.DataPermission; import com.mortals.xhx.annotation.DataPermission;
import com.mortals.xhx.base.system.param.service.ParamService; 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.model.CertificateDocumentQuery;
import com.mortals.xhx.module.certificate.service.CertificateDocumentService; import com.mortals.xhx.module.certificate.service.CertificateDocumentService;
import com.mortals.xhx.module.device.model.DeviceEntity; import com.mortals.xhx.module.device.model.DeviceEntity;
...@@ -33,6 +35,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -33,6 +35,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*; import static com.mortals.framework.ap.SysConstains.*;
import static java.util.stream.Collectors.toMap;
import com.mortals.xhx.common.code.*; import com.mortals.xhx.common.code.*;
...@@ -49,6 +52,8 @@ public class ChildLicenseController extends BaseCRUDJsonBodyMappingController<Ch ...@@ -49,6 +52,8 @@ public class ChildLicenseController extends BaseCRUDJsonBodyMappingController<Ch
@Autowired @Autowired
private CertificateDocumentService certificateDocumentService; private CertificateDocumentService certificateDocumentService;
@Autowired
private UserService userService;
public ChildLicenseController() { public ChildLicenseController() {
super.setModuleDesc("行业许可子证"); super.setModuleDesc("行业许可子证");
...@@ -62,6 +67,7 @@ public class ChildLicenseController extends BaseCRUDJsonBodyMappingController<Ch ...@@ -62,6 +67,7 @@ public class ChildLicenseController extends BaseCRUDJsonBodyMappingController<Ch
this.addDict(model, "deleted", DeletedEnum.getEnumMap()); this.addDict(model, "deleted", DeletedEnum.getEnumMap());
this.addDict(model, "documentId", certificateDocumentService.find(new CertificateDocumentQuery()) this.addDict(model, "documentId", certificateDocumentService.find(new CertificateDocumentQuery())
.stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getDocumentName(), (o, n) -> n))); .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); super.init(model, context);
} }
...@@ -80,7 +86,7 @@ public class ChildLicenseController extends BaseCRUDJsonBodyMappingController<Ch ...@@ -80,7 +86,7 @@ public class ChildLicenseController extends BaseCRUDJsonBodyMappingController<Ch
query.setDeptId(deptId); query.setDeptId(deptId);
} }
} }
query.setChildStatus(ChildStatusEnum.启用.getValue());
super.doListBefore(query, model, context); super.doListBefore(query, model, context);
} }
......
package com.mortals.xhx.module.record.dao.ibatis; package com.mortals.xhx.module.record.dao.ibatis;
import com.mortals.framework.util.EntityUtil;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.record.dao.ApplyLogDao; import com.mortals.xhx.module.record.dao.ApplyLogDao;
import com.mortals.xhx.module.record.model.ApplyLogEntity; import com.mortals.xhx.module.record.model.ApplyLogEntity;
import java.util.Date; import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis; import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 证照申请DaoImpl DAO接口 * 证照申请DaoImpl DAO接口
* *
...@@ -16,6 +21,19 @@ import java.util.List; ...@@ -16,6 +21,19 @@ import java.util.List;
@Repository("applyLogDao") @Repository("applyLogDao")
public class ApplyLogDaoImpl extends BaseCRUDDaoMybatis<ApplyLogEntity,Long> implements 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,11 +11,11 @@ import com.mortals.framework.model.BaseEntityLong; ...@@ -11,11 +11,11 @@ import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.record.model.vo.ApplyLogVo; import com.mortals.xhx.module.record.model.vo.ApplyLogVo;
import lombok.Data; import lombok.Data;
/** /**
* 证照申请实体对象 * 证照申请实体对象
* *
* @author zxfei * @author zxfei
* @date 2024-07-28 * @date 2024-07-31
*/ */
@Data @Data
public class ApplyLogEntity extends ApplyLogVo { public class ApplyLogEntity extends ApplyLogVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -152,6 +152,14 @@ public class ApplyLogEntity extends ApplyLogVo { ...@@ -152,6 +152,14 @@ public class ApplyLogEntity extends ApplyLogVo {
* 制证机关 * 制证机关
*/ */
private String authority; private String authority;
/**
* 附件名称
*/
private String annexName;
/**
* 附件地址
*/
private String annexUrl;
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
...@@ -202,5 +210,7 @@ public class ApplyLogEntity extends ApplyLogVo { ...@@ -202,5 +210,7 @@ public class ApplyLogEntity extends ApplyLogVo {
this.businessPlace = ""; this.businessPlace = "";
this.licenseProject = ""; this.licenseProject = "";
this.authority = ""; this.authority = "";
this.annexName = "";
this.annexUrl = "";
} }
} }
\ No newline at end of file
...@@ -4,11 +4,11 @@ import java.util.Date; ...@@ -4,11 +4,11 @@ import java.util.Date;
import java.util.List; import java.util.List;
import com.mortals.xhx.module.record.model.ApplyLogEntity; import com.mortals.xhx.module.record.model.ApplyLogEntity;
/** /**
* 证照申请查询对象 * 证照申请查询对象
* *
* @author zxfei * @author zxfei
* @date 2024-07-28 * @date 2024-07-31
*/ */
public class ApplyLogQuery extends ApplyLogEntity { public class ApplyLogQuery extends ApplyLogEntity {
/** 开始 序号,主键,自增长 */ /** 开始 序号,主键,自增长 */
private Long idStart; private Long idStart;
...@@ -315,6 +315,16 @@ public class ApplyLogQuery extends ApplyLogEntity { ...@@ -315,6 +315,16 @@ public class ApplyLogQuery extends ApplyLogEntity {
/** 制证机关排除列表 */ /** 制证机关排除列表 */
private List <String> authorityNotList; private List <String> authorityNotList;
/** 附件名称 */
private List<String> annexNameList;
/** 附件名称排除列表 */
private List <String> annexNameNotList;
/** 附件地址 */
private List<String> annexUrlList;
/** 附件地址排除列表 */
private List <String> annexUrlNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */ /** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<ApplyLogQuery> orConditionList; private List<ApplyLogQuery> orConditionList;
...@@ -2078,6 +2088,70 @@ public class ApplyLogQuery extends ApplyLogEntity { ...@@ -2078,6 +2088,70 @@ public class ApplyLogQuery extends ApplyLogEntity {
this.authorityNotList = authorityNotList; this.authorityNotList = authorityNotList;
} }
/**
* 获取 附件名称
* @return annexNameList
*/
public List<String> getAnnexNameList(){
return this.annexNameList;
}
/**
* 设置 附件名称
* @param annexNameList
*/
public void setAnnexNameList(List<String> annexNameList){
this.annexNameList = annexNameList;
}
/**
* 获取 附件名称
* @return annexNameNotList
*/
public List<String> getAnnexNameNotList(){
return this.annexNameNotList;
}
/**
* 设置 附件名称
* @param annexNameNotList
*/
public void setAnnexNameNotList(List<String> annexNameNotList){
this.annexNameNotList = annexNameNotList;
}
/**
* 获取 附件地址
* @return annexUrlList
*/
public List<String> getAnnexUrlList(){
return this.annexUrlList;
}
/**
* 设置 附件地址
* @param annexUrlList
*/
public void setAnnexUrlList(List<String> annexUrlList){
this.annexUrlList = annexUrlList;
}
/**
* 获取 附件地址
* @return annexUrlNotList
*/
public List<String> getAnnexUrlNotList(){
return this.annexUrlNotList;
}
/**
* 设置 附件地址
* @param annexUrlNotList
*/
public void setAnnexUrlNotList(List<String> annexUrlNotList){
this.annexUrlNotList = annexUrlNotList;
}
/** /**
* 设置 序号,主键,自增长 * 设置 序号,主键,自增长
* @param id * @param id
...@@ -3095,6 +3169,44 @@ public class ApplyLogQuery extends ApplyLogEntity { ...@@ -3095,6 +3169,44 @@ public class ApplyLogQuery extends ApplyLogEntity {
return this; return this;
} }
/**
* 设置 附件名称
* @param annexName
*/
public ApplyLogQuery annexName(String annexName){
setAnnexName(annexName);
return this;
}
/**
* 设置 附件名称
* @param annexNameList
*/
public ApplyLogQuery annexNameList(List<String> annexNameList){
this.annexNameList = annexNameList;
return this;
}
/**
* 设置 附件地址
* @param annexUrl
*/
public ApplyLogQuery annexUrl(String annexUrl){
setAnnexUrl(annexUrl);
return this;
}
/**
* 设置 附件地址
* @param annexUrlList
*/
public ApplyLogQuery annexUrlList(List<String> annexUrlList){
this.annexUrlList = annexUrlList;
return this;
}
/** /**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) * 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList * @return orConditionList
......
package com.mortals.xhx.module.record.model; package com.mortals.xhx.module.record.model;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.ArrayList; import java.util.ArrayList;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -10,11 +11,11 @@ import com.mortals.framework.model.BaseEntityLong; ...@@ -10,11 +11,11 @@ import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.record.model.vo.RetainLogVo; import com.mortals.xhx.module.record.model.vo.RetainLogVo;
import lombok.Data; import lombok.Data;
/** /**
* 证照持有实体对象 * 证照持有实体对象
* *
* @author zxfei * @author zxfei
* @date 2024-07-28 * @date 2024-08-01
*/ */
@Data @Data
public class RetainLogEntity extends RetainLogVo { public class RetainLogEntity extends RetainLogVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -103,6 +104,46 @@ public class RetainLogEntity extends RetainLogVo { ...@@ -103,6 +104,46 @@ public class RetainLogEntity extends RetainLogVo {
* 制证机关 * 制证机关
*/ */
private String authority; 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 @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
...@@ -141,5 +182,15 @@ public class RetainLogEntity extends RetainLogVo { ...@@ -141,5 +182,15 @@ public class RetainLogEntity extends RetainLogVo {
this.businessPlace = ""; this.businessPlace = "";
this.licenseProject = ""; this.licenseProject = "";
this.authority = ""; 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; ...@@ -17,4 +17,6 @@ import java.util.List;
public class RetainLogVo extends BaseEntityLong { public class RetainLogVo extends BaseEntityLong {
/** 查询条件 */ /** 查询条件 */
private String query; private String query;
/** 子证联报状态 已联报数/子证总数 */
private String processStatus;
} }
\ No newline at end of file
...@@ -29,6 +29,7 @@ import com.mortals.xhx.module.certificate.pdu.ApplyLogPdu; ...@@ -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.CertificateCatalogService;
import com.mortals.xhx.module.certificate.service.CertificateClassifyService; import com.mortals.xhx.module.certificate.service.CertificateClassifyService;
import com.mortals.xhx.module.certificate.service.CertificateDocumentService; 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.ChildLicenseEntity;
import com.mortals.xhx.module.child.model.ChildLicenseQuery; import com.mortals.xhx.module.child.model.ChildLicenseQuery;
import com.mortals.xhx.module.child.service.ChildLicenseService; import com.mortals.xhx.module.child.service.ChildLicenseService;
...@@ -89,6 +90,8 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap ...@@ -89,6 +90,8 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
private UserService userService; private UserService userService;
@Autowired @Autowired
private ChildLicenseService childLicenseService; private ChildLicenseService childLicenseService;
@Autowired
private CertificateIndustryService certificateIndustryService;
@Override @Override
protected void removeAfter(Long[] ids, Context context,int result) throws AppException { protected void removeAfter(Long[] ids, Context context,int result) throws AppException {
...@@ -184,10 +187,18 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap ...@@ -184,10 +187,18 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
// if(StringUtils.isEmpty(entity.getAuthority())){ // if(StringUtils.isEmpty(entity.getAuthority())){
// throw new AppException("制证机关不能为空"); // throw new AppException("制证机关不能为空");
// } // }
if(StringUtils.isEmpty(entity.getSocialCode())){ if(entity.getId()==null) {
entity.setSocialCode(DateUtils.getCurrDateTime("yyyyMMddHHmmss")+RandomUtil.randomNumbers(4)); if (StringUtils.isEmpty(entity.getSocialCode())) {
entity.setSocialCode(DateUtils.getCurrDateTime("yyyyMMddHHmmss") + RandomUtil.randomNumbers(4));
//throw new AppException("统一社会信用代码不能为空"); //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())){ // if(StringUtils.isEmpty(entity.getLicenseProject())){
// throw new AppException("许可项目不能为空"); // throw new AppException("许可项目不能为空");
// } // }
...@@ -216,9 +227,12 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap ...@@ -216,9 +227,12 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
// formContentJson.put("i_14_制证机关",applyLogEntity.getAuthority()); // formContentJson.put("i_14_制证机关",applyLogEntity.getAuthority());
formContentJson.put("@qrcode_1_二维码",applyLogEntity.getSocialCode()); formContentJson.put("@qrcode_1_二维码",applyLogEntity.getSocialCode());
if(CollectionUtils.isNotEmpty(applyLogEntity.getChildCertificate())){ if(CollectionUtils.isNotEmpty(applyLogEntity.getChildCertificate())){
int index = 1;
for(int i = 0;i<applyLogEntity.getChildCertificate().size();i++){ for(int i = 0;i<applyLogEntity.getChildCertificate().size();i++){
int index = i+1; if(applyLogEntity.getChildCertificate().get(i).getStatus()==1) {
formContentJson.put("i_"+ index +"_子证",applyLogEntity.getChildCertificate().get(i).getShortName()); formContentJson.put("i_" + index + "_子证", applyLogEntity.getChildCertificate().get(i).getShortName());
index++;
}
} }
} }
applyLogEntity.setFormContent(formContentJson.toJSONString()); applyLogEntity.setFormContent(formContentJson.toJSONString());
...@@ -235,6 +249,8 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap ...@@ -235,6 +249,8 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
applyLogEntity.setCatalogCode(catalog.getCatalogCode()); applyLogEntity.setCatalogCode(catalog.getCatalogCode());
applyLogEntity.setCatalogName(catalog.getCatalogName()); applyLogEntity.setCatalogName(catalog.getCatalogName());
applyLogEntity.setFormTemplate(catalog.getFormContent()); applyLogEntity.setFormTemplate(catalog.getFormContent());
CertificateIndustryEntity industryEntity = certificateIndustryService.get(catalog.getIndustryId());
applyLogEntity.setIndustryName(industryEntity==null?"":industryEntity.getIndustryName());
DocTemplateVO docTemplate = new DocTemplateVO(catalog.getTemplateFileUrl(),applyLogEntity.getFormContent()); DocTemplateVO docTemplate = new DocTemplateVO(catalog.getTemplateFileUrl(),applyLogEntity.getFormContent());
try { try {
String rootPath = this.filePath.endsWith("/") ? this.filePath : this.filePath + "/"; String rootPath = this.filePath.endsWith("/") ? this.filePath : this.filePath + "/";
...@@ -430,7 +446,7 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap ...@@ -430,7 +446,7 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
log.info("Image path: " + imagepath); log.info("Image path: " + imagepath);
try { try {
PictureRenderData pictureRenderData = Pictures.ofStream(new FileInputStream(imagepath), PictureType.JPEG) PictureRenderData pictureRenderData = Pictures.ofStream(new FileInputStream(imagepath), PictureType.JPEG)
.size(100, 120).create(); .size(120, 120).create();
addMap.put(StrUtil.removePrefixIgnoreCase(entry.getKey(),"@"),pictureRenderData); addMap.put(StrUtil.removePrefixIgnoreCase(entry.getKey(),"@"),pictureRenderData);
//entry.setValue(pictureRenderData); //entry.setValue(pictureRenderData);
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
......
...@@ -19,7 +19,9 @@ import com.mortals.xhx.module.record.dao.PrintLogDao; ...@@ -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.PrintWaitQueueDao;
import com.mortals.xhx.module.record.dao.RetainLogDao; import com.mortals.xhx.module.record.dao.RetainLogDao;
import com.mortals.xhx.module.record.model.*; import com.mortals.xhx.module.record.model.*;
import com.mortals.xhx.module.record.service.ApplyLogService;
import com.mortals.xhx.module.record.service.PrintWaitQueueService; import com.mortals.xhx.module.record.service.PrintWaitQueueService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -58,6 +60,8 @@ public class PrintWaitQueueServiceImpl extends AbstractCRUDServiceImpl<PrintWait ...@@ -58,6 +60,8 @@ public class PrintWaitQueueServiceImpl extends AbstractCRUDServiceImpl<PrintWait
private CertificateClassifyService certificateClassifyService; private CertificateClassifyService certificateClassifyService;
@Autowired @Autowired
private ParamService paramService; private ParamService paramService;
@Autowired
private ApplyLogService applyLogService;
@Override @Override
protected void findAfter(PrintWaitQueueEntity entity, Context context, List<PrintWaitQueueEntity> list) throws AppException { protected void findAfter(PrintWaitQueueEntity entity, Context context, List<PrintWaitQueueEntity> list) throws AppException {
...@@ -153,17 +157,10 @@ public class PrintWaitQueueServiceImpl extends AbstractCRUDServiceImpl<PrintWait ...@@ -153,17 +157,10 @@ public class PrintWaitQueueServiceImpl extends AbstractCRUDServiceImpl<PrintWait
} }
private void doPrintSuccess(PrintWaitQueueEntity waitQueueEntity){ 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(); PrintLogEntity printLogEntity = new PrintLogEntity();
BeanUtils.copyProperties(waitQueueEntity, printLogEntity, BeanUtil.getNullPropertyNames(waitQueueEntity)); BeanUtils.copyProperties(waitQueueEntity, printLogEntity, BeanUtil.getNullPropertyNames(waitQueueEntity));
...@@ -175,7 +172,28 @@ public class PrintWaitQueueServiceImpl extends AbstractCRUDServiceImpl<PrintWait ...@@ -175,7 +172,28 @@ public class PrintWaitQueueServiceImpl extends AbstractCRUDServiceImpl<PrintWait
printLogEntity.setCreateTime(now); printLogEntity.setCreateTime(now);
printLogEntity.setPrintStatus(PrintStatus.SUCCESS.getValue()); printLogEntity.setPrintStatus(PrintStatus.SUCCESS.getValue());
printLogEntity.setStatusRemark(PrintStatus.SUCCESS.getDesc()); printLogEntity.setStatusRemark(PrintStatus.SUCCESS.getDesc());
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); retainLogDao.insert(retainLogEntity);
}
printLogDao.insert(printLogEntity); printLogDao.insert(printLogEntity);
CertificateCatalogEntity catalogEntity = certificateCatalogService.get(waitQueueEntity.getCatalogId()); CertificateCatalogEntity catalogEntity = certificateCatalogService.get(waitQueueEntity.getCatalogId());
CertificateClassifyQuery query = new CertificateClassifyQuery(); CertificateClassifyQuery query = new CertificateClassifyQuery();
...@@ -183,7 +201,13 @@ public class PrintWaitQueueServiceImpl extends AbstractCRUDServiceImpl<PrintWait ...@@ -183,7 +201,13 @@ public class PrintWaitQueueServiceImpl extends AbstractCRUDServiceImpl<PrintWait
query.setTotalIncrement(1); query.setTotalIncrement(1);
query.setUpdateTime(now); query.setUpdateTime(now);
certificateClassifyService.update(query); 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; ...@@ -4,12 +4,22 @@ import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; 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.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.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.RetainLogEntity;
import com.mortals.xhx.module.record.model.RetainLogQuery; import com.mortals.xhx.module.record.model.RetainLogQuery;
import com.mortals.xhx.module.record.service.RetainLogService; import com.mortals.xhx.module.record.service.RetainLogService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -25,6 +35,9 @@ import java.util.List; ...@@ -25,6 +35,9 @@ import java.util.List;
@Service("retainLogService") @Service("retainLogService")
public class RetainLogServiceImpl extends AbstractCRUDServiceImpl<RetainLogDao, RetainLogEntity, Long> implements RetainLogService { public class RetainLogServiceImpl extends AbstractCRUDServiceImpl<RetainLogDao, RetainLogEntity, Long> implements RetainLogService {
@Autowired
private ChildLicenseService childLicenseService;
@Override @Override
protected RetainLogEntity findBefore(RetainLogEntity entity, PageInfo pageInfo, Context context) throws AppException { protected RetainLogEntity findBefore(RetainLogEntity entity, PageInfo pageInfo, Context context) throws AppException {
RetainLogQuery query = new RetainLogQuery(); RetainLogQuery query = new RetainLogQuery();
...@@ -44,4 +57,39 @@ public class RetainLogServiceImpl extends AbstractCRUDServiceImpl<RetainLogDao, ...@@ -44,4 +57,39 @@ public class RetainLogServiceImpl extends AbstractCRUDServiceImpl<RetainLogDao,
return query; 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; ...@@ -9,6 +9,8 @@ import com.mortals.framework.utils.poi.ExcelUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.base.system.upload.service.UploadService; 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.code.*;
import com.mortals.xhx.common.utils.ImportExcelUtil; import com.mortals.xhx.common.utils.ImportExcelUtil;
import com.mortals.xhx.common.utils.ReadExcelPictureUtil; import com.mortals.xhx.common.utils.ReadExcelPictureUtil;
...@@ -39,6 +41,8 @@ import com.alibaba.fastjson.JSONObject; ...@@ -39,6 +41,8 @@ import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*; import static com.mortals.framework.ap.SysConstains.*;
import static java.util.stream.Collectors.toMap;
/** /**
* *
* 证照申请 * 证照申请
...@@ -55,6 +59,8 @@ public class ApplyLogController extends BaseCRUDJsonBodyMappingController<ApplyL ...@@ -55,6 +59,8 @@ public class ApplyLogController extends BaseCRUDJsonBodyMappingController<ApplyL
@Autowired @Autowired
private CertificateDocumentService certificateDocumentService; private CertificateDocumentService certificateDocumentService;
@Autowired
private UserService userService;
public ApplyLogController(){ public ApplyLogController(){
super.setModuleDesc( "证照申请"); super.setModuleDesc( "证照申请");
...@@ -66,6 +72,7 @@ public class ApplyLogController extends BaseCRUDJsonBodyMappingController<ApplyL ...@@ -66,6 +72,7 @@ public class ApplyLogController extends BaseCRUDJsonBodyMappingController<ApplyL
this.addDict(model,"holderType", IBaseEnum.getEnumMap(HolderType.class)); this.addDict(model,"holderType", IBaseEnum.getEnumMap(HolderType.class));
this.addDict(model,"holderIdType", IBaseEnum.getEnumMap(HolderIdType.class)); this.addDict(model,"holderIdType", IBaseEnum.getEnumMap(HolderIdType.class));
this.addDict(model,"generateStatus", IBaseEnum.getEnumMap(GenerateStatus.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); super.init(model, context);
} }
......
...@@ -4,6 +4,8 @@ import com.mortals.framework.common.IBaseEnum; ...@@ -4,6 +4,8 @@ import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; 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.PrintStatus;
import com.mortals.xhx.common.code.StatusEnum; import com.mortals.xhx.common.code.StatusEnum;
import com.mortals.xhx.module.record.model.PrintLogEntity; import com.mortals.xhx.module.record.model.PrintLogEntity;
...@@ -13,6 +15,9 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -13,6 +15,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.Map; import java.util.Map;
import static java.util.stream.Collectors.toMap;
/** /**
* *
* 证照打印记录 * 证照打印记录
...@@ -26,6 +31,8 @@ public class PrintLogController extends BaseCRUDJsonBodyMappingController<PrintL ...@@ -26,6 +31,8 @@ public class PrintLogController extends BaseCRUDJsonBodyMappingController<PrintL
@Autowired @Autowired
private ParamService paramService; private ParamService paramService;
@Autowired
private UserService userService;
public PrintLogController(){ public PrintLogController(){
super.setModuleDesc( "证照打印记录"); super.setModuleDesc( "证照打印记录");
...@@ -35,6 +42,7 @@ public class PrintLogController extends BaseCRUDJsonBodyMappingController<PrintL ...@@ -35,6 +42,7 @@ public class PrintLogController extends BaseCRUDJsonBodyMappingController<PrintL
protected void init(Map<String, Object> model, Context context) { protected void init(Map<String, Object> model, Context context) {
this.addDict(model,"status", IBaseEnum.getEnumMap(StatusEnum.class)); this.addDict(model,"status", IBaseEnum.getEnumMap(StatusEnum.class));
this.addDict(model,"printStatus", IBaseEnum.getEnumMap(PrintStatus.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); super.init(model, context);
} }
......
...@@ -2,6 +2,8 @@ package com.mortals.xhx.module.record.web; ...@@ -2,6 +2,8 @@ package com.mortals.xhx.module.record.web;
import com.mortals.framework.common.IBaseEnum; import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; 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.CertificateStatus;
import com.mortals.xhx.common.code.StatusEnum; import com.mortals.xhx.common.code.StatusEnum;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -25,6 +27,8 @@ import java.util.Arrays; ...@@ -25,6 +27,8 @@ import java.util.Arrays;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*; import static com.mortals.framework.ap.SysConstains.*;
import static java.util.stream.Collectors.toMap;
/** /**
* *
* 证照持有 * 证照持有
...@@ -38,6 +42,8 @@ public class RetainLogController extends BaseCRUDJsonBodyMappingController<Retai ...@@ -38,6 +42,8 @@ public class RetainLogController extends BaseCRUDJsonBodyMappingController<Retai
@Autowired @Autowired
private ParamService paramService; private ParamService paramService;
@Autowired
private UserService userService;
public RetainLogController(){ public RetainLogController(){
super.setModuleDesc( "证照持有"); super.setModuleDesc( "证照持有");
...@@ -47,6 +53,7 @@ public class RetainLogController extends BaseCRUDJsonBodyMappingController<Retai ...@@ -47,6 +53,7 @@ public class RetainLogController extends BaseCRUDJsonBodyMappingController<Retai
protected void init(Map<String, Object> model, Context context) { protected void init(Map<String, Object> model, Context context) {
this.addDict(model,"status", IBaseEnum.getEnumMap(StatusEnum.class)); this.addDict(model,"status", IBaseEnum.getEnumMap(StatusEnum.class));
this.addDict(model,"certificateStatus", IBaseEnum.getEnumMap(CertificateStatus.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); 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