转库导入、non-stock库存加上 用途 字段

main
userName 2025-04-07 15:30:59 +08:00
parent f88e0eed5c
commit 2c4cdf3563
31 changed files with 451 additions and 90 deletions

View File

@ -38,6 +38,7 @@ public class Location extends VersionalEntity {
private boolean mixItem = false;
/** 是否允许批次混放 */
private boolean mixLot = false;
/** 容器 */
private Container container;

View File

@ -49,10 +49,11 @@ public class LotInfo extends DomainModel implements ApplicationContextAware{
private Long propL2;//
private Long propL3;//
private String propLC1;//OA暂存库存标记
private String propLC2;//成品标记
private String propLC3;//元值
private String propLC2;//成品标记/扩展2
private String propLC3;//元值/扩展1
private String propLC4;//币种
private String propLC5;//用途
private String propLC6;//
private static ApplicationContext ac;
private CommonDao commonDao;
@ -86,6 +87,7 @@ public class LotInfo extends DomainModel implements ApplicationContextAware{
this.propL1 = propL1;
this.propL2 = propL2;
this.propL3 = propL3;
}
public LotInfo(){
@ -128,6 +130,23 @@ public class LotInfo extends DomainModel implements ApplicationContextAware{
}
}
public String getPropLC5() {
return propLC5;
}
public void setPropLC5(String propLC5) {
this.propLC5 = propLC5;
}
public String getPropLC6() {
return propLC6;
}
public void setPropLC6(String propLC6) {
this.propLC6 = propLC6;
}
public double getPropN4() {
return propN4;
}

View File

@ -81,6 +81,10 @@
length="250" />
<property name="propLC4" type="string" column="PROP_LC4"
length="250" />
<property name="propLC5" type="string" column="PROP_LC5"
length="100" />
<property name="propLC6" type="string" column="PROP_LC6"
length="100" />
</component>
</class>
<query name="getItemKeyByProperties">

View File

@ -62,8 +62,8 @@ public class InventoryLog extends Entity {
private String serial;//序列号
private String endRegion;//-工作站
private String strbill1;//移动类型
private String strbill2;//-
private String strbill3;//
private String strbill2;//-LOC
private String strbill3;//工厂
public String getStrbill1() {

View File

@ -29,6 +29,11 @@ public class InventoryView extends Entity{
private String propC7;//
private String propC8;//
private String propC9;//工厂
private String propLC1;//OA暂存库存标记
private String propLC2;//成品标记/扩展2
private String propLC3;//元值/扩展1
private String propLC4;//币种
private String propLC5;//用途
private String soi;//
private Date propD1;//生产日期
private Date propD2;//失效日期
@ -62,6 +67,36 @@ public class InventoryView extends Entity{
public String getPropLC1() {
return propLC1;
}
public void setPropLC1(String propLC1) {
this.propLC1 = propLC1;
}
public String getPropLC2() {
return propLC2;
}
public void setPropLC2(String propLC2) {
this.propLC2 = propLC2;
}
public String getPropLC3() {
return propLC3;
}
public void setPropLC3(String propLC3) {
this.propLC3 = propLC3;
}
public String getPropLC4() {
return propLC4;
}
public void setPropLC4(String propLC4) {
this.propLC4 = propLC4;
}
public String getPropLC5() {
return propLC5;
}
public void setPropLC5(String propLC5) {
this.propLC5 = propLC5;
}
public Date getPropD3() {
return propD3;
}

View File

@ -23,6 +23,11 @@
<property name="propC7" column="propC7" type="string" length="50" />
<property name="propC8" column="propC8" type="string" length="50" />
<property name="propC9" column="propC9" type="string" length="50" />
<property name="propLC1" type="string" column="PROP_LC1" length="250" />
<property name="propLC2" type="string" column="PROP_LC2" length="250" />
<property name="propLC3" type="string" column="PROP_LC3" length="250" />
<property name="propLC4" type="string" column="PROP_LC4" length="250" />
<property name="propLC5" type="string" column="PROP_LC5" length="100" />
<property name="weight" column="WEIGHT" type="double" />
<property name="soi" column="soi" type="string" length="50" />
<property name="lock" column="lock" type="boolean" />

View File

@ -62,6 +62,10 @@
length="250" />
<property name="propLC4" type="string" column="PROP_LC4"
length="250" />
<property name="propLC5" type="string" column="PROP_LC5"
length="100" />
<property name="propLC6" type="string" column="PROP_LC6"
length="100" />
</component>
<property name="relatedBill1" type="string" length="50"
column="RELATED_BILL1" />

View File

@ -63,4 +63,11 @@ public interface ImportFileManager extends BaseManager{
/**华工高理_客户导入*/
@Transactional
void importCustomer(File file);
/**
*
* @param file
*/
@Transactional
void importOutOrderDetail(File file);
}

View File

@ -2305,6 +2305,9 @@ public class DefaultAgvTaskManager extends DefaultBaseManager implements AgvTask
boolean flag=false;
AgvTask agv=commonDao.load(AgvTask.class, id);
if(agv.isBeIssue()&&agv.getStatus().equals(STATUS.ATCALL)) {
if(agv.getJobPriorityType()>0&&agv.getJobPriority()>200) {
break;
}
agv.setJobPriorityType(1L);
agv.setJobPriority(h);
String str = interfaceReqManager.doWmsReqAgv(ApiURL.eoutAGV,agv.yxjAGVJSON(agv),agv.getRobotJobId());

View File

@ -1742,4 +1742,120 @@ public class DefaultImportFileManager extends DefaultBaseManager implements Impo
}
}
@Override
public void importOutOrderDetail(File file) {
try {
Workbook workbook = Workbook.getWorkbook(file);
Sheet sheet = workbook.getSheet(0);// 得到excel第一页的内容
/* 查询单据类型*/
List<BillType> billTypes=commonDao.findByQuery(
"from BillType bt where code='YINVENTORY' ");
Warehouse warehouse=this.load(Warehouse.class, 1l);
for (int i = 1; i <sheet.getRows(); i++) {
int j=0;
String code=sheet.getCell(j++,i).getContents().trim();//工单号
if (code.length()<1) {
break;
}
String lineNumber=sheet.getCell(j++,i).getContents().trim();//项号
String sourceType=sheet.getCell(j++,i).getContents().trim();//出库类型
if (sourceType.length()<1) {
break;
}
String orderDate1=sheet.getCell(j++,i).getContents().trim();//需求日期
String status=PickTicketStatus.OPEN;//状态
String itemCode=sheet.getCell(j++,i).getContents().trim();//料号
String orderQuantity=sheet.getCell(j++,i).getContents().trim();//需求数量
String lotPropC9=sheet.getCell(j++,i).getContents().trim();//工厂
String lotPropC2=sheet.getCell(j++,i).getContents().trim();//LOC
String strBill9=sheet.getCell(j++,i).getContents().trim();//接收工厂
String locType=sheet.getCell(j++,i).getContents().trim();//接收LOC
String barCode=sheet.getCell(j++,i).getContents().trim();//序列号
String lotPropC3=sheet.getCell(j++,i).getContents().trim();//特殊标记
String lotPropC5=sheet.getCell(j++,i).getContents().trim();//供应商
PickTicket pickTicket=new PickTicket();
/*获取工单集合 工单*/
List<PickTicket> resultList = commonDao.findByQuery(" from PickTicket pt where pt.code=:RQORD and "
+ "pt.status='OPEN' ",new String[] { "RQORD"},new Object[] {code.trim()});
if (resultList.size()>0) {
pickTicket=resultList.get(0);
}else {
/* 新建工单*/
pickTicket.setSourceType(sourceType);
pickTicket.setCode(code);
pickTicket.setCollectNo(code);
pickTicket.setRelatedBill2(code);
try {
pickTicket.setOrderDate(sdf.parse(orderDate1));
} catch (Exception e) {
e.printStackTrace();
}
pickTicket.setStatus(status);
pickTicket.setPackageQuantity(0);
pickTicket.setBOLQuantity(0);
pickTicket.setOrderQuantity(0);
pickTicket.setAllocatedQuantity(0);
pickTicket.setPickedQuantity(0);
pickTicket.setShippedQuantity(0);
if(billTypes.size()>0) {
pickTicket.setBillType(billTypes.get(0));
}
pickTicket.setWorkerName1(lotPropC9);
pickTicket.setUpdateTime(new Date());
pickTicket.setWarehouse(warehouse);
commonDao.store(pickTicket);
/*写入工单集合*/
}
Item item=null;
List<Item> itemList=commonDao.findByQuery(
"from Item i where i.code=:code",
new String[] { "code" }, new Object[] { itemCode});
if (itemList.size()>0) {
item=itemList.get(0);
}else {
break;
}
PickTicketDetail pickTicketDetail=new PickTicketDetail();
List<PickTicketDetail> pickTicketDetailList=commonDao.findByQuery(
"from PickTicketDetail ptd where ptd.pickTicket.id=:ptId and ptd.lineNumber=:lineNumber and ptd.item.code=:itemCode",
new String[] { "ptId","lineNumber","itemCode" }, new Object[] { pickTicket.getId(),lineNumber,itemCode });
if (pickTicketDetailList.size()>0) {
/*重复明细*/
pickTicketDetail=pickTicketDetailList.get(0);
pickTicket.setOrderQuantity(pickTicket.getOrderQuantity()+Double.valueOf(orderQuantity)-pickTicketDetail.getOrderQuantity());
commonDao.store(pickTicket);
}else {
/* 新增明细*/
pickTicket.setOrderQuantity(pickTicket.getOrderQuantity()+Double.valueOf(orderQuantity));
pickTicket.setPackageQuantity(pickTicket.getPackageQuantity()+1);
commonDao.store(pickTicket);
}
pickTicketDetail.setItem(item);
pickTicketDetail.setLineNumber(lineNumber);
pickTicketDetail.setPickTicket(pickTicket);
pickTicketDetail.getLineNumber();
// pickTicketDetail.setSOI(SOI);
pickTicketDetail.setOrderQuantity(Double.valueOf(orderQuantity));
pickTicketDetail.setAllocatedQuantity(0);
pickTicketDetail.setPickedQuantity(0);
NewLotInfo newLotInfo=new NewLotInfo();
newLotInfo.setPropC2(lotPropC2);
newLotInfo.setPropC9(lotPropC9);
newLotInfo.setPropC3(lotPropC3);
newLotInfo.setPropC5(lotPropC5);
pickTicketDetail.setNewLotInfo(newLotInfo);
pickTicketDetail.setStrBill9(strBill9);
pickTicketDetail.setLocType(locType);
pickTicketDetail.setStrBill14(barCode);
commonDao.store(pickTicketDetail);
}
} catch (BiffException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

View File

@ -391,6 +391,9 @@ public class DefaultItemManager extends DefaultBaseManager implements
dbKey.getLotInfo().setPropLC1(itemKey.getLotInfo().getPropLC1());
dbKey.getLotInfo().setPropLC2(itemKey.getLotInfo().getPropLC2());
dbKey.getLotInfo().setPropLC3(itemKey.getLotInfo().getPropLC3());
dbKey.getLotInfo().setPropLC4(itemKey.getLotInfo().getPropLC4());
dbKey.getLotInfo().setPropLC5(itemKey.getLotInfo().getPropLC5());
dbKey.getLotInfo().setPropLC6(itemKey.getLotInfo().getPropLC6());
try {
dbKey.getLotInfo().setPropD1(itemKey.getLotInfo().getPropD1()==null ? null : sdf.parse(sdf.format(itemKey.getLotInfo().getPropD1())));
dbKey.getLotInfo().setPropD2(itemKey.getLotInfo().getPropD2()==null ? null : sdf.parse(sdf.format(itemKey.getLotInfo().getPropD2())));
@ -527,6 +530,24 @@ public class DefaultItemManager extends DefaultBaseManager implements
if ("".equals(lotInfo.getPropC9())) {
lotInfo.setPropC9(null);
}
if ("".equals(lotInfo.getPropLC1())) {
lotInfo.setPropLC1(null);
}
if ("".equals(lotInfo.getPropLC2())) {
lotInfo.setPropLC2(null);
}
if ("".equals(lotInfo.getPropLC3())) {
lotInfo.setPropLC3(null);
}
if ("".equals(lotInfo.getPropLC4())) {
lotInfo.setPropLC4(null);
}
if ("".equals(lotInfo.getPropLC5())) {
lotInfo.setPropLC5(null);
}
if ("".equals(lotInfo.getPropLC6())) {
lotInfo.setPropLC6(null);
}
//保质期处理
/* if (item.getDefaultLotRule() != null && item.getDefaultLotRule().getLotRuleComponent().getTrackPropD1()) {
if(lotInfo.getPropD1()==null){
@ -537,13 +558,13 @@ public class DefaultItemManager extends DefaultBaseManager implements
}
}*/
//写入供应商的名称到lotInfo
if (lotInfo.getPropL1() != null && lotInfo.getPropL1() != 0) {
Structure supplier = this.commonDao.load(Structure.class, lotInfo.getPropL1());
lotInfo.setPropLC1(supplier.getName());
} else {
lotInfo.setPropL1(null);
lotInfo.setPropLC1(null);
}
// if (lotInfo.getPropL1() != null && lotInfo.getPropL1() != 0) {
// Structure supplier = this.commonDao.load(Structure.class, lotInfo.getPropL1());
// lotInfo.setPropLC1(supplier.getName());
// } else {
// lotInfo.setPropL1(null);
// lotInfo.setPropLC1(null);
// }
//校验批次属性是否符合管理要求
/*if (verifyLot) {

View File

@ -1135,7 +1135,7 @@ public class DefaultCountPlanManager extends DefaultBaseManager implements
}else {
//料号库位盘点任务
String hql=" from Inventory inv where inv.queuedQuantity=0 and inv.quantity>0 "
+ "and inv.status='已入库' and i.itemKey.item.id<>2254883 ";
+ "and inv.status='已入库' and inv.itemKey.item.id<>2254883 ";
//盘点等级
if(countPlan.getCountCode()!=null&&!countPlan.getCountCode().equals("")) {
String code="";

View File

@ -1194,6 +1194,7 @@ public class DefaultInterfaceReqManager extends DefaultBaseManager implements In
if(pickTicket!=null&&pickTicket.getCode().indexOf("CP")==-1
&&((pickTicket.getSourceId()!=null&&pickTicket.getSourceId().indexOf("OT")== -1)
|| pickTicket.getSourceId()==null )) {
String bs=doWmsReqSap(getPropertiesParm("ldxt.SAP")+ApiURL.doWmsReqSap, jsonobj.toString(),"数据"+pickTicket.getCode());
if(bs!=null&&!bs.equals("")&&OUTPUT(bs)) {

View File

@ -1450,7 +1450,7 @@ public class DefaultInterfaceRespManager extends DefaultBaseManager implements I
lotInfo.setPropC9(company);
lotInfo.setPropLC3(metaValue);
lotInfo.setPropLC4(currencyType);
lotInfo.setPropLC5(USAGE);//用途
asnDetail.setExpectedQuantity(quantity);//订单数量
asnDetail.setItem(item);//物料描述(货品)(物料料号)
asnDetail.setLotInfo(lotInfo);
@ -1779,7 +1779,7 @@ public class DefaultInterfaceRespManager extends DefaultBaseManager implements I
String WAERS=asn.has("WAERS") ? asn.getString("WAERS") : "";//货币单位
String MENGE=asn.has("MENGE") ? asn.getString("MENGE") : "";//数量
String requisitioner=asn.has("requisitioner") ? asn.getString("requisitioner") : "";//工号
String USAGE=asn.has("USAGE")? asn.getString("USAGE"):"";//用途
List<ASN> asns = commonDao.findByQuery(" from ASN asn where asn.code=:code ",
new String[] { "code"},new Object[] {PO});
ASN asndb=EntityFactory.getEntity(ASN.class);
@ -2003,6 +2003,7 @@ public class DefaultInterfaceRespManager extends DefaultBaseManager implements I
lotInfo.setPropC5(propC5);
lotInfo.setPropC6(requisitioner);
lotInfo.setPropC7(requestor);
if(item.getFeeType()!=null&&item.getFeeType().equals("OA")&&
requisitioner!=null&&requisitioner.length()>0) {
List<Personnel> list= commonDao.findByQuery(" from Personnel p where p.number='"+requisitioner+"'");
@ -2012,10 +2013,9 @@ public class DefaultInterfaceRespManager extends DefaultBaseManager implements I
lotInfo.setPropC7(p.getCode());
lotInfo.setPropC4(p.getBumen());
}
}
lotInfo.setPropC9(WERKS);
lotInfo.setPropC9(WERKS);//工厂
lotInfo.setPropLC5(USAGE);//用途
lotInfo.setPropC1(pc1);
asnDetail.setLotInfo(lotInfo);
asnDetail.setAsn(asndb);
@ -3018,7 +3018,7 @@ public class DefaultInterfaceRespManager extends DefaultBaseManager implements I
sb.append( "select max(inv.id) id,max(ik.PROP_C6) as PROP_C6,max(ik.PROP_C4) as PROP_C4,(CONVERT(VARCHAR(10),min(inv.STORAGE_DATE),120)) TACDA,"
+ " max(ik.PROP_C8),(CONVERT(VARCHAR(10),max(ik.PROP_D3),120)) as PROP_D3,ik.PROP_C9,max(i.NAME) iname,i.code icode,"
+ "max(i.UNIT) unit,sum(inv.QUANTITY) sum ,inv.status , max(ik.PROP_C7),(CONVERT(VARCHAR(10),min(inv.STORAGE_DATE),120)) as STORAGE_DATE"
+ " ,max(i.STR_EXTEND3) STR_EXTEND3,max(i.STR_EXTEND2) STR_EXTEND2"
+ " ,max(i.STR_EXTEND3) STR_EXTEND3,max(i.STR_EXTEND2) STR_EXTEND2,max(ik.PROP_LC5) as PROP_LC5 "
+ " from INVENTORY inv "
+" left join ITEM_KEY ik on inv.ITEM_KEY_ID=ik.ID "
+" left join ITEM i on ik.ITEM_ID=i.ID "
@ -3091,6 +3091,7 @@ public class DefaultInterfaceRespManager extends DefaultBaseManager implements I
item.put("unitPrice", 0);//单价
}
item.put("currencyType", inventory[15]+"");//单价币种
item.put("USAGE", inventory[16]+"");//用途
jsonA.add(item);
}

View File

@ -3591,15 +3591,13 @@ public class DefaultQueryAppManager extends DefaultBaseManager implements QueryA
@Override
public JSONObject scanpickItemCode(String taskId,String jhItem,long userId,long warehouseId) {
public synchronized JSONObject scanpickItemCode(String taskId,String jhItem,long userId,long warehouseId) {
JSONObject resultJson = new JSONObject();
JSONObject obj = new JSONObject();
String status = "0";
String msg = "";
String data = "";
try {
if (userId > 0) {
if (warehouseId > 0) {
@ -5107,6 +5105,7 @@ public class DefaultQueryAppManager extends DefaultBaseManager implements QueryA
commonDao.store(newtask);
}else{
cancelAllcate(taskId, userId, warehouseId,false);
//取消分配
Task newtask=againAllcate(ptd, invId, quantity, endRegion,worker==null?"":worker.getName());
//发送AGV任务
if(wa.getId()==1766) {

View File

@ -2292,7 +2292,6 @@ public class DefaultAutoAllocator extends DefaultBaseManager implements AutoAllo
String hql1=" from Inventory i where i.itemKey.item.id=:id and i.location.type in('存货','不良品') "
+ "and i.status='已入库' and i.quantity-i.queuedQuantity>0 and i.counPlan is null "
+ " ";
//指定序列号
if(ptd.getStrBill14()!=null&&!ptd.getStrBill14().equals("")) {
hql1+=" and i.barCode='"+ptd.getStrBill14()+"'";

View File

@ -302,7 +302,8 @@ public interface MoveDocManager extends BaseManager {
/** 出空托*/
@Transactional
void stockCk(Inventory inventory,String gzz);
void stockCk(String gzz,List<Long> invlist);
@Transactional
LibraryTask stockCk(Stock st,String gzzCode,String libraryTaskType,String relatedBill1,String classification,String relatedBill4);

View File

@ -3779,12 +3779,17 @@ public class DefaultMoveDocManager extends DefaultBaseManager implements MoveDoc
return t2;
}
@Override
public void stockCk(Inventory inventory,String gzzCode) {
public void stockCk(String gzz,List<Long> invlist) {
int seq = 1;
int i = 1;
String endRegion=gzzCode;
for(Long id:invlist) {
Inventory inventory=commonDao.load(Inventory.class, id);
inventory.setQueuedQuantity(inventory.getQuantity());
Stock st = inventory.getLP();
stockCk(st, gzzCode,LibraryTaskType.ckt,null,"出空托","1");
commonDao.store(inventory);
stockCk(st, gzz,LibraryTaskType.ckt,null,"出空托","1");
}
}
/** 查询当前库位组对应的任务*/
private LibraryTask findLibraryTaskFor1(LocationStorage ls) {
@ -3808,21 +3813,8 @@ public class DefaultMoveDocManager extends DefaultBaseManager implements MoveDoc
public void stockCk(List<Long> ids) {
// int gzz=602;
// TODO 自动生成的方法存根
for (Long id : ids) {
Inventory inventory=this.load(Inventory.class, id);
/*if (inventory.getQueuedQuantity()>0) {
inventory.setQueuedQuantity(inventory.getQuantity());
commonDao.store(inventory);
stockCk(inventory);
}*/
inventory.setQueuedQuantity(inventory.getQuantity());
commonDao.store(inventory);
stockCk(inventory,603+"");
/*gzz++;
if (gzz==605) {
gzz=602;
}*/
}
stockCk(603+"",ids);
}
@Override

View File

@ -469,7 +469,7 @@ public interface PickTicketManager extends BaseManager {
@Transactional
List<Long> new411pickConfirmBar(Long pickTicketId, Long workerId,List<Long> ids);
/**311转库*/
/**000转库*/
@Transactional
void newdeposit(Long pickTicketId, Long workerId);

View File

@ -402,19 +402,19 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
commonDao.store(pt);
refreshOrderQuantity(pt);
} else {
PickTicketDetail newpickTicketDetail = this.load(PickTicketDetail.class, pickTicketDetail.getId());
newpickTicketDetail.setItem(item);
newpickTicketDetail.setOrderQuantity(pickTicketDetail.getOrderQuantity());
newpickTicketDetail.setOrderQtyOfMasterUnit(pickTicketDetail.getOrderQuantity());
newpickTicketDetail.getNewLotInfo().setPropC2(pickTicketDetail.getNewLotInfo().getPropC2());
newpickTicketDetail.getNewLotInfo().setPropC3(pickTicketDetail.getNewLotInfo().getPropC3());
newpickTicketDetail.getNewLotInfo().setPropC9(pickTicketDetail.getNewLotInfo().getPropC9());
newpickTicketDetail.setStrBill13(pt.getDescription());
newpickTicketDetail.setStrBill14(pickTicketDetail.getStrBill14());
newpickTicketDetail.setStrBill15(pickTicketDetail.getStrBill15());
newpickTicketDetail.setStrBill12(pickTicketDetail.getStrBill12());
commonDao.store(newpickTicketDetail);
pt.addPickTicketDetail(newpickTicketDetail);
// PickTicketDetail newpickTicketDetail = this.load(PickTicketDetail.class, pickTicketDetail.getId());
// newpickTicketDetail.setItem(item);
// newpickTicketDetail.setOrderQuantity(pickTicketDetail.getOrderQuantity());
// newpickTicketDetail.setOrderQtyOfMasterUnit(pickTicketDetail.getOrderQuantity());
// newpickTicketDetail.getNewLotInfo().setPropC2(pickTicketDetail.getNewLotInfo().getPropC2());
// newpickTicketDetail.getNewLotInfo().setPropC3(pickTicketDetail.getNewLotInfo().getPropC3());
// newpickTicketDetail.getNewLotInfo().setPropC9(pickTicketDetail.getNewLotInfo().getPropC9());
// newpickTicketDetail.setStrBill13(pt.getDescription());
// newpickTicketDetail.setStrBill14(pickTicketDetail.getStrBill14());
// newpickTicketDetail.setStrBill15(pickTicketDetail.getStrBill15());
// newpickTicketDetail.setStrBill12(pickTicketDetail.getStrBill12());
commonDao.store(pickTicketDetail);
// pt.addPickTicketDetail(newpickTicketDetail);
// pt.setOrderDate(new Date());
commonDao.store(pt);
refreshOrderQuantity(pt);
@ -4113,9 +4113,11 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
Location srcLoc = commonDao.load(Location.class, srcLocId);// 目标库位
Stock dstLP = commonDao.load(Stock.class, dstLPId);// 目标容器
if (pt.getSourceType() != null && !pt.getSourceType().equals("411")) {
if(dstLP==null) {
throw new BusinessException("无容器码,请绑定");
}
}
ItemKey itemKey =commonDao.load(ItemKey.class, task.getItemKey().getId());
Item item = this.load(Item.class, itemKey.getItem().getId());
Location loc = this.load(Location.class, task.getSrcLoc().getId());
@ -4270,6 +4272,7 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
task.getSrcLoc(),pt.getSourceType());
} else {
Inventory newInventory = EntityFactory.getEntity(Inventory.class);
newInventory.setLocation(dstLoc);
Warehouse warehouse = this.load(Warehouse.class, 1l);
@ -4298,6 +4301,7 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
ItemKey itemKey1 = itemManager.getItemKey(new ItemKey("", item, lot, null, ""),
Boolean.TRUE);
commonDao.store(itemKey1);
String sql = " from Inventory inv where inv.itemKey.id=" + itemKey1.getId()
+ " and inv.location.id=" + srcLoc.getId();
if (task.getBarCode() != null && task.getBarCode().length() > 0) {
@ -8393,7 +8397,7 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
public void newdeposit(Long pickTicketId, Long workerId) {
PickTicket pickTicket = this.load(PickTicket.class, pickTicketId);
if (pickTicket.getSourceType() != null && (pickTicket.getSourceType().equals("311")
if (pickTicket.getSourceType() != null && (pickTicket.getSourceType().equals("000")
||pickTicket.getSourceType().equals("313"))) {
List<Task> ts = this.commonDao.findByQuery("from Task t where t.pickTicketDetail.pickTicket.id="
+ pickTicket.getId() + " and t.movedQuantityMU<t.planQuantity");
@ -8401,8 +8405,11 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
for (Task t : ts) {
String sql=" from Inventory inv where inv.location.id="+t.getSrcLoc().getId()
+ " and inv.itemKey.id="+t.getItemKey().getId()+" and inv.queuedQuantity="+t.getPlanQuantity()
+" and inv.queuedQuantity=inv.quantity ";
+ " and inv.itemKey.id="+t.getItemKey().getId()+" and inv.queuedQuantity>0 "
+" and inv.quantity>0 ";
if(t.getBarCode()!=null&&t.getBarCode().length()>0) {
sql+=" and inv.barCode='"+t.getBarCode()+"' ";
}
List<Inventory> invs=commonDao.findByQuery(sql);
if(invs.size()>0) {
PickTicketDetail ptd=commonDao.load(PickTicketDetail.class, t.getPickTicketDetail().getId());
@ -8432,7 +8439,7 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
lot.setPropC8(t.getItemKey().getLotInfo().getPropC8());
}
if(t.getItemKey().getLotInfo().getPropC9()!=null) {
lot.setPropC9(t.getItemKey().getLotInfo().getPropC9());
lot.setPropC9(t.getPickTicketDetail().getStrBill9());
}
if(t.getItemKey().getLotInfo().getPropD1()!=null) {
lot.setPropD1(t.getItemKey().getLotInfo().getPropD1());
@ -8440,12 +8447,20 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
if(t.getItemKey().getLotInfo().getPropD2()!=null) {
lot.setPropD2(t.getItemKey().getLotInfo().getPropD2());
}
if(t.getItemKey().getLotInfo().getPropD3()!=null) {
lot.setPropD3(t.getItemKey().getLotInfo().getPropD3());
}
if(t.getItemKey().getLotInfo().getPropLC5()!=null) {
lot.setPropLC5(t.getItemKey().getLotInfo().getPropLC5());
}
double t_qty=t.getPlanQuantity()-t.getMovedQuantityMU();//拣货数
ItemKey itemkey=null;
itemkey=itemManager.getItemKey(new ItemKey(
"", t.getItemKey().getItem(), lot, new Date(), ""), Boolean.TRUE);
t.setAgvStatus(3);
t.setInventoryStatus("交单完成");
t.setDstLoc(commonDao.load(Location.class, 97845L));
t.setDstLoc(commonDao.load(Location.class, 88242L));
t.setMovedQuantityMU(t.getPlanQuantity());
// t.setOperateTime(new Date());
t.setOperator(UserHolder.getUser().getName());
@ -8457,14 +8472,79 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
commonDao.store(t);
commonDao.store(ptd);
commonDao.store(pickTicket);
Inventory inv =invs.get(0);
double invqty1=0;
double invqty2=0;
for(Inventory inv:invs) {
invqty1=inv.getQueuedQuantity();//占用数量
invqty2=inv.getQuantity();//库存数量
if(invqty2<=t_qty) {
inv.setQueuedQuantity(0);
inv.setItemKey(itemkey);
commonDao.store(inv);
t_qty=t_qty-t_qty;
inventoryManager.addInventoryLog(InventoryLogType.SHIPPING, -1, t.getBillCode(), t.getDstLoc(), null,
inv.getItemKey(), inv.getStorageDate(), inv.getSOI(), t.getPlanQuantity(), null,
inv.getStatus(), inv.getId(), "转库", t.getPickTicketDetail().getPickTicket().getBillType(),
0L, inv.getBarCode(),t.getSrcLoc(),t.getPickTicketDetail().getPickTicket().getSourceType());
}else {
if(invqty2>t_qty) {
Inventory newInventory = EntityFactory.getEntity(Inventory.class);
newInventory.setLocation(inv.getLocation());
Warehouse warehouse = this.load(Warehouse.class, 1l);
newInventory.setWarehouse(warehouse);
newInventory.setQuantity(t_qty);
newInventory.setQueuedQuantity(0);
newInventory.setQtyOfMasterPack(t_qty);
newInventory.setStatus(inv.getStatus());
newInventory.setSOI(t.getBillCode());
newInventory.setStorageDate(t.getStorageDate());
newInventory.setItemKey(itemkey);
// newInventory.setLP(dstLP);
newInventory.setWarehouseArea(inv.getWarehouseArea());
newInventory.setBarCode(t.getBarCode());
newInventory.setStatuss(inv.getStatuss());
String sql1 = " from Inventory inv where inv.itemKey.id=" + itemkey.getId()
+ " and inv.location.id=" + inv.getLocation().getId();
if (t.getBarCode() != null && t.getBarCode().length() > 0) {
sql += " and inv.barCode='" + t.getBarCode() + "'";
}
List<Inventory> listinvs = commonDao.findByQuery(sql1);
if (listinvs.size() > 0) {
newInventory = listinvs.get(0);
newInventory.setQuantity(newInventory.getQuantity() + t_qty);
newInventory.setQtyOfMasterPack(newInventory.getQuantity());
} else {
newInventory.setLocation(inv.getLocation());
newInventory.setItemKey(itemkey);
newInventory.setStatus("已入库");
newInventory.setTaskid(null);
}
commonDao.store(newInventory);
inv.setQuantity(inv.getQuantity() - t_qty);
if(inv.getQuantity()<0) {
throw new BusinessException(inv.getLocation().getCode()+"不能大于可用数量"+inv.getQuantity()+"");
}
inv.setQtyOfMasterPack(inv.getQuantity());
//输入拣货数量大于当前task未拣货数量库存占用只减去未拣货数量
inv.setQueuedQuantity(inv.getQueuedQuantity() - t_qty);
if(inv.getQueuedQuantity()<=0) {
inv.setQueuedQuantity(0);
}
commonDao.store(inv);
inventoryManager.addInventoryLog(InventoryLogType.SHIPPING, -1, t.getBillCode(), t.getDstLoc(), null,
inv.getItemKey(), inv.getStorageDate(), inv.getSOI(), t.getPlanQuantity(), null,
inv.getStatus(), inv.getId(), "转库", t.getPickTicketDetail().getPickTicket().getBillType(),
0L, inv.getBarCode(),t.getSrcLoc(),t.getPickTicketDetail().getPickTicket().getSourceType());
t_qty=0;
}
}
if(t_qty==0) {
break;
}
}
}else {
throw new BusinessException("该料号:"+t.getItemKey().getItem().getCode()+"库存不能直接转");
}
@ -8472,10 +8552,10 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
ids.add(t.getId());
}
boolean saphs= interfaceReqManager.wmsSapFaliaohuichuang(ids);
submitWMSTask(pickTicket, ids, saphs);
// boolean saphs= interfaceReqManager.wmsSapFaliaohuichuang(ids);
// submitWMSTask(pickTicket, ids, saphs);
} else {
throw new BusinessException("该出库单不是311转库");
throw new BusinessException("该出库单不是000转库");
}
}

View File

@ -75,6 +75,7 @@ public class ASNReceiveServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
private static Logger logger = Logger.getLogger(ASNReceiveServlet.class);
protected static ApplicationContext ac;
private final Object lock = new Object();
/**
* @see HttpServlet#HttpServlet()
*/
@ -457,7 +458,7 @@ public class ASNReceiveServlet extends HttpServlet {
//PDA扫描料号
String taskId =json.has("taskId")?json.getString("taskId"):"";
String jhItem =json.has("jhItem")?json.getString("jhItem"):"";
synchronized ("scanpickItemCode") {
synchronized (lock) {
resultJson=app.scanpickItemCode(taskId,jhItem,workerId, wId);
}
}else if("picking".equals(methodType)){

View File

@ -33,5 +33,13 @@ CREATE TABLE WorkOrderAllocationInfo (
);
GO
-----------2025-04-02
ALTER TABLE ITEM_KEY add PROP_LC5 varchar(50) COLLATE Chinese_PRC_CI_AS NULL;
GO
ALTER TABLE ITEM_KEY add PROP_LC6 varchar(50) COLLATE Chinese_PRC_CI_AS NULL;
GO
ALTER TABLE ASN_DETAIL add PROP_LC5 varchar(50) COLLATE Chinese_PRC_CI_AS NULL;
GO
ALTER TABLE ASN_DETAIL add PROP_LC6 varchar(50) COLLATE Chinese_PRC_CI_AS NULL;
GO

View File

@ -16,10 +16,19 @@
where 1=1 order by plantInfo.name asc ]]></hql>
</list>
<text id="btc.code" title="LOC"
row="1" col="1" defaultValue="" readOnly="false" required="true"
reserve="false" forceOverride="false" inVisible="false"
trimSpace="true" isPrecision="true" />
<!-- <text id="btc.code" title="LOC" -->
<!-- row="1" col="1" defaultValue="" readOnly="false" required="true" -->
<!-- reserve="false" forceOverride="false" inVisible="false" -->
<!-- trimSpace="true" isPrecision="true" /> -->
<list id="btc.code" title="LOC" row="1" col="1" span="1"
width="120" readOnly="false" required="true" reserve="false"
forceOverride="true">
<hql><![CDATA[select
pl.code,
pl.code
from PlantLocation as pl
where 1=1 order by pl.code asc ]]></hql>
</list>
</inputUIs>
<buttons>
<commit id="save" title="save" enableType="none" invisible="false">

View File

@ -4,9 +4,15 @@
<maintainPage id="maintainPlantLocationPage" title="maintainPlantLocationPage" autoQuery="false">
<search>
<inputUIs>
<text id="carrierType.code" title="Plant" row="1"
col="1" readOnly="false" required="false" reserve="false"
forceOverride="false" inVisible="false" trimSpace="false" />
<list id="carrierType.code" title="工厂" row="1" col="1" span="1"
width="120" readOnly="false" required="false" reserve="false"
forceOverride="true">
<hql><![CDATA[select
plantInfo.code,
plantInfo.code
from PlantInfo plantInfo
where 1=1 order by plantInfo.name asc ]]></hql>
</list>
<checkbox id="carrierType.disabled" title="00030D3C97851197274983400"
row="3" col="1" defaultValue="false" span="1" readOnly="false"
required="false" reserve="false" forceOverride="true" inVisible="false" />
@ -26,7 +32,7 @@
left join pl.plantInfo
where 1=1
/~carrierType.disabled: and pl.disabled = {carrierType.disabled}~/
/~carrierType.code: and pl.code like {carrierType.code}~/
/~carrierType.code: and pl.plantInfo.code like {carrierType.code}~/
]]></datasource>
<columns>
<column id="carrierType.id" title="carrierType.id" visible="false" />

View File

@ -110,6 +110,7 @@
inventory.propD3,
inventory.kqName,
inventory.storageDate,
inventory.propLC5,
inventory.lock
FROM InventoryView inventory
WHERE 1=1
@ -159,6 +160,7 @@
<column id="inventory.propD3" title="预计取回日期" visible="true" horizonAlign="center" />
<column id="inventory.kqName" title="库区" visible="true" horizonAlign="center" />
<column id="inventory.storageDate1" title="存货日期" visible="true" horizonAlign="center" format="dateFormatter"/>
<column id="inventory.propLC5" title="用途" visible="true" horizonAlign="center" />
<!-- <column id="inventory.storageDate2" title="存货时间" visible="true" horizonAlign="center" format="dateTiemFormatter"/> -->
<column id="inventory.lock" title="盘点锁定" visible="true" horizonAlign="center" format="booleanFormat"/>
</columns>

View File

@ -15,7 +15,7 @@
and ls.name in ('602','603','604','605')
]]></hql>
</list>
<checkbox id="ordersAll" title="是否加急" row="5" col="2" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
<!-- <checkbox id="ordersAll" title="是否加急" row="5" col="2" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/> -->
</inputUIs>
<buttons>
<commit id="1231stockby122231" title="搬运"
@ -25,7 +25,7 @@
<mapping id="parentIds" className="list" />
</mappings>
<actions>
<action managerName="moveDocManager" methodName="stockLibrartTask" parameter="hj,parentIds,ordersAll" />
<action managerName="moveDocManager" methodName="stockCk" parameter="hj,parentIds" />
</actions>
<forwards>
<forward name="refreshParent" newEnabled="true"

View File

@ -109,7 +109,8 @@
ad.lotInfo.propC7,
ad.beInput,
ad.lotInfo.propLC2,
ad.lotInfo.propLC3
ad.lotInfo.propLC3,
ad.lotInfo.propLC5
from ASNDetail as ad
left join ad.asn as asn
left join ad.item as item
@ -203,6 +204,8 @@
horizonAlign="center" />
<column id="ad.lotInfo.propLC3" title="扩展2" visible="true"
horizonAlign="center" />
<column id="ad.lotInfo.propLC5" title="用途" visible="true"
horizonAlign="center" />
</columns>
<buttons>
<popup id="CollectGood2s" title="补充物料信息" enableType="single"

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<pages>
<editPage id="editImportOutOrderPage" title="editImportOutOrderPage"
entityClass="com.dev.swms.server.model.shipping.PickTicket" width="270" height="130"
onClose="refreshParent">
<inputUIs>
<hidden id="pt.id" reserve="false" />
<file id="imageFile" title="importFile" row="1" col="2"
readOnly="false" required="false" reserve="false" forceOverride="true"
inVisible="false" showImage="false" storeDir="IMAGE_FILE_DIR" />
</inputUIs>
<buttons>
<commit id="import" title="import" enableType="single"
invisible="false">
<mappings>
<mapping id="imageFile" className="file" />
</mappings>
<actions>
<action managerName="importFileManager" methodName="importOutOrderDetail"
parameter="imageFile" />
</actions>
<forwards>
<!-- <forward name="refreshParent" newEnabled="true" editEnabled="true"/> -->
<!-- <forward name="closeWindow" newEnabled="true" editEnabled="true"/> -->
<!-- <forward name="refreshWindow" newEnabled="true" editEnabled="true"/> -->
</forwards>
</commit>
</buttons>
</editPage>
</pages>

View File

@ -53,6 +53,12 @@
<text id="pickTicketDetail.strBill12" title="机台号" row="12" col="1"
readOnly="false" required="false" reserve="false" forceOverride="false"
inVisible="false" trimSpace="true" isPrecision="true" />
<text id="pickTicketDetail.strBill9" title="接收工厂" row="13" col="1"
readOnly="false" required="false" reserve="false" forceOverride="false"
inVisible="false" trimSpace="true" isPrecision="true" />
<text id="pickTicketDetail.locType" title="接收LOC" row="14" col="1"
readOnly="false" required="false" reserve="false" forceOverride="false"
inVisible="false" trimSpace="true" isPrecision="true" />
</inputUIs>
<buttons>
<commit id="save" title="save" enableType="none" invisible="false">

View File

@ -88,6 +88,8 @@
pickTicketDetail.strBill1,
pickTicketDetail.SOI,
pickTicketDetail.strBill15,
pickTicketDetail.strBill9,
pickTicketDetail.locType,
pickTicketDetail.description
FROM PickTicketDetail as pickTicketDetail
left join pickTicketDetail.item as item
@ -130,6 +132,8 @@
<column id="pickTicketDetail.strBill1" title="SAP单号" visible="true" horizonAlign="center" />
<column id="pickTicketDetail.SOI" title="加急标记" visible="true" horizonAlign="center" />
<column id="pickTicketDetail.strBill15" title="序列号标记" visible="true" horizonAlign="center" />
<column id="pickTicketDetail.strBill9" title="接收工厂" visible="true" horizonAlign="center" />
<column id="pickTicketDetail.locType" title="接收LOC" visible="true" horizonAlign="center" />
<column id="pickTicketDetail.description" title="备注" visible="true" horizonAlign="center" />
</columns>
<buttons>

View File

@ -338,6 +338,9 @@
enableType="single" invisible="false" containId="true" pageId="viewOutExceptionLogPage" />
<popup id="pickConfirm21" title="打印A4" enableType="single" invisible="false" containId="true" pageId="editPrintPickticketPage">
</popup>
<popup id="SHASO2" title="导入转库单"
enableType="none" invisible="false" containId="true" pageId="editImportOutOrderPage" />
</buttons>
</maintainPage>
</pages>