|
|
|
@ -9,6 +9,7 @@ import com.hai.common.exception.SysCode; |
|
|
|
|
import com.hai.common.security.SessionObject; |
|
|
|
|
import com.hai.common.security.UserCenter; |
|
|
|
|
import com.hai.common.utils.DateUtil; |
|
|
|
|
import com.hai.common.utils.MemberValidateUtil; |
|
|
|
|
import com.hai.common.utils.ResponseMsgUtil; |
|
|
|
|
import com.hai.entity.*; |
|
|
|
|
import com.hai.model.ResponseData; |
|
|
|
@ -16,6 +17,7 @@ import com.hai.model.UserInfoModel; |
|
|
|
|
import com.hai.service.*; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@ -57,6 +59,8 @@ public class HighCouponAgentController { |
|
|
|
|
@Resource |
|
|
|
|
private HighCouponService highCouponService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HighCouponCodeOtherService couponCodeOtherService; |
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/getAgentCount", method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
@ -404,6 +408,7 @@ public class HighCouponAgentController { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("couponInfo", highCouponService.getCouponById(couponAgentCode.getCouponId())); |
|
|
|
|
map.put("couponCode", highCouponCodeService.getCouponCodeById(couponAgentCode.getCouponCodeId())); |
|
|
|
|
map.put("couponCodeOther", couponCodeOtherService.getDetailByCouponAgentCodeId(couponAgentCode.getId())); |
|
|
|
|
map.put("couponAgentCode", couponAgentCode); |
|
|
|
|
return ResponseMsgUtil.success(map); |
|
|
|
|
|
|
|
|
@ -413,7 +418,6 @@ public class HighCouponAgentController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/remark", method = RequestMethod.POST) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "填写备注") |
|
|
|
@ -444,44 +448,51 @@ public class HighCouponAgentController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/getRecordByCouponAgentId", method = RequestMethod.GET) |
|
|
|
|
@RequestMapping(value = "/pushGzSinopec", method = RequestMethod.POST) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "根据卡券与代理商关系 查询分发记录") |
|
|
|
|
public ResponseData getRecordByCouponAgentId(@RequestParam(name = "couponAgentId", required = true) Long couponAgentId, |
|
|
|
|
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
|
|
|
|
@RequestParam(name = "pageSize", required = true) Integer pageSize, |
|
|
|
|
HttpServletRequest request) { |
|
|
|
|
@ApiOperation(value = "推送贵州中石化") |
|
|
|
|
public ResponseData pushGzSinopec(@RequestBody String reqBody) { |
|
|
|
|
try { |
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
|
map.put("couponAgentId", couponAgentId); |
|
|
|
|
PageHelper.startPage(pageNum,pageSize); |
|
|
|
|
return ResponseMsgUtil.success(new PageInfo<>(highCouponAgentService.getRecordList(map))); |
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(reqBody); |
|
|
|
|
Long couponAgentCodeId = jsonObject.getLong("couponAgentCodeId"); |
|
|
|
|
String phone = jsonObject.getString("phone"); |
|
|
|
|
String remark = jsonObject.getString("remark"); |
|
|
|
|
if (couponAgentCodeId == null || StringUtils.isBlank(phone) || StringUtils.isBlank(remark)) { |
|
|
|
|
log.error("HighMerchantStoreController -> useCouponCode() error!","参数错误"); |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
|
} |
|
|
|
|
if (!MemberValidateUtil.validatePhone(phone)) { |
|
|
|
|
log.error("HighMerchantStoreController -> useCouponCode() error!","手机号格式错误"); |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "手机号格式错误"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
highCouponAgentService.pushGzSinopec(couponAgentCodeId, phone, remark); |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success("操作成功"); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("HighCouponAgentController --> getRecordByCouponAgentId() error!", e); |
|
|
|
|
log.error("HighCouponAgentController --> pushGzSinopec() error!", e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/getCouponByRecord", method = RequestMethod.GET) |
|
|
|
|
@RequestMapping(value = "/getRecordByCouponAgentId", method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "根据分发记录 查询卡券") |
|
|
|
|
public ResponseData getCouponByRecord(@RequestParam(name = "recordId", required = true) Long recordId, |
|
|
|
|
@ApiOperation(value = "根据卡券与代理商关系 查询分发记录") |
|
|
|
|
public ResponseData getRecordByCouponAgentId(@RequestParam(name = "couponAgentId", required = true) Long couponAgentId, |
|
|
|
|
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
|
|
|
|
@RequestParam(name = "pageSize", required = true) Integer pageSize) { |
|
|
|
|
@RequestParam(name = "pageSize", required = true) Integer pageSize, |
|
|
|
|
HttpServletRequest request) { |
|
|
|
|
try { |
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
|
map.put("recordId", recordId); |
|
|
|
|
|
|
|
|
|
map.put("couponAgentId", couponAgentId); |
|
|
|
|
PageHelper.startPage(pageNum,pageSize); |
|
|
|
|
return ResponseMsgUtil.success(new PageInfo<>(highCouponAgentService.getCouponAgentCodeList(map))); |
|
|
|
|
return ResponseMsgUtil.success(new PageInfo<>(highCouponAgentService.getRecordList(map))); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("HighCouponAgentController --> getCouponByRecord() error!", e); |
|
|
|
|
log.error("HighCouponAgentController --> getRecordByCouponAgentId() error!", e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|