TDEngine服务上传
parent
0605ded58f
commit
19400d5e2b
@ -0,0 +1,28 @@
|
||||
<?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>com.hw</groupId>
|
||||
<artifactId>hw-api</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>hw-api-tdengine</artifactId>
|
||||
|
||||
<description>
|
||||
hw-api-tdengine时序数据库模块api
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- RuoYi Common Core-->
|
||||
<dependency>
|
||||
<groupId>com.hw</groupId>
|
||||
<artifactId>hw-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -0,0 +1,66 @@
|
||||
package com.hw.tdengine.api;
|
||||
|
||||
import com.hw.common.core.constant.SecurityConstants;
|
||||
import com.hw.common.core.constant.ServiceNameConstants;
|
||||
import com.hw.common.core.domain.R;
|
||||
import com.hw.common.core.validated.tdengine.AddTdSTableColumn;
|
||||
import com.hw.common.core.validated.tdengine.InsertTdTable;
|
||||
import com.hw.tdengine.api.domain.*;
|
||||
import com.hw.tdengine.api.factory.RemoteTdEngineFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@FeignClient(contextId = "remoteTdEngineService", value = ServiceNameConstants.TDENGINE_SERVICE, fallbackFactory = RemoteTdEngineFallbackFactory.class)
|
||||
public interface RemoteTdEngineService {
|
||||
|
||||
@PostMapping("/tdengine/createDatabase")
|
||||
R<?> createDataBase(@RequestBody String databaseName, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
@PostMapping("/tdengine/createSuperTable")
|
||||
R<?> createSuperTable(@Validated @RequestBody TdSuperTableVo tdSuperTableVo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
@PostMapping("/tdengine/createTable")
|
||||
R<?> createTable(@Validated @RequestBody TdTableVo tdTableVo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
@PostMapping("/tdengine/addSuperTableColumn")
|
||||
R<?> addSuperTableColumn(@Validated(AddTdSTableColumn.class) @RequestBody TdSuperTableVo tdSuperTableVo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
@PostMapping("/tdengine/modifySuperTableColumn")
|
||||
R<?> modifySuperTableColumn(@Validated(AddTdSTableColumn.class) @RequestBody TdSuperTableVo tdSuperTableVo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
@PostMapping("/tdengine/dropSuperTableColumn")
|
||||
R<?> dropColumnForSuperTable(@Validated(AddTdSTableColumn.class) @RequestBody TdSuperTableVo tdSuperTableVo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
@PostMapping("/tdengine/alterTableTag")
|
||||
public R<?> alterTableTag(@Validated @RequestBody AlterTagVo alterTagVo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
@PostMapping("/tdengine/insertTable")
|
||||
R<?> insertTable(@Validated(InsertTdTable.class) @RequestBody TdTableVo tdTableVo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
@PostMapping("/tdengine/getLatestData")
|
||||
R<?> getLatestData(@Validated @RequestBody TdSelectDto tdSelectDto, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
@PostMapping("/tdengine/getLatestDataByTags")
|
||||
R<List<Map<String, Object>>> getLatestDataByTags(@Validated @RequestBody TdSuperTableSelectVo tdSuperTableSelectVo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
@PostMapping("/tdengine/getHistoryData")
|
||||
R<TdReturnDataVo> getHistoryData(@Validated @RequestBody TdHistorySelectDto tdHistorySelectDto, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
@PostMapping("/tdengine/getCountOfHistoryData")
|
||||
R<?> getCountOfHistoryData(@Validated @RequestBody TdHistorySelectDto tdHistorySelectDto, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
@PostMapping("/tdengine/getOnlineDevicesGroupByDay")
|
||||
R<?> getOnlineDevicesGroupByDay(@Validated @RequestBody DeviceStatus queryDeviceStatus, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
@PostMapping("/tdengine/getLastOnlineDevices")
|
||||
R<?> getLastOnlineDevices(@Validated @RequestBody DeviceStatus queryDeviceStatus, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
@PostMapping("/tdengine/getDeviceStatusList")
|
||||
R<List<Map<String, Object>>> getDeviceStatusList(@Validated @RequestBody DeviceStatus queryDeviceStatus, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.hw.tdengine.api.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @Description: 更新子表tag实体类
|
||||
* @ClassName: AlterTagVo
|
||||
* @Author : xins
|
||||
* @Date :2023-08-30 10:56
|
||||
* @Version :1.0
|
||||
*/
|
||||
@Data
|
||||
public class AlterTagVo {
|
||||
|
||||
//数据库名称
|
||||
@NotBlank(message="databaseName cannot be empty")
|
||||
private String databaseName;
|
||||
|
||||
//子表名称
|
||||
@NotBlank(message="tableName cannot be empty")
|
||||
private String tableName;
|
||||
|
||||
@NotBlank(message="tagName cannot be empty")
|
||||
private String tagName;
|
||||
|
||||
@NotNull(message="tagValue cannot be empty")
|
||||
private Object tagValue;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.hw.tdengine.api.domain;
|
||||
|
||||
import com.hw.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 设备状态对象
|
||||
* @ClassName: DeviceStatus
|
||||
* @Author : xins
|
||||
* @Date :2023-09-05 11:35
|
||||
* @Version :1.0
|
||||
*/
|
||||
public class DeviceStatus extends BaseEntity {
|
||||
|
||||
private Long ts;
|
||||
|
||||
private Long deviceId;
|
||||
|
||||
private String deviceCode;
|
||||
|
||||
private Integer deviceType;
|
||||
|
||||
private Integer onlineStatus;
|
||||
|
||||
private Long sceneId;
|
||||
|
||||
private Long startTime;
|
||||
private Long endTime;
|
||||
|
||||
private List<TdField> schemaFields;
|
||||
|
||||
public Long getTs() {
|
||||
return ts;
|
||||
}
|
||||
|
||||
public void setTs(Long ts) {
|
||||
this.ts = ts;
|
||||
}
|
||||
|
||||
public Long getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(Long deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getDeviceCode() {
|
||||
return deviceCode;
|
||||
}
|
||||
|
||||
public void setDeviceCode(String deviceCode) {
|
||||
this.deviceCode = deviceCode;
|
||||
}
|
||||
|
||||
public Integer getDeviceType() {
|
||||
return deviceType;
|
||||
}
|
||||
|
||||
public void setDeviceType(Integer deviceType) {
|
||||
this.deviceType = deviceType;
|
||||
}
|
||||
|
||||
public Integer getOnlineStatus() {
|
||||
return onlineStatus;
|
||||
}
|
||||
|
||||
public void setOnlineStatus(Integer onlineStatus) {
|
||||
this.onlineStatus = onlineStatus;
|
||||
}
|
||||
|
||||
public Long getSceneId() {
|
||||
return sceneId;
|
||||
}
|
||||
|
||||
public void setSceneId(Long sceneId) {
|
||||
this.sceneId = sceneId;
|
||||
}
|
||||
|
||||
public Long getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(Long startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public Long getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(Long endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public List<TdField> getSchemaFields() {
|
||||
return schemaFields;
|
||||
}
|
||||
|
||||
public void setSchemaFields(List<TdField> schemaFields) {
|
||||
this.schemaFields = schemaFields;
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.hw.tdengine.api.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class TdReturnDataVo {
|
||||
|
||||
public int count;
|
||||
public List<Map<String, Object>> dataList;
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.hw.tdengine.api.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: TDengine查询数据入参数据传输对象
|
||||
* @ClassName: TdSelectDto
|
||||
* @Author : xins
|
||||
* @Date :2023-08-29 10:39
|
||||
* @Version :1.0
|
||||
*/
|
||||
@Data
|
||||
public class TdSelectDto {
|
||||
|
||||
//数据库名称
|
||||
@NotBlank(message="databaseName cannot be empty")
|
||||
private String databaseName;
|
||||
|
||||
//子表名称
|
||||
@NotBlank(message="tableName cannot be empty")
|
||||
private String tableName;
|
||||
|
||||
//超级表名称
|
||||
private String superTableName;
|
||||
|
||||
//tags名称
|
||||
private String tagsName;
|
||||
|
||||
private List<TdField> schemaFieldValues;
|
||||
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
package com.hw.tdengine.api.factory;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.hw.common.core.domain.R;
|
||||
import com.hw.tdengine.api.RemoteTdEngineService;
|
||||
import com.hw.tdengine.api.domain.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: TDengine服务降级处理
|
||||
* @ClassName: RemoteTdEngineFallbackFactory
|
||||
* @Author : xins
|
||||
* @Date :2023-09-01 14:14
|
||||
* @Version :1.0
|
||||
*/
|
||||
@Component
|
||||
public class RemoteTdEngineFallbackFactory implements FallbackFactory<RemoteTdEngineService> {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(RemoteTdEngineFallbackFactory.class);
|
||||
|
||||
@Override
|
||||
public RemoteTdEngineService create(Throwable throwable) {
|
||||
return new RemoteTdEngineService() {
|
||||
@Override
|
||||
public R<?> createDataBase(String databaseName, String source) {
|
||||
return R.fail("创建数据库失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> createSuperTable(TdSuperTableVo tdSuperTableVo, String source) {
|
||||
return R.fail("创建超级表失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> createTable(TdTableVo tdTableVo, String source) {
|
||||
return R.fail("创建子表失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> addSuperTableColumn(TdSuperTableVo tdSuperTableVo, String source) {
|
||||
return R.fail("添加超级表Column失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> modifySuperTableColumn(TdSuperTableVo tdSuperTableVo, String source) {
|
||||
return R.fail("修改超级表Column失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> dropColumnForSuperTable(TdSuperTableVo tdSuperTableVo, String source) {
|
||||
return R.fail("删除超级表Column失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> alterTableTag(AlterTagVo alterTagVo, String source) {
|
||||
return R.fail("修改子表tag值失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> insertTable(TdTableVo tdTableVo, String source) {
|
||||
return R.fail("插入数据失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> getLatestData(TdSelectDto tdSelectDto, String source) {
|
||||
return R.fail("获取子表最新数据失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<List<Map<String, Object>>> getLatestDataByTags(TdSuperTableSelectVo tdSuperTableSelectVo, String source) {
|
||||
return R.fail("根据tags获取超级表最新数据失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<TdReturnDataVo> getHistoryData(TdHistorySelectDto tdHistorySelectDto, String source) {
|
||||
return R.fail("获取历史数据失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> getCountOfHistoryData(TdHistorySelectDto tdHistorySelectDto, String source) {
|
||||
return R.fail("获取历史数据数量失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> getOnlineDevicesGroupByDay(DeviceStatus queryDeviceStatus, String source) {
|
||||
return R.fail("获取设备状态失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> getLastOnlineDevices(DeviceStatus queryDeviceStatus, String source) {
|
||||
return R.fail("获取最近设备状态失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<List<Map<String, Object>>> getDeviceStatusList(DeviceStatus queryDeviceStatus, String source) {
|
||||
return R.fail("获取设备状态信息失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
com.hw.tdengine.api.factory.RemoteTdEngineFallbackFactory
|
@ -0,0 +1,4 @@
|
||||
package com.hw.common.core.validated.tdengine;
|
||||
|
||||
public interface AddTdSTableColumn {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.hw.common.core.validated.tdengine;
|
||||
|
||||
public interface InsertTdTable {
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
call mvn install:install-file -Dfile=D:\IdeaProjects\HwMes\hw-modules\hw-jindie\k3cloud-webapi-sdk8.0.6.jar -DgroupId=com.kingdee.bos -DartifactId=k3cloud-webapi-sdk -Dversion=8.0.6 -Dpackaging=jar
|
||||
@pause
|
Binary file not shown.
@ -0,0 +1,115 @@
|
||||
<?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>com.hw</groupId>
|
||||
<artifactId>hw-modules</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>hw-modules-jindie</artifactId>
|
||||
|
||||
<description>
|
||||
hw-modules-jindie金蝶ERP对接模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.hw</groupId>
|
||||
<artifactId>hw-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.hw</groupId>
|
||||
<artifactId>hw-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.hw</groupId>
|
||||
<artifactId>hw-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.hw</groupId>
|
||||
<artifactId>hw-common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.kingdee.bos</groupId>
|
||||
<artifactId>k3cloud-webapi-sdk</artifactId>
|
||||
<version>8.0.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -0,0 +1,19 @@
|
||||
package com.hw;
|
||||
|
||||
// Press Shift twice to open the Search Everywhere dialog and type `show whitespaces`,
|
||||
// then press Enter. You can now see whitespace characters in your code.
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
// Press Alt+Enter with your caret at the highlighted text to see how
|
||||
// IntelliJ IDEA suggests fixing it.
|
||||
System.out.printf("Hello and welcome!");
|
||||
|
||||
// Press Shift+F10 or click the green arrow button in the gutter to run the code.
|
||||
for (int i = 1; i <= 5; i++) {
|
||||
|
||||
// Press Shift+F9 to start debugging your code. We have set one breakpoint
|
||||
// for you, but you can always add more by pressing Ctrl+F8.
|
||||
System.out.println("i = " + i);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.hw.jindie;
|
||||
|
||||
import com.hw.common.security.annotation.EnableCustomConfig;
|
||||
import com.hw.common.security.annotation.EnableRyFeignClients;
|
||||
import com.hw.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 系统模块
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication
|
||||
public class HwJindieApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
SpringApplication.run(HwJindieApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 金蝶ERP对接模块启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
" .-------. ____ __ \n" +
|
||||
" | _ _ \\ \\ \\ / / \n" +
|
||||
" | ( ' ) | \\ _. / ' \n" +
|
||||
" |(_ o _) / _( )_ .' \n" +
|
||||
" | (_,_).' __ ___(_ o _)' \n" +
|
||||
" | |\\ \\ | || |(_,_)' \n" +
|
||||
" | | \\ `' /| `-' / \n" +
|
||||
" | | \\ / \\ / \n" +
|
||||
" ''-' `'-' `-..-' ");
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.hw.jindie.common;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
public class SeqHelper {
|
||||
static long seq = 0L;
|
||||
static int mod = 10000;
|
||||
|
||||
public SeqHelper() {
|
||||
}
|
||||
|
||||
public static long genSeq() {
|
||||
return ++seq;
|
||||
}
|
||||
|
||||
public static String genNumber(String pre) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMHHmmss");
|
||||
String id = sdf.format(new Date());
|
||||
return pre == null ? id + (genSeq() + (long)mod) : pre + id + (genSeq() + (long)mod);
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.hw.jindie.test;
|
||||
|
||||
public class BdCustomer {
|
||||
long CustID;
|
||||
String FNumber;
|
||||
String FName;
|
||||
Long msterID;
|
||||
|
||||
public long getCustID() {
|
||||
return CustID;
|
||||
}
|
||||
|
||||
public void setCustID(long custID) {
|
||||
CustID = custID;
|
||||
}
|
||||
|
||||
public String getFNumber() {
|
||||
return FNumber;
|
||||
}
|
||||
|
||||
public void setFNumber(String FNumber) {
|
||||
this.FNumber = FNumber;
|
||||
}
|
||||
|
||||
public String getFName() {
|
||||
return FName;
|
||||
}
|
||||
|
||||
public void setFName(String FName) {
|
||||
this.FName = FName;
|
||||
}
|
||||
|
||||
public String getFShortName() {
|
||||
return FShortName;
|
||||
}
|
||||
|
||||
public void setFShortName(String FShortName) {
|
||||
this.FShortName = FShortName;
|
||||
}
|
||||
|
||||
String FShortName;
|
||||
|
||||
public Long getMsterID() {
|
||||
return msterID;
|
||||
}
|
||||
|
||||
public void setMsterID(Long msterID) {
|
||||
this.msterID = msterID;
|
||||
}
|
||||
}
|
@ -0,0 +1,237 @@
|
||||
package com.hw.jindie.test;
|
||||
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.kingdee.bos.webapi.entity.*;
|
||||
import com.kingdee.bos.webapi.sdk.K3CloudApi;
|
||||
import com.google.gson.Gson;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.Test;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import com.hw.jindie.common.SeqHelper;
|
||||
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class BdCustomerTest {
|
||||
static String FNumber = SeqHelper.genNumber("BC");
|
||||
static String FNumber2 = SeqHelper.genNumber("BC");
|
||||
static String FName = "aukh_" + UUID.randomUUID().toString();
|
||||
static String FShortName = "aukh_" + UUID.randomUUID().toString();
|
||||
static K3CloudApi api = new K3CloudApi();
|
||||
|
||||
|
||||
/* 本接口用于实现客户 (BD_Customer) 的保存功能 */
|
||||
@Test
|
||||
public void atestSaveCustomer() throws Exception {
|
||||
String para = "{\"FName\": "+"\""+FName+"\""+",\"FNumber\": "+"\""+FNumber+"\""+",\"FCreateOrgId\": {\"FNumber\": \"100\"},\"FUseOrgId\": {\"FNumber\": \"100\"},\"FCOUNTRY\": { \"FNumber\": \"China\"},\"FINVOICETITLE\": \"zzl\",\"FCustTypeId\": { \"FNumber\": \"KHLB001_SYS\"},\"FTRADINGCURRID\": { \"FNumber\": \"PRE001\"},\"FInvoiceType\": \"1\",\"FTaxType\": { \"FNumber\": \"SFL02_SYS\"},\"FPriority\": 1,\"FTaxRate\": { \"FNumber\": \"SL02_SYS\"},\"FISCREDITCHECK\": true,\"FIsTrade\": true }";
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map = new Gson().fromJson(para, map.getClass());
|
||||
SaveResult sRet = api.save("BD_Customer", new SaveParam<Map>(map));
|
||||
Gson gson = new Gson();
|
||||
if (sRet.isSuccessfully()) {
|
||||
System.out.printf("客户保存接口: %s%n", gson.toJson(sRet.getResult()));
|
||||
} else {
|
||||
fail("客户保存接口: " + gson.toJson(sRet.getResult()));
|
||||
}
|
||||
}
|
||||
|
||||
/* 本接口用于实现客户 (BD_Customer) 的保存功能 */
|
||||
@Test
|
||||
public void btestSaveCustomer2() throws Exception {
|
||||
String para2 = "{\"FName\": \"zzl\",\"FNumber\": "+"\""+FNumber2+"\""+",\"FCreateOrgId\": {\"FNumber\": \"100\"},\"FUseOrgId\": {\"FNumber\": \"100\"},\"FCOUNTRY\": { \"FNumber\": \"China\"},\"FINVOICETITLE\": \"zzl\",\"FCustTypeId\": { \"FNumber\": \"KHLB001_SYS\"},\"FTRADINGCURRID\": { \"FNumber\": \"PRE001\"},\"FInvoiceType\": \"1\",\"FTaxType\": { \"FNumber\": \"SFL02_SYS\"},\"FPriority\": 1,\"FTaxRate\": { \"FNumber\": \"SL02_SYS\"},\"FISCREDITCHECK\": true,\"FIsTrade\": true }";
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map = new Gson().fromJson(para2, map.getClass());
|
||||
SaveResult sRet = api.save("BD_Customer", new SaveParam<Map>(map),InvokeMode.Syn);
|
||||
Gson gson = new Gson();
|
||||
if (sRet.isSuccessfully()) {
|
||||
System.out.printf("客户保存接口: %s%n", gson.toJson(sRet.getResult()));
|
||||
} else {
|
||||
fail("客户保存接口: " + gson.toJson(sRet.getResult()));
|
||||
}
|
||||
}
|
||||
|
||||
/*本接口用于实现客户 (BD_Customer) 的提交功能*/
|
||||
@Test
|
||||
public void ctestSubmitCustomer() throws Exception {
|
||||
OperateParam para = new OperateParam();
|
||||
List<String> Numbers = Arrays.asList(FNumber);;
|
||||
para.setNumbers(Numbers);
|
||||
OperatorResult result = api.submit("BD_Customer", para);
|
||||
Gson gson = new Gson();
|
||||
if (result.getResult().getResponseStatus().isIsSuccess()) {
|
||||
System.out.printf("客户提交接口: %s%n", gson.toJson(result.getResult()));
|
||||
} else {
|
||||
fail("客户提交接口:" + gson.toJson(result.getResult()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*本接口用于实现客户 (BD_Customer) 的审核功能*/
|
||||
@Test
|
||||
public void dtestauditCustomer() throws Exception {
|
||||
OperateParam para = new OperateParam();
|
||||
List<String> Numbers = Arrays.asList(FNumber);;
|
||||
para.setNumbers(Numbers);
|
||||
OperatorResult result = api.audit("BD_Customer", para );
|
||||
Gson gson = new Gson();
|
||||
if (result.getResult().getResponseStatus().isIsSuccess()) {
|
||||
System.out.printf("客户审核接口: %s%n", gson.toJson(result.getResult()));
|
||||
} else {
|
||||
fail("客户审核接口: " + gson.toJson(result.getResult().getResponseStatus()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*本接口用于实现客户 (BD_Customer) 的反审核功能*/
|
||||
@Test
|
||||
public void etestunauditCustomer() throws Exception {
|
||||
OperateParam para = new OperateParam();
|
||||
List<String> Numbers = Arrays.asList(FNumber);
|
||||
para.setNumbers(Numbers);
|
||||
OperatorResult result = api.unAudit("BD_Customer", para);
|
||||
Gson gson = new Gson();
|
||||
if (result.getResult().getResponseStatus().isIsSuccess()) {
|
||||
|
||||
System.out.printf("客户反审核接口: %s%n", gson.toJson(result.getResult()));
|
||||
} else {
|
||||
fail("客户反审核接口: " + gson.toJson(result.getResult().getResponseStatus()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*本接口用于实现客户 (BD_Customer) 的禁用功能*/
|
||||
@Test
|
||||
public void ftestForbidCustomer() throws Exception {
|
||||
JsonObject jsonData = new JsonObject();
|
||||
jsonData.addProperty("Numbers", FNumber);
|
||||
String result = api.excuteOperation("BD_Customer","Forbid", jsonData.toString());
|
||||
Gson gson = new Gson();
|
||||
RepoRet repoRet = gson.fromJson(result, RepoRet.class);
|
||||
if (repoRet.getResult().getResponseStatus().isIsSuccess()) {
|
||||
|
||||
System.out.printf("客户禁用接口: %s%n", gson.toJson(repoRet.getResult()));
|
||||
} else {
|
||||
fail("客户禁用接口: " + gson.toJson(repoRet.getResult().getResponseStatus()));
|
||||
}
|
||||
}
|
||||
|
||||
/*本接口用于实现客户 (BD_Customer) 的反禁用功能*/
|
||||
@Test
|
||||
public void gtestenableCustomer() throws Exception {
|
||||
JsonObject jsonData = new JsonObject();
|
||||
jsonData.addProperty("Numbers", FNumber);
|
||||
String result = api.excuteOperation("BD_Customer","enable", jsonData.toString());
|
||||
Gson gson = new Gson();
|
||||
RepoRet repoRet = gson.fromJson(result, RepoRet.class);
|
||||
if (repoRet.getResult().getResponseStatus().isIsSuccess()) {
|
||||
|
||||
System.out.printf("客户反禁用接口: %s%n", gson.toJson(repoRet.getResult()));
|
||||
} else {
|
||||
fail("客户反禁用接口: %s%n "+ gson.toJson(repoRet.getResult().getResponseStatus()));
|
||||
}
|
||||
}
|
||||
|
||||
/*本接口用于实现客户 (BD_Customer) 的查看功能*/
|
||||
@Test
|
||||
public void htestviewCustomer() throws Exception {
|
||||
OperateParam para = new OperateParam();
|
||||
para.setNumber(FNumber);
|
||||
OperatorResult result = api.view("BD_Customer", para);
|
||||
Gson gson = new Gson();
|
||||
if (result.getResult().getResponseStatus().isIsSuccess()) {
|
||||
System.out.printf("客户查看接口: %s%n", gson.toJson(result.getResult()));
|
||||
} else {
|
||||
fail("客户查看接口: " + gson.toJson(result.getResult()));
|
||||
}
|
||||
}
|
||||
|
||||
/*本接口用于实现客户 (BD_Customer) 的查看功能*/
|
||||
@Test
|
||||
public void htestviewCustomer2() throws Exception {
|
||||
OperateParam para = new OperateParam();
|
||||
para.setNumber(FNumber);
|
||||
OperatorResult<BdCustomer> result = api.view("BD_Customer", para, BdCustomer.class);
|
||||
Gson gson = new Gson();
|
||||
System.out.printf("result: %s%n", gson.toJson(result));
|
||||
if (result.getResult().getResponseStatus().isIsSuccess()) {
|
||||
System.out.printf("客户查看接口: %s%n", gson.toJson(result.getResult()));
|
||||
} else {
|
||||
fail("客户查看接口: " + gson.toJson(result.getResult()));
|
||||
}
|
||||
}
|
||||
|
||||
/*本接口用于实现客户 (BD_Customer)的单据查询功能*/
|
||||
@Test
|
||||
public void itestQueryCustomer() throws Exception {
|
||||
QueryParam para = new QueryParam();
|
||||
para.setFormId("BD_Customer");
|
||||
para.setFieldKeys("FNumber,FName,");
|
||||
para.setFilterString("Fnumber=\'"+FNumber+"\'");
|
||||
Gson gson = new Gson();
|
||||
List result = api.executeBillQuery(para,BdCustomer.class);
|
||||
System.out.println("客户单据查询接口: " + gson.toJson(result));
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*本接口用于实现客户 (BD_Customer) 的删除功能*/
|
||||
@Test
|
||||
public void jtestdeleteCustomer() throws Exception {
|
||||
OperateParam para = new OperateParam();
|
||||
List<String> Numbers = Arrays.asList(FNumber);
|
||||
para.setNumbers(Numbers);
|
||||
OperatorResult result = api.delete("BD_Customer",para);
|
||||
Gson gson = new Gson();
|
||||
if (result.getResult().getResponseStatus().isIsSuccess()) {
|
||||
System.out.printf("客户删除接口: %s%n", gson.toJson(result.getResult()));
|
||||
} else {
|
||||
fail("客户删除接口: " + gson.toJson(result.getResult().getResponseStatus()));
|
||||
}
|
||||
}
|
||||
|
||||
/*本接口用于实现客户 (BD_Customer) 的批量提交功能*/
|
||||
@Test
|
||||
public void kbatchsaveCustomer() throws Exception {
|
||||
String para = "[{\"FName\": "+"\""+"aukh_" + UUID.randomUUID().toString()+"\""+",\"FNumber\": "+"\""+SeqHelper.genNumber("KH")+"\""+",\"FCreateOrgId\": {\"FNumber\": \"100\"},\"FUseOrgId\": {\"FNumber\": \"100\"},\"FCOUNTRY\": {\"FNumber\": \"China\"},\"FINVOICETITLE\": \"zzl\",\"FCustTypeId\": {\"FNumber\": \"KHLB001_SYS\"},\"FTRADINGCURRID\": {\"FNumber\": \"PRE001\"},\"FInvoiceType\": \"1\",\"FTaxType\": {\"FNumber\": \"SFL02_SYS\"},\"FPriority\": 1,\"FTaxRate\": {\"FNumber\": \"SL02_SYS\"},\"FISCREDITCHECK\": true,\"FIsTrade\": true},{\"FName\": "+"\""+"auwl_" + UUID.randomUUID().toString()+"\""+",\"FNumber\": "+"\""+SeqHelper.genNumber("KH")+"\""+",\"FCreateOrgId\": {\"FNumber\": \"100\"},\"FUseOrgId\": {\"FNumber\": \"100\"},\"FCOUNTRY\": {\"FNumber\": \"China\"},\"FINVOICETITLE\": \"zzl\",\"FCustTypeId\": {\"FNumber\": \"KHLB001_SYS\"},\"FTRADINGCURRID\": {\"FNumber\": \"PRE001\"},\"FInvoiceType\": \"1\",\"FTaxType\": {\"FNumber\": \"SFL02_SYS\"},\"FPriority\": 1,\"FTaxRate\": {\"FNumber\": \"SL02_SYS\"},\"FISCREDITCHECK\": true,\"FIsTrade\": true}]";
|
||||
// 批量保存客户信息
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
list = new Gson().fromJson(para, list.getClass());
|
||||
SaveResult sRet = api.batchSave("BD_Customer", new BatchSave<>(list));
|
||||
Gson gson = new Gson();
|
||||
if (sRet.isSuccessfully()) {
|
||||
System.out.printf("客户批量保存接口: %s%n", gson.toJson(sRet.getResult()));
|
||||
} else {
|
||||
fail("客户保存接口: " + gson.toJson(sRet.getResult()));
|
||||
}
|
||||
}
|
||||
|
||||
/*本接口用于实现客户 (BD_Customer) 的批量提交功能2*/
|
||||
@Test
|
||||
public void lbatchsaveCustomer2() throws Exception {
|
||||
String para = "[{\"FName\": "+"\""+"aukh_" + UUID.randomUUID().toString()+"\""+",\"FNumber\": "+"\""+SeqHelper.genNumber("KH")+"\""+",\"FCreateOrgId\": {\"FNumber\": \"100\"},\"FUseOrgId\": {\"FNumber\": \"100\"},\"FCOUNTRY\": {\"FNumber\": \"China\"},\"FINVOICETITLE\": \"zzl\",\"FCustTypeId\": {\"FNumber\": \"KHLB001_SYS\"},\"FTRADINGCURRID\": {\"FNumber\": \"PRE001\"},\"FInvoiceType\": \"1\",\"FTaxType\": {\"FNumber\": \"SFL02_SYS\"},\"FPriority\": 1,\"FTaxRate\": {\"FNumber\": \"SL02_SYS\"},\"FISCREDITCHECK\": true,\"FIsTrade\": true}]";
|
||||
// 批量保存客户信息(传请求模式)
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
list = new Gson().fromJson(para, list.getClass());
|
||||
SaveResult sRet = api.batchSave("BD_Customer", new BatchSave<>(list),InvokeMode.Syn);
|
||||
Gson gson = new Gson();
|
||||
if (sRet.isSuccessfully()) {
|
||||
System.out.printf("客户批量保存接口: %s%n", gson.toJson(sRet.getResult()));
|
||||
} else {
|
||||
fail("客户保存接口: " + gson.toJson(sRet.getResult()));
|
||||
}
|
||||
}
|
||||
|
||||
/*本接口用于获取账套信息*/
|
||||
@Test
|
||||
public void ngetDataCenters() throws Exception {
|
||||
List datacenter = api.getDataCenters();
|
||||
Gson gson = new Gson();
|
||||
System.out.printf("或则环境账套信息:%s%n",gson.toJson(datacenter));
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
Spring Boot Version: ${spring-boot.version}
|
||||
Spring Application Name: ${spring.application.name}
|
||||
_ _
|
||||
(_) | |
|
||||
_ __ _ _ ___ _ _ _ ______ ___ _ _ ___ | |_ ___ _ __ ___
|
||||
| '__|| | | | / _ \ | | | || ||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \
|
||||
| | | |_| || (_) || |_| || | \__ \| |_| |\__ \| |_ | __/| | | | | |
|
||||
|_| \__,_| \___/ \__, ||_| |___/ \__, ||___/ \__| \___||_| |_| |_|
|
||||
__/ | __/ |
|
||||
|___/ |___/
|
@ -0,0 +1,29 @@
|
||||
# Tomcat
|
||||
server:
|
||||
port: 7303
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: hw-jindie
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 175.27.215.92:8848
|
||||
namespace: jyhb
|
||||
group: DEFAULT_GROUP
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 175.27.215.92:8848
|
||||
namespace: jyhb
|
||||
group: DEFAULT_GROUP
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/hw-jindie" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.hw" level="info" />
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn" />
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_error" />
|
||||
</root>
|
||||
</configuration>
|
@ -0,0 +1,106 @@
|
||||
<?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>com.hw</groupId>
|
||||
<artifactId>hw-modules</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>hw-modules-tdengine</artifactId>
|
||||
|
||||
<description>
|
||||
hw-modules-tdengine 时序数据库处理模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.hw</groupId>
|
||||
<artifactId>hw-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.hw</groupId>
|
||||
<artifactId>hw-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.hw</groupId>
|
||||
<artifactId>hw-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.hw</groupId>
|
||||
<artifactId>hw-common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- TDengine -->
|
||||
<dependency>
|
||||
<groupId>com.taosdata.jdbc</groupId>
|
||||
<artifactId>taos-jdbcdriver</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.hw</groupId>
|
||||
<artifactId>hw-api-tdengine</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -0,0 +1,34 @@
|
||||
package com.hw.tdengine;
|
||||
|
||||
import com.hw.common.security.annotation.EnableCustomConfig;
|
||||
import com.hw.common.security.annotation.EnableRyFeignClients;
|
||||
import com.hw.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 系统模块
|
||||
*
|
||||
* @author xins
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication
|
||||
public class HwTdengineApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
SpringApplication.run(HwTdengineApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 时序数据库模块启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
" .-------. ____ __ \n" +
|
||||
" | _ _ \\ \\ \\ / / \n" +
|
||||
" | ( ' ) | \\ _. / ' \n" +
|
||||
" |(_ o _) / _( )_ .' \n" +
|
||||
" | (_,_).' __ ___(_ o _)' \n" +
|
||||
" | |\\ \\ | || |(_,_)' \n" +
|
||||
" | | \\ `' /| `-' / \n" +
|
||||
" | | \\ / \\ / \n" +
|
||||
" ''-' `'-' `-..-' ");
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.hw.tdengine.mapper;
|
||||
|
||||
import com.hw.tdengine.api.domain.DeviceStatus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description:TDengine设备状态信息交互接口
|
||||
* @ClassName: DeviceStatusMapper
|
||||
* @Author : xins
|
||||
* @Date :2023-09-05 13:20
|
||||
* @Version :1.0
|
||||
*/
|
||||
public interface DeviceStatusMapper {
|
||||
|
||||
/**
|
||||
* @param: deviceStatus
|
||||
* @description 获取每天在线设备列表
|
||||
* @author xins
|
||||
* @date 2023-09-05 11:43
|
||||
* @return List<DeviceStatus>
|
||||
*/
|
||||
List<DeviceStatus> getOnlineDevicesGroupByDay(DeviceStatus deviceStatus);
|
||||
|
||||
/**
|
||||
* @param: deviceStatus
|
||||
* @description 获取最近的在线设备列表
|
||||
* @author xins
|
||||
* @date 2023-09-05 11:43
|
||||
* @return List<DeviceStatus>
|
||||
*/
|
||||
List<Map<String, Object>> getLastOnlineDevices(DeviceStatus deviceStatus);
|
||||
|
||||
/**
|
||||
* @param: deviceStatus
|
||||
* @description 获取设备状态信息列表
|
||||
* @author xins
|
||||
* @date 2023-09-05 11:43
|
||||
* @return List<DeviceStatus>
|
||||
*/
|
||||
List<Map<String, Object>> getDeviceStatusList(DeviceStatus deviceStatus);
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.hw.tdengine.service;
|
||||
|
||||
import com.hw.tdengine.api.domain.DeviceStatus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IDeviceStatusService {
|
||||
|
||||
/**
|
||||
* @param: DeviceStatus
|
||||
* @description 获取时间范围内每天的在线设备
|
||||
* @author xins
|
||||
* @date 2023-09-05 13:23
|
||||
* @return List<DeviceStatus>
|
||||
*/
|
||||
public List<DeviceStatus> getOnlineDevicesGroupByDay(DeviceStatus queryDeviceStatus);
|
||||
|
||||
/**
|
||||
* @return List<Map<String, Object>>
|
||||
* @param: DeviceStatus
|
||||
* @description 获取某个事件前最新的在线设备
|
||||
* @author xins
|
||||
* @date 2023-09-05 13:23
|
||||
*/
|
||||
public List<Map<String, Object>> getLastOnlineDevices(DeviceStatus queryDeviceStatus);
|
||||
|
||||
/**
|
||||
* @return List<Map<String, Object>>
|
||||
* @param: DeviceStatus
|
||||
* @description 获取设备状态信息列表
|
||||
* @author xins
|
||||
* @date 2023-09-05 13:23
|
||||
*/
|
||||
public List<Map<String, Object>> getDeviceStatusList(DeviceStatus queryDeviceStatus);
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
Spring Boot Version: ${spring-boot.version}
|
||||
Spring Application Name: ${spring.application.name}
|
||||
_ _
|
||||
(_) | |
|
||||
_ __ _ _ ___ _ _ _ ______ ___ _ _ ___ | |_ ___ _ __ ___
|
||||
| '__|| | | | / _ \ | | | || ||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \
|
||||
| | | |_| || (_) || |_| || | \__ \| |_| |\__ \| |_ | __/| | | | | |
|
||||
|_| \__,_| \___/ \__, ||_| |___/ \__, ||___/ \__| \___||_| |_| |_|
|
||||
__/ | __/ |
|
||||
|___/ |___/
|
@ -0,0 +1,29 @@
|
||||
# Tomcat
|
||||
server:
|
||||
port: 7302
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: hw-tdengine
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 175.27.215.92:8848
|
||||
namespace: jyhb
|
||||
group: DEFAULT_GROUP
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 175.27.215.92:8848
|
||||
namespace: jyhb
|
||||
group: DEFAULT_GROUP
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/hw-tdengine" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.hw" level="info" />
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn" />
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_error" />
|
||||
</root>
|
||||
</configuration>
|
@ -0,0 +1,45 @@
|
||||
<?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.hw.tdengine.mapper.DeviceStatusMapper">
|
||||
|
||||
<select id="getOnlineDevicesGroupByDay" parameterType="com.hw.tdengine.api.domain.DeviceStatus" resultType="com.hw.tdengine.api.domain.DeviceStatus" >
|
||||
select timetruncate(ts,1d) ts,devicetype,onlinestatus,deviceid from #{params.databaseName}.#{params.superTableName}
|
||||
where onlinestatus=1
|
||||
<if test="startTime!= null and endTime != null and startTime!= 0 and endTime != 0">
|
||||
and ts BETWEEN #{startTime} AND #{endTime}
|
||||
</if>
|
||||
<if test="sceneId != null "> and scene_id = #{sceneId}</if>
|
||||
group by timetruncate(ts,1d),devicetype,onlinestatus,deviceid
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getLastOnlineDevices" parameterType="com.hw.tdengine.api.domain.DeviceStatus" resultType="java.util.Map" >
|
||||
select <foreach item="item" collection="schemaFields" separator=","
|
||||
index="">last_row(${item.fieldName})</foreach>,last_row(deviceid) from #{params.databaseName}.#{params.superTableName}
|
||||
<where>
|
||||
<if test="endTime!= null and endTime != 0">
|
||||
and ts <= #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
group by deviceid
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getDeviceStatusList" parameterType="com.hw.tdengine.api.domain.DeviceStatus" resultType="java.util.Map" >
|
||||
select ts,onlinestatus from #{params.databaseName}.#{params.tableName}
|
||||
<where>
|
||||
<if test="startTime!= null and startTime != 0">
|
||||
and ts > #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null and endTime != 0">
|
||||
and ts < #{endTime}
|
||||
</if>
|
||||
<if test="onlineStatus!= null">
|
||||
and onlinestatus = #{onlineStatus}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,100 @@
|
||||
<?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>com.hw</groupId>
|
||||
<artifactId>hw-modules</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>hw-modules-wms</artifactId>
|
||||
|
||||
<description>
|
||||
hw-modules-wms仓储模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.hw</groupId>
|
||||
<artifactId>hw-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.hw</groupId>
|
||||
<artifactId>hw-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.hw</groupId>
|
||||
<artifactId>hw-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.hw</groupId>
|
||||
<artifactId>hw-common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -0,0 +1,34 @@
|
||||
package com.hw.wms;
|
||||
|
||||
import com.hw.common.security.annotation.EnableCustomConfig;
|
||||
import com.hw.common.security.annotation.EnableRyFeignClients;
|
||||
import com.hw.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 系统模块
|
||||
*
|
||||
* @author xins
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication
|
||||
public class HwWmsApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
SpringApplication.run(HwWmsApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 仓储模块启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
" .-------. ____ __ \n" +
|
||||
" | _ _ \\ \\ \\ / / \n" +
|
||||
" | ( ' ) | \\ _. / ' \n" +
|
||||
" |(_ o _) / _( )_ .' \n" +
|
||||
" | (_,_).' __ ___(_ o _)' \n" +
|
||||
" | |\\ \\ | || |(_,_)' \n" +
|
||||
" | | \\ `' /| `-' / \n" +
|
||||
" | | \\ / \\ / \n" +
|
||||
" ''-' `'-' `-..-' ");
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package com.hw.wms.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.hw.common.log.annotation.Log;
|
||||
import com.hw.common.log.enums.BusinessType;
|
||||
import com.hw.common.security.annotation.RequiresPermissions;
|
||||
import com.hw.wms.domain.WmsRawOutstock;
|
||||
import com.hw.wms.service.IWmsRawOutstockService;
|
||||
import com.hw.common.core.web.controller.BaseController;
|
||||
import com.hw.common.core.web.domain.AjaxResult;
|
||||
import com.hw.common.core.utils.poi.ExcelUtil;
|
||||
import com.hw.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 原材料出库记录Controller
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-12-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/rawoutstock")
|
||||
public class WmsRawOutstockController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWmsRawOutstockService wmsRawOutstockService;
|
||||
|
||||
/**
|
||||
* 查询原材料出库记录列表
|
||||
*/
|
||||
@RequiresPermissions("wms:rawoutstock:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WmsRawOutstock wmsRawOutstock)
|
||||
{
|
||||
startPage();
|
||||
List<WmsRawOutstock> list = wmsRawOutstockService.selectWmsRawOutstockList(wmsRawOutstock);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出原材料出库记录列表
|
||||
*/
|
||||
@RequiresPermissions("wms:rawoutstock:export")
|
||||
@Log(title = "原材料出库记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WmsRawOutstock wmsRawOutstock)
|
||||
{
|
||||
List<WmsRawOutstock> list = wmsRawOutstockService.selectWmsRawOutstockList(wmsRawOutstock);
|
||||
ExcelUtil<WmsRawOutstock> util = new ExcelUtil<WmsRawOutstock>(WmsRawOutstock.class);
|
||||
util.exportExcel(response, list, "原材料出库记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取原材料出库记录详细信息
|
||||
*/
|
||||
@RequiresPermissions("wms:rawoutstock:query")
|
||||
@GetMapping(value = "/{rawOutstockId}")
|
||||
public AjaxResult getInfo(@PathVariable("rawOutstockId") Long rawOutstockId)
|
||||
{
|
||||
return success(wmsRawOutstockService.selectWmsRawOutstockByRawOutstockId(rawOutstockId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增原材料出库记录
|
||||
*/
|
||||
@RequiresPermissions("wms:rawoutstock:add")
|
||||
@Log(title = "原材料出库记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WmsRawOutstock wmsRawOutstock)
|
||||
{
|
||||
return toAjax(wmsRawOutstockService.insertWmsRawOutstock(wmsRawOutstock));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改原材料出库记录
|
||||
*/
|
||||
@RequiresPermissions("wms:rawoutstock:edit")
|
||||
@Log(title = "原材料出库记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WmsRawOutstock wmsRawOutstock)
|
||||
{
|
||||
return toAjax(wmsRawOutstockService.updateWmsRawOutstock(wmsRawOutstock));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除原材料出库记录
|
||||
*/
|
||||
@RequiresPermissions("wms:rawoutstock:remove")
|
||||
@Log(title = "原材料出库记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{rawOutstockIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] rawOutstockIds)
|
||||
{
|
||||
return toAjax(wmsRawOutstockService.deleteWmsRawOutstockByRawOutstockIds(rawOutstockIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package com.hw.wms.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.wms.domain.WmsRawOutstock;
|
||||
import com.hw.wms.domain.WmsRawOutstockDetail;
|
||||
|
||||
/**
|
||||
* 原材料出库记录Mapper接口
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-12-20
|
||||
*/
|
||||
public interface WmsRawOutstockMapper
|
||||
{
|
||||
/**
|
||||
* 查询原材料出库记录
|
||||
*
|
||||
* @param rawOutstockId 原材料出库记录主键
|
||||
* @return 原材料出库记录
|
||||
*/
|
||||
public WmsRawOutstock selectWmsRawOutstockByRawOutstockId(Long rawOutstockId);
|
||||
|
||||
/**
|
||||
* 查询原材料出库记录列表
|
||||
*
|
||||
* @param wmsRawOutstock 原材料出库记录
|
||||
* @return 原材料出库记录集合
|
||||
*/
|
||||
public List<WmsRawOutstock> selectWmsRawOutstockList(WmsRawOutstock wmsRawOutstock);
|
||||
|
||||
/**
|
||||
* 新增原材料出库记录
|
||||
*
|
||||
* @param wmsRawOutstock 原材料出库记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWmsRawOutstock(WmsRawOutstock wmsRawOutstock);
|
||||
|
||||
/**
|
||||
* 修改原材料出库记录
|
||||
*
|
||||
* @param wmsRawOutstock 原材料出库记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWmsRawOutstock(WmsRawOutstock wmsRawOutstock);
|
||||
|
||||
/**
|
||||
* 删除原材料出库记录
|
||||
*
|
||||
* @param rawOutstockId 原材料出库记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmsRawOutstockByRawOutstockId(Long rawOutstockId);
|
||||
|
||||
/**
|
||||
* 批量删除原材料出库记录
|
||||
*
|
||||
* @param rawOutstockIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmsRawOutstockByRawOutstockIds(Long[] rawOutstockIds);
|
||||
|
||||
/**
|
||||
* 批量删除原材料出库记录明细
|
||||
*
|
||||
* @param rawOutstockIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmsRawOutstockDetailByRawOutstockIds(Long[] rawOutstockIds);
|
||||
|
||||
/**
|
||||
* 批量新增原材料出库记录明细
|
||||
*
|
||||
* @param wmsRawOutstockDetailList 原材料出库记录明细列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchWmsRawOutstockDetail(List<WmsRawOutstockDetail> wmsRawOutstockDetailList);
|
||||
|
||||
|
||||
/**
|
||||
* 通过原材料出库记录主键删除原材料出库记录明细信息
|
||||
*
|
||||
* @param rawOutstockId 原材料出库记录ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmsRawOutstockDetailByRawOutstockId(Long rawOutstockId);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.hw.wms.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.wms.domain.WmsRawOutstock;
|
||||
|
||||
/**
|
||||
* 原材料出库记录Service接口
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-12-20
|
||||
*/
|
||||
public interface IWmsRawOutstockService
|
||||
{
|
||||
/**
|
||||
* 查询原材料出库记录
|
||||
*
|
||||
* @param rawOutstockId 原材料出库记录主键
|
||||
* @return 原材料出库记录
|
||||
*/
|
||||
public WmsRawOutstock selectWmsRawOutstockByRawOutstockId(Long rawOutstockId);
|
||||
|
||||
/**
|
||||
* 查询原材料出库记录列表
|
||||
*
|
||||
* @param wmsRawOutstock 原材料出库记录
|
||||
* @return 原材料出库记录集合
|
||||
*/
|
||||
public List<WmsRawOutstock> selectWmsRawOutstockList(WmsRawOutstock wmsRawOutstock);
|
||||
|
||||
/**
|
||||
* 新增原材料出库记录
|
||||
*
|
||||
* @param wmsRawOutstock 原材料出库记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWmsRawOutstock(WmsRawOutstock wmsRawOutstock);
|
||||
|
||||
/**
|
||||
* 修改原材料出库记录
|
||||
*
|
||||
* @param wmsRawOutstock 原材料出库记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWmsRawOutstock(WmsRawOutstock wmsRawOutstock);
|
||||
|
||||
/**
|
||||
* 批量删除原材料出库记录
|
||||
*
|
||||
* @param rawOutstockIds 需要删除的原材料出库记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmsRawOutstockByRawOutstockIds(Long[] rawOutstockIds);
|
||||
|
||||
/**
|
||||
* 删除原材料出库记录信息
|
||||
*
|
||||
* @param rawOutstockId 原材料出库记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmsRawOutstockByRawOutstockId(Long rawOutstockId);
|
||||
}
|
@ -0,0 +1,131 @@
|
||||
package com.hw.wms.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.ArrayList;
|
||||
import com.hw.common.core.utils.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.hw.wms.domain.WmsRawOutstockDetail;
|
||||
import com.hw.wms.mapper.WmsRawOutstockMapper;
|
||||
import com.hw.wms.domain.WmsRawOutstock;
|
||||
import com.hw.wms.service.IWmsRawOutstockService;
|
||||
|
||||
/**
|
||||
* 原材料出库记录Service业务层处理
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-12-20
|
||||
*/
|
||||
@Service
|
||||
public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService
|
||||
{
|
||||
@Autowired
|
||||
private WmsRawOutstockMapper wmsRawOutstockMapper;
|
||||
|
||||
/**
|
||||
* 查询原材料出库记录
|
||||
*
|
||||
* @param rawOutstockId 原材料出库记录主键
|
||||
* @return 原材料出库记录
|
||||
*/
|
||||
@Override
|
||||
public WmsRawOutstock selectWmsRawOutstockByRawOutstockId(Long rawOutstockId)
|
||||
{
|
||||
return wmsRawOutstockMapper.selectWmsRawOutstockByRawOutstockId(rawOutstockId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询原材料出库记录列表
|
||||
*
|
||||
* @param wmsRawOutstock 原材料出库记录
|
||||
* @return 原材料出库记录
|
||||
*/
|
||||
@Override
|
||||
public List<WmsRawOutstock> selectWmsRawOutstockList(WmsRawOutstock wmsRawOutstock)
|
||||
{
|
||||
return wmsRawOutstockMapper.selectWmsRawOutstockList(wmsRawOutstock);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增原材料出库记录
|
||||
*
|
||||
* @param wmsRawOutstock 原材料出库记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int insertWmsRawOutstock(WmsRawOutstock wmsRawOutstock)
|
||||
{
|
||||
int rows = wmsRawOutstockMapper.insertWmsRawOutstock(wmsRawOutstock);
|
||||
insertWmsRawOutstockDetail(wmsRawOutstock);
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改原材料出库记录
|
||||
*
|
||||
* @param wmsRawOutstock 原材料出库记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int updateWmsRawOutstock(WmsRawOutstock wmsRawOutstock)
|
||||
{
|
||||
wmsRawOutstockMapper.deleteWmsRawOutstockDetailByRawOutstockId(wmsRawOutstock.getRawOutstockId());
|
||||
insertWmsRawOutstockDetail(wmsRawOutstock);
|
||||
return wmsRawOutstockMapper.updateWmsRawOutstock(wmsRawOutstock);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除原材料出库记录
|
||||
*
|
||||
* @param rawOutstockIds 需要删除的原材料出库记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteWmsRawOutstockByRawOutstockIds(Long[] rawOutstockIds)
|
||||
{
|
||||
wmsRawOutstockMapper.deleteWmsRawOutstockDetailByRawOutstockIds(rawOutstockIds);
|
||||
return wmsRawOutstockMapper.deleteWmsRawOutstockByRawOutstockIds(rawOutstockIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除原材料出库记录信息
|
||||
*
|
||||
* @param rawOutstockId 原材料出库记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteWmsRawOutstockByRawOutstockId(Long rawOutstockId)
|
||||
{
|
||||
wmsRawOutstockMapper.deleteWmsRawOutstockDetailByRawOutstockId(rawOutstockId);
|
||||
return wmsRawOutstockMapper.deleteWmsRawOutstockByRawOutstockId(rawOutstockId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增原材料出库记录明细信息
|
||||
*
|
||||
* @param wmsRawOutstock 原材料出库记录对象
|
||||
*/
|
||||
public void insertWmsRawOutstockDetail(WmsRawOutstock wmsRawOutstock)
|
||||
{
|
||||
List<WmsRawOutstockDetail> wmsRawOutstockDetailList = wmsRawOutstock.getWmsRawOutstockDetailList();
|
||||
Long rawOutstockId = wmsRawOutstock.getRawOutstockId();
|
||||
if (StringUtils.isNotNull(wmsRawOutstockDetailList))
|
||||
{
|
||||
List<WmsRawOutstockDetail> list = new ArrayList<WmsRawOutstockDetail>();
|
||||
for (WmsRawOutstockDetail wmsRawOutstockDetail : wmsRawOutstockDetailList)
|
||||
{
|
||||
wmsRawOutstockDetail.setRawOutstockId(rawOutstockId);
|
||||
list.add(wmsRawOutstockDetail);
|
||||
}
|
||||
if (list.size() > 0)
|
||||
{
|
||||
wmsRawOutstockMapper.batchWmsRawOutstockDetail(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
Spring Boot Version: ${spring-boot.version}
|
||||
Spring Application Name: ${spring.application.name}
|
||||
_ _
|
||||
(_) | |
|
||||
_ __ _ _ ___ _ _ _ ______ ___ _ _ ___ | |_ ___ _ __ ___
|
||||
| '__|| | | | / _ \ | | | || ||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \
|
||||
| | | |_| || (_) || |_| || | \__ \| |_| |\__ \| |_ | __/| | | | | |
|
||||
|_| \__,_| \___/ \__, ||_| |___/ \__, ||___/ \__| \___||_| |_| |_|
|
||||
__/ | __/ |
|
||||
|___/ |___/
|
@ -0,0 +1,29 @@
|
||||
# Tomcat
|
||||
server:
|
||||
port: 7304
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: hw-wms
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 175.27.215.92:8848
|
||||
namespace: jyhb
|
||||
group: DEFAULT_GROUP
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 175.27.215.92:8848
|
||||
namespace: jyhb
|
||||
group: DEFAULT_GROUP
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/hw-wms" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.hw" level="info" />
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn" />
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_error" />
|
||||
</root>
|
||||
</configuration>
|
@ -0,0 +1,209 @@
|
||||
<?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.hw.wms.mapper.WmsRawOutstockMapper">
|
||||
|
||||
<resultMap type="WmsRawOutstock" id="WmsRawOutstockResult">
|
||||
<result property="rawOutstockId" column="raw_outstock_id" />
|
||||
<result property="taskCode" column="task_code" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="locationCode" column="location_code" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="planId" column="plan_id" />
|
||||
<result property="planDetailId" column="plan_detail_id" />
|
||||
<result property="stationId" column="station_id" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="operationType" column="operation_type" />
|
||||
<result property="taskType" column="task_type" />
|
||||
<result property="applyReason" column="apply_reason" />
|
||||
<result property="auditReason" column="audit_reason" />
|
||||
<result property="auditStatus" column="audit_status" />
|
||||
<result property="executeStatus" column="execute_status" />
|
||||
<result property="applyBy" column="apply_by" />
|
||||
<result property="applyDate" column="apply_date" />
|
||||
<result property="auditBy" column="audit_by" />
|
||||
<result property="auditDate" column="audit_date" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateDate" column="update_date" />
|
||||
<result property="beginTime" column="begin_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="WmsRawOutstockWmsRawOutstockDetailResult" type="WmsRawOutstock" extends="WmsRawOutstockResult">
|
||||
<collection property="wmsRawOutstockDetailList" notNullColumn="sub_raw_outstock_detail_id" javaType="java.util.List" resultMap="WmsRawOutstockDetailResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="WmsRawOutstockDetail" id="WmsRawOutstockDetailResult">
|
||||
<result property="rawOutstockDetailId" column="sub_raw_outstock_detail_id" />
|
||||
<result property="rawOutstockId" column="sub_raw_outstock_id" />
|
||||
<result property="locationCode" column="sub_location_code" />
|
||||
<result property="materialBarcode" column="sub_material_barcode" />
|
||||
<result property="materialId" column="sub_material_id" />
|
||||
<result property="instockBatch" column="sub_instock_batch" />
|
||||
<result property="materialProductionDate" column="sub_material_production_Date" />
|
||||
<result property="planAmount" column="sub_plan_amount" />
|
||||
<result property="outstockAmount" column="sub_outstock_amount" />
|
||||
<result property="executeStatus" column="sub_execute_status" />
|
||||
<result property="erpStatus" column="sub_erp_status" />
|
||||
<result property="outstockPerson" column="sub_outstock_person" />
|
||||
<result property="outstockTime" column="sub_outstock_time" />
|
||||
<result property="outstockWay" column="sub_outstock_way" />
|
||||
<result property="machineName" column="sub_machine_name" />
|
||||
<result property="qualityStatus" column="sub_quality_status" />
|
||||
<result property="createBy" column="sub_create_by" />
|
||||
<result property="createDate" column="sub_create_date" />
|
||||
<result property="updateBy" column="sub_update_by" />
|
||||
<result property="updateDate" column="sub_update_date" />
|
||||
<result property="stackAmount" column="sub_stack_amount" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWmsRawOutstockVo">
|
||||
select raw_outstock_id, task_code, warehouse_id, location_code, order_id, plan_id, plan_detail_id, station_id, product_id, operation_type, task_type, apply_reason, audit_reason, audit_status, execute_status, apply_by, apply_date, audit_by, audit_date, update_by, update_date, begin_time, end_time from wms_raw_outstock
|
||||
</sql>
|
||||
|
||||
<select id="selectWmsRawOutstockList" parameterType="WmsRawOutstock" resultMap="WmsRawOutstockResult">
|
||||
<include refid="selectWmsRawOutstockVo"/>
|
||||
<where>
|
||||
<if test="taskCode != null and taskCode != ''"> and task_code = #{taskCode}</if>
|
||||
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
|
||||
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
|
||||
<if test="orderId != null "> and order_id = #{orderId}</if>
|
||||
<if test="planId != null "> and plan_id = #{planId}</if>
|
||||
<if test="planDetailId != null "> and plan_detail_id = #{planDetailId}</if>
|
||||
<if test="stationId != null "> and station_id = #{stationId}</if>
|
||||
<if test="productId != null "> and product_id = #{productId}</if>
|
||||
<if test="operationType != null and operationType != ''"> and operation_type = #{operationType}</if>
|
||||
<if test="taskType != null and taskType != ''"> and task_type = #{taskType}</if>
|
||||
<if test="applyReason != null and applyReason != ''"> and apply_reason = #{applyReason}</if>
|
||||
<if test="auditReason != null and auditReason != ''"> and audit_reason = #{auditReason}</if>
|
||||
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
|
||||
<if test="executeStatus != null and executeStatus != ''"> and execute_status = #{executeStatus}</if>
|
||||
<if test="applyBy != null and applyBy != ''"> and apply_by = #{applyBy}</if>
|
||||
<if test="applyDate != null "> and apply_date = #{applyDate}</if>
|
||||
<if test="auditBy != null and auditBy != ''"> and audit_by = #{auditBy}</if>
|
||||
<if test="auditDate != null "> and audit_date = #{auditDate}</if>
|
||||
<if test="updateDate != null "> and update_date = #{updateDate}</if>
|
||||
<if test="beginTime != null "> and begin_time = #{beginTime}</if>
|
||||
<if test="endTime != null "> and end_time = #{endTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWmsRawOutstockByRawOutstockId" parameterType="Long" resultMap="WmsRawOutstockWmsRawOutstockDetailResult">
|
||||
select a.raw_outstock_id, a.task_code, a.warehouse_id, a.location_code, a.order_id, a.plan_id, a.plan_detail_id, a.station_id, a.product_id, a.operation_type, a.task_type, a.apply_reason, a.audit_reason, a.audit_status, a.execute_status, a.apply_by, a.apply_date, a.audit_by, a.audit_date, a.update_by, a.update_date, a.begin_time, a.end_time,
|
||||
b.raw_outstock_detail_id as sub_raw_outstock_detail_id, b.raw_outstock_id as sub_raw_outstock_id, b.location_code as sub_location_code, b.material_barcode as sub_material_barcode, b.material_id as sub_material_id, b.instock_batch as sub_instock_batch, b.material_production_Date as sub_material_production_Date, b.plan_amount as sub_plan_amount, b.outstock_amount as sub_outstock_amount, b.execute_status as sub_execute_status, b.erp_status as sub_erp_status, b.outstock_person as sub_outstock_person, b.outstock_time as sub_outstock_time, b.outstock_way as sub_outstock_way, b.machine_name as sub_machine_name, b.quality_status as sub_quality_status, b.create_by as sub_create_by, b.create_date as sub_create_date, b.update_by as sub_update_by, b.update_date as sub_update_date, b.stack_amount as sub_stack_amount
|
||||
from wms_raw_outstock a
|
||||
left join wms_raw_outstock_detail b on b.raw_outstock_id = a.raw_outstock_id
|
||||
where a.raw_outstock_id = #{rawOutstockId}
|
||||
</select>
|
||||
|
||||
<insert id="insertWmsRawOutstock" parameterType="WmsRawOutstock" useGeneratedKeys="true" keyProperty="rawOutstockId">
|
||||
insert into wms_raw_outstock
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskCode != null and taskCode != ''">task_code,</if>
|
||||
<if test="warehouseId != null">warehouse_id,</if>
|
||||
<if test="locationCode != null">location_code,</if>
|
||||
<if test="orderId != null">order_id,</if>
|
||||
<if test="planId != null">plan_id,</if>
|
||||
<if test="planDetailId != null">plan_detail_id,</if>
|
||||
<if test="stationId != null">station_id,</if>
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="operationType != null">operation_type,</if>
|
||||
<if test="taskType != null">task_type,</if>
|
||||
<if test="applyReason != null">apply_reason,</if>
|
||||
<if test="auditReason != null">audit_reason,</if>
|
||||
<if test="auditStatus != null">audit_status,</if>
|
||||
<if test="executeStatus != null">execute_status,</if>
|
||||
<if test="applyBy != null">apply_by,</if>
|
||||
<if test="applyDate != null">apply_date,</if>
|
||||
<if test="auditBy != null">audit_by,</if>
|
||||
<if test="auditDate != null">audit_date,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateDate != null">update_date,</if>
|
||||
<if test="beginTime != null">begin_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="taskCode != null and taskCode != ''">#{taskCode},</if>
|
||||
<if test="warehouseId != null">#{warehouseId},</if>
|
||||
<if test="locationCode != null">#{locationCode},</if>
|
||||
<if test="orderId != null">#{orderId},</if>
|
||||
<if test="planId != null">#{planId},</if>
|
||||
<if test="planDetailId != null">#{planDetailId},</if>
|
||||
<if test="stationId != null">#{stationId},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="operationType != null">#{operationType},</if>
|
||||
<if test="taskType != null">#{taskType},</if>
|
||||
<if test="applyReason != null">#{applyReason},</if>
|
||||
<if test="auditReason != null">#{auditReason},</if>
|
||||
<if test="auditStatus != null">#{auditStatus},</if>
|
||||
<if test="executeStatus != null">#{executeStatus},</if>
|
||||
<if test="applyBy != null">#{applyBy},</if>
|
||||
<if test="applyDate != null">#{applyDate},</if>
|
||||
<if test="auditBy != null">#{auditBy},</if>
|
||||
<if test="auditDate != null">#{auditDate},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateDate != null">#{updateDate},</if>
|
||||
<if test="beginTime != null">#{beginTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWmsRawOutstock" parameterType="WmsRawOutstock">
|
||||
update wms_raw_outstock
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskCode != null and taskCode != ''">task_code = #{taskCode},</if>
|
||||
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
|
||||
<if test="locationCode != null">location_code = #{locationCode},</if>
|
||||
<if test="orderId != null">order_id = #{orderId},</if>
|
||||
<if test="planId != null">plan_id = #{planId},</if>
|
||||
<if test="planDetailId != null">plan_detail_id = #{planDetailId},</if>
|
||||
<if test="stationId != null">station_id = #{stationId},</if>
|
||||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="operationType != null">operation_type = #{operationType},</if>
|
||||
<if test="taskType != null">task_type = #{taskType},</if>
|
||||
<if test="applyReason != null">apply_reason = #{applyReason},</if>
|
||||
<if test="auditReason != null">audit_reason = #{auditReason},</if>
|
||||
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
|
||||
<if test="executeStatus != null">execute_status = #{executeStatus},</if>
|
||||
<if test="applyBy != null">apply_by = #{applyBy},</if>
|
||||
<if test="applyDate != null">apply_date = #{applyDate},</if>
|
||||
<if test="auditBy != null">audit_by = #{auditBy},</if>
|
||||
<if test="auditDate != null">audit_date = #{auditDate},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateDate != null">update_date = #{updateDate},</if>
|
||||
<if test="beginTime != null">begin_time = #{beginTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
</trim>
|
||||
where raw_outstock_id = #{rawOutstockId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWmsRawOutstockByRawOutstockId" parameterType="Long">
|
||||
delete from wms_raw_outstock where raw_outstock_id = #{rawOutstockId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWmsRawOutstockByRawOutstockIds" parameterType="String">
|
||||
delete from wms_raw_outstock where raw_outstock_id in
|
||||
<foreach item="rawOutstockId" collection="array" open="(" separator="," close=")">
|
||||
#{rawOutstockId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWmsRawOutstockDetailByRawOutstockIds" parameterType="String">
|
||||
delete from wms_raw_outstock_detail where raw_outstock_id in
|
||||
<foreach item="rawOutstockId" collection="array" open="(" separator="," close=")">
|
||||
#{rawOutstockId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWmsRawOutstockDetailByRawOutstockId" parameterType="Long">
|
||||
delete from wms_raw_outstock_detail where raw_outstock_id = #{rawOutstockId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchWmsRawOutstockDetail">
|
||||
insert into wms_raw_outstock_detail( raw_outstock_detail_id, raw_outstock_id, location_code, material_barcode, material_id, instock_batch, material_production_Date, plan_amount, outstock_amount, execute_status, erp_status, outstock_person, outstock_time, outstock_way, machine_name, quality_status, create_by, create_date, update_by, update_date, stack_amount) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.rawOutstockDetailId}, #{item.rawOutstockId}, #{item.locationCode}, #{item.materialBarcode}, #{item.materialId}, #{item.instockBatch}, #{item.materialProductionDate}, #{item.planAmount}, #{item.outstockAmount}, #{item.executeStatus}, #{item.erpStatus}, #{item.outstockPerson}, #{item.outstockTime}, #{item.outstockWay}, #{item.machineName}, #{item.qualityStatus}, #{item.createBy}, #{item.createDate}, #{item.updateBy}, #{item.updateDate}, #{item.stackAmount})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
Loading…
Reference in New Issue