第三方服务提交与下载bug修复,领用单据bug修复

fengcang
anthonyywj2 3 years ago
parent 491e9f17ce
commit 742a005718

@ -11,6 +11,7 @@ public class Constant {
public static final String SCAN_ORDER = "MS"; public static final String SCAN_ORDER = "MS";
public static final String BUS_ORDER = "MY"; public static final String BUS_ORDER = "MY";
public static final String LIN_YONG = "ML";
public static final String dlThrProducts = "THR_DOWNLOAD_PRODUCTS"; public static final String dlThrProducts = "THR_DOWNLOAD_PRODUCTS";
public static final String dlThrInvProducts = "THR_DOWNLOAD_INV_PRODUCTS"; public static final String dlThrInvProducts = "THR_DOWNLOAD_INV_PRODUCTS";

@ -2,6 +2,7 @@ package com.glxp.api.admin.controller.thrsys;
//领用单 //领用单
import com.glxp.api.admin.annotation.AuthRuleAnnotation; import com.glxp.api.admin.annotation.AuthRuleAnnotation;
import com.glxp.api.admin.constant.Constant;
import com.glxp.api.admin.entity.business.StockOrderDetailEntity; import com.glxp.api.admin.entity.business.StockOrderDetailEntity;
import com.glxp.api.admin.entity.thrsys.ThrOrderDetailEntity; import com.glxp.api.admin.entity.thrsys.ThrOrderDetailEntity;
import com.glxp.api.admin.entity.thrsys.ThrOrderEntity; import com.glxp.api.admin.entity.thrsys.ThrOrderEntity;
@ -10,6 +11,8 @@ import com.glxp.api.admin.service.auth.CustomerService;
import com.glxp.api.admin.service.thrsys.ThrOrderDetailService; import com.glxp.api.admin.service.thrsys.ThrOrderDetailService;
import com.glxp.api.admin.service.thrsys.ThrOrderService; import com.glxp.api.admin.service.thrsys.ThrOrderService;
import com.glxp.api.admin.util.DateUtil; import com.glxp.api.admin.util.DateUtil;
import com.glxp.api.admin.util.GennerOrderUtils;
import com.glxp.api.admin.util.OrderNoTypeBean;
import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.common.util.ResultVOUtils;
@ -33,6 +36,8 @@ public class ThrOrderReceiveController {
private ThrOrderDetailService thrOrderDetailService; private ThrOrderDetailService thrOrderDetailService;
@Resource @Resource
CustomerService customerService; CustomerService customerService;
@Resource
GennerOrderUtils gennerOrderUtils;
@AuthRuleAnnotation("") @AuthRuleAnnotation("")
@PostMapping("/udiwms/thrsys/order/insertWeb") @PostMapping("/udiwms/thrsys/order/insertWeb")
@ -43,17 +48,17 @@ public class ThrOrderReceiveController {
} }
Integer userId = customerService.getUserId(); Integer userId = customerService.getUserId();
ThrOrderEntity stockOrderEntity = new ThrOrderEntity(); ThrOrderEntity stockOrderEntity = new ThrOrderEntity();
// Integer id = Integer.parseInt(CustomUtil.getId());
BeanUtils.copyProperties(stockOrderPostRequest, stockOrderEntity); BeanUtils.copyProperties(stockOrderPostRequest, stockOrderEntity);
stockOrderEntity.setCreateUser(userId + ""); stockOrderEntity.setCreateUser(userId + "");
stockOrderEntity.setType(1);//领用单据 stockOrderEntity.setType(1);//领用单据
stockOrderEntity.setUpdateTime(new Date()); stockOrderEntity.setUpdateTime(new Date());
stockOrderEntity.setBilldate(DateUtil.formatDate(new Date())); stockOrderEntity.setBilldate(DateUtil.formatDate(new Date()));
// stockOrderEntity.setId(id);
ThrOrderEntity temp = thrOrderService.findByUnique(stockOrderEntity.getBillNo(), stockOrderEntity.getThirdSysFk()); ThrOrderEntity temp = thrOrderService.findByUnique(stockOrderEntity.getBillNo(), stockOrderEntity.getThirdSysFk());
if (temp != null) { if (temp != null) {
stockOrderEntity.setId(temp.getId()); stockOrderEntity.setId(temp.getId());
} }
String orderNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.LIN_YONG, "yyyyMMdd"));
stockOrderEntity.setBillNo(orderNo);
thrOrderService.insertThrOrder(stockOrderEntity); thrOrderService.insertThrOrder(stockOrderEntity);
stockOrderEntity = thrOrderService.findByUnique(stockOrderEntity.getBillNo(), stockOrderEntity.getThirdSysFk()); stockOrderEntity = thrOrderService.findByUnique(stockOrderEntity.getBillNo(), stockOrderEntity.getThirdSysFk());

@ -14,4 +14,10 @@ public class ErpUnitsResponse {
private String mobile; private String mobile;
private Boolean checked; private Boolean checked;
private String unitId; //必填 往来单位ID private String unitId; //必填 往来单位ID
} }

@ -1,5 +1,6 @@
package com.glxp.api.admin.util; package com.glxp.api.admin.util;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.glxp.api.admin.entity.basic.BasicThirdSysEntity; import com.glxp.api.admin.entity.basic.BasicThirdSysEntity;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -30,12 +31,25 @@ public class HttpOkClient {
header.add("Content-Type"); header.add("Content-Type");
header.add("application/json"); header.add("application/json");
if (null != basicThirdSysEntity) { if (null != basicThirdSysEntity) {
header.add("api_key");
header.add(basicThirdSysEntity.getApikey()); if (StrUtil.isNotEmpty(basicThirdSysEntity.getApikey())) {
header.add("secret_key"); header.add("api_key");
header.add(basicThirdSysEntity.getSecretkey()); header.add(basicThirdSysEntity.getApikey());
}
if (StrUtil.isNotEmpty(basicThirdSysEntity.getSecretkey())) {
header.add("secret_key");
header.add(basicThirdSysEntity.getSecretkey());
}
} }
return okHttpCli.doPostJson(url, json, (String[]) header.toArray());
String[] strArray = new String[header.size()];
header.toArray(strArray);
return okHttpCli.doPostJson(url, json, strArray);
} }
} }

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false"> <configuration scan="true" scanPeriod="60 seconds" debug="false">
<contextName>logback</contextName> <contextName>logback</contextName>
<property name="log.path" value="D:\\udi\\logs\\UDI_WMS_MC\\" /> <!-- <property name="log.path" value="D:\\udi\\logs\\UDI_WMS_MC\\"/>-->
<!--输出到控制台/home/glxpdata/udiwms/UDI_WMS_MC/--> <!--输出到控制台/home/glxpdata/udiwms/UDI_WMS_MC/-->
<!-- <property name="log.path" value="/home/glxpdata/udiwms/UDI_WMS_MC/" />--> <property name="log.path" value="/home/glxpdata/udiwms/UDI_WMS_MC/"/>
<!--D:\\udi\\logs\\UDI_WMS_MC\\--> <!--D:\\udi\\logs\\UDI_WMS_MC\\-->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender"> <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<!-- <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> <!-- <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
@ -124,11 +124,11 @@
</appender> </appender>
<root level="info"> <root level="info">
<appender-ref ref="console" /> <appender-ref ref="console"/>
<appender-ref ref="DEBUG_FILE" /> <appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE" /> <appender-ref ref="INFO_FILE"/>
<appender-ref ref="WARN_FILE" /> <appender-ref ref="WARN_FILE"/>
<appender-ref ref="ERROR_FILE" /> <appender-ref ref="ERROR_FILE"/>
</root> </root>
<!-- logback为java中的包 --> <!-- logback为java中的包 -->
@ -140,7 +140,7 @@
<!-- 测试环境+开发环境. 多个使用逗号隔开. --> <!-- 测试环境+开发环境. 多个使用逗号隔开. -->
<springProfile name="dev"> <springProfile name="dev">
<logger name="com.glxp.api.admin" level="info" /> <logger name="com.glxp.api.admin" level="info"/>
</springProfile> </springProfile>
<!-- 生产环境. --> <!-- 生产环境. -->

Loading…
Cancel
Save