update 添加工序工艺信息

master
yinq 3 months ago
parent cf972cef0c
commit 5d22a31579

@ -0,0 +1,117 @@
package org.dromara.mes.controller;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.mes.domain.vo.ProdTechnologyInfoVo;
import org.dromara.mes.domain.bo.ProdTechnologyInfoBo;
import org.dromara.mes.service.IProdTechnologyInfoService;
import org.dromara.common.mybatis.core.page.TableDataInfo;
/**
*
* 访:/mes/technologyInfo
*
* @author Yinq
* @date 2025-01-21
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/technologyInfo")
public class ProdTechnologyInfoController extends BaseController {
private final IProdTechnologyInfoService prodTechnologyInfoService;
/**
*
*/
@SaCheckPermission("mes:technologyInfo:list")
@GetMapping("/list")
public TableDataInfo<ProdTechnologyInfoVo> list(ProdTechnologyInfoBo bo, PageQuery pageQuery) {
return prodTechnologyInfoService.queryPageList(bo, pageQuery);
}
/**
*
*/
@SaCheckPermission("mes:technologyInfo:export")
@Log(title = "工序工艺信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(ProdTechnologyInfoBo bo, HttpServletResponse response) {
List<ProdTechnologyInfoVo> list = prodTechnologyInfoService.queryList(bo);
ExcelUtil.exportExcel(list, "工序工艺信息", ProdTechnologyInfoVo.class, response);
}
/**
*
*
* @param technologyId
*/
@SaCheckPermission("mes:technologyInfo:query")
@GetMapping("/{technologyId}")
public R<ProdTechnologyInfoVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long technologyId) {
return R.ok(prodTechnologyInfoService.queryById(technologyId));
}
/**
*
*/
@SaCheckPermission("mes:technologyInfo:add")
@Log(title = "工序工艺信息", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody ProdTechnologyInfoBo bo) {
return toAjax(prodTechnologyInfoService.insertByBo(bo));
}
/**
*
*/
@SaCheckPermission("mes:technologyInfo:edit")
@Log(title = "工序工艺信息", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ProdTechnologyInfoBo bo) {
return toAjax(prodTechnologyInfoService.updateByBo(bo));
}
/**
*
*
* @param technologyIds
*/
@SaCheckPermission("mes:technologyInfo:remove")
@Log(title = "工序工艺信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{technologyIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] technologyIds) {
return toAjax(prodTechnologyInfoService.deleteWithValidByIds(List.of(technologyIds), true));
}
/**
*
*/
@GetMapping("getProdTechnologyInfoList")
public R<List<ProdTechnologyInfoVo>> getProdTechnologyInfolist(ProdTechnologyInfoBo bo) {
List<ProdTechnologyInfoVo> list = prodTechnologyInfoService.queryList(bo);
return R.ok(list);
}
}

@ -0,0 +1,117 @@
package org.dromara.mes.controller;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.mes.domain.vo.ProdTechnologyStepInfoVo;
import org.dromara.mes.domain.bo.ProdTechnologyStepInfoBo;
import org.dromara.mes.service.IProdTechnologyStepInfoService;
import org.dromara.common.mybatis.core.page.TableDataInfo;
/**
*
* 访:/mes/technologyStepInfo
*
* @author Yinq
* @date 2025-01-21
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/technologyStepInfo")
public class ProdTechnologyStepInfoController extends BaseController {
private final IProdTechnologyStepInfoService prodTechnologyStepInfoService;
/**
*
*/
@SaCheckPermission("mes:technologyStepInfo:list")
@GetMapping("/list")
public TableDataInfo<ProdTechnologyStepInfoVo> list(ProdTechnologyStepInfoBo bo, PageQuery pageQuery) {
return prodTechnologyStepInfoService.queryPageList(bo, pageQuery);
}
/**
*
*/
@SaCheckPermission("mes:technologyStepInfo:export")
@Log(title = "工艺步序信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(ProdTechnologyStepInfoBo bo, HttpServletResponse response) {
List<ProdTechnologyStepInfoVo> list = prodTechnologyStepInfoService.queryList(bo);
ExcelUtil.exportExcel(list, "工艺步序信息", ProdTechnologyStepInfoVo.class, response);
}
/**
*
*
* @param stepId
*/
@SaCheckPermission("mes:technologyStepInfo:query")
@GetMapping("/{stepId}")
public R<ProdTechnologyStepInfoVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long stepId) {
return R.ok(prodTechnologyStepInfoService.queryById(stepId));
}
/**
*
*/
@SaCheckPermission("mes:technologyStepInfo:add")
@Log(title = "工艺步序信息", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody ProdTechnologyStepInfoBo bo) {
return toAjax(prodTechnologyStepInfoService.insertByBo(bo));
}
/**
*
*/
@SaCheckPermission("mes:technologyStepInfo:edit")
@Log(title = "工艺步序信息", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ProdTechnologyStepInfoBo bo) {
return toAjax(prodTechnologyStepInfoService.updateByBo(bo));
}
/**
*
*
* @param stepIds
*/
@SaCheckPermission("mes:technologyStepInfo:remove")
@Log(title = "工艺步序信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{stepIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] stepIds) {
return toAjax(prodTechnologyStepInfoService.deleteWithValidByIds(List.of(stepIds), true));
}
/**
*
*/
@GetMapping("getProdTechnologyStepInfoList")
public R<List<ProdTechnologyStepInfoVo>> getProdTechnologyStepInfolist(ProdTechnologyStepInfoBo bo) {
List<ProdTechnologyStepInfoVo> list = prodTechnologyStepInfoService.queryList(bo);
return R.ok(list);
}
}

@ -0,0 +1,75 @@
package org.dromara.mes.domain;
import org.dromara.common.tenant.core.TenantEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* prod_technology_info
*
* @author Yinq
* @date 2025-01-21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("prod_technology_info")
public class ProdTechnologyInfo extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "technology_id", type = IdType.AUTO)
private Long technologyId;
/**
* ID
*/
private Long processId;
/**
* ID
*/
private Long materialId;
/**
* 1 2
*/
private String machineType;
/**
* 1 2
*/
private String technologyType;
/**
*
*/
private String technologyVersion;
/**
*
*/
private Long standardTime;
/**
* 1 0
*/
private String activeFlag;
/**
*
*/
private String remark;
@TableField(exist = false)
private String processName;
@TableField(exist = false)
private String materialName;
}

@ -0,0 +1,71 @@
package org.dromara.mes.domain;
import org.dromara.common.tenant.core.TenantEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* prod_technology_step_info
*
* @author Yinq
* @date 2025-01-21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("prod_technology_step_info")
public class ProdTechnologyStepInfo extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "step_id", type = IdType.AUTO)
private Long stepId;
/**
* ID
*/
private Long technologyId;
/**
*
*/
private Long stepCode;
/**
*
*/
private String stepName;
/**
*
*/
private Long stepTime;
/**
*
*/
private String stepParameter;
/**
*
*/
private String valueState;
/**
* 1 0
*/
private String activeFlag;
/**
*
*/
private String remark;
}

@ -0,0 +1,71 @@
package org.dromara.mes.domain.bo;
import org.dromara.mes.domain.ProdTechnologyInfo;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
/**
* prod_technology_info
*
* @author Yinq
* @date 2025-01-21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = ProdTechnologyInfo.class, reverseConvertGenerate = false)
public class ProdTechnologyInfoBo extends BaseEntity {
/**
*
*/
private Long technologyId;
/**
* ID
*/
@NotNull(message = "工序ID不能为空", groups = {AddGroup.class, EditGroup.class})
private Long processId;
/**
* ID
*/
@NotNull(message = "物料ID不能为空", groups = {AddGroup.class, EditGroup.class})
private Long materialId;
/**
* 1 2
*/
private String machineType;
/**
* 1 2
*/
private String technologyType;
/**
*
*/
private String technologyVersion;
/**
*
*/
private Long standardTime;
/**
* 1 0
*/
private String activeFlag;
/**
*
*/
private String remark;
}

@ -0,0 +1,72 @@
package org.dromara.mes.domain.bo;
import org.dromara.mes.domain.ProdTechnologyStepInfo;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
/**
* prod_technology_step_info
*
* @author Yinq
* @date 2025-01-21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = ProdTechnologyStepInfo.class, reverseConvertGenerate = false)
public class ProdTechnologyStepInfoBo extends BaseEntity {
/**
*
*/
private Long stepId;
/**
* ID
*/
@NotNull(message = "工艺ID不能为空", groups = { AddGroup.class, EditGroup.class })
private Long technologyId;
/**
*
*/
@NotNull(message = "步序编号不能为空", groups = { AddGroup.class, EditGroup.class })
private Long stepCode;
/**
*
*/
@NotBlank(message = "步序名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String stepName;
/**
*
*/
private Long stepTime;
/**
*
*/
private String stepParameter;
/**
*
*/
private String valueState;
/**
* 1 0
*/
private String activeFlag;
/**
*
*/
private String remark;
}

@ -0,0 +1,93 @@
package org.dromara.mes.domain.vo;
import org.dromara.mes.domain.ProdTechnologyInfo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* prod_technology_info
*
* @author Yinq
* @date 2025-01-21
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = ProdTechnologyInfo.class)
public class ProdTechnologyInfoVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelProperty(value = "主键标识")
private Long technologyId;
/**
* ID
*/
@ExcelProperty(value = "工序ID")
private Long processId;
/**
* ID
*/
@ExcelProperty(value = "物料ID")
private Long materialId;
/**
* 1 2
*/
@ExcelProperty(value = "机台类型", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "mes_machine_type")
private String machineType;
/**
* 1 2
*/
@ExcelProperty(value = "工艺类型", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "mes_technology_type")
private String technologyType;
/**
*
*/
@ExcelProperty(value = "工艺版本")
private String technologyVersion;
/**
*
*/
@ExcelProperty(value = "硫化标准时间", converter = ExcelDictConvert.class)
private Long standardTime;
/**
* 1 0
*/
@ExcelProperty(value = "激活标识", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "active_flag")
private String activeFlag;
/**
*
*/
@ExcelProperty(value = "备注")
private String remark;
@ExcelProperty(value = "工序名称")
private String processName;
@ExcelProperty(value = "物料名称")
private String materialName;
}

@ -0,0 +1,87 @@
package org.dromara.mes.domain.vo;
import org.dromara.mes.domain.ProdTechnologyStepInfo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* prod_technology_step_info
*
* @author Yinq
* @date 2025-01-21
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = ProdTechnologyStepInfo.class)
public class ProdTechnologyStepInfoVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelProperty(value = "主键标识")
private Long stepId;
/**
* ID
*/
@ExcelProperty(value = "工艺ID")
private Long technologyId;
/**
*
*/
@ExcelProperty(value = "步序编号")
private Long stepCode;
/**
*
*/
@ExcelProperty(value = "步序名称")
private String stepName;
/**
*
*/
@ExcelProperty(value = "步序时间", converter = ExcelDictConvert.class)
private Long stepTime;
/**
*
*/
@ExcelProperty(value = "步序参数")
private String stepParameter;
/**
*
*/
@ExcelProperty(value = "阀门状态")
private String valueState;
/**
* 1 0
*/
@ExcelProperty(value = "激活标识", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "active_flag")
private String activeFlag;
/**
*
*/
@ExcelProperty(value = "备注")
private String remark;
}

@ -0,0 +1,15 @@
package org.dromara.mes.mapper;
import org.dromara.mes.domain.ProdTechnologyInfo;
import org.dromara.mes.domain.vo.ProdTechnologyInfoVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
/**
* Mapper
*
* @author Yinq
* @date 2025-01-21
*/
public interface ProdTechnologyInfoMapper extends BaseMapperPlus<ProdTechnologyInfo, ProdTechnologyInfoVo> {
}

@ -0,0 +1,15 @@
package org.dromara.mes.mapper;
import org.dromara.mes.domain.ProdTechnologyStepInfo;
import org.dromara.mes.domain.vo.ProdTechnologyStepInfoVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
/**
* Mapper
*
* @author Yinq
* @date 2025-01-21
*/
public interface ProdTechnologyStepInfoMapper extends BaseMapperPlus<ProdTechnologyStepInfo, ProdTechnologyStepInfoVo> {
}

@ -0,0 +1,69 @@
package org.dromara.mes.service;
import org.dromara.mes.domain.ProdTechnologyInfo;
import org.dromara.mes.domain.vo.ProdTechnologyInfoVo;
import org.dromara.mes.domain.bo.ProdTechnologyInfoBo;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-01-21
*/
public interface IProdTechnologyInfoService {
/**
*
*
* @param technologyId
* @return
*/
ProdTechnologyInfoVo queryById(Long technologyId);
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<ProdTechnologyInfoVo> queryPageList(ProdTechnologyInfoBo bo, PageQuery pageQuery);
/**
*
*
* @param bo
* @return
*/
List<ProdTechnologyInfoVo> queryList(ProdTechnologyInfoBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean insertByBo(ProdTechnologyInfoBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean updateByBo(ProdTechnologyInfoBo bo);
/**
*
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

@ -0,0 +1,69 @@
package org.dromara.mes.service;
import org.dromara.mes.domain.ProdTechnologyStepInfo;
import org.dromara.mes.domain.vo.ProdTechnologyStepInfoVo;
import org.dromara.mes.domain.bo.ProdTechnologyStepInfoBo;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-01-21
*/
public interface IProdTechnologyStepInfoService {
/**
*
*
* @param stepId
* @return
*/
ProdTechnologyStepInfoVo queryById(Long stepId);
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<ProdTechnologyStepInfoVo> queryPageList(ProdTechnologyStepInfoBo bo, PageQuery pageQuery);
/**
*
*
* @param bo
* @return
*/
List<ProdTechnologyStepInfoVo> queryList(ProdTechnologyStepInfoBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean insertByBo(ProdTechnologyStepInfoBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean updateByBo(ProdTechnologyStepInfoBo bo);
/**
*
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

@ -58,7 +58,12 @@ public class ProdPlanInfoServiceImpl implements IProdPlanInfoService {
public TableDataInfo<ProdPlanInfoVo> queryPageList(ProdPlanInfoBo bo, PageQuery pageQuery) {
MPJLambdaWrapper<ProdPlanInfo> lqw = buildQueryWrapper(bo);
Long workshopId = bo.getWorkshopId();
String tableName = DatabaseConstants.TABLE_NAME_PROD_PLAN_INFO_PREFIX + "_" + workshopId;
String tableName = null;
if (StringUtils.isNull(workshopId)){
tableName = DatabaseConstants.TABLE_NAME_PROD_PLAN_INFO_PREFIX;
} else {
tableName = DatabaseConstants.TABLE_NAME_PROD_PLAN_INFO_PREFIX + "_" + workshopId;
}
Page<ProdPlanInfoVo> result = baseMapper.selectProdPlanInfoList(pageQuery.build(), tableName, lqw);
return TableDataInfo.build(result);
}

@ -0,0 +1,149 @@
package org.dromara.mes.service.impl;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.dromara.mes.domain.BaseMaterialInfo;
import org.dromara.mes.domain.ProdBaseProcessInfo;
import org.springframework.stereotype.Service;
import org.dromara.mes.domain.bo.ProdTechnologyInfoBo;
import org.dromara.mes.domain.vo.ProdTechnologyInfoVo;
import org.dromara.mes.domain.ProdTechnologyInfo;
import org.dromara.mes.mapper.ProdTechnologyInfoMapper;
import org.dromara.mes.service.IProdTechnologyInfoService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* Service
*
* @author Yinq
* @date 2025-01-21
*/
@RequiredArgsConstructor
@Service
public class ProdTechnologyInfoServiceImpl implements IProdTechnologyInfoService {
private final ProdTechnologyInfoMapper baseMapper;
/**
*
*
* @param technologyId
* @return
*/
@Override
public ProdTechnologyInfoVo queryById(Long technologyId) {
ProdTechnologyInfoBo bo = new ProdTechnologyInfoBo();
bo.setTechnologyId(technologyId);
MPJLambdaWrapper<ProdTechnologyInfo> lqw = buildQueryWrapper(bo);
List<ProdTechnologyInfoVo> voList = baseMapper.selectVoList(lqw);
return voList.get(0);
}
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
@Override
public TableDataInfo<ProdTechnologyInfoVo> queryPageList(ProdTechnologyInfoBo bo, PageQuery pageQuery) {
MPJLambdaWrapper<ProdTechnologyInfo> lqw = buildQueryWrapper(bo);
Page<ProdTechnologyInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*
* @param bo
* @return
*/
@Override
public List<ProdTechnologyInfoVo> queryList(ProdTechnologyInfoBo bo) {
MPJLambdaWrapper<ProdTechnologyInfo> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<ProdTechnologyInfo> buildQueryWrapper(ProdTechnologyInfoBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<ProdTechnologyInfo> lqw = JoinWrappers.lambda(ProdTechnologyInfo.class)
.selectAll(ProdTechnologyInfo.class)
.select(ProdBaseProcessInfo::getProcessName)
.select(BaseMaterialInfo::getMaterialName)
.leftJoin(ProdBaseProcessInfo.class, ProdBaseProcessInfo::getProcessId, ProdTechnologyInfo::getProcessId)
.leftJoin(BaseMaterialInfo.class, BaseMaterialInfo::getMaterialId, ProdTechnologyInfo::getMaterialId)
.eq(bo.getTechnologyId() != null, ProdTechnologyInfo::getTechnologyId, bo.getTechnologyId())
.eq(bo.getProcessId() != null, ProdTechnologyInfo::getProcessId, bo.getProcessId())
.eq(bo.getMaterialId() != null, ProdTechnologyInfo::getMaterialId, bo.getMaterialId())
.eq(StringUtils.isNotBlank(bo.getMachineType()), ProdTechnologyInfo::getMachineType, bo.getMachineType())
.eq(StringUtils.isNotBlank(bo.getTechnologyType()), ProdTechnologyInfo::getTechnologyType, bo.getTechnologyType())
.eq(StringUtils.isNotBlank(bo.getTechnologyVersion()), ProdTechnologyInfo::getTechnologyVersion, bo.getTechnologyVersion())
.eq(bo.getStandardTime() != null, ProdTechnologyInfo::getStandardTime, bo.getStandardTime())
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), ProdTechnologyInfo::getActiveFlag, bo.getActiveFlag())
.orderByDesc(ProdTechnologyInfo::getCreateTime);
return lqw;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean insertByBo(ProdTechnologyInfoBo bo) {
ProdTechnologyInfo add = MapstructUtils.convert(bo, ProdTechnologyInfo.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setTechnologyId(add.getTechnologyId());
}
return flag;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean updateByBo(ProdTechnologyInfoBo bo) {
ProdTechnologyInfo update = MapstructUtils.convert(bo, ProdTechnologyInfo.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(ProdTechnologyInfo entity) {
//TODO 做一些数据校验,如唯一约束
}
/**
*
*
* @param ids
* @param isValid
* @return
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if (isValid) {
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
}
}

@ -0,0 +1,139 @@
package org.dromara.mes.service.impl;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.dromara.mes.domain.bo.ProdTechnologyStepInfoBo;
import org.dromara.mes.domain.vo.ProdTechnologyStepInfoVo;
import org.dromara.mes.domain.ProdTechnologyStepInfo;
import org.dromara.mes.mapper.ProdTechnologyStepInfoMapper;
import org.dromara.mes.service.IProdTechnologyStepInfoService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* Service
*
* @author Yinq
* @date 2025-01-21
*/
@RequiredArgsConstructor
@Service
public class ProdTechnologyStepInfoServiceImpl implements IProdTechnologyStepInfoService {
private final ProdTechnologyStepInfoMapper baseMapper;
/**
*
*
* @param stepId
* @return
*/
@Override
public ProdTechnologyStepInfoVo queryById(Long stepId){
return baseMapper.selectVoById(stepId);
}
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
@Override
public TableDataInfo<ProdTechnologyStepInfoVo> queryPageList(ProdTechnologyStepInfoBo bo, PageQuery pageQuery) {
MPJLambdaWrapper<ProdTechnologyStepInfo> lqw = buildQueryWrapper(bo);
Page<ProdTechnologyStepInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*
* @param bo
* @return
*/
@Override
public List<ProdTechnologyStepInfoVo> queryList(ProdTechnologyStepInfoBo bo) {
MPJLambdaWrapper<ProdTechnologyStepInfo> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<ProdTechnologyStepInfo> buildQueryWrapper(ProdTechnologyStepInfoBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<ProdTechnologyStepInfo> lqw = JoinWrappers.lambda(ProdTechnologyStepInfo.class)
.selectAll(ProdTechnologyStepInfo.class)
.eq(bo.getStepId() != null, ProdTechnologyStepInfo::getStepId, bo.getStepId())
.eq(bo.getTechnologyId() != null, ProdTechnologyStepInfo::getTechnologyId, bo.getTechnologyId())
.eq(bo.getStepCode() != null, ProdTechnologyStepInfo::getStepCode, bo.getStepCode())
.like(StringUtils.isNotBlank(bo.getStepName()), ProdTechnologyStepInfo::getStepName, bo.getStepName())
.eq(bo.getStepTime() != null, ProdTechnologyStepInfo::getStepTime, bo.getStepTime())
.eq(StringUtils.isNotBlank(bo.getStepParameter()), ProdTechnologyStepInfo::getStepParameter, bo.getStepParameter())
.eq(StringUtils.isNotBlank(bo.getValueState()), ProdTechnologyStepInfo::getValueState, bo.getValueState())
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), ProdTechnologyStepInfo::getActiveFlag, bo.getActiveFlag())
.orderByDesc(ProdTechnologyStepInfo::getCreateTime);
return lqw;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean insertByBo(ProdTechnologyStepInfoBo bo) {
ProdTechnologyStepInfo add = MapstructUtils.convert(bo, ProdTechnologyStepInfo.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setStepId(add.getStepId());
}
return flag;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean updateByBo(ProdTechnologyStepInfoBo bo) {
ProdTechnologyStepInfo update = MapstructUtils.convert(bo, ProdTechnologyStepInfo.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(ProdTechnologyStepInfo entity){
//TODO 做一些数据校验,如唯一约束
}
/**
*
*
* @param ids
* @param isValid
* @return
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
}
}

@ -93,7 +93,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectProdPlanInfoJoinProcessList" parameterType="ProdPlanInfo" resultMap="ProdPlanInfoResult">
select mpp.plan_id,
select
mpp.plan_id,
mpp.product_order_id,
mpp.plan_code,
mpp.dispatch_code,
@ -102,7 +103,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mpp.process_id,
bpi.process_name,
bpi.process_type,
mpp.process_order,
mpp.last_process_id,
mpp.final_process_flag,
@ -116,29 +116,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mpp.real_begin_time,
mpp.real_end_time,
mpp.attach_id,
mpp.plan_status,
mpp.remark,
mpp.create_by,
mpp.create_time,
mpp.update_by,
mpp.update_time,
mpp.release_type,
mpp.release_id,
case
when mpp.release_type = 2 then su.user_name
when mpp.release_type = 3 then pbsi_3.station_name
when mpp.release_type = 1 then pbsi_1.station_name
else null
end as release_name
when mpp.release_type = 1 then (select pbmi.machine_name
from prod_base_machine_info pbmi
where mpp.release_id = pbmi.machine_id)
when mpp.release_type = 2 then (select su.nick_name
from sys_user su
where mpp.release_id = su.user_id)
when mpp.release_type = 3 then (select pbsi.station_name
from prod_base_station_info pbsi
where mpp.release_id = pbsi.station_id)
end as release_name
from prod_plan_info mpp
left join prod_base_process_info bpi on bpi.process_id = mpp.process_id
left join sys_user su on mpp.release_type = 2 and mpp.release_id = su.user_id
left join prod_base_station_info pbsi_3 on mpp.release_type = 3 and mpp.release_id = pbsi_3.station_id
left join prod_base_station_info pbsi_1 on mpp.release_type = 1 and mpp.release_id = pbsi_1.station_id
<where>
<if test="productOrderId != null ">and mpp.product_order_id = #{productOrderId}</if>
<if test="planCode != null and planCode != ''">and mpp.plan_code = #{planCode}</if>
@ -148,8 +146,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="processId != null ">and mpp.process_id = #{processId}</if>
<if test="processOrder != null ">and mpp.process_order = #{processOrder}</if>
<if test="lastProcessId != null ">and mpp.last_process_id = #{lastProcessId}</if>
<if test="productionTime != null ">and mpp.production_time = #{productionTime}</if>
<if test="planAmount != null ">and mpp.plan_amount = #{planAmount}</if>
<if test="completeAmount != null ">and mpp.complete_amount = #{completeAmount}</if>
@ -159,8 +155,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="realEndTime != null ">and mpp.real_end_time = #{realEndTime}</if>
<if test="attachId != null and attachId != ''">and mpp.attach_id = #{attachId}</if>
<if test="planStatus != null and planStatus != ''">and mpp.plan_status = #{planStatus}</if>
</where>
order by mpp.dispatch_code,mpp.process_order
</select>

@ -0,0 +1,7 @@
<?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.dromara.mes.mapper.ProdTechnologyInfoMapper">
</mapper>

@ -0,0 +1,7 @@
<?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.dromara.mes.mapper.ProdTechnologyStepInfoMapper">
</mapper>
Loading…
Cancel
Save