demand: TMS系统 - 基础管理 - 客户开票主体 - 新增加启用状态控制客户开票权限 TMS系统 - 客户账单管理 - 业务开票申请-新增开票申请时判断启用状态,停用状态,弹窗提醒“此开票抬头付款不及时,延后开票”

committer: heyu
This commit is contained in:
aike 2025-09-19 11:13:44 +08:00
parent e27b57ca67
commit ee682d8d5d
3 changed files with 45 additions and 16 deletions

View File

@ -23,7 +23,6 @@ import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import lombok.Data; import lombok.Data;
/** /**
* @ClassName EmisCustomerInvoiceInfo * @ClassName EmisCustomerInvoiceInfo
* @Description 客户开票信息记录表 * @Description 客户开票信息记录表
@ -31,8 +30,7 @@ import lombok.Data;
* @date 2024-07-21 14:31:02 * @date 2024-07-21 14:31:02
*/ */
@Data @Data
public class EmisCustomerInvoiceInfo extends BaseEntity public class EmisCustomerInvoiceInfo extends BaseEntity {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/* id */ /* id */
@ -64,5 +62,7 @@ public class EmisCustomerInvoiceInfo extends BaseEntity
private String recieveAddress; private String recieveAddress;
/* 发票投递邮箱 */ /* 发票投递邮箱 */
private String email; private String email;
/* 启用状态:1-启用,0-停用 */
private String enableStatus;
} }

View File

@ -14,6 +14,7 @@ import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import lombok.Data;
import com.xdadan.erp.common.core.domain.entity.SysUser; import com.xdadan.erp.common.core.domain.entity.SysUser;
import com.xdadan.erp.emis.domain.*; import com.xdadan.erp.emis.domain.*;
@ -22,6 +23,7 @@ import com.xdadan.erp.emis.domain.exception.EmisBizError;
import com.xdadan.erp.emis.mapper.EmisSettleBillMapper; import com.xdadan.erp.emis.mapper.EmisSettleBillMapper;
import com.xdadan.erp.emis.mapper.EmisSettleInvoiceRelMapper; import com.xdadan.erp.emis.mapper.EmisSettleInvoiceRelMapper;
import com.xdadan.erp.emis.mapper.EmisSettleSubBillMapper; import com.xdadan.erp.emis.mapper.EmisSettleSubBillMapper;
import com.xdadan.erp.emis.mapper.EmisCustomerInvoiceInfoMapper;
import com.xdadan.erp.emis.service.EmisBaseService; import com.xdadan.erp.emis.service.EmisBaseService;
import com.xdadan.erp.emis.service.IEmisSettleBillService; import com.xdadan.erp.emis.service.IEmisSettleBillService;
import com.xdadan.erp.emis.utils.WaybillHelper; import com.xdadan.erp.emis.utils.WaybillHelper;
@ -62,6 +64,8 @@ public class EmisSettleInvoiceRecordServiceImpl extends EmisBaseService implemen
@Autowired @Autowired
private IEmisSettleBillService emisSettleBillService; private IEmisSettleBillService emisSettleBillService;
@Autowired
private EmisCustomerInvoiceInfoMapper emisCustomerInvoiceInfoMapper;
/** /**
* 查询开票记录表 * 查询开票记录表
@ -113,6 +117,26 @@ public class EmisSettleInvoiceRecordServiceImpl extends EmisBaseService implemen
// id流水号 // id流水号
String applySeqNo= WaybillHelper.genApplySeqNo(); String applySeqNo= WaybillHelper.genApplySeqNo();
// 检查开票抬头启用状态
if (StringUtils.isNotBlank(emisSettleInvoiceRecord.getCustomerCode()) &&
StringUtils.isNotBlank(emisSettleInvoiceRecord.getCompanyName()) &&
StringUtils.isNotBlank(emisSettleInvoiceRecord.getCompanyTaxNo())) {
EmisCustomerInvoiceInfo queryInfo = new EmisCustomerInvoiceInfo();
queryInfo.setCustomerCode(emisSettleInvoiceRecord.getCustomerCode());
queryInfo.setCompanyName(emisSettleInvoiceRecord.getCompanyName());
queryInfo.setCompanyTaxNo(emisSettleInvoiceRecord.getCompanyTaxNo());
List<EmisCustomerInvoiceInfo> invoiceInfoList = emisCustomerInvoiceInfoMapper
.selectEmisCustomerInvoiceInfoList(queryInfo);
if (CollectionUtils.isNotEmpty(invoiceInfoList)) {
EmisCustomerInvoiceInfo invoiceInfo = invoiceInfoList.get(0);
if (!"1".equals(invoiceInfo.getEnableStatus())) {
throw new EmisBizError(EmisBizErrorType.FAIL, "此开票抬头付款不及时,延后开票");
}
}
}
// 相同抬头,相同金额,有审批中或者已开票的不允许再申请 // 相同抬头,相同金额,有审批中或者已开票的不允许再申请
int chkRst=emisSettleInvoiceRecordMapper.checkOpenBillRepeat(emisSettleInvoiceRecord); int chkRst=emisSettleInvoiceRecordMapper.checkOpenBillRepeat(emisSettleInvoiceRecord);
if(chkRst!=0){ if(chkRst!=0){

View File

@ -19,10 +19,11 @@
<result property="phone" column="phone" /> <result property="phone" column="phone" />
<result property="recieveAddress" column="recieve_address" /> <result property="recieveAddress" column="recieve_address" />
<result property="email" column="email" /> <result property="email" column="email" />
<result property="enableStatus" column="enable_status" />
</resultMap> </resultMap>
<sql id="selectEmisCustomerInvoiceInfoVo"> <sql id="selectEmisCustomerInvoiceInfoVo">
select id, company_name, company_tax_no, company_tel, company_address, bank_name, bank_acc_no, invoice_type, customer_code, customer_name, contact, phone, recieve_address, email, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_customer_invoice_info select id, company_name, company_tax_no, company_tel, company_address, bank_name, bank_acc_no, invoice_type, customer_code, customer_name, contact, phone, recieve_address, email, enable_status, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_customer_invoice_info
</sql> </sql>
<select id="selectEmisCustomerInvoiceInfoList" parameterType="EmisCustomerInvoiceInfo" resultMap="EmisCustomerInvoiceInfoResult"> <select id="selectEmisCustomerInvoiceInfoList" parameterType="EmisCustomerInvoiceInfo" resultMap="EmisCustomerInvoiceInfoResult">
@ -43,6 +44,7 @@
<if test="phone != null and phone != ''"> and phone like concat('%', #{phone}, '%')</if> <if test="phone != null and phone != ''"> and phone like concat('%', #{phone}, '%')</if>
<if test="recieveAddress != null and recieveAddress != ''"> and recieve_address like concat('%', #{recieveAddress}, '%')</if> <if test="recieveAddress != null and recieveAddress != ''"> and recieve_address like concat('%', #{recieveAddress}, '%')</if>
<if test="email != null and email != ''"> and email like concat('%', #{email}, '%')</if> <if test="email != null and email != ''"> and email like concat('%', #{email}, '%')</if>
<if test="enableStatus != null and enableStatus != ''"> and enable_status = #{enableStatus}</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if> <if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if> <if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if> <if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
@ -84,7 +86,7 @@
</select> </select>
<select id="selectEmisCustomerInvoiceInfoById" parameterType="Long" resultMap="EmisCustomerInvoiceInfoResult"> <select id="selectEmisCustomerInvoiceInfoById" parameterType="Long" resultMap="EmisCustomerInvoiceInfoResult">
select id, company_name, company_tax_no, company_tel, company_address, bank_name, bank_acc_no, invoice_type, customer_code, customer_name, contact, phone, recieve_address, email, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site select id, company_name, company_tax_no, company_tel, company_address, bank_name, bank_acc_no, invoice_type, customer_code, customer_name, contact, phone, recieve_address, email, enable_status, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_customer_invoice_info a from emis_customer_invoice_info a
where a.id = #{id} where a.id = #{id}
</select> </select>
@ -106,6 +108,7 @@
<if test="phone != null and phone != ''">phone,</if> <if test="phone != null and phone != ''">phone,</if>
<if test="recieveAddress != null and recieveAddress != ''">recieve_address,</if> <if test="recieveAddress != null and recieveAddress != ''">recieve_address,</if>
<if test="email != null and email != ''">email,</if> <if test="email != null and email != ''">email,</if>
<if test="enableStatus != null and enableStatus != ''">enable_status,</if>
<if test="remark != null and remark != ''">remark,</if> <if test="remark != null and remark != ''">remark,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if> <if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if> <if test="createBy != null and createBy != ''">create_by,</if>
@ -130,6 +133,7 @@
<if test="phone != null and phone != ''">#{phone},</if> <if test="phone != null and phone != ''">#{phone},</if>
<if test="recieveAddress != null and recieveAddress != ''">#{recieveAddress},</if> <if test="recieveAddress != null and recieveAddress != ''">#{recieveAddress},</if>
<if test="email != null and email != ''">#{email},</if> <if test="email != null and email != ''">#{email},</if>
<if test="enableStatus != null and enableStatus != ''">#{enableStatus},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if> <if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
@ -157,6 +161,7 @@
<if test="phone != null and phone != ''">phone = #{phone},</if> <if test="phone != null and phone != ''">phone = #{phone},</if>
<if test="recieveAddress != null and recieveAddress != ''">recieve_address = #{recieveAddress},</if> <if test="recieveAddress != null and recieveAddress != ''">recieve_address = #{recieveAddress},</if>
<if test="email != null and email != ''">email = #{email},</if> <if test="email != null and email != ''">email = #{email},</if>
<if test="enableStatus != null and enableStatus != ''">enable_status = #{enableStatus},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if> <if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if> <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if> <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>