From 0fedbf70a9697b18a9b9e6042db9c4be5ad27dc2 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Mon, 19 Feb 2024 10:40:48 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PanFactoryDataServiceImpl.java | 79 +++++++++---------- 1 file changed, 38 insertions(+), 41 deletions(-) diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java index ce958ce0f..65f193e68 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java @@ -31,7 +31,6 @@ import com.logpm.factory.pan.service.IPanPackageInfoService; import com.logpm.factory.pan.service.IPanPackageListService; import com.logpm.factory.props.PanFactoryProperties; import com.logpm.factory.snm.bean.Resp; -import com.logpm.factory.snm.entity.OrderStatusLog; import com.logpm.factory.snm.entity.PanFactoryOrder; import com.logpm.factory.snm.entity.PanPackageInfo; import com.logpm.factory.snm.entity.PanPackageList; @@ -51,8 +50,7 @@ import com.logpm.warehouse.feign.IWarehouseTrayTypeClient; import com.logpm.warehouse.feign.IWarehouseWaybillClient; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; + import org.springblade.common.constant.TenantNum; import org.springblade.common.constant.order.*; import org.springblade.common.constant.orderpackage.*; @@ -73,7 +71,6 @@ import java.util.*; @Service public class PanFactoryDataServiceImpl implements IPanFactoryDataService { - private static final Logger logger = LoggerFactory.getLogger(PanFactoryDataServiceImpl.class); private final IPanFactoryOrderService factoryOrderService; @@ -125,7 +122,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { // .eq("appsecret",appSecret); // FactoryAccount factoryAccount = factoryAccountService.getOne(queryWrapper); // if(Objects.isNull(factoryAccount)){ -// logger.warn("未存在对应账户corpid={},appkey={},appsecret={}",corpId,appKey,appSecret); +// log.warn("未存在对应账户corpid={},appkey={},appsecret={}",corpId,appKey,appSecret); // throw new CustomerException(400,"未存在对应账户,请联系管理员"); // } // @@ -170,7 +167,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { queryWrapper.eq("delivery_number", orderInfoDTO.getDeliveryNumber()); PanFactoryOrder panFactoryOrder = factoryOrderService.getOne(queryWrapper); if (Objects.isNull(panFactoryOrder)) { - logger.info("#############handleData: 未找到订单数据 合同自编码orderNo={}", orderNo); + log.info("#############handleData: 未找到订单数据 合同自编码orderNo={}", orderNo); return R.fail(400, "未找到订单数据"); } String plantId = panFactoryOrder.getPlantId();//工厂id @@ -180,7 +177,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { //判断数据是都已存在 if (!orderInfoDTO.verifyData()) { - logger.info("#############handleData: 数据不齐全 orderInfoDTO={}", orderInfoDTO); + log.info("#############handleData: 数据不齐全 orderInfoDTO={}", orderInfoDTO); return R.fail(405, "数据不齐全"); } @@ -195,7 +192,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { String panToken = getPanToken(); //请求参数 - logger.info("##############handleData: 推送包件状态请求参数 {}", s); + log.info("##############handleData: 推送包件状态请求参数 {}", s); //处理逻辑 String result = HttpRequest.post(panFactoryProperties.getUrl() + "/hitf/v1/rest/invoke?namespace=HZERO&serverCode=OPEN&interfaceCode=HUITONG_MID_RECEIVE") .header("Authorization", "Bearer " + panToken) @@ -203,7 +200,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { .body(s).timeout(5 * 1000) .execute().body(); - logger.info("##############handleData: 推送包件状态返回参数 {}", result); + log.info("##############handleData: 推送包件状态返回参数 {}", result); //把结果字符串转为json对象 JSONObject jsonObject = JSONObject.parseObject(result); @@ -212,7 +209,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { Integer code = payload.getInteger("code"); String message = payload.getString("data"); if (code.equals(1)) { - logger.info("##########handleData: 物流状态传递成功"); + log.info("##########handleData: 物流状态传递成功"); } else { return R.fail(405, message); } @@ -234,7 +231,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { String status = orderStatusDTO.getStatus(); if ("1".equals(status) || "2".equals(status) || "5".equals(status) || "6".equals(status) || "8".equals(status) || "9".equals(status)) { - logger.info("#############handleStatusData: 当前数据的状态不推送 status={}", status); + log.info("#############handleStatusData: 当前数据的状态不推送 status={}", status); return Resp.fail(400, "当前数据的状态不推送"); } @@ -245,7 +242,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { packageInfoQueryWrapper.eq("unit_no", unitNo); PanPackageInfo one = panPackageInfoService.getOne(packageInfoQueryWrapper); if (Objects.isNull(one)) { - logger.info("#############handleStatusData: 当前包条码未找到对应数据unitNo={}", unitNo); + log.info("#############handleStatusData: 当前包条码未找到对应数据unitNo={}", unitNo); return Resp.fail(400, "未找到包件数据"); } String plantId = one.getPlantId(); @@ -268,7 +265,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { //判断数据是都已存在 if (!orderStatusDTO.verifyData()) { - logger.info("#############handleStatusData: 数据不齐全 orderStatusDTO={}", orderStatusDTO); + log.info("#############handleStatusData: 数据不齐全 orderStatusDTO={}", orderStatusDTO); return Resp.fail(405, "数据不齐全"); } @@ -283,7 +280,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { String panToken = getPanToken(); //请求参数 - logger.info("##############handleStatusData: 推送包件状态请求参数 {}", s); + log.info("##############handleStatusData: 推送包件状态请求参数 {}", s); //处理逻辑 String result = HttpRequest.post(panFactoryProperties.getUrl() + "/hitf/v1/rest/invoke?namespace=HZERO&serverCode=OPEN&interfaceCode=HUITONG_RECEIVE") .header("Authorization", "Bearer " + panToken) @@ -291,7 +288,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { .body(s).timeout(5 * 1000) .execute().body(); - logger.info("##############handleStatusData: 推送包件状态返回参数 {}", result); + log.info("##############handleStatusData: 推送包件状态返回参数 {}", result); //把结果字符串转为json对象 JSONObject jsonObject = JSONObject.parseObject(result); @@ -300,7 +297,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { Integer code = payload.getInteger("code"); String message = payload.getString("data"); if (code.equals(1)) { - logger.info("##########handleStatusData: 物流状态传递成功"); + log.info("##########handleStatusData: 物流状态传递成功"); } else { return Resp.fail(405, message); } @@ -324,7 +321,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { statusName = "签收"; break; default: - logger.info("###########statusName: 未知的类型"); + log.info("###########statusName: 未知的类型"); } return statusName; } @@ -341,7 +338,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { .execute() .body(); - logger.info("##############getPanToken: 获取皮阿诺token返回参数 {}", result); + log.info("##############getPanToken: 获取皮阿诺token返回参数 {}", result); //获取的结果转成json对象 JSONObject jsonObject = JSONObject.parseObject(result); @@ -357,7 +354,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { @Transactional @Override public void handleDataToPlatform(String unitNo, String operationTime) { - logger.info("############handleDataToPlatform: 处理数据到platform unitNo={}", unitNo); + log.info("############handleDataToPlatform: 处理数据到platform unitNo={}", unitNo); //先查询包件是否已存入到新系统数据库 DistributionParcelListEntity distributionParcelListEntity = distributionParcelListClient.findByPacketBarCode(unitNo); if (Objects.isNull(distributionParcelListEntity)) { @@ -365,7 +362,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { //1.根据包条码去老系统数据库找到对应的包条信息 AdvanceDetailEntity advanceDetailEntity = advanceDetailClient.getOneByUnitNo(unitNo); if (Objects.isNull(advanceDetailEntity)) { - logger.warn("#################handleDataToPlatform: 未找到对应的包条信息 unitNo={}", unitNo); + log.warn("#################handleDataToPlatform: 未找到对应的包条信息 unitNo={}", unitNo); throw new CustomerException(405, "未找到对应的包条信息"); } //2.根据包条信息拿到订单信息 @@ -374,7 +371,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { //2.1 因为会存在相同订单自编码的订单,所以为了区分订单只有通过id查询 AdvanceEntity advanceEntity = advanceClient.fingById(advanceId); if (Objects.isNull(advanceEntity)) { - logger.warn("#################handleDataToPlatform: 未找到对应的订单信息 advanceId={}", advanceId); + log.warn("#################handleDataToPlatform: 未找到对应的订单信息 advanceId={}", advanceId); throw new CustomerException(405, "未找到对应的订单信息"); } @@ -395,7 +392,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { // OrderDetailEntity orderDetailEntity = orderDetailClient.findByUnitNo(unitNo); // if(Objects.isNull(orderDetailEntity)){ -// logger.warn("############handleDataToPlatform: 包条信息不存在 unitNo={}",unitNo); +// log.warn("############handleDataToPlatform: 包条信息不存在 unitNo={}",unitNo); // throw new CustomerException(405, "包条信息不存在"); // } // Integer oldId = orderDetailEntity.getNowWarehouseId(); @@ -403,7 +400,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { // 查询数据对应的仓库名称 BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.findByName(destinationWarehouse); if(Objects.isNull(basicdataWarehouseEntity)){ - logger.warn("############handleDataToPlatform: 仓库信息不存在 destinationWarehouse={}",destinationWarehouse); + log.warn("############handleDataToPlatform: 仓库信息不存在 destinationWarehouse={}",destinationWarehouse); throw new CustomerException(405, "仓库信息不存在"); } Long warehouseId = basicdataWarehouseEntity.getId(); @@ -425,7 +422,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { if(StringUtil.isNoneBlank(operationTime)){ date = CommonUtil.StringToDate(operationTime); } - logger.info("#################handleDataToPlatform.waybillNoNum: {}", waybillNoNum); + log.info("#################handleDataToPlatform.waybillNoNum: {}", waybillNoNum); distributionStockArticleEntity = new DistributionStockArticleEntity(); distributionStockArticleEntity.setOrderCode(orderSelfNum); @@ -454,14 +451,14 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { } else { distributionStockArticleEntity.setCompleteSet(0); } - logger.info("############basicdataWarehouseEntity {}", basicdataWarehouseEntity); + log.info("############basicdataWarehouseEntity {}", basicdataWarehouseEntity); distributionStockArticleEntity.setCreateDept(basicdataWarehouseEntity.getDepartment()); WayBillEntity wayBillEntity = wayBillClient.getByWayBillByOrderCode(orderSelfNum); if(Objects.isNull(wayBillEntity)){ - logger.error("包条同步失败 ----> 数据异常 包条对应的运单不存在 包件 {} 运单对象 {},",unitNo,wayBillEntity); + log.error("包条同步失败 ----> 数据异常 包条对应的运单不存在 包件 {} 运单对象 {},",unitNo,wayBillEntity); return ; @@ -498,7 +495,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { //通过客户名称去查询客户的服务类型、 distributionStockArticleEntity.setTypeService("1");//默认商配 BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findByName(customerName); - logger.info("订单同步出现的客户编号{} 匹配的客户", basicdataClientEntity); + log.info("订单同步出现的客户编号{} 匹配的客户", basicdataClientEntity); if (!Objects.isNull(basicdataClientEntity)) { //商城 distributionStockArticleEntity.setMallId(basicdataClientEntity.getId()); @@ -507,7 +504,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { // todo 这里需要去查询门店 和新系统的门店ID 进行绑定 String peisongType = getPeisongTypeByClientId(basicdataClientEntity.getId()); - logger.info("订单同步peisongType {} ", peisongType); + log.info("订单同步peisongType {} ", peisongType); if (StringUtil.isNoneBlank(peisongType)) { distributionStockArticleEntity.setTypeService(peisongType); @@ -548,7 +545,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { id = distributionStockArticleClient.addData(distributionStockArticleEntity); distributionStockArticleEntity.setId(id); if (id == 0) { - logger.warn("#################handleDataToPlatform: 保存订单信息失败 orderSelfNum={}", orderSelfNum); + log.warn("#################handleDataToPlatform: 保存订单信息失败 orderSelfNum={}", orderSelfNum); throw new CustomerException(405, "保存订单信息失败"); } }else{ @@ -559,10 +556,10 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { //保存包件信息 saveOrderPackage(unitNo, distributionStockArticleEntity, basicdataWarehouseEntity, waybillNoNum,operationTime,basicdataWarehouseEntity.getOldId()); - logger.info("#################handleDataToPlatform: 数据处理完成"); + log.info("#################handleDataToPlatform: 数据处理完成"); } else { //已存在包件信息那就不处理 - logger.info("#################handleDataToPlatform: 包件信息已存在,不用处理 unitNo={}", unitNo); + log.info("#################handleDataToPlatform: 包件信息已存在,不用处理 unitNo={}", unitNo); } //存入包条缓存 @@ -611,7 +608,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { boolean b = warehouseTrayTypeClient.orderScanOrderPackageCode(map); if(!b){ - logger.error("################saveTrayTypeInfoPackage: 包件打托失败 unitNo={} trayCode={}",unitNo,"T"+trayId); + log.error("################saveTrayTypeInfoPackage: 包件打托失败 unitNo={} trayCode={}",unitNo,"T"+trayId); // throw new CustomerException(403,"包件打托失败"); } @@ -646,7 +643,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { */ private String getPeisongTypeByClientId(Long id) { BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(id, 3); - logger.info(">>>>>>> 查询客户的配送类型{}", basicdataStoreBusinessEntity); + log.info(">>>>>>> 查询客户的配送类型{}", basicdataStoreBusinessEntity); if(ObjectUtil.isEmpty(basicdataStoreBusinessEntity)){ return null; } @@ -677,7 +674,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { //// WarehouseWaybillEntity warehouseWaybill = warehouseWaybillClient.findByWaybillNo(waybillNo); if(Objects.isNull(vo)){ - logger.warn("##############saveOrderPackage: 未在老系统查询到包件数据 unitNo={}",unitNo); + log.warn("##############saveOrderPackage: 未在老系统查询到包件数据 unitNo={}",unitNo); throw new CustomerException(405,"未在老系统查询到包件数据"); }else{ @@ -741,10 +738,10 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { } boolean b = distributionParcelListClient.add(entity); if (!b) { - logger.warn("#################handleDataToPlatform: 保存包件信息失败 orderCode={}", entity.getOrderCode()); + log.warn("#################handleDataToPlatform: 保存包件信息失败 orderCode={}", entity.getOrderCode()); throw new CustomerException(405, "保存包件信息失败"); }else{ - logger.info("################handleDataToPlatform: 保存包件成功 OrderPackageCode={}",vo.getPacketBarCode()); + log.info("################handleDataToPlatform: 保存包件成功 OrderPackageCode={}",vo.getPacketBarCode()); // Integer handQuantity = distributionStockArticleEntity.getHandQuantity(); // Integer totalNumber = distributionStockArticleEntity.getTotalNumber(); // @@ -764,7 +761,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { } private void saveWaybillEntity(String waybillNo) { - logger.info("#################handleDataToPlatform.saveWaybillEntity: {}", waybillNo); + log.info("#################handleDataToPlatform.saveWaybillEntity: {}", waybillNo); if (StringUtil.isBlank(waybillNo)) { return; @@ -777,15 +774,15 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { //通过运单号先去查询新系统是否存在这个运单号 WarehouseWaybillEntity warehouseWaybill = warehouseWaybillClient.findByWaybillNo(waybillNo); - logger.info("#################handleDataToPlatform.warehouseWaybill: {}", warehouseWaybill); + log.info("#################handleDataToPlatform.warehouseWaybill: {}", warehouseWaybill); if (Objects.isNull(warehouseWaybill)) { redis.setEx("dealwithWaybillNo:"+waybillNo,waybillNo,30L); //如果新系统中不存在这个运单,那么就去查询老系统的运单数据 WayBillEntity wayBillEntity = wayBillClient.getByWaybillNo(waybillNo); - logger.info("#################handleDataToPlatform.wayBillEntity: {}", wayBillEntity); + log.info("#################handleDataToPlatform.wayBillEntity: {}", wayBillEntity); if (Objects.isNull(wayBillEntity)) { - logger.warn("##############saveWaybillEntity: 老系统中未找到对应运单waybillNo={}", waybillNo); + log.warn("##############saveWaybillEntity: 老系统中未找到对应运单waybillNo={}", waybillNo); throw new CustomerException("老系统中未找到对应运单"); } String startSite = wayBillEntity.getStartSite();//始发仓名称 @@ -1145,7 +1142,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { factoryOrderDTO.setORDER_ATTRIBUTES(order_attributes); if (order_attributes.isEmpty()) { - logger.info("###########saveData: 没有新增包件,不保存信息"); + log.info("###########saveData: 没有新增包件,不保存信息"); return null; } } From 8ba741dccbe635418746815c3c0f1fd9062ea871 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Mon, 26 Feb 2024 16:33:30 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/utils/PhoneCheckUtil.java | 13 + .../mapper/AftersalesWorkOrderMapper.xml | 2 +- .../BasicdataVehicleController.java | 86 +++- .../excel/BasicdataVehicleImportExcel.java | 387 ++++++++++++++++++ .../excel/BasicdataVehicleImporter.java | 35 ++ .../mapper/BasicdataDriverArteryMapper.java | 9 + .../mapper/BasicdataDriverArteryMapper.xml | 4 + .../mapper/BasicdataVehicleMapper.java | 2 +- .../mapper/BasicdataVehicleMapper.xml | 11 +- .../service/IBasicdataVehicleService.java | 10 +- .../impl/BasicdataVehicleServiceImpl.java | 110 ++++- 11 files changed, 651 insertions(+), 18 deletions(-) create mode 100644 blade-biz-common/src/main/java/org/springblade/common/utils/PhoneCheckUtil.java create mode 100644 blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehicleImportExcel.java create mode 100644 blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehicleImporter.java diff --git a/blade-biz-common/src/main/java/org/springblade/common/utils/PhoneCheckUtil.java b/blade-biz-common/src/main/java/org/springblade/common/utils/PhoneCheckUtil.java new file mode 100644 index 000000000..e319e7837 --- /dev/null +++ b/blade-biz-common/src/main/java/org/springblade/common/utils/PhoneCheckUtil.java @@ -0,0 +1,13 @@ +package org.springblade.common.utils; + +/** + * 电话校验 + */ +public class PhoneCheckUtil { + + public static boolean checkPhone(String phone){ + String regex = "^1[3-9]\\d{9}$"; + return phone.matches(regex); + } + +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml index d7d92b6ab..9c09812f4 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml @@ -125,7 +125,7 @@ date_format(from_unixtime(create_time),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d and lawo.work_order_status in ('20') and lawo.work_order_status in ('30') and lawo.work_order_status in ('30') - and lawo.work_order_status in ('70','80') + and lawo.work_order_status in ('70','80','100') and lawo.customer_service_id = #{param.customerServiceId } and lawo.customer_service_name like concat('%', #{param.customerServiceName },'%') and lawo.waybill_mall_id = #{param.waybillMallId } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehicleController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehicleController.java index efa88aa0e..3cf4a8629 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehicleController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehicleController.java @@ -23,7 +23,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.logpm.basicdata.dto.BasicdataVehicleDTO; import com.logpm.basicdata.dto.BasicdataVehiclePhotoDTO; import com.logpm.basicdata.entity.BasicdataVehicleEntity; -import com.logpm.basicdata.excel.BasicdataVehicleExcel; +import com.logpm.basicdata.excel.*; import com.logpm.basicdata.service.IBasicdataDriverArteryService; import com.logpm.basicdata.service.IBasicdataVehiclePhotoService; import com.logpm.basicdata.service.IBasicdataVehicleService; @@ -45,10 +45,14 @@ import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; import org.springframework.beans.BeanUtils; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import springfox.documentation.annotations.ApiIgnore; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.Map; @@ -201,14 +205,80 @@ public class BasicdataVehicleController extends BladeController { @GetMapping("/export-basicdataVehicle") @ApiOperationSupport(order = 9) @ApiOperation(value = "导出数据", notes = "传入basicdataVehicle") - public void exportBasicdataVehicle(@ApiIgnore @RequestParam Map basicdataVehicle, BladeUser bladeUser, HttpServletResponse response) { - QueryWrapper queryWrapper = Condition.getQueryWrapper(basicdataVehicle, BasicdataVehicleEntity.class); - //if (!AuthUtil.isAdministrator()) { - // queryWrapper.lambda().eq(BasicdataVehicle::getTenantId, bladeUser.getTenantId()); - //} - queryWrapper.lambda().eq(BasicdataVehicleEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); - List list = basicdataVehicleService.exportBasicdataVehicle(queryWrapper); + public void exportBasicdataVehicle(@ApiIgnore @RequestParam String ids, HttpServletResponse response) { + + List list = basicdataVehicleService.exportBasicdataVehicle(ids); ExcelUtil.export(response, "车辆信息表数据" + DateUtil.time(), "车辆信息表数据表", list, BasicdataVehicleExcel.class); } + + /** + * 导出数据 + */ + @GetMapping("/export-vehicleTemplate") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "下载导出模板", notes = "传入basicdataVehicle") + public void exportVehicleTemplate(HttpServletResponse response) { + List list = new ArrayList<>(); + BasicdataVehicleImportExcel basicdataVehicleImportExcel = new BasicdataVehicleImportExcel(); + basicdataVehicleImportExcel.setVehicleNub("鄂HG40Q9"); + basicdataVehicleImportExcel.setVehicleSource("1"); + basicdataVehicleImportExcel.setIsHead("1"); + basicdataVehicleImportExcel.setTrailerType("1"); + basicdataVehicleImportExcel.setVehicleModel("1"); + basicdataVehicleImportExcel.setCarType("1"); + basicdataVehicleImportExcel.setVehicleCommander(new BigDecimal(70.0)); + basicdataVehicleImportExcel.setVehicleHeight(new BigDecimal(70.0)); + basicdataVehicleImportExcel.setApprovedVolume(new BigDecimal(500.0)); + basicdataVehicleImportExcel.setPaymentMethod("1"); + basicdataVehicleImportExcel.setLicensePlateColor("1"); + basicdataVehicleImportExcel.setVehicleCode("代号"); + basicdataVehicleImportExcel.setVehicleColor("1"); + basicdataVehicleImportExcel.setLicensePlateType("1"); + basicdataVehicleImportExcel.setNotes("备注"); + basicdataVehicleImportExcel.setVehicleOwner("如需绑定司机填写司机名称"); + basicdataVehicleImportExcel.setVehicleBrand("车辆品牌"); + basicdataVehicleImportExcel.setEngineCode("B48"); + basicdataVehicleImportExcel.setVehicleQuality(new BigDecimal(500.0)); + basicdataVehicleImportExcel.setLoadMass(new BigDecimal(500.0)); + basicdataVehicleImportExcel.setOuterWidth(new BigDecimal(500.0)); + basicdataVehicleImportExcel.setExpirationTime(new Date()); + basicdataVehicleImportExcel.setRoadTransport("420303001532"); + basicdataVehicleImportExcel.setBusinessLicense("420303001532"); + basicdataVehicleImportExcel.setVehicleUnit("个人"); + basicdataVehicleImportExcel.setVehicleUnitPhone("15678923467"); + basicdataVehicleImportExcel.setVehicleOwnerPhone("如需绑定司机填写司机手机号码"); + basicdataVehicleImportExcel.setVehicleOwnerCard("车辆所属人身份证号"); + basicdataVehicleImportExcel.setCarrierName("汇通运输"); + basicdataVehicleImportExcel.setReviewTime(new Date()); + basicdataVehicleImportExcel.setReviewValidity(24); + basicdataVehicleImportExcel.setInsuranceStartTime(new Date()); + basicdataVehicleImportExcel.setInsuranceEndTime(new Date()); + basicdataVehicleImportExcel.setBodyAdvertising("有"); + basicdataVehicleImportExcel.setBodyAdvertising("有"); + basicdataVehicleImportExcel.setAdvertisementsNewTimes(new Date()); + basicdataVehicleImportExcel.setVehicleParkingCompany("XXX挂靠公司"); + basicdataVehicleImportExcel.setWithGps("1"); + basicdataVehicleImportExcel.setGpsServiceProvider("XXX服务商"); + basicdataVehicleImportExcel.setGpsModel("VT77M"); + basicdataVehicleImportExcel.setDemonstrate("是"); + list.add(basicdataVehicleImportExcel); + ExcelUtil.export(response, "车辆信息表数据" + DateUtil.time(), "车辆信息表数据表", list, BasicdataVehicleImportExcel.class); + } + + + + /** + * 导入司机信息 + */ + @PostMapping("import-basicdataVehicle") + @ApiOperationSupport(order = 12) + @ApiOperation(value = "导入车辆信息", notes = "传入excel") + public R importBasicdataVehicle(MultipartFile file) { + log.info("传入>>>>>>>{}",file); + BasicdataVehicleImporter basicdataDriverArteryImporter = new BasicdataVehicleImporter(basicdataVehicleService); + ExcelUtil.save(file,basicdataDriverArteryImporter, BasicdataVehicleImportExcel.class); + return R.success("操作成功"); + } + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehicleImportExcel.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehicleImportExcel.java new file mode 100644 index 000000000..63a3f78cd --- /dev/null +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehicleImportExcel.java @@ -0,0 +1,387 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basicdata.excel; + + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.ContentRowHeight; +import com.alibaba.excel.annotation.write.style.HeadRowHeight; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + + +/** + * 车辆信息表 Excel实体类 + * + * @author lmy + * @since 2023-05-16 + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class BasicdataVehicleImportExcel implements Serializable { + + private static final long serialVersionUID = 1L; + + + /** + * 车牌号 + */ + @ColumnWidth(20) + @ExcelProperty("车牌号") + private String vehicleNub; + /** + * 车辆来源;1-自有,2-承包,3-外请 + */ + @ColumnWidth(20) + @ExcelProperty("车辆来源;1-自有,2-承包,3-外请") + private String vehicleSource; + /** + * 是否车头;1-车头,2-挂车 + */ + @ColumnWidth(20) + @ExcelProperty("是否车头;1-车头,2-挂车") + private String isHead; + /** + * 挂车类型;1-独享,2-共享 + */ + @ColumnWidth(20) + @ExcelProperty("挂车类型;1-独享,2-共享") + private String trailerType; + /** + * 车辆类型;1-挂车,2-普通货车 + */ + @ColumnWidth(20) + @ExcelProperty("车辆类型;1-挂车,2-普通货车") + private String vehicleModel; + /** + * 车厢类型;1-高栏,2-平板,3-箱车 + */ + @ColumnWidth(20) + @ExcelProperty("车厢类型;1-高栏,2-平板,3-箱车") + private String carType; + /** + * 车长;单位(M) + */ + @ColumnWidth(20) + @ExcelProperty("车长;单位(M)") + private BigDecimal vehicleCommander; + /** + * 外廓高 + */ + @ColumnWidth(20) + @ExcelProperty("外廓高") + private BigDecimal vehicleHeight; + /** + * 付款方式;1-现付,2-月付,3-到付 + */ + @ColumnWidth(20) + @ExcelProperty("付款方式;1-现付,2-月付,3-到付") + private String paymentMethod; + /** + * 核定体积 + */ + @ColumnWidth(20) + @ExcelProperty("核定体积") + private BigDecimal approvedVolume; + /** + * 车牌颜色;1-黄色,2-蓝色,3-绿色,4-蓝绿色,5-其他 + */ + @ColumnWidth(20) + @ExcelProperty("车牌颜色;1-黄色,2-蓝色,3-绿色,4-蓝绿色,5-其他") + private String licensePlateColor; + /** + * 车身颜色;1-红,2-黄,3-蓝,4-黑,5-白,6-银 + */ + @ColumnWidth(20) + @ExcelProperty("车身颜色;1-红,2-黄,3-蓝,4-黑,5-白,6-银") + private String vehicleColor; + /** + * 能源类型;1-汽油,2-柴油,3-电,4-天然气,5-混合油,6-燃化石油气,7-甲醇 + */ + @ColumnWidth(20) + @ExcelProperty("能源类型;1-汽油,2-柴油,3-电,4-天然气,5-混合油,6-燃化石油气,7-甲醇") + private String energyType; + /** + * 车牌类型;1-大型汽车号牌,2-小型汽车号牌 + */ + @ColumnWidth(20) + @ExcelProperty("车牌类型;1-大型汽车号牌,2-小型汽车号牌") + private String licensePlateType; + /** + * 备注 + */ + @ColumnWidth(20) + @ExcelProperty("备注") + private String notes; + /** + * 车辆所属人 + */ + @ColumnWidth(20) + @ExcelProperty("车辆所属人") + private String vehicleOwner; + /** + * 品牌型号 + */ + @ColumnWidth(20) + @ExcelProperty("品牌型号") + private String vehicleBrand; + /** + * 车辆代号 + */ + @ColumnWidth(20) + @ExcelProperty("车辆代号") + private String vehicleCode; + /** + * 发动机型号 + */ + @ColumnWidth(20) + @ExcelProperty("发动机型号") + private String engineCode; + /** + * 车辆总质量;单位(T) + */ + @ColumnWidth(20) + @ExcelProperty("车辆总质量;单位(T)") + private BigDecimal vehicleQuality; + /** + * 整备质量;单位(T) + */ + @ColumnWidth(20) + @ExcelProperty("整备质量;单位(T)") + private BigDecimal curbWeight; + /** + * 载荷质量;单位(T) + */ + @ColumnWidth(20) + @ExcelProperty("载荷质量;单位(T)") + private BigDecimal loadMass; + /** + * 外廓宽;单位(M) + */ + @ColumnWidth(20) + @ExcelProperty("外廓宽;单位(M)") + private BigDecimal outerWidth; + /** + * 到期时间 + */ + @ColumnWidth(20) + @ExcelProperty("到期时间") + private Date expirationTime; + /** + * 道路运输证号 + */ + @ColumnWidth(20) + @ExcelProperty("道路运输证号") + private String roadTransport; + /** + * 经营许可证号 + */ + @ColumnWidth(20) + @ExcelProperty("经营许可证号") + private String businessLicense; + /** + * 车辆所属单位 + */ + @ColumnWidth(20) + @ExcelProperty("车辆所属单位") + private String vehicleUnit; + /** + * 车辆所属单位电话 + */ + @ColumnWidth(20) + @ExcelProperty("车辆所属单位电话") + private String vehicleUnitPhone; + /** + * 车辆所属人手机号 + */ + @ColumnWidth(20) + @ExcelProperty("车辆所属人手机号") + private String vehicleOwnerPhone; + /** + * 车辆所属人身份证号 + */ + @ColumnWidth(20) + @ExcelProperty("车辆所属人身份证号") + private String vehicleOwnerCard; +// /** +// * 行驶证正面照片 +// */ +// @ColumnWidth(20) +// @ExcelProperty("行驶证正面照片") +// private String drivingLicensePhoto; +// /** +// * 行驶证照片反面 +// */ +// @ColumnWidth(20) +// @ExcelProperty("行驶证照片反面") +// private String drivingLicensePhotoBack; +// /** +// * 许可证照片 +// */ +// @ColumnWidth(20) +// @ExcelProperty("许可证照片") +// private String licensePhoto; +// /** +// * 车辆照片(最新) +// */ +// @ColumnWidth(20) +// @ExcelProperty("车辆照片(最新)") +// private String vehiclePhoto; +// /** +// * 车尾照片 +// */ +// @ColumnWidth(20) +// @ExcelProperty("车尾照片") +// private String vehicleRearPhoto; +// /** +// * 道路运输照片 +// */ +// @ColumnWidth(20) +// @ExcelProperty("道路运输照片") +// private String roadTransportPhoto; +// /** +// * 人车合影照片 +// */ +// @ColumnWidth(20) +// @ExcelProperty("人车合影照片") +// private String vehiclePeoplePhoto; +// /** +// * 保险卡照片 +// */ +// @ColumnWidth(20) +// @ExcelProperty("保险卡照片") +// private String insuranceCardPhoto; + /** + * 关联承运商Id + */ + @ColumnWidth(20) + @ExcelProperty("关联承运商Id") + private Long carrierId; + + /** + * 关联承运商Id + */ + @ColumnWidth(20) + @ExcelProperty("承运商名称") + private String carrierName; + /** + * 车辆年审时间 + */ + @ColumnWidth(20) + @ExcelProperty("车辆年审时间") + private Date reviewTime; + /** + * 车辆年审有效期 + */ + @ColumnWidth(20) + @ExcelProperty("车辆年审有效期") + private Integer reviewValidity; + /** + * 车辆保险开始时间 + */ + @ColumnWidth(20) + @ExcelProperty("车辆保险开始时间") + private Date insuranceStartTime; + /** + * 车辆保险结束时间 + */ + @ColumnWidth(20) + @ExcelProperty("车辆保险结束时间") + private Date insuranceEndTime; + /** + * 有无车身广告 + */ + @ColumnWidth(20) + @ExcelProperty("有无车身广告") + private String bodyAdvertising; + /** + * 车身广告跟新时间 + */ + @ColumnWidth(20) + @ExcelProperty("车身广告跟新时间") + private Date advertisementsNewTimes; + /** + * 车辆挂靠公司 + */ + @ColumnWidth(20) + @ExcelProperty("车辆挂靠公司") + private String vehicleParkingCompany; + /** + * 是否有GPS;1-没有,2-有 + */ + @ColumnWidth(20) + @ExcelProperty("是否有GPS;1-没有,2-有") + private String withGps; + /** + * GPS服务商 + */ + @ColumnWidth(20) + @ExcelProperty("GPS服务商") + private String gpsServiceProvider; + /** + * GPS型号 + */ + @ColumnWidth(20) + @ExcelProperty("GPS型号") + private String gpsModel; + /** + * 是否是示例 + */ + @ColumnWidth(20) + @ExcelProperty("是否示例") + private String demonstrate; + + + +// /** +// * 预留1 +// */ +// @ColumnWidth(20) +// @ExcelProperty("预留1") +// private String reserve1; +// /** +// * 预留2 +// */ +// @ColumnWidth(20) +// @ExcelProperty("预留2") +// private String reserve2; +// /** +// * 预留3 +// */ +// @ColumnWidth(20) +// @ExcelProperty("预留3") +// private String reserve3; +// /** +// * 预留4 +// */ +// @ColumnWidth(20) +// @ExcelProperty("预留4") +// private String reserve4; +// /** +// * 预留5 +// */ +// @ColumnWidth(20) +// @ExcelProperty("预留5") +// private String reserve5; + +} diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehicleImporter.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehicleImporter.java new file mode 100644 index 000000000..848070a55 --- /dev/null +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehicleImporter.java @@ -0,0 +1,35 @@ +package com.logpm.basicdata.excel; + + + +import com.logpm.basicdata.service.IBasicdataDriverArteryService; +import com.logpm.basicdata.service.IBasicdataVehicleService; +import lombok.RequiredArgsConstructor; +import org.springblade.core.excel.support.ExcelImporter; + +import java.util.List; + + +/** + * @program: LogisticsPlatform-Service + * @description: + * @author: lmy + * @create: 2023-08-09 10:26 + **/ +@RequiredArgsConstructor +public class BasicdataVehicleImporter implements ExcelImporter { + + private final IBasicdataVehicleService service; + + + + + + /** + * @param data + */ + @Override + public void save(List data) { + service.importDriverArtery(data); + } +} diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.java index 9dd03c15f..21fdfef19 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.java @@ -60,4 +60,13 @@ public interface BasicdataDriverArteryMapper extends BaseMapper findDriverListByName(@Param("driverName") String driverName); void updateIsdeletedByPhone(@Param("phone") String phone); + + /** + * 查询司机信息 + * @param vehicleOwner + * @param vehicleOwnerPhone + * @return + */ + BasicdataDriverArteryEntity findDriverListByPhone(@Param("name") String vehicleOwner,@Param("phone") String vehicleOwnerPhone); + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.xml index a1812ff46..a955116e6 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.xml @@ -163,6 +163,10 @@ where `name` like concat('%',#{driverName},'%') limit 10 + diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java index 03a894a10..e4a68f1fc 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java @@ -51,7 +51,7 @@ public interface BasicdataVehicleMapper extends BaseMapper exportBasicdataVehicle(@Param("ew") Wrapper queryWrapper); + List exportBasicdataVehicle(@Param("ids") List ids); List selectPhotoBymasterId(Long id); /** diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml index f2a470fc5..f184a0133 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml @@ -159,7 +159,16 @@ - SELECT * FROM logpm_basicdata_vehicle + SELECT + lbc.vehicle_nub AS vehicleNub, + lbc.vehicle_source AS vehicleSource, + lbc.is_head AS isHead, + lbc.trailer_type AS trailerType, + lbc.vehicle_model AS vehicleModel, + lbc.car_type AS carType, + lbc.vehicle_commander AS vehicleCommander, + lbc.vehicle_height AS vehicleHeight, + lbc.payment_method AS paymentMethod, + lbc.approved_volume AS approvedVolume, + lbc.license_plate_color AS licensePlateColor, + lbc.vehicle_color AS vehicleColor, + lbc.energy_type AS energyType, + lbc.license_plate_type AS licensePlateType, + lbc.notes AS notes, + GROUP_CONCAT(DISTINCT lbda.name) AS vehicleOwner, + lbc.vehicle_brand ASvehicleBrand, + lbc.vehicle_code AS vehicleCode, + lbc.engine_code AS engineCode, + lbc.vehicle_quality AS vehicleQuality, + lbc.curb_weight AS curbWeight, + lbc.load_mass AS loadMass, + lbc.outer_width AS outerWidth, + lbc.expiration_time AS expirationTime, + lbc.road_transport AS roadTransport, + lbc.business_license AS businessLicense, + lbc.vehicle_unit AS vehicleUnit, + lbc.vehicle_unit_phone AS vehicleUnitPhone, + GROUP_CONCAT(DISTINCT lbda.phone) AS vehicleOwnerPhone, + lbc.vehicle_owner_card AS vehicleOwnerCard, + lbc.driving_license_photo, + lbc.driving_license_photo_back, + lbc.license_photo, + lbc.vehicle_photo, + lbc.vehicle_rear_photo, + lbc.road_transport_photo, + lbc.vehicle_people_photo, + lbc.insurance_card_photo, + lbc.carrier_id, + lbc.review_time AS reviewTime, + lbc.review_validity AS reviewValidity, + lbc.insurance_start_time AS insuranceStartTime, + lbc.insurance_end_time AS insuranceEndTime, + lbc.body_advertising AS bodyAdvertising, + lbc.advertisements_new_times AS advertisementsNewTimes, + lbc.vehicle_parking_company AS vehicleParkingCompany, + lbc.with_gps AS withGps, + lbc.gps_service_provider AS gpsServiceProvider, + lbc.gps_model AS gpsModel, + lbc.carrier_name AS carrierName + FROM + logpm_basicdata_vehicle AS lbc + LEFT JOIN logpm_basicdata_drivermiddle AS lbd ON lbc.id = lbd.brand_id + LEFT JOIN logpm_basicdata_driver_artery AS lbda ON lbd.driver_id = lbda.id is_deleted = 0 @@ -169,6 +223,8 @@ + GROUP BY + lbc.id - select vsr.* from view_scan_record vsr + SELECT + `ldpl`.`id` AS `id`, + `ldpl`.`tenant_id` AS `tenant_id`, + `ldpl`.`create_user` AS `create_user`, + `ldpl`.`create_time` AS `create_time`, + `ldpl`.`update_user` AS `update_user`, + `ldpl`.`update_time` AS `update_time`, + `ldpl`.`status` AS `status`, + `ldpl`.`is_deleted` AS `is_deleted`, + `ldpl`.`create_dept` AS `create_dept`, + `ldpl`.`reserve1` AS `reserve1`, + `ldpl`.`reserve2` AS `reserve2`, + `ldpl`.`reserve3` AS `reserve3`, + `ldpl`.`reserve4` AS `reserve4`, + `ldpl`.`reserve5` AS `reserve5`, + `ldpl`.`warehouse_id` AS `warehouse_id`, + `ldpl`.`warehouse` AS `warehouse`, + `ldpl`.`conditions` AS `conditions`, + `ldpl`.`order_package_code` AS `order_package_code`, + `ldpl`.`cargo_title` AS `cargo_title`, + `ldpl`.`shelf_title` AS `shelf_title`, + `ldpl`.`goods_allocation` AS `goods_allocation`, + `ldpl`.`pallet` AS `pallet`, + `ldpl`.`firsts` AS `firsts`, + `ldpl`.`second` AS `second`, + `ldpl`.`third_product` AS `third_product`, + `ldpl`.`quantity` AS `quantity`, + `ldpl`.`train_number` AS `train_number`, + `ldpl`.`stock_article_id` AS `stock_article_id`, + `ldpl`.`order_code` AS `order_code`, + `ldpl`.`service_number` AS `service_number`, + `ldpl`.`material_id` AS `material_id`, + `ldpl`.`material_name` AS `material_name`, + `ldpl`.`material_code` AS `material_code`, + `ldpl`.`material_unit` AS `material_unit`, + `ldpl`.`brand_id` AS `brand_id`, + `ldpl`.`brand_name` AS `brand_name`, + `ldpl`.`order_package_status` AS `order_package_status`, + `ldpl`.`order_package_freeze_status` AS `order_package_freeze_status`, + `ldpl`.`order_package_grounding_status` AS `order_package_grounding_status`, + `ldpl`.`order_package_stockup_status` AS `order_package_stockup_status`, + `ldpl`.`order_package_reservation_status` AS `order_package_reservation_status`, + `ldpl`.`order_package_loading_status` AS `order_package_loading_status`, + `ldpl`.`waybill_number` AS `waybill_number`, + `ldpl`.`waybill_id` AS `waybill_id`, + `ldpl`.`warehouse_entry_time_end` AS `warehouse_entry_time_end`, + `ldpl`.`dealer_name` AS `dealer_name`, + `ldpl`.`dealer_code` AS `dealer_code`, + `ldpl`.`send_warehouse_id` AS `send_warehouse_id`, + `ldpl`.`send_warehouse_name` AS `send_warehouse_name`, + `ldpl`.`accept_warehouse_id` AS `accept_warehouse_id`, + `ldpl`.`accept_warehouse_name` AS `accept_warehouse_name`, + `ldpl`.`order_package_delivery_status` AS `order_package_delivery_status`, + `ldl`.`create_time` AS `operatorTime`, + `ldl`.`create_user` AS `operatorId`, + '取消装车' AS `scanNodeType`, + '配送' AS `nodeName` + FROM + + `logpm_distribution_parcel_list` `ldpl` + JOIN `logpm_distribution_loadscan` `ldl` ON + `ldpl`.`id` = `ldl`.`package_id` + AND `ldl`.`scan_status` = 1 + + ldpl.is_deleted =0 and ldl.is_deleted =0 + + and ldpl.warehouse_id in + + #{item} + + + + and ldpl.order_code like concat('%',#{param.orderCode},'%') + + + and ldpl.order_package_code like concat('%',#{param.orderPackageCode},'%') + + + and ldpl.service_number like concat('%',#{param.serviceNumber},'%') + + + and ldpl.brand_name like concat('%',#{param.brandName},'%') + + + and ldpl.material_code like concat('%',#{param.materialCode},'%') + + + and ldpl.material_name like concat('%',#{param.materialName},'%') + + + and ldpl.firsts like concat('%',#{param.firsts},'%') + + + and ldpl.second like concat('%',#{param.second},'%') + + + and ldpl.third_product like concat('%',#{param.thirdProduct},'%') + + + UNION ALL + SELECT + `ldpl`.`id` AS `id`, + `ldpl`.`tenant_id` AS `tenant_id`, + `ldpl`.`create_user` AS `create_user`, + `ldpl`.`create_time` AS `create_time`, + `ldpl`.`update_user` AS `update_user`, + `ldpl`.`update_time` AS `update_time`, + `ldpl`.`status` AS `status`, + `ldpl`.`is_deleted` AS `is_deleted`, + `ldpl`.`create_dept` AS `create_dept`, + `ldpl`.`reserve1` AS `reserve1`, + `ldpl`.`reserve2` AS `reserve2`, + `ldpl`.`reserve3` AS `reserve3`, + `ldpl`.`reserve4` AS `reserve4`, + `ldpl`.`reserve5` AS `reserve5`, + `ldpl`.`warehouse_id` AS `warehouse_id`, + `ldpl`.`warehouse` AS `warehouse`, + `ldpl`.`conditions` AS `conditions`, + `ldpl`.`order_package_code` AS `order_package_code`, + `ldpl`.`cargo_title` AS `cargo_title`, + `ldpl`.`shelf_title` AS `shelf_title`, + `ldpl`.`goods_allocation` AS `goods_allocation`, + `ldpl`.`pallet` AS `pallet`, + `ldpl`.`firsts` AS `firsts`, + `ldpl`.`second` AS `second`, + `ldpl`.`third_product` AS `third_product`, + `ldpl`.`quantity` AS `quantity`, + `ldpl`.`train_number` AS `train_number`, + `ldpl`.`stock_article_id` AS `stock_article_id`, + `ldpl`.`order_code` AS `order_code`, + `ldpl`.`service_number` AS `service_number`, + `ldpl`.`material_id` AS `material_id`, + `ldpl`.`material_name` AS `material_name`, + `ldpl`.`material_code` AS `material_code`, + `ldpl`.`material_unit` AS `material_unit`, + `ldpl`.`brand_id` AS `brand_id`, + `ldpl`.`brand_name` AS `brand_name`, + `ldpl`.`order_package_status` AS `order_package_status`, + `ldpl`.`order_package_freeze_status` AS `order_package_freeze_status`, + `ldpl`.`order_package_grounding_status` AS `order_package_grounding_status`, + `ldpl`.`order_package_stockup_status` AS `order_package_stockup_status`, + `ldpl`.`order_package_reservation_status` AS `order_package_reservation_status`, + `ldpl`.`order_package_loading_status` AS `order_package_loading_status`, + `ldpl`.`waybill_number` AS `waybill_number`, + `ldpl`.`waybill_id` AS `waybill_id`, + `ldpl`.`warehouse_entry_time_end` AS `warehouse_entry_time_end`, + `ldpl`.`dealer_name` AS `dealer_name`, + `ldpl`.`dealer_code` AS `dealer_code`, + `ldpl`.`send_warehouse_id` AS `send_warehouse_id`, + `ldpl`.`send_warehouse_name` AS `send_warehouse_name`, + `ldpl`.`accept_warehouse_id` AS `accept_warehouse_id`, + `ldpl`.`accept_warehouse_name` AS `accept_warehouse_name`, + `ldpl`.`order_package_delivery_status` AS `order_package_delivery_status`, + `ldl`.`create_time` AS `operatorTime`, + `ldl`.`create_user` AS `operatorId`, + '装车' AS `scanNodeType`, + '配送' AS `nodeName` + FROM + `logpm_distribution_parcel_list` `ldpl` + JOIN `logpm_distribution_loadscan` `ldl` ON + `ldpl`.`id` = `ldl`.`package_id` + AND `ldl`.`scan_status` != 1 + + + and ldpl.warehouse_id in + + #{item} + + + + and ldpl.order_code like concat('%',#{param.orderCode},'%') + + + and ldpl.order_package_code like concat('%',#{param.orderPackageCode},'%') + + + and ldpl.service_number like concat('%',#{param.serviceNumber},'%') + + + and ldpl.brand_name like concat('%',#{param.brandName},'%') + + + and ldpl.material_code like concat('%',#{param.materialCode},'%') + + + and ldpl.material_name like concat('%',#{param.materialName},'%') + + + and ldpl.firsts like concat('%',#{param.firsts},'%') + + + and ldpl.second like concat('%',#{param.second},'%') + + + and ldpl.third_product like concat('%',#{param.thirdProduct},'%') + + + UNION ALL + SELECT + `ldpl`.`id` AS `id`, + `ldpl`.`tenant_id` AS `tenant_id`, + `ldpl`.`create_user` AS `create_user`, + `ldpl`.`create_time` AS `create_time`, + `ldpl`.`update_user` AS `update_user`, + `ldpl`.`update_time` AS `update_time`, + `ldpl`.`status` AS `status`, + `ldpl`.`is_deleted` AS `is_deleted`, + `ldpl`.`create_dept` AS `create_dept`, + `ldpl`.`reserve1` AS `reserve1`, + `ldpl`.`reserve2` AS `reserve2`, + `ldpl`.`reserve3` AS `reserve3`, + `ldpl`.`reserve4` AS `reserve4`, + `ldpl`.`reserve5` AS `reserve5`, + `ldpl`.`warehouse_id` AS `warehouse_id`, + `ldpl`.`warehouse` AS `warehouse`, + `ldpl`.`conditions` AS `conditions`, + `ldpl`.`order_package_code` AS `order_package_code`, + `ldpl`.`cargo_title` AS `cargo_title`, + `ldpl`.`shelf_title` AS `shelf_title`, + `ldpl`.`goods_allocation` AS `goods_allocation`, + `ldpl`.`pallet` AS `pallet`, + `ldpl`.`firsts` AS `firsts`, + `ldpl`.`second` AS `second`, + `ldpl`.`third_product` AS `third_product`, + `ldpl`.`quantity` AS `quantity`, + `ldpl`.`train_number` AS `train_number`, + `ldpl`.`stock_article_id` AS `stock_article_id`, + `ldpl`.`order_code` AS `order_code`, + `ldpl`.`service_number` AS `service_number`, + `ldpl`.`material_id` AS `material_id`, + `ldpl`.`material_name` AS `material_name`, + `ldpl`.`material_code` AS `material_code`, + `ldpl`.`material_unit` AS `material_unit`, + `ldpl`.`brand_id` AS `brand_id`, + `ldpl`.`brand_name` AS `brand_name`, + `ldpl`.`order_package_status` AS `order_package_status`, + `ldpl`.`order_package_freeze_status` AS `order_package_freeze_status`, + `ldpl`.`order_package_grounding_status` AS `order_package_grounding_status`, + `ldpl`.`order_package_stockup_status` AS `order_package_stockup_status`, + `ldpl`.`order_package_reservation_status` AS `order_package_reservation_status`, + `ldpl`.`order_package_loading_status` AS `order_package_loading_status`, + `ldpl`.`waybill_number` AS `waybill_number`, + `ldpl`.`waybill_id` AS `waybill_id`, + `ldpl`.`warehouse_entry_time_end` AS `warehouse_entry_time_end`, + `ldpl`.`dealer_name` AS `dealer_name`, + `ldpl`.`dealer_code` AS `dealer_code`, + `ldpl`.`send_warehouse_id` AS `send_warehouse_id`, + `ldpl`.`send_warehouse_name` AS `send_warehouse_name`, + `ldpl`.`accept_warehouse_id` AS `accept_warehouse_id`, + `ldpl`.`accept_warehouse_name` AS `accept_warehouse_name`, + `ldpl`.`order_package_delivery_status` AS `order_package_delivery_status`, + `ldl`.`create_time` AS `operatorTime`, + `ldl`.`create_user` AS `operatorId`, + '签收' AS `scanNodeType`, + '配送' AS `nodeName` + FROM + `logpm_distribution_parcel_list` `ldpl` + JOIN `logpm_distribution_loadscan` `ldl` ON + `ldpl`.`id` = `ldl`.`package_id` + AND `ldl`.`signfor_state` = 2 + + + and ldpl.warehouse_id in + + #{item} + + + + and ldpl.order_code like concat('%',#{param.orderCode},'%') + + + and ldpl.order_package_code like concat('%',#{param.orderPackageCode},'%') + + + and ldpl.service_number like concat('%',#{param.serviceNumber},'%') + + + and ldpl.brand_name like concat('%',#{param.brandName},'%') + + + and ldpl.material_code like concat('%',#{param.materialCode},'%') + + + and ldpl.material_name like concat('%',#{param.materialName},'%') + + + and ldpl.firsts like concat('%',#{param.firsts},'%') + + + and ldpl.second like concat('%',#{param.second},'%') + + + and ldpl.third_product like concat('%',#{param.thirdProduct},'%') + + + UNION ALL + SELECT + `ldpl`.`id` AS `id`, + `ldpl`.`tenant_id` AS `tenant_id`, + `ldpl`.`create_user` AS `create_user`, + `ldpl`.`create_time` AS `create_time`, + `ldpl`.`update_user` AS `update_user`, + `ldpl`.`update_time` AS `update_time`, + `ldpl`.`status` AS `status`, + `ldpl`.`is_deleted` AS `is_deleted`, + `ldpl`.`create_dept` AS `create_dept`, + `ldpl`.`reserve1` AS `reserve1`, + `ldpl`.`reserve2` AS `reserve2`, + `ldpl`.`reserve3` AS `reserve3`, + `ldpl`.`reserve4` AS `reserve4`, + `ldpl`.`reserve5` AS `reserve5`, + `ldpl`.`warehouse_id` AS `warehouse_id`, + `ldpl`.`warehouse` AS `warehouse`, + `ldpl`.`conditions` AS `conditions`, + `ldpl`.`order_package_code` AS `order_package_code`, + `ldpl`.`cargo_title` AS `cargo_title`, + `ldpl`.`shelf_title` AS `shelf_title`, + `ldpl`.`goods_allocation` AS `goods_allocation`, + `ldpl`.`pallet` AS `pallet`, + `ldpl`.`firsts` AS `firsts`, + `ldpl`.`second` AS `second`, + `ldpl`.`third_product` AS `third_product`, + `ldpl`.`quantity` AS `quantity`, + `ldpl`.`train_number` AS `train_number`, + `ldpl`.`stock_article_id` AS `stock_article_id`, + `ldpl`.`order_code` AS `order_code`, + `ldpl`.`service_number` AS `service_number`, + `ldpl`.`material_id` AS `material_id`, + `ldpl`.`material_name` AS `material_name`, + `ldpl`.`material_code` AS `material_code`, + `ldpl`.`material_unit` AS `material_unit`, + `ldpl`.`brand_id` AS `brand_id`, + `ldpl`.`brand_name` AS `brand_name`, + `ldpl`.`order_package_status` AS `order_package_status`, + `ldpl`.`order_package_freeze_status` AS `order_package_freeze_status`, + `ldpl`.`order_package_grounding_status` AS `order_package_grounding_status`, + `ldpl`.`order_package_stockup_status` AS `order_package_stockup_status`, + `ldpl`.`order_package_reservation_status` AS `order_package_reservation_status`, + `ldpl`.`order_package_loading_status` AS `order_package_loading_status`, + `ldpl`.`waybill_number` AS `waybill_number`, + `ldpl`.`waybill_id` AS `waybill_id`, + `ldpl`.`warehouse_entry_time_end` AS `warehouse_entry_time_end`, + `ldpl`.`dealer_name` AS `dealer_name`, + `ldpl`.`dealer_code` AS `dealer_code`, + `ldpl`.`send_warehouse_id` AS `send_warehouse_id`, + `ldpl`.`send_warehouse_name` AS `send_warehouse_name`, + `ldpl`.`accept_warehouse_id` AS `accept_warehouse_id`, + `ldpl`.`accept_warehouse_name` AS `accept_warehouse_name`, + `ldpl`.`order_package_delivery_status` AS `order_package_delivery_status`, + `lds`.`create_time` AS `operatorTime`, + `lds`.`create_user` AS `operatorId`,( + CASE + + WHEN ( `lds`.`conditions` = 1 ) THEN + '配送备货' + WHEN ( `lds`.`conditions` = 2 ) THEN + '自提备货' + END + ) AS `scanNodeType`, + '备货' AS `nodeName` + FROM + `logpm_distribution_parcel_list` `ldpl` + JOIN `logpm_distribution_stock` `lds` ON + `ldpl`.`id` = `lds`.`parcel_list_id` - vsr.is_deleted =0 - - and vsr.nodeName like concat('%',#{param.nodeName},'%') + + and ldpl.warehouse_id in + + #{item} + + + + and ldpl.order_code like concat('%',#{param.orderCode},'%') + + + and ldpl.order_package_code like concat('%',#{param.orderPackageCode},'%') + + + and ldpl.service_number like concat('%',#{param.serviceNumber},'%') + + + and ldpl.brand_name like concat('%',#{param.brandName},'%') + + + and ldpl.material_code like concat('%',#{param.materialCode},'%') + + + and ldpl.material_name like concat('%',#{param.materialName},'%') + + + and ldpl.firsts like concat('%',#{param.firsts},'%') + + and ldpl.second like concat('%',#{param.second},'%') + + + and ldpl.third_product like concat('%',#{param.thirdProduct},'%') + + + UNION ALL + SELECT + `ldpl`.`id` AS `id`, + `ldpl`.`tenant_id` AS `tenant_id`, + `ldpl`.`create_user` AS `create_user`, + `ldpl`.`create_time` AS `create_time`, + `ldpl`.`update_user` AS `update_user`, + `ldpl`.`update_time` AS `update_time`, + `ldpl`.`status` AS `status`, + `ldpl`.`is_deleted` AS `is_deleted`, + `ldpl`.`create_dept` AS `create_dept`, + `ldpl`.`reserve1` AS `reserve1`, + `ldpl`.`reserve2` AS `reserve2`, + `ldpl`.`reserve3` AS `reserve3`, + `ldpl`.`reserve4` AS `reserve4`, + `ldpl`.`reserve5` AS `reserve5`, + `ldpl`.`warehouse_id` AS `warehouse_id`, + `ldpl`.`warehouse` AS `warehouse`, + `ldpl`.`conditions` AS `conditions`, + `ldpl`.`order_package_code` AS `order_package_code`, + `ldpl`.`cargo_title` AS `cargo_title`, + `ldpl`.`shelf_title` AS `shelf_title`, + `ldpl`.`goods_allocation` AS `goods_allocation`, + `ldpl`.`pallet` AS `pallet`, + `ldpl`.`firsts` AS `firsts`, + `ldpl`.`second` AS `second`, + `ldpl`.`third_product` AS `third_product`, + `ldpl`.`quantity` AS `quantity`, + `ldpl`.`train_number` AS `train_number`, + `ldpl`.`stock_article_id` AS `stock_article_id`, + `ldpl`.`order_code` AS `order_code`, + `ldpl`.`service_number` AS `service_number`, + `ldpl`.`material_id` AS `material_id`, + `ldpl`.`material_name` AS `material_name`, + `ldpl`.`material_code` AS `material_code`, + `ldpl`.`material_unit` AS `material_unit`, + `ldpl`.`brand_id` AS `brand_id`, + `ldpl`.`brand_name` AS `brand_name`, + `ldpl`.`order_package_status` AS `order_package_status`, + `ldpl`.`order_package_freeze_status` AS `order_package_freeze_status`, + `ldpl`.`order_package_grounding_status` AS `order_package_grounding_status`, + `ldpl`.`order_package_stockup_status` AS `order_package_stockup_status`, + `ldpl`.`order_package_reservation_status` AS `order_package_reservation_status`, + `ldpl`.`order_package_loading_status` AS `order_package_loading_status`, + `ldpl`.`waybill_number` AS `waybill_number`, + `ldpl`.`waybill_id` AS `waybill_id`, + `ldpl`.`warehouse_entry_time_end` AS `warehouse_entry_time_end`, + `ldpl`.`dealer_name` AS `dealer_name`, + `ldpl`.`dealer_code` AS `dealer_code`, + `ldpl`.`send_warehouse_id` AS `send_warehouse_id`, + `ldpl`.`send_warehouse_name` AS `send_warehouse_name`, + `ldpl`.`accept_warehouse_id` AS `accept_warehouse_id`, + `ldpl`.`accept_warehouse_name` AS `accept_warehouse_name`, + `ldpl`.`order_package_delivery_status` AS `order_package_delivery_status`, + `lwug`.`create_time` AS `operatorTime`, + `lwug`.`create_user` AS `operatorId`, + `lwug`.`remark` AS `scanNodeType`, + '上下架' AS `nodeName` + FROM + `logpm_distribution_parcel_list` `ldpl` + JOIN `logpm_warehouse_updown_goods_log` `lwug` ON + `ldpl`.`id` = `lwug`.`association_id` + - and vsr.warehouse_id in + and ldpl.warehouse_id in #{item} - - and vsr.scanNodeType like concat('%',#{param.scanNodeType},'%') + + and ldpl.order_code like concat('%',#{param.orderCode},'%') + + + and ldpl.order_package_code like concat('%',#{param.orderPackageCode},'%') + + + and ldpl.service_number like concat('%',#{param.serviceNumber},'%') + + + and ldpl.brand_name like concat('%',#{param.brandName},'%') + + + and ldpl.material_code like concat('%',#{param.materialCode},'%') + + + and ldpl.material_name like concat('%',#{param.materialName},'%') + + + and ldpl.firsts like concat('%',#{param.firsts},'%') + + + and ldpl.second like concat('%',#{param.second},'%') + + + and ldpl.third_product like concat('%',#{param.thirdProduct},'%') + + + UNION ALL + SELECT + `ldpl`.`id` AS `id`, + `ldpl`.`tenant_id` AS `tenant_id`, + `ldpl`.`create_user` AS `create_user`, + `ldpl`.`create_time` AS `create_time`, + `ldpl`.`update_user` AS `update_user`, + `ldpl`.`update_time` AS `update_time`, + `ldpl`.`status` AS `status`, + `ldpl`.`is_deleted` AS `is_deleted`, + `ldpl`.`create_dept` AS `create_dept`, + `ldpl`.`reserve1` AS `reserve1`, + `ldpl`.`reserve2` AS `reserve2`, + `ldpl`.`reserve3` AS `reserve3`, + `ldpl`.`reserve4` AS `reserve4`, + `ldpl`.`reserve5` AS `reserve5`, + `ldpl`.`warehouse_id` AS `warehouse_id`, + `ldpl`.`warehouse` AS `warehouse`, + `ldpl`.`conditions` AS `conditions`, + `ldpl`.`order_package_code` AS `order_package_code`, + `ldpl`.`cargo_title` AS `cargo_title`, + `ldpl`.`shelf_title` AS `shelf_title`, + `ldpl`.`goods_allocation` AS `goods_allocation`, + `ldpl`.`pallet` AS `pallet`, + `ldpl`.`firsts` AS `firsts`, + `ldpl`.`second` AS `second`, + `ldpl`.`third_product` AS `third_product`, + `ldpl`.`quantity` AS `quantity`, + `ldpl`.`train_number` AS `train_number`, + `ldpl`.`stock_article_id` AS `stock_article_id`, + `ldpl`.`order_code` AS `order_code`, + `ldpl`.`service_number` AS `service_number`, + `ldpl`.`material_id` AS `material_id`, + `ldpl`.`material_name` AS `material_name`, + `ldpl`.`material_code` AS `material_code`, + `ldpl`.`material_unit` AS `material_unit`, + `ldpl`.`brand_id` AS `brand_id`, + `ldpl`.`brand_name` AS `brand_name`, + `ldpl`.`order_package_status` AS `order_package_status`, + `ldpl`.`order_package_freeze_status` AS `order_package_freeze_status`, + `ldpl`.`order_package_grounding_status` AS `order_package_grounding_status`, + `ldpl`.`order_package_stockup_status` AS `order_package_stockup_status`, + `ldpl`.`order_package_reservation_status` AS `order_package_reservation_status`, + `ldpl`.`order_package_loading_status` AS `order_package_loading_status`, + `ldpl`.`waybill_number` AS `waybill_number`, + `ldpl`.`waybill_id` AS `waybill_id`, + `ldpl`.`warehouse_entry_time_end` AS `warehouse_entry_time_end`, + `ldpl`.`dealer_name` AS `dealer_name`, + `ldpl`.`dealer_code` AS `dealer_code`, + `ldpl`.`send_warehouse_id` AS `send_warehouse_id`, + `ldpl`.`send_warehouse_name` AS `send_warehouse_name`, + `ldpl`.`accept_warehouse_id` AS `accept_warehouse_id`, + `ldpl`.`accept_warehouse_name` AS `accept_warehouse_name`, + `ldpl`.`order_package_delivery_status` AS `order_package_delivery_status`, + `lwtg`.`create_time` AS `operatorTime`, + `lwtg`.`create_user` AS `operatorId`, + `lwtg`.`remark` AS `scanNodeType`, + '打托' AS `nodeName` + FROM + `logpm_distribution_parcel_list` `ldpl` + JOIN `logpm_warehouse_tray_goods_log` `lwtg` ON + `ldpl`.`id` = `lwtg`.`association_id` + + + and ldpl.warehouse_id in + + #{item} + - and vsr.order_code like concat('%',#{param.orderCode},'%') + and ldpl.order_code like concat('%',#{param.orderCode},'%') - and vsr.order_package_code like concat('%',#{param.orderPackageCode},'%') + and ldpl.order_package_code like concat('%',#{param.orderPackageCode},'%') - and vsr.service_number like concat('%',#{param.serviceNumber},'%') + and ldpl.service_number like concat('%',#{param.serviceNumber},'%') - and vsr.brand_name like concat('%',#{param.brandName},'%') + and ldpl.brand_name like concat('%',#{param.brandName},'%') - and vsr.material_code like concat('%',#{param.materialCode},'%') + and ldpl.material_code like concat('%',#{param.materialCode},'%') - and vsr.material_name like concat('%',#{param.materialName},'%') + and ldpl.material_name like concat('%',#{param.materialName},'%') - and vsr.firsts like concat('%',#{param.firsts},'%') + and ldpl.firsts like concat('%',#{param.firsts},'%') - and vsr.second like concat('%',#{param.second},'%') + and ldpl.second like concat('%',#{param.second},'%') - and vsr.third_product like concat('%',#{param.thirdProduct},'%') + and ldpl.third_product like concat('%',#{param.thirdProduct},'%') + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseStockServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseStockServiceImpl.java index bbc1da23d..3e497ac41 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseStockServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseStockServiceImpl.java @@ -34,6 +34,7 @@ import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.SpringUtil; import org.springblade.system.cache.DictBizCache; import org.springblade.system.feign.IUserClient; @@ -44,6 +45,7 @@ import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import java.util.stream.Stream; /** * 备货扫描记录 服务实现类 @@ -63,12 +65,33 @@ public class WarehouseStockServiceImpl extends BaseServiceImpl selectWarehouseStockPage(IPage page, WarehouseScanRecordVO warehouseScanRecordVO) { warehouseScanRecordVO.setWarehouseIdList(this.loginPerson()); + BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); + if (Func.isEmpty(myCurrentWarehouse)){ + return null; + } + if (Func.isEmpty(warehouseScanRecordVO.getCreateTime())){ + log.error("################查询扫描记录没有填写操作时间"); + return null; + } + List result = new ArrayList<>(); + warehouseScanRecordVO.setWarehouseId(myCurrentWarehouse.getId()); List warehouseScanRecordVOS = baseMapper.selectWarehouseStockPage(page, warehouseScanRecordVO); -// IUserClient userCliient = SpringUtil.getBean(IUserClient.class); -// for (WarehouseScanRecordVO warehouseScanRecordVOData : warehouseScanRecordVOS) { -// warehouseScanRecordVOData.setOperatorName(userCliient.userInfoById(warehouseScanRecordVOData.getOperatorId()).getData().getName()); -// } - return page.setRecords(warehouseScanRecordVOS); + if (Func.isNotBlank(warehouseScanRecordVO.getNodeName())){ + List collect = warehouseScanRecordVOS.stream().filter(s -> warehouseScanRecordVO.getNodeName().equals(s.getNodeName())).collect(Collectors.toList()); + if (collect.size()>0){ + result.addAll(collect); + } + } + if (Func.isNotBlank(warehouseScanRecordVO.getScanNodeType())){ + List collect = warehouseScanRecordVOS.stream().filter(s -> warehouseScanRecordVO.getScanNodeType().equals(s.getNodeName())).collect(Collectors.toList()); + if (collect.size()>0){ + result.addAll(collect); + } + } + if (result.size() == 0){ + result = warehouseScanRecordVOS; + } + return page.setRecords(result); } @Override From f073f5dfd8bcb3b97f544f040161472895975838 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Wed, 28 Feb 2024 18:32:43 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E6=8C=87=E6=A0=87=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../warehouse/vo/WarehouseScanRecordVO.java | 7 +++++ .../impl/BasicdataClientServiceImpl.java | 2 +- .../com/logpm/supervise/api/ClassifyApi.java | 22 ++++++++++---- .../warehouse/mapper/WarehouseStockMapper.xml | 22 ++++++++++++-- .../impl/WarehouseStockServiceImpl.java | 29 ++++++++++++------- 5 files changed, 64 insertions(+), 18 deletions(-) diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseScanRecordVO.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseScanRecordVO.java index 8bdcbece8..c3bec83c8 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseScanRecordVO.java +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseScanRecordVO.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import java.util.Date; import java.util.List; @@ -47,6 +48,12 @@ public class WarehouseScanRecordVO extends WarehouseScanRecordEntity { @ApiModelProperty(value = "扫描详情") private String scanNodeType; + /** + * 二级扫描类型(扫描详情) + */ + @ApiModelProperty(value = "扫描详情") + private Date date; + /** * 仓库List diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java index 021543687..a00758288 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java @@ -301,7 +301,6 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl set =new HashSet<>(); QueryWrapper queryWrapper = new QueryWrapper<>(); List basicdataClients = baseMapper.selectList(queryWrapper); - log.info("查询客户信息>>>:{}",basicdataClients); for (BasicdataClientExcel i : data) { log.info("导入数据《》《》{}",i); if(set.isEmpty()){ @@ -318,6 +317,7 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl>>:{}",basicdataClient); + log.info("查询客户信息>>>:{}",basicdataClients); //查询客户编码和客户名称是否存在 boolean b = basicdataClients.stream().anyMatch(ii -> ii.getClientCode().equals(basicdataClient.getClientCode()) diff --git a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/api/ClassifyApi.java b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/api/ClassifyApi.java index f565482f9..c9a6b5b8d 100644 --- a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/api/ClassifyApi.java +++ b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/api/ClassifyApi.java @@ -13,6 +13,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.redisson.api.condition.Conditions; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.secure.utils.AuthUtil; @@ -20,8 +21,10 @@ import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.*; +import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; @RestController @AllArgsConstructor @@ -34,6 +37,8 @@ public class ClassifyApi { + + @GetMapping("/classifyList") @ApiOperationSupport(order = 1) @ApiOperation(value = "小程序指标项列表", notes = "传入classify") @@ -50,13 +55,20 @@ public class ClassifyApi { // return R.fail("此账号无法对该部门进行考核"); // } // } + List a = new ArrayList<>(); List list = Func.toLongList(deptId); - int indexOf = list.indexOf(Long.parseLong(dept)); - if (list.size() - 1 == indexOf){ - //当前登录账号处于组织结构树最后一级就只能进行最后一级的指标项搜索 - list.remove(indexOf); + a.addAll(list); + Long aLong = list.get(list.size() - 1); + List userDeptList = Func.toLongList(dept); + a.addAll(userDeptList); +// list.addAll(userDeptList); + a = a.stream().distinct().collect(Collectors.toList()); + int indexOf = list.indexOf(aLong); + if (indexOf == list.size()){ + a.remove(indexOf); } - List detail = classifyService.selectClassifyList(deptId); + String collect = a.stream().map(String::valueOf).collect(Collectors.joining(",")); + List detail = classifyService.selectClassifyList(collect); return R.data(detail); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseStockMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseStockMapper.xml index 482103132..5b4372ae2 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseStockMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseStockMapper.xml @@ -98,7 +98,7 @@ `ldpl`.`accept_warehouse_id` AS `accept_warehouse_id`, `ldpl`.`accept_warehouse_name` AS `accept_warehouse_name`, `ldpl`.`order_package_delivery_status` AS `order_package_delivery_status`, - `ldl`.`create_time` AS `operatorTime`, + `ldl`.`update_time` AS `operatorTime`, `ldl`.`create_user` AS `operatorId`, '取消装车' AS `scanNodeType`, '配送' AS `nodeName` @@ -143,6 +143,9 @@ and ldpl.third_product like concat('%',#{param.thirdProduct},'%') + + and ldl.update_time like concat(#{param.date},'%') + UNION ALL SELECT @@ -241,6 +244,9 @@ and ldpl.third_product like concat('%',#{param.thirdProduct},'%') + + and ldl.create_time like concat(#{param.date},'%') + UNION ALL SELECT @@ -296,7 +302,7 @@ `ldpl`.`accept_warehouse_id` AS `accept_warehouse_id`, `ldpl`.`accept_warehouse_name` AS `accept_warehouse_name`, `ldpl`.`order_package_delivery_status` AS `order_package_delivery_status`, - `ldl`.`create_time` AS `operatorTime`, + `ldl`.`update_time` AS `operatorTime`, `ldl`.`create_user` AS `operatorId`, '签收' AS `scanNodeType`, '配送' AS `nodeName` @@ -339,6 +345,9 @@ and ldpl.third_product like concat('%',#{param.thirdProduct},'%') + + and ldl.update_time like concat(#{param.date},'%') + UNION ALL SELECT @@ -443,6 +452,9 @@ and ldpl.third_product like concat('%',#{param.thirdProduct},'%') + + and lds.create_time like concat(#{param.date},'%') + UNION ALL SELECT @@ -540,6 +552,9 @@ and ldpl.third_product like concat('%',#{param.thirdProduct},'%') + + and lwug.create_time like concat(#{param.date},'%') + UNION ALL SELECT @@ -637,6 +652,9 @@ and ldpl.third_product like concat('%',#{param.thirdProduct},'%') + + and lwtg.create_time like concat(#{param.date},'%') + diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseStockServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseStockServiceImpl.java index 3e497ac41..687ab921b 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseStockServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseStockServiceImpl.java @@ -34,16 +34,16 @@ import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.SpringUtil; import org.springblade.system.cache.DictBizCache; import org.springblade.system.feign.IUserClient; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -66,12 +66,21 @@ public class WarehouseStockServiceImpl extends BaseServiceImpl selectWarehouseStockPage(IPage page, WarehouseScanRecordVO warehouseScanRecordVO) { warehouseScanRecordVO.setWarehouseIdList(this.loginPerson()); BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); - if (Func.isEmpty(myCurrentWarehouse)){ - return null; - } - if (Func.isEmpty(warehouseScanRecordVO.getCreateTime())){ - log.error("################查询扫描记录没有填写操作时间"); - return null; + + try { + if (Func.isEmpty(myCurrentWarehouse)){ + return null; + } + if (Func.isEmpty(warehouseScanRecordVO.getOperatorTime())){ + log.error("################查询扫描记录没有填写操作时间"); + return null; + } + String operatorTime = warehouseScanRecordVO.getOperatorTime(); + SimpleDateFormat sf = new SimpleDateFormat(DateUtil.PATTERN_DATE); + Date parse = sf.parse(operatorTime); + warehouseScanRecordVO.setDate(parse); + } catch (ParseException e) { + throw new RuntimeException(e); } List result = new ArrayList<>(); warehouseScanRecordVO.setWarehouseId(myCurrentWarehouse.getId());