diff --git a/adc-da-activiti/src/main/java/com/adc/da/common/ActDefineStartMap.java b/adc-da-activiti/src/main/java/com/adc/da/common/ActDefineStartMap.java index 39123211..e9500f7a 100644 --- a/adc-da-activiti/src/main/java/com/adc/da/common/ActDefineStartMap.java +++ b/adc-da-activiti/src/main/java/com/adc/da/common/ActDefineStartMap.java @@ -69,6 +69,8 @@ public class ActDefineStartMap { map.put("30","policyResearchGroupEnrollment"); // 政策课题参会流程 map.put("31","policyResearchGroupAttendMeeting"); + // 政策法规资料入库流程 + map.put("32","PolicyLawsInformationLibrary"); return map.get(type); } diff --git a/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/ActSarLawsInformationEOController.java b/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/ActSarLawsInformationEOController.java new file mode 100644 index 00000000..371a1e96 --- /dev/null +++ b/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/ActSarLawsInformationEOController.java @@ -0,0 +1,37 @@ +package com.adc.da.workFlow.controller; + +import com.adc.da.http.ResponseMessage; +import com.adc.da.http.Result; +import com.adc.da.workFlow.service.ActSarLawsInformationEOService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +/** + * @author tjzdw + * @description + * @date 2023/10/27 + */ +@Api("政策法规资料") +@RestController +@RequestMapping("/${restPath}/lawss/sarLawsTopic") +public class ActSarLawsInformationEOController { + + @Resource + private ActSarLawsInformationEOService informationEOService; + + @ApiOperation("政策法规资料入库") + @PostMapping("/processLawsRegulatoryInformation") + public ResponseMessage processCreateLawsInformation(String infoJson) throws Exception { + if (StringUtils.isBlank(infoJson)) { + return Result.error("传入数据json不能为空"); + } + informationEOService.processCreateLawsInformation(infoJson); + return Result.success("入库成功"); + } +} diff --git a/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarLawsInformationEOService.java b/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarLawsInformationEOService.java new file mode 100644 index 00000000..4a98ff62 --- /dev/null +++ b/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarLawsInformationEOService.java @@ -0,0 +1,48 @@ +package com.adc.da.workFlow.service; + +import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation; +import com.adc.da.slrs.sarLawsInformation.service.SarLawsInformationService; +import com.alibaba.fastjson.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; + +/** + * @author tjzdw + * @description + * @date 2023/10/27 + */ +@Service +@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class) +public class ActSarLawsInformationEOService { + + @Resource + private SarLawsInformationService informationService; + + private static final Logger logger = LoggerFactory.getLogger(ActSarLawsInformationEOService.class); + + public void processCreateLawsInformation(String lawsInformationInfo) { + SarLawsInformation sarLawsInformation = JSONObject.parseObject(lawsInformationInfo, SarLawsInformation.class); + JSONObject jsonObject = JSONObject.parseObject(lawsInformationInfo); + String applyUserId = jsonObject.getString("applyUserId"); + String applyUserName = jsonObject.getString("applyUserName"); + String approverId = jsonObject.getString("approverId"); + String approverName = jsonObject.getString("approverName"); + String createAndApproveBy = ""; + // 判断发起人和审批人是否相同 + if (approverId.equals(applyUserId)) { + createAndApproveBy = applyUserName + "(" + applyUserId + ")"; + }else { + createAndApproveBy = applyUserName + "(" + applyUserId + ")," + approverName + "(" + approverId + ")"; + } + sarLawsInformation.setCreateAndApproveBy(createAndApproveBy); + sarLawsInformation.setDownloadableBy(createAndApproveBy); + sarLawsInformation.setViewableBy(createAndApproveBy); + logger.info("政策法规资料入库:" + sarLawsInformation); + informationService.addLawsInformation(sarLawsInformation); + } +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java index edd27b26..5e66844c 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java @@ -9,6 +9,7 @@ import java.io.Serializable; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -26,78 +27,91 @@ public class SarLawsInformation extends BasePage implements Serializable { /** * 主键 */ + @ApiModelProperty(value = "主键") @TableId(value = "ID", type = IdType.ID_WORKER_STR) private String id; /** * 一级资料类别 */ + @ApiModelProperty("一级资料类别") @TableField(value = "FIRST_TYPE") private String firstType; /** * 一级资料类别名称 */ + @ApiModelProperty(value = "一级资料类别名称") @TableField(exist = false) private String firstTypeName; /** * 二级资料类别 */ + @ApiModelProperty(value = "二级资料类别") @TableField(value = "SECOND_TYPE") private String secondType; /** * 二级资料类别名称 */ + @ApiModelProperty(value = "二级资料类别名称") @TableField(exist = false) private String secondTypeName; /** * 三级资料类别 */ + @ApiModelProperty(value = "三级资料类别") @TableField(value = "THIRD_TYPE") private String thirdType; /** * 三级资料类别名称 */ + @ApiModelProperty(value = "三级资料类别名称") @TableField(exist = false) private String thirdTypeName; /** * 四级资料类别 */ + @ApiModelProperty(value = "四级资料类别") @TableField(value = "FOURTH_TYPE") private String fourthType; /** * 四级资料类别名称 */ + @ApiModelProperty(value = "四级资料类别名称") @TableField(exist = false) private String fourthTypeName; /** * 资料名称 */ + @ApiModelProperty(value = "资料名称") @TableField(value = "NAME") private String name; /** * 资料归属部门 */ + @ApiModelProperty(value = "资料归属部门") @TableField(value = "DEPARTMENT") private String department; /** * 作者 */ + @ApiModelProperty(value = "作者") @TableField(value = "AUTHOR") private String author; /** * 上传时间 */ + @ApiModelProperty(value = "上传时间") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") @TableField(value = "UPLOAD_TIME") @@ -106,59 +120,69 @@ public class SarLawsInformation extends BasePage implements Serializable { /** * 资料说明 */ + @ApiModelProperty(value = "资料说明") @TableField(value = "DESCRIPTION") private String description; /** * 资料文件 */ + @ApiModelProperty(value = "资料文件") @TableField(value = "INFORMATION_FILE") private String informationFile; /** * 资料文件名称 */ + @ApiModelProperty(value = "资料文件名称") @TableField(exist = false) private String informationFileName; /** * 可查看者,若设置为空则所有用户均可查看,若设置人员后,仅有可查看者可以查看文件信息。 */ + @ApiModelProperty(value = "可查看者") @TableField(value = "VIEWABLE_BY") private String viewableBy; /** * 可下载者,若设置为空则仅有上传人和审批人可以查看,若设置人员后,仅有可下载者可下载文件信息。 */ + @ApiModelProperty(value = "可下载者") @TableField(value = "DOWNLOADABLE_BY") private String downloadableBy; /** * 创建人和审批人 */ + @ApiModelProperty(value = "创建人和审批人") @TableField private String createAndApproveBy; /** * 树节点ID */ + @ApiModelProperty(value = "树节点ID") private String treeNodeId; /** * 树节点名称 */ + @ApiModelProperty(value = "树节点名称") @TableField(exist = false) private String treeNodeName; /** * 逻辑删除,0可用,1不可用 */ + @ApiModelProperty(value = "逻辑删除") @TableField(value = "VALID_FLAG") private Integer validFlag; /** * 创建时间 */ + @ApiModelProperty(value = "创建时间") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") @TableField(value = "CREATE_TIME") @@ -167,6 +191,7 @@ public class SarLawsInformation extends BasePage implements Serializable { /** * 修改时间 */ + @ApiModelProperty("修改时间") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") @TableField(value = "MODIFY_TIME") @@ -176,18 +201,21 @@ public class SarLawsInformation extends BasePage implements Serializable { /** * 排序字段 */ + @ApiModelProperty(value = "排序字段") @TableField(exist = false) private String sortField = "ID"; /** * 排序方式 */ + @ApiModelProperty(value = "排序方式") @TableField(exist = false) private String sortMode = "asc"; /** * 收藏ID */ + @ApiModelProperty(value = "收藏ID") @TableField(exist = false) private String collectId; diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java index d0ee784d..c806097b 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java @@ -17,6 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation; import com.adc.da.slrs.sarLawsInformation.service.SarLawsInformationService; import com.adc.da.slrs.sarLawsInformation.dao.SarLawsInformationDao; +import io.swagger.annotations.ApiModelProperty; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -173,7 +174,7 @@ public class SarLawsInformationServiceImpl extends ServiceImpl fileNameList = new ArrayList<>(); if (StringUtils.isNotBlank(newValue)) { @@ -226,10 +228,13 @@ public class SarLawsInformationServiceImpl extends ServiceImpl