Commit 0b309ac0 by dengshichuan

Merge branch 'dsc' into 'develop'

Dsc

See merge request 8timerv2/8timerapiv200!115
parents a41b62c6 7856b36b
...@@ -504,6 +504,7 @@ public class DzhtController2 { ...@@ -504,6 +504,7 @@ public class DzhtController2 {
qyzxUseRecord.setOrgCode(orgCode); qyzxUseRecord.setOrgCode(orgCode);
qyzxUseRecord.setUseNum(1); qyzxUseRecord.setUseNum(1);
qyzxUseRecord.setScene("签署中"); qyzxUseRecord.setScene("签署中");
qyzxUseRecord.setPmid(2);
qyzxUseRecord.setFlowId(flowId); qyzxUseRecord.setFlowId(flowId);
qyzxUseRecord.insert(); qyzxUseRecord.insert();
...@@ -894,19 +895,21 @@ public class DzhtController2 { ...@@ -894,19 +895,21 @@ public class DzhtController2 {
@ApiOperation(value = "获取签署地址", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "获取签署地址", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> qrySignUrl(@CurrentUser UserBean userBean, @RequestParam String flowId, public Result<Object> qrySignUrl(@CurrentUser UserBean userBean, @RequestParam String flowId,
@RequestParam(required = false) String organizeId, @RequestParam(required = false) String urlType) { @RequestParam(required = false) String organizeId, @RequestParam(required = false) String urlType) {
JSONObject jsonObject = null; JSONObject json = null;
try { try {
QueryWrapper<DzhtAssoGrzc> queryWrapper = new QueryWrapper<DzhtAssoGrzc>(); QueryWrapper<DzhtAssoGrzc> queryWrapper = new QueryWrapper<DzhtAssoGrzc>();
queryWrapper.eq("emp_num", userBean.getEmpNum()).select("account_id"); queryWrapper.eq("emp_num", userBean.getEmpNum()).select("account_id");
String accountId = DzhtAssoGrzc.builder().build().selectOne(queryWrapper).getAccountId(); String accountId = DzhtAssoGrzc.builder().build().selectOne(queryWrapper).getAccountId();
TokenHelper.getTokenData();// 获取鉴权 TokenHelper.getTokenData();// 获取鉴权
jsonObject = SignHelper.qrySignUrl(flowId, accountId, organizeId, urlType); json = SignHelper.qrySignUrl(flowId, accountId, organizeId, urlType);
} catch (DefineException e) { } catch (DefineException e) {
e.printStackTrace(); e.printStackTrace();
return ResultUtil.error(); return ResultUtil.error();
} }
return ResultUtil.data(jsonObject, "获取成功"); if (json != null && json.getLong("code") != 0)
return ResultUtil.error(json.getString("message"));
return ResultUtil.data(json.getJSONObject("data"), "成功");
} }
// 流程签署人催签 // 流程签署人催签
...@@ -942,7 +945,11 @@ public class DzhtController2 { ...@@ -942,7 +945,11 @@ public class DzhtController2 {
if (grzc != null) { if (grzc != null) {
operatorId = grzc.getAccountId(); operatorId = grzc.getAccountId();
} }
SignHelper.revokeSignFlow(flowId, revokeReason, operatorId); JSONObject json = SignHelper.revokeSignFlow(flowId, revokeReason, operatorId);
if (json != null && json.getLong("code") != 0) {
return ResultUtil.error(json.getString("message"));
}
} catch (DefineException e) { } catch (DefineException e) {
e.printStackTrace(); e.printStackTrace();
return ResultUtil.error(); return ResultUtil.error();
...@@ -974,9 +981,10 @@ public class DzhtController2 { ...@@ -974,9 +981,10 @@ public class DzhtController2 {
json = SignHelper.downloadFlowDoc(flowId); json = SignHelper.downloadFlowDoc(flowId);
} catch (DefineException e) { } catch (DefineException e) {
e.printStackTrace(); e.printStackTrace();
return ResultUtil.error();
} }
return ResultUtil.data(json, "成功"); if (json != null && json.getLong("code") != 0)
return ResultUtil.error(json.getString("message"));
return ResultUtil.data(json.getJSONObject("data"), "成功");
} }
/** /**
......
...@@ -90,12 +90,15 @@ public class SignHelper { ...@@ -90,12 +90,15 @@ public class SignHelper {
* @throws DefineException * @throws DefineException
* @author 宫清 * @author 宫清
* @param operatorId * @param operatorId
* @return
* @date 2019年7月21日 下午5:38:42 * @date 2019年7月21日 下午5:38:42
*/ */
public static void revokeSignFlow(String flowId, String revokeReason, String operatorId) throws DefineException { public static JSONObject revokeSignFlow(String flowId, String revokeReason, String operatorId)
throws DefineException {
String param = SignParamUtil.revokeSignFlowParam(revokeReason, operatorId); String param = SignParamUtil.revokeSignFlowParam(revokeReason, operatorId);
JSONObject json = HttpHelper.doCommHttp(RequestType.PUT, ConfigConstant.revokeFlows_URL(flowId),param); JSONObject json = HttpHelper.doCommHttp(RequestType.PUT, ConfigConstant.revokeFlows_URL(flowId), param);
JSONHelper.castDataJson(json, Object.class); // JSONHelper.castDataJson(json, Object.class);
return json;
} }
/** /**
...@@ -176,7 +179,8 @@ public class SignHelper { ...@@ -176,7 +179,8 @@ public class SignHelper {
*/ */
public static JSONObject downloadFlowDoc(String flowId) throws DefineException { public static JSONObject downloadFlowDoc(String flowId) throws DefineException {
JSONObject json = HttpHelper.doCommHttp(RequestType.GET, ConfigConstant.aboutDocument_URL(flowId, null), null); JSONObject json = HttpHelper.doCommHttp(RequestType.GET, ConfigConstant.aboutDocument_URL(flowId, null), null);
return JSONHelper.castDataJson(json, JSONObject.class); // return JSONHelper.castDataJson(json, JSONObject.class);
return json;
} }
// ------------------------------------------------------------------------------------------------流程文档相关end----------------------- // ------------------------------------------------------------------------------------------------流程文档相关end-----------------------
...@@ -360,7 +364,7 @@ public class SignHelper { ...@@ -360,7 +364,7 @@ public class SignHelper {
* @author 宫清 * @author 宫清
* @date 2019年7月21日 下午8:09:07 * @date 2019年7月21日 下午8:09:07
*/ */
public static JSONObject addSignerHandSignArea(String flowId,List<Signfield> list) throws DefineException { public static JSONObject addSignerHandSignArea(String flowId, List<Signfield> list) throws DefineException {
String param = SignParamUtil.addSignerHandSignAreaParam(list); String param = SignParamUtil.addSignerHandSignAreaParam(list);
JSONObject json = HttpHelper.doCommHttp(RequestType.POST, ConfigConstant.addHandSignfieldsForPerson_URL(flowId), JSONObject json = HttpHelper.doCommHttp(RequestType.POST, ConfigConstant.addHandSignfieldsForPerson_URL(flowId),
...@@ -458,7 +462,8 @@ public class SignHelper { ...@@ -458,7 +462,8 @@ public class SignHelper {
throws DefineException { throws DefineException {
JSONObject json = HttpHelper.doCommHttp(RequestType.GET, JSONObject json = HttpHelper.doCommHttp(RequestType.GET,
ConfigConstant.Sign_URL(flowId, accountId, organizeId, urlType), null); ConfigConstant.Sign_URL(flowId, accountId, organizeId, urlType), null);
return JSONHelper.castDataJson(json, JSONObject.class); // return JSONHelper.castDataJson(json, JSONObject.class);
return json;
} }
// ------------------------------------------------------------------------------------------------流程签署人相关end---------------------- // ------------------------------------------------------------------------------------------------流程签署人相关end----------------------
......
...@@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
...@@ -33,9 +34,9 @@ import com.github.pagehelper.PageHelper; ...@@ -33,9 +34,9 @@ import com.github.pagehelper.PageHelper;
import cn.hutool.core.date.DateUnit; import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import cn.timer.api.bean.dzht.DzhtSignflowFinish;
import cn.timer.api.bean.qyzx.QyzxEntInfoM; import cn.timer.api.bean.qyzx.QyzxEntInfoM;
import cn.timer.api.bean.qyzx.QyzxSms; import cn.timer.api.bean.qyzx.QyzxSms;
import cn.timer.api.bean.qyzx.businessService.QyzxBuyRecord; import cn.timer.api.bean.qyzx.businessService.QyzxBuyRecord;
...@@ -215,8 +216,9 @@ public class QyzxBusinessController { ...@@ -215,8 +216,9 @@ public class QyzxBusinessController {
QueryWrapper<QyzxBuyRecord> queryWrapper = new QueryWrapper<>(); QueryWrapper<QyzxBuyRecord> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("org_code", userBean.getOrgCode()).and(query != null && query != "", queryWrapper.eq("org_code", userBean.getOrgCode()).and(query != null && query != "",
wq -> wq.like("order_no", query).or().like("content", query)); wq -> wq.like("order_no", query).or().like("content", query));
queryWrapper.between(s != null && s != "" && e != null && e != "", "create_time",
!StrUtil.hasBlank(s) ? s : "1000-01-01 00:00:00", !StrUtil.hasBlank(e) ? e : "9999-01-01 00:00:00"); queryWrapper.lambda().ge(StringUtils.isNotBlank(s), QyzxBuyRecord::getCreateTime, s)
.le(StringUtils.isNotBlank(e), QyzxBuyRecord::getCreateTime, e);
Page<Object> page = PageHelper.startPage(pageNum, pageSize); Page<Object> page = PageHelper.startPage(pageNum, pageSize);
List<QyzxBuyRecord> list = QyzxBuyRecord.builder().build().selectList(queryWrapper); List<QyzxBuyRecord> list = QyzxBuyRecord.builder().build().selectList(queryWrapper);
return ResultUtil.pageData(list, page.getTotal(), "查询成功"); return ResultUtil.pageData(list, page.getTotal(), "查询成功");
...@@ -286,11 +288,18 @@ public class QyzxBusinessController { ...@@ -286,11 +288,18 @@ public class QyzxBusinessController {
@GetMapping(value = "/queryMsgUseRecord") @GetMapping(value = "/queryMsgUseRecord")
@ApiOperation(value = "查询短信使用记录", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "查询短信使用记录", httpMethod = "GET", notes = "接口发布说明")
public Result<List<QyzxUseRecord>> queryMsgUseRecord(@CurrentUser UserBean userBean, String orderNo) { public Result<List<QyzxUseRecord>> queryMsgUseRecord(@CurrentUser UserBean userBean,
return ResultUtil.data(QyzxUseRecord.builder().build() @RequestParam(required = false) String orderNo, @RequestParam(required = false) String startTime,
@RequestParam(required = false) String endTime, @RequestParam(defaultValue = "1") int pageNum,
@RequestParam(defaultValue = "10") int pageSize) {
Page<Object> page = PageHelper.startPage(pageNum, pageSize);
List<QyzxUseRecord> list = QyzxUseRecord.builder().build()
.selectList(new LambdaQueryWrapper<QyzxUseRecord>().eq(QyzxUseRecord::getOrgCode, userBean.getOrgCode()) .selectList(new LambdaQueryWrapper<QyzxUseRecord>().eq(QyzxUseRecord::getOrgCode, userBean.getOrgCode())
.eq(QyzxUseRecord::getPmid, 1).eq(orderNo != null, QyzxUseRecord::getOrderNo, orderNo)), .eq(QyzxUseRecord::getPmid, 1)
"查询成功"); .eq(StringUtils.isNotBlank(orderNo), QyzxUseRecord::getOrderNo, orderNo)
.ge(StringUtils.isNotBlank(startTime), QyzxUseRecord::getCreateTime, startTime)
.le(StringUtils.isNotBlank(endTime), QyzxUseRecord::getCreateTime, endTime));
return ResultUtil.pageData(list, page.getTotal(), "查询成功");
} }
@GetMapping(value = "/queryMsgUseDetal/{id}") @GetMapping(value = "/queryMsgUseDetal/{id}")
...@@ -312,4 +321,12 @@ public class QyzxBusinessController { ...@@ -312,4 +321,12 @@ public class QyzxBusinessController {
"查询成功"); "查询成功");
} }
@GetMapping(value = "/queryContractUseDetail")
@ApiOperation(value = "查询电子合同使用详情(流程结束后)", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> queryContractUseDetail(@CurrentUser UserBean userBean, String flowId) {
return ResultUtil.data(DzhtSignflowFinish.builder().build().selectOne(
new LambdaQueryWrapper<DzhtSignflowFinish>().eq(flowId != null, DzhtSignflowFinish::getFlowId, flowId)),
"查询成功");
}
} }
/**
* <p>Title: CheckUtil.java</p>
* <p>Description: </p>
* @author dsc
* @date 2020年5月21日
* @version 1.0
*/
package cn.timer.api.utils;
import java.lang.reflect.Field;
import java.util.List;
import java.util.stream.Collectors;
/**
* <p>
* Title: CheckUtil.java
* </p>
* <p>
* Description: 判断对象是否包含空值
* </p>
*
* @author dsc
* @date 2020年5月21日
* @version 1.0
*/
public class CheckUtil {
/**
* 检查对象是否有空字段
*
* @param obj 实体对象
* @return 有则返回true
*/
public static <T> boolean checkObjFieldIsNull(T obj) {
boolean flag = false;
for (Field f : obj.getClass().getDeclaredFields()) {
f.setAccessible(true);
try {
if (f.get(obj) == null) {
flag = true;
return flag;
}
} catch (IllegalArgumentException | IllegalAccessException e) {
e.printStackTrace();
}
}
return flag;
}
/**
* 交集
*
* @param <T>
* @param list1
* @param list2
* @return list1与list2中相同的字段list
*/
public static <T> List<T> intersection(List<T> list1, List<T> list2) {
return list1.stream().filter(item -> list2.contains(item)).collect(Collectors.toList());
}
/**
* 列表取差集
*
* @param <T>
* @param list1
* @param list2
* @return list2中未包含list1的参数list
*/
public static <T> List<T> reduce(List<T> list1, List<T> list2) {
return list1.stream().filter(item -> !list2.contains(item)).collect(Collectors.toList());
}
/**
* 并集
*
* @param <T>
* @param list1
* @param list2
* @param isDistinct 是否去重
* @return
*/
public static <T> List<T> distinct(List<T> list1, List<T> list2, boolean isDistinct) {
list1.addAll(list2);
if (!isDistinct)
return list1;
return list1.stream().distinct().collect(Collectors.toList());
}
// public static void main(String[] args) {
// List<String> list1 = new ArrayList<String>();
// list1.add("a");
// list1.add("b");
// list1.add("c");
// list1.add("d");
// list1.add("3");
// List<String> list2 = new ArrayList<String>();
// list2.add("a");
// list2.add("b");
// list2.add("e");
// list2.add("3");
// System.err.println(intersection(list1, list2));
// System.err.println(reduce(list1, list2));
// System.err.println(distinct(list1, list2, false));
// }
}
...@@ -28,6 +28,8 @@ import com.aliyun.oss.model.OSSObjectSummary; ...@@ -28,6 +28,8 @@ import com.aliyun.oss.model.OSSObjectSummary;
import com.aliyun.oss.model.ObjectListing; import com.aliyun.oss.model.ObjectListing;
import com.aliyun.oss.model.PutObjectRequest; import com.aliyun.oss.model.PutObjectRequest;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.timer.api.utils.Result; import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil; import cn.timer.api.utils.ResultUtil;
...@@ -119,7 +121,9 @@ public class OSSUtil { ...@@ -119,7 +121,9 @@ public class OSSUtil {
ossClient.putObject(putObjectRequest); ossClient.putObject(putObjectRequest);
// 设置URL过期时间为100年。 1s 1h 1d 1y 100y // 设置URL过期时间为100年。 1s 1h 1d 1y 100y
Date expiration = new Date(new Date().getTime() + 1000 * 3600 * 24 * 365 * 100); // Date expiration = new Date(new Date().getTime() + 1000L * 3600 * 24 * 365 * 100);
Date now = new Date();
Date expiration = DateUtil.offset(now, DateField.YEAR, 100); // 一百年之后过期
// 生成以GET方法访问的签名URL,访客可以直接通过浏览器访问相关内容。 // 生成以GET方法访问的签名URL,访客可以直接通过浏览器访问相关内容。
URL url = ossClient.generatePresignedUrl(bucketName, path, expiration); URL url = ossClient.generatePresignedUrl(bucketName, path, expiration);
System.err.println(url); System.err.println(url);
...@@ -360,6 +364,7 @@ public class OSSUtil { ...@@ -360,6 +364,7 @@ public class OSSUtil {
/** /**
* 删除多个文件 * 删除多个文件
*
* @param keys 需要删除的文件。 * @param keys 需要删除的文件。
* @param quiet 返回模式。true表示简单模式,false表示详细模式。默认为详细模式。 * @param quiet 返回模式。true表示简单模式,false表示详细模式。默认为详细模式。
* @return 删除结果。详细模式下为删除成功的文件列表,简单模式下为删除失败的文件列表。 * @return 删除结果。详细模式下为删除成功的文件列表,简单模式下为删除失败的文件列表。
...@@ -393,6 +398,7 @@ public class OSSUtil { ...@@ -393,6 +398,7 @@ public class OSSUtil {
/** /**
* 删除指定前缀(prefix)的文件 * 删除指定前缀(prefix)的文件
*
* @param prefix * @param prefix
*/ */
public void delPrefixWith(String prefix) { public void delPrefixWith(String prefix) {
......
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