demand: 客户管理-月结客户-新增批量导入企业名称、企业税号接口
committer: heyu
This commit is contained in:
parent
52a76ec995
commit
5a89d660f8
@ -19,6 +19,7 @@ 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;
|
||||
@ -240,21 +241,36 @@ 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 {
|
||||
if ("2".equals(emisCustomerUser.getBlImport())) {
|
||||
// 批量导入企业名称和企业税号
|
||||
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());
|
||||
}
|
||||
}
|
||||
// 验证企业名称和企业税号
|
||||
try {
|
||||
checkEnterprise(emisCustomerUser);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
EmisCustomerUser oldUser=emisBaseService.getCustomerUserByPhone(emisCustomerUser.getPhone());
|
||||
if(oldUser!=null){
|
||||
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("月结卡号已存在");
|
||||
@ -282,6 +298,14 @@ public class EmisCustomerUserController extends EmisBaseController
|
||||
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, "企业名称不能包含空格、回车、@、#、$、%、&、数字等特殊符号");
|
||||
|
||||
@ -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);
|
||||
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -469,5 +469,78 @@
|
||||
</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="monthlyPayCode != null and monthlyPayCode != ''">monthly_pay_code = #{monthlyPayCode},</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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user