|
|
|
@ -7,7 +7,9 @@ import com.hai.common.exception.ErrorCode; |
|
|
|
|
import com.hai.common.exception.ErrorHelp; |
|
|
|
|
import com.hai.common.exception.SysCode; |
|
|
|
|
import com.hai.common.security.UserCenter; |
|
|
|
|
import com.hai.common.utils.HttpsUtils; |
|
|
|
|
import com.hai.common.utils.ResponseMsgUtil; |
|
|
|
|
import com.hai.config.CommonSysConst; |
|
|
|
|
import com.hai.entity.HighDiscountUserRel; |
|
|
|
|
import com.hai.model.HighUserModel; |
|
|
|
|
import com.hai.model.ResponseData; |
|
|
|
@ -190,4 +192,57 @@ public class DiscountController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/queryHzfDiscountList",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "查询【惠支付】优惠列表") |
|
|
|
|
public ResponseData queryHzfDiscountList(@RequestParam(name = "status", required = false) Integer status, |
|
|
|
|
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
|
|
|
|
@RequestParam(name = "pageSize", required = true) Integer pageSize) { |
|
|
|
|
try { |
|
|
|
|
HighUserModel userInfoModel = userCenter.getSessionModel(HighUserModel.class); |
|
|
|
|
if (userInfoModel == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); |
|
|
|
|
} |
|
|
|
|
Map<String, Object> param = new HashMap<>(); |
|
|
|
|
param.put("phone", userInfoModel.getHighUser().getPhone()); |
|
|
|
|
param.put("status", status); |
|
|
|
|
param.put("pageNum", pageNum); |
|
|
|
|
param.put("pageSize", pageSize); |
|
|
|
|
|
|
|
|
|
JSONObject response = HttpsUtils.doGet(CommonSysConst.getSysConfig().getHzfDomainName()+"/crest/storeDiscountActivityPartakeUser/getDiscountListByPhone", param); |
|
|
|
|
if (!response.getString("return_code").equals("000000")) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getString("return_msg")); |
|
|
|
|
} |
|
|
|
|
return ResponseMsgUtil.success(response.getJSONObject("return_data")); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("HighDiscountController -> queryHzfDiscountList() error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/queryHzfDiscountTotalNum",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "查询【惠支付】优惠总次数") |
|
|
|
|
public ResponseData queryHzfDiscountTotalNum() { |
|
|
|
|
try { |
|
|
|
|
HighUserModel userInfoModel = userCenter.getSessionModel(HighUserModel.class); |
|
|
|
|
if (userInfoModel == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); |
|
|
|
|
} |
|
|
|
|
Map<String, Object> param = new HashMap<>(); |
|
|
|
|
param.put("phone", userInfoModel.getHighUser().getPhone()); |
|
|
|
|
|
|
|
|
|
JSONObject response = HttpsUtils.doGet(CommonSysConst.getSysConfig().getHzfDomainName() + "/crest/storeDiscountActivityPartakeUser/getDiscountSurplusTotalNum", param); |
|
|
|
|
if (!response.getString("return_code").equals("000000")) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getString("return_msg")); |
|
|
|
|
} |
|
|
|
|
return ResponseMsgUtil.success(response.getInteger("return_data")); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("HighDiscountController -> queryHzfDiscountList() error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|