|
@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
import com.ruoyi.common.utils.PageUtils;
|
|
|
import com.sd.business.entity.order.po.OrderInfo;
|
|
|
+import com.sd.business.entity.statement.dto.ExportDocumentDto;
|
|
|
import com.sd.business.entity.statement.dto.GetDocumentDto;
|
|
|
import com.sd.business.entity.statement.dto.StatementOfAccountMergePageDto;
|
|
|
import com.sd.business.entity.statement.po.StatementOfAccount;
|
|
@@ -20,6 +21,7 @@ import com.sd.business.entity.statement.vo.DocumentBySkuVo;
|
|
|
import com.sd.business.entity.statement.vo.StatementOfAccountMergePageVo;
|
|
|
import com.sd.business.service.department.DepartmentService;
|
|
|
import com.sd.business.service.order.OrderService;
|
|
|
+import com.sd.business.service.statement.StatementOfAccountExportService;
|
|
|
import com.sd.business.service.statement.StatementOfAccountMergeService;
|
|
|
import com.sd.business.service.statement.StatementOfAccountService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -52,6 +54,9 @@ public class StatementOfAccountMergeServiceImpl implements StatementOfAccountMer
|
|
|
@Autowired
|
|
|
private OrderService orderService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private StatementOfAccountExportService statementOfAccountExportService;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public Page<StatementOfAccountMergePageVo> getPage(StatementOfAccountMergePageDto dto) {
|
|
@@ -170,6 +175,34 @@ public class StatementOfAccountMergeServiceImpl implements StatementOfAccountMer
|
|
|
return statementOfAccountService.getDocumentByOrder(getIdList(dto));
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void export(ExportDocumentDto dto, int type) {
|
|
|
+
|
|
|
+ List<Long> idList = Arrays.stream(dto.getIdGroupConcat().split(","))
|
|
|
+ .map(Convert::toLong)
|
|
|
+ .filter(Objects::nonNull)
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ String departmentName = dto.getDepartmentName();
|
|
|
+ String beginDate = dto.getBeginDate();
|
|
|
+ String endDate = dto.getEndDate();
|
|
|
+
|
|
|
+ switch (type) {
|
|
|
+ case 1:
|
|
|
+ statementOfAccountExportService.exportDocumentBySku(idList, departmentName, beginDate, endDate);
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ statementOfAccountExportService.exportDocumentByBom(idList, departmentName, beginDate, endDate);
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ statementOfAccountExportService.exportDocumentByOrder(idList, departmentName, beginDate, endDate);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ throw new ServiceException("未知对账单类型");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private List<Long> getIdList(GetDocumentDto dto) {
|
|
|
|
|
|
String idGroupConcat = dto.getIdGroupConcat();
|