From 9e86bcdfdbbc4563521e9a12f63714f0f9c3972e Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" <123456> Date: Thu, 28 Sep 2023 16:43:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.=E5=AF=B9=E6=8E=A5=E6=AC=A7=E6=B4=BE?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oupai/entity/FactoryPackageEntity.java | 3 + .../receiver/OpOldReceivingDataHandler.java | 55 +++++++++++++++---- .../service/impl/OuPaiFactoryServiceImpl.java | 51 ++++++++++++++++- .../java/com/logpm/factory/TestService.java | 17 ++++++ 4 files changed, 112 insertions(+), 14 deletions(-) diff --git a/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/entity/FactoryPackageEntity.java b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/entity/FactoryPackageEntity.java index bb7d27140..fa35f4046 100644 --- a/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/entity/FactoryPackageEntity.java +++ b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/entity/FactoryPackageEntity.java @@ -62,6 +62,9 @@ public class FactoryPackageEntity extends BaseEntity { /** 三级品类名称 */ @ApiModelProperty(name = "三级品类名称",notes = "") private String thirdClassName ; + + @ApiModelProperty(name = "物料名称合集",notes = "") + private String packageDetailNames ; /** 补进 */ @ApiModelProperty(name = "补进",notes = "") private Integer buyin ; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/receiver/OpOldReceivingDataHandler.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/receiver/OpOldReceivingDataHandler.java index 8397af989..c7762487b 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/receiver/OpOldReceivingDataHandler.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/receiver/OpOldReceivingDataHandler.java @@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.io.IOException; +import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -63,6 +64,14 @@ public class OpOldReceivingDataHandler { JSONObject object = JSONObject.parseObject(jsonStr); String orderPackageCode = object.getString("orderPackageCode"); String warehouseName = object.getString("warehouse_name"); + String opShipNo = object.getString("opShipNo"); + String orderSelfNum = object.getString("orderSelfNum"); + String carNumber = object.getString("carNumber"); + String siteName = object.getString("siteName"); + String packageDetailNames = object.getString("packageDetailNames"); + String firstPackName = object.getString("firstPackName"); + String secondPackName = object.getString("secondPackName"); + String thirdPackName = object.getString("thirdPackName"); QueryWrapper warehouseQueryWrapper = new QueryWrapper(); @@ -87,7 +96,35 @@ public class OpOldReceivingDataHandler { String authCode = oldLogin(warehouseEntity.getId()); // 推送数据 if (StringUtil.isNotBlank(authCode)) { - boolean isSuccess = sendPackageData(authCode, orderPackageCode); + + Map reqMap = new HashMap<>(); + reqMap.put("authCode", authCode); + + // 收货单 + reqMap.put("op_shipNo", opShipNo); + //仓库ID + reqMap.put("warehouse_id", warehouseEntity.getId()); + //订单自编号 + reqMap.put("orderSelfNum", orderSelfNum); + //扫描时间 + reqMap.put("scan_time", new Date()); + //扫描人 + reqMap.put("scan_user", ""); + //车次号 + reqMap.put("mctsTruck", carNumber); + //发货基地 + reqMap.put("siteName", siteName); + //一级品类 + reqMap.put("firstPackName", firstPackName); + //二级品类 + reqMap.put("secondPackName", secondPackName); + //三级品类 + reqMap.put("thirdPackName", thirdPackName); + //物料名称 + reqMap.put("productname", packageDetailNames); + + + boolean isSuccess = sendPackageData(reqMap); if (isSuccess) { // 请求成功 修改推送数据的状态 修改未1 if (ObjectUtils.isNotNull(packageEntity)) { @@ -126,19 +163,15 @@ public class OpOldReceivingDataHandler { } - private boolean sendPackageData(String authCode, String orderPackageCode) { + private boolean sendPackageData(Map map) { // 构建请求头 - Map map = new HashMap<>(); - map.put("type", "1"); - map.put("unitNo", orderPackageCode); - map.put("mctsTruckNo", ""); - map.put("area", ""); - map.put("user_id", oldSystemProperties.getUserId()); - map.put("pick_up_id", ""); - map.put("origin", "按件入库"); + + String authCode = map.get("authCode").toString(); + + log.info("##################sendPackageData: 请求老系统接口 start map {}", map); - String url = oldSystemProperties.getUrl() + "api/scan"; + String url = oldSystemProperties.getUrl() + "openApi/newSystem.OptimsWarehouseScan/index"; String body = HttpRequest.post(url).form(map).header("token", authCode).execute().body(); log.info("##################sendPackageData: 请求老系统接口,url:{},body:{}", url, body); if (StringUtil.isNotBlank(body)) { diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java index 70501df77..0613d601d 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java @@ -141,22 +141,49 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService { FactoryPackageEntity packageEntity = factoryPackageService.getOne(queryWrapper); String code=null; String endWarehouseName = null; + String opShipNo=null; + String orderSelfNum =null; + String carNumber=null; + String siteName = null; + String packageDetailNames = null; + String firstPackName,secondPackName,thirdPackName = null; if (Objects.isNull(packageEntity)) { log.error("############oid 查询数据失败: {}", key); // 查询欧派系统的的数据 - String url = ouPaiProperties.getUri() + "tims_odata_api/api/odata/Package(" + key + ")?select=Code,PackageStatus,FirstClassCode,FirstClassName,SecondClassCode,SecondClassName,ThirdClassCode,ThirdClassName,BuyIn,CosourcingCode,CosourcingUnit,Length,Width,Height,Weight,IsInventory,SendTime,ReceivingTime,CreateTime,ShipTime,CarNumber,DeliveryMethod&$expand=ReceivingOrders($select=Code,Type,Status,Plate,PackagesCount,ReceivePackageCount,PlateNum,CarNumber,CarrierCode,SendTime,ArrivalTime,ReceiveTime,CreateTime,ReturnNumber;$expand=EndWarehouse($select=Name,Code))"; - OpOrderStatusLogEntity opOrderStatusLogEntity = sendRequestData(url, event); + String url = ouPaiProperties.getUri() + "tims_odata_api/api/odata/Package(" + key + ")?select=Code,PackageStatus,FirstClassCode,FirstClassName,SecondClassCode,SecondClassName,ThirdClassCode,ThirdClassName,BuyIn,CosourcingCode,CosourcingUnit,Length,Width,Height,Weight,IsInventory,SendTime,ReceivingTime,CreateTime,ShipTime,CarNumber,DeliveryMethod&$expand=ReceivingOrders($select=Code,Type,Status,Plate,PackagesCount,ReceivePackageCount,PlateNum,CarNumber,CarrierCode,SendTime,ArrivalTime,ReceiveTime,CreateTime,ReturnNumber;$expand=EndWarehouse($select=Name,Code))&$expand=Order($select=SelfCode,Code)"; OpOrderStatusLogEntity opOrderStatusLogEntity = sendRequestData(url, event); JSONObject jsonObject = JSONObject.parseObject(opOrderStatusLogEntity.getResponseBody()); code = jsonObject.getString("Code"); + Boolean isInventory = jsonObject.getBoolean("IsInventory"); + carNumber = jsonObject.getString("CarNumber"); + packageDetailNames = jsonObject.getString("PackageDetailNames"); + firstPackName = jsonObject.getString("FirstPackName"); + secondPackName = jsonObject.getString("SecondPackName"); + thirdPackName = jsonObject.getString("ThirdPackName"); + + if(isInventory){ + log.error("############库存品数据 不进行推送: {}", code); + return key; + } + + JSONObject order = jsonObject.getJSONObject("Order"); + if (order != null){ + orderSelfNum = order.getString("SelfCode"); + } + JSONArray ls = jsonObject.getJSONArray("ReceivingOrders"); if(ls!=null&& !ls.isEmpty()){ JSONObject t = ls.getJSONObject(0); if(t!=null){ + opShipNo = t.getString("Code"); JSONObject endWarehouse = t.getJSONObject("EndWarehouse"); endWarehouseName = endWarehouse.getString("Name"); + + JSONObject fromWarehouse = t.getJSONObject("FromWarehouse"); + siteName = fromWarehouse.getString("Name"); } + }else{ log.error("############没有收货单oid:{}", key); return key; @@ -166,18 +193,28 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService { packageEntity.setPackageStatus(5); factoryPackageService.updateById(packageEntity); code = packageEntity.getCode(); + packageDetailNames =packageEntity.getPackageDetailNames(); + + firstPackName = packageEntity.getFirstClassName(); + secondPackName = packageEntity.getSecondClassName(); + thirdPackName = packageEntity.getThirdClassName(); Long orderId = packageEntity.getOrderId(); // 查询 订单 QueryWrapper queryWrapperFactoryOrderEntity = new QueryWrapper<>(); queryWrapperFactoryOrderEntity.eq("id", orderId); FactoryOrderEntity orderEntity = factoryOrderService.getOne(queryWrapperFactoryOrderEntity); + orderSelfNum = orderEntity.getSelfCode(); // 查询 发货单 Long receivingId = orderEntity.getReceivingId(); ReceivingOrderEntity receivingEntity = receivingOrderMapper.selectById(receivingId); endWarehouseName = receivingEntity.getEndWarehouseName(); - } + opShipNo = receivingEntity.getCode(); + carNumber = receivingEntity.getCarNumber(); + // 发货基地 + siteName = receivingEntity.getFromWarehouseName(); + } // 判断 作业仓库 和 收货仓库 是否一致 log.info(" >>>> 判断作业仓库 和 收货仓库 是否一致 >>>> 作业仓库:{},收货仓库:{}", warehouseName, endWarehouseName); @@ -189,6 +226,14 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService { JSONObject jo = new JSONObject(); jo.put("orderPackageCode", code); jo.put("warehouse_name", warehouseName); + jo.put("opShipNo", opShipNo); + jo.put("orderSelfNum", orderSelfNum); + jo.put("carNumber", carNumber); + jo.put("siteName", siteName); + jo.put("packageDetailNames", packageDetailNames); + jo.put("firstPackName", firstPackName); + jo.put("secondPackName", secondPackName); + jo.put("thirdPackName", thirdPackName); //真正的处理需要的数据 Map map = new HashMap<>(); diff --git a/blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java b/blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java index 5761c873c..4da25f185 100644 --- a/blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java +++ b/blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java @@ -32,6 +32,8 @@ import com.logpm.factory.oupai.service.IOuPaiFactoryService; import com.logpm.factory.oupai.service.impl.OuPaiFactoryServiceImpl; import com.logpm.factory.pan.service.IPanFactoryDataService; import com.logpm.factory.snm.vo.MTOrderPackageRelationVO; +import com.logpm.factory.zb.dto.ZBReceiptDTO; +import com.logpm.factory.zb.service.IZbFactoryDataService; import com.logpm.oldproject.entity.AdvanceDetailEntity; import com.logpm.oldproject.feign.IAdvanceDetailClient; import com.rabbitmq.client.Channel; @@ -85,6 +87,9 @@ public class TestService { @Autowired private IOssClient ossClient; + @Autowired + private IZbFactoryDataService zbFactoryDataService; + @Autowired private OuPaiFactoryServiceImpl ouPaiFactoryService; @@ -329,5 +334,17 @@ public class TestService { } + @Test + public void test8(){ + + + + JSON json = JSON.parseObject("{\"carNumber\":\"\",\"companyCode\":\"zbom\",\"departCode\":\"880359\",\"details\":[{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"15\",\"packageClass\":\"线性包装\",\"packageCode\":\"1523090071264\",\"packageName\":\"\",\"packageType\":\"XX\",\"packageTypeName\":\"线性\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"19\",\"packageClass\":\"线性包装\",\"packageCode\":\"1523090072230\",\"packageName\":\"\",\"packageType\":\"XX\",\"packageTypeName\":\"线性\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"15\",\"packageClass\":\"五金包装\",\"packageCode\":\"1423090661395\",\"packageName\":\"\",\"packageType\":\"WJ\",\"packageTypeName\":\"五金\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"13\",\"packageClass\":\"五金包装\",\"packageCode\":\"1423090661400\",\"packageName\":\"\",\"packageType\":\"WJ\",\"packageTypeName\":\"五金\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"14\",\"packageClass\":\"五金包装\",\"packageCode\":\"1423090661406\",\"packageName\":\"\",\"packageType\":\"WJ\",\"packageTypeName\":\"五金\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"3\",\"packageClass\":\"箱体包装\",\"packageCode\":\"1423090691859\",\"packageName\":\"1423090691859\",\"packageType\":\"XB\",\"packageTypeName\":\"标准板\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"1\",\"packageClass\":\"箱体包装\",\"packageCode\":\"1423090691952\",\"packageName\":\"1423090691952\",\"packageType\":\"XB\",\"packageTypeName\":\"标准板\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"2\",\"packageClass\":\"箱体包装\",\"packageCode\":\"1423090692021\",\"packageName\":\"1423090692021\",\"packageType\":\"XB\",\"packageTypeName\":\"标准板\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"5\",\"packageClass\":\"饰面门板包装\",\"packageCode\":\"1623090473497\",\"packageName\":\"1623090473497\",\"packageType\":\"MB\",\"packageTypeName\":\"门板\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"7\",\"packageClass\":\"饰面门板包装\",\"packageCode\":\"1623090473505\",\"packageName\":\"1623090473505\",\"packageType\":\"MB\",\"packageTypeName\":\"门板\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"4\",\"packageClass\":\"饰面门板包装\",\"packageCode\":\"1623090473510\",\"packageName\":\"1623090473510\",\"packageType\":\"MB\",\"packageTypeName\":\"门板\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"6\",\"packageClass\":\"饰面门板包装\",\"packageCode\":\"1623090473518\",\"packageName\":\"1623090473518\",\"packageType\":\"MB\",\"packageTypeName\":\"门板\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"3\",\"packageClass\":\"饰面门板包装\",\"packageCode\":\"1423090658966\",\"packageName\":\"1423090658966\",\"packageType\":\"MB\",\"packageTypeName\":\"门板\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"15\",\"packageClass\":\"台面包装\",\"packageCode\":\"1523090070679\",\"packageName\":\"\",\"packageType\":\"TM\",\"packageTypeName\":\"台面\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"18\",\"packageClass\":\"台面包装\",\"packageCode\":\"1523090070680\",\"packageName\":\"\",\"packageType\":\"TM\",\"packageTypeName\":\"台面\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"16\",\"packageClass\":\"台面包装\",\"packageCode\":\"1523090070681\",\"packageName\":\"\",\"packageType\":\"TM\",\"packageTypeName\":\"台面\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"17\",\"packageClass\":\"台面包装\",\"packageCode\":\"1523090070682\",\"packageName\":\"\",\"packageType\":\"TM\",\"packageTypeName\":\"台面\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"12\",\"packageClass\":\"箱体包装\",\"packageCode\":\"1423090693442\",\"packageName\":\"1423090693442\",\"packageType\":\"XT\",\"packageTypeName\":\"非标板\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"7\",\"packageClass\":\"箱体包装\",\"packageCode\":\"1423090693444\",\"packageName\":\"1423090693444\",\"packageType\":\"XT\",\"packageTypeName\":\"非标板\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"9\",\"packageClass\":\"箱体包装\",\"packageCode\":\"1423090693445\",\"packageName\":\"1423090693445\",\"packageType\":\"XT\",\"packageTypeName\":\"非标板\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"11\",\"packageClass\":\"箱体包装\",\"packageCode\":\"1423090693446\",\"packageName\":\"1423090693446\",\"packageType\":\"XT\",\"packageTypeName\":\"非标板\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"8\",\"packageClass\":\"箱体包装\",\"packageCode\":\"1423090693447\",\"packageName\":\"1423090693447\",\"packageType\":\"XT\",\"packageTypeName\":\"非标板\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"10\",\"packageClass\":\"箱体包装\",\"packageCode\":\"1423090694754\",\"packageName\":\"1423090694754\",\"packageType\":\"XT\",\"packageTypeName\":\"非标板\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"13\",\"packageClass\":\"箱体包装\",\"packageCode\":\"1423090691972\",\"packageName\":\"1423090691972\",\"packageType\":\"XT\",\"packageTypeName\":\"非标板\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"20\",\"packageClass\":\"16.1603.01\",\"packageCode\":\"1423090719955\",\"packageName\":\"\",\"packageType\":\"SP\",\"packageTypeName\":\"商品\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"},{\"custOrderCode\":\"10423273871\",\"customerCode\":\"F131148\",\"customerName\":\"宁晋县旭润建筑装饰工程有限公司\",\"customizedFlag\":\"Y\",\"inventoryStatus\":\"ZP\",\"items\":[],\"legacyFlag\":\"N\",\"lineNo\":\"19\",\"packageClass\":\"16.1604.01\",\"packageCode\":\"1423090719956\",\"packageName\":\"\",\"packageType\":\"SP\",\"packageTypeName\":\"商品\",\"planQty\":\"1.0000\",\"platformOrderCode\":\"宁晋拎包样202309006\",\"qhFlag\":\"Y\",\"qtFlag\":\"Y\",\"receiverAddress\":\"燕南8栋1单元1702室\",\"receiverMobile\":\"女士\",\"receiverName\":\"女士\",\"relationOrderCode\":\"宁晋拎包样202309006\",\"totalGrossWeight\":\"0.0000\",\"totalVolume\":\"0.000000\"}],\"driverMobile\":\"\",\"driverName\":\"\",\"emptyFlag\":\"N\",\"expectEndTime\":\"\",\"expectStartTime\":\"\",\"orderType\":\"RK\",\"senderAddress\":\"安徽省合肥市长丰县淮南北路1号\",\"senderCity\":\"合肥市\",\"senderDistrict\":\"长丰县\",\"senderMobile\":\"\",\"senderName\":\"\",\"senderProvince\":\"安徽省\",\"senderTel\":\"\",\"senderTow\":\"\",\"taskCode\":\"230928000001\",\"vendorCode\":\"AD-0001\",\"vendorName\":\"安东物流\",\"warehouseCode\":\"HTWL-WH\"}"); + + ZBReceiptDTO javaObject = JSONObject.toJavaObject(json, ZBReceiptDTO.class); + + zbFactoryDataService.saveData(javaObject); + } + } From ec8507d2119c2a074f03c7484d67057b63ac6911 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Thu, 28 Sep 2023 17:53:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.=E6=8B=89=E5=8F=96=E9=87=91=E7=89=8C?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jp/entity/JinpaiArrivalOrderEntity.java | 34 +++ .../factory/jp/entity/JinpaiOrgIdEntity.java | 18 ++ .../jp/entity/JinpaiPushScanLogEntity.java | 35 +++ .../logpm/factory/jp/bean/ApiResponse.java | 17 ++ .../com/logpm/factory/jp/bean/LoginRes.java | 107 ++++++++ .../com/logpm/factory/jp/bean/NowOrg.java | 15 ++ .../logpm/factory/jp/bean/OriginalOrg.java | 16 ++ .../com/logpm/factory/jp/bean/OwnedOrgs.java | 16 ++ .../logpm/factory/jp/bean/PushScanLog.java | 65 +++++ .../com/logpm/factory/jp/bean/RCookie.java | 9 + .../java/com/logpm/factory/jp/bean/Tran.java | 164 ++++++++++++ .../factory/jp/jobhandler/PullJpDataJob.java | 236 ++++++++++++++++++ .../jp/mapper/JinpaiArrivalOrderMapper.java | 9 + .../factory/jp/mapper/JinpaiOrgIdMapper.java | 10 + .../jp/mapper/JinpaiPushScanLogMapper.java | 9 + .../service/IJinpaiArrivalOrderService.java | 7 + .../jp/service/IJinpaiOrgIdService.java | 7 + .../jp/service/IJinpaiPushScanLogService.java | 7 + .../impl/JinpaiArrivalOrderServiceImpl.java | 15 ++ .../service/impl/JinpaiOrgIdServiceImpl.java | 15 ++ .../impl/JinpaiPushScanLogServiceImpl.java | 15 ++ .../com/logpm/factory/jp/util/JsonUtil.java | 63 +++++ 22 files changed, 889 insertions(+) create mode 100644 blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/jp/entity/JinpaiArrivalOrderEntity.java create mode 100644 blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/jp/entity/JinpaiOrgIdEntity.java create mode 100644 blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/jp/entity/JinpaiPushScanLogEntity.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/ApiResponse.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/LoginRes.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/NowOrg.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/OriginalOrg.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/OwnedOrgs.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/PushScanLog.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/RCookie.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/Tran.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/jobhandler/PullJpDataJob.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/mapper/JinpaiArrivalOrderMapper.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/mapper/JinpaiOrgIdMapper.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/mapper/JinpaiPushScanLogMapper.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/IJinpaiArrivalOrderService.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/IJinpaiOrgIdService.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/IJinpaiPushScanLogService.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/impl/JinpaiArrivalOrderServiceImpl.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/impl/JinpaiOrgIdServiceImpl.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/impl/JinpaiPushScanLogServiceImpl.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/util/JsonUtil.java diff --git a/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/jp/entity/JinpaiArrivalOrderEntity.java b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/jp/entity/JinpaiArrivalOrderEntity.java new file mode 100644 index 000000000..14c1541b7 --- /dev/null +++ b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/jp/entity/JinpaiArrivalOrderEntity.java @@ -0,0 +1,34 @@ +package com.logpm.factory.jp.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +import java.util.Date; + +@Data +@TableName("jinpai_arrival_order") +@ApiModel(value = "JinpaiArrivalOrder对象", description = "金牌到达订单") +@EqualsAndHashCode(callSuper = true) +public class JinpaiArrivalOrderEntity extends BaseEntity { + + private String warehouseName; + private String ddNum; + private String ysNum; + private String contractNumber; + private Date deliveryTime; + private String serviceType; + private String store; + private String storeCode; + private String arrivalStatus; + private Integer total; + private Date arrivalTime; + private String administrators; + private String truckNo; + private Date loadingTime; + private Date actualArrivalTime; + private String source; + +} diff --git a/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/jp/entity/JinpaiOrgIdEntity.java b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/jp/entity/JinpaiOrgIdEntity.java new file mode 100644 index 000000000..f9e9f8ec8 --- /dev/null +++ b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/jp/entity/JinpaiOrgIdEntity.java @@ -0,0 +1,18 @@ +package com.logpm.factory.jp.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +@Data +@TableName("jinpai_org_id") +@ApiModel(value = "JinpaiOrgId对象", description = "金牌组织id") +@EqualsAndHashCode(callSuper = true) +public class JinpaiOrgIdEntity extends BaseEntity { + + private String orgId; + private String orgName; + +} diff --git a/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/jp/entity/JinpaiPushScanLogEntity.java b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/jp/entity/JinpaiPushScanLogEntity.java new file mode 100644 index 000000000..e8415111e --- /dev/null +++ b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/jp/entity/JinpaiPushScanLogEntity.java @@ -0,0 +1,35 @@ +package com.logpm.factory.jp.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +import java.util.Date; + +@Data +@TableName("jinpai_push_scan_log") +@ApiModel(value = "JinpaiPushScanLog对象", description = "金牌扫描记录") +@EqualsAndHashCode(callSuper = true) +public class JinpaiPushScanLogEntity extends BaseEntity { + + private String warehouseName; + private String batchNumber; + private String ysNum; + private String contractNumber; + private String ddNum; + private String unitNo; + private String inStatus; + private String inType; + private String serviceType; + private Date deliveryTime; + private Date scanTime; + private Date arrivalTime; + private String store; + private String storeCode; + private String administrators; + private String source; + + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/ApiResponse.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/ApiResponse.java new file mode 100644 index 000000000..241697b24 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/ApiResponse.java @@ -0,0 +1,17 @@ +package com.logpm.factory.jp.bean; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.util.List; + +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class ApiResponse { + + private int code; + private String message; + private T data; + private List rows; + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/LoginRes.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/LoginRes.java new file mode 100644 index 000000000..ed5d3a06a --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/LoginRes.java @@ -0,0 +1,107 @@ +package com.logpm.factory.jp.bean; + +import lombok.Data; + +import java.util.List; + +@Data +public class LoginRes implements RCookie { + + private String userId; + + private String account; + + private String nickname; + + private String passwordExpirationTime; + + private String username; + + private String password; + + private int sex; + + private int age; + + private String phone; + + private int status; + + private String organizationId; + + private String createTime; + + private String creator; + + private String syscode; + + private String sysname; + + private String orgId; + + private String systemdef; + + private String companyPid; + + private String companyPname; + + private String companyId; + + private String orgName; + + private boolean forceModifyPwd; + + private String customerAuthority; + + private String loginTime; + + private String activeTime; + + private String isEnable; + + private String printFlag; + + private String memberType; + + private String logoUrl; + + private String baseLine; + + private String twoCodeFlag; + + private String labelNewServerSwitch; + + private String mongoBaselineSwitch; + + private String switchConsignerCodeMust; + + private String enterpriseName; + + private int crmVisitSwitch; + + private String switchUserConsignerAdd; + + private String switchSmsCheckOpen; + + private String orgType; + + private String ucgn; + + private String fydFlag; + + private String email; + + private OriginalOrg originalOrg; + + private String originalOrgIndex; + + private NowOrg nowOrg; + + private int nowOrgIndex; + + private List ownedOrgs; + + public String cookie; + + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/NowOrg.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/NowOrg.java new file mode 100644 index 000000000..53d0dc3e3 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/NowOrg.java @@ -0,0 +1,15 @@ +package com.logpm.factory.jp.bean; + +import lombok.Data; + +@Data +public class NowOrg { + + private String id; + + private String code; + + private String name; + + private String orgType; +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/OriginalOrg.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/OriginalOrg.java new file mode 100644 index 000000000..969d26ac6 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/OriginalOrg.java @@ -0,0 +1,16 @@ +package com.logpm.factory.jp.bean; + +import lombok.Data; + +@Data +public class OriginalOrg { + + private String id; + + private String code; + + private String name; + + private String orgType; + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/OwnedOrgs.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/OwnedOrgs.java new file mode 100644 index 000000000..748eb4bc3 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/OwnedOrgs.java @@ -0,0 +1,16 @@ +package com.logpm.factory.jp.bean; + +import lombok.Data; + +@Data +public class OwnedOrgs { + + private String id; + + private String code; + + private String name; + + private String orgType; + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/PushScanLog.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/PushScanLog.java new file mode 100644 index 000000000..1fdabf142 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/PushScanLog.java @@ -0,0 +1,65 @@ +package com.logpm.factory.jp.bean; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class PushScanLog { + + @JsonProperty("REMARK") + private String remark; + @JsonProperty("SYSCODE") + private String sysCode; + private String arriveOrgId; + private String arriveOrgName; + private Integer checkFlag; + private String containerId; + private String deliveryMode; + private String extBoxCode; + private String goodsName; + private Integer goodsNumber; + private Integer goodsNumberOrder; + private String goodsShelves; + private String goodsShelvesName; + private BigDecimal goodsVolume; + private BigDecimal goodsVolumeOrder; + private Integer inventoryStatus; + private String lastOutboundTime; + private String manualContractNo; + private String omsExtOrderNo; + private String omsExtYsId; + private String orgId; + private String orgName; + private String outStockTime; + private Integer outboundQuantities; + private String outboundTime; + private String realEndTime; + private Integer receiptQuantities; + private Integer receiptStatus; + private String receiptTime; + private String receiveType; + private String receivingBatchId; + private String recvSite; + private Integer rowId; + private String sendTime; + private String shopCode; + private String shopName; + private String storageLocLabel; + private String subLabel; + private Integer subLabelPrintFlag; + private String subLabelPrintSeq; + private String toContainerIdFlag; + private Integer toStorageLocFlag; + private String transportId; + private String updateName; + private String updateTime; + private String warehouseArea; + private String warehouseAreaName; + private String yjInstallAddr; + private String yjInstallLinker; + private String yjInstallPhone; + private String yjOrderNo; + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/RCookie.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/RCookie.java new file mode 100644 index 000000000..b6450a9bc --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/RCookie.java @@ -0,0 +1,9 @@ +package com.logpm.factory.jp.bean; + +public interface RCookie { + + String getCookie(); + + void setCookie(String cookie); + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/Tran.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/Tran.java new file mode 100644 index 000000000..aaebbbdb1 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/bean/Tran.java @@ -0,0 +1,164 @@ +package com.logpm.factory.jp.bean; + +import lombok.Data; + +@Data +public class Tran { + + private String id; + + private String orgId; + + private String transportId; + + private String shipId; + + private String shipItemId; + + private String startStockId; + + private String writtenOrderId; + + private String shipWrittenOrderId; + + private String orderId; + + private String customerOrderId; + + private String transportType; + + private String sendSite; + + private String recvSite; + + private String recvContactsId; + + private String receContantsName; + + private String revcMobile; + + private String recvPhone; + + private String recvAddress; + + private String shareFee; + + private String codAmount; + + private String goodsNo; + + private String goodsType; + + private String goodsName; + + private String goodsPack; + + private String goodsNumber; + + private String goodsWeight; + + private String goodsGrossWeight; + + private String goodsNetWeight; + + private String goodsVolume; + + private String goodsAmount; + + private String customerNum; + + private String goodsLength; + + private String goodsWidth; + + private String goodsHeigth; + + private String creator; + + private String createTime; + + private String updateId; + + private String updateTime; + + private String arriveFlag; + + private String arriveTime; + + private String arriveUserId; + + private String flag; + + private String remark; + + private String version; + + private String transportWay; + + private String carriageMode; + + private String carrierName; + + private String carrierContacts; + + private String carrierMobile; + + private String carrierPhone; + + private String carNo; + + private String driverName; + + private String driverMobile; + + private String driverPhone; + + private String planBeginTime; + + private String realBeginTime; + + private String planEndTime; + + private String isEnable; + + private String arriveOrgId; + + private String arriveOrgName; + + private int isAlter; + + private String omsExtYsId; + + private String omsExtOrderNo; + + private String sendTime; + + private String manualContractNo; + + private String shopCode; + + private String shopName; + + private String deliveryMode; + + private String deliveryModeName; + + private String transportStatus; + + private String receiverName; + + private String requireRecvTime; + + private String yjOrderNo; + + private String yjUrgentDate; + + private String yjUrgentType; + + private String arrivalAdvice; + + private String arrivalAdviceName; + + private String arrivalAdviceTime; + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/jobhandler/PullJpDataJob.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/jobhandler/PullJpDataJob.java new file mode 100644 index 000000000..5f4b5f163 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/jobhandler/PullJpDataJob.java @@ -0,0 +1,236 @@ +package com.logpm.factory.jp.jobhandler; + +import cn.hutool.crypto.digest.DigestUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpResponse; +import cn.hutool.http.HttpUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.fasterxml.jackson.core.type.TypeReference; +import com.logpm.factory.jp.bean.*; +import com.logpm.factory.jp.entity.JinpaiArrivalOrderEntity; +import com.logpm.factory.jp.entity.JinpaiOrgIdEntity; +import com.logpm.factory.jp.entity.JinpaiPushScanLogEntity; +import com.logpm.factory.jp.service.IJinpaiArrivalOrderService; +import com.logpm.factory.jp.service.IJinpaiOrgIdService; +import com.logpm.factory.jp.service.IJinpaiPushScanLogService; +import com.logpm.factory.jp.util.JsonUtil; +import com.xxl.job.core.biz.model.ReturnT; +import com.xxl.job.core.handler.annotation.XxlJob; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.common.utils.CommonUtil; +import org.springblade.core.tool.utils.StringUtil; +import org.springframework.stereotype.Component; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import java.util.Objects; + +@Slf4j +@AllArgsConstructor +@Component +public class PullJpDataJob { + + private final IJinpaiOrgIdService jinpaiOrgIdService; + private final IJinpaiArrivalOrderService jinpaiArrivalOrderService; + private final IJinpaiPushScanLogService jinpaiPushScanLogService; + + @XxlJob("pullJpData") + public ReturnT pullJpData(String param) { + log.info("############pullJpData: 拉取金牌数据开始 param={}",param); + List list = new ArrayList<>(); + if(StringUtil.isBlank(param)){ + list = jinpaiOrgIdService.list(); + }else{ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("org_id",param); + JinpaiOrgIdEntity orgIdEntity = jinpaiOrgIdService.getOne(queryWrapper); + if(Objects.isNull(orgIdEntity)){ + log.warn("############pullJpData: 未查询到正确的key值"); + return ReturnT.FAIL; + } + list.add(orgIdEntity); + } + + try{ + + //获取昨天的日子 + Calendar cal = Calendar.getInstance(); + cal.add(Calendar.DATE, -1); + String yesterday = new SimpleDateFormat( "yyyy-MM-dd ").format(cal.getTime()); + log.info("############pullJpData: 同步{}的数据开始",yesterday); + + //登陆【登陆结果中有组织列表】 + LoginRes loginRes = login("17340091775", "ht88888888", "3369"); + + for (JinpaiOrgIdEntity entity:list){ + String key = entity.getOrgId(); + String name = entity.getOrgName(); + log.info("############pullJpData: 目前处理{}的数据",name); + //切换组织【组织切换后,loginRes单cookie会被覆盖】 + if(!"成都仓".equals(name)){ + swapOrga(loginRes, key); + } + int arrivePage = 1; + while(true){ + //查询DD单 arriver + List trans = arriveTrans(loginRes, arrivePage, yesterday,yesterday); + if(!Objects.isNull(trans) && trans.size() != 0){ + List arrivalOrderEntities = new ArrayList<>(); + for (Tran tran:trans){ + String omsExtOrderNo = tran.getOmsExtOrderNo(); + log.info("############pullJpData: 目前处理{}的数据",omsExtOrderNo); + JinpaiArrivalOrderEntity jinpaiArrivalOrderEntity = new JinpaiArrivalOrderEntity(); + jinpaiArrivalOrderEntity.setWarehouseName(tran.getArriveOrgName()); + jinpaiArrivalOrderEntity.setYsNum(tran.getOmsExtYsId()); + jinpaiArrivalOrderEntity.setContractNumber(tran.getManualContractNo()); + jinpaiArrivalOrderEntity.setDdNum(tran.getOmsExtOrderNo()); + jinpaiArrivalOrderEntity.setDeliveryTime(StringUtil.isBlank(tran.getSendTime())?null:CommonUtil.StringToDate(tran.getSendTime())); + jinpaiArrivalOrderEntity.setServiceType(tran.getDeliveryModeName()); + jinpaiArrivalOrderEntity.setStore(tran.getShopName()); + jinpaiArrivalOrderEntity.setStoreCode(tran.getShopCode()); + jinpaiArrivalOrderEntity.setArrivalStatus(tran.getArriveFlag()); + jinpaiArrivalOrderEntity.setTotal(Integer.parseInt(tran.getGoodsNumber())); + jinpaiArrivalOrderEntity.setArrivalTime(StringUtil.isBlank(tran.getPlanEndTime())?null:CommonUtil.StringToDate(tran.getPlanEndTime())); + jinpaiArrivalOrderEntity.setAdministrators(tran.getArrivalAdviceName()); + jinpaiArrivalOrderEntity.setTruckNo(tran.getTransportId()); + jinpaiArrivalOrderEntity.setLoadingTime(StringUtil.isBlank(tran.getCreateTime())?null:CommonUtil.StringToDate(tran.getCreateTime())); + jinpaiArrivalOrderEntity.setActualArrivalTime(StringUtil.isBlank(tran.getArriveTime())?null:CommonUtil.StringToDate(tran.getArriveTime())); + jinpaiArrivalOrderEntity.setSource("3369"); + arrivalOrderEntities.add(jinpaiArrivalOrderEntity); + } + jinpaiArrivalOrderService.saveBatch(arrivalOrderEntities); + }else{ + break; + } + arrivePage++; + } + + //拉取推动数据 + int pushPage = 1; + while(true){ + //查询DD单 arriver + List pushScanLogs = pushScanLog(loginRes, pushPage, yesterday,yesterday); + if(!Objects.isNull(pushScanLogs) && pushScanLogs.size() != 0){ + List pushScanLogEntities = new ArrayList<>(); + for (PushScanLog pushScanLog:pushScanLogs){ + String extBoxCode = pushScanLog.getExtBoxCode(); + log.info("############pullJpData: 目前处理推送{}的数据",extBoxCode); + JinpaiPushScanLogEntity jinpaiPushScanLogEntity = new JinpaiPushScanLogEntity(); + jinpaiPushScanLogEntity.setWarehouseName(pushScanLog.getOrgName()); + jinpaiPushScanLogEntity.setBatchNumber(pushScanLog.getReceivingBatchId()); + jinpaiPushScanLogEntity.setYsNum(pushScanLog.getOmsExtYsId()); + jinpaiPushScanLogEntity.setContractNumber(pushScanLog.getManualContractNo()); + jinpaiPushScanLogEntity.setDdNum(pushScanLog.getOmsExtOrderNo()); + jinpaiPushScanLogEntity.setUnitNo(pushScanLog.getExtBoxCode()); + jinpaiPushScanLogEntity.setInStatus(pushScanLog.getReceiptStatus()+""); + jinpaiPushScanLogEntity.setInType(pushScanLog.getReceiveType()); + jinpaiPushScanLogEntity.setDeliveryTime(StringUtil.isBlank(pushScanLog.getSendTime())?null:CommonUtil.StringToDate(pushScanLog.getSendTime())); + jinpaiPushScanLogEntity.setScanTime(StringUtil.isBlank(pushScanLog.getReceiptTime())?null:CommonUtil.StringToDate(pushScanLog.getReceiptTime())); + jinpaiPushScanLogEntity.setArrivalTime(StringUtil.isBlank(pushScanLog.getRealEndTime())?null:CommonUtil.StringToDate(pushScanLog.getRealEndTime())); + jinpaiPushScanLogEntity.setStore(pushScanLog.getShopName()); + jinpaiPushScanLogEntity.setStoreCode(pushScanLog.getShopCode()); + jinpaiPushScanLogEntity.setAdministrators(pushScanLog.getUpdateName()); + jinpaiPushScanLogEntity.setSource("3369"); + pushScanLogEntities.add(jinpaiPushScanLogEntity); + } + jinpaiPushScanLogService.saveBatch(pushScanLogEntities); + }else{ + break; + } + pushPage++; + } + } + }catch (Exception e){ + log.error("系统问题",e); + return ReturnT.FAIL; + } + return ReturnT.SUCCESS; + } + + + private LoginRes login(String account,String password,String syscode){ + HttpRequest httpRequest = HttpUtil.createPost("https://yjtms.yuanfusc.com/tms/system/loginIn.do"); + httpRequest.body("account="+account+"&password="+ DigestUtil.sha256Hex(password)+"&syscode="+syscode); + httpRequest.header("User-Agent","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36"); + httpRequest.header("Referer","https://yjtms.yuanfusc.com/"); + HttpResponse httpResponse = httpRequest.execute(); + String cookie = httpResponse.header("Set-Cookie"); + ApiResponse apiResponse = JsonUtil.toBean(httpResponse.bodyBytes(), new TypeReference>() { + }); + if (apiResponse.getCode() != 0)throw new RuntimeException(apiResponse.getMessage()); + apiResponse.getData().setCookie(cookie); + return apiResponse.getData(); + } + + + private List arriveTrans(RCookie cookie, int page, String start, String end){ + HttpRequest httpRequest = HttpUtil.createGet("https://yjtms.yuanfusc.com/tms/transport/arriveTrans/list.do?page="+page+"&rows=500&condition=%7B%22arrivalAdvice%22%3A1%2C%22realBeginTimeStart%22%3A%22"+start+"%2000%3A00%3A00%22%2C%22realBeginTimeEnd%22%3A%22"+end+"%2023%3A59%3A59%22%7D&sort=yjUrgentType&order=asc"); + httpRequest.header("User-Agent","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36"); + httpRequest.header("Referer","https://yjtms.yuanfusc.com/"); + httpRequest.cookie(cookie.getCookie()); + log.info("################arriveTrans: httpRequest={}",httpRequest); + HttpResponse httpResponse = httpRequest.execute(); + byte[] bytes = httpResponse.bodyBytes(); + if(Objects.isNull(bytes)){ + for (int i = 0; i < 3; i++) { + httpResponse = httpRequest.execute(); + byte[] b = httpResponse.bodyBytes(); + if(!Objects.isNull(b)){ + bytes = b; + break; + } + } + } + log.info("################arriveTrans: httpResponse={}",httpResponse); + ApiResponse apiResponse = JsonUtil.toBean(bytes, new TypeReference>() { + }); + httpResponse.close(); + if (apiResponse.getCode() != 0)throw new RuntimeException(apiResponse.getMessage()); + return apiResponse.getRows(); + } + + private List pushScanLog(RCookie cookie, int page, String start, String end){ + HttpRequest httpRequest = HttpUtil.createGet("https://yjtms.yuanfusc.com/i-report/stockreceive/scanreceivelist.do?page="+page+"&rows=500&condition=%7B%22queryType%22%3A2%2C%22orgIds%22%3A%22fbb8dd984b164150aaac1694cce41f8f%22%2C%22receiptTimeBegin%22%3A%22"+start+"%2000%3A00%3A00%22%2C%22receiptTimeEnd%22%3A%22"+end+"%2023%3A59%3A59%22%7D"); + httpRequest.header("User-Agent","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36"); + httpRequest.header("Referer","https://yjtms.yuanfusc.com/"); + httpRequest.cookie(cookie.getCookie()); + log.info("################pushScanLog: httpRequest={}",httpRequest); + HttpResponse httpResponse = httpRequest.execute(); + byte[] bytes = httpResponse.bodyBytes(); + if(Objects.isNull(bytes)){ + for (int i = 0; i < 3; i++) { + httpResponse = httpRequest.execute(); + byte[] b = httpResponse.bodyBytes(); + if(!Objects.isNull(b)){ + bytes = b; + break; + } + } + } + log.info("################pushScanLog: httpResponse={}",httpResponse); + ApiResponse apiResponse = JsonUtil.toBean(bytes, new TypeReference>() { + }); + httpResponse.close(); + if (apiResponse.getCode() != 0)throw new RuntimeException(apiResponse.getMessage()); + return apiResponse.getRows(); + } + + + + private void swapOrga(RCookie cookie, String orgId){ + HttpRequest httpRequest = HttpUtil.createGet("https://yjtms.yuanfusc.com/tms/system/swapOrga.do?swapOrgaId="+orgId); + httpRequest.header("User-Agent","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36"); + httpRequest.header("Referer","https://yjtms.yuanfusc.com/"); + httpRequest.cookie(cookie.getCookie()); + HttpResponse httpResponse = httpRequest.execute(); + ApiResponse apiResponse = JsonUtil.toBean(httpResponse.bodyBytes(), new TypeReference>() { + }); + if (apiResponse.getCode() != 0)throw new RuntimeException(apiResponse.getMessage()); + cookie.setCookie(httpResponse.header("Set-Cookie")); + } + + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/mapper/JinpaiArrivalOrderMapper.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/mapper/JinpaiArrivalOrderMapper.java new file mode 100644 index 000000000..a164a4fbb --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/mapper/JinpaiArrivalOrderMapper.java @@ -0,0 +1,9 @@ +package com.logpm.factory.jp.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.factory.jp.entity.JinpaiArrivalOrderEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface JinpaiArrivalOrderMapper extends BaseMapper { +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/mapper/JinpaiOrgIdMapper.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/mapper/JinpaiOrgIdMapper.java new file mode 100644 index 000000000..446ed7ee9 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/mapper/JinpaiOrgIdMapper.java @@ -0,0 +1,10 @@ +package com.logpm.factory.jp.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.factory.jp.entity.JinpaiOrgIdEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface JinpaiOrgIdMapper extends BaseMapper { + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/mapper/JinpaiPushScanLogMapper.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/mapper/JinpaiPushScanLogMapper.java new file mode 100644 index 000000000..dff72bba0 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/mapper/JinpaiPushScanLogMapper.java @@ -0,0 +1,9 @@ +package com.logpm.factory.jp.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.factory.jp.entity.JinpaiPushScanLogEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface JinpaiPushScanLogMapper extends BaseMapper { +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/IJinpaiArrivalOrderService.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/IJinpaiArrivalOrderService.java new file mode 100644 index 000000000..d7e1f7181 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/IJinpaiArrivalOrderService.java @@ -0,0 +1,7 @@ +package com.logpm.factory.jp.service; + +import com.logpm.factory.jp.entity.JinpaiArrivalOrderEntity; +import org.springblade.core.mp.base.BaseService; + +public interface IJinpaiArrivalOrderService extends BaseService { +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/IJinpaiOrgIdService.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/IJinpaiOrgIdService.java new file mode 100644 index 000000000..80a5f14ca --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/IJinpaiOrgIdService.java @@ -0,0 +1,7 @@ +package com.logpm.factory.jp.service; + +import com.logpm.factory.jp.entity.JinpaiOrgIdEntity; +import org.springblade.core.mp.base.BaseService; + +public interface IJinpaiOrgIdService extends BaseService { +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/IJinpaiPushScanLogService.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/IJinpaiPushScanLogService.java new file mode 100644 index 000000000..c2b534b3b --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/IJinpaiPushScanLogService.java @@ -0,0 +1,7 @@ +package com.logpm.factory.jp.service; + +import com.logpm.factory.jp.entity.JinpaiPushScanLogEntity; +import org.springblade.core.mp.base.BaseService; + +public interface IJinpaiPushScanLogService extends BaseService { +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/impl/JinpaiArrivalOrderServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/impl/JinpaiArrivalOrderServiceImpl.java new file mode 100644 index 000000000..5f3894327 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/impl/JinpaiArrivalOrderServiceImpl.java @@ -0,0 +1,15 @@ +package com.logpm.factory.jp.service.impl; + +import com.logpm.factory.jp.entity.JinpaiArrivalOrderEntity; +import com.logpm.factory.jp.mapper.JinpaiArrivalOrderMapper; +import com.logpm.factory.jp.service.IJinpaiArrivalOrderService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +@Service +@AllArgsConstructor +@Slf4j +public class JinpaiArrivalOrderServiceImpl extends BaseServiceImpl implements IJinpaiArrivalOrderService { +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/impl/JinpaiOrgIdServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/impl/JinpaiOrgIdServiceImpl.java new file mode 100644 index 000000000..87240948c --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/impl/JinpaiOrgIdServiceImpl.java @@ -0,0 +1,15 @@ +package com.logpm.factory.jp.service.impl; + +import com.logpm.factory.jp.entity.JinpaiOrgIdEntity; +import com.logpm.factory.jp.mapper.JinpaiOrgIdMapper; +import com.logpm.factory.jp.service.IJinpaiOrgIdService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +@Service +@AllArgsConstructor +@Slf4j +public class JinpaiOrgIdServiceImpl extends BaseServiceImpl implements IJinpaiOrgIdService { +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/impl/JinpaiPushScanLogServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/impl/JinpaiPushScanLogServiceImpl.java new file mode 100644 index 000000000..c071b90e6 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/service/impl/JinpaiPushScanLogServiceImpl.java @@ -0,0 +1,15 @@ +package com.logpm.factory.jp.service.impl; + +import com.logpm.factory.jp.entity.JinpaiPushScanLogEntity; +import com.logpm.factory.jp.mapper.JinpaiPushScanLogMapper; +import com.logpm.factory.jp.service.IJinpaiPushScanLogService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +@Service +@AllArgsConstructor +@Slf4j +public class JinpaiPushScanLogServiceImpl extends BaseServiceImpl implements IJinpaiPushScanLogService { +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/util/JsonUtil.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/util/JsonUtil.java new file mode 100644 index 000000000..0c41b37eb --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jp/util/JsonUtil.java @@ -0,0 +1,63 @@ +package com.logpm.factory.jp.util; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; +import org.springblade.common.exception.CustomerException; + +import java.io.IOException; + +@Slf4j +public class JsonUtil { + + private static final ObjectMapper objectMapper = new ObjectMapper(); + + static { + //允许单引号 + objectMapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true); + } + + public static T toBean(byte[] bytes, Class tClass) { + try { + return objectMapper.readValue(bytes, tClass); + } catch (IOException e) { + throw new CustomerException(500,"处理失败"); + } + } + + public static T toBean(String bytes, Class tClass) { + try { + return objectMapper.readValue(bytes, tClass); + } catch (IOException e) { + throw new CustomerException(500,"处理失败"); + } + } + + public static T toBean(String bytes, TypeReference valueTypeRef) { + try { + return objectMapper.readValue(bytes, valueTypeRef); + } catch (IOException e) { + throw new CustomerException(500,"处理失败"); + } + } + + public static T toBean(byte[] bytes, TypeReference valueTypeRef) { + try { + log.info("###############toBean: bytes={} valueTypeRef={}",bytes,valueTypeRef); + return objectMapper.readValue(bytes, valueTypeRef); + } catch (IOException e) { + throw new CustomerException(500,"处理失败"); + } + } + + public static String toString(Object obj) { + try { + return objectMapper.writeValueAsString(obj); + } catch (JsonProcessingException e) { + throw new CustomerException(500,"处理失败"); + } + } + +}