更新对重复导入已提现订单回执的处理

This commit is contained in:
panshuling321 2022-05-20 16:25:42 +08:00
parent 5dd291ca29
commit 1aadfa02ef
3 changed files with 23 additions and 6 deletions

View File

@ -35,4 +35,9 @@ public interface XhpcClearingCheckoutMapper {
List<CheckoutBankVo> selectOrderMapByCheckoutIds(@Param("checkoutIds")String checkoutIds);
int updateStatusByIds(@Param("checkoutIds")String checkoutIds, @Param("status")Integer status);
List<Map<String, Object>> selectMapGroupByStatus(@Param("checkoutIds")String checkoutIds);
String selectIdsByStatusAndIds(@Param("checkoutIds")String checkoutIds, @Param("status") Integer status);
}

View File

@ -283,17 +283,16 @@ public class XhpcClearingCheckoutServiceImpl extends BaseService implements Xhpc
List<CheckoutBankVo> checkoutList = util.importExcel(new FileInputStream(dataFile));
String checkoutIds = checkoutList.stream().map(CheckoutBankVo::getIndex).collect(Collectors.joining(","));
String unReceiptIds = checkoutMapper.selectIdsByStatusAndIds(checkoutIds, 1);
if (checkoutIds.length() > 1) {
if (unReceiptIds.length() > 1) {
List<XhpcClearingReceiptDomain> receiptDomainList = receiptVo.getReceiptList();
for (XhpcClearingReceiptDomain receiptDomain : receiptDomainList) {
receiptDomain.setClearingCheckoutIds(checkoutIds);
receiptDomain.setCreateBy(receiptVo.getCreateBy());
receiptDomain.setClearingCheckoutIds(unReceiptIds);
}
receiptMapper.insretBatch(receiptDomainList);
checkoutMapper.updateStatusByIds(unReceiptIds, 6);
}
checkoutMapper.updateStatusByIds(checkoutIds, 6);
return true;
}

View File

@ -145,7 +145,20 @@
</select>
<update id="deleteLogicByPrimaryKey" parameterType="java.lang.Long">
<select id="selectMapGroupByStatus" resultType="java.util.Map">
SELECT `status`, GROUP_CONCAT(clearing_checkout_id) as 'ids' from xhpc_clearing_checkout
WHERE del_flag=0 and find_in_set(clearing_checkout_id, #{checkoutIds})
GROUP BY status
</select>
<select id="selectIdsByStatusAndIds" resultType="java.lang.String">
SELECT GROUP_CONCAT(clearing_checkout_id) as 'ids' from xhpc_clearing_checkout
WHERE del_flag=0 and find_in_set(clearing_checkout_id, #{checkoutIds}) and status=#{status}
</select>
<update id="deleteLogicByPrimaryKey" parameterType="java.lang.Long">
update xhpc_clearing_checkout set del_flag=2
where clearing_checkout_id = #{clearingCheckoutId,jdbcType=BIGINT}
</update>