|
@@ -73,20 +73,21 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public int receiveTmsTruckWeightResult(List<Map<String, Object>> mapList) throws Exception {
|
|
|
|
|
|
+ public String receiveTmsTruckWeightResult(List<Map<String, Object>> mapList){
|
|
//遍历列表
|
|
//遍历列表
|
|
- int count = 0;
|
|
|
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
for (Map<String, Object> map : mapList) {
|
|
for (Map<String, Object> map : mapList) {
|
|
|
|
+ sb.append(" ");
|
|
String resultTareCalculateNumber = (String) map.get("resultTareCalculateNumber");
|
|
String resultTareCalculateNumber = (String) map.get("resultTareCalculateNumber");
|
|
//如果计量衡名字中含有铁专线 则代表是轨道衡 走轨道衡路线
|
|
//如果计量衡名字中含有铁专线 则代表是轨道衡 走轨道衡路线
|
|
if(resultTareCalculateNumber.contains("铁专线")){
|
|
if(resultTareCalculateNumber.contains("铁专线")){
|
|
- count += addTrainWeightResult(map);
|
|
|
|
|
|
+ sb.append(addTrainWeightResult(map));
|
|
}else {
|
|
}else {
|
|
//走汽车衡
|
|
//走汽车衡
|
|
- count += addTruckWeightResult(map);
|
|
|
|
|
|
+ sb.append(addTruckWeightResult(map));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return count;
|
|
|
|
|
|
+ return sb.toString();
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -94,14 +95,19 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
* @param map
|
|
* @param map
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public int addTruckWeightResult(Map<String, Object> map) throws Exception {
|
|
|
|
|
|
+ public String addTruckWeightResult(Map<String, Object> map) {
|
|
//通过传来的运输订单号 与 物资ID查询计重实绩ID
|
|
//通过传来的运输订单号 与 物资ID查询计重实绩ID
|
|
Map<String, Object> stringObjectMap = tmstruckWeightResultMapper.selectTotalIdByOrderNo(map);
|
|
Map<String, Object> stringObjectMap = tmstruckWeightResultMapper.selectTotalIdByOrderNo(map);
|
|
if(stringObjectMap == null){
|
|
if(stringObjectMap == null){
|
|
- throw new Exception(map.get("orderNumber") + "没有此订单信息或物资信息(" + map.get("materialId") + ")错误");
|
|
|
|
|
|
+ return map.get("orderNumber") + "没有此订单信息或物资信息(" + map.get("materialId") + ")错误";
|
|
}
|
|
}
|
|
map.putAll(stringObjectMap);
|
|
map.putAll(stringObjectMap);
|
|
- TmstruckWeightResult tmstruckWeightResult = generateWeightResult(map);
|
|
|
|
|
|
+ TmstruckWeightResult tmstruckWeightResult = null;
|
|
|
|
+ try {
|
|
|
|
+ tmstruckWeightResult = generateWeightResult(map);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ return e.getMessage();
|
|
|
|
+ }
|
|
int i = tmstruckWeightResultMapper.updateByPrimaryKeySelective(tmstruckWeightResult);
|
|
int i = tmstruckWeightResultMapper.updateByPrimaryKeySelective(tmstruckWeightResult);
|
|
BigDecimal orderType = DataChange.dataToBigDecimal(map.get("orderTypee"));
|
|
BigDecimal orderType = DataChange.dataToBigDecimal(map.get("orderTypee"));
|
|
if("5678".contains(orderType.toString())){
|
|
if("5678".contains(orderType.toString())){
|
|
@@ -114,7 +120,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
utilsService.updateOrderLineSequence(map);
|
|
utilsService.updateOrderLineSequence(map);
|
|
//推送数据
|
|
//推送数据
|
|
utilsService.pushMesToWebsocket((String) stringObjectMap.get("capacityNumber"), "计量");
|
|
utilsService.pushMesToWebsocket((String) stringObjectMap.get("capacityNumber"), "计量");
|
|
- return i;
|
|
|
|
|
|
+ return map.get("orderNumber") + "成功";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -204,14 +210,20 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
* @param map
|
|
* @param map
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public int addTrainWeightResult(Map<String, Object> map) throws Exception {
|
|
|
|
|
|
+ public String addTrainWeightResult(Map<String, Object> map){
|
|
//通过****查询火运总实绩ID和物资ID --遗留问题
|
|
//通过****查询火运总实绩ID和物资ID --遗留问题
|
|
Map<String, Object> totalAndMaterialIdMap = null;
|
|
Map<String, Object> totalAndMaterialIdMap = null;
|
|
if(totalAndMaterialIdMap == null){
|
|
if(totalAndMaterialIdMap == null){
|
|
- throw new Exception("没有此车皮信息");
|
|
|
|
|
|
+ return "没有此车皮信息";
|
|
|
|
+ }
|
|
|
|
+ TmstrainWeightResult tmstrainWeightResult = null;
|
|
|
|
+ try {
|
|
|
|
+ tmstrainWeightResult = generateTrainWeightResult(map);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ return e.getMessage(); //捕获异常信息
|
|
}
|
|
}
|
|
- TmstrainWeightResult tmstrainWeightResult = generateTrainWeightResult(map);
|
|
|
|
- return tmstrainWeightResultMapper.insertSelective(tmstrainWeightResult);
|
|
|
|
|
|
+ tmstrainWeightResultMapper.insertSelective(tmstrainWeightResult);
|
|
|
|
+ return "" + "成功";
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|