소스 검색

Merge branch 'han' of uskycloud/usky-modules into master

gez 1 개월 전
부모
커밋
bde636f2bb

+ 5 - 4
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/MybatisGeneratorUtils.java

@@ -43,10 +43,11 @@ public class MybatisGeneratorUtils {
         //2、数据源配置
         //修改数据源
         DataSourceConfig dsc = new DataSourceConfig();
-        dsc.setUrl("jdbc:mysql://172.16.120.165:3306/usky-fire?useUnicode=true&serverTimezone=GMT&useSSL=false&characterEncoding=utf8");
+        dsc.setUrl("jdbc:mysql://192.168.10.165:3306/usky-fire?useUnicode=true&serverTimezone=GMT&useSSL=false" +
+                "&characterEncoding=utf8");
         dsc.setDriverName("com.mysql.cj.jdbc.Driver");
-        dsc.setUsername("usky");
-        dsc.setPassword("Yt#75Usky");
+        dsc.setUsername("root");
+        dsc.setPassword("yt123456");
         mpg.setDataSource(dsc);
 
         // 3、包配置
@@ -71,7 +72,7 @@ public class MybatisGeneratorUtils {
         // strategy.setTablePrefix("t_"); // 表名前缀
         strategy.setEntityLombokModel(true); //使用lombok
         //修改自己想要生成的表
-        strategy.setInclude("patrol_inspection_abnormal_picture");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
+        strategy.setInclude("patrol_inspection_site_store");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
         mpg.setStrategy(strategy);
 
         // 关闭默认 xml 生成,调整生成 至 根目录

+ 21 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionSiteStoreController.java

@@ -0,0 +1,21 @@
+package com.usky.fire.controller.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author han
+ * @since 2025-10-21
+ */
+@Controller
+@RequestMapping("/patrolInspectionSiteStore")
+public class PatrolInspectionSiteStoreController {
+
+}
+

+ 43 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/PatrolInspectionSiteStore.java

@@ -0,0 +1,43 @@
+package com.usky.fire.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author han
+ * @since 2025-10-21
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class PatrolInspectionSiteStore implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 地点号码
+     */
+    private String siteNubmber;
+
+    /**
+     * 入库时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 入库人
+     */
+    private String creator;
+
+
+}

+ 16 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/PatrolInspectionSiteStoreMapper.java

@@ -0,0 +1,16 @@
+package com.usky.fire.mapper;
+
+import com.usky.fire.domain.PatrolInspectionSiteStore;
+import com.usky.common.mybatis.core.CrudMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author han
+ * @since 2025-10-21
+ */
+public interface PatrolInspectionSiteStoreMapper extends CrudMapper<PatrolInspectionSiteStore> {
+
+}

+ 24 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionSiteStoreService.java

@@ -0,0 +1,24 @@
+package com.usky.fire.service;
+
+import com.usky.fire.domain.PatrolInspectionSiteStore;
+import com.usky.common.mybatis.core.CrudService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author han
+ * @since 2025-10-21
+ */
+public interface PatrolInspectionSiteStoreService extends CrudService<PatrolInspectionSiteStore> {
+
+    /**
+     * 巡检点位采集校验
+     *
+     * @param siteNubmber        地点号码
+     * @return
+     */
+    int siteStoreCount(String siteNubmber);
+
+}

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

@@ -84,6 +84,9 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
     @Autowired
     private PatrolInspectionAbnormalService patrolInspectionAbnormalService;
 
+    @Autowired
+    private PatrolInspectionSiteStoreService patrolInspectionSiteStoreService;
+
     private static final Logger LOGGER = LoggerFactory.getLogger(PatrolInspectionPlanSonServiceImpl.class);
 
     @Override
@@ -612,9 +615,13 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
         queryWrapper.eq(PatrolInspectionSite::getSiteNubmber, patrolInspectionSite.getSiteNubmber())
                 .eq(PatrolInspectionSite::getEnable, 1);
         int list = patrolInspectionSiteService.count(queryWrapper);
+        int siteCount = patrolInspectionSiteStoreService.siteStoreCount(patrolInspectionSite.getSiteNubmber());
         if (list > 0) {
             throw new BusinessException("不可重复采集地点");
         }
+        if (siteCount <= 0) {
+            throw new BusinessException("采集点位不合法,请采集合法点位");
+        }
         patrolInspectionSite.setCreator(SecurityUtils.getUsername());
         patrolInspectionSite.setCollector(SecurityUtils.getLoginUser().getSysUser().getNickName());
         patrolInspectionSite.setCreateTime(LocalDateTime.now());

+ 2 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionSiteServiceImpl.java

@@ -256,6 +256,8 @@ public class PatrolInspectionSiteServiceImpl extends AbstractCrudService<PatrolI
         }
         if (areaId != null) {
             queryWrapper.eq(PatrolInspectionSite::getAreaId, areaId);
+        }else{
+            queryWrapper.ne(PatrolInspectionSite::getAreaId, 0);
         }
         if (StringUtils.isNotBlank(idList)) {
             List<Integer> siteidList = new ArrayList<>();

+ 29 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionSiteStoreServiceImpl.java

@@ -0,0 +1,29 @@
+package com.usky.fire.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.usky.fire.domain.PatrolInspectionPlanSiteSon;
+import com.usky.fire.domain.PatrolInspectionSiteStore;
+import com.usky.fire.mapper.PatrolInspectionSiteStoreMapper;
+import com.usky.fire.service.PatrolInspectionSiteStoreService;
+import com.usky.common.mybatis.core.AbstractCrudService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author han
+ * @since 2025-10-21
+ */
+@Service
+public class PatrolInspectionSiteStoreServiceImpl extends AbstractCrudService<PatrolInspectionSiteStoreMapper, PatrolInspectionSiteStore> implements PatrolInspectionSiteStoreService {
+    @Override
+    public int siteStoreCount(String siteNubmber) {
+        LambdaQueryWrapper<PatrolInspectionSiteStore> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(PatrolInspectionSiteStore::getSiteNubmber, siteNubmber);
+        int siteCount = this.count(queryWrapper);
+        return siteCount;
+    }
+}

+ 13 - 0
service-fire/service-fire-biz/src/main/resources/mapper/fire/PatrolInspectionSiteStoreMapper.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.usky.fire.mapper.PatrolInspectionSiteStoreMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.usky.fire.domain.PatrolInspectionSiteStore">
+        <id column="id" property="id" />
+        <result column="site_nubmber" property="siteNubmber" />
+        <result column="create_time" property="createTime" />
+        <result column="creator" property="creator" />
+    </resultMap>
+
+</mapper>