From 10c28ce3d0b384584c77ce9111a66a0641250752 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 27 二月 2025 18:30:32 +0800
Subject: [PATCH] 最新版本541200007

---
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/WmsServiceImpl.java |   36 +++++++++++++++++++++++-------------
 1 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/WmsServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/WmsServiceImpl.java
index 6ad06ee..b04182f 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/WmsServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/WmsServiceImpl.java
@@ -310,8 +310,8 @@
             if(details.size()>0){
                 platformWmsDetailMapper.insert(details);
             }
+            list.setJobIdList(jobIdList);
             if(jobList.size()>0){
-                list.setJobIdList(jobIdList);
                 startEndNoticeToDriver(jobList);
             }
         }catch (Exception e){
@@ -373,8 +373,16 @@
     private void dealCarPlatformAndDriverInfo(PlatformJob job,int type) {
         //鏌ヨ杞﹁締鏄惁鑷湁杞︼紝浠ュ強jobNum琛ㄧず浣嗘眰浣滀笟鏁伴噺锛堥潪宸茬鍥殑浣滀笟鏁�)
         Cars car = carsMapper.selectOne(new QueryWrapper<Cars>()
-                .select("*,(select count(1) from platform_job b where b.plate_num='"+job.getCarCodeFront()+"' and b.status in("+
-                        Constants.PlatformJobStatus.LEAVED.getKey()+")) as jobNum")
+                .select("*,(select count(1) from platform_job b where b.plate_num='"+job.getCarCodeFront()+"' " +
+                        "and b.status in("+
+                        Constants.PlatformJobStatus.WART_SIGN_IN.getKey()+","+
+                        Constants.PlatformJobStatus.WART_SIGN_IN.getKey()+","+
+                        Constants.PlatformJobStatus.WAIT_CALL.getKey()+","+
+                        Constants.PlatformJobStatus.IN_WAIT.getKey()+","+
+                        Constants.PlatformJobStatus.CALLED.getKey()+","+
+                        Constants.PlatformJobStatus.TRANSFERING.getKey()+","+
+                        Constants.PlatformJobStatus.EXCEPTION.getKey()+","+
+                        Constants.PlatformJobStatus.WORKING.getKey()+")) as jobNum")
                 .lambda()
                 .eq(Cars::getIsdeleted,Constants.ZERO)
                 .eq(Cars::getType,Constants.ONE)
@@ -383,8 +391,10 @@
             //濡傛灉鏄嚜鏈夌墿娴佽溅
             job.setType(type==0?Constants.platformJobType.zycxh:Constants.platformJobType.zyczh);//鑷湁杞﹀嵏璐�/瑁呰揣
             job.setCarCodeBack(job.getCarCodeFront());//鑷湁杞﹂粯璁ゅ墠鍚庤溅鐗屼竴鏍�
-            if(retentionMapper.selectCount(new QueryWrapper<Retention>().lambda().eq(Retention::getType,Constants.THREE)
-                    .eq(Retention::getCarNo,car.getCode()))>Constants.ZERO && car.getJobNum() == 0){
+            if(job.getType() ==Constants.platformJobType.zyczh
+                    && retentionMapper.selectCount(new QueryWrapper<Retention>().lambda().eq(Retention::getType,Constants.THREE)
+                    .eq(Retention::getCarNo,car.getCode()))>Constants.ZERO
+                    && car.getJobNum() == 0){
                 //濡傛灉杞﹁締鍦ㄥ洯
                 job.setStatus(Constants.PlatformJobStatus.WAIT_CALL.getKey());//鍦ㄥ洯鏃犱綔涓氱姸鎬侊紝鍒欒嚜鍔ㄣ�愬凡绛惧埌銆戝鐞�
                 job.setArriveDate(new Date());
@@ -485,7 +495,6 @@
                     job.setContractNum(param.getContractNum());
                     job.setDriverPhone(param.getDriverPhone());
                     job.setDriverName(param.getDriverName());
-//                    job.setOrigin(Constants.ONE);
                     platformWmsJobMapper.insert(job);
                 }
                 jobIdList.add(job.getId());
@@ -497,6 +506,7 @@
                         entity.setIocode(d.getIoCode());
                         entity.setJobId(job.getJobId());
                         entity.setWmsJobId(job.getId());
+                        entity.setContractNum(param.getContractNum());
                         entity.setIoQty(d.getIoQty());
                         entity.setRepertotyAddress(job.getRepertotyAddress());
                         entity.setWmsJobId(job.getId());
@@ -521,8 +531,8 @@
             if(details.size()>0){
                 platformWmsDetailMapper.insert(details);
             }
+            list.setJobIdList(jobIdList);
             if(jobList.size()>0){
-                list.setJobIdList(jobIdList);
                 startEndNoticeToDriver(jobList);
             }
         }catch (Exception e){
@@ -712,14 +722,14 @@
                     .eq(PlatformWmsDetail::getIsdeleted, Constants.ZERO));
             if(details!=null && details.size()>0){
                 for(PlatformWmsDetail d :details){
-                   num.add(Constants.formatBigdecimal(d.getIoQty()));
+                    num =  num.add(Constants.formatBigdecimal(d.getIoQty()));
                 }
-                platformJobMapper.update(null,new UpdateWrapper<PlatformJob>().lambda()
-                        .set(PlatformJob::getTotalNum,num)
-                        .eq(PlatformJob::getOrigin, Constants.ZERO)
-                        .eq(PlatformJob::getId, jobId));
-            }
 
+            }
+            platformJobMapper.update(null,new UpdateWrapper<PlatformJob>().lambda()
+                    .set(PlatformJob::getTotalNum,num)
+                    .eq(PlatformJob::getOrigin, Constants.ONE)
+                    .eq(PlatformJob::getId, jobId));
         }
     }
     /**

--
Gitblit v1.9.3