|
@@ -187,6 +187,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
* @param map orderId, oldMaterialMapList, newMaterialMapList
|
|
|
* @return
|
|
|
*/
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public int updateSteelTruckWeightResult(Map<String, Object> map){
|
|
|
BigDecimal orderId = DataChange.dataToBigDecimal(map.get("orderId"));
|
|
|
List<Map<String, Object>> newMaterialMapList = (List<Map<String, Object>>) map.get("newMaterialMapList");
|
|
@@ -240,7 +241,6 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- //读取新的物资map对比数据
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -303,7 +303,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
for (Map<String, Object> map : oldMaterialMapList) {
|
|
|
String materialId = String.valueOf(map.get("materialId"));//拿到key
|
|
|
//通过这个key去新物资集合中获取是否包含这个key
|
|
|
- Map<String, Object> newMap = getNewMap(materialId, newMaterialMapList);
|
|
|
+ Map<String, Object> newMap = getNewMap(Integer.parseInt(materialId), newMaterialMapList);
|
|
|
if(newMap == null){
|
|
|
//如果在新物资中没有找到,则代表此物资已删除
|
|
|
delete.add(DataChange.dataToBigDecimal(map.get("materialId")));
|
|
@@ -322,7 +322,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
//再次遍历new中的物资 查找 新增 的物资
|
|
|
for (Map<String, Object> map : newMaterialMapList) {
|
|
|
String materialId = String.valueOf(map.get("materialId"));
|
|
|
- Map<String, Object> oldMaps = getNewMap(materialId, oldMaterialMapList);
|
|
|
+ Map<String, Object> oldMaps = getNewMap(Integer.parseInt(materialId), oldMaterialMapList);
|
|
|
if(oldMaps == null){
|
|
|
//如果在旧map中没有找到,则代表是新增的物资,将新增的物资存放到新增列表中
|
|
|
add.add(map);
|
|
@@ -340,7 +340,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
* @param mapList
|
|
|
* @return
|
|
|
*/
|
|
|
- public Map<String, Object> getNewMap(String key, List<Map<String, Object>> mapList){
|
|
|
+ public Map<String, Object> getNewMap(int key, List<Map<String, Object>> mapList){
|
|
|
for (Map<String, Object> map : mapList) {
|
|
|
if(map.containsValue(key)){
|
|
|
return map;
|