|
@@ -64,16 +64,10 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
|
|
|
break;
|
|
|
case 5:
|
|
|
-
|
|
|
- break;
|
|
|
case 6:
|
|
|
-
|
|
|
- break;
|
|
|
case 7:
|
|
|
-
|
|
|
- break;
|
|
|
case 8:
|
|
|
- return tmstruckWeightResultMapper.getAllJiMaoResult(map);
|
|
|
+ return tmstruckWeightResultMapper.getCGAllJiMaoResult(map);
|
|
|
case 9:
|
|
|
break;
|
|
|
case 10:
|
|
@@ -107,16 +101,10 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
|
|
|
break;
|
|
|
case 5:
|
|
|
-
|
|
|
- break;
|
|
|
case 6:
|
|
|
-
|
|
|
- break;
|
|
|
case 7:
|
|
|
-
|
|
|
- break;
|
|
|
case 8:
|
|
|
- return tmstruckWeightResultMapper.getAllJiPiResult(map);
|
|
|
+ return tmstruckWeightResultMapper.getCGAllJiPiResult(map);
|
|
|
case 9:
|
|
|
break;
|
|
|
case 10:
|
|
@@ -178,9 +166,19 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
DecimalFormat df = new DecimalFormat("0.00");
|
|
|
String resultGrossWeight = df.format((double) map.get("resultGrossWeight"));
|
|
|
tmstruckWeightResult.setResultGrossWeight(new BigDecimal(resultGrossWeight));
|
|
|
+ //添加毛重时间
|
|
|
+ long resultGrossWeightTime = (long) map.get("resultGrossWeightTime");
|
|
|
+ tmstruckWeightResult.setResultGrossWeightTime(new Date(resultGrossWeightTime));
|
|
|
+
|
|
|
+ //通过汽车衡编号查询汽车衡ID
|
|
|
+ Integer calculateId = tmstruckWeightResultMapper.selectTruckCalculateId((String) map.get("truckCalculateNumber"));
|
|
|
+ //添加计毛汽车衡
|
|
|
+ if(calculateId != null){
|
|
|
+ tmstruckWeightResult.setResultGrossPlaceId(new BigDecimal(calculateId));
|
|
|
+ }
|
|
|
Integer lineSequence = null; //路段顺序号
|
|
|
- Integer orderType = (Integer) map.get("orderTypee");
|
|
|
- switch (orderType){
|
|
|
+ BigDecimal orderType = DataChange.dataToBigDecimal(map.get("orderTypee"));
|
|
|
+ switch (orderType.intValue()){
|
|
|
//如果订单类型为销售订单 则执行销售订单计皮规则 resultTareWeight
|
|
|
case 1:
|
|
|
//计算净重 从map中获取皮重 tareWeight
|
|
@@ -190,23 +188,27 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
addUpdateRegularField(tmstruckWeightResult); //插入第二次计重时间
|
|
|
lineSequence = 5; //设置路段顺序号为5:出厂
|
|
|
break;
|
|
|
- //采购订单记录计毛为第一次计重
|
|
|
+ case 2:
|
|
|
+ break;
|
|
|
case 3:
|
|
|
- addInsertRegularField(tmstruckWeightResult); //插入第一次计重时间
|
|
|
- lineSequence = 5; //设置路段顺序号为5:出厂
|
|
|
- }
|
|
|
-
|
|
|
- //通过汽车衡编号查询汽车衡ID
|
|
|
- Integer calculateId = tmstruckWeightResultMapper.selectTruckCalculateId((String) map.get("truckCalculateNumber"));
|
|
|
- //添加计毛汽车衡
|
|
|
- if(calculateId != null){
|
|
|
- tmstruckWeightResult.setResultGrossPlaceId(new BigDecimal(calculateId));
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ case 6:
|
|
|
+ case 7:
|
|
|
+ case 8: //采购订单记录计毛为第一次计重 添加磅单号
|
|
|
+ tmstruckWeightResult.setResultPoundNo((String) map.get("resultPoundNo"));
|
|
|
+ addInsertRegularField(tmstruckWeightResult); //插入第一次计重时间常规字段
|
|
|
+ lineSequence = 5; //设置路段顺序号为3:卸货
|
|
|
+ break;
|
|
|
+ case 9:
|
|
|
+ break;
|
|
|
+ case 10:
|
|
|
+ break;
|
|
|
+ case 11:
|
|
|
+ break;
|
|
|
}
|
|
|
- //添加磅单号
|
|
|
- tmstruckWeightResult.setResultPoundNo((String) map.get("resultPoundNo"));
|
|
|
- //添加毛重时间
|
|
|
- long resultGrossWeightTime = (long) map.get("resultGrossWeightTime");
|
|
|
- tmstruckWeightResult.setResultGrossWeightTime(new Date(resultGrossWeightTime));
|
|
|
|
|
|
int i = tmstruckWeightResultMapper.updateByPrimaryKeySelective(tmstruckWeightResult);
|
|
|
//更新订单路段顺序号
|
|
@@ -241,12 +243,29 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
//添加皮重时间
|
|
|
long resultTareWeightTime = (long) map.get("resultTareWeightTime");
|
|
|
tmstruckWeightResult.setResultTareWeightTime(new Date(resultTareWeightTime));
|
|
|
-
|
|
|
+ //通过汽车衡编号查询汽车衡ID 添加计皮汽车衡
|
|
|
+ Integer calculateId = tmstruckWeightResultMapper.selectTruckCalculateId((String) map.get("truckCalculateNumber"));
|
|
|
+ if(calculateId != null){
|
|
|
+ tmstruckWeightResult.setResultTarePlaceId(new BigDecimal(calculateId));
|
|
|
+ }
|
|
|
int i1 = 0;
|
|
|
- Integer orderType = (Integer) map.get("orderTypee");
|
|
|
- switch (orderType){
|
|
|
- //如果订单类型为采购订单 则执行采购订单计皮规则
|
|
|
+ Integer lineSequence = null; //路段顺序号
|
|
|
+ BigDecimal orderType = DataChange.dataToBigDecimal(map.get("orderTypee"));
|
|
|
+ switch (orderType.intValue()){
|
|
|
+ case 1: //销售订单计皮为第一次计重
|
|
|
+ tmstruckWeightResult.setResultPoundNo((String) map.get("resultPoundNo"));
|
|
|
+ addInsertRegularField(tmstruckWeightResult);// 添加插入常规字段 就是第一次计重时间
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ break;
|
|
|
case 3:
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ case 6:
|
|
|
+ case 7:
|
|
|
+ case 8: //如果订单类型为采购订单 则执行采购订单计皮规则
|
|
|
//计算净重 先从map中获取毛重 grossWeight
|
|
|
double netWeight = ((BigDecimal) map.get("grossWeight")).doubleValue() - ((Double) map.get("resultTareWeight"));
|
|
|
String resultNetWeight = df.format(netWeight);
|
|
@@ -259,21 +278,18 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
tmstruckReceiptResult.setInsertUsername("admin");
|
|
|
tmstruckReceiptResult.setInsertTime(new Date());
|
|
|
i1 = tmstruckReceiptResultMapper.updateByTotalResultId(tmstruckReceiptResult);
|
|
|
+ lineSequence = 5; // 出厂
|
|
|
+ break;
|
|
|
+ case 9:
|
|
|
+ break;
|
|
|
+ case 10:
|
|
|
+ break;
|
|
|
+ case 11:
|
|
|
break;
|
|
|
- //销售订单计皮为第一次计重
|
|
|
- case 1:
|
|
|
- addInsertRegularField(tmstruckWeightResult);// 添加插入常规字段 就是第一次计重时间
|
|
|
- }
|
|
|
-
|
|
|
- //通过汽车衡编号查询汽车衡ID
|
|
|
- Integer calculateId = tmstruckWeightResultMapper.selectTruckCalculateId((String) map.get("truckCalculateNumber"));
|
|
|
- //添加计皮汽车衡
|
|
|
- if(calculateId != null){
|
|
|
- tmstruckWeightResult.setResultTarePlaceId(new BigDecimal(calculateId));
|
|
|
}
|
|
|
int i = tmstruckWeightResultMapper.updateByPrimaryKeySelective(tmstruckWeightResult);
|
|
|
//更新订单路段顺序号
|
|
|
- int i2 = utilsService.updateOrderLineSequence(map, 4);
|
|
|
+ int i2 = utilsService.updateOrderLineSequence(map, lineSequence);
|
|
|
return i + i1 + i2;
|
|
|
}
|
|
|
|