Browse Source

客户日志

dist.1.3.0
汤建军 5 months ago
parent
commit
33664dfccf
  1. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataStorageServicesController.java
  2. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataStoreBrandController.java
  3. 6
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java
  4. 7
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataStorageServicesService.java
  5. 8
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataStoreBrandService.java
  6. 15
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTripartiteMallService.java
  7. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
  8. 45
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStorageServicesServiceImpl.java
  9. 40
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreBrandServiceImpl.java
  10. 6
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTrayServiceImpl.java
  11. 134
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java
  12. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java
  13. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java
  14. 43
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

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

@ -129,7 +129,8 @@ public class BasicdataStorageServicesController extends BladeController {
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(basicdataStorageServicesService.deleteLogic(Func.toLongList(ids)));
R r = basicdataStorageServicesService.removeClientStorageServices(ids);
return r;
}

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

@ -155,7 +155,8 @@ public class BasicdataStoreBrandController extends BladeController {
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(basicdataStoreBrandService.deleteLogic(Func.toLongList(ids)));
R r = basicdataStoreBrandService.removeClientBrand(ids);
return r;
}

6
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java

@ -126,7 +126,8 @@ public class BasicdataTripartiteMallController extends BladeController {
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入basicdataTripartiteMall")
public R submit(@Valid @RequestBody BasicdataTripartiteMallEntity basicdataTripartiteMall) {
return R.status(basicdataTripartiteMallService.saveOrUpdate(basicdataTripartiteMall));
R r = basicdataTripartiteMallService.saveOrUpdateClientTripartiteMall(basicdataTripartiteMall);
return r;
}
/**
@ -136,7 +137,8 @@ public class BasicdataTripartiteMallController extends BladeController {
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(basicdataTripartiteMallService.deleteLogic(Func.toLongList(ids)));
R r = basicdataTripartiteMallService.removeClientTripartiteMall(ids);
return r;
}

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

@ -58,4 +58,11 @@ public interface IBasicdataStorageServicesService extends BaseService<BasicdataS
List<BasicdataStorageServicesVO> pageList(IPage<Object> page, Map<String, Object> basicdataStorageServices);
BasicdataStorageServicesEntity findEntityBySendWarehouseIdIsNullAndClientId(Long clientId);
/**
* 删除服务仓
* @param ids
* @return
*/
R removeClientStorageServices(String ids);
}

8
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataStoreBrandService.java

@ -22,6 +22,7 @@ import com.logpm.basicdata.entity.BasicdataStoreBrandEntity;
import com.logpm.basicdata.excel.BasicdataStoreBrandExcel;
import com.logpm.basicdata.vo.BasicdataStoreBrandVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import java.util.List;
import java.util.Map;
@ -71,4 +72,11 @@ public interface IBasicdataStoreBrandService extends BaseService<BasicdataStoreB
* @param basicdataStoreBrand@return
*/
List<BasicdataStoreBrandVO> listIdsName(Map<String, Object> basicdataStoreBrand);
/**
* 移除客户品牌
* @param ids
* @return
*/
R removeClientBrand(String ids);
}

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

@ -22,6 +22,7 @@ import com.logpm.basicdata.entity.BasicdataTripartiteMallEntity;
import com.logpm.basicdata.excel.BasicdataTripartiteMallExcel;
import com.logpm.basicdata.vo.BasicdataTripartiteMallVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import java.util.List;
@ -55,4 +56,18 @@ public interface IBasicdataTripartiteMallService extends BaseService<BasicdataTr
List<BasicdataTripartiteMallEntity> getOwn();
Long getClientIdByNameAndBrandAndCode(String name, String code, String brand);
/**
* 客户三方商场信息保存或修改
* @param basicdataTripartiteMall
* @return
*/
R saveOrUpdateClientTripartiteMall(BasicdataTripartiteMallEntity basicdataTripartiteMall);
/**
* 删除三方商城
* @param ids
* @return
*/
R removeClientTripartiteMall(String ids);
}

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

@ -88,6 +88,7 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
@Autowired
private IBasicdataStoreBusinessService basicdataStoreBusinessService;
@Autowired
@Lazy
private IBasicdataTripartiteMallService basicdataTripartiteMallService; //三方商场
@Autowired
@Lazy

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

@ -22,10 +22,7 @@ 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.entity.*;
import com.logpm.basicdata.excel.BasicdataStorageServicesExcel;
import com.logpm.basicdata.mapper.BasicdataStorageServicesMapper;
import com.logpm.basicdata.service.IBasicdataClientLogService;
@ -262,4 +259,44 @@ public class BasicdataStorageServicesServiceImpl extends BaseServiceImpl<Basicda
return baseMapper.findEntityBySendWarehouseIdIsNullAndClientId(clientId);
}
@Override
public R removeClientStorageServices(String ids) {
String method ="#####################BasicdataStoreBrandServiceImpl.removeClientStorageServices";
List<Long> list = Func.toLongList(ids);
if (list.isEmpty()) {
log.error(method+"参数缺少");
return R.fail("参数缺少");
}
List<BasicdataStorageServicesEntity> basicdataStorageServicesEntities = this.listByIds(list);
if (basicdataStorageServicesEntities.isEmpty()) {
log.error("查询目标删除客户品牌信息错误,ids:{}",list);
return R.fail("查询目标删除客户品牌信息错误");
}
List<Long> clientIds = basicdataStorageServicesEntities.stream().map(BasicdataStorageServicesEntity::getClientId).distinct().collect(Collectors.toList());
if (!clientIds.isEmpty()) {
if (clientIds.size()!=1) {
log.error(method+"当前删除客户品牌存在多个客户信息");
return R.fail("当前删除客户品牌存在多个客户信息");
}
Long clientId = clientIds.get(0);
BasicdataClientEntity clientEntity = basicdataClientService.getById(clientId);
if (Objects.isNull(clientEntity)){
log.error(method+"查询客户信息错误");
return R.fail("查询客户信息错误");
}
BasicdataClientLogEntity basicdataClientLogEntity = new BasicdataClientLogEntity();
basicdataClientLogEntity.setClientId(clientId);
basicdataClientLogEntity.setClientName(clientEntity.getClientName());
basicdataClientLogEntity.setOperator(AuthUtil.getNickName());
StringBuilder builder = new StringBuilder();
for (BasicdataStorageServicesEntity basicdataStorageServicesEntity : basicdataStorageServicesEntities) {
builder.append("[发站仓:").append(basicdataStorageServicesEntity.getSendWarehouseName()).append(",").append("服务仓:").append(basicdataStorageServicesEntity.getServeWarehouseName()).append("],");
}
String content = "删除发站仓配置-->"+builder.deleteCharAt(builder.lastIndexOf(","));
basicdataClientLogEntity.setContent(content);
basicdataClientLogService.saveAppointLog(basicdataClientLogEntity);
}
return R.status(this.removeByIds(list));
}
}

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

@ -34,6 +34,7 @@ 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.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
@ -185,6 +186,45 @@ public class BasicdataStoreBrandServiceImpl extends BaseServiceImpl<BasicdataSto
return voList;
}
@Override
public R removeClientBrand(String ids) {
String method ="#####################BasicdataStoreBrandServiceImpl.removeClientBrand";
List<Long> list = Func.toLongList(ids);
if (list.isEmpty()) {
log.error(method+"参数缺少");
return R.fail("参数缺少");
}
List<BasicdataStoreBrandEntity> basicdataStoreBrandEntities = this.listByIds(list);
if (basicdataStoreBrandEntities.isEmpty()) {
log.error("查询目标删除客户品牌信息错误,ids:{}",list);
return R.fail("查询目标删除客户品牌信息错误");
}
List<Long> clientIds = basicdataStoreBrandEntities.stream().map(BasicdataStoreBrandEntity::getClientId).distinct().collect(Collectors.toList());
if (!clientIds.isEmpty()) {
if (clientIds.size()!=1) {
log.error(method+"当前删除客户品牌存在多个客户信息");
return R.fail("当前删除客户品牌存在多个客户信息");
}
Long clientId = clientIds.get(0);
BasicdataClientEntity clientEntity = basicdataClientService.getById(clientId);
if (Objects.isNull(clientEntity)){
log.error(method+"查询客户信息错误");
return R.fail("查询客户信息错误");
}
BasicdataClientLogEntity basicdataClientLogEntity = new BasicdataClientLogEntity();
basicdataClientLogEntity.setClientId(clientId);
basicdataClientLogEntity.setClientName(clientEntity.getClientName());
basicdataClientLogEntity.setOperator(AuthUtil.getNickName());
String brandNames = basicdataStoreBrandEntities.stream().map(BasicdataStoreBrandEntity::getBrandName).collect(Collectors.joining(","));
String content = "删除品牌-->["+brandNames+"]";
basicdataClientLogEntity.setContent(content);
basicdataClientLogService.saveAppointLog(basicdataClientLogEntity);
}
return R.status(this.deleteLogic(list));
}
public static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) {
Map<Object, Boolean> seen = new ConcurrentHashMap<>(16);
return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null;

6
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTrayServiceImpl.java

@ -64,14 +64,14 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import javax.swing.text.html.HTML;
import java.io.*;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
/**
* 托盘 服务实现类

134
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java

@ -18,15 +18,28 @@ package com.logpm.basicdata.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataClientLogEntity;
import com.logpm.basicdata.entity.BasicdataStorageServicesEntity;
import com.logpm.basicdata.entity.BasicdataTripartiteMallEntity;
import com.logpm.basicdata.excel.BasicdataTripartiteMallExcel;
import com.logpm.basicdata.mapper.BasicdataTripartiteMallMapper;
import com.logpm.basicdata.service.IBasicdataClientLogService;
import com.logpm.basicdata.service.IBasicdataClientService;
import com.logpm.basicdata.service.IBasicdataTripartiteMallService;
import com.logpm.basicdata.vo.BasicdataTripartiteMallVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* 客户三方商城 服务实现类
@ -35,8 +48,15 @@ import java.util.List;
* @since 2023-06-21
*/
@Service
@AllArgsConstructor
@Slf4j
public class BasicdataTripartiteMallServiceImpl extends BaseServiceImpl<BasicdataTripartiteMallMapper, BasicdataTripartiteMallEntity> implements IBasicdataTripartiteMallService {
private IBasicdataClientService basicdataClientService;
private IBasicdataClientLogService basicdataClientLogService;
@Override
public IPage<BasicdataTripartiteMallVO> selectBasicdataTripartiteMallPage(IPage<BasicdataTripartiteMallVO> page, BasicdataTripartiteMallVO basicdataTripartiteMall) {
return page.setRecords(baseMapper.selectBasicdataTripartiteMallPage(page, basicdataTripartiteMall));
@ -54,7 +74,7 @@ public class BasicdataTripartiteMallServiceImpl extends BaseServiceImpl<Basicdat
@Override
public Long getClientIdByNameAndBrand(String name, String brand) {
return baseMapper.getClientIdByNameAndBrand(name,brand);
return baseMapper.getClientIdByNameAndBrand(name, brand);
}
@Override
@ -64,10 +84,116 @@ public class BasicdataTripartiteMallServiceImpl extends BaseServiceImpl<Basicdat
@Override
public Long getClientIdByNameAndBrandAndCode(String name, String code, String brand) {
if("".equals(code)){
code=null;
if ("".equals(code)) {
code = null;
}
return baseMapper.getClientIdByNameAndBrandAndCode(name, code, brand);
}
@Override
@Transactional
public R saveOrUpdateClientTripartiteMall(BasicdataTripartiteMallEntity basicdataTripartiteMall) {
String method = "##############################BasicdataTripartiteMallServiceImpl.saveOrUpdateClientTripartiteMall";
if (Objects.isNull(basicdataTripartiteMall.getBrandId())) {
log.error(method + "BrandId参数缺失");
return R.fail("操作失败,参数缺失");
}
if (Objects.isNull(basicdataTripartiteMall.getTripartiteMall())) {
log.error(method + "TripartiteMall参数缺失");
return R.fail("操作失败,请输入商城名称");
}
if (Objects.isNull(basicdataTripartiteMall.getClientId())) {
log.error(method + "ClientId参数缺失");
return R.fail("操作失败,参数缺失");
}
BasicdataClientEntity clientEntity = basicdataClientService.getById(basicdataTripartiteMall.getClientId());
if (Objects.isNull(clientEntity)) {
log.error(method + "查询客户信息错误,clientId:{}", basicdataTripartiteMall.getClientId());
return R.fail("操作失败,参数缺失");
}
BasicdataClientLogEntity basicdataClientLogEntity = new BasicdataClientLogEntity();
basicdataClientLogEntity.setClientId(clientEntity.getId());
basicdataClientLogEntity.setClientName(clientEntity.getClientName());
basicdataClientLogEntity.setOperator(AuthUtil.getNickName());
String content = "";
if (Objects.isNull(basicdataTripartiteMall.getId())) {
String str = basicdataTripartiteMall.getTripartiteCoding().isEmpty() ? "空" : basicdataTripartiteMall.getTripartiteCoding();
//新增
content = "新增三方商场-->[名称:" + basicdataTripartiteMall.getTripartiteMall() + ",编码:" + str + ",品牌:" + basicdataTripartiteMall.getBrandName() + "]";
basicdataClientLogEntity.setContent(content);
basicdataClientLogService.save(basicdataClientLogEntity);
} else {
//修改
BasicdataTripartiteMallEntity entity = this.getById(basicdataTripartiteMall.getId());
Boolean flag = judgeComparisonBasicdataTripartiteMall(entity, basicdataTripartiteMall);
if (flag) {
content = comparisonBasicdataTripartiteMall(entity, basicdataTripartiteMall);
basicdataClientLogEntity.setContent(content);
basicdataClientLogService.save(basicdataClientLogEntity);
}
}
return R.status(this.saveOrUpdate(basicdataTripartiteMall));
}
private Boolean judgeComparisonBasicdataTripartiteMall(BasicdataTripartiteMallEntity entity, BasicdataTripartiteMallEntity basicdataTripartiteMall) {
String str1 = entity.getTripartiteCoding().isEmpty() ? "空" : entity.getTripartiteCoding();
String str2 = basicdataTripartiteMall.getTripartiteCoding().isEmpty() ? "空" : basicdataTripartiteMall.getTripartiteCoding();
String oldTripartiteMall = "[名称:" + entity.getTripartiteMall() + ",编码:" + str1 + ",品牌:" + entity.getBrandName() + "]";
String newTripartiteMall = "[名称:" + basicdataTripartiteMall.getTripartiteMall() + ",编码:" + str2 + ",品牌:" + basicdataTripartiteMall.getBrandName() + "]";
return !oldTripartiteMall.equals(newTripartiteMall);
}
@Override
public R removeClientTripartiteMall(String ids) {
String method = "#####################BasicdataStoreBrandServiceImpl.removeClientStorageServices";
List<Long> list = Func.toLongList(ids);
if (list.isEmpty()) {
log.error(method + "参数缺少");
return R.fail("参数缺少");
}
List<BasicdataTripartiteMallEntity> basicdataStorageServicesEntities = this.listByIds(list);
if (basicdataStorageServicesEntities.isEmpty()) {
log.error("查询目标删除客户三方信息错误,ids:{}", list);
return R.fail("查询目标删除客户三方信息错误");
}
List<Long> clientIds = basicdataStorageServicesEntities.stream().map(BasicdataTripartiteMallEntity::getClientId).distinct().collect(Collectors.toList());
if (!clientIds.isEmpty()) {
if (clientIds.size() != 1) {
log.error(method + "当前删除客户三方商城存在多个客户信息");
return R.fail("当前删除客户三方商城存在多个客户信息");
}
Long clientId = clientIds.get(0);
BasicdataClientEntity clientEntity = basicdataClientService.getById(clientId);
if (Objects.isNull(clientEntity)) {
log.error(method + "查询客户信息错误");
return R.fail("查询客户信息错误");
}
BasicdataClientLogEntity basicdataClientLogEntity = new BasicdataClientLogEntity();
basicdataClientLogEntity.setClientId(clientId);
basicdataClientLogEntity.setClientName(clientEntity.getClientName());
basicdataClientLogEntity.setOperator(AuthUtil.getNickName());
StringBuilder builder = new StringBuilder();
for (BasicdataTripartiteMallEntity basicdataTripartiteMall : basicdataStorageServicesEntities) {
builder.append("[名称:").append(basicdataTripartiteMall.getTripartiteMall()).append(",编码:").append(basicdataTripartiteMall.getTripartiteCoding()).append(",品牌:").append(basicdataTripartiteMall.getBrandName()).append("],");
}
String content = "删除三方商城配置-->" + builder.deleteCharAt(builder.lastIndexOf(","));
basicdataClientLogEntity.setContent(content);
basicdataClientLogService.saveAppointLog(basicdataClientLogEntity);
}
return R.status(this.removeByIds(list));
}
return baseMapper.getClientIdByNameAndBrandAndCode(name,code,brand);
private String comparisonBasicdataTripartiteMall(BasicdataTripartiteMallEntity entity, BasicdataTripartiteMallEntity basicdataTripartiteMall) {
StringBuilder builder = new StringBuilder();
String str1 = entity.getTripartiteCoding().isEmpty() ? "空" : entity.getTripartiteCoding();
String str2 = basicdataTripartiteMall.getTripartiteCoding().isEmpty() ? "空" : basicdataTripartiteMall.getTripartiteCoding();
String oldTripartiteMall = "[名称:" + entity.getTripartiteMall() + ",编码:" + str1 + ",品牌:" + entity.getBrandName() + "]";
String newTripartiteMall = "[名称:" + basicdataTripartiteMall.getTripartiteMall() + ",编码:" + str2 + ",品牌:" + basicdataTripartiteMall.getBrandName() + "]";
builder.append("编辑三方商城-->").append(oldTripartiteMall).append(",变更为").append(newTripartiteMall);
return builder.toString();
}
}

9
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java

@ -300,8 +300,13 @@ public class DistrilbutionBillLadingController extends BladeController {
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入distrilbutionBillLading")
public R updateOwn(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
Boolean st = distrilbutionBillLadingService.updateOwn(ids);
return R.status(st);
try {
R st = distrilbutionBillLadingService.updateOwn(ids);
return st;
} catch (Exception e) {
log.error(">>>>>", e);
}
return R.fail("操作失败");
}
/**

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

@ -145,7 +145,7 @@ public interface IDistrilbutionBillLadingService extends BaseService<Distrilbuti
* @param ids
* @return
*/
Boolean updateOwn(String ids);
R updateOwn(String ids);
/**
* 查询数据

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

@ -3544,15 +3544,15 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean updateOwn(String ids) {
public R updateOwn(String ids) {
String[] split = ids.split(",");
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)) {
return false;
return R.fail(403,"未授权!!!");
}
Set<Long> parcelListIds = new HashSet<>();
try {
for (int i = 0; i < split.length; i++) {
String s = split[i];
//查询是不是上传图片
@ -3560,14 +3560,22 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
.eq(DistributionPrintEntity::getBillLadingId, s)
);
if (list1.isEmpty()) {
throw new ServiceException("请上传签收图片!!");
return R.fail("请上传签收图片!!");
}
int count = (int) list1.stream().filter(ii -> "1".equals(ii.getGenre().toString())).count();
int count1 = (int) list1.stream().filter(ii -> "2".equals(ii.getGenre().toString())).count();
int count2 = (int) list1.stream().filter(ii -> "3".equals(ii.getGenre().toString())).count();
if (count1 < 1 || count < 1 || count2 < 1) {
throw new ServiceException("请上传完整签收图片!!");
return R.fail("请上传完整签收图片!!");
}
List<DistributionBillLadingScanEntity> ladingScanEntities = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
.eq(DistributionBillLadingScanEntity::getBillLadingId, Long.parseLong(s))
.eq(DistributionBillLadingScanEntity::getMaterialType, "2")
);
if (ladingScanEntities.isEmpty()){
return R.fail("无签收数据!!");
}
//修改提货状态
DistrilbutionBillLadingEntity billLadingEntity = new DistrilbutionBillLadingEntity();
billLadingEntity.setConditions(BillLadingStatusConstant.yiqianshou.getValue());
@ -3580,12 +3588,15 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
distributionStockupInfoService.maintenanceStockUp(Long.parseLong(s), 2);
//查询自提单是否完成扫描
Integer integer = this.selectBillLadingPlanNum(Long.parseLong(s));
List<DistributionBillLadingScanEntity> ladingScanEntities = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
.eq(DistributionBillLadingScanEntity::getBillLadingId, Long.parseLong(s))
.eq(DistributionBillLadingScanEntity::getMaterialType, "2")
);
if (Func.isNotEmpty(ladingScanEntities)) {
int sum = ladingScanEntities.stream().mapToInt(DistributionBillLadingScanEntity::getQuantity).sum();
// if (sum == 0){
// //未进行任何签收扫描的操作这里需要进行拦截
// throw new ServiceException("无签收数据");
//
// }
if (integer != sum) {
//存在资源释放操作
distributionAsyncService.releaseBillLadingResource(Long.parseLong(s), myCurrentWarehouse.getId());
@ -3633,9 +3644,12 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
// 签收发送消息到工厂
pushFactoryOrderData(myCurrentWarehouse.getId(), ladingScanEntity.getParcelListId().toString(), ladingScanEntity.getOrderSelfNumbering());
}
} else {
distributionAsyncService.releaseBillLadingResource(Long.parseLong(s), myCurrentWarehouse.getId());
}
// else {
// //未进行任何签收扫描的操作这里需要进行拦截
//
//// distributionAsyncService.releaseBillLadingResource(Long.parseLong(s), myCurrentWarehouse.getId());
// }
//修改订单状态
List<DistrilbutionBillStockEntity> list = distrilbutionBillStockService.list(Wrappers.<DistrilbutionBillStockEntity>query().lambda()
@ -3677,15 +3691,10 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
// 回传老系统自提数据
sendOldSystem(Long.parseLong(s));
}
} catch (Exception e) {
log.error(">>>>>", e);
return false;
}
// 回传工厂数据
sendFactory(myCurrentWarehouse, parcelListIds);
return true;
return R.success("操作成功");
}
/**

Loading…
Cancel
Save