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