diff --git a/wms-admin/src/main/java/com/ruoyi/web/controller/business/TemperController.java b/wms-admin/src/main/java/com/ruoyi/web/controller/business/TemperController.java new file mode 100644 index 0000000..c829e0f --- /dev/null +++ b/wms-admin/src/main/java/com/ruoyi/web/controller/business/TemperController.java @@ -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 tempers = temperMapper.selectTemperList(queryRules); + if(tempers.isEmpty()) { + return success("查询失败,请重试") ; + } + return success(tempers.get(0).getRkDegree()); + } + +} diff --git a/wms-admin/src/main/resources/application-druid.yml b/wms-admin/src/main/resources/application-druid.yml index 8533250..005eb15 100644 --- a/wms-admin/src/main/resources/application-druid.yml +++ b/wms-admin/src/main/resources/application-druid.yml @@ -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: # 从数据源开关/默认关闭 diff --git a/wms-admin/src/main/resources/templates/business/ongoodsshelf/ongoodsshelf.html b/wms-admin/src/main/resources/templates/business/ongoodsshelf/ongoodsshelf.html index c18a6aa..cfd1a74 100644 --- a/wms-admin/src/main/resources/templates/business/ongoodsshelf/ongoodsshelf.html +++ b/wms-admin/src/main/resources/templates/business/ongoodsshelf/ongoodsshelf.html @@ -34,6 +34,33 @@ +
+
+
+
当前作业任务
+
+
+
+
+ + + + + +
+
+ + + + + +
+
+
+
+
@@ -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; diff --git a/wms-admin/target/classes/application-druid.yml b/wms-admin/target/classes/application-druid.yml index 8533250..005eb15 100644 --- a/wms-admin/target/classes/application-druid.yml +++ b/wms-admin/target/classes/application-druid.yml @@ -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: # 从数据源开关/默认关闭 diff --git a/wms-admin/target/classes/templates/business/ongoodsshelf/ongoodsshelf.html b/wms-admin/target/classes/templates/business/ongoodsshelf/ongoodsshelf.html index c18a6aa..cfd1a74 100644 --- a/wms-admin/target/classes/templates/business/ongoodsshelf/ongoodsshelf.html +++ b/wms-admin/target/classes/templates/business/ongoodsshelf/ongoodsshelf.html @@ -34,6 +34,33 @@
+
+
+
+
当前作业任务
+
+
+
+
+ + + + + +
+
+ + + + + +
+
+
+
+
@@ -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; diff --git a/wms-business/src/main/java/com/ruoyi/business/domain/Temper.java b/wms-business/src/main/java/com/ruoyi/business/domain/Temper.java new file mode 100644 index 0000000..57f93b1 --- /dev/null +++ b/wms-business/src/main/java/com/ruoyi/business/domain/Temper.java @@ -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; + } +} diff --git a/wms-business/src/main/java/com/ruoyi/business/mapper/TemperMapper.java b/wms-business/src/main/java/com/ruoyi/business/mapper/TemperMapper.java new file mode 100644 index 0000000..d014973 --- /dev/null +++ b/wms-business/src/main/java/com/ruoyi/business/mapper/TemperMapper.java @@ -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 selectTemperList(Temper temper); + +} diff --git a/wms-business/src/main/resources/mapper/TemperMapper.xml b/wms-business/src/main/resources/mapper/TemperMapper.xml new file mode 100644 index 0000000..767476f --- /dev/null +++ b/wms-business/src/main/resources/mapper/TemperMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wms-business/target/classes/mapper/TemperMapper.xml b/wms-business/target/classes/mapper/TemperMapper.xml new file mode 100644 index 0000000..767476f --- /dev/null +++ b/wms-business/target/classes/mapper/TemperMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file