dev-discount
袁野 4 years ago
parent 9118cff941
commit ed38148fe7
  1. 11
      hai-bweb/src/main/java/com/bweb/controller/BsCompanyController.java
  2. 2
      hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java
  3. 58
      hai-cweb/src/main/java/com/cweb/controller/HighUserController.java

@ -198,11 +198,7 @@ public class BsCompanyController {
} }
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
// 校验该区域是否存在公司
if (bsCompanyService.selectCompanyByRegion(secCompanyModel.getCompany().getRegionId()) != null) {
log.error("BsCompanyController --> addCompanyAndUser() error!", "该区域分公司已存在");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "");
}
// 校验公司名称 // 校验公司名称
BsCompany secCompany = bsCompanyService.selectCompanyByName(company.getName()); BsCompany secCompany = bsCompanyService.selectCompanyByName(company.getName());
@ -210,6 +206,11 @@ public class BsCompanyController {
log.error("BsCompanyController --> updateCompany() error!", "该单位已经存在"); log.error("BsCompanyController --> updateCompany() error!", "该单位已经存在");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPANY_NAME_IS_EXIST_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPANY_NAME_IS_EXIST_ERROR, "");
} }
// 校验该区域是否存在公司
if (bsCompanyService.selectCompanyByRegion(secCompanyModel.getCompany().getRegionId()) != null && !secCompany.getId().equals(company.getId())) {
log.error("BsCompanyController --> addCompanyAndUser() error!", "该区域分公司已存在");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "");
}
BsOrganization organization = bsOrganizationService.findTopByCompany(company.getId()); BsOrganization organization = bsOrganizationService.findTopByCompany(company.getId());
if (organization == null) { if (organization == null) {
log.error("BsCompanyController --> updateCompany() error!", "未找到该部门信息"); log.error("BsCompanyController --> updateCompany() error!", "未找到该部门信息");

@ -371,6 +371,8 @@ public class HighCouponController {
map.put("status", status); map.put("status", status);
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(highCouponService.getCouponList(map))); return ResponseMsgUtil.success(new PageInfo<>(highCouponService.getCouponList(map)));
} catch (Exception e) { } catch (Exception e) {
log.error("HighCouponController -> getCouponList() error!",e); log.error("HighCouponController -> getCouponList() error!",e);

@ -0,0 +1,58 @@
package com.cweb.controller;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.model.HighUserModel;
import com.hai.model.ResponseData;
import com.hai.service.HighUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
/**
* @Auther: 袁野
* @Description:
* @Date: 2021/3/30 22:50
*/
@Controller
@RequestMapping(value = "/highUser")
@Api(value = "用户接口")
public class HighUserController {
private static Logger log = LoggerFactory.getLogger(HighMerchantStoreController.class);
@Autowired
private UserCenter userCenter;
@Resource
private HighUserService highUserService;
@RequestMapping(value = "/findUser", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据id查询详情")
public ResponseData findById( HttpServletRequest request) {
try {
// 用户
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
return ResponseMsgUtil.success(highUserService.findByUserId(userInfoModel.getHighUser().getId()));
} catch (Exception e) {
log.error("HighUserController --> findByUserId() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}
Loading…
Cancel
Save