Browse Source

[update]:生产管理-制程类别明细

dev
youjianchi 7 months ago
parent
commit
dd1307082f
  1. 6
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysProcessCategoryController.java
  2. 90
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysProcessCategory.java
  3. 8
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysProcessCategoryMapper.java
  4. 28
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysProcessCategoryServiceImpl.java
  5. 58
      ruoyi-admin/src/main/resources/mapper/system/SysProcessCategoryMapper.xml
  6. 6
      ruoyi-admin/src/main/resources/templates/system/processCategory/add.html
  7. 14
      ruoyi-admin/src/main/resources/templates/system/processCategory/edit.html
  8. 43
      ruoyi-admin/src/main/resources/templates/system/processCategory/processCategory.html

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

@ -89,10 +89,10 @@ public class SysProcessCategoryController extends BaseController
/** /**
* 修改制程类别明细 * 修改制程类别明细
*/ */
@GetMapping("/edit/{processCategoryId}") @GetMapping("/edit/{id}")
public String edit(@PathVariable("processCategoryId") Long processCategoryId, ModelMap mmap) public String edit(@PathVariable("id") Long id, ModelMap mmap)
{ {
SysProcessCategory sysProcessCategory = sysProcessCategoryService.selectSysProcessCategoryById(processCategoryId); SysProcessCategory sysProcessCategory = sysProcessCategoryService.selectSysProcessCategoryById(id);
mmap.put("sysProcessCategory", sysProcessCategory); mmap.put("sysProcessCategory", sysProcessCategory);
return prefix + "/edit"; return prefix + "/edit";
} }

90
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysProcessCategory.java

@ -15,13 +15,23 @@ public class SysProcessCategory extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 删除标志(0代表存在 1代表删除) */
private String delFlag;
/** 制程类别id */ /** 制程类别id */
private Long processCategoryId; private String processCategoryId;
/** 制程类别编号 */ /** 制程类别编号 */
@Excel(name = "制程类别编号") @Excel(name = "制程类别编号")
private String processCategoryCode; private String processCategoryCode;
/** 制程类别名称 */
@Excel(name = "制程类别名称")
private String processCategoryName;
/** 制程描述 */ /** 制程描述 */
@Excel(name = "制程描述") @Excel(name = "制程描述")
private String processDescription; private String processDescription;
@ -38,24 +48,28 @@ public class SysProcessCategory extends BaseEntity
@Excel(name = "财务实际加工费") @Excel(name = "财务实际加工费")
private String actualProcessingCost; private String actualProcessingCost;
/** 录入时间 */ public Long getId() {
private String firstAddTime; return id;
}
/** 修改时间 */ public void setId(Long id) {
private String updateInfoTime; this.id = id;
}
/** 备用一 */ public String getDelFlag() {
private String standbyOne; return delFlag;
}
/** 备用二 */ public void setDelFlag(String delFlag) {
private String standbyTwo; this.delFlag = delFlag;
}
public void setProcessCategoryId(Long processCategoryId) public void setProcessCategoryId(String processCategoryId)
{ {
this.processCategoryId = processCategoryId; this.processCategoryId = processCategoryId;
} }
public Long getProcessCategoryId() public String getProcessCategoryId()
{ {
return processCategoryId; return processCategoryId;
} }
@ -68,7 +82,16 @@ public class SysProcessCategory extends BaseEntity
{ {
return processCategoryCode; return processCategoryCode;
} }
public void setProcessDescription(String processDescription)
public String getProcessCategoryName() {
return processCategoryName;
}
public void setProcessCategoryName(String processCategoryName) {
this.processCategoryName = processCategoryName;
}
public void setProcessDescription(String processDescription)
{ {
this.processDescription = processDescription; this.processDescription = processDescription;
} }
@ -104,56 +127,19 @@ public class SysProcessCategory extends BaseEntity
{ {
return actualProcessingCost; return actualProcessingCost;
} }
public void setFirstAddTime(String firstAddTime)
{
this.firstAddTime = firstAddTime;
}
public String getFirstAddTime()
{
return firstAddTime;
}
public void setUpdateInfoTime(String updateInfoTime)
{
this.updateInfoTime = updateInfoTime;
}
public String getUpdateInfoTime()
{
return updateInfoTime;
}
public void setStandbyOne(String standbyOne)
{
this.standbyOne = standbyOne;
}
public String getStandbyOne()
{
return standbyOne;
}
public void setStandbyTwo(String standbyTwo)
{
this.standbyTwo = standbyTwo;
}
public String getStandbyTwo()
{
return standbyTwo;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("delFlag", getDelFlag())
.append("processCategoryId", getProcessCategoryId()) .append("processCategoryId", getProcessCategoryId())
.append("processCategoryCode", getProcessCategoryCode()) .append("processCategoryCode", getProcessCategoryCode())
.append("processCategoryName", getProcessCategoryName())
.append("processDescription", getProcessDescription()) .append("processDescription", getProcessDescription())
.append("workHourOutput", getWorkHourOutput()) .append("workHourOutput", getWorkHourOutput())
.append("standardConversionCost", getStandardConversionCost()) .append("standardConversionCost", getStandardConversionCost())
.append("actualProcessingCost", getActualProcessingCost()) .append("actualProcessingCost", getActualProcessingCost())
.append("firstAddTime", getFirstAddTime())
.append("updateInfoTime", getUpdateInfoTime())
.append("standbyOne", getStandbyOne())
.append("standbyTwo", getStandbyTwo())
.toString(); .toString();
} }
} }

8
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysProcessCategoryMapper.java

@ -46,16 +46,16 @@ public interface SysProcessCategoryMapper
/** /**
* 删除制程类别明细 * 删除制程类别明细
* *
* @param processCategoryId 制程类别明细ID * @param id 主键id
* @return 结果 * @return 结果
*/ */
public int deleteSysProcessCategoryById(Long processCategoryId); public int deleteSysProcessCategoryById(Long id);
/** /**
* 批量删除制程类别明细 * 批量删除制程类别明细
* *
* @param processCategoryIds 需要删除的数据ID * @param ids 需要删除的数据ID
* @return 结果 * @return 结果
*/ */
public int deleteSysProcessCategoryByIds(String[] processCategoryIds); public int deleteSysProcessCategoryByIds(String[] ids);
} }

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

@ -1,6 +1,10 @@
package com.ruoyi.system.service.impl; package com.ruoyi.system.service.impl;
import java.util.List; import java.util.List;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysProcessCategoryMapper; import com.ruoyi.system.mapper.SysProcessCategoryMapper;
@ -20,16 +24,19 @@ public class SysProcessCategoryServiceImpl implements ISysProcessCategoryService
@Autowired @Autowired
private SysProcessCategoryMapper sysProcessCategoryMapper; private SysProcessCategoryMapper sysProcessCategoryMapper;
@Autowired
private RedisCache redisCache;
/** /**
* 查询制程类别明细 * 查询制程类别明细
* *
* @param processCategoryId 制程类别明细ID * @param id 主键id
* @return 制程类别明细 * @return 制程类别明细
*/ */
@Override @Override
public SysProcessCategory selectSysProcessCategoryById(Long processCategoryId) public SysProcessCategory selectSysProcessCategoryById(Long id)
{ {
return sysProcessCategoryMapper.selectSysProcessCategoryById(processCategoryId); return sysProcessCategoryMapper.selectSysProcessCategoryById(id);
} }
/** /**
@ -53,6 +60,12 @@ public class SysProcessCategoryServiceImpl implements ISysProcessCategoryService
@Override @Override
public int insertSysProcessCategory(SysProcessCategory sysProcessCategory) public int insertSysProcessCategory(SysProcessCategory sysProcessCategory)
{ {
String loginName = ShiroUtils.getLoginName();
sysProcessCategory.setCreateBy(loginName);
sysProcessCategory.setCreateTime(DateUtils.getNowDate());
// 生成编号,年月日规则
String billNo = redisCache.generateNo("ZC");
sysProcessCategory.setProcessCategoryId(billNo);
return sysProcessCategoryMapper.insertSysProcessCategory(sysProcessCategory); return sysProcessCategoryMapper.insertSysProcessCategory(sysProcessCategory);
} }
@ -65,6 +78,9 @@ public class SysProcessCategoryServiceImpl implements ISysProcessCategoryService
@Override @Override
public int updateSysProcessCategory(SysProcessCategory sysProcessCategory) public int updateSysProcessCategory(SysProcessCategory sysProcessCategory)
{ {
String loginName = ShiroUtils.getLoginName();
sysProcessCategory.setUpdateBy(loginName);
sysProcessCategory.setUpdateTime(DateUtils.getNowDate());
return sysProcessCategoryMapper.updateSysProcessCategory(sysProcessCategory); return sysProcessCategoryMapper.updateSysProcessCategory(sysProcessCategory);
} }
@ -83,12 +99,12 @@ public class SysProcessCategoryServiceImpl implements ISysProcessCategoryService
/** /**
* 删除制程类别明细信息 * 删除制程类别明细信息
* *
* @param processCategoryId 制程类别明细ID * @param id 主键id
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteSysProcessCategoryById(Long processCategoryId) public int deleteSysProcessCategoryById(Long id)
{ {
return sysProcessCategoryMapper.deleteSysProcessCategoryById(processCategoryId); return sysProcessCategoryMapper.deleteSysProcessCategoryById(id);
} }
} }

58
ruoyi-admin/src/main/resources/mapper/system/SysProcessCategoryMapper.xml

@ -5,20 +5,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.ruoyi.system.mapper.SysProcessCategoryMapper"> <mapper namespace="com.ruoyi.system.mapper.SysProcessCategoryMapper">
<resultMap type="SysProcessCategory" id="SysProcessCategoryResult"> <resultMap type="SysProcessCategory" id="SysProcessCategoryResult">
<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="processCategoryId" column="process_category_id" /> <result property="processCategoryId" column="process_category_id" />
<result property="processCategoryCode" column="process_category_code" /> <result property="processCategoryCode" column="process_category_code" />
<result property="processCategoryName" column="process_category_name" />
<result property="processDescription" column="process_description" /> <result property="processDescription" column="process_description" />
<result property="workHourOutput" column="work_hour_output" /> <result property="workHourOutput" column="work_hour_output" />
<result property="standardConversionCost" column="standard_conversion_cost" /> <result property="standardConversionCost" column="standard_conversion_cost" />
<result property="actualProcessingCost" column="actual_processing_cost" /> <result property="actualProcessingCost" column="actual_processing_cost" />
<result property="firstAddTime" column="first_add_time" />
<result property="updateInfoTime" column="update_info_time" />
<result property="standbyOne" column="standby_one" />
<result property="standbyTwo" column="standby_two" />
</resultMap> </resultMap>
<sql id="selectSysProcessCategoryVo"> <sql id="selectSysProcessCategoryVo">
select process_category_id, process_category_code, process_description, work_hour_output, standard_conversion_cost, actual_processing_cost, first_add_time, update_info_time, standby_one, standby_two from sys_process_category select id,del_flag,create_by,create_time,update_by,update_time,remark,process_category_id, process_category_code, process_category_name, process_description, work_hour_output, standard_conversion_cost, actual_processing_cost from sys_process_category
</sql> </sql>
<select id="selectSysProcessCategoryList" parameterType="SysProcessCategory" resultMap="SysProcessCategoryResult"> <select id="selectSysProcessCategoryList" parameterType="SysProcessCategory" resultMap="SysProcessCategoryResult">
@ -31,30 +35,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSysProcessCategoryById" parameterType="Long" resultMap="SysProcessCategoryResult"> <select id="selectSysProcessCategoryById" parameterType="Long" resultMap="SysProcessCategoryResult">
<include refid="selectSysProcessCategoryVo"/> <include refid="selectSysProcessCategoryVo"/>
where process_category_id = #{processCategoryId} where id = #{id}
</select> </select>
<insert id="insertSysProcessCategory" parameterType="SysProcessCategory" useGeneratedKeys="true" keyProperty="processCategoryId"> <insert id="insertSysProcessCategory" parameterType="SysProcessCategory" useGeneratedKeys="true" keyProperty="processCategoryId">
insert into sys_process_category insert into sys_process_category
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="processCategoryId != null">process_category_id,</if>
<if test="processCategoryCode != null">process_category_code,</if> <if test="processCategoryCode != null">process_category_code,</if>
<if test="processCategoryName != null">process_category_name,</if>
<if test="processDescription != null">process_description,</if> <if test="processDescription != null">process_description,</if>
<if test="workHourOutput != null">work_hour_output,</if> <if test="workHourOutput != null">work_hour_output,</if>
<if test="standardConversionCost != null">standard_conversion_cost,</if> <if test="standardConversionCost != null">standard_conversion_cost,</if>
<if test="actualProcessingCost != null">actual_processing_cost,</if> <if test="actualProcessingCost != null">actual_processing_cost,</if>
<if test="standbyOne != null">standby_one,</if> <if test="createBy != null">create_by,</if>
<if test="standbyTwo != null">standby_two,</if> <if test="createTime != null">create_time,</if>
first_add_time, <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>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="processCategoryId != null">#{processCategoryId},</if>
<if test="processCategoryCode != null">#{processCategoryCode},</if> <if test="processCategoryCode != null">#{processCategoryCode},</if>
<if test="processCategoryName != null">#{processCategoryName},</if>
<if test="processDescription != null">#{processDescription},</if> <if test="processDescription != null">#{processDescription},</if>
<if test="workHourOutput != null">#{workHourOutput},</if> <if test="workHourOutput != null">#{workHourOutput},</if>
<if test="standardConversionCost != null">#{standardConversionCost},</if> <if test="standardConversionCost != null">#{standardConversionCost},</if>
<if test="actualProcessingCost != null">#{actualProcessingCost},</if> <if test="actualProcessingCost != null">#{actualProcessingCost},</if>
<if test="standbyOne != null">#{standbyOne},</if> <if test="createBy != null">#{createBy},</if>
<if test="standbyTwo != null">#{standbyTwo},</if> <if test="createTime != null">#{createTime},</if>
NOW(), <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> </trim>
</insert> </insert>
@ -62,25 +76,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update sys_process_category update sys_process_category
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="processCategoryCode != null">process_category_code = #{processCategoryCode},</if> <if test="processCategoryCode != null">process_category_code = #{processCategoryCode},</if>
<if test="processCategoryName != null">process_category_name = #{processCategoryName},</if>
<if test="processDescription != null">process_description = #{processDescription},</if> <if test="processDescription != null">process_description = #{processDescription},</if>
<if test="workHourOutput != null">work_hour_output = #{workHourOutput},</if> <if test="workHourOutput != null">work_hour_output = #{workHourOutput},</if>
<if test="standardConversionCost != null">standard_conversion_cost = #{standardConversionCost},</if> <if test="standardConversionCost != null">standard_conversion_cost = #{standardConversionCost},</if>
<if test="actualProcessingCost != null">actual_processing_cost = #{actualProcessingCost},</if> <if test="actualProcessingCost != null">actual_processing_cost = #{actualProcessingCost},</if>
<if test="standbyOne != null">standby_one = #{standbyOne},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="standbyTwo != null">standby_two = #{standbyTwo},</if> <if test="createTime != null">create_time = #{createTime},</if>
update_info_time = CONCAT_WS(',',NOW(),update_info_time), <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> </trim>
where process_category_id = #{processCategoryId} where id = #{id}
</update> </update>
<delete id="deleteSysProcessCategoryById" parameterType="Long"> <delete id="deleteSysProcessCategoryById" parameterType="Long">
delete from sys_process_category where process_category_id = #{processCategoryId} delete from sys_process_category where id = #{id}
</delete> </delete>
<delete id="deleteSysProcessCategoryByIds" parameterType="String"> <delete id="deleteSysProcessCategoryByIds" parameterType="String">
delete from sys_process_category where process_category_id in delete from sys_process_category where id in
<foreach item="processCategoryId" collection="array" open="(" separator="," close=")"> <foreach item="item" collection="array" open="(" separator="," close=")">
#{processCategoryId} #{item}
</foreach> </foreach>
</delete> </delete>

6
ruoyi-admin/src/main/resources/templates/system/processCategory/add.html

@ -12,6 +12,12 @@
<input name="processCategoryCode" class="form-control" type="text"> <input name="processCategoryCode" class="form-control" type="text">
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">制程类别名称:</label>
<div class="col-sm-8">
<input name="processCategoryName" class="form-control" type="text">
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">制程描述:</label> <label class="col-sm-3 control-label">制程描述:</label>
<div class="col-sm-8"> <div class="col-sm-8">

14
ruoyi-admin/src/main/resources/templates/system/processCategory/edit.html

@ -6,13 +6,25 @@
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-processCategory-edit" th:object="${sysProcessCategory}"> <form class="form-horizontal m" id="form-processCategory-edit" th:object="${sysProcessCategory}">
<input name="processCategoryId" th:field="*{processCategoryId}" 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="processCategoryId" th:field="*{processCategoryId}" class="form-control" type="text">
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">制程类别编号:</label> <label class="col-sm-3 control-label">制程类别编号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="processCategoryCode" th:field="*{processCategoryCode}" class="form-control" type="text"> <input name="processCategoryCode" th:field="*{processCategoryCode}" class="form-control" type="text">
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">制程类别名称:</label>
<div class="col-sm-8">
<input name="processCategoryName" th:field="*{processCategoryName}" class="form-control" type="text">
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">制程描述:</label> <label class="col-sm-3 control-label">制程描述:</label>
<div class="col-sm-8"> <div class="col-sm-8">

43
ruoyi-admin/src/main/resources/templates/system/processCategory/processCategory.html

@ -64,14 +64,22 @@
checkbox: true checkbox: true
}, },
{ {
field: 'processCategoryId', title: '主键ID',
title: '制程类别id', field: 'id',
visible: false visible: false
}, },
{
field: 'processCategoryId',
title: '制程类别id'
},
{ {
field: 'processCategoryCode', field: 'processCategoryCode',
title: '制程类别编号' title: '制程类别编号'
}, },
{
field: 'processCategoryName',
title: '制程类别名称'
},
{ {
field: 'processDescription', field: 'processDescription',
title: '制程描述' title: '制程描述'
@ -88,29 +96,14 @@
field: 'actualProcessingCost', field: 'actualProcessingCost',
title: '财务实际加工费' title: '财务实际加工费'
}, },
{ {
field: 'firstAddTime', field: 'createTime',
title: '录入时间', title: '录入时间'
formatter: function (value, row, index) { },
if (value == null) { {
return " "; field: 'updateTime',
} else { title: '上次修改时间'
return value; }]
}
}
},
{
field: 'updateInfoTime',
title: '上次修改时间',
formatter: function (value, row, index) {
if (value == null) {
return " ";
} else {
var vArr = value.split(',')
return vArr[0];
}
}
}]
}; };
$.table.init(options); $.table.init(options);
}); });

Loading…
Cancel
Save