Browse Source

已认领实收款产品流程限制在撰写节点退回操作

wucl 1 year ago
parent
commit
bc20187309

+ 1 - 0
dao/src/main/java/com/dayou/mapper/MajorProductionMapper.java

@@ -45,4 +45,5 @@ public interface MajorProductionMapper extends CustomBaseMapper<MajorProduction>
 
     MajorProductionVO getMajorProductionById(@Param("productionId") Long productionId);
 
+    List<String> getProductionNosByMajorId(@Param("majorId") Long majorId);
 }

+ 4 - 0
dao/src/main/resources/mapper/MajorProductionMapper.xml

@@ -527,4 +527,8 @@
         WHERE
             mp.id = #{productionId} and mp.deleted = 0 and m.deleted = 0
     </select>
+
+    <select id="getProductionNosByMajorId" parameterType="java.lang.Long" resultType="java.lang.String">
+        select report_no from major_production where major_id = #{majorId} and deleted = 0
+    </select>
  </mapper>

+ 12 - 1
service/src/main/java/com/dayou/service/impl/FinanceInvoiceServiceImpl.java

@@ -4,10 +4,12 @@ import cn.hutool.core.collection.CollectionUtil;
 import com.dayou.common.BaseEntity;
 import com.dayou.dto.MajorProductionSimpleDTO;
 import com.dayou.entity.FinanceInvoice;
+import com.dayou.entity.MajorProduction;
 import com.dayou.enums.FinanceInvoiceState;
 import com.dayou.enums.ReportStatus;
 import com.dayou.exception.ErrorCode;
 import com.dayou.mapper.FinanceInvoiceMapper;
+import com.dayou.mapper.MajorProductionMapper;
 import com.dayou.service.IFinanceInvoiceService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.dayou.utils.LoginContext;
@@ -32,6 +34,8 @@ import org.springframework.web.multipart.MultipartFile;
 import java.util.Collections;
 import java.util.List;
 import java.util.ArrayList;
+import java.util.stream.Collectors;
+
 import org.springframework.transaction.annotation.Transactional;
 import com.dayou.enums.BatchTaskTypeEnum;
 
@@ -49,6 +53,9 @@ public class FinanceInvoiceServiceImpl extends ServiceImpl<FinanceInvoiceMapper,
     @Autowired
     private FinanceInvoiceMapper financeInvoiceMapper;
 
+    @Autowired
+    private MajorProductionMapper majorProductionMapper;
+
     @Override
     @SuppressWarnings("unchecked")
     public Page<FinanceInvoiceVo> selectPage(Page page,FinanceInvoice financeInvoice,String keyword){
@@ -109,7 +116,11 @@ public class FinanceInvoiceServiceImpl extends ServiceImpl<FinanceInvoiceMapper,
     @Override
     public List<FinanceInvoiceVo> getInvoiceAmountInfo(MajorProductionSimpleDTO simpleDTO) {
         if (CollectionUtil.isEmpty(simpleDTO.getProductionNos())){
-            return financeInvoiceMapper.getInvoiceAmountInfoEmptyProduction(simpleDTO);
+            List<String> productionNos = majorProductionMapper.getProductionNosByMajorId(simpleDTO.getMajorId());
+            if (CollectionUtil.isEmpty(productionNos)){
+                return financeInvoiceMapper.getInvoiceAmountInfoEmptyProduction(simpleDTO);
+            }
+            simpleDTO.setProductionNos(productionNos);
         }
         return financeInvoiceMapper.getInvoiceAmountInfo(simpleDTO);
     }

+ 2 - 1
service/src/main/java/com/dayou/service/impl/ProductionFundServiceImpl.java

@@ -153,7 +153,8 @@ public class ProductionFundServiceImpl extends ServiceImpl<ProductionFundMapper,
     public BigDecimal getProductionRealAmountByProductionNo(String productionNo) {
         try {
             if (StrUtil.isNotEmpty(productionNo)){
-                ProductionFund one = this.getOne(new LambdaQueryWrapper<ProductionFund>().eq(ProductionFund::getProductionNo, productionNo).eq(BaseEntity::getDeleted, Boolean.FALSE));
+                ProductionFund one = this.getOne(new LambdaQueryWrapper<ProductionFund>().eq(ProductionFund::getProductionNo, productionNo)
+                        .eq(BaseEntity::getDeleted, Boolean.FALSE));
                 if (one==null){
                     return BigDecimal.ZERO;
                 }