| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.page.PageInfoBT; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | |
| | | |
| | | /** |
| | | * 跳转领取统计 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/receiveRecord") |
| | |
| | | UserActivityRedenvelope userActivityRedenvelope = userActivityRedenvelopeService.selectOne(new EntityWrapper<UserActivityRedenvelope>().eq("userActivityId",activityId)); |
| | | if(SinataUtil.isNotEmpty(userActivityRegistered)){ |
| | | Map<String,Object> resultMap = userCouponRecordService.getCouponStatic(startTimes,endTimes,userActivityRegistered.getId(),2); |
| | | if (null != resultMap) { |
| | | totalMOney+=Double.parseDouble(resultMap.get("money").toString()); |
| | | map.put("userActivityRegisteredMoney",resultMap.get("money")); |
| | | map.put("userActivityRegisteredNumber",resultMap.get("number")); |
| | |
| | | map.put("userActivityRegisteredNumber",0); |
| | | map.put("userActivityRegisteredUseMoney",0); |
| | | } |
| | | } else { |
| | | map.put("userActivityRegisteredMoney", 0); |
| | | map.put("userActivityRegisteredNumber", 0); |
| | | map.put("userActivityRegisteredUseMoney", 0); |
| | | } |
| | | if(SinataUtil.isNotEmpty(userActivityInvite)){ |
| | | Map<String,Object> resultMap = userCouponRecordService.getCouponStatic(startTimes,endTimes,userActivityInvite.getId(),3); |
| | | if (null != resultMap) { |
| | | totalMOney+=Double.parseDouble(resultMap.get("money").toString()); |
| | | map.put("userActivityInviteMoney",resultMap.get("money")); |
| | | map.put("userActivityInviteNumber",resultMap.get("number")); |
| | | map.put("userActivityInviteUseMoney",resultMap.get("useMoney")); |
| | | } else { |
| | | map.put("userActivityInviteMoney", 0); |
| | | map.put("userActivityInviteNumber", 0); |
| | | map.put("userActivityInviteUseMoney", 0); |
| | | } |
| | | }else{ |
| | | map.put("userActivityInviteMoney",0); |
| | | map.put("userActivityInviteNumber",0); |
| | |
| | | Integer i = Integer.valueOf(string); |
| | | // 小件物流 |
| | | Map<String,Object> resultMap1 = userCouponRecordService.getDiscountStatic1(startTimes,endTimes,userActivityDiscount1.getId()); |
| | | if (null != resultMap1) { |
| | | BigDecimal bigDecimal1 = new BigDecimal(resultMap1.get("money").toString()); |
| | | String string1 = resultMap1.get("number").toString(); |
| | | Integer i1 = Integer.valueOf(string1); |
| | |
| | | map.put("userActivityDiscount1Money",0); |
| | | map.put("userActivityDiscount1Number",0); |
| | | } |
| | | } else { |
| | | map.put("userActivityDiscount1Money", 0); |
| | | map.put("userActivityDiscount1Number", 0); |
| | | } |
| | | if(SinataUtil.isNotEmpty(userActivityRedenvelope)){ |
| | | Map<String,Object> resultMap = userCouponRecordService.getRedStatic(startTimes,endTimes,userActivityRedenvelope.getId()); |
| | | if (null != resultMap) { |
| | | totalMOney+=Double.parseDouble(resultMap.get("money").toString()); |
| | | map.put("userActivityRedenvelopeMoney",resultMap.get("money")); |
| | | map.put("userActivityRedenvelopeNumber",resultMap.get("number")); |
| | | map.put("userActivityRedenvelopeUseMoney",resultMap.get("useMoney")); |
| | | } else { |
| | | map.put("userActivityRedenvelopeMoney", 0); |
| | | map.put("userActivityRedenvelopeNumber", 0); |
| | | map.put("userActivityRedenvelopeUseMoney", 0); |
| | | } |
| | | }else{ |
| | | map.put("userActivityRedenvelopeMoney",0); |
| | | map.put("userActivityRedenvelopeNumber",0); |
| | |
| | | public String index() { |
| | | return PREFIX + "userActivity.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转添加注册送优惠券页面 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("addRegist") |
| | | public String addRegist() { |
| | | return PREFIX + "addRegist.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转红包选择页面 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/sysRedPacketRecord") |
| | | public String sysRedPacketRecord() { |
| | | return PREFIX + "sysRedPacketRecord.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到选择优惠券页面 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/sysCouponRecord") |
| | |
| | | public String sysCouponRecord1() { |
| | | return PREFIX + "sysCouponRecord1.html"; |
| | | } |
| | | |
| | | @RequestMapping("/sysCouponRecord2") |
| | | public String sysCouponRecord2(Model model,Integer type) { |
| | | model.addAttribute("type",type); |
| | | return PREFIX + "sysCouponRecord2.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | |
| | | LogObjectHolder.me().set(userActivity); |
| | | return PREFIX + "userActivity_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | |
| | | page.setRecords(userCouponRecordService.getBlanceList(page,beginTime,endTime,activityId)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param name 活动时间 |
| | | * @param startTime 时间区间 |
| | | * @param registCouponId 注册活动-优惠券id |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param name 活动时间 |
| | | * @param startTime 时间区间 |
| | | * @param registCouponId 注册活动-优惠券id |
| | |
| | | redenvelopeId, redenvelopeEnable, registerPrice, invitationPrice, redPrice,discountDistance,discountOrderNum); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改状态 |
| | | * |
| | | * @param driverActivity |
| | | * @return |
| | | */ |
| | |
| | | userActivityService.updateById(driverActivity); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "userActivity_immediately.html"; |
| | | } |
| | | |
| | | /** |
| | | * 立即处理操作 |
| | | */ |