diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataStorageServicesController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataStorageServicesController.java index 7e3f8d70c..66e9f96dd 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataStorageServicesController.java +++ b/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; } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataStoreBrandController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataStoreBrandController.java index b64ce4219..97d9d967f 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataStoreBrandController.java +++ b/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; } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java index f9e0f90d2..c59666cd6 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java @@ -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; } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataStorageServicesService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataStorageServicesService.java index 2eccbe09b..10e90f2db 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataStorageServicesService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataStorageServicesService.java @@ -58,4 +58,11 @@ public interface IBasicdataStorageServicesService extends BaseService pageList(IPage page, Map basicdataStorageServices); BasicdataStorageServicesEntity findEntityBySendWarehouseIdIsNullAndClientId(Long clientId); + + /** + * 删除服务仓 + * @param ids + * @return + */ + R removeClientStorageServices(String ids); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataStoreBrandService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataStoreBrandService.java index 326c49d69..397a990d0 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataStoreBrandService.java +++ b/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 listIdsName(Map basicdataStoreBrand); + + /** + * 移除客户品牌 + * @param ids + * @return + */ + R removeClientBrand(String ids); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTripartiteMallService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTripartiteMallService.java index d8bfcbaa2..f5277d532 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTripartiteMallService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTripartiteMallService.java @@ -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 getOwn(); Long getClientIdByNameAndBrandAndCode(String name, String code, String brand); + + /** + * 客户三方商场信息保存或修改 + * @param basicdataTripartiteMall + * @return + */ + R saveOrUpdateClientTripartiteMall(BasicdataTripartiteMallEntity basicdataTripartiteMall); + + /** + * 删除三方商城 + * @param ids + * @return + */ + R removeClientTripartiteMall(String ids); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java index 7f8ebcc48..b917ece50 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java @@ -88,6 +88,7 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl list = Func.toLongList(ids); + if (list.isEmpty()) { + log.error(method+"参数缺少"); + return R.fail("参数缺少"); + } + List basicdataStorageServicesEntities = this.listByIds(list); + if (basicdataStorageServicesEntities.isEmpty()) { + log.error("查询目标删除客户品牌信息错误,ids:{}",list); + return R.fail("查询目标删除客户品牌信息错误"); + } + List 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)); + } + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreBrandServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreBrandServiceImpl.java index bdf4a3c1f..20def4979 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreBrandServiceImpl.java +++ b/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 list = Func.toLongList(ids); + if (list.isEmpty()) { + log.error(method+"参数缺少"); + return R.fail("参数缺少"); + } + List basicdataStoreBrandEntities = this.listByIds(list); + if (basicdataStoreBrandEntities.isEmpty()) { + log.error("查询目标删除客户品牌信息错误,ids:{}",list); + return R.fail("查询目标删除客户品牌信息错误"); + } + List 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 Predicate distinctByKey(Function keyExtractor) { Map seen = new ConcurrentHashMap<>(16); return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null; diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTrayServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTrayServiceImpl.java index 3758faf26..598343b9b 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTrayServiceImpl.java +++ b/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; /** * 托盘 服务实现类 diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java index 97d1514c4..36265ff63 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java @@ -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 implements IBasicdataTripartiteMallService { + private IBasicdataClientService basicdataClientService; + + private IBasicdataClientLogService basicdataClientLogService; + + @Override public IPage selectBasicdataTripartiteMallPage(IPage page, BasicdataTripartiteMallVO basicdataTripartiteMall) { return page.setRecords(baseMapper.selectBasicdataTripartiteMallPage(page, basicdataTripartiteMall)); @@ -54,7 +74,7 @@ public class BasicdataTripartiteMallServiceImpl extends BaseServiceImpl list = Func.toLongList(ids); + if (list.isEmpty()) { + log.error(method + "参数缺少"); + return R.fail("参数缺少"); } + List basicdataStorageServicesEntities = this.listByIds(list); + if (basicdataStorageServicesEntities.isEmpty()) { + log.error("查询目标删除客户三方信息错误,ids:{}", list); + return R.fail("查询目标删除客户三方信息错误"); + } + List 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(); } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java index 3e5563996..ba5870792 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java +++ b/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("操作失败"); } /** diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java index 796990e5d..b4103e1dd 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java @@ -145,7 +145,7 @@ public interface IDistrilbutionBillLadingService extends BaseService 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 "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 ladingScanEntities = distributionBillLadingScanService.list(Wrappers.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 ladingScanEntities = distributionBillLadingScanService.list(Wrappers.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 list = distrilbutionBillStockService.list(Wrappers.query().lambda() @@ -3677,15 +3691,10 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl>>>>", e); - return false; - } - // 回传工厂数据 sendFactory(myCurrentWarehouse, parcelListIds); - return true; + return R.success("操作成功"); } /**