master
parent
148272f0bb
commit
0f1e69dc7f
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.njzscloud.dispose.mfg.bom.constant;
|
||||||
|
|
||||||
|
import com.njzscloud.common.core.ienum.DictStr;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典代码:mtl_type
|
||||||
|
* 字典名称:物料类型
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public enum MtlType implements DictStr {
|
||||||
|
YuanLiao("YuanLiao", "原料"),
|
||||||
|
|
||||||
|
FuChanPin("FuChanPin", "副产品"),
|
||||||
|
|
||||||
|
ZhuChanPin("ZhuChanPin", "主产品"),
|
||||||
|
|
||||||
|
;
|
||||||
|
private final String val;
|
||||||
|
|
||||||
|
private final String txt;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,66 @@
|
||||||
|
package com.njzscloud.dispose.mfg.bom.controller;
|
||||||
|
|
||||||
|
import com.njzscloud.common.core.utils.R;
|
||||||
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.dispose.mfg.bom.pojo.entity.BomEntity;
|
||||||
|
import com.njzscloud.dispose.mfg.bom.service.BomService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料清单
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/bom")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class BomController {
|
||||||
|
private final BomService bomService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/add")
|
||||||
|
public R<?> add(@RequestBody BomEntity bomEntity) {
|
||||||
|
bomService.add(bomEntity);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/modify")
|
||||||
|
public R<?> modify(@RequestBody BomEntity bomEntity) {
|
||||||
|
bomService.modify(bomEntity);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/del")
|
||||||
|
public R<?> del(@RequestBody List<Long> ids) {
|
||||||
|
bomService.del(ids);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
public R<BomEntity> detail(@RequestParam("id") Long id) {
|
||||||
|
return R.success(bomService.detail(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*/
|
||||||
|
@GetMapping("/paging")
|
||||||
|
public R<PageResult<BomEntity>> paging(PageParam pageParam, BomEntity bomEntity) {
|
||||||
|
return R.success(bomService.paging(pageParam, bomEntity));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,66 @@
|
||||||
|
package com.njzscloud.dispose.mfg.bom.controller;
|
||||||
|
|
||||||
|
import com.njzscloud.common.core.utils.R;
|
||||||
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.dispose.mfg.bom.pojo.entity.BomDetailEntity;
|
||||||
|
import com.njzscloud.dispose.mfg.bom.service.BomDetailService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料清单明细
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/bom_detail")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class BomDetailController {
|
||||||
|
private final BomDetailService bomDetailService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/add")
|
||||||
|
public R<?> add(@RequestBody BomDetailEntity bomDetailEntity) {
|
||||||
|
bomDetailService.add(bomDetailEntity);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/modify")
|
||||||
|
public R<?> modify(@RequestBody BomDetailEntity bomDetailEntity) {
|
||||||
|
bomDetailService.modify(bomDetailEntity);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/del")
|
||||||
|
public R<?> del(@RequestBody List<Long> ids) {
|
||||||
|
bomDetailService.del(ids);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
public R<BomDetailEntity> detail(@RequestParam("id") Long id) {
|
||||||
|
return R.success(bomDetailService.detail(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*/
|
||||||
|
@GetMapping("/paging")
|
||||||
|
public R<PageResult<BomDetailEntity>> paging(PageParam pageParam, BomDetailEntity bomDetailEntity) {
|
||||||
|
return R.success(bomDetailService.paging(pageParam, bomDetailEntity));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.njzscloud.dispose.mfg.bom.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njzscloud.dispose.mfg.bom.pojo.entity.BomDetailEntity;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料清单明细
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BomDetailMapper extends BaseMapper<BomDetailEntity> {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.njzscloud.dispose.mfg.bom.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njzscloud.dispose.mfg.bom.pojo.entity.BomEntity;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料清单
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BomMapper extends BaseMapper<BomEntity> {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
package com.njzscloud.dispose.mfg.bom.pojo.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njzscloud.dispose.mfg.bom.constant.MtlType;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料清单明细
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("mfg_bom_detail")
|
||||||
|
public class BomDetailEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Id
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料清单 Id;mfg_bom.id
|
||||||
|
*/
|
||||||
|
private Long bomId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品 Id;gds_goods.id
|
||||||
|
*/
|
||||||
|
private Long goodsId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料类型,YuanLiao-->原料、FuChanPin-->副产品、ZhuChanPin-->主产品
|
||||||
|
*/
|
||||||
|
private MtlType mtlType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否为产出;0-->否、1-->是
|
||||||
|
*/
|
||||||
|
private Boolean chu;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消耗/产出量;如果为产出,则此值为 1
|
||||||
|
*/
|
||||||
|
private BigDecimal quantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否必需;0-->否、1-->是
|
||||||
|
*/
|
||||||
|
private Boolean mandatory;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,82 @@
|
||||||
|
package com.njzscloud.dispose.mfg.bom.pojo.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料清单
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("mfg_bom")
|
||||||
|
public class BomEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Id
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编码
|
||||||
|
*/
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主产品 Id;gds_goods.id
|
||||||
|
*/
|
||||||
|
private Long goodId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料清单版本号
|
||||||
|
*/
|
||||||
|
private String bomVer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否可用;0-->否、1-->是
|
||||||
|
*/
|
||||||
|
private Boolean canuse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String memo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人 Id; sys_user.id
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private Long creatorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人 Id; sys_user.id
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private Long modifierId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private LocalDateTime modifyTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除; 0-->未删除、1-->已删除
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Boolean deleted;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.njzscloud.dispose.mfg.bom.pojo.result;
|
||||||
|
|
||||||
|
import com.njzscloud.dispose.mfg.bom.constant.MtlType;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料清单明细
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SearchBomDetailResult {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料清单 Id;mfg_bom.id
|
||||||
|
*/
|
||||||
|
private Long bomId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品 Id;gds_goods.id
|
||||||
|
*/
|
||||||
|
private Long goodsId;
|
||||||
|
/**
|
||||||
|
* 产品名称
|
||||||
|
*/
|
||||||
|
private String goodsName;
|
||||||
|
/**
|
||||||
|
* 产品编码
|
||||||
|
*/
|
||||||
|
private String goodsSn;
|
||||||
|
/**
|
||||||
|
* 物料类型,YuanLiao-->原料、FuChanPin-->副产品、ZhuChanPin-->主产品
|
||||||
|
*/
|
||||||
|
private MtlType mtlType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否为产出;0-->否、1-->是
|
||||||
|
*/
|
||||||
|
private Boolean chu;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消耗/产出量;如果为产出,则此值为 1
|
||||||
|
*/
|
||||||
|
private BigDecimal quantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否必需;0-->否、1-->是
|
||||||
|
*/
|
||||||
|
private Boolean mandatory;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.njzscloud.dispose.mfg.bom.pojo.result;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料清单
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SearchBomResult {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编码
|
||||||
|
*/
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主产品 Id;gds_goods.id
|
||||||
|
*/
|
||||||
|
private Long goodId;
|
||||||
|
/**
|
||||||
|
* 主产品名称
|
||||||
|
*/
|
||||||
|
private String goodsName;
|
||||||
|
/**
|
||||||
|
* 主产品编码
|
||||||
|
*/
|
||||||
|
private String goodsSn;
|
||||||
|
/**
|
||||||
|
* 物料清单版本号
|
||||||
|
*/
|
||||||
|
private String bomVer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否可用;0-->否、1-->是
|
||||||
|
*/
|
||||||
|
private Boolean canuse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String memo;
|
||||||
|
|
||||||
|
private List<SearchBomDetailResult> details;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
package com.njzscloud.dispose.mfg.bom.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.dispose.mfg.bom.mapper.BomDetailMapper;
|
||||||
|
import com.njzscloud.dispose.mfg.bom.pojo.entity.BomDetailEntity;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料清单明细
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class BomDetailService extends ServiceImpl<BomDetailMapper, BomDetailEntity> implements IService<BomDetailEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
public void add(BomDetailEntity bomDetailEntity) {
|
||||||
|
this.save(bomDetailEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
public void modify(BomDetailEntity bomDetailEntity) {
|
||||||
|
this.updateById(bomDetailEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void del(List<Long> ids) {
|
||||||
|
this.removeBatchByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
public BomDetailEntity detail(Long id) {
|
||||||
|
return this.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*/
|
||||||
|
public PageResult<BomDetailEntity> paging(PageParam pageParam, BomDetailEntity bomDetailEntity) {
|
||||||
|
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<BomDetailEntity>query(bomDetailEntity)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
package com.njzscloud.dispose.mfg.bom.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.dispose.mfg.bom.mapper.BomMapper;
|
||||||
|
import com.njzscloud.dispose.mfg.bom.pojo.entity.BomEntity;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料清单
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class BomService extends ServiceImpl<BomMapper, BomEntity> implements IService<BomEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
public void add(BomEntity bomEntity) {
|
||||||
|
this.save(bomEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
public void modify(BomEntity bomEntity) {
|
||||||
|
this.updateById(bomEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void del(List<Long> ids) {
|
||||||
|
this.removeBatchByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
public BomEntity detail(Long id) {
|
||||||
|
return this.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*/
|
||||||
|
public PageResult<BomEntity> paging(PageParam pageParam, BomEntity bomEntity) {
|
||||||
|
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<BomEntity>query(bomEntity)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.constant;
|
||||||
|
|
||||||
|
import com.njzscloud.common.core.ienum.DictStr;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典代码:craft_category
|
||||||
|
* 字典名称:工艺类型
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public enum CraftCategory implements DictStr {
|
||||||
|
ZiDongHua("ZiDongHua", "自动化"),
|
||||||
|
|
||||||
|
RenGong("RenGong", "人工"),
|
||||||
|
|
||||||
|
;
|
||||||
|
private final String val;
|
||||||
|
|
||||||
|
private final String txt;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.controller;
|
||||||
|
|
||||||
|
import com.njzscloud.common.core.utils.R;
|
||||||
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.entity.CraftEntity;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.param.AddCraftParam;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.param.SearchCraftParam;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.result.SearchCraftResult;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.service.CraftService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/craft")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class CraftController {
|
||||||
|
private final CraftService craftService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/add")
|
||||||
|
public R<?> add(@RequestBody AddCraftParam addCraftParam) {
|
||||||
|
craftService.add(addCraftParam);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/modify")
|
||||||
|
public R<?> modify(@RequestBody CraftEntity craftEntity) {
|
||||||
|
craftService.modify(craftEntity);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/del")
|
||||||
|
public R<?> del(@RequestBody List<Long> ids) {
|
||||||
|
craftService.del(ids);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
public R<SearchCraftResult> detail(@RequestParam("id") Long id) {
|
||||||
|
return R.success(craftService.detail(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*/
|
||||||
|
@GetMapping("/paging")
|
||||||
|
public R<PageResult<SearchCraftResult>> paging(PageParam pageParam, SearchCraftParam searchCraftParam) {
|
||||||
|
return R.success(craftService.paging(pageParam, searchCraftParam));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,66 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.controller;
|
||||||
|
|
||||||
|
import com.njzscloud.common.core.utils.R;
|
||||||
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.entity.CraftOperationEntity;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.service.CraftOperationService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/craft_operation")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class CraftOperationController {
|
||||||
|
private final CraftOperationService craftOperationService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/add")
|
||||||
|
public R<?> add(@RequestBody CraftOperationEntity craftOperationEntity) {
|
||||||
|
craftOperationService.add(craftOperationEntity);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/modify")
|
||||||
|
public R<?> modify(@RequestBody CraftOperationEntity craftOperationEntity) {
|
||||||
|
craftOperationService.modify(craftOperationEntity);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/del")
|
||||||
|
public R<?> del(@RequestBody List<Long> ids) {
|
||||||
|
craftOperationService.del(ids);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
public R<CraftOperationEntity> detail(@RequestParam("id") Long id) {
|
||||||
|
return R.success(craftOperationService.detail(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*/
|
||||||
|
@GetMapping("/paging")
|
||||||
|
public R<PageResult<CraftOperationEntity>> paging(PageParam pageParam, CraftOperationEntity craftOperationEntity) {
|
||||||
|
return R.success(craftOperationService.paging(pageParam, craftOperationEntity));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,87 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.controller;
|
||||||
|
|
||||||
|
import com.njzscloud.common.core.utils.R;
|
||||||
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.entity.CraftWayEntity;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.param.AddAllCraftWayParam;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.result.SearchCraftWayResult;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.service.CraftWayService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺路线
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/craft_way")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class CraftWayController {
|
||||||
|
private final CraftWayService craftWayService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/add")
|
||||||
|
public R<?> add(@RequestBody CraftWayEntity craftWayEntity) {
|
||||||
|
craftWayService.add(craftWayEntity);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/add_all")
|
||||||
|
public R<?> addAll(@RequestBody AddAllCraftWayParam addAllCraftWayParam) {
|
||||||
|
craftWayService.addAll(addAllCraftWayParam);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/modify")
|
||||||
|
public R<?> modify(@RequestBody CraftWayEntity craftWayEntity) {
|
||||||
|
craftWayService.modify(craftWayEntity);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/del")
|
||||||
|
public R<?> del(@RequestBody List<Long> ids) {
|
||||||
|
craftWayService.del(ids);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
public R<CraftWayEntity> detail(@RequestParam("id") Long id) {
|
||||||
|
return R.success(craftWayService.detail(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*/
|
||||||
|
@GetMapping("/paging")
|
||||||
|
public R<PageResult<CraftWayEntity>> paging(PageParam pageParam, CraftWayEntity craftWayEntity) {
|
||||||
|
return R.success(craftWayService.paging(pageParam, craftWayEntity));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工艺路线列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list_all")
|
||||||
|
public R<List<SearchCraftWayResult>> listAll(Long craftId) {
|
||||||
|
return R.success(craftWayService.listAll(craftId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.entity.CraftEntity;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.result.SearchCraftResult;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface CraftMapper extends BaseMapper<CraftEntity> {
|
||||||
|
SearchCraftResult detail(@Param("id") Long id);
|
||||||
|
|
||||||
|
IPage<SearchCraftResult> paging(Page<Object> page, @Param("ew") QueryWrapper<Object> ew);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.entity.CraftOperationEntity;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface CraftOperationMapper extends BaseMapper<CraftOperationEntity> {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njzscloud.dispose.mfg.bom.pojo.result.SearchBomDetailResult;
|
||||||
|
import com.njzscloud.dispose.mfg.bom.pojo.result.SearchBomResult;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.entity.CraftWayEntity;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.result.SearchCraftOperationResult;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺路线
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface CraftWayMapper extends BaseMapper<CraftWayEntity> {
|
||||||
|
List<SearchCraftOperationResult> listOperations(@Param("ew") QueryWrapper<Object> ew);
|
||||||
|
|
||||||
|
List<SearchBomResult> listBom(@Param("ew") QueryWrapper<Object> ew);
|
||||||
|
|
||||||
|
List<SearchBomDetailResult> listBomDetail(@Param("ew") QueryWrapper<Object> ew);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,93 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.pojo.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.constant.CraftCategory;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("mfg_craft")
|
||||||
|
public class CraftEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Id
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编码
|
||||||
|
*/
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终产品 Id
|
||||||
|
*/
|
||||||
|
private Long goodsId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺名称
|
||||||
|
*/
|
||||||
|
private String craftName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺版本号
|
||||||
|
*/
|
||||||
|
private String craftVer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺类型;字典编码:craft_category,ZiDongHua-->自动化、RenGong-->人工
|
||||||
|
*/
|
||||||
|
private CraftCategory craftCategory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否可用;0-->否、1-->是
|
||||||
|
*/
|
||||||
|
private Boolean canuse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String memo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人 Id; sys_user.id
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private Long creatorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人 Id; sys_user.id
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private Long modifierId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private LocalDateTime modifyTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除; 0-->未删除、1-->已删除
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Boolean deleted;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,93 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.pojo.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("mfg_craft_operation")
|
||||||
|
public class CraftOperationEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Id
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编号
|
||||||
|
*/
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序名称
|
||||||
|
*/
|
||||||
|
private String operationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序类型;字典编码:operation_category
|
||||||
|
*/
|
||||||
|
private String operationCategory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标准节拍;单位:N/分钟
|
||||||
|
*/
|
||||||
|
private BigDecimal stdCycle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否质检节点;0-->否、1-->是
|
||||||
|
*/
|
||||||
|
private Boolean checkPoint;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否可用;0-->否、1-->是
|
||||||
|
*/
|
||||||
|
private Boolean canuse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String memo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人 Id;sys_user.id
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private Long creatorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人 Id;sys_user.id
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private Long modifierId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private LocalDateTime modifyTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除; 0-->未删除、1-->已删除
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Boolean deleted;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.pojo.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺路线
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("mfg_craft_way")
|
||||||
|
public class CraftWayEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Id
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺 Id
|
||||||
|
*/
|
||||||
|
private Long craftId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序 Id;mfg_craft_operation.id
|
||||||
|
*/
|
||||||
|
private Long operationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料清单 Id
|
||||||
|
*/
|
||||||
|
private Long bomId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 步骤;同一工艺下相同步骤的工序为并行工序
|
||||||
|
*/
|
||||||
|
private Integer step;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String memo;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.pojo.param;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class AddAllCraftWayParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺 Id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "工艺不能为空")
|
||||||
|
private Long craftId;
|
||||||
|
/**
|
||||||
|
* 工艺路线
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "工艺路线不能为空")
|
||||||
|
private List<AddCraftWayParam> craftWayList;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.pojo.param;
|
||||||
|
|
||||||
|
import com.njzscloud.dispose.mfg.craft.constant.CraftCategory;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class AddCraftParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终产品 Id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "终产品不能为空")
|
||||||
|
private Long goodsId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "工艺名称不能为空")
|
||||||
|
private String craftName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺版本号
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "工艺版本号不能为空")
|
||||||
|
private String craftVer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺类型;字典编码:craft_category,ZiDongHua-->自动化、RenGong-->人工
|
||||||
|
*/
|
||||||
|
@NotNull(message = "工艺类型不能为空")
|
||||||
|
private CraftCategory craftCategory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否可用;0-->否、1-->是
|
||||||
|
*/
|
||||||
|
@NotNull(message = "是否可用不能为空")
|
||||||
|
private Boolean canuse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String memo;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.pojo.param;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺路线
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class AddCraftWayParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序 Id;mfg_craft_operation.id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "工序不能为空")
|
||||||
|
private Long operationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料清单 Id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "物料清单不能为空")
|
||||||
|
private Long bomId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 步骤;同一工艺下相同步骤的工序为并行工序
|
||||||
|
*/
|
||||||
|
@NotNull(message = "步骤不能为空")
|
||||||
|
private Integer step;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String memo;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.pojo.param;
|
||||||
|
|
||||||
|
import com.njzscloud.dispose.mfg.craft.constant.CraftCategory;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SearchCraftParam {
|
||||||
|
/**
|
||||||
|
* 工艺名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "工艺名称不能为空")
|
||||||
|
private String craftName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺版本号
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "工艺版本号不能为空")
|
||||||
|
private String craftVer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺类型;字典编码:craft_category,ZiDongHua-->自动化、RenGong-->人工
|
||||||
|
*/
|
||||||
|
@NotNull(message = "工艺类型不能为空")
|
||||||
|
private CraftCategory craftCategory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否可用;0-->否、1-->是
|
||||||
|
*/
|
||||||
|
@NotNull(message = "是否可用不能为空")
|
||||||
|
private Boolean canuse;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.pojo.result;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SearchCraftOperationResult {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编号
|
||||||
|
*/
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序名称
|
||||||
|
*/
|
||||||
|
private String operationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序类型;字典编码:operation_category
|
||||||
|
*/
|
||||||
|
private String operationCategory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标准节拍;单位:N/分钟
|
||||||
|
*/
|
||||||
|
private BigDecimal stdCycle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否质检节点;0-->否、1-->是
|
||||||
|
*/
|
||||||
|
private Boolean checkPoint;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否可用;0-->否、1-->是
|
||||||
|
*/
|
||||||
|
private Boolean canuse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String memo;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.pojo.result;
|
||||||
|
|
||||||
|
import com.njzscloud.dispose.mfg.craft.constant.CraftCategory;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SearchCraftResult {
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编码
|
||||||
|
*/
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终产品 Id
|
||||||
|
*/
|
||||||
|
private Long goodsId;
|
||||||
|
/**
|
||||||
|
* 终产品名称
|
||||||
|
*/
|
||||||
|
private String goodsName;
|
||||||
|
/**
|
||||||
|
* 终产品编码
|
||||||
|
*/
|
||||||
|
private String goodsSn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺名称
|
||||||
|
*/
|
||||||
|
private String craftName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺版本号
|
||||||
|
*/
|
||||||
|
private String craftVer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺类型;字典编码:craft_category,ZiDongHua-->自动化、RenGong-->人工
|
||||||
|
*/
|
||||||
|
private CraftCategory craftCategory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否可用;0-->否、1-->是
|
||||||
|
*/
|
||||||
|
private Boolean canuse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String memo;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.pojo.result;
|
||||||
|
|
||||||
|
import com.njzscloud.dispose.mfg.bom.pojo.result.SearchBomResult;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺路线
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SearchCraftWayResult {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 工艺 Id
|
||||||
|
*/
|
||||||
|
private Long craftId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序 Id;mfg_craft_operation.id
|
||||||
|
*/
|
||||||
|
private Long operationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料清单 Id
|
||||||
|
*/
|
||||||
|
private Long bomId;
|
||||||
|
/**
|
||||||
|
* 工序
|
||||||
|
*/
|
||||||
|
private SearchCraftOperationResult operation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料清单
|
||||||
|
*/
|
||||||
|
private SearchBomResult bom;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 步骤;同一工艺下相同步骤的工序为并行工序
|
||||||
|
*/
|
||||||
|
private Integer step;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String memo;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.mapper.CraftOperationMapper;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.entity.CraftOperationEntity;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class CraftOperationService extends ServiceImpl<CraftOperationMapper, CraftOperationEntity> implements IService<CraftOperationEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
public void add(CraftOperationEntity craftOperationEntity) {
|
||||||
|
this.save(craftOperationEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
public void modify(CraftOperationEntity craftOperationEntity) {
|
||||||
|
this.updateById(craftOperationEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void del(List<Long> ids) {
|
||||||
|
this.removeBatchByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
public CraftOperationEntity detail(Long id) {
|
||||||
|
return this.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*/
|
||||||
|
public PageResult<CraftOperationEntity> paging(PageParam pageParam, CraftOperationEntity craftOperationEntity) {
|
||||||
|
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<CraftOperationEntity>query(craftOperationEntity)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,81 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.lang.Assert;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njzscloud.common.core.ex.Exceptions;
|
||||||
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.common.sn.support.SnUtil;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.mapper.CraftMapper;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.entity.CraftEntity;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.param.AddCraftParam;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.param.SearchCraftParam;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.result.SearchCraftResult;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class CraftService extends ServiceImpl<CraftMapper, CraftEntity> implements IService<CraftEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void add(AddCraftParam addCraftParam) {
|
||||||
|
List<CraftEntity> list = this.list(Wrappers.<CraftEntity>lambdaQuery().eq(CraftEntity::getGoodsId, addCraftParam.getGoodsId()));
|
||||||
|
|
||||||
|
Optional<CraftEntity> optionalCraft = list.stream().filter(item -> item.getCraftVer().equals(addCraftParam.getCraftVer())).findFirst();
|
||||||
|
Assert.isFalse(optionalCraft.isPresent(), () -> Exceptions.exception("工艺版本号已存在"));
|
||||||
|
|
||||||
|
if (addCraftParam.getCanuse()) {
|
||||||
|
updateBatchById(list.stream().map(item -> item.setCanuse(false)).toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
this.save(BeanUtil.copyProperties(addCraftParam, CraftEntity.class)
|
||||||
|
.setSn(SnUtil.next("Craft-SN"))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
public void modify(CraftEntity craftEntity) {
|
||||||
|
this.updateById(craftEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void del(List<Long> ids) {
|
||||||
|
this.removeBatchByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
public SearchCraftResult detail(Long id) {
|
||||||
|
return baseMapper.detail(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*/
|
||||||
|
public PageResult<SearchCraftResult> paging(PageParam pageParam, SearchCraftParam searchCraftParam) {
|
||||||
|
return PageResult.of(baseMapper.paging(pageParam.toPage(), Wrappers.lambdaQuery()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,102 @@
|
||||||
|
package com.njzscloud.dispose.mfg.craft.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njzscloud.common.core.utils.GroupUtil;
|
||||||
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.dispose.mfg.bom.pojo.result.SearchBomDetailResult;
|
||||||
|
import com.njzscloud.dispose.mfg.bom.pojo.result.SearchBomResult;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.mapper.CraftWayMapper;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.entity.CraftWayEntity;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.param.AddAllCraftWayParam;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.result.SearchCraftOperationResult;
|
||||||
|
import com.njzscloud.dispose.mfg.craft.pojo.result.SearchCraftWayResult;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺路线
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class CraftWayService extends ServiceImpl<CraftWayMapper, CraftWayEntity> implements IService<CraftWayEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
public void add(CraftWayEntity craftWayEntity) {
|
||||||
|
this.save(craftWayEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
public void modify(CraftWayEntity craftWayEntity) {
|
||||||
|
this.updateById(craftWayEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void del(List<Long> ids) {
|
||||||
|
this.removeBatchByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
public CraftWayEntity detail(Long id) {
|
||||||
|
return this.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*/
|
||||||
|
public PageResult<CraftWayEntity> paging(PageParam pageParam, CraftWayEntity craftWayEntity) {
|
||||||
|
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<CraftWayEntity>query(craftWayEntity)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void addAll(AddAllCraftWayParam addAllCraftWayParam) {
|
||||||
|
Long craftId = addAllCraftWayParam.getCraftId();
|
||||||
|
this.remove(Wrappers.<CraftWayEntity>lambdaQuery().eq(CraftWayEntity::getCraftId, craftId));
|
||||||
|
List<CraftWayEntity> collect = addAllCraftWayParam.getCraftWayList()
|
||||||
|
.stream()
|
||||||
|
.map(it -> BeanUtil.copyProperties(it, CraftWayEntity.class).setCraftId(craftId))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
this.saveBatch(collect);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<SearchCraftWayResult> listAll(Long craftId) {
|
||||||
|
List<CraftWayEntity> craftWayEntityList = this.list(Wrappers.lambdaQuery(CraftWayEntity.class).eq(CraftWayEntity::getCraftId, craftId));
|
||||||
|
List<SearchCraftWayResult> collect = craftWayEntityList
|
||||||
|
.stream()
|
||||||
|
.map(it -> BeanUtil.copyProperties(it, SearchCraftWayResult.class))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
List<Long> operationIdList = craftWayEntityList.stream().map(CraftWayEntity::getOperationId).collect(Collectors.toList());
|
||||||
|
List<SearchCraftOperationResult> craftOperationResultList = baseMapper.listOperations(Wrappers.query().in("a.id", operationIdList));
|
||||||
|
Map<Long, SearchCraftOperationResult> map1 = GroupUtil.k_o(craftOperationResultList, SearchCraftOperationResult::getId);
|
||||||
|
for (SearchCraftWayResult searchCraftWayResult : collect) {
|
||||||
|
searchCraftWayResult.setOperation(map1.get(searchCraftWayResult.getOperationId()));
|
||||||
|
}
|
||||||
|
List<Long> bomIdList = craftWayEntityList.stream().map(CraftWayEntity::getBomId).collect(Collectors.toList());
|
||||||
|
List<SearchBomResult> bomList = baseMapper.listBom(Wrappers.query().in("a.id", bomIdList));
|
||||||
|
List<SearchBomDetailResult> bomDetailList = baseMapper.listBomDetail(Wrappers.query().in("a.id", bomIdList));
|
||||||
|
Map<Long, List<SearchBomDetailResult>> map2 = GroupUtil.k_a(bomDetailList, SearchBomDetailResult::getBomId);
|
||||||
|
for (SearchBomResult searchBomResult : bomList) {
|
||||||
|
searchBomResult.setDetails(map2.get(searchBomResult.getId()));
|
||||||
|
}
|
||||||
|
return collect;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njzscloud.dispose.mfg.bom.mapper.BomDetailMapper">
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njzscloud.dispose.mfg.bom.mapper.BomMapper">
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?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="com.njzscloud.dispose.mfg.craft.mapper.CraftMapper">
|
||||||
|
|
||||||
|
<sql id="SearchCraftSql">
|
||||||
|
SELECT a.id,
|
||||||
|
a.sn,
|
||||||
|
a.goods_id,
|
||||||
|
a.craft_name,
|
||||||
|
a.craft_ver,
|
||||||
|
a.craft_category,
|
||||||
|
a.canuse,
|
||||||
|
a.memo,
|
||||||
|
a.create_time,
|
||||||
|
b.goods_name,
|
||||||
|
b.sn AS goods_sn
|
||||||
|
FROM mfg_craft a
|
||||||
|
INNER JOIN gds_goods b ON b.id = a.goods_id
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="detail" resultType="com.njzscloud.dispose.mfg.craft.pojo.result.SearchCraftResult">
|
||||||
|
<include refid="SearchCraftSql"/>
|
||||||
|
WHERE a.id = #{id}
|
||||||
|
</select>
|
||||||
|
<select id="paging" resultType="com.njzscloud.dispose.mfg.craft.pojo.result.SearchCraftResult">
|
||||||
|
<include refid="SearchCraftSql"/>
|
||||||
|
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njzscloud.dispose.mfg.craft.mapper.CraftOperationMapper">
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njzscloud.dispose.mfg.craft.mapper.CraftWayMapper">
|
||||||
|
</mapper>
|
||||||
|
|
@ -39175,52 +39175,6 @@
|
||||||
"createdUserId": null,
|
"createdUserId": null,
|
||||||
"dictItems": []
|
"dictItems": []
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "17AB1527-D2DB-4AF4-8468-BBFB792CC944",
|
|
||||||
"defKey": "bom_id",
|
|
||||||
"defName": "物料清单 Id",
|
|
||||||
"intro": "mfg_bom.id",
|
|
||||||
"baseDataType": "BIGINT",
|
|
||||||
"bizDomainType": "",
|
|
||||||
"dbDataType": "BIGINT",
|
|
||||||
"dataLen": "",
|
|
||||||
"numScale": "",
|
|
||||||
"primaryKey": 0,
|
|
||||||
"notNull": 1,
|
|
||||||
"autoIncrement": 0,
|
|
||||||
"defaultValue": "",
|
|
||||||
"stndDictId": "",
|
|
||||||
"stndFieldId": "",
|
|
||||||
"stndDictKey": "",
|
|
||||||
"stndFieldKey": "",
|
|
||||||
"stndComplianceLevel": "",
|
|
||||||
"stndComplianceType": "",
|
|
||||||
"dictFrom": "",
|
|
||||||
"dictItems": null,
|
|
||||||
"fieldTier": "",
|
|
||||||
"mark": null,
|
|
||||||
"attr1": "",
|
|
||||||
"attr2": "",
|
|
||||||
"attr3": "",
|
|
||||||
"attr4": "",
|
|
||||||
"attr5": "",
|
|
||||||
"attr6": "",
|
|
||||||
"attr7": "",
|
|
||||||
"attr8": "",
|
|
||||||
"attr9": "",
|
|
||||||
"attr10": "",
|
|
||||||
"attr11": "",
|
|
||||||
"attr12": "",
|
|
||||||
"attr13": "",
|
|
||||||
"attr14": "",
|
|
||||||
"attr15": "",
|
|
||||||
"attr16": "",
|
|
||||||
"attr17": "",
|
|
||||||
"attr18": "",
|
|
||||||
"attr19": "",
|
|
||||||
"attr20": "",
|
|
||||||
"origin": "UI"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "2AE67567-1B1A-466C-8681-913A43464EB2",
|
"id": "2AE67567-1B1A-466C-8681-913A43464EB2",
|
||||||
"defKey": "operation_name",
|
"defKey": "operation_name",
|
||||||
|
|
@ -39406,52 +39360,6 @@
|
||||||
"attr20": null,
|
"attr20": null,
|
||||||
"origin": "PASTE"
|
"origin": "PASTE"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "481FF15E-5B3F-4D68-A9B6-5E899F99C3F4",
|
|
||||||
"defKey": "step",
|
|
||||||
"defName": "步骤",
|
|
||||||
"intro": "相同步骤的工序为并行工序",
|
|
||||||
"baseDataType": "INT",
|
|
||||||
"bizDomainType": "",
|
|
||||||
"dbDataType": "INT",
|
|
||||||
"dataLen": null,
|
|
||||||
"numScale": null,
|
|
||||||
"primaryKey": 0,
|
|
||||||
"notNull": 1,
|
|
||||||
"autoIncrement": 0,
|
|
||||||
"defaultValue": "",
|
|
||||||
"stndDictId": null,
|
|
||||||
"stndFieldId": null,
|
|
||||||
"stndDictKey": null,
|
|
||||||
"stndFieldKey": null,
|
|
||||||
"stndComplianceLevel": null,
|
|
||||||
"stndComplianceType": null,
|
|
||||||
"dictFrom": "",
|
|
||||||
"dictItems": [],
|
|
||||||
"fieldTier": "",
|
|
||||||
"mark": null,
|
|
||||||
"attr1": null,
|
|
||||||
"attr2": null,
|
|
||||||
"attr3": null,
|
|
||||||
"attr4": null,
|
|
||||||
"attr5": null,
|
|
||||||
"attr6": null,
|
|
||||||
"attr7": null,
|
|
||||||
"attr8": null,
|
|
||||||
"attr9": null,
|
|
||||||
"attr10": null,
|
|
||||||
"attr11": null,
|
|
||||||
"attr12": null,
|
|
||||||
"attr13": null,
|
|
||||||
"attr14": null,
|
|
||||||
"attr15": null,
|
|
||||||
"attr16": null,
|
|
||||||
"attr17": null,
|
|
||||||
"attr18": "PDManer",
|
|
||||||
"attr19": null,
|
|
||||||
"attr20": null,
|
|
||||||
"origin": "PASTE"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "718EF98E-8C67-4467-8FEB-B30631A8C56F",
|
"id": "718EF98E-8C67-4467-8FEB-B30631A8C56F",
|
||||||
"defKey": "canuse",
|
"defKey": "canuse",
|
||||||
|
|
@ -40085,236 +39993,6 @@
|
||||||
"attr19": "",
|
"attr19": "",
|
||||||
"attr20": "",
|
"attr20": "",
|
||||||
"origin": "UI"
|
"origin": "UI"
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "FBF7FBF4-A009-4927-9A02-E29A570B2AC1",
|
|
||||||
"defKey": "creator_id",
|
|
||||||
"defName": "创建人 Id",
|
|
||||||
"intro": "sys_user.id",
|
|
||||||
"baseDataType": "BIGINT",
|
|
||||||
"bizDomainType": "",
|
|
||||||
"dbDataType": "BIGINT",
|
|
||||||
"dataLen": "",
|
|
||||||
"numScale": "",
|
|
||||||
"primaryKey": 0,
|
|
||||||
"notNull": 1,
|
|
||||||
"autoIncrement": 0,
|
|
||||||
"defaultValue": "",
|
|
||||||
"stndDictId": "",
|
|
||||||
"stndFieldId": "",
|
|
||||||
"stndDictKey": "",
|
|
||||||
"stndFieldKey": "",
|
|
||||||
"stndComplianceLevel": "",
|
|
||||||
"stndComplianceType": "",
|
|
||||||
"dictFrom": "",
|
|
||||||
"dictItems": null,
|
|
||||||
"fieldTier": "",
|
|
||||||
"mark": null,
|
|
||||||
"attr1": "",
|
|
||||||
"attr2": "",
|
|
||||||
"attr3": "",
|
|
||||||
"attr4": "",
|
|
||||||
"attr5": "",
|
|
||||||
"attr6": "",
|
|
||||||
"attr7": "",
|
|
||||||
"attr8": "",
|
|
||||||
"attr9": "",
|
|
||||||
"attr10": "",
|
|
||||||
"attr11": "",
|
|
||||||
"attr12": "",
|
|
||||||
"attr13": "",
|
|
||||||
"attr14": "",
|
|
||||||
"attr15": "",
|
|
||||||
"attr16": "",
|
|
||||||
"attr17": "",
|
|
||||||
"attr18": "PDManer",
|
|
||||||
"attr19": "",
|
|
||||||
"attr20": "",
|
|
||||||
"origin": "PASTE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "D8E1EC0E-DEAF-4E7E-9CFC-2C08CBCCC379",
|
|
||||||
"defKey": "modifier_id",
|
|
||||||
"defName": "修改人 Id",
|
|
||||||
"intro": " sys_user.id",
|
|
||||||
"baseDataType": "BIGINT",
|
|
||||||
"bizDomainType": "",
|
|
||||||
"dbDataType": "BIGINT",
|
|
||||||
"dataLen": "",
|
|
||||||
"numScale": "",
|
|
||||||
"primaryKey": 0,
|
|
||||||
"notNull": 1,
|
|
||||||
"autoIncrement": 0,
|
|
||||||
"defaultValue": "",
|
|
||||||
"stndDictId": "",
|
|
||||||
"stndFieldId": "",
|
|
||||||
"stndDictKey": "",
|
|
||||||
"stndFieldKey": "",
|
|
||||||
"stndComplianceLevel": "",
|
|
||||||
"stndComplianceType": "",
|
|
||||||
"dictFrom": "",
|
|
||||||
"dictItems": [],
|
|
||||||
"fieldTier": "",
|
|
||||||
"mark": null,
|
|
||||||
"attr1": "",
|
|
||||||
"attr2": "",
|
|
||||||
"attr3": "",
|
|
||||||
"attr4": "",
|
|
||||||
"attr5": "",
|
|
||||||
"attr6": "",
|
|
||||||
"attr7": "",
|
|
||||||
"attr8": "",
|
|
||||||
"attr9": "",
|
|
||||||
"attr10": "",
|
|
||||||
"attr11": "",
|
|
||||||
"attr12": "",
|
|
||||||
"attr13": "",
|
|
||||||
"attr14": "",
|
|
||||||
"attr15": "",
|
|
||||||
"attr16": "",
|
|
||||||
"attr17": "",
|
|
||||||
"attr18": "PDManer",
|
|
||||||
"attr19": "",
|
|
||||||
"attr20": "",
|
|
||||||
"origin": "PASTE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "82F2DC35-0B85-4C2A-93AB-031FCC3D283A",
|
|
||||||
"defKey": "create_time",
|
|
||||||
"defName": "创建时间",
|
|
||||||
"intro": "",
|
|
||||||
"baseDataType": "DATETIME",
|
|
||||||
"bizDomainType": "",
|
|
||||||
"dbDataType": "DATETIME",
|
|
||||||
"dataLen": "",
|
|
||||||
"numScale": "",
|
|
||||||
"primaryKey": 0,
|
|
||||||
"notNull": 1,
|
|
||||||
"autoIncrement": 0,
|
|
||||||
"defaultValue": "",
|
|
||||||
"stndDictId": "",
|
|
||||||
"stndFieldId": "",
|
|
||||||
"stndDictKey": "",
|
|
||||||
"stndFieldKey": "",
|
|
||||||
"stndComplianceLevel": "",
|
|
||||||
"stndComplianceType": "",
|
|
||||||
"dictFrom": "",
|
|
||||||
"dictItems": [],
|
|
||||||
"fieldTier": "",
|
|
||||||
"mark": null,
|
|
||||||
"attr1": "",
|
|
||||||
"attr2": "",
|
|
||||||
"attr3": "",
|
|
||||||
"attr4": "",
|
|
||||||
"attr5": "",
|
|
||||||
"attr6": "",
|
|
||||||
"attr7": "",
|
|
||||||
"attr8": "",
|
|
||||||
"attr9": "",
|
|
||||||
"attr10": "",
|
|
||||||
"attr11": "",
|
|
||||||
"attr12": "",
|
|
||||||
"attr13": "",
|
|
||||||
"attr14": "",
|
|
||||||
"attr15": "",
|
|
||||||
"attr16": "",
|
|
||||||
"attr17": "",
|
|
||||||
"attr18": "PDManer",
|
|
||||||
"attr19": "",
|
|
||||||
"attr20": "",
|
|
||||||
"origin": "PASTE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "D78B226E-E874-455D-8685-36F0997710F5",
|
|
||||||
"defKey": "modify_time",
|
|
||||||
"defName": "修改时间",
|
|
||||||
"intro": "",
|
|
||||||
"baseDataType": "DATETIME",
|
|
||||||
"bizDomainType": "",
|
|
||||||
"dbDataType": "DATETIME",
|
|
||||||
"dataLen": "",
|
|
||||||
"numScale": "",
|
|
||||||
"primaryKey": 0,
|
|
||||||
"notNull": 1,
|
|
||||||
"autoIncrement": 0,
|
|
||||||
"defaultValue": "",
|
|
||||||
"stndDictId": "",
|
|
||||||
"stndFieldId": "",
|
|
||||||
"stndDictKey": "",
|
|
||||||
"stndFieldKey": "",
|
|
||||||
"stndComplianceLevel": "",
|
|
||||||
"stndComplianceType": "",
|
|
||||||
"dictFrom": "",
|
|
||||||
"dictItems": [],
|
|
||||||
"fieldTier": "",
|
|
||||||
"mark": null,
|
|
||||||
"attr1": "",
|
|
||||||
"attr2": "",
|
|
||||||
"attr3": "",
|
|
||||||
"attr4": "",
|
|
||||||
"attr5": "",
|
|
||||||
"attr6": "",
|
|
||||||
"attr7": "",
|
|
||||||
"attr8": "",
|
|
||||||
"attr9": "",
|
|
||||||
"attr10": "",
|
|
||||||
"attr11": "",
|
|
||||||
"attr12": "",
|
|
||||||
"attr13": "",
|
|
||||||
"attr14": "",
|
|
||||||
"attr15": "",
|
|
||||||
"attr16": "",
|
|
||||||
"attr17": "",
|
|
||||||
"attr18": "PDManer",
|
|
||||||
"attr19": "",
|
|
||||||
"attr20": "",
|
|
||||||
"origin": "PASTE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "D79B9DF6-2D44-41E5-852F-A2BF56A3D18E",
|
|
||||||
"defKey": "deleted",
|
|
||||||
"defName": "是否删除",
|
|
||||||
"intro": " 0-->未删除、1-->已删除",
|
|
||||||
"baseDataType": "TINYINT",
|
|
||||||
"bizDomainType": "",
|
|
||||||
"dbDataType": "TINYINT",
|
|
||||||
"dataLen": 1,
|
|
||||||
"numScale": "",
|
|
||||||
"primaryKey": 0,
|
|
||||||
"notNull": 1,
|
|
||||||
"autoIncrement": 0,
|
|
||||||
"defaultValue": "0",
|
|
||||||
"stndDictId": "",
|
|
||||||
"stndFieldId": "",
|
|
||||||
"stndDictKey": "",
|
|
||||||
"stndFieldKey": "",
|
|
||||||
"stndComplianceLevel": "",
|
|
||||||
"stndComplianceType": "",
|
|
||||||
"dictFrom": "",
|
|
||||||
"dictItems": [],
|
|
||||||
"fieldTier": "",
|
|
||||||
"mark": null,
|
|
||||||
"attr1": "",
|
|
||||||
"attr2": "",
|
|
||||||
"attr3": "",
|
|
||||||
"attr4": "",
|
|
||||||
"attr5": "",
|
|
||||||
"attr6": "",
|
|
||||||
"attr7": "",
|
|
||||||
"attr8": "",
|
|
||||||
"attr9": "",
|
|
||||||
"attr10": "",
|
|
||||||
"attr11": "",
|
|
||||||
"attr12": "",
|
|
||||||
"attr13": "",
|
|
||||||
"attr14": "",
|
|
||||||
"attr15": "",
|
|
||||||
"attr16": "",
|
|
||||||
"attr17": "",
|
|
||||||
"attr18": "PDManer",
|
|
||||||
"attr19": "",
|
|
||||||
"attr20": "",
|
|
||||||
"origin": "PASTE"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"correlations": null,
|
"correlations": null,
|
||||||
|
|
@ -42459,7 +42137,7 @@
|
||||||
"readonly": false,
|
"readonly": false,
|
||||||
"allowWs": false
|
"allowWs": false
|
||||||
},
|
},
|
||||||
"updateTime": 1767582120955,
|
"updateTime": 1767693314511,
|
||||||
"signature": "8b0147224327f003d919047195c70983",
|
"signature": "41d1fbdc96c560fe7fa1949efeb758fe",
|
||||||
"branchId": "1111"
|
"branchId": "1111"
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue