ignore文件
This commit is contained in:
27
ktg-mes/pom.xml
Normal file
27
ktg-mes/pom.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ktg</artifactId>
|
||||
<groupId>com.ktg</groupId>
|
||||
<version>3.8.2</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ktg-mes</artifactId>
|
||||
|
||||
<description>
|
||||
MES 系统
|
||||
</description>
|
||||
<dependencies>
|
||||
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.ktg</groupId>
|
||||
<artifactId>ktg-framework</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,140 @@
|
||||
package com.ktg.mes.md.controller;
|
||||
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.core.domain.entity.ItemType;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.md.service.IItemTypeService;
|
||||
import com.ktg.system.strategy.AutoCodeUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/mes/md/itemtype")
|
||||
public class ItemTypeController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IItemTypeService iItemTypeService;
|
||||
@Autowired
|
||||
private AutoCodeUtil autoCodeUtil;
|
||||
|
||||
/**
|
||||
* 查询分类列表
|
||||
* @param itemType
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:itemtype:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(ItemType itemType){
|
||||
List<ItemType> list =iItemTypeService.selectItemTypeList(itemType);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门列表(排除当前和父节点)
|
||||
* @param itemTypeId
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:itemtype:list')")
|
||||
@GetMapping("/list/exclude/{itemTypeId}")
|
||||
public AjaxResult excludeChild(@PathVariable(value = "itemTypeId",required = false)Long itemTypeId){
|
||||
List<ItemType> list = iItemTypeService.selectItemTypeList(new ItemType());
|
||||
Iterator<ItemType> it = list.iterator();
|
||||
Long parentTypeId =0L;
|
||||
while (it.hasNext()){
|
||||
ItemType itemType = (ItemType) it.next();
|
||||
if(itemType.getItemTypeId() == itemTypeId){
|
||||
parentTypeId = itemType.getParentTypeId();
|
||||
it.remove();
|
||||
}
|
||||
|
||||
if(itemType.getItemTypeId() == parentTypeId){
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门详情
|
||||
* @param itemTypeId
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:itemtype:query')")
|
||||
@GetMapping(value = "/{itemTypeId}")
|
||||
public AjaxResult getInfo(@PathVariable Long itemTypeId){
|
||||
//权限校验?
|
||||
return AjaxResult.success(iItemTypeService.selectItemTypeById(itemTypeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取树形结构数据
|
||||
* @param itemType
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/treeselect")
|
||||
public AjaxResult treeSelect(ItemType itemType){
|
||||
List<ItemType> list = iItemTypeService.selectItemTypeList(itemType);
|
||||
return AjaxResult.success(iItemTypeService.buildTreeSelect(list));
|
||||
}
|
||||
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:itemtype:add')")
|
||||
@Log(title = "新增物料产品分类信息",businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody ItemType itemType){
|
||||
|
||||
if(UserConstants.NOT_UNIQUE.equals(iItemTypeService.checkItemTypeCodeUnique(itemType))){
|
||||
return AjaxResult.error("分类"+itemType.getItemTypeCode()+"编码已存在");
|
||||
}
|
||||
if(UserConstants.NOT_UNIQUE.equals(iItemTypeService.checkItemTypeNameUnique(itemType))){
|
||||
return AjaxResult.error("分类"+itemType.getItemTypeCode()+"名称已存在");
|
||||
}
|
||||
if(itemType.getParentTypeId() ==null || itemType.getParentTypeId()==0){
|
||||
itemType.setParentTypeId(0L);
|
||||
}
|
||||
//自动生成一个唯一编码
|
||||
itemType.setItemTypeCode(autoCodeUtil.genSerialCode(UserConstants.ITEM_TYPE_CODE,null));
|
||||
itemType.setCreateBy(getUsername());
|
||||
return AjaxResult.success(iItemTypeService.insertItemType(itemType));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:itemtype:update')")
|
||||
@Log(title = "更新物料产品分类",businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult update(@Validated @RequestBody ItemType itemType){
|
||||
if(UserConstants.NOT_UNIQUE.equals(iItemTypeService.checkItemTypeCodeUnique(itemType))){
|
||||
return AjaxResult.error("分类"+itemType.getItemTypeCode()+"编码已存在");
|
||||
}
|
||||
if(UserConstants.NOT_UNIQUE.equals(iItemTypeService.checkItemTypeNameUnique(itemType))){
|
||||
return AjaxResult.error("分类"+itemType.getItemTypeCode()+"名称已存在");
|
||||
}
|
||||
itemType.setUpdateBy(getUsername());
|
||||
return AjaxResult.success(iItemTypeService.updateItemType(itemType));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:itemtype:remove')")
|
||||
@Log(title = "删除物料产品分类",businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{itemTypeId}")
|
||||
public AjaxResult del(@PathVariable Long itemTypeId){
|
||||
|
||||
if(iItemTypeService.checkHasChild(itemTypeId)){
|
||||
return AjaxResult.error("分类下有子分类,请先删除子分类");
|
||||
}
|
||||
|
||||
if(iItemTypeService.checkHasItem(itemTypeId)){
|
||||
return AjaxResult.error("分类下有物料,请先删除物料");
|
||||
}
|
||||
|
||||
//权限数据检查?
|
||||
return AjaxResult.success(iItemTypeService.removeItemType(itemTypeId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.ktg.mes.md.controller;
|
||||
|
||||
import com.ktg.mes.md.service.IMdItemService;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.core.domain.entity.ItemType;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import com.ktg.mes.md.domain.MdItem;
|
||||
import com.ktg.mes.md.service.IItemTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/mes/md/mditem")
|
||||
public class MdItemController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IMdItemService mdItemService;
|
||||
|
||||
@Autowired
|
||||
private IItemTypeService iItemTypeService;
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
* @param mdItem
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:mditem:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MdItem mdItem){
|
||||
startPage();
|
||||
List<MdItem> list = mdItemService.selectMdItemList(mdItem);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 主键查询
|
||||
* @param itemId
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:mditem:query')")
|
||||
@GetMapping(value = "/{itemId}")
|
||||
public AjaxResult getInfo(@PathVariable Long itemId){
|
||||
return AjaxResult.success(mdItemService.selectMdItemById(itemId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param mdItem
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:mditem:add')")
|
||||
@Log(title = "物料管理",businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody MdItem mdItem){
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdItemService.checkItemCodeUnique(mdItem))){
|
||||
return AjaxResult.error("新增物料"+mdItem.getItemCode()+"失败,物料编码已存在");
|
||||
}
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdItemService.checkItemNameUnique(mdItem))){
|
||||
return AjaxResult.error("新增物料"+mdItem.getItemCode()+"失败,物料名称已存在");
|
||||
}
|
||||
|
||||
ItemType type =iItemTypeService.selectItemTypeById(mdItem.getItemTypeId());
|
||||
if(StringUtils.isNotNull(type)){
|
||||
mdItem.setItemTypeCode(type.getItemTypeCode());
|
||||
mdItem.setItemTypeName(type.getItemTypeName());
|
||||
mdItem.setItemOrProduct(type.getItemOrProduct());
|
||||
}
|
||||
mdItem.setCreateBy(getUsername());
|
||||
return toAjax(mdItemService.insertMdItem(mdItem));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
* @param mdItem
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:mditem:edit')")
|
||||
@Log(title = "物料管理",businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody MdItem mdItem){
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdItemService.checkItemCodeUnique(mdItem))){
|
||||
return AjaxResult.error("新增物料"+mdItem.getItemCode()+"失败,物料编码已存在");
|
||||
}
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdItemService.checkItemNameUnique(mdItem))){
|
||||
return AjaxResult.error("新增物料"+mdItem.getItemCode()+"失败,物料名称已存在");
|
||||
}
|
||||
ItemType type =iItemTypeService.selectItemTypeById(mdItem.getItemTypeId());
|
||||
if(StringUtils.isNotNull(type)){
|
||||
mdItem.setItemTypeCode(type.getItemTypeCode());
|
||||
mdItem.setItemTypeName(type.getItemTypeName());
|
||||
mdItem.setItemOrProduct(type.getItemOrProduct());
|
||||
}
|
||||
if(StringUtils.isNotNull(mdItem.getSafeStockFlag())&& "N".equals(mdItem.getSafeStockFlag())){
|
||||
mdItem.setMinStock(0D);
|
||||
mdItem.setMaxStock(0D);
|
||||
}
|
||||
|
||||
mdItem.setUpdateBy(getUsername());
|
||||
return toAjax(mdItemService.updateMdItem(mdItem));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:mditem:remove')")
|
||||
@Log(title = "物料管理",businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{itemIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] itemIds){
|
||||
return toAjax(mdItemService.deleteByItemIds(itemIds));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.ktg.mes.md.controller;
|
||||
|
||||
import com.ktg.mes.md.service.IMdProductBomService;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.mes.md.domain.MdProductBom;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 产品BOM关系Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/md/bom")
|
||||
public class MdProductBomController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMdProductBomService mdProductBomService;
|
||||
|
||||
/**
|
||||
* 查询产品BOM关系列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:bom:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MdProductBom mdProductBom)
|
||||
{
|
||||
startPage();
|
||||
List<MdProductBom> list = mdProductBomService.selectMdProductBomList(mdProductBom);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出产品BOM关系列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:bom:export')")
|
||||
@Log(title = "产品BOM关系", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MdProductBom mdProductBom)
|
||||
{
|
||||
List<MdProductBom> list = mdProductBomService.selectMdProductBomList(mdProductBom);
|
||||
ExcelUtil<MdProductBom> util = new ExcelUtil<MdProductBom>(MdProductBom.class);
|
||||
util.exportExcel(response, list, "产品BOM关系数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取产品BOM关系详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:bom:query')")
|
||||
@GetMapping(value = "/{bomId}")
|
||||
public AjaxResult getInfo(@PathVariable("bomId") Long bomId)
|
||||
{
|
||||
return AjaxResult.success(mdProductBomService.selectMdProductBomByBomId(bomId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品BOM关系
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:bom:add')")
|
||||
@Log(title = "产品BOM关系", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MdProductBom mdProductBom)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdProductBomService.checkBomExist(mdProductBom))){
|
||||
return AjaxResult.error("物料"+mdProductBom.getBomItemCode()+"已存在!");
|
||||
}
|
||||
return toAjax(mdProductBomService.insertMdProductBom(mdProductBom));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品BOM关系
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:bom:edit')")
|
||||
@Log(title = "产品BOM关系", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MdProductBom mdProductBom)
|
||||
{
|
||||
return toAjax(mdProductBomService.updateMdProductBom(mdProductBom));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品BOM关系
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:bom:remove')")
|
||||
@Log(title = "产品BOM关系", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{bomIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] bomIds)
|
||||
{
|
||||
return toAjax(mdProductBomService.deleteMdProductBomByBomIds(bomIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.ktg.mes.md.controller;
|
||||
|
||||
import com.ktg.mes.md.service.IMdUnitMeasureService;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.mes.md.domain.MdUnitMeasure;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 单位Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-04-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/md/unitmeasure")
|
||||
public class MdUnitMeasureController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMdUnitMeasureService mdUnitMeasureService;
|
||||
|
||||
/**
|
||||
* 查询单位列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:unitmeasure:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MdUnitMeasure mdUnitMeasure)
|
||||
{
|
||||
startPage();
|
||||
List<MdUnitMeasure> list = mdUnitMeasureService.selectMdUnitMeasureList(mdUnitMeasure);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:unitmeasure:list')")
|
||||
@GetMapping("/listprimary")
|
||||
public AjaxResult listPrimary(){
|
||||
MdUnitMeasure mdUnitMeasure = new MdUnitMeasure();
|
||||
mdUnitMeasure.setPrimaryFlag("Y");
|
||||
List<MdUnitMeasure> list = mdUnitMeasureService.selectMdUnitMeasureList(mdUnitMeasure);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@GetMapping("/selectall")
|
||||
public AjaxResult selectAll(){
|
||||
MdUnitMeasure mdUnitMeasure = new MdUnitMeasure();
|
||||
mdUnitMeasure.setEnableFlag("Y");
|
||||
List<MdUnitMeasure> list = mdUnitMeasureService.selectMdUnitMeasureList(mdUnitMeasure);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出单位列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:unitmeasure:export')")
|
||||
@Log(title = "单位", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MdUnitMeasure mdUnitMeasure)
|
||||
{
|
||||
List<MdUnitMeasure> list = mdUnitMeasureService.selectMdUnitMeasureList(mdUnitMeasure);
|
||||
ExcelUtil<MdUnitMeasure> util = new ExcelUtil<MdUnitMeasure>(MdUnitMeasure.class);
|
||||
util.exportExcel(response, list, "单位数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单位详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:unitmeasure:query')")
|
||||
@GetMapping(value = "/{measureId}")
|
||||
public AjaxResult getInfo(@PathVariable("measureId") Long measureId)
|
||||
{
|
||||
return AjaxResult.success(mdUnitMeasureService.selectMdUnitMeasureByMeasureId(measureId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增单位
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:unitmeasure:add')")
|
||||
@Log(title = "单位", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MdUnitMeasure mdUnitMeasure)
|
||||
{
|
||||
return toAjax(mdUnitMeasureService.insertMdUnitMeasure(mdUnitMeasure));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改单位
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:unitmeasure:edit')")
|
||||
@Log(title = "单位", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MdUnitMeasure mdUnitMeasure)
|
||||
{
|
||||
return toAjax(mdUnitMeasureService.updateMdUnitMeasure(mdUnitMeasure));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除单位
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:unitmeasure:remove')")
|
||||
@Log(title = "单位", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{measureIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] measureIds)
|
||||
{
|
||||
return toAjax(mdUnitMeasureService.deleteMdUnitMeasureByMeasureIds(measureIds));
|
||||
}
|
||||
}
|
||||
199
ktg-mes/src/main/java/com/ktg/mes/md/domain/MdItem.java
Normal file
199
ktg-mes/src/main/java/com/ktg/mes/md/domain/MdItem.java
Normal file
@@ -0,0 +1,199 @@
|
||||
package com.ktg.mes.md.domain;
|
||||
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
public class MdItem extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
private Long itemId;
|
||||
private String itemCode;
|
||||
private String itemName;
|
||||
private String specification;
|
||||
private String unitOfMeasure;
|
||||
private String itemOrProduct;
|
||||
private Long itemTypeId;
|
||||
private String itemTypeCode;
|
||||
private String itemTypeName;
|
||||
private String enableFlag;
|
||||
private String safeStockFlag;
|
||||
private Double minStock;
|
||||
private Double maxStock;
|
||||
private String attr1;
|
||||
private String attr2;
|
||||
private String attr3;
|
||||
private String attr4;
|
||||
|
||||
public Long getItemId() {
|
||||
return itemId;
|
||||
}
|
||||
|
||||
public void setItemId(Long itemId) {
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
@NotBlank(message = "物料产品编码不能为空")
|
||||
@Size(min = 0,max = 64,message = "物料产品编码长度不能超过64个字符")
|
||||
public String getItemCode() {
|
||||
return itemCode;
|
||||
}
|
||||
|
||||
public void setItemCode(String itemCode) {
|
||||
this.itemCode = itemCode;
|
||||
}
|
||||
|
||||
@NotBlank(message = "物料产品名称不能为空")
|
||||
@Size(min = 0,max = 255,message = "物料产品编码名称不能超过255个字符")
|
||||
public String getItemName() {
|
||||
return itemName;
|
||||
}
|
||||
|
||||
public void setItemName(String itemName) {
|
||||
this.itemName = itemName;
|
||||
}
|
||||
|
||||
@Size(min = 0,max = 500,message = "规格型号不能超过255个字符")
|
||||
public String getSpecification() {
|
||||
return specification;
|
||||
}
|
||||
|
||||
public void setSpecification(String specification) {
|
||||
this.specification = specification;
|
||||
}
|
||||
|
||||
@NotBlank(message = "单位不能为空")
|
||||
public String getUnitOfMeasure() {
|
||||
return unitOfMeasure;
|
||||
}
|
||||
|
||||
public void setUnitOfMeasure(String unitOfMeasure) {
|
||||
this.unitOfMeasure = unitOfMeasure;
|
||||
}
|
||||
|
||||
|
||||
public String getItemOrProduct() {
|
||||
return itemOrProduct;
|
||||
}
|
||||
|
||||
public void setItemOrProduct(String itemOrProduct) {
|
||||
this.itemOrProduct = itemOrProduct;
|
||||
}
|
||||
|
||||
@NotNull(message = "物料类型不能为空")
|
||||
public Long getItemTypeId() {
|
||||
return itemTypeId;
|
||||
}
|
||||
|
||||
public void setItemTypeId(Long itemTypeId) {
|
||||
this.itemTypeId = itemTypeId;
|
||||
}
|
||||
|
||||
public String getItemTypeCode() {
|
||||
return itemTypeCode;
|
||||
}
|
||||
|
||||
public void setItemTypeCode(String itemTypeCode) {
|
||||
this.itemTypeCode = itemTypeCode;
|
||||
}
|
||||
|
||||
public String getItemTypeName() {
|
||||
return itemTypeName;
|
||||
}
|
||||
|
||||
public void setItemTypeName(String itemTypeName) {
|
||||
this.itemTypeName = itemTypeName;
|
||||
}
|
||||
|
||||
public String getEnableFlag() {
|
||||
return enableFlag;
|
||||
}
|
||||
|
||||
public void setEnableFlag(String enableFlag) {
|
||||
this.enableFlag = enableFlag;
|
||||
}
|
||||
|
||||
public String getSafeStockFlag() {
|
||||
return safeStockFlag;
|
||||
}
|
||||
|
||||
public void setSafeStockFlag(String safeStockFlag) {
|
||||
this.safeStockFlag = safeStockFlag;
|
||||
}
|
||||
|
||||
public Double getMinStock() {
|
||||
return minStock;
|
||||
}
|
||||
|
||||
public void setMinStock(Double minStock) {
|
||||
this.minStock = minStock;
|
||||
}
|
||||
|
||||
public Double getMaxStock() {
|
||||
return maxStock;
|
||||
}
|
||||
|
||||
public void setMaxStock(Double maxStock) {
|
||||
this.maxStock = maxStock;
|
||||
}
|
||||
|
||||
public String getAttr1() {
|
||||
return attr1;
|
||||
}
|
||||
|
||||
public void setAttr1(String attr1) {
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr2() {
|
||||
return attr2;
|
||||
}
|
||||
|
||||
public void setAttr2(String attr2) {
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr3() {
|
||||
return attr3;
|
||||
}
|
||||
|
||||
public void setAttr3(String attr3) {
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public String getAttr4() {
|
||||
return attr4;
|
||||
}
|
||||
|
||||
public void setAttr4(String attr4) {
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MdItem{" +
|
||||
"itemId=" + itemId +
|
||||
", itemCode='" + itemCode + '\'' +
|
||||
", itemName='" + itemName + '\'' +
|
||||
", specification='" + specification + '\'' +
|
||||
", unitOfMeasure='" + unitOfMeasure + '\'' +
|
||||
", itemOrProduct='" + itemOrProduct + '\'' +
|
||||
", itemTypeId=" + itemTypeId +
|
||||
", itemTypeCode='" + itemTypeCode + '\'' +
|
||||
", itemTypeName='" + itemTypeName + '\'' +
|
||||
", enableFlag='" + enableFlag + '\'' +
|
||||
", safeStockFlag='" + safeStockFlag + '\'' +
|
||||
", minStock=" + minStock +
|
||||
", maxStock=" + maxStock +
|
||||
", attr1='" + attr1 + '\'' +
|
||||
", attr2='" + attr2 + '\'' +
|
||||
", attr3='" + attr3 + '\'' +
|
||||
", attr4='" + attr4 + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
212
ktg-mes/src/main/java/com/ktg/mes/md/domain/MdProductBom.java
Normal file
212
ktg-mes/src/main/java/com/ktg/mes/md/domain/MdProductBom.java
Normal file
@@ -0,0 +1,212 @@
|
||||
package com.ktg.mes.md.domain;
|
||||
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 产品BOM关系对象 md_product_bom
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-05
|
||||
*/
|
||||
public class MdProductBom extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 流水号 */
|
||||
private Long bomId;
|
||||
|
||||
/** 物料产品ID */
|
||||
@Excel(name = "物料产品ID")
|
||||
private Long itemId;
|
||||
|
||||
/** BOM物料ID */
|
||||
@Excel(name = "BOM物料ID")
|
||||
private Long bomItemId;
|
||||
|
||||
/** BOM物料编码 */
|
||||
@Excel(name = "BOM物料编码")
|
||||
private String bomItemCode;
|
||||
|
||||
/** BOM物料名称 */
|
||||
@Excel(name = "BOM物料名称")
|
||||
private String bomItemName;
|
||||
|
||||
/** BOM物料规格 */
|
||||
@Excel(name = "BOM物料规格")
|
||||
private String bomItemSpec;
|
||||
|
||||
/** BOM物料单位 */
|
||||
@Excel(name = "BOM物料单位")
|
||||
private String unitOfMeasure;
|
||||
|
||||
/** 物料使用比例 */
|
||||
@Excel(name = "物料使用比例")
|
||||
private BigDecimal quantity;
|
||||
|
||||
/** 是否启用 */
|
||||
@Excel(name = "是否启用")
|
||||
private String enableFlag;
|
||||
|
||||
/** 预留字段1 */
|
||||
@Excel(name = "预留字段1")
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
@Excel(name = "预留字段2")
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
@Excel(name = "预留字段3")
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
@Excel(name = "预留字段4")
|
||||
private Long attr4;
|
||||
|
||||
public void setBomId(Long bomId)
|
||||
{
|
||||
this.bomId = bomId;
|
||||
}
|
||||
|
||||
public Long getBomId()
|
||||
{
|
||||
return bomId;
|
||||
}
|
||||
public void setItemId(Long itemId)
|
||||
{
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public Long getItemId()
|
||||
{
|
||||
return itemId;
|
||||
}
|
||||
public void setBomItemId(Long bomItemId)
|
||||
{
|
||||
this.bomItemId = bomItemId;
|
||||
}
|
||||
|
||||
public Long getBomItemId()
|
||||
{
|
||||
return bomItemId;
|
||||
}
|
||||
public void setBomItemCode(String bomItemCode)
|
||||
{
|
||||
this.bomItemCode = bomItemCode;
|
||||
}
|
||||
|
||||
public String getBomItemCode()
|
||||
{
|
||||
return bomItemCode;
|
||||
}
|
||||
public void setBomItemName(String bomItemName)
|
||||
{
|
||||
this.bomItemName = bomItemName;
|
||||
}
|
||||
|
||||
public String getBomItemName()
|
||||
{
|
||||
return bomItemName;
|
||||
}
|
||||
public void setBomItemSpec(String bomItemSpec)
|
||||
{
|
||||
this.bomItemSpec = bomItemSpec;
|
||||
}
|
||||
|
||||
public String getBomItemSpec()
|
||||
{
|
||||
return bomItemSpec;
|
||||
}
|
||||
public void setUnitOfMeasure(String unitOfMeasure)
|
||||
{
|
||||
this.unitOfMeasure = unitOfMeasure;
|
||||
}
|
||||
|
||||
public String getUnitOfMeasure()
|
||||
{
|
||||
return unitOfMeasure;
|
||||
}
|
||||
public void setQuantity(BigDecimal quantity)
|
||||
{
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public BigDecimal getQuantity()
|
||||
{
|
||||
return quantity;
|
||||
}
|
||||
public void setEnableFlag(String enableFlag)
|
||||
{
|
||||
this.enableFlag = enableFlag;
|
||||
}
|
||||
|
||||
public String getEnableFlag()
|
||||
{
|
||||
return enableFlag;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("bomId", getBomId())
|
||||
.append("itemId", getItemId())
|
||||
.append("bomItemId", getBomItemId())
|
||||
.append("bomItemCode", getBomItemCode())
|
||||
.append("bomItemName", getBomItemName())
|
||||
.append("bomItemSpec", getBomItemSpec())
|
||||
.append("unitOfMeasure", getUnitOfMeasure())
|
||||
.append("quantity", getQuantity())
|
||||
.append("enableFlag", getEnableFlag())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
184
ktg-mes/src/main/java/com/ktg/mes/md/domain/MdUnitMeasure.java
Normal file
184
ktg-mes/src/main/java/com/ktg/mes/md/domain/MdUnitMeasure.java
Normal file
@@ -0,0 +1,184 @@
|
||||
package com.ktg.mes.md.domain;
|
||||
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 单位对象 md_unit_measure
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-04-27
|
||||
*/
|
||||
public class MdUnitMeasure extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 单位ID */
|
||||
private Long measureId;
|
||||
|
||||
/** 单位编码 */
|
||||
@Excel(name = "单位编码")
|
||||
private String measureCode;
|
||||
|
||||
/** 单位名称 */
|
||||
@Excel(name = "单位名称")
|
||||
private String measureName;
|
||||
|
||||
/** 是否是主单位 */
|
||||
@Excel(name = "是否是主单位")
|
||||
private String primaryFlag;
|
||||
|
||||
/** 主单位ID */
|
||||
@Excel(name = "主单位ID")
|
||||
private Long primaryId;
|
||||
|
||||
/** 与主单位换算比例 */
|
||||
@Excel(name = "与主单位换算比例")
|
||||
private BigDecimal changeRate;
|
||||
|
||||
/** 是否启用 */
|
||||
@Excel(name = "是否启用")
|
||||
private String enableFlag;
|
||||
|
||||
/** 预留字段1 */
|
||||
@Excel(name = "预留字段1")
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
@Excel(name = "预留字段2")
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
@Excel(name = "预留字段3")
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
@Excel(name = "预留字段4")
|
||||
private Long attr4;
|
||||
|
||||
public void setMeasureId(Long measureId)
|
||||
{
|
||||
this.measureId = measureId;
|
||||
}
|
||||
|
||||
public Long getMeasureId()
|
||||
{
|
||||
return measureId;
|
||||
}
|
||||
public void setMeasureCode(String measureCode)
|
||||
{
|
||||
this.measureCode = measureCode;
|
||||
}
|
||||
|
||||
public String getMeasureCode()
|
||||
{
|
||||
return measureCode;
|
||||
}
|
||||
public void setMeasureName(String measureName)
|
||||
{
|
||||
this.measureName = measureName;
|
||||
}
|
||||
|
||||
public String getMeasureName()
|
||||
{
|
||||
return measureName;
|
||||
}
|
||||
public void setPrimaryFlag(String primaryFlag)
|
||||
{
|
||||
this.primaryFlag = primaryFlag;
|
||||
}
|
||||
|
||||
public String getPrimaryFlag()
|
||||
{
|
||||
return primaryFlag;
|
||||
}
|
||||
public void setPrimaryId(Long primaryId)
|
||||
{
|
||||
this.primaryId = primaryId;
|
||||
}
|
||||
|
||||
public Long getPrimaryId()
|
||||
{
|
||||
return primaryId;
|
||||
}
|
||||
public void setChangeRate(BigDecimal changeRate)
|
||||
{
|
||||
this.changeRate = changeRate;
|
||||
}
|
||||
|
||||
public BigDecimal getChangeRate()
|
||||
{
|
||||
return changeRate;
|
||||
}
|
||||
public void setEnableFlag(String enableFlag)
|
||||
{
|
||||
this.enableFlag = enableFlag;
|
||||
}
|
||||
|
||||
public String getEnableFlag()
|
||||
{
|
||||
return enableFlag;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("measureId", getMeasureId())
|
||||
.append("measureCode", getMeasureCode())
|
||||
.append("measureName", getMeasureName())
|
||||
.append("primaryFlag", getPrimaryFlag())
|
||||
.append("primaryId", getPrimaryId())
|
||||
.append("changeRate", getChangeRate())
|
||||
.append("enableFlag", getEnableFlag())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
104
ktg-mes/src/main/java/com/ktg/mes/md/mapper/ItemTypeMapper.java
Normal file
104
ktg-mes/src/main/java/com/ktg/mes/md/mapper/ItemTypeMapper.java
Normal file
@@ -0,0 +1,104 @@
|
||||
package com.ktg.mes.md.mapper;
|
||||
|
||||
import com.ktg.common.core.domain.entity.ItemType;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ItemTypeMapper {
|
||||
|
||||
/**
|
||||
* 根据条件查询物料分类
|
||||
* @param itemType
|
||||
* @return
|
||||
*/
|
||||
public List<ItemType> selectItemTypeList(ItemType itemType);
|
||||
|
||||
/**
|
||||
* 根据主键查询物料分类
|
||||
* @param itemTypeId
|
||||
* @return
|
||||
*/
|
||||
public ItemType selectItemTypeById(Long itemTypeId);
|
||||
|
||||
/**
|
||||
* 根据父类ID查询是否有子类
|
||||
* @param parentTypeId
|
||||
* @return
|
||||
*/
|
||||
public Integer hasChildByItemTypeId(Long parentTypeId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据物料分类查询是否有对应的物料和产品
|
||||
* @param itemTypeId
|
||||
* @return
|
||||
*/
|
||||
public Integer hasItemByItemTypeId(Long itemTypeId);
|
||||
|
||||
/**
|
||||
* 根据父类查询所有子类
|
||||
* @param parentTypeId
|
||||
* @return
|
||||
*/
|
||||
public List<ItemType> selectChildrenItemTypeById(Long parentTypeId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询是否有可用的子类
|
||||
* @param parentTypeId
|
||||
* @return
|
||||
*/
|
||||
public Integer selectNormalChildrenItemTypeById(Long parentTypeId);
|
||||
|
||||
/**
|
||||
* 检查同一个父类下子类名称是否重复
|
||||
* @param itemTypeName
|
||||
* @param parentTypeId
|
||||
* @return
|
||||
*/
|
||||
public ItemType checkItemTypeNameUnique(@Param("itemTypeName") String itemTypeName,@Param("parentTypeId") Long parentTypeId);
|
||||
|
||||
/**
|
||||
* 检查同一个父类下子类编码是否重复
|
||||
* @param itemTypeCode
|
||||
* @param parentTypeId
|
||||
* @return
|
||||
*/
|
||||
public ItemType checkItemTypeCodeUnique(@Param("itemTypeCode") String itemTypeCode,@Param("parentTypeId") Long parentTypeId);
|
||||
|
||||
/**
|
||||
* 新增物料分类
|
||||
* @param itemType
|
||||
* @return
|
||||
*/
|
||||
public Integer insertItemType(ItemType itemType);
|
||||
|
||||
/**
|
||||
* 更新物料分类
|
||||
* @param itemType
|
||||
* @return
|
||||
*/
|
||||
public Integer updateItemType(ItemType itemType);
|
||||
|
||||
/**
|
||||
* 设置物料分类不可用
|
||||
* @param itemTypeIds
|
||||
*/
|
||||
public void updateItemTypeStatusNormal(Long[] itemTypeIds);
|
||||
|
||||
/**
|
||||
* 根据主键删除物料分类
|
||||
* @param itemTypeId
|
||||
* @return
|
||||
*/
|
||||
public Integer deleteItemTypeById(Long itemTypeId);
|
||||
|
||||
/**
|
||||
* 批量删除物料分类
|
||||
* @param itemTypeIds
|
||||
* @return
|
||||
*/
|
||||
public Integer deleteItemTypeByIds(Long[] itemTypeIds);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.ktg.mes.md.mapper;
|
||||
|
||||
import com.ktg.mes.md.domain.MdItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MdItemMapper {
|
||||
/**
|
||||
* 根据条件查询物料编码
|
||||
* @param mdItem
|
||||
* @return
|
||||
*/
|
||||
public List<MdItem> selectMdItemList(MdItem mdItem);
|
||||
|
||||
/**
|
||||
* 查询所有物料编码
|
||||
* @return
|
||||
*/
|
||||
public List<MdItem> selectMdItemAll();
|
||||
|
||||
|
||||
/**
|
||||
* 根据物料ID查询物料
|
||||
* @param itemId
|
||||
* @return
|
||||
*/
|
||||
public MdItem selectMdItemById(Long itemId);
|
||||
|
||||
/**
|
||||
* 检查物料编码是否唯一
|
||||
* @param mdItem
|
||||
* @return
|
||||
*/
|
||||
public MdItem checkItemCodeUnique(MdItem mdItem);
|
||||
|
||||
/**
|
||||
* 检查物料名称是否唯一
|
||||
* @param mdItem
|
||||
* @return
|
||||
*/
|
||||
public MdItem checkItemNameUnique(MdItem mdItem);
|
||||
|
||||
/**
|
||||
* 新增物料
|
||||
* @param mdItem
|
||||
* @return
|
||||
*/
|
||||
public int insertMdItem(MdItem mdItem);
|
||||
|
||||
/**
|
||||
* 更新物料
|
||||
* @param mdItem
|
||||
* @return
|
||||
*/
|
||||
public int updateMdItem(MdItem mdItem);
|
||||
|
||||
/**
|
||||
* 根据ID删除物料
|
||||
* @param itemId
|
||||
* @return
|
||||
*/
|
||||
public int deleteMdItemById(Long itemId);
|
||||
|
||||
/**
|
||||
* 批量删除物料
|
||||
* @param itemIds
|
||||
* @return
|
||||
*/
|
||||
public int deleteMdItemByIds(Long[] itemIds);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.ktg.mes.md.mapper;
|
||||
|
||||
import com.ktg.mes.md.domain.MdProductBom;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 产品BOM关系Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-05
|
||||
*/
|
||||
public interface MdProductBomMapper
|
||||
{
|
||||
/**
|
||||
* 查询产品BOM关系
|
||||
*
|
||||
* @param bomId 产品BOM关系主键
|
||||
* @return 产品BOM关系
|
||||
*/
|
||||
public MdProductBom selectMdProductBomByBomId(Long bomId);
|
||||
|
||||
/**
|
||||
* 查询产品BOM关系列表
|
||||
*
|
||||
* @param mdProductBom 产品BOM关系
|
||||
* @return 产品BOM关系集合
|
||||
*/
|
||||
public List<MdProductBom> selectMdProductBomList(MdProductBom mdProductBom);
|
||||
|
||||
|
||||
/**
|
||||
* 检查物料BOM是否已经存在
|
||||
* @param mdProductBom
|
||||
* @return
|
||||
*/
|
||||
public MdProductBom checkBomExist(MdProductBom mdProductBom);
|
||||
|
||||
/**
|
||||
* 新增产品BOM关系
|
||||
*
|
||||
* @param mdProductBom 产品BOM关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMdProductBom(MdProductBom mdProductBom);
|
||||
|
||||
/**
|
||||
* 修改产品BOM关系
|
||||
*
|
||||
* @param mdProductBom 产品BOM关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMdProductBom(MdProductBom mdProductBom);
|
||||
|
||||
/**
|
||||
* 删除产品BOM关系
|
||||
*
|
||||
* @param bomId 产品BOM关系主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdProductBomByBomId(Long bomId);
|
||||
|
||||
/**
|
||||
* 批量删除产品BOM关系
|
||||
*
|
||||
* @param bomIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdProductBomByBomIds(Long[] bomIds);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.ktg.mes.md.mapper;
|
||||
|
||||
import com.ktg.mes.md.domain.MdUnitMeasure;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 单位Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-04-27
|
||||
*/
|
||||
public interface MdUnitMeasureMapper
|
||||
{
|
||||
/**
|
||||
* 查询单位
|
||||
*
|
||||
* @param measureId 单位主键
|
||||
* @return 单位
|
||||
*/
|
||||
public MdUnitMeasure selectMdUnitMeasureByMeasureId(Long measureId);
|
||||
|
||||
/**
|
||||
* 查询单位列表
|
||||
*
|
||||
* @param mdUnitMeasure 单位
|
||||
* @return 单位集合
|
||||
*/
|
||||
public List<MdUnitMeasure> selectMdUnitMeasureList(MdUnitMeasure mdUnitMeasure);
|
||||
|
||||
/**
|
||||
* 新增单位
|
||||
*
|
||||
* @param mdUnitMeasure 单位
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMdUnitMeasure(MdUnitMeasure mdUnitMeasure);
|
||||
|
||||
/**
|
||||
* 修改单位
|
||||
*
|
||||
* @param mdUnitMeasure 单位
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMdUnitMeasure(MdUnitMeasure mdUnitMeasure);
|
||||
|
||||
/**
|
||||
* 删除单位
|
||||
*
|
||||
* @param measureId 单位主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdUnitMeasureByMeasureId(Long measureId);
|
||||
|
||||
/**
|
||||
* 批量删除单位
|
||||
*
|
||||
* @param measureIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdUnitMeasureByMeasureIds(Long[] measureIds);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ktg.mes.md.service;
|
||||
|
||||
import com.ktg.common.core.domain.TreeSelect;
|
||||
import com.ktg.common.core.domain.entity.ItemType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IItemTypeService {
|
||||
|
||||
public List<ItemType> selectItemTypeList(ItemType itemType);
|
||||
|
||||
public ItemType selectItemTypeById(Long itemTypeId);
|
||||
|
||||
public List<TreeSelect> buildTreeSelect(List<ItemType> list);
|
||||
|
||||
public String checkItemTypeCodeUnique(ItemType itemType);
|
||||
|
||||
public String checkItemTypeNameUnique(ItemType itemType);
|
||||
|
||||
public Integer insertItemType(ItemType itemType);
|
||||
|
||||
public Integer updateItemType(ItemType itemType);
|
||||
|
||||
public Integer removeItemType(Long itemTypeId);
|
||||
|
||||
public boolean checkHasChild(Long itemTypeId);
|
||||
|
||||
public boolean checkHasItem(Long itemTypeId);
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.ktg.mes.md.service;
|
||||
|
||||
import com.ktg.mes.md.domain.MdItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IMdItemService {
|
||||
|
||||
/**
|
||||
* 根据条件查询物料编码
|
||||
* @param mdItem
|
||||
* @return
|
||||
*/
|
||||
public List<MdItem> selectMdItemList(MdItem mdItem);
|
||||
|
||||
/**
|
||||
* 查询所有物料编码
|
||||
* @return
|
||||
*/
|
||||
public List<MdItem> selectMdItemAll();
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询物料编码
|
||||
* @param itemId
|
||||
* @return
|
||||
*/
|
||||
public MdItem selectMdItemById(Long itemId);
|
||||
|
||||
/**
|
||||
* 检查物料编码是否唯一
|
||||
* @param mdItem
|
||||
* @return
|
||||
*/
|
||||
public String checkItemCodeUnique(MdItem mdItem);
|
||||
|
||||
/**
|
||||
* 检查物料名称是否唯一
|
||||
* @param mdItem
|
||||
* @return
|
||||
*/
|
||||
public String checkItemNameUnique(MdItem mdItem);
|
||||
|
||||
/**
|
||||
* 新增物料编码
|
||||
* @param mdItem
|
||||
* @return
|
||||
*/
|
||||
public int insertMdItem(MdItem mdItem);
|
||||
|
||||
/**
|
||||
* 更新物料编码
|
||||
* @param mdItem
|
||||
* @return
|
||||
*/
|
||||
public int updateMdItem(MdItem mdItem);
|
||||
|
||||
/**
|
||||
* 批量删除物料编码
|
||||
* @param itemIds
|
||||
* @return
|
||||
*/
|
||||
public int deleteByItemIds(Long[] itemIds);
|
||||
|
||||
/**
|
||||
* 根据主键删除物料编码
|
||||
* @param itemId
|
||||
* @return
|
||||
*/
|
||||
public int deleteByItemId(Long itemId);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.ktg.mes.md.service;
|
||||
|
||||
import com.ktg.mes.md.domain.MdProductBom;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 产品BOM关系Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-05
|
||||
*/
|
||||
public interface IMdProductBomService
|
||||
{
|
||||
/**
|
||||
* 查询产品BOM关系
|
||||
*
|
||||
* @param bomId 产品BOM关系主键
|
||||
* @return 产品BOM关系
|
||||
*/
|
||||
public MdProductBom selectMdProductBomByBomId(Long bomId);
|
||||
|
||||
/**
|
||||
* 查询产品BOM关系列表
|
||||
*
|
||||
* @param mdProductBom 产品BOM关系
|
||||
* @return 产品BOM关系集合
|
||||
*/
|
||||
public List<MdProductBom> selectMdProductBomList(MdProductBom mdProductBom);
|
||||
|
||||
/**
|
||||
* 检查物料BOM是否已经存在
|
||||
* @param mdProductBom
|
||||
* @return
|
||||
*/
|
||||
public String checkBomExist(MdProductBom mdProductBom);
|
||||
|
||||
/**
|
||||
* 新增产品BOM关系
|
||||
*
|
||||
* @param mdProductBom 产品BOM关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMdProductBom(MdProductBom mdProductBom);
|
||||
|
||||
/**
|
||||
* 修改产品BOM关系
|
||||
*
|
||||
* @param mdProductBom 产品BOM关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMdProductBom(MdProductBom mdProductBom);
|
||||
|
||||
/**
|
||||
* 批量删除产品BOM关系
|
||||
*
|
||||
* @param bomIds 需要删除的产品BOM关系主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdProductBomByBomIds(Long[] bomIds);
|
||||
|
||||
/**
|
||||
* 删除产品BOM关系信息
|
||||
*
|
||||
* @param bomId 产品BOM关系主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdProductBomByBomId(Long bomId);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.ktg.mes.md.service;
|
||||
|
||||
import com.ktg.mes.md.domain.MdUnitMeasure;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 单位Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-04-27
|
||||
*/
|
||||
public interface IMdUnitMeasureService
|
||||
{
|
||||
/**
|
||||
* 查询单位
|
||||
*
|
||||
* @param measureId 单位主键
|
||||
* @return 单位
|
||||
*/
|
||||
public MdUnitMeasure selectMdUnitMeasureByMeasureId(Long measureId);
|
||||
|
||||
/**
|
||||
* 查询单位列表
|
||||
*
|
||||
* @param mdUnitMeasure 单位
|
||||
* @return 单位集合
|
||||
*/
|
||||
public List<MdUnitMeasure> selectMdUnitMeasureList(MdUnitMeasure mdUnitMeasure);
|
||||
|
||||
/**
|
||||
* 新增单位
|
||||
*
|
||||
* @param mdUnitMeasure 单位
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMdUnitMeasure(MdUnitMeasure mdUnitMeasure);
|
||||
|
||||
/**
|
||||
* 修改单位
|
||||
*
|
||||
* @param mdUnitMeasure 单位
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMdUnitMeasure(MdUnitMeasure mdUnitMeasure);
|
||||
|
||||
/**
|
||||
* 批量删除单位
|
||||
*
|
||||
* @param measureIds 需要删除的单位主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdUnitMeasureByMeasureIds(Long[] measureIds);
|
||||
|
||||
/**
|
||||
* 删除单位信息
|
||||
*
|
||||
* @param measureId 单位主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdUnitMeasureByMeasureId(Long measureId);
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
package com.ktg.mes.md.service.impl;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.core.domain.TreeSelect;
|
||||
import com.ktg.common.core.domain.entity.ItemType;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import com.ktg.mes.md.mapper.ItemTypeMapper;
|
||||
import com.ktg.mes.md.service.IItemTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class ItemTypeServiceImpl implements IItemTypeService {
|
||||
|
||||
@Autowired
|
||||
private ItemTypeMapper itemTypeMapper;
|
||||
|
||||
@Override
|
||||
public List<ItemType> selectItemTypeList(ItemType itemType) {
|
||||
return itemTypeMapper.selectItemTypeList(itemType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemType selectItemTypeById(Long itemTypeId) {
|
||||
return itemTypeMapper.selectItemTypeById(itemTypeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TreeSelect> buildTreeSelect(List<ItemType> list) {
|
||||
List<ItemType> itemTypes = buildTree(list);
|
||||
return itemTypes.stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private List<ItemType> buildTree(List<ItemType> itemTypes){
|
||||
List<ItemType> returnList = new ArrayList<ItemType>();
|
||||
List<Long> tempList = new ArrayList<Long>();
|
||||
for(ItemType it : itemTypes){
|
||||
tempList.add(it.getItemTypeId());
|
||||
}
|
||||
|
||||
for(ItemType it : itemTypes){
|
||||
if(!tempList.contains(it.getParentTypeId())){
|
||||
recursionFn(itemTypes,it);
|
||||
returnList.add(it);
|
||||
}
|
||||
}
|
||||
if(returnList.isEmpty()){
|
||||
returnList = itemTypes;
|
||||
}
|
||||
return returnList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归列表
|
||||
*/
|
||||
private void recursionFn(List<ItemType> list, ItemType t)
|
||||
{
|
||||
// 得到子节点列表
|
||||
List<ItemType> childList = getChildList(list, t);
|
||||
t.setChildren(childList);
|
||||
for (ItemType tChild : childList)
|
||||
{
|
||||
if (hasChild(list, tChild))
|
||||
{
|
||||
recursionFn(list, tChild);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到子节点列表
|
||||
*/
|
||||
private List<ItemType> getChildList(List<ItemType> list, ItemType t)
|
||||
{
|
||||
List<ItemType> tlist = new ArrayList<ItemType>();
|
||||
Iterator<ItemType> it = list.iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
ItemType n = (ItemType) it.next();
|
||||
if (StringUtils.isNotNull(n.getParentTypeId()) && n.getParentTypeId().longValue() == t.getItemTypeId().longValue())
|
||||
{
|
||||
tlist.add(n);
|
||||
}
|
||||
}
|
||||
return tlist;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否有子节点
|
||||
*/
|
||||
private boolean hasChild(List<ItemType> list, ItemType t)
|
||||
{
|
||||
return getChildList(list, t).size() > 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String checkItemTypeCodeUnique(ItemType itemType) {
|
||||
ItemType itemType1 =itemTypeMapper.checkItemTypeCodeUnique(itemType.getItemTypeCode(),itemType.getParentTypeId());
|
||||
Long itemTypeId = itemType.getItemTypeId() ==null? -1L:itemType.getItemTypeId();
|
||||
if(StringUtils.isNotNull(itemType1)&& itemTypeId.longValue() != itemType1.getItemTypeId().longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkItemTypeNameUnique(ItemType itemType) {
|
||||
ItemType itemType1 =itemTypeMapper.checkItemTypeNameUnique(itemType.getItemTypeName(),itemType.getParentTypeId());
|
||||
Long itemTypeId = itemType.getItemTypeId() ==null? -1L:itemType.getItemTypeId();
|
||||
if(StringUtils.isNotNull(itemType1)&& itemTypeId.longValue() != itemType1.getItemTypeId().longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer insertItemType(ItemType itemType) {
|
||||
if(itemType.getParentTypeId()!= null){
|
||||
ItemType parent = itemTypeMapper.selectItemTypeById(itemType.getParentTypeId());
|
||||
if(StringUtils.isNotNull(parent)){
|
||||
itemType.setAncestors(parent.getAncestors()+","+parent.getItemTypeId());
|
||||
}
|
||||
}
|
||||
return itemTypeMapper.insertItemType(itemType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer updateItemType(ItemType itemType) {
|
||||
return itemTypeMapper.updateItemType(itemType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer removeItemType(Long itemTypeId) {
|
||||
return itemTypeMapper.deleteItemTypeById(itemTypeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkHasChild(Long itemTypeId) {
|
||||
int num =itemTypeMapper.hasChildByItemTypeId(itemTypeId);
|
||||
return num >0 ? true:false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkHasItem(Long itemTypeId) {
|
||||
int num =itemTypeMapper.hasItemByItemTypeId(itemTypeId);
|
||||
return num >0 ? true:false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.ktg.mes.md.service.impl;
|
||||
|
||||
import com.ktg.mes.md.service.IMdItemService;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import com.ktg.mes.md.domain.MdItem;
|
||||
import com.ktg.mes.md.mapper.MdItemMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class MdItemServiceImpl implements IMdItemService {
|
||||
|
||||
@Autowired
|
||||
private MdItemMapper mdItemMapper;
|
||||
|
||||
@Override
|
||||
public List<MdItem> selectMdItemList(MdItem mdItem) {
|
||||
return mdItemMapper.selectMdItemList(mdItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MdItem> selectMdItemAll() {
|
||||
return mdItemMapper.selectMdItemAll();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public MdItem selectMdItemById(Long itemId) {
|
||||
return mdItemMapper.selectMdItemById(itemId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkItemCodeUnique(MdItem mdItem) {
|
||||
MdItem item = mdItemMapper.checkItemCodeUnique(mdItem);
|
||||
Long itemId = mdItem.getItemId() == null? -1L:mdItem.getItemId();
|
||||
if(StringUtils.isNotNull(item) && item.getItemId().longValue() != itemId.longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}else{
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkItemNameUnique(MdItem mdItem) {
|
||||
MdItem item = mdItemMapper.checkItemNameUnique(mdItem);
|
||||
Long itemId = mdItem.getItemId() == null? -1L:mdItem.getItemId();
|
||||
if(StringUtils.isNotNull(item) && item.getItemId().longValue() != itemId.longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}else{
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertMdItem(MdItem mdItem) {
|
||||
return mdItemMapper.insertMdItem(mdItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateMdItem(MdItem mdItem) {
|
||||
return mdItemMapper.updateMdItem(mdItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByItemIds(Long[] itemIds) {
|
||||
return mdItemMapper.deleteMdItemByIds(itemIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByItemId(Long itemId) {
|
||||
return mdItemMapper.deleteMdItemById(itemId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.ktg.mes.md.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ktg.mes.md.service.IMdProductBomService;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.md.mapper.MdProductBomMapper;
|
||||
import com.ktg.mes.md.domain.MdProductBom;
|
||||
|
||||
/**
|
||||
* 产品BOM关系Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-05
|
||||
*/
|
||||
@Service
|
||||
public class MdProductBomServiceImpl implements IMdProductBomService
|
||||
{
|
||||
@Autowired
|
||||
private MdProductBomMapper mdProductBomMapper;
|
||||
|
||||
/**
|
||||
* 查询产品BOM关系
|
||||
*
|
||||
* @param bomId 产品BOM关系主键
|
||||
* @return 产品BOM关系
|
||||
*/
|
||||
@Override
|
||||
public MdProductBom selectMdProductBomByBomId(Long bomId)
|
||||
{
|
||||
return mdProductBomMapper.selectMdProductBomByBomId(bomId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询产品BOM关系列表
|
||||
*
|
||||
* @param mdProductBom 产品BOM关系
|
||||
* @return 产品BOM关系
|
||||
*/
|
||||
@Override
|
||||
public List<MdProductBom> selectMdProductBomList(MdProductBom mdProductBom)
|
||||
{
|
||||
return mdProductBomMapper.selectMdProductBomList(mdProductBom);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkBomExist(MdProductBom mdProductBom) {
|
||||
MdProductBom bom = mdProductBomMapper.checkBomExist(mdProductBom);
|
||||
Long bomId = mdProductBom.getBomId()==null?-1L:mdProductBom.getBomId();
|
||||
if(StringUtils.isNotNull(bom) && bom.getBomId().longValue() != bomId.longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品BOM关系
|
||||
*
|
||||
* @param mdProductBom 产品BOM关系
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMdProductBom(MdProductBom mdProductBom)
|
||||
{
|
||||
mdProductBom.setCreateTime(DateUtils.getNowDate());
|
||||
return mdProductBomMapper.insertMdProductBom(mdProductBom);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品BOM关系
|
||||
*
|
||||
* @param mdProductBom 产品BOM关系
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMdProductBom(MdProductBom mdProductBom)
|
||||
{
|
||||
mdProductBom.setUpdateTime(DateUtils.getNowDate());
|
||||
return mdProductBomMapper.updateMdProductBom(mdProductBom);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除产品BOM关系
|
||||
*
|
||||
* @param bomIds 需要删除的产品BOM关系主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMdProductBomByBomIds(Long[] bomIds)
|
||||
{
|
||||
return mdProductBomMapper.deleteMdProductBomByBomIds(bomIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品BOM关系信息
|
||||
*
|
||||
* @param bomId 产品BOM关系主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMdProductBomByBomId(Long bomId)
|
||||
{
|
||||
return mdProductBomMapper.deleteMdProductBomByBomId(bomId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.ktg.mes.md.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ktg.mes.md.service.IMdUnitMeasureService;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.md.mapper.MdUnitMeasureMapper;
|
||||
import com.ktg.mes.md.domain.MdUnitMeasure;
|
||||
|
||||
/**
|
||||
* 单位Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-04-27
|
||||
*/
|
||||
@Service
|
||||
public class MdUnitMeasureServiceImpl implements IMdUnitMeasureService
|
||||
{
|
||||
@Autowired
|
||||
private MdUnitMeasureMapper mdUnitMeasureMapper;
|
||||
|
||||
/**
|
||||
* 查询单位
|
||||
*
|
||||
* @param measureId 单位主键
|
||||
* @return 单位
|
||||
*/
|
||||
@Override
|
||||
public MdUnitMeasure selectMdUnitMeasureByMeasureId(Long measureId)
|
||||
{
|
||||
return mdUnitMeasureMapper.selectMdUnitMeasureByMeasureId(measureId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询单位列表
|
||||
*
|
||||
* @param mdUnitMeasure 单位
|
||||
* @return 单位
|
||||
*/
|
||||
@Override
|
||||
public List<MdUnitMeasure> selectMdUnitMeasureList(MdUnitMeasure mdUnitMeasure)
|
||||
{
|
||||
return mdUnitMeasureMapper.selectMdUnitMeasureList(mdUnitMeasure);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增单位
|
||||
*
|
||||
* @param mdUnitMeasure 单位
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMdUnitMeasure(MdUnitMeasure mdUnitMeasure)
|
||||
{
|
||||
mdUnitMeasure.setCreateTime(DateUtils.getNowDate());
|
||||
return mdUnitMeasureMapper.insertMdUnitMeasure(mdUnitMeasure);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改单位
|
||||
*
|
||||
* @param mdUnitMeasure 单位
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMdUnitMeasure(MdUnitMeasure mdUnitMeasure)
|
||||
{
|
||||
mdUnitMeasure.setUpdateTime(DateUtils.getNowDate());
|
||||
return mdUnitMeasureMapper.updateMdUnitMeasure(mdUnitMeasure);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除单位
|
||||
*
|
||||
* @param measureIds 需要删除的单位主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMdUnitMeasureByMeasureIds(Long[] measureIds)
|
||||
{
|
||||
return mdUnitMeasureMapper.deleteMdUnitMeasureByMeasureIds(measureIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除单位信息
|
||||
*
|
||||
* @param measureId 单位主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMdUnitMeasureByMeasureId(Long measureId)
|
||||
{
|
||||
return mdUnitMeasureMapper.deleteMdUnitMeasureByMeasureId(measureId);
|
||||
}
|
||||
}
|
||||
161
ktg-mes/src/main/resources/mapper/md/ItemTypeMapper.xml
Normal file
161
ktg-mes/src/main/resources/mapper/md/ItemTypeMapper.xml
Normal file
@@ -0,0 +1,161 @@
|
||||
<?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.ktg.mes.md.mapper.ItemTypeMapper">
|
||||
|
||||
<resultMap type="ItemType" id="ItemTypeResult">
|
||||
<id property="itemTypeId" column="item_type_id" />
|
||||
<result property="itemTypeCode" column="item_type_code" />
|
||||
<result property="itemTypeName" column="item_type_name" />
|
||||
<result property="parentTypeId" column="parent_type_id" />
|
||||
<result property="ancestors" column="ancestors" />
|
||||
<result property="itemOrProduct" column="item_or_product" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="enableFlag" column="enable_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectItemTypeVo">
|
||||
select d.item_type_id,d.item_type_code,d.item_type_name,d.parent_type_id,d.ancestors, d.item_or_product, d.order_num, d.enable_flag, d.remark,d.attr1,d.attr2,d.attr3,d.attr4, d.create_by, d.create_time
|
||||
from md_item_type d
|
||||
</sql>
|
||||
|
||||
<select id="selectItemTypeList" parameterType="ItemType" resultMap="ItemTypeResult">
|
||||
<include refid="selectItemTypeVo"/>
|
||||
where 1 = 1
|
||||
<if test="itemTypeId != null and itemTypeId != 0">
|
||||
AND item_type_id = #{itemTypeId}
|
||||
</if>
|
||||
<if test="parentTypeId != null and parentTypeId != 0">
|
||||
AND parent_type_id = #{parentTypeId}
|
||||
</if>
|
||||
<if test="itemTypeCode != null and itemTypeCode != ''">
|
||||
AND item_type_code like concat('%', #{itemTypeCode}, '%')
|
||||
</if>
|
||||
<if test="itemTypeName != null and itemTypeName != ''">
|
||||
AND item_type_name like concat('%', #{itemTypeName}, '%')
|
||||
</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">
|
||||
AND enable_flag = #{enableFlag}
|
||||
</if>
|
||||
<if test="itemOrProduct != null and itemOrProduct != ''">
|
||||
AND item_or_product = #{itemOrProduct}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by d.parent_type_id, d.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectItemTypeById" parameterType="Long" resultMap="ItemTypeResult">
|
||||
<include refid="selectItemTypeVo"/>
|
||||
where item_type_id = #{itemTypeId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="hasChildByItemTypeId" parameterType="Long" resultType="int">
|
||||
select count(1) from md_item_type
|
||||
where parent_type_id = #{parentTypeId} limit 1
|
||||
</select>
|
||||
|
||||
<select id="hasItemByItemTypeId" parameterType="Long" resultType="int">
|
||||
select count(1) from md_item
|
||||
where item_type_id = #{itemTypeId} limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectChildrenItemTypeById" parameterType="Long" resultMap="ItemTypeResult">
|
||||
select * from md_item_type where parent_type_id = #{parentTypeId} order by orderNum asc
|
||||
</select>
|
||||
|
||||
<select id="selectNormalChildrenItemTypeById" parameterType="Long" resultType="int">
|
||||
select count(*) from md_item_type where enable_flag = 'Y' and parent_type_id = #{parentTypeId}
|
||||
</select>
|
||||
|
||||
<select id="checkItemTypeNameUnique" resultMap="ItemTypeResult">
|
||||
<include refid="selectItemTypeVo"/>
|
||||
where item_type_name=#{itemTypeName} and parent_type_id = #{parentTypeId} limit 1
|
||||
</select>
|
||||
<select id="checkItemTypeCodeUnique" resultMap="ItemTypeResult">
|
||||
<include refid="selectItemTypeVo"/>
|
||||
where item_type_code=#{itemTypeCode} and parent_type_id = #{parentTypeId} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertItemType" parameterType="ItemType">
|
||||
insert into md_item_type(
|
||||
<if test="itemTypeId != null and itemTypeId != 0">item_type_id,</if>
|
||||
<if test="parentTypeId != null and parentTypeId != 0">parent_type_id,</if>
|
||||
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
||||
<if test="itemTypeCode != null and itemTypeCode != ''">item_type_code,</if>
|
||||
<if test="itemTypeName != null and itemTypeName != ''">item_type_name,</if>
|
||||
<if test="orderNum != null and orderNum != ''">order_num,</if>
|
||||
<if test="itemOrProduct != null and itemOrProduct != ''">item_or_product,</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">enable_flag,</if>
|
||||
<if test="attr1 != null and attr1 != ''">attr1,</if>
|
||||
<if test="attr2 != null and attr2 != ''">attr2,</if>
|
||||
<if test="attr3 != null and attr3 != 0">attr3,</if>
|
||||
<if test="attr4 != null and attr4 != 0">attr4,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="itemTypeId != null and itemTypeId != 0">#{itemTypeId},</if>
|
||||
<if test="parentTypeId != null and parentTypeId != 0">#{parentTypeId},</if>
|
||||
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
||||
<if test="itemTypeCode != null and itemTypeCode != ''">#{itemTypeCode},</if>
|
||||
<if test="itemTypeName != null and itemTypeName != ''">#{itemTypeName},</if>
|
||||
<if test="orderNum != null and orderNum != 0">#{orderNum},</if>
|
||||
<if test="itemOrProduct != null and itemOrProduct != ''">#{itemOrProduct},</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">#{enableFlag},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="attr1 != null and attr1 != ''">#{attr1},</if>
|
||||
<if test="attr2 != null and attr2 != ''">#{attr2},</if>
|
||||
<if test="attr3 != null and attr3 != 0">#{attr3},</if>
|
||||
<if test="attr4 != null and attr4 != 0">#{attr4},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateItemType" parameterType="ItemType">
|
||||
update md_item_type
|
||||
<set>
|
||||
<if test="parentTypeId != null and parentTypeId != 0">parent_type_id = #{parentTypeId},</if>
|
||||
<if test="itemTypeName != null and itemTypeName != ''">item_type_name = #{itemTypeName},</if>
|
||||
<if test="itemTypeCode != null and itemTypeCode != ''">item_type_code = #{itemTypeCode},</if>
|
||||
<if test="itemOrProduct != null and itemOrProduct != ''">item_or_product = #{itemOrProduct},</if>
|
||||
<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
|
||||
<if test="remark != null and remark !=''">remark = #{remark},</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">enable_flag = #{enableFlag},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where item_type_id = #{itemTypeId}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateItemTypeStatusNormal" parameterType="Long">
|
||||
update md_item_type set enable_flag = 'N' where item_type_id in
|
||||
<foreach collection="array" item="itemTypeId" open="(" separator="," close=")">
|
||||
#{itemTypeId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<delete id="deleteItemTypeById" parameterType="Long">
|
||||
delete from md_item_type where item_type_id = #{itemTypeId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteItemTypeByIds" parameterType="Long">
|
||||
delete from md_item_type where item_type_id in
|
||||
<foreach collection="array" item="itemTypeId" open="(" separator="," close=")">
|
||||
#{itemTypeId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
153
ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml
Normal file
153
ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml
Normal file
@@ -0,0 +1,153 @@
|
||||
<?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.ktg.mes.md.mapper.MdItemMapper">
|
||||
|
||||
<resultMap type="MdItem" id="MdItemResult">
|
||||
<id property="itemId" column="item_id" />
|
||||
<result property="itemCode" column="item_code" />
|
||||
<result property="itemName" column="item_name" />
|
||||
<result property="specification" column="specification" />
|
||||
<result property="unitOfMeasure" column="unit_of_measure" />
|
||||
<result property="itemOrProduct" column="item_or_product" />
|
||||
<result property="itemTypeId" column="item_type_id" />
|
||||
<result property="itemTypeCode" column="item_type_code" />
|
||||
<result property="itemTypeName" column="item_type_name" />
|
||||
<result property="enableFlag" column="enable_flag" />
|
||||
<result property="safeStockFlag" column="safe_stock_flag" />
|
||||
<result property="minStock" column="min_stock" />
|
||||
<result property="maxStock" column="max_stock" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMdItemVo">
|
||||
select item_id, item_code, item_name, specification, unit_of_measure, item_or_product,
|
||||
item_type_id,item_type_code,item_type_name,enable_flag,safe_stock_flag,min_stock,max_stock, create_by, create_time, remark
|
||||
from md_item
|
||||
</sql>
|
||||
|
||||
<select id="selectMdItemList" parameterType="MdItem" resultMap="MdItemResult">
|
||||
<include refid="selectMdItemVo"/>
|
||||
<where>
|
||||
<if test="itemCode != null and itemCode != ''">
|
||||
AND item_code like concat('%', #{itemCode}, '%')
|
||||
</if>
|
||||
<if test="itemTypeId != null and itemTypeId != 0 ">
|
||||
AND (item_type_id = #{itemTypeId} OR item_type_id in (select item_type_id from md_item_type where find_in_set(#{itemTypeId},ancestors)))
|
||||
</if>
|
||||
<if test="itemName != null and itemName != ''">
|
||||
AND item_name like concat('%', #{itemName}, '%')
|
||||
</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">
|
||||
AND enable_flag = #{enableFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMdItemAll" resultMap="MdItemResult">
|
||||
<include refid="selectMdItemVo"></include>
|
||||
</select>
|
||||
|
||||
<select id="selectMdItemById" parameterType="Long" resultMap="MdItemResult">
|
||||
<include refid="selectMdItemVo"></include>
|
||||
where item_id = #{itemId}
|
||||
</select>
|
||||
|
||||
<select id="checkItemCodeUnique" parameterType="MdItem" resultMap="MdItemResult">
|
||||
<include refid="selectMdItemVo"/>
|
||||
where item_code = #{itemCode} limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkItemNameUnique" parameterType="MdItem" resultMap="MdItemResult">
|
||||
<include refid="selectMdItemVo"/>
|
||||
where item_code = #{itemName} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertMdItem" parameterType="MdItem" useGeneratedKeys="true" keyProperty="itemId">
|
||||
insert into md_item(
|
||||
item_code,
|
||||
item_name,
|
||||
<if test="specification !=null and specification !=''">specification,</if>
|
||||
unit_of_measure,
|
||||
item_or_product,
|
||||
item_type_id,
|
||||
<if test="itemTypeCode !=null and itemTypeCode !=''">item_type_code,</if>
|
||||
<if test="itemTypeName !=null and itemTypeName !=''">item_type_name,</if>
|
||||
<if test="enableFlag !=null and enableFlag !=''">enable_flag,</if>
|
||||
safe_stock_flag,
|
||||
<if test="safeStockFlag =='Y'.toString()">min_stock,</if>
|
||||
<if test="safeStockFlag =='Y'.toString()">max_stock,</if>
|
||||
<if test="remark !=null and remark !=''">remark,</if>
|
||||
<if test="attr1 !=null and attr1 !=''">attr1,</if>
|
||||
<if test="attr2 !=null and attr2 !=''">attr2,</if>
|
||||
<if test="attr3 !=null and attr3 !=0">attr3,</if>
|
||||
<if test="attr4 !=null and attr4 !=0">attr4,</if>
|
||||
<if test="createBy !=null and createBy !=''">create_by,</if>
|
||||
create_time
|
||||
)
|
||||
values (
|
||||
#{itemCode},
|
||||
#{itemName},
|
||||
<if test="specification !=null and specification !=''">#{specification},</if>
|
||||
#{unitOfMeasure},
|
||||
#{itemOrProduct},
|
||||
#{itemTypeId},
|
||||
<if test="itemTypeCode !=null and itemTypeCode !=''">#{itemTypeCode},</if>
|
||||
<if test="itemTypeName !=null and itemTypeName !=''">#{itemTypeName},</if>
|
||||
<if test="enableFlag !=null and enableFlag !=''">#{enableFlag},</if>
|
||||
#{safeStockFlag},
|
||||
<if test="safeStockFlag =='Y'.toString() and minStock !=null ">#{minStock},</if>
|
||||
<if test="safeStockFlag =='Y'.toString() and safeStockFlag !=null ">#{maxStock},</if>
|
||||
<if test="remark !=null and remark !=''">#{remark},</if>
|
||||
<if test="attr1 !=null and attr1 !=''">#{attr1},</if>
|
||||
<if test="attr2 !=null and attr2 !=''">#{attr2},</if>
|
||||
<if test="attr3 !=null and attr3 !=0">#{attr3},</if>
|
||||
<if test="attr4 !=null and attr4 !=0">#{attr4},</if>
|
||||
<if test="createBy !=null and createBy !=''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateMdItem" parameterType="MdItem">
|
||||
update md_item
|
||||
<set>
|
||||
<if test="itemName !=null and itemName !=''">item_name = #{itemName},</if>
|
||||
<if test="specification !=null and specification !=''">specification = #{specification},</if>
|
||||
<if test="unitOfMeasure !=null and unitOfMeasure !=''">unit_of_measure = #{unitOfMeasure},</if>
|
||||
<if test="itemOrProduct !=null and itemOrProduct !=''">item_or_product = #{itemOrProduct},</if>
|
||||
<if test="enableFlag !=null and enableFlag !=''">enable_flag = #{enableFlag},</if>
|
||||
<if test="safeStockFlag !=null and safeStockFlag !=''">safe_stock_flag = #{safeStockFlag},</if>
|
||||
<if test="minStock !=null and minStock !=''">min_stock = #{minStock},</if>
|
||||
<if test="maxStock !=null and maxStock !=''">max_stock = #{maxStock},</if>
|
||||
<if test="remark !=null and remark !=''">remark = #{remark},</if>
|
||||
<if test="attr1 !=null and attr1 !=''">attr1=#{attr1},</if>
|
||||
<if test="attr2 !=null and attr2 !=''">attr2=#{attr2},</if>
|
||||
<if test="attr3 !=null and attr3 !=0">attr3=#{attr3},</if>
|
||||
<if test="attr4 !=null and attr4 !=0">attr4=#{attr4},</if>
|
||||
<if test="updateBy !=null and updateBy !=''">update_by=#{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where item_id = #{itemId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMdItemById" parameterType="Long">
|
||||
delete from md_item where item_id =#{itemId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMdItemByIds" parameterType="Long">
|
||||
delete from md_item where item_id in
|
||||
<foreach collection="array" item="itemId" open="(" separator="," close=")" >
|
||||
#{itemId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
136
ktg-mes/src/main/resources/mapper/md/MdProductBomMapper.xml
Normal file
136
ktg-mes/src/main/resources/mapper/md/MdProductBomMapper.xml
Normal file
@@ -0,0 +1,136 @@
|
||||
<?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.ktg.mes.md.mapper.MdProductBomMapper">
|
||||
|
||||
<resultMap type="MdProductBom" id="MdProductBomResult">
|
||||
<result property="bomId" column="bom_id" />
|
||||
<result property="itemId" column="item_id" />
|
||||
<result property="bomItemId" column="bom_item_id" />
|
||||
<result property="bomItemCode" column="bom_item_code" />
|
||||
<result property="bomItemName" column="bom_item_name" />
|
||||
<result property="bomItemSpec" column="bom_item_spec" />
|
||||
<result property="unitOfMeasure" column="unit_of_measure" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="enableFlag" column="enable_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMdProductBomVo">
|
||||
select bom_id, item_id, bom_item_id, bom_item_code, bom_item_name, bom_item_spec, unit_of_measure, quantity, enable_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from md_product_bom
|
||||
</sql>
|
||||
|
||||
<select id="selectMdProductBomList" parameterType="MdProductBom" resultMap="MdProductBomResult">
|
||||
<include refid="selectMdProductBomVo"/>
|
||||
<where>
|
||||
<if test="itemId != null "> and item_id = #{itemId}</if>
|
||||
<if test="bomItemId != null "> and bom_item_id = #{bomItemId}</if>
|
||||
<if test="bomItemCode != null and bomItemCode != ''"> and bom_item_code = #{bomItemCode}</if>
|
||||
<if test="bomItemName != null and bomItemName != ''"> and bom_item_name like concat('%', #{bomItemName}, '%')</if>
|
||||
<if test="bomItemSpec != null and bomItemSpec != ''"> and bom_item_spec = #{bomItemSpec}</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''"> and unit_of_measure = #{unitOfMeasure}</if>
|
||||
<if test="quantity != null "> and quantity = #{quantity}</if>
|
||||
<if test="enableFlag != null and enableFlag != ''"> and enable_flag = #{enableFlag}</if>
|
||||
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
|
||||
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
|
||||
<if test="attr3 != null "> and attr3 = #{attr3}</if>
|
||||
<if test="attr4 != null "> and attr4 = #{attr4}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMdProductBomByBomId" parameterType="Long" resultMap="MdProductBomResult">
|
||||
<include refid="selectMdProductBomVo"/>
|
||||
where bom_id = #{bomId}
|
||||
</select>
|
||||
|
||||
<select id="checkBomExist" parameterType="MdProductBom" resultMap="MdProductBomResult">
|
||||
<include refid="selectMdProductBomVo"/>
|
||||
where item_id = #{itemId} and bom_item_id = #{bomItemId} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertMdProductBom" parameterType="MdProductBom" useGeneratedKeys="true" keyProperty="bomId">
|
||||
insert into md_product_bom
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="itemId != null">item_id,</if>
|
||||
<if test="bomItemId != null">bom_item_id,</if>
|
||||
<if test="bomItemCode != null and bomItemCode != ''">bom_item_code,</if>
|
||||
<if test="bomItemName != null and bomItemName != ''">bom_item_name,</if>
|
||||
<if test="bomItemSpec != null">bom_item_spec,</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''">unit_of_measure,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">enable_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="itemId != null">#{itemId},</if>
|
||||
<if test="bomItemId != null">#{bomItemId},</if>
|
||||
<if test="bomItemCode != null and bomItemCode != ''">#{bomItemCode},</if>
|
||||
<if test="bomItemName != null and bomItemName != ''">#{bomItemName},</if>
|
||||
<if test="bomItemSpec != null">#{bomItemSpec},</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''">#{unitOfMeasure},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">#{enableFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMdProductBom" parameterType="MdProductBom">
|
||||
update md_product_bom
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="itemId != null">item_id = #{itemId},</if>
|
||||
<if test="bomItemId != null">bom_item_id = #{bomItemId},</if>
|
||||
<if test="bomItemCode != null and bomItemCode != ''">bom_item_code = #{bomItemCode},</if>
|
||||
<if test="bomItemName != null and bomItemName != ''">bom_item_name = #{bomItemName},</if>
|
||||
<if test="bomItemSpec != null">bom_item_spec = #{bomItemSpec},</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''">unit_of_measure = #{unitOfMeasure},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">enable_flag = #{enableFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where bom_id = #{bomId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMdProductBomByBomId" parameterType="Long">
|
||||
delete from md_product_bom where bom_id = #{bomId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMdProductBomByBomIds" parameterType="String">
|
||||
delete from md_product_bom where bom_id in
|
||||
<foreach item="bomId" collection="array" open="(" separator="," close=")">
|
||||
#{bomId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
121
ktg-mes/src/main/resources/mapper/md/MdUnitMeasureMapper.xml
Normal file
121
ktg-mes/src/main/resources/mapper/md/MdUnitMeasureMapper.xml
Normal file
@@ -0,0 +1,121 @@
|
||||
<?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.ktg.mes.md.mapper.MdUnitMeasureMapper">
|
||||
|
||||
<resultMap type="MdUnitMeasure" id="MdUnitMeasureResult">
|
||||
<result property="measureId" column="measure_id" />
|
||||
<result property="measureCode" column="measure_code" />
|
||||
<result property="measureName" column="measure_name" />
|
||||
<result property="primaryFlag" column="primary_flag" />
|
||||
<result property="primaryId" column="primary_id" />
|
||||
<result property="changeRate" column="change_rate" />
|
||||
<result property="enableFlag" column="enable_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMdUnitMeasureVo">
|
||||
select measure_id, measure_code, measure_name, primary_flag, primary_id, change_rate, enable_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from md_unit_measure
|
||||
</sql>
|
||||
|
||||
<select id="selectMdUnitMeasureList" parameterType="MdUnitMeasure" resultMap="MdUnitMeasureResult">
|
||||
<include refid="selectMdUnitMeasureVo"/>
|
||||
<where>
|
||||
<if test="measureCode != null and measureCode != ''"> and measure_code = #{measureCode}</if>
|
||||
<if test="measureName != null and measureName != ''"> and measure_name like concat('%', #{measureName}, '%')</if>
|
||||
<if test="primaryFlag != null and primaryFlag != ''"> and primary_flag = #{primaryFlag}</if>
|
||||
<if test="primaryId != null "> and primary_id = #{primaryId}</if>
|
||||
<if test="changeRate != null "> and change_rate = #{changeRate}</if>
|
||||
<if test="enableFlag != null and enableFlag != ''"> and enable_flag = #{enableFlag}</if>
|
||||
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
|
||||
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
|
||||
<if test="attr3 != null "> and attr3 = #{attr3}</if>
|
||||
<if test="attr4 != null "> and attr4 = #{attr4}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMdUnitMeasureByMeasureId" parameterType="Long" resultMap="MdUnitMeasureResult">
|
||||
<include refid="selectMdUnitMeasureVo"/>
|
||||
where measure_id = #{measureId}
|
||||
</select>
|
||||
|
||||
<insert id="insertMdUnitMeasure" parameterType="MdUnitMeasure" useGeneratedKeys="true" keyProperty="measureId">
|
||||
insert into md_unit_measure
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="measureCode != null and measureCode != ''">measure_code,</if>
|
||||
<if test="measureName != null and measureName != ''">measure_name,</if>
|
||||
<if test="primaryFlag != null and primaryFlag != ''">primary_flag,</if>
|
||||
<if test="primaryId != null">primary_id,</if>
|
||||
<if test="changeRate != null">change_rate,</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">enable_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="measureCode != null and measureCode != ''">#{measureCode},</if>
|
||||
<if test="measureName != null and measureName != ''">#{measureName},</if>
|
||||
<if test="primaryFlag != null and primaryFlag != ''">#{primaryFlag},</if>
|
||||
<if test="primaryId != null">#{primaryId},</if>
|
||||
<if test="changeRate != null">#{changeRate},</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">#{enableFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMdUnitMeasure" parameterType="MdUnitMeasure">
|
||||
update md_unit_measure
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="measureCode != null and measureCode != ''">measure_code = #{measureCode},</if>
|
||||
<if test="measureName != null and measureName != ''">measure_name = #{measureName},</if>
|
||||
<if test="primaryFlag != null and primaryFlag != ''">primary_flag = #{primaryFlag},</if>
|
||||
<if test="primaryId != null">primary_id = #{primaryId},</if>
|
||||
<if test="changeRate != null">change_rate = #{changeRate},</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">enable_flag = #{enableFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where measure_id = #{measureId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMdUnitMeasureByMeasureId" parameterType="Long">
|
||||
delete from md_unit_measure where measure_id = #{measureId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMdUnitMeasureByMeasureIds" parameterType="String">
|
||||
delete from md_unit_measure where measure_id in
|
||||
<foreach item="measureId" collection="array" open="(" separator="," close=")">
|
||||
#{measureId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user