Merge pull request 'develop' (#30) from develop into master
Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/30
This commit is contained in:
commit
ada79cddb4
@ -120,6 +120,7 @@ public class EmisSettleInvoiceChRecordController extends BaseController
|
||||
vo.setInvoiceCompany(InvoiceExportHelper.mapInvoiceCompany(record.getSalerCompanyName()));
|
||||
// 备注
|
||||
vo.setRemark(InvoiceExportHelper.processRemark(record));
|
||||
vo.setCustomRemark(InvoiceExportHelper.processCustomRemark(record));
|
||||
// 付款日期
|
||||
vo.setPayDate(InvoiceExportHelper.processPayDate(record.getExportPayDays()));
|
||||
// 业务员
|
||||
|
||||
@ -25,6 +25,8 @@ public class EmisSettleInvoiceChRecordExportVO {
|
||||
private String invoiceCompany;
|
||||
// 备注
|
||||
private String remark;
|
||||
// 定制备注
|
||||
private String customRemark;
|
||||
// 付款日期
|
||||
private String payDate;
|
||||
// 业务员
|
||||
|
||||
@ -19,7 +19,7 @@ public class InvoiceExportHelper {
|
||||
"(?i)[,,\u3001.。;\\s]*(co\\.?|ltd\\.?|co|ltd)[,,\u3001.。;\\s]*(co\\.?|ltd\\.?|co|ltd)?[,,\u3001.。;\\s]*$",
|
||||
"").trim();
|
||||
// 去除有限公司和有限责任公司
|
||||
result = result.replaceAll("(有限公司|有限责任公司)$", "").trim();
|
||||
result = result.replaceAll("(有限公司|有限责任公司)", "").trim();
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -71,10 +71,10 @@ public class InvoiceExportHelper {
|
||||
COMPANY_TYPE_MAP.put("探路供应链(上海)有限公司", tls);
|
||||
// 探路供应链(江苏)有限公司
|
||||
Map<Integer, String> tlj = new HashMap<>();
|
||||
tlj.put(1, "探路供应链(江苏)电子专用发票");
|
||||
tlj.put(2, "探路供应链(江苏)电子发票");
|
||||
tlj.put(3, "探路供应链(江苏)纸质发票");
|
||||
tlj.put(4, "探路供应链(江苏)纸质专用发票");
|
||||
tlj.put(1, "探路供应链电子专用发票");
|
||||
tlj.put(2, "探路供应链电子发票");
|
||||
tlj.put(3, "探路供应链纸质发票");
|
||||
tlj.put(4, "探路供应链纸质专用发票");
|
||||
COMPANY_TYPE_MAP.put("探路供应链(江苏)有限公司", tlj);
|
||||
}
|
||||
|
||||
@ -119,9 +119,9 @@ public class InvoiceExportHelper {
|
||||
"").trim();
|
||||
// 处理 CO., LTD 这样的组合
|
||||
finalResult = finalResult.replaceAll("(?i)(CO\\.?\\s*,\\s*LTD\\.?)", "").trim();
|
||||
finalResult = finalResult.replaceAll("(有限公司|有限责任公司)$", "").trim();
|
||||
finalResult = finalResult.replaceAll("(有限公司|有限责任公司)", "").trim();
|
||||
|
||||
if("2".equals(record.getSettleType())){
|
||||
if ("2".equals(record.getSettleType())) {
|
||||
return finalResult.replaceAll("-", ",").replaceAll("(\\d+)\\s+", "$1").trim();
|
||||
}
|
||||
|
||||
@ -141,6 +141,37 @@ public class InvoiceExportHelper {
|
||||
return finalResult;
|
||||
}
|
||||
|
||||
// 处理备注
|
||||
public static String processCustomRemark(EmisSettleInvoiceChRecord record) {
|
||||
String remark = record.getOpenBillRemark();
|
||||
if (remark == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
// 只去除与 LTD 直接相邻的符号
|
||||
String finalResult = remark.replaceAll(
|
||||
"(?i)([,,\u3001.。;\\s]*(co\\.?|ltd\\.?|co|ltd)(?![,,\u3001.。;\\s]*$)[,,\u3001.。;\\s]*(co\\.?|ltd\\.?|co|ltd)?[,,\u3001.。;\\s]*)|(?i)\\s+(co\\.?|ltd\\.?|co|ltd)(?![,,\u3001.。;\\s]*$)[,,\u3001.。;\\s]*(co\\.?|ltd\\.?|co|ltd)?[,,\u3001.。;\\s]*|(?i)\\s+(co\\.?|ltd\\.?|co|ltd)$",
|
||||
"").trim();
|
||||
// 处理 CO., LTD 这样的组合
|
||||
finalResult = finalResult.replaceAll("(?i)(CO\\.?\\s*,\\s*LTD\\.?)", "").trim();
|
||||
finalResult = finalResult.replaceAll("(有限公司|有限责任公司)", "").trim();
|
||||
|
||||
if ("2".equals(record.getSettleType())) {
|
||||
return finalResult.replaceAll("-", ",").replaceAll("(\\d+)\\s+", "$1").trim();
|
||||
}
|
||||
|
||||
// 处理多个日期的情况
|
||||
String[] dateParts = finalResult.split("-");
|
||||
if (dateParts.length > 0) {
|
||||
String lastPart = dateParts[dateParts.length - 1].trim();
|
||||
// 去除日期和公司名之间的空格
|
||||
lastPart = lastPart.replaceAll("(\\d+)\\s+", "$1");
|
||||
finalResult = "现金-" + lastPart;
|
||||
}
|
||||
|
||||
return finalResult;
|
||||
}
|
||||
|
||||
// 处理付款日期
|
||||
public static String processPayDate(String payDate) {
|
||||
if (payDate == null) {
|
||||
|
||||
@ -27,7 +27,7 @@ public class InvoicePoiExportUtil {
|
||||
style.setBorderRight(BorderStyle.THIN);
|
||||
|
||||
// 表头
|
||||
String[] headers = { "开票日期", "公司抬头", "发票号", "时间", "开票金额", "开票公司", "备注", "付款日期", "业务员", "快递公司", "面单单号" };
|
||||
String[] headers = { "开票日期", "公司抬头", "发票号", "时间", "开票金额", "开票公司", "备注", "定制备注", "付款日期", "业务员", "快递公司", "面单单号" };
|
||||
Row headRow = sheet.createRow(0);
|
||||
headRow.setHeightInPoints(30);
|
||||
for (int i = 0; i < headers.length; i++) {
|
||||
@ -37,7 +37,7 @@ public class InvoicePoiExportUtil {
|
||||
}
|
||||
|
||||
// 设置列宽
|
||||
double[] columnWidths = { 8.38, 31, 34.5, 9.13, 8.75, 22.75, 90.5, 29.13, 8.38, 8.38, 41.5 };
|
||||
double[] columnWidths = { 8.38, 31, 34.5, 9.13, 8.75, 22.75, 90.5, 29.13, 29.13, 8.38, 8.38, 41.5 };
|
||||
for (int i = 0; i < columnWidths.length; i++) {
|
||||
sheet.setColumnWidth(i, (int) (columnWidths[i] * 256));
|
||||
}
|
||||
@ -55,6 +55,7 @@ public class InvoicePoiExportUtil {
|
||||
row.createCell(col++).setCellValue(vo.getOpenMoney() == null ? "" : vo.getOpenMoney().toString());
|
||||
row.createCell(col++).setCellValue(vo.getInvoiceCompany());
|
||||
row.createCell(col++).setCellValue(vo.getRemark());
|
||||
row.createCell(col++).setCellValue(vo.getCustomRemark());
|
||||
row.createCell(col++).setCellValue(vo.getPayDate());
|
||||
row.createCell(col++).setCellValue(vo.getSalesmen());
|
||||
row.createCell(col++).setCellValue(vo.getExpressCompany());
|
||||
|
||||
@ -47,7 +47,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="settleType" column="settle_type" />
|
||||
<result property="openBillRemark" column="open_bill_remark" />
|
||||
<result property="payDays" column="pay_days" />
|
||||
<result property="exportPayDays" column="export_pay_days" />
|
||||
|
||||
<association property="billMonth" column="apply_seq_no" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectBillMonthByApplySeqNo"/>
|
||||
<association property="billCode" column="apply_seq_no" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectBillCodeByApplySeqNo"/>
|
||||
@ -127,46 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
FROM emis_settle_pay_record pr
|
||||
INNER JOIN emis_settle_pay_bill_rel pbr ON pr.pay_id = pbr.pay_id
|
||||
INNER JOIN emis_settle_invoice_bill_rel ibr ON ibr.settle_bill_no = pbr.settle_bill_no
|
||||
WHERE ibr.apply_seq_no = a.apply_seq_no) as pay_days,
|
||||
(SELECT
|
||||
CASE
|
||||
WHEN COUNT(*) = 1 THEN
|
||||
CONCAT(
|
||||
DATE_FORMAT(pr.trade_date, '%m/%d'),
|
||||
'已付',
|
||||
CASE pr.pay_type
|
||||
WHEN '1' THEN '企业微信'
|
||||
WHEN '2' THEN '对公'
|
||||
WHEN '3' THEN '微信支付'
|
||||
WHEN '4' THEN '支付宝'
|
||||
WHEN '5' THEN '其他'
|
||||
WHEN '6' THEN '招行付款'
|
||||
ELSE pr.pay_type
|
||||
END
|
||||
)
|
||||
ELSE
|
||||
GROUP_CONCAT(DISTINCT
|
||||
CONCAT(
|
||||
DATE_FORMAT(pr.trade_date, '%m/%d'),
|
||||
'已付',
|
||||
CASE pr.pay_type
|
||||
WHEN '1' THEN '企业微信'
|
||||
WHEN '2' THEN '对公'
|
||||
WHEN '3' THEN '微信支付'
|
||||
WHEN '4' THEN '支付宝'
|
||||
WHEN '5' THEN '其他'
|
||||
WHEN '6' THEN '招行付款'
|
||||
ELSE pr.pay_type
|
||||
END,
|
||||
'-',
|
||||
pr.pay_money
|
||||
)
|
||||
)
|
||||
END
|
||||
FROM emis_settle_pay_record pr
|
||||
INNER JOIN emis_settle_pay_bill_rel pbr ON pr.pay_id = pbr.pay_id
|
||||
INNER JOIN emis_settle_invoice_bill_rel ibr ON ibr.settle_bill_no = pbr.settle_bill_no
|
||||
WHERE ibr.apply_seq_no = a.apply_seq_no) as export_pay_days
|
||||
WHERE ibr.apply_seq_no = a.apply_seq_no) as pay_days
|
||||
FROM emis_settle_invoice_ch_record a
|
||||
<where>
|
||||
del_flag='0'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user