开发生产订单功能

pull/1/head
wangziyangyang 2020-07-01 17:40:33 +08:00
parent 54bcb21e0a
commit b0c8945898
9 changed files with 660 additions and 3 deletions

View File

@ -40,11 +40,11 @@ public class CodeGenerator {
// 数据源配置 // 数据源配置
DataSourceConfig dsc = new DataSourceConfig(); DataSourceConfig dsc = new DataSourceConfig();
dsc.setUrl("jdbc:mysql://192.168.52.76:3306/sparchetype?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong&allowPublicKeyRetrieval=true"); dsc.setUrl("jdbc:mysql://rm-8vb0sazu4d9g0u290eo.mysql.zhangbei.rds.aliyuncs.com:3306/sparchetype?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong&allowPublicKeyRetrieval=true");
// dsc.setSchemaName("public"); // dsc.setSchemaName("public");
dsc.setDriverName("com.mysql.cj.jdbc.Driver"); dsc.setDriverName("com.mysql.cj.jdbc.Driver");
dsc.setUsername("admin"); dsc.setUsername("admin_123");
dsc.setPassword("123456"); dsc.setPassword("Wangzi!!!111");
mpg.setDataSource(dsc); mpg.setDataSource(dsc);
// 包配置 // 包配置

View File

@ -0,0 +1,21 @@
package com.wangziyang.mes.order.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import com.wangziyang.mes.common.BaseController;
/**
* <p>
*
* </p>
*
* @author WangZiYang
* @since 2020-07-01
*/
@Controller
@RequestMapping("/order/sp-order")
public class SpOrderController extends BaseController {
}

View File

@ -0,0 +1,153 @@
package com.wangziyang.mes.order.entity;
import com.wangziyang.mes.common.BaseEntity;
/**
* <p>
*
* </p>
*
* @author WangZiYang
* @since 2020-07-01
*/
public class SpOrder extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private String orderCode;
/**
*
*/
private String orderDescription;
/**
*
*/
private Integer qty;
/**
* P A F
*/
private String orderType;
/**
* ID
*/
private String flowId;
/**
*
*/
private String materiel;
/**
*
*/
private String materielDesc;
/**
*
*/
private String planStartTime;
/**
*
*/
private String planEndTime;
/**
* 1, 2 34
*/
private Integer statue;
public String getOrderCode() {
return orderCode;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderDescription() {
return orderDescription;
}
public void setOrderDescription(String orderDescription) {
this.orderDescription = orderDescription;
}
public Integer getQty() {
return qty;
}
public void setQty(Integer qty) {
this.qty = qty;
}
public String getOrderType() {
return orderType;
}
public void setOrderType(String orderType) {
this.orderType = orderType;
}
public String getFlowId() {
return flowId;
}
public void setFlowId(String flowId) {
this.flowId = flowId;
}
public String getMateriel() {
return materiel;
}
public void setMateriel(String materiel) {
this.materiel = materiel;
}
public String getMaterielDesc() {
return materielDesc;
}
public void setMaterielDesc(String materielDesc) {
this.materielDesc = materielDesc;
}
public String getPlanStartTime() {
return planStartTime;
}
public void setPlanStartTime(String planStartTime) {
this.planStartTime = planStartTime;
}
public String getPlanEndTime() {
return planEndTime;
}
public void setPlanEndTime(String planEndTime) {
this.planEndTime = planEndTime;
}
public Integer getStatue() {
return statue;
}
public void setStatue(Integer statue) {
this.statue = statue;
}
@Override
public String toString() {
return "SpOrder{" +
"orderCode=" + orderCode +
", orderDescription=" + orderDescription +
", qty=" + qty +
", orderType=" + orderType +
", flowId=" + flowId +
", materiel=" + materiel +
", materielDesc=" + materielDesc +
", planStartTime=" + planStartTime +
", planEndTime=" + planEndTime +
", statue=" + statue +
"}";
}
}

View File

@ -0,0 +1,16 @@
package com.wangziyang.mes.order.mapper;
import com.wangziyang.mes.order.entity.SpOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper
* </p>
*
* @author WangZiYang
* @since 2020-07-01
*/
public interface SpOrderMapper extends BaseMapper<SpOrder> {
}

View File

@ -0,0 +1,16 @@
package com.wangziyang.mes.order.service;
import com.wangziyang.mes.order.entity.SpOrder;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
*
* </p>
*
* @author WangZiYang
* @since 2020-07-01
*/
public interface ISpOrderService extends IService<SpOrder> {
}

View File

@ -0,0 +1,20 @@
package com.wangziyang.mes.order.service.impl;
import com.wangziyang.mes.order.entity.SpOrder;
import com.wangziyang.mes.order.mapper.SpOrderMapper;
import com.wangziyang.mes.order.service.ISpOrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
*
* </p>
*
* @author WangZiYang
* @since 2020-07-01
*/
@Service
public class SpOrderServiceImpl extends ServiceImpl<SpOrderMapper, SpOrder> implements ISpOrderService {
}

View File

@ -0,0 +1,5 @@
<?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.wangziyang.mes.order.mapper.SpOrderMapper">
</mapper>

View File

@ -0,0 +1,226 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>添加用户</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<#include "${request.contextPath}/common/common.ftl">
<link href="${request.contextPath}/css/effect.css" rel="stylesheet" type="text/css"/>
<style>
.flowProcss {
font-size: 25px;
margin-left: 310PX;
display: flex;
justify-content: flex-start;
flex-direction: row;
}
</style>
</head>
<body>
<div class="splayui-container">
<div class="splayui-main">
<form class="layui-form splayui-form" lay-filter="formTest">
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md10">
<div class="layui-form-item">
<label for="js-materiel" class="layui-form-label sp-required">物料编号
</label>
<div class="layui-input-inline">
<input type="text" id="js-materiel" name="materiel" lay-verify="required" autocomplete="off"
class="layui-input" value="${result.materiel}">
</div>
</div>
<div class="layui-form-item">
<label for="js-materielDesc" class="layui-form-label sp-required">物料描述
</label>
<div class="layui-input-inline">
<input type="text" id="js-materielDesc" name="materielDesc" lay-verify="required"
autocomplete="off" class="layui-input" value="${result.materielDesc}">
</div>
</div>
<div class="layui-form-item">
<label for="js-unit" class="layui-form-label sp-required">单位
</label>
<div class="layui-input-inline">
<input type="text" id="js-unit" name="unit" lay-verify="required" autocomplete="off"
class="layui-input" value="${result.unit}">
</div>
</div>
<div class="layui-form-item">
<label for="js-productGroup" class="layui-form-label sp-required">产品组
</label>
<div class="layui-input-inline">
<input type="text" id="js-productGroup" name="productGroup" lay-verify="required"
autocomplete="off"
class="layui-input" value="${result.productGroup}">
</div>
</div>
<div class="layui-form-item">
<label for="js-model" class="layui-form-label sp-required">规格型号
</label>
<div class="layui-input-inline">
<input type="text" id="js-model" name="model" lay-verify="required"
autocomplete="off"
class="layui-input" value="${result.model}">
</div>
</div>
<div class="layui-form-item">
<label for="js-matType" class="layui-form-label sp-required">物料类型
</label>
<div class="layui-input-inline">
<select id="js-matType" name="matType" lay-filter="matType-filter" lay-verify="required">
</select>
</div>
</div>
<div class="layui-form-item">
<label for="js-size" class="layui-form-label ">尺寸
</label>
<div class="layui-input-inline">
<input type="text" id="js-size" name="size" autocomplete="off"
class="layui-input" value="${result.size}">
</div>
</div>
<div class="layui-form-item">
<label for="js-flowId" class="layui-form-label ">工艺流程
</label>
<div class="layui-input-inline">
<select id="js-flowId" name="flowId" lay-filter="flow-filter">
</select>
</div>
<div class=" text-effect flowProcss " id="js-flowProcess" name="flowProcss">
</div>
</div>
<div class="layui-form-item">
<label for="js-is-deleted" class="layui-form-label sp-required">状态
</label>
<div class="layui-input-block" id="js-is-deleted" style="width: 310px;">
<input type="radio" name="deleted" value="0" title="正常"
<#if result.deleted == "0" || !(result??)>checked</#if>>
<input type="radio" name="deleted" value="1" title="已删除"
<#if result.deleted == "1">checked</#if>>
<input type="radio" name="deleted" value="2" title="已禁用"
<#if result.deleted == "2">checked</#if>>
</div>
</div>
</div>
<div class="layui-form-item layui-hide">
<div class="layui-input-block">
<input id="js-id" name="id" value="${result.id}"/>
<button id="js-submit" class="layui-btn" lay-submit lay-filter="js-submit-filter">确定
</button>
</div>
</div>
</div>
</form>
</div>
</div>
<script>
layui.use(['form', 'util'], function () {
var form = layui.form,
util = layui.util;
var flowRows = [];
//流程添加下拉框
getFlowData();
//物料类型
getMatTypeData();
/**
* 初始化物料类型数据
*/
function getMatTypeData() {
spUtil.ajax({
url: '${request.contextPath}/basedata/dict/list/material_type',
async: false,
type: 'GET',
// 是否显示 loading
// showLoading: true,
// 是否序列化参数
serializable: false,
// 参数
data: {},
success: function (data) {
$.each(data.data, function (index, item) {
$('#js-matType').append(new Option(item.name, item.value));
});
}
});
}
/**
* 初始化流程数据
*/
function getFlowData() {
spUtil.ajax({
url: '${request.contextPath}/basedata/flow/list',
async: false,
type: 'GET',
// 是否显示 loading
showLoading: true,
// 是否序列化参数
serializable: false,
// 参数
data: {},
success: function (data) {
flowRows = data.data;
}
});
$.each(flowRows, function (index, item) {
$('#js-flowId').append(new Option(item.flowDesc, item.id));
});
//编辑时候根据回显的ID 绘制流程
flowProssbyId("${result.flowId}")
}
//下拉框选择 绘制流程时序图
form.on('select(flow-filter)', function (data) {
flowProssbyId(data.value)
});
//通过ID 获取流程时序 绘制
function flowProssbyId(flowId) {
var newArr = flowRows.filter(function (obj) {
return obj.id == flowId;
});
if (newArr.length > 0) {
procssArr = newArr[0].process.split("->")
$("#js-flowProcess").empty();
$.each(procssArr, function (i, val) {
if (i == procssArr.length - 1) {
$("#js-flowProcess").append("<span style='display: inline-flex;' >" + val + "</span>");
} else {
$("#js-flowProcess").append("<span style='display: inline-flex;' >" + val + '->' + "</span>");
}
});
}
}
//给表单赋值
form.val("formTest", { //formTest 即 class="layui-form" 所在元素属性 lay-filter="" 对应的值
"flowId": "${result.flowId}",
"matType": "${result.matType}"
});
//监听提交
form.on('submit(js-submit-filter)', function (data) {
spUtil.submitForm({
url: "${request.contextPath}/basedata/materile/add-or-update",
data: data.field
});
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,200 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>系统角色列表</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<#include "${request.contextPath}/common/common.ftl">
</head>
<body>
<div class="splayui-container">
<div class="splayui-main">
<!--查询参数-->
<form id="js-search-form" class="layui-form" lay-filter="js-q-form-filter">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">物料编号</label>
<div class="layui-input-inline">
<input type="materiel" name="materiel" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">物料名称</label>
<div class="layui-input-inline">
<input type="materielDesc" name="materielDesc" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<a class="layui-btn" lay-submit lay-filter="js-search-filter"><i
class="layui-icon layui-icon-search layuiadmin-button-btn"></i></a>
</div>
</div>
</form>
<!--表格-->
<table class="layui-hide" id="js-record-table" lay-filter="js-record-table-filter"></table>
</div>
</div>
<!--表格头操作模板-->
<script type="text/html" id="js-record-table-toolbar-top">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-danger layui-btn-sm" lay-event="deleteBatch"><i
class="layui-icon">&#xe640;</i>批量删除
</button>
<@shiro.hasPermission name="user:add">
<button class="layui-btn layui-btn-sm" lay-event="add"><i class="layui-icon">&#xe61f;</i>添加</button>
</@shiro.hasPermission>
</div>
</script>
<!--行操作模板-->
<script type="text/html" id="js-record-table-toolbar-right">
<a class="layui-btn layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete"><i class="layui-icon layui-icon-delete"></i>删除</a>
</script>
<!--js逻辑-->
<script>
layui.use(['form', 'table', 'spLayer', 'spTable'], function () {
var form = layui.form,
table = layui.table,
spLayer = layui.spLayer,
spTable = layui.spTable;
// 表格及数据初始化
var tableIns = spTable.render({
url: '${request.contextPath}/basedata/materile/page',
cols: [
[{
type: 'checkbox'
}, {
field: 'materiel', title: '物料编码'
}, {
field: 'materielDesc', title: '物料描述'
}, {
field: 'productGroup', title: '产品组'
}, {
field: 'size', title: '尺寸'
}, {
field: 'flowDesc', title: '流程描述'
}, {
field: 'model', title: '型号'
}, {
field: 'deleted', title: '状态', templet: function (d) {
return spConfig.isDeletedDict[d.deleted];
}
}, {
fixed: 'right',
field: 'operate',
title: '操作',
toolbar: '#js-record-table-toolbar-right',
unresize: true,
width: 150
}]
],
done: function (res, curr, count) {
}
});
/*
* 数据表格中form表单元素是动态插入,所以需要更新渲染下
* http://www.layui.com/doc/modules/form.html#render
*/
$(function () {
form.render();
});
/**
* 搜索按钮事件
*/
form.on('submit(js-search-filter)', function (data) {
tableIns.reload({
where: data.field,
page: {
// 重新从第 1 页开始
curr: 1
}
});
// 阻止表单跳转。如果需要表单跳转,去掉这段即可。
return false;
});
/**
* 头工具栏事件
*/
table.on('toolbar(js-record-table-filter)', function (obj) {
var checkStatus = table.checkStatus(obj.config.id);
// 批量删除
if (obj.event === 'deleteBatch') {
var checkStatus = table.checkStatus('record-table'),
data = checkStatus.data;
if (data.length > 0) {
layer.confirm('确认要删除吗?', function (index) {
});
} else {
layer.msg("请先选择需要删除的数据!");
}
}
// 添加
if (obj.event === 'add') {
var index = spLayer.open({
title: '添加',
area: ['90%', '90%'],
content: '${request.contextPath}/basedata/materile/add-or-update-ui'
});
}
});
/**
* 监听行工具事件
*/
table.on('tool(js-record-table-filter)', function (obj) {
var data = obj.data;
// 编辑
if (obj.event === 'edit') {
spLayer.open({
title: '编辑',
area: ['90%', '90%'],
// 请求url参数
spWhere: {id: data.id},
content: '${request.contextPath}/basedata/materile/add-or-update-ui'
});
}
// 删除
if (obj.event === 'delete') {
layer.confirm('确认要删除吗?', function (index) {
spUtil.ajax({
url: '${request.contextPath}/basedata/materile/delete',
async: false,
type: 'POST',
// 是否显示 loading
showLoading: true,
// 是否序列化参数
serializable: false,
// 参数
data: {
id: data.id
},
success: function (data) {
tableIns.reload();
layer.close(index);
},
error: function () {
}
});
});
}
});
});
</script>
</body>
</html>