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

init

parent 43fbbbb7
......@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -55,6 +56,7 @@ public class InboundController {
String warehouseId = CommonUtils.parseString("factory",reqData);
String sectionId = CommonUtils.parseString("section",reqData);
List<Map> data = this.inboundService.searchInbound(entryId,warehouseId,sectionId);
return ResponseEntity.ok(JsonUtils.list2Json(data));
}
......@@ -67,8 +69,11 @@ public class InboundController {
@RequestBody String json){
Map reqData = JsonUtils.json2Map(json);
String entryId = CommonUtils.parseString("entryId",reqData);
Map data = this.inboundService.searchInboundInfo(entryId);
return ResponseEntity.ok(JsonUtils.map2Json(data));
Map ret = new HashMap();
List data = this.inboundService.searchInboundInfo(entryId);
ret.put("entryId",entryId);
ret.put("content",data);
return ResponseEntity.ok(JsonUtils.map2Json(ret));
}
/**
......
......@@ -242,9 +242,9 @@ public class JdbcRepository implements CommandLineRunner {
}
Object[] _params = params.toArray();
String _paramsStr = paramsStr(_params);
logger.debug("查询语句是:" + sql.toUpperCase() + " 参数是:" + _paramsStr);
logger.debug("查询语句是:" + sql + " 参数是:" + _paramsStr);
long start = System.currentTimeMillis();
List<Map> rows = this.jdbcTemplate.query(sql.toUpperCase(), _params, new RowMap());
List<Map> rows = this.jdbcTemplate.query(sql, _params, new RowMap());
logger.debug("查询结果总数:"+rows.size()+" SQL查询耗时:"+(System.currentTimeMillis() -start)+"毫秒!");
return rows;
}
......
......@@ -21,7 +21,7 @@ public class RowMap implements RowMapper<Map> {
for (int j = 0; j < colCount; j++) {
String key = resultSet.getMetaData().getColumnName(j+1);
String label = resultSet.getMetaData().getColumnLabel(j+1);
data.put(key.toUpperCase(),resultSet.getObject(key));
//data.put(key.toUpperCase(),resultSet.getObject(key));
data.put(label.toUpperCase(),resultSet.getObject(label));
}
//logger.debug("index:"+i,"row="+data);
......
......@@ -23,7 +23,7 @@ public class InboundService {
public static final String SQL_SEARCHINBOUND_FACTORY = " AND WAREHOUSE_ID=? ";
public static final String SQL_SEARCHINBOUND_SECTION = " AND SECTION_ID=? ";
public static final String SQL_SEARCHINBOUNDINFO =
"SELECT * FROM WMS_INBOUND_ORDER WHERE ENTRYID = ?";
"SELECT SKUID,AMOUNT,IFNULL(STORED,0) AS STORED,STATE FROM WMS_INBOUND_ORDERPOSITION WHERE ENTRYID = ?";
private final static Logger logger = LoggerFactory.getLogger(InboundService.class);
private static final String SQL_SEARCHINBOUND_ENTRYID = " AND ENTRYID like ? ";
......@@ -35,7 +35,10 @@ public class InboundService {
@Autowired
private SystemPropertiesManager systemPropertiesManager;
public static final String SQL_SEARCHINBOUND = "SELECT * FROM WMS_INBOUND_ORDER WHERE 1=1 ";
public static final String SQL_SEARCHINBOUND =
"SELECT ENTRYID,STATE,DATE_FORMAT(CREATED_DATE,'%Y-%m-%d %H:%i:%s') as CREATED_DATE" +
",WAREHOUSE_ID FACTORY,SECTION_ID as SECTION " +
"FROM WMS_INBOUND_ORDER WHERE 1=1 ";
public List<Map> searchInbound(String entryId, String warehouseId, String sectionId) {
......@@ -59,16 +62,13 @@ public class InboundService {
return this.jdbcRepository.queryBySql(sql.toString(),params);
}
public Map searchInboundInfo(String entryId) {
public List<Map> searchInboundInfo(String entryId) {
List params = new ArrayList();
StringBuilder sql = new StringBuilder();
sql.append(SQL_SEARCHINBOUNDINFO);
params.add(entryId);
List<Map> data = this.jdbcRepository.queryBySql(sql.toString(),params);
if(!data.isEmpty()){
return data.get(0);
}
throw new RuntimeException("没有这条记录:"+entryId);
return data;
}
public MessageDTO orderFinish(String entryId) {
......@@ -316,6 +316,7 @@ public class InboundService {
baseBpo.addKV("SECTION_ID",CommonUtils.parseString("SECTION_ID",map));
this.jdbcRepository.insertBusinessObject(baseBpo);
for (int j = 0; j < orderPosition.size(); j++) {
//如果存在就不要再创建
Map podOrders = orderPosition.get(j);
BaseBpo baseBpo2 = new BaseBpo();
baseBpo2.setTable("RCS_TRIPPOSITION");
......@@ -419,7 +420,11 @@ public class InboundService {
}
public MessageDTO endInbound(String stationName) {
return null;
MessageDTO messageDTO = MessageDTO.success();
/*if(){
}*/
return messageDTO;
}
public Map currentPodTask(String stationName) {
......
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