|
@@ -94,7 +94,6 @@ public class TmstruckTotalResultServiceImpl implements ITmstruckTotalResultServi
|
|
|
tmstruckTotalResult.setOrderId(orderId);
|
|
|
tmstruckTotalResult.setInsertTime(new Date());
|
|
|
tmstruckTotalResult.setInsertUsername("admin");
|
|
|
-
|
|
|
tmstruckTotalResultMapper.insertSelective(tmstruckTotalResult);
|
|
|
//处理旧实绩
|
|
|
Map<String,Object> serachMap=new HashMap<>();
|
|
@@ -110,6 +109,10 @@ public class TmstruckTotalResultServiceImpl implements ITmstruckTotalResultServi
|
|
|
//根据旧的总实绩ID判断有没有
|
|
|
Map<String,Object> responseMap = omsFeign.driverReceiveOrRefuse(map);
|
|
|
System.out.println(responseMap);
|
|
|
+ //迁移排队实绩
|
|
|
+ serachMap.put("resultTotalId",maxId);
|
|
|
+ serachMap.put("resultTotalIdOld",resultTotalIdOld);
|
|
|
+ tmstruckWeightResultMapper.copyQmsResult(serachMap);
|
|
|
//进厂
|
|
|
serachMap.put("resultTotalId",maxId);
|
|
|
List<TmstruckEnfactoryResult> tmstruckEnfactoryResultLb = tmstruckEnfactoryResultMapper.selectByParameters(serachMap);
|
|
@@ -119,6 +122,28 @@ public class TmstruckTotalResultServiceImpl implements ITmstruckTotalResultServi
|
|
|
tmstruckEnfactoryResult1.setResultId(tmstruckEnfactoryResult.getResultId());
|
|
|
tmstruckEnfactoryResult1.setResultTotalId(tmstruckEnfactoryResult.getResultTotalId());
|
|
|
tmstruckEnfactoryResultMapper.updateByPrimaryKeySelective(tmstruckEnfactoryResult1);
|
|
|
+ }else{
|
|
|
+ try {
|
|
|
+ new Thread( new Runnable() {
|
|
|
+ public void run(){
|
|
|
+ try {
|
|
|
+ Thread.sleep(200);
|
|
|
+ List<TmstruckEnfactoryResult> tmstruckEnfactoryResultLb = tmstruckEnfactoryResultMapper.selectByParameters(serachMap);
|
|
|
+ if(tmstruckEnfactoryResultLb != null && tmstruckEnfactoryResultLb.size() > 0 && tmstruckEnfactoryResultLb.get(0) != null ) {
|
|
|
+ TmstruckEnfactoryResult tmstruckEnfactoryResult = tmstruckEnfactoryResultLb.get(0);
|
|
|
+ TmstruckEnfactoryResult tmstruckEnfactoryResult1=enOlds.get(0);
|
|
|
+ tmstruckEnfactoryResult1.setResultId(tmstruckEnfactoryResult.getResultId());
|
|
|
+ tmstruckEnfactoryResult1.setResultTotalId(tmstruckEnfactoryResult.getResultTotalId());
|
|
|
+ tmstruckEnfactoryResultMapper.updateByPrimaryKeySelective(tmstruckEnfactoryResult1);
|
|
|
+ }
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).start();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
//计皮
|
|
|
serachMap.put("resultTotalId",maxId);
|
|
@@ -144,11 +169,44 @@ public class TmstruckTotalResultServiceImpl implements ITmstruckTotalResultServi
|
|
|
orderMap.put("seq",0);
|
|
|
tmstruckWeightResultMapper.updateOmstruckStatus(orderMap);
|
|
|
}
|
|
|
+ }else{
|
|
|
+ try {
|
|
|
+ new Thread( new Runnable() {
|
|
|
+ public void run(){
|
|
|
+ try {
|
|
|
+ Thread.sleep(200);
|
|
|
+ List<TmstruckWeightResult> tmstruckWeightResultLb = tmstruckWeightResultMapper.selectByTotalId(serachMap);
|
|
|
+ if(tmstruckWeightResultLb != null && tmstruckWeightResultLb.size() > 0 && tmstruckWeightResultLb.get(0) != null) {
|
|
|
+ TmstruckWeightResult tmstruckWeightResult = tmstruckWeightResultLb.get(0);
|
|
|
+ serachMap.put("switch","1");
|
|
|
+ serachMap.put("resultTotalId",resultTotalIdOld);
|
|
|
+ List<TmstruckWeightResult> olds = tmstruckWeightResultMapper.selectByTotalId(serachMap);
|
|
|
+ if(olds!=null && olds.size()>0){
|
|
|
+ TmstruckWeightResult tmstruckWeightResult1=olds.get(0);
|
|
|
+ tmstruckWeightResult.setResultTareWeightTime(tmstruckWeightResult1.getResultTareWeightTime());
|
|
|
+ tmstruckWeightResult.setResultTareWeight(tmstruckWeightResult1.getResultTareWeight());
|
|
|
+ tmstruckWeightResult.setResultTarePlaceId(tmstruckWeightResult1.getResultTarePlaceId());
|
|
|
+ tmstruckWeightResultMapper.updateByPrimaryKeySelective(tmstruckWeightResult);
|
|
|
+ Map<String,Object> orderMap=new HashMap<>();
|
|
|
+ orderMap.put("orderId",orderId);
|
|
|
+ orderMap.put("seq",2);
|
|
|
+ tmstruckWeightResultMapper.updateOmstruckStatus(orderMap);
|
|
|
+ }else{
|
|
|
+ Map<String,Object> orderMap=new HashMap<>();
|
|
|
+ orderMap.put("orderId",orderId);
|
|
|
+ orderMap.put("seq",0);
|
|
|
+ tmstruckWeightResultMapper.updateOmstruckStatus(orderMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).start();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
- //迁移排队实绩
|
|
|
- serachMap.put("resultTotalId",maxId);
|
|
|
- serachMap.put("resultTotalIdOld",resultTotalIdOld);
|
|
|
- tmstruckWeightResultMapper.copyQmsResult(serachMap);
|
|
|
}else{
|
|
|
//未进厂,状态为待接收
|
|
|
Map<String,Object> orderMap=new HashMap<>();
|