修改判断
This commit is contained in:
@ -56,7 +56,17 @@ public class ReceiveServiceImpl implements ReceiveService {
|
|||||||
map.put("code","500");
|
map.put("code","500");
|
||||||
return map;
|
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()){
|
if (batteryRule.getTitle() == null || batteryRule.getTitle().isEmpty()){
|
||||||
map.put("msg","套餐名称不能为空");
|
map.put("msg","套餐名称不能为空");
|
||||||
map.put("code","500");
|
map.put("code","500");
|
||||||
@ -84,7 +94,7 @@ public class ReceiveServiceImpl implements ReceiveService {
|
|||||||
map.put("code","500");
|
map.put("code","500");
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
if (batteryRule.getCity() == null){
|
if (batteryRule.getCity() == null ){
|
||||||
map.put("msg","套餐城市不能为空");
|
map.put("msg","套餐城市不能为空");
|
||||||
map.put("code","500");
|
map.put("code","500");
|
||||||
return map;
|
return map;
|
||||||
@ -168,6 +178,13 @@ public class ReceiveServiceImpl implements ReceiveService {
|
|||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
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();
|
BaseUser baseUser = new BaseUser();
|
||||||
|
|
||||||
@ -194,6 +211,7 @@ public class ReceiveServiceImpl implements ReceiveService {
|
|||||||
|
|
||||||
UserStore userStore = new UserStore();
|
UserStore userStore = new UserStore();
|
||||||
String storeIds = user.getStoreId();
|
String storeIds = user.getStoreId();
|
||||||
|
|
||||||
String[] storeIdsArray = storeIds.split(",");
|
String[] storeIdsArray = storeIds.split(",");
|
||||||
for (String storeId : storeIdsArray) {
|
for (String storeId : storeIdsArray) {
|
||||||
userStore.setStoreId(Long.parseLong(storeId));
|
userStore.setStoreId(Long.parseLong(storeId));
|
||||||
|
|||||||
Reference in New Issue
Block a user