增加二次校验重复

master
erzhongxmu 2020-04-25 15:07:15 +08:00
parent 7085938f28
commit 394e7ef1f6
1 changed files with 40 additions and 40 deletions

View File

@ -88,7 +88,7 @@ public class WmToDownGoodsController extends BaseController {
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "list") @RequestMapping(params = "list")
@ -98,7 +98,7 @@ public class WmToDownGoodsController extends BaseController {
/** /**
* easyui AJAX * easyui AJAX
* *
* @param request * @param request
* @param response * @param response
* @param dataGrid * @param dataGrid
@ -118,9 +118,9 @@ public class WmToDownGoodsController 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.wmToDownGoodsService.getDataGridReturn(cq, true); this.wmToDownGoodsService.getDataGridReturn(cq, true);
List<WmToDownGoodsEntity> resultold = dataGrid.getResults(); List<WmToDownGoodsEntity> resultold = dataGrid.getResults();
@ -145,7 +145,7 @@ public class WmToDownGoodsController extends BaseController {
TagUtil.datagrid(response, dataGrid); TagUtil.datagrid(response, dataGrid);
} }
@RequestMapping(params = "datagridwave") @RequestMapping(params = "datagridwave")
public void wavedatagridzzfh(WmToDownGoodsEntity wmToDownGoods, public void wavedatagridzzfh(WmToDownGoodsEntity wmToDownGoods,
HttpServletRequest request, HttpServletResponse response, HttpServletRequest request, HttpServletResponse response,
@ -160,9 +160,9 @@ public class WmToDownGoodsController 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.isNull("downSta"); cq.isNull("downSta");
cq.add(); cq.add();
this.wmToDownGoodsService.getDataGridReturn(cq, true); this.wmToDownGoodsService.getDataGridReturn(cq, true);
@ -172,12 +172,12 @@ public class WmToDownGoodsController extends BaseController {
wmToDownGoodsEntity.setGoodsQua(wmToDownGoodsEntity.getGoodsQuaok()); wmToDownGoodsEntity.setGoodsQua(wmToDownGoodsEntity.getGoodsQuaok());
wmToDownGoodsEntity.setGoodsQuaok(""); wmToDownGoodsEntity.setGoodsQuaok("");
resultnew.add(wmToDownGoodsEntity); resultnew.add(wmToDownGoodsEntity);
} }
dataGrid.setResults(resultnew); dataGrid.setResults(resultnew);
TagUtil.datagrid(response, dataGrid); TagUtil.datagrid(response, dataGrid);
} }
@RequestMapping(params = "datagridzzfh") @RequestMapping(params = "datagridzzfh")
public void datagridzzfh(WmToDownGoodsEntity wmToDownGoods, public void datagridzzfh(WmToDownGoodsEntity wmToDownGoods,
HttpServletRequest request, HttpServletResponse response, HttpServletRequest request, HttpServletResponse response,
@ -192,9 +192,9 @@ public class WmToDownGoodsController 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.isNull("downSta"); cq.isNull("downSta");
cq.add(); cq.add();
this.wmToDownGoodsService.getDataGridReturn(cq, true); this.wmToDownGoodsService.getDataGridReturn(cq, true);
@ -204,14 +204,14 @@ public class WmToDownGoodsController extends BaseController {
wmToDownGoodsEntity.setGoodsQua(wmToDownGoodsEntity.getGoodsQuaok()); wmToDownGoodsEntity.setGoodsQua(wmToDownGoodsEntity.getGoodsQuaok());
wmToDownGoodsEntity.setGoodsQuaok(""); wmToDownGoodsEntity.setGoodsQuaok("");
resultnew.add(wmToDownGoodsEntity); resultnew.add(wmToDownGoodsEntity);
} }
dataGrid.setResults(resultnew); dataGrid.setResults(resultnew);
TagUtil.datagrid(response, dataGrid); TagUtil.datagrid(response, dataGrid);
} }
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "doDel") @RequestMapping(params = "doDel")
@ -238,7 +238,7 @@ public class WmToDownGoodsController extends BaseController {
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "doBatchDel") @RequestMapping(params = "doBatchDel")
@ -363,8 +363,8 @@ public class WmToDownGoodsController extends BaseController {
} }
return j; return j;
} }
@RequestMapping(params = "doGetcusname",method ={RequestMethod.GET, RequestMethod.POST}) @RequestMapping(params = "doGetcusname",method ={RequestMethod.GET, RequestMethod.POST})
@ResponseBody @ResponseBody
public AjaxJson doGetcusname(HttpServletRequest request) { public AjaxJson doGetcusname(HttpServletRequest request) {
@ -377,8 +377,8 @@ public class WmToDownGoodsController extends BaseController {
j.setObj(mvcus); j.setObj(mvcus);
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) {
@ -395,9 +395,9 @@ public class WmToDownGoodsController extends BaseController {
+" group by ws.ku_wei_bian_ma,ws.bin_id,ws.shp_ming_cheng,mb.qu_huo_ci_xu, ws.goods_pro_data order by ws.goods_pro_data , ws.goods_qua, mb.qu_huo_ci_xu"; +" group by ws.ku_wei_bian_ma,ws.bin_id,ws.shp_ming_cheng,mb.qu_huo_ci_xu, ws.goods_pro_data order by ws.goods_pro_data , ws.goods_qua, mb.qu_huo_ci_xu";
Object objs = null; Object objs = null;
List<Map<String, Object>> result = systemService.findForJdbc(sql, request.getParameter("goodsid")); List<Map<String, Object>> result = systemService.findForJdbc(sql, request.getParameter("goodsid"));
if(result!=null){ if(result!=null){
}else{ }else{
j.setSuccess(false); j.setSuccess(false);
j.setMsg("商品没有库存"); j.setMsg("商品没有库存");
@ -406,8 +406,8 @@ public class WmToDownGoodsController extends BaseController {
j.setObj(mvgoods); j.setObj(mvgoods);
return j; return j;
} }
@RequestMapping(params = "doGettext",method ={RequestMethod.GET, RequestMethod.POST}) @RequestMapping(params = "doGettext",method ={RequestMethod.GET, RequestMethod.POST})
@ResponseBody @ResponseBody
public AjaxJson doGettext(HttpServletRequest request) { public AjaxJson doGettext(HttpServletRequest request) {
@ -424,7 +424,7 @@ public class WmToDownGoodsController extends BaseController {
.findHql(hql0, wmOmNoticeHEntity.getOmNoticeId(),oConvertUtils.getString(request.getParameter("goodsid")));//获取行项目 .findHql(hql0, wmOmNoticeHEntity.getOmNoticeId(),oConvertUtils.getString(request.getParameter("goodsid")));//获取行项目
for (WmOmNoticeIEntity wmOmNoticeIEntity : wmOmNoticeIEntityList) { for (WmOmNoticeIEntity wmOmNoticeIEntity : wmOmNoticeIEntityList) {
goodsno = (Double.valueOf(wmOmNoticeIEntity.getGoodsQua()) - Double.valueOf(wmOmNoticeIEntity.getGoodsQuaok())) * Double.valueOf(mvgoods.getChlShl()); goodsno = (Double.valueOf(wmOmNoticeIEntity.getGoodsQua()) - Double.valueOf(wmOmNoticeIEntity.getGoodsQuaok())) * Double.valueOf(mvgoods.getChlShl());
if(goodsno > 0 ){ if(goodsno > 0 ){
String sql = "select ws.ku_wei_bian_ma,ws.bin_id,ws.shp_ming_cheng,cast(sum(ws.base_goodscount) as signed) as goods_qua, mb.qu_huo_ci_xu, ws.goods_pro_data" String sql = "select ws.ku_wei_bian_ma,ws.bin_id,ws.shp_ming_cheng,cast(sum(ws.base_goodscount) as signed) as goods_qua, mb.qu_huo_ci_xu, ws.goods_pro_data"
+" from wv_stock ws, md_bin mb where " +" from wv_stock ws, md_bin mb where "
+" ws.ku_wei_bian_ma = mb.ku_wei_bian_ma and mb.ting_yong <> 'Y' and ws.kuctype = '库存'" +" ws.ku_wei_bian_ma = mb.ku_wei_bian_ma and mb.ting_yong <> 'Y' and ws.kuctype = '库存'"
@ -449,17 +449,17 @@ public class WmToDownGoodsController extends BaseController {
mvgoods.setGoodsName(result.get(i).get("shp_ming_cheng").toString());//名称 mvgoods.setGoodsName(result.get(i).get("shp_ming_cheng").toString());//名称
mvgoods.setBzhiQi(result.get(i).get("ku_wei_bian_ma").toString());//库位 mvgoods.setBzhiQi(result.get(i).get("ku_wei_bian_ma").toString());//库位
mvgoods.setCfWenCeng(result.get(i).get("bin_id").toString());//托盘 mvgoods.setCfWenCeng(result.get(i).get("bin_id").toString());//托盘
mvgoods.setChlShl(result.get(i).get("goods_pro_data").toString());//生成日期 setChDanPin mvgoods.setChlShl(result.get(i).get("goods_pro_data").toString());//生成日期 setChDanPin
break; break;
} }
} }
}else{ }else{
j.setSuccess(false); j.setSuccess(false);
j.setMsg("商品没有库存"); j.setMsg("商品没有库存");
} }
break; break;
} }
} }
@ -474,7 +474,7 @@ public class WmToDownGoodsController extends BaseController {
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "doAdd") @RequestMapping(params = "doAdd")
@ -510,12 +510,12 @@ public class WmToDownGoodsController extends BaseController {
wmToDownGoods.setBaseGoodscount(wmToDownGoods wmToDownGoods.setBaseGoodscount(wmToDownGoods
.getGoodsQua()); .getGoodsQua());
} }
if(!wmUtil.checkstcok(wmToDownGoods.getKuWeiBianMa(),wmToDownGoods.getBinIdFrom(),wmToDownGoods.getGoodsId(),wmToDownGoods.getGoodsProData(),wmToDownGoods.getGoodsQua())){ if(!wmUtil.checkstcok(wmToDownGoods.getKuWeiBianMa(),wmToDownGoods.getBinIdFrom(),wmToDownGoods.getGoodsId(),wmToDownGoods.getGoodsProData(),wmToDownGoods.getGoodsQua())){
message = "库存不足"; message = "库存不足";
j.setMsg(message); j.setMsg(message);
return j; return j;
}; };
wmToDownGoodsService.save(wmToDownGoods); wmToDownGoodsService.save(wmToDownGoods);
systemService.addLog(message, Globals.Log_Type_INSERT, systemService.addLog(message, Globals.Log_Type_INSERT,
@ -532,7 +532,7 @@ public class WmToDownGoodsController extends BaseController {
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "doUpdate") @RequestMapping(params = "doUpdate")
@ -560,7 +560,7 @@ public class WmToDownGoodsController extends BaseController {
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "goAdd") @RequestMapping(params = "goAdd")
@ -576,7 +576,7 @@ public class WmToDownGoodsController extends BaseController {
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "goUpdate") @RequestMapping(params = "goUpdate")
@ -592,7 +592,7 @@ public class WmToDownGoodsController extends BaseController {
/** /**
* *
* *
* @return * @return
*/ */
@RequestMapping(params = "upload") @RequestMapping(params = "upload")
@ -603,7 +603,7 @@ public class WmToDownGoodsController extends BaseController {
/** /**
* excel * excel
* *
* @param request * @param request
* @param response * @param response
*/ */
@ -628,7 +628,7 @@ public class WmToDownGoodsController extends BaseController {
/** /**
* excel 使 * excel 使
* *
* @param request * @param request
* @param response * @param response
*/ */
@ -747,8 +747,8 @@ public class WmToDownGoodsController extends BaseController {
wmToDownGoods.setOmBeizhu(wmOmQmIEntity.getOmBeizhu()); wmToDownGoods.setOmBeizhu(wmOmQmIEntity.getOmBeizhu());
try{ try{
WmToDownGoodsEntity wmToDownGoods1 = systemService.findUniqueByProperty(WmToDownGoodsEntity.class,"orderIdI",wmToDownGoods.getOrderIdI()); List<WmToDownGoodsEntity> wmToDownGoods1 = systemService.findByProperty(WmToDownGoodsEntity.class,"orderIdI",wmToDownGoods.getOrderIdI());
if (wmToDownGoods1!=null){ if (wmToDownGoods1!=null&&wmToDownGoods1.size()>0){
D0.setOK(false); D0.setOK(false);
D0.setErrorMsg("重复保存"); D0.setErrorMsg("重复保存");