|
|
@ -11,6 +11,7 @@ import com.alibaba.excel.metadata.Sheet; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
|
|
|
import com.alibaba.nacos.common.utils.MD5Utils; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
import com.baomidou.mybatisplus.extension.conditions.update.UpdateChainWrapper; |
|
|
|
import com.baomidou.mybatisplus.extension.conditions.update.UpdateChainWrapper; |
|
|
@ -20,6 +21,7 @@ import com.logpm.factory.comfac.dto.UnloadCarDTO; |
|
|
|
import com.logpm.factory.excel.ExcelMode; |
|
|
|
import com.logpm.factory.excel.ExcelMode; |
|
|
|
import com.logpm.factory.excel.JpDataMode; |
|
|
|
import com.logpm.factory.excel.JpDataMode; |
|
|
|
import com.logpm.factory.mt.entity.MtFactoryOrderMain; |
|
|
|
import com.logpm.factory.mt.entity.MtFactoryOrderMain; |
|
|
|
|
|
|
|
import com.logpm.factory.mt.entity.MtOrderLogEntity; |
|
|
|
import com.logpm.factory.mt.entity.MtPushData; |
|
|
|
import com.logpm.factory.mt.entity.MtPushData; |
|
|
|
import com.logpm.factory.mt.service.IMtFactoryDataService; |
|
|
|
import com.logpm.factory.mt.service.IMtFactoryDataService; |
|
|
|
import com.logpm.factory.mt.service.IMtFactoryOrderMainService; |
|
|
|
import com.logpm.factory.mt.service.IMtFactoryOrderMainService; |
|
|
@ -31,6 +33,7 @@ import com.logpm.factory.oupai.service.IFactoryPackageService; |
|
|
|
import com.logpm.factory.oupai.service.IOuPaiFactoryService; |
|
|
|
import com.logpm.factory.oupai.service.IOuPaiFactoryService; |
|
|
|
import com.logpm.factory.oupai.service.impl.OuPaiFactoryServiceImpl; |
|
|
|
import com.logpm.factory.oupai.service.impl.OuPaiFactoryServiceImpl; |
|
|
|
import com.logpm.factory.pan.service.IPanFactoryDataService; |
|
|
|
import com.logpm.factory.pan.service.IPanFactoryDataService; |
|
|
|
|
|
|
|
import com.logpm.factory.snm.bean.Resp; |
|
|
|
import com.logpm.factory.snm.vo.MTOrderPackageRelationVO; |
|
|
|
import com.logpm.factory.snm.vo.MTOrderPackageRelationVO; |
|
|
|
import com.logpm.factory.zb.dto.ZBReceiptDTO; |
|
|
|
import com.logpm.factory.zb.dto.ZBReceiptDTO; |
|
|
|
import com.logpm.factory.zb.entity.ZbFactoryLogEntity; |
|
|
|
import com.logpm.factory.zb.entity.ZbFactoryLogEntity; |
|
|
@ -69,6 +72,7 @@ import org.springframework.web.multipart.MultipartFile; |
|
|
|
import org.springframework.web.multipart.commons.CommonsMultipartFile; |
|
|
|
import org.springframework.web.multipart.commons.CommonsMultipartFile; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.*; |
|
|
|
import java.io.*; |
|
|
|
|
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
import java.security.NoSuchAlgorithmException; |
|
|
|
import java.security.NoSuchAlgorithmException; |
|
|
|
import java.text.ParseException; |
|
|
|
import java.text.ParseException; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
@ -361,5 +365,84 @@ public class TestService { |
|
|
|
zbFactoryLogService.save(zbFactoryLogEntity); |
|
|
|
zbFactoryLogService.save(zbFactoryLogEntity); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
public void test10() throws NoSuchAlgorithmException { |
|
|
|
|
|
|
|
// 重新获取
|
|
|
|
|
|
|
|
String appkey = "HuiTong"; |
|
|
|
|
|
|
|
String appsecret = "HT20230822140820"; |
|
|
|
|
|
|
|
String userid = "5003"; |
|
|
|
|
|
|
|
String userpwd = "mt123456*"; |
|
|
|
|
|
|
|
long time = new Date().getTime(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String sign = MD5Utils.md5Hex((appkey + appsecret + time).getBytes(StandardCharsets.UTF_8)); |
|
|
|
|
|
|
|
String pwd = MD5Utils.md5Hex(userpwd.getBytes(StandardCharsets.UTF_8)); |
|
|
|
|
|
|
|
JSONObject jsonObject1 = new JSONObject(); |
|
|
|
|
|
|
|
jsonObject1.put("APPKEY", appkey); |
|
|
|
|
|
|
|
jsonObject1.put("SIGN", sign); |
|
|
|
|
|
|
|
jsonObject1.put("USERID", userid); |
|
|
|
|
|
|
|
jsonObject1.put("USERPWD", pwd); |
|
|
|
|
|
|
|
jsonObject1.put("Timestamp", time); |
|
|
|
|
|
|
|
String result = HttpRequest.post("http://www.mengtian.cn/Auth/Validate") |
|
|
|
|
|
|
|
.header("Content-Type", "application/json").body(jsonObject1.toJSONString()).timeout(5 * 1000) |
|
|
|
|
|
|
|
.execute() |
|
|
|
|
|
|
|
.body(); |
|
|
|
|
|
|
|
//获取的结果转成json对象
|
|
|
|
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result); |
|
|
|
|
|
|
|
System.out.println(jsonObject.toJSONString()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Integer code = jsonObject.getInteger("Result"); |
|
|
|
|
|
|
|
String access_token = jsonObject.getString("Data"); |
|
|
|
|
|
|
|
System.out.println(access_token); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
public void test11() throws NoSuchAlgorithmException { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String url="http://www.mengtian.cn/ZXCFaHuoDan/QueRenShouHuo"; |
|
|
|
|
|
|
|
String appkey = "HuiTong"; |
|
|
|
|
|
|
|
String appsecret = "HT20230822140820"; |
|
|
|
|
|
|
|
String userid = "5003"; |
|
|
|
|
|
|
|
String userpwd = "mt123456*"; |
|
|
|
|
|
|
|
// 发送数据
|
|
|
|
|
|
|
|
String data ="{\"发货单编号\":\"HYLEJIA-230983\",\"确认收货时间\":\"2023-10-01 16:15:38\"}"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//先获取token
|
|
|
|
|
|
|
|
String token = "AMiwQcwT33JksqEfDeRFbjgRieAUo/ztCQWLfpFiEqZpvUXrv0OW1GcJPFhE+ZdmPYQo+K6rUwoJ53u58Bv85A=="; |
|
|
|
|
|
|
|
//处理逻辑
|
|
|
|
|
|
|
|
String result = HttpRequest.post(url) |
|
|
|
|
|
|
|
.header("APPKEY", appkey) |
|
|
|
|
|
|
|
.header("Authorization", token) |
|
|
|
|
|
|
|
.header("USERID", userid) |
|
|
|
|
|
|
|
.header("USERPWD", MD5Utils.md5Hex(userpwd.getBytes(StandardCharsets.UTF_8))) |
|
|
|
|
|
|
|
.header("Content-Type", "application/json") |
|
|
|
|
|
|
|
.body(data).timeout(5 * 1000) |
|
|
|
|
|
|
|
.execute().body(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 保存数据到数据库
|
|
|
|
|
|
|
|
// MtOrderLogEntity mtOrderLogEntity = new MtOrderLogEntity();
|
|
|
|
|
|
|
|
// mtOrderLogEntity.setReqArgs(data);
|
|
|
|
|
|
|
|
// mtOrderLogEntity.setResBody(result);
|
|
|
|
|
|
|
|
// mtOrderLogEntity.setType(type);
|
|
|
|
|
|
|
|
// mtOrderLogEntity.setRefCode(refCode);
|
|
|
|
|
|
|
|
// mtOrderLogService.save(mtOrderLogEntity);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//把结果字符串转为json对象
|
|
|
|
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println(jsonObject); |
|
|
|
|
|
|
|
if (!Objects.isNull(jsonObject)) { |
|
|
|
|
|
|
|
Integer code = jsonObject.getInteger("Result"); |
|
|
|
|
|
|
|
String message = jsonObject.getString("Message"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
public void test12(){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|