|
@@ -384,9 +384,10 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
}
|
|
|
codeMap.put("materialId",materialId);
|
|
|
tmstruckWeightResult.setMaterialId(materialId);
|
|
|
+ tmstruckWeightResult.setMaterialNum(DataChange.dataToBigDecimal(codeMap.get("goodNum")));
|
|
|
}
|
|
|
if(resultNetWeight != null && !"".equals(resultNetWeight) && codeMap.get("saleMaterialId") != null) {
|
|
|
- tmstruckWeightResult.setMaterialNum(DataChange.dataToBigDecimal(codeMap.get("goodNum")));
|
|
|
+
|
|
|
tmstruckWeightResult.setSaleMaterialId(DataChange.dataToBigDecimal(codeMap.get("saleMaterialId")));
|
|
|
tmstruckWeightResult.setSaleMaterialId(saleMaterialId);
|
|
|
}
|
|
@@ -865,65 +866,74 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
//联动删除
|
|
|
for (Map<String, Object> map : mapList) {
|
|
|
String orderNumber = (String) map.get("orderNumber");
|
|
|
+ BigDecimal weightBatchId = DataChange.dataToBigDecimal(map.get("weightBatchId"));
|
|
|
//判断该运输订单号是否是钢材的
|
|
|
Map<String,Object> orderMes = tmstruckWeightResultMapper.getOOType(orderNumber);
|
|
|
if(orderMes == null) {
|
|
|
return "failed";
|
|
|
}
|
|
|
//新增日志表
|
|
|
- saleLogUtil.logOrder(DataChange.dataToBigDecimal(orderMes.get("orderId")),"计量联动删除","计量系统",SaleLogUtil.DELETE);
|
|
|
+ saleLogUtil.logOrder(DataChange.dataToBigDecimal(orderMes.get("orderId")),"计量联动删除" + weightBatchId,"计量系统" + map.get("userName"),SaleLogUtil.DELETE);
|
|
|
BigDecimal resultTotalId = DataChange.dataToBigDecimal(orderMes.get("resultTotalId"));
|
|
|
BigDecimal orderId = DataChange.dataToBigDecimal(orderMes.get("orderId"));
|
|
|
Integer orderType = DataChange.dataToBigDecimal(orderMes.get("orderType")).intValue();
|
|
|
if(orderType == 1 || orderType == 4) {
|
|
|
- //删皮,此时没有物资名称,只有运输订单号
|
|
|
- if(map.get("good") == null || "".equals(map.get("good"))){
|
|
|
- //清空皮重信息,且将进厂时间清空,且将路段顺序号置为0
|
|
|
- tmstruckWeightResultMapper.updateWeightTare(resultTotalId);
|
|
|
- tmstruckWeightResultMapper.updateEnfactoryResult(resultTotalId);
|
|
|
- tmstruckWeightResultMapper.updateOrderLineSqe(orderId);
|
|
|
- tmstruckWeightResultMapper.updateTotalStatus(resultTotalId);
|
|
|
- }
|
|
|
- //如果传输了物资,则判断该物资是第几拼
|
|
|
- if(map.get("good") != null && !"".equals(map.get("good"))){
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
- //查询物资
|
|
|
- map.put("good",map.get("goodspa") + "" + map.get("good"));
|
|
|
- BigDecimal materialId = tmstruckWeightResultMapper.getMaterialId(map);
|
|
|
- if(materialId == null) {
|
|
|
- return "没有找到该物资,返回failed";
|
|
|
- }
|
|
|
- //查询该物资id及对应的净重还有毛重时间是哪一拼
|
|
|
- String resultGrossWeightTime = (String) map.get("resultCrossWeightTime");
|
|
|
- Date resultGrossWeightTime1 = sdf.parse(resultGrossWeightTime);
|
|
|
- Map<String, Object> weightMap = new HashMap<>();
|
|
|
- weightMap.put("resultTotalId",orderMes.get("resultTotalId"));
|
|
|
- weightMap.put("materialId",materialId);
|
|
|
- weightMap.put("resultGrossWeightTime",resultGrossWeightTime);
|
|
|
- weightMap.put("saleMaterialId",map.get("saleMaterialId"));
|
|
|
- Map<String,Object> map1 = tmstruckWeightResultMapper.selectWeightMes(weightMap);
|
|
|
- tmstruckWeightResultMapper.updateMakeDate(DataChange.dataToBigDecimal(weightMap.get("saleMaterialId")));
|
|
|
- //根据查询信息判断是哪一拼
|
|
|
- Integer spellNum = (DataChange.dataToBigDecimal(map1.get("grossSqe")).intValue() + DataChange.dataToBigDecimal(map1.get("tareSqe")).intValue()) / 6;
|
|
|
- if(spellNum == 1){
|
|
|
- //如果是第一拼
|
|
|
- tmstruckWeightResultMapper.updateWeightResult(DataChange.dataToBigDecimal(map1.get("weightTaskResultId")));
|
|
|
- //删除下二拼的皮重
|
|
|
- tmstruckWeightResultMapper.updateWeightTareNoGross(resultTotalId);
|
|
|
+ if(weightBatchId == null) {
|
|
|
+ //删皮,此时没有物资名称,只有运输订单号
|
|
|
+ if(map.get("good") == null || "".equals(map.get("good"))){
|
|
|
+ //清空皮重信息,且将进厂时间清空,且将路段顺序号置为0
|
|
|
+ tmstruckWeightResultMapper.updateWeightTare(resultTotalId);
|
|
|
tmstruckWeightResultMapper.updateEnfactoryResult(resultTotalId);
|
|
|
tmstruckWeightResultMapper.updateOrderLineSqe(orderId);
|
|
|
tmstruckWeightResultMapper.updateTotalStatus(resultTotalId);
|
|
|
- }else{
|
|
|
- tmstruckWeightResultMapper.updateWeightResult(DataChange.dataToBigDecimal(map1.get("weightTaskResultId")));
|
|
|
- tmstruckWeightResultMapper.updateWeightTareNoGross(resultTotalId);
|
|
|
- //查询有净重的实绩的最大路段顺序号
|
|
|
- BigDecimal orderLineSqe = tmstruckWeightResultMapper.selectOrderLineSqe(resultTotalId);
|
|
|
- if(orderLineSqe != null) {
|
|
|
- tmstruckWeightResultMapper.updateOrderLineSqeBySqe(orderId,orderLineSqe.intValue());
|
|
|
+ }
|
|
|
+ //如果传输了物资,则判断该物资是第几拼
|
|
|
+ if(map.get("good") != null && !"".equals(map.get("good"))){
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ //查询物资
|
|
|
+ map.put("good",map.get("goodspa") + "" + map.get("good"));
|
|
|
+ BigDecimal materialId = tmstruckWeightResultMapper.getMaterialId(map);
|
|
|
+ if(materialId == null) {
|
|
|
+ return "没有找到该物资,返回failed";
|
|
|
}
|
|
|
+ //查询该物资id及对应的净重还有毛重时间是哪一拼
|
|
|
+ String resultGrossWeightTime = (String) map.get("resultCrossWeightTime");
|
|
|
+ Date resultGrossWeightTime1 = sdf.parse(resultGrossWeightTime);
|
|
|
+ Map<String, Object> weightMap = new HashMap<>();
|
|
|
+ weightMap.put("resultTotalId",orderMes.get("resultTotalId"));
|
|
|
+ weightMap.put("materialId",materialId);
|
|
|
+ weightMap.put("resultGrossWeightTime",resultGrossWeightTime);
|
|
|
+ weightMap.put("saleMaterialId",map.get("saleMaterialId"));
|
|
|
+ Map<String,Object> map1 = tmstruckWeightResultMapper.selectWeightMes(weightMap);
|
|
|
+ tmstruckWeightResultMapper.updateMakeDate(DataChange.dataToBigDecimal(weightMap.get("saleMaterialId")));
|
|
|
+ //根据查询信息判断是哪一拼
|
|
|
+ Integer spellNum = (DataChange.dataToBigDecimal(map1.get("grossSqe")).intValue() + DataChange.dataToBigDecimal(map1.get("tareSqe")).intValue()) / 6;
|
|
|
+ if(spellNum == 1){
|
|
|
+ //如果是第一拼
|
|
|
+ tmstruckWeightResultMapper.updateWeightResult(DataChange.dataToBigDecimal(map1.get("weightTaskResultId")));
|
|
|
+ //删除下二拼的皮重
|
|
|
+ tmstruckWeightResultMapper.updateWeightTareNoGross(resultTotalId);
|
|
|
+ tmstruckWeightResultMapper.updateEnfactoryResult(resultTotalId);
|
|
|
+ tmstruckWeightResultMapper.updateOrderLineSqe(orderId);
|
|
|
+ tmstruckWeightResultMapper.updateTotalStatus(resultTotalId);
|
|
|
+ }else{
|
|
|
+ tmstruckWeightResultMapper.updateWeightResult(DataChange.dataToBigDecimal(map1.get("weightTaskResultId")));
|
|
|
+ tmstruckWeightResultMapper.updateWeightTareNoGross(resultTotalId);
|
|
|
+ //查询有净重的实绩的最大路段顺序号
|
|
|
+ BigDecimal orderLineSqe = tmstruckWeightResultMapper.selectOrderLineSqe(resultTotalId);
|
|
|
+ if(orderLineSqe != null) {
|
|
|
+ tmstruckWeightResultMapper.updateOrderLineSqeBySqe(orderId,orderLineSqe.intValue());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //存在计量批次id,首先把计量批次ID,更新分录表里面的计量分录id为null,然后把实绩表也清空。
|
|
|
+ tmstruckWeightResultMapper.updateWeightResultToNull(weightBatchId);
|
|
|
+ tmstruckWeightBatchMapper.updateAmsFluToNull(weightBatchId);
|
|
|
|
|
|
- }
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}else{
|
|
|
tmstruckWeightResultMapper.linkageDeleteTransportOrder(orderNumber);
|
|
|
}
|