新增MES密炼物料替代对应关系及开炼机参数维护模块,包括相关实体、控制器、服务和映射器的实现,支持增删改查及数据验证功能。
This commit is contained in:
@@ -0,0 +1,172 @@
|
||||
package org.jeecg.modules.xslmes.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.mes.material.entity.MesMixerMaterial;
|
||||
import org.jeecg.modules.mes.material.service.IMesMixerMaterialService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerMaterialSubstitute;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixerMaterialSubstituteService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* MES 密炼物料替代对应关系
|
||||
*/
|
||||
@Tag(name = "MES密炼物料替代对应关系")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslMixerMaterialSubstitute")
|
||||
@Slf4j
|
||||
public class MesXslMixerMaterialSubstituteController
|
||||
extends JeecgController<MesXslMixerMaterialSubstitute, IMesXslMixerMaterialSubstituteService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslMixerMaterialSubstituteService mesXslMixerMaterialSubstituteService;
|
||||
|
||||
@Autowired
|
||||
private IMesMixerMaterialService mesMixerMaterialService;
|
||||
|
||||
@Operation(summary = "MES密炼物料替代对应关系-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslMixerMaterialSubstitute>> queryPageList(
|
||||
MesXslMixerMaterialSubstitute model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
customeRuleMap.put("mixerMaterialId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("substituteMaterialId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<MesXslMixerMaterialSubstitute> queryWrapper =
|
||||
QueryGenerator.initQueryWrapper(model, req.getParameterMap(), customeRuleMap);
|
||||
queryWrapper.orderByAsc("serial_no");
|
||||
Page<MesXslMixerMaterialSubstitute> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslMixerMaterialSubstitute> pageList = mesXslMixerMaterialSubstituteService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼物料替代对应关系-添加")
|
||||
@Operation(summary = "MES密炼物料替代对应关系-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslMixerMaterialSubstitute model) {
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
|
||||
String err = validateAndFillMaterials(model, false);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
|
||||
mesXslMixerMaterialSubstituteService.saveWithSerialNo(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼物料替代对应关系-编辑")
|
||||
@Operation(summary = "MES密炼物料替代对应关系-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslMixerMaterialSubstitute model) {
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
|
||||
String err = validateAndFillMaterials(model, true);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
|
||||
mesXslMixerMaterialSubstituteService.updateById(model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼物料替代对应关系-删除")
|
||||
@Operation(summary = "MES密炼物料替代对应关系-通过id删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslMixerMaterialSubstituteService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼物料替代对应关系-批量删除")
|
||||
@Operation(summary = "MES密炼物料替代对应关系-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslMixerMaterialSubstituteService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES密炼物料替代对应关系-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslMixerMaterialSubstitute> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslMixerMaterialSubstitute entity = mesXslMixerMaterialSubstituteService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslMixerMaterialSubstitute model) {
|
||||
return super.exportXls(request, model, MesXslMixerMaterialSubstitute.class, "密炼物料替代对应关系");
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslMixerMaterialSubstitute.class);
|
||||
}
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
|
||||
private String validateAndFillMaterials(MesXslMixerMaterialSubstitute model, boolean isUpdate) {
|
||||
if (oConvertUtils.isEmpty(model.getMixerMaterialId())) {
|
||||
return "请选择密炼物料";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getSubstituteMaterialId())) {
|
||||
return "请选择替代密炼物料";
|
||||
}
|
||||
if (model.getMixerMaterialId().equals(model.getSubstituteMaterialId())) {
|
||||
return "密炼物料与替代密炼物料不能相同";
|
||||
}
|
||||
|
||||
MesMixerMaterial mixerMaterial = mesMixerMaterialService.getById(model.getMixerMaterialId());
|
||||
if (mixerMaterial == null) {
|
||||
return "所选密炼物料不存在,请重新选择";
|
||||
}
|
||||
MesMixerMaterial substituteMaterial = mesMixerMaterialService.getById(model.getSubstituteMaterialId());
|
||||
if (substituteMaterial == null) {
|
||||
return "所选替代密炼物料不存在,请重新选择";
|
||||
}
|
||||
|
||||
model.setMixerMaterialCode(mixerMaterial.getMaterialCode());
|
||||
model.setMixerMaterialName(mixerMaterial.getMaterialName());
|
||||
model.setSubstituteMaterialCode(substituteMaterial.getMaterialCode());
|
||||
model.setSubstituteMaterialName(substituteMaterial.getMaterialName());
|
||||
|
||||
LambdaQueryWrapper<MesXslMixerMaterialSubstitute> dupQw = new LambdaQueryWrapper<>();
|
||||
dupQw.eq(MesXslMixerMaterialSubstitute::getMixerMaterialId, model.getMixerMaterialId())
|
||||
.eq(MesXslMixerMaterialSubstitute::getSubstituteMaterialId, model.getSubstituteMaterialId());
|
||||
if (isUpdate && oConvertUtils.isNotEmpty(model.getId())) {
|
||||
dupQw.ne(MesXslMixerMaterialSubstitute::getId, model.getId());
|
||||
}
|
||||
if (mesXslMixerMaterialSubstituteService.count(dupQw) > 0) {
|
||||
return "该密炼物料与替代密炼物料的对应关系已存在";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
package org.jeecg.modules.xslmes.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.mes.material.entity.MesMaterial;
|
||||
import org.jeecg.modules.mes.material.service.IMesMaterialService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslOpenMillParam;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslOpenMillParamService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* MES 开炼机参数维护
|
||||
*/
|
||||
@Tag(name = "MES开炼机参数维护")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslOpenMillParam")
|
||||
@Slf4j
|
||||
public class MesXslOpenMillParamController extends JeecgController<MesXslOpenMillParam, IMesXslOpenMillParamService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslOpenMillParamService mesXslOpenMillParamService;
|
||||
|
||||
@Autowired
|
||||
private IMesMaterialService mesMaterialService;
|
||||
|
||||
@Operation(summary = "MES开炼机参数维护-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslOpenMillParam>> queryPageList(
|
||||
MesXslOpenMillParam model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
customeRuleMap.put("materialId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<MesXslOpenMillParam> queryWrapper =
|
||||
QueryGenerator.initQueryWrapper(model, req.getParameterMap(), customeRuleMap);
|
||||
Page<MesXslOpenMillParam> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslOpenMillParam> pageList = mesXslOpenMillParamService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES开炼机参数维护-添加")
|
||||
@Operation(summary = "MES开炼机参数维护-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslOpenMillParam model) {
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【开炼机参数维护】保存前校验与胶料冗余回填-----------
|
||||
String err = validateAndFillMaterial(model);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【开炼机参数维护】保存前校验与胶料冗余回填-----------
|
||||
mesXslOpenMillParamService.save(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES开炼机参数维护-编辑")
|
||||
@Operation(summary = "MES开炼机参数维护-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslOpenMillParam model) {
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【开炼机参数维护】保存前校验与胶料冗余回填-----------
|
||||
String err = validateAndFillMaterial(model);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【开炼机参数维护】保存前校验与胶料冗余回填-----------
|
||||
mesXslOpenMillParamService.updateById(model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES开炼机参数维护-删除")
|
||||
@Operation(summary = "MES开炼机参数维护-通过id删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslOpenMillParamService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES开炼机参数维护-批量删除")
|
||||
@Operation(summary = "MES开炼机参数维护-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslOpenMillParamService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES开炼机参数维护-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslOpenMillParam> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslOpenMillParam entity = mesXslOpenMillParamService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslOpenMillParam model) {
|
||||
return super.exportXls(request, model, MesXslOpenMillParam.class, "开炼机参数维护");
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslOpenMillParam.class);
|
||||
}
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【开炼机参数维护】保存前校验与胶料冗余回填-----------
|
||||
private String validateAndFillMaterial(MesXslOpenMillParam model) {
|
||||
if (oConvertUtils.isEmpty(model.getMaterialId())) {
|
||||
return "请选择胶料";
|
||||
}
|
||||
MesMaterial material = mesMaterialService.getById(model.getMaterialId());
|
||||
if (material == null) {
|
||||
return "所选胶料不存在,请重新选择";
|
||||
}
|
||||
model.setMaterialName(material.getMaterialName());
|
||||
model.setMaterialCode(material.getMaterialCode());
|
||||
String timeErr = validateTimeFields(model);
|
||||
if (timeErr != null) {
|
||||
return timeErr;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String validateTimeFields(MesXslOpenMillParam model) {
|
||||
if (isNegative(model.getR0FeedTime())) {
|
||||
return "R0进胶时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR0RingTime())) {
|
||||
return "R0成环时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR0BreakTime())) {
|
||||
return "R0拉断时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR0DischargeTime())) {
|
||||
return "R0排胶时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR1FeedTime())) {
|
||||
return "R1进胶时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR1RingTime())) {
|
||||
return "R1成环时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR1BreakTime())) {
|
||||
return "R1拉断时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR1DischargeTime())) {
|
||||
return "R1排胶时间不能为负数";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean isNegative(BigDecimal value) {
|
||||
return value != null && value.compareTo(BigDecimal.ZERO) < 0;
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【开炼机参数维护】保存前校验与胶料冗余回填-----------
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* MES 密炼物料替代对应关系
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_mixer_material_substitute")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES密炼物料替代对应关系")
|
||||
public class MesXslMixerMaterialSubstitute implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Excel(name = "编号", width = 10)
|
||||
@Schema(description = "编号(租户内自动累加,从1开始)")
|
||||
private Integer serialNo;
|
||||
|
||||
@Excel(name = "密炼物料ID", width = 15, dictTable = "mes_mixer_material", dicText = "material_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_mixer_material", dicText = "material_name", dicCode = "id")
|
||||
@Schema(description = "密炼物料ID(关联 mes_mixer_material.id)")
|
||||
private String mixerMaterialId;
|
||||
|
||||
@Excel(name = "密炼物料编码", width = 15)
|
||||
@Schema(description = "密炼物料编码冗余")
|
||||
private String mixerMaterialCode;
|
||||
|
||||
@Excel(name = "密炼物料名称", width = 20)
|
||||
@Schema(description = "密炼物料名称冗余")
|
||||
private String mixerMaterialName;
|
||||
|
||||
@Excel(name = "替代密炼物料ID", width = 15, dictTable = "mes_mixer_material", dicText = "material_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_mixer_material", dicText = "material_name", dicCode = "id")
|
||||
@Schema(description = "替代密炼物料ID(关联 mes_mixer_material.id)")
|
||||
private String substituteMaterialId;
|
||||
|
||||
@Excel(name = "替代密炼物料编码", width = 15)
|
||||
@Schema(description = "替代密炼物料编码冗余")
|
||||
private String substituteMaterialCode;
|
||||
|
||||
@Excel(name = "替代密炼物料名称", width = 20)
|
||||
@Schema(description = "替代密炼物料名称冗余")
|
||||
private String substituteMaterialName;
|
||||
|
||||
@Excel(name = "创建人", width = 15)
|
||||
private String createBy;
|
||||
|
||||
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@Excel(name = "修改人", width = 15)
|
||||
private String updateBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
|
||||
private String sysOrgCode;
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* MES 开炼机参数维护
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_open_mill_param")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES开炼机参数维护")
|
||||
public class MesXslOpenMillParam implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Excel(name = "胶料ID", width = 15, dictTable = "mes_material", dicText = "material_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_material", dicText = "material_name", dicCode = "id")
|
||||
@Schema(description = "胶料ID(关联 mes_material.id)")
|
||||
private String materialId;
|
||||
|
||||
@Excel(name = "胶料名称", width = 20)
|
||||
@Schema(description = "胶料名称冗余")
|
||||
private String materialName;
|
||||
|
||||
@Excel(name = "胶料编码", width = 15)
|
||||
@Schema(description = "胶料编码冗余")
|
||||
private String materialCode;
|
||||
|
||||
@Excel(name = "R0进胶时间(秒)", width = 14)
|
||||
@Schema(description = "R0进胶时间(秒)")
|
||||
private BigDecimal r0FeedTime;
|
||||
|
||||
@Excel(name = "R0成环时间(秒)", width = 14)
|
||||
@Schema(description = "R0成环时间(秒)")
|
||||
private BigDecimal r0RingTime;
|
||||
|
||||
@Excel(name = "R0拉断时间(秒)", width = 14)
|
||||
@Schema(description = "R0拉断时间(秒)")
|
||||
private BigDecimal r0BreakTime;
|
||||
|
||||
@Excel(name = "R0排胶时间(秒)", width = 14)
|
||||
@Schema(description = "R0排胶时间(秒)")
|
||||
private BigDecimal r0DischargeTime;
|
||||
|
||||
@Excel(name = "R1进胶时间(秒)", width = 14)
|
||||
@Schema(description = "R1进胶时间(秒)")
|
||||
private BigDecimal r1FeedTime;
|
||||
|
||||
@Excel(name = "R1成环时间(秒)", width = 14)
|
||||
@Schema(description = "R1成环时间(秒)")
|
||||
private BigDecimal r1RingTime;
|
||||
|
||||
@Excel(name = "R1拉断时间(秒)", width = 14)
|
||||
@Schema(description = "R1拉断时间(秒)")
|
||||
private BigDecimal r1BreakTime;
|
||||
|
||||
@Excel(name = "R1排胶时间(秒)", width = 14)
|
||||
@Schema(description = "R1排胶时间(秒)")
|
||||
private BigDecimal r1DischargeTime;
|
||||
|
||||
@Excel(name = "创建人", width = 15)
|
||||
private String createBy;
|
||||
|
||||
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@Excel(name = "修改人", width = 15)
|
||||
private String updateBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
|
||||
private String sysOrgCode;
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerMaterialSubstitute;
|
||||
|
||||
/**
|
||||
* MES 密炼物料替代对应关系 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface MesXslMixerMaterialSubstituteMapper extends BaseMapper<MesXslMixerMaterialSubstitute> {
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】查询租户内最大编号-----------
|
||||
@Select("SELECT IFNULL(MAX(serial_no), 0) FROM mes_xsl_mixer_material_substitute "
|
||||
+ "WHERE del_flag = 0 AND (#{tenantId} IS NULL OR tenant_id = #{tenantId})")
|
||||
Integer selectMaxSerialNo(@Param("tenantId") Integer tenantId);
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】查询租户内最大编号-----------
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslOpenMillParam;
|
||||
|
||||
/**
|
||||
* MES 开炼机参数维护 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface MesXslOpenMillParamMapper extends BaseMapper<MesXslOpenMillParam> {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?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="org.jeecg.modules.xslmes.mapper.MesXslOpenMillParamMapper">
|
||||
</mapper>
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.jeecg.modules.xslmes.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerMaterialSubstitute;
|
||||
|
||||
/**
|
||||
* MES 密炼物料替代对应关系
|
||||
*/
|
||||
public interface IMesXslMixerMaterialSubstituteService extends IService<MesXslMixerMaterialSubstitute> {
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】新增时分配编号-----------
|
||||
/**
|
||||
* 新增保存(自动分配租户内递增编号)
|
||||
*/
|
||||
boolean saveWithSerialNo(MesXslMixerMaterialSubstitute entity);
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】新增时分配编号-----------
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package org.jeecg.modules.xslmes.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslOpenMillParam;
|
||||
|
||||
/**
|
||||
* MES 开炼机参数维护
|
||||
*/
|
||||
public interface IMesXslOpenMillParamService extends IService<MesXslOpenMillParam> {
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerMaterialSubstitute;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslMixerMaterialSubstituteMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixerMaterialSubstituteService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* MES 密炼物料替代对应关系
|
||||
*/
|
||||
@Service
|
||||
public class MesXslMixerMaterialSubstituteServiceImpl
|
||||
extends ServiceImpl<MesXslMixerMaterialSubstituteMapper, MesXslMixerMaterialSubstitute>
|
||||
implements IMesXslMixerMaterialSubstituteService {
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】新增时分配编号-----------
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean saveWithSerialNo(MesXslMixerMaterialSubstitute entity) {
|
||||
if (entity.getSerialNo() == null) {
|
||||
Integer maxSerial = baseMapper.selectMaxSerialNo(entity.getTenantId());
|
||||
entity.setSerialNo(maxSerial == null ? 1 : maxSerial + 1);
|
||||
}
|
||||
return save(entity);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】新增时分配编号-----------
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslOpenMillParam;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslOpenMillParamMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslOpenMillParamService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* MES 开炼机参数维护
|
||||
*/
|
||||
@Service
|
||||
public class MesXslOpenMillParamServiceImpl extends ServiceImpl<MesXslOpenMillParamMapper, MesXslOpenMillParam>
|
||||
implements IMesXslOpenMillParamService {
|
||||
}
|
||||
Reference in New Issue
Block a user