Browse Source

Merge pull request 'dev' (#10) from dev into pre-production

Reviewed-on: #10
master
zhaoqiaobo 10 months ago
parent
commit
4c8a44e922
  1. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
  2. 6
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomFactoryOrderListener.java
  3. 12
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/util/ZbomUtil.java
  4. 17
      blade-service/logpm-report/pom.xml
  5. 30
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportBillLoadingController.java

12
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml

@ -2032,8 +2032,16 @@
</select>
<select id="selectSignforByDeliveryId"
resultType="com.logpm.distribution.entity.DistributionSignforEntity">
SELECT * FROM logpm_distribution_signfor AS lds LEFT JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id
WHERE lds.delivery_id = #{deliveryId} AND (ldr.reservation_num + ldr.reservation_stock_list_num) > 0
SELECT
lds.*
FROM
logpm_distribution_signfor AS lds
LEFT JOIN ( SELECT b.id,(b.reservation_num+b.reservation_stock_list_num) AS num FROM logpm_distribution_signfor AS a LEFT JOIN logpm_distribution_reservation AS b ON a.reservation_id = b.id GROUP BY a.reservation_id) AS t ON lds.reservation_id = t.id
WHERE
lds.delivery_id = #{deliveryId}
ANd t.num > 0
GROUP BY
lds.reservation_id
</select>
</mapper>

6
blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomFactoryOrderListener.java

@ -213,9 +213,9 @@ public class ZbomFactoryOrderListener {
advanceEntity.setStoreCode(orderPackageDTO.getCustomerCode());
advanceEntity.setStoreName(orderPackageDTO.getCustomerName());
advanceEntity.setServiceNum(orderPackageDTO.getRelationOrderCode());
advanceEntity.setConsigneePerson(orderPackageDTO.getReceiverName());
advanceEntity.setConsigneeMobile(orderPackageDTO.getReceiverMobile());
advanceEntity.setConsigneeAddress(orderPackageDTO.getReceiverAddress());
advanceEntity.setCustomerName(orderPackageDTO.getReceiverName());
advanceEntity.setCustomerPhone(orderPackageDTO.getReceiverMobile());
advanceEntity.setCustomerAddress(orderPackageDTO.getReceiverAddress());
// 封装包件
TrunklineAdvanceDetailEntity advanceDetailEntity = new TrunklineAdvanceDetailEntity();

12
blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/util/ZbomUtil.java

@ -3,7 +3,9 @@ package com.logpm.factorydata.zbom.util;
import cn.hutool.core.map.MapUtil;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.logpm.factorydata.zbom.pros.ZbFactoryProperties;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.HttpConstants;
import org.springblade.common.utils.CommonUtil;
@ -18,19 +20,22 @@ import java.util.Map;
* @author zhaoqiaobo
* @create 2024-03-21 15:23
*/
@Slf4j
public class ZbomUtil {
/**
* 推送数据
*
* @param zbProperties 志邦配置信息
* @param body 请求提
* @param method 请求方法
* @param body 请求提
* @param method 请求方法
* @return 返回请求结果
* @throws Exception
*/
public static String pushZbomSystem(ZbFactoryProperties zbProperties, String body, String method) throws Exception {
// 构建请求url
String url = ZbomUtil.buildUrl(zbProperties, body, method);
log.info("推送志邦url:{}", url);
// 请求数据
HashMap<String, String> headers = MapUtil.of(HttpConstants.HTTP.HEADER_NAME.CONTENT_TYPE, HttpConstants.HTTP.HEADER_VALUE.JSON);
HttpResponse execute = HttpUtil.createPost(url).headerMap(headers, false).body(body).timeout(5 * 1000).execute();
@ -47,8 +52,11 @@ public class ZbomUtil {
params.put("sign_method", "md5");
params.put("timestamp", CommonUtil.dateToStringGeneral(new Date()));
params.put("v", "1.0");
log.info("推送志邦参数:{}", JSONUtil.toJsonStr(params));
String body = bodyParam.replaceAll("\\s+", "");
log.info("推送志邦请求体:{}", body);
String sign = QmSignUntil.signTopRequest(params, zbProperties.getSecretkey(), "md5", body);
log.info("推送志邦签名:{}", sign);
String url = getZbUrl(zbProperties.getUrl() + "/api/edi/ots/in?", params, sign);
return url;
}

17
blade-service/logpm-report/pom.xml

@ -33,8 +33,21 @@
<artifactId>logpm-basicdata-api</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-report-api</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-dict-api</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-factory-data-api</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
</dependencies>
<build>

30
blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportBillLoadingController.java

@ -1,7 +1,12 @@
package com.logpm.report.controller;
import cn.hutool.core.util.EnumUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.enums.NodeEnums;
import com.logpm.factorydata.util.FactoryDataMessageSender;
import com.logpm.factorydata.vo.NodePushMsg;
import com.logpm.report.query.BillDetailsQuery;
import com.logpm.report.query.BillLoadingTasksQuery;
import com.logpm.report.service.IReportBillLoadingAsyncService;
@ -12,13 +17,19 @@ import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 自提报表前端控制器
*
* @Author zqb
* @Date 2024/3/14
**/
@ -30,6 +41,25 @@ public class ReportBillLoadingController {
private IReportBillLoadingAsyncService reportBillLoadingAsyncService;
private final FactoryDataMessageSender sender;
@PostMapping("/sendMessage")
@ApiOperation(value = "发送消息测试", notes = "发送消息测试")
public R<String> tasksPage(@RequestBody Map map) {
String node = (String) map.get("node");
NodeEnums nodeEnums = EnumUtil.fromString(NodeEnums.class, node);
NodePushMsg build = NodePushMsg.builder()
.node(nodeEnums)
.brand(BrandEnums.ZB)
.operatorTime(new Date())
.operator("test")
.address("test")
.content((List<Object>) map.get("content"))
.build();
sender.sendNodeDataByBrand(build);
return R.data("成功");
}
@GetMapping("/tasks")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "自提任务维度", notes = "自提任务维度")

Loading…
Cancel
Save