|
|
@@ -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);
|
|
|
+ }
|
|
|
+}
|