|
|
@ -63,6 +63,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.context.ApplicationEventPublisher;
|
|
|
|
import org.springframework.context.ApplicationEventPublisher;
|
|
|
|
import org.springframework.context.ApplicationEventPublisherAware;
|
|
|
|
import org.springframework.context.ApplicationEventPublisherAware;
|
|
|
|
import org.springframework.core.io.ByteArrayResource;
|
|
|
|
import org.springframework.core.io.ByteArrayResource;
|
|
|
|
|
|
|
|
import org.springframework.core.io.InputStreamResource;
|
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
|
import org.springframework.format.number.CurrencyStyleFormatter;
|
|
|
|
import org.springframework.format.number.CurrencyStyleFormatter;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@ -1362,7 +1363,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public ByteArrayResource downloadBatchSettleReportXlsx(int batchId) {
|
|
|
|
public InputStreamResource downloadBatchSettleReportXlsx(int batchId) {
|
|
|
|
List<JSONObject> mchList = clearingDetailMapper.batchReport(batchId);
|
|
|
|
List<JSONObject> mchList = clearingDetailMapper.batchReport(batchId);
|
|
|
|
if (mchList.isEmpty()) {
|
|
|
|
if (mchList.isEmpty()) {
|
|
|
|
throw new NotFoundException("No batch found");
|
|
|
|
throw new NotFoundException("No batch found");
|
|
|
@ -1384,7 +1385,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
|
|
|
|
try (ByteArrayOutputStream bout = new ByteArrayOutputStream()) {
|
|
|
|
try (ByteArrayOutputStream bout = new ByteArrayOutputStream()) {
|
|
|
|
builder.build(bout);
|
|
|
|
builder.build(bout);
|
|
|
|
bout.flush();
|
|
|
|
bout.flush();
|
|
|
|
return new ByteArrayResource(bout.toByteArray()) {
|
|
|
|
return new InputStreamResource(new ByteArrayInputStream(bout.toByteArray())) {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public String getFilename() {
|
|
|
|
public String getFilename() {
|
|
|
|
return "settle_report_" + DateFormatUtils.format(mchList.get(0).getDate("report_date"), "yyyyMMdd") + "_" + batchId + ".xlsx";
|
|
|
|
return "settle_report_" + DateFormatUtils.format(mchList.get(0).getDate("report_date"), "yyyyMMdd") + "_" + batchId + ".xlsx";
|
|
|
|