Browse Source

fix:修复司机绑定多个职责的场景

dist.1.3.0
pref_mail@163.com 8 months ago
parent
commit
75aab26642
  1. 2
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataDriverArteryEntity.java
  2. 6
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataDriverArteryVO.java
  3. 11
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java
  4. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataDriverArteryDTO.java
  5. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.java
  6. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.xml
  7. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java

2
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataDriverArteryEntity.java

@ -62,7 +62,7 @@ public class BasicdataDriverArteryEntity extends TenantEntity {
/**
* 职务类型;1-干线,2-配送
*/
@ApiModelProperty(value = "职务类型;1-干线,2-配送,3-全部")
@ApiModelProperty(value = "职务类型;1-干线,2-配送")
private String jobType;
/**
* 准驾车型;1-A1,2-A2,3-A3,4-B1,5-B2,6-C1,7-C2

6
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataDriverArteryVO.java

@ -50,6 +50,12 @@ public class BasicdataDriverArteryVO extends BasicdataDriverArteryEntity {
@ApiModelProperty(value = "司机关联车辆列表")
private List<BasicdataVehicleEntity> vehicleVOList;
/**
* 司机类型
*/
private List<String> jobTypeString;
private List<BasicdataDriverWarehouseVO> warehouses = new ArrayList<>();

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

@ -34,6 +34,7 @@ import com.logpm.basicdata.vo.BasicdataDriverWarehouseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import jodd.util.ArraysUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.boot.ctrl.BladeController;
@ -54,10 +55,7 @@ import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 司机信息表 控制器
@ -95,6 +93,11 @@ public class BasicdataDriverArteryController extends BladeController {
List<BasicdataDriverWarehouseVO> warehouseIds = basicdataDriverWarehouseService.findByDriverId(driverId);
BasicdataDriverArteryVO basicdataDriverArteryVO = new BasicdataDriverArteryVO();
BeanUtil.copy(detail,basicdataDriverArteryVO);
// 拆分 司机类型
String[] split = basicdataDriverArteryVO.getJobType().split(",");
List<String> list = Arrays.asList(split);
basicdataDriverArteryVO.setJobTypeString(list);
basicdataDriverArteryVO.setWarehouses(warehouseIds);
basicdataDriverArteryVO.setBindVehicles(String.join(",",vehicleIds));
return R.data(basicdataDriverArteryVO);

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataDriverArteryDTO.java

@ -41,4 +41,6 @@ public class BasicdataDriverArteryDTO extends BasicdataDriverArteryEntity {
private String bindVehicles;
private List<Long> warehouseIds = new ArrayList<>();
}

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.java

@ -69,7 +69,7 @@ public interface BasicdataDriverArteryMapper extends BaseMapper<BasicdataDriverA
*/
BasicdataDriverArteryEntity findDriverListByPhone(@Param("name") String vehicleOwner,@Param("phone") String vehicleOwnerPhone);
List<BasicdataDriverArteryEntity> selectListByWarehouseId(@Param("warehouseId") Long warehouseId);
List<BasicdataDriverArteryEntity> selectListByWarehouseId(@Param("warehouseId") Long warehouseId,@Param("jobType")String jobType);
BasicdataDriverArteryEntity findEntityByPhone(@Param("phone") String phone);
}

4
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.xml

@ -168,13 +168,12 @@
left join logpm_basicdata_vehicle lbv on lbv.id = lbdm.brand_id
where lbda.`name` like concat('%',#{driverName},'%')
<if test="jobType != null and jobType = ''">
and lbda.job_type = #{jobType}
and locate(#{jobType},lbda.job_type)>0
</if>
group by lbda.id,
lbda.name,
lbda.phone,
lbda.type
limit 10
</select>
<select id="findDriverListByPhone" resultType="com.logpm.basicdata.entity.BasicdataDriverArteryEntity">
SELECT id,name,bind_vehicle FROM logpm_basicdata_driver_artery WHERE name = #{name} AND phone = #{phone}
@ -186,6 +185,7 @@
from logpm_basicdata_driver_artery lbda
left join logpm_basicdata_driver_warehouse lbdw on lbdw.driver_id = lbda.id
where lbdw.warehouse_id = #{warehouseId}
and locate(${jobType},lbda.job_type)>0
and lbda.is_deleted = 0
</select>

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java

@ -140,7 +140,7 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl<BasicdataD
log.info("################ getDriverList 仓库信息:{}", myCurrentWarehouse);
Long warehouseId = myCurrentWarehouse.getId();
ArrayList<BasicdataDriverArteryVO> basicdataDriverArteryVOS = new ArrayList<>();
List<BasicdataDriverArteryEntity> list = baseMapper.selectListByWarehouseId(warehouseId);
List<BasicdataDriverArteryEntity> list = baseMapper.selectListByWarehouseId(warehouseId,"2");
log.info("################getDriverList list:{}", list);
if(list.isEmpty()){

Loading…
Cancel
Save