no message
parent
a4001a23ca
commit
3eb1e9983c
|
|
@ -51,6 +51,12 @@ public interface ImportFileManager extends BaseManager{
|
|||
*/
|
||||
@Transactional
|
||||
void importPickTicketOrder(File file);
|
||||
/**
|
||||
* 导入工单明细
|
||||
* @param file
|
||||
*/
|
||||
@Transactional
|
||||
void importOrderDetail(File file);
|
||||
@Transactional
|
||||
void importStoreLine(File file);
|
||||
|
||||
|
|
|
|||
|
|
@ -570,7 +570,7 @@ public class DefaultImportFileManager extends DefaultBaseManager implements Impo
|
|||
|
||||
}
|
||||
private static SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");//小写的mm表示的是分钟
|
||||
private static SimpleDateFormat sdfa=new SimpleDateFormat("YYYY-MM-DD HH:mm:ss");
|
||||
private static SimpleDateFormat sdfa=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
public void importXBKPickTicket(File file){
|
||||
try {
|
||||
Workbook workbook = Workbook.getWorkbook(file);
|
||||
|
|
@ -1536,10 +1536,14 @@ public class DefaultImportFileManager extends DefaultBaseManager implements Impo
|
|||
/* 查询单据类型*/
|
||||
List<BillType> billTypes=commonDao.findByQuery(
|
||||
"from BillType bt");
|
||||
Warehouse warehouse=this.load(Warehouse.class, 1l);
|
||||
for (int i = 1; i <sheet.getRows(); i++) {
|
||||
//料号 描述 包装数量 长(m) 宽(m) 高(m) 重量(KG) 包装类型 单位 中大物料标记
|
||||
int j=0;
|
||||
String sourceType=sheet.getCell(j++,i).getContents().trim();//出库类型
|
||||
if (sourceType.length()<1) {
|
||||
break;
|
||||
}
|
||||
String code=sheet.getCell(j++,i).getContents().trim();//工单号
|
||||
String orderDate1=sheet.getCell(j++,i).getContents().trim();//需求日期
|
||||
String billTypeName=sheet.getCell(j++,i).getContents().trim();//单据类型
|
||||
|
|
@ -1581,7 +1585,7 @@ public class DefaultImportFileManager extends DefaultBaseManager implements Impo
|
|||
e.printStackTrace();
|
||||
}
|
||||
for (BillType billType : billTypes) {
|
||||
if (billType.equals(billTypeName)) {
|
||||
if (billType.getName().equals(billTypeName)) {
|
||||
pickTicket.setBillType(billType);
|
||||
break;
|
||||
}
|
||||
|
|
@ -1606,6 +1610,7 @@ public class DefaultImportFileManager extends DefaultBaseManager implements Impo
|
|||
pickTicket.setPriority(Integer.valueOf(priority));
|
||||
try {
|
||||
pickTicket.setUpdateTime(sdfa.parse(updateTime1+" "+updateTime2));
|
||||
pickTicket.getUpdateTime();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
@ -1620,6 +1625,7 @@ public class DefaultImportFileManager extends DefaultBaseManager implements Impo
|
|||
pickTicket.setLogisticsCompany(logisticsCompany);
|
||||
pickTicket.setDriverName(driverName);
|
||||
pickTicket.setUserName(userName);
|
||||
pickTicket.setWarehouse(warehouse);
|
||||
commonDao.store(pickTicket);
|
||||
}
|
||||
} catch (BiffException e) {
|
||||
|
|
@ -1631,4 +1637,92 @@ public class DefaultImportFileManager extends DefaultBaseManager implements Impo
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void importOrderDetail(File file) {
|
||||
try {
|
||||
Workbook workbook = Workbook.getWorkbook(file);
|
||||
Sheet sheet = workbook.getSheet(0);// 得到excel第一页的内容
|
||||
/* 查询单据类型*/
|
||||
List<BillType> billTypes=commonDao.findByQuery(
|
||||
"from BillType bt");
|
||||
Warehouse warehouse=this.load(Warehouse.class, 1l);
|
||||
for (int i = 1; i <sheet.getRows(); i++) {
|
||||
int j=0;
|
||||
j++;
|
||||
String code=sheet.getCell(j++,i).getContents().trim();//工单号
|
||||
if (code.length()<1) {
|
||||
break;
|
||||
}
|
||||
j++;
|
||||
String SOI=sheet.getCell(j++,i).getContents().trim();//优先级
|
||||
j++;
|
||||
j++;
|
||||
String itemCode=sheet.getCell(j++,i).getContents().trim();//料号
|
||||
j++;
|
||||
j++;
|
||||
String orderQuantity=sheet.getCell(j++,i).getContents().trim();//需求数量
|
||||
String allocatedQuantity=sheet.getCell(j++,i).getContents().trim();//预分配数量
|
||||
String pickedQuantity=sheet.getCell(j++,i).getContents().trim();//拣货数量
|
||||
String lotPropC2=sheet.getCell(j++,i).getContents().trim();//LOC
|
||||
String lotPropC9=sheet.getCell(j++,i).getContents().trim();//工厂
|
||||
j++;
|
||||
String lineNumber=sheet.getCell(j++,i).getContents().trim();//项号
|
||||
String strBill2=sheet.getCell(j++,i).getContents().trim();//更新标识
|
||||
String updateTime1 = sheet.getCell(j++,i).getContents().trim();//创建日期
|
||||
j++;
|
||||
j++;
|
||||
j++;
|
||||
String strBill12=sheet.getCell(j++,i).getContents().trim();//机台号
|
||||
j++;
|
||||
j++;
|
||||
PickTicket pickTicket=null;
|
||||
List<PickTicket> pickTickets=commonDao.findByQuery(
|
||||
"from PickTicket pt where pt.code=:code and CONVERT(varchar(10), pt.updateTime, 120)=:updateTime1",
|
||||
new String[] { "code","updateTime1" }, new Object[] { code,updateTime1 });
|
||||
if (pickTickets.size()>0) {
|
||||
pickTicket=pickTickets.get(0);
|
||||
}else {
|
||||
break;
|
||||
}
|
||||
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);
|
||||
}
|
||||
pickTicketDetail.setItem(item);
|
||||
pickTicketDetail.setLineNumber(lineNumber);
|
||||
pickTicketDetail.setPickTicket(pickTicket);
|
||||
pickTicketDetail.getLineNumber();
|
||||
pickTicketDetail.setSOI(SOI);
|
||||
pickTicketDetail.setOrderQuantity(Double.valueOf(orderQuantity));
|
||||
pickTicketDetail.setAllocatedQuantity(Double.valueOf(allocatedQuantity));
|
||||
pickTicketDetail.setPickedQuantity(Double.valueOf(pickedQuantity));
|
||||
NewLotInfo newLotInfo=new NewLotInfo();
|
||||
newLotInfo.setPropC2(lotPropC2);
|
||||
newLotInfo.setPropC9(lotPropC9);
|
||||
pickTicketDetail.setNewLotInfo(newLotInfo);
|
||||
pickTicketDetail.setStrBill2(strBill2);
|
||||
pickTicketDetail.setStrBill12(strBill12);
|
||||
commonDao.store(pickTicketDetail);
|
||||
}
|
||||
} catch (BiffException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<pages>
|
||||
<editPage id="editImportOrderDetailPage" title="导入工单明细"
|
||||
entityClass="com.dev.swms.server.model.shipping.PickTicketDetail" width="270" height="130"
|
||||
onClose="refreshParent">
|
||||
<inputUIs>
|
||||
<hidden id="pickTicket.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="importOrderDetail"
|
||||
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>
|
||||
|
|
@ -237,6 +237,9 @@
|
|||
editEnabled="true" />
|
||||
</forwards>
|
||||
</commit>
|
||||
<!-- 导入工单明细导入 -->
|
||||
<popup id="importPickTicketOrder" title="导入工单明细" enableType="none" invisible="false"
|
||||
containId="true" pageId="editImportOrderDetailPage"/>
|
||||
</buttons>
|
||||
</maintainPage>
|
||||
</pages>
|
||||
|
|
|
|||
Loading…
Reference in New Issue