<add>[important]添加入库界面查询温度功能
This commit is contained in:
parent
5a3ac10c72
commit
4d499e75fb
|
|
@ -0,0 +1,42 @@
|
|||
package com.ruoyi.web.controller.business;
|
||||
|
||||
import com.ruoyi.business.domain.Temper;
|
||||
import com.ruoyi.business.mapper.TemperMapper;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 温度控制器
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/business/temper")
|
||||
public class TemperController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private TemperMapper temperMapper;
|
||||
|
||||
/**
|
||||
* 获取温度
|
||||
* @return 获取的温度
|
||||
*/
|
||||
@PostMapping("/getTemper")
|
||||
@ResponseBody
|
||||
public AjaxResult getTemper() {
|
||||
Temper queryRules = new Temper();
|
||||
queryRules.setRkId(1);
|
||||
List<Temper> tempers = temperMapper.selectTemperList(queryRules);
|
||||
if(tempers.isEmpty()) {
|
||||
return success("查询失败,请重试") ;
|
||||
}
|
||||
return success(tempers.get(0).getRkDegree());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -5,11 +5,16 @@ spring:
|
|||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
# master:
|
||||
# url: jdbc:mysql://localhost:3306/wms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# username: root
|
||||
## password: ntscc@2018
|
||||
# password: root
|
||||
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/wms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
# password: ntscc@2018
|
||||
password: root
|
||||
url: jdbc:mysql://192.168.234.134:3306/wms_ntpp_n7?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: developer
|
||||
password: developer
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
|
|
|
|||
|
|
@ -34,6 +34,33 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-shadow">
|
||||
<div class="ibox float-e-margins" style="margin-bottom: 10px;">
|
||||
<div class="ibox-title">
|
||||
<h5>当前作业任务</h5>
|
||||
</div>
|
||||
<div class="ibox-content ibox-content-1" style="margin: 0;height: 80px">
|
||||
<form style="margin-left: 10px">
|
||||
<div class=" form-horizontal">
|
||||
<label class="control-label">当前温度:</label>
|
||||
<label class="control-label" style="font-weight: bold" id="temperNow"></label>
|
||||
<button type="button" class="btn btn-primary btn-xs" id="getTemper" style="margin-left: 30px" onclick="getTemperNow()">获取温度</button>
|
||||
<label class="control-label" style="margin-left: 50px">任务状态:</label>
|
||||
<label class="control-label" style="font-weight: bold" id="inStatus">无</label>
|
||||
</div>
|
||||
<div class=" form-horizontal">
|
||||
<label for="providerInSelect" class="control-label">当前入库供应商:</label>
|
||||
<select class="select-list" style="font-weight: bold; width: 300px" id="providerInSelect">
|
||||
<option value="0">请选择供应商后点击开始入库</option>
|
||||
</select>
|
||||
<button type="button" class="btn btn-primary btn-xs" id="getProviderIn" style="margin-left: 30px" onclick="getTemperNow()">获取供应商列表</button>
|
||||
<button type="button" class="btn btn-warning btn-xs" id="startIn" style="margin-left: 5px" onclick="getTemperNow()">开始入库</button>
|
||||
<button type="button" class="btn btn-danger btn-xs" id="stopIn" style="margin-left: 5px" onclick="getTemperNow()">停止入库</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 10px;" class="box-shadow">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
|
|
@ -385,6 +412,20 @@
|
|||
$.table.init(options);
|
||||
});
|
||||
|
||||
// 点击按钮获取温度
|
||||
function getTemperNow() {
|
||||
$.post({
|
||||
url: ctx + "business/temper/getTemper",
|
||||
success: function (data) {
|
||||
console.log(data)
|
||||
$("#temperNow").text(data.data + " ℃");
|
||||
},
|
||||
error: function (data) {
|
||||
$("#temperNow").text(data.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// ERP入库
|
||||
function scanFunctionProviderIn() {
|
||||
let keycode = event.keyCode;
|
||||
|
|
|
|||
|
|
@ -5,11 +5,16 @@ spring:
|
|||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
# master:
|
||||
# url: jdbc:mysql://localhost:3306/wms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# username: root
|
||||
## password: ntscc@2018
|
||||
# password: root
|
||||
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/wms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
# password: ntscc@2018
|
||||
password: root
|
||||
url: jdbc:mysql://192.168.234.134:3306/wms_ntpp_n7?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: developer
|
||||
password: developer
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
|
|
|
|||
|
|
@ -34,6 +34,33 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-shadow">
|
||||
<div class="ibox float-e-margins" style="margin-bottom: 10px;">
|
||||
<div class="ibox-title">
|
||||
<h5>当前作业任务</h5>
|
||||
</div>
|
||||
<div class="ibox-content ibox-content-1" style="margin: 0;height: 80px">
|
||||
<form style="margin-left: 10px">
|
||||
<div class=" form-horizontal">
|
||||
<label class="control-label">当前温度:</label>
|
||||
<label class="control-label" style="font-weight: bold" id="temperNow"></label>
|
||||
<button type="button" class="btn btn-primary btn-xs" id="getTemper" style="margin-left: 30px" onclick="getTemperNow()">获取温度</button>
|
||||
<label class="control-label" style="margin-left: 50px">任务状态:</label>
|
||||
<label class="control-label" style="font-weight: bold" id="inStatus">无</label>
|
||||
</div>
|
||||
<div class=" form-horizontal">
|
||||
<label for="providerInSelect" class="control-label">当前入库供应商:</label>
|
||||
<select class="select-list" style="font-weight: bold; width: 300px" id="providerInSelect">
|
||||
<option value="0">请选择供应商后点击开始入库</option>
|
||||
</select>
|
||||
<button type="button" class="btn btn-primary btn-xs" id="getProviderIn" style="margin-left: 30px" onclick="getTemperNow()">获取供应商列表</button>
|
||||
<button type="button" class="btn btn-warning btn-xs" id="startIn" style="margin-left: 5px" onclick="getTemperNow()">开始入库</button>
|
||||
<button type="button" class="btn btn-danger btn-xs" id="stopIn" style="margin-left: 5px" onclick="getTemperNow()">停止入库</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 10px;" class="box-shadow">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
|
|
@ -385,6 +412,20 @@
|
|||
$.table.init(options);
|
||||
});
|
||||
|
||||
// 点击按钮获取温度
|
||||
function getTemperNow() {
|
||||
$.post({
|
||||
url: ctx + "business/temper/getTemper",
|
||||
success: function (data) {
|
||||
console.log(data)
|
||||
$("#temperNow").text(data.data + " ℃");
|
||||
},
|
||||
error: function (data) {
|
||||
$("#temperNow").text(data.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// ERP入库
|
||||
function scanFunctionProviderIn() {
|
||||
let keycode = event.keyCode;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,50 @@
|
|||
package com.ruoyi.business.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* T_base_temper 表
|
||||
*/
|
||||
public class Temper {
|
||||
|
||||
/**
|
||||
* 仓库温度
|
||||
*/
|
||||
private BigDecimal rkDegree;
|
||||
|
||||
/**
|
||||
* 仓库id
|
||||
*/
|
||||
private Integer rkId;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
public BigDecimal getRkDegree() {
|
||||
return rkDegree;
|
||||
}
|
||||
|
||||
public void setRkDegree(BigDecimal rkDegree) {
|
||||
this.rkDegree = rkDegree;
|
||||
}
|
||||
|
||||
public Integer getRkId() {
|
||||
return rkId;
|
||||
}
|
||||
|
||||
public void setRkId(Integer rkId) {
|
||||
this.rkId = rkId;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.ruoyi.business.mapper;
|
||||
|
||||
import com.ruoyi.business.domain.Temper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface TemperMapper {
|
||||
|
||||
/**
|
||||
* 查询温度列表
|
||||
* @param temper 查询条件
|
||||
* @return 查询结果
|
||||
*/
|
||||
List<Temper> selectTemperList(Temper temper);
|
||||
|
||||
}
|
||||
26
wms-business/src/main/resources/mapper/TemperMapper.xml
Normal file
26
wms-business/src/main/resources/mapper/TemperMapper.xml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?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.ruoyi.business.mapper.TemperMapper">
|
||||
|
||||
|
||||
<resultMap type="Temper" id="TemperMap">
|
||||
<result property="rkId" column="rkId"/>
|
||||
<result property="rkDegree" column="rkDegree"/>
|
||||
<result property="updateTime" column="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectTemperList" parameterType="Temper" resultMap="TemperMap">
|
||||
select rkId,rkDegree,updateTime from t_base_temper
|
||||
<where>
|
||||
<if test="rkId != null "> and rkId = #{rkId}</if>
|
||||
<if test="rkDegree != null "> and rkDegree = #{rkDegree}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
26
wms-business/target/classes/mapper/TemperMapper.xml
Normal file
26
wms-business/target/classes/mapper/TemperMapper.xml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?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.ruoyi.business.mapper.TemperMapper">
|
||||
|
||||
|
||||
<resultMap type="Temper" id="TemperMap">
|
||||
<result property="rkId" column="rkId"/>
|
||||
<result property="rkDegree" column="rkDegree"/>
|
||||
<result property="updateTime" column="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectTemperList" parameterType="Temper" resultMap="TemperMap">
|
||||
select rkId,rkDegree,updateTime from t_base_temper
|
||||
<where>
|
||||
<if test="rkId != null "> and rkId = #{rkId}</if>
|
||||
<if test="rkDegree != null "> and rkDegree = #{rkDegree}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user