From 12ec47a5fed86e04433ca725caf6068c5000d0af Mon Sep 17 00:00:00 2001 From: 44323 <443237572@qq.com> Date: 星期日, 08 十月 2023 17:02:09 +0800 Subject: [PATCH] 后台代码 --- cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java | 114 +++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 87 insertions(+), 27 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 3759f72..b46d67c 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 @@ -12,7 +12,10 @@ import com.dsh.activity.feignclient.other.StoreClient; import com.dsh.activity.feignclient.other.model.Store; import com.dsh.activity.feignclient.other.model.StoreDetailOfCourse; +import com.dsh.activity.model.CoachChangeStateVO; +import com.dsh.activity.model.PointMerchandiseIncomeVo; import com.dsh.activity.model.PointMerchandiseVo; +import com.dsh.activity.model.WriteOffDTO; import com.dsh.activity.model.request.*; import com.dsh.activity.model.response.GoodsInfoOneVo; import com.dsh.activity.model.response.StoreVos; @@ -73,7 +76,91 @@ @Resource private CouponCityService ccityService; + @Autowired + private UserPointsMerchandiseService userPointsMerchandiseService; + /** + * 门票上下架 state=1 上架 state=2 下架 + */ + @RequestMapping("/base/pointMerchars/changeState") + public Object changeState(@RequestBody CoachChangeStateVO dto){ + return pmdsService.changeState(dto); + } + /** + * 门票核销 + */ + @RequestMapping("/base/pointMerchars/writeOff") + public Object writeOff(@RequestBody WriteOffDTO dto){ + UserPointsMerchandise byId = userPointsMerchandiseService.getById(dto.getId()); + byId.setStoreId(dto.getVerifiStoreId()); + byId.setStatus(2); + byId.setVerificationTime(new Date()); + byId.setUserId(null); + byId.setVerificationUserId(dto.getVerificationUserId()); + return userPointsMerchandiseService.updateById(byId); + } + @ResponseBody + @PostMapping("/base/pointMerchars/ticketList") + public List<Map<String,Object>> ticketList(@RequestBody IntegralGoodsOfSearch ofSearch){ + List<Map<String, Object>> result = pmdsService.ticketList(ofSearch); + if (result.size() > 0){ + for (Map<String, Object> stringObjectMap : result) { + 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())){ + result = dealTimeData(result,ofSearch.getActiveStatus()); + } + } + return result; + } + @ResponseBody + @PostMapping("/base/pointMerchars/queryGoodsListSearch") + public List<Map<String,Object>> getIntegralGoodsListOfSearch(@RequestBody IntegralGoodsOfSearch ofSearch){ + System.out.println(ofSearch); + List<Map<String, Object>> mapList = pmdsService.queryGoodsListOfSearch(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; + } + /** + * 获取积分商票消费金额 + */ + @ResponseBody + @RequestMapping("/base/pointMerchars/getAmount") + public List<PointMerchandiseIncomeVo> getAmount(){ + return userPointsMerchandiseService.getAmount(); + } @Resource private PointsMerchandiseCityService pmdsCityService; @@ -549,34 +636,7 @@ } - @ResponseBody - @PostMapping("/base/pointMerchars/queryGoodsListSearch") - public List<Map<String,Object>> getIntegralGoodsListOfSearch(@RequestBody IntegralGoodsOfSearch ofSearch){ - System.out.println(ofSearch); - List<Map<String, Object>> mapList = pmdsService.queryGoodsListOfSearch(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; - } public int dealTimeStatus(String startTime, String endTime){ LocalDate now = LocalDate.now(); -- Gitblit v1.7.1