diff --git a/ruoyi-api/hwmom-api-mes/pom.xml b/ruoyi-api/hwmom-api-mes/pom.xml new file mode 100644 index 00000000..723cccf8 --- /dev/null +++ b/ruoyi-api/hwmom-api-mes/pom.xml @@ -0,0 +1,33 @@ + + + + org.dromara + ruoyi-api + ${revision} + + 4.0.0 + + hwmom-api-mes + + + hwmom-api-mes MES接口模块 + + + + + + + org.dromara + ruoyi-common-core + + + + org.dromara + ruoyi-common-excel + + + + + diff --git a/ruoyi-api/hwmom-api-mes/src/main/java/org/dromara/mes/api/RemoteMaterialInfoService.java b/ruoyi-api/hwmom-api-mes/src/main/java/org/dromara/mes/api/RemoteMaterialInfoService.java new file mode 100644 index 00000000..fda0e6cf --- /dev/null +++ b/ruoyi-api/hwmom-api-mes/src/main/java/org/dromara/mes/api/RemoteMaterialInfoService.java @@ -0,0 +1,21 @@ +package org.dromara.mes.api; + +import org.dromara.mes.api.domain.bo.BaseMaterialInfoBo; + +import java.util.List; + +/** + * 物料接口 + * + * @author Yinq + */ +public interface RemoteMaterialInfoService { + + /** + * 批量新增物料信息接口 + * @param bos + * @return true成功,false失败 + */ + Boolean remoteInsertBaseMaterialInfo(List bos); + +} diff --git a/ruoyi-api/hwmom-api-mes/src/main/java/org/dromara/mes/api/domain/BaseMaterialInfo.java b/ruoyi-api/hwmom-api-mes/src/main/java/org/dromara/mes/api/domain/BaseMaterialInfo.java new file mode 100644 index 00000000..537fb1f9 --- /dev/null +++ b/ruoyi-api/hwmom-api-mes/src/main/java/org/dromara/mes/api/domain/BaseMaterialInfo.java @@ -0,0 +1,270 @@ +package org.dromara.mes.api.domain; + +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + +/** + * 物料信息对象 base_material_info + * + */ +@Data +public class BaseMaterialInfo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + private Long materialId; + + /** + * ERP信息 + */ + private String erpId; + + /** + * 物料编码 + */ + private String materialCode; + + /** + * 旧物料编码 + */ + private String oldMaterialCode; + + /** + * 物料名称 + */ + private String materialName; + + /** + * 物料类型ID + */ + private Long materialTypeId; + + /** + * 物料大类(1原材料 2半成品 3成品) + */ + private String materialCategories; + + /** + * 物料小类 + */ + private String materialSubclass; + + /** + * 批次标识(0否 1是) + */ + private String batchFlag; + + /** + * 小批次数量 + */ + private Long batchAmount; + + /** + * 计量单位ID + */ + private Long materialUnitId; + + /** + * 计量单位名称 + */ + private String materialUnit; + + /** + * 物料组 + */ + private String materialMatkl; + + /** + * 物料规格 + */ + private String materialSpec; + + /** + * 净重 + */ + private Long netWeight; + + /** + * 毛重 + */ + private Long grossWeight; + + /** + * 绑定标识(1是 0否) + */ + private String alwaysFlag; + + /** + * 所属工厂 + */ + private Long factoryId; + + /** + * 创建组织 + */ + private Long createOrgId; + + /** + * 使用组织 + */ + private Long useOrgId; + + /** + * 所属产线 + */ + private Long prodLineId; + + /** + * 激活标识(1是 0否) + */ + private String activeFlag; + + /** + * 删除标识(0否 1是) + */ + private String deletedFlag; + + /** + * 采购计价单位 + */ + private Long purchasePriceUnitId; + + /** + * 审核日期 + */ + private Date approveDate; + + /** + * erp最后更新日期 + */ + private Date erpModifyDate; + + /** + * 最大库存数量 + */ + private Long maxStockAmount; + + /** + * 最小库存数量 + */ + private Long minStockAmount; + + /** + * 安全库存数量 + */ + private Long safeStockAmount; + + /** + * 申请标识(1是 0否) + */ + private String applyFlag; + + /** + * 物料分类(1ERP同步 2虚拟物料 3MES物料) + */ + private String materialClassfication; + + /** + * 自动出库标识(1是 0否) + */ + private String autoOutstockFlag; + + /** + * 辅料标识(1是 0否) + */ + private String accessoriesFlag; + + /** + * 低值易耗品标识(1是 0否) + */ + private String lowValueConsumableFlag; + + /** + * 品牌 + */ + private String brand; + + /** + * 层级 + */ + private String plyrating; + + /** + * 花纹 + */ + private String pattern; + + /** + * 速度级别 + */ + private String speedLevel; + + /** + * 负荷载重 + */ + private String load; + + /** + * 轮胎标记(1全钢胎 2半钢胎 3工程胎) + */ + private String tireMarkings; + + /** + * 最小停放时间(秒) + */ + private Long minParkingTime; + + /** + * 最大停放时间(秒) + */ + private Long maxParkingTime; + + /** + * 标准重量 + */ + private Long standardWeight; + + /** + * 标准重量上限 + */ + private Long weightUpperLimit; + + /** + * 标准重量下限 + */ + private Long weightLowerLimit; + + /** + * 内胎标记(0无 1有) + */ + private String innerTubeFlag; + + /** + * 销售类型(0内销 1外销) + */ + private String saleType; + + /** + * 备注 + */ + private String remark; + + + /** + * 所属工厂名称 + */ + private String factoryName; //映射字段 + + /** + * 物料类型名称 + */ + private String matrialTypeName;//映射字段 + +} diff --git a/ruoyi-api/hwmom-api-mes/src/main/java/org/dromara/mes/api/domain/bo/BaseMaterialInfoBo.java b/ruoyi-api/hwmom-api-mes/src/main/java/org/dromara/mes/api/domain/bo/BaseMaterialInfoBo.java new file mode 100644 index 00000000..8522435c --- /dev/null +++ b/ruoyi-api/hwmom-api-mes/src/main/java/org/dromara/mes/api/domain/bo/BaseMaterialInfoBo.java @@ -0,0 +1,256 @@ +package org.dromara.mes.api.domain.bo; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 物料信息业务对象 base_material_info + * + */ +@Data +public class BaseMaterialInfoBo implements Serializable { + + /** + * 主键标识 + */ + private Long materialId; + + /** + * ERP信息 + */ + private String erpId; + + /** + * 物料编码 + */ + private String materialCode; + + /** + * 旧物料编码 + */ + private String oldMaterialCode; + + /** + * 物料名称 + */ + private String materialName; + + /** + * 物料类型ID + */ + private Long materialTypeId; + + /** + * 物料大类(1原材料 2半成品 3成品) + */ + private String materialCategories; + + /** + * 物料小类 + */ + private String materialSubclass; + + /** + * 批次标识(0否 1是) + */ + private String batchFlag; + + /** + * 小批次数量 + */ + private Long batchAmount; + + /** + * 计量单位ID + */ + private Long materialUnitId; + + /** + * 计量单位名称 + */ + private String materialUnit; + + /** + * 物料组 + */ + private String materialMatkl; + + /** + * 物料规格 + */ + private String materialSpec; + + /** + * 净重 + */ + private Long netWeight; + + /** + * 毛重 + */ + private Long grossWeight; + + /** + * 绑定标识(1是 0否) + */ + private String alwaysFlag; + + /** + * 所属工厂 + */ + private Long factoryId; + + /** + * 创建组织 + */ + private Long createOrgId; + + /** + * 使用组织 + */ + private Long useOrgId; + + /** + * 所属产线 + */ + private Long prodLineId; + + /** + * 激活标识(1是 0否) + */ + private String activeFlag; + + /** + * 删除标识(0否 1是) + */ + private String deletedFlag; + + /** + * 采购计价单位 + */ + private Long purchasePriceUnitId; + + /** + * 审核日期 + */ + private Date approveDate; + + /** + * erp最后更新日期 + */ + private Date erpModifyDate; + + /** + * 最大库存数量 + */ + private Long maxStockAmount; + + /** + * 最小库存数量 + */ + private Long minStockAmount; + + /** + * 安全库存数量 + */ + private Long safeStockAmount; + + /** + * 申请标识(1是 0否) + */ + private String applyFlag; + + /** + * 物料分类(1ERP同步 2虚拟物料 3MES物料) + */ + private String materialClassfication; + + /** + * 自动出库标识(1是 0否) + */ + private String autoOutstockFlag; + + /** + * 辅料标识(1是 0否) + */ + private String accessoriesFlag; + + /** + * 低值易耗品标识(1是 0否) + */ + private String lowValueConsumableFlag; + + /** + * 品牌 + */ + private String brand; + + /** + * 层级 + */ + private String plyrating; + + /** + * 花纹 + */ + private String pattern; + + /** + * 速度级别 + */ + private String speedLevel; + + /** + * 负荷载重 + */ + private String load; + + /** + * 轮胎标记(1全钢胎 2半钢胎 3工程胎) + */ + private String tireMarkings; + + /** + * 最小停放时间(秒) + */ + private Long minParkingTime; + + /** + * 最大停放时间(秒) + */ + private Long maxParkingTime; + + /** + * 标准重量 + */ + private Long standardWeight; + + /** + * 标准重量上限 + */ + private Long weightUpperLimit; + + /** + * 标准重量下限 + */ + private Long weightLowerLimit; + + /** + * 内胎标记(0无 1有) + */ + private String innerTubeFlag; + + /** + * 销售类型(0内销 1外销) + */ + private String saleType; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/ruoyi-api/pom.xml b/ruoyi-api/pom.xml index 8b5f0b9e..fc8dc580 100644 --- a/ruoyi-api/pom.xml +++ b/ruoyi-api/pom.xml @@ -13,6 +13,7 @@ ruoyi-api-system ruoyi-api-resource ruoyi-api-workflow + hwmom-api-mes ruoyi-api diff --git a/ruoyi-modules/hwmom-api/pom.xml b/ruoyi-modules/hwmom-api/pom.xml new file mode 100644 index 00000000..205abd76 --- /dev/null +++ b/ruoyi-modules/hwmom-api/pom.xml @@ -0,0 +1,141 @@ + + + + org.dromara + ruoyi-modules + ${revision} + + 4.0.0 + + hwmom-api + + + hwmom-api系统模块 + + + + + + org.dromara + ruoyi-common-nacos + + + + org.dromara + ruoyi-common-sentinel + + + + + org.dromara + ruoyi-common-log + + + + org.dromara + ruoyi-common-dict + + + + org.dromara + ruoyi-common-doc + + + + org.dromara + ruoyi-common-web + + + + org.dromara + ruoyi-common-mybatis + + + + org.dromara + ruoyi-common-dubbo + + + + org.dromara + ruoyi-common-seata + + + + org.dromara + ruoyi-common-idempotent + + + + org.dromara + ruoyi-common-tenant + + + + org.dromara + ruoyi-common-security + + + + org.dromara + ruoyi-common-translation + + + + org.dromara + ruoyi-common-sensitive + + + + org.dromara + ruoyi-common-encrypt + + + + + org.dromara + ruoyi-api-system + + + + org.dromara + ruoyi-api-resource + + + + + + + com.microsoft.sqlserver + mssql-jdbc + + + org.dromara + hwmom-api-mes + 2.2.2 + compile + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + repackage + + + + + + + + diff --git a/ruoyi-modules/hwmom-api/src/main/java/org/dromara/api/HwMomApiApplication.java b/ruoyi-modules/hwmom-api/src/main/java/org/dromara/api/HwMomApiApplication.java new file mode 100644 index 00000000..a79da957 --- /dev/null +++ b/ruoyi-modules/hwmom-api/src/main/java/org/dromara/api/HwMomApiApplication.java @@ -0,0 +1,22 @@ +package org.dromara.api; + +import org.apache.dubbo.config.spring.context.annotation.EnableDubbo; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup; + +/** + * 系统模块 + * + * @author ruoyi + */ +@EnableDubbo +@SpringBootApplication +public class HwMomApiApplication { + public static void main(String[] args) { + SpringApplication application = new SpringApplication(HwMomApiApplication.class); + application.setApplicationStartup(new BufferingApplicationStartup(2048)); + application.run(args); + System.out.println("(♥◠‿◠)ノ゙ HwApi启动成功 ლ(´ڡ`ლ)゙ "); + } +} diff --git a/ruoyi-modules/hwmom-api/src/main/java/org/dromara/api/controller/BaseMaterialInfoApiController.java b/ruoyi-modules/hwmom-api/src/main/java/org/dromara/api/controller/BaseMaterialInfoApiController.java new file mode 100644 index 00000000..9f03d280 --- /dev/null +++ b/ruoyi-modules/hwmom-api/src/main/java/org/dromara/api/controller/BaseMaterialInfoApiController.java @@ -0,0 +1,41 @@ +package org.dromara.api.controller; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.config.annotation.DubboReference; +import org.dromara.api.service.IBaseMaterialInfoApiService; +import org.dromara.mes.api.RemoteMaterialInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; + + +/** + * 车间信息 + * 前端访问路由地址为:/mes/baseWorkshopInfo + * + * @author Yinq + * @date 2025-01-02 + */ +@Slf4j +@RequiredArgsConstructor +@RestController +@RequestMapping("/materialInfoApi") +public class BaseMaterialInfoApiController extends BaseController { + + + + @Autowired + private final IBaseMaterialInfoApiService materialInfoApiService; + + + /** + * 测试物料信息存储接口 + */ + @PostMapping ("/test") + public String test(String requestBody) { + return materialInfoApiService.insertApi(requestBody); + } + +} diff --git a/ruoyi-modules/hwmom-api/src/main/java/org/dromara/api/service/IBaseMaterialInfoApiService.java b/ruoyi-modules/hwmom-api/src/main/java/org/dromara/api/service/IBaseMaterialInfoApiService.java new file mode 100644 index 00000000..6356824e --- /dev/null +++ b/ruoyi-modules/hwmom-api/src/main/java/org/dromara/api/service/IBaseMaterialInfoApiService.java @@ -0,0 +1,14 @@ +package org.dromara.api.service; + + +/** + * 车间信息Service接口 + * + * @author Yinq + * @date 2025-01-02 + */ +public interface IBaseMaterialInfoApiService { + + String insertApi(String requestBody); + +} diff --git a/ruoyi-modules/hwmom-api/src/main/java/org/dromara/api/service/impl/BaseMaterialInfoApiServiceImpl.java b/ruoyi-modules/hwmom-api/src/main/java/org/dromara/api/service/impl/BaseMaterialInfoApiServiceImpl.java new file mode 100644 index 00000000..17c91118 --- /dev/null +++ b/ruoyi-modules/hwmom-api/src/main/java/org/dromara/api/service/impl/BaseMaterialInfoApiServiceImpl.java @@ -0,0 +1,33 @@ +package org.dromara.api.service.impl; + +import org.apache.dubbo.config.annotation.DubboReference; +import org.dromara.api.service.IBaseMaterialInfoApiService; + +import lombok.RequiredArgsConstructor; +import org.dromara.mes.api.RemoteMaterialInfoService; +import org.dromara.mes.api.domain.bo.BaseMaterialInfoBo; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Service业务层处理 + * + * @author Yinq + * @date 2025-01-02 + */ +@RequiredArgsConstructor +@Service +public class BaseMaterialInfoApiServiceImpl implements IBaseMaterialInfoApiService { + + @DubboReference + private final RemoteMaterialInfoService remoteMaterialInfoService; + + @Override + public String insertApi(String requestBody) { + List list = new ArrayList<>(); + Boolean aBoolean = remoteMaterialInfoService.remoteInsertBaseMaterialInfo(list); + return null; + } +} diff --git a/ruoyi-modules/hwmom-api/src/main/resources/application.yml b/ruoyi-modules/hwmom-api/src/main/resources/application.yml new file mode 100644 index 00000000..95382875 --- /dev/null +++ b/ruoyi-modules/hwmom-api/src/main/resources/application.yml @@ -0,0 +1,34 @@ +# Tomcat +server: + port: 6016 + +# Spring +spring: + application: + # 应用名称 + name: hwmom-api + profiles: + # 环境配置 + active: @profiles.active@ + +--- # nacos 配置 +spring: + cloud: + nacos: + # nacos 服务地址 + server-addr: @nacos.server@ + username: @nacos.username@ + password: @nacos.password@ + discovery: + # 注册组 + group: @nacos.discovery.group@ + namespace: ${spring.profiles.active} + config: + # 配置组 + group: @nacos.config.group@ + namespace: ${spring.profiles.active} + config: + import: + - optional:nacos:application-common.yml + - optional:nacos:datasource.yml + - optional:nacos:${spring.application.name}.yml diff --git a/ruoyi-modules/hwmom-api/src/main/resources/banner.txt b/ruoyi-modules/hwmom-api/src/main/resources/banner.txt new file mode 100644 index 00000000..f13665ec --- /dev/null +++ b/ruoyi-modules/hwmom-api/src/main/resources/banner.txt @@ -0,0 +1,8 @@ +Spring Boot Version: ${spring-boot.version} +Spring Application Name: ${spring.application.name} + __ _ + / /_ _ ______ ___ ____ ____ ___ ____ _____ (_) + / __ \ | /| / / __ `__ \/ __ \/ __ `__ \______/ __ `/ __ \/ / + / / / / |/ |/ / / / / / / /_/ / / / / / /_____/ /_/ / /_/ / / +/_/ /_/|__/|__/_/ /_/ /_/\____/_/ /_/ /_/ \__,_/ .___/_/ + /_/ diff --git a/ruoyi-modules/hwmom-api/src/main/resources/logback-plus.xml b/ruoyi-modules/hwmom-api/src/main/resources/logback-plus.xml new file mode 100644 index 00000000..caaa3455 --- /dev/null +++ b/ruoyi-modules/hwmom-api/src/main/resources/logback-plus.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + ${console.log.pattern} + utf-8 + + + + + + + + + + + + + + + diff --git a/ruoyi-modules/hwmom-api/src/main/resources/mapper/package-info.md b/ruoyi-modules/hwmom-api/src/main/resources/mapper/package-info.md new file mode 100644 index 00000000..c938b1e5 --- /dev/null +++ b/ruoyi-modules/hwmom-api/src/main/resources/mapper/package-info.md @@ -0,0 +1,3 @@ +java包使用 `.` 分割 resource 目录使用 `/` 分割 +
+此文件目的 防止文件夹粘连找不到 `xml` 文件 \ No newline at end of file diff --git a/ruoyi-modules/hwmom-mes/pom.xml b/ruoyi-modules/hwmom-mes/pom.xml index 83005fce..35f2c1e3 100644 --- a/ruoyi-modules/hwmom-mes/pom.xml +++ b/ruoyi-modules/hwmom-mes/pom.xml @@ -116,6 +116,13 @@ mssql-jdbc + + org.dromara + hwmom-api-mes + 2.2.2 + compile + + diff --git a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/dubbo/RemoteMaterialInfoServiceImpl.java b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/dubbo/RemoteMaterialInfoServiceImpl.java new file mode 100644 index 00000000..14e0c9b7 --- /dev/null +++ b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/dubbo/RemoteMaterialInfoServiceImpl.java @@ -0,0 +1,48 @@ +package org.dromara.mes.dubbo; + +import lombok.RequiredArgsConstructor; +import org.apache.dubbo.config.annotation.DubboService; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.mes.api.RemoteMaterialInfoService; +import org.dromara.mes.api.domain.bo.BaseMaterialInfoBo; +import org.dromara.mes.domain.BaseMaterialInfo; +import org.dromara.mes.mapper.BaseMaterialInfoMapper; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + + +/** + * 物料接口实现类 + * + * @author Yinq + */ +@RequiredArgsConstructor +@Service +@DubboService +public class RemoteMaterialInfoServiceImpl implements RemoteMaterialInfoService { + + private final BaseMaterialInfoMapper materialInfoMapper; + + /** + * 批量新增物料信息接口 + * @param bos + * @return true成功,false失败 + */ + @Override + public Boolean remoteInsertBaseMaterialInfo(List bos) { + List list = new ArrayList<>(); + for (BaseMaterialInfoBo bo : bos) { + BaseMaterialInfo add = MapstructUtils.convert(bo, BaseMaterialInfo.class); + list.add(add); + } + if (list.size() == 0){ + return false; + } + return materialInfoMapper.insertBatch(list); + } + + + +} diff --git a/ruoyi-modules/hwmom-mes/src/main/resources/banner.txt b/ruoyi-modules/hwmom-mes/src/main/resources/banner.txt index c86da884..26a8803c 100644 --- a/ruoyi-modules/hwmom-mes/src/main/resources/banner.txt +++ b/ruoyi-modules/hwmom-mes/src/main/resources/banner.txt @@ -1,10 +1,7 @@ Spring Boot Version: ${spring-boot.version} Spring Application Name: ${spring.application.name} - _ _ - (_) | | - _ __ _ _ ___ _ _ _ ______ ___ _ _ ___ | |_ ___ _ __ ___ -| '__|| | | | / _ \ | | | || ||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \ -| | | |_| || (_) || |_| || | \__ \| |_| |\__ \| |_ | __/| | | | | | -|_| \__,_| \___/ \__, ||_| |___/ \__, ||___/ \__| \___||_| |_| |_| - __/ | __/ | - |___/ |___/ + __ + / /_ _ ______ ___ ____ ____ ___ ____ ___ ___ _____ + / __ \ | /| / / __ `__ \/ __ \/ __ `__ \______/ __ `__ \/ _ \/ ___/ + / / / / |/ |/ / / / / / / /_/ / / / / / /_____/ / / / / / __(__ ) +/_/ /_/|__/|__/_/ /_/ /_/\____/_/ /_/ /_/ /_/ /_/ /_/\___/____/ diff --git a/ruoyi-modules/pom.xml b/ruoyi-modules/pom.xml index 303665f9..314b984f 100644 --- a/ruoyi-modules/pom.xml +++ b/ruoyi-modules/pom.xml @@ -16,6 +16,7 @@ ruoyi-workflow hwmom-mes hwmom-wms + hwmom-api ruoyi-modules