修改判断
This commit is contained in:
@ -56,7 +56,17 @@ public class ReceiveServiceImpl implements ReceiveService {
|
||||
map.put("code","500");
|
||||
return map;
|
||||
}
|
||||
BatteryRule batteryRule = JSON.parseObject(String.valueOf(syncRequest.getData()), BatteryRule.class);
|
||||
BatteryRule batteryRule = new BatteryRule();
|
||||
try {
|
||||
batteryRule = JSON.parseObject(String.valueOf(syncRequest.getData()), BatteryRule.class);
|
||||
}catch (Exception e)
|
||||
{
|
||||
map.put("msg","数据格式错误");
|
||||
map.put("exception",e.getMessage());
|
||||
map.put("code","500");
|
||||
return map;
|
||||
}
|
||||
|
||||
if (batteryRule.getTitle() == null || batteryRule.getTitle().isEmpty()){
|
||||
map.put("msg","套餐名称不能为空");
|
||||
map.put("code","500");
|
||||
@ -168,6 +178,13 @@ public class ReceiveServiceImpl implements ReceiveService {
|
||||
map.put("code", "500");
|
||||
return map;
|
||||
}
|
||||
if(user.getIsmerchant() == 1){
|
||||
if (user.getStoreId() == null || user.getStoreId().isEmpty()) {
|
||||
map.put("msg", "用户为商户时门店不能为空");
|
||||
map.put("code", "500");
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
BaseUser baseUser = new BaseUser();
|
||||
|
||||
@ -194,6 +211,7 @@ public class ReceiveServiceImpl implements ReceiveService {
|
||||
|
||||
UserStore userStore = new UserStore();
|
||||
String storeIds = user.getStoreId();
|
||||
|
||||
String[] storeIdsArray = storeIds.split(",");
|
||||
for (String storeId : storeIdsArray) {
|
||||
userStore.setStoreId(Long.parseLong(storeId));
|
||||
|
||||
Reference in New Issue
Block a user