Browse Source

Merge branch 'pre-production'

master
pref_mail@163.com 8 months ago
parent
commit
0ac3c657c1
  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. 2
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/BillladingDTO.java
  5. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineLoadSignOrderVO.java
  6. 86
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataClientLogController.java
  7. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataStorageServicesController.java
  8. 35
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataClientLogDTO.java
  9. 43
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientLogMapper.java
  10. 30
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientLogMapper.xml
  11. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml
  12. 57
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientLogService.java
  13. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataStorageServicesService.java
  14. 92
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientLogServiceImpl.java
  15. 171
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
  16. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientUserServiceImpl.java
  17. 228
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStorageServicesServiceImpl.java
  18. 42
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreBrandServiceImpl.java
  19. 47
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreContactServiceImpl.java
  20. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java
  21. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java
  22. 26
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/MallOrderController.java
  23. 24
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  24. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  25. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  26. 562
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  27. 488
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  28. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  29. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockArticleWrapper.java
  30. 44
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java
  31. 13
      blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java
  32. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/BillladingController.java
  33. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java
  34. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/IncomingController.java
  35. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml
  36. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineBillladingService.java
  37. 45
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  38. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java
  39. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  40. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillPackageServiceImpl.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;
}

2
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/BillladingDTO.java

@ -53,7 +53,7 @@ public class BillladingDTO extends TrunklineBillladingEntity {
private String consignee;//收货单位
private String remark;//备注
private String destinationWarehouseName;//目的仓
private String completeTime;//目的仓
private Long billladingId;
}

1
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineLoadSignOrderVO.java

@ -9,6 +9,7 @@ import java.util.List;
@Data
public class TrunklineLoadSignOrderVO extends TrunklineLoadSignOrderEntity {
private String warehouseName;
private String driverName;
private String carsNo;
private String carsLineName;

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>

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml

@ -101,6 +101,8 @@
from logpm_basicdata_client lbc
left join logpm_basicdata_store_contact lbsc on lbsc.shop_id = lbc.id
where lbc.id = #{clientId}
order by lbsc.default_type desc
limit 1
</select>
<select id="pageList" resultType="com.logpm.basicdata.vo.BasicdataClientVO">
SELECT

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

171
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) {
@ -749,7 +855,7 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
});
if (b) {
String repeatClientName = basicdataClients.stream().filter(ii -> ii.getClientName().equals(data.getClientName())).map(BasicdataClientEntity::getClientName).collect(Collectors.joining(","));
return R.fail(repeatClientName+"客户名称已存在");
return R.fail(repeatClientName + "客户名称已存在");
}
}
//添加品牌
@ -760,7 +866,7 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
for (String ar : ars) {
BasicdataBrandEntity one = matchBasicdataBrandEntityListValue(basicdataBrandEntityList, ar);
if (ObjectUtils.isNull(one)) {
return R.fail(data.getClientName()+"品牌信息不存在");
return R.fail(data.getClientName() + "品牌信息不存在");
}
}
}
@ -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;

228
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 {
private IBasicdataWarehouseService basicdataWarehouseService;
@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));
@ -66,95 +86,175 @@ public class BasicdataStorageServicesServiceImpl extends BaseServiceImpl<Basicda
@Override
public List<BasicdataStorageServicesExcel> exportBasicdataStorageServices(Wrapper<BasicdataStorageServicesEntity> queryWrapper) {
List<BasicdataStorageServicesExcel> basicdataStorageServicesList = baseMapper.exportBasicdataStorageServices(queryWrapper);
//basicdataStorageServicesList.forEach(basicdataStorageServices -> {
// basicdataStorageServices.setTypeName(DictCache.getValue(DictEnum.YES_NO, BasicdataStorageServices.getType()));
//});
// basicdataStorageServicesList.forEach(basicdataStorageServices -> {
// basicdataStorageServices.setTypeName(DictCache.getValue(DictEnum.YES_NO, BasicdataStorageServices.getType()));
// });
return basicdataStorageServicesList;
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean submitSave(BasicdataStorageServicesDTO basicdataStorageServices) {
if(ObjectUtils.isNotNull(basicdataStorageServices.getId())){
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){
if (sendBasicdataWarehouseEntity != null) {
if (!Objects.isNull(listMap)) {
List<BasicdataStorageServicesEntity> basicdataStorageServicesEntities = listMap.get(sendBasicdataWarehouseEntity.getName());
if (!Objects.isNull(basicdataStorageServicesEntities)) {
return R.fail("已存在发站仓配置!!!");
}
}
basicdataStorageServices.setSendWarehouseName(sendBasicdataWarehouseEntity.getName());
}
BasicdataWarehouseEntity serveBasicdataWarehouseEntity = basicdataWarehouseService.getById(basicdataStorageServices.getServeWarehouseId());
if(serveBasicdataWarehouseEntity!=null){
basicdataStorageServices.setServeWarehouseName(serveBasicdataWarehouseEntity.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;
}else{
//添加
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("当前添加已存在!");
}else{
return R.success("操作成功");
} else {
List<String> addSendWarehouseIds = new ArrayList<>();
int a = 0;
if (Func.isEmpty(basicdataStorageServices.getSendWarehouseIds())) {
//需要进行所有仓库的获取
List<BasicdataWarehouseEntity> warehouseList = basicdataWarehouseService.list();
// 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<String> sendWarehouseIds = basicdataStorageServices.getSendWarehouseIds();
List<BasicdataStorageServicesEntity> servicesEntities = new ArrayList<>();
if(ObjectUtil.isEmpty(sendWarehouseIds) || sendWarehouseIds.size() < 1){
BasicdataStorageServicesEntity basicdataStorageServicesEntity = new BasicdataStorageServicesEntity();
BeanUtils.copyProperties(basicdataStorageServices,basicdataStorageServicesEntity);
// 获取仓库名称
BasicdataWarehouseEntity serveBasicdataWarehouseEntity = basicdataWarehouseService.getById(basicdataStorageServices.getServeWarehouseId());
basicdataStorageServicesEntity.setServeWarehouseName(serveBasicdataWarehouseEntity.getName());
servicesEntities.add(basicdataStorageServicesEntity);
}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())
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(list.size() < 1){
if (!allList.isEmpty()) {
return R.fail("已存在全部的服务仓配置");
}else {
log.error(method+"该客户下不存在未添加发站仓信息,已存在配置:{}",list.stream().map(BasicdataStorageServicesEntity::getSendWarehouseId).collect(Collectors.toList()));
}
BasicdataStorageServicesEntity basicdataStorageServicesEntity = new BasicdataStorageServicesEntity();
// 获取仓库名称
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 {
addSendWarehouseIds.forEach(i -> {
BasicdataStorageServicesEntity basicdataStorageServicesEntity = new BasicdataStorageServicesEntity();
BeanUtils.copyProperties(basicdataStorageServices,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.isEmpty()) {
this.saveBatch(servicesEntities);
}
if (!basicdataClientLogEntityList.isEmpty()) {
//进行批量日志保存
basicdataClientLogService.saveBatchAppointLog(basicdataClientLogEntityList);
}
}
if(servicesEntities.size() > 0){
this.saveBatch(servicesEntities);
}
return true;
}
// return this.saveOrUpdate(basicdataStorageServices);
return R.success("操作成功");
}
@Override
public List<BasicdataStorageServicesVO> pageList(IPage<Object> page, Map<String, Object> basicdataStorageServices) {
BasicdataStorageServicesEntity basicdataStorageServicesEntity = JSONObject.parseObject(JSONObject.toJSONString(basicdataStorageServices), BasicdataStorageServicesEntity.class);
BasicdataStorageServicesVO basicdataStorageServicesvo = new BasicdataStorageServicesVO() ;
BeanUtils.copyProperties(basicdataStorageServicesEntity,basicdataStorageServicesvo);
return baseMapper.selectBasicdataStorageServicesPage(page,basicdataStorageServicesvo);
BasicdataStorageServicesVO basicdataStorageServicesvo = new BasicdataStorageServicesVO();
BeanUtils.copyProperties(basicdataStorageServicesEntity, basicdataStorageServicesvo);
return baseMapper.selectBasicdataStorageServicesPage(page, basicdataStorageServicesvo);
}
@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);
}

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java

@ -141,9 +141,10 @@ public class DistributionSignforAppController {
@PostMapping("/signfor")
@ApiOperationSupport(order = 2)
public R signfor(@Valid @RequestBody DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
R r = distributionSignforService.signfor(distrilbutionloadingscanDTO);
long time = new Date().getTime();
try {
R r = distributionSignforService.signfor(distrilbutionloadingscanDTO);
long time = new Date().getTime();
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)) {
log.warn("#############signfor:" + time + " 下架仓库信息为空 myCurrentWarehouse={}", myCurrentWarehouse);
@ -162,11 +163,12 @@ public class DistributionSignforAppController {
}
updownTypeClient.downPackageOrDelTray(orderPackageCodes, myCurrentWarehouse.getId(), "签收下架解托");
}
return r;
} catch (Exception e) {
log.error("#############signfor:" + time + " 下架失败", e);
log.error("#############signfor:签收报错", e);
}
return r;
return R.fail("签收失败!");
}
/**

12
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java

@ -466,10 +466,10 @@ public class DistributionDeliveryListController extends BladeController {
@ApiOperationSupport(order = 2)
@ApiOperation(value = "PC签收包件")
public R signfor(@Valid @RequestBody DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
R r = distributionSignforService.signforPC(distrilbutionloadingscanDTO);
long time = new Date().getTime();
try{
try{
R r = distributionSignforService.signforPC(distrilbutionloadingscanDTO);
long time = new Date().getTime();
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn("#############signforPC:"+time+" 仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
@ -489,11 +489,13 @@ public class DistributionDeliveryListController extends BladeController {
}
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCodes,myCurrentWarehouse.getId(),"签收下架解托");
}
return r;
}catch (Exception e){
log.error("#############signforPC:"+time+" 下架失败",e);
log.error("#############signforPC:",e);
return R.fail("签收失败");
}
return r;
}
@PostMapping("/deliveryInventorySign")

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("服务器异常");
}
/**
* 导出数据
*/

24
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml

@ -1299,9 +1299,27 @@
<select id="reservationList" resultMap="reservationResultMap">
select ldr.* from logpm_distribution_reservation ldr
where ldr.delivery_type=2
<if test="distrbutionReservation.reservationStatus != null">
and ldr.reservation_status = #{distrbutionReservation.reservationStatus}
where ldr.delivery_type=2 and ldr.reservation_status !='40'
<if test="distrbutionReservation.reservationCode != null" >
and ldr.reservation_code like concat(#{distrbutionReservation.reservationCode},'%')
</if>
<if test="distrbutionReservation.serviceNumber != null">
and ldr.service_number like concat(#{distrbutionReservation.serviceNumber},'%')
</if>
<if test="distrbutionReservation.stockArticleId != null">
and ldr.stock_article_id like concat('%',#{distrbutionReservation.stockArticleId},'%')
</if>
<if test="distrbutionReservation.mallName != null">
and ldr.mall_name like concat(#{distrbutionReservation.mallName},'%')
</if>
<if test="distrbutionReservation.consignee != null">
and ldr.consignee like concat('%',#{distrbutionReservation.consignee},'%')
</if>
<if test="distrbutionReservation.deliveryPhone != null">
and ldr.delivery_phone =#{distrbutionReservation.deliveryPhone}
</if>
<if test="distrbutionReservation.deliveryAddress != null">
and ldr.delivery_address like concat('%',#{distrbutionReservation.deliveryAddress},'%')
</if>
<if test="distrbutionReservation.clientIds != null">
and ldr.mall_id in

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml

@ -200,7 +200,7 @@
LEFT JOIN logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id
<where>
ldsa.is_deleted = 0 and ldsa.hand_quantity > 0 and ldsa.order_status in ('10','20','30','40','50','60','70')
and ldsa.genre = '1' and ldsa.type_service='2'
and ldsa.genre = '1' and ldsa.type_service='2' and ldsa.reservation_status != '30'
<if test="distributionStockArticleVO.orderCode!=null and distributionStockArticleVO.orderCode !=''">
and ldsa.order_code like concat(#{distributionStockArticleVO.orderCode},'%')
</if>

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

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

File diff suppressed because it is too large Load Diff

488
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -85,6 +85,8 @@ import org.springblade.common.serviceConstant.ServiceConstant;
import org.springblade.common.utils.CommonUtil;
import org.springblade.common.utils.FileUtil;
import org.springblade.common.utils.GaoDeApiUtil;
import org.springblade.core.log.feign.ILogClient;
import org.springblade.core.log.model.LogError;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.BladeUser;
@ -245,6 +247,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Autowired
private IDistributionNodeWorkService iDistributionNodeWorkService;
@Autowired
private ILogClient logClient;
@Override
public IPage<DistributionSignforVO> selectDistributionSignforPage(IPage<DistributionSignforVO> page, DistributionSignforVO distributionSignfor) {
@ -2522,7 +2527,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return Resp.scanFail("此任务已完成复核", "此任务已完成复核");
}
List<Long> packageLockIds = new ArrayList<>();
try {
@ -2805,7 +2809,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return Resp.scanSuccessWithData("签收成功", str, orderPackageCodes);
} catch (Exception e) {
log.error(">>>>> 签收异常报错", e);
throw new CustomerException("当前登录信息已失效,请重新登录");
throw new CustomerException("签收异常报错"+e.getMessage());
}
}
@ -2868,269 +2872,277 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Transactional(rollbackFor = Exception.class)
public R signforPC(DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
String nickName = null;
Long userId = null;
try {
String nickName = null;
Long userId = null;
nickName = AuthUtil.getNickName();
userId = AuthUtil.getUserId();
} catch (Exception e) {
log.error(">>>>> 签收异常报错", e);
throw new CustomerException("当前登录信息不已失效,请重新登录");
}
try {
nickName = AuthUtil.getNickName();
userId = AuthUtil.getUserId();
} catch (Exception e) {
log.error(">>>>> 签收异常报错", e);
throw new CustomerException("当前登录信息不已失效,请重新登录");
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
// ---------------------------------2023-09-09 包件签收调整---------------------------------------------------------------
//思路: 在于一个客户下不会出现重复的包条码
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)) {
throw new CustomerException(403, "仓库信息不能为空");
}
//思路: 在于一个客户下不会出现重复的包条码
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)) {
throw new CustomerException(403, "仓库信息不能为空");
}
// DistributionParcelListEntity parcelListEntity = distributionParcelListService.selectByOrderPackageCode(distrilbutionloadingscanDTO.getBarcodes(), myCurrentWarehouse.getId());
// if (Func.isEmpty(parcelListEntity)) {
// return Resp.scanFail("包件信息不存在", "包件信息不存在");
// }
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(distrilbutionloadingscanDTO.getReservationId());
if (Func.isEmpty(distributionReservationEntity)) {
log.error("########无效的预约单,reservationId:{}", distrilbutionloadingscanDTO.getReservationId());
return R.fail("服务器正忙!!");
}
if (Func.isEmpty(distrilbutionloadingscanDTO.getBarcodes())) {
log.error("########缺失参数,barcodes:{}", distrilbutionloadingscanDTO.getBarcodes());
return R.fail("服务器正忙!!");
}
List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.in(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcodes())
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId())
);
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId());
if (Func.isEmpty(deliveryListEntity)) {
throw new CustomerException(403, "配送异常!!!");
}
if (Func.isNotEmpty(parcelListEntities)) {
boolean flag = parcelListEntities.stream().anyMatch(p -> OrderPackageStatusConstant.yiqianshou.getValue().equals(p.getOrderPackageStatus()));
if (flag) {
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(distrilbutionloadingscanDTO.getReservationId());
if (Func.isEmpty(distributionReservationEntity)) {
log.error("########无效的预约单,reservationId:{}", distrilbutionloadingscanDTO.getReservationId());
return R.fail("服务器正忙!!");
}
if (Func.isEmpty(distrilbutionloadingscanDTO.getBarcodes())) {
log.error("########缺失参数,barcodes:{}", distrilbutionloadingscanDTO.getBarcodes());
return R.fail("存在已签收包件!!");
return R.fail("服务器正忙!!");
}
List<Long> ids = parcelListEntities.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList());
List<DistributionLoadscanAbnormalEntity> abnormalEntities = distributionLoadscanAbnormalService.list(Wrappers.<DistributionLoadscanAbnormalEntity>query().lambda()
.in(DistributionLoadscanAbnormalEntity::getPackageId, ids)
List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.in(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcodes())
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId())
);
if (!abnormalEntities.isEmpty()) {
//判断此包件的异常是否是当前扫描车次和客户
//首先判断存在异常是否不属于当前车次和客户
boolean a = abnormalEntities.stream().allMatch(b -> !deliveryListEntity.getId().equals(b.getDeliveryListId()) || !distrilbutionloadingscanDTO.getReservationId().equals(b.getReservationId()));
if (a) {
//该异常属于其他车次
String code = abnormalEntities.stream().filter(c -> !deliveryListEntity.getId().equals(c.getDeliveryListId()) || !distrilbutionloadingscanDTO.getReservationId().equals(c.getReservationId())).map(DistributionLoadscanAbnormalEntity::getPackageCode).collect(Collectors.joining(","));
log.info("包件已在其他车次存在异常 >>>>包条码:{}", code);
log.info("包件已在其他车次存在异常 >>>>当前车次:{},异常车次:{}", deliveryListEntity.getTrainNumber(), abnormalEntities.stream().map(DistributionLoadscanAbnormalEntity::getTrainNumber).collect(Collectors.joining(",")));
return R.fail(code + "已在其他车次执行异常!!");
}
//判断具体的装车信息
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId());
if (Func.isEmpty(deliveryListEntity)) {
throw new CustomerException(403, "配送异常!!!");
}
}
List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId());
//查询该客户是否存在该包件信息
String[] orderPackageCodes = distrilbutionloadingscanDTO.getBarcodes().split(",");
if (Func.isEmpty(orderPackageCodes)) {
//缺失包件码参数
log.error("PC签收缺失包件码参数");
return R.fail("请联系管理员!!!");
}
List<String> orderpackages = new ArrayList<>();
List<Long> packageLockIds = new ArrayList<>();
List<JSONObject> jsonObjects = new ArrayList<>();
List<JSONObject> aaa = new ArrayList<>();
for (String orderPackageCode : orderPackageCodes) {
List<DistributionParcelListEntity> collect = parcelListEntityList.stream().filter(p -> p.getOrderPackageCode().equals(orderPackageCode)).collect(Collectors.toList());
String content = "";
if (Func.isNotEmpty(collect) && collect.size() == 1) {
//存在则查询该包件是否进行装车
DistributionParcelListEntity parcelListEntity = collect.get(0);
JSONObject trunklinePackageTrackLog = new JSONObject();
DistributionLoadscanEntity distributionLoadscanEntity = distributionLoadscanMapper.selectOne(Wrappers.<DistributionLoadscanEntity>query().lambda()
.ne(DistributionLoadscanEntity::getScanStatus, 1)
.eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
.eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
.eq(DistributionLoadscanEntity::getOrderPackageCode, parcelListEntity.getOrderPackageCode()));
if (Func.isNotEmpty(distributionLoadscanEntity)) {
if (distributionLoadscanEntity.getSignforState().equals(2)) {
return Resp.scanFail("重复扫描", "重复扫描");
if (Func.isNotEmpty(parcelListEntities)) {
boolean flag = parcelListEntities.stream().anyMatch(p -> OrderPackageStatusConstant.yiqianshou.getValue().equals(p.getOrderPackageStatus()));
if (flag) {
log.error("########缺失参数,barcodes:{}", distrilbutionloadingscanDTO.getBarcodes());
return R.fail("存在已签收包件!!");
}
List<Long> ids = parcelListEntities.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList());
List<DistributionLoadscanAbnormalEntity> abnormalEntities = distributionLoadscanAbnormalService.list(Wrappers.<DistributionLoadscanAbnormalEntity>query().lambda()
.in(DistributionLoadscanAbnormalEntity::getPackageId, ids)
);
if (!abnormalEntities.isEmpty()) {
//判断此包件的异常是否是当前扫描车次和客户
//首先判断存在异常是否不属于当前车次和客户
boolean a = abnormalEntities.stream().allMatch(b -> !deliveryListEntity.getId().equals(b.getDeliveryListId()) || !distrilbutionloadingscanDTO.getReservationId().equals(b.getReservationId()));
if (a) {
//该异常属于其他车次
String code = abnormalEntities.stream().filter(c -> !deliveryListEntity.getId().equals(c.getDeliveryListId()) || !distrilbutionloadingscanDTO.getReservationId().equals(c.getReservationId())).map(DistributionLoadscanAbnormalEntity::getPackageCode).collect(Collectors.joining(","));
log.info("包件已在其他车次存在异常 >>>>包条码:{}", code);
log.info("包件已在其他车次存在异常 >>>>当前车次:{},异常车次:{}", deliveryListEntity.getTrainNumber(), abnormalEntities.stream().map(DistributionLoadscanAbnormalEntity::getTrainNumber).collect(Collectors.joining(",")));
return R.fail(code + "已在其他车次执行异常!!");
}
//存在装车记录,进行修改即可
//进行签收记录数据的维护
distributionLoadscanEntity.setSigningTime(simpleDateFormat.format(new Date()));
distributionLoadscanEntity.setSignforState(2);
distributionLoadscanEntity.setReceivedQuantity(distributionLoadscanEntity.getLoadedNub());
//判断具体的装车信息
}
}
List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId());
//查询该客户是否存在该包件信息
String[] orderPackageCodes = distrilbutionloadingscanDTO.getBarcodes().split(",");
if (Func.isEmpty(orderPackageCodes)) {
//缺失包件码参数
log.error("PC签收缺失包件码参数");
return R.fail("请联系管理员!!!");
}
List<String> orderpackages = new ArrayList<>();
List<Long> packageLockIds = new ArrayList<>();
List<JSONObject> jsonObjects = new ArrayList<>();
List<JSONObject> aaa = new ArrayList<>();
for (String orderPackageCode : orderPackageCodes) {
List<DistributionParcelListEntity> collect = parcelListEntityList.stream().filter(p -> p.getOrderPackageCode().equals(orderPackageCode)).collect(Collectors.toList());
String content = "";
if (Func.isNotEmpty(collect) && collect.size() == 1) {
//存在则查询该包件是否进行装车
DistributionParcelListEntity parcelListEntity = collect.get(0);
JSONObject trunklinePackageTrackLog = new JSONObject();
DistributionLoadscanEntity distributionLoadscanEntity = distributionLoadscanMapper.selectOne(Wrappers.<DistributionLoadscanEntity>query().lambda()
.ne(DistributionLoadscanEntity::getScanStatus, 1)
.eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
.eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
.eq(DistributionLoadscanEntity::getOrderPackageCode, parcelListEntity.getOrderPackageCode()));
if (Func.isNotEmpty(distributionLoadscanEntity)) {
if (distributionLoadscanEntity.getSignforState().equals(2)) {
return Resp.scanFail("重复扫描", "重复扫描");
}
//存在装车记录,进行修改即可
//进行签收记录数据的维护
distributionLoadscanEntity.setSigningTime(simpleDateFormat.format(new Date()));
distributionLoadscanEntity.setSignforState(2);
distributionLoadscanEntity.setReceivedQuantity(distributionLoadscanEntity.getLoadedNub());
distributionLoadscanEntity.setSigningUser(nickName);
distributionLoadscanEntity.setSigningUserId(userId);
distributionLoadscanEntity.setSignforType(LoadScanSigningTypeStatusConstant.wenyuanpiliangqianshou.getValue());
distributionLoadscanEntity.setSigningUser(nickName);
distributionLoadscanEntity.setSigningUserId(userId);
distributionLoadscanEntity.setSignforType(LoadScanSigningTypeStatusConstant.wenyuanpiliangqianshou.getValue());
distributionLoadscanService.updateById(distributionLoadscanEntity);
packageLockIds.add(distributionLoadscanEntity.getPackageId());
//缺少一个异步维护包件签收的方法
// distributionAsyncService.changeOrderSignforStatus(collect.get(0));
Integer j = distributionSignforMapper.updateSignforNum(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
//下架解托
warehouseUpdownTypeClient.downPackageOrDelTray(distributionLoadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
content = "包件在" + myCurrentWarehouse.getName() + "由" + AuthUtil.getNickName() + "后台签收,装车方式:扫描装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + distributionReservationEntity.getReservationCode();
try {
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), distributionLoadscanEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
} catch (Exception e) {
log.error("装车日志数据错误", e);
}
aaa.add(trunklinePackageTrackLog);
} else {
//这里装车的数据需要进行补录
DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfDTO();
if (deliveryListEntity.getKind().equals(ServiceConstant.DELIVERLIST_KIND_SELF)) {
distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectOne(new QueryWrapper<DistributionDeliverySelfEntity>().lambda()
.eq(DistributionDeliverySelfEntity::getIsMaster, ServiceConstant.IS_MASTER_YES)
.eq(DistributionDeliverySelfEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
);
distributionLoadscanService.updateById(distributionLoadscanEntity);
packageLockIds.add(distributionLoadscanEntity.getPackageId());
//缺少一个异步维护包件签收的方法
// distributionAsyncService.changeOrderSignforStatus(collect.get(0));
Integer j = distributionSignforMapper.updateSignforNum(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
//下架解托
warehouseUpdownTypeClient.downPackageOrDelTray(distributionLoadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
content = "包件在" + myCurrentWarehouse.getName() + "由" + AuthUtil.getNickName() + "后台签收,装车方式:扫描装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + distributionReservationEntity.getReservationCode();
try {
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), distributionLoadscanEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
} catch (Exception e) {
log.error("装车日志数据错误", e);
}
aaa.add(trunklinePackageTrackLog);
} else {
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(new QueryWrapper<DistributionDeliveryTripartiteEntity>().lambda()
.eq(DistributionDeliveryTripartiteEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()));
BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity);
}
DistributionDeliveryListEntity listEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId());
if (Func.isEmpty(listEntity)) {
log.error("##########配送计划异常:{}", listEntity);
return Resp.scanFail("服务器正忙...", "服务器正忙");
}
//查询配送计划的计划司机
distributionLoadscanEntity = new DistributionLoadscanEntity();
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverPhone())) {
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleNub())) {
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
}
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) {
distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getId())) {
distributionLoadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) {
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
}
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleId())) {
distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
Date loadScanTime = new Date();
distributionLoadscanEntity.setScanTime(simpleDateFormat.format(loadScanTime));
distributionLoadscanEntity.setPackageId(parcelListEntity.getId());
distributionLoadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
Date signingTime = new Date(System.currentTimeMillis() + (1000 * 60));
distributionLoadscanEntity.setSigningTime(simpleDateFormat.format(signingTime));
distributionLoadscanEntity.setReceivedQuantity(parcelListEntity.getQuantity());
distributionLoadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId());
distributionLoadscanEntity.setIsSignfor(2);
distributionLoadscanEntity.setIsInsert(2);
distributionLoadscanEntity.setSignforType(LoadScanSigningTypeStatusConstant.wenyuanpiliangqianshou.getValue());
distributionLoadscanEntity.setWarehouseId(myCurrentWarehouse.getId());
distributionLoadscanEntity.setWarehouseName(myCurrentWarehouse.getName());
distributionLoadscanEntity.setSignforState(2);
distributionLoadscanEntity.setPackageNub(parcelListEntity.getQuantity());
distributionLoadscanEntity.setOrderId(parcelListEntity.getStockArticleId());
distributionLoadscanEntity.setLoadedNub(parcelListEntity.getQuantity());
distributionLoadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId());
distributionLoadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId());
distributionLoadscanEntity.setScanUser(AuthUtil.getUser().getNickName());
distributionLoadscanEntity.setSigningUser(AuthUtil.getUser().getNickName());
distributionLoadscanEntity.setSigningUserId(AuthUtil.getUser().getUserId());
distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.buluzhuangche.getValue());
distributionLoadscanService.save(distributionLoadscanEntity);
packageLockIds.add(distributionLoadscanEntity.getPackageId());
JSONObject jsonObject = new JSONObject();
jsonObject.put("code", distributionLoadscanEntity.getOrderPackageCode());
jsonObject.put("warehouseId", myCurrentWarehouse.getId());
jsonObject.put("taskId", distrilbutionloadingscanDTO.getReservationId());
jsonObject.put("type", 1);
jsonObject.put("num", 1);
jsonObject.put("remark", "文员签收下架");
jsonObjects.add(jsonObject);
//进行签收数量的修改
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新装车包件数和签收包件数
Integer j = distributionSignforMapper.updateSignforByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
// 包件解托下架
content = "包件在" + myCurrentWarehouse.getName() + "由" + AuthUtil.getNickName() + "后台签收,装车方式:补录装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + distributionReservationEntity.getReservationCode();
try {
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), distributionLoadscanEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
} catch (Exception e) {
log.error("装车日志数据错误", e);
//这里装车的数据需要进行补录
DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfDTO();
if (deliveryListEntity.getKind().equals(ServiceConstant.DELIVERLIST_KIND_SELF)) {
distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectOne(new QueryWrapper<DistributionDeliverySelfEntity>().lambda()
.eq(DistributionDeliverySelfEntity::getIsMaster, ServiceConstant.IS_MASTER_YES)
.eq(DistributionDeliverySelfEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
);
} else {
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(new QueryWrapper<DistributionDeliveryTripartiteEntity>().lambda()
.eq(DistributionDeliveryTripartiteEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()));
BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity);
}
DistributionDeliveryListEntity listEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId());
if (Func.isEmpty(listEntity)) {
log.error("##########配送计划异常:{}", listEntity);
return Resp.scanFail("服务器正忙...", "服务器正忙");
}
//查询配送计划的计划司机
distributionLoadscanEntity = new DistributionLoadscanEntity();
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverPhone())) {
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleNub())) {
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
}
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) {
distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getId())) {
distributionLoadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) {
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
}
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleId())) {
distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
Date loadScanTime = new Date();
distributionLoadscanEntity.setScanTime(simpleDateFormat.format(loadScanTime));
distributionLoadscanEntity.setPackageId(parcelListEntity.getId());
distributionLoadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
Date signingTime = new Date(System.currentTimeMillis() + (1000 * 60));
distributionLoadscanEntity.setSigningTime(simpleDateFormat.format(signingTime));
distributionLoadscanEntity.setReceivedQuantity(parcelListEntity.getQuantity());
distributionLoadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId());
distributionLoadscanEntity.setIsSignfor(2);
distributionLoadscanEntity.setIsInsert(2);
distributionLoadscanEntity.setSignforType(LoadScanSigningTypeStatusConstant.wenyuanpiliangqianshou.getValue());
distributionLoadscanEntity.setWarehouseId(myCurrentWarehouse.getId());
distributionLoadscanEntity.setWarehouseName(myCurrentWarehouse.getName());
distributionLoadscanEntity.setSignforState(2);
distributionLoadscanEntity.setPackageNub(parcelListEntity.getQuantity());
distributionLoadscanEntity.setOrderId(parcelListEntity.getStockArticleId());
distributionLoadscanEntity.setLoadedNub(parcelListEntity.getQuantity());
distributionLoadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId());
distributionLoadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId());
distributionLoadscanEntity.setScanUser(AuthUtil.getUser().getNickName());
distributionLoadscanEntity.setSigningUser(AuthUtil.getUser().getNickName());
distributionLoadscanEntity.setSigningUserId(AuthUtil.getUser().getUserId());
distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.buluzhuangche.getValue());
distributionLoadscanService.save(distributionLoadscanEntity);
packageLockIds.add(distributionLoadscanEntity.getPackageId());
JSONObject jsonObject = new JSONObject();
jsonObject.put("code", distributionLoadscanEntity.getOrderPackageCode());
jsonObject.put("warehouseId", myCurrentWarehouse.getId());
jsonObject.put("taskId", distrilbutionloadingscanDTO.getReservationId());
jsonObject.put("type", 1);
jsonObject.put("num", 1);
jsonObject.put("remark", "文员签收下架");
jsonObjects.add(jsonObject);
//进行签收数量的修改
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新装车包件数和签收包件数
Integer j = distributionSignforMapper.updateSignforByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
// 包件解托下架
content = "包件在" + myCurrentWarehouse.getName() + "由" + AuthUtil.getNickName() + "后台签收,装车方式:补录装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + distributionReservationEntity.getReservationCode();
try {
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), distributionLoadscanEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
} catch (Exception e) {
log.error("装车日志数据错误", e);
}
aaa.add(trunklinePackageTrackLog);
}
aaa.add(trunklinePackageTrackLog);
}
//修改包件状态为装车、签收
DistributionParcelListEntity updatePackage = parcelListEntity;
updatePackage.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
updatePackage.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
distributionParcelListService.updateById(updatePackage);
//维护签收包件状态
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(), myCurrentWarehouse.getId());
//推送信息至工厂
// distributionAsyncService.sendFactory(parcelListEntity, simpleDateFormat.format(new Date()), distributionReservationEntity.getId(), distributionReservationEntity.getReservationCode(), myCurrentWarehouse.getName(), nickName);
sendNodeWorkDataBroadcast(parcelListEntity, distributionReservationEntity, distributionLoadscanEntity.getSigningTime(), myCurrentWarehouse);
//收集包件
orderpackages.add(updatePackage.getOrderPackageCode());
//修改包件状态为装车、签收
DistributionParcelListEntity updatePackage = parcelListEntity;
updatePackage.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
updatePackage.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
distributionParcelListService.updateById(updatePackage);
//维护签收包件状态
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(), myCurrentWarehouse.getId());
//推送信息至工厂
// distributionAsyncService.sendFactory(parcelListEntity, simpleDateFormat.format(new Date()), distributionReservationEntity.getId(), distributionReservationEntity.getReservationCode(), myCurrentWarehouse.getName(), nickName);
sendNodeWorkDataBroadcast(parcelListEntity, distributionReservationEntity, distributionLoadscanEntity.getSigningTime(), myCurrentWarehouse);
//收集包件
orderpackages.add(updatePackage.getOrderPackageCode());
// 推送商家端
// 推送
// try {
// sendMessage(orderPackageCode, distributionReservationEntity.getReservationCode(),
// deliveryListEntity.getTrainNumber(), deliveryListEntity.getVehicleName(), deliveryListEntity.getDriverName(),
// AuthUtil.getUserName(), myCurrentWarehouse.getId(), AuthUtil.getTenantId());
// } catch (Exception e) {
//// throw new RuntimeException(e);
// log.error(">>>> 签收推送报错", e);
// }
// 推送商家端
// 推送
// try {
// sendMessage(orderPackageCode, distributionReservationEntity.getReservationCode(),
// deliveryListEntity.getTrainNumber(), deliveryListEntity.getVehicleName(), deliveryListEntity.getDriverName(),
// AuthUtil.getUserName(), myCurrentWarehouse.getId(), AuthUtil.getTenantId());
// } catch (Exception e) {
//// throw new RuntimeException(e);
// log.error(">>>> 签收推送报错", e);
// }
} else {
//一个客户下出现重复包条码
log.error("############出现重复包条码:{}", collect);
throw new RuntimeException("包件数据异常,请联系管理员!!!");
} else {
//一个客户下出现重复包条码
log.error("############出现重复包条码:{}", collect);
throw new RuntimeException("包件数据异常,请联系管理员!!!");
}
}
}
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
//添加缓存
if (!packageLockIds.isEmpty()) {
List<Long> a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:");
if (Func.isNotEmpty(a)) {
assert a != null;
boolean flag = a.stream().anyMatch(any -> packageLockIds.contains(any));
if (flag) {
//正在操作,请稍后重试
throw new RuntimeException("该包件正在被操作,请稍后再试!!!");
//添加缓存
if (!packageLockIds.isEmpty()) {
List<Long> a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:");
if (Func.isNotEmpty(a)) {
assert a != null;
boolean flag = a.stream().anyMatch(any -> packageLockIds.contains(any));
if (flag) {
//正在操作,请稍后重试
throw new RuntimeException("该包件正在被操作,请稍后再试!!!");
} else {
packageLockIds.addAll(a);
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:", packageLockIds, 60L);
}
} else {
packageLockIds.addAll(a);
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:", packageLockIds, 60L);
}
} else {
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:", packageLockIds, 60L);
}
//维护客户
distributionReservationService.maintenanceReservationInfo(distrilbutionloadingscanDTO.getReservationId());
//维护配送任务
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId());
return R.data(orderpackages, "签收成功");
} catch (RuntimeException e) {
log.error("签收异常", e);
LogError logError = new LogError();
logError.setMessage(e.getMessage());
logClient.saveErrorLog(logError);
throw new CustomerException("系统错误, 请联系管理员");
}
//维护客户
distributionReservationService.maintenanceReservationInfo(distrilbutionloadingscanDTO.getReservationId());
//维护配送任务
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId());
return R.data(orderpackages, "签收成功");
}
private boolean judgmentClient(DistributionReservationEntity distributionReservationEntity, Long stockArticleId) {

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

@ -433,9 +433,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
}
}
//查询这个费用
List<DistributionDeliveryChargeEntity> list = distributionDeliveryChargeService.list(Wrappers.<DistributionDeliveryChargeEntity>query().lambda()
.eq(DistributionDeliveryChargeEntity::getBillLading, distrilbutionBillLading.getId())
);
// List<DistributionDeliveryChargeEntity> list = distributionDeliveryChargeService.list(Wrappers.<DistributionDeliveryChargeEntity>query().lambda()
// .eq(DistributionDeliveryChargeEntity::getBillLading, distrilbutionBillLading.getId())
// );
//修改订单数据
if (!distrilbutionBillLading.getStockArticleList().isEmpty()) {
List<JSONObject> jsonObjects = handleOrder(distrilbutionBillLading, billLadingEntity.getPickupBatch());

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockArticleWrapper.java

@ -72,7 +72,7 @@ public class DistributionStockArticleWrapper extends BaseEntityWrapper<Distribut
}
}
// distributionStockupVO.setIsZeroString("1".equals(distributionStockupVO.getIsZero())?"是":"否");
distributionStockupVO.setReservationNum(entity.getHandQuantity()-entity.getDeliveryQuantity());
distributionStockupVO.setReservationNum(entity.getHandQuantity());
buildVoInfor(distributionStockupVO);
return distributionStockupVO;
}

44
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java

@ -816,6 +816,26 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
return orderStatusLog;
}
private OpPackagePushLogEntity sendPushOuPaiDataNew(Long refId, String url, Integer pushType, JSONObject data) {
OpPackagePushLogEntity opPackagePushLogEntity = new OpPackagePushLogEntity();
opPackagePushLogEntity.setArgs(data.toJSONString());
opPackagePushLogEntity.setPushType(pushType);
opPackagePushLogEntity.setUrl(url);
opPackagePushLogEntity.setRefId(refId);
opPackagePushLogEntity.setPushOupaiNode(data.getString("Operate"));
String token = buildToken();
HttpResponse httpResponse = HttpRequest.post(url).header("Authorization", token).body(data.toJSONString()).execute();
String result = httpResponse.body();
opPackagePushLogEntity.setResp(result);
opPackagePushLogService.save(opPackagePushLogEntity);
return opPackagePushLogEntity;
}
/**
* 发送请求
*
@ -824,7 +844,25 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
private OpPackagePushLogEntity sendPushOuPaiData(Long refId, String url, Integer pushType, JSONObject data) {
LambdaQueryWrapper<OpPackagePushLogEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
// 需要判断出库节点是否已经回传了入库节点
String o = data.getString("Operate");
if ("发货".equals(o)) {
// 判断是否有入库数
LambdaQueryWrapper<OpPackagePushLogEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(OpPackagePushLogEntity::getRefId, refId);
lambdaQueryWrapper.eq(OpPackagePushLogEntity::getPushOupaiNode, "收货");
lambdaQueryWrapper.eq(OpPackagePushLogEntity::getPushType, pushType);// 查询包件
List<OpPackagePushLogEntity> list = opPackagePushLogService.list(lambdaQueryWrapper);
if(list.isEmpty()){
data.put("Operate","收货");
OpPackagePushLogEntity opPackagePushLogEntity = sendPushOuPaiDataNew(refId, url, 1, data);
data.put("Operate","发货");
}
}
LambdaQueryWrapper<OpPackagePushLogEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(OpPackagePushLogEntity::getRefId, refId);
lambdaQueryWrapper.eq(OpPackagePushLogEntity::getPushOupaiNode, data.getString("Operate"));
lambdaQueryWrapper.eq(OpPackagePushLogEntity::getPushType, pushType);// 查询包件
@ -849,6 +887,10 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
}
}

13
blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java

@ -35,6 +35,7 @@ import com.logpm.factory.oupai.entity.OpOrderStatusLogEntity;
import com.logpm.factory.oupai.service.IFactoryOrderService;
import com.logpm.factory.oupai.service.IFactoryPackageService;
import com.logpm.factory.oupai.service.IOuPaiFactoryDataService;
import com.logpm.factory.oupai.service.IOuPaiFactoryService;
import com.logpm.factory.oupai.service.impl.OuPaiFactoryServiceImpl;
import com.logpm.factory.oupai.vo.OuPaiDataPushVO;
import com.logpm.factory.pan.service.IPanFactoryDataService;
@ -126,6 +127,7 @@ public class TestService {
@Autowired
private IMtFactoryOrderMainService mtFactoryOrderMainService;
@Test
public void test2() {
// ouPaiFactoryService.findOuPaiFactoryOrderDTOByCarCarNumber("LCD230505047");
@ -931,6 +933,17 @@ public class TestService {
@Autowired
private IFactoryOrderService factoryOrderService;
@Test
public void test20() {
OrderStatusDTO orderStatusDTO = new OrderStatusDTO();
orderStatusDTO.setStatus("1");
orderStatusDTO.setUnitNo("23112702738-4");
ouPaiFactoryService.handleStatusData(orderStatusDTO);
}
@Test
public void test19() {
OrderStatusDTO orderStatusDTO = new OrderStatusDTO();

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/BillladingController.java

@ -277,6 +277,7 @@ public class BillladingController {
//提货单状态 1=未开始,2=提货中,3=已完成,4=已结算 5=已取消
Integer type = billladingDTO.getType();
Long billladingId = billladingDTO.getId();
String completeTime = billladingDTO.getCompleteTime();
try{
//当前登录人选择的仓库
@ -295,7 +296,7 @@ public class BillladingController {
return R.fail(405,"提货单id不能为空");
}
trunklineBillladingService.updateBillladingStatus(billladingId,type,myCurrentWarehouse.getId(),myCurrentWarehouse.getName());
trunklineBillladingService.updateBillladingStatus(billladingId,type,myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),completeTime);
return R.success("更新完成");
}catch (CustomerException e){
log.error(e.message,e);

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java

@ -2405,6 +2405,7 @@ public class CarsLoadController {
}else{
warehouseIds.add(myCurrentWarehouse.getId());
}
loadCarsDTO.setWarehouseIds(warehouseIds);
return carsLoadService.findSignOrderPageList(loadCarsDTO);
}catch (CustomerException e){

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/IncomingController.java

@ -11,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
@ -89,7 +90,7 @@ public class IncomingController {
log.warn(method+"处理订单数据为空");
return R.fail(405,"处理订单数据为空");
}
inComingDTO.setNickName(AuthUtil.getNickName());
return inComingService.incomingBatchOrder(inComingDTO,null);
}catch (CustomerException e){

9
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml

@ -118,9 +118,17 @@
select ltlso.id id,
ltlso.load_id loadId,
ltlso.warehouse_id warehouseId,
lww.warehouse_name warehouseName,
ltlso.plan_num planNum,
ltlso.load_sign_code loadSignCode,
ltlso.sign_num signNum,
ltlso.mall_name mallName,
ltlso.mall_person mallPerson,
ltlso.mall_mobile mallMobile,
ltlso.mall_address mallAddress,
ltlso.belong_to_warehouse_name belongToWarehouseName,
ltlso.sign_status signStatus,
ltlso.sign_time signTime,
ltcl.driver_name driverName,
ltcl.driver_mobile driverMobile,
ltcl.car_number carNumber,
@ -130,6 +138,7 @@
from logpm_trunkline_load_sign_order ltlso
left join logpm_trunkline_cars_load ltcl on ltcl.id = ltlso.load_id
LEFT JOIN logpm_trunkline_cars_order ltco on ltco.sign_order_id = ltlso.id
left join logpm_warehouse_warehouse lww on lww.id = ltlso.warehouse_id
<where>
and (ltlso.warehouse_id in

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineBillladingService.java

@ -22,7 +22,7 @@ public interface ITrunklineBillladingService extends BaseService<TrunklineBillla
void updateBilllading(BillladingDTO billladingDTO);
void updateBillladingStatus(Long billladingId, Integer type,Long warehouseId,String warehouseName);
void updateBillladingStatus(Long billladingId, Integer type,Long warehouseId,String warehouseName,String completeTime);
R billladingDetail(Long billladingId, Long warehouseId);

45
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -1787,18 +1787,18 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
Set<String> importStandardOuPaiDTOSet = importStandardOuPaiDTOS.stream().map(ImportStandardOuPaiDTO::getOrderPackageCode).collect(Collectors.toSet());
//把pacakgeDetailExcelDTOS中的元素的orderPackageCode属性分组
Map<String, Long> orderPackageCodeCounts = importStandardOuPaiDTOS.stream()
.collect(Collectors.groupingBy(ImportStandardOuPaiDTO::getOrderPackageCode, Collectors.counting()));
Set<String> duplicateOrderPackageCodes = orderPackageCodeCounts.entrySet().stream()
.filter(entry -> entry.getValue() > 1)
.map(Map.Entry::getKey)
.collect(Collectors.toSet());
if(!duplicateOrderPackageCodes.isEmpty()){
log.warn("#################importStandardOuPai: 包条码重复 {}",duplicateOrderPackageCodes);
return R.fail(405, "包条码重复"+duplicateOrderPackageCodes);
}
// Map<String, Long> orderPackageCodeCounts = importStandardOuPaiDTOS.stream()
// .collect(Collectors.groupingBy(ImportStandardOuPaiDTO::getOrderPackageCode, Collectors.counting()));
//
// Set<String> duplicateOrderPackageCodes = orderPackageCodeCounts.entrySet().stream()
// .filter(entry -> entry.getValue() > 1)
// .map(Map.Entry::getKey)
// .collect(Collectors.toSet());
//
// if(!duplicateOrderPackageCodes.isEmpty()){
// log.warn("#################importStandardOuPai: 包条码重复 {}",duplicateOrderPackageCodes);
// return R.fail(405, "包条码重复"+duplicateOrderPackageCodes);
// }
List<String> orderPackageCodeKeys = new ArrayList<>(importStandardOuPaiDTOSet);
@ -1818,6 +1818,23 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
hasOrderPackageCodeList.addAll(hasOrderPackageCodes);
});
List<TrunklineAdvanceDetailEntity> updateMaterialList = new ArrayList<>();
//把importStandardOuPaiDTOS转化成orderPackageCode为key的Map
Map<String, ImportStandardOuPaiDTO> importStandardOuPaiDTOMap = importStandardOuPaiDTOS.stream().collect(Collectors.toMap(ImportStandardOuPaiDTO::getOrderPackageCode, Function.identity(), (a, b) -> a));
List<TrunklineAdvanceDetailEntity> hasAdvanceDetailList = advanceDetailService.findListByOrderPackageCodeList(hasOrderPackageCodeList);
hasAdvanceDetailList.forEach(advanceDetailEntity -> {
ImportStandardOuPaiDTO importStandardOuPaiDTO = importStandardOuPaiDTOMap.get(advanceDetailEntity.getOrderPackageCode());
TrunklineAdvanceDetailEntity updateMaterialEntity = new TrunklineAdvanceDetailEntity();
updateMaterialEntity.setId(advanceDetailEntity.getId());
updateMaterialEntity.setMaterialCode(importStandardOuPaiDTO.getMaterialCode());
updateMaterialEntity.setMaterialName(importStandardOuPaiDTO.getMaterialName());
updateMaterialEntity.setFirstPackName(importStandardOuPaiDTO.getFirstsName());
updateMaterialEntity.setSecondPackName(importStandardOuPaiDTO.getSencodsName());
updateMaterialEntity.setThirdPackName(importStandardOuPaiDTO.getThirdsName());
updateMaterialList.add(updateMaterialEntity);
});
//排除importStandardOuPaiDTOS中orderPackageCode在hasOrderPackageCodeList中存在的元素
importStandardOuPaiDTOS = importStandardOuPaiDTOS.stream().filter(item -> !hasOrderPackageCodeList.contains(item.getOrderPackageCode())).collect(Collectors.toList());
@ -2077,6 +2094,10 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
carsLoadAsyncService.sendRabbitMessageLoadScanData(advanceEntityList);
}
if(CollUtil.isNotEmpty(updateMaterialList)){
advanceDetailService.updateBatchById(updateMaterialList);
}
int successNum = advanceDetailEntities.size();
return R.success("成功导入"+successNum+"条");

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java

@ -382,7 +382,7 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
}
@Override
public void updateBillladingStatus(Long billladingId, Integer type,Long warehouseId,String warehouseName) {
public void updateBillladingStatus(Long billladingId, Integer type,Long warehouseId,String warehouseName,String completeTime) {
log.info("#############updateBillladingStatus: 更新提货单状态 type={}",type);
TrunklineBillladingEntity billladingEntity = baseMapper.selectById(billladingId);
@ -418,7 +418,7 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
//提货完成
if ("2".equals(billladingStatus)) {
billladingEntity.setBillladingStatus("3");
billladingEntity.setEndTime(new Date());
billladingEntity.setEndTime(CommonUtil.StringToDate(completeTime));
stringBuffer.append(",提货中变更为提货完成");
} else {
log.warn("##################updateBillladingStatus: 提货单不能更新为已完成 billladingStatus={}", billladingStatus);

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -2852,6 +2852,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setLoadingAbnormal(isAbnormal);
carsLoadScanEntity.setUnloadAbnormal(0);
carsLoadScanEntity.setUnloadCheck(0);
carsLoadScanEntity.setUnloadNum(0);
carsLoadScanEntity.setType(2);
carsLoadScanEntity.setIsData(isData);
carsLoadScanEntity.setTrayId(trayId);

10
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillPackageServiceImpl.java

@ -174,11 +174,15 @@ public class TrunklineWaybillPackageServiceImpl extends BaseServiceImpl<Trunklin
//更新所有包件的当前所在仓
if(CollUtil.isNotEmpty(orderPackageCodes)){
List<TrunklineAdvanceDetailEntity> advanceDetailEntities = advanceDetailService.findListByOrderPackageCodeList(orderPackageCodes);
List<TrunklineAdvanceDetailEntity> updateAdvanceDetailList = new ArrayList<>();
advanceDetailEntities.forEach(advanceDetailEntity -> {
advanceDetailEntity.setNowWarehouseId(warehouseId);
advanceDetailEntity.setNowWarehouseName(warehouseEntity.getName());
TrunklineAdvanceDetailEntity updateAdvanceDetail = new TrunklineAdvanceDetailEntity();
updateAdvanceDetail.setId(advanceDetailEntity.getId());
updateAdvanceDetail.setNowWarehouseId(warehouseId);
updateAdvanceDetail.setNowWarehouseName(warehouseEntity.getName());
updateAdvanceDetailList.add(updateAdvanceDetail);
});
advanceDetailService.updateBatchById(advanceDetailEntities);
advanceDetailService.updateBatchById(updateAdvanceDetailList);
}
}
}

Loading…
Cancel
Save