소스 검색

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

姜永辉 1 년 전
부모
커밋
40d97ff63e

+ 6 - 4
src/main/java/com/dk/mdm/mapper/ivt/InboundItemMapper.xml

@@ -709,12 +709,14 @@
         where item_id = #{itemId}::uuid
         where item_id = #{itemId}::uuid
     </update>
     </update>
 
 
-
     <!--根据来源id删除单据-->
     <!--根据来源id删除单据-->
-    <delete id="deleteItemByFromId">
-        DELETE FROM dkic_b.t_psi_inbound_item
+    <update id="deleteItemByFromId">
+        update dkic_b.t_psi_inbound_item
+        <set>
+            flg_valid = false
+        </set>
         WHERE from_id = #{fromId}::uuid
         WHERE from_id = #{fromId}::uuid
-    </delete>
+    </update>
 
 
     <!--查询入库价-->
     <!--查询入库价-->
     <select id="selectPriceInto"  resultMap="BaseResultMapResponse">
     <select id="selectPriceInto"  resultMap="BaseResultMapResponse">

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

@@ -114,7 +114,7 @@ public interface InboundMapper extends BaseMapper<Inbound>{
      * @date   : 2024/3/9 9:14
      * @date   : 2024/3/9 9:14
      * @author : 寇珊珊
      * @author : 寇珊珊
      */
      */
-    InboundResponse selectByFromId(@Param("id") String id);
+    InboundResponse selectByFromId(@Param("fromId") String fromId);
 
 
     /**
     /**
      * @desc   : 根据来源id删除单据
      * @desc   : 根据来源id删除单据

+ 7 - 4
src/main/java/com/dk/mdm/mapper/ivt/InboundMapper.xml

@@ -1193,14 +1193,17 @@
         SELECT
         SELECT
         <include refid="Base_Column_List_Response"/>
         <include refid="Base_Column_List_Response"/>
         FROM dkic_b.t_psi_inbound tpi
         FROM dkic_b.t_psi_inbound tpi
-        WHERE tpi.from_id = #{id}::uuid
+        WHERE tpi.from_id = #{fromId}::uuid
         and tpi.flg_valid
         and tpi.flg_valid
     </select>
     </select>
 
 
 
 
     <!--根据来源id删除单据-->
     <!--根据来源id删除单据-->
-    <delete id="deleteByFromId">
-        DELETE FROM dkic_b.t_psi_inbound
+    <update id="deleteByFromId" >
+        update dkic_b.t_psi_inbound
+        <set>
+            flg_valid = false
+        </set>
         WHERE from_id = #{fromId}::uuid
         WHERE from_id = #{fromId}::uuid
-    </delete>
+    </update>
 </mapper>
 </mapper>

+ 6 - 0
src/main/java/com/dk/mdm/mapper/report/ReportMapper.xml

@@ -1421,6 +1421,12 @@
             <if test="cpId != null">
             <if test="cpId != null">
                 tpp.cp_id = #{cpId}
                 tpp.cp_id = #{cpId}
             </if>
             </if>
+            <if test="staffIds != null and staffIds.size()>0">
+                AND tpp.staff_id = any(#{staffIds, typeHandler=uuidListTypeHandler})
+            </if>
+            <if test="orgIds != null and orgIds.size() > 0">
+                AND tpp.org_id = any(#{orgIds, typeHandler=uuidListTypeHandler})
+            </if>
         </where>
         </where>
     </sql>
     </sql>
     <!--  销售跟踪表 列表查询 -->
     <!--  销售跟踪表 列表查询 -->

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

@@ -255,7 +255,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
     public void deleteOutsideGoodsInto(OutboundVO outboundVO, List<OutboundItemVO> outboundItemVOList) {
     public void deleteOutsideGoodsInto(OutboundVO outboundVO, List<OutboundItemVO> outboundItemVOList) {
         if (outboundItemVOList != null && outboundItemVOList.size() > 0) {
         if (outboundItemVOList != null && outboundItemVOList.size() > 0) {
             //根据出库单id分组
             //根据出库单id分组
-            Map<String, List<OutboundItemVO>> outboundItemVOMap = outboundItemVOList.stream().collect(Collectors.groupingBy(OutboundItemVO::getOutId));
+            Map<String, List<OutboundItemVO>> outboundItemVOMap = outboundItemVOList.stream().collect(Collectors.groupingBy(OutboundItemVO::getFromId));
             for (String str : outboundItemVOMap.keySet()) {
             for (String str : outboundItemVOMap.keySet()) {
                 InboundResponse inboundResponse = inboundMapper.selectByFromId(str);
                 InboundResponse inboundResponse = inboundMapper.selectByFromId(str);
                 // 退账
                 // 退账
@@ -265,9 +265,9 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
             }
             }
             //删除外协入库单
             //删除外协入库单
             //外协入库总单
             //外协入库总单
-            inboundMapper.deleteByFromId(outboundItemVOList.get(0).getOutId());
+            inboundMapper.deleteByFromId(outboundItemVOList.get(0).getFromId());
             //外协入库明细
             //外协入库明细
-            inboundItemMapper.deleteItemByFromId(outboundItemVOList.get(0).getOutId());
+            inboundItemMapper.deleteItemByFromId(outboundItemVOList.get(0).getFromId());
         }
         }
 
 
     }
     }

+ 7 - 2
src/main/java/com/dk/mdm/service/sale/OrderService.java

@@ -847,6 +847,7 @@ public class OrderService extends BaseService<Order> {
                             if (deleteOrderItemVOList.size() > 0) {
                             if (deleteOrderItemVOList.size() > 0) {
                                 for (OrderItemVO orderItemVO : deleteOrderItemVOList) {
                                 for (OrderItemVO orderItemVO : deleteOrderItemVOList) {
                                     orderItemVO.setOutId(outboundResponsejson.getOutId());
                                     orderItemVO.setOutId(outboundResponsejson.getOutId());
+                                    orderItemVO.setPriceOut(orderItemVO.getFactPrice());
                                 }
                                 }
                                 orderVO.setDeleteItemList(deleteOrderItemVOList);
                                 orderVO.setDeleteItemList(deleteOrderItemVOList);
                             }
                             }
@@ -1067,7 +1068,6 @@ public class OrderService extends BaseService<Order> {
             throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.ISFLGVALID_FALSE.getMessage());
             throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.ISFLGVALID_FALSE.getMessage());
         }
         }
         //endregion
         //endregion
-
         //region 作废
         //region 作废
         Order orderUpdate = new Order();
         Order orderUpdate = new Order();
         orderUpdate.setFlgValid(false).setOrderId(id);
         orderUpdate.setFlgValid(false).setOrderId(id);
@@ -1097,8 +1097,13 @@ public class OrderService extends BaseService<Order> {
                 }
                 }
             }
             }
 
 
+            String gradeCode = authUtils.getStaff().getGradeCode();
             // 更新总账表的总收款额和可用额
             // 更新总账表的总收款额和可用额
-            accountService.updateReceiptLock(recPayForUpdate.getObjectId());
+            if ("STD".equals(gradeCode)) {
+                accountService.updateReceipt(recPayForUpdate.getObjectId());
+            } else {
+                accountService.updateReceiptLock(recPayForUpdate.getObjectId());
+            }
 
 
             // 更新账户余额
             // 更新账户余额
             for (String macId : macList) {
             for (String macId : macList) {