Browse Source

Merge remote-tracking branch 'origin/pre-production'

master
zhenghaoyu 2 months ago
parent
commit
1e8952fc4a
  1. 4
      blade-biz-common/src/main/java/org/springblade/common/utils/DefaultUserTokenConfig.java
  2. 18
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataClientEntity.java
  3. 5
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataBrandCategoryVO.java
  4. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java
  5. 3
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java
  6. 4
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  7. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataBrandCategoryController.java
  8. 24
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataClientController.java
  9. 30
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java
  10. 44
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataClientExcel.java
  11. 61
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataTripartiteMallExcel.java
  12. 20
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataTripartiteMallImporter.java
  13. 15
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataBrandCategoryMapper.java
  14. 27
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataBrandCategoryMapper.xml
  15. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml
  16. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTripartiteMallMapper.xml
  17. 7
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java
  18. 12
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTripartiteMallService.java
  19. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataBrandCategoryServiceImpl.java
  20. 433
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
  21. 90
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java
  22. 4
      blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java
  23. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  24. 12
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml
  25. 16
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

4
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;
}

18
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;
/**
* 合同附件
*/

5
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;
}

1
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;

3
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;

4
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

@ -2211,8 +2211,8 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
aftersaleSurveyRecordDTO.setStatus(1);
aftersaleSurveyRecordDTO.setIsDeleted(0);
aftersaleSurveyRecordDTO.setTypesOf("1");
aftersaleSurveyRecordDTO.setContent(aftersaleSurveyRecordDTO.getAddDepartment() + "提交处理结果!");
aftersaleSurveyRecordDTO.setProcessingResults(aftersaleSurveyRecordDTO.getAddDepartment() + "提交了处理结果" + aftersalesProcessingResultsDTO.getResultType());
aftersaleSurveyRecordDTO.setContent(myCurrentWarehouse.getName() + "提交处理结果!");
aftersaleSurveyRecordDTO.setProcessingResults(myCurrentWarehouse.getName() + "提交了处理结果" + aftersalesProcessingResultsDTO.getResultType());
aftersaleSurveyRecordDTO.setDifference("3");
aftersaleSurveyRecordDTO.setWorkOrderId(aftersalesWorkOrderDTO.getId());
aftersaleSurveyRecordDTO.setFollowWarehouseId(myCurrentWarehouse.getId());

4
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataBrandCategoryController.java

@ -74,8 +74,8 @@ public class BasicdataBrandCategoryController extends BladeController {
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入basicdataBrandCategory")
public R<IPage<BasicdataBrandCategoryEntity>> list(@ApiIgnore @RequestParam Map<String, Object> basicdataBrandCategory, Query query) {
IPage<BasicdataBrandCategoryEntity> pages = basicdataBrandCategoryService.page(Condition.getPage(query), Condition.getQueryWrapper(basicdataBrandCategory, BasicdataBrandCategoryEntity.class));
public R<List<BasicdataBrandCategoryEntity>> list(@ApiIgnore @RequestParam Map<String, Object> basicdataBrandCategory, Query query) {
List<BasicdataBrandCategoryEntity> pages = basicdataBrandCategoryService.list(Condition.getPage(query), Condition.getQueryWrapper(basicdataBrandCategory, BasicdataBrandCategoryEntity.class));
return R.data(pages);
}

24
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<BasicdataClientExcel> list = basicdataClientService.exportclientTemplate();
ExcelUtil.export(response, "基础客户导入模板" + DateUtil.time(), "基础客户导入模板", list, BasicdataClientExcel.class);
}
/**
* 校验导入数据

30
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<BasicdataTripartiteMallExcel> 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("操作成功");
}
/**
* 导出数据
*/

44
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;
/**
* 配送类型

61
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;
}

20
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<BasicdataTripartiteMallExcel> {
private final IBasicdataTripartiteMallService service;
@Override
public void save(List<BasicdataTripartiteMallExcel> data) {
service.importTripartiteMall(data);
}
}

15
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<BasicdataBrandCategoryEntity> {
/**
* 自定义分页
*
* @param page
* @param basicdataBrandCategory
* @return
*/
List<BasicdataBrandCategoryVO> selectBasicdataBrandCategoryPage(IPage page, BasicdataBrandCategoryVO basicdataBrandCategory);
/**
@ -52,4 +44,11 @@ public interface BasicdataBrandCategoryMapper extends BaseMapper<BasicdataBrandC
*/
List<BasicdataBrandCategoryExcel> exportBasicdataBrandCategory(@Param("ew") Wrapper<BasicdataBrandCategoryEntity> queryWrapper);
/**
* 分页
* @param page
* @param basicdataBrandCategory
* @return
*/
IPage<BasicdataBrandCategoryVO> selectBasicdataBrandCategoryPage(IPage<BasicdataBrandCategoryVO> page,@Param("param") BasicdataBrandCategoryVO basicdataBrandCategory);
}

27
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataBrandCategoryMapper.xml

@ -24,13 +24,34 @@
</resultMap>
<select id="selectBasicdataBrandCategoryPage" resultMap="basicdataBrandCategoryResultMap">
select * from logpm_basicdata_brand_category where is_deleted = 0
</select>
<select id="exportBasicdataBrandCategory" resultType="com.logpm.basicdata.excel.BasicdataBrandCategoryExcel">
SELECT * FROM logpm_basicdata_brand_category ${ew.customSqlSegment}
</select>
<select id="selectBasicdataBrandCategoryPage" resultType="com.logpm.basicdata.vo.BasicdataBrandCategoryVO">
SELECT
lbbc.id ,
lbb.brand_name AS brandName,
lbc.`name` AS name,
lbb.id AS brandId,
lbc.id AS categoryId
FROM
logpm_basicdata_brand_category AS lbbc
LEFT JOIN logpm_basicdata_brand AS lbb ON lbbc.brand_id = lbb.id
LEFT JOIN logpm_basicdata_category AS lbc ON lbbc.category_id = lbc.id
<where>
lbbc.is_deleted = 0
<if test="param.brandName != null and param.brandName != ''">
AND lbb.id = #{param.brandName}
</if>
<if test="param.name != null and param.name != ''">
AND lbc.id = #{param.name}
</if>
</where>
GROUP BY
lbbc.id
</select>
</mapper>

2
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,

2
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

7
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java

@ -134,4 +134,11 @@ public interface IBasicdataClientService extends BaseService<BasicdataClientEnti
R checkImportBasicDataClient(MultipartFile file);
List<BasicdataClientEntity> listNameLike(String name);
/**
* 获取客户导入模板
* @return
*/
List<BasicdataClientExcel> exportclientTemplate();
}

12
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTripartiteMallService.java

@ -86,4 +86,16 @@ public interface IBasicdataTripartiteMallService extends BaseService<BasicdataTr
* @return
*/
R saveTripartiteMallEntity(BasicdataTripartiteMallEntity basicdataTripartiteMall);
/**
* 三方商城导入模板
* @return
*/
List<BasicdataTripartiteMallExcel> exportTripartiteMallTemplate();
/**
* 三方商城导入
* @param data
*/
void importTripartiteMall(List<BasicdataTripartiteMallExcel> data);
}

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataBrandCategoryServiceImpl.java

@ -39,7 +39,7 @@ public class BasicdataBrandCategoryServiceImpl extends BaseServiceImpl<Basicdata
@Override
public IPage<BasicdataBrandCategoryVO> selectBasicdataBrandCategoryPage(IPage<BasicdataBrandCategoryVO> page, BasicdataBrandCategoryVO basicdataBrandCategory) {
return page.setRecords(baseMapper.selectBasicdataBrandCategoryPage(page, basicdataBrandCategory));
return baseMapper.selectBasicdataBrandCategoryPage(page, basicdataBrandCategory);
}

433
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<BasicdataClientM
if(!Objects.isNull(predicateContractStartTime)){
boolean contractStartTime = predicateContractStartTime.test(newClientEntity.getContractStartTime());
if (!contractStartTime) {
content.append("合同开始时间由[").append(sdf.format(oldClientEntity.getContractStartTime())).append("]变更为-->[").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<Date> 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<BasicdataClientM
);
}
@Override
public List<BasicdataClientExcel> exportclientTemplate() {
List<BasicdataClientExcel> 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<Long> toLongList) {
@ -497,6 +535,308 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
return list;
}
// /**
// * 导入数据
// *
// * @param data
// * @param isCovered
// */
// @Override
// @Transactional(rollbackFor = Exception.class)
// public void importClient(List<BasicdataClientExcel> data, Boolean isCovered) {
// log.info("客户导入数据");
//
// QueryWrapper<BasicdataClientEntity> queryWrapper = new QueryWrapper<>();
// List<BasicdataClientEntity> basicdataClients = baseMapper.selectList(queryWrapper);
// // 验证数据
// checkImportBasicDataClient(data,basicdataClients);
//
//
// List<BasicdataStoreContactEntity> storeContactEntities = new ArrayList<>(); // 联系人
// List<BasicdataTripartiteMallEntity> tripartiteMallEntities = new ArrayList<>(); // 三方商场
// List<BasicdataStoreBrandEntity> storeBrandEntities = new ArrayList<>(); // 品牌
// List<BasicdataStorageServicesEntity> storageServicesEntities = new ArrayList<>(); // 服务仓
// List<BasicdataStoreBusinessEntity> storeBusinessEntities = new ArrayList<>(); // 服务类型
// //查询仓库信息
// List<BasicdataWarehouseEntity> list1 = warehouseService.warehouseListqx();
// List<DictBiz> dictBizs = DictBizCache.getList(DictBizConstant.DISTRIBUTION_TYPE);//商 市 自
// List<DictBiz> clientBiz = DictBizCache.getList(DictBizConstant.CLIENT_TYPE); //客 工
// List<DictBiz> freightBiz = DictBizCache.getList(BASIC_FREIGHT_TYPE); //客 工
// Set<String> set = new HashSet<>();
//
//
//
// LambdaQueryWrapper<BasicdataBrandEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
// lambdaQueryWrapper.eq(BasicdataBrandEntity::getIsDeleted, 0);
// List<BasicdataBrandEntity> 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<BasicdataClientEntity> basicdataClientEntities = basicdataClients.stream().filter(ii -> ii.getClientName().equals(basicdataClient.getClientName()) && ii.getClientCode().equals(basicdataClient.getClientCode())).collect(Collectors.toList());
// if(!basicdataClientEntities.isEmpty()){
// // 获取全部重复的数据
// List<String> clientNames = basicdataClientEntities.stream().map(BasicdataClientEntity::getClientName).collect(Collectors.toList());
// List<String> 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<DictBiz> clientFirst = clientBiz.stream().filter(ii -> ii.getDictValue().equals(i.getClientType())).findFirst();
// basicdataClient.setClientType(clientFirst.get().getDictKey());
// //查询客户名称是不是重复
// List<BasicdataClientEntity> basicdataClientEntities = baseMapper.selectList(Wrappers.<BasicdataClientEntity>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<BasicdataStoreBusinessEntity> 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<BasicdataStorageServicesEntity> 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<BasicdataClientM
@Override
@Transactional(rollbackFor = Exception.class)
public void importClient(List<BasicdataClientExcel> data, Boolean isCovered) {
log.info("客户导入数据");
QueryWrapper<BasicdataClientEntity> queryWrapper = new QueryWrapper<>();
List<BasicdataClientEntity> basicdataClients = baseMapper.selectList(queryWrapper);
@ -533,7 +872,6 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
List<BasicdataBrandEntity> basicdataBrandEntityList = basicdataBrandService.list(lambdaQueryWrapper);
for (BasicdataClientExcel i : data) {
// 处理下空格 换行
@ -554,7 +892,7 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
log.info(">>>>>> basicdataClient.getClientCode() {}", basicdataClient.getClientCode());
if(!basicdataClients.isEmpty()){
List<BasicdataClientEntity> basicdataClientEntities = basicdataClients.stream().filter(ii -> ii.getClientName().equals(basicdataClient.getClientName()) && ii.getClientCode().equals(basicdataClient.getClientCode())).collect(Collectors.toList());
List<BasicdataClientEntity> basicdataClientEntities = basicdataClients.stream().filter(ii -> ii.getClientName().equals(basicdataClient.getClientName())).collect(Collectors.toList());
if(!basicdataClientEntities.isEmpty()){
// 获取全部重复的数据
List<String> clientNames = basicdataClientEntities.stream().map(BasicdataClientEntity::getClientName).collect(Collectors.toList());
@ -567,7 +905,9 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
}
Optional<DictBiz> 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<BasicdataClientEntity> basicdataClientEntities = baseMapper.selectList(Wrappers.<BasicdataClientEntity>query().lambda()
.eq(BasicdataClientEntity::getClientName, i.getClientName())
@ -579,8 +919,7 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
basicdataClient.setCargoControl(false);
basicdataClient.setStatus(1);
basicdataClient.setIsDeleted(0);
basicdataClient.setCreateTime(new Date());
basicdataClient.setUpdateTime(new Date());
log.info(">>>>>> 11111 {}", basicdataClient);
// 默认付款方式
String keyValue = matchDictValue(DictBizCache.getList(OPEN_ORDER_PAY_WAY), i.getDefaultPaymentMethods().trim());
@ -595,9 +934,50 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
String typeValue= matchDictValue(DictBizCache.getList(DISTRIBUTION_TYPE), i.getMold());
basicdataClient.setTypeService(StringUtil.isNoneBlank(typeValue)?Integer.parseInt(typeValue):null);
log.info(">>>>>> 22222 {}", basicdataClient);
List<RegionAllVO> regionAllVOList= redis.get("blade:sys:regions::SimpleKey []");
if (!Objects.isNull(i.getBladeRegionProvinceName())){
log.info(">>>>>> 3333 {}", basicdataClient);
List<RegionAllVO> 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<RegionAllVO> children1 = regionAllVO.getChildren();
if (!children1.isEmpty()) {
List<RegionAllVO> 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<RegionAllVO> children2 = regionAllVO1.getChildren();
if (!children2.isEmpty()) {
List<RegionAllVO> 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<BasicdataClientM
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);
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<BasicdataClientM
storeBrandEntity.setBrandName(one.getBrandName());
storeBrandEntities.add(storeBrandEntity);
}
}
//添加联系人
if (ObjectUtils.isNotNull(i.getLinkman())) {
@ -662,26 +1043,7 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
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);
}
}
}
@ -802,7 +1164,10 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
.map(BasicdataClientExcel::getClientName)
.distinct()
.count() != data.size();
boolean b = data.stream().anyMatch(a -> Objects.isNull(a.getBladeRegionProvinceName()) || Objects.isNull(a.getBladeRegionCityName()));
if (b) {
throw new CustomerException("请填写至市级地址");
}
if(hasDuplicates){
throw new CustomerException("存在相同的数据");
}

90
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<Basicdat
private IBasicdataClientLogService basicdataClientLogService;
private IBasicdataBrandService basicdataBrandService;
@Override
public IPage<BasicdataTripartiteMallVO> selectBasicdataTripartiteMallPage(IPage<BasicdataTripartiteMallVO> page, BasicdataTripartiteMallVO basicdataTripartiteMall) {
@ -236,6 +244,88 @@ public class BasicdataTripartiteMallServiceImpl extends BaseServiceImpl<Basicdat
return R.success("操作成功");
}
@Override
public List<BasicdataTripartiteMallExcel> exportTripartiteMallTemplate() {
List<BasicdataTripartiteMallExcel> 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<BasicdataTripartiteMallExcel> data) {
List<Long> 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<String> clientNames = data.stream().map(BasicdataTripartiteMallExcel::getClientName).distinct().collect(Collectors.toList());
//查询客户信息是否合法
List<BasicdataClientEntity> basicdataClientEntityList = basicdataClientService.list(Wrappers.<BasicdataClientEntity>query().lambda()
.in(BasicdataClientEntity::getClientName, clientNames)
);
if (basicdataClientEntityList.isEmpty()) {
throw new ServiceException(clientNames+"查询客户信息错误");
}
Map<String, List<BasicdataClientEntity>> listMap = basicdataClientEntityList.stream().collect(Collectors.groupingBy(BasicdataClientEntity::getClientName));
List<BasicdataTripartiteMallEntity> tripartiteMallEntityList = new ArrayList<>();
for (BasicdataTripartiteMallExcel datum : data) {
List<BasicdataTripartiteMallEntity> entities = this.list(Wrappers.<BasicdataTripartiteMallEntity>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<BasicdataClientEntity> 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<BasicdataBrandEntity> list = basicdataBrandService.list(Wrappers.<BasicdataBrandEntity>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<BasicdataClientEntity> 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();

4
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<TrunklineCarsLoadScanEntity> 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());
// 增加网点电话

2
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}
</select>

12
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
<trim prefix="HAVING" prefixOverrides="AND">
<if test="param.trainNumber != null and param.trainNumber !='' ">
@ -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
<trim prefix="HAVING" prefixOverrides="AND">
<if test="param.trainNumber != null and param.trainNumber !='' ">

16
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());
}

Loading…
Cancel
Save