Browse Source

客户日志增加、客户服务仓调整、商家端取消预约计划

dist.1.3.0
汤建军 8 months ago
parent
commit
20ab013810
  1. 5
      blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java
  2. 96
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataClientLogEntity.java
  3. 36
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataClientLogVO.java
  4. 86
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataClientLogController.java
  5. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataStorageServicesController.java
  6. 35
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataClientLogDTO.java
  7. 43
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientLogMapper.java
  8. 30
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientLogMapper.xml
  9. 57
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientLogService.java
  10. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataStorageServicesService.java
  11. 92
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientLogServiceImpl.java
  12. 167
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
  13. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientUserServiceImpl.java
  14. 192
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStorageServicesServiceImpl.java
  15. 42
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreBrandServiceImpl.java
  16. 47
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreContactServiceImpl.java
  17. 26
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/MallOrderController.java
  18. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  19. 158
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

5
blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java

@ -44,6 +44,8 @@ public class DictBizConstant {
public static final String DELIVERY_WAY = "delivery_way";//增值服务类型
public static final String SERVICE_TYPE = "service_type";//增值服务类型
// --------------2023-08-05 ---------------------
public static final String DISTRIBUTION_DELIVERY_STATUS = "distribution_delivery_status";//配送状态
@ -74,6 +76,9 @@ public class DictBizConstant {
public static final String CERTIFICATE_TYPE = "certificate_type";
public static final String MAINLINE_WAYBILL_PAYMENTMETHOD = "mainline_waybill_paymentmethod";
//---------------2023-08-08 仓库模块
public static final String PALLET_ORDER_TYPE = "pallet_order_type";//打托类型 1服务号 2合同号 3商场 4门店 5客户 6仓库 7其他
public static final String PALLET_ZERO_TYPE = "pallet_zero_type";//打托类型 1服务号 2合同号 3商场 4门店 5客户 6仓库 7其他

96
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataClientLogEntity.java

@ -0,0 +1,96 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.util.Date;
import java.util.List;
/**
* 基础客户表 实体类
*
* @author cyz
* @since 2023-05-16
*/
@Data
@TableName("logpm_basicdata_client_log")
@ApiModel(value = "BasicdataClient对象", description = "基础客户表")
@EqualsAndHashCode(callSuper = true)
public class BasicdataClientLogEntity extends TenantEntity {
/**
* 预留1
*/
@ApiModelProperty(value = "预留1")
private String reserve1;
/**
* 预留2
*/
@ApiModelProperty(value = "预留2")
private String reserve2;
/**
* 预留3
*/
@ApiModelProperty(value = "预留3")
private String reserve3;
/**
* 预留4
*/
@ApiModelProperty(value = "预留4")
private String reserve4;
/**
* 预留5
*/
@ApiModelProperty(value = "预留5")
private String reserve5;
/**
* 客户Id
*/
@ApiModelProperty(value = "客户Id")
private Long clientId;
/**
* 客户名称
*/
@ApiModelProperty(value = "客户名称")
private String clientName;
/**
* 操作人
*/
@ApiModelProperty(value = "操作人")
private String operator;
/**
* 操作描述
*/
@ApiModelProperty(value = "操作描述")
private String content;
}

36
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataClientLogVO.java

@ -0,0 +1,36 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.vo;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataClientLogEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 基础客户表 视图实体类
*
* @author cyz
* @since 2023-05-16
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class BasicdataClientLogVO extends BasicdataClientLogEntity {
private static final long serialVersionUID = 1L;
}

86
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataClientLogController.java

@ -0,0 +1,86 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataClientLogEntity;
import com.logpm.basicdata.entity.BasicdataStoreBusinessEntity;
import com.logpm.basicdata.entity.BasicdataStoreContactEntity;
import com.logpm.basicdata.excel.BasicDataClienImporter;
import com.logpm.basicdata.excel.BasicdataClientExcel;
import com.logpm.basicdata.service.IBasicdataClientLogService;
import com.logpm.basicdata.service.IBasicdataClientService;
import com.logpm.basicdata.service.IBasicdataStoreBusinessService;
import com.logpm.basicdata.service.IBasicdataStoreContactService;
import com.logpm.basicdata.vo.BasicdataClientVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.feign.IUserClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.Map;
/**
* 基础客户表 控制器
*
* @author cyz
* @since 2023-05-16
*/
@RestController
@RequestMapping("/clientLog")
@Api(value = "基础客户表", tags = "基础客户表接口")
public class BasicdataClientLogController extends BladeController {
@Autowired
private IBasicdataClientLogService basicdataClientLogService;
@GetMapping("/list")
@ApiOperationSupport(order = 6)
private R list(@RequestParam Long clientId){
return R.data(basicdataClientLogService.list(Wrappers.<BasicdataClientLogEntity>query().lambda()
.eq(BasicdataClientLogEntity::getClientId,clientId)
)
);
}
}

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataStorageServicesController.java

@ -119,7 +119,7 @@ public class BasicdataStorageServicesController extends BladeController {
@ApiOperation(value = "新增或修改", notes = "传入basicdataStorageServices")
public R submit(@Valid @RequestBody BasicdataStorageServicesDTO basicdataStorageServices) {
return R.status(basicdataStorageServicesService.submitSave(basicdataStorageServices));
return basicdataStorageServicesService.submitSave(basicdataStorageServices);
}
/**

35
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataClientLogDTO.java

@ -0,0 +1,35 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.dto;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataClientLogEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 基础客户表 数据传输对象实体类
*
* @author cyz
* @since 2023-05-16
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class BasicdataClientLogDTO extends BasicdataClientLogEntity {
private static final long serialVersionUID = 1L;
}

43
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientLogMapper.java

@ -0,0 +1,43 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataClientLogEntity;
import com.logpm.basicdata.excel.BasicdataClientExcel;
import com.logpm.basicdata.vo.BasicdataClientVO;
import com.logpm.basicdata.vo.ClientInfoVO;
import org.apache.ibatis.annotations.Param;
import org.springblade.common.model.dto.NameDTO;
import java.util.List;
import java.util.Map;
/**
* 基础客户表 Mapper 接口
*
* @author cyz
* @since 2023-05-16
*/
public interface BasicdataClientLogMapper extends BaseMapper<BasicdataClientLogEntity> {
}

30
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientLogMapper.xml

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.basicdata.mapper.BasicdataClientLogMapper">
<!-- 通用查询映射结果 -->
<resultMap id="basicdataClientResultMap" type="com.logpm.basicdata.entity.BasicdataClientLogEntity">
<result column="tenant_id" property="tenantId"/>
<result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="create_dept" property="createDept"/>
<result column="id" property="id"/>
<result column="reserve1" property="reserve1"/>
<result column="reserve2" property="reserve2"/>
<result column="reserve3" property="reserve3"/>
<result column="reserve4" property="reserve4"/>
<result column="reserve5" property="reserve5"/>
<result column="client_id" property="clientId"/>
<result column="client_name" property="clientName"/>
<result column="operator" property="operator"/>
<result column="content" property="content"/>
</resultMap>
</mapper>

57
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientLogService.java

@ -0,0 +1,57 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataClientLogEntity;
import com.logpm.basicdata.excel.BasicdataClientExcel;
import com.logpm.basicdata.vo.BasicdataClientVO;
import org.springblade.common.model.dto.NameDTO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import org.springframework.web.multipart.MultipartFile;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.Map;
/**
* 基础客户表 服务类
*
* @author cyz
* @since 2023-05-16
*/
public interface IBasicdataClientLogService extends BaseService<BasicdataClientLogEntity> {
/**
* 保存指定日志
* @param basicdataClientLogEntity
*/
boolean saveAppointLog(BasicdataClientLogEntity basicdataClientLogEntity);
/**
* 批量保存指定日志
* @param basicdataClientLogEntityList
*/
boolean saveBatchAppointLog(List<BasicdataClientLogEntity> basicdataClientLogEntityList);
}

3
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataStorageServicesService.java

@ -23,6 +23,7 @@ import com.logpm.basicdata.entity.BasicdataStorageServicesEntity;
import com.logpm.basicdata.excel.BasicdataStorageServicesExcel;
import com.logpm.basicdata.vo.BasicdataStorageServicesVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import java.util.List;
import java.util.Map;
@ -52,7 +53,7 @@ public interface IBasicdataStorageServicesService extends BaseService<BasicdataS
*/
List<BasicdataStorageServicesExcel> exportBasicdataStorageServices(Wrapper<BasicdataStorageServicesEntity> queryWrapper);
boolean submitSave(BasicdataStorageServicesDTO basicdataStorageServices);
R submitSave(BasicdataStorageServicesDTO basicdataStorageServices);
List<BasicdataStorageServicesVO> pageList(IPage<Object> page, Map<String, Object> basicdataStorageServices);

92
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientLogServiceImpl.java

@ -0,0 +1,92 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basic.entity.BasicTenantCodeEntity;
import com.logpm.basic.feign.IBasicTenantCodeClient;
import com.logpm.basicdata.entity.*;
import com.logpm.basicdata.excel.BasicdataClientExcel;
import com.logpm.basicdata.mapper.BasicdataClientLogMapper;
import com.logpm.basicdata.mapper.BasicdataClientMapper;
import com.logpm.basicdata.service.*;
import com.logpm.basicdata.vo.BasicdataClientVO;
import com.logpm.basicdata.vo.ClientInfoVO;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.RedisKeyConstant;
import org.springblade.common.constant.basiccode.BasicCodeShowConstant;
import org.springblade.common.constant.basiccode.BasicCodeTypeConstant;
import org.springblade.common.model.dto.NameDTO;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.BladeUser;
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.ObjectUtil;
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.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import static org.springblade.common.constant.DictBizConstant.OPEN_ORDER_PAY_WAY;
/**
* 基础客户表 服务实现类
*
* @author cyz
* @since 2023-05-16
*/
@Slf4j
@Service
public class BasicdataClientLogServiceImpl extends BaseServiceImpl<BasicdataClientLogMapper, BasicdataClientLogEntity> implements IBasicdataClientLogService {
@Override
public boolean saveAppointLog(BasicdataClientLogEntity basicdataClientLogEntity) {
return this.save(basicdataClientLogEntity);
}
@Override
public boolean saveBatchAppointLog(List<BasicdataClientLogEntity> basicdataClientLogEntityList) {
return this.saveBatch(basicdataClientLogEntityList);
}
}

167
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java

@ -28,26 +28,10 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basic.entity.BasicTenantCodeEntity;
import com.logpm.basic.feign.IBasicTenantCodeClient;
import com.logpm.basicdata.entity.BasicdataBrandEntity;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataHistoricalContractEntity;
import com.logpm.basicdata.entity.BasicdataStorageServicesEntity;
import com.logpm.basicdata.entity.BasicdataStoreBrandEntity;
import com.logpm.basicdata.entity.BasicdataStoreBusinessEntity;
import com.logpm.basicdata.entity.BasicdataStoreContactEntity;
import com.logpm.basicdata.entity.BasicdataTripartiteMallEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.entity.*;
import com.logpm.basicdata.excel.BasicdataClientExcel;
import com.logpm.basicdata.mapper.BasicdataClientMapper;
import com.logpm.basicdata.service.IBasicdataBrandService;
import com.logpm.basicdata.service.IBasicdataClientService;
import com.logpm.basicdata.service.IBasicdataHistoricalContractService;
import com.logpm.basicdata.service.IBasicdataStorageServicesService;
import com.logpm.basicdata.service.IBasicdataStoreBrandService;
import com.logpm.basicdata.service.IBasicdataStoreBusinessService;
import com.logpm.basicdata.service.IBasicdataStoreContactService;
import com.logpm.basicdata.service.IBasicdataTripartiteMallService;
import com.logpm.basicdata.service.IBasicdataWarehouseService;
import com.logpm.basicdata.service.*;
import com.logpm.basicdata.vo.BasicdataClientVO;
import com.logpm.basicdata.vo.ClientInfoVO;
import lombok.extern.slf4j.Slf4j;
@ -64,11 +48,14 @@ import org.springblade.core.secure.BladeUser;
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.ObjectUtil;
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.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -76,7 +63,9 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import static org.springblade.common.constant.DictBizConstant.OPEN_ORDER_PAY_WAY;
@ -101,6 +90,7 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
@Autowired
private IBasicdataTripartiteMallService basicdataTripartiteMallService; //三方商场
@Autowired
@Lazy
private IBasicdataStorageServicesService basicdataStorageServicesService; //服务仓
@Autowired
private IBasicdataBrandService basicdataBrandService; //品牌
@ -120,6 +110,12 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
@Autowired
private BladeRedis redis;
@Autowired
private IRegionFeign regionFeign;
@Autowired
private IBasicdataClientLogService basicdataClientLogService;
@Override
public IPage<BasicdataClientVO> selectBasicdataClientPage(IPage<BasicdataClientVO> page, BasicdataClientVO basicdataClient) {
return page.setRecords(baseMapper.selectBasicdataClientPage(page, basicdataClient));
@ -140,9 +136,15 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
public boolean ownSaveOrUpdate(BasicdataClientEntity basicdataClient) throws NoSuchAlgorithmException {
//添加客户端的历史合同的数据
if (ObjectUtils.isNotNull(basicdataClient.getId())) {
BasicdataClientEntity oldClientEntity = this.getById(basicdataClient.getId());
if (!Objects.isNull(basicdataClient.getBusinessType())) {
basicdataClient.setTypeService(Integer.parseInt(basicdataClient.getBusinessType()));
}
//对比两个客户信息进行比对
boolean flag = contrastOldClientAndNewClient(oldClientEntity, basicdataClient);
if (!flag){
log.info(">>>>>>>>>>>>>>>>>>>>>>>记录客户修改日志操作失败");
}
//修改
this.updateById(basicdataClient);
List<BasicdataStoreBusinessEntity> list = basicdataStoreBusinessService.list(Wrappers.<BasicdataStoreBusinessEntity>query().lambda()
@ -283,6 +285,110 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
return true;
}
private boolean contrastOldClientAndNewClient(BasicdataClientEntity oldClientEntity, BasicdataClientEntity newClientEntity) {
StringBuilder content = new StringBuilder();
Predicate<String> predicateClientName = Predicate.isEqual(oldClientEntity.getClientName());
boolean clientName = predicateClientName.test(newClientEntity.getClientName());
if (!clientName){
//客户名称
content.append("客户名称由[").append(oldClientEntity.getClientName()).append("]变更为-->[").append(newClientEntity.getClientName()).append("],");
}
Predicate<String> predicateClientType = Predicate.isEqual(oldClientEntity.getClientType());
boolean clientType = predicateClientType.test(newClientEntity.getClientType());
if (!clientType){
//类型
String oldClientTypeValue = DictBizCache.getValue(DictBizConstant.CLIENT_TYPE, oldClientEntity.getClientType());
String newClientTypeValue = DictBizCache.getValue(DictBizConstant.CLIENT_TYPE, newClientEntity.getClientType());
content.append("客户类型由[").append(oldClientTypeValue).append("]变更为-->[").append(newClientTypeValue).append("],");
}
Predicate<String> predicateDetailedly = Predicate.isEqual(oldClientEntity.getDetailedly());
boolean detailedly = predicateDetailedly.test(newClientEntity.getDetailedly());
if (!detailedly){
//详细地址
content.append("详细地址由[").append(oldClientEntity.getDetailedly()).append("]变更为-->[").append(newClientEntity.getDetailedly()).append("],");
}
Predicate<Integer> predicateTypeService = Predicate.isEqual(oldClientEntity.getTypeService());
boolean typeService = predicateTypeService.test(newClientEntity.getTypeService());
if (!typeService){
//配送类型
String oldDeliveryType = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, oldClientEntity.getTypeService());
String newDeliveryType = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, newClientEntity.getTypeService());
content.append("配送类型由[").append(oldDeliveryType).append("]变更为-->[").append(newDeliveryType).append("],");
}
Predicate<String> predicateDefaultPaymentMethods = Predicate.isEqual(oldClientEntity.getDefaultPaymentMethods());
boolean defaultPaymentMethods = predicateDefaultPaymentMethods.test(newClientEntity.getDefaultPaymentMethods());
if (!defaultPaymentMethods){
//结算方式
String oldDefaultPaymentMethodsValue = DictBizCache.getValue(DictBizConstant.MAINLINE_WAYBILL_PAYMENTMETHOD, oldClientEntity.getDefaultPaymentMethods());
String newDefaultPaymentMethodsValue = DictBizCache.getValue(DictBizConstant.MAINLINE_WAYBILL_PAYMENTMETHOD, newClientEntity.getDefaultPaymentMethods());
content.append("结算方式由[").append(oldDefaultPaymentMethodsValue).append("]变更为-->[").append(newDefaultPaymentMethodsValue).append("],");
}
String oldAddress = handleClientCityCode(oldClientEntity);
String newAddress = handleClientCityCode(newClientEntity);
if (!oldAddress.equals(newAddress)){
//地址变更
content.append("地址由[").append(oldAddress).append("]变更为-->[").append(newAddress).append("],");
}
StringBuilder newTypeServiceBuilder = new StringBuilder();
List<String> newTypeServiceList = newClientEntity.getTypeServiceList();
if (!newTypeServiceList.isEmpty()) {
for (String newType : newTypeServiceList) {
String newTypeService = DictBizCache.getValue(DictBizConstant.SERVICE_TYPE, newType);
newTypeServiceBuilder.append(newTypeService).append(",");
}
}
//查询原计划服务类型
List<BasicdataStoreBusinessEntity> oldTypeServiceList = basicdataStoreBusinessService.list(Wrappers.<BasicdataStoreBusinessEntity>query().lambda()
.eq(BasicdataStoreBusinessEntity::getClientId, oldClientEntity.getId())
);
StringBuilder oldTypeServiceBuilder = new StringBuilder();
if (!oldTypeServiceList.isEmpty()) {
for (BasicdataStoreBusinessEntity oldType : oldTypeServiceList) {
String oldTypeService = DictBizCache.getValue(DictBizConstant.SERVICE_TYPE, oldType.getTypeService());
oldTypeServiceBuilder.append(oldTypeService).append(",");
}
if (!oldTypeServiceBuilder.deleteCharAt(oldTypeServiceBuilder.lastIndexOf(",")).toString().contentEquals(newTypeServiceBuilder.deleteCharAt(newTypeServiceBuilder.lastIndexOf(",")))) {
content.append("服务类型由[").append(oldTypeServiceBuilder).append("]变更为-->[").append(newTypeServiceBuilder).append("],");
}
}
//比对合同附件文件
if (!Objects.isNull(newClientEntity.getFileName())) {
String oldFileName = "";
//查询之前的历史合同附件
List<BasicdataHistoricalContractEntity> historicalContractEntities = basicdataHistoricalContractService.list(Wrappers.<BasicdataHistoricalContractEntity>query().lambda()
.eq(BasicdataHistoricalContractEntity::getClientId, oldClientEntity.getId())
.orderByDesc(BasicdataHistoricalContractEntity::getCreateTime)
);
if (!historicalContractEntities.isEmpty()) {
oldFileName = historicalContractEntities.get(0).getFileName();
}
if (!newClientEntity.getFileName().equals(oldFileName)){
content.append("合同附件由[").append(oldFileName).append("]变更为-->[").append(newClientEntity.getFileName()).append("],");
}
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//对于合同开始时间比对
Predicate<Date> predicateContractStartTime = Predicate.isEqual(oldClientEntity.getContractStartTime());
boolean contractStartTime = predicateContractStartTime.test(newClientEntity.getContractStartTime());
if (!contractStartTime){
content.append("合同开始时间由[").append(sdf.format(oldClientEntity.getContractStartTime())).append("]变更为-->[").append(sdf.format(oldClientEntity.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("],");
}
BasicdataClientLogEntity basicdataClientLogEntity = new BasicdataClientLogEntity();
basicdataClientLogEntity.setClientName(newClientEntity.getClientName());
basicdataClientLogEntity.setClientId(newClientEntity.getId());
basicdataClientLogEntity.setOperator(AuthUtil.getNickName());
basicdataClientLogEntity.setContent(content.deleteCharAt(content.lastIndexOf(",")).toString());
return basicdataClientLogService.save(basicdataClientLogEntity);
}
@Override
public List<BasicdataClientEntity> listName(String name) {
@ -769,5 +875,30 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
return R.success("校验成功");
}
private String handleClientCityCode(BasicdataClientEntity clientEntity){
StringBuilder oldAddress = new StringBuilder();
if (!Objects.isNull(clientEntity.getBladeRegionProvinceId())){
String provinceName = regionFeign.getName(clientEntity.getBladeRegionProvinceId());
if (Func.isNotEmpty(provinceName)){
oldAddress.append(provinceName);
}
}
if (!Objects.isNull(clientEntity.getBladeRegionCityId())){
String cityName = regionFeign.getName(clientEntity.getBladeRegionCityId());
if (Func.isNotEmpty(cityName)){
oldAddress.append(cityName);
}
}
if (!Objects.isNull(clientEntity.getBladeRegionAreaId())){
String areaName = regionFeign.getName(clientEntity.getBladeRegionAreaId());
if (Func.isNotEmpty(areaName)){
oldAddress.append(areaName);
}
}
return oldAddress.toString();
}
}

1
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientUserServiceImpl.java

@ -26,6 +26,7 @@ import org.springblade.system.entity.User;
import org.springblade.system.entity.UserInfo;
import org.springblade.system.feign.IUserClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import java.security.NoSuchAlgorithmException;

192
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStorageServicesServiceImpl.java

@ -22,25 +22,37 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.dto.BasicdataStorageServicesDTO;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataClientLogEntity;
import com.logpm.basicdata.entity.BasicdataStorageServicesEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.excel.BasicdataStorageServicesExcel;
import com.logpm.basicdata.mapper.BasicdataStorageServicesMapper;
import com.logpm.basicdata.service.IBasicdataClientLogService;
import com.logpm.basicdata.service.IBasicdataClientService;
import com.logpm.basicdata.service.IBasicdataStorageServicesService;
import com.logpm.basicdata.service.IBasicdataWarehouseService;
import com.logpm.basicdata.vo.BasicdataStorageServicesVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.feign.IUserClient;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
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;
import java.util.stream.Collectors;
/**
* 门店服务仓库表 服务实现类
@ -49,14 +61,22 @@ import java.util.Map;
* @since 2023-05-16
*/
@Service
@AllArgsConstructor
@Slf4j
public class BasicdataStorageServicesServiceImpl extends BaseServiceImpl<BasicdataStorageServicesMapper, BasicdataStorageServicesEntity> implements IBasicdataStorageServicesService {
@Autowired
private IBasicdataWarehouseService basicdataWarehouseService;
@Autowired
private IUserClient userClient;
@Autowired
@Lazy
private IBasicdataClientService basicdataClientService;
@Autowired
private IBasicdataClientLogService basicdataClientLogService;
@Override
public IPage<BasicdataStorageServicesVO> selectBasicdataStorageServicesPage(IPage<BasicdataStorageServicesVO> page, BasicdataStorageServicesVO basicdataStorageServices) {
return page.setRecords(baseMapper.selectBasicdataStorageServicesPage(page, basicdataStorageServices));
@ -74,79 +94,159 @@ public class BasicdataStorageServicesServiceImpl extends BaseServiceImpl<Basicda
@Override
@Transactional(rollbackFor = Exception.class)
public boolean submitSave(BasicdataStorageServicesDTO basicdataStorageServices) {
public R submitSave(BasicdataStorageServicesDTO basicdataStorageServices) {
String method = "#####################################BasicdataStorageServicesServiceImpl.submitSave";
if (Objects.isNull(basicdataStorageServices.getClientId())) {
log.error(method + "clientID参数缺失");
return R.fail("参数缺失");
}
if (Objects.isNull(basicdataStorageServices.getServeWarehouseId())) {
log.error(method + "serveWarehouseId参数缺失");
return R.fail("参数缺失");
}
BasicdataClientEntity clientEntity = basicdataClientService.getById(basicdataStorageServices.getClientId());
if (Objects.isNull(clientEntity)) {
log.error(method + "查询客户信息错误clientID:{}", basicdataStorageServices.getClientId());
return R.fail("查询客户信息错误");
}
BasicdataWarehouseEntity warehouseService = basicdataWarehouseService.getById(basicdataStorageServices.getServeWarehouseId());
if (Objects.isNull(warehouseService)) {
log.error(method + "查询服务仓信息错误warehouseID:{}", basicdataStorageServices.getServeWarehouseId());
return R.fail("查询服务仓信息错误");
}
List<BasicdataStorageServicesEntity> list = this.list(Wrappers.<BasicdataStorageServicesEntity>query().lambda()
.eq(BasicdataStorageServicesEntity::getClientId, basicdataStorageServices.getClientId())
);
Map<String, List<BasicdataStorageServicesEntity>> listMap = null;
if (!list.isEmpty()) {
listMap = list.stream().collect(Collectors.groupingBy(BasicdataStorageServicesEntity::getSendWarehouseName));
}
if (ObjectUtils.isNotNull(basicdataStorageServices.getId())) {
//进行日志记录
BasicdataClientLogEntity basicdataClientLogEntity = new BasicdataClientLogEntity();
basicdataClientLogEntity.setClientName(clientEntity.getClientName());
basicdataClientLogEntity.setClientId(clientEntity.getId());
basicdataClientLogEntity.setOperator(AuthUtil.getNickName());
BasicdataStorageServicesEntity entity = this.getById(basicdataStorageServices.getId());
if (Objects.isNull(clientEntity)) {
log.error(method + "查询发站仓配置错误id:{}", basicdataStorageServices.getId());
return R.fail("查询发站仓配置错误");
}
// 获取仓库名称
BasicdataWarehouseEntity sendBasicdataWarehouseEntity = basicdataWarehouseService.getById(basicdataStorageServices.getSendWarehouseId());
if (sendBasicdataWarehouseEntity != null) {
basicdataStorageServices.setSendWarehouseName(sendBasicdataWarehouseEntity.getName());
if (!Objects.isNull(listMap)) {
List<BasicdataStorageServicesEntity> basicdataStorageServicesEntities = listMap.get(sendBasicdataWarehouseEntity.getName());
if (!Objects.isNull(basicdataStorageServicesEntities)) {
return R.fail("已存在发站仓配置!!!");
}
BasicdataWarehouseEntity serveBasicdataWarehouseEntity = basicdataWarehouseService.getById(basicdataStorageServices.getServeWarehouseId());
if(serveBasicdataWarehouseEntity!=null){
basicdataStorageServices.setServeWarehouseName(serveBasicdataWarehouseEntity.getName());
}
basicdataStorageServices.setSendWarehouseName(sendBasicdataWarehouseEntity.getName());
}
basicdataStorageServices.setServeWarehouseName(warehouseService.getName());
String content = "服务仓配置发站仓由[" + entity.getSendWarehouseName() + "]变更为-->[" + basicdataStorageServices.getSendWarehouseName() + "],服务仓由[" + entity.getServeWarehouseName() + "]变更为-->[" + basicdataStorageServices.getServeWarehouseName() + "]";
basicdataClientLogEntity.setContent(content);
basicdataClientLogService.saveAppointLog(basicdataClientLogEntity);
this.updateById(basicdataStorageServices);
return true;
return R.success("操作成功");
} else {
//添加
List<String> addSendWarehouseIds = new ArrayList<>();
int a = 0;
if (Func.isEmpty(basicdataStorageServices.getSendWarehouseIds())) {
//需要进行所有仓库的获取
List<BasicdataWarehouseEntity> warehouseList = basicdataWarehouseService.list();
if(ObjectUtils.isNull( basicdataStorageServices.getSendWarehouseIds()) || basicdataStorageServices.getSendWarehouseIds().size() == 0 ){
//查询有没有过服务舱
List<BasicdataStorageServicesEntity> list = this.list(Wrappers.<BasicdataStorageServicesEntity>query().lambda()
.eq(BasicdataStorageServicesEntity::getServeWarehouseId, basicdataStorageServices.getServeWarehouseId())
.eq(BasicdataStorageServicesEntity::getClientId, basicdataStorageServices.getClientId())
);
boolean b = list.stream().anyMatch(i -> ObjectUtil.isEmpty(i.getSendWarehouseId()));
if(b){
throw new ServiceException("当前添加已存在!");
// List<BasicdataWarehouseEntity> warehouseList = basicdataWarehouseService.getMyWarehouseList();
if (!warehouseList.isEmpty()) {
List<String> allWarehouseIds = warehouseList.stream().map(BasicdataWarehouseEntity::getId).map(String::valueOf).collect(Collectors.toList());
a = warehouseList.size();
if (!list.isEmpty()) {
//存在有服务仓信息
List<String> allWarehouseId = warehouseList.stream().filter(f -> !list.stream().map(BasicdataStorageServicesEntity::getSendWarehouseName).collect(Collectors.toList()).contains(f.getName())).map(BasicdataWarehouseEntity::getId).map(String::valueOf).collect(Collectors.toList());
// List<String> allWarehouseId = allWarehouseIds.stream().filter(f -> !list.stream().map(BasicdataStorageServicesEntity::getSendWarehouseName).collect(Collectors.toList()).contains(f)).collect(Collectors.toList());
if (!allWarehouseId.isEmpty()) {
addSendWarehouseIds.addAll(allWarehouseId);
}
} else {
//没有服务仓信息
addSendWarehouseIds.addAll(allWarehouseIds);
}
}
} else {
//校验当前选择的服务仓是否存在有配置
List<String> sendWarehouseIds = basicdataStorageServices.getSendWarehouseIds();
if (!list.isEmpty()) {
List<String> warehouseIds = sendWarehouseIds.stream().filter(f -> !list.stream().map(BasicdataStorageServicesEntity::getSendWarehouseId).collect(Collectors.toList()).contains(f)).collect(Collectors.toList());
if (!warehouseIds.isEmpty()) {
addSendWarehouseIds.addAll(warehouseIds);
} else {
return R.fail("当前添加服务仓均已存在配置");
}
}
}
List<BasicdataStorageServicesEntity> servicesEntities = new ArrayList<>();
if(ObjectUtil.isEmpty(sendWarehouseIds) || sendWarehouseIds.size() < 1){
List<BasicdataClientLogEntity> basicdataClientLogEntityList = new ArrayList<>();
if (!addSendWarehouseIds.isEmpty()) {
if (Objects.equals(addSendWarehouseIds.size(),a)){
//校验是否进行了一次全部的添加
List<BasicdataStorageServicesEntity> allList = this.list(Wrappers.<BasicdataStorageServicesEntity>query().lambda()
.eq(BasicdataStorageServicesEntity::getClientId, clientEntity.getId())
.eq(BasicdataStorageServicesEntity::getSendWarehouseName, "全部")
);
if (!allList.isEmpty()) {
return R.fail("已存在全部的服务仓配置");
}else {
log.error(method+"该客户下不存在未添加发站仓信息,已存在配置:{}",list.stream().map(BasicdataStorageServicesEntity::getSendWarehouseId).collect(Collectors.toList()));
}
BasicdataStorageServicesEntity basicdataStorageServicesEntity = new BasicdataStorageServicesEntity();
BeanUtils.copyProperties(basicdataStorageServices,basicdataStorageServicesEntity);
// 获取仓库名称
BasicdataWarehouseEntity serveBasicdataWarehouseEntity = basicdataWarehouseService.getById(basicdataStorageServices.getServeWarehouseId());
basicdataStorageServicesEntity.setServeWarehouseName(serveBasicdataWarehouseEntity.getName());
basicdataStorageServicesEntity.setSendWarehouseName("全部");
basicdataStorageServicesEntity.setClientId(clientEntity.getId());
basicdataStorageServicesEntity.setDistinguish(2);
basicdataStorageServicesEntity.setServeWarehouseName(warehouseService.getName());
basicdataStorageServicesEntity.setServeWarehouseId(warehouseService.getId());
// basicdataStorageServicesEntity.setSendWarehouseId(addSendWarehouseIds.stream().collect(Collectors.joining(",")));
servicesEntities.add(basicdataStorageServicesEntity);
//进行日志记录
BasicdataClientLogEntity basicdataClientLogEntity = new BasicdataClientLogEntity();
basicdataClientLogEntity.setClientName(clientEntity.getClientName());
basicdataClientLogEntity.setClientId(clientEntity.getId());
basicdataClientLogEntity.setOperator(AuthUtil.getNickName());
String content = "新增服务仓配置-->发站仓[全部],服务仓["+basicdataStorageServicesEntity.getServeWarehouseName()+"]";
basicdataClientLogEntity.setContent(content);
basicdataClientLogEntityList.add(basicdataClientLogEntity);
}else {
sendWarehouseIds.forEach( i ->{
List<BasicdataStorageServicesEntity> list = this.list(Wrappers.<BasicdataStorageServicesEntity>query().lambda()
.eq(BasicdataStorageServicesEntity::getServeWarehouseId, basicdataStorageServices.getServeWarehouseId())
.eq(BasicdataStorageServicesEntity::getSendWarehouseId, i)
.eq(BasicdataStorageServicesEntity::getClientId, basicdataStorageServices.getClientId())
);
if(list.size() < 1){
addSendWarehouseIds.forEach(i -> {
BasicdataStorageServicesEntity basicdataStorageServicesEntity = new BasicdataStorageServicesEntity();
BeanUtils.copyProperties(basicdataStorageServices, basicdataStorageServicesEntity);
// 获取仓库名称
BasicdataWarehouseEntity sendBasicdataWarehouseEntity = basicdataWarehouseService.getById(i);
basicdataStorageServicesEntity.setSendWarehouseName(sendBasicdataWarehouseEntity.getName());
BasicdataWarehouseEntity serveBasicdataWarehouseEntity = basicdataWarehouseService.getById(basicdataStorageServices.getServeWarehouseId());
basicdataStorageServicesEntity.setServeWarehouseName(serveBasicdataWarehouseEntity.getName());
basicdataStorageServicesEntity.setSendWarehouseId(i);
basicdataStorageServicesEntity.setServeWarehouseName(warehouseService.getName());
basicdataStorageServicesEntity.setSendWarehouseId(i.toString());
servicesEntities.add(basicdataStorageServicesEntity);
}
//进行日志记录
BasicdataClientLogEntity basicdataClientLogEntity = new BasicdataClientLogEntity();
basicdataClientLogEntity.setClientName(clientEntity.getClientName());
basicdataClientLogEntity.setClientId(clientEntity.getId());
basicdataClientLogEntity.setOperator(AuthUtil.getNickName());
String content = "新增服务仓配置-->发站仓["+basicdataStorageServicesEntity.getSendWarehouseName()+"],服务仓["+basicdataStorageServicesEntity.getServeWarehouseName()+"]";
basicdataClientLogEntity.setContent(content);
basicdataClientLogEntityList.add(basicdataClientLogEntity);
});
}
if(servicesEntities.size() > 0){
if (!servicesEntities.isEmpty()) {
this.saveBatch(servicesEntities);
}
return true;
if (!basicdataClientLogEntityList.isEmpty()) {
//进行批量日志保存
basicdataClientLogService.saveBatchAppointLog(basicdataClientLogEntityList);
}
}
}
// return this.saveOrUpdate(basicdataStorageServices);
return R.success("操作成功");
}
@Override

42
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreBrandServiceImpl.java

@ -21,21 +21,25 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataClientLogEntity;
import com.logpm.basicdata.entity.BasicdataStoreBrandEntity;
import com.logpm.basicdata.excel.BasicdataStoreBrandExcel;
import com.logpm.basicdata.mapper.BasicdataStoreBrandMapper;
import com.logpm.basicdata.service.IBasicdataClientLogService;
import com.logpm.basicdata.service.IBasicdataClientService;
import com.logpm.basicdata.service.IBasicdataShopService;
import com.logpm.basicdata.service.IBasicdataStoreBrandService;
import com.logpm.basicdata.vo.BasicdataStoreBrandVO;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.function.Predicate;
@ -51,7 +55,14 @@ import java.util.stream.Collectors;
@Slf4j
public class BasicdataStoreBrandServiceImpl extends BaseServiceImpl<BasicdataStoreBrandMapper, BasicdataStoreBrandEntity> implements IBasicdataStoreBrandService {
IBasicdataShopService basicdataShopService;
private IBasicdataShopService basicdataShopService;
@Autowired
private IBasicdataClientLogService basicdataClientLogService;
@Autowired
@Lazy
private IBasicdataClientService basicdataClientService;
@Override
public IPage<BasicdataStoreBrandVO> selectBasicdataStoreBrandPage(IPage<BasicdataStoreBrandVO> page, BasicdataStoreBrandVO basicdataStoreBrand) {
@ -74,6 +85,16 @@ public class BasicdataStoreBrandServiceImpl extends BaseServiceImpl<BasicdataSto
// List<BasicdataShopEntity> list = basicdataShopService.list(Wrappers.<BasicdataShopEntity>query().lambda()
// .eq(BasicdataShopEntity::getId, basicdataStoreBrand.getShopId())
// );
String method = "##############BasicdataStoreBrandServiceImpl.submitSave";
if(Objects.isNull(basicdataStoreBrand.getShopId())){
throw new RuntimeException("当前客户ID缺失");
}
BasicdataClientEntity clientEntity = basicdataClientService.getById(basicdataStoreBrand.getShopId());
if(Objects.isNull(clientEntity)){
log.error(method+"查询客户信息错误:{}",basicdataStoreBrand.getShopId());
throw new RuntimeException("查询客户信息错误!");
}
List<BasicdataStoreBrandEntity> basicdataStoreBrandEntities = baseMapper.selectList(Wrappers.<BasicdataStoreBrandEntity>query().lambda()
.eq(BasicdataStoreBrandEntity::getBrandId, basicdataStoreBrand.getBrandId())
.eq(BasicdataStoreBrandEntity::getClientId,basicdataStoreBrand.getShopId())
@ -82,6 +103,17 @@ public class BasicdataStoreBrandServiceImpl extends BaseServiceImpl<BasicdataSto
throw new RuntimeException("当前已拥有该品牌!");
}
basicdataStoreBrand.setClientId(Long.parseLong(basicdataStoreBrand.getShopId()));
//进行日志客户的日志记录
BasicdataClientLogEntity basicdataClientLogEntity = new BasicdataClientLogEntity();
basicdataClientLogEntity.setClientId(Long.parseLong(basicdataStoreBrand.getShopId()));
basicdataClientLogEntity.setClientName(clientEntity.getClientName());
basicdataClientLogEntity.setOperator(AuthUtil.getNickName());
basicdataClientLogEntity.setContent("新增品牌-->["+basicdataStoreBrand.getBrandName()+"]");
boolean flag = basicdataClientLogService.saveAppointLog(basicdataClientLogEntity);
if (!flag){
log.info(method+"保存客户增加品牌日志错误");
}
return this.saveOrUpdate(basicdataStoreBrand);
}

47
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreContactServiceImpl.java

@ -20,14 +20,17 @@ 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.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataClientLogEntity;
import com.logpm.basicdata.entity.BasicdataStoreContactEntity;
import com.logpm.basicdata.excel.BasicdataStoreContactExcel;
import com.logpm.basicdata.mapper.BasicdataStoreContactMapper;
import com.logpm.basicdata.service.IBasicdataClientLogService;
import com.logpm.basicdata.service.IBasicdataClientService;
import com.logpm.basicdata.service.IBasicdataStoreContactService;
import com.logpm.basicdata.vo.BasicdataStoreContactVO;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
@ -51,6 +54,9 @@ public class BasicdataStoreContactServiceImpl extends BaseServiceImpl<BasicdataS
@Lazy
private IBasicdataClientService basicdataClientService;
@Autowired
private IBasicdataClientLogService basicdataClientLogService;
@Override
public IPage<BasicdataStoreContactVO> selectBasicdataStoreContactPage(IPage<BasicdataStoreContactVO> page, BasicdataStoreContactVO basicdataStoreContact) {
@ -70,9 +76,17 @@ public class BasicdataStoreContactServiceImpl extends BaseServiceImpl<BasicdataS
@Override
public Boolean ownUpdateById(BasicdataStoreContactEntity basicdataStoreContact) {
try{
String method = " ###################BasicdataStoreContactServiceImpl.ownUpdateById";
List<BasicdataStoreContactEntity> storeContactEntities = baseMapper.selectList(Wrappers.<BasicdataStoreContactEntity>query().lambda()
.eq(BasicdataStoreContactEntity::getShopId, basicdataStoreContact.getShopId())
);
BasicdataClientEntity clientEntity = basicdataClientService.getById(basicdataStoreContact.getShopId());
if (Objects.isNull(clientEntity)){
log.error(method+"查询客户信息错误clientID:{}",basicdataStoreContact.getShopId());
throw new RuntimeException("查询客户信息错误");
}
if (!basicdataStoreContact.getDefaultType()){
boolean flag = storeContactEntities.stream().filter(f->!f.getId().equals(basicdataStoreContact.getId())).allMatch(b -> b.getDefaultType().equals(false));
if (flag){
@ -95,6 +109,14 @@ public class BasicdataStoreContactServiceImpl extends BaseServiceImpl<BasicdataS
.set(BasicdataClientEntity::getPhone,collected.get(0).getPhone())
);
this.updateById(basicdataStoreContact);
//进行日志记录
BasicdataClientLogEntity basicdataClientLogEntity = new BasicdataClientLogEntity();
basicdataClientLogEntity.setClientId(basicdataStoreContact.getShopId());
basicdataClientLogEntity.setClientName(clientEntity.getClientName());
basicdataClientLogEntity.setOperator(AuthUtil.getNickName());
basicdataClientLogEntity.setContent("默认联系人由["+clientEntity.getLinkman()+"]变更为-->["+collected.get(0).getLinkman()+"]");
basicdataClientLogService.saveAppointLog(basicdataClientLogEntity);
return true;
}catch (Exception e){
log.info("报错信息:{}",e.getMessage());
@ -111,7 +133,17 @@ public class BasicdataStoreContactServiceImpl extends BaseServiceImpl<BasicdataS
@Override
public boolean saveOrUpdateBasicdataStoreContact(BasicdataStoreContactEntity basicdataStoreContact) {
//进行客户列表的联系人修改
String method ="########################BasicdataStoreContactServiceImpl.saveOrUpdateBasicdataStoreContact";
if (Objects.isNull(basicdataStoreContact.getShopId())){
log.error(method+"参数缺失clientID");
return false;
}
Long shopId = basicdataStoreContact.getShopId();
BasicdataClientEntity clientEntity = basicdataClientService.getById(shopId);
if (Objects.isNull(clientEntity)){
log.error(method+"查询客户信息错误clientId:{}",shopId);
return false;
}
if (!Objects.isNull(basicdataStoreContact.getDefaultType()) &&basicdataStoreContact.getDefaultType()){
BasicdataClientEntity basicdataClientEntity = new BasicdataClientEntity();
basicdataClientEntity.setId(shopId);
@ -119,6 +151,21 @@ public class BasicdataStoreContactServiceImpl extends BaseServiceImpl<BasicdataS
basicdataClientEntity.setPhone(basicdataStoreContact.getPhone());
basicdataClientService.updateById(basicdataClientEntity);
}
BasicdataClientLogEntity basicdataClientLogEntity = new BasicdataClientLogEntity();
basicdataClientLogEntity.setClientId(shopId);
basicdataClientLogEntity.setClientName(clientEntity.getClientName());
basicdataClientLogEntity.setOperator(AuthUtil.getNickName());
String content = "";
if (Objects.isNull(basicdataStoreContact.getId())){
//新增
content = "新增品牌-->["+basicdataStoreContact.getLinkman()+"]";
}else {
//修改
BasicdataStoreContactEntity contactEntity = this.getById(basicdataStoreContact.getId());
content = "联系人由["+contactEntity.getLinkman()+"]变更为-->["+basicdataStoreContact.getLinkman()+"]";
}
basicdataClientLogEntity.setContent(content);
basicdataClientLogService.save(basicdataClientLogEntity);
return this.saveOrUpdate(basicdataStoreContact);
}

26
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/MallOrderController.java

@ -7,6 +7,7 @@ import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.excel.DistributionStockArticleExcel;
import com.logpm.distribution.service.IDistributionReservationService;
import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import com.logpm.distribution.wrapper.DistributionStockArticleWrapper;
@ -23,10 +24,7 @@ import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
@ -50,6 +48,9 @@ public class MallOrderController extends BladeController {
private final IBasicdataClientClient basicdataClientClient;
private IBasicdataWarehouseClient warehouseClient;
private final IDistributionReservationService distributionReservationService;
@GetMapping("/page")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionStockArticle")
@ -74,6 +75,23 @@ public class MallOrderController extends BladeController {
}
@DeleteMapping("/batchCancelMallReservation")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionStockArticle")
public R batchCancelMallReservation(@ApiIgnore String ids) {
try {
return distributionReservationService.batchCancelMallReservation(ids);
}catch (Exception e){
log.error("商场订单列表查询",e);
}
return R.fail("服务器异常");
}
/**
* 导出数据
*/

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java

@ -299,4 +299,10 @@ public interface IDistributionReservationService extends BaseService<Distributio
List<DistributionReservationEntity> selectListByDeliveryId(Long id);
/**
* 商家端取消预约计划
* @param ids
* @return
*/
R batchCancelMallReservation(String ids);
}

158
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -179,7 +179,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
private IWarehouseWaybillClient warehouseWaybillClient;
@Autowired
private IDisStockListDetailService disStockListDetailService;
@ -228,8 +227,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
private ITrunklinePackageTrackLogClient trunklinePackageTrackLogClient;
@Override
public IPage<DistributionReservationVO> selectDistrbutionReservationPage(IPage<DistributionReservationVO> page, DistributionReservationVO distrbutionReservation) {
return page.setRecords(baseMapper.selectDistrbutionReservationPage(page, distrbutionReservation));
@ -2637,7 +2634,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
@Override
public R<?> getReservationPackage(String reservationId, String id) {
DistributionReservationPackageDTO reservationPackageDTO = new DistributionReservationPackageDTO();
@ -3315,6 +3311,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationOrderPackageVO.setPackageList(allPackageList);
return R.data(reservationOrderPackageVO);
}
@Override
public IPage<DistributionReservationVO> reservationList(IPage<DistributionReservationVO> page, Map<String, Object> distrbutionReservation) {
@ -3549,6 +3546,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
/**
* 维护预约单计划数量
*
* @param reservationId
*/
@Override
@ -3583,7 +3581,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
}
/**
@ -3658,6 +3655,157 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
return baseMapper.selectListByDeliveryId(id);
}
@Override
@Transactional
public R batchCancelMallReservation(String ids) {
String method = "###########################DistributionReservationServiceImpl.cancelMallReservation";
if (Objects.isNull(ids)) {
log.error(method + "参数id为空");
return R.fail("操作失败,请联系管理员");
}
List<Long> reservationIds = Func.toLongList(ids);
List<DistributionReservationEntity> distributionReservationEntities = this.listByIds(reservationIds);
if (distributionReservationEntities.isEmpty()) {
log.error(method + "查询预约计划错误reservationIds:{}", reservationIds);
return R.fail("查询预约计划错误");
}
if (distributionReservationEntities.size() != reservationIds.size()) {
log.error(method + "查询预约计划数量和取消目标计划数不等,目标数:{},计划数:{}", reservationIds.size(), distributionReservationEntities.size());
return R.fail("查询预约计划数量和取消目标计划数不等");
}
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)) {
log.error(method + "执行操作未进行仓库选择");
return R.fail(403, "未授权!!!");
}
boolean isCancel = distributionReservationEntities.stream().allMatch(r -> ReservationStatusConstant.daiqueren.getValue().equals(r.getReservationStatus()));
List<JSONObject> logList = new ArrayList<>();
if (isCancel) {
for (Long reservationId : reservationIds) {
//全部处于待确认可以执行取消
//对当前计划下的包件订单库存品进行查询
//查询当前计划下的订单和库存品
List<DistributionReservationStockarticleEntity> reservationStockarticleEntities = distributionReservationStockarticleService.list(Wrappers.<DistributionReservationStockarticleEntity>query().lambda()
.eq(DistributionReservationStockarticleEntity::getReservationId, reservationId)
.ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())
);
if (!reservationStockarticleEntities.isEmpty()) {
Map<String, List<DistributionReservationStockarticleEntity>> listMap = reservationStockarticleEntities.stream().collect(Collectors.groupingBy(DistributionReservationStockarticleEntity::getIsZero));
Set<String> strings = listMap.keySet();
List<Long> orderIds = new ArrayList<>();
for (String isZero : strings) {
List<DistributionReservationStockarticleEntity> distributionReservationStockarticleEntities = listMap.get(isZero);
//取消订制品
orderIds = distributionReservationStockarticleEntities.stream().map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList());
if (IsOrNoConstant.no.getValue().equals(isZero)) {
//对此计划下的所有订制品包件进行取消和状态恢复
List<DistributionReservationPackageEntity> packageEntityList = distributionReservationPackageService.list(Wrappers.<DistributionReservationPackageEntity>query().lambda()
.eq(DistributionReservationPackageEntity::getReservationId, reservationId)
.in(DistributionReservationPackageEntity::getStockArticleId, orderIds)
.ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue())
.ne(DistributionReservationPackageEntity::getCancelRemark, "商家端取消")
);
if (!packageEntityList.isEmpty()) {
//进行包件状态恢复
List<Long> waitCancelPackageIds = packageEntityList.stream().map(DistributionReservationPackageEntity::getParceListId).collect(Collectors.toList());
distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>update().lambda()
.in(DistributionParcelListEntity::getId, waitCancelPackageIds)
.set(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue())
);
String content = "包件在" + myCurrentWarehouse.getName() + "由" + AuthUtil.getUser().getNickName() + "取消预约计划";
for (DistributionReservationPackageEntity distributionReservationPackageEntity : packageEntityList) {
JSONObject jsonObject = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), distributionReservationPackageEntity.getPacketBarCode(), content, WorkNodeEnums.CANCEL_DELIVERY.getCode());
logList.add(jsonObject);
}
}
} else if (IsOrNoConstant.yes.getValue().equals(isZero)) {
//取消零担
List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntities = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.eq(DistributionReservationZeroPackageEntity::getReservationId, reservationId)
.in(DistributionReservationZeroPackageEntity::getStockArticleId, orderIds)
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
if (!reservationZeroPackageEntities.isEmpty()) {
List<Long> collect = reservationZeroPackageEntities.stream().map(DistributionReservationZeroPackageEntity::getId).collect(Collectors.toList());
for (DistributionReservationZeroPackageEntity reservationZeroPackageEntity : reservationZeroPackageEntities) {
//进行零担配送数量恢复
distributionParcelNumberService.updateBillNum(reservationZeroPackageEntity.getParcelListId(), reservationZeroPackageEntity.getQuantity(), 2);
//维护零担包件的预约状态
distributionParcelListService.maintenanceZeroPackageInfo(reservationZeroPackageEntity.getParcelListId(), myCurrentWarehouse.getId());
}
distributionReservationZeroPackageService.update(Wrappers.<DistributionReservationZeroPackageEntity>update().lambda()
.eq(DistributionReservationZeroPackageEntity::getReservationId,reservationId)
.in(DistributionReservationZeroPackageEntity::getId,collect)
.set(DistributionReservationZeroPackageEntity::getZeroPackageStatus,ReservationPackageStatusConstant.quxiao.getValue())
);
}
} else {
log.error(method + "预约下存在未进行零担标识的数据,reservationId:{}", reservationId);
}
distributionReservationStockarticleService.update(Wrappers.<DistributionReservationStockarticleEntity>update().lambda()
.eq(DistributionReservationStockarticleEntity::getReservationId, reservationId)
.in(DistributionReservationStockarticleEntity::getStockArticleId, orderIds)
.set(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())
);
//进行订单状态维护
distributionStockArticleService.maintenanceOrderInfoByIds(orderIds);
}
List<DistributionReservationStocklistEntity> reservationStocklistEntityList = distributionReservationStocklistService.list(Wrappers.<DistributionReservationStocklistEntity>query().lambda()
.eq(DistributionReservationStocklistEntity::getReservationId, reservationId)
.ne(DistributionReservationStocklistEntity::getStockListStatus, ReservationInventoryStatusConstant.quxiao.getValue())
);
if (!reservationStocklistEntityList.isEmpty()) {
for (DistributionReservationStocklistEntity reservationStocklistEntity : reservationStocklistEntityList) {
distributionStockListService.updateInventoryQuantityOccupied(reservationStocklistEntity.getStocklistId(),reservationStocklistEntity.getReservationNum());
}
//对生成包件进行状态取消
List<Long> waitInventoryIds = reservationStocklistEntityList.stream().map(DistributionReservationStocklistEntity::getStocklistId).collect(Collectors.toList());
List<DisStockListDetailEntity> inventoryPackage = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getReservationId, reservationId)
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
.in(DisStockListDetailEntity::getStockListId, waitInventoryIds)
);
if (!inventoryPackage.isEmpty()) {
List<Long> waitInventoryPackageIds = inventoryPackage.stream().map(DisStockListDetailEntity::getId).collect(Collectors.toList());
//对库存品包件进行取消
disStockListDetailService.update(Wrappers.<DisStockListDetailEntity>update().lambda()
.eq(DisStockListDetailEntity::getReservationId,reservationId)
.in(DisStockListDetailEntity::getId,waitInventoryPackageIds)
.set(DisStockListDetailEntity::getStockPackageStatus,ReservationPackageStatusConstant.quxiao.getValue())
);
}
//对计划数据进行取消
distributionReservationStocklistService.update(Wrappers.<DistributionReservationStocklistEntity>update().lambda()
.eq(DistributionReservationStocklistEntity::getReservationId,reservationId)
.set(DistributionReservationStocklistEntity::getStockListStatus,ReservationPackageStatusConstant.quxiao.getValue())
.in(DistributionReservationStocklistEntity::getStocklistId,waitInventoryIds)
);
}
}
this.update(Wrappers.<DistributionReservationEntity>update().lambda()
.eq(DistributionReservationEntity::getId,reservationId)
.set(DistributionReservationEntity::getReservationStatus,ReservationStatusConstant.yiquexiao.getValue())
);
}
if (!logList.isEmpty()) {
trunklinePackageTrackLogClient.addPackageTrackLog(logList);
}
return R.success("操作成功");
} else {
String tips = distributionReservationEntities.stream().filter(r -> ReservationStatusConstant.daiqueren.getValue().equals(r.getReservationStatus())).map(DistributionReservationEntity::getReservationCode).collect(Collectors.joining(",")) + "取消失败,请核查当前预约计划状态";
return R.fail(tips);
}
}
private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node) {

Loading…
Cancel
Save