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. 88
      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}")
public String edit(@PathVariable("processCategoryId") Long processCategoryId, ModelMap mmap)
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
SysProcessCategory sysProcessCategory = sysProcessCategoryService.selectSysProcessCategoryById(processCategoryId);
SysProcessCategory sysProcessCategory = sysProcessCategoryService.selectSysProcessCategoryById(id);
mmap.put("sysProcessCategory", sysProcessCategory);
return prefix + "/edit";
}

88
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;
/** 主键ID */
private Long id;
/** 删除标志(0代表存在 1代表删除) */
private String delFlag;
/** 制程类别id */
private Long processCategoryId;
private String processCategoryId;
/** 制程类别编号 */
@Excel(name = "制程类别编号")
private String processCategoryCode;
/** 制程类别名称 */
@Excel(name = "制程类别名称")
private String processCategoryName;
/** 制程描述 */
@Excel(name = "制程描述")
private String processDescription;
@ -38,24 +48,28 @@ public class SysProcessCategory extends BaseEntity
@Excel(name = "财务实际加工费")
private String actualProcessingCost;
/** 录入时间 */
private String firstAddTime;
public Long getId() {
return id;
}
/** 修改时间 */
private String updateInfoTime;
public void setId(Long id) {
this.id = id;
}
/** 备用一 */
private String standbyOne;
public String getDelFlag() {
return delFlag;
}
/** 备用二 */
private String standbyTwo;
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public void setProcessCategoryId(Long processCategoryId)
public void setProcessCategoryId(String processCategoryId)
{
this.processCategoryId = processCategoryId;
}
public Long getProcessCategoryId()
public String getProcessCategoryId()
{
return processCategoryId;
}
@ -68,6 +82,15 @@ public class SysProcessCategory extends BaseEntity
{
return processCategoryCode;
}
public String getProcessCategoryName() {
return processCategoryName;
}
public void setProcessCategoryName(String processCategoryName) {
this.processCategoryName = processCategoryName;
}
public void setProcessDescription(String processDescription)
{
this.processDescription = processDescription;
@ -104,56 +127,19 @@ public class SysProcessCategory extends BaseEntity
{
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
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("delFlag", getDelFlag())
.append("processCategoryId", getProcessCategoryId())
.append("processCategoryCode", getProcessCategoryCode())
.append("processCategoryName", getProcessCategoryName())
.append("processDescription", getProcessDescription())
.append("workHourOutput", getWorkHourOutput())
.append("standardConversionCost", getStandardConversionCost())
.append("actualProcessingCost", getActualProcessingCost())
.append("firstAddTime", getFirstAddTime())
.append("updateInfoTime", getUpdateInfoTime())
.append("standbyOne", getStandbyOne())
.append("standbyTwo", getStandbyTwo())
.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 结果
*/
public int deleteSysProcessCategoryById(Long processCategoryId);
public int deleteSysProcessCategoryById(Long id);
/**
* 批量删除制程类别明细
*
* @param processCategoryIds 需要删除的数据ID
* @param ids 需要删除的数据ID
* @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;
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.stereotype.Service;
import com.ruoyi.system.mapper.SysProcessCategoryMapper;
@ -20,16 +24,19 @@ public class SysProcessCategoryServiceImpl implements ISysProcessCategoryService
@Autowired
private SysProcessCategoryMapper sysProcessCategoryMapper;
@Autowired
private RedisCache redisCache;
/**
* 查询制程类别明细
*
* @param processCategoryId 制程类别明细ID
* @param id 主键id
* @return 制程类别明细
*/
@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
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);
}
@ -65,6 +78,9 @@ public class SysProcessCategoryServiceImpl implements ISysProcessCategoryService
@Override
public int updateSysProcessCategory(SysProcessCategory sysProcessCategory)
{
String loginName = ShiroUtils.getLoginName();
sysProcessCategory.setUpdateBy(loginName);
sysProcessCategory.setUpdateTime(DateUtils.getNowDate());
return sysProcessCategoryMapper.updateSysProcessCategory(sysProcessCategory);
}
@ -83,12 +99,12 @@ public class SysProcessCategoryServiceImpl implements ISysProcessCategoryService
/**
* 删除制程类别明细信息
*
* @param processCategoryId 制程类别明细ID
* @param id 主键id
* @return 结果
*/
@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">
<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="processCategoryCode" column="process_category_code" />
<result property="processCategoryName" column="process_category_name" />
<result property="processDescription" column="process_description" />
<result property="workHourOutput" column="work_hour_output" />
<result property="standardConversionCost" column="standard_conversion_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>
<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>
<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">
<include refid="selectSysProcessCategoryVo"/>
where process_category_id = #{processCategoryId}
where id = #{id}
</select>
<insert id="insertSysProcessCategory" parameterType="SysProcessCategory" useGeneratedKeys="true" keyProperty="processCategoryId">
insert into sys_process_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="processCategoryId != null">process_category_id,</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="workHourOutput != null">work_hour_output,</if>
<if test="standardConversionCost != null">standard_conversion_cost,</if>
<if test="actualProcessingCost != null">actual_processing_cost,</if>
<if test="standbyOne != null">standby_one,</if>
<if test="standbyTwo != null">standby_two,</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="processCategoryId != null">#{processCategoryId},</if>
<if test="processCategoryCode != null">#{processCategoryCode},</if>
<if test="processCategoryName != null">#{processCategoryName},</if>
<if test="processDescription != null">#{processDescription},</if>
<if test="workHourOutput != null">#{workHourOutput},</if>
<if test="standardConversionCost != null">#{standardConversionCost},</if>
<if test="actualProcessingCost != null">#{actualProcessingCost},</if>
<if test="standbyOne != null">#{standbyOne},</if>
<if test="standbyTwo != null">#{standbyTwo},</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>
@ -62,25 +76,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update sys_process_category
<trim prefix="SET" suffixOverrides=",">
<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="workHourOutput != null">work_hour_output = #{workHourOutput},</if>
<if test="standardConversionCost != null">standard_conversion_cost = #{standardConversionCost},</if>
<if test="actualProcessingCost != null">actual_processing_cost = #{actualProcessingCost},</if>
<if test="standbyOne != null">standby_one = #{standbyOne},</if>
<if test="standbyTwo != null">standby_two = #{standbyTwo},</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 process_category_id = #{processCategoryId}
where id = #{id}
</update>
<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 id="deleteSysProcessCategoryByIds" parameterType="String">
delete from sys_process_category where process_category_id in
<foreach item="processCategoryId" collection="array" open="(" separator="," close=")">
#{processCategoryId}
delete from sys_process_category where id in
<foreach item="item" collection="array" open="(" separator="," close=")">
#{item}
</foreach>
</delete>

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

@ -12,6 +12,12 @@
<input name="processCategoryCode" 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="processCategoryName" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">制程描述:</label>
<div class="col-sm-8">

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

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

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

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

Loading…
Cancel
Save