Browse Source

修改盘库,巡检 生成记录报错

master
hp 3 years ago
parent
commit
102934f815
  1. 25
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclestayinventory/ScmVehicleStayInventoryService.java

25
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclestayinventory/ScmVehicleStayInventoryService.java

@ -51,6 +51,8 @@ import org.springframework.transaction.annotation.Transactional;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
@ -92,7 +94,7 @@ public class ScmVehicleStayInventoryService extends MybatisBaseService<ScmVehicl
if (StringUtils.isNotBlank(query.getLocationSid())) {
qw.eq("svsi.locationSid", query.getLocationSid());
}
qw.eq("bv.vehicleState","0001").or().eq("bv.vehicleState","0003");
qw.eq("bv.vehicleState", "0001").or().eq("bv.vehicleState", "0003");
IPage<ScmVehicleStayInventory> page = PagerUtil.queryToPage(pq);
IPage<ScmVehicleStayInventoryVo> pagging = baseMapper.selectPageVo(page, qw);
PagerVo<ScmVehicleStayInventoryVo> p = PagerUtil.pageToVo(pagging, null);
@ -146,15 +148,18 @@ public class ScmVehicleStayInventoryService extends MybatisBaseService<ScmVehicl
if (scmVehicleStayInventoryVos.size() > 0) {
return rb.setMsg("生成盘库记录失败,请查看是否有未盘库的记录");
}
for (AppScmInventoryRecordsVo appScmInventoryRecordsVo : list) {
ScmVehicleStayInventory scmVehicleStayInventory = new ScmVehicleStayInventory();
scmVehicleStayInventory.setMainSid(appScmInventoryRecordsVo.getVin());
scmVehicleStayInventory.setLocationSid(appScmInventoryRecordsVo.getWarehouseSid());
scmVehicleStayInventory.setLocation(appScmInventoryRecordsVo.getWarehouse());
scmVehicleStayInventory.setInventoryName("");
scmVehicleStayInventory.setInventoryDate("");
scmVehicleStayInventory.setCreateOrgSid(orgSid);
save(scmVehicleStayInventory);
list.removeAll(Collections.singleton(null));
if (!list.isEmpty()) {
for (AppScmInventoryRecordsVo appScmInventoryRecordsVo : list) {
ScmVehicleStayInventory scmVehicleStayInventory = new ScmVehicleStayInventory();
scmVehicleStayInventory.setMainSid(appScmInventoryRecordsVo.getVin());
scmVehicleStayInventory.setLocationSid(appScmInventoryRecordsVo.getWarehouseSid());
scmVehicleStayInventory.setLocation(appScmInventoryRecordsVo.getWarehouse());
scmVehicleStayInventory.setInventoryName("");
scmVehicleStayInventory.setInventoryDate("");
scmVehicleStayInventory.setCreateOrgSid(orgSid);
save(scmVehicleStayInventory);
}
}
return rb.success();
}

Loading…
Cancel
Save