diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataDriverArteryEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataDriverArteryEntity.java index c2eb59af5..fcc9605eb 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataDriverArteryEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataDriverArteryEntity.java @@ -68,10 +68,10 @@ public class BasicdataDriverArteryEntity extends TenantEntity { @ApiModelProperty(value = "备注") private String notes; /** - * 绑定车辆 + * 绑定车辆状态 */ - @ApiModelProperty(value = "绑定车辆") - private String bindVehicle; + @ApiModelProperty(value = "绑定车辆状态") + private Integer bindVehicle; /** * 合同开始时间 */ @@ -170,7 +170,7 @@ public class BasicdataDriverArteryEntity extends TenantEntity { * 关联承运商Id */ @ApiModelProperty(value = "关联承运商Id") - private String carrierId; + private Long carrierId; /** * 运输协议 */ diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataDrivermiddleEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataDrivermiddleEntity.java new file mode 100644 index 000000000..64e16f713 --- /dev/null +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataDrivermiddleEntity.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basicdata.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Date; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +/** + * 司机中间表 实体类 + * + * @author lmy + * @since 2023-06-26 + */ +@Data +@TableName("logpm_basicdata_drivermiddle") +@ApiModel(value = "BasicdataDrivermiddle对象", description = "司机中间表") +@EqualsAndHashCode(callSuper = true) +public class BasicdataDrivermiddleEntity extends TenantEntity { + + /** + * 预留1 + */ + @ApiModelProperty(value = "预留1") + private String reserve1; + /** + * 预留2 + */ + @ApiModelProperty(value = "预留2") + private String reserve2; + /** + * 预留3 + */ + @ApiModelProperty(value = "预留3") + private String reserve3; + /** + * 预留4 + */ + @ApiModelProperty(value = "预留4") + private String reserve4; + /** + * 预留5 + */ + @ApiModelProperty(value = "预留5") + private String reserve5; + /** + * 司机表ID + */ + @ApiModelProperty(value = "司机表ID") + private Long driverId; + /** + * 车辆表ID + */ + @ApiModelProperty(value = "车辆表ID") + private Long brandId; + /** + * zhufuztai + */ + @ApiModelProperty(value = "zhufuztai") + private String state; + +} diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataVehicleEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataVehicleEntity.java index 437d87919..5929f0806 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataVehicleEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataVehicleEntity.java @@ -113,10 +113,10 @@ public class BasicdataVehicleEntity extends TenantEntity { @ApiModelProperty(value = "备注") private String notes; /** - * 车辆所属人 + * 车辆所属人状态 */ - @ApiModelProperty(value = "车辆所属人") - private String vehicleOwner; + @ApiModelProperty(value = "车辆所属人状态") + private Integer vehicleOwner; /** * 品牌型号 */ diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataDrivermiddleClient.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataDrivermiddleClient.java new file mode 100644 index 000000000..70984ac0f --- /dev/null +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataDrivermiddleClient.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basicdata.feign; + +import org.springblade.common.constant.ModuleNameConstant; +import org.springblade.core.mp.support.BladePage; +import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +/** + * 司机中间表 Feign接口类 + * + * @author lmy + * @since 2023-06-26 + */ +@FeignClient( + value = ModuleNameConstant.APPLICATION_BASICDATA_NAME +) +public interface IBasicdataDrivermiddleClient { + + String API_PREFIX = "drivermiddle/client"; + String TOP = API_PREFIX + "/top"; + + /** + * 获取司机中间表列表 + * + * @param current 页号 + * @param size 页数 + * @return BladePage + */ + @GetMapping(TOP) + BladePage top(@RequestParam("current") Integer current, @RequestParam("size") Integer size); + +} diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataDriverArteryVO.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataDriverArteryVO.java index e97fc338c..3a369d1e7 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataDriverArteryVO.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataDriverArteryVO.java @@ -22,6 +22,8 @@ import org.springblade.core.tool.node.INode; import lombok.Data; import lombok.EqualsAndHashCode; +import java.util.List; + /** * 司机信息表 视图实体类 * @@ -32,10 +34,11 @@ import lombok.EqualsAndHashCode; @EqualsAndHashCode(callSuper = true) public class BasicdataDriverArteryVO extends BasicdataDriverArteryEntity { private static final long serialVersionUID = 1L; + /** - * 供应商 + * 车辆信息 */ - @ApiModelProperty(value = "供应商") - private String carrier; + @ApiModelProperty(value = "车辆信息") + private String bindVehicles; } diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataDrivermiddleVO.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataDrivermiddleVO.java new file mode 100644 index 000000000..32c53fd9c --- /dev/null +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataDrivermiddleVO.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basicdata.vo; + +import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity; +import org.springblade.core.tool.node.INode; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 司机中间表 视图实体类 + * + * @author lmy + * @since 2023-06-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class BasicdataDrivermiddleVO extends BasicdataDrivermiddleEntity { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataVehicleVO.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataVehicleVO.java index 2ab061ba3..e40aa1629 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataVehicleVO.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataVehicleVO.java @@ -32,6 +32,10 @@ import lombok.EqualsAndHashCode; @EqualsAndHashCode(callSuper = true) public class BasicdataVehicleVO extends BasicdataVehicleEntity { private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "历史照片") private String historicPhotos; + + @ApiModelProperty(value = "车辆所属") + private String vehicleOwners; } diff --git a/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/PanPackageInfo.java b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/PanPackageInfo.java index 88db3c06a..6f6781d30 100644 --- a/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/PanPackageInfo.java +++ b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/PanPackageInfo.java @@ -66,4 +66,7 @@ public class PanPackageInfo extends BaseEntity { @ApiModelProperty(value = "直发标识") private String directSignage; + @ApiModelProperty(value = "是否补发") + private Integer reissueStatus; + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java index 3f5115bca..d7966ae33 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java @@ -17,6 +17,9 @@ package com.logpm.basicdata.controller; import com.logpm.basicdata.dto.BasicdataDriverArteryDTO; +import com.logpm.basicdata.entity.BasicdataVehicleEntity; +import com.logpm.basicdata.service.IBasicdataVehicleService; +import com.logpm.basicdata.vo.BasicdataVehicleVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -59,6 +62,8 @@ public class BasicdataDriverArteryController extends BladeController { private final IBasicdataDriverArteryService basicdataDriverArteryService; + private final IBasicdataVehicleService basicdataVehicleService; + /** * 司机信息表 详情 */ @@ -91,14 +96,30 @@ public class BasicdataDriverArteryController extends BladeController { return R.data(pages); } + /** + * 司机信息表 字典 + */ + @GetMapping("/dictionary") + @ApiOperationSupport(order = 10) + @ApiOperation(value = "司机信息表",notes = "传入code") + public R> dictionary() { + List dictionary = basicdataDriverArteryService.selectBasicdataDriverArteryDictionary(); + return R.data(dictionary); + } + /** * 司机信息表 新增 */ @PostMapping("/save") @ApiOperationSupport(order = 4) @ApiOperation(value = "新增", notes = "传入basicdataDriverArtery") - public R save(@Valid @RequestBody BasicdataDriverArteryEntity basicdataDriverArtery) { - return R.status(basicdataDriverArteryService.save(basicdataDriverArtery)); + public R save(@Valid @RequestBody BasicdataDriverArteryDTO basicdataDriverArtery) { + boolean save = basicdataDriverArteryService.save(basicdataDriverArtery); + //加入关联表 + if (null !=basicdataDriverArtery.getBindVehicles() && save){ + Integer b = basicdataDriverArteryService.updateVehicle(basicdataDriverArtery); + } + return R.status(save); } /** @@ -107,7 +128,11 @@ public class BasicdataDriverArteryController extends BladeController { @PostMapping("/update") @ApiOperationSupport(order = 5) @ApiOperation(value = "修改", notes = "传入basicdataDriverArtery") - public R update(@Valid @RequestBody BasicdataDriverArteryEntity basicdataDriverArtery) { + public R update(@Valid @RequestBody BasicdataDriverArteryDTO basicdataDriverArtery) { + //加入关联表 + if (null !=basicdataDriverArtery.getBindVehicles()){ + Integer b = basicdataDriverArteryService.updateVehicle(basicdataDriverArtery); + } return R.status(basicdataDriverArteryService.updateById(basicdataDriverArtery)); } @@ -117,7 +142,8 @@ public class BasicdataDriverArteryController extends BladeController { @PostMapping("/submit") @ApiOperationSupport(order = 6) @ApiOperation(value = "新增或修改", notes = "传入basicdataDriverArtery") - public R submit(@Valid @RequestBody BasicdataDriverArteryEntity basicdataDriverArtery) { + public R submit(@Valid @RequestBody BasicdataDriverArteryDTO basicdataDriverArtery) { + return R.status(basicdataDriverArteryService.saveOrUpdate(basicdataDriverArtery)); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDrivermiddleController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDrivermiddleController.java new file mode 100644 index 000000000..963d80365 --- /dev/null +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDrivermiddleController.java @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basicdata.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.springblade.core.secure.BladeUser; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity; +import com.logpm.basicdata.vo.BasicdataDrivermiddleVO; +import com.logpm.basicdata.excel.BasicdataDrivermiddleExcel; +import com.logpm.basicdata.service.IBasicdataDrivermiddleService; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.excel.util.ExcelUtil; +import org.springblade.core.tool.constant.BladeConstant; +import springfox.documentation.annotations.ApiIgnore; +import java.util.Map; +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +/** + * 司机中间表 控制器 + * + * @author lmy + * @since 2023-06-26 + */ +@RestController +@AllArgsConstructor +@RequestMapping("drivermiddle/basicdataDrivermiddle") +@Api(value = "司机中间表", tags = "司机中间表接口") +public class BasicdataDrivermiddleController extends BladeController { + + private final IBasicdataDrivermiddleService basicdataDrivermiddleService; + + /** + * 司机中间表 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入basicdataDrivermiddle") + public R detail(BasicdataDrivermiddleEntity basicdataDrivermiddle) { + BasicdataDrivermiddleEntity detail = basicdataDrivermiddleService.getOne(Condition.getQueryWrapper(basicdataDrivermiddle)); + return R.data(detail); + } + /** + * 司机中间表 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入basicdataDrivermiddle") + public R> list(@ApiIgnore @RequestParam Map basicdataDrivermiddle, Query query) { + IPage pages = basicdataDrivermiddleService.page(Condition.getPage(query), Condition.getQueryWrapper(basicdataDrivermiddle, BasicdataDrivermiddleEntity.class)); + return R.data(pages); + } + + /** + * 司机中间表 自定义分页 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入basicdataDrivermiddle") + public R> page(BasicdataDrivermiddleVO basicdataDrivermiddle, Query query) { + IPage pages = basicdataDrivermiddleService.selectBasicdataDrivermiddlePage(Condition.getPage(query), basicdataDrivermiddle); + return R.data(pages); + } + + /** + * 司机中间表 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入basicdataDrivermiddle") + public R save(@Valid @RequestBody BasicdataDrivermiddleEntity basicdataDrivermiddle) { + return R.status(basicdataDrivermiddleService.save(basicdataDrivermiddle)); + } + + /** + * 司机中间表 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入basicdataDrivermiddle") + public R update(@Valid @RequestBody BasicdataDrivermiddleEntity basicdataDrivermiddle) { + return R.status(basicdataDrivermiddleService.updateById(basicdataDrivermiddle)); + } + + /** + * 司机中间表 新增或修改 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入basicdataDrivermiddle") + public R submit(@Valid @RequestBody BasicdataDrivermiddleEntity basicdataDrivermiddle) { + return R.status(basicdataDrivermiddleService.saveOrUpdate(basicdataDrivermiddle)); + } + + /** + * 司机中间表 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(basicdataDrivermiddleService.deleteLogic(Func.toLongList(ids))); + } + + + /** + * 导出数据 + */ + @GetMapping("/export-basicdataDrivermiddle") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "导出数据", notes = "传入basicdataDrivermiddle") + public void exportBasicdataDrivermiddle(@ApiIgnore @RequestParam Map basicdataDrivermiddle, BladeUser bladeUser, HttpServletResponse response) { + QueryWrapper queryWrapper = Condition.getQueryWrapper(basicdataDrivermiddle, BasicdataDrivermiddleEntity.class); + //if (!AuthUtil.isAdministrator()) { + // queryWrapper.lambda().eq(BasicdataDrivermiddle::getTenantId, bladeUser.getTenantId()); + //} + queryWrapper.lambda().eq(BasicdataDrivermiddleEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); + List list = basicdataDrivermiddleService.exportBasicdataDrivermiddle(queryWrapper); + ExcelUtil.export(response, "司机中间表数据" + DateUtil.time(), "司机中间表数据表", list, BasicdataDrivermiddleExcel.class); + } + +} diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehicleController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehicleController.java index 0a48c4276..4cb405cb5 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehicleController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehicleController.java @@ -20,7 +20,9 @@ import com.alibaba.nacos.common.utils.StringUtils; import com.logpm.basicdata.dto.BasicdataVehicleDTO; import com.logpm.basicdata.dto.BasicdataVehiclePhotoDTO; import com.logpm.basicdata.entity.BasicdataVehiclePhotoEntity; +import com.logpm.basicdata.service.IBasicdataDriverArteryService; import com.logpm.basicdata.service.IBasicdataVehiclePhotoService; +import com.logpm.basicdata.vo.BasicdataCarrierVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -69,6 +71,8 @@ public class BasicdataVehicleController extends BladeController { private final IBasicdataVehiclePhotoService basicdataVehiclePhotoService; + private final IBasicdataDriverArteryService basicdataDriverArteryService; + /** * 车辆信息表 详情 @@ -108,6 +112,17 @@ public class BasicdataVehicleController extends BladeController { return R.data(pages); } + /** + * 车辆信息表 字典 + */ + @GetMapping("/dictionary") + @ApiOperationSupport(order = 10) + @ApiOperation(value = "车辆信息表",notes = "传入code") + public R> dictionary() { + List dictionary = basicdataVehicleService.selectBasicdataVehicleDictionary(); + return R.data(dictionary); + } + /** * 车辆信息表 新增 */ @@ -115,7 +130,12 @@ public class BasicdataVehicleController extends BladeController { @ApiOperationSupport(order = 4) @ApiOperation(value = "新增", notes = "传入basicdataVehicle") public R save(@Valid @RequestBody BasicdataVehicleDTO basicdataVehicle) { - return R.status(basicdataVehicleService.save(basicdataVehicle)); + boolean save = basicdataVehicleService.save(basicdataVehicle); + //加入关联表 + if (null !=basicdataVehicle.getVehicleOwners() && save){ + Integer b = basicdataVehicleService.updateOwners(basicdataVehicle); + } + return R.status(save); } /** @@ -134,6 +154,10 @@ public class BasicdataVehicleController extends BladeController { //添加历史照片 basicdataVehiclePhotoService.save(basicdataVehiclePhoto); } + //加入关联表 + if (null !=basicdataVehicle.getVehicleOwners()){ + Integer b = basicdataVehicleService.updateOwners(basicdataVehicle); + } return R.status(basicdataVehicleService.updateById(basicdataVehicle)); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataDriverArteryDTO.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataDriverArteryDTO.java index 8287881ab..0c72bc65a 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataDriverArteryDTO.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataDriverArteryDTO.java @@ -17,6 +17,7 @@ package com.logpm.basicdata.dto; import com.logpm.basicdata.entity.BasicdataDriverArteryEntity; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -30,5 +31,9 @@ import lombok.EqualsAndHashCode; @EqualsAndHashCode(callSuper = true) public class BasicdataDriverArteryDTO extends BasicdataDriverArteryEntity { private static final long serialVersionUID = 1L; - + /** + * 车辆信息 + */ + @ApiModelProperty(value = "车辆信息") + private String bindVehicles; } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataDrivermiddleDTO.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataDrivermiddleDTO.java new file mode 100644 index 000000000..11de75396 --- /dev/null +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataDrivermiddleDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basicdata.dto; + +import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 司机中间表 数据传输对象实体类 + * + * @author lmy + * @since 2023-06-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class BasicdataDrivermiddleDTO extends BasicdataDrivermiddleEntity { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataVehicleDTO.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataVehicleDTO.java index 81397de57..b44dc7833 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataVehicleDTO.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataVehicleDTO.java @@ -17,6 +17,7 @@ package com.logpm.basicdata.dto; import com.logpm.basicdata.entity.BasicdataVehicleEntity; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -31,4 +32,7 @@ import lombok.EqualsAndHashCode; public class BasicdataVehicleDTO extends BasicdataVehicleEntity { private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "车辆所属") + private String vehicleOwners; + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataDrivermiddleExcel.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataDrivermiddleExcel.java new file mode 100644 index 000000000..5cd87704d --- /dev/null +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataDrivermiddleExcel.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basicdata.excel; + + +import lombok.Data; + +import java.util.Date; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.ContentRowHeight; +import com.alibaba.excel.annotation.write.style.HeadRowHeight; +import java.io.Serializable; + + +/** + * 司机中间表 Excel实体类 + * + * @author lmy + * @since 2023-06-26 + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class BasicdataDrivermiddleExcel implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 租户号 + */ + @ColumnWidth(20) + @ExcelProperty("租户号") + private String tenantId; + /** + * 是否已删除 + */ + @ColumnWidth(20) + @ExcelProperty("是否已删除") + private Integer isDeleted; + /** + * 预留1 + */ + @ColumnWidth(20) + @ExcelProperty("预留1") + private String reserve1; + /** + * 预留2 + */ + @ColumnWidth(20) + @ExcelProperty("预留2") + private String reserve2; + /** + * 预留3 + */ + @ColumnWidth(20) + @ExcelProperty("预留3") + private String reserve3; + /** + * 预留4 + */ + @ColumnWidth(20) + @ExcelProperty("预留4") + private String reserve4; + /** + * 预留5 + */ + @ColumnWidth(20) + @ExcelProperty("预留5") + private String reserve5; + /** + * 司机表ID + */ + @ColumnWidth(20) + @ExcelProperty("司机表ID") + private Long driverId; + /** + * 车辆表ID + */ + @ColumnWidth(20) + @ExcelProperty("车辆表ID") + private Long brandId; + /** + * zhufuztai + */ + @ColumnWidth(20) + @ExcelProperty("zhufuztai") + private String state; + +} diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataDrivermiddleClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataDrivermiddleClient.java new file mode 100644 index 000000000..fb1f3614b --- /dev/null +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataDrivermiddleClient.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basicdata.feign; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.AllArgsConstructor; +import org.springblade.core.mp.support.BladePage; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity; +import com.logpm.basicdata.service.IBasicdataDrivermiddleService; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +/** + * 司机中间表 Feign实现类 + * + * @author lmy + * @since 2023-06-26 + */ +@ApiIgnore() +@RestController +@AllArgsConstructor +public class BasicdataDrivermiddleClient implements IBasicdataDrivermiddleClient { + + private final IBasicdataDrivermiddleService basicdataDrivermiddleService; + + @Override + @GetMapping(TOP) + public BladePage top(Integer current, Integer size) { + Query query = new Query(); + query.setCurrent(current); + query.setSize(size); + IPage page = basicdataDrivermiddleService.page(Condition.getPage(query)); + return BladePage.of(page); + } + +} diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.java index b0393068a..c94589fe6 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.java @@ -51,5 +51,10 @@ public interface BasicdataDriverArteryMapper extends BaseMapper exportBasicdataDriverArtery(@Param("ew") Wrapper queryWrapper); - + /** + * 查询司机字典 + * + * @return + */ + List selectBasicdataDictionary(); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.xml index 478513d8f..28e758ce6 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.xml @@ -50,45 +50,44 @@ @@ -109,5 +108,8 @@ + diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDrivermiddleMapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDrivermiddleMapper.java new file mode 100644 index 000000000..325f47d03 --- /dev/null +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDrivermiddleMapper.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basicdata.mapper; + +import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity; +import com.logpm.basicdata.vo.BasicdataDrivermiddleVO; +import com.logpm.basicdata.excel.BasicdataDrivermiddleExcel; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; +import java.util.List; + +/** + * 司机中间表 Mapper 接口 + * + * @author lmy + * @since 2023-06-26 + */ +public interface BasicdataDrivermiddleMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param basicdataDrivermiddle + * @return + */ + List selectBasicdataDrivermiddlePage(IPage page, BasicdataDrivermiddleVO basicdataDrivermiddle); + + + /** + * 获取导出数据 + * + * @param queryWrapper + * @return + */ + List exportBasicdataDrivermiddle(@Param("ew") Wrapper queryWrapper); + +} diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDrivermiddleMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDrivermiddleMapper.xml new file mode 100644 index 000000000..86171eab1 --- /dev/null +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDrivermiddleMapper.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java index a99fe774e..fa30b18de 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java @@ -18,6 +18,7 @@ package com.logpm.basicdata.mapper; import com.logpm.basicdata.dto.BasicdataVehicleDTO; import com.logpm.basicdata.entity.BasicdataVehicleEntity; +import com.logpm.basicdata.vo.BasicdataCarrierVO; import com.logpm.basicdata.vo.BasicdataVehicleVO; import com.logpm.basicdata.excel.BasicdataVehicleExcel; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -53,4 +54,10 @@ public interface BasicdataVehicleMapper extends BaseMapper exportBasicdataVehicle(@Param("ew") Wrapper queryWrapper); List selectPhotoBymasterId(Long id); + /** + * 查询车辆字典 + * + * @return + */ + List selectBasicdataDictionary(); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml index 0d408f0e8..0e1ae2521 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml @@ -140,7 +140,8 @@ ORDER BY lbvp.create_time LIMIT 3 - ) historicPhotos + ) historicPhotos, + (SELECT GROUP_CONCAT(driver_id SEPARATOR ',') from logpm_basicdata_drivermiddle lbd WHERE lbd.brand_id = lbv.id and lbd.is_deleted = 0) vehicleOwners FROM logpm_basicdata_vehicle lbv @@ -172,5 +173,8 @@ lbvp.create_time LIMIT 3 + diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataDriverArteryService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataDriverArteryService.java index 3db438699..fcc4cf563 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataDriverArteryService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataDriverArteryService.java @@ -49,5 +49,15 @@ public interface IBasicdataDriverArteryService extends BaseService exportBasicdataDriverArtery(Wrapper queryWrapper); - + /** + * 修改 + * + * @param basicdataDriverArtery + * @return + */ + Integer updateVehicle(BasicdataDriverArteryDTO basicdataDriverArtery); + /** + * 司机信息表 字典 + */ + List selectBasicdataDriverArteryDictionary(); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataDrivermiddleService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataDrivermiddleService.java new file mode 100644 index 000000000..26ef45c8a --- /dev/null +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataDrivermiddleService.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basicdata.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity; +import com.logpm.basicdata.vo.BasicdataDrivermiddleVO; +import com.logpm.basicdata.excel.BasicdataDrivermiddleExcel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import java.util.List; + +/** + * 司机中间表 服务类 + * + * @author lmy + * @since 2023-06-26 + */ +public interface IBasicdataDrivermiddleService extends BaseService { + /** + * 自定义分页 + * + * @param page + * @param basicdataDrivermiddle + * @return + */ + IPage selectBasicdataDrivermiddlePage(IPage page, BasicdataDrivermiddleVO basicdataDrivermiddle); + + + /** + * 导出数据 + * + * @param queryWrapper + * @return + */ + List exportBasicdataDrivermiddle(Wrapper queryWrapper); + +} diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataVehicleService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataVehicleService.java index 5df7b1320..ce2dcab99 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataVehicleService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataVehicleService.java @@ -19,6 +19,7 @@ package com.logpm.basicdata.service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.logpm.basicdata.dto.BasicdataVehicleDTO; import com.logpm.basicdata.entity.BasicdataVehicleEntity; +import com.logpm.basicdata.vo.BasicdataCarrierVO; import com.logpm.basicdata.vo.BasicdataVehicleVO; import com.logpm.basicdata.excel.BasicdataVehicleExcel; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -61,4 +62,12 @@ public interface IBasicdataVehicleService extends BaseService selectBasicdataVehicleDictionary(); + /** + * 新增关联表 + */ + Integer updateOwners(BasicdataVehicleDTO basicdataVehicle); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java index a09677c16..488bc8db9 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java @@ -16,16 +16,25 @@ */ package com.logpm.basicdata.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.logpm.basicdata.dto.BasicdataDriverArteryDTO; import com.logpm.basicdata.entity.BasicdataDriverArteryEntity; +import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity; +import com.logpm.basicdata.entity.BasicdataVehicleEntity; +import com.logpm.basicdata.mapper.BasicdataDrivermiddleMapper; +import com.logpm.basicdata.mapper.BasicdataVehicleMapper; import com.logpm.basicdata.vo.BasicdataDriverArteryVO; import com.logpm.basicdata.excel.BasicdataDriverArteryExcel; import com.logpm.basicdata.mapper.BasicdataDriverArteryMapper; import com.logpm.basicdata.service.IBasicdataDriverArteryService; +import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.core.mp.base.BaseServiceImpl; + +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; /** @@ -35,8 +44,14 @@ import java.util.List; * @since 2023-05-15 */ @Service +@AllArgsConstructor public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl implements IBasicdataDriverArteryService { + private final BasicdataVehicleMapper basicdataVehicleMapper; + + private final BasicdataDrivermiddleMapper basicdataDrivermiddleMapper; + + private final BasicdataDrivermiddleServiceImpl basicdataDrivermiddleService; @Override public IPage selectBasicdataDriverArteryPage(IPage page, BasicdataDriverArteryDTO basicdataDriverArtery) { return page.setRecords(baseMapper.selectBasicdataDriverArteryPage(page, basicdataDriverArtery)); @@ -52,4 +67,28 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl().lambda().eq(BasicdataDrivermiddleEntity::getDriverId, basicdataDriverArtery.getId())); + //新增现有的数据 + if (delete>0){ + List bindVehicles = Arrays.asList(basicdataDriverArtery.getBindVehicles().split(",")); + ArrayList basicdataDrivermiddleEntities = new ArrayList<>(); + bindVehicles.forEach(e->{ + BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity(); + basicdataDrivermiddleEntity.setDriverId(basicdataDriverArtery.getId()); + basicdataDrivermiddleEntity.setBrandId(Long.valueOf(e)); + basicdataDrivermiddleEntities.add(basicdataDrivermiddleEntity); + }); + basicdataDrivermiddleService.saveBatch(basicdataDrivermiddleEntities); + } + return delete; + } + + @Override + public List selectBasicdataDriverArteryDictionary() { + return baseMapper.selectBasicdataDictionary(); + } + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDrivermiddleServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDrivermiddleServiceImpl.java new file mode 100644 index 000000000..ac00dbd42 --- /dev/null +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDrivermiddleServiceImpl.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basicdata.service.impl; + +import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity; +import com.logpm.basicdata.vo.BasicdataDrivermiddleVO; +import com.logpm.basicdata.excel.BasicdataDrivermiddleExcel; +import com.logpm.basicdata.mapper.BasicdataDrivermiddleMapper; +import com.logpm.basicdata.service.IBasicdataDrivermiddleService; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseServiceImpl; +import java.util.List; + +/** + * 司机中间表 服务实现类 + * + * @author lmy + * @since 2023-06-26 + */ +@Service +public class BasicdataDrivermiddleServiceImpl extends BaseServiceImpl implements IBasicdataDrivermiddleService { + + @Override + public IPage selectBasicdataDrivermiddlePage(IPage page, BasicdataDrivermiddleVO basicdataDrivermiddle) { + return page.setRecords(baseMapper.selectBasicdataDrivermiddlePage(page, basicdataDrivermiddle)); + } + + + @Override + public List exportBasicdataDrivermiddle(Wrapper queryWrapper) { + List basicdataDrivermiddleList = baseMapper.exportBasicdataDrivermiddle(queryWrapper); + //basicdataDrivermiddleList.forEach(basicdataDrivermiddle -> { + // basicdataDrivermiddle.setTypeName(DictCache.getValue(DictEnum.YES_NO, BasicdataDrivermiddle.getType())); + //}); + return basicdataDrivermiddleList; + } + +} diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java index d657bbbe9..e85cea080 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java @@ -16,16 +16,24 @@ */ package com.logpm.basicdata.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.logpm.basicdata.dto.BasicdataVehicleDTO; +import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity; import com.logpm.basicdata.entity.BasicdataVehicleEntity; +import com.logpm.basicdata.mapper.BasicdataDrivermiddleMapper; +import com.logpm.basicdata.vo.BasicdataCarrierVO; import com.logpm.basicdata.vo.BasicdataVehicleVO; import com.logpm.basicdata.excel.BasicdataVehicleExcel; import com.logpm.basicdata.mapper.BasicdataVehicleMapper; import com.logpm.basicdata.service.IBasicdataVehicleService; +import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.core.mp.base.BaseServiceImpl; + +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; /** @@ -35,8 +43,12 @@ import java.util.List; * @since 2023-05-16 */ @Service +@AllArgsConstructor public class BasicdataVehicleServiceImpl extends BaseServiceImpl implements IBasicdataVehicleService { + private final BasicdataDrivermiddleMapper basicdataDrivermiddleMapper; + + private final BasicdataDrivermiddleServiceImpl basicdataDrivermiddleService; @Override public IPage selectBasicdataVehiclePage(IPage page, BasicdataVehicleDTO basicdataVehicle) { return page.setRecords(baseMapper.selectBasicdataVehiclePage(page, basicdataVehicle)); @@ -62,4 +74,28 @@ public class BasicdataVehicleServiceImpl extends BaseServiceImpl selectBasicdataVehicleDictionary() { + return baseMapper.selectBasicdataDictionary(); + } + + @Override + public Integer updateOwners(BasicdataVehicleDTO basicdataVehicle) { + //删除原有绑定关系 + int delete = basicdataDrivermiddleMapper.delete(new QueryWrapper().lambda().eq(BasicdataDrivermiddleEntity::getBrandId, basicdataVehicle.getId())); + //新增现有的数据 + if (delete>0){ + List bindOwners = Arrays.asList(basicdataVehicle.getVehicleOwners().split(",")); + ArrayList basicdataDrivermiddleEntities = new ArrayList<>(); + bindOwners.forEach(e->{ + BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity(); + basicdataDrivermiddleEntity.setBrandId(basicdataVehicle.getId()); + basicdataDrivermiddleEntity.setDriverId(Long.valueOf(e)); + basicdataDrivermiddleEntities.add(basicdataDrivermiddleEntity); + }); + basicdataDrivermiddleService.saveBatch(basicdataDrivermiddleEntities); + } + return delete; + } + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/wrapper/BasicdataDriverArteryWrapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/wrapper/BasicdataDriverArteryWrapper.java new file mode 100644 index 000000000..41cc563bc --- /dev/null +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/wrapper/BasicdataDriverArteryWrapper.java @@ -0,0 +1,26 @@ +package com.logpm.basicdata.wrapper; + +import com.logpm.basicdata.entity.BasicdataBrandEntity; +import com.logpm.basicdata.entity.BasicdataDriverArteryEntity; +import com.logpm.basicdata.vo.BasicdataBrandVO; +import com.logpm.basicdata.vo.BasicdataDriverArteryVO; +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springframework.stereotype.Component; + +import java.util.Objects; + +@Component +public class BasicdataDriverArteryWrapper extends BaseEntityWrapper { + + + + @Override + public BasicdataDriverArteryVO entityVO(BasicdataDriverArteryEntity entity) { + BasicdataDriverArteryVO stationlinenumVO = Objects.requireNonNull(BeanUtil.copy(entity, BasicdataDriverArteryVO.class)); + + // + + return stationlinenumVO; + } +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java index 25e7fd80a..66a19ef66 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java @@ -22,6 +22,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.logpm.factory.comfac.service.IAsyncDataService; import com.logpm.factory.comfac.service.IOrderStatusLogService; import com.logpm.factory.pan.dto.PanFactoryOrderDTO; +import com.logpm.factory.pan.dto.PanPackageInfoDTO; import com.logpm.factory.pan.service.IPanFactoryDataService; import com.logpm.factory.pan.service.IPanFactoryOrderService; import com.logpm.factory.pan.service.IPanPackageInfoService; @@ -29,6 +30,7 @@ import com.logpm.factory.pan.service.IPanPackageListService; import com.logpm.factory.snm.bean.Resp; import com.logpm.factory.snm.entity.OrderStatusLog; import com.logpm.factory.snm.entity.PanFactoryOrder; +import com.logpm.factory.snm.entity.PanPackageInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; @@ -39,6 +41,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; +import java.util.List; import java.util.Objects; /** @@ -116,8 +119,24 @@ public class PanFactoryDataController extends BladeController { queryWrapper.eq("order_no",orderNo); PanFactoryOrder one = factoryOrderService.getOne(queryWrapper); if(!Objects.isNull(one)){ - log.warn("############data: 订单数据已存在 orderNo={}",orderNo); - return Resp.fail(400,"订单数据已存在"); +// log.warn("############data: 订单数据已存在 orderNo={}",orderNo); +// return Resp.fail(400,"订单数据已存在"); + //如果订单已存在就去验证订单下面的包件信息 + List order_attributes = factoryOrderDTO.getORDER_ATTRIBUTES(); + QueryWrapper qw = new QueryWrapper<>(); + qw.eq("order_no",orderNo); + List list = packageInfoService.list(qw); + for(PanPackageInfo panPackageInfo:list){ + String unitNo = panPackageInfo.getUnitNo(); + for(int i = 0; i qw = new QueryWrapper<>(); + qw.eq("order_no",factoryOrderDTO.getOrderNo()); + //先查询订单是否存在 + PanFactoryOrder factoryOrder = factoryOrderService.getOne(qw); + boolean flag = false; + if(Objects.isNull(factoryOrder)){ + factoryOrder = new PanFactoryOrder(); + BeanUtil.copyProperties(factoryOrderDTO,factoryOrder); + //保存订单数据 + factoryOrderService.save(factoryOrder); + }else{ + flag = true; + } + +// PanFactoryOrder factoryOrder = new PanFactoryOrder(); +// BeanUtil.copyProperties(factoryOrderDTO,factoryOrder); +// //保存订单数据 +// factoryOrderService.save(factoryOrder); List packageInfos = factoryOrderDTO.getORDER_ATTRIBUTES(); List panPackageInfos = new ArrayList<>(); @@ -383,7 +398,13 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { PanPackageInfo packageInfo = new PanPackageInfo(); BeanUtil.copyProperties(dto,packageInfo); packageInfo.setOrderId(factoryOrder.getId()); + if(flag){ + packageInfo.setReissueStatus(1); + }else{ + packageInfo.setReissueStatus(0); + } panPackageInfos.add(packageInfo); + //保存包件信息数据 //因为需要先保存包件明细需要包件的id // packageInfoService.save(packageInfo); diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OpenOrderHandler.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OpenOrderHandler.java index c7a13872b..e1d135768 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OpenOrderHandler.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OpenOrderHandler.java @@ -55,6 +55,7 @@ public class OpenOrderHandler { if(Objects.isNull(advanceEntity)){ log.info("##################openOrderStatusHandler: 未找到对应订单 orderNo={}",orderNo); channel.basicAck(deliveryTag,true); + return; } String type = advanceEntity.getType();//品牌 diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OrderStatusHandler.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OrderStatusHandler.java index c56fa6748..c91019eb3 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OrderStatusHandler.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OrderStatusHandler.java @@ -55,6 +55,7 @@ public class OrderStatusHandler { if(Objects.isNull(advanceEntity)){ log.info("##################orderStatusHandler: 未找到对应订单 orderNo={}",orderNo); channel.basicAck(deliveryTag,true); + return; } String type = advanceEntity.getType();//品牌 diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/ReceiveInfoHandler.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/ReceiveInfoHandler.java index 11d11a30f..4c3237ff4 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/ReceiveInfoHandler.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/ReceiveInfoHandler.java @@ -59,6 +59,7 @@ public class ReceiveInfoHandler { if(Objects.isNull(advanceEntity)){ log.info("##################receiveInfoHandler: 未找到对应订单 orderCode={}",orderCode); channel.basicAck(deliveryTag,true); + return; } String type = advanceEntity.getType();//品牌