This commit is contained in:
linfso 2024-08-05 18:53:44 +08:00
parent 6d82bb4be1
commit 1a8099a175
8 changed files with 109 additions and 10 deletions

View File

@ -152,4 +152,45 @@ public class EmisSettleInvoiceRecordController extends BaseController
{
return toAjax(emisSettleInvoiceRecordService.deleteEmisSettleInvoiceRecordByIds(ids));
}
/**
* 中心审核驳回
*/
// @PreAuthorize("@ss.hasPermi('emis:emisWaybillAjustApply:centerNoPass')")
@Log(title = "中心驳回", businessType = BusinessType.UPDATE)
@PostMapping("/auditCenterNoPass/{ids}")
public AjaxResult auditCenterNoPass(@PathVariable Long[] ids, @RequestBody EmisSettleInvoiceRecord spr)
{
if(ids!=null && ids.length>0){
for(int i=0;i<ids.length;i++){
try {
long id=ids[i];
EmisSettleInvoiceRecord old=emisSettleInvoiceRecordService.selectEmisSettleInvoiceRecordById(id);
if(old==null){
return AjaxResult.error("账单不存在");
}
if("2".equals(old.getBlAudit())){
return AjaxResult.error("中心已驳回,不能继续驳回");
}
EmisSettleInvoiceRecord emisSettleInvoiceRecord = new EmisSettleInvoiceRecord();
emisSettleInvoiceRecord.setId(id);
emisSettleInvoiceRecord.setAuditNote(spr.getAuditNote());
emisSettleInvoiceRecordService.auditCenterNoPass(emisSettleInvoiceRecord);
}catch (Exception ex){
ex.printStackTrace();
// 返回子定义异常
if(ex instanceof EmisBizError){
return AjaxResult.error(ex.getMessage(),((EmisBizError)ex).getErrorCode());
}
return AjaxResult.error("审核异常,联系客服");
}
}
}
return AjaxResult.success("操作成功");
}
}

View File

@ -33,6 +33,7 @@ public class EmisSettleInvoiceRecord extends BaseEntity
{
private static final long serialVersionUID = 1L;
/* id */
private Long id;
/* 申请序号 */
@ -40,9 +41,9 @@ public class EmisSettleInvoiceRecord extends BaseEntity
/* 申请时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date applyDate;
/* 申请人 */
/* 审核人 */
private String applyManCode;
/* 申请站点 */
/* 审核站点 */
private String applySiteCode;
/* 客户编码 */
private String customerCode;
@ -80,7 +81,7 @@ public class EmisSettleInvoiceRecord extends BaseEntity
private BigDecimal openMoney;
/* 发票号 */
private String invoiceNo;
/* 开票状态 0-待开票 1-开票中 2-已开票 3-拒绝开票 */
/* 开票状态 0-待开票 1-已开票 2-拒绝开票 */
private String invoiceStatus;
/* 开票状态描述 */
private String invoiceStatusDesc;
@ -99,6 +100,8 @@ public class EmisSettleInvoiceRecord extends BaseEntity
private String auditManCode;
/* 审核站点 */
private String auditSiteCode;
/* 审核异常原因 */
private String auditNote;
/* 操作人 */
private String opManCode;
/* 操作时间 */

View File

@ -89,4 +89,7 @@ public interface EmisSettleInvoiceRecordMapper extends BaseMapper<EmisSettleInvo
* @return 结果
*/
public int deleteEmisSettleInvoiceRecordByIds(Long[] ids);
public int auditCenterNoPass(EmisSettleInvoiceRecord emisSettleInvoiceRecord);
}

View File

@ -78,5 +78,14 @@ public interface IEmisSettleInvoiceRecordService
public int deleteEmisSettleInvoiceRecordById(Long id);
/**
* 中心驳回
* @param inputObj
* @return
* @throws EmisBizError
*/
public int auditCenterNoPass(EmisSettleInvoiceRecord inputObj) throws EmisBizError;
}

View File

@ -13,6 +13,9 @@ package com.xdadan.erp.emis.service.impl;
import java.math.BigDecimal;
import java.util.List;
import com.xdadan.erp.common.annotation.Log;
import com.xdadan.erp.common.core.domain.AjaxResult;
import com.xdadan.erp.common.enums.BusinessType;
import com.xdadan.erp.emis.domain.*;
import com.xdadan.erp.emis.domain.enumtype.EmisBizErrorType;
import com.xdadan.erp.emis.domain.exception.EmisBizError;
@ -20,11 +23,15 @@ import com.xdadan.erp.emis.mapper.EmisSettleBillMapper;
import com.xdadan.erp.emis.service.EmisBaseService;
import com.xdadan.erp.emis.utils.WaybillHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Service;
import com.xdadan.erp.emis.mapper.EmisSettleInvoiceRecordMapper;
import com.xdadan.erp.emis.service.IEmisSettleInvoiceRecordService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
/**
/**
* 开票记录表Service业务层处理
*
* @author linfso
@ -183,4 +190,23 @@ public class EmisSettleInvoiceRecordServiceImpl extends EmisBaseService implemen
return emisSettleInvoiceRecordMapper.deleteEmisSettleInvoiceRecordById(id);
}
@Override
public int auditCenterNoPass(EmisSettleInvoiceRecord inputObj) throws EmisBizError {
EmisSettleInvoiceRecord emisSettleInvoiceRecord = emisSettleInvoiceRecordMapper.selectEmisSettleInvoiceRecordById(inputObj.getId());
if("2".equals(emisSettleInvoiceRecord.getBlAudit()) ){
throw new EmisBizError(EmisBizErrorType.FAIL,"已驳回!");
}
emisSettleInvoiceRecord.setBlAudit("2");
emisSettleInvoiceRecord.setAuditNote(inputObj.getAuditNote());
emisSettleInvoiceRecord.setAuditManCode(getCurrentUser().getEmpCode());
emisSettleInvoiceRecord.setAuditSiteCode(getCurrentUser().getOwnerSiteCode());
return emisSettleInvoiceRecordMapper.auditCenterNoPass(emisSettleInvoiceRecord);
}
}

View File

@ -51,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
</where>
order by create_time desc
order by order_num desc
</select>
<select id="selectPrintTplListByPrinter" parameterType="EmisPrintTpl" resultMap="EmisPrintTplResult">

View File

@ -313,6 +313,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<delete id="deleteEmisSettleInvoiceChRecordById" parameterType="Long">
update emis_settle_invoice_ch_record set del_flag='0' where id = #{id}
</delete>

View File

@ -37,6 +37,7 @@
<result property="auditDate" column="audit_date" />
<result property="auditManCode" column="audit_man_code" />
<result property="auditSiteCode" column="audit_site_code" />
<result property="auditNote" column="audit_note" />
<result property="opManCode" column="op_man_code" />
<result property="opDate" column="op_date" />
<result property="opSiteCode" column="op_site_code" />
@ -59,7 +60,7 @@
</resultMap>
<sql id="selectEmisSettleInvoiceRecordVo">
select id, apply_seq_no, apply_date, apply_man_code, apply_site_code, customer_code, customer_name, settle_bill_no, settle_bill_name, apply_money, invoice_type, company_name, company_tax_no, company_tel, company_address, bank_name, bank_acc_no, contact, phone, real_tax_type, open_money_max, open_money, invoice_no, invoice_status, invoice_status_desc, recieve_address, email, file_path, remark, bl_audit, audit_date, audit_man_code, audit_site_code, op_man_code, op_date, op_site_code, open_ch_id, open_ch_status, open_ch_status_desc, open_com_code, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_settle_invoice_record
select id, apply_seq_no, apply_date, apply_man_code, apply_site_code, customer_code, customer_name, settle_bill_no, settle_bill_name, apply_money, invoice_type, company_name, company_tax_no, company_tel, company_address, bank_name, bank_acc_no, contact, phone, real_tax_type, open_money_max, open_money, invoice_no, invoice_status, invoice_status_desc, recieve_address, email, file_path, remark, bl_audit, audit_date, audit_man_code, audit_site_code, audit_note, op_man_code, op_date, op_site_code, open_ch_id, open_ch_status, open_ch_status_desc, open_com_code, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_settle_invoice_record
</sql>
<select id="selectEmisSettleInvoiceRecordList" parameterType="EmisSettleInvoiceRecord" resultMap="EmisSettleInvoiceRecordResult">
@ -118,13 +119,13 @@
</select>
<select id="selectInvoiceRecordListBySettleBillNo" parameterType="String" resultMap="EmisSettleInvoiceRecordResult">
select id, apply_seq_no, apply_date, apply_man_code, apply_site_code, customer_code, customer_name, settle_bill_no, settle_bill_name, apply_money, invoice_type, company_name, company_tax_no, company_tel, company_address, bank_name, bank_acc_no, contact, phone, real_tax_type, open_money_max, open_money, invoice_no, invoice_status, invoice_status_desc, recieve_address, email, file_path, remark, bl_audit, audit_date, audit_man_code, audit_site_code, op_man_code, op_date, op_site_code, open_ch_id, open_ch_status, open_ch_status_desc, open_com_code, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, apply_seq_no, apply_date, apply_man_code, apply_site_code, customer_code, customer_name, settle_bill_no, settle_bill_name, apply_money, invoice_type, company_name, company_tax_no, company_tel, company_address, bank_name, bank_acc_no, contact, phone, real_tax_type, open_money_max, open_money, invoice_no, invoice_status, invoice_status_desc, recieve_address, email, file_path, remark, bl_audit, audit_date, audit_man_code, audit_site_code, audit_note, op_man_code, op_date, op_site_code, open_ch_id, open_ch_status, open_ch_status_desc, open_com_code, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_settle_invoice_record a
where a.settle_bill_no = #{settleBillNo}
</select>
<select id="selectInvoiceRecordByApplySeqNo" parameterType="String" resultMap="EmisSettleInvoiceRecordResult">
select id, apply_seq_no, apply_date, apply_man_code, apply_site_code, customer_code, customer_name, settle_bill_no, settle_bill_name, apply_money, invoice_type, company_name, company_tax_no, company_tel, company_address, bank_name, bank_acc_no, contact, phone, real_tax_type, open_money_max, open_money, invoice_no, invoice_status, invoice_status_desc, recieve_address, email, file_path, remark, bl_audit, audit_date, audit_man_code, audit_site_code, op_man_code, op_date, op_site_code, open_ch_id, open_ch_status, open_ch_status_desc, open_com_code, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, apply_seq_no, apply_date, apply_man_code, apply_site_code, customer_code, customer_name, settle_bill_no, settle_bill_name, apply_money, invoice_type, company_name, company_tax_no, company_tel, company_address, bank_name, bank_acc_no, contact, phone, real_tax_type, open_money_max, open_money, invoice_no, invoice_status, invoice_status_desc, recieve_address, email, file_path, remark, bl_audit, audit_date, audit_man_code, audit_site_code, audit_note, op_man_code, op_date, op_site_code, open_ch_id, open_ch_status, open_ch_status_desc, open_com_code, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_settle_invoice_record a
where a.apply_seq_no = #{applySeqNo}
</select>
@ -183,7 +184,7 @@
</select>
<select id="selectEmisSettleInvoiceRecordById" parameterType="Long" resultMap="EmisSettleInvoiceRecordResult">
select id, apply_seq_no, apply_date, apply_man_code, apply_site_code, customer_code, customer_name, settle_bill_no, settle_bill_name, apply_money, invoice_type, company_name, company_tax_no, company_tel, company_address, bank_name, bank_acc_no, contact, phone, real_tax_type, open_money_max, open_money, invoice_no, invoice_status, invoice_status_desc, recieve_address, email, file_path, remark, bl_audit, audit_date, audit_man_code, audit_site_code, op_man_code, op_date, op_site_code, open_ch_id, open_ch_status, open_ch_status_desc, open_com_code, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, apply_seq_no, apply_date, apply_man_code, apply_site_code, customer_code, customer_name, settle_bill_no, settle_bill_name, apply_money, invoice_type, company_name, company_tax_no, company_tel, company_address, bank_name, bank_acc_no, contact, phone, real_tax_type, open_money_max, open_money, invoice_no, invoice_status, invoice_status_desc, recieve_address, email, file_path, remark, bl_audit, audit_date, audit_man_code, audit_site_code, audit_note, op_man_code, op_date, op_site_code, open_ch_id, open_ch_status, open_ch_status_desc, open_com_code, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_settle_invoice_record a
where a.id = #{id}
</select>
@ -224,6 +225,7 @@
<if test="auditDate != null">audit_date,</if>
<if test="auditManCode != null and auditManCode != ''">audit_man_code,</if>
<if test="auditSiteCode != null and auditSiteCode != ''">audit_site_code,</if>
<if test="auditNote != null and auditNote != ''">audit_note,</if>
<if test="opManCode != null and opManCode != ''">op_man_code,</if>
<if test="opDate != null">op_date,</if>
<if test="opSiteCode != null and opSiteCode != ''">op_site_code,</if>
@ -273,6 +275,7 @@
<if test="auditDate != null">#{auditDate},</if>
<if test="auditManCode != null and auditManCode != ''">#{auditManCode},</if>
<if test="auditSiteCode != null and auditSiteCode != ''">#{auditSiteCode},</if>
<if test="auditNote != null and auditNote != ''">#{auditNote},</if>
<if test="opManCode != null and opManCode != ''">#{opManCode},</if>
<if test="opDate != null">#{opDate},</if>
<if test="opSiteCode != null and opSiteCode != ''">#{opSiteCode},</if>
@ -325,6 +328,7 @@
<if test="auditDate != null">audit_date = #{auditDate},</if>
<if test="auditManCode != null and auditManCode != ''">audit_man_code = #{auditManCode},</if>
<if test="auditSiteCode != null and auditSiteCode != ''">audit_site_code = #{auditSiteCode},</if>
<if test="auditNote != null and auditNote != ''">audit_note = #{auditNote},</if>
<if test="opManCode != null and opManCode != ''">op_man_code = #{opManCode},</if>
<if test="opDate != null">op_date = #{opDate},</if>
<if test="opSiteCode != null and opSiteCode != ''">op_site_code = #{opSiteCode},</if>
@ -343,8 +347,17 @@
where id = #{id}
</update>
<update id="auditCenterNoPass" parameterType="EmisSettleInvoiceRecord">
update emis_settle_invoice_record
set bl_audit='2',audit_note = #{auditNote},audit_date=now(),
audit_man_code = #{auditManCode},
audit_site_code = #{auditSiteCode}
where id = #{id}
</update>
<delete id="deleteEmisSettleInvoiceRecordById" parameterType="Long">
delete from emis_settle_invoice_record where id = #{id}
update emis_settle_invoice_record where id = #{id}
</delete>
<delete id="deleteEmisSettleInvoiceRecordByIds" parameterType="String">