demand: 新增寄件人地址不校验企业名称是否为空 修改寄件人地址添加企业名称格式校验
committer: heyu
This commit is contained in:
parent
f5991f7076
commit
9196fe5996
@ -141,8 +141,7 @@ public class EmisCustomerAddressController extends EmisBaseController
|
|||||||
|
|
||||||
@Log(title = "更新客户收寄件地址", businessType = BusinessType.UPDATE)
|
@Log(title = "更新客户收寄件地址", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/editAddress")
|
@PostMapping("/editAddress")
|
||||||
public AjaxResult editAddress(@RequestBody EmisCustomerAddress emisCustomerAddress)
|
public AjaxResult editAddress(@RequestBody EmisCustomerAddress emisCustomerAddress) throws EmisBizError {
|
||||||
{
|
|
||||||
return toAjax(emisCustomerAddressService.updateEmisCustomerAddress(emisCustomerAddress));
|
return toAjax(emisCustomerAddressService.updateEmisCustomerAddress(emisCustomerAddress));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,8 +152,7 @@ public class EmisCustomerAddressController extends EmisBaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('emis:emisCustomerAddress:edit')")
|
@PreAuthorize("@ss.hasPermi('emis:emisCustomerAddress:edit')")
|
||||||
@Log(title = "客户收寄件地址", businessType = BusinessType.UPDATE)
|
@Log(title = "客户收寄件地址", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody EmisCustomerAddress emisCustomerAddress)
|
public AjaxResult edit(@RequestBody EmisCustomerAddress emisCustomerAddress) throws EmisBizError {
|
||||||
{
|
|
||||||
return toAjax(emisCustomerAddressService.updateEmisCustomerAddress(emisCustomerAddress));
|
return toAjax(emisCustomerAddressService.updateEmisCustomerAddress(emisCustomerAddress));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -50,7 +50,7 @@ public interface IEmisCustomerAddressService
|
|||||||
* @param emisCustomerAddress 客户收寄件地址
|
* @param emisCustomerAddress 客户收寄件地址
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateEmisCustomerAddress(EmisCustomerAddress emisCustomerAddress);
|
public int updateEmisCustomerAddress(EmisCustomerAddress emisCustomerAddress) throws EmisBizError;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除客户收寄件地址
|
* 批量删除客户收寄件地址
|
||||||
|
|||||||
@ -12,6 +12,8 @@ package com.xdadan.erp.emis.service.impl;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.xdadan.erp.emis.domain.enumtype.EmisBizErrorType;
|
||||||
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||||
import com.xdadan.erp.emis.service.EmisBaseService;
|
import com.xdadan.erp.emis.service.EmisBaseService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -69,8 +71,21 @@ public class EmisCustomerAddressServiceImpl extends EmisBaseService implements I
|
|||||||
emisCustomerAddress.setUseSiteCode(getCurrentUser().getOwnerSiteCode());
|
emisCustomerAddress.setUseSiteCode(getCurrentUser().getOwnerSiteCode());
|
||||||
emisCustomerAddress.setUseSite(getCurrentUser().getOwnerSiteName());
|
emisCustomerAddress.setUseSite(getCurrentUser().getOwnerSiteName());
|
||||||
|
|
||||||
// 创建用户
|
// 验证企业名称格式
|
||||||
return createCustomerAddressNew(emisCustomerAddress);
|
if (!validateEnterpriseName(emisCustomerAddress.getEnterpriseName())) {
|
||||||
|
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "企业名称不能包含空格、回车、@、#、$、%、&、数字等特殊符号");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证企业税号格式
|
||||||
|
if (!validateEnterpriseTaxId(emisCustomerAddress.getEnterpriseTaxId())) {
|
||||||
|
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "企业税号必须为8-18位数字和大写字母组成,不能包含汉字、空格等特殊符号");
|
||||||
|
}
|
||||||
|
List<EmisCustomerAddress> emisCustomerAddressList = emisCustomerAddressMapper.checkAndQuery(emisCustomerAddress);
|
||||||
|
if (CollectionUtil.isEmpty(emisCustomerAddressList)) {
|
||||||
|
// 不重复的情况则 创建地址
|
||||||
|
return emisCustomerAddressMapper.insertEmisCustomerAddress(emisCustomerAddress);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -80,12 +95,20 @@ public class EmisCustomerAddressServiceImpl extends EmisBaseService implements I
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateEmisCustomerAddress(EmisCustomerAddress emisCustomerAddress)
|
public int updateEmisCustomerAddress(EmisCustomerAddress emisCustomerAddress) throws EmisBizError {
|
||||||
{
|
|
||||||
// emisCustomerAddress.preUpdate();
|
// emisCustomerAddress.preUpdate();
|
||||||
// emisCustomerAddress.setUseSiteCode(getCurrentUser().getOwnerSiteCode());
|
// emisCustomerAddress.setUseSiteCode(getCurrentUser().getOwnerSiteCode());
|
||||||
// emisCustomerAddress.setUseSite(getCurrentUser().getOwnerSiteName());
|
// emisCustomerAddress.setUseSite(getCurrentUser().getOwnerSiteName());
|
||||||
|
|
||||||
|
// 验证企业名称格式
|
||||||
|
if (!validateEnterpriseName(emisCustomerAddress.getEnterpriseName())) {
|
||||||
|
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "企业名称不能包含空格、回车、@、#、$、%、&、数字等特殊符号");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证企业税号格式
|
||||||
|
if (!validateEnterpriseTaxId(emisCustomerAddress.getEnterpriseTaxId())) {
|
||||||
|
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "企业税号必须为8-18位数字和大写字母组成,不能包含汉字、空格等特殊符号");
|
||||||
|
}
|
||||||
return emisCustomerAddressMapper.updateEmisCustomerAddress(emisCustomerAddress);
|
return emisCustomerAddressMapper.updateEmisCustomerAddress(emisCustomerAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user