Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-csf
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xingmin
yd-csf
Commits
f3bce9aa
Commit
f3bce9aa
authored
Sep 10, 2025
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fna接口15
parent
8e9f2f76
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
124 additions
and
94 deletions
+124
-94
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiCustomerController.java
+1
-44
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiFnaController.java
+1
-25
yd-csf-service/src/main/java/com/yd/csf/service/dto/CustomerAddRequest.java
+26
-23
yd-csf-service/src/main/java/com/yd/csf/service/dto/FnaQueryRequest.java
+4
-1
yd-csf-service/src/main/java/com/yd/csf/service/model/Customer.java
+5
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/CustomerService.java
+2
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/FnaService.java
+3
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CustomerServiceImpl.java
+56
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FnaServiceImpl.java
+19
-0
yd-csf-service/src/main/java/com/yd/csf/service/vo/AddressVO.java
+7
-1
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiCustomerController.java
View file @
f3bce9aa
...
@@ -58,53 +58,10 @@ public class ApiCustomerController {
...
@@ -58,53 +58,10 @@ public class ApiCustomerController {
@PostMapping
(
"/add"
)
@PostMapping
(
"/add"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Result
<
String
>
addCustomer
(
@RequestBody
CustomerAddRequest
customerAddRequest
,
HttpServletRequest
request
)
{
public
Result
<
String
>
addCustomer
(
@RequestBody
CustomerAddRequest
customerAddRequest
,
HttpServletRequest
request
)
{
if
(
customerAddRequest
==
null
)
{
if
(
customerAddRequest
==
null
)
{
return
Result
.
fail
(
ErrorCode
.
PARAMS_ERROR
.
getCode
(),
ErrorCode
.
PARAMS_ERROR
.
getMessage
());
return
Result
.
fail
(
ErrorCode
.
PARAMS_ERROR
.
getCode
(),
ErrorCode
.
PARAMS_ERROR
.
getMessage
());
}
}
return
Result
.
success
(
customerService
.
addCustomer
(
customerAddRequest
));
// 校验 请求 对象中,参数是否全部为空
if
(
ValidateUtil
.
isAllFieldsNull
(
customerAddRequest
))
{
throw
new
BusinessException
(
ErrorCode
.
PARAMS_ERROR
.
getCode
(),
ErrorCode
.
PARAMS_ERROR
.
getMessage
());
}
// 客户主表信息
Customer
customer
=
new
Customer
();
BeanUtils
.
copyProperties
(
customerAddRequest
,
customer
);
// 客户扩展表信息
CustomerExpand
customerExpand
=
customerService
.
getCustomerExpand
(
customerAddRequest
);
// 客户主表业务唯一id
customer
.
setCustomerBizId
(
RandomStringGenerator
.
generateBizId16
(
"customer"
));
boolean
result
=
customerService
.
save
(
customer
);
if
(!
result
)
{
return
Result
.
fail
(
ErrorCode
.
OPERATION_ERROR
.
getCode
(),
ErrorCode
.
OPERATION_ERROR
.
getMessage
());
}
// 客户扩展表信息,非空时,写入数据库
if
(!
ValidateUtil
.
isAllFieldsNull
(
customerAddRequest
))
{
// 主表业务唯一id
customerExpand
.
setCustomerBizId
(
customer
.
getCustomerBizId
());
// 客户扩展表业务唯一id
customerExpand
.
setCustomerExpandBizId
(
RandomStringGenerator
.
generateBizId16
(
"customer_expand"
));
// 写入数据库
boolean
resultExpand
=
customerExpandService
.
save
(
customerExpand
);
if
(!
resultExpand
)
{
return
Result
.
fail
(
ErrorCode
.
OPERATION_ERROR
.
getCode
(),
ErrorCode
.
OPERATION_ERROR
.
getMessage
());
}
// 更新客户主表
Customer
updateCustomer
=
new
Customer
();
updateCustomer
.
setId
(
customer
.
getId
());
updateCustomer
.
setCustomerExpandBizId
(
customerExpand
.
getCustomerBizId
());
customerService
.
updateById
(
updateCustomer
);
}
// Result<GetLoginInfoResponse> loginUser = apiSysUserFeignClient.getLoginInfo();
// customer.setUserBizId(loginUser.getData().getApiLoginUserInfoResponse().getUserBizId());
// 返回新写入的数据 id
String
newFnaId
=
customer
.
getCustomerBizId
();
return
Result
.
success
(
newFnaId
);
}
}
/**
/**
...
...
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiFnaController.java
View file @
f3bce9aa
package
com
.
yd
.
csf
.
api
.
controller
;
package
com
.
yd
.
csf
.
api
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yd.common.exception.BusinessException
;
import
com.yd.common.exception.BusinessException
;
import
com.yd.common.result.Result
;
import
com.yd.common.result.Result
;
import
com.yd.common.utils.RandomStringGenerator
;
import
com.yd.csf.api.service.ApiAppointmentService
;
import
com.yd.csf.api.service.ApiAppointmentService
;
import
com.yd.csf.feign.dto.appointment.ApiAppointmentInfoDto
;
import
com.yd.csf.feign.dto.appointment.ApiAppointmentInfoDto
;
import
com.yd.csf.feign.response.appointment.ApiAppointmentDetailResponse
;
import
com.yd.csf.service.common.ErrorCode
;
import
com.yd.csf.service.common.ErrorCode
;
import
com.yd.csf.service.dto.DeleteFnaRequest
;
import
com.yd.csf.service.dto.DeleteFnaRequest
;
import
com.yd.csf.service.dto.FnaAddRequest
;
import
com.yd.csf.service.dto.FnaAddRequest
;
import
com.yd.csf.service.dto.FnaQueryRequest
;
import
com.yd.csf.service.dto.FnaQueryRequest
;
import
com.yd.csf.service.dto.FnaUpdateRequest
;
import
com.yd.csf.service.dto.FnaUpdateRequest
;
import
com.yd.csf.service.model.Appointment
;
import
com.yd.csf.service.model.Customer
;
import
com.yd.csf.service.model.Customer
;
import
com.yd.csf.service.model.Fna
;
import
com.yd.csf.service.model.Fna
;
import
com.yd.csf.service.service.CustomerService
;
import
com.yd.csf.service.service.CustomerService
;
...
@@ -25,7 +21,6 @@ import io.swagger.v3.oas.annotations.Operation;
...
@@ -25,7 +21,6 @@ import io.swagger.v3.oas.annotations.Operation;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -80,26 +75,7 @@ public class ApiFnaController {
...
@@ -80,26 +75,7 @@ public class ApiFnaController {
if
(
deleteRequest
==
null
||
deleteRequest
.
getId
()
==
null
)
{
if
(
deleteRequest
==
null
||
deleteRequest
.
getId
()
==
null
)
{
throw
new
BusinessException
(
ErrorCode
.
PARAMS_ERROR
.
getCode
(),
ErrorCode
.
PARAMS_ERROR
.
getMessage
());
throw
new
BusinessException
(
ErrorCode
.
PARAMS_ERROR
.
getCode
(),
ErrorCode
.
PARAMS_ERROR
.
getMessage
());
}
}
return
Result
.
success
(
fnaService
.
deleteFna
(
deleteRequest
));
Long
id
=
deleteRequest
.
getId
();
// 判断是否存在
Fna
oldFna
=
fnaService
.
getById
(
id
);
if
(
oldFna
==
null
)
{
throw
new
BusinessException
(
ErrorCode
.
NOT_FOUND_ERROR
.
getCode
(),
ErrorCode
.
NOT_FOUND_ERROR
.
getMessage
());
}
// 仅本人或管理员可删除
// if (!oldFna.getUserId().equals(user.getId()) && !userService.isAdmin(request)) {
// throw new BusinessException(ErrorCode.NO_AUTH_ERROR);
// }
// 操作数据库
Fna
updateFna
=
new
Fna
();
updateFna
.
setId
(
id
);
updateFna
.
setIsDeleted
(
1
);
boolean
result
=
fnaService
.
updateById
(
updateFna
);
if
(!
result
)
{
return
Result
.
fail
(
ErrorCode
.
OPERATION_ERROR
.
getCode
(),
ErrorCode
.
OPERATION_ERROR
.
getMessage
());
}
return
Result
.
success
(
true
);
}
}
/**
/**
...
...
yd-csf-service/src/main/java/com/yd/csf/service/dto/CustomerAddRequest.java
View file @
f3bce9aa
...
@@ -7,6 +7,7 @@ import lombok.Data;
...
@@ -7,6 +7,7 @@ import lombok.Data;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
/**
/**
* 创建customer请求
* 创建customer请求
...
@@ -59,13 +60,13 @@ public class CustomerAddRequest implements Serializable {
...
@@ -59,13 +60,13 @@ public class CustomerAddRequest implements Serializable {
/**
/**
* 称谓
* 称谓
*/
*/
@Schema
(
description
=
"称谓"
)
@Schema
(
description
=
"称谓
字典值: csf_customer_title
"
)
private
String
title
;
private
String
title
;
/**
/**
* 性别
* 性别
*/
*/
@Schema
(
description
=
"性别"
)
@Schema
(
description
=
"性别
字典值: sys_gender
"
)
private
Object
gender
;
private
Object
gender
;
/**
/**
...
@@ -113,7 +114,7 @@ public class CustomerAddRequest implements Serializable {
...
@@ -113,7 +114,7 @@ public class CustomerAddRequest implements Serializable {
/**
/**
* 是否吸烟
* 是否吸烟
*/
*/
@Schema
(
description
=
"是否吸烟"
)
@Schema
(
description
=
"是否吸烟
字典值: sys_no_yes
"
)
private
String
smoke
;
private
String
smoke
;
/**
/**
...
@@ -137,7 +138,7 @@ public class CustomerAddRequest implements Serializable {
...
@@ -137,7 +138,7 @@ public class CustomerAddRequest implements Serializable {
/**
/**
* 证件类型
* 证件类型
*/
*/
@Schema
(
description
=
"证件类型"
)
@Schema
(
description
=
"证件类型
字典值: csf_id_type
"
)
private
String
idType
;
private
String
idType
;
/**
/**
...
@@ -161,7 +162,7 @@ public class CustomerAddRequest implements Serializable {
...
@@ -161,7 +162,7 @@ public class CustomerAddRequest implements Serializable {
/**
/**
* 婚姻状况
* 婚姻状况
*/
*/
@Schema
(
description
=
"婚姻状况"
)
@Schema
(
description
=
"婚姻状况
字典值: csf_marriage
"
)
private
Object
marriage
;
private
Object
marriage
;
/**
/**
...
@@ -173,7 +174,7 @@ public class CustomerAddRequest implements Serializable {
...
@@ -173,7 +174,7 @@ public class CustomerAddRequest implements Serializable {
/**
/**
* 教育程度
* 教育程度
*/
*/
@Schema
(
description
=
"教育程度"
)
@Schema
(
description
=
"教育程度
字典值: csf_education
"
)
private
Object
education
;
private
Object
education
;
/**
/**
...
@@ -205,28 +206,30 @@ public class CustomerAddRequest implements Serializable {
...
@@ -205,28 +206,30 @@ public class CustomerAddRequest implements Serializable {
/**
/**
* 是否长期出国
* 是否长期出国
*/
*/
@Schema
(
description
=
"是否长期出国"
)
@Schema
(
description
=
"是否长期出国
字典值: sys_no_yes
"
)
private
String
longtimeAbroad
;
private
String
longtimeAbroad
;
/**
private
List
<
AddressVO
>
addressList
;
* 居住地址
*/
private
AddressVO
residenceAddress
;
/**
* 住宅地址
*/
private
AddressVO
residentialAddress
;
/**
/**
* 邮寄地址
* 居住地址
*/
private
AddressVO
mailingAddress
;
/**
* 公司地址
*/
*/
private
AddressVO
companyAddress
;
// private AddressVO residenceAddress;
//
// /**
// * 住宅地址
// */
// private AddressVO residentialAddress;
//
// /**
// * 邮寄地址
// */
// private AddressVO mailingAddress;
//
// /**
// * 公司地址
// */
// private AddressVO companyAddress;
/**
/**
* 公司名称
* 公司名称
...
...
yd-csf-service/src/main/java/com/yd/csf/service/dto/FnaQueryRequest.java
View file @
f3bce9aa
package
com
.
yd
.
csf
.
service
.
dto
;
package
com
.
yd
.
csf
.
service
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.yd.common.dto.PageDto
;
import
com.yd.common.dto.PageDto
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -21,12 +22,14 @@ public class FnaQueryRequest extends PageDto implements Serializable {
...
@@ -21,12 +22,14 @@ public class FnaQueryRequest extends PageDto implements Serializable {
* 创建时间开始
* 创建时间开始
*/
*/
@Schema
(
description
=
"创建时间开始"
)
@Schema
(
description
=
"创建时间开始"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
LocalDateTime
startTime
;
private
LocalDateTime
startTime
;
/**
/**
* 创建时间结束
* 创建时间结束
*/
*/
@Schema
(
description
=
"创建时间结束"
)
@Schema
(
description
=
"创建时间结束"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
LocalDateTime
endTime
;
private
LocalDateTime
endTime
;
/**
/**
...
@@ -38,7 +41,7 @@ public class FnaQueryRequest extends PageDto implements Serializable {
...
@@ -38,7 +41,7 @@ public class FnaQueryRequest extends PageDto implements Serializable {
/**
/**
* 状态
* 状态
*/
*/
@Schema
(
description
=
"状态
UNCOMPLETED-未完成 COMPLETED-已完成
"
)
@Schema
(
description
=
"状态
字典值: csf_fna_status
"
)
private
String
status
;
private
String
status
;
/**
/**
...
...
yd-csf-service/src/main/java/com/yd/csf/service/model/Customer.java
View file @
f3bce9aa
...
@@ -27,6 +27,11 @@ public class Customer implements Serializable {
...
@@ -27,6 +27,11 @@ public class Customer implements Serializable {
private
String
customerBizId
;
private
String
customerBizId
;
/**
/**
* 用户业务ID
*/
private
String
userBizId
;
/**
* 自定义代码
* 自定义代码
*/
*/
private
String
customCode
;
private
String
customCode
;
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/CustomerService.java
View file @
f3bce9aa
...
@@ -28,4 +28,6 @@ public interface CustomerService extends IService<Customer> {
...
@@ -28,4 +28,6 @@ public interface CustomerService extends IService<Customer> {
Page
<
CustomerVO
>
getCustomerVOPage
(
Page
<
Customer
>
customerPage
);
Page
<
CustomerVO
>
getCustomerVOPage
(
Page
<
Customer
>
customerPage
);
Customer
getByCustomerBizId
(
String
customerBizId
);
Customer
getByCustomerBizId
(
String
customerBizId
);
String
addCustomer
(
CustomerAddRequest
customerAddRequest
);
}
}
yd-csf-service/src/main/java/com/yd/csf/service/service/FnaService.java
View file @
f3bce9aa
...
@@ -2,6 +2,7 @@ package com.yd.csf.service.service;
...
@@ -2,6 +2,7 @@ package com.yd.csf.service.service;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yd.csf.service.dto.DeleteFnaRequest
;
import
com.yd.csf.service.dto.FnaAddRequest
;
import
com.yd.csf.service.dto.FnaAddRequest
;
import
com.yd.csf.service.dto.FnaQueryRequest
;
import
com.yd.csf.service.dto.FnaQueryRequest
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
...
@@ -44,4 +45,6 @@ public interface FnaService extends IService<Fna> {
...
@@ -44,4 +45,6 @@ public interface FnaService extends IService<Fna> {
Fna
getByBizId
(
String
fnaBizId
);
Fna
getByBizId
(
String
fnaBizId
);
boolean
updateByBizId
(
Fna
fna
);
boolean
updateByBizId
(
Fna
fna
);
Boolean
deleteFna
(
DeleteFnaRequest
deleteRequest
);
}
}
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CustomerServiceImpl.java
View file @
f3bce9aa
...
@@ -6,6 +6,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -6,6 +6,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
com.yd.common.exception.BusinessException
;
import
com.yd.common.result.Result
;
import
com.yd.common.utils.RandomStringGenerator
;
import
com.yd.csf.service.common.ErrorCode
;
import
com.yd.csf.service.dao.CustomerMapper
;
import
com.yd.csf.service.dao.CustomerMapper
;
import
com.yd.csf.service.dto.CustomerAddRequest
;
import
com.yd.csf.service.dto.CustomerAddRequest
;
import
com.yd.csf.service.dto.CustomerQueryRequest
;
import
com.yd.csf.service.dto.CustomerQueryRequest
;
...
@@ -14,12 +18,14 @@ import com.yd.csf.service.model.Customer;
...
@@ -14,12 +18,14 @@ import com.yd.csf.service.model.Customer;
import
com.yd.csf.service.model.CustomerExpand
;
import
com.yd.csf.service.model.CustomerExpand
;
import
com.yd.csf.service.service.CustomerExpandService
;
import
com.yd.csf.service.service.CustomerExpandService
;
import
com.yd.csf.service.service.CustomerService
;
import
com.yd.csf.service.service.CustomerService
;
import
com.yd.csf.service.utils.ValidateUtil
;
import
com.yd.csf.service.vo.AddressVO
;
import
com.yd.csf.service.vo.AddressVO
;
import
com.yd.csf.service.vo.CustomerExpandVO
;
import
com.yd.csf.service.vo.CustomerExpandVO
;
import
com.yd.csf.service.vo.CustomerVO
;
import
com.yd.csf.service.vo.CustomerVO
;
import
com.yd.csf.service.vo.FnaVO
;
import
com.yd.csf.service.vo.FnaVO
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.List
;
...
@@ -41,6 +47,11 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer>
...
@@ -41,6 +47,11 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer>
@Resource
@Resource
private
CustomerExpandService
customerExpandService
;
private
CustomerExpandService
customerExpandService
;
@Resource
private
CustomerService
customerService
;
@Override
@Override
public
CustomerVO
getCustomerVO
(
Customer
customer
)
{
public
CustomerVO
getCustomerVO
(
Customer
customer
)
{
return
CustomerVO
.
objToVo
(
customer
);
return
CustomerVO
.
objToVo
(
customer
);
...
@@ -109,6 +120,51 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer>
...
@@ -109,6 +120,51 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer>
return
baseMapper
.
selectOne
(
new
LambdaQueryWrapper
<
Customer
>().
eq
(
Customer:
:
getCustomerBizId
,
customerBizId
));
return
baseMapper
.
selectOne
(
new
LambdaQueryWrapper
<
Customer
>().
eq
(
Customer:
:
getCustomerBizId
,
customerBizId
));
}
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
String
addCustomer
(
CustomerAddRequest
customerAddRequest
)
{
// 校验 请求 对象中,参数是否全部为空
if
(
ValidateUtil
.
isAllFieldsNull
(
customerAddRequest
))
{
throw
new
BusinessException
(
ErrorCode
.
PARAMS_ERROR
.
getCode
(),
ErrorCode
.
PARAMS_ERROR
.
getMessage
());
}
// 客户主表信息
Customer
customer
=
new
Customer
();
BeanUtils
.
copyProperties
(
customerAddRequest
,
customer
);
// 客户扩展表信息
CustomerExpand
customerExpand
=
customerService
.
getCustomerExpand
(
customerAddRequest
);
// 获取 userBizId
// SecurityUtil.getLoginUser();
// customer.setUserBizId("");
// 客户主表业务唯一id
customer
.
setCustomerBizId
(
RandomStringGenerator
.
generateBizId16
(
"customer"
));
boolean
result
=
customerService
.
save
(
customer
);
if
(!
result
)
{
throw
new
BusinessException
(
ErrorCode
.
OPERATION_ERROR
.
getCode
(),
ErrorCode
.
OPERATION_ERROR
.
getMessage
());
}
// 客户扩展表信息,非空时,写入数据库
if
(!
ValidateUtil
.
isAllFieldsNull
(
customerAddRequest
))
{
// 主表业务唯一id
customerExpand
.
setCustomerBizId
(
customer
.
getCustomerBizId
());
// 客户扩展表业务唯一id
customerExpand
.
setCustomerExpandBizId
(
RandomStringGenerator
.
generateBizId16
(
"customer_expand"
));
// 写入数据库
boolean
resultExpand
=
customerExpandService
.
save
(
customerExpand
);
if
(!
resultExpand
)
{
throw
new
BusinessException
(
ErrorCode
.
OPERATION_ERROR
.
getCode
(),
ErrorCode
.
OPERATION_ERROR
.
getMessage
());
}
// 更新客户主表
Customer
updateCustomer
=
new
Customer
();
updateCustomer
.
setId
(
customer
.
getId
());
updateCustomer
.
setCustomerExpandBizId
(
customerExpand
.
getCustomerBizId
());
customerService
.
updateById
(
updateCustomer
);
}
return
customer
.
getCustomerBizId
();
}
}
}
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FnaServiceImpl.java
View file @
f3bce9aa
...
@@ -6,10 +6,12 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
...
@@ -6,10 +6,12 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yd.common.exception.BusinessException
;
import
com.yd.common.result.Result
;
import
com.yd.common.result.Result
;
import
com.yd.common.utils.RandomStringGenerator
;
import
com.yd.common.utils.RandomStringGenerator
;
import
com.yd.csf.service.common.ErrorCode
;
import
com.yd.csf.service.common.ErrorCode
;
import
com.yd.csf.service.dao.FnaMapper
;
import
com.yd.csf.service.dao.FnaMapper
;
import
com.yd.csf.service.dto.DeleteFnaRequest
;
import
com.yd.csf.service.dto.FnaAddRequest
;
import
com.yd.csf.service.dto.FnaAddRequest
;
import
com.yd.csf.service.dto.FnaQueryRequest
;
import
com.yd.csf.service.dto.FnaQueryRequest
;
import
com.yd.csf.service.model.Fna
;
import
com.yd.csf.service.model.Fna
;
...
@@ -207,4 +209,21 @@ public class FnaServiceImpl extends ServiceImpl<FnaMapper, Fna> implements FnaSe
...
@@ -207,4 +209,21 @@ public class FnaServiceImpl extends ServiceImpl<FnaMapper, Fna> implements FnaSe
return
baseMapper
.
update
(
fna
,
updateWrapper
)
>
0
;
return
baseMapper
.
update
(
fna
,
updateWrapper
)
>
0
;
}
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
deleteFna
(
DeleteFnaRequest
deleteRequest
)
{
Long
id
=
deleteRequest
.
getId
();
// 判断是否存在
Fna
oldFna
=
this
.
getById
(
id
);
if
(
oldFna
==
null
)
{
throw
new
BusinessException
(
ErrorCode
.
NOT_FOUND_ERROR
.
getCode
(),
ErrorCode
.
NOT_FOUND_ERROR
.
getMessage
());
}
// 操作数据库
boolean
result
=
this
.
removeById
(
id
);
if
(!
result
)
{
throw
new
BusinessException
(
ErrorCode
.
OPERATION_ERROR
.
getCode
(),
ErrorCode
.
OPERATION_ERROR
.
getMessage
());
}
return
result
;
}
}
}
yd-csf-service/src/main/java/com/yd/csf/service/vo/AddressVO.java
View file @
f3bce9aa
...
@@ -8,9 +8,15 @@ import java.io.Serializable;
...
@@ -8,9 +8,15 @@ import java.io.Serializable;
@Data
@Data
@ToString
@ToString
@Schema
(
description
=
"地址
residenceAddress-居住地址、residentialAddress-住宅地址、mailingAddress-邮寄地址、companyAddress-公司地址
"
)
@Schema
(
description
=
"地址"
)
public
class
AddressVO
implements
Serializable
{
public
class
AddressVO
implements
Serializable
{
/**
* 地址类型
*/
@Schema
(
description
=
"地址类型 residenceAddress-居住地址、residentialAddress-住宅地址、mailingAddress-邮寄地址、companyAddress-公司地址"
)
private
String
type
;
@Schema
(
description
=
"区域"
)
@Schema
(
description
=
"区域"
)
private
String
region
;
private
String
region
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment