| | |
| | | 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; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IUserMerchantCouponService userMerchantCouponService; |
| | | |
| | | |
| | | @Autowired |
| | | private ITMerchantService merchantService; |
| | | |
| | | |
| | | @Autowired |
| | | private IMerchantActivitySlaveService merchantActivitySlaveService; |
| | | |
| | | |
| | | @Autowired |
| | | private IUserService userService; |
| | | |
| | | |
| | | @Resource |
| | | private ShiroExtUtil shiroExtUtil; |
| | | |
| | | @RequestMapping("/index") |
| | | public String index() { |
| | | return PREFIX + "merchantActivity.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @param startTime |
| | | * @param endTime |
| | |
| | | @RequestMapping("/list") |
| | | @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.list(startTime, endTime, type, merchantName, status, companyId, page); |
| | |
| | | @ResponseBody |
| | | 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)) { |
| | |
| | | public Object activityExamineList(String startTime, String endTime, Integer type, Integer auditStatus) { |
| | | |
| | | Integer companyId = null; |
| | | if (ShiroExtUtil.getUser().getRoleType().equals(1)) { |
| | | companyId = ShiroExtUtil.getUser().getObjectId(); |
| | | if (shiroExtUtil.getUser().getRoleType().equals(1)) { |
| | | companyId = shiroExtUtil.getUser().getObjectId(); |
| | | } |
| | | |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | |
| | | @RequestMapping("/examine") |
| | | @ResponseBody |
| | | public Object examine(Integer id, Integer state, String auditNote) { |
| | | |
| | | |
| | | MerchantActivity activity = merchantActivityService.selectById(id); |
| | | |
| | | Integer userId = ShiroExtUtil.getUser().getId(); |
| | | Integer userId = shiroExtUtil.getUser().getId(); |
| | | User user = userService.selectById(userId); |
| | | |
| | | |
| | | if (ToolUtil.isNotEmpty(activity)) { |
| | | activity.setAuditStatus(state); |
| | | activity.setAuditNote(auditNote); |
| | | activity.setAuditUserId(user.getObjectId()); |
| | | activity.setAuditTime(new Date()); |
| | | |
| | | |
| | | merchantActivityService.updateById(activity); |
| | | } |
| | | return SUCCESS_TIP; |