Quellcode durchsuchen

Merge branch 'master' of http://47.100.3.209:3000/gdc/yiliangyiyun

ccj vor 2 Jahren
Ursprung
Commit
fd09de2150

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

@@ -369,8 +369,8 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
         else {
             expenseInfo.setStatusFlag(StatusEnum.COST_PAYMENT.getFlag());
             expenseInfo.setStatus(StatusEnum.COST_PAYMENT.getName());
-            //库点费用未分配金额默认等于费用金额
-            if (!"1".equals(expenseInfo.getCostType()) && !"1".equals(expenseInfo.getExpensesPurpose())) {
+            //合同非粮款和库点费用未分配金额默认等于费用金额
+            if (("3".equals(expenseInfo.getCostType()) && "1".equals(expenseInfo.getExpensesPurpose()))||"3".equals(expenseInfo.getExpensesPurpose())) {
                 expenseInfo.setUnallocatedAmount(expenseInfo.getAmountMoney());
             }
             //合同粮款校验

+ 2 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehousingOrderServiceImpl.java

@@ -298,7 +298,8 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
                         }
                     }
                     List<ExpenseAllocationInfo> expenseAllocationInfos = expenseAllocationInfoService.selectList(new EntityWrapper<ExpenseAllocationInfo>()
-                            .eq("order_id", warehousingOrder2.getId()));
+                            .eq("order_id", warehousingOrder2.getId())
+                            .ne("status","已驳回"));
                     if (!CollectionUtils.isEmpty(expenseAllocationInfos)) {
                         for (ExpenseAllocationInfo expenseAllocationInfo : expenseAllocationInfos) {
                             ExpenseInfo expenseInfo = expenseInfoService.selectById(expenseAllocationInfo.getInfoId());

+ 8 - 2
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/ContractManagementInfoMapper.xml

@@ -1225,6 +1225,7 @@
                          exi.contract_id = cmi.id
                        AND exi.expenses_type = '2'
                        AND exi.expenses_purpose = '1'
+                       AND exi.status = '已付款'
                        AND exi.delete_flag = '0'
                  )- (
                      SELECT
@@ -1235,6 +1236,7 @@
                          exi.contract_id = cmi.id
                        AND exi.expenses_type = '1'
                        AND exi.expenses_purpose = '1'
+                       AND exi.status_flag >= '5'
                        AND exi.delete_flag = '0'
                  )+ (
                      SELECT
@@ -1245,7 +1247,7 @@
                              AND war.comp_id = cmi1.comp_id
                              AND war.delete_flag = '0'
                              LEFT JOIN expense_allocation_info eai ON eai.order_id = war.id
-                             AND eai.delete_flag = '0'
+                             AND eai.delete_flag = '0' and eai.status = '已通过'
                      WHERE
                          cmi1.id = cmi.id
                  ))/ (
@@ -1282,6 +1284,7 @@
                      exi.contract_id = cmi.id
                    AND exi.expenses_type = '2'
                    AND exi.expenses_purpose = '1'
+                   AND exi.status = '已付款'
                    AND exi.delete_flag = '0'
              )- (
                  SELECT
@@ -1291,6 +1294,7 @@
                  WHERE
                      exi.contract_no = cmi.contract_no
                    AND exi.expense_name = '运费'
+                   AND exi.status = '已付款'
                    AND exi.delete_flag = '0'
              ))/(
                     (
@@ -1331,6 +1335,7 @@
                          exi.contract_id = cmi.id
                        AND exi.expenses_type = '2'
                        AND exi.expenses_purpose = '1'
+                       AND exi.status = '已付款'
                        AND exi.delete_flag = '0'
                  )- (
                      SELECT
@@ -1341,6 +1346,7 @@
                          exi.contract_id = cmi.id
                        AND exi.expenses_type = '1'
                        AND exi.expenses_purpose = '1'
+                       AND exi.status_flag >= '5'
                        AND exi.delete_flag = '0'
                  )- (
                      SELECT
@@ -1351,7 +1357,7 @@
                              AND war.comp_id = cmi1.comp_id
                              AND war.delete_flag = '0'
                              LEFT JOIN expense_allocation_info eai ON eai.order_id = war.id
-                             AND eai.delete_flag = '0'
+                             AND eai.delete_flag = '0' and eai.status = '已通过'
                      WHERE
                          cmi1.id = cmi.id
                  ))/ (

+ 12 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseBaseInfoMapper.xml

@@ -492,11 +492,15 @@
         tran_task_info tti
         LEFT JOIN tran_car_info tci ON tci.info_id = tti.id
         AND tci.delete_flag = 0
+        AND tci.comp_id = #{compId}
         WHERE
         tti.task_type = '移库'
         AND tti.goods_name = wpsi.goods_name
         AND tti.delete_flag = 0
         AND tci.status_flag = 3
+        <if test="compId != null and compId != ''">
+            AND tti.comp_id = #{compId}
+        </if>
         )as moveNum/* 移库在途数量,已发出未反馈 */,
         (
         SELECT
@@ -517,6 +521,9 @@
         cmi.contract_type = 2
         AND cmi.delete_flag = 0
         AND sprr.amount_not_payable IS NOT NULL
+        <if test="compId != null and compId != ''">
+            AND cmi.comp_id = #{compId}
+        </if>
         GROUP BY
         cmi.contract_no,
         cgi.goods_name
@@ -527,6 +534,9 @@
         AND cpi.delete_flag = 0
         WHERE
         tt.goods_name = wpsi.goods_name
+        <if test="compId != null and compId != ''">
+            AND cmi.comp_id= #{compId}
+        </if>
         AND tt.total &lt; cpi.mildew_grain
         ) as purchaseNum/* 采购在途数量,合同已付减应付除以单价得到吨数 */,
         (
@@ -542,6 +552,8 @@
         AND tti.goods_name = wpsi.goods_name
         AND tti.delete_flag = 0
         AND tci.status_flag = 3
+        AND tci.comp_id = #{compId}
+        AND tti.comp_id = #{compId}
         ) as saleNum
         FROM
         warehouse_base_info wbi