Просмотр исходного кода

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

于继渤 1 год назад
Родитель
Сommit
3418c0743c

+ 1 - 1
src/main/java/com/dk/mdm/mapper/ivt/InventoryMapper.xml

@@ -301,7 +301,7 @@
             <if test="nonStdCode != null and nonStdCode != ''">
                 AND tpi.non_std_code = #{nonStdCode}
             </if>
-            <if test="nonStdCode == null and nonStdCode == ''">
+            <if test="nonStdCode == null or nonStdCode == ''">
                 AND tpi.non_std_code = '-'
             </if>
         </where>

+ 9 - 2
src/main/java/com/dk/mdm/mapper/report/ReportMapper.xml

@@ -3089,6 +3089,7 @@
             left join dkic_b.t_psi_outbound tpo on tpo.out_id = tpoi.out_id
         </if>
         <include refid="getSaleProfitCond"/>
+        <include refid="getSaleProfitDateCond"/>
         <if test="orgIds!=null and orgIds.size()>0">
             and (
             tpo.org_id = any(#{orgIds, typeHandler=com.dk.common.infrastructure.handler.UuidListTypeHandler})
@@ -3110,7 +3111,7 @@
         </if>
         <include refid="getSaleProfitInOutBound"/>
         from dkic_b.t_psi_outbound_item tpoi
-        where tpoi.cp_id = #{cpId} and tpoi.out_status = '出库状态-已出库'
+        <include refid="getSaleProfitCond"/>
         AND tpoi.op_create_time >= now() - interval
         <if test="byDate==null or (byDate!=null and byDate=='false')">
             '1 year'
@@ -3141,6 +3142,7 @@
         from dkic_b.t_psi_outbound_item tpoi
         left join dkic_b.t_psi_outbound tpo on tpo.out_id = tpoi.out_id
         <include refid="getSaleProfitCond"/>
+        <include refid="getSaleProfitDateCond"/>
         group by tpo.org_id) t
         ) tt
         left join dkic_b.t_mst_org tmo on tmo.org_id = tt.org_id
@@ -3158,6 +3160,7 @@
         from dkic_b.t_psi_outbound_item tpoi
         left join dkic_b.t_psi_outbound tpo on tpo.out_id = tpoi.out_id
         <include refid="getSaleProfitCond"/>
+        <include refid="getSaleProfitDateCond"/>
         <if test="orgIds!=null and orgIds.size()>0">
             and (
             tpo.org_id = any(#{orgIds, typeHandler=com.dk.common.infrastructure.handler.UuidListTypeHandler})
@@ -3179,6 +3182,7 @@
         <include refid="getSaleProfitInOutBound"/>
         from dkic_b.t_psi_outbound_item tpoi
         <include refid="getSaleProfitCond"/>
+        <include refid="getSaleProfitDateCond"/>
         group by sku_id) t
         ) tt
         left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tt.sku_id
@@ -3191,7 +3195,10 @@
     </sql>
 
     <sql id="getSaleProfitCond">
-        where tpoi.cp_id = #{cpId} and tpoi.out_status = '出库状态-已出库'
+        where tpoi.cp_id = #{cpId} and tpoi.out_status = '出库状态-已出库' and tpoi.sku_id is not null
+    </sql>
+
+    <sql id="getSaleProfitDateCond">
         <if test="makeTimeStart != null and makeTimeEnd != null">
             AND tpoi.op_create_time &gt;= #{makeTimeStart}::timestamp with time zone
             AND tpoi.op_create_time &lt; #{makeTimeEnd}::timestamp with time zone + interval '1 day'

+ 5 - 3
src/main/java/com/dk/mdm/service/sale/OrderService.java

@@ -490,9 +490,11 @@ public class OrderService extends BaseService<Order> {
             throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.ISFLGVALID_FALSE.getMessage());
         }
         // 如果全部出库了
-        if (orderForUpdate.getSumQuantity().compareTo(orderForUpdate.getOutQty()) == 0) {
-            throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.ORDER_IS_OUT.getMessage());
-        }
+        //标:之前沟通允许大编辑,目前订单开单已出库的单子进行编辑是不允许操作的(请确定一下,到底系统设计是否允许大编辑?)
+        //bug 6933可查
+//        if (orderForUpdate.getSumQuantity().compareTo(orderForUpdate.getOutQty()) == 0) {
+//            throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.ORDER_IS_OUT.getMessage());
+//        }
 
         // 明细实体(避免并发,需要再查一遍)
         OrderItem orderItemForUpdate;