Browse Source

[update]:生产管理-生产工序

dev
youjianchi 7 months ago
parent
commit
c2d5b83dd5
  1. 66
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysProcedure.java
  2. 12
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysProcedureMapper.java
  3. 15
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysProcedureServiceImpl.java
  4. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysProcessCategoryServiceImpl.java
  5. 6
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProcedureController.java
  6. 52
      ruoyi-admin/src/main/resources/mapper/system/SysProcedureMapper.xml
  7. 18
      ruoyi-admin/src/main/resources/templates/system/procedure/add.html
  8. 28
      ruoyi-admin/src/main/resources/templates/system/procedure/edit.html
  9. 55
      ruoyi-admin/src/main/resources/templates/system/procedure/procedure.html

66
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysProcedure.java

@ -17,8 +17,17 @@ public class SysProcedure extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 删除标志(0代表存在 1代表删除) */
private String delFlag;
/** 生产设备型号 */
private String produceEquipModel;
/** 工序id */
private Long procedureId;
private String procedureId;
/** 工序编号 */
@Excel(name = "工序编号")
@ -51,20 +60,37 @@ public class SysProcedure extends BaseEntity
/** 工序备注 */
@Excel(name = "工序备注")
private String procedureRemark;
/** 录入时间 */
@Excel(name = "录入时间")
private String firstAddTime;
/** 修改时间 */
@Excel(name = "修改时间")
private String updateInfoTime;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getProduceEquipModel() {
return produceEquipModel;
}
public void setProduceEquipModel(String produceEquipModel) {
this.produceEquipModel = produceEquipModel;
}
public void setProcedureId(Long procedureId)
public void setProcedureId(String procedureId)
{
this.procedureId = procedureId;
}
public Long getProcedureId()
public String getProcedureId()
{
return procedureId;
}
@ -140,25 +166,13 @@ public class SysProcedure extends BaseEntity
return procedureRemark;
}
public String getFirstAddTime() {
return firstAddTime;
}
public void setFirstAddTime(String firstAddTime) {
this.firstAddTime = firstAddTime;
}
public String getUpdateInfoTime() {
return updateInfoTime;
}
public void setUpdateInfoTime(String updateInfoTime) {
this.updateInfoTime = updateInfoTime;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("delFlag", getDelFlag())
.append("produceEquipModel", getProduceEquipModel())
.append("procedureId", getProcedureId())
.append("procedureCode",getProcedureCode())
.append("workshopName", getWorkshopName())
.append("procedureName", getProcedureName())
@ -167,8 +181,6 @@ public class SysProcedure extends BaseEntity
.append("procedureWorkhour", getProcedureWorkhour())
.append("associatedItem", getAssociatedItem())
.append("procedureRemark", getProcedureRemark())
.append("firstAddTime", getFirstAddTime())
.append("updateInfoTime", getUpdateInfoTime())
.toString();
}
}

12
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysProcedureMapper.java

@ -15,10 +15,10 @@ public interface SysProcedureMapper
/**
* 查询生产加工工序明细
*
* @param procedureId 生产加工工序明细ID
* @param id 主键id
* @return 生产加工工序明细
*/
SysProcedure selectSysProcedureById(Long procedureId);
SysProcedure selectSysProcedureById(Long id);
/**
* 查询生产加工工序明细列表
@ -48,17 +48,17 @@ public interface SysProcedureMapper
/**
* 删除生产加工工序明细
*
* @param procedureId 生产加工工序明细ID
* @param id 主键id
* @return 结果
*/
int deleteSysProcedureById(Long procedureId);
int deleteSysProcedureById(Long id);
/**
* 批量删除生产加工工序明细
*
* @param procedureIds 需要删除的数据ID
* @param ids 需要删除的数据ID
* @return 结果
*/
int deleteSysProcedureByIds(String[] procedureIds);
int deleteSysProcedureByIds(String[] ids);
}

15
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysProcedureServiceImpl.java

@ -1,6 +1,9 @@
package com.ruoyi.system.service.impl;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.system.domain.SysProcedure;
import com.ruoyi.system.mapper.SysProcedureMapper;
import com.ruoyi.system.service.ISysProcedureService;
@ -21,6 +24,9 @@ public class SysProcedureServiceImpl implements ISysProcedureService
@Autowired
private SysProcedureMapper sysProcedureMapper;
@Autowired
private RedisCache redisCache;
/**
* 查询生产加工工序明细
*
@ -54,6 +60,12 @@ public class SysProcedureServiceImpl implements ISysProcedureService
@Override
public int insertSysProcedure(SysProcedure sysProcedure)
{
String loginName = ShiroUtils.getLoginName();
sysProcedure.setCreateBy(loginName);
sysProcedure.setCreateTime(DateUtils.getNowDate());
// 生成编号
String billNo = redisCache.generateNo("POGX");
sysProcedure.setProcedureId(billNo);
return sysProcedureMapper.insertSysProcedure(sysProcedure);
}
@ -66,6 +78,9 @@ public class SysProcedureServiceImpl implements ISysProcedureService
@Override
public int updateSysProcedure(SysProcedure sysProcedure)
{
String loginName = ShiroUtils.getLoginName();
sysProcedure.setUpdateBy(loginName);
sysProcedure.setUpdateTime(DateUtils.getNowDate());
return sysProcedureMapper.updateSysProcedure(sysProcedure);
}

2
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysProcessCategoryServiceImpl.java

@ -63,7 +63,7 @@ public class SysProcessCategoryServiceImpl implements ISysProcessCategoryService
String loginName = ShiroUtils.getLoginName();
sysProcessCategory.setCreateBy(loginName);
sysProcessCategory.setCreateTime(DateUtils.getNowDate());
// 生成编号,年月日规则
// 生成编号
String billNo = redisCache.generateNo("ZC");
sysProcessCategory.setProcessCategoryId(billNo);
return sysProcessCategoryMapper.insertSysProcessCategory(sysProcessCategory);

6
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProcedureController.java

@ -97,10 +97,10 @@ public class SysProcedureController extends BaseController
/**
* 修改生产加工工序明细
*/
@GetMapping("/edit/{procedureId}")
public String edit(@PathVariable("procedureId") Long procedureId, ModelMap mmap)
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
SysProcedure sysProcedure = sysProcedureService.selectSysProcedureById(procedureId);
SysProcedure sysProcedure = sysProcedureService.selectSysProcedureById(id);
mmap.put("sysProcedure", sysProcedure);
return prefix + "/edit";
}

52
ruoyi-admin/src/main/resources/mapper/system/SysProcedureMapper.xml

@ -5,6 +5,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.ruoyi.system.mapper.SysProcedureMapper">
<resultMap type="SysProcedure" id="SysProcedureResult">
<result property="id" column="id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="delFlag" column="del_flag" />
<result property="produceEquipModel" column="produce_equip_model" />
<result property="procedureId" column="procedure_id" />
<result property="procedureCode" column="procedure_code" />
<result property="workshopName" column="workshop_name" />
@ -14,13 +22,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="procedureWorkhour" column="procedure_workhour" />
<result property="associatedItem" column="associated_item" />
<result property="procedureRemark" column="procedure_remark" />
<result property="firstAddTime" column="first_add_time" />
<result property="updateInfoTime" column="update_info_time" />
</resultMap>
<sql id="selectSysProcedureVo">
select procedure_id, procedure_code, workshop_name, procedure_name, sequence, each_cost, procedure_workhour, associated_item, procedure_remark, first_add_time, update_info_time from sys_procedure
select id,del_flag,create_by,create_time,update_by,update_time,remark,produce_equip_model,procedure_id, procedure_code, workshop_name, procedure_name, sequence, each_cost, procedure_workhour, associated_item, procedure_remark from sys_procedure
</sql>
<select id="selectSysProcedureList" parameterType="SysProcedure" resultMap="SysProcedureResult">
@ -29,18 +35,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="procedureCode != null and procedureCode != ''"> and procedure_code = #{procedureCode}</if>
<if test="workshopName != null and workshopName != ''"> and workshop_name like concat('%', #{workshopName}, '%')</if>
<if test="procedureName != null and procedureName != ''"> and procedure_name like concat('%', #{procedureName}, '%')</if>
<if test="produceEquipModel != null and produceEquipModel != ''"> and produce_equip_model like concat('%', #{produceEquipModel}, '%')</if>
<if test="associatedItem != null and associatedItem != ''"> and associated_item = #{associatedItem}</if>
</where>
</select>
<select id="selectSysProcedureById" parameterType="Long" resultMap="SysProcedureResult">
<include refid="selectSysProcedureVo"/>
where procedure_id = #{procedureId}
where id = #{id}
</select>
<insert id="insertSysProcedure" parameterType="SysProcedure" useGeneratedKeys="true" keyProperty="procedureId">
insert into sys_procedure
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="produceEquipModel != null">produce_equip_model,</if>
<if test="procedureId != null">procedure_id,</if>
<if test="procedureCode != null">procedure_code,</if>
<if test="workshopName != null and workshopName != ''">workshop_name,</if>
<if test="procedureName != null">procedure_name,</if>
@ -49,9 +58,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="procedureWorkhour != null">procedure_workhour,</if>
<if test="associatedItem != null">associated_item,</if>
<if test="procedureRemark != null">procedure_remark,</if>
first_add_time,
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="produceEquipModel != null">#{produceEquipModel},</if>
<if test="procedureId != null">#{procedureId},</if>
<if test="procedureCode != null">#{procedureCode},</if>
<if test="workshopName != null and workshopName != ''">#{workshopName},</if>
<if test="procedureName != null">#{procedureName},</if>
@ -60,13 +76,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="procedureWorkhour != null">#{procedureWorkhour},</if>
<if test="associatedItem != null">#{associatedItem},</if>
<if test="procedureRemark != null">#{procedureRemark},</if>
now()
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateSysProcedure" parameterType="SysProcedure">
update sys_procedure
<trim prefix="SET" suffixOverrides=",">
<if test="produceEquipModel != null">produce_equip_model = #{produceEquipModel},</if>
<if test="procedureId != null">procedure_id = #{procedureId},</if>
<if test="procedureCode != null">procedure_code = #{procedureCode},</if>
<if test="workshopName != null and workshopName != ''">workshop_name = #{workshopName},</if>
<if test="procedureName != null">procedure_name = #{procedureName},</if>
@ -75,19 +98,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="procedureWorkhour != null">procedure_workhour = #{procedureWorkhour},</if>
<if test="associatedItem != null">associated_item = #{associatedItem},</if>
<if test="procedureRemark != null">procedure_remark = #{procedureRemark},</if>
update_info_time = CONCAT_WS(',',NOW(),update_info_time),
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where procedure_id = #{procedureId}
where id = #{id}
</update>
<delete id="deleteSysProcedureById" parameterType="Long">
delete from sys_procedure where procedure_id = #{procedureId}
delete from sys_procedure where id = #{id}
</delete>
<delete id="deleteSysProcedureByIds" parameterType="String">
delete from sys_procedure where procedure_id in
<foreach item="procedureId" collection="array" open="(" separator="," close=")">
#{procedureId}
delete from sys_procedure where id in
<foreach item="item" collection="array" open="(" separator="," close=")">
#{item}
</foreach>
</delete>

18
ruoyi-admin/src/main/resources/templates/system/procedure/add.html

@ -8,22 +8,28 @@
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-procedure-add">
<div class="form-group">
<label class="col-sm-3 control-label">生产设备型号:</label>
<div class="col-sm-8">
<input name="produceEquipModel" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工序编号:</label>
<div class="col-sm-8">
<input name="procedureCode" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<!--<div class="form-group">
<label class="col-sm-3 control-label is-required" >车间名称:</label>
<div class="col-sm-8">
<!-- <input name="workshopName" class="form-control" type="text"/>-->
&lt;!&ndash; <input name="workshopName" class="form-control" type="text"/>&ndash;&gt;
<select name="workshopName" class="form-control select-list js-example-tags" th:with="type=${@dict.getType('sys_procedure_workshopName')}">
<option value="">请选择车间名称</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
</select>
</div>
</div>
</div>-->
<div class="form-group">
<label class="col-sm-3 control-label is-required" >工序名称:</label>
<div class="col-sm-8">
@ -49,7 +55,7 @@
<input name="procedureWorkhour" class="form-control" type="text" >
</div>
</div>
<div class="form-group">
<!--<div class="form-group">
<label class="col-sm-3 control-label">核算数量关联项:</label>
<div class="col-sm-8">
<select name="associatedItem" class="form-control select-list js-example-tags" th:with="type=${@dict.getType('sys_procedure_associatedItem')}">
@ -57,11 +63,11 @@
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
</select>
</div>
</div>
</div>-->
<div class="form-group">
<label class="col-sm-3 control-label">工序备注:</label>
<div class="col-sm-8">
<input name="procedureRemark" class="form-control" type="text">
<textarea name="procedureRemark" class="form-control"></textarea>
</div>
</div>
</form>

28
ruoyi-admin/src/main/resources/templates/system/procedure/edit.html

@ -8,23 +8,35 @@
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-procedure-edit" th:object="${sysProcedure}">
<input name="procedureId" th:field="*{procedureId}" type="hidden">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">工序id:</label>
<div class="col-sm-8">
<input readonly name="procedureId" th:field="*{procedureId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">生产设备型号:</label>
<div class="col-sm-8">
<input name="produceEquipModel" th:field="*{produceEquipModel}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工序编号:</label>
<div class="col-sm-8">
<input name="procedureCode" th:field="*{procedureCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<!--<div class="form-group">
<label class="col-sm-3 control-label">车间名称:</label>
<div class="col-sm-8">
<!-- <input name="workshopName" th:field="*{workshopName}" class="form-control" type="text">-->
&lt;!&ndash; <input name="workshopName" th:field="*{workshopName}" class="form-control" type="text">&ndash;&gt;
<select name="workshopName" class="form-control select-list js-example-tags" th:field="*{workshopName}" th:with="type=${@dict.getType('sys_procedure_workshopName')}">
<option value="">请选择车间名称</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
</select>
</div>
</div>
</div>-->
<div class="form-group">
<label class="col-sm-3 control-label">工序名称:</label>
<div class="col-sm-8">
@ -49,20 +61,20 @@
<input name="procedureWorkhour" th:field="*{procedureWorkhour}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<!--<div class="form-group">
<label class="col-sm-3 control-label">核算数量关联项:</label>
<div class="col-sm-8">
<select name="associatedItem" class="form-control select-list js-example-tags" th:field="*{associatedItem}" th:with="type=${@dict.getType('sys_procedure_associatedItem')}">
<option value="">请选择核算数量关联项</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
</select>
<!-- <input name="associatedItem" th:field="*{associatedItem}" class="form-control" type="text">-->
</div>
&lt;!&ndash; <input name="associatedItem" th:field="*{associatedItem}" class="form-control" type="text">&ndash;&gt;
</div>
</div>-->
<div class="form-group">
<label class="col-sm-3 control-label">工序备注:</label>
<div class="col-sm-8">
<input name="procedureRemark" th:field="*{procedureRemark}" class="form-control" type="text">
<textarea name="procedureRemark" th:field="*{procedureRemark}" class="form-control"></textarea>
</div>
</div>
</form>

55
ruoyi-admin/src/main/resources/templates/system/procedure/procedure.html

@ -15,26 +15,30 @@
<label>工序编号:</label>
<input type="text" name="procedureCode"/>
</li>
<li>
<!--<li>
<label>车间名称:</label>
<!-- <input type="text" name="workshopName"/>-->
&lt;!&ndash; <input type="text" name="workshopName"/>&ndash;&gt;
<select name="workshopName" class="form-control select-list" th:with="type=${@dict.getType('sys_procedure_workshopName')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
</select>
</li>
</li>-->
<li>
<label>工序名称:</label>
<input type="text" name="procedureName"/>
</li>
<li>
<label>生产设备型号:</label>
<input type="text" name="produceEquipModel"/>
</li>
<!--<li>
<label>核算数量关联项:</label>
<!-- <input type="text" name="associatedItem"/>-->
&lt;!&ndash; <input type="text" name="associatedItem"/>&ndash;&gt;
<select name="associatedItem" class="form-control select-list" th:with="type=${@dict.getType('sys_procedure_associatedItem')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
</select>
</li>
</li>-->
<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>
@ -83,17 +87,26 @@
checkbox: true
},
{
field: 'procedureId',
title: '工序id',
title: '主键ID',
field: 'id',
visible: false
},
{
field: 'procedureId',
title: '工序id'
},
{
field: 'procedureCode',
title: '工序编号'
},
{
field: 'produceEquipModel',
title: '生产设备型号'
},
{
field: 'workshopName',
title: '车间名称'
title: '车间名称',
visible: false
},
{
field: 'procedureName',
@ -114,34 +127,20 @@
},
{
field: 'associatedItem',
title: '核算数量关联项'
title: '核算数量关联项',
visible: false
},
{
field: 'procedureRemark',
title: '工序备注'
},
{
field: 'firstAddTime',
title: '录入时间',
formatter: function (value, row, index) {
if (value == null) {
return " ";
} else {
return value;
}
}
field: 'createTime',
title: '录入时间'
},
{
field: 'updateInfoTime',
title: '上次修改时间',
formatter: function (value, row, index) {
if (value == null) {
return " ";
} else {
var vArr = value.split(',')
return vArr[0];
}
}
field: 'updateTime',
title: '上次修改时间'
}
// {

Loading…
Cancel
Save