PDA 改为UNIAPP

master
cez 2022-06-25 09:03:50 +08:00
parent e3eb773c7a
commit 81f2ef63c3
2 changed files with 70 additions and 60 deletions

View File

@ -448,9 +448,21 @@ public class WmOmQmIController extends BaseController {
String message = null; String message = null;
AjaxJson j = new AjaxJson(); AjaxJson j = new AjaxJson();
message = "下架成功"; message = "下架成功";
String id = request.getParameter("id").toString();
boolean isok = todown(id);
if (!isok){
j.setSuccess(isok);
message = "下架失败";
}
j.setMsg(message);
return j;
}
public boolean todown(String id){
try { try {
WmOmQmIEntity wmOmQmI = systemService.getEntity( WmOmQmIEntity wmOmQmI = systemService.getEntity(
WmOmQmIEntity.class, request.getParameter("id").toString()); WmOmQmIEntity.class, id);
if (wmOmQmI != null&&wmOmQmI.getBinSta().equals("N")) { if (wmOmQmI != null&&wmOmQmI.getBinSta().equals("N")) {
WmToDownGoodsEntity wmToDownGoods = new WmToDownGoodsEntity(); WmToDownGoodsEntity wmToDownGoods = new WmToDownGoodsEntity();
wmToDownGoods.setBinIdFrom(wmOmQmI.getTinId());//下架托盘 wmToDownGoods.setBinIdFrom(wmOmQmI.getTinId());//下架托盘
@ -473,32 +485,22 @@ public class WmOmQmIController extends BaseController {
systemService.save(wmToDownGoods); systemService.save(wmToDownGoods);
wmOmQmI.setBinSta("Y"); wmOmQmI.setBinSta("Y");
systemService.saveOrUpdate(wmOmQmI); systemService.saveOrUpdate(wmOmQmI);
try{ try{
String orderId = wmOmQmI.getOmNoticeId(); String orderId = wmOmQmI.getOmNoticeId();
String type = "jh"; String type = "jh";
String username = ResourceUtil.getSessionUserName().getRealName(); String username = ResourceUtil.getSessionUserName().getRealName();
updateUser(orderId,type,username); updateUser(orderId,type,username);
}catch (Exception e){ }catch (Exception e){
} }
systemService.addLog(message, Globals.Log_Type_DEL, return true;
Globals.Log_Leavel_INFO);
} else { } else {
j.setSuccess(false); return false;
message = "下架任务找不到";
} }
} catch (Exception e) { } catch (Exception e) {
j.setSuccess(false); return false;
e.printStackTrace();
message = "下架失败";
throw new BusinessException(e.getMessage());
} }
j.setMsg(message);
return j;
} }
/** /**
* *
* *

View File

@ -17,6 +17,7 @@ import com.zzjee.wmapi.entity.WvGiNoticeEntity;
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.util.*; import org.jeecgframework.core.util.*;
import org.jeecgframework.web.system.pojo.base.TSBaseUser;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
@ -751,54 +752,15 @@ public class WmToDownGoodsController extends BaseController {
} }
try{
t = systemService.get(WvGiNoticeEntity.class,wmToDownGoods.getOrderIdI());
if(t!=null&&StringUtil.isEmpty(wmToDownGoods.getBinIdFrom())){
wmToDownGoods.setGoodsName(t.getShpMingCheng());
wmToDownGoods.setBinIdFrom(t.getTinId());
}
}catch (Exception e){
}
// 保存 // 保存
try { try {
wmToDownGoods.setCreateDate(DateUtils.getDate()); //查询create_name
if(wmUtil.checkstcokk(wmToDownGoods.getCusCode(),wmToDownGoods.getKuWeiBianMa(),wmToDownGoods.getBinIdFrom(),wmToDownGoods.getGoodsId(),wmToDownGoods.getGoodsProData(),wmToDownGoods.getBaseGoodscount())) TSBaseUser user = systemService.findUniqueByProperty(TSBaseUser.class, "userName", wmToDownGoods.getCreateBy());
{ if (user != null) {
WmOmQmIEntity wmOmQmIEntity = systemService.get(WmOmQmIEntity.class,t.getId()); wmToDownGoods.setCreateName(user.getRealName());
wmToDownGoods.setImCusCode(wmOmQmIEntity.getImCusCode()); }
wmToDownGoods.setOmBeizhu(wmOmQmIEntity.getOmBeizhu()); todown(wmToDownGoods.getOrderIdI(),wmToDownGoods.getCreateBy(),wmToDownGoods.getCreateName());
try{
List<WmToDownGoodsEntity> wmToDownGoodslist1 = systemService.findByProperty(WmToDownGoodsEntity.class,"orderIdI",wmToDownGoods.getOrderIdI());
if (wmToDownGoodslist1!=null&&wmToDownGoodslist1.size()>0){
D0.setOK(false);
D0.setErrorMsg("重复保存");
return new ResponseEntity(D0,HttpStatus.OK);
}
}catch (Exception e){
}
try{
String orderId = wmOmQmIEntity.getOmNoticeId();
String type = "jh";
String username = wmToDownGoods.getCreateBy();
updateUser(orderId,type,username);
}catch (Exception e){
}
wmToDownGoodsService.save(wmToDownGoods);
D0.setOK(true);
}else{
D0.setOK(false);
D0.setErrorMsg("库存不足");
};
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
D0.setOK(false); D0.setOK(false);
@ -809,6 +771,52 @@ public class WmToDownGoodsController extends BaseController {
// return new ResponseEntity(headers, HttpStatus.CREATED); // return new ResponseEntity(headers, HttpStatus.CREATED);
} }
public boolean todown(String id,String username,String realname){
try {
WmOmQmIEntity wmOmQmI = systemService.getEntity(
WmOmQmIEntity.class, id);
if (wmOmQmI != null&&wmOmQmI.getBinSta().equals("N")) {
WmToDownGoodsEntity wmToDownGoods = new WmToDownGoodsEntity();
wmToDownGoods.setCreateBy(username);
wmToDownGoods.setCreateName(realname);
wmToDownGoods.setCreateDate(now());
wmToDownGoods.setBinIdFrom(wmOmQmI.getTinId());//下架托盘
wmToDownGoods.setKuWeiBianMa(wmOmQmI.getBinId());//储位
wmToDownGoods.setBinIdTo(wmOmQmI.getOmNoticeId());//到托盘
wmToDownGoods.setCusCode(wmOmQmI.getCusCode());//货主
wmToDownGoods.setGoodsId(wmOmQmI.getGoodsId());//
wmToDownGoods.setGoodsProData(wmOmQmI.getProData());//生产日期
wmToDownGoods.setOrderId(wmOmQmI.getOmNoticeId());//出货通知单
wmToDownGoods.setOrderIdI(wmOmQmI.getId());//出货通知项目
wmToDownGoods.setBaseUnit(wmOmQmI.getBaseUnit());//基本单位
wmToDownGoods.setBaseGoodscount(wmOmQmI.getBaseGoodscount());//基本单位数量
wmToDownGoods.setGoodsUnit(wmOmQmI.getGoodsUnit());//出货单位
wmToDownGoods.setGoodsQua(wmOmQmI.getQmOkQuat());//出货数量
wmToDownGoods.setGoodsQuaok(wmOmQmI.getQmOkQuat());//出货数量
wmToDownGoods.setGoodsName(wmOmQmI.getGoodsName());//商品名称
wmToDownGoods.setOmBeizhu(wmOmQmI.getOmBeizhu());//备注
wmToDownGoods.setImCusCode(wmOmQmI.getImCusCode());//客户单号
wmToDownGoods.setOrderType("01");//默认为01
systemService.save(wmToDownGoods);
wmOmQmI.setBinSta("Y");
systemService.saveOrUpdate(wmOmQmI);
try{
String orderId = wmOmQmI.getOmNoticeId();
String type = "jh";
updateUser(orderId,type,username);
}catch (Exception e){
}
return true;
} else {
return false;
}
} catch (Exception e) {
return false;
}
}
//装车复核 //装车复核
@RequestMapping(value = "/change", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/change", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody @ResponseBody