update 标准法规入库/变更流程-返回数据做翻译

This commit is contained in:
liao
2023-11-09 14:18:41 +08:00
parent a4c543c141
commit c31e70ed4b
4 changed files with 27 additions and 5 deletions
@@ -1,8 +1,5 @@
package com.jero.modules.activiti.process.fb.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.jero.modules.activiti.process.fb.entity.ProcessFbStandardConsultation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -1,6 +1,7 @@
package com.jero.modules.activiti.process.fb.service.impl;
import com.alibaba.fastjson.JSON;
import com.jero.common.constant.enums.YesOrNoEnum;
import com.jero.common.util.UUIDUtils;
import com.jero.modules.activiti.enums.ProcessTypeEnum;
import com.jero.modules.activiti.process.fb.common.ProcessDefinitionKey;
@@ -13,10 +14,14 @@ import com.jero.modules.activiti.process.fb.util.ObjectToMapUtil;
import com.jero.modules.activiti.process.fb.vo.ProcessInfoVO;
import com.jero.modules.laws.common.constant.FieldCommon;
import com.jero.modules.laws.common.constant.ResultCommon;
import com.jero.modules.laws.common.mapper.LawsCommonMapper;
import com.jero.modules.laws.common.service.ILawsCommonService;
import com.jero.modules.laws.common.util.CurrentUserUtil;
import com.jero.modules.tag.entity.LawsTag;
import com.jero.modules.tag.enums.TableNameEnum;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jero.common.exception.JeroBootException;
@@ -24,8 +29,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
@@ -43,6 +50,8 @@ public class ProcessFbEntryChangeServiceImpl extends ServiceImpl<ProcessFbEntryC
private IProcessHandleService processHandleService;
@Resource
private ILawsCommonService lawsCommonService;
@Resource
private LawsCommonMapper lawsCommonMapper;
/**
* @Author: liao
@@ -203,7 +212,15 @@ public class ProcessFbEntryChangeServiceImpl extends ServiceImpl<ProcessFbEntryC
ProcessInfoVO processInfoVO = processHandleService.queryProcessInfoVO(draftId, processInstanceId);
ProcessFbEntryChange processFbEntryChange = getById(processInfoVO.getBusinessId());
Map<String, Object> map = JSON.parseObject(processFbEntryChange.getBusinessJson(), Map.class);
processFbEntryChange.setBusinessMap(map);
// 处理字典翻译
List<LawsTag> fieldList = lawsCommonMapper.getFieldList(TableNameEnum.getTableName(processFbEntryChange.getSource()));
// 新增编辑显示
fieldList = fieldList.stream().filter(lawsTag -> YesOrNoEnum.YES.getValue()
.equals(lawsTag.getIsShowFormCreate().toString())).collect(Collectors.toList());
Map<String, Object> stringObjectMap = lawsCommonService.processResultMap(map, fieldList);
processFbEntryChange.setBusinessMap(stringObjectMap);
processInfoVO.setBusinessInfoDTO(processFbEntryChange);
return processInfoVO;
}
@@ -90,6 +90,13 @@ public interface ILawsCommonService {
**/
Map<String, Object> getByIdAndModule(String id, String module, String type, String standardNumber);
/**
* @Author: liao
* @Date: 2023/11/9 14:16
* @Description: 对返回数据做处理
**/
public Map<String, Object> processResultMap(Map<String, Object> initMap, List<LawsTag> fieldList);
/**
* @Author: liao
* @Date: 2023/8/24 13:52
@@ -349,7 +349,8 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
* @Date: 2023/8/25 11:52
* @Description: 对返回的数据做处理(详情页)
**/
private Map<String, Object> processResultMap(Map<String, Object> initMap, List<LawsTag> fieldList) {
@Override
public Map<String, Object> processResultMap(Map<String, Object> initMap, List<LawsTag> fieldList) {
List<SysDictItem> dictItemList = getDictItemList(fieldList);
Map<String, Object> resultMap = new LinkedHashMap<>();
String id = (String) initMap.get("id");