demand: TMS系统 - 客户账单管理 - 财务开票处理-审核通过回退接口
committer: heyu
This commit is contained in:
parent
1c267a8d61
commit
1ec77676ae
@ -330,6 +330,32 @@ public class EmisSettleInvoiceRecordController extends BaseController {
|
||||
return AjaxResult.success("操作成功");
|
||||
}
|
||||
|
||||
@Log(title = "发票申请审核回退", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/auditCenterPassRollback/{ids}")
|
||||
public AjaxResult auditCenterPassRollback(@PathVariable Long[] ids)
|
||||
{
|
||||
if(ids!=null && ids.length>0){
|
||||
for(int i=0;i<ids.length;i++){
|
||||
try {
|
||||
long id=ids[i];
|
||||
EmisSettleInvoiceRecord emisSettleInvoiceRecord = new EmisSettleInvoiceRecord();
|
||||
emisSettleInvoiceRecord.setId(id);
|
||||
emisSettleInvoiceRecordService.rollbackAuditCenterPass(emisSettleInvoiceRecord);
|
||||
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
// 返回子定义异常
|
||||
if(ex instanceof EmisBizError){
|
||||
return AjaxResult.error(ex.getMessage(),((EmisBizError)ex).getErrorCode());
|
||||
}
|
||||
|
||||
return AjaxResult.error("回退异常,联系客服");
|
||||
}
|
||||
}
|
||||
}
|
||||
return AjaxResult.success("操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量发票延期
|
||||
*/
|
||||
|
||||
@ -102,6 +102,8 @@ public interface EmisSettleInvoiceRecordMapper extends BaseMapper<EmisSettleInvo
|
||||
|
||||
public int auditCenterPass(EmisSettleInvoiceRecord emisSettleInvoiceRecord);
|
||||
|
||||
public int rollbackAuditCenterPass(EmisSettleInvoiceRecord emisSettleInvoiceRecord);
|
||||
|
||||
/**
|
||||
* 根据运单号列表查询开票记录
|
||||
*
|
||||
|
||||
@ -89,6 +89,15 @@ public interface IEmisSettleInvoiceRecordService {
|
||||
|
||||
public int auditCenterPass(EmisSettleInvoiceRecord inputObj) throws EmisBizError;
|
||||
|
||||
/**
|
||||
* 回退中心审核通过
|
||||
*
|
||||
* @param inputObj
|
||||
* @return
|
||||
* @throws EmisBizError
|
||||
*/
|
||||
public int rollbackAuditCenterPass(EmisSettleInvoiceRecord inputObj) throws EmisBizError;
|
||||
|
||||
/**
|
||||
* 根据运单号列表查询开票记录
|
||||
*
|
||||
|
||||
@ -31,7 +31,6 @@ import com.xdadan.erp.emis.domain.EmisSettlePayRecord;
|
||||
import com.xdadan.erp.emis.domain.EmisWaybill;
|
||||
import com.xdadan.erp.emis.domain.EmisSettleBill;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
@ -405,6 +404,47 @@ public class EmisSettleInvoiceRecordServiceImpl extends EmisBaseService implemen
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 回退中心审核通过
|
||||
*
|
||||
* @param inputObj
|
||||
* @return
|
||||
* @throws EmisBizError
|
||||
*/
|
||||
@Override
|
||||
public int rollbackAuditCenterPass(EmisSettleInvoiceRecord inputObj) throws EmisBizError {
|
||||
EmisSettleInvoiceRecord emisSettleInvoiceRecord = emisSettleInvoiceRecordMapper
|
||||
.selectEmisSettleInvoiceRecordById(inputObj.getId());
|
||||
|
||||
if (emisSettleInvoiceRecord == null) {
|
||||
throw new EmisBizError(EmisBizErrorType.FAIL, "申请不存在");
|
||||
}
|
||||
|
||||
if (!"1".equals(emisSettleInvoiceRecord.getBlAudit())) {
|
||||
throw new EmisBizError(EmisBizErrorType.FAIL, "仅审核通过的申请可回退");
|
||||
}
|
||||
if (!"1".equals(emisSettleInvoiceRecord.getInvoiceStatus())) {
|
||||
throw new EmisBizError(EmisBizErrorType.FAIL, "仅开票中的申请可回退");
|
||||
}
|
||||
|
||||
// 重置审核状态
|
||||
emisSettleInvoiceRecord.setBlAudit("0");
|
||||
emisSettleInvoiceRecord.setInvoiceStatus("0");
|
||||
emisSettleInvoiceRecord.setAuditManCode(null);
|
||||
emisSettleInvoiceRecord.setAuditSiteCode(null);
|
||||
emisSettleInvoiceRecord.setAuditNote(null);
|
||||
|
||||
emisSettleInvoiceRecordMapper.rollbackAuditCenterPass(emisSettleInvoiceRecord);
|
||||
|
||||
// 重新计算开票状态
|
||||
String[] settleBillArr = emisSettleInvoiceRecord.getSettleBillNo().split(",");
|
||||
for (int i = 0; i < settleBillArr.length; i++) {
|
||||
emisSettleBillService.reCalcSettleBillInvoiceStatus(settleBillArr[i]);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
BigDecimal totalMoney = BigDecimal.ZERO;
|
||||
BigDecimal recMoney = BigDecimal.ZERO;
|
||||
|
||||
@ -719,6 +719,17 @@
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="rollbackAuditCenterPass" parameterType="EmisSettleInvoiceRecord">
|
||||
update emis_settle_invoice_record
|
||||
set bl_audit='0',
|
||||
invoice_status='0',
|
||||
audit_date = null,
|
||||
audit_man_code = null,
|
||||
audit_site_code = null,
|
||||
audit_note = null
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateHasPayByApplySeqNo" parameterType="string">
|
||||
update emis_settle_invoice_record
|
||||
set payment_status='1'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user