| | |
| | | @ResponseBody |
| | | @PostMapping("/coupon/queryCouponByUser/{userId}") |
| | | public List<Integer> queryCouponByUser(@PathVariable("userId") Integer userId){ |
| | | List<Coupon> list = couponService.list(new QueryWrapper<Coupon>().eq("distributionMethod", 2).eq("userPopulation",2) |
| | | List<Coupon> list = couponService.list(new QueryWrapper<Coupon>().eq("distributionMethod", 2) |
| | | .le("startTime", new Date()).ge("endTime", new Date()).eq("auditStatus", 2) |
| | | .eq("state", 1)); |
| | | |
| | |
| | | Integer publisherType = (Integer) stringObjectMap.get("publisherType"); |
| | | if (publisherType!=null) { |
| | | if (publisherType == 1) { |
| | | Integer cityManagerId = (Integer) stringObjectMap.get("cityManagerId"); |
| | | TCityManager byId = citClient.getById(cityManagerId); |
| | | stringObjectMap.put("province", byId.getProvince()); |
| | | |
| | | stringObjectMap.put("city", byId.getCity()); |
| | | } |
| | | } |
| | | } |
| | |
| | | case 1: |
| | | coupon.setIntegral(BigDecimal.valueOf(dataVo.getRequiredPoints())); |
| | | break; |
| | | case 2: |
| | | coupon.setCash(dataVo.getRequiredCash()); |
| | | coupon.setIntegral(BigDecimal.valueOf(dataVo.getRequiredPoints())); |
| | | break; |
| | | |
| | | case 3: |
| | | coupon.setCash(dataVo.getRequiredCash()); |
| | | break; |
| | |
| | | } |
| | | if (dataVo.getUserType() == 1){ |
| | | coupon.setPublisherType(2); |
| | | coupon.setAuditStatus(2); |
| | | coupon.setCityManagerId(dataVo.getCityManagerId()); |
| | | } |
| | | if (dataVo.getUserType() == 2){ |
| | | coupon.setPublisherType(1); |
| | | coupon.setCityManagerId(dataVo.getCityManagerId()); |
| | | } |
| | | if(dataVo.getObjType()!=1){ |
| | | coupon.setAuditStatus(1); |
| | | } |
| | | if (dataVo.getUserType()==1){ |
| | | if (dataVo.getUserType() == 3){ |
| | | coupon.setPublisherType(3); |
| | | coupon.setAuditStatus(2); |
| | | }else{ |
| | | coupon.setAuditStatus(1); |
| | | } |
| | | if(dataVo.getObjType()!=1){ |
| | | coupon.setAuditStatus(1); |
| | | coupon.setCityManagerId(dataVo.getCityManagerId()); |
| | | } |
| | | |
| | | boolean save = couponService.save(coupon); |