增加二次校验重复

master
erzhongxmu 2020-04-25 15:02:51 +08:00
parent 5b685f36fb
commit 7085938f28
2 changed files with 75 additions and 54 deletions

View File

@ -90,7 +90,7 @@ public class WmInQmIController extends BaseController {
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "list") @RequestMapping(params = "list")
@ -103,7 +103,7 @@ public class WmInQmIController extends BaseController {
} }
/** /**
* easyui AJAX * easyui AJAX
* *
* @param request * @param request
* @param response * @param response
* @param dataGrid * @param dataGrid
@ -121,9 +121,9 @@ public class WmInQmIController extends BaseController {
} catch (Exception e) { } catch (Exception e) {
throw new BusinessException(e.getMessage()); throw new BusinessException(e.getMessage());
} }
Map<String,Object> map1 = new HashMap<String,Object>(); Map<String,Object> map1 = new HashMap<String,Object>();
map1.put("imNoticeId", "desc"); map1.put("imNoticeId", "desc");
cq.setOrder(map1); cq.setOrder(map1);
if (wmInQmI.getBinSta() == null) { if (wmInQmI.getBinSta() == null) {
cq.eq("binSta", "N"); cq.eq("binSta", "N");
} }
@ -163,9 +163,9 @@ public class WmInQmIController extends BaseController {
} catch (Exception e) { } catch (Exception e) {
throw new BusinessException(e.getMessage()); throw new BusinessException(e.getMessage());
} }
Map<String,Object> map1 = new HashMap<String,Object>(); Map<String,Object> map1 = new HashMap<String,Object>();
map1.put("imNoticeId", "desc"); map1.put("imNoticeId", "desc");
cq.setOrder(map1); cq.setOrder(map1);
if (wmInQmI.getBinSta() == null) { if (wmInQmI.getBinSta() == null) {
cq.eq("binSta", "N"); cq.eq("binSta", "N");
} }
@ -194,7 +194,7 @@ public class WmInQmIController extends BaseController {
} }
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "doDel") @RequestMapping(params = "doDel")
@ -307,15 +307,22 @@ public class WmInQmIController extends BaseController {
wmInQmIEntity.setBinSta("Y"); wmInQmIEntity.setBinSta("Y");
systemService.save(wmToUpGoodsEntity);
systemService.saveOrUpdate(wmInQmIEntity); systemService.saveOrUpdate(wmInQmIEntity);
//重复增加二次判断
List<WmToUpGoodsEntity> listall = systemService.findByProperty(WmToUpGoodsEntity.class,"orderIdI",wmToUpGoodsEntity.getOrderIdI());
if(listall!=null&&listall.size()>0){
return true;
}
//重复增加二次判断
systemService.save(wmToUpGoodsEntity);
} }
return true; return true;
} }
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "doBatchDel") @RequestMapping(params = "doBatchDel")
@ -412,7 +419,7 @@ public class WmInQmIController extends BaseController {
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "doAdd") @RequestMapping(params = "doAdd")
@ -671,7 +678,7 @@ public class WmInQmIController extends BaseController {
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "doUpdate") @RequestMapping(params = "doUpdate")
@ -710,7 +717,7 @@ public class WmInQmIController extends BaseController {
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "goAdd") @RequestMapping(params = "goAdd")
@ -723,7 +730,7 @@ public class WmInQmIController extends BaseController {
return new ModelAndView("com/zzjee/wm/wmInQmI-add"); return new ModelAndView("com/zzjee/wm/wmInQmI-add");
} }
@RequestMapping(params = "goAddBatch") @RequestMapping(params = "goAddBatch")
public ModelAndView goAddBatch(WmInQmIEntity wmInQmI, HttpServletRequest req) { public ModelAndView goAddBatch(WmInQmIEntity wmInQmI, HttpServletRequest req) {
WmImNoticeIEntity WmImNoticeI = systemService.getEntity(WmImNoticeIEntity.class, WmImNoticeIEntity WmImNoticeI = systemService.getEntity(WmImNoticeIEntity.class,
@ -764,10 +771,10 @@ public class WmInQmIController extends BaseController {
return new ModelAndView("com/zzjee/wm/wmInQmI-add"); return new ModelAndView("com/zzjee/wm/wmInQmI-add");
} }
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "goUpdate") @RequestMapping(params = "goUpdate")
@ -782,7 +789,7 @@ public class WmInQmIController extends BaseController {
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "upload") @RequestMapping(params = "upload")
@ -793,7 +800,7 @@ public class WmInQmIController extends BaseController {
/** /**
* excel * excel
* *
* @param request * @param request
* @param response * @param response
*/ */
@ -834,7 +841,7 @@ for (WmInQmIEntity wmInQmIEntity : wmInQmIso) {
/** /**
* excel 使 * excel 使
* *
* @param request * @param request
* @param response * @param response
*/ */

View File

@ -59,12 +59,12 @@ import com.zzjee.wm.entity.WmToUpGoodsEntity;
import com.zzjee.wm.page.wmtoupgoodspage; import com.zzjee.wm.page.wmtoupgoodspage;
import com.zzjee.wm.service.WmToUpGoodsServiceI; import com.zzjee.wm.service.WmToUpGoodsServiceI;
/** /**
* @Title: Controller * @Title: Controller
* @Description: * @Description:
* @author erzhongxmu * @author erzhongxmu
* @date 2017-09-11 15:08:46 * @date 2017-09-11 15:08:46
* @version V1.0 * @version V1.0
* *
*/ */
@Controller @Controller
@ -81,12 +81,12 @@ public class WmToUpGoodsController extends BaseController {
private SystemService systemService; private SystemService systemService;
@Autowired @Autowired
private Validator validator; private Validator validator;
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "list") @RequestMapping(params = "list")
@ -96,7 +96,7 @@ public class WmToUpGoodsController extends BaseController {
/** /**
* easyui AJAX * easyui AJAX
* *
* @param request * @param request
* @param response * @param response
* @param dataGrid * @param dataGrid
@ -112,9 +112,9 @@ public class WmToUpGoodsController extends BaseController {
}catch (Exception e) { }catch (Exception e) {
throw new BusinessException(e.getMessage()); throw new BusinessException(e.getMessage());
} }
Map<String,Object> map1 = new HashMap<String,Object>(); Map<String,Object> map1 = new HashMap<String,Object>();
map1.put("createDate", "desc"); map1.put("createDate", "desc");
cq.setOrder(map1); cq.setOrder(map1);
cq.add(); cq.add();
this.wmToUpGoodsService.getDataGridReturn(cq, true); this.wmToUpGoodsService.getDataGridReturn(cq, true);
@ -139,10 +139,10 @@ public class WmToUpGoodsController extends BaseController {
TagUtil.datagrid(response, dataGrid); TagUtil.datagrid(response, dataGrid);
} }
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "doDel") @RequestMapping(params = "doDel")
@ -163,10 +163,10 @@ public class WmToUpGoodsController extends BaseController {
j.setMsg(message); j.setMsg(message);
return j; return j;
} }
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "doBatchDel") @RequestMapping(params = "doBatchDel")
@ -177,7 +177,7 @@ public class WmToUpGoodsController extends BaseController {
message = "上架列表删除成功"; message = "上架列表删除成功";
try{ try{
for(String id:ids.split(",")){ for(String id:ids.split(",")){
WmToUpGoodsEntity wmToUpGoods = systemService.getEntity(WmToUpGoodsEntity.class, WmToUpGoodsEntity wmToUpGoods = systemService.getEntity(WmToUpGoodsEntity.class,
id id
); );
wmToUpGoodsService.delete(wmToUpGoods); wmToUpGoodsService.delete(wmToUpGoods);
@ -192,7 +192,7 @@ public class WmToUpGoodsController extends BaseController {
return j; return j;
} }
@RequestMapping(params = "doGettextzy",method ={RequestMethod.GET, RequestMethod.POST}) @RequestMapping(params = "doGettextzy",method ={RequestMethod.GET, RequestMethod.POST})
@ResponseBody @ResponseBody
public AjaxJson doGettextzy(HttpServletRequest request) { public AjaxJson doGettextzy(HttpServletRequest request) {
@ -205,11 +205,11 @@ public class WmToUpGoodsController extends BaseController {
j.setObj(mvgoods); j.setObj(mvgoods);
return j; return j;
} }
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "doAdd") @RequestMapping(params = "doAdd")
@ -252,10 +252,10 @@ public class WmToUpGoodsController extends BaseController {
j.setMsg(message); j.setMsg(message);
return j; return j;
} }
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "doUpdate") @RequestMapping(params = "doUpdate")
@ -312,7 +312,7 @@ public class WmToUpGoodsController extends BaseController {
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "goAdd") @RequestMapping(params = "goAdd")
@ -325,7 +325,7 @@ public class WmToUpGoodsController extends BaseController {
} }
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "goUpdate") @RequestMapping(params = "goUpdate")
@ -336,10 +336,10 @@ public class WmToUpGoodsController extends BaseController {
} }
return new ModelAndView("com/zzjee/wm/wmToUpGoods-update"); return new ModelAndView("com/zzjee/wm/wmToUpGoods-update");
} }
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "upload") @RequestMapping(params = "upload")
@ -347,10 +347,10 @@ public class WmToUpGoodsController extends BaseController {
req.setAttribute("controller_name","wmToUpGoodsController"); req.setAttribute("controller_name","wmToUpGoodsController");
return new ModelAndView("common/upload/pub_excel_upload"); return new ModelAndView("common/upload/pub_excel_upload");
} }
/** /**
* excel * excel
* *
* @param request * @param request
* @param response * @param response
*/ */
@ -369,7 +369,7 @@ public class WmToUpGoodsController extends BaseController {
} }
/** /**
* excel 使 * excel 使
* *
* @param request * @param request
* @param response * @param response
*/ */
@ -383,13 +383,13 @@ public class WmToUpGoodsController extends BaseController {
modelMap.put(NormalExcelConstants.DATA_LIST,new ArrayList()); modelMap.put(NormalExcelConstants.DATA_LIST,new ArrayList());
return NormalExcelConstants.JEECG_EXCEL_VIEW; return NormalExcelConstants.JEECG_EXCEL_VIEW;
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@RequestMapping(params = "importExcel", method = RequestMethod.POST) @RequestMapping(params = "importExcel", method = RequestMethod.POST)
@ResponseBody @ResponseBody
public AjaxJson importExcel(HttpServletRequest request, HttpServletResponse response) { public AjaxJson importExcel(HttpServletRequest request, HttpServletResponse response) {
AjaxJson j = new AjaxJson(); AjaxJson j = new AjaxJson();
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
@ -417,7 +417,7 @@ public class WmToUpGoodsController extends BaseController {
} }
return j; return j;
} }
@RequestMapping(method = RequestMethod.GET) @RequestMapping(method = RequestMethod.GET)
@ResponseBody @ResponseBody
public ResponseEntity<?> list(@RequestParam String username, @RequestParam String searchstr) { public ResponseEntity<?> list(@RequestParam String username, @RequestParam String searchstr) {
@ -430,7 +430,7 @@ public class WmToUpGoodsController extends BaseController {
return new ResponseEntity(D0, HttpStatus.OK); return new ResponseEntity(D0, HttpStatus.OK);
} }
@RequestMapping(value = "/{id}", method = RequestMethod.GET) @RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public ResponseEntity<?> get(@PathVariable("id") String id) { public ResponseEntity<?> get(@PathVariable("id") String id) {
@ -467,19 +467,33 @@ public class WmToUpGoodsController extends BaseController {
//保存 //保存
try{ try{
D0.setOK(true); D0.setOK(true);
WmInQmIEntity wmInQmIEntity = systemService.get(WmInQmIEntity.class,wmToUpGoods.getWmToUpId()); WmInQmIEntity wmInQmIEntity = systemService.get(WmInQmIEntity.class,wmToUpGoods.getOrderIdI());
if(wmInQmIEntity!=null){ if(wmInQmIEntity!=null){
if("Y".equals(wmInQmIEntity.getBinSta())){
D0.setOK(false);
D0.setErrorMsg("已经上架,不能重复上架");
return new ResponseEntity(D0, HttpStatus.OK);
}
wmInQmIEntity.setBinSta("Y"); wmInQmIEntity.setBinSta("Y");
systemService.updateEntitie(wmInQmIEntity); systemService.updateEntitie(wmInQmIEntity);
}else{
D0.setOK(false);
D0.setErrorMsg("验收任务已经删除,不能上架");
return new ResponseEntity(D0, HttpStatus.OK);
} }
if(StringUtil.isNotEmpty(wmToUpGoods.getWmToUpId())){ if(StringUtil.isNotEmpty(wmToUpGoods.getOrderIdI())){
List<WmToUpGoodsEntity> wmToUpGoodsEntity = systemService.findByProperty(WmToUpGoodsEntity.class,"wmToUpId",wmToUpGoods.getWmToUpId()); List<WmToUpGoodsEntity> wmToUpGoodsEntity = systemService.findByProperty(WmToUpGoodsEntity.class,"orderIdI",wmToUpGoods.getOrderIdI());
if(wmToUpGoodsEntity!=null&&wmToUpGoodsEntity.size()>0){ if(wmToUpGoodsEntity!=null&&wmToUpGoodsEntity.size()>0){
D0.setOK(false); D0.setOK(false);
D0.setErrorMsg("已经上架,不能重复上架"); D0.setErrorMsg("已经上架,不能重复上架");
return new ResponseEntity(D0, HttpStatus.OK); return new ResponseEntity(D0, HttpStatus.OK);
} }
}else{
D0.setOK(false);
D0.setErrorMsg("验收记录为空,不能上架");
return new ResponseEntity(D0, HttpStatus.OK);
} }
wmToUpGoods.setGoodsName(wmInQmIEntity.getGoodsName()); wmToUpGoods.setGoodsName(wmInQmIEntity.getGoodsName());