dongke 1 год назад
Родитель
Сommit
10ad8194a5

+ 2 - 1
src/main/java/com/dk/mdm/mapper/mst/CustomerMapper.xml

@@ -109,7 +109,7 @@
         <result column="outboundNotQuantity" property="outboundNotQuantity"/>
         <result column="outboundReturnQuantity" property="outboundReturnQuantity"/>
         <result column="outboundReturnAmount" property="outboundReturnAmount"/>
-
+        <result column="receipt_lock" property="receiptLock"/>
         <result column="startAmount" property="startAmount"/>
     </resultMap>
 
@@ -313,6 +313,7 @@
         tma.receivable,
         tma.receivable_residue,
         tma.receipt_residue,
+        tma.receipt_lock,
         tmor.sum_amt_receivable AS "startAmount"
 --         concat(tms3.staff_name)  AS "followStaffsName"
         FROM dkic_b.t_mst_customer tmc

+ 5 - 5
src/main/java/com/dk/mdm/mapper/mst/SupplierMapper.xml

@@ -58,7 +58,7 @@ op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user,return_
         <result column="inboundAmount" property="inboundAmount"/>
         <result column="inboundNotQuantity" property="inboundNotQuantity"/>
         <result column="inboundNotAmount" property="inboundNotAmount"/>
-
+        <result column="sum_amt_payable" property="sumAmtPayable"/>
 
 
 
@@ -315,16 +315,16 @@ op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user,return_
         msl.cp_id AND tpob.flg_valid AND tpob.into_type = '入库类型-采购入库' AND tpob.into_status = '入库状态-入库中') AS
         "inboundNotAmount",
         tma.payable_residue AS "payableResidue",
-        tma.payment AS "payment"
-
-
-
+        tma.payment AS "payment",
+        tmop.sum_amt_payable
         FROM dkic_b.t_mst_supplier msl
         LEFT JOIN dkic_b.t_mst_staff  tms   ON tms.staff_id = msl.staff_id
+        LEFT JOIN dkic_b.t_mac_other_payable tmop   ON tmop.object_id = msl.sup_id and tmop.business_type = 0
         LEFT JOIN dkic_b.t_mst_org  tmo   ON tmo.org_id = msl.org_id
         LEFT JOIN sys.t_data_kind tdk   ON tdk.kind_code = msl.sup_type
         LEFT JOIN dkic_b.t_mac_account tma   ON tma.object_id = msl.sup_id
         WHERE msl.sup_id = #{id}::uuid
+
     </select>
 
     <!-- 根据主键锁定表t_mst_supplier的一行数据 -->

+ 2 - 1
src/main/java/com/dk/mdm/model/response/mst/CustomerResponse.java

@@ -347,7 +347,8 @@ public class CustomerResponse extends PageInfo<CustomerResponse> implements Seri
 
     private String followStaffsName;
 
-
+    @ApiModelProperty(value = "总收款锁定金额 (SUM(收款+退收款)(锁定金额))")
+    private BigDecimal receiptLock;
 
 
     private static final long serialVersionUID = 1L;

+ 24 - 5
src/main/java/com/dk/mdm/service/ivt/inbound/InboundPurchaseService.java

@@ -203,14 +203,30 @@ public class InboundPurchaseService extends BaseService<Inbound> {
         //入库类型
         inboundVO.setIntoType(Constant.IntoType.SALE.getName());
         //自动入库标识
+//        if (inboundVO.getFlgAutoHandle()) {
+//            //已入库
+//            inboundVO.setIntoStatus(Constant.IntoStatus.YIRUKU.getName());
+//            //入库日期
+//            inboundVO.setIntoDate(inboundVO.getIntoDate() == null ? LocalDate.now() : inboundVO.getIntoDate());
+//        } else {
+//            //入库中
+//            inboundVO.setIntoStatus(Constant.IntoStatus.RUKUZHONG.getName());
+//        }
         if (inboundVO.getFlgAutoHandle()) {
+            if (inboundVO.getInboundProcessingFlag()) {
+                //已入库
+                inboundVO.setIntoStatus(Constant.IntoStatus.YIRUKU.getName());
+                //入库日期
+                inboundVO.setIntoDate(inboundVO.getIntoDate() == null ? LocalDate.now() : inboundVO.getIntoDate());
+            } else {
+                //入库中
+                inboundVO.setIntoStatus(Constant.IntoStatus.RUKUZHONG.getName());
+            }
+        } else {
             //已入库
             inboundVO.setIntoStatus(Constant.IntoStatus.YIRUKU.getName());
             //入库日期
             inboundVO.setIntoDate(inboundVO.getIntoDate() == null ? LocalDate.now() : inboundVO.getIntoDate());
-        } else {
-            //入库中
-            inboundVO.setIntoStatus(Constant.IntoStatus.RUKUZHONG.getName());
         }
         //入库状态等于已入库 更新合计入库数量/金额 = 入库中数量/入库中金额
         if (Constant.IntoStatus.YIRUKU.getName().equals(inboundVO.getIntoStatus())) {
@@ -229,8 +245,11 @@ public class InboundPurchaseService extends BaseService<Inbound> {
         inboundMapper.insert(inbound);
         //endregion
 
-        //region 采购总单
-        this.insertOrderMessageByEdit(inboundVO, inboundVO.getItemList());
+        if (inboundVO.getFromId() != null) {
+            //region 采购总单
+            this.insertOrderMessageByEdit(inboundVO, inboundVO.getItemList());
+        }
+
         //endregion
 
         //region 明细