Przeglądaj źródła

孢子仪新增 图片数量统计功能

zhaiyifei 1 rok temu
rodzic
commit
39b8e86a6e

+ 0 - 10
src/main/java/com/yunfeiyun/agmp/iotm/device/bzy/service/IIotSporeService.java

@@ -2,7 +2,6 @@ package com.yunfeiyun.agmp.iotm.device.bzy.service;
 
 
 import com.yunfeiyun.agmp.iot.common.domain.IotSpore;
-import com.yunfeiyun.agmp.iotm.device.bzy.domain.IotSporeResVo;
 
 import java.util.List;
 import java.util.Map;
@@ -30,7 +29,6 @@ public interface IIotSporeService
      * @return 害虫信息集合
      */
     public List<IotSpore> selectIotSporeList(IotSpore iotPest);
-    public List<IotSporeResVo> selectIotSporeList1(IotSpore iotSpore);
 
     public Map<String, IotSpore> selectIotSporeMapAllInfo();
     public Map<String, String> selectIotSporeMapAll();
@@ -45,14 +43,6 @@ public interface IIotSporeService
     public int insertIotSpore(IotSpore iotPest);
 
     /**
-     * 修改害虫信息
-     *
-     * @param iotPest 害虫信息
-     * @return 结果
-     */
-    public int updateIotSpore(IotSpore iotPest);
-
-    /**
      * 批量删除害虫信息
      *
      * @param ids 需要删除的害虫信息主键集合

+ 2 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/bzy/service/impl/IotBzyrecogServiceImpl.java

@@ -139,6 +139,7 @@ public class IotBzyrecogServiceImpl implements IIotBzyrecogService {
                     iotPest.setSporeCreatedDate(DateUtils.dateTimeNow());
                     iotPest.setSporeDelstatus("0");
                     iotPest.setSporeInsertType("2");
+                    iotPest.setTid(resVo.getTid());
                     iotPestService.insertIotSpore(iotPest);
                     pestMap.put(iotPest.getSporeId(), iotPest.getSporeBid());
                     JSONObject point2 = new JSONObject();
@@ -451,6 +452,7 @@ public class IotBzyrecogServiceImpl implements IIotBzyrecogService {
                     iotPest.setSporeCreatedDate(DateUtils.dateTimeNow());
                     iotPest.setSporeDelstatus("0");
                     iotPest.setSporeInsertType("2");
+                    iotPest.setTid(resVo.getTid());
                     iotPestService.insertIotSpore(iotPest);
 
                     pestMap.put(iotPest.getSporeName(), iotPest.getSporeBid());

+ 0 - 17
src/main/java/com/yunfeiyun/agmp/iotm/device/bzy/service/impl/IotSporeServiceImpl.java

@@ -3,7 +3,6 @@ package com.yunfeiyun.agmp.iotm.device.bzy.service.impl;
 import com.yunfeiyun.agmp.common.enums.RedisCacheKey;
 import com.yunfeiyun.agmp.common.framework.manager.RedisCacheManager;
 import com.yunfeiyun.agmp.iot.common.domain.IotSpore;
-import com.yunfeiyun.agmp.iotm.device.bzy.domain.IotSporeResVo;
 import com.yunfeiyun.agmp.iotm.device.bzy.service.IIotSporeService;
 import com.yunfeiyun.agmp.iotm.web.mapper.IotSporeMapper;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -56,11 +55,6 @@ public class IotSporeServiceImpl implements IIotSporeService {
     }
 
     @Override
-    public List<IotSporeResVo> selectIotSporeList1(IotSpore iotSpore) {
-        return iotPestMapper.selectIotSporeList1(iotSpore);
-    }
-
-    @Override
     public Map<String, IotSpore> selectIotSporeMapAllInfo() {
 //        Map<String,String> map = redisCacheManager.getCacheMap(RedisCacheKey.IOT_PEST,"all");
 //        if(map.size()==0){
@@ -97,17 +91,6 @@ public class IotSporeServiceImpl implements IIotSporeService {
     }
 
     /**
-     * 修改害虫信息
-     *
-     * @param iotPest 害虫信息
-     * @return 结果
-     */
-    @Override
-    public int updateIotSpore(IotSpore iotPest) {
-        return iotPestMapper.updateIotSpore(iotPest);
-    }
-
-    /**
      * 批量删除害虫信息
      *
      * @param ids 需要删除的害虫信息主键

+ 0 - 2
src/main/java/com/yunfeiyun/agmp/iotm/web/mapper/IotSporeMapper.java

@@ -2,7 +2,6 @@ package com.yunfeiyun.agmp.iotm.web.mapper;
 
 
 import com.yunfeiyun.agmp.iot.common.domain.IotSpore;
-import com.yunfeiyun.agmp.iotm.device.bzy.domain.IotSporeResVo;
 
 import java.util.List;
 
@@ -30,7 +29,6 @@ public interface IotSporeMapper {
      * @return 害虫信息集合
      */
     public List<IotSpore> selectIotSporeList(IotSpore iotPest);
-    public List<IotSporeResVo> selectIotSporeList1(IotSpore iotSpore);
 
     /**
      * 新增害虫信息

+ 2 - 2
src/main/java/com/yunfeiyun/agmp/iotm/web/service/impl/IotDeviceServiceImpl.java

@@ -381,7 +381,7 @@ public class IotDeviceServiceImpl implements IIotDeviceService
             devCodeSet.add(iotDevice.getDevtypeBid() + iotDevice.getDevCode());
             String topic = IotMqttConstant.getReportTopicByDevtype(iotDevice.getDevtypeBid());
             if(StringUtils.isNotEmpty(topic)){
-                devTopicSet.add(IotMqttConstant.getReportTopicByDevtype(iotDevice.getDevtypeBid()));
+                devTopicSet.add(IotMqttConstant.getReportTopicByDevtype(iotDevice.getDevtypeBid()) + iotDevice.getDevCode());
             }
         }
         String topic = IotMqttConstant.getReportTopicByDevtype(devtypeBid);
@@ -389,7 +389,7 @@ public class IotDeviceServiceImpl implements IIotDeviceService
             String key = devtypeBid + code;
             // 同一个mqtt Topic只能有一个设备
             // 同一个设备类型下不能有重复的设备编号
-            if(devTopicSet.contains(topic) || devCodeSet.contains(key)){
+            if(devTopicSet.contains(topic + code) || devCodeSet.contains(key)){
                 return code;
             }
         }

+ 3 - 13
src/main/resources/mapper/IotSporeMapper.xml

@@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectIotSporeVo"/>
         <where>
             sporeDelstatus = 0
+            <if test="tid != null and tid != ''"> and tid = #{tid}</if>
             <if test="sporeBid != null  and sporeBid != ''"> and sporeBid = #{sporeBid}</if>
             <if test="cId != null  and cId != ''"> and cId = #{cId}</if>
             <if test="sporeType != null  and sporeType != ''"> and sporeType = #{sporeType}</if>
@@ -64,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="sporeDelstatus != null">sporeDelstatus,</if>
             <if test="sporeInsertType != null">sporeInsertType,</if>
             <if test="sporeType != null">sporeType,</if>
+            tid
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="sporeBid != null and sporeBid != ''">#{sporeBid},</if>
@@ -78,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="sporeDelstatus != null">#{sporeDelstatus},</if>
             <if test="sporeInsertType != null">#{sporeInsertType},</if>
             <if test="sporeType != null">#{sporeType},</if>
+            #{tid}
          </trim>
     </insert>
 
@@ -119,17 +122,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         from IotSpore
         left join FmsCalarm on FmsCalarm.calarmId = IotSpore.sporeId
     </sql>
-
-    <select id="selectIotSporeList1" parameterType="IotSpore" resultType="IotSporeResVo">
-        <include refid="selectIotSporeVo1"/>
-        <where>
-            sporeDelstatus = 0
-            <if test="sporeBid != null  and sporeBid != ''"> and sporeBid = #{sporeBid}</if>
-            <if test="cId != null  and cId != ''"> and cId = #{cId}</if>
-            <if test="sporeType != null  and sporeType != ''"> and sporeType = #{sporeType}</if>
-            <if test="sporeName != null  and sporeName != ''"> and sporeName like concat('%', #{sporeName}, '%')</if>
-            <if test="sporeId != null  and sporeId != ''"> and sporeId = #{sporeId}</if>
-            <if test="sporeRemark != null  and sporeRemark != ''"> and sporeRemark like concat('%', #{sporeRemark}, '%')</if>
-        </where>
-    </select>
 </mapper>