|
@@ -149,7 +149,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
* 更新计毛实绩 采集需要的数据
|
|
|
* 运输订单号
|
|
|
* 汽车衡编号
|
|
|
- * 物资名称
|
|
|
+ * 物资ID
|
|
|
* 毛重
|
|
|
* 毛重时间
|
|
|
* 磅单号
|
|
@@ -159,9 +159,6 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
@Transactional
|
|
|
public int addJiMaoResult(Map<String, Object> map) {
|
|
|
TmstruckWeightResult tmstruckWeightResult = new TmstruckWeightResult();
|
|
|
- //通过物资名称和物资规格查询物资Id
|
|
|
- int materialId = tmstruckWeightResultMapper.getMaterialIdByMaterialNameAndSpe(map);
|
|
|
- map.put("materialId", materialId);
|
|
|
//通过传来的运输订单号与物资ID查询计重实绩
|
|
|
map.putAll(tmstruckWeightResultMapper.selectTotalIdByOrderNo(map));
|
|
|
generateMaoWeightResult(map, tmstruckWeightResult);
|
|
@@ -170,6 +167,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
int i = 0;
|
|
|
switch (orderType.intValue()){
|
|
|
case 1:
|
|
|
+ case 4:
|
|
|
//添加第二次计量常规字段
|
|
|
addUpdateRegularField(tmstruckWeightResult);
|
|
|
//查询当前计毛是否为最后一拼(针对多拼) (查询是否还有装车实绩没有数据)
|
|
@@ -181,32 +179,27 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
int gatepostId = rulesService.calculateGatepost(map);
|
|
|
i += tmstruckLeaveFactoryResultService.updateLeaveFactoryGatepostId(resultTotalId.intValue(), gatepostId);
|
|
|
}else {
|
|
|
- //如果还有未装车的实绩 则代表还有未装车的物资 计算各个物资装车点 并更新到装车实绩中
|
|
|
- //如果是多拼 使用多种物资计算第一个装货的物资和装车点
|
|
|
+ //如果还有未装车的实绩 则代表还有未装车的物资 计算下一装车物资ID 更新下一物资的计皮实绩
|
|
|
Map<String, Object> platIdMap = rulesService.calculateMaterial(list); //获得materialId loadingId
|
|
|
platIdMap.put("orderId", map.get("orderId"));
|
|
|
- i += tmstruckLoadResultService.updateLoadingId(platIdMap); //更新装货点
|
|
|
//更新下一计量实绩以当前毛重为皮重
|
|
|
platIdMap.put("resultTareWeight", map.get("resultGrossWeight"));
|
|
|
i += updateWeightResult(platIdMap);
|
|
|
//添加仓库排队
|
|
|
- platIdMap.put("orderNumber", map.get("orderNumber"));
|
|
|
- qmsFeign.addQueueResultByCk(platIdMap);
|
|
|
+// platIdMap.put("orderNumber", map.get("orderNumber"));
|
|
|
+// qmsFeign.addQueueResultByCk(platIdMap);
|
|
|
}
|
|
|
break;
|
|
|
case 2:
|
|
|
case 3:
|
|
|
break;
|
|
|
- case 4:
|
|
|
- break;
|
|
|
case 5:
|
|
|
case 6:
|
|
|
case 7:
|
|
|
- case 8: //采购订单记录计毛为第一次计重 添加磅单号
|
|
|
+ case 8:
|
|
|
+ case 9: //采购订单记录计毛为第一次计重 添加磅单号
|
|
|
addInsertRegularField(tmstruckWeightResult); //插入第一次计重时间常规字段
|
|
|
break;
|
|
|
- case 9:
|
|
|
- break;
|
|
|
case 10:
|
|
|
break;
|
|
|
case 11:
|
|
@@ -231,7 +224,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
tmstruckWeightResult.setWeightTaskResultId(weightTaskResultId);
|
|
|
//添加毛重
|
|
|
DecimalFormat df = new DecimalFormat("0.00");
|
|
|
- String resultGrossWeight = df.format((double) map.get("resultGrossWeight"));
|
|
|
+ String resultGrossWeight = df.format(DataChange.dataToBigDecimal(map.get("resultGrossWeight")).doubleValue());
|
|
|
tmstruckWeightResult.setResultGrossWeight(new BigDecimal(resultGrossWeight));
|
|
|
//添加毛重时间
|
|
|
long resultGrossWeightTime = (long) map.get("resultGrossWeightTime");
|
|
@@ -242,10 +235,13 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
tmstruckWeightResult.setResultNetWeight(resultNetWeight);
|
|
|
}
|
|
|
//通过汽车衡编号查询汽车衡ID
|
|
|
- Integer calculateId = tmstruckWeightResultMapper.selectTruckCalculateId((String) map.get("truckCalculateNumber"));
|
|
|
- //添加计毛汽车衡
|
|
|
- if(calculateId != null){
|
|
|
- tmstruckWeightResult.setResultGrossPlaceId(new BigDecimal(calculateId));
|
|
|
+ String truckCalculateNumber = (String) map.get("truckCalculateNumber");
|
|
|
+ if(truckCalculateNumber != null) {
|
|
|
+ Integer calculateId = tmstruckWeightResultMapper.selectTruckCalculateId(truckCalculateNumber);
|
|
|
+ //添加计毛汽车衡
|
|
|
+ if (calculateId != null) {
|
|
|
+ tmstruckWeightResult.setResultGrossPlaceId(new BigDecimal(calculateId));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -256,7 +252,6 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
* 皮重 resultTareWeight
|
|
|
* 皮重时间 resultTareWeightTime
|
|
|
* 净重
|
|
|
- * 物资名称:materialName 物资规格:materialSpecification 型号:materialModel
|
|
|
* @param map
|
|
|
* @return
|
|
|
*/
|
|
@@ -264,9 +259,6 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
@Transactional
|
|
|
public int addJiPiResult(Map<String, Object> map) {
|
|
|
TmstruckWeightResult tmstruckWeightResult = new TmstruckWeightResult();
|
|
|
- //通过物资名称和物资规格查询物资Id
|
|
|
- int materialId = tmstruckWeightResultMapper.getMaterialIdByMaterialNameAndSpe(map);
|
|
|
- map.put("materialId", materialId);
|
|
|
//通过传来的运输订单号 与 物资ID查询计重实绩ID
|
|
|
map.putAll(tmstruckWeightResultMapper.selectTotalIdByOrderNo(map));
|
|
|
generatePiWeightResult(map, tmstruckWeightResult);
|
|
@@ -274,6 +266,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
BigDecimal orderType = DataChange.dataToBigDecimal(map.get("orderTypee"));
|
|
|
switch (orderType.intValue()){
|
|
|
case 1:
|
|
|
+ case 4:
|
|
|
//销售订单计皮为第一次计重
|
|
|
addInsertRegularField(tmstruckWeightResult);// 添加插入常规字段 就是第一次计重时间;
|
|
|
//查询还未装车的物资
|
|
@@ -284,7 +277,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
i += tmstruckLoadResultService.updateLoadingId(mesMap); //更新装货点
|
|
|
//添加仓库排队
|
|
|
mesMap.put("orderNumber", map.get("orderNumber"));
|
|
|
- qmsFeign.addQueueResultByCk(mesMap);
|
|
|
+// qmsFeign.addQueueResultByCk(mesMap);
|
|
|
}else {
|
|
|
//如果是多拼 使用多种物资计算第一个装货的物资和装车点
|
|
|
Map<String, Object> platIdMap = rulesService.calculateMaterial(mapList); //获得materialId loadingId
|
|
@@ -292,7 +285,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
i += tmstruckLoadResultService.updateLoadingId(platIdMap); //更新装货点
|
|
|
//添加仓库排队
|
|
|
platIdMap.put("orderNumber", map.get("orderNumber"));
|
|
|
- qmsFeign.addQueueResultByCk(platIdMap);
|
|
|
+// qmsFeign.addQueueResultByCk(platIdMap);
|
|
|
}
|
|
|
break;
|
|
|
case 2:
|
|
@@ -301,8 +294,6 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
addInsertRegularField(tmstruckWeightResult);// 添加插入常规字段 就是第一次计重时间;
|
|
|
//焦炭、水渣只有一种物资 装货点是通过发运计划的时候填写的
|
|
|
break;
|
|
|
- case 4:
|
|
|
- break;
|
|
|
case 5:
|
|
|
case 6:
|
|
|
case 7:
|
|
@@ -364,7 +355,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
*/
|
|
|
public int updateWeightResult(Map<String, Object> map){
|
|
|
TmstruckWeightResult tmstruckWeightResult = new TmstruckWeightResult();
|
|
|
- //通过物资ID和运输订单Id修改查找计量实绩ID
|
|
|
+ //通过(物资ID)和运输订单Id修改查找计量实绩ID
|
|
|
Integer id = tmstruckWeightResultMapper.getWeightIdByMaterialIdAndOrderId(map);
|
|
|
tmstruckWeightResult.setId(new BigDecimal(id));
|
|
|
if(map.get("tarePlaceId") != null){ //如果皮重汽车衡不为空 更新皮重汽车衡
|