Browse Source

优化

master
dimengzhe 2 years ago
parent
commit
831b271b7d
  1. 45
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesordersubmit/BusSalesOrderSubmitService.java
  2. 197
      anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow/FlowableRest.java
  3. 59
      anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flowtask/FlowTaskService.java
  4. 26
      anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysflowableconfig/SysFlowableConfig.java
  5. 26
      anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysflowableconfig/SysFlowableConfigFeign.java
  6. 12
      anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysflowableconfig/SysFlowableConfigFeignFallback.java
  7. 22
      anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysflowableconfig/SysFlowableConfigQuery.java
  8. 17
      anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysflowableconfig/SysFlowableConfigVvo.java
  9. 18
      anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysflowableconfig/SysFlowableConfigMapper.java
  10. 7
      anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysflowableconfig/SysFlowableConfigMapper.xml
  11. 29
      anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysflowableconfig/SysFlowableConfigRest.java
  12. 30
      anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysflowableconfig/SysFlowableConfigService.java
  13. 25
      doc/databases/portal_tables.sql

45
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesordersubmit/BusSalesOrderSubmitService.java

@ -24,12 +24,34 @@ public class BusSalesOrderSubmitService extends MybatisBaseService<BusSalesOrder
if (busSalesOrderSubmit == null) {
busSalesOrderSubmit = new BusSalesOrderSubmit();
BeanUtil.copyProperties(busSalesOrderSubmitDto, busSalesOrderSubmit, "sid");
if(StringUtils.isBlank(busSalesOrderSubmitDto.getDistributorName())){
if(StringUtils.isNotBlank(busSalesOrderSubmitDto.getDistributorNameTwo())){
busSalesOrderSubmit.setDistributorName(busSalesOrderSubmitDto.getDistributorNameTwo());
busSalesOrderSubmitDto.setDistributorPrice(busSalesOrderSubmitDto.getDistributorPriceTwo());
busSalesOrderSubmitDto.setDistributorNameTwo("");
busSalesOrderSubmitDto.setDistributorPriceTwo("");
busSalesOrderSubmit.setDistributorNameTwo("");
busSalesOrderSubmit.setDistributorSid(busSalesOrderSubmitDto.getDistributorSidTwo());
busSalesOrderSubmit.setDistributorSidTwo("");
busSalesOrderSubmit.setDistributorMobile(busSalesOrderSubmitDto.getDistributorMobileTwo());
busSalesOrderSubmit.setDistributorMobileTwo("");
busSalesOrderSubmit.setDistributorUnit(busSalesOrderSubmitDto.getDistributorUnitTwo());
busSalesOrderSubmit.setDistributorUnitTwo("");
}
}
BigDecimal priceBig = new BigDecimal("0");
BigDecimal priceAll = new BigDecimal("0");
BigDecimal priceBigTwo = new BigDecimal("0");
BigDecimal priceAllTwo = new BigDecimal("0");
if (StringUtils.isNotBlank(busSalesOrderSubmitDto.getDistributorPrice())) {
priceBig = new BigDecimal(busSalesOrderSubmitDto.getDistributorPrice());
busSalesOrderSubmit.setDistributorPrice(priceBig);
}
if (StringUtils.isNotBlank(busSalesOrderSubmitDto.getDistributorPriceTwo())) {
priceBigTwo = new BigDecimal(busSalesOrderSubmitDto.getDistributorPriceTwo());
busSalesOrderSubmit.setDistributorPriceTwo(priceBigTwo);
}
if (StringUtils.isNotBlank(busSalesOrderSubmitDto.getDistributorPriceAll())) {
priceAll = new BigDecimal(busSalesOrderSubmitDto.getDistributorPriceAll());
@ -39,12 +61,33 @@ public class BusSalesOrderSubmitService extends MybatisBaseService<BusSalesOrder
save(busSalesOrderSubmit);
} else {
BeanUtil.copyProperties(busSalesOrderSubmitDto, busSalesOrderSubmit);
if(StringUtils.isBlank(busSalesOrderSubmitDto.getDistributorName())){
if(StringUtils.isNotBlank(busSalesOrderSubmitDto.getDistributorNameTwo())){
busSalesOrderSubmit.setDistributorName(busSalesOrderSubmitDto.getDistributorNameTwo());
busSalesOrderSubmitDto.setDistributorPrice(busSalesOrderSubmitDto.getDistributorPriceTwo());
busSalesOrderSubmitDto.setDistributorNameTwo("");
busSalesOrderSubmitDto.setDistributorPriceTwo("");
busSalesOrderSubmit.setDistributorNameTwo("");
busSalesOrderSubmit.setDistributorPriceTwo(BigDecimal.ZERO);
busSalesOrderSubmit.setDistributorSid(busSalesOrderSubmitDto.getDistributorSidTwo());
busSalesOrderSubmit.setDistributorSidTwo("");
busSalesOrderSubmit.setDistributorMobile(busSalesOrderSubmitDto.getDistributorMobileTwo());
busSalesOrderSubmit.setDistributorMobileTwo("");
busSalesOrderSubmit.setDistributorUnit(busSalesOrderSubmitDto.getDistributorUnitTwo());
busSalesOrderSubmit.setDistributorUnitTwo("");
}
}
BigDecimal priceBig = new BigDecimal("0");
BigDecimal priceAll = new BigDecimal("0");
BigDecimal priceBigTwo = new BigDecimal("0");
BigDecimal priceAllTwo = new BigDecimal("0");
if (StringUtils.isNotBlank(busSalesOrderSubmitDto.getDistributorPrice())) {
priceBig = new BigDecimal(busSalesOrderSubmitDto.getDistributorPrice());
busSalesOrderSubmit.setDistributorPrice(priceBig);
}
if (StringUtils.isNotBlank(busSalesOrderSubmitDto.getDistributorPriceTwo())) {
priceBigTwo = new BigDecimal(busSalesOrderSubmitDto.getDistributorPriceTwo());
busSalesOrderSubmit.setDistributorPriceTwo(priceBigTwo);
}
if (StringUtils.isNotBlank(busSalesOrderSubmitDto.getDistributorPriceAll())) {
priceAll = new BigDecimal(busSalesOrderSubmitDto.getDistributorPriceAll());

197
anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow/FlowableRest.java

@ -359,8 +359,6 @@ public class FlowableRest implements FlowableFeign {
log.info("b:{}", b);
UpdateFlowFieldVo vo = new UpdateFlowFieldVo();
ResultBean rb = ResultBean.fireFail();
// Map<String, Object> formVariables = dto.getFormVariables();
String taskId = dto.getTaskId();
if (StringUtils.isBlank(taskId)) {
return rb.setMsg("taskId 不能为空!");
@ -368,27 +366,195 @@ public class FlowableRest implements FlowableFeign {
if (StringUtils.isBlank(dto.getBusinessSid())) {
return rb.setMsg("businessSid 不能为空!");
}
/*if(formVariables==null){
return rb.setMsg("业务参数集合 不能为空!");
}*/
if (dto.getFormVariables() == null)
dto.setFormVariables(new HashMap<String, Object>());
Map<String, Object> formVariables = dto.getFormVariables();
formVariables.put("businessSid", dto.getBusinessSid());
String nextUserSid = dto.getNextNodeUserSids();
boolean adminContains = false;
if (StringUtils.isBlank(nextUserSid)) {
ResultBean<UserAndOrgPath> nextNodeUserSidsOfSubmit = getNextNodeUserSidsOfSubmit(dto);
if (!nextNodeUserSidsOfSubmit.getSuccess()) {
// return rb.setMsg("nextUserSid 不能为空!");
//=================================添加系统个管理员自动审批
nextUserSid = "427a2fb0-60c5-409f-bea4-4eb441041ae6";
adminContains = true;
}else{
nextUserSid = nextNodeUserSidsOfSubmit.getData().getUserSid();
formVariables.put(BusinessVariables.ORGPATH, nextNodeUserSidsOfSubmit.getData().getOrgPath());
}
}
String comment = dto.getComment();
if (StringUtils.isBlank(comment)) {
comment = "";
}
String instanceId = dto.getInstanceId();
if (StringUtils.isBlank(instanceId)) {
return rb.setMsg("instanceId 不能为空!");
}
String userSid = dto.getUserSid();
if (StringUtils.isBlank(userSid)) {
return rb.setMsg("userSid 不能为空!");
}
String businessSid = dto.getBusinessSid();
if (StringUtils.isBlank(businessSid)) {
return rb.setMsg("业务sid 不能为空!");
}
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
if (Objects.isNull(task)) {
return rb.setMsg("任务不存在");
}
String assignee = task.getAssignee();
if (b && (StringUtils.isNotBlank(assignee) && assignee.indexOf(userSid) < 0)) {
return rb.setMsg("当前用户不是环节的待办人,不能进行办理操作!");
}
String nodeState = "";
String taskDefKey = "";
vo.setSid(businessSid);
if (DelegationState.PENDING.equals(task.getDelegationState())) {
taskService.addComment(taskId, instanceId,
FlowComment.DELEGATE.getType(), comment);
taskService.resolveTask(taskId, formVariables);
} else {
taskService.addComment(taskId, instanceId, FlowComment.NORMAL.getType(), comment);
log.error("taskid:{},userSid:{}", taskId, userSid);
log.error("formVariables:{}", JSON.toJSONString(formVariables));
taskService.setAssignee(taskId, userSid);
taskService.complete(taskId, formVariables);
//根据流程实例的id取最新的待办环节,给环节设置上用户sid
ResultBean<List<LatestTaskVo>> ll = flowtaskService.getLatestTasksNew(instanceId);
if (ll.getData().size() > 0) {
LatestTaskVo latestTaskVo = ll.getData().get(0);
String id_ = latestTaskVo.getId_();
taskService.setAssignee(id_, nextUserSid);
vo.setTaskId(id_);
//在act_ru_variable表中增加环节上的业务参数的变量
taskService.setVariablesLocal(id_, formVariables);
nodeState = latestTaskVo.getName_();
taskDefKey = latestTaskVo.getTask_def_key_();
} else {
nodeState = FlowComment.SETTLE.getRemark();
taskDefKey = "Event_end";
vo.setNodeState(FlowComment.SETTLE.getRemark());
}
}
if (adminContains) {
dto.setUserSid(nextUserSid);
dto.setTaskId(vo.getTaskId());
dto.setTaskDefKey(taskDefKey);
dto.setComment("系统管理员已自动审批");
return handleProsess(dto, false);
}
List<FlowElement> flowElements = processService.calApprovePath(dto.getModelId(), dto.getModelId(),
dto.getFormVariables());
boolean contains = false;
boolean adminSecondsContains = false;
for (int i = 0; i < flowElements.size(); i++) {
FlowElement flowElement = flowElements.get(i);
String id = flowElement.getId();
if (taskDefKey.equals(id) && i + 1 < flowElements.size()) {
FlowElement flowElement1 = flowElements.get(i + 1);
if (flowElement1 instanceof UserTask) {
UserTask userTask = (UserTask) flowElement1;
List<String> candidateGroups = userTask.getCandidateGroups();
List<SysUserVo> sysUserVoLists = new ArrayList<>();
//根据角色查询用户
for (String roleSid : candidateGroups) {
UserQuery userQuery = new UserQuery();
userQuery.setRoleSid(roleSid);
userQuery.setOrgSidPath(dto.getOrgSidPath());
ResultBean<List<SysUserVo>> userByRole = sysUserFeign.getUserByRole(userQuery);
boolean success = userByRole.getSuccess();
if (!success) {
continue;
}
sysUserVoLists.addAll(userByRole.getData());
}
//当前环节运营部总经理 刘丽艳 点击同意 下一环节 事业部副总经理 (nextUserSid) 和事业部总经理(sysUserVoLists.get(0).getSid())
//判断查询回来的用户的集合size是1 并且用户的sid和下一环节的用户的sid相同。
if (sysUserVoLists.size() == 1 && sysUserVoLists.get(0).getSid().equals(nextUserSid)) {
contains = true;
break;
}
//如果下一环节无用户,则默认系统管理员自动审批
if(sysUserVoLists.size() == 0 && StringUtils.isNotBlank(nextUserSid)){
contains = true;
break;
}
if(sysUserVoLists.size() == 0){
adminSecondsContains = true;
break;
}
}
}
if (contains) {
break;
}
if (adminSecondsContains) {
break;
}
}
if (contains) {
dto.setUserSid(nextUserSid);
dto.setTaskId(vo.getTaskId());
dto.setTaskDefKey(taskDefKey);
dto.setComment("因与下一级审批人相同,系统自动处理,需以下一级审批人审批意见为准!");
return handleProsess(dto, false);
}
if (adminSecondsContains) {
dto.setUserSid(nextUserSid);
dto.setTaskId(vo.getTaskId());
dto.setTaskDefKey(taskDefKey);
dto.setComment("系统管理员已自动审批");
return handleProsess(dto, false);
}
vo.setProcInsId(instanceId);
vo.setProcDefId(task.getProcessDefinitionId());
vo.setNodeState(nodeState);
vo.setTaskDefKey(taskDefKey);
vo.setNextNodeUserSids(nextUserSid);
return rb.success().setData(vo);
}
/**
* 未添加系统管理员自动审批功能
* @param dto
* @param b 是否连续跳转环节
* @return
*/
public ResultBean<UpdateFlowFieldVo> handleProsess111(BusinessVariables dto, boolean b) {
log.info("BusinessVariables:{}", JSONObject.toJSONString(dto));
log.info("b:{}", b);
UpdateFlowFieldVo vo = new UpdateFlowFieldVo();
ResultBean rb = ResultBean.fireFail();
String taskId = dto.getTaskId();
if (StringUtils.isBlank(taskId)) {
return rb.setMsg("taskId 不能为空!");
}
if (StringUtils.isBlank(dto.getBusinessSid())) {
return rb.setMsg("businessSid 不能为空!");
}
if (dto.getFormVariables() == null)
dto.setFormVariables(new HashMap<String, Object>());
Map<String, Object> formVariables = dto.getFormVariables();
formVariables.put("businessSid", dto.getBusinessSid());
String nextUserSid = dto.getNextNodeUserSids();
if (StringUtils.isBlank(nextUserSid)) {
ResultBean<UserAndOrgPath> nextNodeUserSidsOfSubmit = getNextNodeUserSidsOfSubmit(dto);
if (!nextNodeUserSidsOfSubmit.getSuccess()) {
return rb.setMsg("nextUserSid 不能为空!");
}else{
nextUserSid = nextNodeUserSidsOfSubmit.getData().getUserSid();
formVariables.put(BusinessVariables.ORGPATH, nextNodeUserSidsOfSubmit.getData().getOrgPath());
}
nextUserSid = nextNodeUserSidsOfSubmit.getData().getUserSid();
formVariables.put(BusinessVariables.ORGPATH, nextNodeUserSidsOfSubmit.getData().getOrgPath());
}
String comment = dto.getComment();
if (StringUtils.isBlank(comment)) {
comment = "";
//return rb.setMsg("comment 不能为空!");
}
String instanceId = dto.getInstanceId();
if (StringUtils.isBlank(instanceId)) {
@ -397,7 +563,6 @@ public class FlowableRest implements FlowableFeign {
String userSid = dto.getUserSid();
if (StringUtils.isBlank(userSid)) {
return rb.setMsg("userSid 不能为空!");
}
String businessSid = dto.getBusinessSid();
if (StringUtils.isBlank(businessSid)) {
@ -418,18 +583,12 @@ public class FlowableRest implements FlowableFeign {
if (DelegationState.PENDING.equals(task.getDelegationState())) {
taskService.addComment(taskId, instanceId,
FlowComment.DELEGATE.getType(), comment);
// Map<String,Object> values =(Map<String,Object>) formVariables.get("values");
taskService.resolveTask(taskId, formVariables);
} else {
taskService.addComment(taskId, instanceId, FlowComment.NORMAL.getType(), comment);
log.error("taskid:{},userSid:{}", taskId, userSid);
log.error("formVariables:{}", JSON.toJSONString(formVariables));
taskService.setAssignee(taskId, userSid);
//formVariables.remove("userSid");
/*for(Map.Entry<String, Object> entry:formVariables.entrySet()){
taskService.setVariable(taskId,entry.getKey(),entry.getValue());
System.out.println(entry.getKey()+"--->"+entry.getValue());
}*/
taskService.complete(taskId, formVariables);
//根据流程实例的id取最新的待办环节,给环节设置上用户sid
ResultBean<List<LatestTaskVo>> ll = flowtaskService.getLatestTasksNew(instanceId);
@ -438,13 +597,6 @@ public class FlowableRest implements FlowableFeign {
String id_ = latestTaskVo.getId_();
taskService.setAssignee(id_, nextUserSid);
vo.setTaskId(id_);
/* for(Map.Entry<String, Object> entry:formVariables.entrySet()){
taskService.setVariable(id_,entry.getKey(),entry.getValue());
taskService.setVariableLocal(id_,entry.getKey(),entry.getValue());
System.out.println(entry.getKey()+"--->"+entry.getValue());
}*/
// taskService.setVariables(id_,formVariables);
//在act_ru_variable表中增加环节上的业务参数的变量
taskService.setVariablesLocal(id_, formVariables);
nodeState = latestTaskVo.getName_();
@ -455,7 +607,6 @@ public class FlowableRest implements FlowableFeign {
vo.setNodeState(FlowComment.SETTLE.getRemark());
}
}
//ResultBean<FlowRecordVo> flowRecordVoResultBean = flowableService.flowRecord(dto.getInstanceId(), dto.getModelId());
List<FlowElement> flowElements = processService.calApprovePath(dto.getModelId(), dto.getModelId(),
dto.getFormVariables());
boolean contains = false;

59
anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flowtask/FlowTaskService.java

@ -311,6 +311,7 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
List<FlowTask> hisFlowList = new ArrayList<>();
for (HistoricActivityInstance histIns : list) {
if (StringUtils.isNotBlank(histIns.getTaskId())) {
boolean isStop = false;
FlowTask flowTask = new FlowTask();
flowTask.setTaskId(histIns.getTaskId());
flowTask.setTaskName(histIns.getActivityName());
@ -334,6 +335,9 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
List<SysUserVo> data1 = sysUserVoResultBean.getData();
List<TaskUserInfo> taskUserInfos=new ArrayList<>();
for( SysUserVo data:data1){
if("admin".equals(data.getName())){
isStop = true;
}
TaskUserInfo taskUserInfo=new TaskUserInfo();
taskUserInfo.setAssigneeName(data.getName());
taskUserInfo.setAssigneeSid(data.getSid());
@ -344,6 +348,10 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
}
flowTask.setTaskUserInfos(taskUserInfos);
}
if(isStop){
continue;
}
// 展示审批人员
List<HistoricIdentityLink> linksForTask = historyService.getHistoricIdentityLinksForTask(histIns.getTaskId());
StringBuilder stringBuilder = new StringBuilder();
@ -1341,7 +1349,24 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
flowTaskVo.setTargetKey(item.getId());
listResultBean_2= taskReject_(flowTaskVo, true);
}else{
taskService.setAssignee(id_, assignee_);
if("427a2fb0-60c5-409f-bea4-4eb441041ae6".equals(assignee_)){
flowTaskVo.setTaskId(id_);
flowTaskVo.setUserSid(assignee_);
flowTaskVo.setTargetKey(item.getId());
listResultBean_2= taskReject_(flowTaskVo, true);
}else{
if("427a2fb0-60c5-409f-bea4-4eb441041ae6".equals(flowTaskVo.getUserSid())){
flowTaskVo.setTaskId(id_);
flowTaskVo.setUserSid(assignee_);
flowTaskVo.setTargetKey(item.getId());
listResultBean_2= taskReject_(flowTaskVo, true);
}else{
taskService.setAssignee(id_, assignee_);
}
}
}
LatestTaskVo latestTaskVo = new LatestTaskVo();
latestTaskVo.setASSIGNEE_(item.getAssignee());
@ -1464,6 +1489,9 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
return new ResultBean<List<LatestTaskVo>>().fail().setMsg("流程找不到上一环节,撤回操作失败!").setData(new ArrayList<>());
}
HistoricTaskInstance historicTaskInstance1 = historyService.createHistoricTaskInstanceQuery().taskId(taskId).singleResult();
//==================================================添加
// historicTaskInstance1 = returnInstance(historicTaskInstance1);
//==================================================添加
String assignee = historicTaskInstance1.getAssignee();
String userSid = flowTaskVo.getUserSid();
ResultBean<FlowRecordVo> flowRecordVoResultBean = flowableService.flowRecord(flowTaskVo.getInstanceId(), flowTaskVo.getInstanceId());
@ -1482,6 +1510,25 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
String assigneeSid0 = taskUserInfo_0.getAssigneeSid();
if(!assigneeSid1.equals(assigneeSid0)){
/*if("427a2fb0-60c5-409f-bea4-4eb441041ae6".equals(assignee)){
FlowTask flowTask1 = flowList.get(1);
for(int i=1;i<flowList.size();i++){
FlowTask flowTask = flowList.get(i);
List<TaskUserInfo> taskUserInfos = flowTask.getTaskUserInfos();
TaskUserInfo taskUserInfo = taskUserInfos.get(0);
if(assigneeSid0.equals(taskUserInfo.getAssigneeSid())){
if(!FlowComment.RECALL.getType().equals( flowTask1.getComment().getType())){
ii++;
}
continue;
}else{
ybrsid=flowList.get(i).getTaskUserInfos().get(0).getAssigneeSid();
break;
}
}
}else{
ybrsid=assignee;
}*/
ybrsid=assignee;
}else{
FlowTask flowTask1 = flowList.get(1);
@ -1515,6 +1562,16 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
return revokeProcess(flowTaskVo,0);
}
public HistoricTaskInstance returnInstance(HistoricTaskInstance historicTaskInstance1){
if("427a2fb0-60c5-409f-bea4-4eb441041ae6".equals(historicTaskInstance1.getAssignee())){
String taskId = getTaskId(historicTaskInstance1.getTaskDefinitionKey(), historicTaskInstance1.getProcessInstanceId(), historicTaskInstance1.getProcessDefinitionId());
historicTaskInstance1 = historyService.createHistoricTaskInstanceQuery().taskId(taskId).singleResult();
return returnInstance(historicTaskInstance1);
}else{
return historicTaskInstance1;
}
}
// @Transactional(rollbackFor = Exception.class)
private ResultBean<List<LatestTaskVo>> revokeProcess_( String processInstanceId,
String assignee ) {

26
anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysflowableconfig/SysFlowableConfig.java

@ -0,0 +1,26 @@
package com.yxt.anrui.portal.api.sysflowableconfig;
import com.yxt.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @description: 转办设置
* @author: dimengzhe
* @date: 2023/6/17
**/
@Data
public class SysFlowableConfig extends BaseEntity {
private static final long serialVersionUID = 6324080869870694172L;
@ApiModelProperty("用户sid")
private String userSid;
@ApiModelProperty("转办人的sid")
private String chengeUserSid;
@ApiModelProperty("开始时间")
private Date startDate;
@ApiModelProperty("结束时间")
private Date endDate;
}

26
anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysflowableconfig/SysFlowableConfigFeign.java

@ -0,0 +1,26 @@
package com.yxt.anrui.portal.api.sysflowableconfig;
import com.yxt.common.core.result.ResultBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
/**
* @description: 转办设置
* @author: dimengzhe
* @date: 2023/6/17
**/
@Api(tags = "流程转办设置")
@FeignClient(
contextId = "anrui-portal-SysFlowableConfig",
name = "anrui-portal",
path = "v1/SysFlowableConfig",
fallback = SysFlowableConfigFeignFallback.class)
public interface SysFlowableConfigFeign {
@ApiOperation("查询是否有转办人 ")
@GetMapping("/selectByUserSid")
ResultBean<SysFlowableConfigVvo> selectByUserSid(@SpringQueryMap SysFlowableConfigQuery query);
}

12
anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysflowableconfig/SysFlowableConfigFeignFallback.java

@ -0,0 +1,12 @@
package com.yxt.anrui.portal.api.sysflowableconfig;
import org.springframework.stereotype.Component;
/**
* @description: 转办设置
* @author: dimengzhe
* @date: 2023/6/17
**/
@Component
public class SysFlowableConfigFeignFallback {
}

22
anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysflowableconfig/SysFlowableConfigQuery.java

@ -0,0 +1,22 @@
package com.yxt.anrui.portal.api.sysflowableconfig;
import com.yxt.common.core.query.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @description: 转办
* @author: dimengzhe
* @date: 2023/6/19
**/
@Data
public class SysFlowableConfigQuery implements Query {
private static final long serialVersionUID = -7197208684456288643L;
@ApiModelProperty("用户sid")
private String userSid;
@ApiModelProperty("当前时间")
private Date nowDate;
}

17
anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysflowableconfig/SysFlowableConfigVvo.java

@ -0,0 +1,17 @@
package com.yxt.anrui.portal.api.sysflowableconfig;
import com.yxt.common.core.vo.Vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @description: 转办
* @author: dimengzhe
* @date: 2023/6/19
**/
@Data
public class SysFlowableConfigVvo implements Vo {
private static final long serialVersionUID = -3291554285219440731L;
@ApiModelProperty("转办人sid")
private String changeUserSid;
}

18
anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysflowableconfig/SysFlowableConfigMapper.java

@ -0,0 +1,18 @@
package com.yxt.anrui.portal.biz.sysflowableconfig;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yxt.anrui.portal.api.sysflowableconfig.SysFlowableConfig;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
/**
* @description:
* @author: dimengzhe
* @date: 2023/6/17
**/
@Mapper
public interface SysFlowableConfigMapper extends BaseMapper<SysFlowableConfig> {
SysFlowableConfig selectByUserSid(@Param("userSid") String userSid, @Param("nowDate") Date nowDate);
}

7
anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysflowableconfig/SysFlowableConfigMapper.xml

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yxt.anrui.portal.biz.sysflowableconfig.SysFlowableConfigMapper">
<select id="selectByUserSid" resultType="com.yxt.anrui.portal.api.sysflowableconfig.SysFlowableConfig">
select * from sys_flowable_config where userSid = #{userSid} and #{nowDate} between startDate and endDate
</select>
</mapper>

29
anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysflowableconfig/SysFlowableConfigRest.java

@ -0,0 +1,29 @@
package com.yxt.anrui.portal.biz.sysflowableconfig;
import com.yxt.anrui.portal.api.sysflowableconfig.SysFlowableConfigFeign;
import com.yxt.anrui.portal.api.sysflowableconfig.SysFlowableConfigQuery;
import com.yxt.anrui.portal.api.sysflowableconfig.SysFlowableConfigVvo;
import com.yxt.common.core.result.ResultBean;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @description: 转办设置rest
* @author: dimengzhe
* @date: 2023/6/17
**/
@Api(tags = "转办设置")
@RestController
@RequestMapping("v1/SysFlowableConfig")
public class SysFlowableConfigRest implements SysFlowableConfigFeign {
@Autowired
private SysFlowableConfigService sysFlowableConfigService;
@Override
public ResultBean<SysFlowableConfigVvo> selectByUserSid(SysFlowableConfigQuery query) {
return sysFlowableConfigService.selectByUserSid(query);
}
}

30
anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysflowableconfig/SysFlowableConfigService.java

@ -0,0 +1,30 @@
package com.yxt.anrui.portal.biz.sysflowableconfig;
import cn.hutool.core.bean.BeanUtil;
import com.yxt.anrui.portal.api.sysflowableconfig.SysFlowableConfig;
import com.yxt.anrui.portal.api.sysflowableconfig.SysFlowableConfigQuery;
import com.yxt.anrui.portal.api.sysflowableconfig.SysFlowableConfigVvo;
import com.yxt.common.base.service.MybatisBaseService;
import com.yxt.common.core.result.ResultBean;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* @description: 转办
* @author: dimengzhe
* @date: 2023/6/17
**/
@Service
public class SysFlowableConfigService extends MybatisBaseService<SysFlowableConfigMapper, SysFlowableConfig> {
public ResultBean<SysFlowableConfigVvo> selectByUserSid(SysFlowableConfigQuery query) {
ResultBean<SysFlowableConfigVvo> rb = ResultBean.fireFail();
SysFlowableConfigVvo sysFlowableConfigVvo = new SysFlowableConfigVvo();
//查询该用户当前时间是否有转办人
String userSid = query.getUserSid();
Date nowDate = query.getNowDate();
SysFlowableConfig sysFlowableConfig = baseMapper.selectByUserSid(userSid,nowDate);
BeanUtil.copyProperties(sysFlowableConfig,sysFlowableConfigVvo);
return rb.success().setData(sysFlowableConfigVvo);
}
}

25
doc/databases/portal_tables.sql

@ -715,3 +715,28 @@ CREATE TABLE `sys_url_config`
) ENGINE = InnoDB
AUTO_INCREMENT = 18
DEFAULT CHARSET = utf8 COMMENT ='模块配置地址';
DROP TABLE IF EXISTS `sys_flowable_config`;
CREATE TABLE `sys_flowable_config`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`sid` varchar(64) NOT NULL COMMENT 'sid',
`lockVersion` int(11) NOT NULL DEFAULT '0' COMMENT '记录版本,锁',
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '记录创建时间',
`modifyTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '记录最后修改时间',
`isEnable` int(11) NOT NULL DEFAULT '1' COMMENT '记录是否可用,1:可用,0:不可用',
`state` int(11) DEFAULT '1' COMMENT '状态',
`isDelete` int(11) DEFAULT NULL COMMENT '记录是否被删除,0:未删除,1:已经删除',
`remarks` varchar(255) DEFAULT NULL COMMENT '备注信息',
`createBySid` varchar(64) DEFAULT NULL COMMENT '创建者',
`updateBySid` varchar(64) DEFAULT NULL COMMENT '更新者',
`userSid` varchar(64) DEFAULT NULL COMMENT '办理人sid',
`changeUserSid` varchar(500) DEFAULT NULL COMMENT '转办人',
`startDate` timestamp null DEFAULT NULL COMMENT '开始时间',
`endDate` timestamp null DEFAULT NULL COMMENT '结束时间',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE = InnoDB
AUTO_INCREMENT = 18
DEFAULT CHARSET = utf8 COMMENT ='转办人设置';

Loading…
Cancel
Save