| | |
| | | import com.stylefeng.guns.core.beetl.ShiroExtUtil; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.model.MerchantActivity; |
| | | import com.stylefeng.guns.modular.system.model.MerchantActivitySlave; |
| | | import com.stylefeng.guns.modular.system.model.User; |
| | | import com.stylefeng.guns.modular.system.model.UserMerchantCoupon; |
| | | import com.stylefeng.guns.modular.system.response.MerchantActivityVo; |
| | | import com.stylefeng.guns.modular.system.response.UserRequest; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | private ITMerchantService merchantService; |
| | | @Autowired |
| | | private IUserMerchantCouponService userMerchantCouponService; |
| | | |
| | | |
| | | @Autowired |
| | | private IUserService userService; |
| | | |
| | | |
| | | @Resource |
| | | private ShiroExtUtil shiroExtUtil; |
| | | |
| | | @RequestMapping("/index") |
| | | public String index() { |
| | | return PREFIX + "merchantActivityGive.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @param startTime |
| | | * @param endTime |
| | |
| | | @ResponseBody |
| | | public Object list(String startTime, String endTime, Integer type, String merchantName, Integer status) { |
| | | |
| | | Integer companyId = ShiroExtUtil.getUser().getObjectId(); |
| | | |
| | | Integer companyId = shiroExtUtil.getUser().getObjectId(); |
| | | |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | List<Map<String, Object>> list = merchantActivityService.getMerchantActivityGiveList(startTime, endTime, type, merchantName, status, companyId, page); |
| | | page.setRecords(list); |
| | |
| | | @RequestMapping("/add") |
| | | public Object add(@RequestBody MerchantActivity activity) { |
| | | |
| | | Integer userId = ShiroExtUtil.getUser().getId(); |
| | | Integer userId = shiroExtUtil.getUser().getId(); |
| | | User user = userService.selectById(userId); |
| | | if (ToolUtil.isNotEmpty(user)) { |
| | | if (user.getRoleType().equals(2)) { |