Commit 4d844a7d by 向延琳

修改设备响应状态

1 parent fcb0e64a
...@@ -190,4 +190,9 @@ public final class Constants { ...@@ -190,4 +190,9 @@ public final class Constants {
* 厂商ID-博实结 * 厂商ID-博实结
*/ */
public static final String BSJ_FACTORY_ID = "BSJ"; public static final String BSJ_FACTORY_ID = "BSJ";
/**
* 响应状态
*/
public static final int STATUS_RESPONSE = 2;
} }
...@@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/** /**
* @author xiangyanlin * @author xiangyanlin
* @date 2022/9/9 * @date 2022/9/9
...@@ -52,4 +54,11 @@ public class DeviceFreqController implements DeviceFreqClient { ...@@ -52,4 +54,11 @@ public class DeviceFreqController implements DeviceFreqClient {
deviceFreqService.closeDeviceFreqFromDB(); deviceFreqService.closeDeviceFreqFromDB();
return R.ok(); return R.ok();
} }
@PostMapping(value = "/updateResponseStatus")
@Override
public R<Void> updateDeviceFreqResponseStatus(String sn) {
deviceFreqService.updateDeviceFreqResponseStatus(sn);
return R.ok();
}
} }
...@@ -5,6 +5,7 @@ import com.glsx.plat.mybatis.mapper.CommonBaseMapper; ...@@ -5,6 +5,7 @@ import com.glsx.plat.mybatis.mapper.CommonBaseMapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List; import java.util.List;
@Mapper @Mapper
...@@ -22,4 +23,10 @@ public interface DeviceFreqMapper extends CommonBaseMapper<DeviceFreq> { ...@@ -22,4 +23,10 @@ public interface DeviceFreqMapper extends CommonBaseMapper<DeviceFreq> {
* @return 生效的调频记录 * @return 生效的调频记录
*/ */
List<String> listToCloseFreq(); List<String> listToCloseFreq();
/**
* 更新状态
* @param sn 设备号
*/
void updateDeviceFreqResponseStatus(@Param("sn")String sn, @Param("status") Integer status);
} }
\ No newline at end of file \ No newline at end of file
...@@ -185,4 +185,9 @@ public class DeviceFreqService { ...@@ -185,4 +185,9 @@ public class DeviceFreqService {
snList.forEach(sn -> this.resetAdjFreq(new ResetAdjFreqBO(sn, 1L))); snList.forEach(sn -> this.resetAdjFreq(new ResetAdjFreqBO(sn, 1L)));
} }
public void updateDeviceFreqResponseStatus(String sn) {
deviceFreqMapper.updateDeviceFreqResponseStatus(sn, Constants.STATUS_RESPONSE);
}
} }
...@@ -59,4 +59,10 @@ ...@@ -59,4 +59,10 @@
</where> </where>
</select> </select>
<update id="updateDeviceFreqResponseStatus">
update t_device_freq
set response_status = #{status}
where sn = #{sn}
</update>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -39,4 +39,9 @@ public class DeviceFreqServiceTest { ...@@ -39,4 +39,9 @@ public class DeviceFreqServiceTest {
} }
@Test
public void testUpdateDeviceFreqResponseStatus() {
deviceFreqService.updateDeviceFreqResponseStatus("2691212734");
}
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!