Commit 703cadd3 authored by yff's avatar yff

增加jgfk

parent 3e6c80e9
...@@ -285,7 +285,7 @@ public class GpfkController extends BaseController { ...@@ -285,7 +285,7 @@ public class GpfkController extends BaseController {
@ResponseBody @ResponseBody
public Object jgfk(@RequestBody JSONObject param) { public Object jgfk(@RequestBody JSONObject param) {
FkCondition condition = JSONObject.toJavaObject(param, FkCondition.class); FkCondition condition = JSONObject.toJavaObject(param, FkCondition.class);
FkVO gpfk = gpfkService.zpfkUpgrade(condition); FkVO gpfk = gpfkService.jgfk(condition);
if(gpfk!=null) { if(gpfk!=null) {
return buildReturnData(gpfk); return buildReturnData(gpfk);
} }
......
...@@ -1586,7 +1586,91 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -1586,7 +1586,91 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
*/ */
@Override @Override
public FkVO jgfk(FkCondition fkCondition) { public FkVO jgfk(FkCondition fkCondition) {
// TODO Auto-generated method stub /*
* 基础判断 1.条码是否为空 2.前端是否传入标准工序 3.条码是否为已知类型条码
*/
if(StringUtils.isEmpty(fkCondition.getSncode())) {
throwReturnMessage("未扫描到条码,请重新确认!");
}
if(StringUtils.isEmpty(fkCondition.getBzgxid())) {
throwReturnMessage("扫描工序出错,请重新确认!");
}
String snType = checkSnType(fkCondition.getSncode());
if(StringUtils.isEmpty(snType)) {
throwReturnMessage("该条码为未知条码,请重新确认!");
}
FkVO fkVO = null;
if(snType.equals(SmCodeEnum.LOGOUT.getId())) {
fkVO = new FkVO();
fkVO.setSntype(snType);
}
else if(snType.equals(SmCodeEnum.WOSNID.getId())) {
GpfkCondition gpfkCondition = new GpfkCondition();
gpfkCondition.setWosnid(fkCondition.getSncode());
gpfkCondition.setBzgxid(fkCondition.getBzgxid());
FkVO curFkVo = gpfkDao.queryKwellWoBySnidUptoDate(fkCondition.getSncode(), fkCondition.getBzgxid());
checkLastBzgxIfComplete(curFkVo);
checkNextBzgxIfExistFk(curFkVo);
if(StringUtils.isNotEmpty(curFkVo.getId())) {
curFkVo = gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getSncode(), fkCondition.getBzgxid());
}
curFkVo.setSntype(snType);
return curFkVo;
}
else if(snType.equals(SmCodeEnum.OKBZ.getId())) {
if(StringUtils.isEmpty(fkCondition.getWosncode())) {
throwReturnMessage("该订单序列号未输入,请重新确认!");
}
Gpfk gpfk = new Gpfk();
FkVO curFkVo =gpfkDao.queryKwellWoBySnidUptoDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
gpfk.setWosnid(curFkVo.getWosnCode());
gpfk.setWogylx(curFkVo.getWogylxid());
gpfk.setFkgx(curFkVo.getWogylxid());
gpfk.setFkrid(UserInfoUtil.getId());
gpfk.setFkr(UserInfoUtil.getUserName());
gpfk.setFksj(DateUtils.getDateTime());
gpfk.setWlid(curFkVo.getWlid());
gpfk.setYwrq(DateUtils.getDate());
gpfk.setHgbz(HGBZ);
gpfk.setFklx(GpfkFklxEnum.WO.getId());
gpfk.setHgsl(1.0d);
gpfk.setFksl(1.0d);
gpfk.setBhgsl(0.0d);
gpfk.setBzgxid(fkCondition.getBzgxid());
insert(gpfk);
FkVO newFkVo =gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
newFkVo.setSntype(snType);
addOrUpdateGpfkjg(newFkVo.getWlid(), fkCondition.getBzgxid(), newFkVo.getFkgx(), fkCondition.getWosncode(), HGBZ);
return newFkVo;
}
else if(snType.equals(SmCodeEnum.NGBZ.getId())) {
if(StringUtils.isEmpty(fkCondition.getWosncode())) {
throwReturnMessage("该订单序列号未输入,请重新确认!");
}
Gpfk gpfk = new Gpfk();
FkVO curFkVo =gpfkDao.queryKwellWoBySnidUptoDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
gpfk.setWosnid(curFkVo.getWosnCode());
gpfk.setWogylx(curFkVo.getWogylxid());
gpfk.setFkgx(curFkVo.getWogylxid());
gpfk.setFkrid(UserInfoUtil.getId());
gpfk.setFkr(UserInfoUtil.getUserName());
gpfk.setFksj(DateUtils.getDateTime());
gpfk.setWlid(curFkVo.getWlid());
gpfk.setHgbz(BHGBZ);
gpfk.setFklx(GpfkFklxEnum.WO.getId());
gpfk.setYwrq(DateUtils.getDate());
gpfk.setHgsl(0.0);
gpfk.setBhgsl(1.0);
gpfk.setBzgxid(fkCondition.getBzgxid());
insert(gpfk);
FkVO newFkVo =gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
newFkVo.setSntype(snType);
addOrUpdateGpfkjg(newFkVo.getWlid(), fkCondition.getBzgxid(), newFkVo.getFkgx(), fkCondition.getWosncode(), BHGBZ);
return newFkVo;
}
else {
throwReturnMessage("序列号类型错误,请重新确认!");
}
return null; return null;
} }
...@@ -1807,12 +1891,6 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -1807,12 +1891,6 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
GpfkCondition gpfkCondition = new GpfkCondition(); GpfkCondition gpfkCondition = new GpfkCondition();
gpfkCondition.setWosnid(fkCondition.getSncode()); gpfkCondition.setWosnid(fkCondition.getSncode());
gpfkCondition.setBzgxid(fkCondition.getBzgxid()); gpfkCondition.setBzgxid(fkCondition.getBzgxid());
//FkVO curFkVo = gpfkDao.queryKwellWxWoBySnidUptoDate(fkCondition.getSncode());
//checkLastBzgxIfComplete(curFkVo);
//checkNextBzgxIfExistFk(curFkVo);
// if(StringUtils.isNotEmpty(curFkVo.getId())) {
// curFkVo = gpfkDao.queryWxWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getSncode(), fkCondition.getBzgxid());
// }
FkVO curFkVo = gpfkDao.queryWxWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getSncode(), fkCondition.getBzgxid()); FkVO curFkVo = gpfkDao.queryWxWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getSncode(), fkCondition.getBzgxid());
if (curFkVo == null) { if (curFkVo == null) {
curFkVo = gpfkDao.queryKwellWxWoBySnidUptoDate(fkCondition.getSncode()); curFkVo = gpfkDao.queryKwellWxWoBySnidUptoDate(fkCondition.getSncode());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment