| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.beetl.ShiroExtUtil; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.dao.UserActivityMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.util.DateUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Autowired |
| | | private IUserActivityInviteService userActivityInviteService; |
| | | |
| | | |
| | | @Autowired |
| | | private IUserActivityRedenvelopeService userActivityRedenvelopeService; |
| | | |
| | | |
| | | @Autowired |
| | | private IUserActivityRegisteredService userActivityRegisteredService; |
| | | |
| | | |
| | | @Autowired |
| | | private IUserService userService; |
| | | |
| | | @Resource |
| | | private ShiroExtUtil shiroExtUtil; |
| | | |
| | | @Override |
| | | public void insertOrUpdate(Integer id, String name, String startTime, Integer registCouponId, Integer registEnable, Integer registNumber, Integer registEffective, |
| | | Integer inviteCouponId, Integer inviteEnable, Integer inviteNumber, Integer inviteEffective, Integer balanceEnable, String balanceInfo, |
| | | Integer discountEnable, Double discountSpecial, Double discountTaxi, Double discountLogistics, Integer redenvelopeId, Integer redenvelopeEnable, |
| | | Double registerPrice, Double invitationPrice, Double redPrice) { |
| | | if(id==null) { |
| | | if (id == null) { |
| | | String[] timeArray = startTime.split(" - "); |
| | | Date startTimes = DateUtil.getDate_str3(timeArray[0]); |
| | | Date endTimes = DateUtil.getDate_str3(timeArray[1]); |
| | | ShiroUser user = ShiroExtUtil.getUser(); |
| | | ShiroUser user = shiroExtUtil.getUser(); |
| | | Date nowDay = new Date(); |
| | | UserActivity userActivity = new UserActivity(); |
| | | userActivity.setInsertTime(nowDay); |
| | | userActivity.setCompanyId(ShiroExtUtil.getUser().getObjectId()); |
| | | userActivity.setCompanyType(ShiroExtUtil.getUser().getRoleType()); |
| | | userActivity.setCompanyId(shiroExtUtil.getUser().getObjectId()); |
| | | userActivity.setCompanyType(shiroExtUtil.getUser().getRoleType()); |
| | | userActivity.setStatus(userActivity.getCompanyType() == 1 ? 3 : 1); |
| | | userActivity.setName(name); |
| | | userActivity.setStartTime(startTimes); |
| | |
| | | String[] timeArray = startTime.split(" - "); |
| | | Date startTimes = DateUtil.getDate_str3(timeArray[0]); |
| | | Date endTimes = DateUtil.getDate_str3(timeArray[1]); |
| | | ShiroUser user = ShiroExtUtil.getUser(); |
| | | ShiroUser user = shiroExtUtil.getUser(); |
| | | Date nowDay = new Date(); |
| | | UserActivity userActivity = new UserActivity(); |
| | | userActivity.setId(id); |
| | | userActivity.setInsertTime(nowDay); |
| | | userActivity.setCompanyId(ShiroExtUtil.getUser().getObjectId()); |
| | | userActivity.setCompanyType(ShiroExtUtil.getUser().getRoleType()); |
| | | userActivity.setCompanyId(shiroExtUtil.getUser().getObjectId()); |
| | | userActivity.setCompanyType(shiroExtUtil.getUser().getRoleType()); |
| | | userActivity.setStatus(userActivity.getCompanyType() == 1 ? 3 : 1); |
| | | userActivity.setName(name); |
| | | userActivity.setStartTime(startTimes); |
| | |
| | | userActivityRedenvelopeService.delete(new EntityWrapper<UserActivityRedenvelope>().eq("userActivityId", id)); |
| | | userActivityRegisteredService.delete(new EntityWrapper<UserActivityRegistered>().eq("userActivityId", id)); |
| | | //添加注册奖励 |
| | | if(registCouponId!=null){ |
| | | if (registCouponId != null) { |
| | | UserActivityRegistered userActivityRegistered = new UserActivityRegistered(); |
| | | userActivityRegistered.setCouponId(registCouponId); |
| | | userActivityRegistered.setEnable(registEnable); |