Browse Source

Merge branch 'server-165' of uskycloud/usky-modules into master

gez 1 năm trước cách đây
mục cha
commit
807470ff10

+ 1 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPlanSonServiceImpl.java

@@ -397,7 +397,7 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
     public List<PatrolInspectionSite> siteList(String startTime, String endTime) {
         LambdaQueryWrapper<PatrolInspectionSite> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.eq(PatrolInspectionSite::getTenantId, SecurityUtils.getTenantId());
-        queryWrapper.eq(PatrolInspectionSite::getCollector, SecurityUtils.getUsername());
+        queryWrapper.eq(PatrolInspectionSite::getCollector, SecurityUtils.getLoginUser().getSysUser().getNickName());
         queryWrapper.eq(PatrolInspectionSite::getEnable, 1);
         if (startTime != null && !"".equals(startTime) && endTime != null && !"".equals(endTime)) {
             queryWrapper.between(PatrolInspectionSite::getCollectTime, startTime, endTime);

+ 3 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/mapper/DmpDeviceTypeMapper.java

@@ -4,6 +4,7 @@ import com.usky.common.security.utils.SecurityUtils;
 import com.usky.iot.domain.DmpDeviceType;
 import com.usky.common.mybatis.core.CrudMapper;
 import com.usky.iot.domain.DmpProductInfo;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
@@ -19,4 +20,6 @@ import java.util.List;
 @Repository
 public interface DmpDeviceTypeMapper extends CrudMapper<DmpDeviceType> {
     List<DmpProductInfo> getProductInfo(Integer tenantId);
+
+    List<DmpProductInfo> getProductInfoList(@Param("typeCode") String typeCode);
 }

+ 8 - 2
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/BaseFacilityTypeServiceImpl.java

@@ -143,12 +143,18 @@ public class BaseFacilityTypeServiceImpl extends AbstractCrudService<BaseFacilit
 
     @Override
     public boolean remove(Integer id) {
+        BaseFacilityType one = this.getById(id);
+        if(one == null){
+            throw new BusinessException("设施类型不存在");
+        }
+
         LambdaQueryWrapper<BaseGgpFacility> queryWrapper1 = Wrappers.lambdaQuery();
-        queryWrapper1.eq(BaseGgpFacility::getFacilityType, id);
+        queryWrapper1.eq(BaseGgpFacility::getFacilityType, one.getTypeCode());
         int facilityNum = baseGgpFacilityService.getBaseMapper().selectCount(queryWrapper1);
         if (facilityNum>0) {
-            throw new BusinessException("设施类型删除失败,该设施类型下有设施绑定");
+            throw new BusinessException("当前类型已有关联设施,不可删除");
         }
+
         return this.removeById(id);
     }
 }

+ 10 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/DmpDeviceTypeServiceImpl.java

@@ -67,6 +67,16 @@ public class DmpDeviceTypeServiceImpl extends AbstractCrudService<DmpDeviceTypeM
 
     @Override
     public void remove(Integer id) {
+        DmpDeviceType one = this.getById(id);
+        if(one == null){
+            throw new BusinessException("设备类型不存在");
+        }
+
+        List<DmpProductInfo> list = baseMapper.getProductInfoList(one.getTypeCode());
+        if(list.size() > 0){
+            throw new BusinessException("当前类型已有关联产品,不可删除");
+        }
+
         this.removeById(id);
     }
 

+ 12 - 0
service-iot/service-iot-biz/src/main/resources/mapper/iot/DmpDeviceTypeMapper.xml

@@ -31,5 +31,17 @@
             </if>
         </where>
     </select>
+    <select id="getProductInfoList" resultType="com.usky.iot.domain.DmpProductInfo">
+        select *
+        from dmp_product
+        <where>
+            <if test="typeCode != null">
+                and device_type = #{typeCode}
+            </if>
+            <if test="1 == 1">
+                and delete_flag = 0
+            </if>
+        </where>
+    </select>
 
 </mapper>

+ 1 - 1
service-meeting/service-meeting-biz/src/main/java/com/usky/meeting/repository/MeetingInfoRepository.java

@@ -160,7 +160,7 @@ public interface MeetingInfoRepository extends JpaRepository<MeetingInfo, Long>,
             " date_format(a.end_date,'%Y-%m-%d %H:%i:%s') as endDate" +
             " from meeting_info as a" +
             " where a.room_id = :roomId" +
-            " and ((start_date <= :startDate and end_date >= :startDate and end_date != :startDate) or (start_date <= :endDate and end_date >= :endDate and start_date != :endDate))" +
+            " and ((a.start_date <= :startDate and a.end_date >= :startDate and a.end_date != :startDate) or (a.start_date <= :endDate and a.end_date >= :endDate and a.start_date != :endDate))" +
             " and if(:meetingId != '',a.meeting_id != :meetingId,1=1)" +
             " and a.is_cancel = 0 and a.meeting_status != 2 and a.approve_status != 2",nativeQuery = true)
     List<Map<String,String>> checkDmRoomMeetingDate(@Param("roomId") Long roomId,

+ 6 - 2
service-meeting/service-meeting-biz/src/main/java/com/usky/meeting/service/impl/MeetingRoomServiceImpl.java

@@ -192,8 +192,10 @@ public class MeetingRoomServiceImpl extends AbstractCrudService<MeetingRoomMappe
         map.put("userName", userName);
         List<MeetingAttendee> list = meetingAttendeeRepository.findMeetingAttendeeList(meetingId, userId, tenantId);
         if (org.springframework.util.CollectionUtils.isEmpty(list)) {
+            map.put("status","0");
             map.put("msg", "您当前没有需要参加的会议");
         } else {
+            map.put("status","1");
             map.put("msg", "验证成功");
         }
         return map;
@@ -203,10 +205,12 @@ public class MeetingRoomServiceImpl extends AbstractCrudService<MeetingRoomMappe
     public List<DmMeetingRoomDto> getMeetingRoomReservationList(MeetingRoomReservationVO reservationVO) throws ParseException {
         List<DmMeetingRoomDto> list = new ArrayList<>();
         List<DmMeetingRoomDto> newDmMeetingRoomDtoList = new ArrayList<>();
+        String meetingRoomName = reservationVO.getMeetingRoomName();
         Long meetingRoomId = reservationVO.getMeetingRoomId();
         LambdaQueryWrapper<MeetingRoom> queryWrapper = Wrappers.lambdaQuery();
-        queryWrapper.eq(meetingRoomId != null, MeetingRoom::getRoomId, meetingRoomId)
-                .eq(MeetingRoom::getTenantId, SecurityUtils.getTenantId());
+        queryWrapper.eq(meetingRoomId != null,MeetingRoom::getRoomId,reservationVO.getMeetingRoomId())
+                .like(StringUtils.isNotBlank(meetingRoomName),MeetingRoom::getRoomName,meetingRoomName)
+                .eq(MeetingRoom::getTenantId,SecurityUtils.getTenantId());
         List<MeetingRoom> list1 = this.list(queryWrapper);
         List<Long> floorIdList = new ArrayList<>();
         if (CollectionUtils.isNotEmpty(list1)) {

+ 3 - 0
service-meeting/service-meeting-biz/src/main/java/com/usky/meeting/service/vo/MeetingRoomReservationVO.java

@@ -1,5 +1,7 @@
 package com.usky.meeting.service.vo;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.squareup.moshi.Json;
 import lombok.Data;
 
 @Data
@@ -8,6 +10,7 @@ public class MeetingRoomReservationVO {
     /**
      * 会议室id
      */
+    @JsonFormat(shape = JsonFormat.Shape.STRING)
     private Long meetingRoomId;
 
     /**