|  |  |  | 
|---|
|  |  |  | 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实现 | 
|---|
|  |  |  | 
|---|
|  |  |  | private SmsEmailMapper smsEmailMapper; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private EmayService emayService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private RetentionMapper retentionMapper; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 入库通知任务业务处理 | 
|---|
|  |  |  | * @param job 参数 | 
|---|
|  |  |  | 
|---|
|  |  |  | //如果是自有物流车 | 
|---|
|  |  |  | 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() | 
|---|