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