shasha hace 1 mes
padre
commit
b46c6d5475
Se han modificado 24 ficheros con 767 adiciones y 130 borrados
  1. 20 0
      .gitignore
  2. 24 0
      snowy-admin-web/src/api/biz/customerAccountApi.js
  3. 78 0
      snowy-admin-web/src/views/biz/customer/accountAdd.vue
  4. 107 0
      snowy-admin-web/src/views/biz/customer/accountIndex.vue
  5. 1 5
      snowy-admin-web/src/views/biz/customer/form.vue
  6. 11 15
      snowy-admin-web/src/views/biz/customer/index.vue
  7. 94 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/controller/BizCustomerAccountController.java
  8. 0 14
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/controller/BizCustomerController.java
  9. 0 4
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/entity/BizCustomer.java
  10. 47 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/entity/BizCustomerAccount.java
  11. 34 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/enums/BizCustomerAccountEnum.java
  12. 25 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/mapper/BizCustomerAccountMapper.java
  13. 5 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/mapper/mapping/BizCustomerAccountMapper.xml
  14. 37 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/param/BizCustomerAccountAddParam.java
  15. 34 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/param/BizCustomerAccountIdParam.java
  16. 53 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/param/BizCustomerAccountPageParam.java
  17. 0 5
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/param/BizCustomerAddParam.java
  18. 0 4
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/param/BizCustomerEditParam.java
  19. 0 4
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/param/BizCustomerPageParam.java
  20. 63 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/service/BizCustomerAccountService.java
  21. 0 8
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/service/BizCustomerService.java
  22. 131 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/service/impl/BizCustomerAccountServiceImpl.java
  23. 0 71
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/service/impl/BizCustomerServiceImpl.java
  24. 3 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/user/entity/BizUser.java

+ 20 - 0
.gitignore

@@ -0,0 +1,20 @@
+.idea/compiler.xml
+.idea/
+snowy-common/target/
+snowy-plugin/snowy-plugin-auth/target/
+snowy-plugin/snowy-plugin-biz/target/
+snowy-plugin/snowy-plugin-client/target/
+snowy-plugin/snowy-plugin-dev/target/
+snowy-plugin/snowy-plugin-gen/target/
+snowy-plugin/snowy-plugin-mobile/target/
+snowy-plugin/snowy-plugin-sys/target/
+snowy-plugin-api/snowy-plugin-auth-api/target/
+snowy-plugin-api/snowy-plugin-biz-api/target/
+snowy-plugin-api/snowy-plugin-dev-api/target/
+snowy-plugin-api/snowy-plugin-mobile-api/target/
+snowy-plugin-api/snowy-plugin-sys-api/target/
+snowy-web-app/target/
+snowy-admin-web/package.json
+snowy-web-app/src/main/resources/application.properties
+snowy-web-app/src/main/resources/application-local.properties
+snowy-web-app/src/main/resources/application-test.properties

+ 24 - 0
snowy-admin-web/src/api/biz/customerAccountApi.js

@@ -0,0 +1,24 @@
+import { baseRequest } from '@/utils/request'
+
+const request = (url, ...arg) => baseRequest(`/biz/customerAccount/` + url, ...arg)
+
+/**
+ * 客户账号Api接口管理器
+ *
+ * @author sandy
+ * @date  2025/04/09 17:00
+ **/
+export default {
+	// 获取客户账号分页
+	customerAccountPage(data) {
+		return request('page', data, 'get')
+	},
+	// 提交客户账号表单 edit为true时为编辑,默认为新增
+	customerAccountSubmitForm(data, edit = false) {
+		return request(edit ? 'edit' : 'add', data)
+	},
+	// 删除客户账号
+	customerAccountDelete(data) {
+		return request('delete', data)
+	},
+}

+ 78 - 0
snowy-admin-web/src/views/biz/customer/accountAdd.vue

@@ -0,0 +1,78 @@
+<template>
+	<xn-form-container
+		:title="'增加客户账号'"
+		:width="700"
+		v-model:open="open"
+		:destroy-on-close="true"
+		@close="onClose"
+	>
+		<a-form ref="formRef" :model="formData" :rules="formRules" :wrapper-col="wrapperCol" :label-col="labelCol">
+			<a-form-item label="客户账号:" name="loginAccount">
+				<a-input v-model:value="formData.loginAccount" placeholder="请输入客户账号" allow-clear />
+			</a-form-item>
+		</a-form>
+		<template #footer>
+			<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
+			<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
+		</template>
+	</xn-form-container>
+</template>
+
+<script setup name="customerForm">
+	import { cloneDeep } from 'lodash-es'
+	import { required } from '@/utils/formRules'
+	import customerAccountApi from '@/api/biz/customerAccountApi'
+	// 抽屉状态
+	const open = ref(false)
+	const emit = defineEmits({ successful: null })
+	const formRef = ref()
+	// 表单数据
+	const formData = ref({})
+	const submitLoading = ref(false)
+
+	//设置表单样式
+	const labelCol = ref({ span: 5})
+	const wrapperCol = ref({ span: 16})
+
+	// 打开抽屉
+	const onOpen = (recordData) => {
+		open.value = true
+		if (recordData) {
+			formData.value.customerId = recordData.id
+		}
+	}
+	// 关闭抽屉
+	const onClose = () => {
+		formRef.value.resetFields()
+		formData.value = {}
+		open.value = false
+	}
+	// 默认要校验的
+	const formRules = {
+		loginAccount: [required("客户账号")],
+	}
+
+	// 验证并提交数据
+	const onSubmit = () => {
+		formRef.value
+			.validate()
+			.then(() => {
+				submitLoading.value = true
+				const formDataParam = cloneDeep(formData.value)
+				customerAccountApi
+					.customerAccountSubmitForm(formDataParam, formDataParam.id)
+					.then(() => {
+						onClose()
+						emit('successful')
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			})
+			.catch(() => {})
+	}
+	// 抛出函数
+	defineExpose({
+		onOpen
+	})
+</script>

+ 107 - 0
snowy-admin-web/src/views/biz/customer/accountIndex.vue

@@ -0,0 +1,107 @@
+<template>
+	<a-drawer title="客户账号管理" :width="650" :open="visible" :destroy-on-close="true" @close="onClose">
+		<s-table
+			ref="tableRef"
+			:columns="columns"
+			:data="loadData"
+			:alert="false"
+			:row-key="(record) => record.id"
+			:tool-config="toolConfig"
+		>
+			<template #operator class="table-operator">
+				<a-button type="primary" v-if="hasPerm('customerAccountAdd')" @click="accountAddForm.onOpen(recordData)">
+					<template #icon>
+						<plus-outlined />
+					</template>
+					<span>新增账号</span>
+				</a-button>
+			</template>
+			<template #bodyCell="{ column, record, index }">
+				<template v-if="column.dataIndex === 'serial'">
+					{{ index + 1 }}
+				</template>
+				<template v-if="column.dataIndex === 'action'">
+					<a-space>
+						<a-popconfirm title="确定要删除此字段吗?" v-if="hasPerm('customerAccountDelete')" @confirm="deleteCustomerAccount(record)">
+							<a-button type="link" danger size="small">删除</a-button>
+						</a-popconfirm>
+					</a-space>
+				</template>
+			</template>
+		</s-table>
+	</a-drawer>
+	<AccountAddForm ref="accountAddForm" @successful="tableRef.refresh(true)" />
+</template>
+
+<script setup name="accountForm">
+	import customerAccountApi from '@/api/biz/customerAccountApi'
+	import AccountAddForm from './accountAdd.vue'
+
+	const columns = [
+		{
+			title: '序号',
+			width: 50,
+			dataIndex: 'serial',
+			align:'center'
+		},
+		{
+			title: '账号',
+			align:'center',
+			dataIndex: 'loginAccount'
+		},
+	]
+	const toolConfig = { refresh: true, height: false, columnSetting: false, striped: false }
+	// 默认是关闭状态
+	const visible = ref(false)
+	const searchFormState = ref()
+	const accountAddForm = ref()
+	const recordData = ref()
+	const tableRef = ref()
+
+	// 操作栏通过权限判断是否显示
+	if (hasPerm(['customerAccountDelete'])) {
+		columns.push({
+			title: '操作',
+			dataIndex: 'action',
+			align: 'center',
+			width: 150
+		})
+	}
+
+	// 打开抽屉
+	const onOpen = (record) => {
+		recordData.value = record
+		searchFormState.value = {
+			customerId: record.id
+		}
+		visible.value = true
+	}
+	// 加载字段数据
+	const loadData = (parameter) => {
+		return customerAccountApi.customerAccountPage(Object.assign(parameter, searchFormState.value)).then((res) => {
+			return res
+		})
+	}
+	// 关闭抽屉
+	const onClose = () => {
+		visible.value = false
+	}
+	// 删除
+	const deleteCustomerAccount = (record) => {
+		let params = [
+			{
+				id: record.id
+			}
+		]
+		customerAccountApi.customerAccountDelete(params).then(() => {
+			tableRef.value.refresh(true)
+		})
+	}
+	// 调用这个函数将子组件的一些数据和方法暴露出去
+	defineExpose({
+		onOpen
+	})
+</script>
+
+<style scoped>
+</style>

+ 1 - 5
snowy-admin-web/src/views/biz/customer/form.vue

@@ -10,9 +10,6 @@
 			<a-form-item label="关联用友平台的ID:" name="yongId">
 				<a-input v-model:value="formData.yongId" placeholder="请输入关联用友平台的ID" allow-clear />
 			</a-form-item>
-			<a-form-item label="客户登录账号:" name="loginAccount">
-				<a-input v-model:value="formData.loginAccount" placeholder="请输入客户登录账号" allow-clear />
-			</a-form-item>
 			<a-form-item label="客户名称:" name="name">
 				<a-input v-model:value="formData.name" placeholder="请输入客户名称" allow-clear />
 			</a-form-item>
@@ -68,8 +65,7 @@
 	}
 	// 默认要校验的
 	const formRules = {
-		yongId: [required("关联用友平台的ID")],
-		loginAccount: [required("客户登录账号")],
+		// yongId: [required("关联用友平台的ID")],
 		name: [required("客户名称")],
 		contact: [required("联系人")],
 		phone: [required("手机号")],

+ 11 - 15
snowy-admin-web/src/views/biz/customer/index.vue

@@ -2,11 +2,6 @@
 	<a-card :bordered="false" style="margin-bottom: 10px" class="mb-2">
 		<a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
 			<a-row :gutter="24">
-				<a-col :span="6">
-					<a-form-item label="客户登录账号" name="loginAccount">
-						<a-input v-model:value="searchFormState.loginAccount" placeholder="请输入客户登录账号" />
-					</a-form-item>
-				</a-col>
 				<a-col :span="6">
 					<a-form-item label="客户名称" name="name">
 						<a-input v-model:value="searchFormState.name" placeholder="请输入客户名称" />
@@ -48,22 +43,27 @@
 						<a-popconfirm title="确定要删除吗?" @confirm="deleteCustomer(record)">
 							<a-button type="link" danger size="small" v-if="hasPerm('customerDelete')">删除</a-button>
 						</a-popconfirm>
+						<a-divider type="vertical" v-if="hasPerm(['customerEdit', 'customerDelete'], 'or') && hasPerm('customerAccount')" />
+						<a @click="accountFormRef.onOpen(record)" v-if="hasPerm('customerAccount')">账号管理</a>
 					</a-space>
 				</template>
 			</template>
 		</s-table>
 	</a-card>
 	<Form ref="formRef" @successful="tableRef.refresh()" />
+	<AccountForm ref="accountFormRef" @successful="tableRef.refresh()" />
 </template>
 
 <script setup name="customer">
 	import { cloneDeep } from 'lodash-es'
 	import Form from './form.vue'
+	import AccountForm from './accountIndex.vue'
 	import customerApi from '@/api/biz/customerApi'
 	const searchFormState = ref({})
 	const searchFormRef = ref()
 	const tableRef = ref()
 	const formRef = ref()
+	const accountFormRef = ref()	
 	const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
 	const columns = [
 		{
@@ -72,42 +72,38 @@
 			dataIndex: 'serial',
 			align:'center'
 		},
-		{
-			title: '登录账号',
-			dataIndex: 'loginAccount'
-		},
 		{
 			title: '客户名称',
+			width: 180,
 			dataIndex: 'name'
 		},
 		{
 			title: '联系人',
+			width: 80,
 			dataIndex: 'contact'
 		},
 		{
 			title: '手机号',
+			width: 80,
 			dataIndex: 'phone'
 		},
 		{
 			title: '客户地址',
+			width: 250,
 			dataIndex: 'address'
 		},
 		{
 			title: '备注',
 			dataIndex: 'remark'
 		},
-		{
-			title: '关联用友平台的ID',
-			dataIndex: 'yongId'
-		},
 	]
 	// 操作栏通过权限判断是否显示
-	if (hasPerm(['customerEdit', 'customerDelete'])) {
+	if (hasPerm(['customerEdit', 'customerDelete', 'customerAccount'])) {
 		columns.push({
 			title: '操作',
 			dataIndex: 'action',
 			align: 'center',
-			width: 150
+			width: 220
 		})
 	}
 	const selectedRowKeys = ref([])

+ 94 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/controller/BizCustomerAccountController.java

@@ -0,0 +1,94 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.customer.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import org.springframework.validation.annotation.Validated;
+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.RestController;
+import vip.xiaonuo.common.annotation.CommonLog;
+import vip.xiaonuo.common.pojo.CommonResult;
+import vip.xiaonuo.biz.modular.customer.entity.BizCustomerAccount;
+import vip.xiaonuo.biz.modular.customer.param.BizCustomerAccountAddParam;
+import vip.xiaonuo.biz.modular.customer.param.BizCustomerAccountIdParam;
+import vip.xiaonuo.biz.modular.customer.param.BizCustomerAccountPageParam;
+import vip.xiaonuo.biz.modular.customer.service.BizCustomerAccountService;
+
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotEmpty;
+import java.util.List;
+
+/**
+ * 客户账号控制器
+ *
+ * @author sandy
+ * @date  2025/04/09 17:00
+ */
+@Tag(name = "客户账号控制器")
+@RestController
+@Validated
+public class BizCustomerAccountController {
+
+    @Resource
+    private BizCustomerAccountService bizCustomerAccountService;
+
+    /**
+     * 获取客户账号分页
+     *
+     * @author sandy
+     * @date  2025/04/09 17:00
+     */
+    @Operation(summary = "获取客户账号分页")
+    @GetMapping("/biz/customerAccount/page")
+    public CommonResult<Page<BizCustomerAccount>> page(BizCustomerAccountPageParam bizCustomerAccountPageParam) {
+        return CommonResult.data(bizCustomerAccountService.page(bizCustomerAccountPageParam));
+    }
+
+    /**
+     * 添加客户账号
+     *
+     * @author sandy
+     * @date  2025/04/09 17:00
+     */
+    @Operation(summary = "添加客户账号")
+    @CommonLog("添加客户账号")
+    @SaCheckPermission("/biz/customerAccount/add")
+    @PostMapping("/biz/customerAccount/add")
+    public CommonResult<String> add(@RequestBody @Valid BizCustomerAccountAddParam bizCustomerAccountAddParam) {
+        bizCustomerAccountService.add(bizCustomerAccountAddParam);
+        return CommonResult.ok();
+    }
+
+    /**
+     * 删除客户账号
+     *
+     * @author sandy
+     * @date  2025/04/09 17:00
+     */
+    @Operation(summary = "删除客户账号")
+    @CommonLog("删除客户账号")
+    @SaCheckPermission("/biz/customerAccount/delete")
+    @PostMapping("/biz/customerAccount/delete")
+    public CommonResult<String> delete(@RequestBody @Valid @NotEmpty(message = "集合不能为空")
+                                                   List<BizCustomerAccountIdParam> bizCustomerAccountIdParamList) {
+        bizCustomerAccountService.delete(bizCustomerAccountIdParamList);
+        return CommonResult.ok();
+    }
+
+}

+ 0 - 14
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/controller/BizCustomerController.java

@@ -130,20 +130,6 @@ public class BizCustomerController {
         return CommonResult.data(bizCustomerService.detail(bizCustomerIdParam));
     }
 
-    /**
-     * 重置用户密码
-     *
-     * @author sandy
-     * @date  2025/03/26 10:00
-     **/
-    @Operation(summary = "重置用户密码")
-    @CommonLog("重置用户密码")
-    @PostMapping("/biz/customer/resetPassword")
-    public CommonResult<String> resetPassword(@RequestBody @Valid BizCustomerIdParam bizCustomerIdParam) {
-        bizCustomerService.resetPassword(bizCustomerIdParam);
-        return CommonResult.ok();
-    }
-
     /**
      * 用友推送客户接口
      *

+ 0 - 4
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/entity/BizCustomer.java

@@ -37,10 +37,6 @@ public class BizCustomer extends CommonEntity {
     @Schema(description = "主键ID")
     private String id;
 
-    /** 客户登录账号 */
-    @Schema(description = "客户登录账号")
-    private String loginAccount;
-
     /** 客户名称 */
     @Schema(description = "客户名称")
     private String name;

+ 47 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/entity/BizCustomerAccount.java

@@ -0,0 +1,47 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.customer.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Getter;
+import lombok.Setter;
+import vip.xiaonuo.common.pojo.CommonEntity;
+
+import java.util.Date;
+
+/**
+ * 客户账号实体
+ *
+ * @author sandy
+ * @date  2025/04/09 17:00
+ **/
+@Getter
+@Setter
+@TableName("biz_customer_account")
+public class BizCustomerAccount extends CommonEntity {
+
+    /** 主键ID */
+    @TableId
+    @Schema(description = "主键ID")
+    private String id;
+
+    /** 客户ID */
+    @Schema(description = "客户ID")
+    private String customerId;
+
+    /** 账号 */
+    @Schema(description = "账号")
+    private String loginAccount;
+
+}

+ 34 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/enums/BizCustomerAccountEnum.java

@@ -0,0 +1,34 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.customer.enums;
+
+import lombok.Getter;
+
+/**
+ * 客户账号枚举
+ *
+ * @author sandy
+ * @date  2025/04/09 17:00
+ **/
+@Getter
+public enum BizCustomerAccountEnum {
+
+    /** 未删除 */
+    NOT_DELETE("NOT_DELETE");
+
+    private final String value;
+
+    BizCustomerAccountEnum(String value) {
+        this.value = value;
+    }
+}

+ 25 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/mapper/BizCustomerAccountMapper.java

@@ -0,0 +1,25 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.customer.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import vip.xiaonuo.biz.modular.customer.entity.BizCustomerAccount;
+
+/**
+ * 客户账号Mapper接口
+ *
+ * @author sandy
+ * @date  2025/04/09 17:00
+ **/
+public interface BizCustomerAccountMapper extends BaseMapper<BizCustomerAccount> {
+}

+ 5 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/mapper/mapping/BizCustomerAccountMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="vip.xiaonuo.biz.modular.customer.mapper.BizCustomerAccountMapper">
+
+</mapper>

+ 37 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/param/BizCustomerAccountAddParam.java

@@ -0,0 +1,37 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.customer.param;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 客户账号添加参数
+ *
+ * @author sandy
+ * @date  2025/04/09 17:00
+ **/
+@Getter
+@Setter
+public class BizCustomerAccountAddParam {
+
+    /** 客户ID */
+    @Schema(description = "客户ID")
+    private String customerId;
+
+    /** 账号 */
+    @Schema(description = "账号")
+    private String loginAccount;
+
+}

+ 34 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/param/BizCustomerAccountIdParam.java

@@ -0,0 +1,34 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.customer.param;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 客户Id参数
+ *
+ * @author sandy
+ * @date  2025/03/25 15:30
+ **/
+@Getter
+@Setter
+public class BizCustomerAccountIdParam {
+
+    /** 主键ID */
+    @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotBlank(message = "id不能为空")
+    private String id;
+}

+ 53 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/param/BizCustomerAccountPageParam.java

@@ -0,0 +1,53 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.customer.param;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 客户账号查询参数
+ *
+ * @author sandy
+ * @date  2025/04/09 17:00
+ **/
+@Getter
+@Setter
+public class BizCustomerAccountPageParam {
+
+    /** 当前页 */
+    @Schema(description = "当前页码")
+    private Integer current;
+
+    /** 每页条数 */
+    @Schema(description = "每页条数")
+    private Integer size;
+
+    /** 排序字段 */
+    @Schema(description = "排序字段,字段驼峰名称,如:userName")
+    private String sortField;
+
+    /** 排序方式 */
+    @Schema(description = "排序方式,升序:ASCEND;降序:DESCEND")
+    private String sortOrder;
+
+    /** 关键词 */
+    @Schema(description = "关键词")
+    private String searchKey;
+
+    /** 客户ID */
+    @Schema(description = "客户ID")
+    private String customerId;
+
+}

+ 0 - 5
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/param/BizCustomerAddParam.java

@@ -31,11 +31,6 @@ import java.util.Date;
 @Setter
 public class BizCustomerAddParam {
 
-    /** 客户登录账号 */
-    @Schema(description = "客户登录账号", requiredMode = Schema.RequiredMode.REQUIRED)
-    @NotBlank(message = "客户登录账号不能为空")
-    private String loginAccount;
-
     /** 客户名称 */
     @Schema(description = "客户名称")
     private String name;

+ 0 - 4
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/param/BizCustomerEditParam.java

@@ -36,10 +36,6 @@ public class BizCustomerEditParam {
     @NotBlank(message = "id不能为空")
     private String id;
 
-    /** 客户登录账号 */
-    @Schema(description = "客户登录账号")
-    private String loginAccount;
-
     /** 客户名称 */
     @Schema(description = "客户名称")
     private String name;

+ 0 - 4
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/param/BizCustomerPageParam.java

@@ -48,10 +48,6 @@ public class BizCustomerPageParam {
     @Schema(description = "关键词")
     private String searchKey;
 
-    /** 客户登录账号 */
-    @Schema(description = "客户登录账号")
-    private String loginAccount;
-
     /** 客户名称 */
     @Schema(description = "客户名称")
     private String name;

+ 63 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/service/BizCustomerAccountService.java

@@ -0,0 +1,63 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.customer.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import vip.xiaonuo.biz.modular.customer.entity.BizCustomerAccount;
+import vip.xiaonuo.biz.modular.customer.param.BizCustomerAccountAddParam;
+import vip.xiaonuo.biz.modular.customer.param.BizCustomerAccountIdParam;
+import vip.xiaonuo.biz.modular.customer.param.BizCustomerAccountPageParam;
+
+import java.util.List;
+
+/**
+ * 客户账号Service接口
+ *
+ * @author sandy
+ * @date  2025/04/09 17:00
+ **/
+public interface BizCustomerAccountService extends IService<BizCustomerAccount> {
+
+    /**
+     * 获取客户账号分页
+     *
+     * @author sandy
+     * @date  2025/04/09 17:00
+     */
+    Page<BizCustomerAccount> page(BizCustomerAccountPageParam bizBizCustomerAccountPageParam);
+
+    /**
+     * 添加客户账号
+     *
+     * @author sandy
+     * @date  2025/04/09 17:00
+     */
+    void add(BizCustomerAccountAddParam bizBizCustomerAccountAddParam);
+
+    /**
+     * 删除客户账号
+     *
+     * @author sandy
+     * @date  2025/04/09 17:00
+     */
+    void delete(List<BizCustomerAccountIdParam> bizBizCustomerAccountIdParamList);
+
+    /**
+     * 获取客户账号详情
+     *
+     * @author sandy
+     * @date  2025/04/09 17:00
+     **/
+    BizCustomerAccount queryEntity(String id);
+}

+ 0 - 8
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/service/BizCustomerService.java

@@ -80,14 +80,6 @@ public interface BizCustomerService extends IService<BizCustomer> {
      */
     BizCustomer detail(BizCustomerIdParam bizCustomerIdParam);
 
-    /**
-     * 重置用户密码
-     *
-     * @author sandy
-     * @date  2025/03/26 10:00
-     **/
-    void resetPassword(BizCustomerIdParam bizCustomerIdParam);
-
     /**
      * 获取客户详情
      *

+ 131 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/service/impl/BizCustomerAccountServiceImpl.java

@@ -0,0 +1,131 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.customer.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollStreamUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import jakarta.annotation.Resource;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import vip.xiaonuo.biz.modular.customer.entity.BizCustomer;
+import vip.xiaonuo.biz.modular.customer.enums.BizCustomerAccountEnum;
+import vip.xiaonuo.biz.modular.customer.enums.BizCustomerEnum;
+import vip.xiaonuo.biz.modular.customer.param.BizCustomerAccountIdParam;
+import vip.xiaonuo.biz.modular.goods.entity.BizGoods;
+import vip.xiaonuo.biz.modular.user.entity.BizUser;
+import vip.xiaonuo.biz.modular.user.enums.BizUserStatusEnum;
+import vip.xiaonuo.biz.modular.user.mapper.BizUserMapper;
+import vip.xiaonuo.common.enums.CommonSortOrderEnum;
+import vip.xiaonuo.common.exception.CommonException;
+import vip.xiaonuo.common.page.CommonPageRequest;
+import vip.xiaonuo.biz.modular.customer.entity.BizCustomerAccount;
+import vip.xiaonuo.biz.modular.customer.mapper.BizCustomerAccountMapper;
+import vip.xiaonuo.biz.modular.customer.param.BizCustomerAccountAddParam;
+import vip.xiaonuo.biz.modular.customer.param.BizCustomerAccountPageParam;
+import vip.xiaonuo.biz.modular.customer.service.BizCustomerAccountService;
+import vip.xiaonuo.common.util.CommonCryptogramUtil;
+import vip.xiaonuo.dev.api.DevConfigApi;
+import vip.xiaonuo.sys.api.SysUserApi;
+
+import java.util.List;
+
+/**
+ * 客户账号Service接口实现类
+ *
+ * @author sandy
+ * @date  2025/04/09 17:00
+ **/
+@Service
+public class BizCustomerAccountServiceImpl extends ServiceImpl<BizCustomerAccountMapper, BizCustomerAccount> implements BizCustomerAccountService {
+
+    @Resource
+    private DevConfigApi devConfigApi;
+
+    @Resource
+    private BizUserMapper bizUserMapper;
+
+    @Resource
+    private SysUserApi sysUserApi;
+
+    private static final String SNOWY_SYS_DEFAULT_PASSWORD_KEY = "SNOWY_SYS_DEFAULT_PASSWORD";
+
+    @Override
+    public Page<BizCustomerAccount> page(BizCustomerAccountPageParam bizCustomerAccountPageParam) {
+        QueryWrapper<BizCustomerAccount> queryWrapper = new QueryWrapper<BizCustomerAccount>().checkSqlInjection();
+        if(ObjectUtil.isNotEmpty(bizCustomerAccountPageParam.getCustomerId())) {
+            queryWrapper.lambda().like(BizCustomerAccount::getCustomerId, bizCustomerAccountPageParam.getCustomerId());
+        }
+        queryWrapper.lambda().eq(BizCustomerAccount::getDeleteFlag, BizCustomerAccountEnum.NOT_DELETE.getValue());
+        if(ObjectUtil.isAllNotEmpty(bizCustomerAccountPageParam.getSortField(), bizCustomerAccountPageParam.getSortOrder())) {
+            CommonSortOrderEnum.validate(bizCustomerAccountPageParam.getSortOrder());
+            queryWrapper.orderBy(true, bizCustomerAccountPageParam.getSortOrder().equals(CommonSortOrderEnum.ASC.getValue()),
+                    StrUtil.toUnderlineCase(bizCustomerAccountPageParam.getSortField()));
+        } else {
+            queryWrapper.lambda().orderByAsc(BizCustomerAccount::getId);
+        }
+        return this.page(CommonPageRequest.defaultPage(), queryWrapper);
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void add(BizCustomerAccountAddParam bizCustomerAccountAddParam) {
+        QueryWrapper<BizCustomerAccount> queryWrapper = new QueryWrapper<>();
+        if(ObjectUtil.isNotEmpty(bizCustomerAccountAddParam.getLoginAccount())){
+            queryWrapper.lambda().eq(BizCustomerAccount::getLoginAccount,bizCustomerAccountAddParam.getLoginAccount());
+        }
+        queryWrapper.lambda().eq(BizCustomerAccount::getDeleteFlag, BizCustomerAccountEnum.NOT_DELETE.getValue());
+        long count = this.count(queryWrapper);
+        if(count>0){
+            throw new CommonException("该客户账号已经存在!");
+        }
+
+        BizCustomerAccount bizCustomerAccount = BeanUtil.toBean(bizCustomerAccountAddParam, BizCustomerAccount.class);
+        this.save(bizCustomerAccount);
+
+        // 添加客户登录账号
+        BizUser bizUser = new BizUser();
+        bizUser.setCustomerId(bizCustomerAccountAddParam.getCustomerId());
+        bizUser.setName(bizCustomerAccountAddParam.getLoginAccount());
+        bizUser.setAccount(bizCustomerAccountAddParam.getLoginAccount());
+        bizUser.setUserType("1");
+        // 设置密码
+        bizUser.setPassword(CommonCryptogramUtil.doHashValue(devConfigApi.getValueByKey(SNOWY_SYS_DEFAULT_PASSWORD_KEY)));
+        // 设置状态
+        bizUser.setUserStatus(BizUserStatusEnum.ENABLE.getValue());
+        this.bizUserMapper.insert(bizUser);
+
+        // 添加客户角色
+        this.sysUserApi.grantRoleType(bizUser.getId(), "客户");
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void delete(List<BizCustomerAccountIdParam> bizCustomerAccountIdParamList) {
+        // 执行删除
+        this.removeByIds(CollStreamUtil.toList(bizCustomerAccountIdParamList, BizCustomerAccountIdParam::getId));
+    }
+
+    @Override
+    public BizCustomerAccount queryEntity(String id) {
+        BizCustomerAccount bizCustomerAccount = this.getById(id);
+        if(ObjectUtil.isEmpty(bizCustomerAccount)) {
+            throw new CommonException("客户账号不存在,id值为:{}", id);
+        }
+        return bizCustomerAccount;
+    }
+}

+ 0 - 71
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/customer/service/impl/BizCustomerServiceImpl.java

@@ -57,23 +57,9 @@ import java.util.Map;
 @Service
 public class BizCustomerServiceImpl extends ServiceImpl<BizCustomerMapper, BizCustomer> implements BizCustomerService {
 
-    private static final String SNOWY_SYS_DEFAULT_PASSWORD_KEY = "SNOWY_SYS_DEFAULT_PASSWORD";
-
-    @Resource
-    private DevConfigApi devConfigApi;
-
-    @Resource
-    private BizUserMapper bizUserMapper;
-
-    @Resource
-    private SysUserApi sysUserApi;
-
     @Override
     public Page<BizCustomer> page(BizCustomerPageParam bizCustomerPageParam) {
         QueryWrapper<BizCustomer> queryWrapper = new QueryWrapper<BizCustomer>().checkSqlInjection();
-        if(ObjectUtil.isNotEmpty(bizCustomerPageParam.getLoginAccount())) {
-            queryWrapper.lambda().like(BizCustomer::getLoginAccount, bizCustomerPageParam.getLoginAccount());
-        }
         if(ObjectUtil.isNotEmpty(bizCustomerPageParam.getName())) {
             queryWrapper.lambda().like(BizCustomer::getName, bizCustomerPageParam.getName());
         }
@@ -94,9 +80,6 @@ public class BizCustomerServiceImpl extends ServiceImpl<BizCustomerMapper, BizCu
     @Override
     public List<BizCustomer> getList(BizCustomerPageParam bizCustomerPageParam) {
         QueryWrapper<BizCustomer> queryWrapper = new QueryWrapper<BizCustomer>().checkSqlInjection();
-        if(ObjectUtil.isNotEmpty(bizCustomerPageParam.getLoginAccount())) {
-            queryWrapper.lambda().like(BizCustomer::getLoginAccount, bizCustomerPageParam.getLoginAccount());
-        }
         if(ObjectUtil.isNotEmpty(bizCustomerPageParam.getName())) {
             queryWrapper.lambda().like(BizCustomer::getName, bizCustomerPageParam.getName());
         }
@@ -122,11 +105,6 @@ public class BizCustomerServiceImpl extends ServiceImpl<BizCustomerMapper, BizCu
         if(countYong>0){
             throw new CommonException("客户关联的用友平台ID已存在!");
         }
-        //查询客户账号是否添加过
-        long countLogin = this.count(new QueryWrapper<BizCustomer>().lambda().eq(BizCustomer::getLoginAccount, bizCustomerAddParam.getLoginAccount()));
-        if(countLogin>0){
-            throw new CommonException("客户账号已存在!");
-        }
         //查询客户名称是否添加过
         long countName = this.count(new QueryWrapper<BizCustomer>().lambda().eq(BizCustomer::getName, bizCustomerAddParam.getName()));
         if(countName>0){
@@ -134,22 +112,6 @@ public class BizCustomerServiceImpl extends ServiceImpl<BizCustomerMapper, BizCu
         }
         BizCustomer bizCustomer = BeanUtil.toBean(bizCustomerAddParam, BizCustomer.class);
         this.save(bizCustomer);
-
-        // 添加客户登录账号
-        BizUser bizUser = new BizUser();
-        bizUser.setCustomerId(bizCustomer.getId());
-        bizUser.setAccount(bizCustomer.getLoginAccount());
-        bizUser.setName(bizCustomer.getName());
-        bizUser.setPhone(bizCustomer.getPhone());
-        bizUser.setUserType("1");
-        // 设置密码
-        bizUser.setPassword(CommonCryptogramUtil.doHashValue(devConfigApi.getValueByKey(SNOWY_SYS_DEFAULT_PASSWORD_KEY)));
-        // 设置状态
-        bizUser.setUserStatus(BizUserStatusEnum.ENABLE.getValue());
-        this.bizUserMapper.insert(bizUser);
-
-        // 添加客户角色
-        this.sysUserApi.grantRoleType(bizUser.getId(), "客户");
     }
 
     @Transactional(rollbackFor = Exception.class)
@@ -169,13 +131,6 @@ public class BizCustomerServiceImpl extends ServiceImpl<BizCustomerMapper, BizCu
                 throw new CommonException("客户关联的用友平台ID已存在!");
             }
         }
-        if(!StringUtils.equals(bizCustomer.getLoginAccount(),bizCustomerEditParam.getLoginAccount())){
-            //查询客户账号是否添加过
-            long countLogin = this.count(new QueryWrapper<BizCustomer>().lambda().eq(BizCustomer::getLoginAccount, bizCustomerEditParam.getLoginAccount()));
-            if(countLogin>0){
-                throw new CommonException("客户账号已存在!");
-            }
-        }
         if(!StringUtils.equals(bizCustomer.getName(),bizCustomerEditParam.getName())){
             //查询客户名称是否添加过
             long count = this.count(new QueryWrapper<BizCustomer>().lambda().eq(BizCustomer::getName, bizCustomerEditParam.getName()));
@@ -185,25 +140,6 @@ public class BizCustomerServiceImpl extends ServiceImpl<BizCustomerMapper, BizCu
         }
         BeanUtil.copyProperties(bizCustomerEditParam, bizCustomer);
         this.updateById(bizCustomer);
-
-        // 检查是否存在账号
-        long count = this.bizUserMapper.selectCount(new QueryWrapper<BizUser>().lambda().eq(BizUser::getCustomerId, bizCustomer.getId()));
-        if(count == 0){
-            BizUser bizUser = new BizUser();
-            bizUser.setCustomerId(bizCustomer.getId());
-            bizUser.setAccount(bizCustomer.getLoginAccount());
-            bizUser.setName(bizCustomer.getName());
-            bizUser.setPhone(bizCustomer.getPhone());
-            bizUser.setUserType("1");
-            // 设置密码
-            bizUser.setPassword(CommonCryptogramUtil.doHashValue(devConfigApi.getValueByKey(SNOWY_SYS_DEFAULT_PASSWORD_KEY)));
-            // 设置状态
-            bizUser.setUserStatus(BizUserStatusEnum.ENABLE.getValue());
-            this.bizUserMapper.insert(bizUser);
-
-            // 添加客户角色
-            this.sysUserApi.grantRoleType(bizUser.getId(), "客户");
-        }
     }
 
     @Transactional(rollbackFor = Exception.class)
@@ -218,13 +154,6 @@ public class BizCustomerServiceImpl extends ServiceImpl<BizCustomerMapper, BizCu
         return this.queryEntity(bizCustomerIdParam.getId());
     }
 
-    @Override
-    public void resetPassword(BizCustomerIdParam bizCustomerIdParam) {
-        this.bizUserMapper.update(new LambdaUpdateWrapper<BizUser>().eq(BizUser::getCustomerId,
-                bizCustomerIdParam.getId()).set(BizUser::getPassword,
-                CommonCryptogramUtil.doHashValue(devConfigApi.getValueByKey(SNOWY_SYS_DEFAULT_PASSWORD_KEY))));
-    }
-
     @Override
     public BizCustomer queryEntity(String id) {
         BizCustomer bizCustomer = this.getById(id);

+ 3 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/user/entity/BizUser.java

@@ -288,4 +288,7 @@ public class BizUser extends CommonEntity {
 
     @Schema(description = "客户ID")
     private String customerId;
+
+    @Schema(description = "客户账号ID")
+    private String customerAccountId;
 }