Commit e6f2621e authored by tank.li@mushiny.com's avatar tank.li@mushiny.com

上架只能用A面

parent 8d678190
......@@ -356,8 +356,8 @@ public class CommonUtils {
switch (face){
case "A":faceInt = 0;break;
case "B":faceInt = 1;break;
case "C":faceInt = 2;break;
case "B":faceInt = 1;break;
case "D":faceInt = 3;break;
default:faceInt = 0;
}
......
......@@ -79,12 +79,12 @@ public class MqListener {
Integer podDirection = CommonUtils.parseInteger("podDirection",data);
int toward = 0;
/*int toward = 0;
switch (podDirection){
case 1 : toward = 90; break;
case 2 : toward = 180; break;
case 3 : toward = 270; break;
}
}*/
if(rows.isEmpty()){
Map record = new HashMap();
//record.putAll(data);
......@@ -94,7 +94,7 @@ public class MqListener {
record.put("STATION_ID",workstationId);
record.put("POD_INDEX",podIndex);
record.put("POD_ID",podId);
record.put("TOWARD",toward);
record.put("TOWARD",podDirection);
record.put("WAREHOUSE_ID",CommonUtils.getWarehouse(Sql_Table.FACTORY));
record.put("TRIP_TASKID",CommonUtils.parseString("taskId",data));
CommonUtils.genUselessInfo(record);
......@@ -108,7 +108,7 @@ public class MqListener {
newValue.put("STATION_ID",workstationId);
newValue.put("POD_ID",podId);
newValue.put("POD_INDEX",CommonUtils.parseInteger("podId",data));
newValue.put("TOWARD",toward);
newValue.put("TOWARD",podDirection);
newValue.put("TRIP_TASKID",CommonUtils.parseString("taskId",data));
CommonUtils.modifyUselessInfo(newValue);
......
......@@ -59,7 +59,7 @@ public class ICQAService {
Integer wsFace = CommonUtils.parseInteger("WORKING_FACE_ORIENTATION", data);
String podId = CommonUtils.parseString("POD_ID", data);
String face = InboundService.getFace(wsFace,pod_toward);
String face = CommonUtils.IntegerToFace(pod_toward);
/*`ID` varchar(255) NOT NULL,
`ENTRYID` varchar(255) NOT NULL,
`ENTRYPOSITIONID` varchar(255) NOT NULL,
......@@ -184,12 +184,12 @@ public class ICQAService {
baseBpo2.addKV("WAREHOUSE_ID", CommonUtils.parseString("WAREHOUSE_ID", map));
baseBpo2.addKV("SECTION_ID", CommonUtils.parseString("SECTION_ID", map));
this.jdbcRepository.insertBusinessObject(baseBpo2);*/
Integer podIndex = CommonUtils.parseInteger("POD_INDEX",podOrder);
Integer stopCellId = CommonUtils.parseInteger("STOPPOINT",podOrder);
Integer sectId = CommonUtils.parseInteger("RCS_SECTIONID",podOrder);
Integer podIndex = CommonUtils.parseInteger("PODINDEX",podOrder);
Integer stopCellId = 475;//CommonUtils.parseInteger("STOPPOINT",podOrder);
Integer sectId = 1;//CommonUtils.parseInteger("RCS_SECTIONID",podOrder);
Integer face = CommonUtils.faceToInteger(needFace);
Integer wsDirect = CommonUtils.wsFace2Direct(
CommonUtils.parseInteger("WORKING_FACE_ORIENTATION",podOrder));
Integer wsDirect = /*CommonUtils.wsFace2Direct(*/
CommonUtils.parseInteger("WORKING_FACE_ORIENTATION",podOrder);
tripPositionID = this.wmsToWcsService.sendSingleTripToWcs(podIndex,sectId,stopCellId,wsDirect,face);
}else{
Map data = tripPositions.get(0);
......@@ -474,7 +474,7 @@ public class ICQAService {
String factory = CommonUtils.parseString("FACTORY",data);
factory = CommonUtils.getWarehouse(factory);
String client = CommonUtils.parseString("FACTORY",data);
client = CommonUtils.getClient(factory);
client = CommonUtils.getClient(client);
if (CommonUtils.isEmpty(skuId)) {
//所有的SKU
items = this.jdbcRepository.queryBySql(Sql_Table.SQL_FINDALLITEM
......@@ -486,6 +486,11 @@ public class ICQAService {
items = this.jdbcRepository.queryBySql(Sql_Table.SQL_FINDALLITEM_BYSKUID
, client,factory, skuId);
}
for (int i = 0; i < items.size(); i++) {
Map map = items.get(i);
map.put("SECTION_ID",CommonUtils.getSection(CommonUtils.parseString("SECTION_ID",map)));
map.put("WAREHOUSE_ID",CommonUtils.getWarehouse(CommonUtils.parseString("WAREHOUSE_ID",map)));
}
data.put("content",items);
return data;
}
......
......@@ -161,10 +161,27 @@ public class InboundService {
this.updateInboundPodOrder(Sql_Table.FINISH, podOrderId);
//增加入库流水记录
this.add2InboundHistory(stored,entryId,pId,skuId,containerId,uid,id,factory);
//判断是否结束入库单
this.updateInboundOrder(entryId);
return messageDTO;
}
private void updateInboundOrder(String entryId) {
List list = this.jdbcRepository.queryBySql(Sql_Table.SQL_CHECK_INBOUND_STATUS, entryId);
if (list == null || list.isEmpty()) {
//讲主表更新
Map newValue = new HashMap();
newValue.put("STATE",Sql_Table.FINISH);
newValue.put("NEED_RESP",1);
CommonUtils.modifyUselessInfo(newValue);
Map con = new HashMap();
con.put("ENTRYID",entryId);
int count = this.jdbcRepository.updateRecords(Sql_Table.WMS_INBOUND_ORDER, newValue, con);
logger.debug("更新入库货架任务成功! count:"+count);
}
}
private void updateInboundPodOrder(String state, String podOrderId) {
Map newValue = new HashMap();
newValue.put("STATE",state);
......@@ -261,7 +278,19 @@ public class InboundService {
*/
public MessageDTO skuNotFound(String entryId, String skuId) {
return this.updateInboundOrderStatus(entryId, skuId, Sql_Table.ERROR,0, "物料丢失");
MessageDTO dto = this.updateInboundOrderStatus(entryId, skuId, Sql_Table.ERROR,0, "物料丢失");
//将任务结束
List<Map> rows = this.jdbcRepository.queryBySql(Sql_Table.SQL_QUERY_INBOUND_PODORDER_BYENTRYID,entryId);
for (int i = 0; i < rows.size(); i++) {
Map map = rows.get(i);
if(Objects.equals(skuId,CommonUtils.parseString("SKUID",map))){
String podOrderId = CommonUtils.parseString("ID",map);
this.updateInboundPodOrder(Sql_Table.FINISH,podOrderId);
}
}
//判断是否结束入库单
this.updateInboundOrder(entryId);
return dto;
}
......@@ -412,12 +441,12 @@ public class InboundService {
//this.WcsAPI.sent
//发送任务结束
this.jdbcRepository.insertBusinessObject(baseBpo2);*/
Integer podIndex = CommonUtils.parseInteger("POD_INDEX",podOrder);
Integer stopCellId = CommonUtils.parseInteger("STOPPOINT",podOrder);
Integer sectId = CommonUtils.parseInteger("RCS_SECTIONID",podOrder);
Integer podIndex = CommonUtils.parseInteger("PODINDEX",podOrder);
Integer stopCellId = 475;//CommonUtils.parseInteger("STOPPOINT",podOrder);
Integer sectId = 1;//CommonUtils.parseInteger("RCS_SECTIONID",podOrder);
Integer face = CommonUtils.faceToInteger(needFace);
Integer wsDirect = CommonUtils.wsFace2Direct(
CommonUtils.parseInteger("WORKING_FACE_ORIENTATION",podOrder));
Integer wsDirect = /*CommonUtils.wsFace2Direct(*/
CommonUtils.parseInteger("WORKING_FACE_ORIENTATION",podOrder);
tripPositionID = this.wmsToWcsService.sendSingleTripToWcs(podIndex,sectId,stopCellId,wsDirect,face);
}else{
Map data = tripPositions.get(0);
......@@ -629,7 +658,7 @@ public class InboundService {
Integer wsFace = CommonUtils.parseInteger("WORKING_FACE_ORIENTATION", data);
String podId = CommonUtils.parseString("POD_ID", data);
String face = getFace(wsFace,pod_toward);
String face = CommonUtils.IntegerToFace(pod_toward);
/*`ID` varchar(255) NOT NULL,
`ENTRYID` varchar(255) NOT NULL,
`ENTRYPOSITIONID` varchar(255) NOT NULL,
......
......@@ -231,10 +231,10 @@ public interface Sql_Table {
"AND RCS_TRIPPOSITION.TRIPPOSITION_STATE=? \n" +
"ORDER BY POD_INDEX";
String SQL_QUERY_INBOUND_PODORDER = "SELECT * FROM WMS_INBOUND_PODORDER " +
"WHERE STATE='Available' AND POD_FACE=? " +
"WHERE STATE='Process' AND POD_FACE=? " +
"AND POD_ID=? AND WORKSTATION_ID=? limit 1";
String SQL_QUERY_ICQA_PODORDER = "SELECT * FROM WMS_ICQA_PODORDER " +
"WHERE STATE='Available' AND POD_FACE=? " +
"WHERE STATE='Process' AND POD_FACE=? " +
"AND POD_ID=? AND WORKSTATION_ID=? limit 1";
String SQL_QUERY_INBOUND_PODORDER_BYENTRYID = "SELECT * FROM WMS_INBOUND_PODORDER WHERE ENTRYID=?";
String SQL_QUERY_INBOUND_POSFINISH = "SELECT * FROM WMS_INBOUND_ORDER \n" +
......@@ -246,12 +246,15 @@ public interface Sql_Table {
String STOWPOD = "StowPod";
String ICQAPOD = "IcqaPod";
String SQL_QUERYEMPTYSTORAGELOCATION = "SELECT MD_STORAGELOCATION.* FROM MD_STORAGELOCATION\n" +
"WHERE MD_STORAGELOCATION.ID NOT IN \n" +
"(SELECT STORAGELOCATION_ID FROM INV_UNITLOAD WHERE ENTITY_LOCK=0)\n" +
"WHERE SUBSTRING(MD_STORAGELOCATION.NAME,9,1)='A' \n" + //只要A面
"AND MD_STORAGELOCATION.ID \n" +
"NOT IN (SELECT STORAGELOCATION_ID FROM INV_UNITLOAD WHERE ENTITY_LOCK=0)" +
"LIMIT 1";
String TABLE_INV_UNITLOAD = "INV_UNITLOAD";
String CLIENT_ID = "1001";
String FACTORY = "1001";
String SECTION = "1001-1";
String SQL_CHECK_INBOUND_STATUS = "SELECT 1 FROM WMS_INBOUND_ORDERPOSITION " +
"WHERE ENTRYID=? AND STATE='Available' limit 1" ;
}
......@@ -181,7 +181,7 @@ public class WMSRespService {
//检查是否有任务完成的 将 NEED_RESP 修改成1
//检查是否有明细已完成 需要将主表记录更新为完成Finish 本来是一条语句完成的
List<Map> allFinishedInbound = this.jdbcRepository.queryBySql(Sql_Table.SQL_QUERY_INBOUND_POSFINISH);
/*List<Map> allFinishedInbound = this.jdbcRepository.queryBySql(Sql_Table.SQL_QUERY_INBOUND_POSFINISH);
for (int i = 0; i < allFinishedInbound.size(); i++) {
Map icqaOrder = allFinishedInbound.get(i);
BaseBpo baseBpo = new BaseBpo();
......@@ -193,7 +193,7 @@ public class WMSRespService {
baseBpo.addKV("NEED_RESP", 1);
CommonUtils.modifyUselessInfo(baseBpo.getKv());
this.jdbcRepository.updateBusinessObject(baseBpo);
}
}*/
}
......
......@@ -60,6 +60,8 @@ public class WMSService {
baseBpo.addKV("WAREHOUSE_ID",CommonUtils.getWarehouse(inboundOrderDTO.getFACTORY()));
baseBpo.addKV("SECTION_ID",CommonUtils.getSection(inboundOrderDTO.getSECTION()));
baseBpo.addKV("ENTRYID",inboundOrderDTO.getENTRYID());
baseBpo.addKV("STATE",Sql_Table.AVAILABLE);
baseBpo.addKV("NEED_RESP",0);
this.jdbcRepository.insertBusinessObject(baseBpo);
}
@Transactional
......
......@@ -104,7 +104,7 @@ public class WmsToWcsService{
taskMap.put("sectionId", sectionId);
taskMap.put("podId", podIndex);
taskMap.put("stopCellId", stopCellId);
taskMap.put("direction", direction);
taskMap.put("direction", 3);//TODO
taskMap.put("targetDirection", face);
String taskIdFromWcs = executorHandler.postForObject(this.callPodUrl,
......
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