Browse Source

修改激活记录,主账户查询全部,子账户查询当前登录人的

luyanwen-001 3 years ago
parent
commit
d88b0dba90

+ 3 - 0
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dto/req/ActivationRecordReq.java

@@ -20,4 +20,7 @@ public class ActivationRecordReq implements Serializable {
 
     @ApiModelProperty(value = "月份")
     private String month;
+
+    @ApiModelProperty(value = "当前登陆人ID")
+    private Long userId;
 }

+ 3 - 1
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/service/impl/QrBoxMappingServiceImpl.java

@@ -235,7 +235,9 @@ public class QrBoxMappingServiceImpl implements QrBoxMappingService {
         Integer isMainAccount = userUtil.getWholeUser().getIsMainAccount();
 
         ActivationRecordRes res = new ActivationRecordRes();
-
+        if (isMainAccount.equals(1)) {
+            req.setUserId(null);
+        }
         List<ActivationRecordVO> recordVOList = qrBoxMappingMapper.getActivationRecord(req);
         List<ActivationRecordRes.ActivationRecordBean> beanList = PojoConverterUtils.copyList(recordVOList, ActivationRecordRes.ActivationRecordBean.class);
         res.setActivationRecordBeanList(beanList);

+ 3 - 0
abi-cloud-qr-platform-server/src/main/resources/dao/mapper/QrBoxMappingMapper.xml

@@ -140,6 +140,9 @@
             <if test="req.month != null and req.month !=''">
                 AND DATE_FORMAT(qbm.active_time,'%Y-%m') = #{req.month}
             </if>
+            <if test="req.userId != null and req.userId !=''">
+                AND ui.id =#{req.userId}
+            </if>
         </where>
         ORDER BY qbm.active_time DESC
     </select>