Browse Source

修改签收,装车查询问题

training
caoyizhong 1 year ago
parent
commit
07924ce3da
  1. 9
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java
  2. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataDriverArteryClient.java
  3. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java
  4. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  5. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

9
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java

@ -16,6 +16,8 @@
*/
package com.logpm.basicdata.controller;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.dto.BasicdataDriverArteryDTO;
import com.logpm.basicdata.entity.BasicdataVehicleEntity;
import com.logpm.basicdata.service.IBasicdataVehicleService;
@ -116,6 +118,13 @@ public class BasicdataDriverArteryController extends BladeController {
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入basicdataDriverArtery")
public R save(@Valid @RequestBody BasicdataDriverArteryDTO basicdataDriverArtery) {
List<BasicdataDriverArteryEntity> list = basicdataDriverArteryService.list(Wrappers.<BasicdataDriverArteryEntity>query().lambda()
.eq(BasicdataDriverArteryEntity::getUserId, basicdataDriverArtery.getUserId())
.eq(BasicdataDriverArteryEntity::getIsDeleted, 0)
);
if(list.size() > 0){
return R.fail("绑定的用户已存在!不要重复绑定!!!");
}
boolean save = basicdataDriverArteryService.save(basicdataDriverArtery);
//加入关联表
if (null !=basicdataDriverArtery.getBindVehicles()&& save){

4
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataDriverArteryClient.java

@ -18,6 +18,7 @@ package com.logpm.basicdata.feign;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.mapper.BasicdataDriverArteryMapper;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage;
@ -56,8 +57,9 @@ public class BasicdataDriverArteryClient implements IBasicdataDriverArteryClient
@Override
@GetMapping(GETENTITY)
public BasicdataDriverArteryEntity getDriverArtery(Long id) {
BasicdataDriverArteryEntity basicdataDriverArteryEntity = basicdataDriverArteryMapper.selectOne(new QueryWrapper<BasicdataDriverArteryEntity>().lambda()
BasicdataDriverArteryEntity basicdataDriverArteryEntity = basicdataDriverArteryMapper.selectOne(Wrappers.<BasicdataDriverArteryEntity>query().lambda()
.eq(BasicdataDriverArteryEntity::getUserId,id)
.eq(BasicdataDriverArteryEntity::getIsDeleted,0)
);
return basicdataDriverArteryEntity;
}

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java

@ -25,7 +25,6 @@ import com.logpm.distribution.vo.DistributionSignforVO;
import com.logpm.distribution.excel.DistributionSignforExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.vo.DistributionSignforsnmbVO;
import com.logpm.distribution.vo.DistributionstatisticsnmbVO;
import com.logpm.distribution.vo.app.*;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -1057,8 +1057,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//查询当前登录人的配送任务
BasicdataDriverArteryEntity driverArtery = iBasicdataDriverArteryClient.getDriverArtery(user.getUserId());
if (null == driverArtery) {
log.error("没有司机的信息!!");
return page.setRecords(distributionAppDeliveryListVOS);
}
//查询司机的任务
List<Long> deliveryIds = distributionDeliverySelfMapper.selectdeliveryList(driverArtery.getId());
if (deliveryIds.size() > 0) {
distributionAppDeliveryListVOS = baseMapper.selectDistributionAppDeliveryListPage(page, distributionAppDeliveryListDTO, deliveryIds);
@ -1123,9 +1125,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//查询是否备货
distributionAppDeliveryListVO.setIsstock("备货完成");
Integer reNub = distributionStockMapper.selectCount(new QueryWrapper<DistributionStockEntity>().lambda()
.in(DistributionStockEntity::getReservationId, reList)
).intValue();
Integer deliveryNumber = distributionAppDeliveryListVO.getDeliveryNumber();
.in(reList.size() > 0,DistributionStockEntity::getReservationId, reList)
).intValue(); //扫描件数
Integer deliveryNumber = distributionAppDeliveryListVO.getDeliveryNumber(); //配送件数
if (reNub < deliveryNumber) {
distributionAppDeliveryListVO.setIsstock("备货未完成");
}

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -61,6 +61,7 @@ import java.util.stream.Collectors;
@Service
@AllArgsConstructor
public class DistributionSignforServiceImpl extends BaseServiceImpl<DistributionSignforMapper, DistributionSignforEntity> implements IDistributionSignforService {
private final DistributionLoadscanServiceImpl distributionLoadscanService;
private final DistributionLoadscaninvnServiceImpl distributionLoadscaninvnService;
private final DistributionLoadscanMapper distributionLoadscanMapper;
@ -405,7 +406,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (value.getData().equals("delivery_driver")){
//查询当前登录人的配送任务
BasicdataDriverArteryEntity driverArtery = iBasicdataDriverArteryClient.getDriverArtery(user.getUserId());
if (null == driverArtery){return page.setRecords(distributionAppDeliveryListVOS);}
if (null == driverArtery){
log.error("没有司机的信息!!");
return page.setRecords(distributionAppDeliveryListVOS);}
List<Long> deliveryIds = distributionDeliverySelfMapper.selectdeliveryList(driverArtery.getId());
if (deliveryIds.size()>0){
distributionAppDeliveryListVOS = baseMapper.selectDistributionAppDeliveryInListPage(page, distributionAppDeliveryListDTO,deliveryIds);

Loading…
Cancel
Save