mac 2 лет назад
Родитель
Сommit
e5d116f33b

+ 1 - 1
kxs-product/kxs-product-biz/src/main/resources/mapper/KxsMachineMapper.xml

@@ -47,7 +47,7 @@
         <where>
         <where>
             and del_flag = 0
             and del_flag = 0
             and status = 0
             and status = 0
-            and pre_user_id > 0
+            and pre_user_id = 0
             <if test="query.warehouseId != null">
             <if test="query.warehouseId != null">
                 and warehouse_id = #{query.warehouseId}
                 and warehouse_id = #{query.warehouseId}
             </if>
             </if>

+ 4 - 2
kxs-store/kxs-store-biz/src/main/java/com/kxs/store/biz/service/impl/KxsMachineAdvanceServiceImpl.java

@@ -137,8 +137,10 @@ public class KxsMachineAdvanceServiceImpl extends ServiceImpl<KxsMachineAdvanceM
         }
         }
         KxsMachineAdvanceInfo machineAdvanceInfo = kxsMachineAdvanceInfoMapper
         KxsMachineAdvanceInfo machineAdvanceInfo = kxsMachineAdvanceInfoMapper
                 .selectOne(Wrappers.<KxsMachineAdvanceInfo>lambdaQuery()
                 .selectOne(Wrappers.<KxsMachineAdvanceInfo>lambdaQuery()
+                        .eq(KxsMachineAdvanceInfo::getIsReturn, CommonConstants.FAIL)
+                        .eq(KxsMachineAdvanceInfo::getIsConfirm, CommonConstants.FAIL)
                         .eq(KxsMachineAdvanceInfo::getPosSn, advance.getPosSn()));
                         .eq(KxsMachineAdvanceInfo::getPosSn, advance.getPosSn()));
-
+        Optional.ofNullable(machineAdvanceInfo).orElseThrow(() -> new GlobalCustomerException("该机具已被接收/已撤回"));
         machineAdvanceInfo.setIsReturn(CommonConstants.SUCCESS);
         machineAdvanceInfo.setIsReturn(CommonConstants.SUCCESS);
         machineAdvanceInfo.setReturnTime(LocalDateTime.now());
         machineAdvanceInfo.setReturnTime(LocalDateTime.now());
         kxsMachineAdvanceInfoMapper.updateById(machineAdvanceInfo);
         kxsMachineAdvanceInfoMapper.updateById(machineAdvanceInfo);
@@ -203,7 +205,7 @@ public class KxsMachineAdvanceServiceImpl extends ServiceImpl<KxsMachineAdvanceM
         String pidPath = toUser.getPidPath();
         String pidPath = toUser.getPidPath();
 
 
         //判断是否是下级
         //判断是否是下级
-        boolean contains = pidPath.contains("," + userId + ",");
+        boolean contains = pidPath.contains(StrUtil.COMMA + userId + StrUtil.COMMA);
         if (!contains) {
         if (!contains) {
             return R.failed(StoreErrorTypeEnum.USER_IS_NOT_FIND.getDescription());
             return R.failed(StoreErrorTypeEnum.USER_IS_NOT_FIND.getDescription());
         }
         }

+ 2 - 2
kxs-store/kxs-store-biz/src/main/resources/mapper/KxsMachineAdvanceMapper.xml

@@ -41,7 +41,7 @@
         </if>
         </if>
         and b.is_apply = 0
         and b.is_apply = 0
         and b.is_return = 0
         and b.is_return = 0
-        and b.is_confirm = 1
+        and b.is_confirm in (0,1)
         group by to_user_id) as warehouse_user
         group by to_user_id) as warehouse_user
 
 
 
 
@@ -76,7 +76,7 @@
         and a.to_user_id = #{toUserId}
         and a.to_user_id = #{toUserId}
         and b.is_apply = 0
         and b.is_apply = 0
         and b.is_return = 0
         and b.is_return = 0
-        and b.is_confirm = 1
+        and b.is_confirm in (0, 1)
     </select>
     </select>
 
 
     <resultMap type="com.kxs.store.api.vo.kxsapp.userAdvance.AdvanceDevModalVO" id="AdvanceDevModalMap">
     <resultMap type="com.kxs.store.api.vo.kxsapp.userAdvance.AdvanceDevModalVO" id="AdvanceDevModalMap">