Commit 5fb4f164 authored by hongguangwu's avatar hongguangwu

1.7.21-报销

parent 3a6d3d1f
......@@ -78,7 +78,7 @@ public interface EkpBankGrantDetailMapper extends BaseMapper<EkpBankGrantDetail>
List<EkpBankCodeConfiglVo> getEkpBankCodeConfiglVo();
// 更新工资支出的 银企出纳
void updateGongZiZhiChuTable(@Param("fdId") String fdId, @Param("chuNaName") String chuNaName);
void updateGongZiZhiChuTable(@Param("tableName") String tableName, @Param("fdId") String fdId, @Param("chuNaName") String chuNaName);
// 更新工资支出Main表的 银企出纳
void updateGongZiZhiChuMain(@Param("fdId") String fdId, @Param("chuNaName") String chuNaName);
......
......@@ -40,4 +40,10 @@ public interface EkpBankPayTaskMapper extends BaseMapper<EkpBankPayTask> {
// 获取发放中的明细表,查询结果
List<EkpBankResultVo> getEkpBankMainByNeedResultDetail(@Param("typeName") String typeName);
// 获取发放中的主表,查询结果——其他(非扣税、报销等)
List<EkpBankResultVo> getEkpBankMainByNeedResultMainByOther();
// 获取发放中的明细表,查询结果——其他(非扣税、报销等)
List<EkpBankResultVo> getEkpBankMainByNeedResultDetailByOther();
}
......@@ -77,7 +77,7 @@ public interface EkpBankGrantDetailService extends IService<EkpBankGrantDetail>
* @Date: 2024/12/26 11:41
* @return: void
**/
void updateGongZiZhiChuTable(String fdId, String chuNaName);
void updateGongZiZhiChuTable(String tableName, String fdId, String chuNaName);
/**
* @param fdId 工资支出 表id
* @param chuNaName 银企出纳名字
......
......@@ -47,4 +47,10 @@ public interface EkpBankPayTaskService extends IService<EkpBankPayTask> {
**/
List<EkpBankResultVo> getEkpBankMainByNeedResultDetail(String typeName);
// 获取发放中的主表,查询结果——其他(非扣税、报销等)
List<EkpBankResultVo> getEkpBankMainByNeedResultMainByOther();
// 获取发放中的明细表,查询结果——其他(非扣税、报销等)
List<EkpBankResultVo> getEkpBankMainByNeedResultDetailByOther();
}
......@@ -129,8 +129,8 @@ public class EkpBankGrantDetailServiceImpl extends ServiceImpl<EkpBankGrantDetai
}
@Override
public void updateGongZiZhiChuTable(String fdId, String chuNaName) {
baseMapper.updateGongZiZhiChuTable(fdId, chuNaName);
public void updateGongZiZhiChuTable(String tableName, String fdId, String chuNaName) {
baseMapper.updateGongZiZhiChuTable(tableName,fdId, chuNaName);
}
@Override
......
......@@ -57,4 +57,25 @@ public class EkpBankPayTaskServiceImpl extends ServiceImpl<EkpBankPayTaskMapper,
public List<EkpBankResultVo> getEkpBankMainByNeedResultDetail(String typeName) {
return baseMapper.getEkpBankMainByNeedResultDetail(typeName);
}
/**
* @Description: 获取发放中的主表,查询结果
* @Author: hgw
* @Date: 2024/11/25 10:26
* @return: java.util.List<com.yifu.cloud.plus.v1.ekp.entity.EkpBankPayTask>
**/
@Override
public List<EkpBankResultVo> getEkpBankMainByNeedResultMainByOther() {
return baseMapper.getEkpBankMainByNeedResultMainByOther();
}
/**
* @Description: 获取发放中的明细表,查询结果
* @Author: hgw
* @Date: 2024/11/25 10:39
* @return: java.util.List<com.yifu.cloud.plus.v1.ekp.vo.EkpBankResultVo>
**/
@Override
public List<EkpBankResultVo> getEkpBankMainByNeedResultDetailByOther() {
return baseMapper.getEkpBankMainByNeedResultDetailByOther();
}
}
......@@ -798,6 +798,8 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
@Transactional
public R<String> submitBankTask(String fdId, String type, String submitUser) {
if (Common.isNotNull(fdId) && Common.isNotNull(type)) {
// 工资支出表名称
String tableName = "ekp_fd9be224c214ad0992aa";
String redisKey = "SUBMIT_BANK_" + fdId;
if (Common.isNotNull(redisUtil.get(redisKey))) {
return R.failed("数据锁定中,请耐心等待!");
......@@ -840,7 +842,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
// 同步更新明细的发放时间、发放状态
ekpBankGrantDetailService.updateStatusByGrant(fdId);
// 更新 工资支出 的 银企出纳名字
ekpBankGrantDetailService.updateGongZiZhiChuTable(fdId, submitUser);
ekpBankGrantDetailService.updateGongZiZhiChuTable(tableName, fdId, submitUser);
ekpBankGrantDetailService.updateGongZiZhiChuMain(fdId, submitUser);
}
redisUtil.remove(redisKey);
......@@ -911,6 +913,9 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
@Transactional
public synchronized R<String> submitNoTaxTask(String fdId, String type, String submitUser) {
if (Common.isNotNull(fdId) && Common.isNotNull(type)) {
// 非扣税表名称
String tableName = "ekp_75edcee9b5e4b198035a";
String wxNoPre = "FKS";
String redisKey = "SUBMIT_NO_TAX_BANK_" + fdId;
if (Common.isNotNull(redisUtil.get(redisKey))) {
return R.failed("数据锁定中,请耐心等待!");
......@@ -936,6 +941,21 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
redisUtil.remove(redisKey);
return R.failed("数据错误,无金额!");
}
if (Common.isNotNull(main.getFdPayType()) && "报销".equals(main.getFdPayType())) {
if ("行政报销".equals(main.getFdCustomerName())) {
wxNoPre = "XZBX";
tableName = "ekp_6f55b508bcf492cae93d";
} else if ("业务报销".equals(main.getFdCustomerName())) {
wxNoPre = "YWBX";
tableName = "ekp_a2b51052cb1324b5f92f";
} else if ("项目报销".equals(main.getFdCustomerName())) {
wxNoPre = "XMBX";
tableName = "ekp_a185e090a77a14211ab0";
} else if ("差旅费报销".equals(main.getFdCustomerName())) {
wxNoPre = "CLFBX";
tableName = "ekp_af0fda0b28888440fa17";
}
}
int count = ekpBankGrantDetailService.getCountByIdAndMain(fdId);
String totalAmt = String.valueOf(BigDecimalUtils.safeMultiply(main.getFdMoney(), new BigDecimal("100"), 0));
String totalCount = String.valueOf(count);
......@@ -943,10 +963,10 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
// 为空或者失败数=-1,则生成新的wxNo
if (Common.isEmpty(wxNo) ||
(Common.isNotNull(main.getFdFailNum()) && main.getFdFailNum() == CommonConstants.ONE_INT_NEGATE)) {
wxNo = "FKS" + new Date().getTime();
wxNo = wxNoPre + new Date().getTime();
String cur = ekpBankGrantDetailService.getWxNoByWxNo(wxNo);
if (Common.isNotNull(cur)) {
wxNo = "FKS" + new Date().getTime();
wxNo = wxNoPre + new Date().getTime();
}
main.setFdWxNo(wxNo);
main.setFdFailNum(CommonConstants.ZERO_INT);
......@@ -980,12 +1000,13 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
// 同步更新明细的发放时间、发放状态
ekpBankGrantDetailService.updateStatusByGrant(fdId);
// 更新 工资支出 的 银企出纳名字
ekpBankGrantDetailService.updateGongZiZhiChuTable(fdId, submitUser);
ekpBankGrantDetailService.updateGongZiZhiChuTable(tableName, fdId, submitUser);
ekpBankGrantDetailService.updateGongZiZhiChuMain(fdId, submitUser);
}
redisUtil.remove(redisKey);
return returnR;
} else {
wxNoPre = "FKSMX";
// 2明细表
EkpBankGrantDetail detail = ekpBankGrantDetailService.getById(fdId);
if (detail == null) {
......@@ -1000,6 +1021,24 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
redisUtil.remove(redisKey);
return R.failed("数据错误,无金额!");
}
if (Common.isNotNull(detail.getFdParentId())) {
EkpBankPayTask main = ekpBankPayTaskService.getById(detail.getFdParentId());
if (main == null) {
redisUtil.remove(redisKey);
return R.failed("未找到主表数据!");
}
if (Common.isNotNull(main.getFdPayType()) && "报销".equals(main.getFdPayType())) {
if ("行政报销".equals(main.getFdCustomerName())) {
wxNoPre = "XZBXMX";
} else if ("业务报销".equals(main.getFdCustomerName())) {
wxNoPre = "YWBXMX";
} else if ("项目报销".equals(main.getFdCustomerName())) {
wxNoPre = "XMBXMX";
} else if ("差旅费报销".equals(main.getFdCustomerName())) {
wxNoPre = "CLFBXMX";
}
}
}
String totalAmt = String.valueOf(BigDecimalUtils.safeMultiply(detail.getFdMoney(), new BigDecimal("100"), 0));
String totalCount = "1";
String wxNo = detail.getFdWxNo();
......@@ -1007,10 +1046,10 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
if (Common.isEmpty(wxNo) ||
(Common.isNotNull(detail.getFdFailNum()) && detail.getFdFailNum() > CommonConstants.ZERO_INT
&& Common.isNotNull(detail.getFdGrantNum()) && detail.getFdFailNum() >= detail.getFdGrantNum())) {
wxNo = "FKSMX" + new Date().getTime();
wxNo = wxNoPre + new Date().getTime();
String cur = ekpBankGrantDetailService.getWxNoByWxNo(wxNo);
if (Common.isNotNull(cur)) {
wxNo = "FKSMX" + new Date().getTime();
wxNo = wxNoPre + new Date().getTime();
}
detail.setFdWxNo(wxNo);
ekpBankGrantDetailService.updateById(detail);
......@@ -1327,7 +1366,6 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
MybankEnterprisePayQpayentResponseV1 responseV1;
String title = "转账";
String typeName = "非扣税";
String seqNoPre = "AHWX";
String seqNo;
......@@ -1347,7 +1385,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
List<EkpBankGrantDetail> detailDataList;
EkpBankGrantDetail detailData;
// 1:获取需要查询结果的非扣税支付任务(发放中的任务)——主表
List<EkpBankResultVo> mainList = ekpBankPayTaskService.getEkpBankMainByNeedResultMain(typeName);
List<EkpBankResultVo> mainList = ekpBankPayTaskService.getEkpBankMainByNeedResultMainByOther();
String statusRemark;
// 终结态:失败6/8/41或成功7
String failStatus = "41";
......@@ -1498,7 +1536,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
}
// 2:获取主表已发放且明细表发放中的明细表数据,查询工行接口
List<EkpBankResultVo> detailList = ekpBankPayTaskService.getEkpBankMainByNeedResultDetail(typeName);
List<EkpBankResultVo> detailList = ekpBankPayTaskService.getEkpBankMainByNeedResultDetailByOther();
// 明细表
if (detailList != null && !detailList.isEmpty()) {
detailDataList = new ArrayList<>();
......
......@@ -231,7 +231,7 @@
<!-- 更新工资支出 的 银企出纳 -->
<update id="updateGongZiZhiChuTable" >
UPDATE ekp_fd9be224c214ad0992aa SET fd_bank_pay_chu_na = #{chuNaName} WHERE fd_id = #{fdId};
UPDATE ${tableName} SET fd_bank_pay_chu_na = #{chuNaName} WHERE fd_id = #{fdId};
</update>
<!-- 更新工资支出Main表的 银企出纳 -->
<update id="updateGongZiZhiChuMain" >
......
......@@ -106,6 +106,25 @@
where a.fd_grant_status = '已发放' and d.fd_grant_status = '发放失败' and d.fd_handle_status = '发放中' and a.fd_pay_type = #{typeName}
</select>
<!-- 获取发放中的主表,查询结果 -->
<select id="getEkpBankMainByNeedResultMainByOther" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpBankResultVo">
select a.fd_id fdId,a.fd_wx_no fdWxNo
,count(d.fd_id) num,a.fd_bank_name fdBankName,a.fd_bank_no fdBankNo,a.fd_bank_account fdBankAccount
,a.fd_grant_num fdGrantNum,a.fd_atta_src fdAttaSrc
from ekp_bank_pay_task a left join ekp_bank_grant_detail d on a.fd_id = d.fd_parent_id
where a.fd_grant_status = '发放中' and a.fd_pay_type in ("非扣税","报销")
GROUP BY a.fd_id
</select>
<!-- 获取发放中的明细表,查询结果 -->
<select id="getEkpBankMainByNeedResultDetailByOther" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpBankResultVo">
select d.fd_id fdId,d.fd_wx_no fdWxNo,d.fd_parent_id fdParentId,d.fd_fail_num fdFailNum,d.fd_salary_id fdSalaryId
,'1' num,a.fd_bank_name fdBankName,a.fd_bank_no fdBankNo,a.fd_bank_account fdBankAccount,d.fd_payee_name fdPayeeName
,d.fd_grant_num fdGrantNum,d.fd_recipient_bank fdRecipientBank,d.fd_atta_src fdAttaSrc,d.fd_money fdMoney
from ekp_bank_grant_detail d left join ekp_bank_pay_task a on a.fd_id = d.fd_parent_id
where a.fd_grant_status = '已发放' and d.fd_grant_status = '发放失败' and d.fd_handle_status = '发放中' and a.fd_pay_type in ("非扣税","报销")
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment