Commit 56af6282 by 邓实川 Committed by chenzg

工具类,上传普通文件时间更改,企业中心电子合同记录接口优化

parent 47b8cec3
......@@ -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.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.Page;
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.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
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.QyzxSms;
import cn.timer.api.bean.qyzx.businessService.QyzxBuyRecord;
......@@ -215,8 +216,9 @@ public class QyzxBusinessController {
QueryWrapper<QyzxBuyRecord> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("org_code", userBean.getOrgCode()).and(query != null && 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);
List<QyzxBuyRecord> list = QyzxBuyRecord.builder().build().selectList(queryWrapper);
return ResultUtil.pageData(list, page.getTotal(), "查询成功");
......@@ -286,11 +288,18 @@ public class QyzxBusinessController {
@GetMapping(value = "/queryMsgUseRecord")
@ApiOperation(value = "查询短信使用记录", httpMethod = "GET", notes = "接口发布说明")
public Result<List<QyzxUseRecord>> queryMsgUseRecord(@CurrentUser UserBean userBean, String orderNo) {
return ResultUtil.data(QyzxUseRecord.builder().build()
public Result<List<QyzxUseRecord>> queryMsgUseRecord(@CurrentUser UserBean userBean,
@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())
.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}")
......@@ -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;
/**
* <p>
* Title: CheckUtil.java
* </p>
* <p>
* Description: 判断对象是否包含空值
* </p>
*
* @author dsc
* @date 2020年5月21日
* @version 1.0
*/
public class CheckUtil {
public static boolean checkObjFieldIsNull(Object 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;
}
}
......@@ -28,6 +28,8 @@ import com.aliyun.oss.model.OSSObjectSummary;
import com.aliyun.oss.model.ObjectListing;
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.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
......@@ -119,7 +121,9 @@ public class OSSUtil {
ossClient.putObject(putObjectRequest);
// 设置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,访客可以直接通过浏览器访问相关内容。
URL url = ossClient.generatePresignedUrl(bucketName, path, expiration);
System.err.println(url);
......@@ -360,7 +364,8 @@ public class OSSUtil {
/**
* 删除多个文件
* @param keys 需要删除的文件。
*
* @param keys 需要删除的文件。
* @param quiet 返回模式。true表示简单模式,false表示详细模式。默认为详细模式。
* @return 删除结果。详细模式下为删除成功的文件列表,简单模式下为删除失败的文件列表。
*/
......@@ -393,6 +398,7 @@ public class OSSUtil {
/**
* 删除指定前缀(prefix)的文件
*
* @param prefix
*/
public void delPrefixWith(String prefix) {
......@@ -434,7 +440,7 @@ public class OSSUtil {
// 关闭OSSClient。
ossClient.shutdown();
}
/*
* (跨域资源) // Endpoint以杭州为例,其它Region请按实际情况填写。 String endpoint =
* "http://oss-cn-hangzhou.aliyuncs.com"; //
......
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