Browse Source

1.皮阿诺推送订单数据接口

2.获取工厂token接口
3.中转订单信息状态的接口
test
zhenghaoyu 2 years ago
parent
commit
a4722d86d2
  1. 31
      blade-biz-common/pom.xml
  2. 58
      blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java
  3. 24
      blade-biz-common/src/main/java/org/springblade/common/utils/CommonUtil.java
  4. 67
      blade-biz-common/src/main/java/org/springblade/common/utils/TokenUtil.java
  5. 5
      blade-service/logpm-factory/pom.xml
  6. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/FactoryApplication.java
  7. 25
      blade-service/logpm-factory/src/main/java/com/logpm/factory/config/InterceptorAdapterConfig.java
  8. 53
      blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java
  9. 67
      blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RequestWrapper.java
  10. 29
      blade-service/logpm-factory/src/main/java/com/logpm/factory/filer/HttpServletFilter.java
  11. 86
      blade-service/logpm-factory/src/main/java/com/logpm/factory/interceptor/FactoryAccountsInterceptor.java
  12. 20
      blade-service/logpm-factory/src/main/java/com/logpm/factory/props/PanFactoryProperties.java
  13. 30
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DirectQueueOneHandler.java
  14. 23
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/bean/MessageStruct.java
  15. 19
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/bean/Resp.java
  16. 77
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/controller/FactoryAuthController.java
  17. 173
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/controller/PanFactoryDataController.java
  18. 9
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/FactoryAccountDTO.java
  19. 23
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/OrderInfoDTO.java
  20. 57
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/OrderStatusDTO.java
  21. 20
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/PanFactoryOrderDTO.java
  22. 20
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/PanPackageInfoDTO.java
  23. 6
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/PanPackageListDTO.java
  24. 17
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryAccountMapper.java
  25. 20
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryAccountMapper.xml
  26. 17
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryTokenMapper.java
  27. 20
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryTokenMapper.xml
  28. 19
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanFactoryOrderMapper.java
  29. 20
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanFactoryOrderMapper.xml
  30. 31
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanOrderStatusLogMapper.java
  31. 20
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanOrderStatusLogMapper.xml
  32. 31
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageInfoMapper.java
  33. 20
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageInfoMapper.xml
  34. 31
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageListMapper.java
  35. 20
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageListMapper.xml
  36. 12
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IFactoryAccountService.java
  37. 11
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IFactoryAuthService.java
  38. 15
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IFactoryTokenService.java
  39. 16
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanFactoryDataService.java
  40. 12
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanFactoryOrderService.java
  41. 8
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanOrderStatusLogService.java
  42. 12
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanPackageInfoService.java
  43. 7
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanPackageListService.java
  44. 19
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/FactoryAccountServiceImpl.java
  45. 78
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/FactoryAuthServiceImpl.java
  46. 49
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/FactoryTokenServiceImpl.java
  47. 166
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanFactoryDataServiceImpl.java
  48. 19
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanFactoryOrderServiceImpl.java
  49. 19
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanOrderStatusLogServiceImpl.java
  50. 19
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanPackageInfoServiceImpl.java
  51. 19
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanPackageListServiceImpl.java
  52. 6
      blade-service/logpm-factory/src/main/resources/application-dev.yml
  53. 14
      blade-service/logpm-factory/src/main/resources/application.yml

31
blade-biz-common/pom.xml

@ -29,6 +29,7 @@
<scope>provided</scope>
</dependency>
<!-- 二维码生成jar包-->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
@ -45,6 +46,8 @@
<artifactId>javase</artifactId>
<version>3.3.3</version>
</dependency>
<!-- commons-lang-->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
@ -55,6 +58,34 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!--minio-->
<!-- <dependency>-->
<!-- <groupId>io.minio</groupId>-->
<!-- <artifactId>minio</artifactId>-->
<!-- <version>8.5.2</version>-->
<!-- </dependency>-->
<!--freemark模板所需类-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
<dependency>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>core-renderer</artifactId>
<version>R8</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.8.0</version>
</dependency>
<!--Jwt-->
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>3.8.2</version>
</dependency>
</dependencies>
<build>

58
blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java

@ -0,0 +1,58 @@
package org.springblade.common.constant;
/**
* RabbitMQ常量池
*
* @author yangkai.shen
*/
public interface RabbitConstant {
/**
* 直接模式1
*/
String DIRECT_MODE_QUEUE_ONE = "queue.direct.1";
/**
* 队列2
*/
String QUEUE_TWO = "queue.2";
/**
* 队列3
*/
String QUEUE_THREE = "3.queue";
/**
* 分列模式
*/
String FANOUT_MODE_QUEUE = "fanout.mode";
/**
* 主题模式
*/
String TOPIC_MODE_QUEUE = "topic.mode";
/**
* 路由1
*/
String TOPIC_ROUTING_KEY_ONE = "queue.#";
/**
* 路由2
*/
String TOPIC_ROUTING_KEY_TWO = "*.queue";
/**
* 路由3
*/
String TOPIC_ROUTING_KEY_THREE = "3.queue";
/**
* 延迟队列
*/
String DELAY_QUEUE = "delay.queue";
/**
* 延迟队列交换器
*/
String DELAY_MODE_QUEUE = "delay.mode";
}

24
blade-biz-common/src/main/java/org/springblade/common/utils/CommonUtil.java

@ -22,6 +22,8 @@ import org.springframework.util.StringUtils;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Random;
import java.util.TimeZone;
/**
@ -65,6 +67,28 @@ public class CommonUtil {
return null;
}
public static String createOrderCode() {
int START = 100000; //定义范围开始数字
int END = 999999; //定义范围结束数字
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
String orderIdStart = format.format(new Date());
System.out.println(orderIdStart);
Random rand = new Random();
int i = rand.nextInt(END - START + 1) + START;
orderIdStart = orderIdStart + i + getRandomString(2);
return orderIdStart;
}
private static String getRandomString(int length) {
String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
Random random = new Random();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < length; i++) {
int number = random.nextInt(62);
sb.append(str.charAt(number));
}
return sb.toString().toUpperCase();
}
}

67
blade-biz-common/src/main/java/org/springblade/common/utils/TokenUtil.java

@ -0,0 +1,67 @@
package org.springblade.common.utils;
import com.alibaba.nacos.common.utils.MD5Utils;
import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;
import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
public class TokenUtil {
public static String token (String username,String password,String secrte){
String token = "";
try {
Date date = new Date();
//秘钥及加密算法
Algorithm algorithm = Algorithm.HMAC256(secrte);
//设置头部信息
Map<String,Object> header = new HashMap<>();
header.put("typ","JWT");
header.put("alg","HS256");
//携带username,password信息,生成签名
token = JWT.create()
.withHeader(header)
.withClaim("username",username)
.withClaim("password",password)
.withClaim("createtimestamp",date.getTime())
.sign(algorithm);
}catch (Exception e){
e.printStackTrace();
return null;
}
return token;
}
// public static boolean verify(String token){
// /**
// * @desc 验证token,通过返回true
// * @params [token]需要校验的串
// **/
// try {
// Algorithm algorithm = Algorithm.HMAC256(TOKEN_SECRET);
// JWTVerifier verifier = JWT.require(algorithm).build();
// DecodedJWT jwt = verifier.verify(token);
// return true;
// }catch (Exception e){
// e.printStackTrace();
// return false;
// }
// }
public static void main(String[] args) throws NoSuchAlgorithmException {
// String username ="zhangsan";
// String password = "123";
// String token = token(username,password,"23123123");
// System.out.println(token);
// boolean b = verify("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXNzd22yZCI6IjEyMyIsImV4cCI6MTU3ODE5NzQxMywidXNlcm5hbWUiOiJ6aGFuZ3NhbiJ9.IyTZT0tISQQZhGhsNuaqHGV8LD7idjUYjn3MGbulmJg");
// System.out.println(b);
String s = MD5Utils.encodeHexString("123456".getBytes(StandardCharsets.UTF_8));
s = MD5Utils.md5Hex("123456".getBytes(StandardCharsets.UTF_8));
System.out.println(s);
}
}

5
blade-service/logpm-factory/pom.xml

@ -75,6 +75,11 @@
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
</dependency>
<!--mq-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-amqp</artifactId>-->
<!-- </dependency>-->
</dependencies>
<build>

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/FactoryApplication.java

@ -29,7 +29,7 @@ import org.springblade.core.launch.BladeApplication;
public class FactoryApplication {
public static void main(String[] args) {
BladeApplication.run(ModuleNameConstant.APPLICATION_FACTORY_NAME, FactoryApplication.class, args);
BladeApplication.run(ModuleNameConstant.APPLICATION_FACTORY_NAME+"-zhy", FactoryApplication.class, args);
}
}

25
blade-service/logpm-factory/src/main/java/com/logpm/factory/config/InterceptorAdapterConfig.java

@ -0,0 +1,25 @@
package com.logpm.factory.config;
import com.logpm.factory.interceptor.FactoryAccountsInterceptor;
import com.logpm.factory.snm.service.IFactoryTokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class InterceptorAdapterConfig implements WebMvcConfigurer {
@Autowired
IFactoryTokenService factoryTokenService;
@Override
public void addInterceptors(InterceptorRegistry interceptorRegistry) {
InterceptorRegistration registry = interceptorRegistry.addInterceptor(new FactoryAccountsInterceptor(factoryTokenService));
registry.addPathPatterns("/factory/**").
excludePathPatterns("/factory/auth/token")
.excludePathPatterns("/factory/**/sendOrders")
.excludePathPatterns("/factory/**/sendOrderStatus");
}
}

53
blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java

@ -0,0 +1,53 @@
package com.logpm.factory.config;
/**
* RabbitMQ配置主要是配置队列如果提前存在该队列可以省略本配置类
*
* @author yangkai.shen
*/
//@Slf4j
//@Configuration(proxyBeanMethods = false)
public class RabbitMqConfiguration {
// @Bean
// public RabbitTemplate rabbitTemplate() {
// CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
// connectionFactory.setPublisherConfirms(true);
// connectionFactory.setPublisherReturns(true);
// RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory);
// rabbitTemplate.setMandatory(true);
// rabbitTemplate.setConfirmCallback((correlationData, ack, cause) -> log.info("消息发送成功:correlationData({}),ack({}),cause({})", correlationData, ack, cause));
// rabbitTemplate.setReturnCallback((message, replyCode, replyText, exchange, routingKey) -> log.info("消息丢失:exchange({}),route({}),replyCode({}),replyText({}),message:{}", exchange, routingKey, replyCode, replyText, message));
// return rabbitTemplate;
// }
/**
* 延迟队列
*/
// @Bean
// public Queue delayQueue() {
// return new Queue(RabbitConstant.DIRECT_MODE_QUEUE_ONE, true);
// }
/**
* 延迟队列交换器, x-delayed-type x-delayed-message 固定
*/
// @Bean
// public CustomExchange delayExchange() {
// Map<String, Object> args = Maps.newHashMap();
// args.put("x-delayed-type", "direct");
// return new CustomExchange("TestDirectExchange", "x-delayed-message", true, false, args);
// }
/**
* 延迟队列绑定自定义交换器
*
* @param delayQueue 队列
* @param delayExchange 延迟交换器
*/
// @Bean
// public Binding delayBinding(Queue delayQueue, CustomExchange delayExchange) {
// return BindingBuilder.bind(delayQueue).to(delayExchange).with("TestDirectRouting").noargs();
// }
}

67
blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RequestWrapper.java

@ -0,0 +1,67 @@
package com.logpm.factory.config;
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.io.*;
public class RequestWrapper extends HttpServletRequestWrapper {
private final String body;
public RequestWrapper(HttpServletRequest request) throws IOException {
super(request);
StringBuilder stringBuilder = new StringBuilder();
BufferedReader bufferedReader = null;
try {
InputStream inputStream = request.getInputStream();
if (inputStream != null) {
bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
char[] charBuffer = new char[128];
int bytesRead = -1;
while ((bytesRead = bufferedReader.read(charBuffer)) > 0) {
stringBuilder.append(charBuffer, 0, bytesRead);
}
} else {
stringBuilder.append("");
}
} catch (IOException ex) {
throw ex;
} finally {
if (bufferedReader != null) {
try {
bufferedReader.close();
} catch (IOException ex) {
throw ex;
}
}
}
body = stringBuilder.toString();
}
@Override
public ServletInputStream getInputStream() throws IOException {
final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(body.getBytes());
ServletInputStream servletInputStream = new ServletInputStream() {
public boolean isFinished() {
return false;
}
public boolean isReady() {
return false;
}
public void setReadListener(ReadListener readListener) {}
public int read() throws IOException {
return byteArrayInputStream.read();
}
};
return servletInputStream;
}
@Override
public BufferedReader getReader() throws IOException {
return new BufferedReader(new InputStreamReader(this.getInputStream()));
}
public String getBody() {
return this.body;
}
}

29
blade-service/logpm-factory/src/main/java/com/logpm/factory/filer/HttpServletFilter.java

@ -0,0 +1,29 @@
package com.logpm.factory.filer;
import com.logpm.factory.config.RequestWrapper;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
@WebFilter(urlPatterns = "/*")
public class HttpServletFilter implements Filter {
public void init(FilterConfig filterConfig) throws ServletException {
}
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
ServletRequest requestWrapper = null;
if(request instanceof HttpServletRequest) {
requestWrapper = new RequestWrapper((HttpServletRequest) request);
}
if(requestWrapper == null) {
chain.doFilter(request, response);
} else {
chain.doFilter(requestWrapper, response);
}
}
public void destroy() {
}
}

86
blade-service/logpm-factory/src/main/java/com/logpm/factory/interceptor/FactoryAccountsInterceptor.java

@ -0,0 +1,86 @@
package com.logpm.factory.interceptor;
import com.alibaba.fastjson.JSONObject;
import com.logpm.factory.config.RequestWrapper;
import com.logpm.factory.snm.service.IFactoryTokenService;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
@Log4j2
@AllArgsConstructor
public class FactoryAccountsInterceptor implements HandlerInterceptor {
private final IFactoryTokenService factoryTokenService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws CustomerException {
try {
RequestWrapper myRequestWrapper = new RequestWrapper(request);
String body = myRequestWrapper.getBody();
JSONObject jsonObject = JSONObject.parseObject(body);
//获取头中参数
String token = request.getHeader("Authorization");
String corpId = request.getHeader("corpid");
if(StringUtil.isBlank(corpId)){
corpId = jsonObject.getString("corpid");
}
if(!StringUtil.hasLength(token)){
returnJson(response,JSONObject.toJSONString(R.fail(203,"认证不通过,token有误")));
return false;
}
if(!StringUtil.hasLength(corpId)){
returnJson(response,JSONObject.toJSONString(R.fail(203,"认证不通过,corpId有误")));
return false;
}
log.info("##########preHandle: token={}",token);
//验证token
boolean b = factoryTokenService.verifyToken(token,corpId);
if(!b){
returnJson(response,JSONObject.toJSONString(R.fail(203,"认证不通过,token不存在或已过期")));
return false;
}
return true;
} catch (Exception e) {
returnJson(response,JSONObject.toJSONString(R.fail(500,"服务异常,请联系管理员")));
return false;
}
}
private void returnJson(HttpServletResponse response, String json) {
PrintWriter writer = null;
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
try {
writer = response.getWriter();
writer.print(json);
} catch (IOException e) {
System.out.println(e.getMessage());
} finally {
if (writer != null)
writer.close();
}
}
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
HandlerInterceptor.super.postHandle(request, response, handler, modelAndView);
}
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
HandlerInterceptor.super.afterCompletion(request, response, handler, ex);
}
}

20
blade-service/logpm-factory/src/main/java/com/logpm/factory/props/PanFactoryProperties.java

@ -0,0 +1,20 @@
package com.logpm.factory.props;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Data
@ConfigurationProperties(prefix = "pan")
@Component
public class PanFactoryProperties {
private String url;
private String clientId;
private String clientSecret;
private String grantType;
}

30
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DirectQueueOneHandler.java

@ -0,0 +1,30 @@
package com.logpm.factory.receiver;
/**
* 直接队列1 处理器
*
* @author yangkai.shen
*/
//@Slf4j
//@RabbitListener(queues = RabbitConstant.DIRECT_MODE_QUEUE_ONE)
//@Component
public class DirectQueueOneHandler {
// @RabbitHandler
// public void directHandlerManualAck(PanFactoryOrderDTO factoryOrderDTO, Message message, Channel channel) {
// // 如果手动ACK,消息会被监听消费,但是消息在队列中依旧存在,如果 未配置 acknowledge-mode 默认是会在消费完毕后自动ACK掉
// final long deliveryTag = message.getMessageProperties().getDeliveryTag();
// try {
// log.info("直接队列1,手动ACK,接收消息:{}", factoryOrderDTO);
// //通知 MQ 消息已被成功消费,可以ACK了
// channel.basicAck(deliveryTag, false);
// } catch (IOException e) {
// try {
// // 处理失败,重新压入MQ
// channel.basicRecover();
// } catch (IOException e1) {
// e1.printStackTrace();
// }
// }
// }
}

23
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/bean/MessageStruct.java

@ -0,0 +1,23 @@
package com.logpm.factory.snm.bean;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* 测试消息体
*
* @author yangkai.shen
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MessageStruct implements Serializable {
private static final long serialVersionUID = 392365881428311040L;
private String message;
}

19
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/bean/Resp.java

@ -0,0 +1,19 @@
package com.logpm.factory.snm.bean;
import lombok.Data;
import org.springblade.core.tool.api.R;
@Data
public class Resp extends R {
private String orderNo;
public static Resp successOrderNo(String orderNo,String msg){
Resp resp = new Resp();
resp.setMsg(msg);
resp.setCode(1);
resp.setSuccess(true);
resp.setOrderNo(orderNo);
return resp;
}
}

77
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/controller/FactoryAuthController.java

@ -0,0 +1,77 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factory.snm.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.factory.snm.dto.FactoryAccountDTO;
import com.logpm.factory.snm.service.IFactoryAuthService;
import com.logpm.factory.snm.service.IPanFactoryDataService;
import com.logpm.factory.snm.vo.FactoryTokenVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
/**
* 皮阿诺数据 控制器
*
* @author zhy
* @since 2023-06-06
*/
@Log4j2
@RestController
@AllArgsConstructor
@RequestMapping("/factory/auth")
@Api(value = "工厂授权数据", tags = "工厂授权接口")
public class FactoryAuthController extends BladeController {
private final IFactoryAuthService factoryAuthService;
@ResponseBody
@PostMapping("/token")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "获取token推送", notes = "传入factoryAccountDTO")
public R token(@Validated @RequestBody FactoryAccountDTO factoryAccountDTO, HttpServletResponse response) {
log.info("############token: 获取账号token");
//通过企业id 应用id 秘钥 获取对应的token
String corpid = factoryAccountDTO.getCorpid();//企业id
String appkey = factoryAccountDTO.getAppkey();//应用id
String appsecret = factoryAccountDTO.getAppsecret();//秘钥
try{
FactoryTokenVO factoryTokenVO = factoryAuthService.getToken(corpid,appkey,appsecret);
String token = factoryTokenVO.getToken();
//把token放入头
response.setHeader("Authorization",token);
return R.data(factoryTokenVO);
}catch (CustomerException e){
log.error(e.getMessage(),e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(e.getMessage(),e);
return R.fail(400,e.getMessage());
}
}
}

173
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/controller/PanFactoryDataController.java

@ -0,0 +1,173 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factory.snm.controller;
import cn.hutool.core.bean.BeanUtil;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.factory.snm.bean.Resp;
import com.logpm.factory.snm.dto.*;
import com.logpm.factory.snm.entity.PanFactoryOrder;
import com.logpm.factory.snm.entity.PanPackageInfo;
import com.logpm.factory.snm.entity.PanPackageList;
import com.logpm.factory.snm.service.IPanFactoryDataService;
import com.logpm.factory.snm.service.IPanFactoryOrderService;
import com.logpm.factory.snm.service.IPanPackageInfoService;
import com.logpm.factory.snm.service.IPanPackageListService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
/**
* 皮阿诺数据 控制器
*
* @author zhy
* @since 2023-06-06
*/
@Log4j2
@RestController
@AllArgsConstructor
@RequestMapping("/factory/pan")
@Api(value = "工厂数据", tags = "工厂数据接口")
public class PanFactoryDataController extends BladeController {
private final IPanFactoryOrderService factoryOrderService;
private final IPanPackageInfoService packageInfoService;
private final IPanPackageListService packageListService;
private final IPanFactoryDataService factoryDataService;
// @ResponseBody
// @PostMapping("/token")
// @ApiOperationSupport(order = 1)
// @ApiOperation(value = "获取token推送", notes = "传入factoryAccountDTO")
// public R token(@Validated @RequestBody FactoryAccountDTO factoryAccountDTO, HttpServletResponse response) {
// log.info("############token: 获取账号token");
// //通过企业id 应用id 秘钥 获取对应的token
// String corpid = factoryAccountDTO.getCorpid();//企业id
// String appkey = factoryAccountDTO.getAppkey();//应用id
// String appsecret = factoryAccountDTO.getAppsecret();//秘钥
//
// try{
// FactoryTokenVO factoryTokenVO = factoryDataService.getToken(corpid,appkey,appsecret);
// String token = factoryTokenVO.getToken();
// //把token放入头
// response.setHeader("Authorization",token);
// return R.data(factoryTokenVO);
// }catch (CustomerException e){
// log.error(e.getMessage(),e);
// return R.fail(e.code,e.message);
// }catch (Exception e){
// log.error(e.getMessage(),e);
// return R.fail(400,e.getMessage());
// }
// }
/**
* 工厂数据推送接口
*/
@ResponseBody
@PostMapping("/data")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "通常数据推送", notes = "传入factoryOrderDTO")
public Resp data(@Validated @RequestBody PanFactoryOrderDTO factoryOrderDTO, HttpServletRequest request) {
log.info("############data: ");
String corpId = request.getHeader("corpId");
PanFactoryOrder factoryOrder = new PanFactoryOrder();
BeanUtil.copyProperties(factoryOrderDTO,factoryOrder);
factoryOrder.setCorpid(corpId);
//保存订单数据
factoryOrderService.save(factoryOrder);
List<PanPackageInfoDTO> packageInfos = factoryOrderDTO.getORDER_ATTRIBUTES();
for (PanPackageInfoDTO dto:packageInfos){
PanPackageInfo packageInfo = new PanPackageInfo();
BeanUtil.copyProperties(dto,packageInfo);
packageInfo.setOrderId(factoryOrder.getId());
//保存包件信息数据
//因为需要先保存包件明细需要包件的id
packageInfoService.save(packageInfo);
//再存入包件明细
List<PanPackageList> PanPackagelist = new ArrayList<>();
List<PanPackageListDTO> order_attributes_line = dto.getORDER_ATTRIBUTES_LINE();
for (PanPackageListDTO panPackageListDTO:order_attributes_line){
PanPackageList panPackageList = new PanPackageList();
BeanUtil.copyProperties(panPackageListDTO,panPackageList);
panPackageList.setPackageId(packageInfo.getId());
PanPackagelist.add(panPackageList);
}
packageListService.saveBatch(PanPackagelist);
}
return Resp.successOrderNo(factoryOrder.getOrderNo(),"SUCCESS");
}
@ResponseBody
@PostMapping("/sendOrders")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "订单数据推送", notes = "传入orderInfoDTO")
public R sendOrders(@Validated @RequestBody OrderInfoDTO orderInfoDTO) {
log.info("############sendOrders: ");
try{
factoryDataService.handleData(orderInfoDTO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrders: 系统异常",e);
return R.fail(500,"############sendOrders: 系统异常");
}
return R.success("SUCCESS");
}
@ResponseBody
@PostMapping("/sendOrderStatus")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "订单状态推送", notes = "传入orderInfoDTO")
public R sendOrderStatus(@RequestBody OrderStatusDTO orderStatusDTO) {
log.info("############sendOrderStatus: ");
try{
factoryDataService.handleStatusData(orderStatusDTO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrderStatus: 系统异常",e);
return R.fail(500,"############sendOrderStatus: 系统异常");
}
return Resp.success("SUCCESS");
}
}

9
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/FactoryAccountDTO.java

@ -0,0 +1,9 @@
package com.logpm.factory.snm.dto;
import com.logpm.factory.snm.entity.FactoryAccount;
import lombok.Data;
@Data
public class FactoryAccountDTO extends FactoryAccount {
}

23
blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/vo/BasicTeamGroupVO.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/OrderInfoDTO.java

@ -14,26 +14,27 @@
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basic.vo;
package com.logpm.factory.snm.dto;
import com.logpm.basic.entity.BasicTeamGroupEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.ArrayList;
import java.util.List;
import javax.validation.constraints.NotEmpty;
/**
* 基础班组表 视图实体类
* PHP传过来的OrderInfo
*
* @author BladeX
* @since 2023-05-25
* @author zhy
* @since 2023-06-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class BasicTeamGroupVO extends BasicTeamGroupEntity {
public class OrderInfoDTO {
private static final long serialVersionUID = 1L;
private List<BasicTeamStaffVO> staffs = new ArrayList<>();
@NotEmpty(message = "客户订单号不能为空")
private String orderNo;//客户订单号
private String loadingList;//WMS装车清单号
@NotEmpty(message = "物流单号不能为空")
private String logiBillNo;//物流单号
}

57
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/OrderStatusDTO.java

@ -0,0 +1,57 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factory.snm.dto;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
/**
* OrderStatus
*
* @author zhy
* @since 2023-06-12
*/
@Data
public class OrderStatusDTO {
private static final long serialVersionUID = 1L;
@NotEmpty(message = "派车单号不能为空")
private String dispatchNumber;//派车单号
@NotEmpty(message = "客户订单号不能为空")
private String orderNo;//客户订单号
@NotEmpty(message = "物流单号不能为空")
private String logiBillNo;//物流单号
@NotEmpty(message = "包件码不能为空")
private String unitNo;//包件码
@NotEmpty(message = "操作时间不能为空")
private String operationTime;//操作时间
@NotEmpty(message = "当前仓库不能为空")
private String currentWarehouse;//当前仓库
@NotEmpty(message = "目的仓库")
private String destinationWarehouse;//目的仓库
@NotEmpty(message = "状态")
private String status;//状态
}

20
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/PanFactoryOrderDTO.java

@ -0,0 +1,20 @@
package com.logpm.factory.snm.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.logpm.factory.snm.entity.PanFactoryOrder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
public class PanFactoryOrderDTO extends PanFactoryOrder {
@Valid
@JsonProperty("ORDER_ATTRIBUTES")
private List<PanPackageInfoDTO> ORDER_ATTRIBUTES = new ArrayList<>();
}

20
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/PanPackageInfoDTO.java

@ -0,0 +1,20 @@
package com.logpm.factory.snm.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.logpm.factory.snm.entity.PanPackageInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
public class PanPackageInfoDTO extends PanPackageInfo {
@Valid
@JsonProperty("ORDER_ATTRIBUTES_LINE")
private List<PanPackageListDTO> ORDER_ATTRIBUTES_LINE = new ArrayList<>();
}

6
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/PanPackageListDTO.java

@ -0,0 +1,6 @@
package com.logpm.factory.snm.dto;
import com.logpm.factory.snm.entity.PanPackageList;
public class PanPackageListDTO extends PanPackageList {
}

17
blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/vo/BasicTeamStaffVO.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryAccountMapper.java

@ -14,21 +14,18 @@
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basic.vo;
package com.logpm.factory.snm.mapper;
import com.logpm.basic.entity.BasicTeamStaffEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.snm.entity.FactoryAccount;
/**
* 班组人员表 视图实体类
* 工厂账号接口日志 Mapper 接口
*
* @author zhy
* @since 2023-05-29
* @since 2023-03-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class BasicTeamStaffVO extends BasicTeamStaffEntity {
private static final long serialVersionUID = 1L;
public interface FactoryAccountMapper extends BaseMapper<FactoryAccount> {
}

20
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryAccountMapper.xml

@ -0,0 +1,20 @@
<?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.logpm.factory.snm.mapper.FactoryAccountMapper">
<!-- 通用查询映射结果 -->
<!-- <resultMap id="orderLogResultMap" type="com.logpm.factory.snm.entity.FactoryOrder">-->
<!-- <result column="id" property="id"/>-->
<!-- <result column="req_args" property="reqArgs"/>-->
<!-- <result column="res_body" property="resBody"/>-->
<!-- <result column="type" property="type"/>-->
<!-- <result column="create_user" property="createUser"/>-->
<!-- <result column="create_time" property="createTime"/>-->
<!-- <result column="update_user" property="updateUser"/>-->
<!-- <result column="update_time" property="updateTime"/>-->
<!-- <result column="status" property="status"/>-->
<!-- <result column="is_deleted" property="isDeleted"/>-->
<!-- <result column="create_dept" property="createDept"/>-->
<!-- </resultMap>-->
</mapper>

17
blade-service/logpm-basic/src/main/java/com/logpm/basic/dto/BasicTeamStaffDTO.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryTokenMapper.java

@ -14,21 +14,18 @@
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basic.dto;
package com.logpm.factory.snm.mapper;
import com.logpm.basic.entity.BasicTeamStaffEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.snm.entity.FactoryToken;
/**
* 班组人员表 数据传输对象实体类
* 工厂账号接口日志 Mapper 接口
*
* @author zhy
* @since 2023-05-29
* @since 2023-03-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class BasicTeamStaffDTO extends BasicTeamStaffEntity {
private static final long serialVersionUID = 1L;
public interface FactoryTokenMapper extends BaseMapper<FactoryToken> {
}

20
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryTokenMapper.xml

@ -0,0 +1,20 @@
<?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.logpm.factory.snm.mapper.FactoryTokenMapper">
<!-- 通用查询映射结果 -->
<!-- <resultMap id="orderLogResultMap" type="com.logpm.factory.snm.entity.FactoryOrder">-->
<!-- <result column="id" property="id"/>-->
<!-- <result column="req_args" property="reqArgs"/>-->
<!-- <result column="res_body" property="resBody"/>-->
<!-- <result column="type" property="type"/>-->
<!-- <result column="create_user" property="createUser"/>-->
<!-- <result column="create_time" property="createTime"/>-->
<!-- <result column="update_user" property="updateUser"/>-->
<!-- <result column="update_time" property="updateTime"/>-->
<!-- <result column="status" property="status"/>-->
<!-- <result column="is_deleted" property="isDeleted"/>-->
<!-- <result column="create_dept" property="createDept"/>-->
<!-- </resultMap>-->
</mapper>

19
blade-service/logpm-basic/src/main/java/com/logpm/basic/dto/BasicTeamGroupDTO.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanFactoryOrderMapper.java

@ -14,21 +14,18 @@
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basic.dto;
package com.logpm.factory.snm.mapper;
import com.logpm.basic.entity.BasicTeamGroupEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.snm.entity.PanFactoryOrder;
/**
* 基础班组表 数据传输对象实体类
* 工厂推送数据接口日志 Mapper 接口
*
* @author BladeX
* @since 2023-05-25
* @author zhy
* @since 2023-03-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class BasicTeamGroupDTO extends BasicTeamGroupEntity {
private static final long serialVersionUID = 1L;
public interface PanFactoryOrderMapper extends BaseMapper<PanFactoryOrder> {
}

20
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanFactoryOrderMapper.xml

@ -0,0 +1,20 @@
<?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.logpm.factory.snm.mapper.PanFactoryOrderMapper">
<!-- 通用查询映射结果 -->
<!-- <resultMap id="orderLogResultMap" type="com.logpm.factory.snm.entity.FactoryOrder">-->
<!-- <result column="id" property="id"/>-->
<!-- <result column="req_args" property="reqArgs"/>-->
<!-- <result column="res_body" property="resBody"/>-->
<!-- <result column="type" property="type"/>-->
<!-- <result column="create_user" property="createUser"/>-->
<!-- <result column="create_time" property="createTime"/>-->
<!-- <result column="update_user" property="updateUser"/>-->
<!-- <result column="update_time" property="updateTime"/>-->
<!-- <result column="status" property="status"/>-->
<!-- <result column="is_deleted" property="isDeleted"/>-->
<!-- <result column="create_dept" property="createDept"/>-->
<!-- </resultMap>-->
</mapper>

31
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanOrderStatusLogMapper.java

@ -0,0 +1,31 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factory.snm.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.snm.entity.PanOrderStatusLog;
/**
* 工厂推送数据接口日志 Mapper 接口
*
* @author zhy
* @since 2023-03-28
*/
public interface PanOrderStatusLogMapper extends BaseMapper<PanOrderStatusLog> {
}

20
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanOrderStatusLogMapper.xml

@ -0,0 +1,20 @@
<?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.logpm.factory.snm.mapper.PanOrderStatusLogMapper">
<!-- 通用查询映射结果 -->
<!-- <resultMap id="orderLogResultMap" type="com.logpm.factory.snm.entity.FactoryOrder">-->
<!-- <result column="id" property="id"/>-->
<!-- <result column="req_args" property="reqArgs"/>-->
<!-- <result column="res_body" property="resBody"/>-->
<!-- <result column="type" property="type"/>-->
<!-- <result column="create_user" property="createUser"/>-->
<!-- <result column="create_time" property="createTime"/>-->
<!-- <result column="update_user" property="updateUser"/>-->
<!-- <result column="update_time" property="updateTime"/>-->
<!-- <result column="status" property="status"/>-->
<!-- <result column="is_deleted" property="isDeleted"/>-->
<!-- <result column="create_dept" property="createDept"/>-->
<!-- </resultMap>-->
</mapper>

31
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageInfoMapper.java

@ -0,0 +1,31 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factory.snm.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.snm.entity.PanPackageInfo;
/**
* 工厂推送数据接口日志 Mapper 接口
*
* @author zhy
* @since 2023-03-28
*/
public interface PanPackageInfoMapper extends BaseMapper<PanPackageInfo> {
}

20
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageInfoMapper.xml

@ -0,0 +1,20 @@
<?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.logpm.factory.snm.mapper.PanPackageInfoMapper">
<!-- 通用查询映射结果 -->
<!-- <resultMap id="orderLogResultMap" type="com.logpm.factory.snm.entity.FactoryOrder">-->
<!-- <result column="id" property="id"/>-->
<!-- <result column="req_args" property="reqArgs"/>-->
<!-- <result column="res_body" property="resBody"/>-->
<!-- <result column="type" property="type"/>-->
<!-- <result column="create_user" property="createUser"/>-->
<!-- <result column="create_time" property="createTime"/>-->
<!-- <result column="update_user" property="updateUser"/>-->
<!-- <result column="update_time" property="updateTime"/>-->
<!-- <result column="status" property="status"/>-->
<!-- <result column="is_deleted" property="isDeleted"/>-->
<!-- <result column="create_dept" property="createDept"/>-->
<!-- </resultMap>-->
</mapper>

31
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageListMapper.java

@ -0,0 +1,31 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factory.snm.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.snm.entity.PanPackageList;
/**
* 工厂推送数据接口日志 Mapper 接口
*
* @author zhy
* @since 2023-03-28
*/
public interface PanPackageListMapper extends BaseMapper<PanPackageList> {
}

20
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageListMapper.xml

@ -0,0 +1,20 @@
<?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.logpm.factory.snm.mapper.PanPackageListMapper">
<!-- 通用查询映射结果 -->
<!-- <resultMap id="orderLogResultMap" type="com.logpm.factory.snm.entity.FactoryOrder">-->
<!-- <result column="id" property="id"/>-->
<!-- <result column="req_args" property="reqArgs"/>-->
<!-- <result column="res_body" property="resBody"/>-->
<!-- <result column="type" property="type"/>-->
<!-- <result column="create_user" property="createUser"/>-->
<!-- <result column="create_time" property="createTime"/>-->
<!-- <result column="update_user" property="updateUser"/>-->
<!-- <result column="update_time" property="updateTime"/>-->
<!-- <result column="status" property="status"/>-->
<!-- <result column="is_deleted" property="isDeleted"/>-->
<!-- <result column="create_dept" property="createDept"/>-->
<!-- </resultMap>-->
</mapper>

12
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IFactoryAccountService.java

@ -0,0 +1,12 @@
package com.logpm.factory.snm.service;
import com.logpm.factory.snm.entity.FactoryAccount;
import org.springblade.core.mp.base.BaseService;
/**
* 工厂推送数据接口
*/
public interface IFactoryAccountService extends BaseService<FactoryAccount> {
}

11
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IFactoryAuthService.java

@ -0,0 +1,11 @@
package com.logpm.factory.snm.service;
import com.logpm.factory.snm.vo.FactoryTokenVO;
import java.security.NoSuchAlgorithmException;
public interface IFactoryAuthService {
FactoryTokenVO getToken(String corpId, String appKey, String appSecret) throws NoSuchAlgorithmException;
}

15
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IFactoryTokenService.java

@ -0,0 +1,15 @@
package com.logpm.factory.snm.service;
import com.logpm.factory.snm.entity.FactoryToken;
import org.springblade.core.mp.base.BaseService;
import java.security.NoSuchAlgorithmException;
/**
* 工厂推送数据接口
*/
public interface IFactoryTokenService extends BaseService<FactoryToken> {
boolean verifyToken(String token, String corpId) throws NoSuchAlgorithmException;
}

16
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanFactoryDataService.java

@ -0,0 +1,16 @@
package com.logpm.factory.snm.service;
import com.logpm.factory.snm.dto.OrderInfoDTO;
import com.logpm.factory.snm.dto.OrderStatusDTO;
/**
* 工厂推送数据接口
*/
public interface IPanFactoryDataService {
void handleData(OrderInfoDTO orderInfoDTO);
void handleStatusData(OrderStatusDTO orderStatusDTO);
}

12
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanFactoryOrderService.java

@ -0,0 +1,12 @@
package com.logpm.factory.snm.service;
import com.logpm.factory.snm.entity.PanFactoryOrder;
import org.springblade.core.mp.base.BaseService;
/**
* 工厂推送数据接口
*/
public interface IPanFactoryOrderService extends BaseService<PanFactoryOrder> {
}

8
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanOrderStatusLogService.java

@ -0,0 +1,8 @@
package com.logpm.factory.snm.service;
import com.logpm.factory.snm.entity.PanOrderStatusLog;
import org.springblade.core.mp.base.BaseService;
public interface IPanOrderStatusLogService extends BaseService<PanOrderStatusLog> {
}

12
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanPackageInfoService.java

@ -0,0 +1,12 @@
package com.logpm.factory.snm.service;
import com.logpm.factory.snm.entity.PanPackageInfo;
import org.springblade.core.mp.base.BaseService;
/**
* 工厂推送包件数据接口
*/
public interface IPanPackageInfoService extends BaseService<PanPackageInfo> {
}

7
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanPackageListService.java

@ -0,0 +1,7 @@
package com.logpm.factory.snm.service;
import com.logpm.factory.snm.entity.PanPackageList;
import org.springblade.core.mp.base.BaseService;
public interface IPanPackageListService extends BaseService<PanPackageList> {
}

19
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/FactoryAccountServiceImpl.java

@ -0,0 +1,19 @@
package com.logpm.factory.snm.service.impl;
import com.logpm.factory.snm.entity.FactoryAccount;
import com.logpm.factory.snm.mapper.FactoryAccountMapper;
import com.logpm.factory.snm.service.IFactoryAccountService;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@AllArgsConstructor
@Service
public class FactoryAccountServiceImpl extends BaseServiceImpl<FactoryAccountMapper, FactoryAccount> implements IFactoryAccountService {
private static final Logger logger = LoggerFactory.getLogger(FactoryAccountServiceImpl.class);
}

78
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/FactoryAuthServiceImpl.java

@ -0,0 +1,78 @@
package com.logpm.factory.snm.service.impl;
import com.alibaba.nacos.common.utils.MD5Utils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.factory.snm.entity.FactoryAccount;
import com.logpm.factory.snm.entity.FactoryToken;
import com.logpm.factory.snm.service.IFactoryAccountService;
import com.logpm.factory.snm.service.IFactoryAuthService;
import com.logpm.factory.snm.service.IFactoryTokenService;
import com.logpm.factory.snm.vo.FactoryTokenVO;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.TokenUtil;
import org.springframework.stereotype.Service;
import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
import java.util.Objects;
@AllArgsConstructor
@Service
public class FactoryAuthServiceImpl implements IFactoryAuthService {
private static final Logger logger = LoggerFactory.getLogger(FactoryAuthServiceImpl.class);
private final IFactoryAccountService factoryAccountService;
private final IFactoryTokenService factoryTokenService;
@Override
public FactoryTokenVO getToken(String corpId, String appKey, String appSecret) throws NoSuchAlgorithmException {
FactoryTokenVO factoryTokenVO = new FactoryTokenVO();
QueryWrapper<FactoryAccount> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("corpid",corpId)
.eq("appkey",appKey)
.eq("appsecret",appSecret);
FactoryAccount factoryAccount = factoryAccountService.getOne(queryWrapper);
if(Objects.isNull(factoryAccount)){
logger.warn("未存在对应账户corpid={},appkey={},appsecret={}",corpId,appKey,appSecret);
throw new CustomerException(400,"未存在对应账户,请联系管理员");
}
//生成token
String token = TokenUtil.token(corpId, appKey, appSecret);
//生成token摘要
String tokenAbst = MD5Utils.md5Hex(token.getBytes(StandardCharsets.UTF_8));
//过期时间生成
LocalDateTime start = LocalDateTime.now();
LocalDateTime end = start.plusMinutes(30);
Date date = Date.from( end.atZone( ZoneId.systemDefault()).toInstant());
//查询是否有当前账户的token数据
QueryWrapper<FactoryToken> queryTokenWrapper = new QueryWrapper<>();
queryWrapper.eq("corpid",corpId);
FactoryToken factoryToken = factoryTokenService.getOne(queryTokenWrapper);
if(Objects.isNull(factoryToken)){
factoryToken = new FactoryToken();
}
//保存新的token
factoryToken.setToken(token);
factoryToken.setTokenAbst(tokenAbst);
factoryToken.setCorpid(corpId);
factoryToken.setExpireTime(date);
factoryTokenService.saveOrUpdate(factoryToken);
factoryTokenVO.setToken(token);
factoryTokenVO.setExpireTime(date);
factoryTokenVO.setExpireTimeLong(date.getTime());
return factoryTokenVO;
}
}

49
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/FactoryTokenServiceImpl.java

@ -0,0 +1,49 @@
package com.logpm.factory.snm.service.impl;
import com.alibaba.nacos.common.utils.MD5Utils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.factory.snm.entity.FactoryToken;
import com.logpm.factory.snm.mapper.FactoryTokenMapper;
import com.logpm.factory.snm.service.IFactoryTokenService;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException;
import java.util.Date;
import java.util.Objects;
@AllArgsConstructor
@Service
public class FactoryTokenServiceImpl extends BaseServiceImpl<FactoryTokenMapper, FactoryToken> implements IFactoryTokenService {
private static final Logger logger = LoggerFactory.getLogger(FactoryTokenServiceImpl.class);
@Override
public boolean verifyToken(String token, String corpId) throws NoSuchAlgorithmException {
logger.info("#########verifyToken: 验证token开始");
//先生成token摘要
String tokenAbst = MD5Utils.md5Hex(token.getBytes(StandardCharsets.UTF_8));
//编写查询条件
QueryWrapper<FactoryToken> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("token_abst",tokenAbst)
.eq("corpid",corpId);
FactoryToken factoryToken = baseMapper.selectOne(queryWrapper);
if(Objects.isNull(factoryToken)){
logger.warn("#########verifyToken: token验证不通过 token={},corpid={}",token,corpId);
return false;
}
Long expireTimeLong = factoryToken.getExpireTime().getTime();
Long now = new Date().getTime();
//判断是否过期
if(now > expireTimeLong){
logger.warn("#########verifyToken: token验证不通过 已过期 token={},corpId={}",token,corpId);
return false;
}
return true;
}
}

166
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanFactoryDataServiceImpl.java

@ -0,0 +1,166 @@
package com.logpm.factory.snm.service.impl;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.factory.props.PanFactoryProperties;
import com.logpm.factory.snm.dto.OrderInfoDTO;
import com.logpm.factory.snm.dto.OrderStatusDTO;
import com.logpm.factory.snm.entity.PanFactoryOrder;
import com.logpm.factory.snm.entity.PanOrderStatusLog;
import com.logpm.factory.snm.service.*;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@AllArgsConstructor
@Service
public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
private static final Logger logger = LoggerFactory.getLogger(PanFactoryDataServiceImpl.class);
// private final IFactoryAccountService factoryAccountService;
// private final IFactoryTokenService factoryTokenService;
private final IPanFactoryOrderService factoryOrderService;
private final PanFactoryProperties panFactoryProperties;
private final IPanOrderStatusLogService panOrderStatusLogService;
// @Override
// public FactoryTokenVO getToken(String corpId, String appKey, String appSecret) throws NoSuchAlgorithmException {
//
// FactoryTokenVO factoryTokenVO = new FactoryTokenVO();
// QueryWrapper<FactoryAccount> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("corpid",corpId)
// .eq("appkey",appKey)
// .eq("appsecret",appSecret);
// FactoryAccount factoryAccount = factoryAccountService.getOne(queryWrapper);
// if(Objects.isNull(factoryAccount)){
// logger.warn("未存在对应账户corpid={},appkey={},appsecret={}",corpId,appKey,appSecret);
// throw new CustomerException(400,"未存在对应账户,请联系管理员");
// }
//
// //生成token
// String token = TokenUtil.token(corpId, appKey, appSecret);
// //生成token摘要
// String tokenAbst = MD5Utils.md5Hex(token.getBytes(StandardCharsets.UTF_8));
// //过期时间生成
// LocalDateTime start = LocalDateTime.now();
// LocalDateTime end = start.plusMinutes(30);
// Date date = Date.from( end.atZone( ZoneId.systemDefault()).toInstant());
//
// //查询是否有当前账户的token数据
// QueryWrapper<FactoryToken> queryTokenWrapper = new QueryWrapper<>();
// queryWrapper.eq("corpid",corpId);
// FactoryToken factoryToken = factoryTokenService.getOne(queryTokenWrapper);
// if(Objects.isNull(factoryToken)){
// factoryToken = new FactoryToken();
// }
// //保存新的token
// factoryToken.setToken(token);
// factoryToken.setTokenAbst(tokenAbst);
// factoryToken.setCorpid(corpId);
// factoryToken.setExpireTime(date);
// factoryTokenService.saveOrUpdate(factoryToken);
//
// factoryTokenVO.setToken(token);
// factoryTokenVO.setExpireTime(date);
// factoryTokenVO.setExpireTimeLong(date.getTime());
// return factoryTokenVO;
// }
@Transactional(rollbackFor = Exception.class)
@Override
public void handleData(OrderInfoDTO orderInfoDTO) {
//根据客户订单号去查询WMS装车清单号
QueryWrapper<PanFactoryOrder> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("order_no",orderInfoDTO.getOrderNo());
PanFactoryOrder panFactoryOrder = factoryOrderService.getOne(queryWrapper);
String loadingList = panFactoryOrder.getLoadingList();//装车清单编号
orderInfoDTO.setLoadingList(loadingList);
//推送到皮阿诺系统
String url = "";
// String result = HttpRequest.post(url+"/oauth/oauth/token").form(map).timeout(5 * 1000).execute().body();
}
@Override
public void handleStatusData(OrderStatusDTO orderStatusDTO) {
//先保存原始请求数据
PanOrderStatusLog panOrderStatusLog = new PanOrderStatusLog();
panOrderStatusLog.setArgs(JSONObject.toJSONString(orderStatusDTO));
panOrderStatusLog.setStatus(1);
panOrderStatusLogService.save(panOrderStatusLog);
//拼接参数
Map<String,Object> map = new HashMap<>();
map.put("payload",JSONObject.toJSONString(orderStatusDTO));
//先获取token
String panToken = getPanToken();
//处理逻辑
String result = HttpRequest.post(panFactoryProperties.getUrl()+"/hitf/v1/rest/invoke?namespace=HZERO&serverCode=OPEN&interfaceCode=HUITONG_RECEIVE")
.header("Authorization","Bearer "+panToken)
// .header("Content-Type","application/json")
.form(map).timeout(5 * 1000)
.execute()
.body();
logger.info("##############handleStatusData: 推送包件状态返回参数 {}",result);
//把结果字符串转为json对象
JSONObject jsonObject = JSONObject.parseObject(result);
JSONObject payload = jsonObject.getJSONObject("payload");
if(!Objects.isNull(payload)){
Integer code = payload.getInteger("code");
String message = payload.getString("data");
if(code.equals(1)){
logger.info("##########handleStatusData: 物流状态传递成功");
panOrderStatusLog.setStatus(0);
panOrderStatusLogService.saveOrUpdate(panOrderStatusLog);
}else{
throw new CustomerException(400,message);
}
}else{
throw new CustomerException(400,"返回格式有误:"+result);
}
}
private String getPanToken(){
Map<String,Object> map = new HashMap<>();
map.put("client_id",panFactoryProperties.getClientId());
map.put("client_secret",panFactoryProperties.getClientSecret());
map.put("grant_type",panFactoryProperties.getGrantType());
String result = HttpRequest.post(panFactoryProperties.getUrl()+"/oauth/oauth/token")
.header("Content-Type","application/x-www-form-urlencoded")
.form(map).timeout(5 * 1000)
.execute()
.body();
logger.info("##############getPanToken: 获取皮阿诺token返回参数 {}",result);
//获取的结果转成json对象
JSONObject jsonObject = JSONObject.parseObject(result);
String access_token = jsonObject.getString("access_token");
if(StringUtil.hasLength(access_token)){
return access_token;
}else{
throw new CustomerException(402,"获取皮阿诺token失败");
}
}
}

19
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanFactoryOrderServiceImpl.java

@ -0,0 +1,19 @@
package com.logpm.factory.snm.service.impl;
import com.logpm.factory.snm.entity.PanFactoryOrder;
import com.logpm.factory.snm.mapper.PanFactoryOrderMapper;
import com.logpm.factory.snm.service.IPanFactoryOrderService;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@AllArgsConstructor
@Service
public class PanFactoryOrderServiceImpl extends BaseServiceImpl<PanFactoryOrderMapper, PanFactoryOrder> implements IPanFactoryOrderService {
private static final Logger logger = LoggerFactory.getLogger(PanFactoryOrderServiceImpl.class);
}

19
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanOrderStatusLogServiceImpl.java

@ -0,0 +1,19 @@
package com.logpm.factory.snm.service.impl;
import com.logpm.factory.snm.entity.PanOrderStatusLog;
import com.logpm.factory.snm.mapper.PanOrderStatusLogMapper;
import com.logpm.factory.snm.service.IPanOrderStatusLogService;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@AllArgsConstructor
@Service
public class PanOrderStatusLogServiceImpl extends BaseServiceImpl<PanOrderStatusLogMapper, PanOrderStatusLog> implements IPanOrderStatusLogService {
private static final Logger logger = LoggerFactory.getLogger(PanOrderStatusLogServiceImpl.class);
}

19
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanPackageInfoServiceImpl.java

@ -0,0 +1,19 @@
package com.logpm.factory.snm.service.impl;
import com.logpm.factory.snm.entity.PanPackageInfo;
import com.logpm.factory.snm.mapper.PanPackageInfoMapper;
import com.logpm.factory.snm.service.IPanPackageInfoService;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@AllArgsConstructor
@Service
public class PanPackageInfoServiceImpl extends BaseServiceImpl<PanPackageInfoMapper, PanPackageInfo> implements IPanPackageInfoService {
private static final Logger logger = LoggerFactory.getLogger(PanPackageInfoServiceImpl.class);
}

19
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanPackageListServiceImpl.java

@ -0,0 +1,19 @@
package com.logpm.factory.snm.service.impl;
import com.logpm.factory.snm.entity.PanPackageList;
import com.logpm.factory.snm.mapper.PanPackageListMapper;
import com.logpm.factory.snm.service.IPanPackageListService;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@AllArgsConstructor
@Service
public class PanPackageListServiceImpl extends BaseServiceImpl<PanPackageListMapper, PanPackageList> implements IPanPackageListService {
private static final Logger logger = LoggerFactory.getLogger(PanPackageListServiceImpl.class);
}

6
blade-service/logpm-factory/src/main/resources/application-dev.yml

@ -42,3 +42,9 @@ spring:
url: ${blade.datasource.factory.slave.url}
username: ${blade.datasource.factory.slave.username}
password: ${blade.datasource.factory.slave.password}
pan:
url: http://157.122.179.34:15019
clientId: hzero-front-dev
clientSecret: c2VjcmV0
grantType: client_credentials

14
blade-service/logpm-factory/src/main/resources/application.yml

@ -35,16 +35,22 @@ logging:
spring:
main:
allow-circular-references: true
#rabbitmq配置
# rabbitmq:
# host: 192.168.2.100
# port: 5672
# username: admin
# password: admin
# #虚拟host 可以不设置,使用server默认host
# virtual-host: /
xxl:
job:
accessToken: ''
admin:
addresses: http://192.168.2.110:7009/xxl-job-admin
addresses: http://127.0.0.1:7009/xxl-job-admin
executor:
appname: logpm-factory-xxljob
ip: 192.168.2.110
ip: 127.0.0.1
logpath: ../data/applogs/logpm-factory-xxljob/jobhandler
logretentiondays: -1
port: 7018

Loading…
Cancel
Save