新增MES混炼示方模块,包括主表及子表结构、控制器、服务和映射器的实现,支持增删改查功能,优化数据验证和用户体验,增强系统稳定性。
This commit is contained in:
@@ -111,3 +111,24 @@ jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslFormulaSpecService.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixerPsCompileServiceImpl.java
|
||||
|
||||
-- author:cursor---date:20260522--for: 【XSLMES-20260522-A17】新增MES技术管理-混炼示方1主4子表及紧凑页 ---
|
||||
jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_98__mes_xsl_mixing_spec.sql
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslMixingSpec.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslMixingSpecMaterial.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslMixingSpecStep.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslMixingSpecDownStep.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslMixingSpecTcu.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/vo/MesXslMixingSpecPage.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslMixingSpecMapper.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslMixingSpecMaterialMapper.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslMixingSpecStepMapper.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslMixingSpecDownStepMapper.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslMixingSpecTcuMapper.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslMixingSpecService.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixingSpecServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslMixingSpecController.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpecList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingSpecModal.vue
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
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.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
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.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpec;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixingSpecService;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslMixingSpecPage;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
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/mesXslMixingSpec")
|
||||
public class MesXslMixingSpecController extends JeecgController<MesXslMixingSpec, IMesXslMixingSpecService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslMixingSpecService mesXslMixingSpecService;
|
||||
|
||||
@Operation(summary = "MES混炼示方-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslMixingSpec>> queryPageList(
|
||||
MesXslMixingSpec model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(name = "keyword", required = false) String keyword,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslMixingSpec> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
//update-begin---author:cursor ---date:20260522 for:【XSLMES-20260522-A17】混炼示方列表关键字查询-----------
|
||||
if (oConvertUtils.isNotEmpty(keyword)) {
|
||||
queryWrapper.and(w -> w.like("spec_name", keyword).or().like("issue_number", keyword).or().like("purpose", keyword).or().like("machine_name", keyword));
|
||||
}
|
||||
//update-end---author:cursor ---date:20260522 for:【XSLMES-20260522-A17】混炼示方列表关键字查询-----------
|
||||
queryWrapper.orderByDesc("update_time").orderByDesc("create_time");
|
||||
Page<MesXslMixingSpec> page = new Page<>(pageNo, pageSize);
|
||||
return Result.OK(mesXslMixingSpecService.page(page, queryWrapper));
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES混炼示方-添加")
|
||||
@Operation(summary = "MES混炼示方-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixing_spec:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslMixingSpecPage page) {
|
||||
String err = validateMain(page);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
MesXslMixingSpec main = new MesXslMixingSpec();
|
||||
BeanUtils.copyProperties(page, main);
|
||||
mesXslMixingSpecService.saveMain(main, page.getMaterialList(), page.getStepList(), page.getDownStepList(), page.getTcuList());
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES混炼示方-编辑")
|
||||
@Operation(summary = "MES混炼示方-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixing_spec:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslMixingSpecPage page) {
|
||||
String err = validateMain(page);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
MesXslMixingSpec main = new MesXslMixingSpec();
|
||||
BeanUtils.copyProperties(page, main);
|
||||
mesXslMixingSpecService.updateMain(main, page.getMaterialList(), page.getStepList(), page.getDownStepList(), page.getTcuList());
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES混炼示方-删除")
|
||||
@Operation(summary = "MES混炼示方-通过id删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixing_spec:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslMixingSpecService.delMain(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES混炼示方-批量删除")
|
||||
@Operation(summary = "MES混炼示方-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixing_spec:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslMixingSpecService.delBatchMain(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES混炼示方-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslMixingSpecPage> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslMixingSpecPage page = mesXslMixingSpecService.queryPageById(id);
|
||||
if (page == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(page);
|
||||
}
|
||||
|
||||
@Operation(summary = "MES混炼示方-发行编号候选")
|
||||
@GetMapping(value = "/queryIssueNumberOptions")
|
||||
public Result<List<Map<String, String>>> queryIssueNumberOptions(
|
||||
@RequestParam(name = "keyword", required = false) String keyword) {
|
||||
return Result.OK(mesXslMixingSpecService.queryIssueNumberOptions(keyword));
|
||||
}
|
||||
|
||||
@Operation(summary = "MES混炼示方-用途候选")
|
||||
@GetMapping(value = "/queryPurposeOptions")
|
||||
public Result<List<Map<String, String>>> queryPurposeOptions(
|
||||
@RequestParam(name = "keyword", required = false) String keyword) {
|
||||
return Result.OK(mesXslMixingSpecService.queryPurposeOptions(keyword));
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixing_spec:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslMixingSpec model) {
|
||||
return super.exportXls(request, model, MesXslMixingSpec.class, "混炼示方");
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixing_spec:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslMixingSpec.class);
|
||||
}
|
||||
|
||||
//update-begin---author:cursor ---date:20260522 for:【XSLMES-20260522-A17】混炼示方主子保存校验-----------
|
||||
private String validateMain(MesXslMixingSpecPage page) {
|
||||
if (oConvertUtils.isEmpty(page.getSpecName())) {
|
||||
return "请填写规格";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(page.getPurpose())) {
|
||||
return "请选择用途";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(page.getIssueNumber())) {
|
||||
return "请选择发行编号";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
//update-end---author:cursor ---date:20260522 for:【XSLMES-20260522-A17】混炼示方主子保存校验-----------
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
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.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* MES 混炼示方主表
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_mixing_spec")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES混炼示方")
|
||||
public class MesXslMixingSpec implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
|
||||
@Excel(name = "规格", width = 16)
|
||||
@Schema(description = "规格")
|
||||
private String specName;
|
||||
|
||||
@Excel(name = "用途", width = 24)
|
||||
@Schema(description = "用途")
|
||||
private String purpose;
|
||||
|
||||
@Schema(description = "机台ID")
|
||||
private String machineId;
|
||||
|
||||
@Excel(name = "机台", width = 14)
|
||||
@Schema(description = "机台")
|
||||
private String machineName;
|
||||
|
||||
@Excel(name = "制作日期", width = 14, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Schema(description = "制作日期")
|
||||
private Date makeDate;
|
||||
|
||||
@Excel(name = "发行编号", width = 16)
|
||||
@Schema(description = "发行编号")
|
||||
private String issueNumber;
|
||||
|
||||
@Schema(description = "换算系数")
|
||||
private BigDecimal convertFactor;
|
||||
|
||||
@Schema(description = "填充体积")
|
||||
private BigDecimal fillVolume;
|
||||
|
||||
@Schema(description = "回收炭黑(秒)")
|
||||
private Integer recycleCarbonSec;
|
||||
|
||||
@Schema(description = "母胶比重")
|
||||
private BigDecimal motherRubberSg;
|
||||
|
||||
@Schema(description = "终炼胶比重")
|
||||
private BigDecimal finalRubberSg;
|
||||
|
||||
@Schema(description = "适用工厂")
|
||||
private String applyFactory;
|
||||
|
||||
@Schema(description = "段数")
|
||||
private Integer stageCount;
|
||||
|
||||
@Schema(description = "纯混炼时间(秒)")
|
||||
private Integer pureMixSec;
|
||||
|
||||
@Schema(description = "回收炭黑(KG)")
|
||||
private BigDecimal recycleCarbonKg;
|
||||
|
||||
@Schema(description = "自动小料打印设定")
|
||||
private String autoSmallPrintSetting;
|
||||
|
||||
@Schema(description = "设定车数")
|
||||
private Integer setTrainCount;
|
||||
|
||||
@Schema(description = "侧壁水温")
|
||||
private BigDecimal sideWallWaterTemp;
|
||||
|
||||
@Schema(description = "超时排胶时间")
|
||||
private Integer overtimeDischargeSec;
|
||||
|
||||
@Schema(description = "超温排胶时间")
|
||||
private Integer overtempDischargeSec;
|
||||
|
||||
@Schema(description = "超温排胶温度")
|
||||
private BigDecimal overtempDischargeTemp;
|
||||
|
||||
@Schema(description = "卸料门水温")
|
||||
private BigDecimal doorWaterTemp;
|
||||
|
||||
@Schema(description = "转子水温")
|
||||
private BigDecimal rotorWaterTemp;
|
||||
|
||||
@Schema(description = "最高进料温度")
|
||||
private BigDecimal maxFeedTemp;
|
||||
|
||||
@Schema(description = "起草人")
|
||||
private String draftBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "起草时间")
|
||||
private Date draftTime;
|
||||
|
||||
@Schema(description = "校对人")
|
||||
private String proofreadBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "校对时间")
|
||||
private Date proofreadTime;
|
||||
|
||||
@Schema(description = "审核人")
|
||||
private String auditBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "审核时间")
|
||||
private Date auditTime;
|
||||
|
||||
@Schema(description = "批准人")
|
||||
private String approveBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "批准时间")
|
||||
private Date approveTime;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Schema(description = "变更日期")
|
||||
private Date changeDate;
|
||||
|
||||
private String sysOrgCode;
|
||||
private String createBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
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;
|
||||
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
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 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;
|
||||
|
||||
/**
|
||||
* 混炼示方明细3:下密炼机混炼条件
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_mixing_spec_down_step")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "混炼示方下密炼机混炼条件")
|
||||
public class MesXslMixingSpecDownStep implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Schema(description = "主表ID")
|
||||
private String mixingSpecId;
|
||||
|
||||
@Schema(description = "行序")
|
||||
private Integer sortNo;
|
||||
|
||||
@Schema(description = "动作")
|
||||
private String actionName;
|
||||
|
||||
@Schema(description = "时间(秒)")
|
||||
private Integer actionSec;
|
||||
|
||||
@Schema(description = "保护时间")
|
||||
private Integer protectSec;
|
||||
|
||||
@Schema(description = "温度(℃)")
|
||||
private BigDecimal tempC;
|
||||
|
||||
@Schema(description = "功率(Kw)")
|
||||
private BigDecimal powerKw;
|
||||
|
||||
@Schema(description = "能量(Kwh)")
|
||||
private BigDecimal energyKwh;
|
||||
|
||||
@Schema(description = "组合")
|
||||
private String comboMode;
|
||||
|
||||
@Schema(description = "转速(rpm)")
|
||||
private BigDecimal speedRpm;
|
||||
|
||||
@Schema(description = "压力(Mpa)")
|
||||
private BigDecimal pressureMpa;
|
||||
|
||||
@Schema(description = "栓(%)")
|
||||
private BigDecimal boltPercent;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
|
||||
private String createBy;
|
||||
private Date createTime;
|
||||
private String updateBy;
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
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 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;
|
||||
|
||||
/**
|
||||
* 混炼示方明细1:橡胶及配合剂
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_mixing_spec_material")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "混炼示方橡胶及配合剂")
|
||||
public class MesXslMixingSpecMaterial implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Schema(description = "主表ID")
|
||||
private String mixingSpecId;
|
||||
|
||||
@Schema(description = "行序")
|
||||
private Integer sortNo;
|
||||
|
||||
@Schema(description = "物料大类")
|
||||
private String materialMajor;
|
||||
|
||||
@Schema(description = "物料小类")
|
||||
private String materialMinor;
|
||||
|
||||
@Schema(description = "种类")
|
||||
private String materialKind;
|
||||
|
||||
@Schema(description = "密炼物料名称")
|
||||
private String mixerMaterialName;
|
||||
|
||||
@Schema(description = "密炼物料描述")
|
||||
private String mixerMaterialDesc;
|
||||
|
||||
@Schema(description = "单重")
|
||||
private BigDecimal unitWeight;
|
||||
|
||||
@Schema(description = "累计")
|
||||
private BigDecimal accumWeight;
|
||||
|
||||
@Schema(description = "顺序")
|
||||
private Integer seqNo;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
|
||||
private String createBy;
|
||||
private Date createTime;
|
||||
private String updateBy;
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
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 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;
|
||||
|
||||
/**
|
||||
* 混炼示方明细2:混合步骤
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_mixing_spec_step")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "混炼示方混合步骤")
|
||||
public class MesXslMixingSpecStep implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Schema(description = "主表ID")
|
||||
private String mixingSpecId;
|
||||
|
||||
@Schema(description = "行序")
|
||||
private Integer sortNo;
|
||||
|
||||
@Schema(description = "动作")
|
||||
private String actionName;
|
||||
|
||||
@Schema(description = "时间(秒)")
|
||||
private Integer actionSec;
|
||||
|
||||
@Schema(description = "保护时间")
|
||||
private Integer protectSec;
|
||||
|
||||
@Schema(description = "温度(℃)")
|
||||
private BigDecimal tempC;
|
||||
|
||||
@Schema(description = "功率(Kw)")
|
||||
private BigDecimal powerKw;
|
||||
|
||||
@Schema(description = "能量(Kwh)")
|
||||
private BigDecimal energyKwh;
|
||||
|
||||
@Schema(description = "组合")
|
||||
private String comboMode;
|
||||
|
||||
@Schema(description = "转速(rpm)")
|
||||
private BigDecimal speedRpm;
|
||||
|
||||
@Schema(description = "压力(Mpa)")
|
||||
private BigDecimal pressureMpa;
|
||||
|
||||
@Schema(description = "栓(%)")
|
||||
private BigDecimal boltPercent;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
|
||||
private String createBy;
|
||||
private Date createTime;
|
||||
private String updateBy;
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
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 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;
|
||||
|
||||
/**
|
||||
* 混炼示方明细4:TCU温度条件
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_mixing_spec_tcu")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "混炼示方TCU温度条件")
|
||||
public class MesXslMixingSpecTcu implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Schema(description = "主表ID")
|
||||
private String mixingSpecId;
|
||||
|
||||
@Schema(description = "行序")
|
||||
private Integer sortNo;
|
||||
|
||||
@Schema(description = "区分(字典xslmes_mixing_tcu_section)")
|
||||
private String sectionType;
|
||||
|
||||
@Schema(description = "前转子温度")
|
||||
private BigDecimal frontRotorTemp;
|
||||
|
||||
@Schema(description = "后转子温度")
|
||||
private BigDecimal rearRotorTemp;
|
||||
|
||||
@Schema(description = "前混炼室温度")
|
||||
private BigDecimal frontChamberTemp;
|
||||
|
||||
@Schema(description = "后混炼室温度")
|
||||
private BigDecimal rearChamberTemp;
|
||||
|
||||
@Schema(description = "上下顶栓温度")
|
||||
private BigDecimal topPlugTemp;
|
||||
|
||||
@Schema(description = "药品称量位置(字典xslmes_mixing_drug_weigh_pos)")
|
||||
private String drugWeighPos;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
|
||||
private String createBy;
|
||||
private Date createTime;
|
||||
private String updateBy;
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecDownStep;
|
||||
|
||||
public interface MesXslMixingSpecDownStepMapper extends BaseMapper<MesXslMixingSpecDownStep> {}
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpec;
|
||||
|
||||
public interface MesXslMixingSpecMapper extends BaseMapper<MesXslMixingSpec> {}
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecMaterial;
|
||||
|
||||
public interface MesXslMixingSpecMaterialMapper extends BaseMapper<MesXslMixingSpecMaterial> {}
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecStep;
|
||||
|
||||
public interface MesXslMixingSpecStepMapper extends BaseMapper<MesXslMixingSpecStep> {}
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecTcu;
|
||||
|
||||
public interface MesXslMixingSpecTcuMapper extends BaseMapper<MesXslMixingSpecTcu> {}
|
||||
@@ -0,0 +1,39 @@
|
||||
package org.jeecg.modules.xslmes.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpec;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecDownStep;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecMaterial;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecStep;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecTcu;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslMixingSpecPage;
|
||||
|
||||
public interface IMesXslMixingSpecService extends IService<MesXslMixingSpec> {
|
||||
void saveMain(
|
||||
MesXslMixingSpec main,
|
||||
List<MesXslMixingSpecMaterial> materialList,
|
||||
List<MesXslMixingSpecStep> stepList,
|
||||
List<MesXslMixingSpecDownStep> downStepList,
|
||||
List<MesXslMixingSpecTcu> tcuList);
|
||||
|
||||
void updateMain(
|
||||
MesXslMixingSpec main,
|
||||
List<MesXslMixingSpecMaterial> materialList,
|
||||
List<MesXslMixingSpecStep> stepList,
|
||||
List<MesXslMixingSpecDownStep> downStepList,
|
||||
List<MesXslMixingSpecTcu> tcuList);
|
||||
|
||||
void delMain(String id);
|
||||
|
||||
void delBatchMain(Collection<? extends Serializable> idList);
|
||||
|
||||
MesXslMixingSpecPage queryPageById(String id);
|
||||
|
||||
List<Map<String, String>> queryIssueNumberOptions(String keyword);
|
||||
|
||||
List<Map<String, String>> queryPurposeOptions(String keyword);
|
||||
}
|
||||
@@ -0,0 +1,339 @@
|
||||
package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpec;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecDownStep;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecMaterial;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecStep;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecTcu;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslMixingSpecDownStepMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslMixingSpecMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslMixingSpecMaterialMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslMixingSpecStepMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslMixingSpecTcuMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixingSpecService;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslMixingSpecPage;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@Service
|
||||
public class MesXslMixingSpecServiceImpl extends ServiceImpl<MesXslMixingSpecMapper, MesXslMixingSpec>
|
||||
implements IMesXslMixingSpecService {
|
||||
|
||||
private static final String TCU_UP = "up_mixer";
|
||||
private static final String TCU_DOWN = "down_mixer";
|
||||
|
||||
@Resource
|
||||
private MesXslMixingSpecMaterialMapper materialMapper;
|
||||
@Resource
|
||||
private MesXslMixingSpecStepMapper stepMapper;
|
||||
@Resource
|
||||
private MesXslMixingSpecDownStepMapper downStepMapper;
|
||||
@Resource
|
||||
private MesXslMixingSpecTcuMapper tcuMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveMain(
|
||||
MesXslMixingSpec main,
|
||||
List<MesXslMixingSpecMaterial> materialList,
|
||||
List<MesXslMixingSpecStep> stepList,
|
||||
List<MesXslMixingSpecDownStep> downStepList,
|
||||
List<MesXslMixingSpecTcu> tcuList) {
|
||||
//update-begin---author:cursor ---date:20260522 for:【XSLMES-20260522-A17】混炼示方主子表新增保存-----------
|
||||
normalizeMain(main);
|
||||
this.save(main);
|
||||
saveChildren(main.getId(), materialList, stepList, downStepList, tcuList);
|
||||
//update-end---author:cursor ---date:20260522 for:【XSLMES-20260522-A17】混炼示方主子表新增保存-----------
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateMain(
|
||||
MesXslMixingSpec main,
|
||||
List<MesXslMixingSpecMaterial> materialList,
|
||||
List<MesXslMixingSpecStep> stepList,
|
||||
List<MesXslMixingSpecDownStep> downStepList,
|
||||
List<MesXslMixingSpecTcu> tcuList) {
|
||||
//update-begin---author:cursor ---date:20260522 for:【XSLMES-20260522-A17】混炼示方主子表编辑保存-----------
|
||||
normalizeMain(main);
|
||||
this.updateById(main);
|
||||
clearChildren(main.getId());
|
||||
saveChildren(main.getId(), materialList, stepList, downStepList, tcuList);
|
||||
//update-end---author:cursor ---date:20260522 for:【XSLMES-20260522-A17】混炼示方主子表编辑保存-----------
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delMain(String id) {
|
||||
clearChildren(id);
|
||||
this.removeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delBatchMain(Collection<? extends Serializable> idList) {
|
||||
if (CollectionUtils.isEmpty(idList)) {
|
||||
return;
|
||||
}
|
||||
for (Serializable id : idList) {
|
||||
if (id != null) {
|
||||
delMain(String.valueOf(id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MesXslMixingSpecPage queryPageById(String id) {
|
||||
MesXslMixingSpec main = this.getById(id);
|
||||
if (main == null) {
|
||||
return null;
|
||||
}
|
||||
MesXslMixingSpecPage page = new MesXslMixingSpecPage();
|
||||
page.setId(main.getId());
|
||||
page.setTenantId(main.getTenantId());
|
||||
page.setSpecName(main.getSpecName());
|
||||
page.setPurpose(main.getPurpose());
|
||||
page.setMachineId(main.getMachineId());
|
||||
page.setMachineName(main.getMachineName());
|
||||
page.setMakeDate(main.getMakeDate());
|
||||
page.setIssueNumber(main.getIssueNumber());
|
||||
page.setConvertFactor(main.getConvertFactor());
|
||||
page.setFillVolume(main.getFillVolume());
|
||||
page.setRecycleCarbonSec(main.getRecycleCarbonSec());
|
||||
page.setMotherRubberSg(main.getMotherRubberSg());
|
||||
page.setFinalRubberSg(main.getFinalRubberSg());
|
||||
page.setApplyFactory(main.getApplyFactory());
|
||||
page.setStageCount(main.getStageCount());
|
||||
page.setPureMixSec(main.getPureMixSec());
|
||||
page.setRecycleCarbonKg(main.getRecycleCarbonKg());
|
||||
page.setAutoSmallPrintSetting(main.getAutoSmallPrintSetting());
|
||||
page.setSetTrainCount(main.getSetTrainCount());
|
||||
page.setSideWallWaterTemp(main.getSideWallWaterTemp());
|
||||
page.setOvertimeDischargeSec(main.getOvertimeDischargeSec());
|
||||
page.setOvertempDischargeSec(main.getOvertempDischargeSec());
|
||||
page.setOvertempDischargeTemp(main.getOvertempDischargeTemp());
|
||||
page.setDoorWaterTemp(main.getDoorWaterTemp());
|
||||
page.setRotorWaterTemp(main.getRotorWaterTemp());
|
||||
page.setMaxFeedTemp(main.getMaxFeedTemp());
|
||||
page.setDraftBy(main.getDraftBy());
|
||||
page.setDraftTime(main.getDraftTime());
|
||||
page.setProofreadBy(main.getProofreadBy());
|
||||
page.setProofreadTime(main.getProofreadTime());
|
||||
page.setAuditBy(main.getAuditBy());
|
||||
page.setAuditTime(main.getAuditTime());
|
||||
page.setApproveBy(main.getApproveBy());
|
||||
page.setApproveTime(main.getApproveTime());
|
||||
page.setChangeDate(main.getChangeDate());
|
||||
page.setSysOrgCode(main.getSysOrgCode());
|
||||
page.setCreateBy(main.getCreateBy());
|
||||
page.setCreateTime(main.getCreateTime());
|
||||
page.setUpdateBy(main.getUpdateBy());
|
||||
page.setUpdateTime(main.getUpdateTime());
|
||||
page.setDelFlag(main.getDelFlag());
|
||||
|
||||
page.setMaterialList(queryMaterialByMainId(id));
|
||||
page.setStepList(queryStepByMainId(id));
|
||||
page.setDownStepList(queryDownStepByMainId(id));
|
||||
page.setTcuList(fillDefaultTcuRows(queryTcuByMainId(id)));
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> queryIssueNumberOptions(String keyword) {
|
||||
//update-begin---author:cursor ---date:20260522 for:【XSLMES-20260522-A17】发行编号联想取密炼PS-----------
|
||||
LambdaQueryWrapper<MesXslMixingSpec> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotBlank(keyword)) {
|
||||
queryWrapper.like(MesXslMixingSpec::getIssueNumber, keyword);
|
||||
}
|
||||
queryWrapper.isNotNull(MesXslMixingSpec::getIssueNumber)
|
||||
.orderByDesc(MesXslMixingSpec::getUpdateTime)
|
||||
.orderByDesc(MesXslMixingSpec::getCreateTime)
|
||||
.last("limit 30");
|
||||
List<MesXslMixingSpec> rows = this.list(queryWrapper);
|
||||
List<Map<String, String>> options = new ArrayList<>();
|
||||
for (MesXslMixingSpec row : rows) {
|
||||
if (StringUtils.isBlank(row.getIssueNumber())) {
|
||||
continue;
|
||||
}
|
||||
options.add(Map.of("label", row.getIssueNumber(), "value", row.getIssueNumber()));
|
||||
}
|
||||
return options;
|
||||
//update-end---author:cursor ---date:20260522 for:【XSLMES-20260522-A17】发行编号联想取密炼PS-----------
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> queryPurposeOptions(String keyword) {
|
||||
LambdaQueryWrapper<MesXslMixingSpec> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotBlank(keyword)) {
|
||||
queryWrapper.like(MesXslMixingSpec::getPurpose, keyword);
|
||||
}
|
||||
queryWrapper.isNotNull(MesXslMixingSpec::getPurpose)
|
||||
.orderByDesc(MesXslMixingSpec::getUpdateTime)
|
||||
.orderByDesc(MesXslMixingSpec::getCreateTime)
|
||||
.last("limit 50");
|
||||
List<MesXslMixingSpec> rows = this.list(queryWrapper);
|
||||
List<Map<String, String>> options = new ArrayList<>();
|
||||
for (MesXslMixingSpec row : rows) {
|
||||
if (StringUtils.isBlank(row.getPurpose())) {
|
||||
continue;
|
||||
}
|
||||
options.add(Map.of("label", row.getPurpose(), "value", row.getPurpose()));
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
private void normalizeMain(MesXslMixingSpec main) {
|
||||
if (main.getDraftTime() == null) {
|
||||
main.setDraftTime(new Date());
|
||||
}
|
||||
if (main.getDelFlag() == null) {
|
||||
main.setDelFlag(0);
|
||||
}
|
||||
}
|
||||
|
||||
private void clearChildren(String mainId) {
|
||||
materialMapper.delete(new LambdaQueryWrapper<MesXslMixingSpecMaterial>().eq(MesXslMixingSpecMaterial::getMixingSpecId, mainId));
|
||||
stepMapper.delete(new LambdaQueryWrapper<MesXslMixingSpecStep>().eq(MesXslMixingSpecStep::getMixingSpecId, mainId));
|
||||
downStepMapper.delete(new LambdaQueryWrapper<MesXslMixingSpecDownStep>().eq(MesXslMixingSpecDownStep::getMixingSpecId, mainId));
|
||||
tcuMapper.delete(new LambdaQueryWrapper<MesXslMixingSpecTcu>().eq(MesXslMixingSpecTcu::getMixingSpecId, mainId));
|
||||
}
|
||||
|
||||
private void saveChildren(
|
||||
String mainId,
|
||||
List<MesXslMixingSpecMaterial> materialList,
|
||||
List<MesXslMixingSpecStep> stepList,
|
||||
List<MesXslMixingSpecDownStep> downStepList,
|
||||
List<MesXslMixingSpecTcu> tcuList) {
|
||||
Date now = new Date();
|
||||
int sort = 0;
|
||||
if (!CollectionUtils.isEmpty(materialList)) {
|
||||
for (MesXslMixingSpecMaterial row : materialList) {
|
||||
if (row == null) {
|
||||
continue;
|
||||
}
|
||||
row.setId(null);
|
||||
row.setMixingSpecId(mainId);
|
||||
row.setSortNo(sort++);
|
||||
if (row.getCreateTime() == null) {
|
||||
row.setCreateTime(now);
|
||||
}
|
||||
materialMapper.insert(row);
|
||||
}
|
||||
}
|
||||
sort = 0;
|
||||
if (!CollectionUtils.isEmpty(stepList)) {
|
||||
for (MesXslMixingSpecStep row : stepList) {
|
||||
if (row == null) {
|
||||
continue;
|
||||
}
|
||||
row.setId(null);
|
||||
row.setMixingSpecId(mainId);
|
||||
row.setSortNo(sort++);
|
||||
if (row.getCreateTime() == null) {
|
||||
row.setCreateTime(now);
|
||||
}
|
||||
stepMapper.insert(row);
|
||||
}
|
||||
}
|
||||
sort = 0;
|
||||
if (!CollectionUtils.isEmpty(downStepList)) {
|
||||
for (MesXslMixingSpecDownStep row : downStepList) {
|
||||
if (row == null) {
|
||||
continue;
|
||||
}
|
||||
row.setId(null);
|
||||
row.setMixingSpecId(mainId);
|
||||
row.setSortNo(sort++);
|
||||
if (row.getCreateTime() == null) {
|
||||
row.setCreateTime(now);
|
||||
}
|
||||
downStepMapper.insert(row);
|
||||
}
|
||||
}
|
||||
List<MesXslMixingSpecTcu> tcuRows = fillDefaultTcuRows(tcuList);
|
||||
sort = 0;
|
||||
for (MesXslMixingSpecTcu row : tcuRows) {
|
||||
row.setId(null);
|
||||
row.setMixingSpecId(mainId);
|
||||
row.setSortNo(sort++);
|
||||
if (row.getCreateTime() == null) {
|
||||
row.setCreateTime(now);
|
||||
}
|
||||
if (TCU_DOWN.equals(row.getSectionType())) {
|
||||
row.setDrugWeighPos(null);
|
||||
}
|
||||
tcuMapper.insert(row);
|
||||
}
|
||||
}
|
||||
|
||||
private List<MesXslMixingSpecMaterial> queryMaterialByMainId(String mainId) {
|
||||
return materialMapper.selectList(
|
||||
new LambdaQueryWrapper<MesXslMixingSpecMaterial>()
|
||||
.eq(MesXslMixingSpecMaterial::getMixingSpecId, mainId)
|
||||
.orderByAsc(MesXslMixingSpecMaterial::getSortNo)
|
||||
.orderByAsc(MesXslMixingSpecMaterial::getId));
|
||||
}
|
||||
|
||||
private List<MesXslMixingSpecStep> queryStepByMainId(String mainId) {
|
||||
return stepMapper.selectList(
|
||||
new LambdaQueryWrapper<MesXslMixingSpecStep>()
|
||||
.eq(MesXslMixingSpecStep::getMixingSpecId, mainId)
|
||||
.orderByAsc(MesXslMixingSpecStep::getSortNo)
|
||||
.orderByAsc(MesXslMixingSpecStep::getId));
|
||||
}
|
||||
|
||||
private List<MesXslMixingSpecDownStep> queryDownStepByMainId(String mainId) {
|
||||
return downStepMapper.selectList(
|
||||
new LambdaQueryWrapper<MesXslMixingSpecDownStep>()
|
||||
.eq(MesXslMixingSpecDownStep::getMixingSpecId, mainId)
|
||||
.orderByAsc(MesXslMixingSpecDownStep::getSortNo)
|
||||
.orderByAsc(MesXslMixingSpecDownStep::getId));
|
||||
}
|
||||
|
||||
private List<MesXslMixingSpecTcu> queryTcuByMainId(String mainId) {
|
||||
return tcuMapper.selectList(
|
||||
new LambdaQueryWrapper<MesXslMixingSpecTcu>()
|
||||
.eq(MesXslMixingSpecTcu::getMixingSpecId, mainId)
|
||||
.orderByAsc(MesXslMixingSpecTcu::getSortNo)
|
||||
.orderByAsc(MesXslMixingSpecTcu::getId));
|
||||
}
|
||||
|
||||
private List<MesXslMixingSpecTcu> fillDefaultTcuRows(List<MesXslMixingSpecTcu> source) {
|
||||
List<MesXslMixingSpecTcu> rows = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(source)) {
|
||||
rows.addAll(source);
|
||||
}
|
||||
boolean hasUp = rows.stream().anyMatch(r -> TCU_UP.equals(r.getSectionType()));
|
||||
boolean hasDown = rows.stream().anyMatch(r -> TCU_DOWN.equals(r.getSectionType()));
|
||||
if (!hasUp) {
|
||||
MesXslMixingSpecTcu up = new MesXslMixingSpecTcu();
|
||||
up.setSectionType(TCU_UP);
|
||||
rows.add(0, up);
|
||||
}
|
||||
if (!hasDown) {
|
||||
MesXslMixingSpecTcu down = new MesXslMixingSpecTcu();
|
||||
down.setSectionType(TCU_DOWN);
|
||||
rows.add(down);
|
||||
}
|
||||
rows.sort((a, b) -> {
|
||||
int ai = TCU_UP.equals(a.getSectionType()) ? 0 : TCU_DOWN.equals(a.getSectionType()) ? 1 : 2;
|
||||
int bi = TCU_UP.equals(b.getSectionType()) ? 0 : TCU_DOWN.equals(b.getSectionType()) ? 1 : 2;
|
||||
return Integer.compare(ai, bi);
|
||||
});
|
||||
if (rows.size() > 2) {
|
||||
return new ArrayList<>(rows.subList(0, 2));
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.jeecg.modules.xslmes.vo;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpec;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecDownStep;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecMaterial;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecStep;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecTcu;
|
||||
|
||||
/**
|
||||
* 混炼示方主子保存VO
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class MesXslMixingSpecPage extends MesXslMixingSpec {
|
||||
private List<MesXslMixingSpecMaterial> materialList;
|
||||
private List<MesXslMixingSpecStep> stepList;
|
||||
private List<MesXslMixingSpecDownStep> downStepList;
|
||||
private List<MesXslMixingSpecTcu> tcuList;
|
||||
}
|
||||
Reference in New Issue
Block a user