dev-discount
袁野 4 years ago
parent d5e792a81a
commit 7c5b7ed744
  1. 4
      hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java
  2. 6
      hai-bweb/src/main/java/com/bweb/controller/HighDiscountCouponRelController.java
  3. 17
      hai-bweb/src/main/java/com/bweb/controller/LoginController.java

@ -112,7 +112,6 @@ public class HighDiscountController {
if (highDiscount.getId() == null
|| StringUtils.isBlank(highDiscount.getDiscountName())
|| StringUtils.isBlank(highDiscount.getDiscountImg())
|| StringUtils.isBlank(highDiscount.getDiscountCarouselImg())
|| highDiscount.getEffectiveDay() == null
|| highDiscount.getSalesEndTime() == null) {
log.error("HighDiscountController -> updateDiscount() error!","参数错误");
@ -148,7 +147,7 @@ public class HighDiscountController {
}
@RequestMapping(value="/updateDiscountStatus",method = RequestMethod.POST)
@RequestMapping(value="/updateDiscountStatus",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "修改优惠券状态")
public ResponseData updateDiscountStatus(@RequestParam(name = "discountId", required = true) Long discountId,
@ -187,6 +186,7 @@ public class HighDiscountController {
@RequestMapping(value="/getDiscountList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询优惠券列表")
public ResponseData getDiscountList(@RequestParam(name = "discountKey", required = false) String discountKey,
@RequestParam(name = "discountName", required = false) String discountName,

@ -49,7 +49,7 @@ public class HighDiscountCouponRelController {
try {
JSONObject jsonObject = JSONObject.parseObject(reqBody);
Long discountId = jsonObject.getLong("discountId");
String couponIdStr = jsonObject.getString("couponId");
String couponIdStr = jsonObject.getString("couponIdStr");
if (discountId == null || StringUtils.isBlank(couponIdStr)) {
log.error("HighDiscountCouponRelController -> insertDiscountCoupon() error!","参数错误");
@ -110,9 +110,9 @@ public class HighDiscountCouponRelController {
}
}
@RequestMapping(value="/insertDiscount",method = RequestMethod.GET)
@RequestMapping(value="/getRelByDiscount",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据卡卷 查询关联卡券")
@ApiOperation(value = "根据优惠券 查询关联卡券")
public ResponseData getRelByDiscount(@RequestParam(name = "discountId", required = true) Long discountId) {
try {

@ -60,6 +60,9 @@ public class LoginController {
@Resource
private SecPermissionService secPermissionService;
@Resource
private HighAgentService highAgentService;
@RequestMapping(value="/userLogin",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "机构用户登录({'loginName':'','password':''})")
@ -156,6 +159,20 @@ public class LoginController {
}
userInfoModel.setMerchantStore(merchantStore);
} else if (secUser.getObjectType() == 4) {
// 查询门店
HighAgent highAgent = highAgentService.findByAgentMsgId(secUser.getObjectId());
if(highAgent == null){
log.error("login error!","未找到代理商");
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_AGENT, "");
}
if(highAgent.getStatus() != 1) {
log.error("login error!","未找到代理商");
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_AGENT, "");
}
userInfoModel.setHighAgent(highAgent);
} else {
log.error("login error!","用户信息错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, "");

Loading…
Cancel
Save