瀏覽代碼

1.经销商app-我的页面-增加经销商用户信息详情接口
2.经销商app-我的页面-增加保存经销商用户经纬度接口

纪新园 1 周之前
父節點
當前提交
ebabe8ae6b

+ 10 - 1
blade-service-api/blade-u9cloud-api/src/main/java/org/springblade/u9cloud/feign/IZcrmViewCustomerSel.java

@@ -4,8 +4,10 @@ package org.springblade.u9cloud.feign;
 import org.springblade.core.tool.api.R;
 import org.springblade.u9cloud.entity.ZcrmViewCustomerSel;
 import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
 
 /**
  * 客户档案表 Feign接口类
@@ -21,6 +23,13 @@ public interface IZcrmViewCustomerSel {
 	 * 注意:路径需要与服务提供者的完整路径一致
 	 * 服务提供者的完整路径 = Controller的@RequestMapping + 方法的@PostMapping
 	 */
-	@PostMapping("/api/viewCustomerSel/TestZcrmViewCustomerSelAdd") // 这里需要包含Controller类上的路径前缀
+	@PostMapping("/api/viewCustomerSel/TestZcrmViewCustomerSelAdd")
+	// 这里需要包含Controller类上的路径前缀
 	R<String> u9cloudAdd(@RequestBody ZcrmViewCustomerSel zcrmViewCustomerSel);
+
+	/**
+	 * 客户详情接口
+	 */
+	@GetMapping("/api/viewCustomerSel/getCustomerSelDetail")
+	R<ZcrmViewCustomerSel> getCustomerSelDetail(@RequestParam("customerId") Long customerId);
 }

+ 11 - 0
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/User.java

@@ -153,4 +153,15 @@ public class User extends TenantEntity {
 	 */
 	private Long customerId;
 
+	/**
+	 * 经度
+	 */
+	@ApiModelProperty(value = "经度")
+	private String longitude;
+	/**
+	 * 维度
+	 */
+	@ApiModelProperty(value = "维度")
+	private String dimension;
+
 }

+ 11 - 0
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/feign/IUserClient.java

@@ -38,6 +38,8 @@ public interface IUserClient {
 	String USER_AUTH_INFO = API_PREFIX + "/user-auth-info";
 	String SAVE_USER = API_PREFIX + "/save-user";
 	String UPDATE_USER = API_PREFIX + "/update-user";
+
+	String UPDATE_USER_COORDINATES = API_PREFIX + "/updateUserCoordinates";
 	String REMOVE_USER = API_PREFIX + "/remove-user";
 	String GAIN_USER = API_PREFIX + "/gainUser";
 	String USER_INFO_BY_NAME = API_PREFIX + "/user-info-by-name";
@@ -212,6 +214,15 @@ public interface IUserClient {
 	R<Boolean> updateUser(@RequestBody User user);
 
 	/**
+	 * 修改用户经纬度
+	 *
+	 * @param user 用户实体
+	 * @return
+	 */
+	@PostMapping(UPDATE_USER_COORDINATES)
+	R<Boolean> updateUserCoordinates(@RequestBody User user);
+
+	/**
 	 * 修改用户openId
 	 */
 	@PostMapping(UPDATE_OPEN_ID)

+ 33 - 0
blade-service-api/gubersail-dealer-app-api/src/main/java/com/gubersail/app/api/user/AppUser.java

@@ -0,0 +1,33 @@
+package com.gubersail.app.api.user;
+
+import lombok.Data;
+
+/**
+ * @author :jixinyuan
+ * @date : 2025/11/12
+ */
+@Data
+public class AppUser {
+
+	/**
+	 * id
+	 */
+	private Long id;
+	/**
+	 * 名称
+	 */
+	private String name;
+	/**
+	 * 地址
+	 */
+	private String address;
+	/**
+	 * 经度
+	 */
+	private String longitude;
+	/**
+	 * 维度
+	 */
+	private String dimension;
+
+}

+ 10 - 5
blade-service/blade-u9cloud/src/main/java/org/springblade/u9cloud/controller/ZcrmViewCustomerSelController.java

@@ -1,12 +1,9 @@
 package org.springblade.u9cloud.controller;
 
 import lombok.AllArgsConstructor;
-import lombok.RequiredArgsConstructor;
 import org.springblade.core.tool.api.R;
 import org.springblade.u9cloud.entity.ZcrmViewCustomerSel;
-import org.springblade.u9cloud.feign.IZcrmViewCustomerSel;
 import org.springblade.u9cloud.service.ZcrmViewCustomerSelService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 /**
@@ -26,11 +23,11 @@ public class ZcrmViewCustomerSelController {
 
 	/**
 	 * 执行同步
+	 *
 	 * @return
 	 */
 	@GetMapping("/executionSynchronization")
-	public R<String> executionSynchronization()
-	{
+	public R<String> executionSynchronization() {
 		boolean res = zcrmViewCustomerSelService.insertBatchCustomers();
 		if (res) {
 			return R.data("执行成功");
@@ -50,4 +47,12 @@ public class ZcrmViewCustomerSelController {
 		}
 	}
 
+	/**
+	 * 客户详情接口
+	 */
+	@GetMapping("/getCustomerSelDetail")
+	public R<ZcrmViewCustomerSel> TestZcrmViewCustomerSelAdd(@RequestParam("customerId") Long customerId) {
+		return R.data(zcrmViewCustomerSelService.getById(customerId));
+	}
+
 }

+ 5 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/feign/UserClient.java

@@ -191,6 +191,11 @@ public class UserClient implements IUserClient {
 	}
 
 	@Override
+	public R<Boolean> updateUserCoordinates(User user) {
+		return R.data(service.updateById(user));
+	}
+
+	@Override
 	@PostMapping(UPDATE_OPEN_ID)
 	public R<Boolean> updateOpenId(@RequestBody User user) {
 		return R.data(service.updateOpenId(user));

+ 61 - 0
blade-service/gubersail-dealer-app/src/main/java/com/gubersail/app/user/controller/AppUserController.java

@@ -0,0 +1,61 @@
+/*
+ *      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.gubersail.app.user.controller;
+
+import com.gubersail.app.api.user.AppUser;
+import com.gubersail.app.user.service.IAppUserService;
+import io.swagger.annotations.Api;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.tool.api.R;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+
+/**
+ * 经销商用户信息 控制器
+ *
+ * @author BladeX
+ * @since 2023-04-23
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/appUser")
+@Api(value = "经销商用户信息", tags = "经销商用户信息接口")
+public class AppUserController extends BladeController {
+
+	private final IAppUserService IAppUserService;
+
+	/**
+	 * 经销商用户信息详情
+	 */
+	@GetMapping("/detail")
+	public R<AppUser> detail(AppUser stockDesc) {
+		AppUser detail = IAppUserService.detail(stockDesc);
+		return R.data(detail);
+	}
+
+	/**
+	 * 保存经销商用户经纬度
+	 */
+	@PostMapping("/submit")
+	public R submit(@Valid @RequestBody AppUser appUser) {
+		return IAppUserService.submit(appUser);
+	}
+
+}

+ 35 - 0
blade-service/gubersail-dealer-app/src/main/java/com/gubersail/app/user/service/IAppUserService.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.gubersail.app.user.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gubersail.app.api.user.AppUser;
+import org.springblade.core.tool.api.R;
+
+/**
+ * 经销商用户信息
+ *
+ * @author BladeX
+ * @since 2023-04-23
+ */
+public interface IAppUserService {
+
+
+	AppUser detail(AppUser stockDesc);
+
+	R submit(AppUser appUser);
+}

+ 73 - 0
blade-service/gubersail-dealer-app/src/main/java/com/gubersail/app/user/service/impl/AppUserServiceImpl.java

@@ -0,0 +1,73 @@
+/*
+ *      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.gubersail.app.user.service.impl;
+
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.gubersail.app.api.user.AppUser;
+import com.gubersail.app.user.service.IAppUserService;
+import lombok.AllArgsConstructor;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.system.user.entity.User;
+import org.springblade.system.user.feign.IUserClient;
+import org.springblade.u9cloud.entity.ZcrmViewCustomerSel;
+import org.springblade.u9cloud.feign.IZcrmViewCustomerSel;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * 经销商用户信息 服务实现类
+ *
+ * @author BladeX
+ * @since 2023-04-23
+ */
+@Service
+@AllArgsConstructor
+public class AppUserServiceImpl implements IAppUserService {
+
+	private final IUserClient userClient;
+
+	private final IZcrmViewCustomerSel customerSel;
+
+
+	@Override
+	public AppUser detail(AppUser stockDesc) {
+		AppUser appUser = new AppUser();
+		R<User> res = userClient.userInfoById(AuthUtil.getUserId());
+		if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())){
+			appUser.setId(res.getData().getId());
+			appUser.setLongitude(res.getData().getLongitude());
+			appUser.setDimension(res.getData().getDimension());
+			appUser.setName(res.getData().getRealName());
+			R<ZcrmViewCustomerSel> selR = customerSel.getCustomerSelDetail(res.getData().getCustomerId());
+			if (selR.isSuccess() && ObjectUtils.isNotNull(selR.getData())){
+				appUser.setAddress(selR.getData().getDescFlexFieldPrivateDescSeg3());
+			}
+		}
+		return appUser;
+	}
+
+	@Override
+	public R submit(AppUser appUser) {
+		User user = new User();
+		user.setId(appUser.getId());
+		user.setLongitude(appUser.getLongitude());
+		user.setDimension(appUser.getDimension());
+		userClient.updateUser(user);
+		return R.data(appUser);
+	}
+}