zhangyuewww 2 years ago
parent
commit
be67d5e016

+ 3 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/ContractManagementInfoMapper.java

@@ -87,9 +87,9 @@ public interface ContractManagementInfoMapper extends BaseMapper<ContractManagem
      * @return
      */
     List<ContractManagementInfo> getBuyContractList(Map<String, Object> pageView);
-    Double selectBuyPrice(String contractNo);
-    Double selectSalePrice(String contractNo);
-    Double selectAcquisitionPrice(String contractNo);
+    Double selectBuyPrice(String contractNo,String compId);
+    Double selectSalePrice(String contractNo,String compId);
+    Double selectAcquisitionPrice(String contractNo,String compId);
 
     /**
      * 合同数据

+ 3 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ContractManagementInfoServiceImpl.java

@@ -979,7 +979,7 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
         Double surplusWeight = 0d;
         //销售合同
         if ("1".equals(contractManagementInfo.getContractType()) && "销售合同".equals(contractManagementInfo.getAgreementType())) {
-            price = baseMapper.selectSalePrice(contractNo);
+            price = baseMapper.selectSalePrice(contractNo,contractManagementInfo.getCompId());
         }
         //采购合同
         else if ("2".equals(contractManagementInfo.getContractType())) {
@@ -992,7 +992,7 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
                     throw new YException(YExceptionEnum.CONTRACT_HAS_SURPLUS_ERROR);
                 }
             }
-            price = baseMapper.selectBuyPrice(contractNo);
+            price = baseMapper.selectBuyPrice(contractNo,contractManagementInfo.getCompId());
         }
         //收购合同
         else if ("3".equals(contractManagementInfo.getContractType()) && "收购合同".equals(contractManagementInfo.getAgreementType())) {
@@ -1005,7 +1005,7 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
                     throw new YException(YExceptionEnum.CONTRACT_HAS_SURPLUS_ERROR);
                 }
             }
-            price = baseMapper.selectAcquisitionPrice(contractNo);
+            price = baseMapper.selectAcquisitionPrice(contractNo,contractManagementInfo.getCompId());
         }
         price = new BigDecimal(price).setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
         return price;

+ 3 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/ContractManagementInfoMapper.xml

@@ -1408,6 +1408,7 @@
         WHERE
             cmi.delete_flag = 0
           AND cmi.contract_no = #{contractNo}
+          AND cmi.comp_id = #{compId}
     </select>
     <select id="selectSalePrice" resultType="java.lang.Double">
         SELECT
@@ -1473,6 +1474,7 @@
         WHERE
             cmi.delete_flag = 0
           AND cmi.contract_no = #{contractNo}
+          AND cmi.comp_id = #{compId}
     </select>
     <select id="selectAcquisitionPrice" resultType="java.lang.Double">
         SELECT
@@ -1536,6 +1538,7 @@
         WHERE
             cmi.delete_flag = 0
           AND cmi.contract_no = #{contractNo}
+          AND cmi.comp_id = #{compId}
     </select>