|
@@ -295,4 +295,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);
|
|
|
+ }
|
|
|
}
|