增加导入附件的查看记录
This commit is contained in:
+2
-2
@@ -165,8 +165,8 @@ public class TabOrderMonitorController extends BaseController
|
||||
int fail = data.get("fail") instanceof Number ? ((Number) data.get("fail")).intValue() : 0;
|
||||
String action = rows.size() == 1 ? "ONE" : "SELECTED";
|
||||
String bizId = firstOrderBizId(rows, action);
|
||||
String status = fail > 0 && ok == 0 ? "FAIL" : "SUCCESS";
|
||||
String err = fail > 0 ? ("fail=" + fail) : null;
|
||||
String status = fail > 0 ? "FAIL" : "SUCCESS";
|
||||
String err = fail > 0 ? ("fail=" + fail + ", ok=" + ok) : null;
|
||||
TabOrderSyncEsLog.save(billSearchStore, bizId, action, rows, data, status, err);
|
||||
return success(data);
|
||||
}
|
||||
|
||||
+52
-4
@@ -1,5 +1,6 @@
|
||||
package com.bms.web.controller.price;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -25,8 +26,11 @@ import com.bms.common.core.page.TableDataInfo;
|
||||
import com.bms.common.enums.BusinessType;
|
||||
import com.bms.common.utils.DateUtils;
|
||||
import com.bms.common.utils.MessageUtils;
|
||||
import com.bms.common.utils.SecurityUtils;
|
||||
import com.bms.common.utils.StringUtils;
|
||||
import com.bms.common.utils.poi.ExcelUtil;
|
||||
import com.bms.system.domain.BmsBizAttachment;
|
||||
import com.bms.system.service.IBmsBizAttachmentService;
|
||||
import com.bms.price.domain.BatchAddIncomeBillFeeTask;
|
||||
import com.bms.price.domain.ChargeWeightImportTask;
|
||||
import com.bms.price.domain.PrcBillingTask;
|
||||
@@ -66,6 +70,9 @@ public class BillingController extends BaseController
|
||||
@Autowired
|
||||
private IPrcBillingTaskService prcBillingTaskService;
|
||||
|
||||
@Autowired
|
||||
private IBmsBizAttachmentService bizAttachmentService;
|
||||
|
||||
/**
|
||||
* Historical quote list.
|
||||
*/
|
||||
@@ -360,12 +367,36 @@ public class BillingController extends BaseController
|
||||
@PostMapping("/bill/chargeWeight/importData")
|
||||
public AjaxResult importChargeWeight(MultipartFile file) throws Exception
|
||||
{
|
||||
if (file == null || file.isEmpty())
|
||||
{
|
||||
return error("file required");
|
||||
}
|
||||
byte[] bytes = file.getBytes();
|
||||
String originalName = file.getOriginalFilename();
|
||||
ExcelUtil<ChargeWeightImportRow> util = new ExcelUtil<ChargeWeightImportRow>(ChargeWeightImportRow.class);
|
||||
List<ChargeWeightImportRow> rows = util.importExcel(file.getInputStream());
|
||||
List<ChargeWeightImportRow> rows = util.importExcel(new ByteArrayInputStream(bytes));
|
||||
String taskId = prcOrderBillService.submitImportChargeWeight(rows);
|
||||
Map<String, Object> payload = new HashMap<String, Object>();
|
||||
payload.put("taskId", taskId);
|
||||
return success(payload);
|
||||
try
|
||||
{
|
||||
BmsBizAttachment att = bizAttachmentService.saveUpload(
|
||||
BmsBizAttachment.BIZ_CHARGE_WEIGHT_IMPORT, taskId, bytes, originalName,
|
||||
SecurityUtils.getUsername(), null);
|
||||
Map<String, Object> payload = new HashMap<String, Object>();
|
||||
payload.put("taskId", taskId);
|
||||
if (att != null)
|
||||
{
|
||||
payload.put("attachmentId", att.getAttachmentId());
|
||||
}
|
||||
return success(payload);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// Import task already queued; attachment failure should not block rebill
|
||||
Map<String, Object> payload = new HashMap<String, Object>();
|
||||
payload.put("taskId", taskId);
|
||||
payload.put("attachmentWarn", e.getMessage());
|
||||
return success(payload);
|
||||
}
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('price:billing:chargeWeightEdit')")
|
||||
@@ -379,4 +410,21 @@ public class BillingController extends BaseController
|
||||
}
|
||||
return success(task);
|
||||
}
|
||||
|
||||
/**
|
||||
* List charge-weight import Excel attachment records.
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('price:billing:chargeWeightEdit')")
|
||||
@GetMapping("/bill/chargeWeight/import/attachments")
|
||||
public TableDataInfo listChargeWeightImportAttachments(BmsBizAttachment query)
|
||||
{
|
||||
if (query == null)
|
||||
{
|
||||
query = new BmsBizAttachment();
|
||||
}
|
||||
query.setBizType(BmsBizAttachment.BIZ_CHARGE_WEIGHT_IMPORT);
|
||||
startPage();
|
||||
List<BmsBizAttachment> list = bizAttachmentService.selectBmsBizAttachmentList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user