master
parent
08715a54fc
commit
ff8ce551db
|
|
@ -109,7 +109,7 @@ public class BomService extends ServiceImpl<BomMapper, BomEntity> implements ISe
|
||||||
.ne(excludeId != null, BomEntity::getId, excludeId));
|
.ne(excludeId != null, BomEntity::getId, excludeId));
|
||||||
|
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
throw Exceptions.clierr("同一主产品的BOM版本号必须唯一");
|
throw Exceptions.clierr("同一主产品的物料版本号必须唯一");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -126,7 +126,7 @@ public class BomService extends ServiceImpl<BomMapper, BomEntity> implements ISe
|
||||||
.ne(excludeId != null, BomEntity::getId, excludeId));
|
.ne(excludeId != null, BomEntity::getId, excludeId));
|
||||||
|
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
throw Exceptions.clierr("同一主产品只能有一个可用的BOM");
|
throw Exceptions.clierr("同一主产品只能有一个可用的物料");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.njzscloud.common.core.utils.R;
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.dispose.mfg.craft.pojo.entity.CraftOperationEntity;
|
import com.njzscloud.dispose.mfg.craft.pojo.entity.CraftOperationEntity;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.param.SearchCraftOperationParam;
|
||||||
import com.njzscloud.dispose.mfg.craft.service.CraftOperationService;
|
import com.njzscloud.dispose.mfg.craft.service.CraftOperationService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -13,6 +14,7 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工序
|
* 工序
|
||||||
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
|
|
@ -60,7 +62,7 @@ public class CraftOperationController {
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
@GetMapping("/paging")
|
@GetMapping("/paging")
|
||||||
public R<PageResult<CraftOperationEntity>> paging(PageParam pageParam, CraftOperationEntity craftOperationEntity) {
|
public R<PageResult<CraftOperationEntity>> paging(PageParam pageParam, SearchCraftOperationParam operationParam) {
|
||||||
return R.success(craftOperationService.paging(pageParam, craftOperationEntity));
|
return R.success(craftOperationService.paging(pageParam, operationParam));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
package com.njzscloud.dispose.mfg.craft.pojo.entity;
|
package com.njzscloud.dispose.mfg.craft.pojo.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.njzscloud.common.core.ienum.DictItem;
|
||||||
|
import com.njzscloud.common.core.ienum.DictKey;
|
||||||
|
import com.njzscloud.common.mp.support.handler.j.DictItemTypeHandler;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
@ -11,6 +14,7 @@ import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工序
|
* 工序
|
||||||
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
|
@ -38,7 +42,9 @@ public class CraftOperationEntity {
|
||||||
/**
|
/**
|
||||||
* 工序类型;字典编码:operation_category
|
* 工序类型;字典编码:operation_category
|
||||||
*/
|
*/
|
||||||
private String operationCategory;
|
@DictKey("operation_category")
|
||||||
|
@TableField(typeHandler = DictItemTypeHandler.class)
|
||||||
|
private DictItem operationCategory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标准节拍;单位:N/分钟
|
* 标准节拍;单位:N/分钟
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.pojo.param;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序
|
||||||
|
*
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SearchCraftOperationParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编号
|
||||||
|
*/
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序名称
|
||||||
|
*/
|
||||||
|
private String operationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否质检节点;0-->否、1-->是
|
||||||
|
*/
|
||||||
|
private Boolean checkPoint;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否可用;0-->否、1-->是
|
||||||
|
*/
|
||||||
|
private Boolean canuse;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,12 +1,15 @@
|
||||||
package com.njzscloud.dispose.mfg.craft.service;
|
package com.njzscloud.dispose.mfg.craft.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.common.sn.support.SnUtil;
|
||||||
import com.njzscloud.dispose.mfg.craft.mapper.CraftOperationMapper;
|
import com.njzscloud.dispose.mfg.craft.mapper.CraftOperationMapper;
|
||||||
import com.njzscloud.dispose.mfg.craft.pojo.entity.CraftOperationEntity;
|
import com.njzscloud.dispose.mfg.craft.pojo.entity.CraftOperationEntity;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.param.SearchCraftOperationParam;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -16,6 +19,8 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工序
|
* 工序
|
||||||
|
*
|
||||||
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
|
|
@ -26,6 +31,7 @@ public class CraftOperationService extends ServiceImpl<CraftOperationMapper, Cra
|
||||||
* 新增
|
* 新增
|
||||||
*/
|
*/
|
||||||
public void add(CraftOperationEntity craftOperationEntity) {
|
public void add(CraftOperationEntity craftOperationEntity) {
|
||||||
|
craftOperationEntity.setSn(this.generateSn());
|
||||||
this.save(craftOperationEntity);
|
this.save(craftOperationEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -54,7 +60,25 @@ public class CraftOperationService extends ServiceImpl<CraftOperationMapper, Cra
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
public PageResult<CraftOperationEntity> paging(PageParam pageParam, CraftOperationEntity craftOperationEntity) {
|
public PageResult<CraftOperationEntity> paging(PageParam pageParam, SearchCraftOperationParam operationParam) {
|
||||||
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<CraftOperationEntity>query(craftOperationEntity)));
|
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<CraftOperationEntity>lambdaQuery()
|
||||||
|
.like(StrUtil.isNotBlank(operationParam.getSn()), CraftOperationEntity::getSn, operationParam.getSn())
|
||||||
|
.like(StrUtil.isNotBlank(operationParam.getOperationName()), CraftOperationEntity::getOperationName, operationParam.getOperationName())
|
||||||
|
.eq(operationParam.getCheckPoint() != null, CraftOperationEntity::getCheckPoint, operationParam.getCheckPoint())
|
||||||
|
.eq(operationParam.getCanuse() != null, CraftOperationEntity::getCanuse, operationParam.getCanuse())));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成编码
|
||||||
|
*
|
||||||
|
* @return sn 编码
|
||||||
|
*/
|
||||||
|
public String generateSn() {
|
||||||
|
String sn = SnUtil.next("Operation-SN");
|
||||||
|
if (this.exists(Wrappers.<CraftOperationEntity>lambdaQuery().eq(CraftOperationEntity::getSn, sn).eq(CraftOperationEntity::getDeleted, Boolean.FALSE))) {
|
||||||
|
this.generateSn();
|
||||||
|
}
|
||||||
|
return sn;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue