diff --git a/op-modules/op-technology/src/main/java/com/op/technology/controller/ProProcessController.java b/op-modules/op-technology/src/main/java/com/op/technology/controller/ProProcessController.java index f9459cc3..ddc19e17 100644 --- a/op-modules/op-technology/src/main/java/com/op/technology/controller/ProProcessController.java +++ b/op-modules/op-technology/src/main/java/com/op/technology/controller/ProProcessController.java @@ -162,10 +162,21 @@ public class ProProcessController extends BaseController { /** * 查询工厂模型列表 */ - @RequiresPermissions("mes:pro:process:list") - @GetMapping("/selectSysFactoryList") - public AjaxResult selectSysFactoryList(SysFactory sysFactory) { - List list = proProcessService.selectSysFactoryList(sysFactory); - return success(list); +// @RequiresPermissions("mes:pro:process:list") +// @GetMapping("/selectSysFactoryList") +// public AjaxResult selectSysFactoryList(SysFactory sysFactory) { +// List list = proProcessService.selectSysFactoryList(sysFactory); +// return success(list); +// } + + /** + * 查询设工作中心 + */ + @RequiresPermissions("wms:factory:getWorkCenterList") + @GetMapping("/getWorkCenterList") + public TableDataInfo getWorkCenterList(SysFactory sysFactory) { + startPage(); + List list = proProcessService.getWorkCenterList(sysFactory); + return getDataTable(list); } } diff --git a/op-modules/op-technology/src/main/java/com/op/technology/mapper/ProProcessMapper.java b/op-modules/op-technology/src/main/java/com/op/technology/mapper/ProProcessMapper.java index 2003b590..35eba4b2 100644 --- a/op-modules/op-technology/src/main/java/com/op/technology/mapper/ProProcessMapper.java +++ b/op-modules/op-technology/src/main/java/com/op/technology/mapper/ProProcessMapper.java @@ -71,6 +71,9 @@ public interface ProProcessMapper Equipment selectEquipmentByEquipmentId(Long equipmentId); List selectBaseBomComponentList(BomComponent bomComponent); - //查询工厂模型 - public List selectSysFactoryList(SysFactory sysFactory); + //查询树形工厂模型 +// public List selectSysFactoryList(SysFactory sysFactory); + + //查询下拉式工作中心 + public List getWorkCenterList(SysFactory sysFactory); } diff --git a/op-modules/op-technology/src/main/java/com/op/technology/service/IProProcessService.java b/op-modules/op-technology/src/main/java/com/op/technology/service/IProProcessService.java index 58a01716..0c3b7537 100644 --- a/op-modules/op-technology/src/main/java/com/op/technology/service/IProProcessService.java +++ b/op-modules/op-technology/src/main/java/com/op/technology/service/IProProcessService.java @@ -72,6 +72,9 @@ public interface IProProcessService public List selectBaseBomComponentList(BomComponent bomComponent); - //查询树形结构 - public List selectSysFactoryList(SysFactory sysFactory); + //查询树形工作中心结构 + //public List selectSysFactoryList(SysFactory sysFactory); + + //查询下拉式工作中心 + List getWorkCenterList(SysFactory sysFactory); } diff --git a/op-modules/op-technology/src/main/java/com/op/technology/service/impl/ProProcessServiceImpl.java b/op-modules/op-technology/src/main/java/com/op/technology/service/impl/ProProcessServiceImpl.java index 63752afd..6f58e225 100644 --- a/op-modules/op-technology/src/main/java/com/op/technology/service/impl/ProProcessServiceImpl.java +++ b/op-modules/op-technology/src/main/java/com/op/technology/service/impl/ProProcessServiceImpl.java @@ -222,6 +222,18 @@ public class ProProcessServiceImpl implements IProProcessService { return proProcessMapper.selectBaseBomComponentList(bomComponent); } +// /** +// * 查询工厂模型列表 +// * +// * @param sysFactory 工厂模型 +// * @return 工厂模型 +// */ +// @Override +// @DS("#header.poolName") +// public List selectSysFactoryList(SysFactory sysFactory) { +// return proProcessMapper.selectSysFactoryList(sysFactory); +// } + /** * 查询工厂模型列表 * @@ -230,7 +242,7 @@ public class ProProcessServiceImpl implements IProProcessService { */ @Override @DS("#header.poolName") - public List selectSysFactoryList(SysFactory sysFactory) { - return proProcessMapper.selectSysFactoryList(sysFactory); + public List getWorkCenterList(SysFactory sysFactory) { + return proProcessMapper.getWorkCenterList(sysFactory); } } diff --git a/op-modules/op-technology/src/main/resources/mapper/technology/ProProcessMapper.xml b/op-modules/op-technology/src/main/resources/mapper/technology/ProProcessMapper.xml index 7705a107..ece10a43 100644 --- a/op-modules/op-technology/src/main/resources/mapper/technology/ProProcessMapper.xml +++ b/op-modules/op-technology/src/main/resources/mapper/technology/ProProcessMapper.xml @@ -318,4 +318,9 @@ and bom_code = #{bomCode} + + diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseAreaController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseAreaController.java index cdddea1c..1483547f 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseAreaController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseAreaController.java @@ -72,7 +72,13 @@ public class BaseAreaController extends BaseController { @Log(title = "库区", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody BaseArea baseArea) { - return toAjax(baseAreaService.insertBaseArea(baseArea)); + if (baseAreaService.checkAreaCodeUnique(baseArea)) { + return AjaxResult.error("库区编码已存在!"); + }else if(baseAreaService.checkAreaDescUnique(baseArea)){ + return AjaxResult.error("库区描述已存在!"); + }else{ + return toAjax(baseAreaService.insertBaseArea(baseArea)); + } } /** diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseEquipmentController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseEquipmentController.java index 02d405dc..9fb4a939 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseEquipmentController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseEquipmentController.java @@ -72,7 +72,13 @@ public class BaseEquipmentController extends BaseController { @Log(title = "设备管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody BaseEquipment baseEquipment) { - return toAjax(baseEquipmentService.insertBaseEquipment(baseEquipment)); + if (baseEquipmentService.checkEquipmentCodeUnique(baseEquipment)) { + return AjaxResult.error("设备编码已存在!"); + }else if(baseEquipmentService.checkEquipmentNameUnique(baseEquipment)){ + return AjaxResult.error("设备名称已存在!"); + }else{ + return toAjax(baseEquipmentService.insertBaseEquipment(baseEquipment)); + } } /** diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/SysFactoryController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/SysFactoryController.java index 745f03f4..5227fb5e 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/SysFactoryController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/SysFactoryController.java @@ -2,6 +2,8 @@ package com.op.wms.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; + +import com.op.common.core.web.page.TableDataInfo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -92,4 +94,16 @@ public class SysFactoryController extends BaseController { public AjaxResult remove(@PathVariable Long[] factoryIds) { return toAjax(sysFactoryService.deleteSysFactoryByFactoryIds(factoryIds)); } + + // 查询工作中心 + /** + * 查询设备管理列表 + */ + @RequiresPermissions("wms:factory:getWorkCenterList") + @GetMapping("/getWorkCenterList") + public TableDataInfo getWorkCenterList(SysFactory sysFactory) { + startPage(); + List list = sysFactoryService.getWorkCenterList(sysFactory); + return getDataTable(list); + } } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/SysFactory.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/SysFactory.java index 3d491ed5..f2f0d7ed 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/domain/SysFactory.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/SysFactory.java @@ -5,6 +5,9 @@ import org.apache.commons.lang3.builder.ToStringStyle; import com.op.common.core.annotation.Excel; import com.op.common.core.web.domain.TreeEntity; +import java.util.List; +import java.util.Map; + /** * 工厂模型对象 sys_factory * @@ -44,6 +47,11 @@ public class SysFactory extends TreeEntity { @Excel(name = "工厂编码") private String factoryCode; + //虚拟字段 + private List> workCenter; + private String value; + private String label; + public void setFactoryId(Long factoryId) { this.factoryId = factoryId; } @@ -103,6 +111,27 @@ public class SysFactory extends TreeEntity { this.factoryCode = factoryCode; } + public String getValue() { + return value; + } + public void setValue(String value) { + this.value = value; + } + + public String getLabel() { + return label; + } + public void setLabel(String label) { + this.label = label; + } + + public List> getWorkCenter() { + return workCenter; + } + public void setWorkCenter(List> workCenter) { + this.workCenter = workCenter; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -120,7 +149,9 @@ public class SysFactory extends TreeEntity { .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) - .append("factoryCode", getFactoryCode()) - .toString(); + .append("factoryCode", getFactoryCode()) + .append("value", getValue()) + .append("label", getLabel()) + .toString(); } } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseAreaMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseAreaMapper.java index 080c9a07..c6ae9163 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseAreaMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseAreaMapper.java @@ -60,4 +60,7 @@ public interface BaseAreaMapper { public int deleteBaseAreaByAreaIds(String[] areaIds); public Integer queryCount(BaseArea baseArea); + + public String checkAreaCodeUnique(BaseArea baseArea); + public String checkAreaDescUnique(BaseArea baseArea); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseEquipmentMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseEquipmentMapper.java index 4a566ad6..ac3a2205 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseEquipmentMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseEquipmentMapper.java @@ -2,6 +2,7 @@ package com.op.wms.mapper; import java.util.List; +import com.baomidou.dynamic.datasource.annotation.DS; import com.op.wms.domain.BaseEquipment; /** @@ -58,4 +59,10 @@ public interface BaseEquipmentMapper { * @return 结果 */ public int deleteBaseEquipmentByEquipmentIds(Long[] equipmentIds); + @DS("master") + public String getEquipmentTypeName(BaseEquipment baseEquipment); + + //判断 + String checkEquipmentCodeUnique(BaseEquipment baseEquipment); + String checkEquipmentNameUnique(BaseEquipment baseEquipment); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/SysFactoryMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/SysFactoryMapper.java index 39f64ae5..cc2b8d96 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/SysFactoryMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/SysFactoryMapper.java @@ -58,4 +58,6 @@ public interface SysFactoryMapper { * @return 结果 */ public int deleteSysFactoryByFactoryIds(Long[] factoryIds); + + public List getWorkCenterList(SysFactory sysFactory); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseAreaService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseAreaService.java index eb2ff666..50010cac 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseAreaService.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseAreaService.java @@ -57,4 +57,8 @@ public interface IBaseAreaService { * @return 结果 */ public int deleteBaseAreaByAreaId(String areaId); + + boolean checkAreaCodeUnique(BaseArea baseArea); + + boolean checkAreaDescUnique(BaseArea baseArea); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseEquipmentService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseEquipmentService.java index dc07f16d..adfc4d4a 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseEquipmentService.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseEquipmentService.java @@ -57,4 +57,7 @@ public interface IBaseEquipmentService { * @return 结果 */ public int deleteBaseEquipmentByEquipmentId(Long equipmentId); + + boolean checkEquipmentCodeUnique(BaseEquipment baseEquipment); + boolean checkEquipmentNameUnique(BaseEquipment baseEquipment); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/ISysFactoryService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/ISysFactoryService.java index ef3c43ef..5d9f879b 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/ISysFactoryService.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/ISysFactoryService.java @@ -57,4 +57,7 @@ public interface ISysFactoryService { * @return 结果 */ public int deleteSysFactoryByFactoryId(Long factoryId); + + //好 + List getWorkCenterList(SysFactory sysFactory); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseAreaServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseAreaServiceImpl.java index 97604523..ee0e6b4c 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseAreaServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseAreaServiceImpl.java @@ -100,4 +100,37 @@ public class BaseAreaServiceImpl implements IBaseAreaService { public int deleteBaseAreaByAreaId(String areaId) { return baseAreaMapper.deleteBaseAreaByAreaId(areaId); } + + /** + * 判断库区信息 + * + * @return 结果 + */ + @Override + @DS("#header.poolName") + public boolean checkAreaCodeUnique(BaseArea baseArea){ + String area = baseAreaMapper.checkAreaCodeUnique(baseArea); + if(area == null){ + return false; + }else{ + return true; + } + } + + /** + * 判断库区信息 + * + * @return 结果 + */ + @Override + @DS("#header.poolName") + public boolean checkAreaDescUnique(BaseArea baseArea){ + String desc = baseAreaMapper.checkAreaDescUnique(baseArea); + if(desc== null){ + return false; + }else{ + return true; + } + } + } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseEquipmentServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseEquipmentServiceImpl.java index 2a9f4bc5..4926df22 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseEquipmentServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseEquipmentServiceImpl.java @@ -4,6 +4,7 @@ import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; import com.op.common.core.utils.DateUtils; +import com.op.wms.domain.BaseArea; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.op.wms.mapper.BaseEquipmentMapper; @@ -55,6 +56,8 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService { @DS("#header.poolName") public int insertBaseEquipment(BaseEquipment baseEquipment) { baseEquipment.setCreateTime(DateUtils.getNowDate()); + String equipmentTypeName = baseEquipmentMapper.getEquipmentTypeName(baseEquipment); + baseEquipment.setEquipmentTypeName(equipmentTypeName); return baseEquipmentMapper.insertBaseEquipment(baseEquipment); } @@ -68,6 +71,8 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService { @DS("#header.poolName") public int updateBaseEquipment(BaseEquipment baseEquipment) { baseEquipment.setUpdateTime(DateUtils.getNowDate()); + String equipmentTypeName = baseEquipmentMapper.getEquipmentTypeName(baseEquipment); + baseEquipment.setEquipmentTypeName(equipmentTypeName); return baseEquipmentMapper.updateBaseEquipment(baseEquipment); } @@ -94,4 +99,36 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService { public int deleteBaseEquipmentByEquipmentId(Long equipmentId) { return baseEquipmentMapper.deleteBaseEquipmentByEquipmentId(equipmentId); } + + /** + * 判断设备信息 + * + * @return 结果 + */ + @Override + @DS("#header.poolName") + public boolean checkEquipmentCodeUnique(BaseEquipment baseEquipment){ + String equipment = baseEquipmentMapper.checkEquipmentCodeUnique(baseEquipment); + if(equipment == null){ + return false; + }else{ + return true; + } + } + + /** + * 判断设备信息 + * + * @return 结果 + */ + @Override + @DS("#header.poolName") + public boolean checkEquipmentNameUnique(BaseEquipment baseEquipment){ + String equipment = baseEquipmentMapper.checkEquipmentNameUnique(baseEquipment); + if(equipment == null){ + return false; + }else{ + return true; + } + } } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/SysFactoryServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/SysFactoryServiceImpl.java index 38177af3..2d30269c 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/SysFactoryServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/SysFactoryServiceImpl.java @@ -97,4 +97,17 @@ public class SysFactoryServiceImpl implements ISysFactoryService { public int deleteSysFactoryByFactoryId(Long factoryId) { return sysFactoryMapper.deleteSysFactoryByFactoryId(factoryId); } + + /** + * 查询工厂模型列表 + * + * @param sysFactory 工厂模型 + * @return 工厂模型 + */ + @Override + @DS("#header.poolName") + public List getWorkCenterList(SysFactory sysFactory) { + return sysFactoryMapper.getWorkCenterList(sysFactory); + } + } diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/BaseAreaMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/BaseAreaMapper.xml index 6009dd7c..2c2034c7 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/BaseAreaMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/BaseAreaMapper.xml @@ -1,9 +1,9 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -44,11 +44,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - + insert into base_area - + area_code, area_desc, region_code, @@ -112,9 +112,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" active_flag, remark, factory_code, - + - + #{areaCode}, #{areaDesc}, #{regionCode}, @@ -145,7 +145,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{activeFlag}, #{remark}, #{factoryCode}, - + @@ -190,15 +190,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from base_area where area_id in + delete from base_area where area_id in #{areaId} - + + + + + + \ No newline at end of file diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml index 8f1fcca7..926d1274 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml @@ -39,12 +39,12 @@ + select dict_label + from sys_dict_data + where dict_value = #{equipmentTypeCode} + + + + + + \ No newline at end of file diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/SysFactoryMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/SysFactoryMapper.xml index e168a235..ebeb957e 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/SysFactoryMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/SysFactoryMapper.xml @@ -112,4 +112,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{factoryId} + + + \ No newline at end of file