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

Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/165
This commit is contained in:
heyu 2025-08-28 17:37:49 +08:00
commit 761eb86207
13 changed files with 292 additions and 66 deletions

View File

@ -141,8 +141,7 @@ public class EmisCustomerAddressController extends EmisBaseController
@Log(title = "更新客户收寄件地址", businessType = BusinessType.UPDATE)
@PostMapping("/editAddress")
public AjaxResult editAddress(@RequestBody EmisCustomerAddress emisCustomerAddress)
{
public AjaxResult editAddress(@RequestBody EmisCustomerAddress emisCustomerAddress) throws EmisBizError {
return toAjax(emisCustomerAddressService.updateEmisCustomerAddress(emisCustomerAddress));
}
@ -153,8 +152,7 @@ public class EmisCustomerAddressController extends EmisBaseController
@PreAuthorize("@ss.hasPermi('emis:emisCustomerAddress:edit')")
@Log(title = "客户收寄件地址", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EmisCustomerAddress emisCustomerAddress)
{
public AjaxResult edit(@RequestBody EmisCustomerAddress emisCustomerAddress) throws EmisBizError {
return toAjax(emisCustomerAddressService.updateEmisCustomerAddress(emisCustomerAddress));
}

View File

@ -1,11 +1,11 @@
/**
/**
* @Project: emis
* @Title: EmisCustomerUserController.java
* @author linfso
* @date 2024-03-01 03:51:54
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @version v1.0
* @Description: <p> 快递客户用户 控制器 </p>
*/
@ -16,8 +16,10 @@ import javax.servlet.http.HttpServletResponse;
import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter;
import com.xdadan.erp.emis.domain.*;
import com.xdadan.erp.emis.domain.enumtype.EmisBizErrorType;
import com.xdadan.erp.emis.domain.exception.EmisBizError;
import com.xdadan.erp.emis.service.EmisBaseService;
import jodd.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.security.access.prepost.PreAuthorize;
@ -42,7 +44,7 @@ import com.xdadan.erp.emis.service.IEmisCustomerUserService;
/**
* 快递客户用户Controller
*
*
* @author linfso
* @date 2024-03-01 03:51:54
*/
@ -239,15 +241,20 @@ public class EmisCustomerUserController extends EmisBaseController
@PreAuthorize("@ss.hasPermi('emis:emisCustomerUser:add')")
@Log(title = "新增月结用户", businessType = BusinessType.INSERT)
@PostMapping("/addMonthUser")
public AjaxResult addMonthUser(@RequestBody EmisCustomerUser emisCustomerUser)
{
public AjaxResult addMonthUser(@RequestBody EmisCustomerUser emisCustomerUser) {
try {
EmisCustomerUser oldUser=emisBaseService.getCustomerUserByPhone(emisCustomerUser.getPhone());
if(oldUser!=null){
// 验证企业名称和企业税号
try {
checkEnterprise(emisCustomerUser);
} catch (Exception e) {
return AjaxResult.error(e.getMessage());
}
EmisCustomerUser oldUser = emisBaseService.getCustomerUserByPhone(emisCustomerUser.getPhone());
if (oldUser != null) {
return AjaxResult.error("该客户电话号码已被占用,请使用新号码");
}
if(!StringUtils.isEmpty(emisCustomerUser.getMonthlyPayCode() )) {
if (!StringUtils.isEmpty(emisCustomerUser.getMonthlyPayCode())) {
oldUser = emisBaseService.getCustomerUserByMonthlyPayCode(emisCustomerUser.getMonthlyPayCode());
if (oldUser != null) {
return AjaxResult.error("月结卡号已存在");
@ -271,6 +278,52 @@ public class EmisCustomerUserController extends EmisBaseController
}
/**
* 批量导入企业税号
*/
@PreAuthorize("@ss.hasPermi('emis:emisCustomerUser:batchImportEnterprise')")
@Log(title = "新增月结用户", businessType = BusinessType.INSERT)
@PostMapping("/batchImportEnterprise")
public AjaxResult batchImportEnterprise(@RequestBody EmisCustomerUser emisCustomerUser) {
// 批量导入企业名称和企业税号
try {
checkEnterpriseDetail(emisCustomerUser);
if (StringUtil.isBlank(emisCustomerUser.getMonthlyPayCode())) {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "月结卡号不能为空");
}
EmisCustomerUser editUser = new EmisCustomerUser();
editUser.setMonthlyPayCode(emisCustomerUser.getMonthlyPayCode());
editUser.setEnterpriseName(emisCustomerUser.getEnterpriseName());
editUser.setEnterpriseTaxId(emisCustomerUser.getEnterpriseTaxId());
return toAjax(emisCustomerUserService.updateEnterpriseInfoByMonthlyPayCode(editUser));
} catch (Exception e) {
return AjaxResult.error(e.getMessage());
}
}
private void checkEnterprise(EmisCustomerUser emisCustomerUser) throws EmisBizError {
if (!"0086".equals(emisCustomerUser.getCountry())) {
return;
}
checkEnterpriseDetail(emisCustomerUser);
}
private void checkEnterpriseDetail(EmisCustomerUser emisCustomerUser) throws EmisBizError {
if (StringUtil.isBlank(emisCustomerUser.getEnterpriseTaxId())
|| StringUtil.isBlank(emisCustomerUser.getEnterpriseName())) {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1, "企业名称/企业税号不能为空");
}
// 验证企业名称格式
if (!emisBaseService.validateEnterpriseName(emisCustomerUser.getEnterpriseName())) {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "企业名称不能包含空格、回车、@、#、$、%、&、数字等特殊符号");
}
// 验证企业税号格式
if (!emisBaseService.validateEnterpriseTaxId(emisCustomerUser.getEnterpriseTaxId())) {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "企业税号必须为8-18位数字和大写字母组成,不能包含汉字、空格等特殊符号");
}
}
private void nameToCode(EmisCustomerUser emisCustomerUser) {
// 国家
if (!StringUtils.isEmpty(emisCustomerUser.getCountry())) {
@ -345,6 +398,13 @@ public class EmisCustomerUserController extends EmisBaseController
public AjaxResult editMonthUser(@RequestBody EmisCustomerUser emisCustomerUser)
{
try {
// 验证企业名称和企业税号
try {
// 验证企业名称格式
checkEnterprise(emisCustomerUser);
} catch (Exception e) {
return AjaxResult.error(e.getMessage());
}
EmisCustomerUser oldUser=emisBaseService.getCustomerUserByPhone(emisCustomerUser.getPhone());
if(oldUser!=null && !oldUser.getCustomerCode().equals(emisCustomerUser.getCustomerCode())){
return AjaxResult.error("该客户电话号码已被占用,请使用新号码");

View File

@ -1,11 +1,11 @@
/**
/**
* @Project: emis
* @Title: EmisMonthpayAccountController.java
* @author linfso
* @date 2024-04-24 05:05:22
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @version v1.0
* @Description: <p> 月结账户表 控制器 </p>
*/
@ -42,7 +42,7 @@ import com.xdadan.erp.emis.service.IEmisMonthpayAccountService;
/**
* 月结账户表Controller
*
*
* @author linfso
* @date 2024-04-24 05:05:22
*/
@ -93,7 +93,7 @@ public class EmisMonthpayAccountController extends EmisBaseController
* @param emisCustomerUser
* @return
*/
@JacksonFilter(include= {"customerCode","custNo","custName","payee","salesmen","payeeName","salesmenName"},value= EmisCustomerUser.class,type= JacksonFilter.JscksonFilterType.RESPONSE)
@JacksonFilter(include= {"customerCode","custNo","custName","payee","salesmen","payeeName","salesmenName","enterpriseName","enterpriseTaxId"},value= EmisCustomerUser.class,type= JacksonFilter.JscksonFilterType.RESPONSE)
@GetMapping("/listSimple")
public TableDataInfo listSimple(EmisCustomerUser emisCustomerUser)
{

View File

@ -185,5 +185,10 @@ public class EmisCustomerUser extends BaseEntity
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date lastOrderTime;
/* 企业名称 */
private String enterpriseName;
/* 企业税号 */
private String enterpriseTaxId;
}

View File

@ -1,10 +1,10 @@
/**
/**
* @Project: emis
* @Title: EmisCustomerUserMapper.java
* @author linfso
* @date 2024-03-01 03:51:54
* @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>
*/
@ -24,32 +24,32 @@ public interface EmisCustomerUserMapper extends BaseMapper<EmisCustomerUser>
/**
* 主键查询
* @param id
* @return
* @return
*/
public EmisCustomerUser selectEmisCustomerUserById(Long id);
/**
* 查询列表
*
* @param emisCustomerUser
*
* @param emisCustomerUser
* @return 集合
*/
public List<EmisCustomerUser> selectEmisCustomerUserList(EmisCustomerUser emisCustomerUser);
/**
* 新增
*
* 新增
*
* @param emisCustomerUser
* @return
* @return
*/
public int insertEmisCustomerUser(EmisCustomerUser emisCustomerUser);
/**
* 修改
*
* @param emisCustomerUser
* @return
*
* @param emisCustomerUser
* @return
*/
public int updateEmisCustomerUser(EmisCustomerUser emisCustomerUser);
@ -64,7 +64,7 @@ public interface EmisCustomerUserMapper extends BaseMapper<EmisCustomerUser>
/**
* 删除
*
*
* @param id 主键
* @return 结果
*/
@ -72,7 +72,7 @@ public interface EmisCustomerUserMapper extends BaseMapper<EmisCustomerUser>
/**
* 批量删除
*
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
@ -99,5 +99,11 @@ public interface EmisCustomerUserMapper extends BaseMapper<EmisCustomerUser>
public int insertSysOmsUserRole(Long omsUserId);
/** 根据月结卡号修改企业名称和企业税号
*
* @param emisCustomerUser
* @return
*/
public int updateEnterpriseInfoByMonthlyPayCode(EmisCustomerUser emisCustomerUser);
}

View File

@ -3600,12 +3600,12 @@ public class EmisBaseService {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "企业税号必须为8-18位数字和大写字母组成,不能包含汉字、空格等特殊符号");
}
} else {
emisCustomerAddressNew.setEnterpriseName(null);
emisCustomerAddressNew.setEnterpriseTaxId(null);
emisCustomerAddressNew.setEnterpriseName(" ");
emisCustomerAddressNew.setEnterpriseTaxId(" ");
}
} else {
emisCustomerAddressNew.setEnterpriseName(null);
emisCustomerAddressNew.setEnterpriseTaxId(null);
emisCustomerAddressNew.setEnterpriseName(" ");
emisCustomerAddressNew.setEnterpriseTaxId(" ");
}
}

View File

@ -50,7 +50,7 @@ public interface IEmisCustomerAddressService
* @param emisCustomerAddress 客户收寄件地址
* @return 结果
*/
public int updateEmisCustomerAddress(EmisCustomerAddress emisCustomerAddress);
public int updateEmisCustomerAddress(EmisCustomerAddress emisCustomerAddress) throws EmisBizError;
/**
* 批量删除客户收寄件地址

View File

@ -1,10 +1,10 @@
/**
/**
* @Project: emis
* @Title: EmisCustomerUserService.java
* @author linfso
* @date 2024-03-01 03:51:54
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @version v1.0
* @Description: <p> 快递客户用户 服务类接口 </p>
*/
package com.xdadan.erp.emis.service;
@ -18,18 +18,18 @@ import com.xdadan.erp.emis.domain.EmisCustomerUser;
* @author linfso
* @date 2024-03-01 03:51:54
*/
public interface IEmisCustomerUserService
public interface IEmisCustomerUserService
{
/**
* 主键查询
* @param id
* @return
* @return
*/
public EmisCustomerUser selectEmisCustomerUserById(Long id);
/**
* 查询快递客户用户列表
*
*
* @param emisCustomerUser 快递客户用户
* @return 快递客户用户集合
*/
@ -37,7 +37,7 @@ public interface IEmisCustomerUserService
/**
* 新增快递客户用户
*
*
* @param emisCustomerUser 快递客户用户
* @return 结果
*/
@ -57,7 +57,7 @@ public interface IEmisCustomerUserService
/**
* 修改快递客户用户
*
*
* @param emisCustomerUser 快递客户用户
* @return 结果
*/
@ -65,7 +65,7 @@ public interface IEmisCustomerUserService
/**
* 批量删除快递客户用户
*
*
* @param ids 需要删除的快递客户用户主键集合
* @return 结果
*/
@ -73,9 +73,17 @@ public interface IEmisCustomerUserService
/**
* 删除快递客户用户信息
*
*
* @param id 快递客户用户主键
* @return 结果
*/
public int deleteEmisCustomerUserById(Long id);
/**
* 根据月结卡号修改企业名称和企业税号
*
* @param emisCustomerUser 客户用户对象(包含月结卡号、企业名称、企业税号)
* @return 结果
*/
public int updateEnterpriseInfoByMonthlyPayCode(EmisCustomerUser emisCustomerUser);
}

View File

@ -12,8 +12,11 @@ package com.xdadan.erp.emis.service.impl;
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.service.EmisBaseService;
import jodd.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xdadan.erp.emis.domain.EmisCustomerAddress;
@ -69,8 +72,13 @@ public class EmisCustomerAddressServiceImpl extends EmisBaseService implements I
emisCustomerAddress.setUseSiteCode(getCurrentUser().getOwnerSiteCode());
emisCustomerAddress.setUseSite(getCurrentUser().getOwnerSiteName());
// 创建用户
return createCustomerAddressNew(emisCustomerAddress);
checkEnterprise(emisCustomerAddress);
List<EmisCustomerAddress> emisCustomerAddressList = emisCustomerAddressMapper.checkAndQuery(emisCustomerAddress);
if (CollectionUtil.isEmpty(emisCustomerAddressList)) {
// 不重复的情况则 创建地址
return emisCustomerAddressMapper.insertEmisCustomerAddress(emisCustomerAddress);
}
return 1;
}
/**
@ -80,15 +88,32 @@ public class EmisCustomerAddressServiceImpl extends EmisBaseService implements I
* @return 结果
*/
@Override
public int updateEmisCustomerAddress(EmisCustomerAddress emisCustomerAddress)
{
public int updateEmisCustomerAddress(EmisCustomerAddress emisCustomerAddress) throws EmisBizError {
// emisCustomerAddress.preUpdate();
// emisCustomerAddress.setUseSiteCode(getCurrentUser().getOwnerSiteCode());
// emisCustomerAddress.setUseSite(getCurrentUser().getOwnerSiteName());
checkEnterprise(emisCustomerAddress);
return emisCustomerAddressMapper.updateEmisCustomerAddress(emisCustomerAddress);
}
private void checkEnterprise(EmisCustomerAddress emisCustomerAddress) throws EmisBizError {
// 验证企业名称格式
if (StringUtil.isNotBlank(emisCustomerAddress.getEnterpriseName())) {
if (!validateEnterpriseName(emisCustomerAddress.getEnterpriseName())) {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "企业名称不能包含空格、回车、@、#、$、%、&、数字等特殊符号");
}
}
// 验证企业税号格式
if (StringUtil.isNotBlank(emisCustomerAddress.getEnterpriseTaxId())) {
if (!validateEnterpriseTaxId(emisCustomerAddress.getEnterpriseTaxId())) {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "企业税号必须为8-18位数字和大写字母组成,不能包含汉字、空格等特殊符号");
}
}
}
/**
* 批量删除客户收寄件地址
*

View File

@ -1,10 +1,10 @@
/**
/**
* @Project: emis
* @Title: EmisCustomerUserServiceImpl.java
* @author linfso
* @date 2024-03-01 03:51:54
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @version v1.0
* @Description: <p> 快递客户用户 实体类 </p>
*/
@ -22,7 +22,7 @@ import com.xdadan.erp.emis.service.IEmisCustomerUserService;
/**
* 快递客户用户Service业务层处理
*
*
* @author linfso
* @date 2024-03-01 03:51:54
*/
@ -34,7 +34,7 @@ public class EmisCustomerUserServiceImpl extends EmisBaseService implements IEmi
/**
* 查询快递客户用户
*
*
* @param id 快递客户用户主键
* @return 快递客户用户
*/
@ -46,7 +46,7 @@ public class EmisCustomerUserServiceImpl extends EmisBaseService implements IEmi
/**
* 查询快递客户用户列表
*
*
* @param emisCustomerUser 快递客户用户
* @return 快递客户用户
*/
@ -58,7 +58,7 @@ public class EmisCustomerUserServiceImpl extends EmisBaseService implements IEmi
/**
* 新增快递客户用户
*
*
* @param emisCustomerUser 快递客户用户
* @return 结果
*/
@ -94,7 +94,7 @@ public class EmisCustomerUserServiceImpl extends EmisBaseService implements IEmi
/**
* 修改快递客户用户
*
*
* @param emisCustomerUser 快递客户用户
* @return 结果
*/
@ -112,7 +112,7 @@ public class EmisCustomerUserServiceImpl extends EmisBaseService implements IEmi
/**
* 批量删除快递客户用户
*
*
* @param ids 需要删除的快递客户用户主键
* @return 结果
*/
@ -124,7 +124,7 @@ public class EmisCustomerUserServiceImpl extends EmisBaseService implements IEmi
/**
* 删除快递客户用户信息
*
*
* @param id 快递客户用户主键
* @return 结果
*/
@ -134,4 +134,16 @@ public class EmisCustomerUserServiceImpl extends EmisBaseService implements IEmi
return emisCustomerUserMapper.deleteEmisCustomerUserById(id);
}
/**
* 根据月结卡号修改企业名称和企业税号
*
* @param emisCustomerUser 客户用户对象(包含月结卡号、企业名称、企业税号)
* @return 结果
*/
@Override
public int updateEnterpriseInfoByMonthlyPayCode(EmisCustomerUser emisCustomerUser) {
return emisCustomerUserMapper.updateEnterpriseInfoByMonthlyPayCode(emisCustomerUser);
}
}

View File

@ -10,6 +10,9 @@
package com.xdadan.erp.emis.service.impl;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@ -166,7 +169,14 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements
sendAddress.setAddressType("1");
sendAddress.setEnterpriseName(emisWaybillSave.getEnterpriseName());
sendAddress.setEnterpriseTaxId(emisWaybillSave.getEnterpriseTaxId());
// checkAdress(sendAddress);
LocalDateTime thresholdDateTime = LocalDateTime.of(2025, 9, 1, 0, 0, 0);
Date thresholdDate = Date.from(thresholdDateTime.atZone(ZoneId.systemDefault()).toInstant());
Date sendDate = emisWaybillSave.getSendDate();
if (sendDate != null && sendDate.after(thresholdDate)) {
checkAdress(sendAddress);
}
// 插入数据
emisWaybillAjustApply.setApplyDate(new Date());

View File

@ -64,6 +64,8 @@ package com.xdadan.erp.emis.service.impl;
import java.math.RoundingMode;
import java.net.URLEncoder;
import java.text.DecimalFormat;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@ -2494,6 +2496,16 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
if(isNew) {
emisWaybillSave.setOrderDate(emisWaybillSave.getSendDate());
}
if (!"0086".equals(emisWaybillSave.getSendCountry())) {
emisWaybillSave.setEnterpriseName(" ");
emisWaybillSave.setEnterpriseTaxId(" ");
}
if(StringUtil.isBlank(emisWaybillSave.getEnterpriseName())){
emisWaybillSave.setEnterpriseName(" ");
}
if(StringUtil.isBlank(emisWaybillSave.getEnterpriseTaxId())){
emisWaybillSave.setEnterpriseTaxId(" ");
}
// 发件地址
EmisCustomerAddress sendAddress = new EmisCustomerAddress();
@ -2628,8 +2640,16 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
}
// 保存客户收件、寄件地址,开单不要关联客户地址数据
// createCustomerAddressNew(sendAddress);
createCustomerAddress(sendAddress);
// 定义阈值日期:2025年9月1日 00:00:00
LocalDateTime thresholdDateTime = LocalDateTime.of(2025, 9, 1, 0, 0, 0);
Date thresholdDate = Date.from(thresholdDateTime.atZone(ZoneId.systemDefault()).toInstant());
Date sendDate = emisWaybillSave.getSendDate();
if (sendDate != null && sendDate.before(thresholdDate)) {
createCustomerAddress(sendAddress);
} else {
createCustomerAddressNew(sendAddress);
}
createCustomerAddress(recieveAddress);
emisWaybillSave.setCustomerCode(customerCode);

View File

@ -61,6 +61,8 @@
<result property="orderNum" column="order_num" />
<result property="salesSupport" column="sales_support"/>
<result property="salesExecutive" column="sales_executive"/>
<result property="enterpriseName" column="enterprise_name"/>
<result property="enterpriseTaxId" column="enterprise_tax_id"/>
<result property="custNo" column="monthly_pay_code" />
<result property="custName" column="customer_name" />
@ -90,7 +92,7 @@
<sql id="selectEmisCustomerUserVo">
select id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_customer_user
select id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, enterprise_name, enterprise_tax_id, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_customer_user
</sql>
<!-- or FIND_IN_SET(#{ownerSite},biz_site)-->
@ -144,6 +146,8 @@
<if test="realName != null and realName != ''"> and real_name like concat('%', #{realName}, '%')</if>
<if test="idNo != null and idNo != ''"> and id_no like concat('%', #{idNo}, '%')</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="dataFrom != null and dataFrom != ''"> and data_from like concat('%', #{dataFrom}, '%')</if>
<if test="blOpenOms != null and blOpenOms != ''"> and bl_open_oms=#{blOpenOms}</if>
<if test="blSms != null and blSms != ''"> and bl_sms=#{blSms}</if>
@ -184,7 +188,7 @@
</select>
<select id="selectEmisCustomerUserById" parameterType="Long" resultMap="EmisCustomerUserResult">
select id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, enterprise_name, enterprise_tax_id, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_customer_user a
where a.id = #{id}
</select>
@ -247,6 +251,8 @@
<if test="orderNum != null and orderNum != ''">order_num,</if>
<if test="salesSupport != null and salesSupport != ''">sales_support,</if>
<if test="salesExecutive != null and salesExecutive != ''">sales_executive,</if>
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name,</if>
<if test="enterpriseTaxId != null and enterpriseTaxId != ''">enterprise_tax_id,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
@ -312,6 +318,8 @@
<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
<if test="salesSupport != null and salesSupport != ''">#{salesSupport},</if>
<if test="salesExecutive != null and salesExecutive != ''">#{salesExecutive},</if>
<if test="enterpriseName != null and enterpriseName != ''">#{enterpriseName},</if>
<if test="enterpriseTaxId != null and enterpriseTaxId != ''">#{enterpriseTaxId},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
@ -381,6 +389,8 @@
<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
<if test="salesSupport != null and salesSupport != ''">sales_support = #{salesSupport},</if>
<if test="salesExecutive != null and salesExecutive != ''">sales_executive = #{salesExecutive},</if>
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name = #{enterpriseName},</if>
<if test="enterpriseTaxId != null and enterpriseTaxId != ''">enterprise_tax_id = #{enterpriseTaxId},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
@ -428,25 +438,25 @@
<!-- </select>-->
<select id="selectEmisCustomerUserByPhone" parameterType="string" resultMap="EmisCustomerUserResult">
select id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, enterprise_name, enterprise_tax_id, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_customer_user a
where a.del_flag='0' and a.phone = #{phone}
</select>
<select id="selectCustomerByCustomerCode" parameterType="string" resultMap="EmisCustomerUserResult">
select id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, enterprise_name, enterprise_tax_id, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_customer_user a
where a.del_flag='0' and a.customer_code = #{customerCode}
</select>
<select id="selectMonthCustomerByName" parameterType="string" resultMap="EmisCustomerUserResult">
select id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, enterprise_name, enterprise_tax_id, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_customer_user a
where a.del_flag='0' and a.customer_type='2' and a.customer_name = #{customerName}
</select>
<select id="selectMonthCustomerByMonthlyPayCode" parameterType="string" resultMap="EmisCustomerUserResult">
select id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, enterprise_name, enterprise_tax_id, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_customer_user a
where a.del_flag='0' and a.customer_type='2' and a.monthly_pay_code= #{monthlyPayCode}
</select>
@ -459,5 +469,77 @@
</insert>
<!-- 根据月结卡号修改企业名称和企业税号 -->
<update id="updateEnterpriseInfoByMonthlyPayCode" parameterType="EmisCustomerUser">
update emis_customer_user
<trim prefix="SET" suffixOverrides=",">
<if test="customerCode != null and customerCode != ''">customer_code = #{customerCode},</if>
<if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
<if test="customerNameEn != null and customerNameEn != ''">customer_name_en = #{customerNameEn},</if>
<if test="simpleName != null and simpleName != ''">simple_name = #{simpleName},</if>
<if test="contact != null and contact != ''">contact = #{contact},</if>
<if test="phone != null and phone != ''">phone = #{phone},</if>
<if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
<if test="customerType != null and customerType != ''">customer_type = #{customerType},</if>
<if test="settledType != null and settledType != ''">settled_type = #{settledType},</if>
<if test="userType != null and userType != ''">user_type = #{userType},</if>
<if test="company != null and company != ''">company = #{company},</if>
<if test="licNo != null and licNo != ''">lic_no = #{licNo},</if>
<if test="deptId != null and deptId != ''">dept_id = #{deptId},</if>
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
<if test="sex != null and sex != ''">sex = #{sex},</if>
<if test="invitationInfo != null and invitationInfo != ''">invitation_info = #{invitationInfo},</if>
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
<if test="loginDate != null">login_date = #{loginDate},</if>
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
<if test="unionId != null and unionId != ''">union_id = #{unionId},</if>
<if test="openid != null and openid != ''">openid = #{openid},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="password != null and password != ''">password = #{password},</if>
<if test="ownerSite != null and ownerSite != ''">owner_site = #{ownerSite},</if>
<if test="bizSite != null and bizSite != ''">biz_site = #{bizSite},</if>
<if test="bizSiteName != null and bizSiteName != ''">biz_site_name = #{bizSiteName},</if>
<if test="country != null and country != ''">country = #{country},</if>
<if test="province != null and province != ''">province = #{province},</if>
<if test="city != null and city != ''">city = #{city},</if>
<if test="county != null and county != ''">county = #{county},</if>
<if test="town != null and town != ''">town = #{town},</if>
<if test="address != null and address != ''">address = #{address},</if>
<if test="email != null and email != ''">email = #{email},</if>
<if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
<if test="realName != null and realName != ''">real_name = #{realName},</if>
<if test="idNo != null and idNo != ''">id_no = #{idNo},</if>
<if test="idType != null and idType != ''">id_type = #{idType},</if>
<if test="idPic1 != null and idPic1 != ''">id_pic1 = #{idPic1},</if>
<if test="idPic2 != null and idPic2 != ''">id_pic2 = #{idPic2},</if>
<if test="idVerifyStatus != null and idVerifyStatus != ''">id_verify_status = #{idVerifyStatus},</if>
<if test="payee != null and payee != ''">payee = #{payee},</if>
<if test="salesmen != null and salesmen != ''">salesmen = #{salesmen},</if>
<if test="dataFrom != null and dataFrom != ''">data_from = #{dataFrom},</if>
<if test="blOpenOms != null and blOpenOms != ''">bl_open_oms = #{blOpenOms},</if>
<if test="blSms != null and blSms != ''">bl_sms = #{blSms},</if>
<if test="opEmpCode != null and opEmpCode != ''">op_emp_code = #{opEmpCode},</if>
<if test="firstSigningDay != null and firstSigningDay != ''">first_signing_day = #{firstSigningDay},</if>
<if test="creditPeriodType != null and creditPeriodType != ''">credit_period_type = #{creditPeriodType},</if>
<if test="creditPeriod != null">credit_period = #{creditPeriod},</if>
<if test="settleDay != null">settle_day = #{settleDay},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
<if test="salesSupport != null and salesSupport != ''">sales_support = #{salesSupport},</if>
<if test="salesExecutive != null and salesExecutive != ''">sales_executive = #{salesExecutive},</if>
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name = #{enterpriseName},</if>
<if test="enterpriseTaxId != null and enterpriseTaxId != ''">enterprise_tax_id = #{enterpriseTaxId},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
</trim>
WHERE monthly_pay_code = #{monthlyPayCode}
AND del_flag = '0'
</update>
</mapper>
</mapper>