8 changed files with 350 additions and 64 deletions
@ -0,0 +1,55 @@
|
||||
package com.logpm.factory.mt.receiver; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.fasterxml.jackson.core.JsonProcessingException; |
||||
import com.logpm.factory.mt.service.IMtFactoryDataService; |
||||
import com.rabbitmq.client.Channel; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.common.constant.RabbitConstant; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.core.tool.utils.DateUtil; |
||||
import org.springframework.amqp.core.Message; |
||||
import org.springframework.amqp.rabbit.annotation.RabbitHandler; |
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
import java.io.IOException; |
||||
import java.security.NoSuchAlgorithmException; |
||||
import java.util.Date; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* 将数据回传给梦天工厂 |
||||
*/ |
||||
|
||||
@Slf4j |
||||
@RabbitListener(queues = RabbitConstant.MT_BUSINESS_DATA_2_FACTORY_QUEUE) |
||||
@Component |
||||
public class BusinessData2FactoryHandler { |
||||
|
||||
@Autowired |
||||
private IMtFactoryDataService mtFactoryDataService; |
||||
|
||||
@RabbitHandler |
||||
public void sendOrderPackageScan(Map map, Message message, Channel channel) throws IOException, NoSuchAlgorithmException { |
||||
|
||||
log.info(">>>>>>>>>>>>>>>>> 司机扫描推送 {}", DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss.SSS")); |
||||
|
||||
String json = (String) map.get("messageData"); |
||||
JSONObject object = JSONObject.parseObject(json); |
||||
String orderPackageCode = object.getString("orderPackageCode"); |
||||
String operationTime = object.getString("operationTime"); |
||||
String distributionContactId = object.getString("distributionContactId"); |
||||
String destinationWarehouse = object.getString("destinationWarehouse"); |
||||
|
||||
try { |
||||
mtFactoryDataService.qianshouScanForNewSystem(orderPackageCode, operationTime, distributionContactId, destinationWarehouse); |
||||
} catch (Exception e) { |
||||
log.error(">>>>>>", e); |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,49 @@
|
||||
package com.logpm.factory.mt.receiver; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.logpm.factory.mt.dto.MtReceiveDTO; |
||||
import com.logpm.factory.mt.service.IMtFactoryDataService; |
||||
import com.rabbitmq.client.Channel; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.common.constant.RabbitConstant; |
||||
import org.springblade.core.tool.utils.DateUtil; |
||||
import org.springframework.amqp.core.Message; |
||||
import org.springframework.amqp.rabbit.annotation.RabbitHandler; |
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
import java.io.IOException; |
||||
import java.security.NoSuchAlgorithmException; |
||||
import java.util.Date; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* 将数据复核回传给梦天工厂 |
||||
*/ |
||||
|
||||
@Slf4j |
||||
@RabbitListener(queues = RabbitConstant.MT_BUSINESS_DATA_CLERK_CHECK_2_FACTORY_QUEUE) |
||||
@Component |
||||
public class BusinessDataClerkCheck2FactoryHandler { |
||||
|
||||
@Autowired |
||||
private IMtFactoryDataService mtFactoryDataService; |
||||
|
||||
@RabbitHandler |
||||
public void sendOrderPackageScan(Map map, Message message, Channel channel) throws IOException, NoSuchAlgorithmException { |
||||
|
||||
log.info(">>>>>>>>>>>>>>>>> 文员复核推送 {}", DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss.SSS")); |
||||
String json = (String) map.get("messageData"); |
||||
MtReceiveDTO mtReceiveDTO = JSONObject.parseObject(json,MtReceiveDTO.class); |
||||
|
||||
try { |
||||
mtFactoryDataService.sendReceiveInfoByNewSystem(mtReceiveDTO); |
||||
} catch (Exception e) { |
||||
log.error(">>>>>>", e); |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,50 @@
|
||||
#mybatis-plus配置 |
||||
mybatis-plus: |
||||
mapper-locations: classpath:com/logpm/**/mapper/*Mapper.xml |
||||
#实体扫描,多个package用逗号或者分号分隔 |
||||
typeAliasesPackage: com.logpm.**.entity |
||||
|
||||
#swagger扫描路径配置 |
||||
swagger: |
||||
base-packages: |
||||
- org.springblade |
||||
- com.logpm |
||||
|
||||
#oss配置 |
||||
oss: |
||||
enabled: true |
||||
name: minio |
||||
tenant-mode: false |
||||
endpoint: http://127.0.0.1:9000 |
||||
access-key: D99KGE6ZTQXSATTJWU24 |
||||
secret-key: QyVqGnhIQQE734UYSUFlGOZViE6+ZlDEfUG3NjhJ |
||||
bucket-name: bladex |
||||
|
||||
#blade配置 |
||||
blade: |
||||
#本地文件上传 |
||||
file: |
||||
remote-mode: true |
||||
upload-domain: http://localhost:8999 |
||||
remote-path: /usr/share/nginx/html |
||||
|
||||
logging: |
||||
config: classpath:logback.xml |
||||
|
||||
|
||||
spring: |
||||
main: |
||||
allow-circular-references: true |
||||
|
||||
xxl: |
||||
job: |
||||
accessToken: '' |
||||
admin: |
||||
addresses: http://192.168.10.200:7009/xxl-job-admin |
||||
executor: |
||||
appname: logpm-factory-xxljob |
||||
ip: 127.0.0.1 |
||||
logpath: ../data/applogs/logpm-factory-xxljob/jobhandler |
||||
logretentiondays: -1 |
||||
port: 7020 |
||||
|
Loading…
Reference in new issue