diff --git a/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicCarModelEntity.java b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicCarModelEntity.java new file mode 100644 index 000000000..2bbf789ca --- /dev/null +++ b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicCarModelEntity.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.basic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +import javax.validation.constraints.Max; +import javax.validation.constraints.Min; +import javax.validation.constraints.Size; + +/** + * 车型基础信息 实体类 + * + * @author lmy + * @since 2023-05-24 + */ +@Data +@TableName("logpm_basic_car_model") +@ApiModel(value = "BasicCarModel对象", description = "车型基础信息") +@EqualsAndHashCode(callSuper = true) +public class BasicCarModelEntity 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; + + @ApiModelProperty(value = "车辆类型") + private String vehicleModel; + + @Min(value = 0, message = "车辆类型车辆核定体积最小为:0") + @Max(value = 64, message = "车辆类型长度最大为:64") + @ApiModelProperty(value = "车长") + private Float vehicleCommander; + + @Min(value = 0, message = "车辆类型外廓高最小为:0") + @Max(value = 64, message = "车辆类型外廓高最大为:64") + @ApiModelProperty(value = "外廓高") + private Float vehicleHeight; + + @Min(value = 0, message = "车辆类型车辆核定体积最小为:0") + @Max(value = 999999, message = "车辆类型车辆核定体积最大为:999999") + @ApiModelProperty(value = "核定体积") + private Float approvedVolume; + + @Min(value = 0, message = "车辆类型车辆总质量最小为:0") + @Max(value = 999999, message = "车辆类型车辆总质量最大为:999999") + @ApiModelProperty(value = "车辆总质量") + private Float vehicleQuality; + + @Min(value = 0, message = "车辆类型车辆整备质量最小为:0") + @Max(value = 999999, message = "车辆类型车辆整备质量最大为:999999") + @ApiModelProperty(value = "整备质量") + private Float curbWeight; + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicCarModelController.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicCarModelController.java new file mode 100644 index 000000000..eb3509acc --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicCarModelController.java @@ -0,0 +1,37 @@ +package com.logpm.basic.controller; + +import com.logpm.basic.dto.BasicCarModelDTO; +import com.logpm.basic.entity.BasicCarModelEntity; +import com.logpm.basic.service.IBasicCarModelService; +import io.swagger.annotations.Api; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +@RestController +@AllArgsConstructor +@RequestMapping("/carModel") +@Api(value = "车型默认数据", tags = "车型默认数据") +@Slf4j +public class BasicCarModelController extends BladeController { + + private IBasicCarModelService basicCarModelService; + + @GetMapping("/list") + public R> getCarModelList(Query query) { + return R.data(basicCarModelService.list()); + } + + @PostMapping("/save") + public R saveCarModel(@Valid @RequestBody @Validated BasicCarModelDTO basicCarModelDTO) { + String res = basicCarModelService.saveCarModel(basicCarModelDTO); + return "".equals(res) ? R.success("保存成功") : R.fail(res); + } +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/dto/BasicCarModelDTO.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/dto/BasicCarModelDTO.java new file mode 100644 index 000000000..93a4531b7 --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/dto/BasicCarModelDTO.java @@ -0,0 +1,13 @@ +package com.logpm.basic.dto; + +import com.logpm.basic.entity.BasicCarModelEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper = true) +public class BasicCarModelDTO extends BasicCarModelEntity { + + private static final long serialVersionUID = 1L; + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicCarModelMapper.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicCarModelMapper.java new file mode 100644 index 000000000..870ec67a5 --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicCarModelMapper.java @@ -0,0 +1,32 @@ +/* + * 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.basic.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.basic.entity.BasicCarModelEntity; + + +/** + * 车辆型号 Mapper 接口 + * + * @author lmy + * @since 2023-05-24 + */ +public interface BasicCarModelMapper extends BaseMapper { + + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/IBasicCarModelService.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/IBasicCarModelService.java new file mode 100644 index 000000000..9d95fa818 --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/IBasicCarModelService.java @@ -0,0 +1,34 @@ +/* + * 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.basic.service; + +import com.logpm.basic.dto.BasicCarModelDTO; +import com.logpm.basic.entity.BasicCarModelEntity; +import org.springblade.core.mp.base.BaseService; + + +/** + * 提货线路中间表 服务类 + * + * @author lmy + * @since 2023-05-25 + */ +public interface IBasicCarModelService extends BaseService { + + + String saveCarModel(BasicCarModelDTO basicCarModelDTO); +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicCarModelServiceImpl.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicCarModelServiceImpl.java new file mode 100644 index 000000000..ad1a67ffb --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicCarModelServiceImpl.java @@ -0,0 +1,85 @@ +/* + * 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.basic.service.impl; + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.basic.dto.BasicCarModelDTO; +import com.logpm.basic.entity.BasicCarModelEntity; +import com.logpm.basic.mapper.BasicCarModelMapper; +import com.logpm.basic.service.IBasicCarModelService; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.system.cache.DictBizCache; +import org.springblade.system.entity.DictBiz; +import org.springframework.stereotype.Service; + +import javax.management.Query; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 车辆型号 服务实现类 + * + * @author lmy + * @since 2023-05-25 + */ +@Service +@Slf4j +public class BasicCarModelServiceImpl extends BaseServiceImpl implements IBasicCarModelService { + + private final String CarTypeDictCode = "basic_vehicle_model"; + + @Override + public String saveCarModel(BasicCarModelDTO basicCarModelDTO) { + try { + if (basicCarModelDTO == null) { + return "数据不能为空"; + } + + if (basicCarModelDTO.getVehicleModel() == null || basicCarModelDTO.getVehicleModel().isEmpty()) { + return "车辆类型不能为空"; + } + + List list = DictBizCache.getList(CarTypeDictCode); + List codes = list.stream().map(DictBiz::getDictKey).collect(Collectors.toList()); + + if (!codes.contains(basicCarModelDTO.getVehicleModel())) { + return "车辆类型不存在"; + } + + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(BasicCarModelEntity::getVehicleModel, basicCarModelDTO.getVehicleModel()); + boolean isUpdate = false; + if (basicCarModelDTO.getId() != null && !basicCarModelDTO.getId().equals(0L)) { + lambdaQueryWrapper.ne(BasicCarModelEntity::getId, basicCarModelDTO.getId()); + isUpdate = true; + } + BasicCarModelEntity have = getOne(lambdaQueryWrapper); + if (have != null) { + return "车辆类型已存在"; + } + + boolean res = isUpdate ? updateById(basicCarModelDTO) : save(basicCarModelDTO); + return res ? "" : "保存失败"; + } catch (Exception e) { + log.error("车辆模型保存》系统异常", e); + return "保存失败"; + } + } +} 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("操作成功"); } /**