Commit e557d981 authored by liuyuanjun's avatar liuyuanjun

Merge branch 'develop' of ssh://103.249.252.28:10022/wangxiahui/zhny into develop

parents 16742453 53eb12c6
......@@ -34,7 +34,7 @@ import java.util.List;
* */
@RequestMapping("buildtp")
public class BuildTpController extends PaginationController<BuildTp> {
@Autowired
private BuildTpService buildTpServiceImpl;
......
......@@ -44,6 +44,7 @@ import java.util.List;
@RequestMapping("busdevice")
public class BusDeviceController extends PaginationController<BusDevice> {
@Autowired
private BusDeviceService busDeviceServiceImpl;
......
......@@ -27,7 +27,7 @@ public interface BusDeviceRepository extends BaseMapper<BusDevice> {
"<if test='devTpId != null'> and a.dev_tp_id = #{devTpId}</if>" +
"<if test='devNum != null'> and a.dev_num = #{devNum}</if>" +
"<if test='qrcodeUrl != null'> and a.qrcode_url is not null</if>"
+ "</script>")
+ " order by a.create_time asc</script>")
List<Map<String,Object>> queryBusDevices(BusDevice busDevice);
/*
......
......@@ -54,5 +54,7 @@ public class BusDevice implements Serializable{
*/
private String qrcodeUrl;
private Date createTime;
}
......@@ -80,6 +80,7 @@ public class BusDeviceServiceImpl implements BusDeviceService {
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public PersistModel save(BusDevice busDevice){
busDevice.setCreateTime(new Date());
int line = 1;
String message = "";
//增加操作
......
......@@ -24,9 +24,9 @@ public interface DeviceParamRepository {
*/
@Select("<script>select d.PARAM,p.PARAM_NM,p.P_SOURCE,p.P_MIN,p.P_MAX,p.SYMBOL,p.FLAG,p.PARAM_UNIT,d.PARAM_CODE " +
"from bus_device_param d,bus_devicetp_param p " +
"where d.PARAM_CODE=p.PARAM_CODE and d.DEV_NUM=#{devNum} order by p.PARAM_NM</script>")
"where d.PARAM_CODE=p.PARAM_CODE and d.DEV_NUM=#{devNum} and p.PRO_ID=#{proId} order by p.PARAM_NM</script>")
@ResultMap("BaseResultMap")
List<DeviceParam> selectDeviceParamList(@Param("devNum") String devNum);
List<DeviceParam> selectDeviceParamList(@Param("devNum") String devNum, @Param("proId") String proId);
@Select("<script>select OTHER_PARAM from bus_param_refer where PRO_ID=#{proId} and OWN_PARAM='sensor'</script>")
@ResultType(String.class)
......
......@@ -148,7 +148,6 @@ public class SystemServiceImpl implements SystemService {
@Override
public Map<String, Object> selectDeviceParamList(String devNum) {
List<DeviceParam> list = deviceParamRepository.selectDeviceParamList(devNum);
// 表具的键
String devCode = "";
// 电量的键
......@@ -162,6 +161,7 @@ public class SystemServiceImpl implements SystemService {
devParam = deviceMap.get("devParam");
proId = deviceMap.get("proId");
}
List<DeviceParam> list = deviceParamRepository.selectDeviceParamList(devNum, proId);
// 如果不为空,需要将devCode截取一下
if (StringUtils.isNotEmpty(devCode) && StringUtils.isNotEmpty(devParam) && StringUtils.isNotEmpty(proId))
devCode = devCode.split(proId + "_")[1];
......@@ -253,7 +253,7 @@ public class SystemServiceImpl implements SystemService {
// 判断两个比较电量大小
if (newElec != null && oldElec != null) {
// 如果两数相减小于0.003,认为是关闭,大于等于认为是开启
if (newElec.subtract(oldElec).compareTo(new BigDecimal(0.003)) < 0)
if (newElec.subtract(oldElec).compareTo(new BigDecimal(0.001)) < 0)
paramStatus.setStatus(0);
else
paramStatus.setStatus(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment