k94314517
2024-10-16 17efddc6a667670dca682bf36b51a43e99615e6d
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/WmsServiceImpl.java
@@ -23,8 +23,10 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
 * WMS平台对接Service实现
@@ -56,6 +58,8 @@
    private SmsEmailMapper smsEmailMapper;
    @Autowired
    private EmayService emayService;
    @Autowired
    private RetentionMapper retentionMapper;
    /**
     * 入库通知任务业务处理
     * @param job 参数
@@ -331,12 +335,20 @@
            //如果是自有物流车
            job.setType(type==0?Constants.platformJobType.zycxh:Constants.platformJobType.zyczh);//自有车卸货/装货
            job.setCarCodeBack(job.getCarCodeFront());//自有车默认前后车牌一样
            if(Constants.equalsInteger(car.getInStatus(),Constants.ONE) && car.getJobNum() == 0) {
            if(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());
                job.setSingType(Constants.TWO);
                job.setSignDate(new Date());
                List<PlatformJob> signList = platformJobMapper.selectList(new QueryWrapper<PlatformJob>().lambda().apply(" DATE(SIGN_DATE) = DATE(NOW()) and sign_date is not null  "));
                if(CollectionUtils.isEmpty(signList)){
                    job.setSignNum(Constants.ONE);
                } else{
                    int maxNumber = Collections.max(signList.stream().map(i->i.getSignNum()).collect(Collectors.toList()));
                    job.setSignNum(maxNumber + Constants.ONE);
                }
            }
        }
        PlatformGroup group = platformGroupMapper.selectOne(new QueryWrapper<PlatformGroup>().lambda()