diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarMainController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarMainController.java index 4010dcdb..28d76fe4 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarMainController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarMainController.java @@ -5,7 +5,9 @@ import cn.iocoder.yudao.module.custom.service.CarMainService; import cn.iocoder.yudao.module.custom.vo.CarMainReqVO; import cn.iocoder.yudao.module.custom.vo.CarMainRespVO; import cn.iocoder.yudao.module.custom.vo.CustomerMainSaveReqVO; +import cn.iocoder.yudao.module.label.service.BusiLabelService; import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -16,8 +18,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import javax.validation.*; import javax.servlet.http.*; +import javax.validation.Valid; import java.util.*; import java.io.IOException; @@ -25,6 +27,8 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import static cn.iocoder.yudao.common.BaseConstants.TABLE_BASE_CAR_MAIN; +import static cn.iocoder.yudao.common.BaseConstants.TABLE_BASE_CUSTOMER_MAIN; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; @@ -40,9 +44,12 @@ import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; @Validated public class CarMainController { - @Resource + @Autowired private CarMainService carMainService; + @Autowired + private BusiLabelService busiLabelService; + /** * 创建车辆信息 * @@ -141,9 +148,24 @@ public class CarMainController { @PostMapping("/bindCustomerCar") @Operation(summary = "绑定用户") @PreAuthorize("@ss.hasPermission('base:car-main:bindCustomer')") - public CommonResult bindCustomerCar(@RequestBody CustomerMainSaveReqVO saveReqVO) { + public CommonResult bindCustomerCar(@RequestBody CarMainReqVO saveReqVO) { carMainService.bindCustomAndCar(saveReqVO); return success(true); } + /** + * 设置标签 + * + * @param saveReqVO CustomerMainSaveReqVO + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + * @author PQZ + * @date 16:35 2024/8/6 + **/ + @PostMapping("/setLabel") + @Operation(summary = "设置标签") + public CommonResult setLabel(@RequestBody CarMainReqVO saveReqVO) { + busiLabelService.saveBusiLable(saveReqVO.getId(), TABLE_BASE_CAR_MAIN, saveReqVO.getLabelList()); + return success(true); + } + } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarMainService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarMainService.java index 8dbf9ec2..94c236db 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarMainService.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarMainService.java @@ -65,5 +65,5 @@ public interface CarMainService extends IService { * @param saveReqVO CustomerMainSaveReqVO实体 * @return void **/ - void bindCustomAndCar(CustomerMainSaveReqVO saveReqVO); + void bindCustomAndCar(CarMainReqVO saveReqVO); } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java index 2e801f00..a9cb88b1 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java @@ -1,14 +1,9 @@ package cn.iocoder.yudao.module.custom.service.impl; import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; -import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.module.custom.entity.CarMain; import cn.iocoder.yudao.module.custom.entity.CustomerCar; -import cn.iocoder.yudao.module.custom.entity.CustomerItem; -import cn.iocoder.yudao.module.custom.entity.CustomerMain; import cn.iocoder.yudao.module.custom.mapper.CarMainMapper; import cn.iocoder.yudao.module.custom.mapper.CustomerCarMapper; import cn.iocoder.yudao.module.custom.service.CarMainService; @@ -16,8 +11,8 @@ import cn.iocoder.yudao.module.custom.service.CustomerCarService; import cn.iocoder.yudao.module.custom.vo.CarMainReqVO; import cn.iocoder.yudao.module.custom.vo.CarMainRespVO; import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO; -import cn.iocoder.yudao.module.custom.vo.CustomerMainSaveReqVO; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import cn.iocoder.yudao.module.label.entity.BusiLabel; +import cn.iocoder.yudao.module.label.service.BusiLabelService; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -30,7 +25,6 @@ import java.util.ArrayList; import java.util.List; import static cn.iocoder.yudao.common.BaseConstants.CUS_SIGN_CAR; -import static cn.iocoder.yudao.common.BaseConstants.CUS_SIGN_CUSTOMER; /** * 车辆信息 Service 实现类 @@ -46,6 +40,10 @@ public class CarMainServiceImpl extends ServiceImpl impl @Autowired private CustomerCarService customerCarService; + @Autowired + private BusiLabelService busiLabelService; + + /** * 创建车辆信息 * @@ -128,6 +126,10 @@ public class CarMainServiceImpl extends ServiceImpl impl List cusList = customerCarMapper.selectCusListByCarId(id); result.setCusList(cusList); + //联查标签信息 + List labelList = busiLabelService.listByMainId(id); + result.setLabelList(labelList); + return result; } @@ -152,7 +154,7 @@ public class CarMainServiceImpl extends ServiceImpl impl * @return void **/ @Override - public void bindCustomAndCar(CustomerMainSaveReqVO saveReqVO) { + public void bindCustomAndCar(CarMainReqVO saveReqVO) { List customerCars = new ArrayList<>(); List cusList = saveReqVO.getCusList(); if (ObjectUtil.isNotEmpty(cusList)){ diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainReqVO.java index 95f2fc40..571f067b 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainReqVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainReqVO.java @@ -1,10 +1,12 @@ package cn.iocoder.yudao.module.custom.vo; +import cn.iocoder.yudao.module.label.entity.BusiLabel; import lombok.*; import io.swagger.v3.oas.annotations.media.Schema; import cn.iocoder.yudao.framework.common.pojo.PageParam; import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; +import java.util.List; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -78,4 +80,9 @@ public class CarMainReqVO extends PageParam { @Schema(description = "租户ID") private String tenantId; + @Schema(description = "车辆绑定客户信息") + private List cusList; + + @Schema(description = "车辆绑定标签信息") + List labelList; } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainRespVO.java index 49e46ca5..17a09474 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainRespVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainRespVO.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.custom.vo; import cn.iocoder.yudao.module.custom.entity.CarMain; import cn.iocoder.yudao.module.custom.entity.CustomerMain; +import cn.iocoder.yudao.module.label.entity.BusiLabel; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; @@ -25,9 +26,12 @@ public class CarMainRespVO extends CarMain { @Schema(description = "是否车主(0否1是)") private String isOwner; - @Schema(description = "创建时间") + @Schema(description = "关联客户信息") private List cusList; + @Schema(description = "标签信息") + List labelList; + diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CascaderOptionsVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CascaderOptionsVO.java new file mode 100644 index 00000000..4fa1f9e9 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CascaderOptionsVO.java @@ -0,0 +1,2 @@ +package cn.iocoder.yudao.module.custom.vo;public class CascaderOptionsVO { +} diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainSaveReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainSaveReqVO.java index 97efbd47..1989cd30 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainSaveReqVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainSaveReqVO.java @@ -16,8 +16,6 @@ public class CustomerMainSaveReqVO extends CustomerMain { private List itemList; /**客户绑定车辆信息*/ private List carList; - /**客户绑定车辆信息*/ - private List cusList; /**标签信息*/ List labelList;