update 添加hwmom-api、hwmom-api-mes模块

master
yinq 1 month ago
parent cf72dc0611
commit 9d4d8c4533

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-api</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hwmom-api-mes</artifactId>
<description>
hwmom-api-mes MES接口模块
</description>
<dependencies>
<!-- RuoYi Common Core-->
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-core</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-excel</artifactId>
</dependency>
</dependencies>
</project>

@ -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 truefalse
*/
Boolean remoteInsertBaseMaterialInfo(List<BaseMaterialInfoBo> bos);
}

@ -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;//映射字段
}

@ -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;
}

@ -13,6 +13,7 @@
<module>ruoyi-api-system</module>
<module>ruoyi-api-resource</module>
<module>ruoyi-api-workflow</module>
<module>hwmom-api-mes</module>
</modules>
<artifactId>ruoyi-api</artifactId>

@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-modules</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hwmom-api</artifactId>
<description>
hwmom-api系统模块
</description>
<dependencies>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-nacos</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-sentinel</artifactId>
</dependency>
<!-- RuoYi Common Log -->
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-log</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-dict</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-doc</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-web</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-mybatis</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-dubbo</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-seata</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-idempotent</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-tenant</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-security</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-translation</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-sensitive</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-encrypt</artifactId>
</dependency>
<!-- RuoYi Api System -->
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-api-system</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-api-resource</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.mysql</groupId>-->
<!-- <artifactId>mysql-connector-j</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>hwmom-api-mes</artifactId>
<version>2.2.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

@ -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启动成功 ლ(´ڡ`ლ)゙ ");
}
}

@ -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);
}
}

@ -0,0 +1,14 @@
package org.dromara.api.service;
/**
* Service
*
* @author Yinq
* @date 2025-01-02
*/
public interface IBaseMaterialInfoApiService {
String insertApi(String requestBody);
}

@ -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<BaseMaterialInfoBo> list = new ArrayList<>();
Boolean aBoolean = remoteMaterialInfoService.remoteInsertBaseMaterialInfo(list);
return null;
}
}

@ -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

@ -0,0 +1,8 @@
Spring Boot Version: ${spring-boot.version}
Spring Application Name: ${spring.application.name}
__ _
/ /_ _ ______ ___ ____ ____ ___ ____ _____ (_)
/ __ \ | /| / / __ `__ \/ __ \/ __ `__ \______/ __ `/ __ \/ /
/ / / / |/ |/ / / / / / / /_/ / / / / / /_____/ /_/ / /_/ / /
/_/ /_/|__/|__/_/ /_/ /_/\____/_/ /_/ /_/ \__,_/ .___/_/
/_/

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<!-- 日志存放路径 -->
<property name="log.path" value="logs/${project.artifactId}" />
<!-- 日志输出格式 -->
<property name="console.log.pattern"
value="%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}%n) - %msg%n"/>
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${console.log.pattern}</pattern>
<charset>utf-8</charset>
</encoder>
</appender>
<include resource="logback-common.xml" />
<include resource="logback-logstash.xml" />
<!-- 开启 skywalking 日志收集 -->
<include resource="logback-skylog.xml" />
<!--系统操作日志-->
<root level="info">
<appender-ref ref="console" />
</root>
</configuration>

@ -0,0 +1,3 @@
java包使用 `.` 分割 resource 目录使用 `/` 分割
<br>
此文件目的 防止文件夹粘连找不到 `xml` 文件

@ -116,6 +116,13 @@
<artifactId>mssql-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>hwmom-api-mes</artifactId>
<version>2.2.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

@ -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 truefalse
*/
@Override
public Boolean remoteInsertBaseMaterialInfo(List<BaseMaterialInfoBo> bos) {
List<BaseMaterialInfo> 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);
}
}

@ -1,10 +1,7 @@
Spring Boot Version: ${spring-boot.version}
Spring Application Name: ${spring.application.name}
_ _
(_) | |
_ __ _ _ ___ _ _ _ ______ ___ _ _ ___ | |_ ___ _ __ ___
| '__|| | | | / _ \ | | | || ||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \
| | | |_| || (_) || |_| || | \__ \| |_| |\__ \| |_ | __/| | | | | |
|_| \__,_| \___/ \__, ||_| |___/ \__, ||___/ \__| \___||_| |_| |_|
__/ | __/ |
|___/ |___/
__
/ /_ _ ______ ___ ____ ____ ___ ____ ___ ___ _____
/ __ \ | /| / / __ `__ \/ __ \/ __ `__ \______/ __ `__ \/ _ \/ ___/
/ / / / |/ |/ / / / / / / /_/ / / / / / /_____/ / / / / / __(__ )
/_/ /_/|__/|__/_/ /_/ /_/\____/_/ /_/ /_/ /_/ /_/ /_/\___/____/

@ -16,6 +16,7 @@
<module>ruoyi-workflow</module>
<module>hwmom-mes</module>
<module>hwmom-wms</module>
<module>hwmom-api</module>
</modules>
<artifactId>ruoyi-modules</artifactId>

Loading…
Cancel
Save