|
@@ -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));
|
|
|
+
|
|
|
+
|
|
|
+ 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()){
|
|
|
|
|
|
case 1:
|
|
|
|
|
@@ -190,23 +188,27 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
addUpdateRegularField(tmstruckWeightResult);
|
|
|
lineSequence = 5;
|
|
|
break;
|
|
|
-
|
|
|
+ case 2:
|
|
|
+ break;
|
|
|
case 3:
|
|
|
- addInsertRegularField(tmstruckWeightResult);
|
|
|
- lineSequence = 5;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- 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;
|
|
|
+ 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));
|
|
|
-
|
|
|
+
|
|
|
+ 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:
|
|
|
|
|
|
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);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- 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;
|
|
|
}
|
|
|
|
|
@@ -295,4 +311,111 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
tmstruckWeightResult.setUpdateTime(new Date());
|
|
|
tmstruckWeightResult.setUpdateUsername("admin");
|
|
|
}
|
|
|
+
|
|
|
+ *通过运输订单判断下一步是否需要计量,更新汽车衡到计量实绩中
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public int isNextNeedJl(BigDecimal orderId) {
|
|
|
+
|
|
|
+ Map<BigDecimal,String> map=tmstruckWeightResultMapper.selectByOrderId(orderId);
|
|
|
+
|
|
|
+ BigDecimal materialTypeId=new BigDecimal(map.get("materialTypeId").toString());
|
|
|
+
|
|
|
+ BigDecimal orderLineSequence=new BigDecimal(map.get("orderLineSequence").toString());
|
|
|
+
|
|
|
+ BigDecimal weightTaskResultId=new BigDecimal(map.get("weightTaskResultId").toString());
|
|
|
+
|
|
|
+ BigDecimal lineId=new BigDecimal(map.get("lineId").toString());
|
|
|
+
|
|
|
+
|
|
|
+ List<BigDecimal> list=getNextStep(lineId,orderLineSequence.intValue());
|
|
|
+ if(list.size()==3){
|
|
|
+
|
|
|
+ if(list.get(1).intValue()==1 || list.get(1).intValue()==2){
|
|
|
+
|
|
|
+ if(list.get(0).intValue()==0){
|
|
|
+
|
|
|
+ BigDecimal truckCalculateId =tmstruckWeightResultMapper.getTruckCalculateNumber(materialTypeId,new BigDecimal(1));
|
|
|
+
|
|
|
+
|
|
|
+ if(list.get(1).intValue()==1){
|
|
|
+
|
|
|
+ TmstruckWeightResult tmstruckWeightResult=new TmstruckWeightResult();
|
|
|
+ tmstruckWeightResult.setWeightTaskResultId(weightTaskResultId);
|
|
|
+ tmstruckWeightResult.setResultGrossPlaceId(truckCalculateId);
|
|
|
+ tmstruckWeightResult.setUpdateTime(new Date());
|
|
|
+ tmstruckWeightResult.setUpdateUsername("admin");
|
|
|
+ tmstruckWeightResultMapper.updateByPrimaryKeySelective(tmstruckWeightResult);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(list.get(1).intValue()==2){
|
|
|
+
|
|
|
+ TmstruckWeightResult tmstruckWeightResult=new TmstruckWeightResult();
|
|
|
+ tmstruckWeightResult.setWeightTaskResultId(weightTaskResultId);
|
|
|
+ tmstruckWeightResult.setResultTarePlaceId(truckCalculateId);
|
|
|
+ tmstruckWeightResult.setUpdateTime(new Date());
|
|
|
+ tmstruckWeightResult.setUpdateUsername("admin");
|
|
|
+ tmstruckWeightResultMapper.updateByPrimaryKeySelective(tmstruckWeightResult);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ else if(list.get(2).intValue()==5){
|
|
|
+
|
|
|
+ BigDecimal truckCalculateId =tmstruckWeightResultMapper.getTruckCalculateNumber(materialTypeId,new BigDecimal(2));
|
|
|
+
|
|
|
+
|
|
|
+ if(list.get(1).intValue()==1){
|
|
|
+
|
|
|
+ TmstruckWeightResult tmstruckWeightResult=new TmstruckWeightResult();
|
|
|
+ tmstruckWeightResult.setWeightTaskResultId(weightTaskResultId);
|
|
|
+ tmstruckWeightResult.setResultGrossPlaceId(truckCalculateId);
|
|
|
+ tmstruckWeightResult.setUpdateTime(new Date());
|
|
|
+ tmstruckWeightResult.setUpdateUsername("admin");
|
|
|
+ tmstruckWeightResultMapper.updateByPrimaryKeySelective(tmstruckWeightResult);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(list.get(1).intValue()==2){
|
|
|
+
|
|
|
+ TmstruckWeightResult tmstruckWeightResult=new TmstruckWeightResult();
|
|
|
+ tmstruckWeightResult.setWeightTaskResultId(weightTaskResultId);
|
|
|
+ tmstruckWeightResult.setResultTarePlaceId(truckCalculateId);
|
|
|
+ tmstruckWeightResult.setUpdateTime(new Date());
|
|
|
+ tmstruckWeightResult.setUpdateUsername("admin");
|
|
|
+ tmstruckWeightResultMapper.updateByPrimaryKeySelective(tmstruckWeightResult);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+
|
|
|
+ BigDecimal truckCalculateId =tmstruckWeightResultMapper.getTruckCalculateNumber(materialTypeId,new BigDecimal(3));
|
|
|
+
|
|
|
+
|
|
|
+ if(list.get(1).intValue()==1){
|
|
|
+
|
|
|
+ TmstruckWeightResult tmstruckWeightResult=new TmstruckWeightResult();
|
|
|
+ tmstruckWeightResult.setWeightTaskResultId(weightTaskResultId);
|
|
|
+ tmstruckWeightResult.setResultGrossPlaceId(truckCalculateId);
|
|
|
+ tmstruckWeightResult.setUpdateTime(new Date());
|
|
|
+ tmstruckWeightResult.setUpdateUsername("admin");
|
|
|
+ tmstruckWeightResultMapper.updateByPrimaryKeySelective(tmstruckWeightResult);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(list.get(1).intValue()==2){
|
|
|
+
|
|
|
+ TmstruckWeightResult tmstruckWeightResult=new TmstruckWeightResult();
|
|
|
+ tmstruckWeightResult.setWeightTaskResultId(weightTaskResultId);
|
|
|
+ tmstruckWeightResult.setResultTarePlaceId(truckCalculateId);
|
|
|
+ tmstruckWeightResult.setUpdateTime(new Date());
|
|
|
+ tmstruckWeightResult.setUpdateUsername("admin");
|
|
|
+ tmstruckWeightResultMapper.updateByPrimaryKeySelective(tmstruckWeightResult);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<BigDecimal> getNextStep(BigDecimal lineId, int orderLineSequence) {
|
|
|
+ return tmstruckWeightResultMapper.getNextStep(lineId,orderLineSequence);
|
|
|
+ }
|
|
|
}
|