提交修改

dev-discount
yuanye 4 years ago
parent 33a03862df
commit 87276a1afc
  1. 8
      hai-bweb/src/main/java/com/bweb/controller/HighMerchantController.java
  2. 6
      hai-service/src/main/java/com/hai/service/impl/HighMerchantServiceImpl.java
  3. 2
      hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java

@ -62,7 +62,7 @@ public class HighMerchantController {
@ApiOperation(value = "增加商户")
public ResponseData insertMerchant(@RequestBody HighMerchantModel highMerchant, HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
SessionObject sessionObject = UserCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (userInfoModel.getBsCompany() == null) {
log.error("HighMerchantController -> updateMerchant() error!","该主角色没有权限");
@ -113,7 +113,7 @@ public class HighMerchantController {
@ApiOperation(value = "修改商户")
public ResponseData updateMerchant(@RequestBody HighMerchantModel highMerchant, HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
SessionObject sessionObject = UserCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (userInfoModel.getBsCompany() == null) {
log.error("HighMerchantController -> updateMerchant() error!","该主角色没有权限");
@ -144,7 +144,7 @@ public class HighMerchantController {
}
// 校验账户手机号
if (MemberValidateUtil.validatePhone(highMerchant.getSecUser().getTelephone())) {
if (!MemberValidateUtil.validatePhone(highMerchant.getSecUser().getTelephone())) {
log.error("BsStudentController --> updateMerchant() error!", "请输入正确的电话号码");
throw ErrorHelp.genException(SysCode.System, ErrorCode.PHONE_NUM_IS_ERROR, "");
}
@ -226,7 +226,7 @@ public class HighMerchantController {
@RequestParam(name = "pageSize", required = true) Integer pageSize,
HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
SessionObject sessionObject = UserCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (userInfoModel.getBsCompany() == null) {
log.error("HighMerchantController -> getMerchantList() error!","权限不足");

@ -41,7 +41,7 @@ public class HighMerchantServiceImpl implements HighMerchantService {
highMerchant.getSecUser().setPassword(MD5Util.encode(highMerchant.getSecUser().getPassword().getBytes()));
highMerchant.getSecUser().setAdminFlag(1);
highMerchant.getSecUser().setStatus(1);
highMerchant.getSecUser().setRoleId(2L);
highMerchant.getSecUser().setRoleId(3L);
highMerchant.getSecUser().setObjectType(2);
highMerchant.getSecUser().setObjectId(highMerchant.getId());
highMerchant.getSecUser().setCreateTime(new Date());
@ -70,7 +70,7 @@ public class HighMerchantServiceImpl implements HighMerchantService {
public void updateStatus(Long id, Integer status) {
// 查询商户
HighMerchantModel merchant = getMerchantById(id);
if(merchant != null) {
if(merchant == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOF_FOUND, "");
}
merchant.setStatus(status);
@ -103,7 +103,7 @@ public class HighMerchantServiceImpl implements HighMerchantService {
criteria.andCompanyIdEqualTo(MapUtils.getLongValue(map, "companyId"));
}
if (MapUtils.getLong(map, "merchantKey") != null) {
if (StringUtils.isNotBlank(MapUtils.getString(map, "merchantKey"))) {
criteria.andMerchantKeyEqualTo(MapUtils.getString(map, "merchantKey"));
}

@ -42,7 +42,7 @@ public class HighMerchantStoreServiceImpl implements HighMerchantStoreService {
highMerchantStore.getSecUser().setPassword(MD5Util.encode(highMerchantStore.getSecUser().getPassword().getBytes()));
highMerchantStore.getSecUser().setAdminFlag(1);
highMerchantStore.getSecUser().setStatus(1);
highMerchantStore.getSecUser().setRoleId(3L);
highMerchantStore.getSecUser().setRoleId(4L);
highMerchantStore.getSecUser().setObjectType(3);
highMerchantStore.getSecUser().setObjectId(highMerchantStore.getId());
highMerchantStore.getSecUser().setCreateTime(new Date());

Loading…
Cancel
Save