|
@@ -546,26 +546,51 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
(x.getBusinessType().equals(MAJOR_BUSINESS.name())|| x.getBusinessType().equals(ASSET_BUSINESS.name())))
|
|
(x.getBusinessType().equals(MAJOR_BUSINESS.name())|| x.getBusinessType().equals(ASSET_BUSINESS.name())))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
majorOrderFund.stream().forEach(x->{
|
|
majorOrderFund.stream().forEach(x->{
|
|
|
|
+ BigDecimal totalAmount = x.getRealAmount();
|
|
|
|
+
|
|
List<ProductionFund> prods = productionFundService.list(new LambdaQueryWrapper<ProductionFund>()
|
|
List<ProductionFund> prods = productionFundService.list(new LambdaQueryWrapper<ProductionFund>()
|
|
- .eq(ProductionFund::getOrderFundId, x.getId()).select(ProductionFund::getProductionType));
|
|
|
|
|
|
+ .eq(ProductionFund::getOrderFundId, x.getId()).select(ProductionFund::getProductionType,ProductionFund::getRealAmount,BaseEntity::getId));
|
|
if (CollectionUtil.isNotEmpty(prods)){
|
|
if (CollectionUtil.isNotEmpty(prods)){
|
|
- if (prods.size()>1){
|
|
|
|
- List<ProductionFund> noStatement = prods.stream().filter(p -> !p.getProductionType().equals(ProductionEnum.STATEMENT.name())).collect(Collectors.toList());
|
|
|
|
- if (noStatement.size()>1){
|
|
|
|
- productionFundService.update(new LambdaUpdateWrapper<ProductionFund>()
|
|
|
|
- .eq(ProductionFund::getOrderFundId,x.getId())
|
|
|
|
- .eq(ProductionFund::getProductionType,ProductionEnum.REPORT.name())
|
|
|
|
- .set(ProductionFund::getRealAmount,x.getRealAmount()));
|
|
|
|
- }else {
|
|
|
|
- productionFundService.update(new LambdaUpdateWrapper<ProductionFund>()
|
|
|
|
- .eq(ProductionFund::getOrderFundId,x.getId())
|
|
|
|
- .eq(ProductionFund::getProductionType,noStatement.get(0).getProductionType())
|
|
|
|
- .set(ProductionFund::getRealAmount,x.getRealAmount()));
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- productionFundService.update(new LambdaUpdateWrapper<ProductionFund>()
|
|
|
|
- .eq(ProductionFund::getOrderFundId,x.getId()).set(ProductionFund::getRealAmount,x.getRealAmount()));
|
|
|
|
- }
|
|
|
|
|
|
+ for (ProductionFund prod : prods) {
|
|
|
|
+ if (prod.getRealAmount()!=null && prod.getRealAmount().compareTo(BigDecimal.ZERO)>0){
|
|
|
|
+ productionFundService.update(new LambdaUpdateWrapper<ProductionFund>()
|
|
|
|
+ .eq(ProductionFund::getOrderFundId,prod.getId()).set(ProductionFund::getRealAmount, totalAmount));
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if (prod.getProductionType().equals(REPORT.name())){
|
|
|
|
+ productionFundService.update(new LambdaUpdateWrapper<ProductionFund>()
|
|
|
|
+ .eq(ProductionFund::getOrderFundId,prod.getId()).set(ProductionFund::getRealAmount, totalAmount));
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if (prod.getProductionType().equals(LETTER.name())){
|
|
|
|
+ productionFundService.update(new LambdaUpdateWrapper<ProductionFund>()
|
|
|
|
+ .eq(ProductionFund::getOrderFundId,prod.getId()).set(ProductionFund::getRealAmount, totalAmount));
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if (prod.getProductionType().equals(STATEMENT.name())){
|
|
|
|
+ productionFundService.update(new LambdaUpdateWrapper<ProductionFund>()
|
|
|
|
+ .eq(ProductionFund::getOrderFundId,prod.getId()).set(ProductionFund::getRealAmount, totalAmount));
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+// if (prods.size()>1){
|
|
|
|
+//
|
|
|
|
+// List<ProductionFund> noStatement = prods.stream().filter(p -> !p.getProductionType().equals(ProductionEnum.STATEMENT.name())).collect(Collectors.toList());
|
|
|
|
+// if (noStatement.size()>1){
|
|
|
|
+// productionFundService.update(new LambdaUpdateWrapper<ProductionFund>()
|
|
|
|
+// .eq(ProductionFund::getOrderFundId,x.getId())
|
|
|
|
+// .eq(ProductionFund::getProductionType,ProductionEnum.REPORT.name())
|
|
|
|
+// .set(ProductionFund::getRealAmount, totalAmount));
|
|
|
|
+// }else {
|
|
|
|
+// productionFundService.update(new LambdaUpdateWrapper<ProductionFund>()
|
|
|
|
+// .eq(ProductionFund::getOrderFundId,x.getId())
|
|
|
|
+// .eq(ProductionFund::getProductionType,noStatement.get(0).getProductionType())
|
|
|
|
+// .set(ProductionFund::getRealAmount, totalAmount));
|
|
|
|
+// }
|
|
|
|
+// }else{
|
|
|
|
+// productionFundService.update(new LambdaUpdateWrapper<ProductionFund>()
|
|
|
|
+// .eq(ProductionFund::getOrderFundId,x.getId()).set(ProductionFund::getRealAmount, totalAmount));
|
|
|
|
+// }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
@@ -1681,12 +1706,12 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
Date archiveTime = productionNo.getArchiveTime();
|
|
Date archiveTime = productionNo.getArchiveTime();
|
|
Date confirmTime = productionNo.getConfirmTime();
|
|
Date confirmTime = productionNo.getConfirmTime();
|
|
Date bgOutTime = productionNo.getBgOutTime();
|
|
Date bgOutTime = productionNo.getBgOutTime();
|
|
- if (archiveTime!=null){
|
|
|
|
|
|
+ if (archiveTime!=null && majorProduction.getSaveFileDate()==null){
|
|
flog = true;
|
|
flog = true;
|
|
majorProduction.setIfSaveFile(true);
|
|
majorProduction.setIfSaveFile(true);
|
|
majorProduction.setSaveFileDate(DateUtils.dateToLocalDate(archiveTime));
|
|
majorProduction.setSaveFileDate(DateUtils.dateToLocalDate(archiveTime));
|
|
}
|
|
}
|
|
- if (confirmTime!=null){
|
|
|
|
|
|
+ if (confirmTime!=null && majorProduction.getDeliveryDate() == null){
|
|
flog = true;
|
|
flog = true;
|
|
majorProduction.setDelivery(true);
|
|
majorProduction.setDelivery(true);
|
|
majorProduction.setDeliveryDate(DateUtils.dateToLocalDate(confirmTime));
|
|
majorProduction.setDeliveryDate(DateUtils.dateToLocalDate(confirmTime));
|
|
@@ -2184,6 +2209,45 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public Boolean commissionProductionId() {
|
|
|
|
+ List<CommissionDeclare> result = commissionDeclareService.list(new LambdaQueryWrapper<CommissionDeclare>().eq(CommissionDeclare::getDeclareResult, "审核通过")
|
|
|
|
+ .isNull(CommissionDeclare::getProductionId).eq(BaseEntity::getDeleted, false).select(BaseEntity::getId, CommissionDeclare::getBusinessId));
|
|
|
|
+
|
|
|
|
+ for (CommissionDeclare commissionDeclare : result){
|
|
|
|
+ MajorProduction production = financeClaimService.getProductionIdByMajorId(commissionDeclare.getBusinessId());
|
|
|
|
+
|
|
|
|
+ if (production==null){
|
|
|
|
+ List<MajorProduction> list = majorProductionService.list(new LambdaQueryWrapper<MajorProduction>().eq(MajorProduction::getMajorId, commissionDeclare.getBusinessId())
|
|
|
|
+ .select(BaseEntity::getId, MajorProduction::getProduction));
|
|
|
|
+ Long productionId = null;
|
|
|
|
+ for (MajorProduction majorProduction : list){
|
|
|
|
+ if (majorProduction.getProduction().equals(REPORT.name())){
|
|
|
|
+ productionId = majorProduction.getId();
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if (majorProduction.getProduction().equals(LETTER.name())){
|
|
|
|
+ productionId = majorProduction.getId();
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if (majorProduction.getProduction().equals(STATEMENT.name())){
|
|
|
|
+ productionId = majorProduction.getId();
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (productionId!=null){
|
|
|
|
+ commissionDeclareService.update(new LambdaUpdateWrapper<CommissionDeclare>().eq(BaseEntity::getId,commissionDeclare.getId())
|
|
|
|
+ .set(CommissionDeclare::getProductionId,productionId));
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ MajorProduction one = majorProductionService.getOne(new LambdaQueryWrapper<MajorProduction>().eq(MajorProduction::getProduction, production.getProduction())
|
|
|
|
+ .eq(MajorProduction::getReportNo, production.getReportNo()));
|
|
|
|
+ commissionDeclareService.update(new LambdaUpdateWrapper<CommissionDeclare>().eq(BaseEntity::getId,commissionDeclare.getId())
|
|
|
|
+ .set(CommissionDeclare::getProductionId,one.getId()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|