|
@@ -22,6 +22,7 @@ import com.dayou.exception.ErrorCode;
|
|
|
import com.dayou.mapper.DyoaHistoryMapper;
|
|
|
import com.dayou.mapper.DyoaRecordMapper;
|
|
|
import com.dayou.mapper.FinanceClaimMapper;
|
|
|
+import com.dayou.mapper.ProductionFundMapper;
|
|
|
import com.dayou.service.*;
|
|
|
import com.dayou.service.impl.AssetsServiceImpl;
|
|
|
import com.dayou.utils.DateUtils;
|
|
@@ -71,6 +72,9 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
|
|
|
private Map<String,Long> orderFundIds = new HashMap<>();
|
|
|
|
|
|
+ private Map<String,Long> productionFundIds = new HashMap<>();
|
|
|
+
|
|
|
+ private Map<Long,Long> orderFundIdProdFundIds = new HashMap<>();
|
|
|
|
|
|
private static final Map<String,String> MAJOR_ORDER_COLUM = new HashMap<>();
|
|
|
|
|
@@ -90,6 +94,7 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
@Autowired
|
|
|
private IUserService userService;
|
|
|
|
|
@@ -294,6 +299,7 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
|
|
|
//财务开票字段
|
|
|
FINANCE_INVOICE_COLUM.put("orderId","orderFundId");
|
|
|
+ FINANCE_INVOICE_COLUM.put("creatorName","applyId");
|
|
|
FINANCE_INVOICE_COLUM.put("incomeId","realFundId");
|
|
|
FINANCE_INVOICE_COLUM.put("companyName","title");
|
|
|
FINANCE_INVOICE_COLUM.put("companyNO","taxNo");
|
|
@@ -316,7 +322,8 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
FINANCE_INVOICE_COLUM.put("ticketNo","ticketNo");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private ProductionFundMapper productionFundMapper;
|
|
|
|
|
|
|
|
|
@Override
|
|
@@ -644,12 +651,22 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
case "makerId":
|
|
|
field.set(invoice,getMbsUserId((String) columValue));
|
|
|
break;
|
|
|
+ case "applyId":
|
|
|
+ field.set(invoice,getMbsUserId((String) columValue));
|
|
|
+ break;
|
|
|
default:
|
|
|
field.set(invoice,columValue);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+ String orderId = (String) resultMap.get("orderId");
|
|
|
+ Long orderFundMbsId = findOrderFundId((String) orderId);
|
|
|
+ Long productionFunId = getProductionFundIdByOrderFundId(orderFundMbsId);
|
|
|
+ invoice.setProductionFundId(productionFunId);
|
|
|
+
|
|
|
Date createdDatetime = (Date) resultMap.get("createdDatetime");
|
|
|
invoice.setCreated(createdDatetime);
|
|
|
financeInvoiceService.save(invoice);
|
|
@@ -663,6 +680,14 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private Long getProductionFundIdByOrderFundId(Long orderFundMbsId) {
|
|
|
+ if (CollectionUtil.isEmpty(orderFundIdProdFundIds)) {
|
|
|
+ orderFundIdProdFundIds = productionFundService.getProductionFundIdByOrderFundId().stream().collect(Collectors.toMap(ProductionFund::getOrderFundId,BaseEntity::getId));
|
|
|
+ }
|
|
|
+ return orderFundIdProdFundIds.get(orderFundMbsId);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@DSTransactional
|
|
|
@Override
|
|
|
public void fetchAssetsOrderProduction() {
|
|
@@ -1202,6 +1227,13 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
return orderFundIds.get(columValue);
|
|
|
}
|
|
|
|
|
|
+ private Long findProductionFundId(String columValue) {
|
|
|
+ if (CollectionUtil.isEmpty(productionFundIds)){
|
|
|
+ productionFundIds = productionFundService.selectProductionFundIdByDyoaReportNo().stream().collect(Collectors.toMap(ProductionFund::getProductionNo,ProductionFund::getId));
|
|
|
+ }
|
|
|
+ return productionFundIds.get(columValue);
|
|
|
+ }
|
|
|
+
|
|
|
// private Long getMbsWorkFlows(String flowCode){
|
|
|
// if (CollectionUtil.isEmpty(workFlows)){
|
|
|
// List<WorkFlow> list = workFlowService.list(new LambdaQueryWrapper<WorkFlow>().select(BaseEntity::getId, WorkFlow::getCode));
|