开发流程与工序关系功能呢。新增工序、流程实体
parent
9b538d6ca6
commit
0027d0eeee
|
@ -0,0 +1,49 @@
|
|||
package com.wangziyang.mes.basedata.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.wangziyang.mes.basedata.request.SpFlowReq;
|
||||
import com.wangziyang.mes.basedata.service.ISpFlowService;
|
||||
import com.wangziyang.mes.common.BaseController;
|
||||
import com.wangziyang.mes.common.Result;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程控制器
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-14
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/basedata/flow")
|
||||
public class SpFlowController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
public ISpFlowService iSpFlowService;
|
||||
|
||||
/**
|
||||
* 流程信息分页查询
|
||||
*
|
||||
* @param req 请求参数
|
||||
* @return Result 执行结果
|
||||
*/
|
||||
@ApiOperation("主数据表头分页查询")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "req", value = "请求参数", defaultValue = "请求参数")})
|
||||
@PostMapping("/page")
|
||||
@ResponseBody
|
||||
public Result page(SpFlowReq req) {
|
||||
IPage result = iSpFlowService.page(req);
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
package com.wangziyang.mes.basedata.controller;
|
||||
|
||||
|
||||
import com.wangziyang.mes.basedata.entity.SpFlow;
|
||||
import com.wangziyang.mes.basedata.entity.SpOper;
|
||||
import com.wangziyang.mes.basedata.request.SpTableManagerReq;
|
||||
import com.wangziyang.mes.basedata.service.ISpFlowService;
|
||||
import com.wangziyang.mes.basedata.service.ISpOperService;
|
||||
import com.wangziyang.mes.basedata.vo.SpOperVo;
|
||||
import com.wangziyang.mes.common.BaseController;
|
||||
import com.wangziyang.mes.common.Result;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
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.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程与工序关系控制器
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-14
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/basedata/flow/process")
|
||||
public class SpFlowOperRelationController extends BaseController {
|
||||
/**
|
||||
* 流程基础数据服务
|
||||
*/
|
||||
@Autowired
|
||||
public ISpFlowService iSpFlowService;
|
||||
|
||||
/**
|
||||
* 工序基础数据服务
|
||||
*/
|
||||
@Autowired
|
||||
public ISpOperService iSpOperService;
|
||||
|
||||
/**
|
||||
* 流程与工序关系管理界面
|
||||
*
|
||||
* @param model 模型
|
||||
* @return 流程与工序关系管理界面
|
||||
*/
|
||||
@ApiOperation("流程与工序关系管理界面UI")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "model", value = "模型", defaultValue = "模型")})
|
||||
@GetMapping("/list-ui")
|
||||
public String listUI(Model model) {
|
||||
return "basedata/flowprocess/list";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 流程与工序关系管理编辑界面
|
||||
*
|
||||
* @param model 模型
|
||||
* @param record 平台表对象
|
||||
* @return 更改界面
|
||||
*/
|
||||
@ApiOperation("流程与工序关系管理编辑界面")
|
||||
@GetMapping("/add-or-update-ui")
|
||||
public String addOrUpdateUI(Model model, SpFlow record) {
|
||||
List<SpOper> operList = iSpOperService.list();
|
||||
List<SpOperVo> spOperVos = new ArrayList<>();
|
||||
//得出全部的工序数据
|
||||
for (SpOper spOper : operList) {
|
||||
SpOperVo operVo = new SpOperVo();
|
||||
operVo.setValue(spOper.getId());
|
||||
operVo.setTitle(spOper.getOper());
|
||||
spOperVos.add(operVo);
|
||||
}
|
||||
model.addAttribute("allOper", spOperVos);
|
||||
if (StringUtils.isNotEmpty(record.getId())) {
|
||||
SpFlow flowbyId = iSpFlowService.getById(record.getId());
|
||||
//当前流程信息
|
||||
model.addAttribute("flow", flowbyId);
|
||||
// model.addAttribute("current", spOperVos);
|
||||
}
|
||||
return "basedata/flowprocess/addOrUpdate";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 流程信息分页查询
|
||||
*
|
||||
* @param req 请求参数
|
||||
* @return Result 执行结果
|
||||
*/
|
||||
@ApiOperation("主数据表头分页查询")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "req", value = "请求参数", defaultValue = "请求参数")})
|
||||
@PostMapping("/page")
|
||||
@ResponseBody
|
||||
public Result page(SpTableManagerReq req) {
|
||||
// IPage result = iSpTableManagerService.page(req);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.wangziyang.mes.basedata.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-03-14
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/basedata/sp-oper")
|
||||
public class SpOperController extends BaseController {
|
||||
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
package com.wangziyang.mes.basedata.dto;
|
||||
|
||||
public class SpFlowOperRelationDto {
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
package com.wangziyang.mes.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.wangziyang.mes.common.BaseEntity;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程实体类
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-14
|
||||
*/
|
||||
@TableName(value = "sp_flow")
|
||||
public class SpFlow extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 流程
|
||||
*/
|
||||
private String flow;
|
||||
|
||||
/**
|
||||
* 流程描述
|
||||
*/
|
||||
private String flowDesc;
|
||||
|
||||
/**
|
||||
* 流程时序绘制 A——>B——>C
|
||||
*/
|
||||
private String process;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SpFlow{" +
|
||||
"flow=" + flow +
|
||||
", flowDesc=" + flowDesc +
|
||||
", process=" + process +
|
||||
"}";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 流程
|
||||
*
|
||||
* @return flow 流程
|
||||
*/
|
||||
public String getFlow() {
|
||||
return this.flow;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 流程
|
||||
*
|
||||
* @param flow 流程
|
||||
*/
|
||||
public void setFlow(String flow) {
|
||||
this.flow = flow;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 流程描述
|
||||
*
|
||||
* @return flowDesc 流程描述
|
||||
*/
|
||||
public String getFlowDesc() {
|
||||
return this.flowDesc;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 流程描述
|
||||
*
|
||||
* @param flowDesc 流程描述
|
||||
*/
|
||||
public void setFlowDesc(String flowDesc) {
|
||||
this.flowDesc = flowDesc;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 流程时序绘制 A——>B——>C
|
||||
*
|
||||
* @return process 流程时序绘制 A——>B——>C
|
||||
*/
|
||||
public String getProcess() {
|
||||
return this.process;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 流程时序绘制 A——>B——>C
|
||||
*
|
||||
* @param process 流程时序绘制 A——>B——>C
|
||||
*/
|
||||
public void setProcess(String process) {
|
||||
this.process = process;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,249 @@
|
|||
package com.wangziyang.mes.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.wangziyang.mes.common.BaseEntity;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*流程与工序关系实体
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-14
|
||||
*/
|
||||
@TableName("sp_flow_oper_relation")
|
||||
public class SpFlowOperRelation extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 流程ID
|
||||
*/
|
||||
private String flowId;
|
||||
|
||||
/**
|
||||
* 流程代码
|
||||
*/
|
||||
private String flow;
|
||||
|
||||
/**
|
||||
* 前道工序ID
|
||||
*/
|
||||
private String perOperId;
|
||||
|
||||
/**
|
||||
* 前道工序代码
|
||||
*/
|
||||
private String perOper;
|
||||
|
||||
/**
|
||||
* 当前工序ID
|
||||
*/
|
||||
private String operId;
|
||||
|
||||
/**
|
||||
* 当前工序
|
||||
*/
|
||||
private String oper;
|
||||
|
||||
/**
|
||||
* 下道工序ID
|
||||
*/
|
||||
private String nextOperId;
|
||||
|
||||
/**
|
||||
* 下道工序
|
||||
*/
|
||||
private String nextOper;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sortNum;
|
||||
|
||||
/**
|
||||
* 工序类型(首道工序firstOper;最后一道工序lastOper)
|
||||
*/
|
||||
private String operType;
|
||||
|
||||
|
||||
/**
|
||||
* 获取 流程ID
|
||||
*
|
||||
* @return flowId 流程ID
|
||||
*/
|
||||
public String getFlowId() {
|
||||
return this.flowId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 流程ID
|
||||
*
|
||||
* @param flowId 流程ID
|
||||
*/
|
||||
public void setFlowId(String flowId) {
|
||||
this.flowId = flowId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 流程代码
|
||||
*
|
||||
* @return flow 流程代码
|
||||
*/
|
||||
public String getFlow() {
|
||||
return this.flow;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 流程代码
|
||||
*
|
||||
* @param flow 流程代码
|
||||
*/
|
||||
public void setFlow(String flow) {
|
||||
this.flow = flow;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 前道工序ID
|
||||
*
|
||||
* @return perOperId 前道工序ID
|
||||
*/
|
||||
public String getPerOperId() {
|
||||
return this.perOperId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 前道工序ID
|
||||
*
|
||||
* @param perOperId 前道工序ID
|
||||
*/
|
||||
public void setPerOperId(String perOperId) {
|
||||
this.perOperId = perOperId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 前道工序代码
|
||||
*
|
||||
* @return perOper 前道工序代码
|
||||
*/
|
||||
public String getPerOper() {
|
||||
return this.perOper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 前道工序代码
|
||||
*
|
||||
* @param perOper 前道工序代码
|
||||
*/
|
||||
public void setPerOper(String perOper) {
|
||||
this.perOper = perOper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 当前工序ID
|
||||
*
|
||||
* @return operId 当前工序ID
|
||||
*/
|
||||
public String getOperId() {
|
||||
return this.operId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 当前工序ID
|
||||
*
|
||||
* @param operId 当前工序ID
|
||||
*/
|
||||
public void setOperId(String operId) {
|
||||
this.operId = operId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 当前工序
|
||||
*
|
||||
* @return oper 当前工序
|
||||
*/
|
||||
public String getOper() {
|
||||
return this.oper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 当前工序
|
||||
*
|
||||
* @param oper 当前工序
|
||||
*/
|
||||
public void setOper(String oper) {
|
||||
this.oper = oper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 下道工序ID
|
||||
*
|
||||
* @return nextOperId 下道工序ID
|
||||
*/
|
||||
public String getNextOperId() {
|
||||
return this.nextOperId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 下道工序ID
|
||||
*
|
||||
* @param nextOperId 下道工序ID
|
||||
*/
|
||||
public void setNextOperId(String nextOperId) {
|
||||
this.nextOperId = nextOperId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 下道工序
|
||||
*
|
||||
* @return nextOper 下道工序
|
||||
*/
|
||||
public String getNextOper() {
|
||||
return this.nextOper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 下道工序
|
||||
*
|
||||
* @param nextOper 下道工序
|
||||
*/
|
||||
public void setNextOper(String nextOper) {
|
||||
this.nextOper = nextOper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 排序
|
||||
*
|
||||
* @return sortNum 排序
|
||||
*/
|
||||
public Integer getSortNum() {
|
||||
return this.sortNum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 排序
|
||||
*
|
||||
* @param sortNum 排序
|
||||
*/
|
||||
public void setSortNum(Integer sortNum) {
|
||||
this.sortNum = sortNum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 工序类型(首道工序firstOper;最后一道工序lastOper)
|
||||
*
|
||||
* @return operType 工序类型(首道工序firstOper;最后一道工序lastOper)
|
||||
*/
|
||||
public String getOperType() {
|
||||
return this.operType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 工序类型(首道工序firstOper;最后一道工序lastOper)
|
||||
*
|
||||
* @param operType 工序类型(首道工序firstOper;最后一道工序lastOper)
|
||||
*/
|
||||
public void setOperType(String operType) {
|
||||
this.operType = operType;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package com.wangziyang.mes.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.wangziyang.mes.common.BaseEntity;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*工序实体类
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-14
|
||||
*/
|
||||
@TableName(value = "sp_oper")
|
||||
public class SpOper extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 工序
|
||||
*/
|
||||
private String oper;
|
||||
/**
|
||||
* 工序描述
|
||||
*/
|
||||
private String operDesc;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SpOper{" +
|
||||
"oper=" + oper +
|
||||
", operDesc=" + operDesc +
|
||||
"}";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 工序
|
||||
*
|
||||
* @return oper 工序
|
||||
*/
|
||||
public String getOper() {
|
||||
return this.oper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 工序
|
||||
*
|
||||
* @param oper 工序
|
||||
*/
|
||||
public void setOper(String oper) {
|
||||
this.oper = oper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 工序描述
|
||||
*
|
||||
* @return operDesc 工序描述
|
||||
*/
|
||||
public String getOperDesc() {
|
||||
return this.operDesc;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 工序描述
|
||||
*
|
||||
* @param operDesc 工序描述
|
||||
*/
|
||||
public void setOperDesc(String operDesc) {
|
||||
this.operDesc = operDesc;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.wangziyang.mes.basedata.mapper;
|
||||
|
||||
import com.wangziyang.mes.basedata.entity.SpFlow;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-14
|
||||
*/
|
||||
public interface SpFlowMapper extends BaseMapper<SpFlow> {
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.wangziyang.mes.basedata.mapper;
|
||||
|
||||
import com.wangziyang.mes.basedata.entity.SpFlowOperRelation;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-14
|
||||
*/
|
||||
public interface SpFlowOperRelationMapper extends BaseMapper<SpFlowOperRelation> {
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.wangziyang.mes.basedata.mapper;
|
||||
|
||||
import com.wangziyang.mes.basedata.entity.SpOper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-14
|
||||
*/
|
||||
public interface SpOperMapper extends BaseMapper<SpOper> {
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.wangziyang.mes.basedata.request;
|
||||
|
||||
import com.wangziyang.mes.common.BasePageReq;
|
||||
/**
|
||||
* 流程分页对象
|
||||
* @author wangziyang
|
||||
* @since 2020/03/15
|
||||
*/
|
||||
public class SpFlowReq extends BasePageReq {
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.wangziyang.mes.basedata.request;
|
||||
|
||||
import com.wangziyang.mes.common.BasePageReq;
|
||||
|
||||
/**
|
||||
* 工序分页对象
|
||||
* @author wangziyang
|
||||
* @since 2020/03/15
|
||||
*/
|
||||
public class SpOperReq extends BasePageReq {
|
||||
}
|
|
@ -3,7 +3,9 @@ package com.wangziyang.mes.basedata.request;
|
|||
import com.wangziyang.mes.common.BasePageReq;
|
||||
|
||||
/**
|
||||
*
|
||||
* 通用主数据分页对象
|
||||
* @author wangziyang
|
||||
* @since 2020/03/15
|
||||
*/
|
||||
public class SpTableManagerReq extends BasePageReq {
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
package com.wangziyang.mes.basedata.service;
|
||||
|
||||
import com.wangziyang.mes.basedata.entity.SpFlowOperRelation;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-14
|
||||
*/
|
||||
public interface ISpFlowOperRelationService extends IService<SpFlowOperRelation> {
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.wangziyang.mes.basedata.service;
|
||||
|
||||
import com.wangziyang.mes.basedata.entity.SpFlow;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程服务类
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-14
|
||||
*/
|
||||
public interface ISpFlowService extends IService<SpFlow> {
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.wangziyang.mes.basedata.service;
|
||||
|
||||
import com.wangziyang.mes.basedata.entity.SpOper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-14
|
||||
*/
|
||||
public interface ISpOperService extends IService<SpOper> {
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.wangziyang.mes.basedata.service.impl;
|
||||
|
||||
import com.wangziyang.mes.basedata.entity.SpFlowOperRelation;
|
||||
import com.wangziyang.mes.basedata.mapper.SpFlowOperRelationMapper;
|
||||
import com.wangziyang.mes.basedata.service.ISpFlowOperRelationService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-14
|
||||
*/
|
||||
@Service
|
||||
public class SpFlowOperRelationServiceImpl extends ServiceImpl<SpFlowOperRelationMapper, SpFlowOperRelation> implements ISpFlowOperRelationService {
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.wangziyang.mes.basedata.service.impl;
|
||||
|
||||
import com.wangziyang.mes.basedata.entity.SpFlow;
|
||||
import com.wangziyang.mes.basedata.mapper.SpFlowMapper;
|
||||
import com.wangziyang.mes.basedata.service.ISpFlowService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-14
|
||||
*/
|
||||
@Service
|
||||
public class SpFlowServiceImpl extends ServiceImpl<SpFlowMapper, SpFlow> implements ISpFlowService {
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.wangziyang.mes.basedata.service.impl;
|
||||
|
||||
import com.wangziyang.mes.basedata.entity.SpOper;
|
||||
import com.wangziyang.mes.basedata.mapper.SpOperMapper;
|
||||
import com.wangziyang.mes.basedata.service.ISpOperService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-14
|
||||
*/
|
||||
@Service
|
||||
public class SpOperServiceImpl extends ServiceImpl<SpOperMapper, SpOper> implements ISpOperService {
|
||||
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package com.wangziyang.mes.basedata.vo;
|
||||
|
||||
/**
|
||||
* 流程与工序穿梭数据展示对象
|
||||
*
|
||||
* @author wangziyang
|
||||
* @since 2020/03/16
|
||||
*/
|
||||
public class SpOperVo {
|
||||
/**
|
||||
* 具体的存储的ID值
|
||||
*/
|
||||
private String value;
|
||||
/**
|
||||
* 显示标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 获取 具体的存储的ID值
|
||||
*
|
||||
* @return value 具体的存储的ID值
|
||||
*/
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 具体的存储的ID值
|
||||
*
|
||||
* @param value 具体的存储的ID值
|
||||
*/
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 显示标题
|
||||
*
|
||||
* @return title 显示标题
|
||||
*/
|
||||
public String getTitle() {
|
||||
return this.title;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 显示标题
|
||||
*
|
||||
* @param title 显示标题
|
||||
*/
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
}
|
|
@ -105,7 +105,7 @@ public class CodeGenerator {
|
|||
strategy.setNaming(NamingStrategy.underline_to_camel);
|
||||
strategy.setColumnNaming(NamingStrategy.underline_to_camel);
|
||||
strategy.setSuperEntityClass("com.wangziyang.mes.common.BaseEntity");
|
||||
strategy.setEntityLombokModel(true);
|
||||
// strategy.setEntityLombokModel(true);
|
||||
//strategy.setRestControllerStyle(true);
|
||||
strategy.setRestControllerStyle(false);
|
||||
// 公共父类
|
||||
|
|
|
@ -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.basedata.mapper.SpFlowOperRelationMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,112 @@
|
|||
<!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">
|
||||
</head>
|
||||
<body>
|
||||
<div class="splayui-container">
|
||||
<div class="splayui-main">
|
||||
<form class="layui-form splayui-form">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label for="js-name" class="layui-form-label sp-required">流程编码
|
||||
</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="js-flow" name="flow" lay-verify="required" autocomplete="off"
|
||||
class="layui-input" value="${flow.flow}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label for="js-code" class="layui-form-label sp-required">流程描述
|
||||
</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="js-flowDesc" name="flowDesc" lay-verify="required" autocomplete="off"
|
||||
class="layui-input" value="${flow.flowDesc}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label for="js-descr" class="layui-form-label sp-required">流程时序
|
||||
</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="js-process" name="process" lay-verify="required" autocomplete="off"
|
||||
class="layui-input" value="${flow.process}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
|
||||
<legend>流程与工序关系</legend>
|
||||
</fieldset>
|
||||
<div id="js-shuttle" class="demo-transfer"></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-demotransferactive="getData" lay-submit
|
||||
lay-filter="js-submit-filter">确定
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
layui.use(['form', 'util', 'transfer', 'util'], function () {
|
||||
var form = layui.form,
|
||||
util = layui.util,
|
||||
layer = layui.layer,
|
||||
transfer = layui.transfer;
|
||||
|
||||
console.log("1");
|
||||
//模拟数据
|
||||
data2 = [];
|
||||
<#list allOper as oper >
|
||||
oper = {};
|
||||
oper.value = '${oper.value}';
|
||||
oper.title = '${oper.title}';
|
||||
data2.push(oper);
|
||||
</#list>
|
||||
//初始右侧数据
|
||||
transfer.render({
|
||||
elem: '#js-shuttle',
|
||||
title: ['全部工序', '当前Flow下工序']
|
||||
, data: data2
|
||||
, value: ["1", "3", "5", "7", "9", "11"]
|
||||
, id: 'key123' //定义唯一索引
|
||||
})
|
||||
//监听提交
|
||||
form.on('submit(js-submit-filter)', function (data) {
|
||||
spUtil.submitForm({
|
||||
url: "${request.contextPath}/admin/sys/role/add-or-update",
|
||||
data: data.field
|
||||
});
|
||||
});
|
||||
//批量办法定事件
|
||||
util.event('lay-demoTransferActive', {
|
||||
getData: function (othis) {
|
||||
var getData = transfer.getData('key123'); //获取右侧数据
|
||||
console.log(JSON.stringify(getData));
|
||||
}
|
||||
, reload: function () {
|
||||
//实例重载
|
||||
transfer.reload('key123', {
|
||||
title: ['文人', '喜欢的文人']
|
||||
, value: ['2', '5', '9']
|
||||
, showSearch: true
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,167 @@
|
|||
<!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="text" name="nameLike" 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"></i>批量删除
|
||||
</button>
|
||||
<@shiro.hasPermission name="user:add">
|
||||
<button class="layui-btn layui-btn-sm" lay-event="add"><i class="layui-icon"></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/flow/page',
|
||||
cols: [
|
||||
[{
|
||||
type: 'checkbox'
|
||||
}, {
|
||||
field: 'flow', title: '流程'
|
||||
}, {
|
||||
field: 'flowDesc', title: '流程描述'
|
||||
}, {
|
||||
field: 'process', title: '流程时序过程'
|
||||
}, {
|
||||
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: ['80%', '90%'],
|
||||
content: '${request.contextPath}/basedata/flow/process/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: ['80%', '90%'],
|
||||
// 请求url参数
|
||||
spWhere: {id: data.id},
|
||||
content: '${request.contextPath}/basedata/flow/process/add-or-update-ui'
|
||||
});
|
||||
}
|
||||
|
||||
// 删除
|
||||
if (obj.event === 'delete') {
|
||||
layer.confirm('确认要删除吗?', function (index) {
|
||||
obj.del();
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue