diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFinancePrintServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFinancePrintServiceImpl.java index c5aeda79f..b06e08917 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFinancePrintServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFinancePrintServiceImpl.java @@ -122,10 +122,10 @@ public class WxFinancePrintServiceImpl implements WxFinancePrintService { record.setUpdateTime(date); record.setName(record.getTitle()); Map map = new HashMap(); - map.put("width", 770); + map.put("width", 768); map.put("height", 500); - map.put("pageWidth", 325); - map.put("pageHeight", 275); + map.put("pageWidth", 215); + map.put("pageHeight", 140); map.put("tempItems", record.getTempItems()); map.put("id", String.valueOf(record.getId())); map.put("title", record.getName()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFinanceServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFinanceServiceImpl.java index 6148563e1..dc72fbe2f 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFinanceServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFinanceServiceImpl.java @@ -198,7 +198,8 @@ public class WxFinanceServiceImpl implements WxFinanceService { @Override public FinanceBillSetoffSum getBillSetoffSum(WxFinanceReceive record) { - record.setType(EnumFinanceReceiveType.ADVANCE.getCode()); + record.setType(EnumFinanceCashierType.RECEIVE.getCode()); + record.setReceiveType(EnumFinanceReceiveType.ADVANCE.getCode()); record.setStatus(EnumFinanceReceiveStatus.NORMAL.getCode()); List advanceList = wxFinanceReceiveMapper.getMerchantAdvanceGroupSumList(record); BigDecimal total = new BigDecimal(0); @@ -970,6 +971,19 @@ public class WxFinanceServiceImpl implements WxFinanceService { wxFinanceReceiveMapper.updateById(advance); } } + //要更新账单的冲抵 + WxBillPayDTO payDto = new WxBillPayDTO(); + payDto.updateTenantInfo(record); + payDto.setId(bill.getId()); + payDto.setBillTypeValue(bill.getBillType()); + payDto.setAddpay("0"); + payDto.setSetOff(rb.getReceive()); + if (isRedSetoff) { + payDto.setRemark("收款单红冲,自动回退"); + }else { + payDto.setRemark("收款单作废,自动回退"); + } + wxBillAllHelper.backPay(payDto, user); //记录删除 wxFinanceReceiveSetoffMapper.deleteByConditon(rsq); } diff --git a/mallinkService/src/main/resources/mapper/WxAllBillMapper.xml b/mallinkService/src/main/resources/mapper/WxAllBillMapper.xml index fcb1471c6..d6329f7da 100644 --- a/mallinkService/src/main/resources/mapper/WxAllBillMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxAllBillMapper.xml @@ -76,23 +76,23 @@ and ( - (`starttime` <= #{oweBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and status not in (3,6,7) and bill_type not in (13,21,5)) + (`starttime` <= #{oweBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and status not in (3,6,7,9) and bill_type not in (13,21,5)) or - (`starttime` <= #{oweBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and status not in (3,6,7) and bill_type in (13,21,5)) + (`starttime` <= #{oweBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and status not in (3,6,7,9) and bill_type in (13,21,5)) ) and ( - (`starttime` > #{oweBillLastTime} and `starttime` <= #{nearBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and status not in (3,6,7) and bill_type not in (13,21,5)) + (`starttime` > #{oweBillLastTime} and `starttime` <= #{nearBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and status not in (3,6,7,9) and bill_type not in (13,21,5)) or - (`starttime` > #{oweBillLastTime} and `starttime` <= #{nearBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and status not in (3,6,7) and bill_type in (13,21,5)) + (`starttime` > #{oweBillLastTime} and `starttime` <= #{nearBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and status not in (3,6,7,9) and bill_type in (13,21,5)) ) and ( - (`starttime` <= #{needPayStartDay} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and status not in (3,6,7) and bill_type not in (13,21,5)) + (`starttime` <= #{needPayStartDay} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and status not in (3,6,7,9) and bill_type not in (13,21,5)) or - (`starttime` <= #{needPayStartDay} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and status not in (3,6,7) and bill_type in (13,21,5)) + (`starttime` <= #{needPayStartDay} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and status not in (3,6,7,9) and bill_type in (13,21,5)) ) @@ -105,9 +105,9 @@ and ( - (`last_owe_call_time` is not null and `receive_pay` - `pay`- IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and status not in (3,6,7) and bill_type not in (13,21,5)) + (`last_owe_call_time` is not null and `receive_pay` - `pay`- IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and status not in (3,6,7,9) and bill_type not in (13,21,5)) or - (`last_owe_call_time` is not null and `receive_pay` - `pay`- IFNULL(`set_off`,'0') > 0 and status not in (3,6,7) and bill_type in (13,21,5)) + (`last_owe_call_time` is not null and `receive_pay` - `pay`- IFNULL(`set_off`,'0') > 0 and status not in (3,6,7,9) and bill_type in (13,21,5)) ) and `merchant_id` is not null