From 170ed31ead893f4720c19b933f9b3d2a63b656b0 Mon Sep 17 00:00:00 2001 From: liaoxuwei <5789413@qq.com> Date: Tue, 8 Nov 2022 15:07:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AF=81=E7=85=A7=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E6=A1=A3=E6=A1=88=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- certificate-manager/doc/api.md | 69 +++++++++++++++++++ .../mortals/xhx/common/code/OperTypeEnum.java | 62 +++++++++++++---- .../impl/CertificateClassifyServiceImpl.java | 4 +- .../module/record/model/vo/ApplyLogVo.java | 7 +- .../record/service/ApplyLogService.java | 9 +++ .../service/impl/ApplyLogServiceImpl.java | 28 ++++++++ .../module/record/web/ApplyLogController.java | 21 ++++++ 7 files changed, 182 insertions(+), 18 deletions(-) diff --git a/certificate-manager/doc/api.md b/certificate-manager/doc/api.md index 36593e8..bbf0eab 100644 --- a/certificate-manager/doc/api.md +++ b/certificate-manager/doc/api.md @@ -2142,6 +2142,75 @@ data|object|鏁版嵁瀵硅薄 ``` +### 鏌ヨ璇佺収鐢宠妗f淇℃伅 + +**璇锋眰URL:** apply/log/record + +**璇锋眰鏂瑰紡:** POST + +**鍐呭绫诲瀷:** application/json;charset=utf-8 + +**绠€瑕佹弿杩�:** 鏌ヨ璇佺収鐢宠妗f淇℃伅 + +**璇锋眰鍙傛暟:** + +鍙傛暟鍚嶇О|绫诲瀷|蹇呭~|鎻忚堪 +:---|:---|:---|:------ +id|Long|鏄瘄涓婚敭 + +**璇锋眰鏍蜂緥:** +``` + { + "id":1 + } + +``` +**鍝嶅簲鍙傛暟:** + +鍙傛暟鍚嶇О|鍙傛暟绫诲瀷|鎻忚堪 +:---|:---|:------ +code|Integer|缁撴灉鐮侊紙-1.澶辫触锛�1.鎴愬姛锛� +msg|String|娑堟伅 +data|array|缁撴灉闆嗗垪琛� +  id|Long|搴忓彿锛屼富閿紝鑷闀� +  recordId|Long|璇佺収妗fID +  catalogId|Long|璇佺収鐩綍ID +  catalogCode|String|璇佺収鐩綍缂栧彿 +  catalogName|String|鐩綍鍚嶇О +  certificateCode|String|璇佷欢缂栧彿 +  certificateName|String|璇佷欢鍚嶇О +  issueTime|Date|棰佸彂鏃堕棿 +  pickerName|String|鍙栦欢浜哄鍚� +  pickerIDCardNo|String|鍙栦欢浜鸿瘉浠跺彿鐮� +  holderType|Integer|鎸佹湁鑰呯被鍨嬶紝1锛氳嚜鐒朵汉锛�2锛氭硶浜猴紝3锛氳嚜鐒朵汉娉曚汉 +  holderIdType|Integer|鎸佹湁鑰呰瘉浠剁被鍨嬶紝1锛氳韩浠借瘉锛�2锛氱粍缁囨満鏋勪唬鐮佺瓑 +  holderName|String|鎸佹湁鑰呭悕绉� +  holderIDCardNo|String|鎸佹湁鑰呰瘉浠跺彿鐮� +  enterpriseName|String|浼佷笟鍚嶇О +  validityStart|Date|鏈夋晥鏈熻捣濮� +  validityEnd|Date|鏈夋晥鏈熸埅姝� +  privateID|String|涓撶綉ID +  certificateUrl|String|璇佷欢闄勪欢鍦板潃 +  previewUrl|String|璇佷欢棰勮鍦板潃 +  formContent|String|璇佺収妯℃澘姝f湰琛ㄥ崟鍐呭 +  formTemplate|String|璇佺収妯℃澘姝f湰琛ㄥ崟鍐呭 +  generateStatus|Integer|鐢熸垚鐘舵€�1鏈敓鎴�2宸茬敓鎴� +  operType|Integer|妗f鎿嶄綔绫诲瀷1鏂板2鍙樻洿 +  createUserId|Long|鍒涘缓鐢ㄦ埛 +  createTime|Date|鍒涘缓鏃堕棿 +  updateUserId|Long|鏇存柊鐢ㄦ埛 +  updateTime|Date|鏇存柊鏃堕棿 +dict|object|瀛楀吀瀵硅薄 + +**鍝嶅簲娑堟伅鏍蜂緥:** +``` +{ + "code":1, + "data":{ + } +} +``` + ## 璇佺収鎵撳嵃璁板綍 ### 鏌ヨ璇佺収鎵撳嵃璁板綍鍒楄〃 diff --git a/certificate-manager/src/main/java/com/mortals/xhx/common/code/OperTypeEnum.java b/certificate-manager/src/main/java/com/mortals/xhx/common/code/OperTypeEnum.java index edccb58..190d1ee 100644 --- a/certificate-manager/src/main/java/com/mortals/xhx/common/code/OperTypeEnum.java +++ b/certificate-manager/src/main/java/com/mortals/xhx/common/code/OperTypeEnum.java @@ -1,35 +1,71 @@ package com.mortals.xhx.common.code; +import com.mortals.framework.ap.SysConstains; +import com.mortals.framework.common.IBaseEnum; + import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; /** * Created by chendilin on 2018/3/7. */ -public enum OperTypeEnum { +public enum OperTypeEnum implements IBaseEnum { - SAVE(0,"鏂板"), - UPDATE(1,"淇敼"), - DELETE(2,"鍒犻櫎"), - OTHER(-1,"鍏跺畠"); + SAVE(0,"鏂板", SysConstains.STYLE_DEFAULT), + UPDATE(1,"淇敼", SysConstains.STYLE_DEFAULT), + DELETE(2,"鍒犻櫎", SysConstains.STYLE_DEFAULT), + OTHER(-1,"鍏跺畠", SysConstains.STYLE_DEFAULT); private int value; - private String msg; + private String desc; + private String style; - private OperTypeEnum(int value,String msg) { + OperTypeEnum(int value, String desc, String style) { this.value = value; - this.msg = msg; + this.desc = desc; + this.style = style; } + @Override public int getValue() { return this.value; } - public static Map<String,String> getEnumMap(){ - Map<String,String> resultMap = new HashMap<>(); - OperTypeEnum[] operTypeEnum = OperTypeEnum.values(); - for (OperTypeEnum typeEnum : operTypeEnum) { - resultMap.put(String.valueOf(typeEnum.value),typeEnum.msg); + public String getDesc() { + return desc; + } + + public String getStyle() + { + return style; + } + + public static OperTypeEnum getByValue(int value) { + for (OperTypeEnum e : OperTypeEnum.values()) { + if (e.getValue() == value) { + return e; + } + } + return null; + } + + public static Map<String,String> getEnumMap(int... eItem) { + Map<String,String> resultMap= new LinkedHashMap<String,String>(); + for (OperTypeEnum item : OperTypeEnum.values()) { + try{ + boolean hasE = false; + for (int e : eItem){ + if(item.getValue()==e){ + hasE = true; + break; + } + } + if(!hasE){ + resultMap.put(item.getValue()+"", item.getDesc()); + } + }catch(Exception ex){ + } } return resultMap; } diff --git a/certificate-manager/src/main/java/com/mortals/xhx/module/certificate/service/impl/CertificateClassifyServiceImpl.java b/certificate-manager/src/main/java/com/mortals/xhx/module/certificate/service/impl/CertificateClassifyServiceImpl.java index f3e4e06..fb5a4a3 100644 --- a/certificate-manager/src/main/java/com/mortals/xhx/module/certificate/service/impl/CertificateClassifyServiceImpl.java +++ b/certificate-manager/src/main/java/com/mortals/xhx/module/certificate/service/impl/CertificateClassifyServiceImpl.java @@ -36,7 +36,9 @@ public class CertificateClassifyServiceImpl extends AbstractCRUDServiceImpl<Cert throw new AppException("鍒嗙被鍚嶇О閲嶅"); } entity.setTotal(0); - entity.setSort(0); + if(entity.getSort()==null){ + entity.setSort(0); + } entity.setShowFront(0); entity.setClassifyType(1); } diff --git a/certificate-manager/src/main/java/com/mortals/xhx/module/record/model/vo/ApplyLogVo.java b/certificate-manager/src/main/java/com/mortals/xhx/module/record/model/vo/ApplyLogVo.java index 1e21965..8879549 100644 --- a/certificate-manager/src/main/java/com/mortals/xhx/module/record/model/vo/ApplyLogVo.java +++ b/certificate-manager/src/main/java/com/mortals/xhx/module/record/model/vo/ApplyLogVo.java @@ -18,8 +18,7 @@ public class ApplyLogVo extends BaseEntityLong { /** 鏌ヨ鏉′欢 */ private String query; - /** - * 璇佺収鐩綍缂栧彿 - */ - private String catalogCode; + /** 鎿嶄綔绫诲瀷鍚嶇О */ + private String operTypeName; + } \ No newline at end of file diff --git a/certificate-manager/src/main/java/com/mortals/xhx/module/record/service/ApplyLogService.java b/certificate-manager/src/main/java/com/mortals/xhx/module/record/service/ApplyLogService.java index 17f7cce..a5980bd 100644 --- a/certificate-manager/src/main/java/com/mortals/xhx/module/record/service/ApplyLogService.java +++ b/certificate-manager/src/main/java/com/mortals/xhx/module/record/service/ApplyLogService.java @@ -5,6 +5,8 @@ import com.mortals.framework.model.Context; import com.mortals.framework.service.ICRUDService; import com.mortals.xhx.module.record.model.ApplyLogEntity; +import java.util.List; + /** * ApplyLogService * @@ -30,4 +32,11 @@ public interface ApplyLogService extends ICRUDService<ApplyLogEntity,Long>{ void generateOriginal(ApplyLogEntity applyLogEntity, Context context) throws AppException; + /** + * 鍙樻洿璁板綍 + * @param applyId + * @return + * @throws AppException + */ + List<ApplyLogEntity> ApplyRecord(Long applyId) throws AppException; } \ No newline at end of file diff --git a/certificate-manager/src/main/java/com/mortals/xhx/module/record/service/impl/ApplyLogServiceImpl.java b/certificate-manager/src/main/java/com/mortals/xhx/module/record/service/impl/ApplyLogServiceImpl.java index fad979c..b774b4c 100644 --- a/certificate-manager/src/main/java/com/mortals/xhx/module/record/service/impl/ApplyLogServiceImpl.java +++ b/certificate-manager/src/main/java/com/mortals/xhx/module/record/service/impl/ApplyLogServiceImpl.java @@ -16,6 +16,8 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.mortals.framework.model.PageInfo; import com.mortals.xhx.base.system.upload.service.UploadService; +import com.mortals.xhx.base.system.user.model.UserEntity; +import com.mortals.xhx.base.system.user.service.UserService; import com.mortals.xhx.common.code.ClassifyType; import com.mortals.xhx.common.code.GenerateStatus; import com.mortals.xhx.common.code.OperTypeEnum; @@ -80,6 +82,9 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap @Autowired private RecordDao recordDao; + @Autowired + private UserService userService; + @Override protected ApplyLogEntity findBefore(ApplyLogEntity entity, PageInfo pageInfo, Context context) throws AppException { ApplyLogQuery query = new ApplyLogQuery(); @@ -246,6 +251,29 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap printWaitQueueService.creatWaitQueueByApply(applyLogEntity, GenerateStatus.ORIGINAL.getValue(),context); } + @Override + public List<ApplyLogEntity> ApplyRecord(Long applyId) throws AppException { + ApplyLogEntity applyLogEntity = this.dao.get(applyId); + if(applyLogEntity==null){ + throw new AppException("鏁版嵁涓嶅瓨鍦�"); + } + UserEntity userEntity = userService.get(applyLogEntity.getCreateUserId()); + ApplyLogEntity query = new ApplyLogEntity(); + query.setRecordId(applyLogEntity.getRecordId()); + List<ApplyLogEntity> list = dao.getList(query); + for(ApplyLogEntity entity:list){ + OperTypeEnum operTypeEnum = OperTypeEnum.getByValue(entity.getOperType()); + if(operTypeEnum!=null){ + entity.setOperTypeName(operTypeEnum.getDesc()+entity.getCertificateName()); + } + + if(userEntity!=null){ + entity.setCreateUserName(userEntity.getRealName()); + } + } + return list; + } + private String preview(DocTemplateVO docTemplate,Context context){ String rootPath = this.filePath.endsWith("/") ? this.filePath : this.filePath + "/"; //杞崲琛ㄥ崟鍙傛暟涓簃ap闆嗗悎 diff --git a/certificate-manager/src/main/java/com/mortals/xhx/module/record/web/ApplyLogController.java b/certificate-manager/src/main/java/com/mortals/xhx/module/record/web/ApplyLogController.java index 16bba8d..8d245d9 100644 --- a/certificate-manager/src/main/java/com/mortals/xhx/module/record/web/ApplyLogController.java +++ b/certificate-manager/src/main/java/com/mortals/xhx/module/record/web/ApplyLogController.java @@ -103,4 +103,25 @@ public class ApplyLogController extends BaseCRUDJsonBodyMappingController<ApplyL return ret; } + /** + * 妗f + */ + @PostMapping(value = "record") + @UnAuth + public Rest<Object> record(@RequestBody ApplyLogEntity applyLogEntity) { + Rest<Object> ret = new Rest(); + try { + List<ApplyLogEntity> list = this.service.ApplyRecord(applyLogEntity.getId()); + ret.setCode(VALUE_RESULT_SUCCESS); + ret.setMsg("鏌ヨ妗f鎴愬姛"); + ret.setData(list); + } catch (Exception e) { + log.error("鏌ヨ妗f寮傚父", e); + ret.setCode(VALUE_RESULT_FAILURE); + ret.setMsg(super.convertException(e)); + + } + return ret; + } + } \ No newline at end of file -- 2.24.3