From 7808456a1e50af2dbd67488278eac85a558bd8f9 Mon Sep 17 00:00:00 2001 From: 44323 <443237572@qq.com> Date: 星期日, 08 十月 2023 17:05:36 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/PlayPai --- cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 116 insertions(+), 4 deletions(-) diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java b/cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java index b46d67c..6569c12 100644 --- a/cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java +++ b/cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java @@ -16,6 +16,7 @@ import com.dsh.activity.model.PointMerchandiseIncomeVo; import com.dsh.activity.model.PointMerchandiseVo; import com.dsh.activity.model.WriteOffDTO; +import com.dsh.activity.model.QueryDataFee; import com.dsh.activity.model.request.*; import com.dsh.activity.model.response.GoodsInfoOneVo; import com.dsh.activity.model.response.StoreVos; @@ -76,6 +77,11 @@ @Resource private CouponCityService ccityService; + + + @Resource + private PointsMerchandiseCityService pmdsCityService; + @Autowired private UserPointsMerchandiseService userPointsMerchandiseService; @@ -161,9 +167,6 @@ public List<PointMerchandiseIncomeVo> getAmount(){ return userPointsMerchandiseService.getAmount(); } - - @Resource - private PointsMerchandiseCityService pmdsCityService; @ResponseBody @@ -637,7 +640,6 @@ - public int dealTimeStatus(String startTime, String endTime){ LocalDate now = LocalDate.now(); LocalDate start = LocalDate.parse(startTime); @@ -985,4 +987,114 @@ } + + @ResponseBody + @PostMapping("/base/pointMerchars/getIntegralGoodsListOfSearchAudit") + public List<Map<String,Object>> getIntegralGoodsListOfSearchAudit(@RequestBody IntegralGoodsOfSearch ofSearch){ + System.out.println(ofSearch); + List<Map<String, Object>> mapList = pmdsService.queryGoodsListOfSearchAudit(ofSearch); + if (mapList.size() > 0){ + for (Map<String, Object> stringObjectMap : mapList) { + Integer o = (Integer) stringObjectMap.get("id"); + String startTime = (String) stringObjectMap.get("startTime"); + String endTime = (String) stringObjectMap.get("endTime"); + stringObjectMap.put("timeValue",startTime + "至"+endTime); + int count1 = upmseService.count(new LambdaQueryWrapper<UserPointsMerchandise>() + .eq(UserPointsMerchandise::getPointsMerchandiseId, o)); + int count2 = upmseService.count(new LambdaQueryWrapper<UserPointsMerchandise>() + .eq(UserPointsMerchandise::getPointsMerchandiseId, o) + .eq(UserPointsMerchandise::getStatus,2)); + stringObjectMap.put("hasExchangeQty",count1); + stringObjectMap.put("hasPickQty",count2); + + stringObjectMap.put("activeStatus",dealTimeStatus(startTime,endTime)); + } + if (ToolUtil.isNotEmpty(ofSearch.getActiveStatus())){ + mapList = dealTimeData(mapList,ofSearch.getActiveStatus()); + } + } + System.out.println("mapList->"+mapList); + return mapList; + } + + + @PostMapping("/base/pointMerchars/updateType") + @ResponseBody + public Object updateType(@RequestBody String s){ + String[] split = s.split("_"); + PointsMerchandise byId = pmdsService.getById(split[0]); + byId.setStatus(Integer.valueOf(split[1])); + if(Integer.valueOf(split[1])==3){ + + byId.setRemark(split[2]); + } + return pmdsService.updateById(byId); + + } + + + @PostMapping("/base/pointMerchars/queryFee") + @ResponseBody + public HashMap<String, Object> queryFee(@RequestBody QueryDataFee queryDataFee){ + HashMap<String, Object> map = new HashMap<>(); + String data = queryDataFee.getData(); + List<Integer> ids = queryDataFee.getIds(); + if(ids.size()==0){ + ids.add(-1); + } + List<PointsMerchandise> list1 = pmdsService.list(new LambdaQueryWrapper<PointsMerchandise>().eq(PointsMerchandise::getRedemptionMethod, 3)); + LambdaQueryWrapper<UserPointsMerchandise> vipPaymentLambdaQueryWrapper = new LambdaQueryWrapper<>(); + if(ToolUtil.isNotEmpty(data)){ + String stime = data.split(" - ")[0]+" 00:00:00"; + String etime = data.split(" - ")[1]+" 23:59:59"; + vipPaymentLambdaQueryWrapper.between(UserPointsMerchandise::getInsertTime,stime,etime); + } + vipPaymentLambdaQueryWrapper.in(UserPointsMerchandise::getUserId,ids); + List<Integer> collect = list1.stream().map(PointsMerchandise::getId).collect(Collectors.toList()); + if(collect.size()==0){ + collect.add(-1); + } + vipPaymentLambdaQueryWrapper.in(UserPointsMerchandise::getPointsMerchandiseId,collect); + vipPaymentLambdaQueryWrapper.eq(UserPointsMerchandise::getPayStatus,2); + ArrayList<Integer> objects = new ArrayList<>(); + List<UserPointsMerchandise> list = upmseService.list(vipPaymentLambdaQueryWrapper); + + double a =0; + double d =0; + double m =0; + double j =0; + double y =0; + for (UserPointsMerchandise userPointsMerchandise : list) { + for (PointsMerchandise pointsMerchandise : list1) { + if(pointsMerchandise.getId()==userPointsMerchandise.getPointsMerchandiseId()){ + a += pointsMerchandise.getCash().doubleValue(); + } + if(pointsMerchandise.getType()==3){ + if(pointsMerchandise.getCardType()==1){ + d += pointsMerchandise.getCash().doubleValue(); + } + if(pointsMerchandise.getCardType()==2){ + m += pointsMerchandise.getCash().doubleValue(); + } + if(pointsMerchandise.getCardType()==3){ + j += pointsMerchandise.getCash().doubleValue(); + } + if(pointsMerchandise.getCardType()==4){ + y += pointsMerchandise.getCash().doubleValue(); + } + } + } + + } + + map.put("all",a); + map.put("day",d); + map.put("month",m); + map.put("quarter",j); + map.put("year",y); + return map; + + + } + } -- Gitblit v1.7.1