密炼机动作维护、日罐物料对应信息、密炼机条件维护、生产订单、金蝶对接配置
This commit is contained in:
@@ -0,0 +1,168 @@
|
||||
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 java.util.Arrays;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
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.MesXslMixerCondition;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixerConditionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@Tag(name = "密炼机条件维护")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslMixerCondition")
|
||||
public class MesXslMixerConditionController
|
||||
extends JeecgController<MesXslMixerCondition, IMesXslMixerConditionService> {
|
||||
|
||||
@Autowired private IMesXslMixerConditionService mesXslMixerConditionService;
|
||||
|
||||
@Operation(summary = "密炼机条件维护-分页列表查询")
|
||||
@GetMapping("/list")
|
||||
public Result<IPage<MesXslMixerCondition>> queryPageList(
|
||||
MesXslMixerCondition model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslMixerCondition> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<MesXslMixerCondition> pageList = mesXslMixerConditionService.page(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "密炼机条件维护-添加")
|
||||
@Operation(summary = "密炼机条件维护-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_condition:add")
|
||||
@PostMapping("/add")
|
||||
public Result<String> add(@RequestBody MesXslMixerCondition model) {
|
||||
String err = validateForSave(model, null);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
mesXslMixerConditionService.fillEquipmentName(model);
|
||||
if (StringUtils.isBlank(model.getEquipmentName())) {
|
||||
return Result.error("请选择有效的设备名称");
|
||||
}
|
||||
mesXslMixerConditionService.save(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "密炼机条件维护-编辑")
|
||||
@Operation(summary = "密炼机条件维护-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_condition:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslMixerCondition model) {
|
||||
String err = validateForSave(model, model.getId());
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
mesXslMixerConditionService.fillEquipmentName(model);
|
||||
if (StringUtils.isBlank(model.getEquipmentName())) {
|
||||
return Result.error("请选择有效的设备名称");
|
||||
}
|
||||
mesXslMixerConditionService.updateById(model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "密炼机条件维护-通过id删除")
|
||||
@Operation(summary = "密炼机条件维护-通过id删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_condition:delete")
|
||||
@DeleteMapping("/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslMixerConditionService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "密炼机条件维护-批量删除")
|
||||
@Operation(summary = "密炼机条件维护-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_condition:deleteBatch")
|
||||
@DeleteMapping("/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslMixerConditionService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "密炼机条件维护-通过id查询")
|
||||
@GetMapping("/queryById")
|
||||
public Result<MesXslMixerCondition> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslMixerCondition entity = mesXslMixerConditionService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@Operation(summary = "校验条件名称是否重复")
|
||||
@GetMapping("/checkConditionName")
|
||||
public Result<String> checkConditionName(
|
||||
@RequestParam(name = "conditionName", required = true) String conditionName,
|
||||
@RequestParam(name = "dataId", required = false) String dataId) {
|
||||
if (oConvertUtils.isEmpty(conditionName) || conditionName.trim().isEmpty()) {
|
||||
return Result.OK("该值可用!");
|
||||
}
|
||||
if (mesXslMixerConditionService.isConditionNameDuplicated(conditionName, dataId)) {
|
||||
return Result.error("条件名称不能重复");
|
||||
}
|
||||
return Result.OK("该值可用!");
|
||||
}
|
||||
|
||||
@Operation(summary = "校验条件代码是否重复")
|
||||
@GetMapping("/checkConditionCode")
|
||||
public Result<String> checkConditionCode(
|
||||
@RequestParam(name = "conditionCode", required = true) String conditionCode,
|
||||
@RequestParam(name = "dataId", required = false) String dataId) {
|
||||
if (oConvertUtils.isEmpty(conditionCode) || conditionCode.trim().isEmpty()) {
|
||||
return Result.OK("该值可用!");
|
||||
}
|
||||
if (mesXslMixerConditionService.isConditionCodeDuplicated(conditionCode, dataId)) {
|
||||
return Result.error("条件代码不能重复");
|
||||
}
|
||||
return Result.OK("该值可用!");
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_condition:exportXls")
|
||||
@RequestMapping("/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslMixerCondition model) {
|
||||
return super.exportXls(request, model, MesXslMixerCondition.class, "密炼机条件维护");
|
||||
}
|
||||
|
||||
private String validateForSave(MesXslMixerCondition model, String excludeId) {
|
||||
if (oConvertUtils.isEmpty(model.getEquipmentId()) || StringUtils.isBlank(model.getEquipmentId())) {
|
||||
return "设备名称不能为空";
|
||||
}
|
||||
model.setEquipmentId(model.getEquipmentId().trim());
|
||||
if (oConvertUtils.isEmpty(model.getConditionName()) || StringUtils.isBlank(model.getConditionName())) {
|
||||
return "条件名称不能为空";
|
||||
}
|
||||
model.setConditionName(model.getConditionName().trim());
|
||||
if (mesXslMixerConditionService.isConditionNameDuplicated(model.getConditionName(), excludeId)) {
|
||||
return "条件名称不能重复";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getConditionCode()) || StringUtils.isBlank(model.getConditionCode())) {
|
||||
return "条件代码不能为空";
|
||||
}
|
||||
model.setConditionCode(model.getConditionCode().trim());
|
||||
if (mesXslMixerConditionService.isConditionCodeDuplicated(model.getConditionCode(), excludeId)) {
|
||||
return "条件代码不能重复";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
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 java.util.Arrays;
|
||||
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.modules.xslmes.entity.MesXslProductionOrder;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslProductionOrderService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@Tag(name = "生产订单")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslProductionOrder")
|
||||
public class MesXslProductionOrderController
|
||||
extends JeecgController<MesXslProductionOrder, IMesXslProductionOrderService> {
|
||||
|
||||
@Autowired private IMesXslProductionOrderService mesXslProductionOrderService;
|
||||
|
||||
@Operation(summary = "生产订单-分页列表查询")
|
||||
@GetMapping("/list")
|
||||
public Result<IPage<MesXslProductionOrder>> queryPageList(
|
||||
MesXslProductionOrder model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslProductionOrder> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<MesXslProductionOrder> pageList = mesXslProductionOrderService.page(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "生产订单-添加")
|
||||
@Operation(summary = "生产订单-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_production_order:add")
|
||||
@PostMapping("/add")
|
||||
public Result<String> add(@RequestBody MesXslProductionOrder model) {
|
||||
mesXslProductionOrderService.save(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "生产订单-编辑")
|
||||
@Operation(summary = "生产订单-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_production_order:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslProductionOrder model) {
|
||||
mesXslProductionOrderService.updateById(model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "生产订单-通过id删除")
|
||||
@Operation(summary = "生产订单-通过id删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_production_order:delete")
|
||||
@DeleteMapping("/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslProductionOrderService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "生产订单-批量删除")
|
||||
@Operation(summary = "生产订单-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_production_order:deleteBatch")
|
||||
@DeleteMapping("/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslProductionOrderService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "生产订单-通过id查询")
|
||||
@GetMapping("/queryById")
|
||||
public Result<MesXslProductionOrder> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslProductionOrder entity = mesXslProductionOrderService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_production_order:exportXls")
|
||||
@RequestMapping("/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslProductionOrder model) {
|
||||
return super.exportXls(request, model, MesXslProductionOrder.class, "生产订单");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
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_condition")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES密炼机条件维护")
|
||||
public class MesXslMixerCondition implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Excel(name = "设备名称", width = 20, dictTable = "mes_xsl_equipment_ledger", dicText = "equipment_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_xsl_equipment_ledger", dicText = "equipment_name", dicCode = "id")
|
||||
@Schema(description = "设备台账ID")
|
||||
private String equipmentId;
|
||||
|
||||
@Excel(name = "设备名称", width = 20)
|
||||
@Schema(description = "设备名称冗余")
|
||||
private String equipmentName;
|
||||
|
||||
@Excel(name = "条件名称", width = 20)
|
||||
@Schema(description = "条件名称")
|
||||
private String conditionName;
|
||||
|
||||
@Excel(name = "条件代码", width = 20)
|
||||
@Schema(description = "条件代码")
|
||||
private String conditionCode;
|
||||
|
||||
@Excel(name = "备注", width = 30)
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
private Integer tenantId;
|
||||
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,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.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_production_order")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES生产订单")
|
||||
public class MesXslProductionOrder implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Excel(name = "销售订单号", width = 20)
|
||||
private String salesOrderNo;
|
||||
|
||||
@Excel(name = "生产订单号", width = 20)
|
||||
private String productionOrderNo;
|
||||
|
||||
@Excel(name = "订单日期", width = 20, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date orderDate;
|
||||
|
||||
@Excel(name = "生产车间", width = 20)
|
||||
private String productionWorkshop;
|
||||
|
||||
@Excel(name = "加工段数", width = 12)
|
||||
private Integer processSegmentCount;
|
||||
|
||||
@Excel(name = "物料编号", width = 20)
|
||||
private String materialCode;
|
||||
|
||||
@Excel(name = "MES胶料名称", width = 20)
|
||||
private String mesMaterialName;
|
||||
|
||||
@Excel(name = "金蝶物料名称", width = 20)
|
||||
private String kingdeeMaterialName;
|
||||
|
||||
@Excel(name = "金蝶物料规格", width = 20)
|
||||
private String kingdeeMaterialSpec;
|
||||
|
||||
@Excel(name = "计划数量", width = 15)
|
||||
private BigDecimal planQty;
|
||||
|
||||
@Excel(name = "拆分状态", width = 12, replace = {"已拆分_1", "未拆分_0"})
|
||||
private Integer splitStatus;
|
||||
|
||||
private Integer tenantId;
|
||||
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,6 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerCondition;
|
||||
|
||||
public interface MesXslMixerConditionMapper extends BaseMapper<MesXslMixerCondition> {}
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslProductionOrder;
|
||||
|
||||
public interface MesXslProductionOrderMapper extends BaseMapper<MesXslProductionOrder> {}
|
||||
@@ -0,0 +1,13 @@
|
||||
package org.jeecg.modules.xslmes.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerCondition;
|
||||
|
||||
public interface IMesXslMixerConditionService extends IService<MesXslMixerCondition> {
|
||||
|
||||
void fillEquipmentName(MesXslMixerCondition model);
|
||||
|
||||
boolean isConditionNameDuplicated(String conditionName, String excludeId);
|
||||
|
||||
boolean isConditionCodeDuplicated(String conditionCode, String excludeId);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.jeecg.modules.xslmes.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslProductionOrder;
|
||||
|
||||
public interface IMesXslProductionOrderService extends IService<MesXslProductionOrder> {}
|
||||
@@ -0,0 +1,59 @@
|
||||
package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentLedger;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerCondition;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslEquipmentLedgerMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslMixerConditionMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixerConditionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class MesXslMixerConditionServiceImpl
|
||||
extends ServiceImpl<MesXslMixerConditionMapper, MesXslMixerCondition>
|
||||
implements IMesXslMixerConditionService {
|
||||
|
||||
@Autowired private MesXslEquipmentLedgerMapper equipmentLedgerMapper;
|
||||
|
||||
@Override
|
||||
public boolean isConditionNameDuplicated(String conditionName, String excludeId) {
|
||||
if (StringUtils.isBlank(conditionName)) {
|
||||
return false;
|
||||
}
|
||||
LambdaQueryWrapper<MesXslMixerCondition> wrapper =
|
||||
new LambdaQueryWrapper<MesXslMixerCondition>().eq(MesXslMixerCondition::getConditionName, conditionName.trim());
|
||||
if (StringUtils.isNotBlank(excludeId)) {
|
||||
wrapper.ne(MesXslMixerCondition::getId, excludeId.trim());
|
||||
}
|
||||
return this.count(wrapper) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConditionCodeDuplicated(String conditionCode, String excludeId) {
|
||||
if (StringUtils.isBlank(conditionCode)) {
|
||||
return false;
|
||||
}
|
||||
LambdaQueryWrapper<MesXslMixerCondition> wrapper =
|
||||
new LambdaQueryWrapper<MesXslMixerCondition>().eq(MesXslMixerCondition::getConditionCode, conditionCode.trim());
|
||||
if (StringUtils.isNotBlank(excludeId)) {
|
||||
wrapper.ne(MesXslMixerCondition::getId, excludeId.trim());
|
||||
}
|
||||
return this.count(wrapper) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillEquipmentName(MesXslMixerCondition model) {
|
||||
if (model == null) {
|
||||
return;
|
||||
}
|
||||
if (StringUtils.isBlank(model.getEquipmentId())) {
|
||||
model.setEquipmentName(null);
|
||||
return;
|
||||
}
|
||||
MesXslEquipmentLedger equipment = equipmentLedgerMapper.selectById(model.getEquipmentId().trim());
|
||||
model.setEquipmentName(equipment == null ? null : equipment.getEquipmentName());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslProductionOrder;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslProductionOrderMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslProductionOrderService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class MesXslProductionOrderServiceImpl
|
||||
extends ServiceImpl<MesXslProductionOrderMapper, MesXslProductionOrder>
|
||||
implements IMesXslProductionOrderService {}
|
||||
Reference in New Issue
Block a user