Commit b359f2cf authored by wangyihao's avatar wangyihao

添加 图片 校验

parent 32b7ca01
......@@ -34,7 +34,7 @@ public class WebShopController {
@Resource
private StoreService storeService;
@Resource
WorkerService workerService;
private WorkerService workerService;
/**
* 根据条件查询商家列表
......
......@@ -61,6 +61,21 @@ public class StoreController extends BaseController {
if(store.getUserId() != null && !"".equals(store.getUserId())) {
store.setUserId(null);
}
if(store.getStoreHomePic()==null || "".equals(store.getStoreHomePic())) {
resultInfo.setCode("0");
resultInfo.setMsg("店铺主图为空");
return resultInfo;
}
if(store.getStorePic()==null || "".equals(store.getStorePic())) {
resultInfo.setCode("0");
resultInfo.setMsg("店铺详情图为空");
return resultInfo;
}
if(store.getQrCode()==null || "".equals(store.getQrCode())) {
resultInfo.setCode("0");
resultInfo.setMsg("店铺二维码为空");
return resultInfo;
}
resultInfo = storeService.updateStore(store, op);
}else {
if(store.getUserId() == null || "".equals(store.getUserId())) {
......@@ -68,6 +83,21 @@ public class StoreController extends BaseController {
resultInfo.setMsg("系统用户id为空");
return resultInfo;
}
if(store.getStoreHomePic()==null || "".equals(store.getStoreHomePic())) {
resultInfo.setCode("0");
resultInfo.setMsg("店铺主图为空");
return resultInfo;
}
if(store.getStorePic()==null || "".equals(store.getStorePic())) {
resultInfo.setCode("0");
resultInfo.setMsg("店铺详情图为空");
return resultInfo;
}
if(store.getQrCode()==null || "".equals(store.getQrCode())) {
resultInfo.setCode("0");
resultInfo.setMsg("店铺二维码为空");
return resultInfo;
}
resultInfo = storeService.addStore(store, op);
}
return resultInfo;
......
......@@ -66,6 +66,16 @@ public class WorkerController extends BaseController {
//操作人
Operator op = getOperator();
if (worker!=null&&worker.getWorkerId()!=null&&!"".equals(worker.getWorkerId())) {
if(worker.getWorkerPic() == null || "".equals(worker.getWorkerPic())) {
resultInfo.setCode("0");
resultInfo.setMsg("员工详情图片为空");
return resultInfo;
}
if(worker.getWorkerHomePic() == null || "".equals(worker.getWorkerHomePic())) {
resultInfo.setCode("0");
resultInfo.setMsg("员工主图为空");
return resultInfo;
}
if(worker.getUserId() != null && !"".equals(worker.getUserId())) {
worker.setUserId(null);
}
......@@ -76,6 +86,16 @@ public class WorkerController extends BaseController {
resultInfo.setMsg("系统用户id为空");
return resultInfo;
}
if(worker.getWorkerPic() == null || "".equals(worker.getWorkerPic())) {
resultInfo.setCode("0");
resultInfo.setMsg("员工详情图片为空");
return resultInfo;
}
if(worker.getWorkerHomePic() == null || "".equals(worker.getWorkerHomePic())) {
resultInfo.setCode("0");
resultInfo.setMsg("员工主图为空");
return resultInfo;
}
resultInfo = workerService.addWorker(worker, op);
}
return resultInfo;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment