56 changed files with 754 additions and 93 deletions
@ -0,0 +1 @@ |
|||||||
|
mvn install:install-file -DgroupId=com.aspose -DartifactId=aspose-words -Dversion=15.8.0 -Dfile="words-15.8.0.jar" -Dpackaging=jar |
||||||
Binary file not shown.
@ -0,0 +1,34 @@ |
|||||||
|
ALTER TABLE `negative`.`negative` |
||||||
|
ADD COLUMN `countersign_apply_id` int; |
||||||
|
|
||||||
|
INSERT INTO `negative`.`flow_action`(`id`, `action_key`, `flow_key`, `next_flow_key`, `button_label`, `button_type`, `plain`, `sort`, `action_name`, `validate_form`, `do_close`, `open_dialog`) VALUES (21, 'apply_countersign', 'second_approve', NULL, '单位会签', 'primary', 1, 1, '发起会签', 0, NULL, 1); |
||||||
|
INSERT INTO `negative`.`flow_action`(`id`, `action_key`, `flow_key`, `next_flow_key`, `button_label`, `button_type`, `plain`, `sort`, `action_name`, `validate_form`, `do_close`, `open_dialog`) VALUES (22, 'countersign', 'countersign', NULL, '提交会签', 'primary', 0, 1, '提交会签', 1, 1, 0); |
||||||
|
INSERT INTO `negative`.`flow_action`(`id`, `action_key`, `flow_key`, `next_flow_key`, `button_label`, `button_type`, `plain`, `sort`, `action_name`, `validate_form`, `do_close`, `open_dialog`) VALUES (23, 'apply_countersign', 'first_approve', '', '单位会签', 'primary', 1, 1, '发起会签', 0, NULL, 1); |
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE `negative_countersign` ( |
||||||
|
`id` int NOT NULL AUTO_INCREMENT, |
||||||
|
`countersign_apply_id` int NOT NULL, |
||||||
|
`negative_id` varchar(40) NOT NULL, |
||||||
|
`comments` text , |
||||||
|
`files` text , |
||||||
|
`depart_id` varchar(40) DEFAULT NULL, |
||||||
|
`depart_name` varchar(255) DEFAULT NULL, |
||||||
|
`create_time` datetime DEFAULT NULL, |
||||||
|
`creator` varchar(255) DEFAULT NULL, |
||||||
|
`creator_name` varchar(255) DEFAULT NULL, |
||||||
|
`state` varchar(255) DEFAULT NULL, |
||||||
|
`update_time` datetime DEFAULT NULL, |
||||||
|
PRIMARY KEY (`id`) |
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='单位会签表'; |
||||||
|
|
||||||
|
CREATE TABLE `negative_countersign_apply` ( |
||||||
|
`id` int NOT NULL AUTO_INCREMENT, |
||||||
|
`negative_id` varchar(40) NOT NULL, |
||||||
|
`requirement` text NOT NULL, |
||||||
|
`create_time` datetime NOT NULL, |
||||||
|
`creator` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL, |
||||||
|
`creator_name` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL, |
||||||
|
`create_depart_name` varchar(255) DEFAULT NULL, |
||||||
|
PRIMARY KEY (`id`) |
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='单位会签申请表'; |
||||||
@ -0,0 +1,11 @@ |
|||||||
|
package com.biutag.supervision.constants.enums; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author wxc |
||||||
|
* @date 2024/11/26 |
||||||
|
*/ |
||||||
|
public enum CountersignState { |
||||||
|
|
||||||
|
uncompleted, |
||||||
|
completed; |
||||||
|
} |
||||||
@ -0,0 +1,107 @@ |
|||||||
|
package com.biutag.supervision.flow.action; |
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil; |
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
||||||
|
import com.biutag.supervision.common.UserContextHolder; |
||||||
|
import com.biutag.supervision.constants.enums.*; |
||||||
|
import com.biutag.supervision.pojo.dto.ActionDto; |
||||||
|
import com.biutag.supervision.pojo.dto.flow.ApplyCountersignData; |
||||||
|
import com.biutag.supervision.pojo.entity.*; |
||||||
|
import com.biutag.supervision.pojo.model.UserAuth; |
||||||
|
import com.biutag.supervision.service.*; |
||||||
|
import lombok.RequiredArgsConstructor; |
||||||
|
import org.springframework.stereotype.Component; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
import java.util.List; |
||||||
|
import java.util.Set; |
||||||
|
import java.util.stream.Collectors; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author wxc |
||||||
|
* @date 2024/11/26 |
||||||
|
*/ |
||||||
|
@RequiredArgsConstructor |
||||||
|
@Component |
||||||
|
public class ApplyCountersignAction implements Action { |
||||||
|
|
||||||
|
private final NegativeCountersignApplyService countersignApplyService; |
||||||
|
|
||||||
|
private final NegativeCountersignService countersignService; |
||||||
|
|
||||||
|
private final NegativeService negativeService; |
||||||
|
|
||||||
|
private final NegativeWorkService workService; |
||||||
|
|
||||||
|
private final SupDepartService departService; |
||||||
|
|
||||||
|
@Override |
||||||
|
public void next(ActionDto actionDto) { |
||||||
|
ApplyCountersignData applyCountersignData = BeanUtil.toBean(actionDto.getData(), ApplyCountersignData.class); |
||||||
|
addWork(actionDto, applyCountersignData); |
||||||
|
addCountersign(actionDto.getNegativeId(), applyCountersignData); |
||||||
|
} |
||||||
|
|
||||||
|
private void addCountersign(String negativeId, ApplyCountersignData applyCountersignData) { |
||||||
|
UserAuth user = UserContextHolder.getCurrentUser(); |
||||||
|
NegativeCountersignApply countersignApply = new NegativeCountersignApply(); |
||||||
|
countersignApply.setNegativeId(negativeId) |
||||||
|
.setRequirement(applyCountersignData.getRequirement()) |
||||||
|
.setCreateTime(LocalDateTime.now()) |
||||||
|
.setCreator(user.getUserName()) |
||||||
|
.setCreatorName(user.getNickName()); |
||||||
|
countersignApplyService.save(countersignApply); |
||||||
|
Set<String> departIds = applyCountersignData.getCountersignDeparts().stream().map(ApplyCountersignData.CountersignDepart::getId).collect(Collectors.toSet()); |
||||||
|
|
||||||
|
List<NegativeCountersign> countersigns = departIds.stream().map(departId -> { |
||||||
|
NegativeCountersign countersign = new NegativeCountersign(); |
||||||
|
countersign.setCountersignApplyId(countersignApply.getId()) |
||||||
|
.setNegativeId(negativeId) |
||||||
|
.setDepartId(departId) |
||||||
|
.setDepartName(departService.getById(departId).getShortName()) |
||||||
|
.setState(CountersignState.uncompleted.name()) |
||||||
|
.setCreateTime(LocalDateTime.now()); |
||||||
|
return countersign; |
||||||
|
}).toList(); |
||||||
|
countersignService.saveBatch(countersigns); |
||||||
|
// 更新
|
||||||
|
negativeService.update(new LambdaUpdateWrapper<Negative>().eq(Negative::getId, negativeId) |
||||||
|
.set(Negative::getCountersignApplyId, countersignApply.getId()) |
||||||
|
.set(Negative::getUpdTime, LocalDateTime.now())); |
||||||
|
} |
||||||
|
|
||||||
|
private void addWork(ActionDto actionDto, ApplyCountersignData applyCountersignData) { |
||||||
|
List<NegativeWork> works = workService.list(actionDto.getNegativeId()); |
||||||
|
Set<String> departIds = applyCountersignData.getCountersignDeparts().stream() |
||||||
|
.map(ApplyCountersignData.CountersignDepart::getId) |
||||||
|
.collect(Collectors.toSet()); |
||||||
|
List<NegativeWork> filterWorks = works.stream().filter(item -> !FlowNodeEnum.COUNTERSIGN.getKey().equals(item.getFlowKey()) && departIds.contains(item.getDepartId())).toList(); |
||||||
|
if (!filterWorks.isEmpty()) { |
||||||
|
throw new RuntimeException(String.format("办理单位【%s】不能参与会签", filterWorks.stream().map(NegativeWork::getDepartName).collect(Collectors.joining("、")))); |
||||||
|
} |
||||||
|
List<String> workDepartIds = works.stream().filter(item -> FlowNodeEnum.COUNTERSIGN.getKey().equals(item.getFlowKey()) && departIds.contains(item.getDepartId())).map(NegativeWork::getDepartId).toList(); |
||||||
|
if (!workDepartIds.isEmpty()) { |
||||||
|
// 删除 之前work记录,避免重复
|
||||||
|
workService.remove(new LambdaQueryWrapper<NegativeWork>().eq(NegativeWork::getNegativeId, actionDto.getNegativeId()).in(NegativeWork::getDepartId, workDepartIds)); |
||||||
|
} |
||||||
|
Integer workId = actionDto.getWorkId(); |
||||||
|
NegativeWork work = workService.getById(workId); |
||||||
|
List<NegativeWork> negativeWorks = departIds.stream().map(departId -> { |
||||||
|
NegativeWork w = new NegativeWork(); |
||||||
|
SupDepart depart = departService.getById(departId); |
||||||
|
w.setRoleCode(depart.getLevel().equals(DepartLevelEnum.SECOND.getValue()) ? RoleCodeEnum.SECOND_ADMIN.getCode() : RoleCodeEnum.THREE_ADMIN.getCode()) |
||||||
|
.setStatus(WorkStatusEnum.todo.name()) |
||||||
|
.setDepartId(departId) |
||||||
|
.setNegativeId(actionDto.getNegativeId()) |
||||||
|
.setDepartName(depart.getShortName()) |
||||||
|
.setProblemSourcesCode(work.getProblemSourcesCode()) |
||||||
|
.setCreateTime(LocalDateTime.now()) |
||||||
|
.setUpdateTime(LocalDateTime.now()) |
||||||
|
.setFlowKey("countersign"); |
||||||
|
return w; |
||||||
|
}).toList(); |
||||||
|
workService.saveBatch(negativeWorks); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,61 @@ |
|||||||
|
package com.biutag.supervision.flow.action; |
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil; |
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
||||||
|
import com.biutag.supervision.constants.enums.CountersignState; |
||||||
|
import com.biutag.supervision.constants.enums.WorkStatusEnum; |
||||||
|
import com.biutag.supervision.pojo.dto.ActionDto; |
||||||
|
import com.biutag.supervision.pojo.dto.flow.CountersignData; |
||||||
|
import com.biutag.supervision.pojo.entity.Negative; |
||||||
|
import com.biutag.supervision.pojo.entity.NegativeCountersign; |
||||||
|
import com.biutag.supervision.pojo.entity.NegativeWork; |
||||||
|
import com.biutag.supervision.service.NegativeCountersignService; |
||||||
|
import com.biutag.supervision.service.NegativeService; |
||||||
|
import com.biutag.supervision.service.NegativeWorkService; |
||||||
|
import com.biutag.supervision.util.JSON; |
||||||
|
import lombok.RequiredArgsConstructor; |
||||||
|
import org.springframework.stereotype.Component; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
import java.util.Objects; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author wxc |
||||||
|
* @date 2024/11/26 |
||||||
|
*/ |
||||||
|
@RequiredArgsConstructor |
||||||
|
@Component |
||||||
|
public class CountersignAction implements Action { |
||||||
|
|
||||||
|
private final NegativeCountersignService countersignService; |
||||||
|
|
||||||
|
private final NegativeService negativeService; |
||||||
|
|
||||||
|
private final NegativeWorkService workService; |
||||||
|
|
||||||
|
@Override |
||||||
|
public void next(ActionDto actionDto) { |
||||||
|
CountersignData countersignData = BeanUtil.toBean(actionDto.getData(), CountersignData.class); |
||||||
|
addWork(actionDto.getWorkId()); |
||||||
|
updateCountersign(actionDto.getNegativeId(), actionDto.getWorkId(), countersignData); |
||||||
|
} |
||||||
|
|
||||||
|
public void updateCountersign(String negativeId, Integer workId, CountersignData countersignData) { |
||||||
|
Negative negative = negativeService.getById(negativeId); |
||||||
|
NegativeWork work = workService.getById(workId); |
||||||
|
countersignService.update(new LambdaUpdateWrapper<NegativeCountersign>() |
||||||
|
.eq(NegativeCountersign::getNegativeId, negativeId) |
||||||
|
.eq(NegativeCountersign::getCountersignApplyId, negative.getCountersignApplyId()) |
||||||
|
.eq(NegativeCountersign::getDepartId, work.getDepartId()) |
||||||
|
.set(NegativeCountersign::getComments, countersignData.getComments()) |
||||||
|
.set(NegativeCountersign::getFiles, Objects.isNull(countersignData.getFiles()) || countersignData.getFiles().isEmpty() ? null : |
||||||
|
JSON.toJSONString(countersignData.getFiles())) |
||||||
|
.set(NegativeCountersign::getState, CountersignState.completed.name()) |
||||||
|
.set(NegativeCountersign::getUpdateTime, LocalDateTime.now())); |
||||||
|
} |
||||||
|
|
||||||
|
public void addWork(Integer workId) { |
||||||
|
workService.update(new LambdaUpdateWrapper<NegativeWork>().eq(NegativeWork::getId, workId).set(NegativeWork::getStatus, WorkStatusEnum.done.name()).set(NegativeWork::getUpdateTime, LocalDateTime.now())); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,8 @@ |
|||||||
|
package com.biutag.supervision.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.biutag.supervision.pojo.entity.NegativeCountersignApply; |
||||||
|
|
||||||
|
public interface NegativeCountersignApplyMapper extends BaseMapper<NegativeCountersignApply> { |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,8 @@ |
|||||||
|
package com.biutag.supervision.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.biutag.supervision.pojo.entity.NegativeCountersign; |
||||||
|
|
||||||
|
public interface NegativeCountersignMapper extends BaseMapper<NegativeCountersign> { |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,35 @@ |
|||||||
|
package com.biutag.supervision.pojo.domain; |
||||||
|
|
||||||
|
import com.biutag.supervision.pojo.entity.NegativeCountersign; |
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
import lombok.experimental.Accessors; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author wxc |
||||||
|
* @date 2024/11/26 |
||||||
|
*/ |
||||||
|
@Accessors(chain = true) |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class CountersignApply { |
||||||
|
|
||||||
|
private Integer id; |
||||||
|
|
||||||
|
private String requirement; |
||||||
|
|
||||||
|
@JsonFormat(pattern = "YYYY-MM-dd HH:mm") |
||||||
|
private LocalDateTime createTime; |
||||||
|
|
||||||
|
private String creatorName; |
||||||
|
|
||||||
|
private String createDepartName; |
||||||
|
|
||||||
|
private List<NegativeCountersign> countersigns = new ArrayList<>(); |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,30 @@ |
|||||||
|
package com.biutag.supervision.pojo.dto.flow; |
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank; |
||||||
|
import jakarta.validation.constraints.Size; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author wxc |
||||||
|
* @date 2024/11/26 |
||||||
|
*/ |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class ApplyCountersignData { |
||||||
|
|
||||||
|
@NotBlank(message = "会签具体要求不能为空") |
||||||
|
private String requirement; |
||||||
|
|
||||||
|
@Size(min = 1, message = "参与会签单位不能少于1个") |
||||||
|
private List<CountersignDepart> countersignDeparts = new ArrayList<>(); |
||||||
|
|
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class CountersignDepart { |
||||||
|
private String id; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,23 @@ |
|||||||
|
package com.biutag.supervision.pojo.dto.flow; |
||||||
|
|
||||||
|
import com.biutag.supervision.pojo.vo.FileVo; |
||||||
|
import jakarta.validation.constraints.NotBlank; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author wxc |
||||||
|
* @date 2024/11/26 |
||||||
|
*/ |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class CountersignData { |
||||||
|
|
||||||
|
@NotBlank(message = "会签具体要求不能为空") |
||||||
|
private String comments; |
||||||
|
|
||||||
|
private List<FileVo> files; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,61 @@ |
|||||||
|
package com.biutag.supervision.pojo.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
import lombok.experimental.Accessors; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
|
||||||
|
@Accessors(chain = true) |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class NegativeCountersign { |
||||||
|
|
||||||
|
//
|
||||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||||
|
private Integer id; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("countersign_apply_id") |
||||||
|
private Integer countersignApplyId; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("negative_id") |
||||||
|
private String negativeId; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("comments") |
||||||
|
private String comments; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("files") |
||||||
|
private String files; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("depart_id") |
||||||
|
private String departId; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("depart_name") |
||||||
|
private String departName; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("create_time") |
||||||
|
private LocalDateTime createTime; |
||||||
|
|
||||||
|
private LocalDateTime updateTime; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("creator") |
||||||
|
private String creator; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("creator_name") |
||||||
|
private String creatorName; |
||||||
|
|
||||||
|
private String state; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,45 @@ |
|||||||
|
package com.biutag.supervision.pojo.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
import lombok.experimental.Accessors; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
|
||||||
|
@Accessors(chain = true) |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class NegativeCountersignApply { |
||||||
|
|
||||||
|
//
|
||||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||||
|
private Integer id; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("negative_id") |
||||||
|
private String negativeId; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("requirement") |
||||||
|
private String requirement; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("create_time") |
||||||
|
private LocalDateTime createTime; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("creator") |
||||||
|
private String creator; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("creator_name") |
||||||
|
private String creatorName; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("create_depart_name") |
||||||
|
private String createDepartName; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,28 @@ |
|||||||
|
package com.biutag.supervision.pojo.model; |
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author wxc |
||||||
|
* @date 2024/11/25 |
||||||
|
*/ |
||||||
|
@AllArgsConstructor |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class ExtensionApproveStepModel { |
||||||
|
|
||||||
|
private String title; |
||||||
|
|
||||||
|
private String comments; |
||||||
|
|
||||||
|
private String state; |
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") |
||||||
|
private LocalDateTime createTime; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,30 @@ |
|||||||
|
package com.biutag.supervision.service; |
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil; |
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||||
|
import com.biutag.supervision.pojo.domain.CountersignApply; |
||||||
|
import com.biutag.supervision.pojo.entity.NegativeCountersignApply; |
||||||
|
import com.biutag.supervision.mapper.NegativeCountersignApplyMapper; |
||||||
|
import lombok.RequiredArgsConstructor; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@RequiredArgsConstructor |
||||||
|
@Service |
||||||
|
public class NegativeCountersignApplyService extends ServiceImpl<NegativeCountersignApplyMapper, NegativeCountersignApply> { |
||||||
|
|
||||||
|
private final NegativeCountersignService countersignService; |
||||||
|
|
||||||
|
public List<CountersignApply> list(String negativeId) { |
||||||
|
List<NegativeCountersignApply> list = list(new LambdaQueryWrapper<NegativeCountersignApply>().eq(NegativeCountersignApply::getNegativeId, negativeId)); |
||||||
|
return list.stream().map(apply -> { |
||||||
|
CountersignApply countersignApply = new CountersignApply(); |
||||||
|
BeanUtil.copyProperties(apply, countersignApply); |
||||||
|
countersignApply.setCountersigns(countersignService.list(apply.getId())); |
||||||
|
return countersignApply; |
||||||
|
}).toList(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,19 @@ |
|||||||
|
package com.biutag.supervision.service; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||||
|
import com.biutag.supervision.pojo.entity.NegativeCountersign; |
||||||
|
import com.biutag.supervision.mapper.NegativeCountersignMapper; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@Service |
||||||
|
public class NegativeCountersignService extends ServiceImpl<NegativeCountersignMapper, NegativeCountersign> { |
||||||
|
|
||||||
|
public List<NegativeCountersign> list(Integer countersignApplyId) { |
||||||
|
return list(new LambdaQueryWrapper<NegativeCountersign>().eq(NegativeCountersign::getCountersignApplyId, countersignApplyId) |
||||||
|
.orderByAsc(NegativeCountersign::getState)); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,36 @@ |
|||||||
|
package com.biutag.supervision.util; |
||||||
|
|
||||||
|
import com.aspose.words.Document; |
||||||
|
import com.aspose.words.License; |
||||||
|
import com.aspose.words.SaveFormat; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream; |
||||||
|
import java.io.ByteArrayOutputStream; |
||||||
|
import java.io.InputStream; |
||||||
|
|
||||||
|
@Slf4j |
||||||
|
public class WordUtil { |
||||||
|
|
||||||
|
public static InputStream convertDocx(InputStream is) { |
||||||
|
getLicense(); |
||||||
|
try(ByteArrayOutputStream f = new ByteArrayOutputStream()) { |
||||||
|
Document doc = new Document(is); |
||||||
|
doc.save(f, SaveFormat.DOCX); |
||||||
|
return new ByteArrayInputStream(f.toByteArray()); |
||||||
|
} catch (Exception e) { |
||||||
|
throw new RuntimeException("docx转换异常:" + e.getMessage()); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public static boolean getLicense() { |
||||||
|
try (InputStream is = WordUtil.class.getResourceAsStream("/license/words.license.xml")){ |
||||||
|
License aposeLic = new License(); |
||||||
|
aposeLic.setLicense(is); |
||||||
|
return true; |
||||||
|
} catch (Exception e) { |
||||||
|
throw new RuntimeException(e.getMessage()); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,13 @@ |
|||||||
|
<License> |
||||||
|
<Data> |
||||||
|
<Products> |
||||||
|
<Product>Aspose.Total for Java</Product> |
||||||
|
<Product>Aspose.Words for Java</Product> |
||||||
|
</Products> |
||||||
|
<EditionType>Enterprise</EditionType> |
||||||
|
<SubscriptionExpiry>20991231</SubscriptionExpiry> |
||||||
|
<LicenseExpiry>20991231</LicenseExpiry> |
||||||
|
<SerialNumber>8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7</SerialNumber> |
||||||
|
</Data> |
||||||
|
<Signature>sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU=</Signature> |
||||||
|
</License> |
||||||
Loading…
Reference in new issue