diff --git a/op-modules/op-technology/src/main/java/com/op/technology/domain/BomComponent.java b/op-modules/op-technology/src/main/java/com/op/technology/domain/BomComponent.java index 06de88ff..f4c1a48d 100644 --- a/op-modules/op-technology/src/main/java/com/op/technology/domain/BomComponent.java +++ b/op-modules/op-technology/src/main/java/com/op/technology/domain/BomComponent.java @@ -93,6 +93,14 @@ public class BomComponent extends BaseEntity { @Excel(name = "预留字段3") private String attr3; + //虚拟字段 + @Excel(name = "组件上层物料名称") + private String componentName; + + /** 产品描述 */ + @Excel(name = "产品描述") + private String productDescZh; + // private List children; // // public List getChildren() { @@ -140,6 +148,15 @@ public class BomComponent extends BaseEntity { public String getProductCode() { return productCode; } + + public void setProductDescZh(String productDescZh) { + this.productDescZh = productDescZh; + } + + public String getProductDescZh() { + return productDescZh; + } + public void setCumc(String cumc) { this.cumc = cumc; } @@ -151,6 +168,13 @@ public class BomComponent extends BaseEntity { this.component = component; } + public String getComponentName() { + return componentName; + } + public void setComponentName(String componentName) { + this.componentName = componentName; + } + public String getComponent() { return component; } @@ -254,7 +278,9 @@ public class BomComponent extends BaseEntity { .append("bomName", getBomName()) .append("site", getSite()) .append("productCode", getProductCode()) + .append("productDescZh", getProductDescZh()) .append("cumc", getCumc()) + .append("componentName", getComponentName()) .append("component", getComponent()) .append("bomHierarchy", getBomHierarchy()) .append("projectNo", getProjectNo()) diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseLocationController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseLocationController.java index f89ae496..adf0aa1d 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseLocationController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseLocationController.java @@ -72,7 +72,15 @@ public class BaseLocationController extends BaseController { @Log(title = "货位管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody BaseLocation baseLocation) { - return toAjax(baseLocationService.insertBaseLocation(baseLocation)); + if (baseLocationService.checkCodeUnique(baseLocation)) { + return AjaxResult.error("货位编码已存在!"); + } +// else if(baseLocationService.checkNameUnique(baseLocation)){ +// return AjaxResult.error("货位描述已存在!"); +// } + else{ + return toAjax(baseLocationService.insertBaseLocation(baseLocation)); + } } /** diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseWarehouseController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseWarehouseController.java index 306b72c0..d1fb0a58 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseWarehouseController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseWarehouseController.java @@ -72,7 +72,13 @@ public class BaseWarehouseController extends BaseController { @Log(title = "仓库管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody BaseWarehouse baseWarehouse) { - return toAjax(baseWarehouseService.insertBaseWarehouse(baseWarehouse)); + if (baseWarehouseService.checkWarehouseCodeUnique(baseWarehouse)) { + return AjaxResult.error("仓库编码已存在!"); + }else if(baseWarehouseService.checkWarehouseNameUnique(baseWarehouse)){ + return AjaxResult.error("仓库名称已存在!"); + }else{ + return toAjax(baseWarehouseService.insertBaseWarehouse(baseWarehouse)); + } } /** diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseLocationMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseLocationMapper.java index 6d47f668..f7a978f6 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseLocationMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseLocationMapper.java @@ -58,4 +58,7 @@ public interface BaseLocationMapper { * @return 结果 */ public int deleteBaseLocationByLocationIds(String[] locationIds); + + String checkCodeUnique(BaseLocation baseLocation); +// String checkNameUnique(BaseLocation baseLocation); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseWarehouseMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseWarehouseMapper.java index 58435a8a..3834bd30 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseWarehouseMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseWarehouseMapper.java @@ -2,6 +2,7 @@ package com.op.wms.mapper; import java.util.List; +import com.op.wms.domain.BaseEquipment; import com.op.wms.domain.BaseWarehouse; /** @@ -60,4 +61,7 @@ public interface BaseWarehouseMapper { public int deleteBaseWarehouseByWarehouseIds(String[] warehouseIds); //查询总数 Integer queryCount(BaseWarehouse baseWarehouse); + + String checkWarehouseCodeUnique(BaseWarehouse baseWarehouse); + String checkWarehouseNameUnique(BaseWarehouse baseWarehouse); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseLocationService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseLocationService.java index 9153409c..0ccdb992 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseLocationService.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseLocationService.java @@ -57,4 +57,7 @@ public interface IBaseLocationService { * @return 结果 */ public int deleteBaseLocationByLocationId(String locationId); + +// boolean checkNameUnique(BaseLocation baseLocation); + boolean checkCodeUnique(BaseLocation baseLocation); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseWarehouseService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseWarehouseService.java index a2213d10..09236e03 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseWarehouseService.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseWarehouseService.java @@ -57,4 +57,7 @@ public interface IBaseWarehouseService { * @return 结果 */ public int deleteBaseWarehouseByWarehouseId(String warehouseId); + + boolean checkWarehouseCodeUnique(BaseWarehouse baseWarehouse); + boolean checkWarehouseNameUnique(BaseWarehouse baseWarehouse); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseLocationServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseLocationServiceImpl.java index 467c6812..77ec2add 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseLocationServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseLocationServiceImpl.java @@ -5,6 +5,7 @@ import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; import com.op.common.core.utils.DateUtils; import com.op.common.security.utils.SecurityUtils; +import com.op.wms.domain.BaseProduct; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.op.wms.mapper.BaseLocationMapper; @@ -97,4 +98,36 @@ public class BaseLocationServiceImpl implements IBaseLocationService { public int deleteBaseLocationByLocationId(String locationId) { return baseLocationMapper.deleteBaseLocationByLocationId(locationId); } + + /** + * 判断货位信息 + * + * @return 结果 + */ + @Override + @DS("#header.poolName") + public boolean checkCodeUnique(BaseLocation baseLocation) { + String code = baseLocationMapper.checkCodeUnique(baseLocation); + if(code == null){ + return false; + }else{ + return true; + } + } + + /** + * 判断货位信息 + * + * @return 结果 + */ +// @Override +// @DS("#header.poolName") +// public boolean checkNameUnique(BaseLocation baseLocation) { +// String name = baseLocationMapper.checkNameUnique(baseLocation); +// if(name == null){ +// return false; +// }else{ +// return true; +// } +// } } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseWarehouseServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseWarehouseServiceImpl.java index f6523075..e7a0d3fc 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseWarehouseServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseWarehouseServiceImpl.java @@ -5,6 +5,7 @@ import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; import com.op.common.core.utils.DateUtils; import com.op.common.security.utils.SecurityUtils; +import com.op.wms.domain.BaseEquipment; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.op.wms.mapper.BaseWarehouseMapper; @@ -100,4 +101,36 @@ public class BaseWarehouseServiceImpl implements IBaseWarehouseService { public int deleteBaseWarehouseByWarehouseId(String warehouseId) { return baseWarehouseMapper.deleteBaseWarehouseByWarehouseId(warehouseId); } + + /** + * 判断仓库信息 + * + * @return 结果 + */ + @Override + @DS("#header.poolName") + public boolean checkWarehouseCodeUnique(BaseWarehouse baseWarehouse) { + String code = baseWarehouseMapper.checkWarehouseCodeUnique(baseWarehouse); + if(code == null){ + return false; + }else{ + return true; + } + } + + /** + * 判断仓库信息 + * + * @return 结果 + */ + @Override + @DS("#header.poolName") + public boolean checkWarehouseNameUnique(BaseWarehouse baseWarehouse) { + String name = baseWarehouseMapper.checkWarehouseNameUnique(baseWarehouse); + if(name == null){ + return false; + }else{ + return true; + } + } } 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 6e30fdc7..16258e37 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 @@ -183,9 +183,9 @@ \ No newline at end of file diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/BaseLocationMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/BaseLocationMapper.xml index 61ebae81..60389f18 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/BaseLocationMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/BaseLocationMapper.xml @@ -67,7 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + select location_code + from base_location + where location_code = #{locationCode} + + \ No newline at end of file diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/BaseWarehouseMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/BaseWarehouseMapper.xml index e9f13085..4fe2589b 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/BaseWarehouseMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/BaseWarehouseMapper.xml @@ -33,8 +33,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + \ No newline at end of file