修改 发泡

master
wangh 4 years ago
parent ab282e34b0
commit c7d040b836

@ -5,6 +5,7 @@ import com.ruoyi.system.domain.BoxOutput;
import com.ruoyi.system.domain.OrderInfo;
import com.ruoyi.system.domain.QualityInfo;
import com.ruoyi.system.service.IBroadDataService;
import com.ruoyi.system.service.IBroadDruidService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -54,4 +55,6 @@ public class AllBroadHTMLController {
}
}

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.ruoyi.system.domain.BoxPlanCompletion;
import com.ruoyi.system.domain.OrderInfo;
import com.ruoyi.system.service.IBroadDataService;
import com.ruoyi.system.service.IBroadDruidService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
@ -30,7 +32,8 @@ import java.util.Set;
public class FPBroadController {
@Autowired
IBroadDataService service;
@Autowired
IBroadDruidService iBroadDruidService;
@PostMapping("/selectOrderExecution")
@ -69,30 +72,24 @@ public class FPBroadController {
@PostMapping("/selectDeviceState")
@ApiOperation("设备状态查询")
private String selectDeviceState(){
Set<String> strings = map.keySet();
Map<String,Integer> stateMap = null;
try {
stateMap =new HashMap<>();
Map<String,String> stateMap=new HashMap<>();
for (String key:strings) {
Process p = null;
try {
p = Runtime.getRuntime().exec("/system/bin/ping -c 1 10.10.60.176");
int status = p.waitFor();
System.out.println(status);
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
for (String key:strings) {
ProcessBuilder procBuilder = new ProcessBuilder("ping", map.get(key),"-w","2","-n","1");
Process proc = procBuilder.start();
int exitValue = proc.waitFor();
stateMap.put(key,exitValue);
}
} catch (IOException e) {
System.out.println(e.getMessage());
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
String json=JSONObject.toJSONString(map);
String json=JSONArray.toJSONString(stateMap);
return json;
}
@ -104,4 +101,9 @@ public class FPBroadController {
return JSONArray.toJSONString(service.selectFpStock());
}
@PostMapping("/selectTeamGroups")
@ApiOperation("班组是早晚")
public int selectTeamGroups(){
return iBroadDruidService.selectTeamGroups();
}
}

@ -0,0 +1,135 @@
package com.ruoyi.system.controller;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.BaseFpPlanqty;
import com.ruoyi.system.service.IBaseFpPlanqtyService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 线Controller
*
* @author ruoyi
* @date 2022-07-20
*/
@Controller
@RequestMapping("/system/base_planqty")
public class BaseFpPlanqtyController extends BaseController
{
private String prefix = "system/base_planqty";
@Autowired
private IBaseFpPlanqtyService baseFpPlanqtyService;
@RequiresPermissions("system:base_planqty:view")
@GetMapping()
public String base_planqty()
{
return prefix + "/base_planqty";
}
/**
* 线
*/
@RequiresPermissions("system:base_planqty:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(BaseFpPlanqty baseFpPlanqty)
{
startPage();
List<BaseFpPlanqty> list = baseFpPlanqtyService.selectBaseFpPlanqtyList(baseFpPlanqty);
return getDataTable(list);
}
/**
* 线
*/
@RequiresPermissions("system:base_planqty:export")
@Log(title = "发泡线工位目标", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(BaseFpPlanqty baseFpPlanqty)
{
List<BaseFpPlanqty> list = baseFpPlanqtyService.selectBaseFpPlanqtyList(baseFpPlanqty);
ExcelUtil<BaseFpPlanqty> util = new ExcelUtil<BaseFpPlanqty>(BaseFpPlanqty.class);
return util.exportExcel(list, "发泡线工位目标数据");
}
/**
* 线
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 线
*/
@RequiresPermissions("system:base_planqty:add")
@Log(title = "发泡线工位目标", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(BaseFpPlanqty baseFpPlanqty)
{
List<BaseFpPlanqty> list = baseFpPlanqtyService.selectBaseFpPlanqtyList(null);
Long id=1L;
System.out.println(list);
if (list!=null||!list.isEmpty()){
id=list.get(list.size()-1).getId()+1;
}
baseFpPlanqty.setId(id);
return toAjax(baseFpPlanqtyService.insertBaseFpPlanqty(baseFpPlanqty));
}
/**
* 线
*/
@RequiresPermissions("system:base_planqty:edit")
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
BaseFpPlanqty baseFpPlanqty = baseFpPlanqtyService.selectBaseFpPlanqtyById(id);
mmap.put("baseFpPlanqty", baseFpPlanqty);
return prefix + "/edit";
}
/**
* 线
*/
@RequiresPermissions("system:base_planqty:edit")
@Log(title = "发泡线工位目标", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(BaseFpPlanqty baseFpPlanqty)
{
return toAjax(baseFpPlanqtyService.updateBaseFpPlanqty(baseFpPlanqty));
}
/**
* 线
*/
@RequiresPermissions("system:base_planqty:remove")
@Log(title = "发泡线工位目标", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(baseFpPlanqtyService.deleteBaseFpPlanqtyByIds(ids));
}
}

@ -0,0 +1,51 @@
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 线 base_fp_planqty
*
* @author ruoyi
* @date 2022-07-20
*/
public class BaseFpPlanqty extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 目标数 */
@Excel(name = "目标数")
private Long qty;
/** $column.columnComment */
private Long id;
public void setQty(Long qty)
{
this.qty = qty;
}
public Long getQty()
{
return qty;
}
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("qty", getQty())
.append("id", getId())
.toString();
}
}

@ -0,0 +1,61 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.BaseFpPlanqty;
/**
* 线Mapper
*
* @author ruoyi
* @date 2022-07-20
*/
public interface BaseFpPlanqtyMapper
{
/**
* 线
*
* @param id 线
* @return 线
*/
public BaseFpPlanqty selectBaseFpPlanqtyById(Long id);
/**
* 线
*
* @param baseFpPlanqty 线
* @return 线
*/
public List<BaseFpPlanqty> selectBaseFpPlanqtyList(BaseFpPlanqty baseFpPlanqty);
/**
* 线
*
* @param baseFpPlanqty 线
* @return
*/
public int insertBaseFpPlanqty(BaseFpPlanqty baseFpPlanqty);
/**
* 线
*
* @param baseFpPlanqty 线
* @return
*/
public int updateBaseFpPlanqty(BaseFpPlanqty baseFpPlanqty);
/**
* 线
*
* @param id 线
* @return
*/
public int deleteBaseFpPlanqtyById(Long id);
/**
* 线
*
* @param ids
* @return
*/
public int deleteBaseFpPlanqtyByIds(String[] ids);
}

@ -58,6 +58,8 @@ public interface BroadDataMapper {
void insertXK_H_QTY(@Param("name") String name,@Param("nowOut") int nowOut,@Param("cha") int cha,@Param("zs") int zsQty);
int selectTeamGroups();
///////////////////////////////////////////////////////////////////////////
// 6

@ -0,0 +1,61 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.BaseFpPlanqty;
/**
* 线Service
*
* @author ruoyi
* @date 2022-07-20
*/
public interface IBaseFpPlanqtyService
{
/**
* 线
*
* @param id 线
* @return 线
*/
public BaseFpPlanqty selectBaseFpPlanqtyById(Long id);
/**
* 线
*
* @param baseFpPlanqty 线
* @return 线
*/
public List<BaseFpPlanqty> selectBaseFpPlanqtyList(BaseFpPlanqty baseFpPlanqty);
/**
* 线
*
* @param baseFpPlanqty 线
* @return
*/
public int insertBaseFpPlanqty(BaseFpPlanqty baseFpPlanqty);
/**
* 线
*
* @param baseFpPlanqty 线
* @return
*/
public int updateBaseFpPlanqty(BaseFpPlanqty baseFpPlanqty);
/**
* 线
*
* @param ids 线
* @return
*/
public int deleteBaseFpPlanqtyByIds(String ids);
/**
* 线
*
* @param id 线
* @return
*/
public int deleteBaseFpPlanqtyById(Long id);
}

@ -6,4 +6,5 @@ package com.ruoyi.system.service;
*/
public interface IBroadDruidService {
int selectTeamGroups();
}

@ -0,0 +1,94 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BaseFpPlanqtyMapper;
import com.ruoyi.system.domain.BaseFpPlanqty;
import com.ruoyi.system.service.IBaseFpPlanqtyService;
import com.ruoyi.common.core.text.Convert;
/**
* 线Service
*
* @author ruoyi
* @date 2022-07-20
*/
@Service
public class BaseFpPlanqtyServiceImpl implements IBaseFpPlanqtyService
{
@Autowired
private BaseFpPlanqtyMapper baseFpPlanqtyMapper;
/**
* 线
*
* @param id 线
* @return 线
*/
@Override
public BaseFpPlanqty selectBaseFpPlanqtyById(Long id)
{
return baseFpPlanqtyMapper.selectBaseFpPlanqtyById(id);
}
/**
* 线
*
* @param baseFpPlanqty 线
* @return 线
*/
@Override
public List<BaseFpPlanqty> selectBaseFpPlanqtyList(BaseFpPlanqty baseFpPlanqty)
{
return baseFpPlanqtyMapper.selectBaseFpPlanqtyList(baseFpPlanqty);
}
/**
* 线
*
* @param baseFpPlanqty 线
* @return
*/
@Override
public int insertBaseFpPlanqty(BaseFpPlanqty baseFpPlanqty)
{
return baseFpPlanqtyMapper.insertBaseFpPlanqty(baseFpPlanqty);
}
/**
* 线
*
* @param baseFpPlanqty 线
* @return
*/
@Override
public int updateBaseFpPlanqty(BaseFpPlanqty baseFpPlanqty)
{
return baseFpPlanqtyMapper.updateBaseFpPlanqty(baseFpPlanqty);
}
/**
* 线
*
* @param ids 线
* @return
*/
@Override
public int deleteBaseFpPlanqtyByIds(String ids)
{
return baseFpPlanqtyMapper.deleteBaseFpPlanqtyByIds(Convert.toStrArray(ids));
}
/**
* 线
*
* @param id 线
* @return
*/
@Override
public int deleteBaseFpPlanqtyById(Long id)
{
return baseFpPlanqtyMapper.deleteBaseFpPlanqtyById(id);
}
}

@ -24,4 +24,9 @@ public class BroadDruidServiceImpl implements IBroadDruidService {
int zsQty=mapper.selectNowXkOutPut1();
mapper.insertXK_H_QTY(boxOutput.getName(),nowOut,nowOut-qty,zsQty);
}
@Override
public int selectTeamGroups() {
return mapper.selectTeamGroups();
}
}

@ -0,0 +1,60 @@
<?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.system.mapper.BaseFpPlanqtyMapper">
<resultMap type="BaseFpPlanqty" id="BaseFpPlanqtyResult">
<result property="qty" column="qty" />
<result property="id" column="id" />
</resultMap>
<sql id="selectBaseFpPlanqtyVo">
select qty, id from base_fp_planqty
</sql>
<select id="selectBaseFpPlanqtyList" parameterType="BaseFpPlanqty" resultMap="BaseFpPlanqtyResult">
<include refid="selectBaseFpPlanqtyVo"/>
<where>
</where>
</select>
<select id="selectBaseFpPlanqtyById" parameterType="Long" resultMap="BaseFpPlanqtyResult">
<include refid="selectBaseFpPlanqtyVo"/>
where id = #{id}
</select>
<insert id="insertBaseFpPlanqty" parameterType="BaseFpPlanqty">
<selectKey keyProperty="id" resultType="long" order="BEFORE">
SELECT seq_base_fp_planqty.NEXTVAL as id FROM DUAL
</selectKey>
insert into base_fp_planqty
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="qty != null">qty,</if>
<if test="id != null">id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="qty != null">#{qty},</if>
<if test="id != null">#{id},</if>
</trim>
</insert>
<update id="updateBaseFpPlanqty" parameterType="BaseFpPlanqty">
update base_fp_planqty
<trim prefix="SET" suffixOverrides=",">
<if test="qty != null">qty = #{qty},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBaseFpPlanqtyById" parameterType="Long">
delete from base_fp_planqty where id = #{id}
</delete>
<delete id="deleteBaseFpPlanqtyByIds" parameterType="String">
delete from base_fp_planqty where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -466,4 +466,7 @@
insert into XK_H_QTY(H_NAME, QTY, QTY_C,ZS_C)
values (#{name},#{nowOut},#{cha},#{zs})
</insert>
<select id="selectTeamGroups" resultType="integer">
select case when sysdate &lt; W_END then 0 else 1 end from BASE_DAY_WBTIME where ROWNUM=1 order by CREATE_TIME desc ;
</select>
</mapper>

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增发泡线工位目标')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-base_planqty-add">
<div class="form-group">
<label class="col-sm-3 control-label">目标数:</label>
<div class="col-sm-8">
<input name="qty" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/base_planqty"
$("#form-base_planqty-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-base_planqty-add').serialize());
}
}
</script>
</body>
</html>

@ -0,0 +1,82 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('发泡线工位目标列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:base_planqty:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:base_planqty:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:base_planqty:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:base_planqty:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('system:base_planqty:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:base_planqty:remove')}]];
var prefix = ctx + "system/base_planqty";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "发泡线工位目标",
columns: [{
checkbox: true
},
{
field: 'qty',
title: '目标数'
},
{
field: 'id',
title: '${comment}',
visible: false
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改发泡线工位目标')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-base_planqty-edit" th:object="${baseFpPlanqty}">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">目标数:</label>
<div class="col-sm-8">
<input name="qty" th:field="*{qty}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/base_planqty";
$("#form-base_planqty-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-base_planqty-edit').serialize());
}
}
</script>
</body>
</html>
Loading…
Cancel
Save