From a23cadaf6a51156571e7570d415bdfaa84af2f1c Mon Sep 17 00:00:00 2001 From: PQZ Date: Wed, 13 Nov 2024 09:49:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=91=E6=8F=B4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/CustomerMainController.java | 21 ++--- .../custom/service/CustomerCarService.java | 12 +++ .../service/impl/CustomerCarServiceImpl.java | 88 ++++++++++++++++++- .../custom/vo/CustomerMainSaveReqVO.java | 8 +- 4 files changed, 112 insertions(+), 17 deletions(-) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerMainController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerMainController.java index 3bba72f7..252a7cd8 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerMainController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerMainController.java @@ -1,12 +1,8 @@ package cn.iocoder.yudao.module.custom.controller.admin; -import cn.hutool.http.HttpRequest; -import cn.hutool.http.HttpResponse; -import cn.hutool.http.HttpUtil; -import cn.hutool.json.JSONObject; -import cn.hutool.json.JSONUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.custom.entity.CustomerMain; +import cn.iocoder.yudao.module.custom.service.CustomerCarService; import cn.iocoder.yudao.module.custom.service.CustomerMainService; import cn.iocoder.yudao.module.custom.vo.CustomerMainPageReqVO; import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO; @@ -23,11 +19,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import javax.net.ssl.HttpsURLConnection; import javax.validation.Valid; - -import java.net.HttpURLConnection; -import java.net.URL; import java.util.List; import static cn.iocoder.yudao.common.BaseConstants.*; @@ -48,7 +40,8 @@ public class CustomerMainController { private CustomerMainService customerMainService; @Resource private BusiLabelService busiLabelService; - + @Resource + private CustomerCarService customerCarService; /** * 客户管理分页列表查询 * @@ -85,6 +78,14 @@ public class CustomerMainController { return success(true); } + + @PostMapping("/saveCustomerAndCar") + @Operation(summary = "保存客户及车辆信息") + public CommonResult saveCustomerAndCar(@RequestBody CustomerMainSaveReqVO saveReqVO) throws Exception { + customerCarService.saveCustomerAndCar(saveReqVO); + return success(true); + } + /** * 编辑客户 * diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CustomerCarService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CustomerCarService.java index 218231f8..75b63847 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CustomerCarService.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CustomerCarService.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.custom.service; import cn.iocoder.yudao.module.custom.entity.CustomerCar; +import cn.iocoder.yudao.module.custom.vo.CustomerMainSaveReqVO; import com.baomidou.mybatisplus.extension.service.IService; import java.util.List; @@ -23,4 +24,15 @@ public interface CustomerCarService extends IService { * @date 18:45 2024/8/3 **/ void bindCustomerCar(String mainId, String mainTable, List customerCars); + + + + /** + * 保存客户及车辆信息 + * @author PQZ + * @date 15:51 2024/11/12 + * @param saveReqVO CustomerMainSaveReqVO + * @return void + **/ + void saveCustomerAndCar(CustomerMainSaveReqVO saveReqVO) throws Exception; } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCarServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCarServiceImpl.java index 015b7c9b..5484f799 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCarServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCarServiceImpl.java @@ -1,19 +1,32 @@ package cn.iocoder.yudao.module.custom.service.impl; import cn.hutool.core.util.ObjectUtil; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; 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.CustomerMain; import cn.iocoder.yudao.module.custom.mapper.CustomerCarMapper; +import cn.iocoder.yudao.module.custom.service.CarMainService; import cn.iocoder.yudao.module.custom.service.CustomerCarService; +import cn.iocoder.yudao.module.custom.service.CustomerMainService; +import cn.iocoder.yudao.module.custom.vo.CustomerMainSaveReqVO; +import cn.iocoder.yudao.module.system.api.user.AdminUserApi; +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; +import cn.iocoder.yudao.module.system.api.user.dto.UserDTO; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; +import javax.annotation.Resource; import java.util.List; -import static cn.iocoder.yudao.common.BaseConstants.CUS_SIGN_CAR; -import static cn.iocoder.yudao.common.BaseConstants.CUS_SIGN_CUSTOMER; +import static cn.iocoder.yudao.common.BaseConstants.*; +import static cn.iocoder.yudao.framework.common.config.CommonStr.USER_TYPE_CUS; /** * 客户车辆管理关联 @@ -24,6 +37,15 @@ import static cn.iocoder.yudao.common.BaseConstants.CUS_SIGN_CUSTOMER; @Validated public class CustomerCarServiceImpl extends ServiceImpl implements CustomerCarService { + @Resource + @Lazy + private CustomerMainService customerMainService; + @Resource + @Lazy + private CarMainService carMainService; + @Resource + @Lazy + private AdminUserApi adminUserApi; /** * 保存客户与车辆的关联关系 @@ -60,4 +82,66 @@ public class CustomerCarServiceImpl extends ServiceImpl carList; /**标签信息*/ List labelList; - - /** - * 微信openId - */ - private String openId; + /**客户车辆信息*/ + private CarMain car; } \ No newline at end of file