feat(标准解读流程): 获取条款数据接口

This commit is contained in:
yjz
2024-07-05 16:52:33 +08:00
parent 4a09887562
commit 71c3ef87bb
10 changed files with 154 additions and 15 deletions
@@ -1,13 +1,12 @@
package com.jero.common.system.vo;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@@ -17,12 +16,12 @@ public class DictModel implements Serializable{
public DictModel() {
}
public DictModel(String value, String text) {
this.value = value;
this.text = text;
}
/**
* 字典value
*/
@@ -31,6 +30,10 @@ public class DictModel implements Serializable{
* 字典文本
*/
private String text;
/**
* 是否置灰(1:是 0:否)
*/
private String isDisabled;
/**
* 特殊用途: JgEditableTable
@@ -5,9 +5,11 @@ import com.jero.common.api.vo.ResultCommon;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.aspect.annotation.Translation;
import com.jero.common.constant.CommonConstant;
import com.jero.common.system.vo.DictModel;
import com.jero.common.util.MessageUtils;
import com.jero.common.util.SnowflakeUtils;
import com.jero.modules.activiti.process.standardinterpret.dto.StandardInterpretFlowDTO;
import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpretClause;
import com.jero.modules.activiti.process.standardinterpret.service.StandardInterpretFlowService;
import com.jero.modules.activiti.process.standardinterpret.vo.StandardInterpretFlowVO;
import io.swagger.annotations.Api;
@@ -49,6 +51,29 @@ public class StandardInterpretFlowController {
return String.valueOf(SnowflakeUtils.snowflake());
}
/**
* 标准解读流程-通过标准id查询分解单列表
*
* @return
*/
@AutoLog(value = "标准解读流程-通过标准id查询分解单列表")
@ApiOperation(value="标准解读流程-通过标准id查询分解单列表", notes="标准解读流程-通过标准id查询分解单列表")
@GetMapping(value = "/getFileByStandardId")
public Result<List<DictModel>> queryFileByStandardId(String standardId) {
return Result.OK(standardInterpretFlowService.queryFileByStandardId(standardId));
}
/**
* 标准解读流程-查询条款列表
* @return
*/
@AutoLog(value = "标准解读流程-查询条款列表", operateType = CommonConstant.OPERATE_TYPE_1)
@ApiOperation(value="标准解读流程-查询条款列表", notes="标准解读流程-查询条款列表")
@GetMapping(value = "/getClauseList")
public Result<List<ProcessStandardInterpretClause>> getClauseList(String standardId,String fileType) {
return Result.OK(standardInterpretFlowService.getClauseList(standardId, fileType));
}
/**
* 标准解读流程-流程发起
* @param standardInterpretFlowDTO 标准解读流程对象
@@ -1,6 +1,8 @@
package com.jero.modules.activiti.process.standardinterpret.service;
import com.jero.common.system.vo.DictModel;
import com.jero.modules.activiti.process.standardinterpret.dto.StandardInterpretFlowDTO;
import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpretClause;
import com.jero.modules.activiti.process.standardinterpret.vo.StandardInterpretFlowVO;
import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.task.Task;
@@ -71,4 +73,19 @@ public interface StandardInterpretFlowService {
void demo(Map<String, Object> map);
List<Task> getTaskId(String processInstanceId);
/**
* 查询条款列表
* @param standardId
* @param fileType
* @return
*/
List<ProcessStandardInterpretClause> getClauseList(String standardId, String fileType);
/**
* 通过标准id查询分解单列表
* @param standardId
* @return
*/
List<DictModel> queryFileByStandardId(String standardId);
}
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.jero.common.constant.enums.YesOrNoEnum;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.vo.DictModel;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.SnowflakeUtils;
import com.jero.modules.activiti.common.ActivitiCommon;
@@ -33,8 +34,13 @@ import com.jero.modules.activiti.process.standardinterpret.vo.StandardInterpretF
import com.jero.modules.activiti.service.ProcessAllService;
import com.jero.modules.activiti.service.ProcessApprovalRecordService;
import com.jero.modules.activiti.service.ProcessNodeLinkService;
import com.jero.modules.laws.documenttool.entity.LawsDocumentSplit;
import com.jero.modules.laws.documenttool.mapper.DocumentSplitMapper;
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
import com.jero.modules.split.entity.SarFileSplitInfoEO;
import com.jero.modules.split.service.ISarFileSplitInfoService;
import com.jero.modules.system.service.ISysDictService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.ProcessEngines;
@@ -76,6 +82,9 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
private final ILawsDomesticStandardService lawsDomesticStandardService;
private final ProcessStandardInterpretClauseSublistController processStandardInterpretClauseSublist;
private final IProcessHandleService processHandleService;
private final ISarFileSplitInfoService sarFileSplitInfoService;
private final DocumentSplitMapper documentSplitMapper;
private final ISysDictService sysDictService;
@Override
public void flowStart(StandardInterpretFlowDTO standardInterpretFlowDTO) {
@@ -444,6 +453,44 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
.list();
}
@Override
public List<ProcessStandardInterpretClause> getClauseList(String standardId, String fileType) {
List<ProcessStandardInterpretClause> list = new ArrayList<>();
SarFileSplitInfoEO sarFileSplitInfoEO =
sarFileSplitInfoService.getOne(new LambdaQueryWrapper<SarFileSplitInfoEO>()
.eq(SarFileSplitInfoEO::getStandardId, standardId)
.eq(SarFileSplitInfoEO::getFileType, fileType)
.isNull(SarFileSplitInfoEO::getPublishBeforeId), false);
if (!Objects.isNull(sarFileSplitInfoEO)){
LawsDocumentSplit lawsDocumentSplit = new LawsDocumentSplit();
list = documentSplitMapper.selectClauseList(lawsDocumentSplit);
// 添加标准数据
LawsDomesticStandard lawsDomesticStandard = lawsDomesticStandardService.getById(standardId);
ProcessStandardInterpretClause processStandardInterpretClause = new ProcessStandardInterpretClause();
processStandardInterpretClause.setItemNum(lawsDomesticStandard.getStandardNumber());
processStandardInterpretClause.setItemTitle(lawsDomesticStandard.getStandardName());
list.add(0, processStandardInterpretClause);
}
return list;
}
@Override
public List<DictModel> queryFileByStandardId(String standardId) {
LambdaUpdateWrapper<SarFileSplitInfoEO> queryWrapper = new LambdaUpdateWrapper<>();
queryWrapper.eq(SarFileSplitInfoEO::getStandardId, standardId);
List<SarFileSplitInfoEO> list = sarFileSplitInfoService.list(queryWrapper);
List<DictModel> dictItems = sysDictService.getDictItems("process_manuscript");
for (DictModel dictItem : dictItems) {
if (list.stream().anyMatch(sarFileSplitInfoEO -> sarFileSplitInfoEO.getFileType().equals(dictItem.getValue()))){
dictItem.setIsDisabled(YesOrNoEnum.NO.getValue());
}else {
dictItem.setIsDisabled(YesOrNoEnum.YES.getValue());
}
}
return dictItems;
}
@Override
public void flowSave(StandardInterpretFlowDTO standardInterpretFlowDTO) {
// 处理业务数据
@@ -541,6 +588,14 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
map.put(StandardInterpretCommon.INTERPRETING_PEOPLE, new ArrayList<>(interpretPersonIdList));
processStandardInterpretClauseSublistService.saveBatch(processStandardInterpretClauseSublists);
}else {
// 保存会签人员、审核人员、批准人员
processStandardInterpretService.updateById(processStandardInterpret);
map.put(StandardInterpretCommon.JOINTLY_SIGN_LIST,
processStandardInterpret.getCountersignPersonIds());
map.put(StandardInterpretCommon.DEPARTMENT_MANAGER,
Arrays.asList(processStandardInterpret.getUploader().split(",")));
map.put(StandardInterpretCommon.TECHNICAL_OFFICER,
processStandardInterpret.getApprovePersonId());
// 不分发
processStandardInterpretClauseSublistService
.saveOrUpdateBatch(processStandardInterpretClauseSublistList);
@@ -2,25 +2,25 @@ package com.jero.modules.laws.common.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jero.common.api.vo.Result;
import com.jero.common.api.vo.ResultCommon;
import com.jero.common.aspect.annotation.DictPoint;
import com.jero.common.exception.JeroBootException;
import com.jero.common.util.MessageUtils;
import com.jero.common.api.vo.ResultCommon;
import com.jero.modules.laws.common.service.ILawsCommonService;
import com.jero.modules.laws.common.vo.LawsDictModel;
import com.jero.modules.laws.common.vo.ManyStandardSelectionBox;
import com.jero.modules.laws.common.vo.ManyStandardSelectionBoxVO;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.split.entity.SarFileSplitInfoEO;
import com.jero.modules.system.util.SysWaterMarkUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@@ -79,5 +79,4 @@ public class LawsCommonController {
public Result<List<SarFileSplitInfoEO>> getSplitsByStandardNumber(@RequestParam("standardNumber") String standardNumber) {
return Result.OK(lawsCommonService.getSplitsByStandardNumber(standardNumber));
}
}
@@ -55,15 +55,21 @@
resultType="com.jero.modules.laws.common.vo.ManyStandardSelectionBox">
select * from (
SELECT standard.id, standard.standard_number, standard.standard_name, standard.implementation_date,
standard.standard_state, standard.source, standard.create_time
standard.standard_state, standard.source, standard.create_time,
standard.new_product_impl_date, standard.new_auth_impl_date
<if test="vo.releaseSplitFlag != null and vo.releaseSplitFlag != ''">
, split.id AS split_info_id
</if>
FROM
(SELECT id, standard_number, standard_name, implementation_date, standard_state, '1' AS source, create_time
(SELECT id, standard_number, standard_name, implementation_date, standard_state, '1' AS source, create_time,
new_product_impl_date, new_auth_impl_date
FROM laws_domestic_standard
WHERE del_flag = 0
UNION ALL
SELECT id, standard_number, standard_name, release_date, standard_state, '3' AS source, create_time
SELECT id, standard_number, standard_name, release_date, standard_state, '3' AS source, create_time,
null as new_product_impl_date, null as new_auth_impl_date
FROM laws_enterprise_standard
WHERE del_flag = 0) standard
<if test="vo.releaseSplitFlag != null and vo.releaseSplitFlag != ''">
@@ -74,7 +80,9 @@
AND standard.id IS NOT NULL
AND split.del_flag = 0
AND split.publish_before_id IS NULL
AND split.split_status = '2'
<if test="vo.splitState != null and vo.splitState != ''">
AND split.split_status = #{vo.splitState}
</if>
</if>
<if test="vo.source != null and vo.source != ''">
AND standard.source LIKE CONCAT('%', #{vo.source}, '%')
@@ -37,6 +37,20 @@ public class ManyStandardSelectionBox {
@ApiModelProperty(value = "企标标准状态")
@Dict(dicCode = "enterprise_standard_state")
private java.lang.String esStandardState;
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "实施日期")
private java.util.Date implementationDate;
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "新认证车实施日期")
private java.lang.String newAuthImplDate;
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "新生产车实施日期")
private String newProductionImplementation;
@ApiModelProperty(value = "文档拆分id")
private java.lang.String splitInfoId;
public void setStandardState(String standardState) {
this.standardState = standardState;
@@ -31,4 +31,7 @@ public class ManyStandardSelectionBoxVO {
@ApiModelProperty(value = "标准状态")
private java.lang.String standardState;
@ApiModelProperty(value = "拆分状态")
private java.lang.String splitState;
}
@@ -5,10 +5,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpretClause;
import com.jero.modules.laws.documenttool.entity.*;
import com.jero.modules.split.entity.SarFileSplitInfoEO;
import com.jero.modules.split.entity.SarFileSplitItemsEO;
import com.jero.modules.split.entity.SarFileSplitItemsValEO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -19,6 +21,7 @@ import java.util.Map;
* @Date: 2023/10/12/23:03
* @Description: 文档拆分
*/
@Mapper
public interface DocumentSplitMapper extends BaseMapper<LawsDocumentSplit> {
/**
* 文档拆分-分页列表查询
@@ -210,4 +213,6 @@ public interface DocumentSplitMapper extends BaseMapper<LawsDocumentSplit> {
* @param infoId
*/
List<String> queryLawsDocumentSplitGroupByMenuId(@Param("infoId") String infoId);
List<ProcessStandardInterpretClause> selectClauseList(@Param("lawsDocumentSplit") LawsDocumentSplit lawsDocumentSplit);
}
@@ -262,6 +262,16 @@
WHERE count > 1
</select>
<select id="selectClauseList"
resultType="com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpretClause">
SELECT s.id clauseId,item_num,item_title,item_content
FROM laws_document_split s
LEFT JOIN SAR_FILE_SPLIT_MENU m ON s.MENU_ID = m.id
WHERE del_flag = 0
<if test="lawsDocumentSplit.infoId != null and lawsDocumentSplit.infoId != ''">
AND s.info_id = #{lawsDocumentSplit.infoId}
</if>
</select>
<update id="editDocumentSplitDetail">
UPDATE laws_document_split