增加 无动力设备展示接口

master
wanghao 1 month ago
parent 7ee0edb3f7
commit 307d735aaa

@ -6,16 +6,17 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://119.45.202.115:3306/bg_wheel_chocks?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# url: jdbc:mysql://119.45.202.115:3306/bg_wheel_chocks?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://1.13.177.47:3306/bg_wheel_chocks?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: haiwei@123
password: Haiwei123456
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
enabled: true
url: jdbc:mysql://119.45.202.115:3306/no_power_control?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: haiwei@123
# 初始连接数
initialSize: 5
# 最小连接池数量

@ -64,9 +64,9 @@ spring:
servlet:
multipart:
# 单个文件大小
max-file-size: 20MB
max-file-size: 50MB
# 设置总上传的文件大小
max-request-size: 30MB
max-request-size: 50MB
# 服务模块
devtools:
restart:

@ -1,6 +1,7 @@
package com.ruoyi.api.controller;
import com.ruoyi.api.domain.BroadCountNumber;
import com.ruoyi.api.domain.NoPowerDevice;
import com.ruoyi.api.service.impl.BroadApiService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.manage.domain.BaseStore;
@ -46,5 +47,13 @@ public class BroadApiController {
}
@PostMapping("/getDevice")
@ResponseBody
public AjaxResult getDevice(String storeName){
List<NoPowerDevice> list=service.getDevice(storeName);
return AjaxResult.success(list);
}
}

@ -0,0 +1,78 @@
package com.ruoyi.api.domain;
import com.ruoyi.common.annotation.Excel;
public class NoPowerDevice {
/** 摆放桩位 */
@Excel(name = "摆放桩位")
private String locationName;
/** 设备编码 */
@Excel(name = "设备编码")
private String deviceCode;
/** 设备名称 */
@Excel(name = "设备名称")
private String deviceName;
/** 设备类型 */
@Excel(name = "设备类型")
private Long deviceType;
/** 使用状态 */
@Excel(name = "使用状态 0=空闲 1=使用中")
private String useState;
/** 设备状态 */
@Excel(name = "设备状态 0=停用 1=正常 2=维修中")
private String deviceState;
public String getLocationName() {
return locationName;
}
public void setLocationName(String locationName) {
this.locationName = locationName;
}
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public Long getDeviceType() {
return deviceType;
}
public void setDeviceType(Long deviceType) {
this.deviceType = deviceType;
}
public String getUseState() {
return useState;
}
public void setUseState(String useState) {
this.useState = useState;
}
public String getDeviceState() {
return deviceState;
}
public void setDeviceState(String deviceState) {
this.deviceState = deviceState;
}
}

@ -1,6 +1,7 @@
package com.ruoyi.api.mapper;
import com.ruoyi.api.domain.BroadCountNumber;
import com.ruoyi.api.domain.NoPowerDevice;
import com.ruoyi.manage.domain.BaseStore;
import com.ruoyi.manage.domain.LedgerRfid;
import org.springframework.stereotype.Repository;
@ -20,4 +21,6 @@ public interface BroadApiMapper {
List<BroadCountNumber> getCountNumberById(int id);
List<LedgerRfid> getLedgerByCode(String locationCode);
List<NoPowerDevice> getDevice(String storeName);
}

@ -1,7 +1,10 @@
package com.ruoyi.api.service.impl;
import com.ruoyi.api.domain.BroadCountNumber;
import com.ruoyi.api.domain.NoPowerDevice;
import com.ruoyi.api.mapper.BroadApiMapper;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.manage.domain.BaseStore;
import com.ruoyi.manage.domain.LedgerRfid;
import org.springframework.beans.factory.annotation.Autowired;
@ -15,9 +18,8 @@ import java.util.List;
*/
@Service
public class BroadApiService {
@Autowired
private BroadApiMapper mapper;
@Autowired
private BroadApiMapper mapper;
public List<BaseStore> getArea() {
@ -31,4 +33,9 @@ private BroadApiMapper mapper;
public List<LedgerRfid> getLedgerByCode(String locationCode) {
return mapper.getLedgerByCode(locationCode);
}
@DataSource(value = DataSourceType.SLAVE)
public List<NoPowerDevice> getDevice(String storeName) {
return mapper.getDevice(storeName);
}
}

@ -29,6 +29,20 @@
where is_scrap = 1
and location_code = #{locationCode}
</select>
<resultMap id="DeviceResult" type="com.ruoyi.api.domain.NoPowerDevice">
<result property="deviceCode" column="device_code" />
<result property="deviceName" column="device_name" />
<result property="deviceType" column="device_type" />
<result property="useState" column="use_state" />
<result property="deviceState" column="device_state" />
<result property="locationName" column="location_name" />
</resultMap>
<select id="getDevice" resultMap="DeviceResult">
select device_code, device_name, use_state, device_state, location_name from device_base_info where location_name=#{storeName}
</select>
</mapper>

@ -32,7 +32,7 @@ public class MimeTypeUtils
// word excel powerpoint
"doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt",
// 压缩文件
"rar", "zip", "gz", "bz2",
"rar", "zip", "gz", "bz2", "7z",
// 视频格式
"mp4", "avi", "rmvb",
// pdf

Loading…
Cancel
Save