From 9236a1b324cf9281303be91ab6842c6ac4cd59a5 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 6 Nov 2023 14:19:12 +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 --- .../controller/BsRebateRewardController.java | 2 + .../com/cweb/controller/TestController.java | 57 ++++++++++++------- .../api/controller/v1/TradeController.java | 6 ++ .../hfkj/service/impl/BsMerServiceImpl.java | 17 +++++- .../impl/BsRebateRewardServiceImpl.java | 2 +- 5 files changed, 62 insertions(+), 22 deletions(-) diff --git a/bweb/src/main/java/com/bweb/controller/BsRebateRewardController.java b/bweb/src/main/java/com/bweb/controller/BsRebateRewardController.java index 29f7419..d2a4e8e 100644 --- a/bweb/src/main/java/com/bweb/controller/BsRebateRewardController.java +++ b/bweb/src/main/java/com/bweb/controller/BsRebateRewardController.java @@ -147,6 +147,8 @@ public class BsRebateRewardController { // 上传华为云 OBS HuaWeiYunObs.obsUtilPutObject(CommonSysConst.getSysConfig().getFilesystem() + "/" + childPath + fileName, HuaWeiYunObs.bucketName, childPath + fileName); + // 延迟1秒 OBS服务器内网上传,有时间差 + Thread.sleep(1000); String fileUrl = CommonSysConst.getSysConfig().getObs_url() + "/"+ childPath + fileName; return ResponseMsgUtil.success(fileUrl); diff --git a/cweb/src/main/java/com/cweb/controller/TestController.java b/cweb/src/main/java/com/cweb/controller/TestController.java index a677ecd..a64241a 100644 --- a/cweb/src/main/java/com/cweb/controller/TestController.java +++ b/cweb/src/main/java/com/cweb/controller/TestController.java @@ -28,6 +28,7 @@ import com.hfkj.model.MerBasisModel; import com.hfkj.model.ResponseData; import com.hfkj.service.*; import com.hfkj.service.rebate.BsRebateMerAccountService; +import com.hfkj.service.rebate.BsRebatePartMerService; import com.hfkj.service.rebate.BsRebateRewardService; import com.hfkj.service.rebate.model.RebateMerAccountTradeObject; import com.hfkj.sysenum.*; @@ -36,6 +37,7 @@ import com.hfkj.unipush.UniPushService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; @@ -109,6 +111,9 @@ public class TestController { @Resource private BsStoreCidService bsStoreCidService; + @Resource + private BsRebatePartMerService rebatePartMerService; + @RequestMapping(value="/refreshMerStatus",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "refreshMerStatus") @@ -266,7 +271,9 @@ public class TestController { @RequestMapping(value="/tianQueTest",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "tianQueTest") - public ResponseData tianQueTest(@RequestParam(value = "code", required = false) String code) { + public ResponseData tianQueTest(@RequestParam(value = "code", required = false) String code, + @RequestParam(value = "timeS", required = false) Long timeS, + @RequestParam(value = "timeE", required = false) Long timeE) { try { // tianQueMerService.addMer(Long.parseLong(code)); // return ResponseMsgUtil.success(tianQueMerService.queryMerchantInfo(code)); @@ -280,27 +287,37 @@ public class TestController { //return ResponseMsgUtil.success(tianQueMerService.weChatPayConf("399230921077727", "597456493", "01", "wxa075e8509802f826", "00", "")); // return ResponseMsgUtil.success(tianQueMerService.queryConf("399230921077727", "597456493")); // return ResponseMsgUtil.success(tianQueSeparateService.queryAmt(code)); - String orderNo = System.currentTimeMillis()+""; - System.out.println("order:" + orderNo); - // return ResponseMsgUtil.success(tianQueFundManageService.orgTransfer("399230906938051",orderNo,new BigDecimal("0.01"), "测试", "01")); - List merId = new ArrayList<>(); - merId.add(51L); - merId.add(61L); - - for (Long id : merId) { - BsMer mer = merService.getMer(id); - BsRebateMerAccount rebateMerAccount = new BsRebateMerAccount(); - rebateMerAccount.setAccountNumber(System.currentTimeMillis()); - rebateMerAccount.setAmount(new BigDecimal("0")); - rebateMerAccount.setMerId(mer.getId()); - rebateMerAccount.setMerNo(mer.getMerNo()); - rebateMerAccount.setMerName(mer.getMerName()); - rebateMerAccount.setMerAbbreviate(mer.getMerAbbreviate()); - rebateMerAccountService.editData(rebateMerAccount); + + // 刷新活动金账户 + if (StringUtils.isNotBlank(code) && code.equals("01")) { + Map param = new HashMap<>(); + List merList = merService.getMerList(param); + for (BsMer mer : merList) { + BsRebateMerAccount rebateMerAccount = new BsRebateMerAccount(); + rebateMerAccount.setAccountNumber((10000000 + mer.getId())); + rebateMerAccount.setAmount(new BigDecimal("0")); + rebateMerAccount.setMerId(mer.getId()); + rebateMerAccount.setMerNo(mer.getMerNo()); + rebateMerAccount.setMerName(mer.getMerName()); + rebateMerAccount.setMerAbbreviate(mer.getMerAbbreviate()); + rebateMerAccountService.editData(rebateMerAccount); + } + } else if (StringUtils.isNotBlank(code) && code.equals("02")){ + + Map param = new HashMap<>(); + param.put("status", RebatePartMerStatusEnum.status1.getNumber()); + List merList = rebatePartMerService.getMerList(param); + + List merIdList = new ArrayList<>(); + for (BsRebatePartMer partMer : merList) { + merIdList.add(partMer.getMerId()); + } + rebateRewardService.createReward(new Date(timeS), new Date(timeE), merIdList); + // rebateRewardService.createReward(new Date(1680278400000L), new Date(1696089600000L), merIdList); } + // return ResponseMsgUtil.success(tianQueFundManageService.orgTransfer("399230906938051",orderNo,new BigDecimal("0.01"), "测试", "01")); - rebateRewardService.createReward(new Date(1680278400000L), new Date(1696089600000L), merId); // rebateRewardService.grantReward(202310111953L); /* @@ -312,7 +329,7 @@ public class TestController { // tianQueFundManageService.orgTransfer("399230920037043", orderNo, new BigDecimal("0.01"), "测试营销转账", "02"); - return ResponseMsgUtil.success(orderNo); + return ResponseMsgUtil.success(null); // return ResponseMsgUtil.success(tianQueFundManageService.getTransferInfo(orderNo)); // 1200 diff --git a/open-api/src/main/java/com/api/controller/v1/TradeController.java b/open-api/src/main/java/com/api/controller/v1/TradeController.java index 5efbe3c..72d3de5 100644 --- a/open-api/src/main/java/com/api/controller/v1/TradeController.java +++ b/open-api/src/main/java/com/api/controller/v1/TradeController.java @@ -272,6 +272,8 @@ public class TradeController { // 上传华为云 OBS HuaWeiYunObs.obsUtilPutObject(CommonSysConst.getSysConfig().getFilesystem() + "/" + childPath + fileName, HuaWeiYunObs.bucketName, childPath + fileName); + // 延迟1秒 OBS服务器内网上传,有时间差 + Thread.sleep(1000); String fileUrl = CommonSysConst.getSysConfig().getObs_url() + "/"+ childPath + fileName; log.info("返回参数:" + fileUrl); @@ -313,6 +315,8 @@ public class TradeController { // 上传华为云 OBS HuaWeiYunObs.obsUtilPutObject(CommonSysConst.getSysConfig().getFilesystem() + "/" + childPath + fileName, HuaWeiYunObs.bucketName, childPath + fileName); + // 延迟1秒 OBS服务器内网上传,有时间差 + Thread.sleep(1000); String fileUrl = CommonSysConst.getSysConfig().getObs_url() + "/"+ childPath + fileName; log.info("返回参数:" + fileUrl); @@ -368,6 +372,8 @@ public class TradeController { // 上传华为云 OBS HuaWeiYunObs.obsUtilPutObject(CommonSysConst.getSysConfig().getFilesystem() + "/" + childPath + fileName, HuaWeiYunObs.bucketName, childPath + fileName); + // 延迟1秒 OBS服务器内网上传,有时间差 + Thread.sleep(1000); String fileUrl = CommonSysConst.getSysConfig().getObs_url() + "/"+ childPath + fileName; log.info("返回参数:" + fileUrl); diff --git a/service/src/main/java/com/hfkj/service/impl/BsMerServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsMerServiceImpl.java index c311f69..8889f2f 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsMerServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/impl/BsMerServiceImpl.java @@ -16,6 +16,7 @@ import com.hfkj.model.MerAccountModel; import com.hfkj.model.MerBasisModel; import com.hfkj.model.StoreModel; import com.hfkj.service.*; +import com.hfkj.service.rebate.BsRebateMerAccountService; import com.hfkj.sysenum.*; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; @@ -26,6 +27,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.io.IOException; +import java.math.BigDecimal; import java.util.Date; import java.util.List; import java.util.Map; @@ -78,6 +80,9 @@ public class BsMerServiceImpl implements BsMerService { @Resource private CommonService commonService; + @Resource + private BsRebateMerAccountService rebateMerAccountService; + @Override public void editMer(BsMer mer) { if (mer.getId() == null) { @@ -142,9 +147,19 @@ public class BsMerServiceImpl implements BsMerService { @Override @Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class}) - public void configMerBasis(BsMer mer, BsMerIndustry merIndustry, BsMerRegion merRegion) throws IOException { + public void configMerBasis(BsMer mer, BsMerIndustry merIndustry, BsMerRegion merRegion) { editMer(mer); + // 配置活动金账户 + BsRebateMerAccount rebateMerAccount = new BsRebateMerAccount(); + rebateMerAccount.setAccountNumber((10000000 + mer.getId())); + rebateMerAccount.setAmount(new BigDecimal("0")); + rebateMerAccount.setMerId(mer.getId()); + rebateMerAccount.setMerNo(mer.getMerNo()); + rebateMerAccount.setMerName(mer.getMerName()); + rebateMerAccount.setMerAbbreviate(mer.getMerAbbreviate()); + rebateMerAccountService.editData(rebateMerAccount); + // 行业 BsMerIndustry industry = merIndustryService.getMerIndustryByMerId(mer.getId()); if (industry != null) { diff --git a/service/src/main/java/com/hfkj/service/rebate/impl/BsRebateRewardServiceImpl.java b/service/src/main/java/com/hfkj/service/rebate/impl/BsRebateRewardServiceImpl.java index 4079611..d2691b8 100644 --- a/service/src/main/java/com/hfkj/service/rebate/impl/BsRebateRewardServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/rebate/impl/BsRebateRewardServiceImpl.java @@ -105,7 +105,7 @@ public class BsRebateRewardServiceImpl implements BsRebateRewardService { roster.setSalesmanName(mer.getSalesmanName()); roster.setMerId(mer.getId()); roster.setMerNo(mer.getMerNo()); - roster.setMerName(mer.getMerNo()); + roster.setMerName(mer.getMerName()); roster.setMerAbbreviate(mer.getMerAbbreviate()); roster.setMerAccountNumber(rebateMerAccountService.getAccountByMerId(merId).getAccountNumber()); List> collect = merRatioList.stream().filter(o -> o.get("merId").equals(merId)).collect(Collectors.toList());