Sfoglia il codice sorgente

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss-server-mdm

于继渤 1 anno fa
parent
commit
ba31af42d2

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

@@ -112,10 +112,10 @@
                 AND tmc.cus_code = #{cusCode}
             </if>
             <if test="cusName != null and cusName != ''">
-                AND tmc.cus_name = #{cusName}
+                AND tmc.cus_name like concat('%', my_ex.likequery(#{cusName}) , '%')
             </if>
             <if test="cusPhone != null and cusPhone != ''">
-                AND tmc.cus_phone = #{cusPhone}
+                AND tmc.cus_phone like concat('%', my_ex.likequery(#{cusPhone}) , '%')
             </if>
             <if test="addressArea != null and addressArea != ''">
                 AND tmc.address_area = #{addressArea}
@@ -133,10 +133,10 @@
                 AND tmc.address_full = #{addressFull}
             </if>
             <if test="contactName != null and contactName != ''">
-                AND tmc.contact_name = #{contactName}
+                AND tmc.contact_name like concat('%', my_ex.likequery(#{contactName}) , '%')
             </if>
             <if test="contactPhone != null and contactPhone != ''">
-                AND tmc.contact_phone = #{contactPhone}
+                AND tmc.contact_phone like concat('%', my_ex.likequery(#{contactPhone}) , '%')
             </if>
             <if test="cusFrom != null and cusFrom != ''">
                 AND tmc.cus_from = #{cusFrom}::uuid

+ 3 - 26
src/main/java/com/dk/mdm/mapper/report/ReportMapper.xml

@@ -62,7 +62,6 @@
             AND tpi.wh_id = #{whId} ::uuid
         </if>
     </select>
-
     <!-- 采购明细报表明细条件列 -->
     <sql id="Condition_PurDetailReport">
         <where>
@@ -125,7 +124,6 @@
             </if>
         </where>
     </sql>
-
     <!-- 采购明细报表主表条件列 -->
     <sql id="Condition_PurReport">
         <where>
@@ -169,7 +167,6 @@
             </if>
         </where>
     </sql>
-
     <!-- 销售明细报表明细条件列 -->
     <sql id="Condition_OrdDetailReport">
         <where>
@@ -242,7 +239,6 @@
             </if>
         </where>
     </sql>
-
     <!-- 销售明细报表主表条件列 -->
     <sql id="Condition_OrdReport">
         <where>
@@ -292,7 +288,6 @@
             </if>
         </where>
     </sql>
-
     <!-- 出库明细报表明细条件列 -->
     <sql id="Condition_OutboundDetailReport">
         <where>
@@ -358,7 +353,6 @@
             </if>
         </where>
     </sql>
-
     <!-- 出库明细报表主表条件列 -->
     <sql id="Condition_OutboundReport">
         <where>
@@ -402,7 +396,6 @@
             </if>
         </where>
     </sql>
-
     <!-- 入库明细报表明细条件列 -->
     <sql id="Condition_IntoboundDetailReport">
         <where>
@@ -469,7 +462,6 @@
             </if>
         </where>
     </sql>
-
     <!-- 入库明细报表主表条件列 -->
     <sql id="Condition_IntoboundReport">
         <where>
@@ -513,7 +505,6 @@
             </if>
         </where>
     </sql>
-
     <!-- 客户收款明细表条件列 -->
     <sql id="Condition_RecPayDetailReport">
         <where>
@@ -549,7 +540,6 @@
             </if>
         </where>
     </sql>
-
     <!-- 采购明细报表主表 -->
     <select id="getPurReport" resultType="java.util.Map">
         select
@@ -571,6 +561,7 @@
         ,tpp.return_amt as "returnInAmtSum"
         ,tpp.amt_payable as "amtPayable"
         ,tpp.amt_residue as "amtResidue"
+        ,tpp.make_time as "makeTime"
         ,tpp.remarks
         FROM  dkic_b.t_psi_purchase tpp
         Left join dkic_b.t_mst_org tmo on tpp.org_id = tmo.org_id
@@ -586,7 +577,6 @@
             limit #{end} offset #{start}
         </if>
     </select>
-
     <!-- 采购明细报表主表Count-->
     <select id="getPurReportCount" resultType="java.lang.Long">
         SELECT count(1)
@@ -600,7 +590,6 @@
         left join sys.t_data_kind tdk1 on tdk1.kind_code = tpp.pur_type
         <include refid="Condition_PurReport"/>
     </select>
-
     <!-- 采购明细报表明细 -->
     <select id="getPurDetailReport" resultType="java.util.Map">
         select
@@ -686,7 +675,6 @@
         left join sys.t_data_kind tdk3 on tdk3.kind_code = tppi.into_status
         <include refid="Condition_PurDetailReport"/>
     </select>
-
     <!-- 销售明细报表主表 -->
     <select id="getOrderReport" resultType="java.util.Map">
         SELECT
@@ -742,7 +730,6 @@
         left join sys.t_data_kind as tdk2 on t.order_status = tdk2.kind_code
         <include refid="Condition_OrdReport"/>
     </select>
-
     <!-- 销售明细报表明细 -->
     <select id="getOrderDetailReport" resultType="java.util.Map">
         select
@@ -832,7 +819,6 @@
         left join dkic_b.t_psi_outbound as tpo on tpo.from_id=t.order_id
         <include refid="Condition_OrdDetailReport"/>
     </select>
-
     <!-- 出库明细报表主表 -->
     <select id="getOutboundReport" resultType="java.util.Map">
         SELECT
@@ -856,6 +842,7 @@
         t.return_qty as "returnOutQtySum",
         t.return_amt as "returnOutAmtSum",
         t.out_date as "outDate",
+        t.make_time as "makeTime",
         t.remarks,
         makestaff.staff_name as "makeStaffName"
         FROM dkic_b.t_psi_outbound as t
@@ -887,7 +874,6 @@
         LEFT JOIN sys.t_data_kind tdktype   ON tdktype.kind_code = t.out_type
         <include refid="Condition_OutboundReport"/>
     </select>
-
     <!-- 出库明细报表明细 -->
     <select id="getOutboundDetailReport" resultType="java.util.Map">
         select
@@ -969,7 +955,6 @@
         left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
         <include refid="Condition_OutboundDetailReport"/>
     </select>
-
     <!-- 入库明细报表主表 -->
     <select id="getInboundlReport" resultType="java.util.Map">
         SELECT
@@ -994,6 +979,7 @@
         t.return_amt as "returnintoAmtSum",
         t.into_date as "intoDate",
         tmw.wh_name as "whName",
+        t.make_time as "makeTime",
         t.remarks,
         makestaff.staff_name as "makeStaffName"
         FROM dkic_b.t_psi_inbound as t
@@ -1027,7 +1013,6 @@
         left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = t.wh_id
         <include refid="Condition_IntoboundReport"/>
     </select>
-
     <!-- 入库明细报表明细 -->
     <select id="getInboundDetailReport" resultType="java.util.Map">
         select
@@ -1106,7 +1091,6 @@
         left join dkic_b.t_psi_inventory as tpi on tpi.inv_id = tpoi.inv_id
         <include refid="Condition_IntoboundDetailReport"/>
     </select>
-
     <!-- 客户收款明细报表主表 -->
     <select id="getRecPayDetailReport" resultType="java.util.Map">
         SELECT
@@ -1149,7 +1133,6 @@
         left join dkic_b.t_mst_money_account tmma on tmma.mac_id = tmrpi.mac_id
         <include refid="Condition_RecPayDetailReport"/>
     </select>
-
     <sql id="ConditionPurTrackingReport">
         <where>
             <if test="cpId != null">
@@ -1157,7 +1140,6 @@
             </if>
         </where>
     </sql>
-
     <!--  销售跟踪表 列表查询 -->
     <select id="getSalesTrackingReport" resultType="java.util.Map">
         SELECT
@@ -1221,7 +1203,6 @@
             limit #{end} offset #{start}
         </if>
     </select>
-
     <sql id="ConditionSalesTrackingReport">
         <where>
             <if test="orderNo != null">
@@ -1248,8 +1229,6 @@
             </if>
         </where>
     </sql>
-
-
     <!--  销售明细查询 -->
     <select id="getSalesItemReport" resultType="java.util.Map">
         SELECT
@@ -1299,7 +1278,6 @@
         </if>
 
     </select>
-
     <sql id="ConditionSaleItem">
         <where>
             <if test="orderId != null and orderId != ''">
@@ -1618,7 +1596,6 @@
         </if>
     </select>
 
-
     <select id="getPurTrackingReportCount" resultType="java.lang.Long">
         SELECT count(1)
         FROM

+ 4 - 2
src/main/java/com/dk/mdm/service/ivt/inbound/InboundOtherService.java

@@ -589,8 +589,10 @@ public class InboundOtherService extends BaseService<Inbound> {
                 inboundItemVO.setInventoryType(Constant.InventoryType.INBOUND.getName());
                 inboundItemVO.setInventoryDocCode(Constant.InventoryDocCode.OTHER_INBOUND.getValue());
                 //编辑之前的数
-                inboundItemVO.setQtyBeforeUpdate(inboundItemResponse.getIntoQty());
-                inboundItemVO.setAmtBeforeUpdate(inboundItemResponse.getIntoAmt());
+                if (inboundItemResponse.getIntoQty().compareTo(BigDecimal.ZERO) > 0) {
+                    inboundItemVO.setQtyBeforeUpdate(inboundItemResponse.getIntoQty());
+                    inboundItemVO.setAmtBeforeUpdate(inboundItemResponse.getIntoAmt());
+                }
                 inboundItemVO.setAddOrEditFlag(true);
                 //endregion
             }

+ 4 - 2
src/main/java/com/dk/mdm/service/ivt/inbound/InboundPurchaseReturnService.java

@@ -652,8 +652,10 @@ public class InboundPurchaseReturnService extends BaseService<Inbound> {
                 inboundItemVO.setInventoryType(Constant.InventoryType.INBOUND.getName());
                 inboundItemVO.setInventoryDocCode(Constant.InventoryDocCode.PURCHASE_RETURN.getValue());
                 //编辑之前的数
-                inboundItemVO.setQtyBeforeUpdate(inboundItemResponse.getIntoQty());
-                inboundItemVO.setAmtBeforeUpdate(inboundItemResponse.getIntoAmt());
+                if(inboundItemResponse.getIntoQty().compareTo(BigDecimal.ZERO)>0){
+                    inboundItemVO.setQtyBeforeUpdate(inboundItemResponse.getIntoQty());
+                    inboundItemVO.setAmtBeforeUpdate(inboundItemResponse.getIntoAmt());
+                }
                 inboundItemVO.setAddOrEditFlag(true);
                 //endregion
             }

+ 4 - 2
src/main/java/com/dk/mdm/service/ivt/inbound/InboundPurchaseService.java

@@ -944,8 +944,10 @@ public class InboundPurchaseService extends BaseService<Inbound> {
                 inboundItemVO.setInventoryType(Constant.InventoryType.INBOUND.getName());
                 inboundItemVO.setInventoryDocCode(Constant.InventoryDocCode.PURCHASE_ORDER.getValue());
                 //编辑之前的数
-                inboundItemVO.setQtyBeforeUpdate(inboundItemResponse.getIntoQty());
-                inboundItemVO.setAmtBeforeUpdate(inboundItemResponse.getIntoAmt());
+                if(inboundItemResponse.getIntoQty().compareTo(BigDecimal.ZERO)>0) {
+                    inboundItemVO.setQtyBeforeUpdate(inboundItemResponse.getIntoQty());
+                    inboundItemVO.setAmtBeforeUpdate(inboundItemResponse.getIntoAmt());
+                }
                 inboundItemVO.setAddOrEditFlag(true);
                 //endregion
             }

+ 4 - 2
src/main/java/com/dk/mdm/service/ivt/outbound/OutboundOtherService.java

@@ -593,8 +593,10 @@ public class OutboundOtherService extends BaseService<Outbound> {
                 outboundItemVO.setInventoryType(Constant.InventoryType.OUTBOUND.getName());
                 outboundItemVO.setInventoryDocCode(Constant.InventoryDocCode.OTHER_OUTBOUND.getValue());
                 //编辑之前的数
-                outboundItemVO.setQtyBeforeUpdate(outboundItemResponse.getOutQty());
-                outboundItemVO.setAmtBeforeUpdate(outboundItemResponse.getOutAmt());
+                if(outboundItemResponse.getOutQty().compareTo(BigDecimal.ZERO)>0) {
+                    outboundItemVO.setQtyBeforeUpdate(outboundItemResponse.getOutQty());
+                    outboundItemVO.setAmtBeforeUpdate(outboundItemResponse.getOutAmt());
+                }
                 outboundItemVO.setAddOrEditFlag(true);
                 //endregion
             }

+ 4 - 2
src/main/java/com/dk/mdm/service/ivt/outbound/OutboundSaleOrderService.java

@@ -940,8 +940,10 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
                 outboundItemVO.setInventoryType(Constant.InventoryType.OUTBOUND.getName());
                 outboundItemVO.setInventoryDocCode(Constant.InventoryDocCode.SALE_ORDER.getValue());
                 //编辑之前的数
-                outboundItemVO.setQtyBeforeUpdate(outboundItemResponse.getOutQty());
-                outboundItemVO.setAmtBeforeUpdate(outboundItemResponse.getOutAmt());
+                if (outboundItemResponse.getOutQty().compareTo(BigDecimal.ZERO) > 0) {
+                    outboundItemVO.setQtyBeforeUpdate(outboundItemResponse.getOutQty());
+                    outboundItemVO.setAmtBeforeUpdate(outboundItemResponse.getOutAmt());
+                }
                 outboundItemVO.setAddOrEditFlag(true);
                 //endregion
 

+ 4 - 2
src/main/java/com/dk/mdm/service/ivt/outbound/OutboundSaleReturnService.java

@@ -901,8 +901,10 @@ public class OutboundSaleReturnService extends BaseService<Outbound> {
                 outboundItemVO.setInventoryType(Constant.InventoryType.OUTBOUND.getName());
                 outboundItemVO.setInventoryDocCode(Constant.InventoryDocCode.SALE_RETURN.getValue());
                 //编辑之前的数
-                outboundItemVO.setQtyBeforeUpdate(outboundItemResponse.getOutQty());
-                outboundItemVO.setAmtBeforeUpdate(outboundItemResponse.getOutAmt());
+                if (outboundItemResponse.getOutQty().compareTo(BigDecimal.ZERO) > 0) {
+                    outboundItemVO.setQtyBeforeUpdate(outboundItemResponse.getOutQty());
+                    outboundItemVO.setAmtBeforeUpdate(outboundItemResponse.getOutAmt());
+                }
                 outboundItemVO.setAddOrEditFlag(true);
                 //endregion
             }

+ 3 - 3
src/main/java/com/dk/mdm/service/mac/PaymentService.java

@@ -343,9 +343,9 @@ public class PaymentService extends BaseService<RecPay> {
 
         // 更新前的最后校验
         // 剩余应付为负数,则不能保存
-        if (accountUpdate.getPayableResidue().compareTo(BigDecimal.ZERO) == -1) {
-            throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.AMT_HANDLE_NO_LESS_AMT_SHOULD.getMessage());
-        }
+//        if (accountUpdate.getPayableResidue().compareTo(BigDecimal.ZERO) == -1) {
+//            throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.AMT_HANDLE_NO_LESS_AMT_SHOULD.getMessage());
+//        }
         // 可用金额为负数,则不能保存
         if (accountUpdate.getPaymentResidue().compareTo(BigDecimal.ZERO) == -1) {
             throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.MAC_BALANCE_NO_LESS.getMessage());

+ 3 - 3
src/main/java/com/dk/mdm/service/mac/ReceiptService.java

@@ -578,9 +578,9 @@ public class ReceiptService extends BaseService<RecPay> {
 
         // 更新前的最后校验
         // 剩余应收为负数,则不能保存
-        if (accountUpdate.getReceivableResidue().compareTo(BigDecimal.ZERO) == -1) {
-            throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.AMT_HANDLE_NO_LESS_AMT_SHOULD.getMessage());
-        }
+//        if (accountUpdate.getReceivableResidue().compareTo(BigDecimal.ZERO) == -1) {
+//            throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.AMT_HANDLE_NO_LESS_AMT_SHOULD.getMessage());
+//        }
         // 可用金额为负数,则不能保存
         if (accountUpdate.getReceiptResidue().compareTo(BigDecimal.ZERO) == -1) {
             throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.MAC_BALANCE_NO_LESS.getMessage());