储位信息可删除

master
erzhongxmu 2022-03-18 15:27:08 +08:00
parent 2d6441b534
commit 0eb985522f
1 changed files with 9 additions and 6 deletions

View File

@ -131,16 +131,17 @@ public class MdBinController extends BaseController {
mdBin = systemService.getEntity(MdBinEntity.class, mdBin.getId()); mdBin = systemService.getEntity(MdBinEntity.class, mdBin.getId());
message = "仓位停用成功"; message = "仓位停用成功";
try{ try{
mdBin.setTingYong("Y");
mdBinService.saveOrUpdate(mdBin);
if(wmUtil.checkishavestock("bin",mdBin.getKuWeiBianMa())){ if(wmUtil.checkishavestock("bin",mdBin.getKuWeiBianMa())){
message = "仓位停用成功,但是存在库存"; message = "仓位停用成功,但是存在库存";
j.setSuccess(false); j.setSuccess(false);
j.setMsg(message); j.setMsg(message);
mdBin.setTingYong("Y");
mdBinService.saveOrUpdate(mdBin);
return j; return j;
}else{
mdBinService.delete(mdBin);
} }
// mdBinService.delete(mdBin);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO); systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}catch(Exception e){ }catch(Exception e){
e.printStackTrace(); e.printStackTrace();
@ -303,11 +304,13 @@ public class MdBinController extends BaseController {
mdBin.setTingYong("Y"); mdBin.setTingYong("Y");
if(wmUtil.checkishavestock("bin",mdBin.getKuWeiBianMa())){ if(wmUtil.checkishavestock("bin",mdBin.getKuWeiBianMa())){
message = "仓位停用成功,但是存在库存"; message = "仓位停用成功,但是存在库存";
mdBinService.updateEntitie(mdBin);
// j.setSuccess(false); // j.setSuccess(false);
// j.setMsg(message); // j.setMsg(message);
// return j; // return j;
}else{
mdBinService.delete(mdBin);
} }
mdBinService.updateEntitie(mdBin);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO); systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
} }
}catch(Exception e){ }catch(Exception e){
@ -479,7 +482,7 @@ public class MdBinController extends BaseController {
MdBinEntity mdb = null; MdBinEntity mdb = null;
List<MdBinEntity> mdblist = systemService.findByProperty(MdBinEntity.class, "kuWeiBianMa", mdBin.getKuWeiBianMa()); List<MdBinEntity> mdblist = systemService.findByProperty(MdBinEntity.class, "kuWeiBianMa", mdBin.getKuWeiBianMa());
for (MdBinEntity t:mdblist){ for (MdBinEntity t:mdblist){
if(t.getBinStore().equals(mdBin.getBinStore())){ if(t.getKuWeiBianMa().equals(mdBin.getKuWeiBianMa())){
mdb = t; mdb = t;
} }
} }