限制不能重复上架

master
e 2019-09-21 10:48:00 +08:00
parent 8f03e64f45
commit 36010a0981
1 changed files with 19 additions and 7 deletions

View File

@ -11,6 +11,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolation;
import javax.validation.Validator; import javax.validation.Validator;
import com.zzjee.wmutil.wmUtil;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.jeecgframework.core.beanvalidator.BeanValidators; import org.jeecgframework.core.beanvalidator.BeanValidators;
@ -99,8 +100,7 @@ public class WmToUpGoodsController extends BaseController {
* @param request * @param request
* @param response * @param response
* @param dataGrid * @param dataGrid
* @param user */
*/
@RequestMapping(params = "datagrid") @RequestMapping(params = "datagrid")
public void datagrid(WmToUpGoodsEntity wmToUpGoods,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) { public void datagrid(WmToUpGoodsEntity wmToUpGoods,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
@ -210,8 +210,7 @@ public class WmToUpGoodsController extends BaseController {
/** /**
* *
* *
* @param ids * @return
* @return
*/ */
@RequestMapping(params = "doAdd") @RequestMapping(params = "doAdd")
@ResponseBody @ResponseBody
@ -257,8 +256,7 @@ public class WmToUpGoodsController extends BaseController {
/** /**
* *
* *
* @param ids * @return
* @return
*/ */
@RequestMapping(params = "doUpdate") @RequestMapping(params = "doUpdate")
@ResponseBody @ResponseBody
@ -454,6 +452,18 @@ public class WmToUpGoodsController extends BaseController {
return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST); return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST);
} }
if(StringUtil.isEmpty(wmToUpGoods.getKuWeiBianMa())){
D0.setOK(false);
D0.setErrorMsg("储位不能为空");
return new ResponseEntity(D0, HttpStatus.OK);
}else{
if (!wmUtil.checkbin(wmToUpGoods.getKuWeiBianMa())) {
D0.setOK(false);
D0.setErrorMsg("储位不存在");
return new ResponseEntity(D0, HttpStatus.OK); }
}
//保存 //保存
try{ try{
D0.setOK(true); D0.setOK(true);
@ -466,7 +476,9 @@ public class WmToUpGoodsController extends BaseController {
List<WmToUpGoodsEntity> wmToUpGoodsEntity = systemService.findByProperty(WmToUpGoodsEntity.class,"wmToUpId",wmToUpGoods.getWmToUpId()); List<WmToUpGoodsEntity> wmToUpGoodsEntity = systemService.findByProperty(WmToUpGoodsEntity.class,"wmToUpId",wmToUpGoods.getWmToUpId());
if(wmToUpGoodsEntity!=null&&wmToUpGoodsEntity.size()>0){ if(wmToUpGoodsEntity!=null&&wmToUpGoodsEntity.size()>0){
D0.setOK(false); D0.setOK(false);
return new ResponseEntity(D0, HttpStatus.OK); D0.setErrorMsg("已经上架,不能重复上架");
return new ResponseEntity(D0, HttpStatus.OK);
} }
} }