线边库存无需批次

main
FOAM 2024-11-29 09:55:36 +08:00
parent 0dfe22db6a
commit af45935bad
5 changed files with 61 additions and 47 deletions

View File

@ -1587,7 +1587,7 @@ public class DefaultInterfaceManager extends DefaultBaseManager implements Inter
int shsl=Integer.parseInt(sl.trim());
obj.put("qty",shsl);
obj.put("put_xs", getPutXs(tph,d.getId(),it.getCode()));
List<Pinfan> pfs=this.commonDao.findByQuery("from Pinfan pf where pf.item.id="+d.getItem().getId()+" and pf.bonded='"+tax+"'");
List<Pinfan> pfs=this.commonDao.findByQuery("from Pinfan pf where pf.item.id="+d.getItem().getId()+" and pf.bonded='"+tax+"' and pf.zone.code like '%CKD%'");
if(pfs.size()<=0){
throw new BusinessException("请维护品番关联");
}else{

View File

@ -2453,6 +2453,9 @@ public class DefaultASNManager extends DefaultBaseManager implements ASNManager
Long id=Long.parseLong(sheet.getCell(0,i).getContents().trim());
Inventory inv=this.commonDao.get(Inventory.class, id);
if(inv!=null){
//清0日志
InventoryLog log=pickKamsManager.addInventoryLog(InventoryLogType.COUNT_ADJUST, -1, inv.getZone(), inv.getLocation(), null, inv.getItemKey(),
inv.getQuantity(), null, UserHolder.getUser().getName(), inv.getId(), "调整数量"+inv.getQuantity()+"盘点归0", null, null, inv.getZzkw());
Double tzQty=Double.parseDouble(sheet.getCell(8,i).getContents().trim());
String tzbz=sheet.getCell(9,i).getContents().trim();
double srcQty=inv.getQtyOfMasterPack();
@ -2461,22 +2464,22 @@ public class DefaultASNManager extends DefaultBaseManager implements ASNManager
this.commonDao.store(inv);
String des=(int)srcQty+"变为"+tzQty;
int incOrDec=1;
double fasl=srcQty-tzQty;;
if(fasl==0){
System.out.println(i+1+"行没有调整");
continue;
}
if(fasl>0){
incOrDec=-1;
}
InventoryLog log=pickKamsManager.addInventoryLog(InventoryLogType.INVENTORY_ADJUST, incOrDec, inv.getZone(), inv.getLocation(), null, inv.getItemKey(),
Math.abs(fasl), null, UserHolder.getUser().getName(), inv.getId(), des, null, null, inv.getZzkw());
log.setOperDes(tzbz);
this.commonDao.store(log);
// double fasl=srcQty-tzQty;;
// if(fasl==0){
// System.out.println(i+1+"行没有调整");
// continue;
// }
// if(fasl>0){
// incOrDec=-1;
// }
InventoryLog log2=pickKamsManager.addInventoryLog(InventoryLogType.COUNT_ADJUST, 1, inv.getZone(), inv.getLocation(), null, inv.getItemKey(),
inv.getQuantity(), null, UserHolder.getUser().getName(), inv.getId(), "盘点初始值"+inv.getQuantity(), null, null, inv.getZzkw());
log2.setOperDes(tzbz);
this.commonDao.store(log2);
System.out.println(i+1+"行调整完成");
}else{
System.out.println(i+1+"行没找到");
}
}
} catch (BiffException e) {

View File

@ -1131,7 +1131,13 @@ public class DefaultPickKamsManager extends DefaultBaseManager implements PickKa
this.commonDao.store(r);
}
PickTicketDetail ptd=t.getPickTicketDetail();
Inventory inv=findInventory(t.getItemKey(), zone, xb_loc, pt.getCode(), SysCode.XB1, ptd.getZzkw());
ItemKey key =t.getItemKey();
//重新生成itemKey不带批次
if(t.getItemKey().getItem().isBeWeight()){//发动机重新获得批次
key = this.itemManager.getItemKey(new ItemKey("",
key.getItem(), key.getPinfan()), Boolean.TRUE,null);
}
Inventory inv=findInventory(key, zone, xb_loc, pt.getCode(), SysCode.XB1, ptd.getZzkw());
double xb_qty=l.getShipQuantity();
t_xb_qty+=xb_qty;
double srcQty1=0;
@ -1597,39 +1603,42 @@ public class DefaultPickKamsManager extends DefaultBaseManager implements PickKa
hql+=" and i.itemKey.pinfan.bonded='"+b.getBonded()+"' ";
hql+=" and i.itemKey.pinfan.zone.id!=77 ";
}
if(b.getItem().isBeWeight()){//发动机去除批次
hql+=" and i.itemKey.lotInfo.propC3 is null";
}
hql+=" and i.location.id="+xb_loc.getId()+" order by i.itemKey.lotInfo.propC3";
// hql+=" order by i.id ";
List<Inventory> invs=commonDao.findByQuery(hql);
double srcQty1=0;
if(invs.size()>0) {
double qty=Double.parseDouble(b.getSingle())*sp.getOrderQuantity();
//如果为发动机,则按照批次耗用
if(b.getItem().isBeWeight()){
int i=0;
for(Inventory inv:invs){
if(qty<=0){
break;
}
i++;
if(i<invs.size()&&inv.getQtyOfMasterPack()<=0){
continue;
}
srcQty1=inv.getQtyOfMasterPack();
double hyQty=0;
if(inv.getQtyOfMasterPack()>qty||i==invs.size()){
hyQty=qty;
qty-=hyQty;
}else{
hyQty=inv.getQtyOfMasterPack();
qty-=hyQty;
}
inv.setQtyOfMasterPack(inv.getQtyOfMasterPack()-hyQty);
inv.setQuantity(inv.getQtyOfMasterPack());
commonDao.store(inv);
this.addInventoryLog(InventoryLogType.PROCESS_DOWN, -1, b.getZone(), inv.getLocation(), sp.getBigItem().getCode(), inv.getItemKey(),
hyQty, null, UserHolder.getUser().getName(), null, (int)srcQty1+"变为"+(int)inv.getQtyOfMasterPack()+"hy"+sp.getId(), null, null, b.getZzkw());
}
}else{
// //如果为发动机,则按照批次耗用
// if(b.getItem().isBeWeight()){
// int i=0;
// for(Inventory inv:invs){
// if(qty<=0){
// break;
// }
// i++;
// if(i<invs.size()&&inv.getQtyOfMasterPack()<=0){
// continue;
// }
// srcQty1=inv.getQtyOfMasterPack();
// double hyQty=0;
// if(inv.getQtyOfMasterPack()>qty||i==invs.size()){
// hyQty=qty;
// qty-=hyQty;
// }else{
// hyQty=inv.getQtyOfMasterPack();
// qty-=hyQty;
// }
// inv.setQtyOfMasterPack(inv.getQtyOfMasterPack()-hyQty);
// inv.setQuantity(inv.getQtyOfMasterPack());
// commonDao.store(inv);
// this.addInventoryLog(InventoryLogType.PROCESS_DOWN, -1, b.getZone(), inv.getLocation(), sp.getBigItem().getCode(), inv.getItemKey(),
// hyQty, null, UserHolder.getUser().getName(), null, (int)srcQty1+"变为"+(int)inv.getQtyOfMasterPack()+"hy"+sp.getId(), null, null, b.getZzkw());
// }
// }else{
Inventory inv=invs.get(0);
srcQty1=inv.getQtyOfMasterPack();
@ -1638,7 +1647,7 @@ public class DefaultPickKamsManager extends DefaultBaseManager implements PickKa
commonDao.store(inv);
this.addInventoryLog(InventoryLogType.PROCESS_DOWN, -1, b.getZone(), inv.getLocation(), sp.getBigItem().getCode(), inv.getItemKey(),
qty, null, UserHolder.getUser().getName(), null, (int)srcQty1+"变为"+(int)inv.getQtyOfMasterPack()+"hy"+sp.getId(), null, null, b.getZzkw());
}
// }
}else {
//生成库存记录
Inventory inv=EntityFactory.getEntity(Inventory.class);

View File

@ -18,7 +18,9 @@
where 1=1 and commonCode.codeType='工位' order by commonCode.id]]></hql>
</list>
<text id="p.code" title="p.code" row="2" col="1" readOnly="false" required="false" reserve="false" forceOverride="false" inVisible="false" trimSpace="false" isPrecision="false"/>
<date id="pp.OfflineDate" title="操作日期" row="2" col="2" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" showTime="false" manualEditable="true" defaultCurrentDate="false"/>
<dateRanger id="pp.OfflineDate" title="操作日期" row="7" col="1" span="2" readOnly="false" required="false" reserve="false" forceOverride="false" inVisible="false" showTime="false" manualEditable="true" defaultCurrentDate="false" fromDate="pp.OfflineDate.begin" toDate="pp.OfflineDate.end"/>
<!-- <date id="pp.OfflineDate" title="操作日期" row="2" col="2" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" showTime="false" manualEditable="true" defaultCurrentDate="false"/> -->
<text id="pp.bigItem.code" title="机型" row="3" col="1" readOnly="false" required="false" reserve="false" forceOverride="false" inVisible="false" trimSpace="false" isPrecision="false"/>
<text id="pp.strExtend2" title="发货" row="3" col="2" readOnly="false" required="false" reserve="false" forceOverride="false" inVisible="false" trimSpace="false" isPrecision="false"/>
<text id="pp.modelNo" title="机号" row="5" col="1" readOnly="false" required="false" reserve="false" forceOverride="false" inVisible="false" trimSpace="false" isPrecision="false"/>
@ -65,8 +67,8 @@
/~procedure: and pp.procedure like {procedure} ~/
/~p.numberNo: and pp.numberNo like {p.numberNo} ~/
/~ p.bomList.id: and pp.bomList.id = {p.bomList.id} ~/
/~pickTicket.orderDate.begin: AND pp.OfflineDate >= {pickTicket.orderDate.begin} ~/
/~pickTicket.orderDate.end: AND pp.OfflineDate <= {pickTicket.orderDate.end} ~/
/~pp.OfflineDate.begin: AND DATE(pp.OfflineDate) >= {pp.OfflineDate.begin} ~/
/~pp.OfflineDate.end: AND DATE(pp.OfflineDate) <= {pp.OfflineDate.end} ~/
order by pp.strExtend4 desc,pp.longExtend1 desc,pp.id
]]></datasource>
<columns>

View File

@ -20,7 +20,7 @@
AND (location.outLock = '' or location.outLock is null)
AND location.warehouse = #{SESSION_WAREHOUSE}
AND location.code <> ${inventory.location.code}
AND location.type in ('STORAGE','TRANSIT','BAD','SHIP')]]></hql>
AND (location.type in ('STORAGE','TRANSIT','BAD','SHIP') OR location.code='JBTXB' )]]></hql>
</remote>
<text id="destLP" title="moveInventoryPage.destLP" row="11" col="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="true" trimSpace="true" isPrecision="true">
<!-- <visibleExpression><![CDATA[(${fullLPMove}=='false')]]></visibleExpression> -->