demand: TMS系统 - 基础管理 - 客户开票主体 - 新增加启用状态控制客户开票权限 TMS系统 - 客户账单管理 - 业务开票申请-新增开票申请时判断启用状态,停用状态,弹窗提醒“此开票抬头付款不及时,延后开票”
committer: heyu
This commit is contained in:
parent
e27b57ca67
commit
ee682d8d5d
@ -23,7 +23,6 @@ import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName EmisCustomerInvoiceInfo
|
||||
* @Description 客户开票信息记录表
|
||||
@ -31,8 +30,7 @@ import lombok.Data;
|
||||
* @date 2024-07-21 14:31:02
|
||||
*/
|
||||
@Data
|
||||
public class EmisCustomerInvoiceInfo extends BaseEntity
|
||||
{
|
||||
public class EmisCustomerInvoiceInfo extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/* id */
|
||||
@ -64,5 +62,7 @@ public class EmisCustomerInvoiceInfo extends BaseEntity
|
||||
private String recieveAddress;
|
||||
/* 发票投递邮箱 */
|
||||
private String email;
|
||||
/* 启用状态:1-启用,0-停用 */
|
||||
private String enableStatus;
|
||||
|
||||
}
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
/**
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisSettleInvoiceRecordServiceImpl.java
|
||||
* @author linfso
|
||||
* @date 2024-07-21 13:31:26
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @version v1.0
|
||||
* @Description: <p> 开票记录表 实体类 </p>
|
||||
*/
|
||||
|
||||
@ -14,6 +14,7 @@ import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import lombok.Data;
|
||||
|
||||
import com.xdadan.erp.common.core.domain.entity.SysUser;
|
||||
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.EmisSettleInvoiceRelMapper;
|
||||
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.IEmisSettleBillService;
|
||||
import com.xdadan.erp.emis.utils.WaybillHelper;
|
||||
@ -38,7 +40,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 开票记录表Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author linfso
|
||||
* @date 2024-07-21 13:31:26
|
||||
*/
|
||||
@ -62,10 +64,12 @@ public class EmisSettleInvoiceRecordServiceImpl extends EmisBaseService implemen
|
||||
@Autowired
|
||||
private IEmisSettleBillService emisSettleBillService;
|
||||
|
||||
@Autowired
|
||||
private EmisCustomerInvoiceInfoMapper emisCustomerInvoiceInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询开票记录表
|
||||
*
|
||||
*
|
||||
* @param id 开票记录表主键
|
||||
* @return 开票记录表
|
||||
*/
|
||||
@ -78,7 +82,7 @@ public class EmisSettleInvoiceRecordServiceImpl extends EmisBaseService implemen
|
||||
|
||||
/**
|
||||
* 查询开票记录表列表
|
||||
*
|
||||
*
|
||||
* @param emisSettleInvoiceRecord 开票记录表
|
||||
* @return 开票记录表
|
||||
*/
|
||||
@ -90,8 +94,8 @@ public class EmisSettleInvoiceRecordServiceImpl extends EmisBaseService implemen
|
||||
|
||||
/**
|
||||
* 检查是否重复
|
||||
*
|
||||
* @param emisSettleInvoiceRecord
|
||||
*
|
||||
* @param emisSettleInvoiceRecord
|
||||
* @return 数量
|
||||
*/
|
||||
@Override
|
||||
@ -102,7 +106,7 @@ public class EmisSettleInvoiceRecordServiceImpl extends EmisBaseService implemen
|
||||
|
||||
/**
|
||||
* 新增开票记录表
|
||||
*
|
||||
*
|
||||
* @param emisSettleInvoiceRecord 开票记录表
|
||||
* @return 结果
|
||||
*/
|
||||
@ -113,6 +117,26 @@ public class EmisSettleInvoiceRecordServiceImpl extends EmisBaseService implemen
|
||||
// id流水号
|
||||
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);
|
||||
if(chkRst!=0){
|
||||
@ -201,7 +225,7 @@ public class EmisSettleInvoiceRecordServiceImpl extends EmisBaseService implemen
|
||||
|
||||
/**
|
||||
* 修改开票记录表
|
||||
*
|
||||
*
|
||||
* @param emisSettleInvoiceRecord 开票记录表
|
||||
* @return 结果
|
||||
*/
|
||||
@ -213,7 +237,7 @@ public class EmisSettleInvoiceRecordServiceImpl extends EmisBaseService implemen
|
||||
|
||||
/**
|
||||
* 批量删除开票记录表
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的开票记录表主键
|
||||
* @return 结果
|
||||
*/
|
||||
@ -225,7 +249,7 @@ public class EmisSettleInvoiceRecordServiceImpl extends EmisBaseService implemen
|
||||
|
||||
/**
|
||||
* 删除开票记录表信息
|
||||
*
|
||||
*
|
||||
* @param id 开票记录表主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
||||
@ -19,10 +19,11 @@
|
||||
<result property="phone" column="phone" />
|
||||
<result property="recieveAddress" column="recieve_address" />
|
||||
<result property="email" column="email" />
|
||||
<result property="enableStatus" column="enable_status" />
|
||||
</resultMap>
|
||||
|
||||
<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>
|
||||
|
||||
<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="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="enableStatus != null and enableStatus != ''"> and enable_status = #{enableStatus}</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="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
|
||||
@ -84,7 +86,7 @@
|
||||
</select>
|
||||
|
||||
<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
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
@ -106,6 +108,7 @@
|
||||
<if test="phone != null and phone != ''">phone,</if>
|
||||
<if test="recieveAddress != null and recieveAddress != ''">recieve_address,</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="delFlag != null and delFlag != ''">del_flag,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
@ -130,6 +133,7 @@
|
||||
<if test="phone != null and phone != ''">#{phone},</if>
|
||||
<if test="recieveAddress != null and recieveAddress != ''">#{recieveAddress},</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="delFlag != null and delFlag != ''">#{delFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
@ -157,6 +161,7 @@
|
||||
<if test="phone != null and phone != ''">phone = #{phone},</if>
|
||||
<if test="recieveAddress != null and recieveAddress != ''">recieve_address = #{recieveAddress},</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="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user