Commit 6a36113d authored by chenzhao's avatar chenzhao

融资审核 整改单代码生成

parent ecb11018
......@@ -22,6 +22,16 @@ public enum FinancingAuditEnum {
* 编码
*/
public static String getNameByCode(String code){
String name = null;
for (FinancingAuditEnum value : FinancingAuditEnum.values()) {
if (value.getCode().equals(code)){
name= value.getName();
}
}
return name;
}
}
package com.yeejoin.amos.boot.module.jxiop.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 投融整改单
*
* @author system_generator
* @date 2024-04-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="FinancingRectificationOrderDto", description="投融整改单")
public class FinancingRectificationOrderDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "整改单号")
private String rectificationOrderCode;
@ApiModelProperty(value = "农户id")
private Long peasantHouseholdId;
@ApiModelProperty(value = "问题描述")
private String problemDescription;
@ApiModelProperty(value = "整改状态")
private String rectificationStatus;
@ApiModelProperty(value = "整改描述")
private String rectificationDescription;
@ApiModelProperty(value = "完成日期")
private Date completeDate;
@ApiModelProperty(value = "负责人ID")
private Long responsibleUserId;
@ApiModelProperty(value = "负责人姓名")
private String responsibleUserName;
@ApiModelProperty(value = "负责人电话")
private String responsibleUserPhone;
@ApiModelProperty(value = "整改照片")
private String rectificationPhoto;
}
package com.yeejoin.amos.boot.module.jxiop.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 投融整改单
*
* @author system_generator
* @date 2024-04-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("hygf_financing_rectification_order")
public class FinancingRectificationOrder extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 整改单号
*/
@TableField("rectification_order_code")
private String rectificationOrderCode;
/**
* 农户id
*/
@TableField("peasant_household_id")
private Long peasantHouseholdId;
/**
* 问题描述
*/
@TableField("problem_description")
private String problemDescription;
/**
* 整改状态
*/
@TableField("rectification_status")
private String rectificationStatus;
/**
* 整改描述
*/
@TableField("rectification_description")
private String rectificationDescription;
/**
* 完成日期
*/
@TableField("complete_date")
private Date completeDate;
/**
* 负责人ID
*/
@TableField("responsible_user_id")
private Long responsibleUserId;
/**
* 负责人姓名
*/
@TableField("responsible_user_name")
private String responsibleUserName;
/**
* 负责人电话
*/
@TableField("responsible_user_phone")
private String responsibleUserPhone;
/**
* 整改照片
*/
@TableField("rectification_photo")
private String rectificationPhoto;
}
package com.yeejoin.amos.boot.module.jxiop.api.mapper;
import com.yeejoin.amos.boot.module.jxiop.api.entity.FinancingRectificationOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 投融整改单 Mapper 接口
*
* @author system_generator
* @date 2024-04-02
*/
public interface FinancingRectificationOrderMapper extends BaseMapper<FinancingRectificationOrder> {
}
......@@ -18,4 +18,6 @@ public interface IFinancingInfoService {
void rollback(String processId, String peasantHouseholdId);
FinancingInfoDto selectDataInfo(Long sequenceNbr);
void execueFlow(Map<String, Object> params);
}
package com.yeejoin.amos.boot.module.jxiop.api.service;
/**
* 投融整改单接口类
*
* @author system_generator
* @date 2024-04-02
*/
public interface IFinancingRectificationOrderService {
}
<?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.yeejoin.amos.boot.module.jxiop.api.mapper.FinancingRectificationOrderMapper">
</mapper>
......@@ -126,4 +126,13 @@ public class FinancingInfoController extends BaseController {
financingInfoServiceImpl.rollback(instanceId,peasantHouseholdId);
return CommonResponseNewUtil.success();
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST",value = "审核", notes = "审核")
@PostMapping(value = "/execueFlow")
public ResponseModel execueFlow(@RequestBody Map<String, Object> params) {
financingInfoServiceImpl.execueFlow(params);
return CommonResponseNewUtil.success();
}
}
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.hygf.api.Enum.FinancingAuditEnum;
import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingAuditingDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.WorkflowResultDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.BasicGridAcceptance;
import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingAuditing;
import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingInfo;
import com.yeejoin.amos.boot.module.hygf.api.mapper.FinancingInfoMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IFinancingInfoService;
......@@ -15,6 +20,7 @@ import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingInfoDto;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO;
import com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO;
import com.yeejoin.amos.feign.workflow.model.TaskResultDTO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
......@@ -78,14 +84,17 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan
ids.stream().forEach(e->{
LambdaQueryWrapper<FinancingInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(FinancingInfo::getPeasantHouseholdId,Long.valueOf(e));
List<FinancingInfo> financingInfos = this.getBaseMapper().selectList(queryWrapper);
if (CollectionUtils.isEmpty(financingInfos)){
FinancingInfo financingInfos = this.getBaseMapper().selectOne(queryWrapper);
if (ObjectUtils.isEmpty(financingInfos)){
model.setStatus(FinancingAuditEnum.待融资审核.getName());
model.setPeasantHouseholdId(Long.valueOf(e));
FinancingInfoDto financingInfoDto = new FinancingInfoDto();
BeanUtils.copyProperties(model,financingInfoDto);
financingInfoDto.setSequenceNbr(null);
this.createWithModel(financingInfoDto);
}else {
financingInfos.setStatus(FinancingAuditEnum.待融资审核.getName());
this.updateById(financingInfos);
}
//开启工作流 并执行一步
......@@ -106,7 +115,6 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan
financingAuditingDto.setPeasantHouseholdId(Long.valueOf(e));
financingAuditingDto.setPromoter(RequestContext.getExeUserId());
financingAuditingService.createWithModel(financingAuditingDto);
});
......@@ -118,7 +126,6 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan
@Override
public void rollback(String processId, String peasantHouseholdId) {
workFlowService.stopProcess(processId);
LambdaQueryWrapper<FinancingInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(FinancingInfo::getPeasantHouseholdId,peasantHouseholdId);
List<FinancingInfo> financingInfos = this.getBaseMapper().selectList(queryWrapper);
......@@ -137,4 +144,49 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan
public FinancingInfoDto selectDataInfo(Long peasantHouseholdId) {
return this.getBaseMapper().selectDataInfo(peasantHouseholdId);
}
@Override
public void execueFlow(Map<String, Object> params) {
LambdaQueryWrapper<FinancingAuditing> query = new LambdaQueryWrapper<>();
query.eq(FinancingAuditing::getInstanceId,params.get("instanceId").toString());
query.orderByDesc(BaseEntity::getRecDate);
query.last("limit 1");
FinancingAuditing financingAuditing = financingAuditingService.getBaseMapper().selectOne(query);
//组装信息
TaskResultDTO task = new TaskResultDTO();
task.setResultCode("approvalStatus");
task.setTaskId(financingAuditing.getNextTaskId());
task.setComment(params.getOrDefault("comments","").toString());
HashMap<String, Object> map = new HashMap<>();
task.setVariable(map);
map.put("approvalStatus",params.get("approvalStatus"));
//执行流程
ProcessTaskDTO processTaskDTO = workFlowService.complete(financingAuditing.getNextTaskId(), task);
List<WorkflowResultDto> workflowResultDtos = workFlowService.buildWorkFlowInfo(CollectionUtil.newArrayList(processTaskDTO));
WorkflowResultDto workflowResultDto = workflowResultDtos.get(0);
FinancingAuditingDto financingAuditingDto = new FinancingAuditingDto();
BeanUtils.copyProperties(workflowResultDto,financingAuditingDto);
financingAuditingDto.setPeasantHouseholdId(financingAuditing.getPeasantHouseholdId());
financingAuditingDto.setPromoter(financingAuditing.getPromoter());
if (null == financingAuditingDto.getInstanceId()){
financingAuditingDto.setInstanceId(financingAuditing.getInstanceId());
}
financingAuditingService.createWithModel(financingAuditingDto);
String statusName = FinancingAuditEnum.getNameByCode(workflowResultDto.getNextNodeKey());
LambdaQueryWrapper<FinancingInfo> info = new LambdaQueryWrapper<>();
info.eq(FinancingInfo::getPeasantHouseholdId,financingAuditing.getPeasantHouseholdId());
FinancingInfo financingInfo = this.getBaseMapper().selectOne(info);
financingInfo.setStatus(statusName);
this.updateById(financingInfo);
if (params.get("approvalStatus").equals("7")){
}
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.yeejoin.amos.boot.module.jxiop.api.entity.FinancingRectificationOrder;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.FinancingRectificationOrderMapper;
import com.yeejoin.amos.boot.module.jxiop.api.service.IFinancingRectificationOrderService;
import com.yeejoin.amos.boot.module.jxiop.api.dto.FinancingRectificationOrderDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 投融整改单服务实现类
*
* @author system_generator
* @date 2024-04-02
*/
@Service
public class FinancingRectificationOrderServiceImpl extends BaseService<FinancingRectificationOrderDto,FinancingRectificationOrder,FinancingRectificationOrderMapper> implements IFinancingRectificationOrderService {
/**
* 分页查询
*/
public Page<FinancingRectificationOrderDto> queryForFinancingRectificationOrderPage(Page<FinancingRectificationOrderDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<FinancingRectificationOrderDto> queryForFinancingRectificationOrderList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
......@@ -73,13 +73,13 @@ public class WorkFlowService {
List<WorkflowResultDto> workflowResultDtoList = new ArrayList<>();
processTaskDTOS.forEach(item -> {
WorkflowResultDto workflowResultDto = new WorkflowResultDto();
workflowResultDto.setInstanceId(item.getProcessInstance().getId());
workflowResultDto.setTaskName(item.getTask().getName());
if (null != item.getProcessInstance()){
workflowResultDto.setInstanceId(item.getProcessInstance().getId());
}
// workflowResultDto.setNextExecutorIds(String.join(",", item.getCandidateGroups()));
workflowResultDto.setExecutorId(item.getExecutor().getUserId());
workflowResultDto.setExecutorName(item.getExecutor().getRealName());
if (!CollectionUtils.isEmpty(item.getNextTask())) {
ActTaskDTO actTaskDTO = item.getNextTask().get(0);
workflowResultDto.setTaskName(actTaskDTO.getName());
workflowResultDto.setNextTaskId(actTaskDTO.getId());
workflowResultDto.setNextNodeKey(actTaskDTO.getKey()); // 工作流字段还未添加
workflowResultDto.setNextNodeName(actTaskDTO.getName());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment