diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/CopySendController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/CopySendController.java deleted file mode 100644 index 0a6ee6a1..00000000 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/CopySendController.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.daqing.financial.guarantee.controller; - -import cn.hutool.core.util.IdUtil; -import com.daqing.financial.guarantee.util.ImgUtil; -import com.daqing.financial.guarantee.util.R; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.io.IOException; - -/** - * @Author chen - * @DATE 2021/1/15 9:43 - * @Version 1.0 - * 抄送控制器 - */ -@Api(tags = {"抄送API"}) -@RestController -@RequestMapping("/copy-send") -public class CopySendController { - - - @ApiOperation("base转换图片") - @GetMapping("/conversionImg") - public R conversionImg(String imgData){ - //获取随机值 - String snowflakeId = IdUtil.getSnowflake(6, 4).nextIdStr(); - //文件扩展名 - String ext = ".png"; - //新文件名:雪花算法.文件扩展名 - String newName = snowflakeId + ext; - //指定存放目录 - String directory = "D:/img/"; - //图片完整路径 - String imgPath = directory+newName; - try { - ImgUtil.generateImage(imgData,imgPath); - } catch (IOException e) { - e.printStackTrace(); - } - return R.ok(); - } - -} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAuditProcessController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAuditProcessController.java index fe33eecd..8021d6f5 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAuditProcessController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAuditProcessController.java @@ -100,6 +100,9 @@ public class DgAuditProcessController { case "0": approvalNum.setInitiateNum(approvalNum.getInitiateNum()+1); break; + case "1": + approvalNum.setAgreed(approvalNum.getAgreed()+1); + break; case "2": approvalNum.setAgreed(approvalNum.getAgreed()+1); break; diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgCopyForController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgCopyForController.java index 674ee466..75f247b6 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgCopyForController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgCopyForController.java @@ -1,11 +1,18 @@ package com.daqing.financial.guarantee.controller; - +import com.daqing.financial.guarantee.service.IDgCopyForService; +import com.daqing.financial.guarantee.util.R; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import java.io.IOException; + /** *

* 抄送详情表 前端控制器 @@ -14,8 +21,29 @@ import org.springframework.web.bind.annotation.RestController; * @author Qyq * @since 2021-01-15 */ +@Api(tags = {"截图抄送"}) @RestController @RequestMapping("/dg-copy-for") public class DgCopyForController { + @Autowired + private IDgCopyForService copyForService; + + @ApiOperation("抄送任务") + @GetMapping("/copySend") + public R copySend(@ApiParam(name = "businessId", value = "业务id") + @RequestParam Integer businessId, + @ApiParam(name = "processId", value = "进程id") + @RequestParam Integer processId, + @ApiParam(name = "imgData", value = "base64图片编码") + @RequestParam String imgData){ + try { + boolean ok = copyForService.copySendUser(businessId,processId,imgData); + return ok ? R.ok() : R.error(); + } catch (IOException e) { + e.printStackTrace(); + return R.error().message(e.getMessage()); + } + } + } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgCopyUserController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgCopyUserController.java index 9b098043..fd7303cd 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgCopyUserController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgCopyUserController.java @@ -1,6 +1,7 @@ package com.daqing.financial.guarantee.controller; +import io.swagger.annotations.Api; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.stereotype.Controller; @@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController; * @author Qyq * @since 2021-01-15 */ +@Api(tags = {"抄送我的"}) @RestController @RequestMapping("/dg-copy-user") public class DgCopyUserController { diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessUserController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessUserController.java index 80134a6a..74b472ef 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessUserController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessUserController.java @@ -1,11 +1,29 @@ package com.daqing.financial.guarantee.controller; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.daqing.financial.guarantee.feign.HrmsFeignService; +import com.daqing.financial.guarantee.model.response.PersonalEfficiencyListResponse; +import com.daqing.financial.guarantee.service.IDgProcessUserService; +import com.daqing.financial.guarantee.util.R; +import com.daqing.framework.domain.guarantee.DgProcessUser; +import com.daqing.framework.model.response.ResponseResult; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; + /** *

* 业务模块选择抄送用户表 前端控制器 @@ -14,8 +32,46 @@ import org.springframework.web.bind.annotation.RestController; * @author Qyq * @since 2021-01-15 */ +@Api(tags = {"流程选择抄送人"}) @RestController @RequestMapping("/dg-process-user") public class DgProcessUserController { + @Autowired + private IDgProcessUserService processUserService; + + @Autowired + private HrmsFeignService hrmsFeignService; + + @ApiOperation("根据进程id查询抄送用户") + @GetMapping("/queryCopySendUser") + public R queryCopySendUser( + @ApiParam(name = "processId", value = "进程id") + @RequestParam Integer processId){ + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("process_id",processId).select("user_id"); + List list = processUserService.list(wrapper); + + List arr = new ArrayList<>(); + for (DgProcessUser res : list) { + arr.add(res.getUserId()); + } + //根据提单人id查询其部门名称 + ResponseResult responseResult = hrmsFeignService.getAccountAndDeptNameById(arr); + List employeeMessage = null; + if (responseResult.getData() != null) { + employeeMessage = (List) responseResult.getData(); + } + for (DgProcessUser response : list) { + for (LinkedHashMap res : employeeMessage) { + if (response.getUserId().equals(res.get("id"))) {//如果提单人id相同情况下,就往对象里面赋值 + response.setUserName(JSONObject.toJSONString(res.get("account")).replace("\"", "")); + } + } + } + return R.ok().data("userList",list); + } + + + } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgCopyForService.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgCopyForService.java index 0a9cd5b9..b5302640 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgCopyForService.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgCopyForService.java @@ -4,6 +4,8 @@ package com.daqing.financial.guarantee.service; import com.baomidou.mybatisplus.extension.service.IService; import com.daqing.framework.domain.guarantee.DgCopyFor; +import java.io.IOException; + /** *

* 抄送详情表 服务类 @@ -14,4 +16,5 @@ import com.daqing.framework.domain.guarantee.DgCopyFor; */ public interface IDgCopyForService extends IService { + boolean copySendUser(Integer businessId, Integer processId, String imgData) throws IOException; } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java index e51674ad..3d347757 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java @@ -652,7 +652,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl * 抄送详情表 服务实现类 @@ -17,4 +31,52 @@ import org.springframework.stereotype.Service; @Service public class DgCopyForServiceImpl extends ServiceImpl implements IDgCopyForService { + @Autowired + private DgProcessUserMapper processUserMapper; + + @Autowired + private DgCopyUserMapper copyUserMapper; + + @Override + public boolean copySendUser(Integer businessId, Integer processId, String imgData) throws IOException { + //获取随机值 + String snowflakeId = IdUtil.getSnowflake(6, 4).nextIdStr(); + //文件扩展名 + String ext = ".png"; + //新文件名:雪花算法.文件扩展名 + String newName = snowflakeId + ext; + //指定存放目录 + String directory = PromptSuccess.UPLOAD_FILE_PATH; + //图片完整路径 + String imgPath = directory + newName; + ImgUtil.generateImage(imgData, imgPath); + //拼接图片地址 + //访问路径前缀 + String serverPrefix = PromptSuccess.IMAGE_URL_PATH; + //访问路径 + String accessPath = serverPrefix + newName; + DgCopyFor copyFor = new DgCopyFor(); + copyFor.setBusinessId(businessId); + copyFor.setProcessId(processId); + copyFor.setPicUrl(accessPath); + //添加抄送详情 + baseMapper.insert(copyFor); + Integer copyForId = copyFor.getId(); + //查询该模块下需要抄送的用户id + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("process_id", processId).select("user_id"); + List list = processUserMapper.selectList(wrapper); + if (list != null && list.size() != 0) { + list.forEach(dgProcessUser -> { + Integer userId = dgProcessUser.getUserId(); + DgCopyUser copyUser = new DgCopyUser(); + copyUser.setCopyId(copyForId); + copyUser.setUserId(userId); + //添加抄送关系 + copyUserMapper.insert(copyUser); + }); + } + return true; + } + } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java index 109cde3a..c76026f3 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java @@ -692,7 +692,8 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl @@ -40,6 +40,10 @@ public class DgCopyFor implements Serializable { */ private String picUrl; + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT) + private Date createTime; + public Integer getId() { return id; } diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgCopyUser.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgCopyUser.java index 9b283407..9e200dcf 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgCopyUser.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgCopyUser.java @@ -1,10 +1,10 @@ package com.daqing.framework.domain.guarantee; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; +import java.util.Date; /** *

@@ -35,6 +35,10 @@ public class DgCopyUser implements Serializable { */ private Integer userId; + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT) + private Date createTime; + public Integer getId() { return id; } diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgProcessUser.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgProcessUser.java index bded2da9..acfd1fb1 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgProcessUser.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgProcessUser.java @@ -1,10 +1,11 @@ package com.daqing.framework.domain.guarantee; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; import java.io.Serializable; +import java.util.Date; /** *

@@ -14,6 +15,7 @@ import java.io.Serializable; * @author Qyq * @since 2021-01-15 */ +@Data @TableName("dg_process_user") public class DgProcessUser implements Serializable { @@ -35,34 +37,10 @@ public class DgProcessUser implements Serializable { */ private Integer userId; - public Integer getId() { - return id; - } + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT) + private Date createTime; - public void setId(Integer id) { - this.id = id; - } - public Integer getProcessId() { - return processId; - } - - public void setProcessId(Integer processId) { - this.processId = processId; - } - public Integer getUserId() { - return userId; - } - - public void setUserId(Integer userId) { - this.userId = userId; - } - - @Override - public String toString() { - return "DgProcessUser{" + - "id=" + id + - ", processId=" + processId + - ", userId=" + userId + - "}"; - } + @TableField(exist = false) + private String userName; }