diff --git a/blade-biz-common/src/main/java/org/springblade/common/utils/DefaultUserTokenConfig.java b/blade-biz-common/src/main/java/org/springblade/common/utils/DefaultUserTokenConfig.java index d66a8dea0..9b0ce7841 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/utils/DefaultUserTokenConfig.java +++ b/blade-biz-common/src/main/java/org/springblade/common/utils/DefaultUserTokenConfig.java @@ -2,7 +2,7 @@ package org.springblade.common.utils; public class DefaultUserTokenConfig { /** - * 默认用户的token 超时时间 + * 默认用户的token 超时时间 */ - public static final Long EXPIRE_TIME = 7 *24 * 60 * 60 * 1000L; + public static final Long EXPIRE_TIME = 7 * 24 * 60 * 60L; } diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataClientEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataClientEntity.java index 6f13a1fc2..ec021bc91 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataClientEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataClientEntity.java @@ -164,16 +164,34 @@ public class BasicdataClientEntity extends TenantEntity { */ @ApiModelProperty(value = "省份") private String bladeRegionProvinceId; + + /** + * 省份 + */ + @ApiModelProperty(value = "省份") + private String bladeRegionProvinceName; /** * 市 */ @ApiModelProperty(value = "市") private String bladeRegionCityId; + + /** + * 市 + */ + @ApiModelProperty(value = "市") + private String bladeRegionCityName; /** * 区/县 */ @ApiModelProperty(value = "区/县") private String bladeRegionAreaId; + + /** + * 区/县 + */ + @ApiModelProperty(value = "区/县") + private String bladeRegionAreaName; /** * 合同附件 */ diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataBrandCategoryVO.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataBrandCategoryVO.java index fd1e225ca..5fcd4221e 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataBrandCategoryVO.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataBrandCategoryVO.java @@ -31,4 +31,9 @@ import lombok.EqualsAndHashCode; public class BasicdataBrandCategoryVO extends BasicdataBrandCategoryEntity { private static final long serialVersionUID = 1L; + private String brandName; + private String name; + + + } diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java index 7646632ef..fcd8a4c01 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java @@ -125,6 +125,7 @@ public class OpenOrderDTO implements Serializable { private String trunklineVehicleType;//提货车型 private String pickupVehicleType;//提货车型 + private Long pickupVehicleTypeId;//提货车型id private Integer checkStatus; diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java index 420e441b9..f233716b9 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java @@ -483,6 +483,9 @@ public class WarehouseWaybillEntity extends TenantEntity { @ApiModelProperty(value = "干线车型 ") private String trunklineVehicleType; + @ApiModelProperty(value = "提货车型id ") + private Long pickupVehicleTypeId; + @ApiModelProperty(value = "提货车型 ") private String pickupVehicleType; diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java index ccbb0f80f..542b7b6f9 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java @@ -2211,8 +2211,8 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl> list(@ApiIgnore @RequestParam Map basicdataBrandCategory, Query query) { - IPage pages = basicdataBrandCategoryService.page(Condition.getPage(query), Condition.getQueryWrapper(basicdataBrandCategory, BasicdataBrandCategoryEntity.class)); + public R> list(@ApiIgnore @RequestParam Map basicdataBrandCategory, Query query) { + List pages = basicdataBrandCategoryService.list(Condition.getPage(query), Condition.getQueryWrapper(basicdataBrandCategory, BasicdataBrandCategoryEntity.class)); return R.data(pages); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataClientController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataClientController.java index 7ef3464e2..ee25e414a 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataClientController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataClientController.java @@ -257,6 +257,30 @@ public class BasicdataClientController extends BladeController { return R.success("操作成功"); } + /** + * 导入数据 + */ + @PostMapping("/newImportBasicDataClient") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "导入数据", notes = "传入basicDataClient") + public R newImportBasicDataClient(MultipartFile file, Integer isCovered) { + isCovered = 1; + BasicDataClienImporter clientImporter = new BasicDataClienImporter(basicdataClientService, isCovered == 1); + ExcelUtil.save(file, clientImporter, BasicdataClientExcel.class); + return R.success("操作成功"); + } + + /** + * 导入模板 + */ + @PostMapping("/exportclientTemplate") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "导入数据", notes = "传入basicDataClient") + public void exportclientTemplate(HttpServletResponse response) { + List list = basicdataClientService.exportclientTemplate(); + ExcelUtil.export(response, "基础客户导入模板" + DateUtil.time(), "基础客户导入模板", list, BasicdataClientExcel.class); + } + /** * 校验导入数据 diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java index d26bd7339..27edd19f2 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java @@ -21,7 +21,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.logpm.basicdata.entity.BasicdataTripartiteMallEntity; +import com.logpm.basicdata.excel.BasicDataClienImporter; +import com.logpm.basicdata.excel.BasicdataClientExcel; import com.logpm.basicdata.excel.BasicdataTripartiteMallExcel; +import com.logpm.basicdata.excel.BasicdataTripartiteMallImporter; import com.logpm.basicdata.service.IBasicdataTripartiteMallService; import com.logpm.basicdata.vo.BasicdataTripartiteMallVO; import io.swagger.annotations.Api; @@ -37,6 +40,7 @@ import org.springblade.core.tool.api.R; import org.springblade.core.tool.constant.BladeConstant; import org.springblade.core.tool.utils.DateUtil; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import springfox.documentation.annotations.ApiIgnore; import javax.servlet.http.HttpServletResponse; @@ -152,6 +156,32 @@ public class BasicdataTripartiteMallController extends BladeController { } + /** + * 导出数据 + */ + @PostMapping("/exportTripartiteMallTemplate") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "导出数据", notes = "传入basicdataTripartiteMall") + public void exportTripartiteMallTemplate(HttpServletResponse response) { + List list = basicdataTripartiteMallService.exportTripartiteMallTemplate(); + ExcelUtil.export(response, "客户三方商城导入模板" + DateUtil.time(), "客户三方商城数据表", list, BasicdataTripartiteMallExcel.class); + } + + + /** + * 导出数据 + */ + @PostMapping("/importTripartiteMall") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "导出数据", notes = "传入basicdataTripartiteMall") + public R importTripartiteMall(MultipartFile file) { + BasicdataTripartiteMallImporter tripartiteMallImporter = new BasicdataTripartiteMallImporter(basicdataTripartiteMallService ); + ExcelUtil.save(file, tripartiteMallImporter, BasicdataTripartiteMallExcel.class); + return R.success("操作成功"); + } + + + /** * 导出数据 */ diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataClientExcel.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataClientExcel.java index e8f6e87c6..003b77e2d 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataClientExcel.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataClientExcel.java @@ -78,19 +78,19 @@ public class BasicdataClientExcel implements Serializable { */ @ColumnWidth(20) @ExcelProperty("省") - private String bladeRegionProvinceId; + private String bladeRegionProvinceName; /** * 市 */ @ColumnWidth(20) @ExcelProperty("市") - private String bladeRegionCityId; + private String bladeRegionCityName; /** * 区/县 */ @ColumnWidth(20) @ExcelProperty("区/县") - private String bladeRegionAreaId; + private String bladeRegionAreaName; /** * 是否控货 */ @@ -128,26 +128,26 @@ public class BasicdataClientExcel implements Serializable { @ColumnWidth(20) @ExcelProperty("品牌") private String brandName; - /** - * 三方商场 - */ - @ColumnWidth(20) - @ExcelProperty("三方商场编码") - private String tripartiteCoding; - - /** - * 三方商场品牌 - */ - @ColumnWidth(20) - @ExcelProperty("三方商场品牌") - private String tripartiteMallBrand; +// /** +// * 三方商场 +// */ +// @ColumnWidth(20) +// @ExcelProperty("三方商场编码") +// private String tripartiteCoding; - /** - * 三方商场 - */ - @ColumnWidth(20) - @ExcelProperty("三方商场名称") - private String tripartiteMall; +// /** +// * 三方商场品牌 +// */ +// @ColumnWidth(20) +// @ExcelProperty("三方商场品牌") +// private String tripartiteMallBrand; +// +// /** +// * 三方商场 +// */ +// @ColumnWidth(20) +// @ExcelProperty("三方商场名称") +// private String tripartiteMall; /** * 配送类型 diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataTripartiteMallExcel.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataTripartiteMallExcel.java index 8b0d25769..21c818282 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataTripartiteMallExcel.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataTripartiteMallExcel.java @@ -40,55 +40,15 @@ public class BasicdataTripartiteMallExcel implements Serializable { private static final long serialVersionUID = 1L; + + /** - * 租户号 - */ - @ColumnWidth(20) - @ExcelProperty("租户号") - private String tenantId; - /** - * 是否已删除 - */ - @ColumnWidth(20) - @ExcelProperty("是否已删除") - private Integer isDeleted; - /** - * 预留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; - /** - * 客户ID + * 三方编码 */ @ColumnWidth(20) - @ExcelProperty("客户ID") - private String client; - /** + @ExcelProperty("客户名称") + private String clientName; + /* * 三方商城 */ @ColumnWidth(20) @@ -101,4 +61,13 @@ public class BasicdataTripartiteMallExcel implements Serializable { @ExcelProperty("三方编码") private String tripartiteCoding; + /** + * 三方编码 + */ + @ColumnWidth(20) + @ExcelProperty("品牌") + private String brandName; + + + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataTripartiteMallImporter.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataTripartiteMallImporter.java new file mode 100644 index 000000000..07f5f49c3 --- /dev/null +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataTripartiteMallImporter.java @@ -0,0 +1,20 @@ +package com.logpm.basicdata.excel; + +import com.logpm.basicdata.service.IBasicdataTripartiteMallService; +import lombok.RequiredArgsConstructor; +import org.springblade.core.excel.support.ExcelImporter; + +import java.util.List; + +@RequiredArgsConstructor +public class BasicdataTripartiteMallImporter implements ExcelImporter { + + private final IBasicdataTripartiteMallService service; + + + + @Override + public void save(List data) { + service.importTripartiteMall(data); + } +} diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataBrandCategoryMapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataBrandCategoryMapper.java index 20c109d57..8f26b01e1 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataBrandCategoryMapper.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataBrandCategoryMapper.java @@ -34,14 +34,6 @@ import java.util.List; */ public interface BasicdataBrandCategoryMapper extends BaseMapper { - /** - * 自定义分页 - * - * @param page - * @param basicdataBrandCategory - * @return - */ - List selectBasicdataBrandCategoryPage(IPage page, BasicdataBrandCategoryVO basicdataBrandCategory); /** @@ -52,4 +44,11 @@ public interface BasicdataBrandCategoryMapper extends BaseMapper exportBasicdataBrandCategory(@Param("ew") Wrapper queryWrapper); + /** + * 分页 + * @param page + * @param basicdataBrandCategory + * @return + */ + IPage selectBasicdataBrandCategoryPage(IPage page,@Param("param") BasicdataBrandCategoryVO basicdataBrandCategory); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataBrandCategoryMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataBrandCategoryMapper.xml index ac0e9c69b..842ca2ae3 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataBrandCategoryMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataBrandCategoryMapper.xml @@ -24,13 +24,34 @@ - + + diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml index 50202445b..4e6bf7fcb 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml @@ -106,6 +106,8 @@ SELECT lbc.id, lbc.client_name, + lbc.create_time, + lbc.update_time, lbc. client_type, lbc.client_code, lbc. linkman, diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTripartiteMallMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTripartiteMallMapper.xml index 8c1084a0e..0516c375e 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTripartiteMallMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTripartiteMallMapper.xml @@ -69,6 +69,8 @@ lbtm.tripartite_coding, lbtm.brand_name, lbc.client_name AS clientName, + lbc.create_time AS createTime, + lbc.update_time AS updateTime, lbc.type_service AS typeService FROM logpm_basicdata_tripartite_mall AS lbtm diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java index 4d25f445e..3e292a88a 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java @@ -134,4 +134,11 @@ public interface IBasicdataClientService extends BaseService listNameLike(String name); + + /** + * 获取客户导入模板 + * @return + */ + List exportclientTemplate(); + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTripartiteMallService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTripartiteMallService.java index 62c43e7f3..5e5826cb2 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTripartiteMallService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTripartiteMallService.java @@ -86,4 +86,16 @@ public interface IBasicdataTripartiteMallService extends BaseService exportTripartiteMallTemplate(); + + /** + * 三方商城导入 + * @param data + */ + void importTripartiteMall(List data); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataBrandCategoryServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataBrandCategoryServiceImpl.java index 06790e83c..207ec87e8 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataBrandCategoryServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataBrandCategoryServiceImpl.java @@ -39,7 +39,7 @@ public class BasicdataBrandCategoryServiceImpl extends BaseServiceImpl selectBasicdataBrandCategoryPage(IPage page, BasicdataBrandCategoryVO basicdataBrandCategory) { - return page.setRecords(baseMapper.selectBasicdataBrandCategoryPage(page, basicdataBrandCategory)); + return baseMapper.selectBasicdataBrandCategoryPage(page, basicdataBrandCategory); } 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 05573fa64..dd34a8e91 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 @@ -74,6 +74,7 @@ import org.springblade.system.cache.DictBizCache; import org.springblade.system.entity.DictBiz; import org.springblade.system.feign.IRegionFeign; import org.springblade.system.feign.IUserClient; +import org.springblade.system.vo.RegionAllVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; @@ -409,14 +410,22 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl[").append(sdf.format(oldClientEntity.getContractStartTime())).append("],"); + if (!Objects.isNull(oldClientEntity.getContractStartTime())){ + content.append("合同开始时间由[").append(sdf.format(oldClientEntity.getContractStartTime())).append("]变更为-->[").append(sdf.format(oldClientEntity.getContractStartTime())).append("],"); + }else { + content.append("添加合同开始时间[").append(sdf.format(newClientEntity.getContractStartTime())).append("],"); + } } } //对于合同结束时间比对 Predicate predicateContractEntTime = Predicate.isEqual(oldClientEntity.getContractEntTime()); boolean contractEndTime = predicateContractEntTime.test(newClientEntity.getContractEntTime()); if (!contractEndTime) { - content.append("合同开始时间由[").append(sdf.format(oldClientEntity.getContractEntTime())).append("]变更为-->[").append(sdf.format(newClientEntity.getContractEntTime())).append("],"); + if (!Objects.isNull(oldClientEntity.getContractEntTime())){ + content.append("合同结束时间由[").append(sdf.format(oldClientEntity.getContractStartTime())).append("]变更为-->[").append(sdf.format(oldClientEntity.getContractStartTime())).append("],"); + }else { + content.append("添加合同结束时间[").append(sdf.format(newClientEntity.getContractStartTime())).append("],"); + } } BasicdataClientLogEntity basicdataClientLogEntity = new BasicdataClientLogEntity(); basicdataClientLogEntity.setClientName(newClientEntity.getClientName()); @@ -444,6 +453,35 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl exportclientTemplate() { + List list = new ArrayList<>(); + BasicdataClientExcel basicdataClientExcel = new BasicdataClientExcel(); + basicdataClientExcel.setClientName("示例:商场A"); + basicdataClientExcel.setTypeService("示例:干线,仓库,配送"); + basicdataClientExcel.setClientType("示例:商配"); + basicdataClientExcel.setDetailedly("示例:XXX省XX市XX区/县"); + basicdataClientExcel.setBladeRegionProvinceName("示例:XX省"); + basicdataClientExcel.setBladeRegionCityName("示例:XX市"); + basicdataClientExcel.setBladeRegionAreaName("示例:XX区/县"); + basicdataClientExcel.setCargoControl("示例:是"); + basicdataClientExcel.setSendWarehouseName("示例:XX仓"); + basicdataClientExcel.setServeWarehouseName("示例:XX仓"); + basicdataClientExcel.setLinkman("示例:张三"); + basicdataClientExcel.setPhone("示例:120********"); + basicdataClientExcel.setBrandName("示例:品牌"); +// basicdataClientExcel.setTripartiteCoding("示例:张三"); +// basicdataClientExcel.setTripartiteMallBrand("示例:张三"); +// basicdataClientExcel.setTripartiteMall("示例:张三"); + basicdataClientExcel.setMold("示例:商配"); + basicdataClientExcel.setContractStartTime(new Date()); + basicdataClientExcel.setContractEntTime(new Date()); + basicdataClientExcel.setDefaultPaymentMethods("示例:月结"); + basicdataClientExcel.setCleanObjType("示例:工厂"); + list.add(basicdataClientExcel); + return list; + } + @Override @Transactional(rollbackFor = Exception.class) public Boolean ownDeleteLogic(List toLongList) { @@ -497,6 +535,308 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl data, Boolean isCovered) { +// log.info("客户导入数据"); +// +// QueryWrapper queryWrapper = new QueryWrapper<>(); +// List basicdataClients = baseMapper.selectList(queryWrapper); +// // 验证数据 +// checkImportBasicDataClient(data,basicdataClients); +// +// +// List storeContactEntities = new ArrayList<>(); // 联系人 +// List tripartiteMallEntities = new ArrayList<>(); // 三方商场 +// List storeBrandEntities = new ArrayList<>(); // 品牌 +// List storageServicesEntities = new ArrayList<>(); // 服务仓 +// List storeBusinessEntities = new ArrayList<>(); // 服务类型 +// //查询仓库信息 +// List list1 = warehouseService.warehouseListqx(); +// List dictBizs = DictBizCache.getList(DictBizConstant.DISTRIBUTION_TYPE);//商 市 自 +// List clientBiz = DictBizCache.getList(DictBizConstant.CLIENT_TYPE); //客 工 +// List freightBiz = DictBizCache.getList(BASIC_FREIGHT_TYPE); //客 工 +// Set set = new HashSet<>(); +// +// +// +// LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); +// lambdaQueryWrapper.eq(BasicdataBrandEntity::getIsDeleted, 0); +// List basicdataBrandEntityList = basicdataBrandService.list(lambdaQueryWrapper); +// +// +// +// for (BasicdataClientExcel i : data) { +// +// // 处理下空格 换行 +// i.setClientName(i.getClientName().trim()); +// +// log.info("导入数据《》《》{}", i); +// +// if (ObjectUtils.isNull(i.getClientName())) { +// throw new ServiceException("客户编码或客户名称不能为空!"); +// } +// BasicdataClientEntity basicdataClient = new BasicdataClientEntity(); +// BeanUtil.copyProperties(i, basicdataClient); +// //系统生成码值 +// String finallyClientCode = this.getFinallyClientCode(); +// basicdataClient.setClientCode(finallyClientCode); +// //将这个最新的防止缓存中 +// +// log.info(">>>>>> basicdataClient.getClientCode() {}", basicdataClient.getClientCode()); +// +// if(!basicdataClients.isEmpty()){ +// List basicdataClientEntities = basicdataClients.stream().filter(ii -> ii.getClientName().equals(basicdataClient.getClientName()) && ii.getClientCode().equals(basicdataClient.getClientCode())).collect(Collectors.toList()); +// if(!basicdataClientEntities.isEmpty()){ +// // 获取全部重复的数据 +// List clientNames = basicdataClientEntities.stream().map(BasicdataClientEntity::getClientName).collect(Collectors.toList()); +// List clientCodes = basicdataClientEntities.stream().map(BasicdataClientEntity::getClientCode).collect(Collectors.toList()); +// String clientNameStr = String.join(",", clientNames); +// String clientCodeStr = String.join(",", clientCodes); +// throw new ServiceException("客户编码 "+clientCodeStr+" 或客户名称 "+clientNameStr+" 已存在"); +// } +// +// } +// +// Optional clientFirst = clientBiz.stream().filter(ii -> ii.getDictValue().equals(i.getClientType())).findFirst(); +// basicdataClient.setClientType(clientFirst.get().getDictKey()); +// //查询客户名称是不是重复 +// List basicdataClientEntities = baseMapper.selectList(Wrappers.query().lambda() +// .eq(BasicdataClientEntity::getClientName, i.getClientName()) +// ); +// if (basicdataClientEntities.isEmpty()) { +// BladeUser user = AuthUtil.getUser(); +// basicdataClient.setPid(0L); +// basicdataClient.setCreateUser(user.getUserId()); +// basicdataClient.setCargoControl(false); +// basicdataClient.setStatus(1); +// basicdataClient.setIsDeleted(0); +// basicdataClient.setCreateTime(new Date()); +// basicdataClient.setUpdateTime(new Date()); +// +// // 默认付款方式 +// String keyValue = matchDictValue(DictBizCache.getList(OPEN_ORDER_PAY_WAY), i.getDefaultPaymentMethods().trim()); +// +// basicdataClient.setDefaultPaymentMethods(keyValue); +// +// String s = matchDictValue(DictBizCache.getList(CLEAN_OBJ_TYPE), i.getCleanObjType()); +// +// basicdataClient.setCleanObjType(s); +// +// +// String typeValue= matchDictValue(DictBizCache.getList(DISTRIBUTION_TYPE), i.getMold()); +// +// basicdataClient.setTypeService(StringUtil.isNoneBlank(typeValue)?Integer.parseInt(typeValue):null); +// +// baseMapper.insert(basicdataClient); +// redis.set(RedisKeyConstant.FINAL_CLIENT_CODE + AuthUtil.getTenantId(), basicdataClient.getClientCode()); +// if (ObjectUtils.isNull(basicdataClient.getId())) { +// throw new ServiceException("客户ID不存在"); +// } +// +// //添加服务类型 +// if (ObjectUtils.isNotNull(i.getTypeService())) { +// BasicdataStoreBusinessEntity storeBusinessEntity = new BasicdataStoreBusinessEntity(); +// storeBusinessEntity.setClientId(basicdataClient.getId().toString()); +// storeBusinessEntity.setTypeService(i.getTypeService()); +// storeBusinessEntity.setMold(i.getMold()); +// storeBusinessEntities.add(storeBusinessEntity); +// } +// //添加服务仓 +// if (ObjectUtils.isNotNull(i.getServeWarehouseName())) { +// BasicdataStorageServicesEntity servicesEntity = new BasicdataStorageServicesEntity(); +// servicesEntity.setClientId(basicdataClient.getId()); +// servicesEntity.setDistinguish(2); +// if (ObjectUtils.isNotNull(i.getSendWarehouseName())) { +//// Long id = list1.stream().filter(q -> q.getName().equals(i.getSendWarehouseName())).findFirst().get().getId(); +//// servicesEntity.setSendWarehouseId(String.valueOf(id)); +// servicesEntity.setSendWarehouseName(i.getSendWarehouseName()); +// } +// Long id = list1.stream().filter(q -> q.getName().equals(i.getServeWarehouseName())).findFirst().get().getId(); +// servicesEntity.setServeWarehouseId(id); +// servicesEntity.setServeWarehouseName(i.getServeWarehouseName()); +// storageServicesEntities.add(servicesEntity); +// }else { +// BasicdataStorageServicesEntity servicesEntity = new BasicdataStorageServicesEntity(); +// servicesEntity.setClientId(basicdataClient.getId()); +// servicesEntity.setDistinguish(2); +// servicesEntity.setSendWarehouseName("全部"); +// storageServicesEntities.add(servicesEntity); +// } +// //添加品牌 +// if (ObjectUtils.isNotNull(i.getBrandName())) { +// +// String[] ars = i.getBrandName().split(","); +// +// for (String ar : ars) { +// BasicdataStoreBrandEntity storeBrandEntity = new BasicdataStoreBrandEntity(); +// storeBrandEntity.setClientId(basicdataClient.getId()); +// storeBrandEntity.setShopId(basicdataClient.getId().toString()); +// BasicdataBrandEntity one = matchBasicdataBrandEntityListValue(basicdataBrandEntityList, ar); +// +// +// if (ObjectUtils.isNull(one)) { +// throw new ServiceException("品牌不存在"); +// } +// assert one != null; +// storeBrandEntity.setBrandId(one.getId()); +// storeBrandEntity.setBrandName(one.getBrandName()); +// storeBrandEntities.add(storeBrandEntity); +// } +// +// +// } +// //添加联系人 +// if (ObjectUtils.isNotNull(i.getLinkman())) { +// BasicdataStoreContactEntity storeContactEntity = new BasicdataStoreContactEntity(); +// storeContactEntity.setShopId(basicdataClient.getId()); +// storeContactEntity.setPhone(i.getPhone()); +// storeContactEntity.setLinkman(i.getLinkman()); +// storeContactEntity.setDefaultType(true); +// storeContactEntities.add(storeContactEntity); +// +// } +// //添加三方商场 +//// if (ObjectUtils.isNotNull(i.getTripartiteMall())) { +//// BasicdataTripartiteMallEntity tripartiteMallEntity = new BasicdataTripartiteMallEntity(); +//// tripartiteMallEntity.setClientId(basicdataClient.getId()); +//// tripartiteMallEntity.setTripartiteMall(i.getTripartiteMall()); +//// tripartiteMallEntity.setTripartiteCoding(i.getTripartiteCoding()); +//// +//// BasicdataBrandEntity one = matchBasicdataBrandEntityListValue(basicdataBrandEntityList, i.getTripartiteMallBrand()); +//// +//// if (ObjectUtil.isNotEmpty(one)) { +//// //三方名称 +//// assert one != null; +//// tripartiteMallEntity.setBrandId(one.getId()); +//// tripartiteMallEntity.setBrandName(one.getBrandName()); +//// } +//// tripartiteMallEntities.add(tripartiteMallEntity); +//// } +// +// } +// } +// +// //品牌 +// if (!storeBrandEntities.isEmpty()) { +// basicdataStoreBrandService.saveBatch(storeBrandEntities); +// } +// //服务类型 +// if (!storeBusinessEntities.isEmpty()) { +// List list = new ArrayList<>(); +// storeBusinessEntities.stream().forEach(i -> { +// if (i.getTypeService().contains(",")) { +// String[] split = i.getTypeService().split(","); +// for (int j = 0; j < split.length; j++) { +// BasicdataStoreBusinessEntity business = new BasicdataStoreBusinessEntity(); +// BeanUtil.copyProperties(i, business); +// int finalJ = j; +// if ("配送".equals(split[j])) { +// switch (business.getMold()) { +// case "商配": +// business.setMold("1"); +// break; +// case "市配": +// business.setMold("2"); +// break; +// case "自提": +// business.setMold("3"); +// break; +// case "三方中转": +// business.setMold("4"); +// break; +// default: +// throw new CustomerException("未知的服务类型"); +// } +// +// } else { +// business.setMold(null); +// } +// log.info("#################split[finalJ]>>>>>>>>>>>>>>:{}", split[finalJ]); +// String dictValue = freightBiz.stream().filter(q -> q.getDictValue().equals(split[finalJ])).findFirst().get().getDictKey(); +// business.setTypeService(dictValue); +// list.add(business); +// } +// } else { +// String dictValue = freightBiz.stream().filter(q -> q.getDictValue().equals(i.getTypeService())).findFirst().get().getDictKey(); +// i.setTypeService(dictValue); +// if ("配送".equals(i.getTypeService())) { +// String mold = i.getMold(); +// switch (mold) { +// case "商配": +// i.setMold("1"); +// break; +// case "市配": +// i.setMold("2"); +// break; +// case "自提": +// i.setMold("3"); +// break; +// case "三方中转": +// i.setMold("4"); +// break; +// default: +// throw new CustomerException("未知的服务类型"); +// } +// +// } else { +// i.setMold(null); +// } +// list.add(i); +// } +// }); +// basicdataStoreBusinessService.saveBatch(list); +// } +// //服务仓 +// if (!storageServicesEntities.isEmpty()) { +// List servicesEntityList = new ArrayList<>(); +// storageServicesEntities.forEach(i -> { +// if (ObjectUtils.isNotNull(i.getSendWarehouseName())) { +// if (i.getSendWarehouseName().contains(",")) { +// String[] split = i.getSendWarehouseName().split(","); +// for (int j = 0; j < split.length; j++) { +// BasicdataStorageServicesEntity servicesEntity = new BasicdataStorageServicesEntity(); +// Long id = list1.stream().filter(q -> q.getName().equals(i.getSendWarehouseName())).findFirst().get().getId(); +// BeanUtil.copyProperties(i, servicesEntity); +// servicesEntity.setSendWarehouseId(id.toString()); +// servicesEntity.setSendWarehouseName(split[j]); +// servicesEntityList.add(servicesEntity); +// } +// } else { +// Long id = list1.stream().filter(q -> q.getName().equals(i.getSendWarehouseName())).findFirst().get().getId(); +// i.setSendWarehouseId(id.toString()); +// servicesEntityList.add(i); +// } +// } else { +// BasicdataStorageServicesEntity servicesEntity = new BasicdataStorageServicesEntity(); +// BeanUtil.copyProperties(i, servicesEntity); +// servicesEntityList.add(servicesEntity); +// } +// +// }); +// basicdataStorageServicesService.saveBatch(servicesEntityList); +// } +// //联系人 +// if (!storeContactEntities.isEmpty()) { +// basicdataStoreContactService.saveBatch(storeContactEntities); +// } +// //三方 +// if (!tripartiteMallEntities.isEmpty()) { +// basicdataTripartiteMallService.saveBatch(tripartiteMallEntities); +// } +// } + + + + + + /** * 导入数据 * @@ -506,7 +846,6 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl data, Boolean isCovered) { - log.info("客户导入数据"); QueryWrapper queryWrapper = new QueryWrapper<>(); List basicdataClients = baseMapper.selectList(queryWrapper); @@ -533,7 +872,6 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl basicdataBrandEntityList = basicdataBrandService.list(lambdaQueryWrapper); - for (BasicdataClientExcel i : data) { // 处理下空格 换行 @@ -554,7 +892,7 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl>>>>> basicdataClient.getClientCode() {}", basicdataClient.getClientCode()); if(!basicdataClients.isEmpty()){ - List basicdataClientEntities = basicdataClients.stream().filter(ii -> ii.getClientName().equals(basicdataClient.getClientName()) && ii.getClientCode().equals(basicdataClient.getClientCode())).collect(Collectors.toList()); + List basicdataClientEntities = basicdataClients.stream().filter(ii -> ii.getClientName().equals(basicdataClient.getClientName())).collect(Collectors.toList()); if(!basicdataClientEntities.isEmpty()){ // 获取全部重复的数据 List clientNames = basicdataClientEntities.stream().map(BasicdataClientEntity::getClientName).collect(Collectors.toList()); @@ -567,7 +905,9 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl clientFirst = clientBiz.stream().filter(ii -> ii.getDictValue().equals(i.getClientType())).findFirst(); - basicdataClient.setClientType(clientFirst.get().getDictKey()); + if (!Objects.isNull(clientFirst.get())){ + basicdataClient.setClientType(clientFirst.get().getDictKey()); + } //查询客户名称是不是重复 List basicdataClientEntities = baseMapper.selectList(Wrappers.query().lambda() .eq(BasicdataClientEntity::getClientName, i.getClientName()) @@ -579,8 +919,7 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl>>>>> 11111 {}", basicdataClient); // 默认付款方式 String keyValue = matchDictValue(DictBizCache.getList(OPEN_ORDER_PAY_WAY), i.getDefaultPaymentMethods().trim()); @@ -595,9 +934,50 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl>>>>> 22222 {}", basicdataClient); + List regionAllVOList= redis.get("blade:sys:regions::SimpleKey []"); + if (!Objects.isNull(i.getBladeRegionProvinceName())){ + log.info(">>>>>> 3333 {}", basicdataClient); + List collect = regionAllVOList.stream().filter(f -> i.getBladeRegionProvinceName().equals(f.getLabel())).collect(Collectors.toList()); + if (!collect.isEmpty()) { + RegionAllVO regionAllVO = collect.get(0); + basicdataClient.setBladeRegionProvinceId(regionAllVO.getValue()); + basicdataClient.setBladeRegionProvinceName(regionAllVO.getLabel()); + if (!Objects.isNull(i.getBladeRegionCityName())){ + List children1 = regionAllVO.getChildren(); + if (!children1.isEmpty()) { + List collect1 = children1.stream().filter(f -> i.getBladeRegionCityName().equals(f.getLabel())).collect(Collectors.toList()); + if (!collect1.isEmpty()) { + RegionAllVO regionAllVO1 = collect1.get(0); + basicdataClient.setBladeRegionCityId(regionAllVO1.getValue()); + basicdataClient.setBladeRegionCityName(regionAllVO1.getLabel()); + if (!Objects.isNull(i.getBladeRegionAreaName())){ + List children2 = regionAllVO1.getChildren(); + if (!children2.isEmpty()) { + List collect2 = children2.stream().filter(f -> i.getBladeRegionAreaName().equals(f.getLabel())).collect(Collectors.toList()); + if (!collect2.isEmpty()) { + RegionAllVO regionAllVO2= collect2.get(0); + basicdataClient.setBladeRegionAreaId(regionAllVO2.getValue()); + basicdataClient.setBladeRegionAreaName(regionAllVO2.getLabel()); + }else { + throw new ServiceException(basicdataClient.getClientName()+"区/县地址错误"); + } + } + } + }else { + throw new ServiceException(basicdataClient.getClientName()+"市地址错误"); + } + } + } + }else { + throw new ServiceException(basicdataClient.getClientName()+"省地址错误"); + } + } + - baseMapper.insert(basicdataClient); + this.save(basicdataClient); redis.set(RedisKeyConstant.FINAL_CLIENT_CODE + AuthUtil.getTenantId(), basicdataClient.getClientCode()); + if (ObjectUtils.isNull(basicdataClient.getId())) { throw new ServiceException("客户ID不存在"); } @@ -621,9 +1001,12 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl q.getName().equals(i.getServeWarehouseName())).findFirst().get().getId(); - servicesEntity.setServeWarehouseId(id); - servicesEntity.setServeWarehouseName(i.getServeWarehouseName()); - storageServicesEntities.add(servicesEntity); + if (!Objects.isNull(id)){ + servicesEntity.setServeWarehouseId(id); + servicesEntity.setServeWarehouseName(i.getServeWarehouseName()); + storageServicesEntities.add(servicesEntity); + } + }else { BasicdataStorageServicesEntity servicesEntity = new BasicdataStorageServicesEntity(); servicesEntity.setClientId(basicdataClient.getId()); @@ -651,8 +1034,6 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl Objects.isNull(a.getBladeRegionProvinceName()) || Objects.isNull(a.getBladeRegionCityName())); + if (b) { + throw new CustomerException("请填写至市级地址"); + } if(hasDuplicates){ throw new CustomerException("存在相同的数据"); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java index 28b5c38c1..f140e1e13 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java @@ -19,11 +19,13 @@ package com.logpm.basicdata.service.impl; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.basicdata.entity.BasicdataBrandEntity; import com.logpm.basicdata.entity.BasicdataClientEntity; import com.logpm.basicdata.entity.BasicdataClientLogEntity; import com.logpm.basicdata.entity.BasicdataTripartiteMallEntity; import com.logpm.basicdata.excel.BasicdataTripartiteMallExcel; import com.logpm.basicdata.mapper.BasicdataTripartiteMallMapper; +import com.logpm.basicdata.service.IBasicdataBrandService; import com.logpm.basicdata.service.IBasicdataClientLogService; import com.logpm.basicdata.service.IBasicdataClientService; import com.logpm.basicdata.service.IBasicdataTripartiteMallService; @@ -31,14 +33,18 @@ import com.logpm.basicdata.vo.BasicdataTripartiteMallVO; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.jetbrains.annotations.Nullable; +import org.springblade.common.exception.CustomerException; +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.api.R; +import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.StringUtil; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Objects; @@ -59,6 +65,8 @@ public class BasicdataTripartiteMallServiceImpl extends BaseServiceImpl selectBasicdataTripartiteMallPage(IPage page, BasicdataTripartiteMallVO basicdataTripartiteMall) { @@ -236,6 +244,88 @@ public class BasicdataTripartiteMallServiceImpl extends BaseServiceImpl exportTripartiteMallTemplate() { + List list = new ArrayList<>(); + BasicdataTripartiteMallExcel tripartiteMallExcel = new BasicdataTripartiteMallExcel(); + tripartiteMallExcel.setTripartiteMall("示例:XXX商城"); + tripartiteMallExcel.setTripartiteCoding("示例:ASDFG0000"); + tripartiteMallExcel.setBrandName("示例:欧派"); + list.add(tripartiteMallExcel); + return list; + } + + @Override + @Transactional + public void importTripartiteMall(List data) { + List clientIds = new ArrayList<>(); + boolean b = data.stream().anyMatch(a -> Objects.isNull(a.getClientName())); + String string =""; + if (b) { + string = data.stream().filter(a -> Objects.isNull(a.getClientName())).map(BasicdataTripartiteMallExcel::getTripartiteMall).collect(Collectors.joining(",")); + throw new ServiceException(string+"未填写客户信息"); + } + boolean c = data.stream().anyMatch(a -> Objects.isNull(a.getBrandName())); + if (c) { + string = data.stream().filter(a -> Objects.isNull(a.getBrandName())).map(BasicdataTripartiteMallExcel::getTripartiteMall).collect(Collectors.joining(",")); + throw new ServiceException(string+"未填写品牌信息"); + } + List clientNames = data.stream().map(BasicdataTripartiteMallExcel::getClientName).distinct().collect(Collectors.toList()); + + //查询客户信息是否合法 + List basicdataClientEntityList = basicdataClientService.list(Wrappers.query().lambda() + .in(BasicdataClientEntity::getClientName, clientNames) + ); + if (basicdataClientEntityList.isEmpty()) { + throw new ServiceException(clientNames+"查询客户信息错误"); + } + Map> listMap = basicdataClientEntityList.stream().collect(Collectors.groupingBy(BasicdataClientEntity::getClientName)); + List tripartiteMallEntityList = new ArrayList<>(); + for (BasicdataTripartiteMallExcel datum : data) { + List entities = this.list(Wrappers.query().lambda() + .eq(BasicdataTripartiteMallEntity::getTripartiteMall, datum.getTripartiteMall()) + .eq(!Objects.isNull(datum.getTripartiteCoding()),BasicdataTripartiteMallEntity::getTripartiteCoding,datum.getTripartiteCoding()) + .eq(BasicdataTripartiteMallEntity::getBrandName, datum.getBrandName()) + ); + if (!entities.isEmpty()) { + clientIds.addAll(entities.stream().map(BasicdataTripartiteMallEntity::getClientId).collect(Collectors.toList())); + }else { + List basicdataClientEntities = listMap.get(datum.getClientName()); + if (basicdataClientEntities.isEmpty()) { + throw new ServiceException(datum.getClientName()+"客户信息错误"); + } + if (basicdataClientEntities.size() != 1) { + throw new ServiceException(datum.getClientName()+"客户信息存在多个"); + } + BasicdataClientEntity basicdataClientEntity = basicdataClientEntities.get(0); + BasicdataTripartiteMallEntity basicdataTripartiteMall = BeanUtil.copyProperties(datum, BasicdataTripartiteMallEntity.class); + basicdataTripartiteMall.setClientId(basicdataClientEntity.getId()); + List list = basicdataBrandService.list(Wrappers.query().lambda() + .eq(BasicdataBrandEntity::getBrandName, datum.getBrandName()) + ); + if (!list.isEmpty()) { + basicdataTripartiteMall.setBrandId(list.get(0).getId()); + }else { + throw new ServiceException(datum.getClientName()+"客户信息错误"); + + } + tripartiteMallEntityList.add(basicdataTripartiteMall); + } + + } + if (!clientIds.isEmpty()) { + List basicdataClientEntityList1 = basicdataClientService.listByIds(clientIds); + if (!basicdataClientEntityList1.isEmpty()) { + String errorClient = basicdataClientEntityList1.stream().map(BasicdataClientEntity::getClientName).collect(Collectors.joining(",")); + throw new ServiceException(errorClient+"已存在相关配置"); + } + } + if (!tripartiteMallEntityList.isEmpty()) { + this.saveBatch(tripartiteMallEntityList); + } + + } + private String comparisonBasicdataTripartiteMall(BasicdataTripartiteMallEntity entity, BasicdataTripartiteMallEntity basicdataTripartiteMall) { StringBuilder builder = new StringBuilder(); String str1 = entity.getTripartiteCoding().isEmpty() ? "空" : entity.getTripartiteCoding(); diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java index 4e0c2a10d..05c3f2e86 100644 --- a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java @@ -154,7 +154,7 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService { List trunklineCarsLoadScanEntities = groupedByLoadId.get(key); //干线发车 - nodeInfoVO = buildTrunklineByLoadCar(trunklineCarsLoadScanEntities, listByLoadId ); + nodeInfoVO = buildTrunklineByLoadCar(trunklineCarsLoadScanEntities, listByLoadId ); if (nodeInfoVO != null) { nodeInfoVOList.add(nodeInfoVO); } @@ -208,7 +208,7 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService { if(qualityDeliverEntity != null){ nodeInfoVO = new NodeInfoVO(); nodeInfoVO.setOperateName("配送签收"); - nodeInfoVO.setOperateNumber(signNum + "/" + loadNum); + nodeInfoVO.setOperateNumber(signNum +""); nodeInfoVO.setOperateWarehouseName(qualityDeliverEntity.getWarehouseName()); nodeInfoVO.setOperateTime(qualityDeliverEntity.getSignTime()); // 增加网点电话 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml index 5407946b4..5ae9e3cfe 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml @@ -779,7 +779,7 @@ logpm_distribution_signfor lds JOIN logpm_distribution_delivery_list lddl ON lddl.id = lds.delivery_id JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id AND ldr.reservation_status != 40 - LEFT JOIN logpm_distribution_positioning AS ldp ON lds.reservation_id = lds.reservation_id AND ldp.is_deleted = 0 + LEFT JOIN logpm_distribution_positioning AS ldp ON ldp.reservation_id = lds.reservation_id AND ldp.is_deleted = 0 where lds.is_deleted = 0 and lds.id = #{id} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml index 3b6150678..191ea85a5 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml @@ -1332,7 +1332,7 @@ lww.consignee consignee, lww.departure_warehouse_name departureWarehouseName, lww.destination_warehouse_name destinationWarehouseName, - IFNULL(lqd.delivery_type,lww.service_type) serviceType, + min(lqd.delivery_type) serviceType, GROUP_CONCAT(DISTINCT ltad.train_number) trainNumber, GROUP_CONCAT(DISTINCT ltcls.load_code) loadingLoadCode, GROUP_CONCAT(DISTINCT ltclsm.load_code) unloadLoadCode, @@ -1435,7 +1435,6 @@ lww.consignee, lww.departure_warehouse_name, lww.destination_warehouse_name, - lqd.delivery_type,lww.service_type, oat.day_time @@ -1459,10 +1458,10 @@ lww.consignee consignee, lww.departure_warehouse_name departureWarehouseName, lww.destination_warehouse_name destinationWarehouseName, - CASE WHEN IFNULL(lqd.delivery_type,lww.service_type)=1 THEN '商配' - WHEN IFNULL(lqd.delivery_type,lww.service_type)=2 THEN '市配' - WHEN IFNULL(lqd.delivery_type,lww.service_type)=3 THEN '自提' - WHEN IFNULL(lqd.delivery_type,lww.service_type)=4 THEN '三方中转' + CASE WHEN min(lqd.delivery_type)=1 THEN '商配' + WHEN min(lqd.delivery_type)=2 THEN '市配' + WHEN min(lqd.delivery_type)=3 THEN '自提' + WHEN min(lqd.delivery_type)=4 THEN '三方中转' ELSE '未知' END serviceType, GROUP_CONCAT(DISTINCT ltad.train_number) trainNumber, GROUP_CONCAT(DISTINCT ltcls.load_code) loadingLoadCode, @@ -1566,7 +1565,6 @@ lww.consignee, lww.departure_warehouse_name, lww.destination_warehouse_name, - lqd.delivery_type,lww.service_type, oat.day_time diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java index 9be9cff9b..64d985274 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java @@ -734,6 +734,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { waybillEntity.setTrunklineVehicleType(openOrderDTO.getTrunklineVehicleType()); waybillEntity.setTrunklineVehicleTypeId(openOrderDTO.getTrunklineVehicleTypeId()); waybillEntity.setPickupVehicleType(openOrderDTO.getPickupVehicleType()); + waybillEntity.setPickupVehicleTypeId(openOrderDTO.getPickupVehicleTypeId()); waybillEntity.setAbolishStatus(0); waybillEntity.setFreezeStatus(0); waybillEntity.setSignNum(0); @@ -998,6 +999,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { waybillEntity.setTrunklineVehicleType(openOrderDTO.getTrunklineVehicleType()); waybillEntity.setTrunklineVehicleTypeId(openOrderDTO.getTrunklineVehicleTypeId()); waybillEntity.setPickupVehicleType(openOrderDTO.getPickupVehicleType()); + waybillEntity.setPickupVehicleTypeId(openOrderDTO.getPickupVehicleTypeId()); waybillEntity.setDepartureWarehouseId(openOrderDTO.getDepartureWarehouseId()); waybillEntity.setDepartureWarehouseName(openOrderDTO.getDepartureWarehouseName()); waybillEntity.setDestinationWarehouseId(openOrderDTO.getDestinationWarehouseId()); @@ -4823,8 +4825,8 @@ public class OpenOrderServiceImpl implements IOpenOrderService { // stringBuilder.append("到站:").append(destination).append("-->").append(newDestination).append(";"); EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); editOrderMsgVO.setItemName("干线车型"); - editOrderMsgVO.setOldValue(DictBizCache.getValue("price_vehicle_type", trunklineVehicleType)); - editOrderMsgVO.setNewValue(DictBizCache.getValue("price_vehicle_type", newTrunklineVehicleType)); + editOrderMsgVO.setOldValue(trunklineVehicleType); + editOrderMsgVO.setNewValue(newTrunklineVehicleType); msgList.add(editOrderMsgVO); } @@ -4834,8 +4836,8 @@ public class OpenOrderServiceImpl implements IOpenOrderService { // stringBuilder.append("到站:").append(destination).append("-->").append(newDestination).append(";"); EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); editOrderMsgVO.setItemName("提货车型"); - editOrderMsgVO.setOldValue(DictBizCache.getValue("price_vehicle_type", pickupVehicleType)); - editOrderMsgVO.setNewValue(DictBizCache.getValue("price_vehicle_type", newPickupVehicleType)); + editOrderMsgVO.setOldValue(pickupVehicleType); + editOrderMsgVO.setNewValue(newPickupVehicleType); msgList.add(editOrderMsgVO); } @@ -5442,15 +5444,17 @@ public class OpenOrderServiceImpl implements IOpenOrderService { String newTrunklineVehicleType = openOrderDTO.getTrunklineVehicleType(); String trunklineVehicleType = waybillEntity.getTrunklineVehicleType(); if (!ObjectUtil.equals(newTrunklineVehicleType, trunklineVehicleType)) { - stringBuilder.append("干线车型:").append(DictBizCache.getValue("price_vehicle_type", trunklineVehicleType)).append("-->").append(DictBizCache.getValue("price_vehicle_type", newTrunklineVehicleType)).append(";"); + stringBuilder.append("干线车型:").append(trunklineVehicleType).append("-->").append(newTrunklineVehicleType).append(";"); waybillEntity.setTrunklineVehicleType(newTrunklineVehicleType); + waybillEntity.setTrunklineVehicleTypeId(openOrderDTO.getTrunklineVehicleTypeId()); } String newPickupVehicleType = openOrderDTO.getPickupVehicleType(); String pickupVehicleType = waybillEntity.getPickupVehicleType(); if (!ObjectUtil.equals(newPickupVehicleType, pickupVehicleType)) { - stringBuilder.append("提货车型:").append(DictBizCache.getValue("price_vehicle_type", pickupVehicleType)).append("-->").append(DictBizCache.getValue("price_vehicle_type", newPickupVehicleType)).append(";"); + stringBuilder.append("提货车型:").append(pickupVehicleType).append("-->").append(newPickupVehicleType).append(";"); waybillEntity.setPickupVehicleType(newPickupVehicleType); + waybillEntity.setPickupVehicleTypeId(openOrderDTO.getPickupVehicleTypeId()); }