master
chen 4 years ago
parent 96e58427d8
commit d28ab3322c
  1. 47
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/CopySendController.java
  2. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAuditProcessController.java
  3. 34
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgCopyForController.java
  4. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgCopyUserController.java
  5. 56
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessUserController.java
  6. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgCopyForService.java
  7. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java
  8. 62
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgCopyForServiceImpl.java
  9. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java
  10. 10
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgCopyFor.java
  11. 10
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgCopyUser.java
  12. 42
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgProcessUser.java

@ -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();
}
}

@ -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;

@ -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;
/**
* <p>
* 抄送详情表 前端控制器
@ -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());
}
}
}

@ -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 {

@ -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;
/**
* <p>
* 业务模块选择抄送用户表 前端控制器
@ -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<DgProcessUser> wrapper = new QueryWrapper<>();
wrapper.eq("process_id",processId).select("user_id");
List<DgProcessUser> list = processUserService.list(wrapper);
List<Integer> arr = new ArrayList<>();
for (DgProcessUser res : list) {
arr.add(res.getUserId());
}
//根据提单人id查询其部门名称
ResponseResult responseResult = hrmsFeignService.getAccountAndDeptNameById(arr);
List<LinkedHashMap> employeeMessage = null;
if (responseResult.getData() != null) {
employeeMessage = (List<LinkedHashMap>) 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);
}
}

@ -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;
/**
* <p>
* 抄送详情表 服务类
@ -14,4 +16,5 @@ import com.daqing.framework.domain.guarantee.DgCopyFor;
*/
public interface IDgCopyForService extends IService<DgCopyFor> {
boolean copySendUser(Integer businessId, Integer processId, String imgData) throws IOException;
}

@ -652,7 +652,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
String account = dgApplyAmountInfoController.getAccount();
String departmentId = OrdinaryUtil.getDepartmentId(Integer.parseInt(this.getUserId()));
AuditProcessUtil.save(Integer.parseInt(this.getUserId()),dgApplyAmountList1.getBusinessId(),
account,departmentId,remark,1,roleId,"","","",StatusCode.CZ_LAUNCH);
account,departmentId,remark,1,roleId,"","","",status);
return 1;
}

@ -1,11 +1,25 @@
package com.daqing.financial.guarantee.service.impl;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.daqing.financial.guarantee.mapper.DgCopyForMapper;
import com.daqing.financial.guarantee.mapper.DgCopyUserMapper;
import com.daqing.financial.guarantee.mapper.DgProcessUserMapper;
import com.daqing.financial.guarantee.service.IDgCopyForService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daqing.financial.guarantee.service.IDgCopyUserService;
import com.daqing.financial.guarantee.service.IDgProcessUserService;
import com.daqing.financial.guarantee.util.ImgUtil;
import com.daqing.framework.domain.guarantee.DgCopyFor;
import com.daqing.framework.domain.guarantee.DgCopyUser;
import com.daqing.framework.domain.guarantee.DgProcessUser;
import com.daqing.framework.model.response.PromptSuccess;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.util.List;
/**
* <p>
* 抄送详情表 服务实现类
@ -17,4 +31,52 @@ import org.springframework.stereotype.Service;
@Service
public class DgCopyForServiceImpl extends ServiceImpl<DgCopyForMapper, DgCopyFor> 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<DgProcessUser> wrapper = new QueryWrapper<>();
wrapper.eq("process_id", processId).select("user_id");
List<DgProcessUser> 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;
}
}

@ -692,7 +692,8 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl<DgGuaranteeAss
String account = dgApplyAmountInfoController.getAccount();
String departmentId = OrdinaryUtil.getDepartmentId(Integer.parseInt(this.getUserId()));
AuditProcessUtil.save(Integer.parseInt(this.getUserId()),guaranteeUser.getBusinessId(),
account, departmentId, approvalGuaranteeRequest.getApplyContent(), 2,roleId,reason,loanMoney,loanTerm,approvalGuaranteeRequest.getStatus());
account, departmentId, approvalGuaranteeRequest.getApplyContent(),
2,roleId,reason,loanMoney,loanTerm,approvalGuaranteeRequest.getStatus());
return 1;
}

@ -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;
/**
* <p>
@ -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;
}

@ -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;
/**
* <p>
@ -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;
}

@ -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;
/**
* <p>
@ -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;
}
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;
}
@ApiModelProperty(value = "创建时间")
@TableField(fill = FieldFill.INSERT)
private Date createTime;
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;
}

Loading…
Cancel
Save