工艺建模
This commit is contained in:
parent
2092cf7f42
commit
091f307764
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"java.compile.nullAnalysis.mode": "automatic"
|
||||
}
|
||||
@ -0,0 +1,162 @@
|
||||
package com.neu.carbon.mes.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.neu.carbon.wms.domain.WmsMaterialInfo;
|
||||
import com.neu.carbon.wms.service.IWmsMaterialInfoService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.github.xiaoymin.knife4j.annotations.DynamicParameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.DynamicResponseParameters;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.neu.common.annotation.Log;
|
||||
import com.neu.common.core.controller.BaseController;
|
||||
import com.neu.common.core.domain.AjaxResult;
|
||||
import com.neu.common.enums.BusinessType;
|
||||
import com.neu.carbon.mes.domain.MesProcessModel;
|
||||
import com.neu.carbon.mes.service.IMesProcessModelService;
|
||||
import com.neu.common.utils.poi.ExcelUtil;
|
||||
import com.neu.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 工艺建模Controller
|
||||
*
|
||||
* @author neuedu
|
||||
* @date 2024-11-24
|
||||
*/
|
||||
@Api(tags = {"工艺建模"})
|
||||
@RestController
|
||||
@RequestMapping("/mesModel/processModel")
|
||||
public class MesProcessModelController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMesProcessModelService mesProcessModelService;
|
||||
|
||||
//wms物料信息
|
||||
@Autowired
|
||||
private IWmsMaterialInfoService wmsMaterialInfoService;
|
||||
|
||||
/**
|
||||
* 查询工艺建模列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询工艺建模列表")
|
||||
@DynamicResponseParameters(properties = {
|
||||
@DynamicParameter(name = "total", value = "总记录数"),
|
||||
@DynamicParameter(name = "code", value = "状态码,200正确,其他错误"),
|
||||
@DynamicParameter(name = "rows", value = "返回业务数据(数组类型)", dataTypeClass = MesProcessModel.class),
|
||||
@DynamicParameter(name = "msg", value = "返回消息内容")
|
||||
})
|
||||
public TableDataInfo list(MesProcessModel mesProcessModel)
|
||||
{
|
||||
startPage();
|
||||
List<MesProcessModel> list = mesProcessModelService.selectMesProcessModelList(mesProcessModel);
|
||||
|
||||
list.forEach(materia -> {
|
||||
WmsMaterialInfo wmsMaterialInfo = wmsMaterialInfoService.selectWmsMaterialInfoById(materia.getMaterialId());
|
||||
if (wmsMaterialInfo != null) {
|
||||
materia.setMaterialIName(wmsMaterialInfo.getName());
|
||||
materia.setMaterialModel(wmsMaterialInfo.getModel());
|
||||
}
|
||||
});
|
||||
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出工艺建模列表
|
||||
*/
|
||||
@ApiOperation("导出工艺建模列表")
|
||||
@DynamicResponseParameters(properties = {
|
||||
@DynamicParameter(name = "code", value = "状态码,200正确,其他错误"),
|
||||
@DynamicParameter(name = "msg", value = "文件名")
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermi('mesModel:processModel:export')")
|
||||
@Log(title = "工艺建模", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(MesProcessModel mesProcessModel)
|
||||
{
|
||||
List<MesProcessModel> list = mesProcessModelService.selectMesProcessModelList(mesProcessModel);
|
||||
ExcelUtil<MesProcessModel> util = new ExcelUtil<MesProcessModel>(MesProcessModel.class);
|
||||
return util.exportExcel(list, "processModel");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工艺建模详细信息
|
||||
*/
|
||||
@ApiOperation("获取工艺建模详细信息")
|
||||
@DynamicResponseParameters(properties = {
|
||||
@DynamicParameter(name = "code", value = "状态码,200正确,其他错误"),
|
||||
@DynamicParameter(name = "data", value = "返回业务数据", dataTypeClass = MesProcessModel.class),
|
||||
@DynamicParameter(name = "msg", value = "返回消息内容")
|
||||
})
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
MesProcessModel materia = mesProcessModelService.selectMesProcessModelById(id);
|
||||
|
||||
WmsMaterialInfo wmsMaterialInfo = wmsMaterialInfoService.selectWmsMaterialInfoById(materia.getMaterialId());
|
||||
if (wmsMaterialInfo != null) {
|
||||
materia.setMaterialIName(wmsMaterialInfo.getName());
|
||||
materia.setMaterialModel(wmsMaterialInfo.getModel());
|
||||
}
|
||||
return AjaxResult.success(materia);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增工艺建模
|
||||
*/
|
||||
@ApiOperation("新增工艺建模")
|
||||
@DynamicResponseParameters(properties = {
|
||||
@DynamicParameter(name = "code", value = "状态码,200正确,其他错误"),
|
||||
@DynamicParameter(name = "msg", value = "返回消息内容")
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermi('mesModel:processModel:add')")
|
||||
@Log(title = "工艺建模", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MesProcessModel mesProcessModel)
|
||||
{
|
||||
return toAjax(mesProcessModelService.insertMesProcessModel(mesProcessModel));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改工艺建模
|
||||
*/
|
||||
@ApiOperation("修改工艺建模")
|
||||
@DynamicResponseParameters(properties = {
|
||||
@DynamicParameter(name = "code", value = "状态码,200正确,其他错误"),
|
||||
@DynamicParameter(name = "msg", value = "返回消息内容")
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermi('mesModel:processModel:edit')")
|
||||
@Log(title = "工艺建模", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MesProcessModel mesProcessModel)
|
||||
{
|
||||
return toAjax(mesProcessModelService.updateMesProcessModel(mesProcessModel));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除工艺建模
|
||||
*/
|
||||
@ApiOperation("删除工艺建模")
|
||||
@DynamicResponseParameters(properties = {
|
||||
@DynamicParameter(name = "code", value = "状态码,200正确,其他错误"),
|
||||
@DynamicParameter(name = "msg", value = "返回消息内容")
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermi('mesModel:processModel:remove')")
|
||||
@Log(title = "工艺建模", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(mesProcessModelService.deleteMesProcessModelByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,129 @@
|
||||
package com.neu.carbon.mes.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.neu.common.annotation.Excel;
|
||||
import com.neu.common.core.domain.BaseEntity;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* 工艺建模对象 mes_process_model
|
||||
*
|
||||
* @author neuedu
|
||||
* @date 2024-11-24
|
||||
*/
|
||||
@ApiModel("工艺建模")
|
||||
public class MesProcessModel extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 编号 */
|
||||
@ApiModelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
/** 物料档案编号 */
|
||||
@ApiModelProperty("物料档案编号")
|
||||
@Excel(name = "物料档案编号")
|
||||
private Long materialId;
|
||||
|
||||
/** 物料档案名称 */
|
||||
@ApiModelProperty("物料档案名称")
|
||||
@Excel(name = "物料档案名称")
|
||||
private String materialIName;
|
||||
|
||||
/** 物料档案型号 */
|
||||
@ApiModelProperty("物料档案型号")
|
||||
@Excel(name = "物料档案型号")
|
||||
private String materialModel;
|
||||
|
||||
/** 工艺名称 */
|
||||
@ApiModelProperty("工艺名称")
|
||||
@Excel(name = "工艺名称")
|
||||
private String processName;
|
||||
|
||||
/** 工艺描述 */
|
||||
@ApiModelProperty("工艺描述")
|
||||
@Excel(name = "工艺描述")
|
||||
private String description;
|
||||
|
||||
/** 单位耗电量 */
|
||||
@ApiModelProperty("单位耗电量")
|
||||
@Excel(name = "单位耗电量")
|
||||
private Long powerConsume;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setMaterialId(Long materialId)
|
||||
{
|
||||
this.materialId = materialId;
|
||||
}
|
||||
|
||||
public Long getMaterialId()
|
||||
{
|
||||
return materialId;
|
||||
}
|
||||
public void setProcessName(String processName)
|
||||
{
|
||||
this.processName = processName;
|
||||
}
|
||||
|
||||
public String getProcessName()
|
||||
{
|
||||
return processName;
|
||||
}
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
public void setPowerConsume(Long powerConsume)
|
||||
{
|
||||
this.powerConsume = powerConsume;
|
||||
}
|
||||
|
||||
public Long getPowerConsume()
|
||||
{
|
||||
return powerConsume;
|
||||
}
|
||||
|
||||
public String getMaterialIName() {
|
||||
return materialIName;
|
||||
}
|
||||
|
||||
public void setMaterialIName(String materialIName) {
|
||||
this.materialIName = materialIName;
|
||||
}
|
||||
|
||||
public String getMaterialModel() {
|
||||
return materialModel;
|
||||
}
|
||||
|
||||
public void setMaterialModel(String materialModel) {
|
||||
this.materialModel = materialModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("materialId", getMaterialId())
|
||||
.append("processName", getProcessName())
|
||||
.append("description", getDescription())
|
||||
.append("powerConsume", getPowerConsume())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.neu.carbon.mes.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.neu.carbon.mes.domain.MesProcessModel;
|
||||
|
||||
/**
|
||||
* 工艺建模Mapper接口
|
||||
*
|
||||
* @author neuedu
|
||||
* @date 2024-11-24
|
||||
*/
|
||||
public interface MesProcessModelMapper
|
||||
{
|
||||
/**
|
||||
* 查询工艺建模
|
||||
*
|
||||
* @param id 工艺建模ID
|
||||
* @return 工艺建模
|
||||
*/
|
||||
public MesProcessModel selectMesProcessModelById(Long id);
|
||||
|
||||
/**
|
||||
* 查询工艺建模列表
|
||||
*
|
||||
* @param mesProcessModel 工艺建模
|
||||
* @return 工艺建模集合
|
||||
*/
|
||||
public List<MesProcessModel> selectMesProcessModelList(MesProcessModel mesProcessModel);
|
||||
|
||||
/**
|
||||
* 新增工艺建模
|
||||
*
|
||||
* @param mesProcessModel 工艺建模
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesProcessModel(MesProcessModel mesProcessModel);
|
||||
|
||||
/**
|
||||
* 修改工艺建模
|
||||
*
|
||||
* @param mesProcessModel 工艺建模
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesProcessModel(MesProcessModel mesProcessModel);
|
||||
|
||||
/**
|
||||
* 删除工艺建模
|
||||
*
|
||||
* @param id 工艺建模ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesProcessModelById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除工艺建模
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesProcessModelByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.neu.carbon.mes.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.neu.carbon.mes.domain.MesProcessModel;
|
||||
|
||||
/**
|
||||
* 工艺建模Service接口
|
||||
*
|
||||
* @author neuedu
|
||||
* @date 2024-11-24
|
||||
*/
|
||||
public interface IMesProcessModelService
|
||||
{
|
||||
/**
|
||||
* 查询工艺建模
|
||||
*
|
||||
* @param id 工艺建模ID
|
||||
* @return 工艺建模
|
||||
*/
|
||||
public MesProcessModel selectMesProcessModelById(Long id);
|
||||
|
||||
/**
|
||||
* 查询工艺建模列表
|
||||
*
|
||||
* @param mesProcessModel 工艺建模
|
||||
* @return 工艺建模集合
|
||||
*/
|
||||
public List<MesProcessModel> selectMesProcessModelList(MesProcessModel mesProcessModel);
|
||||
|
||||
/**
|
||||
* 新增工艺建模
|
||||
*
|
||||
* @param mesProcessModel 工艺建模
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesProcessModel(MesProcessModel mesProcessModel);
|
||||
|
||||
/**
|
||||
* 修改工艺建模
|
||||
*
|
||||
* @param mesProcessModel 工艺建模
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesProcessModel(MesProcessModel mesProcessModel);
|
||||
|
||||
/**
|
||||
* 批量删除工艺建模
|
||||
*
|
||||
* @param ids 需要删除的工艺建模ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesProcessModelByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除工艺建模信息
|
||||
*
|
||||
* @param id 工艺建模ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesProcessModelById(Long id);
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
package com.neu.carbon.mes.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.neu.carbon.mes.mapper.MesProcessModelMapper;
|
||||
import com.neu.carbon.mes.domain.MesProcessModel;
|
||||
import com.neu.carbon.mes.service.IMesProcessModelService;
|
||||
|
||||
/**
|
||||
* 工艺建模Service业务层处理
|
||||
*
|
||||
* @author neuedu
|
||||
* @date 2024-11-24
|
||||
*/
|
||||
@Service
|
||||
public class MesProcessModelServiceImpl implements IMesProcessModelService
|
||||
{
|
||||
@Autowired
|
||||
private MesProcessModelMapper mesProcessModelMapper;
|
||||
|
||||
/**
|
||||
* 查询工艺建模
|
||||
*
|
||||
* @param id 工艺建模ID
|
||||
* @return 工艺建模
|
||||
*/
|
||||
@Override
|
||||
public MesProcessModel selectMesProcessModelById(Long id)
|
||||
{
|
||||
return mesProcessModelMapper.selectMesProcessModelById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询工艺建模列表
|
||||
*
|
||||
* @param mesProcessModel 工艺建模
|
||||
* @return 工艺建模
|
||||
*/
|
||||
@Override
|
||||
public List<MesProcessModel> selectMesProcessModelList(MesProcessModel mesProcessModel)
|
||||
{
|
||||
return mesProcessModelMapper.selectMesProcessModelList(mesProcessModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增工艺建模
|
||||
*
|
||||
* @param mesProcessModel 工艺建模
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMesProcessModel(MesProcessModel mesProcessModel)
|
||||
{
|
||||
return mesProcessModelMapper.insertMesProcessModel(mesProcessModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改工艺建模
|
||||
*
|
||||
* @param mesProcessModel 工艺建模
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMesProcessModel(MesProcessModel mesProcessModel)
|
||||
{
|
||||
return mesProcessModelMapper.updateMesProcessModel(mesProcessModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除工艺建模
|
||||
*
|
||||
* @param ids 需要删除的工艺建模ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMesProcessModelByIds(Long[] ids)
|
||||
{
|
||||
return mesProcessModelMapper.deleteMesProcessModelByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除工艺建模信息
|
||||
*
|
||||
* @param id 工艺建模ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMesProcessModelById(Long id)
|
||||
{
|
||||
return mesProcessModelMapper.deleteMesProcessModelById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
<?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.neu.carbon.mes.mapper.MesProcessModelMapper">
|
||||
|
||||
<resultMap type="MesProcessModel" id="MesProcessModelResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="processName" column="process_name" />
|
||||
<result property="description" column="description" />
|
||||
<result property="powerConsume" column="power_consume" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMesProcessModelVo">
|
||||
select id, material_id, process_name, description, power_consume, remark from mes_process_model
|
||||
</sql>
|
||||
|
||||
<select id="selectMesProcessModelList" parameterType="MesProcessModel" resultMap="MesProcessModelResult">
|
||||
<include refid="selectMesProcessModelVo"/>
|
||||
<where>
|
||||
<if test="materialId != null "> and material_id = #{materialId}</if>
|
||||
<if test="processName != null and processName != ''"> and process_name like concat('%', #{processName}, '%')</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
<if test="powerConsume != null "> and power_consume = #{powerConsume}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMesProcessModelById" parameterType="Long" resultMap="MesProcessModelResult">
|
||||
<include refid="selectMesProcessModelVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertMesProcessModel" parameterType="MesProcessModel" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into mes_process_model
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="materialId != null">material_id,</if>
|
||||
<if test="processName != null and processName != ''">process_name,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="powerConsume != null">power_consume,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="materialId != null">#{materialId},</if>
|
||||
<if test="processName != null and processName != ''">#{processName},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="powerConsume != null">#{powerConsume},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMesProcessModel" parameterType="MesProcessModel">
|
||||
update mes_process_model
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="materialId != null">material_id = #{materialId},</if>
|
||||
<if test="processName != null and processName != ''">process_name = #{processName},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="powerConsume != null">power_consume = #{powerConsume},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMesProcessModelById" parameterType="Long">
|
||||
delete from mes_process_model where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesProcessModelByIds" parameterType="String">
|
||||
delete from mes_process_model where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
BIN
neu-carbon-wms.zip
Normal file
BIN
neu-carbon-wms.zip
Normal file
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user