From 4cbae79bf0b885c877e386def2cee12600933df0 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 10 Jul 2023 18:22:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bweb/controller/BsTradeOrderController.java | 8 ++++++-- .../main/java/com/bweb/controller/TestController.java | 2 +- .../com/bweb/excel/model/ExportTradeOrderModel.java | 2 +- .../main/java/com/cweb/controller/TestController.java | 4 ++-- .../java/com/hfkj/schedule/TradeOrderSchedule.java | 9 ++++++++- .../com/hfkj/channel/lakala/LaKaLaTradeService.java | 1 - .../main/java/com/hfkj/dao/BsTradeOrderMapperExt.java | 2 +- .../java/com/hfkj/openapi/v1/utils/SignatureUtil.java | 11 +++++------ .../hfkj/service/impl/BsTradeOrderServiceImpl.java | 4 ++++ 9 files changed, 28 insertions(+), 15 deletions(-) diff --git a/bweb/src/main/java/com/bweb/controller/BsTradeOrderController.java b/bweb/src/main/java/com/bweb/controller/BsTradeOrderController.java index e0cac66..19149c1 100644 --- a/bweb/src/main/java/com/bweb/controller/BsTradeOrderController.java +++ b/bweb/src/main/java/com/bweb/controller/BsTradeOrderController.java @@ -72,6 +72,7 @@ public class BsTradeOrderController { @RequestParam(value = "payTimeS" , required = false) Long payTimeS, @RequestParam(value = "payTimeE" , required = false) Long payTimeE, @RequestParam(value = "status" , required = false) Integer status, + @RequestParam(value = "specialField" , required = false) String specialField, @RequestParam(value = "pageNum" , required = true) Integer pageNum, @RequestParam(value = "pageSize" , required = true) Integer pageSize) { try { @@ -132,6 +133,7 @@ public class BsTradeOrderController { param.put("payTimeS", payTimeS); param.put("payTimeE", payTimeE); param.put("status", status); + param.put("specialField", specialField); PageHelper.startPage(pageNum,pageSize); return ResponseMsgUtil.success(new PageInfo<>(tradeOrderService.getTradeOrderList(param))); @@ -159,7 +161,9 @@ public class BsTradeOrderController { @RequestParam(value = "accTradeNo" , required = false) String accTradeNo, @RequestParam(value = "payTimeS" , required = false) Long payTimeS, @RequestParam(value = "payTimeE" , required = false) Long payTimeE, - @RequestParam(value = "status" , required = false) Integer status) { + @RequestParam(value = "status" , required = false) Integer status, + @RequestParam(value = "specialField" , required = false) String specialField + ) { try { Map param = new HashMap<>(); UserInfoModel userModel = userCenter.getSessionModel(UserInfoModel.class); @@ -218,7 +222,7 @@ public class BsTradeOrderController { param.put("payTimeS", payTimeS); param.put("payTimeE", payTimeE); param.put("status", status); - + param.put("specialField", specialField); List dataList = new ArrayList<>(); ExportTradeOrderModel data; diff --git a/bweb/src/main/java/com/bweb/controller/TestController.java b/bweb/src/main/java/com/bweb/controller/TestController.java index 7a9acf9..d2deebe 100644 --- a/bweb/src/main/java/com/bweb/controller/TestController.java +++ b/bweb/src/main/java/com/bweb/controller/TestController.java @@ -104,7 +104,7 @@ public class TestController { try { JSONObject queryTrade = laKaLaTradeService.queryTrade(order.getOutTradeNo()); if (queryTrade != null) { - order.setTradeActualAmount(queryTrade.getBigDecimal("total_amount")); + order.setTradeActualAmount(queryTrade.getBigDecimal("total_amount").divide(new BigDecimal("100"))); order.setAccSettleAmount( StringUtils.isNotBlank(queryTrade.getString("acc_settle_amount")) ?queryTrade.getBigDecimal("acc_settle_amount").divide(new BigDecimal("100")) diff --git a/bweb/src/main/java/com/bweb/excel/model/ExportTradeOrderModel.java b/bweb/src/main/java/com/bweb/excel/model/ExportTradeOrderModel.java index e7f89a5..30ca54d 100644 --- a/bweb/src/main/java/com/bweb/excel/model/ExportTradeOrderModel.java +++ b/bweb/src/main/java/com/bweb/excel/model/ExportTradeOrderModel.java @@ -78,7 +78,7 @@ public class ExportTradeOrderModel { private Date createTime; @ColumnWidth(25) - @ExcelProperty(value = "支付时间") + @ExcelProperty(value = "交易时间") private Date payTime; @ColumnWidth(25) diff --git a/cweb/src/main/java/com/cweb/controller/TestController.java b/cweb/src/main/java/com/cweb/controller/TestController.java index 7845e30..22c5b5d 100644 --- a/cweb/src/main/java/com/cweb/controller/TestController.java +++ b/cweb/src/main/java/com/cweb/controller/TestController.java @@ -260,8 +260,8 @@ public class TestController { //return ResponseMsgUtil.success(saasMerService.merchantInfo("123364703")); // return ResponseMsgUtil.success(saasCommon.getCategory(null)); // return ResponseMsgUtil.success(laKaLaLedgerService.queryLedgerMer(code)); - // return ResponseMsgUtil.success(laKaLaTradeService.queryTrans(code)); - return ResponseMsgUtil.success(laKaLaTradeService.queryTrade(code)); + return ResponseMsgUtil.success(laKaLaTradeService.queryTrans(code)); + // return ResponseMsgUtil.success(laKaLaTradeService.queryTrade(code)); // return ResponseMsgUtil.success(""); // 1200 // return ResponseMsgUtil.success(saasCommon.fileUpload(new HashMap<>())); diff --git a/schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java b/schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java index 925a673..15c52b6 100644 --- a/schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java +++ b/schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; import com.hfkj.channel.lakala.LaKaLaTradeSeparateService; import com.hfkj.channel.lakala.LaKaLaTradeService; import com.hfkj.channel.weixin.utils.WxOrderConfig; +import com.hfkj.common.utils.DateUtil; import com.hfkj.entity.BsTradeOrder; import com.hfkj.entity.BsTradeOrderProfitSharing; import com.hfkj.entity.BsTradeOrderProfitSharingReceiver; @@ -21,6 +22,7 @@ import org.springframework.scheduling.annotation.Scheduled; import javax.annotation.Resource; import java.math.BigDecimal; import java.util.*; +import java.util.stream.Collectors; /** * 交易订单定时任务 @@ -257,12 +259,17 @@ public class TradeOrderSchedule { /** * 交易结算 * 每分钟扫描一次 - */ + */ @Scheduled(cron="0 0/1 * * * ?") public void tradeOrderSettle() { Map param = new HashMap<>(); param.put("status", "3"); param.put("settleAmountIsNull", true); + + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DAY_OF_MONTH, -2); + param.put("payTimeS", calendar.getTimeInMillis()); + List tradeOrderList = tradeOrderService.getTradeOrderList(param); for (BsTradeOrder tradeOrder : tradeOrderList) { try { diff --git a/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java b/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java index 4795a01..24bcc17 100644 --- a/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java +++ b/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java @@ -364,7 +364,6 @@ public class LaKaLaTradeService { Map commonParam = new HashMap<>(); commonParam.put("req_time", DateUtil.format(new Date(), "yyyyMMddHHmmss")); commonParam.put("version", "3.0"); - commonParam.put("out_org_code", CommonSysConst.getSysConfig().getLkl_v3_appid()); Map map = new HashMap<>(); map.put("merchant_no", platformNo.getCupNo()); diff --git a/service/src/main/java/com/hfkj/dao/BsTradeOrderMapperExt.java b/service/src/main/java/com/hfkj/dao/BsTradeOrderMapperExt.java index 8d8b7c9..0868d1a 100644 --- a/service/src/main/java/com/hfkj/dao/BsTradeOrderMapperExt.java +++ b/service/src/main/java/com/hfkj/dao/BsTradeOrderMapperExt.java @@ -48,7 +48,7 @@ public interface BsTradeOrderMapperExt { " LEFT JOIN (select " + " settle_date, " + " count(1) tradeNum, " + - " sum(income_amount) tradeAmount, " + + " sum(trade_actual_amount) tradeAmount, " + " sum(settle_amount) settleAmount, " + " sum(shd_fee_amt) shdFeeAmount " + " from bs_trade_order " + diff --git a/service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java b/service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java index f5c28f9..5db7df2 100644 --- a/service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java +++ b/service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java @@ -82,16 +82,15 @@ public class SignatureUtil { public static void main(String[] args) throws Exception { String paramStr = "{\n" + - " \"merchantNo\": \"2023053014484290706\",\n" + - " \"outTradeNo\": \"ZF1130202305051459532538971005\",\n" + + " \"merchantNo\": \"2023041916292112804\",\n" + + " \"outTradeNo\": \"ZF1130202305051459532538970005\",\n" + " \"payMode\": \"WECHAT\",\n" + " \"totalAmount\": 0.01,\n" + " \"transType\": \"JSAPI\",\n" + - " \"subAppid\":\"wxc1d482cb439d570d\",\n" + - " \"userId\": \"o4Jwb42CBpXgAZJaF985MViTBIaI\",\n" + - " \"profitSharing\": 0\n" + + " \"userId\": \"od8qG06bHnTsDWklsB2VsssLZYcQ\",\n" + + " \"profitSharing\": 0" + "}"; - String sign = createSign(JSONObject.parseObject(paramStr), "2sKRbwGqRoejsqn9HFJL9p5T0GqDOONp"); + String sign = createSign(JSONObject.parseObject(paramStr), "2jLO2WjXcSRSzTCaca0Kmv0OFrfYBbrA"); System.out.println(sign); } } diff --git a/service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java index 42c042d..17750ad 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java @@ -402,6 +402,10 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService { criteria.andSettleAmountIsNull(); } + if (StringUtils.isNotBlank(MapUtils.getString(param, "specialField"))) { + criteria.andSpecialFieldLike("%"+MapUtils.getString(param, "specialField")+"%"); + } + example.setOrderByClause("create_time desc"); return tradeOrderMapper.selectByExample(example); }