Merge pull request 'develop' (#164) from develop into master

Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/164
This commit is contained in:
heyu 2025-08-26 13:46:10 +08:00
commit 16d6aa6b03
13 changed files with 277 additions and 64 deletions

View File

@ -1,11 +1,11 @@
/**
/**
* @Project: emis
* @Title: EmisCustomerAddressController.java
* @author linfso
* @date 2024-03-01 04:47:51
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @version v1.0
* @Description: <p> 客户收寄件地址 控制器 </p>
*/
@ -16,6 +16,7 @@ import javax.servlet.http.HttpServletResponse;
import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter;
import com.xdadan.erp.common.core.domain.entity.SysUser;
import com.xdadan.erp.emis.domain.exception.EmisBizError;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
@ -33,7 +34,7 @@ import com.xdadan.erp.emis.service.IEmisCustomerAddressService;
/**
* 客户收寄件地址Controller
*
*
* @author linfso
* @date 2024-03-01 04:47:51
*/
@ -60,7 +61,7 @@ public class EmisCustomerAddressController extends EmisBaseController
}
// @PreAuthorize("@ss.hasPermi('emis:emisCustomerAddress:list')")
@JacksonFilter(include= {"id","name","phone","country","province","city","county","countryName","provinceName","cityName","countyName","town","townName","address","postCode","email","company","blDefaultFlag","orderNum","createTime","remark"},value= EmisCustomerAddress.class,type= JacksonFilter.JscksonFilterType.RESPONSE)
@JacksonFilter(include= {"id","name","phone","country","province","city","county","countryName","provinceName","cityName","countyName","town","townName","address","postCode","email","company","blDefaultFlag","orderNum","createTime","remark","enterpriseName","enterpriseTaxId"},value= EmisCustomerAddress.class,type= JacksonFilter.JscksonFilterType.RESPONSE)
@GetMapping("/listSimple")
public TableDataInfo listSimple(EmisCustomerAddress emisCustomerAddress)
{
@ -75,7 +76,7 @@ public class EmisCustomerAddressController extends EmisBaseController
}
@JacksonFilter(include= {"id","name","phone","country","province","city","county","address","postCode","email","company","countryName","provinceName","cityName","countyName","town","townName","blDefaultFlag","orderNum","createTime","remark"},value= EmisCustomerAddress.class,type= JacksonFilter.JscksonFilterType.RESPONSE)
@JacksonFilter(include= {"id","name","phone","country","province","city","county","address","postCode","email","company","countryName","provinceName","cityName","countyName","town","townName","blDefaultFlag","orderNum","createTime","remark","enterpriseName","enterpriseTaxId"},value= EmisCustomerAddress.class,type= JacksonFilter.JscksonFilterType.RESPONSE)
@RequestMapping("/getAddressById")
public AjaxResult getAddressById(@RequestParam("id") Long id)
{
@ -124,16 +125,14 @@ public class EmisCustomerAddressController extends EmisBaseController
@PreAuthorize("@ss.hasPermi('emis:emisCustomerAddress:add')")
@Log(title = "客户收寄件地址", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EmisCustomerAddress emisCustomerAddress)
{
public AjaxResult add(@RequestBody EmisCustomerAddress emisCustomerAddress) throws EmisBizError {
return toAjax(emisCustomerAddressService.insertEmisCustomerAddress(emisCustomerAddress));
}
@Log(title = "客户收寄件地址", businessType = BusinessType.INSERT)
@PostMapping("/addAddress")
public AjaxResult addAddress(@RequestBody EmisCustomerAddress emisCustomerAddress)
{
public AjaxResult addAddress(@RequestBody EmisCustomerAddress emisCustomerAddress) throws EmisBizError {
String ownerSiteCode = getLoginUser().getUser().getOwnerSiteCode();
emisCustomerAddress.setUseSiteCode(ownerSiteCode);
emisCustomerAddress.setUseSite(ownerSiteCode);

View File

@ -83,4 +83,9 @@ public class EmisCustomerAddress extends BaseEntity
/* 使用站点名称 */
private String useSiteName;
/* 企业名称 */
private String enterpriseName;
/* 企业税号 */
private String enterpriseTaxId;
}

View File

@ -156,6 +156,10 @@ public class EmisWaybill extends BaseEntity
private String sendPostcode;
/* 发件人省市区名称,逗号分隔 */
private String sendPcd;
/* 企业名称 */
private String enterpriseName;
/* 企业税号 */
private String enterpriseTaxId;
/* 支付方式 : 现金或月结 */
@TableField
@DataAuditField(fieldComment = "支付方式",dictType="emis_payment_type")

View File

@ -41,4 +41,8 @@ public class Sender implements Serializable {
private String email;
/* 公司 */
private String company;
/* 企业名称 */
private String enterpriseName;
/* 企业税号 */
private String enterpriseTaxId;
}

View File

@ -502,6 +502,8 @@ public class WaybillOrder implements Serializable {
sender.setAddress(dbWaybill.getSendAddress());
sender.setPostCode(dbWaybill.getSendPostcode());
sender.setCompany(dbWaybill.getSendCompany());
sender.setEnterpriseName(dbWaybill.getEnterpriseName());
sender.setEnterpriseTaxId(dbWaybill.getEnterpriseTaxId());
voItem.setSender(sender);
// voItem.setId(dbWaybill.getId());
@ -785,6 +787,8 @@ public class WaybillOrder implements Serializable {
dbWaybill.setSendAddress(sender.getAddress());
dbWaybill.setSendPostcode(sender.getPostCode());
dbWaybill.setSendCompany(sender.getCompany());
dbWaybill.setEnterpriseName(sender.getEnterpriseName());
dbWaybill.setEnterpriseTaxId(sender.getEnterpriseTaxId());
}
dbWaybill.setPaymentType(this.getPaymentType());

View File

@ -1,10 +1,10 @@
/**
/**
* @Project: emis
* @Title: EmisCustomerAddressMapper.java
* @author linfso
* @date 2024-03-01 04:47:51
* @Copyright: ShangHai Doitinfo 2022 All rights reserved.
* @version v1.0
* @version v1.0
* @Description: <p> 客户收寄件地址 Mapper 接口 </p>
* <span style='color:red'> Warning : This file is generate by ai tools,don't edit!!! </span>
*/
@ -30,31 +30,31 @@ public interface EmisCustomerAddressMapper extends BaseMapper<EmisCustomerAddres
/**
* 主键查询
* @param id
* @return
* @return
*/
public EmisCustomerAddress selectEmisCustomerAddressById(Long id);
/**
* 查询列表
*
* @param emisCustomerAddress
*
* @param emisCustomerAddress
* @return 集合
*/
public List<EmisCustomerAddress> selectEmisCustomerAddressList(EmisCustomerAddress emisCustomerAddress);
/**
* 新增
*
* 新增
*
* @param emisCustomerAddress
* @return
* @return
*/
public int insertEmisCustomerAddress(EmisCustomerAddress emisCustomerAddress);
/**
* 修改
*
* @param emisCustomerAddress
* @return
*
* @param emisCustomerAddress
* @return
*/
public int updateEmisCustomerAddress(EmisCustomerAddress emisCustomerAddress);
@ -62,7 +62,7 @@ public interface EmisCustomerAddressMapper extends BaseMapper<EmisCustomerAddres
/**
* 删除
*
*
* @param id 主键
* @return 结果
*/
@ -70,7 +70,7 @@ public interface EmisCustomerAddressMapper extends BaseMapper<EmisCustomerAddres
/**
* 批量删除
*
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
@ -101,6 +101,14 @@ public interface EmisCustomerAddressMapper extends BaseMapper<EmisCustomerAddres
*/
public int checkUnique(EmisCustomerAddress emisCustomerAddress);
/**
* 检查是否重复
*
* @param emisCustomerAddress
* @return
*/
public List<EmisCustomerAddress> checkAndQuery(EmisCustomerAddress emisCustomerAddress);
/**
* 查询重复的地址,并且给客户打上标签

View File

@ -3552,6 +3552,62 @@ public class EmisBaseService {
}
/**
* 根据添加的地址增加客户
*
* @param emisCustomerAddressNew
* @return
*/
public int createCustomerAddressNew(EmisCustomerAddress emisCustomerAddressNew) throws EmisBizError {
checkAdress(emisCustomerAddressNew);
List<EmisCustomerAddress> emisCustomerAddressList = emisCustomerAddressMapper.checkAndQuery(emisCustomerAddressNew);
if (CollectionUtil.isEmpty(emisCustomerAddressList)) {
// 不重复的情况则 创建地址
return emisCustomerAddressMapper.insertEmisCustomerAddress(emisCustomerAddressNew);
} else {
if ("1".equals(emisCustomerAddressNew.getAddressType()) && "0086".equals(emisCustomerAddressNew.getCountry())) {
List<Long> emisCustomerAddressIds = emisCustomerAddressList.stream().filter(i -> (StringUtil.isBlank(i.getEnterpriseTaxId()) || StringUtil.isBlank(i.getEnterpriseName()))).map(EmisCustomerAddress::getId).collect(Collectors.toList());
if (CollectionUtil.isEmpty(emisCustomerAddressIds)) {
return 1;
}
for (Long id : emisCustomerAddressIds) {
EmisCustomerAddress emisCustomerAddress = new EmisCustomerAddress();
emisCustomerAddress.setId(id);
emisCustomerAddress.setEnterpriseTaxId(emisCustomerAddressNew.getEnterpriseTaxId());
emisCustomerAddress.setEnterpriseName(emisCustomerAddressNew.getEnterpriseName());
emisCustomerAddressMapper.updateEmisCustomerAddress(emisCustomerAddress);
}
}
}
return 1;
}
public void checkAdress(EmisCustomerAddress emisCustomerAddressNew) throws EmisBizError {
if ("1".equals(emisCustomerAddressNew.getAddressType())) {
if ("0086".equals(emisCustomerAddressNew.getCountry())) {
if (StringUtil.isBlank(emisCustomerAddressNew.getEnterpriseTaxId()) || StringUtil.isBlank(emisCustomerAddressNew.getEnterpriseName())) {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1, "企业名称/企业税号不能为空");
}
// 验证企业名称格式
if (!validateEnterpriseName(emisCustomerAddressNew.getEnterpriseName())) {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "企业名称不能包含空格、回车、@、#、$、%、&、数字等特殊符号");
}
// 验证企业税号格式
if (!validateEnterpriseTaxId(emisCustomerAddressNew.getEnterpriseTaxId())) {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "企业税号必须为8-18位数字和大写字母组成,不能包含汉字、空格等特殊符号");
}
} else {
emisCustomerAddressNew.setEnterpriseName(null);
emisCustomerAddressNew.setEnterpriseTaxId(null);
}
} else {
emisCustomerAddressNew.setEnterpriseName(null);
emisCustomerAddressNew.setEnterpriseTaxId(null);
}
}
/**
* 根据添加的地址增加客户
@ -3572,6 +3628,49 @@ public class EmisBaseService {
return 1;
}
/**
* 验证企业名称格式
* 不允许包含空格、回车、@、#、$、%、&、数字等特殊符号
*/
public boolean validateEnterpriseName(String enterpriseName) {
if (com.xdadan.erp.common.utils.StringUtils.isEmpty(enterpriseName)) {
return false;
}
// 检查是否包含不允许的字符
String invalidChars = " @#$%&0123456789";
for (char c : invalidChars.toCharArray()) {
if (enterpriseName.contains(String.valueOf(c))) {
return false;
}
}
// 检查是否包含回车符
if (enterpriseName.contains("\n") || enterpriseName.contains("\r")) {
return false;
}
return true;
}
/**
* 验证企业税号格式
* 8-18位数组成,由数字和大写字母组成,不允许有汉字、空格等特殊符号
*/
public boolean validateEnterpriseTaxId(String enterpriseTaxId) {
if (com.xdadan.erp.common.utils.StringUtils.isEmpty(enterpriseTaxId)) {
return false;
}
// 检查长度
if (enterpriseTaxId.length() < 8 || enterpriseTaxId.length() > 18) {
return false;
}
// 检查是否只包含数字和大写字母
return enterpriseTaxId.matches("^[0-9A-Z]+$");
}
/**
* 获取线路
* @param code
@ -5529,8 +5628,8 @@ public class EmisBaseService {
}
if (emisWaybillSave.getParcelQty().equals(emisWaybillOld.getParcelQty())
&& emisWaybillSave.getBillWeight().equals(emisWaybillOld.getBillWeight())
&& emisWaybillSave.getTotalVolume().equals(emisWaybillOld.getTotalVolume())) {
&& emisWaybillSave.getBillWeight().stripTrailingZeros().equals(emisWaybillOld.getBillWeight().stripTrailingZeros())
&& emisWaybillSave.getTotalVolume().stripTrailingZeros().equals(emisWaybillOld.getTotalVolume().stripTrailingZeros())) {
return;
}

View File

@ -1,16 +1,17 @@
/**
/**
* @Project: emis
* @Title: EmisCustomerAddressService.java
* @author linfso
* @date 2024-03-01 04:47:51
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @version v1.0
* @Description: <p> 客户收寄件地址 服务类接口 </p>
*/
package com.xdadan.erp.emis.service;
import java.util.List;
import com.xdadan.erp.emis.domain.EmisCustomerAddress;
import com.xdadan.erp.emis.domain.exception.EmisBizError;
/**
* @ClassName EmisCustomerAddressService
@ -18,18 +19,18 @@ import com.xdadan.erp.emis.domain.EmisCustomerAddress;
* @author linfso
* @date 2024-03-01 04:47:51
*/
public interface IEmisCustomerAddressService
public interface IEmisCustomerAddressService
{
/**
* 主键查询
* @param id
* @return
* @return
*/
public EmisCustomerAddress selectEmisCustomerAddressById(Long id);
/**
* 查询客户收寄件地址列表
*
*
* @param emisCustomerAddress 客户收寄件地址
* @return 客户收寄件地址集合
*/
@ -37,15 +38,15 @@ public interface IEmisCustomerAddressService
/**
* 新增客户收寄件地址
*
*
* @param emisCustomerAddress 客户收寄件地址
* @return 结果
*/
public int insertEmisCustomerAddress(EmisCustomerAddress emisCustomerAddress);
public int insertEmisCustomerAddress(EmisCustomerAddress emisCustomerAddress) throws EmisBizError;
/**
* 修改客户收寄件地址
*
*
* @param emisCustomerAddress 客户收寄件地址
* @return 结果
*/
@ -53,7 +54,7 @@ public interface IEmisCustomerAddressService
/**
* 批量删除客户收寄件地址
*
*
* @param ids 需要删除的客户收寄件地址主键集合
* @return 结果
*/
@ -61,7 +62,7 @@ public interface IEmisCustomerAddressService
/**
* 删除客户收寄件地址信息
*
*
* @param id 客户收寄件地址主键
* @return 结果
*/

View File

@ -1,10 +1,10 @@
/**
/**
* @Project: emis
* @Title: EmisCustomerAddressServiceImpl.java
* @author linfso
* @date 2024-03-01 04:47:51
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @version v1.0
* @Description: <p> 客户收寄件地址 实体类 </p>
*/
@ -12,6 +12,7 @@ package com.xdadan.erp.emis.service.impl;
import java.util.List;
import com.xdadan.erp.emis.domain.exception.EmisBizError;
import com.xdadan.erp.emis.service.EmisBaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -21,7 +22,7 @@ import com.xdadan.erp.emis.service.IEmisCustomerAddressService;
/**
* 客户收寄件地址Service业务层处理
*
*
* @author linfso
* @date 2024-03-01 04:47:51
*/
@ -33,7 +34,7 @@ public class EmisCustomerAddressServiceImpl extends EmisBaseService implements I
/**
* 查询客户收寄件地址
*
*
* @param id 客户收寄件地址主键
* @return 客户收寄件地址
*/
@ -45,7 +46,7 @@ public class EmisCustomerAddressServiceImpl extends EmisBaseService implements I
/**
* 查询客户收寄件地址列表
*
*
* @param emisCustomerAddress 客户收寄件地址
* @return 客户收寄件地址
*/
@ -57,25 +58,24 @@ public class EmisCustomerAddressServiceImpl extends EmisBaseService implements I
/**
* 新增客户收寄件地址
*
*
* @param emisCustomerAddress 客户收寄件地址
* @return 结果
*/
@Override
public int insertEmisCustomerAddress(EmisCustomerAddress emisCustomerAddress)
{
public int insertEmisCustomerAddress(EmisCustomerAddress emisCustomerAddress) throws EmisBizError {
// 新增地址
emisCustomerAddress.preInsert();
emisCustomerAddress.setUseSiteCode(getCurrentUser().getOwnerSiteCode());
emisCustomerAddress.setUseSite(getCurrentUser().getOwnerSiteName());
// 创建用户
return emisCustomerAddressMapper.insertEmisCustomerAddress(emisCustomerAddress);
return createCustomerAddressNew(emisCustomerAddress);
}
/**
* 修改客户收寄件地址
*
*
* @param emisCustomerAddress 客户收寄件地址
* @return 结果
*/
@ -91,7 +91,7 @@ public class EmisCustomerAddressServiceImpl extends EmisBaseService implements I
/**
* 批量删除客户收寄件地址
*
*
* @param ids 需要删除的客户收寄件地址主键
* @return 结果
*/
@ -103,7 +103,7 @@ public class EmisCustomerAddressServiceImpl extends EmisBaseService implements I
/**
* 删除客户收寄件地址信息
*
*
* @param id 客户收寄件地址主键
* @return 结果
*/

View File

@ -1,10 +1,10 @@
/**
/**
* @Project: emis
* @Title: EmisWaybillAjustApplyServiceImpl.java
* @author linfso
* @date 2024-06-25 23:39:28
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @version v1.0
* @Description: <p> 运单调整申请 实体类 </p>
*/
@ -37,7 +37,7 @@ import org.springframework.transaction.annotation.Transactional;
/**
* 运单调整申请Service业务层处理
*
*
* @author linfso
* @date 2024-06-25 23:39:28
*/
@ -72,7 +72,7 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements
/**
* 查询运单调整申请
*
*
* @param id 运单调整申请主键
* @return 运单调整申请
*/
@ -85,7 +85,7 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements
/**
* 查询运单调整申请列表
*
*
* @param emisWaybillAjustApply 运单调整申请
* @return 运单调整申请
*/
@ -97,8 +97,8 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements
/**
* 检查是否重复
*
* @param emisWaybillAjustApply
*
* @param emisWaybillAjustApply
* @return 数量
*/
@Override
@ -109,13 +109,14 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements
/**
* 新增运单调整申请
*
*
* @param emisWaybillAjustApply 运单调整申请
* @return 结果
*/
@Override
public int insertEmisWaybillAjustApply(EmisWaybillAjustApply emisWaybillAjustApply) throws EmisBizError {
EmisWaybill emisWaybillSave = getEmisWaybillNewFromJson(emisWaybillAjustApply);
// 判断单号是否存在
EmisWaybill emisWaybillOld=getWaybillByBillCode(emisWaybillAjustApply.getBillCode());
if(emisWaybillOld==null){
@ -148,6 +149,25 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements
checkVirtualParam(getEmisWaybillNewFromJson(emisWaybillAjustApply),emisWaybillOld);
}
// 发件地址
EmisCustomerAddress sendAddress = new EmisCustomerAddress();
sendAddress.setCountry(emisWaybillSave.getSendCountry());
sendAddress.setName(emisWaybillSave.getSendName());
sendAddress.setPhone(emisWaybillSave.getSendMobile());
sendAddress.setProvince(emisWaybillSave.getSendProvince());
sendAddress.setCity(emisWaybillSave.getSendCity());
sendAddress.setCounty(emisWaybillSave.getSendCounty());
sendAddress.setTown(emisWaybillSave.getSendTown());
// recieveAddress.setEmail(emisWaybillSave);
sendAddress.setAddress(emisWaybillSave.getSendAddress());
sendAddress.setCompany(emisWaybillSave.getSendCompany());
sendAddress.setUseSiteCode(emisWaybillSave.getSendSiteCode());
sendAddress.setAddressType("1");
sendAddress.setEnterpriseName(emisWaybillSave.getEnterpriseName());
sendAddress.setEnterpriseTaxId(emisWaybillSave.getEnterpriseTaxId());
checkAdress(sendAddress);
// 插入数据
emisWaybillAjustApply.setApplyDate(new Date());
emisWaybillAjustApply.setApplySiteCode(SecurityUtils.getLoginUser().getUser().getOwnerSiteCode());
@ -180,7 +200,7 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements
/**
* 修改运单调整申请
*
*
* @param emisWaybillAjustApply 运单调整申请
* @return 结果
*/
@ -192,7 +212,7 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements
/**
* 批量删除运单调整申请
*
*
* @param ids 需要删除的运单调整申请主键
* @return 结果
*/
@ -204,7 +224,7 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements
/**
* 删除运单调整申请信息
*
*
* @param id 运单调整申请主键
* @return 结果
*/

View File

@ -2510,6 +2510,8 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
sendAddress.setUseSiteCode(emisWaybillSave.getSendSiteCode());
sendAddress.setAddressType("1");
sendAddress.setEnterpriseName(emisWaybillSave.getEnterpriseName());
sendAddress.setEnterpriseTaxId(emisWaybillSave.getEnterpriseTaxId());
// 收件地址
EmisCustomerAddress recieveAddress = new EmisCustomerAddress();
@ -2626,7 +2628,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
}
// 保存客户收件、寄件地址,开单不要关联客户地址数据
createCustomerAddress(sendAddress);
createCustomerAddressNew(sendAddress);
createCustomerAddress(recieveAddress);
emisWaybillSave.setCustomerCode(customerCode);

View File

@ -27,6 +27,8 @@
<result property="blSiteDefaultFlag" column="bl_site_default_flag" />
<result property="useSite" column="use_site" />
<result property="useSiteCode" column="use_site_code" />
<result property="enterpriseName" column="enterprise_name" />
<result property="enterpriseTaxId" column="enterprise_tax_id" />
<association property="countryName" column="country" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectCountryNameByCode"/>
@ -38,7 +40,7 @@
</resultMap>
<sql id="selectEmisCustomerAddressVo">
select id, user_id, customer_code, short_name, alias, address_type, country, name, phone, province, city, county, town, address, post_code, email, company, bl_default_flag, order_num, bl_site_default_flag, use_site, use_site_code, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site from emis_customer_address
select id, user_id, customer_code, short_name, alias, address_type, country, name, phone, province, city, county, town, address, post_code, email, company, bl_default_flag, order_num, bl_site_default_flag, use_site, use_site_code, enterprise_name, enterprise_tax_id, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site from emis_customer_address
</sql>
@ -63,6 +65,8 @@
<if test="postCode != null and postCode != ''"> and post_code like concat('%', #{postCode}, '%')</if>
<if test="email != null and email != ''"> and email like concat('%', #{email}, '%')</if>
<if test="company != null and company != ''"> and company like concat('%', #{company}, '%')</if>
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="enterpriseTaxId != null and enterpriseTaxId != ''"> and enterprise_tax_id like concat('%', #{enterpriseTaxId}, '%')</if>
<if test="blDefaultFlag != null and blDefaultFlag != ''"> and bl_default_flag = #{blDefaultFlag}</if>
<if test="orderNum != null "> and order_num like concat('%', #{orderNum}, '%')</if>
<if test="blSiteDefaultFlag != null and blSiteDefaultFlag != ''"> and bl_site_default_flag like concat('%', #{blSiteDefaultFlag}, '%')</if>
@ -79,7 +83,7 @@
<if test="useSiteCode != null and useSiteCode != ''"> and FIND_IN_SET(use_site_code, #{useSiteCode})</if>
<if test="searchValue != null and searchValue != ''">
and ( name like concat('%',#{searchValue}, '%') or phone like concat('%',#{searchValue}, '%') or company like concat('%',#{searchValue}, '%') )
and ( name like concat('%',#{searchValue}, '%') or phone like concat('%',#{searchValue}, '%') or company like concat('%',#{searchValue}, '%') or enterprise_name like concat('%',#{searchValue}, '%') or enterprise_tax_id like concat('%',#{searchValue}, '%') )
</if>
</where>
@ -87,7 +91,7 @@
</select>
<select id="selectEmisCustomerAddressById" parameterType="Long" resultMap="EmisCustomerAddressResult">
select id, user_id, customer_code, short_name, alias, address_type, country, name, phone, province, city, county, town, address, post_code, email, company, bl_default_flag, order_num, bl_site_default_flag, use_site, use_site_code, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site
select id, user_id, customer_code, short_name, alias, address_type, country, name, phone, province, city, county, town, address, post_code, email, company, bl_default_flag, order_num, bl_site_default_flag, use_site, use_site_code, enterprise_name, enterprise_tax_id, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site
from emis_customer_address a
where a.id = #{id}
</select>
@ -116,6 +120,8 @@
<if test="blSiteDefaultFlag != null and blSiteDefaultFlag != ''">bl_site_default_flag,</if>
<if test="useSite != null and useSite != ''">use_site,</if>
<if test="useSiteCode != null and useSiteCode != ''">use_site_code,</if>
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name,</if>
<if test="enterpriseTaxId != null and enterpriseTaxId != ''">enterprise_tax_id,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
@ -147,6 +153,8 @@
<if test="blSiteDefaultFlag != null and blSiteDefaultFlag != ''">#{blSiteDefaultFlag},</if>
<if test="useSite != null and useSite != ''">#{useSite},</if>
<if test="useSiteCode != null and useSiteCode != ''">#{useSiteCode},</if>
<if test="enterpriseName != null and enterpriseName != ''">#{enterpriseName},</if>
<if test="enterpriseTaxId != null and enterpriseTaxId != ''">#{enterpriseTaxId},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
@ -179,6 +187,8 @@
<if test="blDefaultFlag != null and blDefaultFlag != ''">bl_default_flag = #{blDefaultFlag},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="blSiteDefaultFlag != null and blSiteDefaultFlag != ''">bl_site_default_flag = #{blSiteDefaultFlag},</if>
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name = #{enterpriseName},</if>
<if test="enterpriseTaxId != null and enterpriseTaxId != ''">enterprise_tax_id = #{enterpriseTaxId},</if>
<if test="useSite != null and useSite != ''">use_site = #{useSite},</if>
<if test="useSiteCode != null and useSiteCode != ''">use_site_code = #{useSiteCode},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
@ -237,6 +247,12 @@
<if test="company != null and company != ''">and company = #{company}</if>
<if test="company == null">and company is null</if>
<if test="enterpriseName != null and enterpriseName != ''">and enterprise_name = #{enterpriseName}</if>
<if test="enterpriseName == null">and enterprise_name is null</if>
<if test="enterpriseTaxId != null and enterpriseTaxId != ''">and enterprise_tax_id = #{enterpriseTaxId}</if>
<if test="enterpriseTaxId == null">and enterprise_tax_id is null</if>
and address_type = #{addressType}
and customer_code is null
</select>
@ -266,5 +282,34 @@
limit 1
</select>
<select id="checkAndQuery" parameterType="EmisCustomerAddress" resultMap="EmisCustomerAddressResult">
select * from emis_customer_address
where del_flag='0'
and country = #{country}
and `name` = #{name}
and phone = #{phone}
and province = #{province}
</mapper>
<if test="city != null and city != ''"> and city = #{city}</if>
<if test="city == null">and city is null</if>
<if test="county != null and county != ''">and county = #{county}</if>
<if test="county == null ">and county is null</if>
<if test="address != null and address != ''">and address = #{address}</if>
<if test="address == null">and address is null</if>
<if test="company != null and company != ''">and company = #{company}</if>
<if test="company == null">and company is null</if>
<if test="enterpriseName != null and enterpriseName != ''">and enterprise_name = #{enterpriseName}</if>
<if test="enterpriseName == null">and enterprise_name is null</if>
<if test="enterpriseTaxId != null and enterpriseTaxId != ''">and enterprise_tax_id = #{enterpriseTaxId}</if>
<if test="enterpriseTaxId == null">and enterprise_tax_id is null</if>
and address_type = #{addressType}
</select>
</mapper>

View File

@ -44,6 +44,8 @@
<result property="sendAddress" column="send_address" />
<result property="sendPostcode" column="send_postcode" />
<result property="sendPcd" column="send_pcd" />
<result property="enterpriseName" column="enterprise_name" />
<result property="enterpriseTaxId" column="enterprise_tax_id" />
<result property="paymentType" column="payment_type" />
<result property="calcFeeType" column="calc_fee_type" />
<result property="custNo" column="cust_no" />
@ -299,7 +301,7 @@
a.receive_company, a.receive_mobile, a.receive_tel, a.receive_country, a.receive_province, a.receive_city,
a.receive_county, a.receive_town, a.receive_address, a.receive_postcode, a.receive_pcd, a.send_name, a.send_company,a.start_site_code,
a.send_mobile, a.send_tel, a.send_country, a.send_province, a.send_city, a.send_county, a.send_town, a.send_address,
a.send_postcode, a.send_pcd, a.payment_type, a.calc_fee_type, a.cust_no, a.cust_name, a.trans_line_type, a.product_type,
a.send_postcode, a.send_pcd, a.enterprise_name, a.enterprise_tax_id, a.payment_type, a.calc_fee_type, a.cust_no, a.cust_name, a.trans_line_type, a.product_type,
a.time_type, a.meter_type, a.carry_type, a.customs_clear, a.customs_eclaration, a.estimate_date, a.pack_type, a.dispatch_method,
a.pickup_method, a.pick_start_date, a.pick_finish_date, a.pick_fail_reason, a.into_warehouse_code,
a.into_warehouse_name, a.into_warehouse_address, a.into_warehouse_contact, a.into_warehouse_phone,
@ -400,7 +402,7 @@
a.receive_company, a.receive_mobile, a.receive_tel, a.receive_country, a.receive_province, a.receive_city,
a.receive_county, a.receive_town, a.receive_address, a.receive_postcode, a.receive_pcd, a.send_name, a.send_company,
a.send_mobile, a.send_tel, a.send_country, a.send_province, a.send_city, a.send_county, a.send_town, a.send_address,
a.send_postcode, a.send_pcd, a.payment_type, a.calc_fee_type, a.cust_no, a.cust_name, a.trans_line_type, a.product_type,
a.send_postcode, a.send_pcd, a.enterprise_name, a.enterprise_tax_id, a.payment_type, a.calc_fee_type, a.cust_no, a.cust_name, a.trans_line_type, a.product_type,
a.time_type, a.meter_type, a.carry_type, a.customs_clear, a.customs_eclaration, a.estimate_date, a.pack_type, a.dispatch_method,
a.pickup_method, a.pick_start_date, a.pick_finish_date, a.pick_fail_reason, a.into_warehouse_code,
a.into_warehouse_name, a.into_warehouse_address, a.into_warehouse_contact, a.into_warehouse_phone,
@ -664,6 +666,8 @@
<if test="sendTown != null and sendTown != ''"> and send_town=#{sendTown}</if>
<if test="sendAddress != null and sendAddress != ''"> and send_address like concat('%', #{sendAddress}, '%')</if>
<if test="sendPostcode != null and sendPostcode != ''"> and send_postcode like concat('%', #{sendPostcode}, '%')</if>
<if test="enterpriseName != null and enterpriseName != ''"> and a.enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="enterpriseTaxId != null and enterpriseTaxId != ''"> and a.enterprise_tax_id like concat('%', #{enterpriseTaxId}, '%')</if>
<if test="paymentType != null and paymentType != ''"> and payment_type=#{paymentType}</if>
<if test="calcFeeType != null and calcFeeType != ''"> and calc_fee_type=#{calcFeeType}</if>
<if test="custNo != null and custNo != ''"> and cust_no like concat('%', #{custNo}, '%')</if>
@ -913,6 +917,8 @@
<if test="sendTown != null and sendTown != ''"> and a.send_town=#{sendTown}</if>
<if test="sendAddress != null and sendAddress != ''"> and a.send_address like concat('%', #{sendAddress}, '%')</if>
<if test="sendPostcode != null and sendPostcode != ''"> and a.send_postcode like concat('%', #{sendPostcode}, '%')</if>
<if test="enterpriseName != null and enterpriseName != ''"> and a.enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="enterpriseTaxId != null and enterpriseTaxId != ''"> and a.enterprise_tax_id like concat('%', #{enterpriseTaxId}, '%')</if>
<if test="paymentType != null and paymentType != ''"> and a.payment_type=#{paymentType}</if>
<if test="calcFeeType != null and calcFeeType != ''"> and a.calc_fee_type=#{calcFeeType}</if>
<if test="custNo != null and custNo != ''"> and a.cust_no like concat('%', #{custNo}, '%')</if>
@ -1210,6 +1216,8 @@
<if test="blVirtual ==1"> and bl_virtual=#{blVirtual}</if>
<if test="sendAddress != null and sendAddress != ''"> and send_address like concat('%', #{sendAddress}, '%')</if>
<if test="sendPostcode != null and sendPostcode != ''"> and send_postcode like concat('%', #{sendPostcode}, '%')</if>
<if test="enterpriseName != null and enterpriseName != ''"> and a.enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="enterpriseTaxId != null and enterpriseTaxId != ''"> and a.enterprise_tax_id like concat('%', #{enterpriseTaxId}, '%')</if>
<if test="paymentType != null and paymentType != ''"> and FIND_IN_SET(payment_type,#{paymentType})</if>
<if test="calcFeeType != null and calcFeeType != ''"> and calc_fee_type=#{calcFeeType}</if>
<if test="custNo != null and custNo != ''"> and cust_no like concat('%', #{custNo}, '%')</if>
@ -1609,6 +1617,8 @@
<if test="sendTown != null and sendTown != ''"> and send_town=#{sendTown}</if>
<if test="sendAddress != null and sendAddress != ''"> and send_address like concat('%', #{sendAddress}, '%')</if>
<if test="sendPostcode != null and sendPostcode != ''"> and send_postcode like concat('%', #{sendPostcode}, '%')</if>
<if test="enterpriseName != null and enterpriseName != ''"> and a.enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="enterpriseTaxId != null and enterpriseTaxId != ''"> and a.enterprise_tax_id like concat('%', #{enterpriseTaxId}, '%')</if>
<if test="paymentType != null and paymentType != ''"> and FIND_IN_SET(payment_type,#{paymentType})</if>
<if test="calcFeeType != null and calcFeeType != ''"> and calc_fee_type=#{calcFeeType}</if>
<if test="custNo != null and custNo != ''"> and cust_no like concat('%', #{custNo}, '%')</if>
@ -2078,6 +2088,8 @@
<if test="sendTown != null and sendTown != ''"> and send_town=#{sendTown}</if>
<if test="sendAddress != null and sendAddress != ''"> and send_address like concat('%', #{sendAddress}, '%')</if>
<if test="sendPostcode != null and sendPostcode != ''"> and send_postcode like concat('%', #{sendPostcode}, '%')</if>
<if test="enterpriseName != null and enterpriseName != ''"> and a.enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="enterpriseTaxId != null and enterpriseTaxId != ''"> and a.enterprise_tax_id like concat('%', #{enterpriseTaxId}, '%')</if>
<if test="paymentType != null and paymentType != ''"> and FIND_IN_SET(payment_type,#{paymentType})</if>
<if test="calcFeeType != null and calcFeeType != ''"> and calc_fee_type=#{calcFeeType}</if>
<if test="custNo != null and custNo != ''"> and cust_no like concat('%', #{custNo}, '%')</if>
@ -2509,6 +2521,8 @@
<if test="productType != null and productType != ''"> and a.product_type=#{productType}</if>
<if test="sendCompany != null and sendCompany != ''"> and a.send_company like concat('%', #{sendCompany}, '%')</if>
<if test="enterpriseName != null and enterpriseName != ''"> and a.enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="enterpriseTaxId != null and enterpriseTaxId != ''"> and a.enterprise_tax_id like concat('%', #{enterpriseTaxId}, '%')</if>
<if test="takePieceEmployeeCode != null and takePieceEmployeeCode != ''"> and a.take_piece_employee_code=#{takePieceEmployeeCode}</if>
<if test="operateEmployeeCode != null and operateEmployeeCode != ''"> and a.operate_employee_code=#{operateEmployeeCode}</if>
<if test="registerManCode != null and registerManCode != ''"> and register_man_code= #{registerManCode}</if>
@ -2811,6 +2825,8 @@
<if test="sendAddress != null and sendAddress != ''">send_address,</if>
<if test="sendPostcode != null and sendPostcode != ''">send_postcode,</if>
<if test="sendPcd != null and sendPcd != ''">send_pcd,</if>
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name,</if>
<if test="enterpriseTaxId != null and enterpriseTaxId != ''">enterprise_tax_id,</if>
<if test="paymentType != null and paymentType != ''">payment_type,</if>
<if test="calcFeeType != null and calcFeeType != ''">calc_fee_type,</if>
<if test="custNo != null and custNo != ''">cust_no,</if>
@ -2997,6 +3013,8 @@
<if test="sendAddress != null and sendAddress != ''">#{sendAddress},</if>
<if test="sendPostcode != null and sendPostcode != ''">#{sendPostcode},</if>
<if test="sendPcd != null and sendPcd != ''">#{sendPcd},</if>
<if test="enterpriseName != null and enterpriseName != ''">#{enterpriseName},</if>
<if test="enterpriseTaxId != null and enterpriseTaxId != ''">#{enterpriseTaxId},</if>
<if test="paymentType != null and paymentType != ''">#{paymentType},</if>
<if test="calcFeeType != null and calcFeeType != ''">#{calcFeeType},</if>
<if test="custNo != null and custNo != ''">#{custNo},</if>
@ -3185,6 +3203,8 @@
<if test="sendAddress != null and sendAddress != ''">send_address = #{sendAddress},</if>
<if test="sendPostcode != null and sendPostcode != ''">send_postcode = #{sendPostcode},</if>
<if test="sendPcd != null and sendPcd != ''">send_pcd = #{sendPcd},</if>
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name = #{enterpriseName},</if>
<if test="enterpriseTaxId != null and enterpriseTaxId != ''">enterprise_tax_id = #{enterpriseTaxId},</if>
<if test="paymentType != null and paymentType != ''">payment_type = #{paymentType},</if>
<if test="calcFeeType != null and calcFeeType != ''">calc_fee_type = #{calcFeeType},</if>
<if test="custNo != null and custNo != ''">cust_no = #{custNo},</if>
@ -3374,6 +3394,8 @@
<if test="sendAddress != null and sendAddress != ''">send_address = #{sendAddress},</if>
<if test="sendPostcode != null and sendPostcode != ''">send_postcode = #{sendPostcode},</if>
<if test="sendPcd != null and sendPcd != ''">send_pcd = #{sendPcd},</if>
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name = #{enterpriseName},</if>
<if test="enterpriseTaxId != null and enterpriseTaxId != ''">enterprise_tax_id = #{enterpriseTaxId},</if>
<if test="paymentType != null and paymentType != ''">payment_type = #{paymentType},</if>
<if test="calcFeeType != null and calcFeeType != ''">calc_fee_type = #{calcFeeType},</if>
<if test="custNo != null and custNo != ''">cust_no = #{custNo},</if>