| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import cn.hutool.system.UserInfo; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | |
| | | 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.TSystemNotice; |
| | | import com.stylefeng.guns.modular.system.model.TUser; |
| | | import com.stylefeng.guns.modular.system.model.UserRedPacketRecord; |
| | | import com.stylefeng.guns.modular.system.service.ITSystemNoticeService; |
| | | import com.stylefeng.guns.modular.system.service.ITUserService; |
| | | import com.stylefeng.guns.modular.system.service.IUserRedPacketRecordService; |
| | | import com.stylefeng.guns.modular.system.service.impl.UserServiceImpl; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private ITSystemNoticeService systemNoticeService; |
| | | |
| | | @Autowired |
| | | private ITUserService userService; |
| | | |
| | | |
| | | @RequestMapping(value = "/direct") |
| | | @ResponseBody |
| | | public ResultUtil direct(String ids, Integer redId) { |
| | |
| | | money = Double.valueOf(String.valueOf(sysRedPacketRecord.getMoney())); |
| | | //计算剩余金额是否够 |
| | | |
| | | if (v <= 0){ |
| | | |
| | | if (v-money*ids.split(",").length < 0){ |
| | | return ResultUtil.error("当前红包剩余金额不足"); |
| | | } |
| | | |
| | |
| | | // userRedPacketRecord.setOrderType(3); |
| | | userRedPacketRecord.setUserId(Integer.valueOf(s)); |
| | | userRedPacketRecordService.insert(userRedPacketRecord); |
| | | |
| | | TUser tUser = userService.selectById(Integer.valueOf(s)); |
| | | Integer language = tUser.getLanguage(); |
| | | try { |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您收到一个额度为GHS"+money+"的红包,请查收。" : language == 2 ? "You have received a red envelope with a limit of GHS"+money+". Please check it." : "Vous recevez un paquet rouge avec une limite de ghs+"+money+", veuillez vérifier.", tUser.getId()); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | return ResultUtil.success("指派成功",null,"当前红包为随机红包,可能有部分用户无法领取"); |