diff --git a/ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue b/ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue index fab23b4..0696e4e 100644 --- a/ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue +++ b/ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue @@ -192,7 +192,7 @@ export default { }, { title: '请求地址', - align: "center", + align: "left", dataIndex: 'url' }, { diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java index eca24ce..e711649 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java @@ -28,7 +28,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.alibaba.fastjson.JSONObject; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -492,7 +492,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl sysUserWarehouse.setUserid(user.getId()); sysUserWarehouse.setUsername(user.getUsername()); if (!sysUserWarehouseService.save(sysUserWarehouse)) { - throw new ServiceException("保存失败"); + throw new JeecgBootException("保存失败"); } } } @@ -558,7 +558,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl LambdaQueryWrapper<SysUserWarehouse> sysUserWarehouseLambdaQueryWrapper = Wrappers.lambdaQuery(); sysUserWarehouseLambdaQueryWrapper.eq(SysUserWarehouse::getUserid, user.getId()); if (!sysUserWarehouseService.remove(sysUserWarehouseLambdaQueryWrapper)) { - throw new ServiceException("删除用户和仓库关系失败"); + throw new JeecgBootException("删除用户和仓库关系失败"); } if (StringUtils.isNotEmpty(warehouses)) { String[] strs = warehouses.split(","); @@ -568,7 +568,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl sysUserWarehouse.setWarehousecode(warehouseCode); sysUserWarehouse.setUsername(user.getRealname()); if (!sysUserWarehouseService.save(sysUserWarehouse)) { - throw new ServiceException("保存用户和仓库关系失败"); + throw new JeecgBootException("保存用户和仓库关系失败"); } } } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/acs/service/impl/AcsServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/acs/service/impl/AcsServiceImpl.java index a818bdc..23d3085 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/acs/service/impl/AcsServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/acs/service/impl/AcsServiceImpl.java @@ -3,6 +3,7 @@ package org.jeecg.modules.wms.api.acs.service.impl; import javax.annotation.Resource; import org.jeecg.common.api.vo.Result; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.modules.wms.api.acs.entity.AgvEntity; import org.jeecg.modules.wms.api.acs.service.IAcsService; import org.jeecg.modules.wms.config.address.service.IAddressService; @@ -16,7 +17,6 @@ import org.jeecg.utils.constant.QuantityConstant; import org.springframework.stereotype.Service; import com.alibaba.fastjson.JSON; -import com.aliyun.oss.ServiceException; @Service public class AcsServiceImpl implements IAcsService { @@ -61,7 +61,7 @@ public class AcsServiceImpl implements IAcsService { agvTask.setPreTaskNo(preTaskNo); boolean success = agvTaskService.updateById(agvTask); if (!success) { - throw new ServiceException("更新Agv任务状态失败"); + throw new JeecgBootException("更新Agv任务状态失败"); } AgvEntity agvEntity = new AgvEntity(); agvEntity.setTaskNo(agvTask.getId()); @@ -77,7 +77,7 @@ public class AcsServiceImpl implements IAcsService { System.out.println(jsonParam); String body = OkHttpUtils.sendPostByJsonStr(url, jsonParam); if (StringUtils.isEmpty(body)) { - throw new ServiceException("接口地址错误或返回为空"); + throw new JeecgBootException("接口地址错误或返回为空"); } Result result = JSON.parseObject(body, Result.class); if (result.getCode() != QuantityConstant.HTTP_OK) { @@ -94,7 +94,7 @@ public class AcsServiceImpl implements IAcsService { String jsonParam = JSON.toJSONString(agvEntity); String body = OkHttpUtils.sendPostByJsonStr(url, jsonParam); if (StringUtils.isEmpty(body)) { - throw new ServiceException("接口地址错误或返回为空"); + throw new JeecgBootException("接口地址错误或返回为空"); } Result result = JSON.parseObject(body, Result.class); if (result.getCode() != QuantityConstant.HTTP_OK) { @@ -112,7 +112,7 @@ public class AcsServiceImpl implements IAcsService { String jsonParam = JSON.toJSONString(agvEntity); String body = OkHttpUtils.sendPostByJsonStr(url, jsonParam); if (StringUtils.isEmpty(body)) { - throw new ServiceException("接口地址错误或返回为空"); + throw new JeecgBootException("接口地址错误或返回为空"); } Result result = JSON.parseObject(body, Result.class); if (result.getCode() != QuantityConstant.HTTP_OK) { diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/service/impl/ErpServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/service/impl/ErpServiceImpl.java index 28e14d8..22d4115 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/service/impl/ErpServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/service/impl/ErpServiceImpl.java @@ -38,7 +38,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.alibaba.fastjson.JSON; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -124,7 +124,7 @@ public class ErpServiceImpl implements IErpService { receiptHeader.setRemark(remark); Result result = receiptHeaderService.saveReceiptHeader(receiptHeader); if (!result.isSuccess()) { - throw new ServiceException("创建入库单头失败" + result.getMessage()); + throw new JeecgBootException("创建入库单头失败" + result.getMessage()); } for (ErpReceiptDetail erpReceiptDetail : erpReceiptDetailList) { BigDecimal qty = erpReceiptDetail.getQty(); @@ -137,13 +137,13 @@ public class ErpServiceImpl implements IErpService { String lot = erpReceiptDetail.getLot(); String project = erpReceiptDetail.getProject(); if (StringUtils.isEmpty(materialCode)) { - throw new ServiceException("入库单下发, 物料编码为空"); + throw new JeecgBootException("入库单下发, 物料编码为空"); } if (StringUtils.isEmpty(inventoryStatus)) { inventoryStatus = QuantityConstant.QUALITY_GOOD; } if (qty.compareTo(BigDecimal.ZERO) <= 0) { - throw new ServiceException("入库单下发, 单据数量必须大于0"); + throw new JeecgBootException("入库单下发, 单据数量必须大于0"); } ReceiptDetail receiptDetail = new ReceiptDetail(); receiptDetail.setWarehouseCode(warehouseCode); @@ -164,7 +164,7 @@ public class ErpServiceImpl implements IErpService { material.setEnable(QuantityConstant.STATUS_ENABLE); success = materialService.save(material); if (!success) { - throw new ServiceException("入库单下发, 保存物料失败"); + throw new JeecgBootException("入库单下发, 保存物料失败"); } } receiptDetail.setInventoryStatus(inventoryStatus); @@ -177,12 +177,12 @@ public class ErpServiceImpl implements IErpService { receiptDetail.setProject(project); success = receiptDetailService.save(receiptDetail); if (!success) { - throw new ServiceException("入库单下发, 保存入库单详情失败"); + throw new JeecgBootException("入库单下发, 保存入库单详情失败"); } } success = receiptHeaderService.updateReceiptHeader(receiptHeader.getId()); if (!success) { - throw new ServiceException("入库单下发, 更新入库单失败"); + throw new JeecgBootException("入库单下发, 更新入库单失败"); } return Result.OK("入库单下发成功"); } @@ -261,7 +261,7 @@ public class ErpServiceImpl implements IErpService { shipmentHeader.setRemark(remark); Result result = shipmentHeaderService.saveShipmentHeader(shipmentHeader); if (!result.isSuccess()) { - throw new ServiceException("创建出库单头失败" + result.getMessage()); + throw new JeecgBootException("创建出库单头失败" + result.getMessage()); } for (ErpShipmentDetail erpShipmentDetail : erpShipmentDetailList) { @@ -272,13 +272,13 @@ public class ErpServiceImpl implements IErpService { String lot = erpShipmentDetail.getLot(); String project = erpShipmentDetail.getProject(); if (StringUtils.isEmpty(materialCode)) { - throw new ServiceException("出库单下发, 物料编码为空"); + throw new JeecgBootException("出库单下发, 物料编码为空"); } if (StringUtils.isEmpty(inventoryStatus)) { inventoryStatus = QuantityConstant.QUALITY_GOOD; } if (qty.compareTo(BigDecimal.ZERO) <= 0) { - throw new ServiceException("出库单下发, 单据数量必须大于0"); + throw new JeecgBootException("出库单下发, 单据数量必须大于0"); } ShipmentDetail shipmentDetail = new ShipmentDetail(); shipmentDetail.setWarehouseCode(warehouseCode); @@ -289,7 +289,7 @@ public class ErpServiceImpl implements IErpService { shipmentDetail.setQty(qty); Material material = materialService.getMaterialByCode(materialCode); if (material == null) { - throw new ServiceException("出库单下发, 没有找到物料信息" + materialCode); + throw new JeecgBootException("出库单下发, 没有找到物料信息" + materialCode); } shipmentDetail.setInventoryStatus(inventoryStatus); shipmentDetail.setMaterialCode(materialCode); @@ -301,12 +301,12 @@ public class ErpServiceImpl implements IErpService { shipmentDetail.setProject(project); boolean success = shipmentDetailService.save(shipmentDetail); if (!success) { - throw new ServiceException("出库单下发, 保存入库单详情失败"); + throw new JeecgBootException("出库单下发, 保存入库单详情失败"); } } boolean success = shipmentHeaderService.updateShipmentHeader(shipmentHeader.getId()); if (!success) { - throw new ServiceException("出库单下发, 更新入库单失败"); + throw new JeecgBootException("出库单下发, 更新入库单失败"); } return Result.OK("出库单下发成功"); } @@ -393,7 +393,7 @@ public class ErpServiceImpl implements IErpService { BeanUtils.copyProperties(erpMaterial, material); boolean success = materialService.save(material); if (!success) { - throw new ServiceException("增加物料失败, 保存时报错"); + throw new JeecgBootException("增加物料失败, 保存时报错"); } return Result.ok("增加物料成功"); } @@ -415,7 +415,7 @@ public class ErpServiceImpl implements IErpService { System.out.println(jsonParam); String body = OkHttpUtils.sendPostByJsonStr(url, jsonParam); if (StringUtils.isEmpty(body)) { - throw new ServiceException("接口地址错误或返回为空"); + throw new JeecgBootException("接口地址错误或返回为空"); } Result result = JSON.parseObject(body, Result.class); if (result.getCode() != QuantityConstant.HTTP_OK) { @@ -429,7 +429,7 @@ public class ErpServiceImpl implements IErpService { receiptHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_RETURN); boolean success = receiptHeaderService.updateById(receiptHeader); if (!success) { - throw new ServiceException("回传入库单失败, 更新入库单头失败"); + throw new JeecgBootException("回传入库单失败, 更新入库单头失败"); } receiptHeaderService.delMain(receiptHeader.getId().toString(), QuantityConstant.BACK_DELETE_RECEIPT); return Result.ok("回传入库单成功"); @@ -452,7 +452,7 @@ public class ErpServiceImpl implements IErpService { System.out.println(jsonParam); String body = OkHttpUtils.sendPostByJsonStr(url, jsonParam); if (StringUtils.isEmpty(body)) { - throw new ServiceException("接口地址错误或返回为空"); + throw new JeecgBootException("接口地址错误或返回为空"); } Result result = JSON.parseObject(body, Result.class); if (result.getCode() != QuantityConstant.HTTP_OK) { @@ -462,7 +462,7 @@ public class ErpServiceImpl implements IErpService { shipmentHeader.setLastStatus(QuantityConstant.SHIPMENT_HEADER_RETURN); boolean success = shipmentHeaderService.updateById(shipmentHeader); if (!success) { - throw new ServiceException("回传出库单失败, 更新出库单头失败"); + throw new JeecgBootException("回传出库单失败, 更新出库单头失败"); } return Result.ok("回传出库单成功"); } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mes/servuce/impl/MesServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mes/servuce/impl/MesServiceImpl.java index 8a8eb77..75d8689 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mes/servuce/impl/MesServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mes/servuce/impl/MesServiceImpl.java @@ -42,7 +42,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.alibaba.fastjson.JSON; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.toolkit.IdWorker; /** @@ -136,16 +136,16 @@ public class MesServiceImpl implements IMesService { } Result result = receiveService.receiving(receiveList, warehouseCode); if (!result.isSuccess()) { - throw new ServiceException(result.getMessage()); + throw new JeecgBootException(result.getMessage()); } ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getUnCompleteReceiptContainerByCode(containerCode, warehouseCode); if (receiptContainerHeader == null) { - throw new ServiceException(result.getMessage()); + throw new JeecgBootException(result.getMessage()); } receiptContainerHeader.setToPort(toPort); boolean success = receiptContainerHeaderService.updateById(receiptContainerHeader); if (!success) { - throw new ServiceException("MES下发入库信息,更新入库组盘头失败"); + throw new JeecgBootException("MES下发入库信息,更新入库组盘头失败"); } return receiptContainerHeaderService.createReceiptTask(receiptContainerHeader, warehouseCode); } @@ -194,15 +194,15 @@ public class MesServiceImpl implements IMesService { BigDecimal shipQty = mesShipmentDetail.getShipQty(); Result result = shipmentCombinationService.autoCombinationDetail(shipmentDetail, shipQty); if (!result.isSuccess()) { - throw new ServiceException("MES下发出库信息," + result.getMessage()); + throw new JeecgBootException("MES下发出库信息," + result.getMessage()); } } if (mesShipmentDetailList.size() == 0) { - throw new ServiceException("MES下发出库信息为空"); + throw new JeecgBootException("MES下发出库信息为空"); } List<ShipmentContainerDetail> shipmentContainerDetailList = shipmentContainerDetailService.getShipmentContainerDetailListByShipmentCode(shipmentCode); if (shipmentContainerDetailList == null) { - throw new ServiceException("MES下发出库信息, 没有找到出库配盘详情"); + throw new JeecgBootException("MES下发出库信息, 没有找到出库配盘详情"); } List<Integer> shipmentContainerIdList = shipmentContainerDetailList.stream().map(ShipmentContainerDetail::getShipmentContainerId).distinct().collect(Collectors.toList()); @@ -213,16 +213,16 @@ public class MesServiceImpl implements IMesService { sequence++; ShipmentContainerHeader shipmentContainerHeader = shipmentContainerHeaderService.getById(shipmentContainerId); if (shipmentContainerHeader == null) { - throw new ServiceException("MES下发出库信息,没有找到出库表头:" + shipmentContainerId); + throw new JeecgBootException("MES下发出库信息,没有找到出库表头:" + shipmentContainerId); } shipmentContainerHeader.setToPort(toPort); boolean success = shipmentContainerHeaderService.updateById(shipmentContainerHeader); if (!success) { - throw new ServiceException("MES下发出库信息,更新出库组盘头失败"); + throw new JeecgBootException("MES下发出库信息,更新出库组盘头失败"); } Result result = shipmentCombinationService.createShipmentTask(shipmentContainerHeader, warehouseCode, shipmentOrder, sequence, sequenceNumber); if (!result.isSuccess()) { - throw new ServiceException(result.getMessage()); + throw new JeecgBootException(result.getMessage()); } } return Result.OK("MES下发出库信息成功"); @@ -246,7 +246,7 @@ public class MesServiceImpl implements IMesService { taskHeader.setBackMesTimestamp(backMesTimeStamp); boolean success = taskHeaderService.updateById(taskHeader); if (!success) { - throw new ServiceException("回传入库信息失败,更新任务时间戳失败"); + throw new JeecgBootException("回传入库信息失败,更新任务时间戳失败"); } } @@ -256,7 +256,7 @@ public class MesServiceImpl implements IMesService { int receiptDetailId = taskDetail.getReceiptDetailId(); ReceiptDetail receiptDetail = receiptDetailService.getById(receiptDetailId); if (receiptDetail == null) { - throw new ServiceException("回传入库信息失败,没有找到入库单详情"); + throw new JeecgBootException("回传入库信息失败,没有找到入库单详情"); } String materialCode = receiptDetail.getMaterialCode(); BigDecimal qty = taskDetail.getQty(); @@ -276,16 +276,16 @@ public class MesServiceImpl implements IMesService { System.out.println(jsonParam); String body = OkHttpUtils.sendPostByJsonStr(url, jsonParam); if (StringUtils.isEmpty(body)) { - throw new ServiceException("接口地址错误或返回为空"); + throw new JeecgBootException("接口地址错误或返回为空"); } Result result = JSON.parseObject(body, Result.class); if (result.getCode() != QuantityConstant.HTTP_OK) { - throw new ServiceException(result.getMessage()); + throw new JeecgBootException(result.getMessage()); } taskHeader.setBackMes(QuantityConstant.MES_SEND_OK); boolean success = taskHeaderService.updateById(taskHeader); if (!success) { - throw new ServiceException("回传入库信息失败,更新任务失败"); + throw new JeecgBootException("回传入库信息失败,更新任务失败"); } return Result.ok("回传MES入库信息成功"); } @@ -310,7 +310,7 @@ public class MesServiceImpl implements IMesService { taskHeader.setBackMesTimestamp(backMesTimeStamp); boolean success = taskHeaderService.updateById(taskHeader); if (!success) { - throw new ServiceException("回传出库信息失败,更新任务时间戳失败"); + throw new JeecgBootException("回传出库信息失败,更新任务时间戳失败"); } } @@ -320,7 +320,7 @@ public class MesServiceImpl implements IMesService { int shipmentDetailId = taskDetail.getShipmentDetailId(); ShipmentDetail shipmentDetail = shipmentDetailService.getById(shipmentDetailId); if (shipmentDetail == null) { - throw new ServiceException("回传出库信息失败,没有找到出库单详情"); + throw new JeecgBootException("回传出库信息失败,没有找到出库单详情"); } String materialCode = shipmentDetail.getMaterialCode(); BigDecimal qty = taskDetail.getQty(); @@ -338,18 +338,18 @@ public class MesServiceImpl implements IMesService { taskHeader.setBackMes(QuantityConstant.MES_SEND_OK); boolean success = taskHeaderService.updateById(taskHeader); if (!success) { - throw new ServiceException("回传出库信息失败,更新任务失败"); + throw new JeecgBootException("回传出库信息失败,更新任务失败"); } String url = addressService.getUrlByParam(QuantityConstant.ADDRESS_MES_BACK_SHIPMENT); String jsonParam = JSON.toJSONString(mesBackShipmentList); System.out.println(jsonParam); String body = OkHttpUtils.sendPostByJsonStr(url, jsonParam); if (StringUtils.isEmpty(body)) { - throw new ServiceException("接口地址错误或返回为空"); + throw new JeecgBootException("接口地址错误或返回为空"); } Result result = JSON.parseObject(body, Result.class); if (result.getCode() != QuantityConstant.HTTP_OK) { - throw new ServiceException(result.getMessage()); + throw new JeecgBootException(result.getMessage()); } return Result.ok("回传出库信息成功"); } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/service/impl/MobileService.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/service/impl/MobileService.java index 609e831..dca962d 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/service/impl/MobileService.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/service/impl/MobileService.java @@ -24,7 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import java.util.ArrayList; import java.util.List; @@ -119,7 +119,7 @@ public class MobileService implements IMobileService { // 锁定库位状态 locationService.updateStatus(loc.getCode(), QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); } else { - throw new ServiceException("补充入库主表生成失败!"); + throw new JeecgBootException("补充入库主表生成失败!"); } return Result.OK("呼叫料盒成功", taskHeader); @@ -151,7 +151,7 @@ public class MobileService implements IMobileService { if (rs1.isSuccess()) { receiptHeader = rs1.getResult(); } else { - throw new ServiceException(rs1.getMessage()); + throw new JeecgBootException(rs1.getMessage()); } List<Receive> receiveList = new ArrayList<>(); @@ -159,7 +159,7 @@ public class MobileService implements IMobileService { d.setReceiptId(receiptHeader.getId()); Result rs2 = receiptDetailService.saveReceiptDetail(d); if(!rs2.isSuccess()) { - throw new ServiceException(rs2.getMessage()); + throw new JeecgBootException(rs2.getMessage()); } Receive v = new Receive(); v.setId(d.getId()); @@ -179,7 +179,7 @@ public class MobileService implements IMobileService { if(rs3.isSuccess()) { return rs3; }else{ - throw new ServiceException(rs3.getMessage()); + throw new JeecgBootException(rs3.getMessage()); } } } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/LocationAllocationServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/LocationAllocationServiceImpl.java index 4643de2..daaf64f 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/LocationAllocationServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/LocationAllocationServiceImpl.java @@ -1,6 +1,6 @@ package org.jeecg.modules.wms.api.wcs.service; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import org.jeecg.modules.wms.config.container.entity.Container; @@ -56,15 +56,15 @@ public class LocationAllocationServiceImpl implements LocationAllocationService String containerCode, String materialAreaCode) { Container container = containerService.getContainerByCode(containerCode, warehouseCode); if (container == null) { - throw new ServiceException("分配库位时,容器为空"); + throw new JeecgBootException("分配库位时,容器为空"); } ContainerType containerType = containerTypeService.getContainerTypeByCode(container.getContainerTypeCode(), warehouseCode); if (containerType == null) { - throw new ServiceException("分配库位时,容器类型为空"); + throw new JeecgBootException("分配库位时,容器类型为空"); } String locationType = containerType.getLocationType(); if (StringUtils.isEmpty(locationType)) { - throw new ServiceException("分配库位时,库位类型为空"); + throw new JeecgBootException("分配库位时,库位类型为空"); } List<LocationType> locationTypeList = new ArrayList<>(); String[] list = locationType.split(","); @@ -123,7 +123,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService roadWays.removeAll(removeRoadWays); Collections.shuffle(roadWays); if (roadWays == null || roadWays.size() == 0) { - throw new ServiceException("分配库位时, 巷道为空"); + throw new JeecgBootException("分配库位时, 巷道为空"); } Integer roadWay = roadWays.get(0); // 优先找外侧库位 diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java index e105a86..c2a8aca 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java @@ -42,7 +42,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.alibaba.fastjson.JSON; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -169,12 +169,12 @@ public class WcsServiceImpl implements WcsService { boolean success = locationService.updateStatus(locationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); if (!success) { - throw new ServiceException("分配库位时,更新库位状态失败"); + throw new JeecgBootException("分配库位时,更新库位状态失败"); } if (StringUtils.isNotEmpty(taskHeader.getToLocationCode()) && !locationCode.equals(taskHeader.getToLocationCode())) { success = locationService.updateStatus(taskHeader.getToLocationCode(), QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("分配库位时,更新之前分配的库位状态失败"); + throw new JeecgBootException("分配库位时,更新之前分配的库位状态失败"); } } @@ -196,7 +196,7 @@ public class WcsServiceImpl implements WcsService { ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getById(receiptContainerDetail.getReceiptContainerId()); receiptContainerHeader.setToLocationCode(locationCode); if (!receiptContainerHeaderService.updateById(receiptContainerHeader)) { - throw new ServiceException("分配库位时,更新入库组盘的库位号失败"); + throw new JeecgBootException("分配库位时,更新入库组盘的库位号失败"); } } } @@ -212,11 +212,11 @@ public class WcsServiceImpl implements WcsService { if (StringUtils.isNotEmpty(insideLocation.getContainerCode())) { Location destinationLocation = locationService.getEmptyLocation(insideLocation); if (destinationLocation == null) { - throw new ServiceException("创建移库任务失败, 目标库位为空"); + throw new JeecgBootException("创建移库任务失败, 目标库位为空"); } Result result = taskHeaderService.createTransferTask(insideLocation.getCode(), destinationLocation.getCode(), warehouseCode); if (!result.isSuccess()) { - throw new ServiceException("创建移库任务失败"); + throw new JeecgBootException("创建移库任务失败"); } return Result.ok("移库任务先执行"); } @@ -235,7 +235,7 @@ public class WcsServiceImpl implements WcsService { taskHeader.setWeight(Integer.parseInt(warecellDomain.getWeight())); taskHeader.setToLocationCode(locationCode); if (!taskHeaderService.updateById(taskHeader)) { - throw new ServiceException("更新任务头表目标库位失败"); + throw new JeecgBootException("更新任务头表目标库位失败"); } WcsTask wcsTask = new WcsTask(); @@ -385,12 +385,12 @@ public class WcsServiceImpl implements WcsService { wcsTask.setRemark(QuantityConstant.EMPTY_STRING); Container container = containerService.getContainerByCode(containerCode, warehouseCode); if (container == null) { - throw new ServiceException("下发任务时,容器没有找到"); + throw new JeecgBootException("下发任务时,容器没有找到"); } String value = parameterConfigurationService.getValueByCode(QuantityConstant.RULE_CONNECT_WCS); if (StringUtils.isEmpty(value)) { - throw new ServiceException("下发任务时,没有找到连接WCS的数据配置"); + throw new JeecgBootException("下发任务时,没有找到连接WCS的数据配置"); } int connectWCS = Integer.parseInt(value); if (connectWCS == QuantityConstant.RULE_WCS_CONNECT) { @@ -400,7 +400,7 @@ public class WcsServiceImpl implements WcsService { System.out.println(jsonParam); String body = OkHttpUtils.sendPostByJsonStr(url, jsonParam); if (StringUtils.isEmpty(body)) { - throw new ServiceException("接口地址错误或返回为空"); + throw new JeecgBootException("接口地址错误或返回为空"); } Result result = JSON.parseObject(body, Result.class); if (result.getCode() != QuantityConstant.HTTP_OK) { @@ -440,7 +440,7 @@ public class WcsServiceImpl implements WcsService { wcsTask.setTaskType(1000); break; default: - throw new ServiceException("不支持的任务类型"); + throw new JeecgBootException("不支持的任务类型"); } return wcsTask; @@ -557,13 +557,13 @@ public class WcsServiceImpl implements WcsService { receiptContainerHeader.setToLocationCode(locationCode); boolean success = receiptContainerHeaderService.updateById(receiptContainerHeader); if (!success) { - throw new ServiceException("重入处理失败, 更新入库组盼头失败"); + throw new JeecgBootException("重入处理失败, 更新入库组盼头失败"); } } // 6. 锁定WMS分配的库位 boolean success = locationService.updateStatus(locationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); if (!success) { - throw new ServiceException("重入处理失败, 更新库位状态失败"); + throw new JeecgBootException("重入处理失败, 更新库位状态失败"); } String originLocationCode = taskHeader.getOriginLocationCode(); String taskLocationCode = taskHeader.getToLocationCode(); @@ -582,7 +582,7 @@ public class WcsServiceImpl implements WcsService { // 8. 更新任务信息 success = taskHeaderService.updateById(taskHeader); if (!success) { - throw new ServiceException("重入处理失败, 更新任务信息失败"); + throw new JeecgBootException("重入处理失败, 更新任务信息失败"); } // 9. 封装返回的数据格式,包括任务号和重新分配的库位号 diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/controller/ContainerController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/controller/ContainerController.java index 2f407bd..5a455f8 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/controller/ContainerController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/controller/ContainerController.java @@ -12,7 +12,7 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import org.apache.shiro.authz.annotation.RequiresPermissions; @@ -119,12 +119,12 @@ public class ContainerController extends JeecgController<Container, IContainerSe if (StringUtils.isNotEmpty(locationCode)) { Location location = locationService.getLocationByCode(locationCode, container.getWarehouseCode()); if (location == null) { - throw new ServiceException("编辑的库位号不存在"); + throw new JeecgBootException("编辑的库位号不存在"); } } boolean success = containerService.updateById(container); if (!success) { - throw new ServiceException("编辑失败"); + throw new JeecgBootException("编辑失败"); } return Result.OK("编辑成功!"); } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/impl/ContainerServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/impl/ContainerServiceImpl.java index 8dfc94f..3e38a6c 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/impl/ContainerServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/impl/ContainerServiceImpl.java @@ -17,7 +17,7 @@ import org.jeecg.utils.constant.QuantityConstant; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -102,7 +102,7 @@ public class ContainerServiceImpl extends ServiceImpl<ContainerMapper, Container if (StringUtils.isNotEmpty(locationCode)) { success = havaLocationCodeByContainer(locationCode, warehouseCode); if (success) { - throw new ServiceException("容器表已经存在这个库位号,不能再写入"); + throw new JeecgBootException("容器表已经存在这个库位号,不能再写入"); } } container.setStatus(status); @@ -119,7 +119,7 @@ public class ContainerServiceImpl extends ServiceImpl<ContainerMapper, Container container.setWarehouseCode(warehouseCode); container.setStatus(QuantityConstant.STATUS_CONTAINER_EMPTY); if (!save(container)) { - throw new ServiceException("新增容器失败"); + throw new JeecgBootException("新增容器失败"); } return container; } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java index deccfb2..7b49f12 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java @@ -24,7 +24,7 @@ import org.jeecg.utils.constant.QuantityConstant; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -98,7 +98,7 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i if (StringUtils.isNotEmpty(containerCode)) { success = havaContainerCodeInLocation(containerCode, warehouseCode); if (success) { - throw new ServiceException("库位表已经存在这个容器号,不能再写入"); + throw new JeecgBootException("库位表已经存在这个容器号,不能再写入"); } } location.setContainerCode(containerCode); @@ -330,7 +330,7 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i boolean success = saveBatch(locationList); if (!success) { - throw new ServiceException("批量增加库位失败"); + throw new JeecgBootException("批量增加库位失败"); } return Result.ok("批量增加库位成功"); } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/impl/ReceiptContainerHeaderServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/impl/ReceiptContainerHeaderServiceImpl.java index 2712e12..35da4f7 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/impl/ReceiptContainerHeaderServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/impl/ReceiptContainerHeaderServiceImpl.java @@ -33,7 +33,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.alibaba.fastjson.JSON; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -97,7 +97,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai } @Override - @Transactional(rollbackFor = ServiceException.class) + @Transactional(rollbackFor = JeecgBootException.class) @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'入库任务生成'", extra = "#extraJsonString1", msg = "'任务ID:' + #taskHeader.getId()", condition = "#receiptContainerDetailList.size() > 0", recordReturnValue = true) @OperationLog(bizId = "''", bizType = "'任务追踪'", tag = "'入库任务生成'", extra = "#extraJsonString2", @@ -119,40 +119,40 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai } boolean success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode); if (!success) { - throw new ServiceException("更新容器状态失败"); + throw new JeecgBootException("更新容器状态失败"); } String fromLocationCode = receiptContainerHeader.getFromLocationCode(); String toLocaitonCode = receiptContainerHeader.getToLocationCode(); if (StringUtils.isNotEmpty(fromLocationCode)) { success = locationService.updateStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); if (!success) { - throw new ServiceException("更新起始库位状态失败"); + throw new JeecgBootException("更新起始库位状态失败"); } } String zoneCode = null; if (StringUtils.isNotEmpty(toLocaitonCode)) { success = locationService.updateStatus(toLocaitonCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); if (!success) { - throw new ServiceException("更新目标库位状态失败"); + throw new JeecgBootException("更新目标库位状态失败"); } Location toLocation = locationService.getLocationByCode(toLocaitonCode, warehouseCode); if (!toLocation.getWarehouseCode().equals(warehouseCode)) { - throw new ServiceException("库位对应的仓库不匹配"); + throw new JeecgBootException("库位对应的仓库不匹配"); } zoneCode = toLocation.getZoneCode(); // 旁边库位有任务 if (taskHeaderService.haveUncompleteTaskInNear(toLocation)) { - throw new ServiceException("旁边库位任务数大于0"); + throw new JeecgBootException("旁边库位任务数大于0"); } } int receiptContainerStatus = receiptContainerHeader.getStatus(); if (receiptContainerStatus != QuantityConstant.RECEIPT_CONTAINER_BUILD) { - throw new ServiceException("入库组盘状态不是创建状态"); + throw new JeecgBootException("入库组盘状态不是创建状态"); } receiptContainerHeader.setStatus(QuantityConstant.RECEIPT_CONTAINER_TASK); success = receiptContainerHeaderService.updateById(receiptContainerHeader); if (!success) { - throw new ServiceException("更新入库组盘头状态失败"); + throw new JeecgBootException("更新入库组盘头状态失败"); } TaskHeader taskHeader = new TaskHeader(); taskHeader.setContainerCode(containerCode); @@ -168,7 +168,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai taskHeader.setToPortCode(receiptContainerHeader.getToPort()); success = taskHeaderService.save(taskHeader); if (!success) { - throw new ServiceException("任务生成失败"); + throw new JeecgBootException("任务生成失败"); } int taskHeaderId = taskHeader.getId(); List<TaskDetail> taskDetailList = new ArrayList<>(); @@ -194,29 +194,29 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai taskDetailList.add(taskDetail); ReceiptDetail receiptDetail = receiptDetailService.getById(receiptContainerDetail.getReceiptDetailId()); if (receiptDetail == null) { - throw new ServiceException("根据id:" + receiptContainerDetail.getReceiptDetailId() + ",没有找到入库单详情"); + throw new JeecgBootException("根据id:" + receiptContainerDetail.getReceiptDetailId() + ",没有找到入库单详情"); } receiptDetail.setStatus(QuantityConstant.RECEIPT_HEADER_WAIT_SHELF); receiptDetailList.add(receiptDetail); } success = taskDetailService.saveBatch(taskDetailList); if (!success) { - throw new ServiceException("任务详情生成失败"); + throw new JeecgBootException("任务详情生成失败"); } receiptContainerHeader.setStatus(QuantityConstant.RECEIPT_CONTAINER_TASK); success = this.updateById(receiptContainerHeader); if (!success) { - throw new ServiceException("生成任务时,更新入库组盘头失败"); + throw new JeecgBootException("生成任务时,更新入库组盘头失败"); } success = receiptDetailService.updateBatchById(receiptDetailList); if (!success) { - throw new ServiceException("更新入库单明细失败"); + throw new JeecgBootException("更新入库单明细失败"); } List<Integer> receiptIdList = receiptDetailList.stream().map(ReceiptDetail::getReceiptId).distinct().collect(Collectors.toList()); for (Integer receiptId : receiptIdList) { success = receiptHeaderService.updateReceiptHeaderStatus(receiptId); if (!success) { - throw new ServiceException("更新入库单明细失败"); + throw new JeecgBootException("更新入库单明细失败"); } } LogRecordContext.putVariable("taskHeader", taskHeader);// 操作日志收集 @@ -292,7 +292,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai } @Override - @Transactional(rollbackFor = ServiceException.class) + @Transactional(rollbackFor = JeecgBootException.class) @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'入库任务取消'", extra = "#extraJsonString", msg = "'任务ID:' + #taskHeader.getId()", condition = "#receiptContainerDetailList.size() > 0", recordReturnValue = true) public boolean cancelReceiptTask(TaskHeader taskHeader) { @@ -302,14 +302,14 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai } int receiptContainerStatus = receiptContainerHeader.getStatus(); if (receiptContainerStatus != QuantityConstant.RECEIPT_CONTAINER_TASK) { - throw new ServiceException("取消入库任务时, 任务状态不为生成任务状态"); + throw new JeecgBootException("取消入库任务时, 任务状态不为生成任务状态"); } receiptContainerHeader.setStatus(QuantityConstant.RECEIPT_CONTAINER_BUILD); // 取消任务后,不指定组盘库位 receiptContainerHeader.setToLocationCode(QuantityConstant.EMPTY_STRING); boolean success = receiptContainerHeaderService.updateById(receiptContainerHeader); if (!success) { - throw new ServiceException("取消入库任务时, 更新入库组盘头失败"); + throw new JeecgBootException("取消入库任务时, 更新入库组盘头失败"); } List<ReceiptContainerDetail> receiptContainerDetailList = @@ -318,7 +318,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai for (ReceiptContainerDetail receiptContainerDetail : receiptContainerDetailList) { ReceiptDetail receiptDetail = receiptDetailService.getById(receiptContainerDetail.getReceiptDetailId()); if (receiptDetail == null) { - throw new ServiceException("取消入库任务时, 没有找到入库单详情" + receiptContainerDetail.getReceiptDetailId()); + throw new JeecgBootException("取消入库任务时, 没有找到入库单详情" + receiptContainerDetail.getReceiptDetailId()); } receiptDetail.setStatus(QuantityConstant.RECEIPT_HEADER_RECEIVING); receiptDetailList.add(receiptDetail); @@ -326,14 +326,14 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai if (receiptDetailList.size() != 0) { success = receiptDetailService.updateBatchById(receiptDetailList); if (!success) { - throw new ServiceException("取消入库任务时, 更新入库单详情头失败"); + throw new JeecgBootException("取消入库任务时, 更新入库单详情头失败"); } List<Integer> receiptIdList = receiptDetailList.stream().map(ReceiptDetail::getReceiptId).distinct().collect(Collectors.toList()); for (Integer receiptId : receiptIdList) { success = receiptHeaderService.updateReceiptHeaderStatus(receiptId); if (!success) { - throw new ServiceException("更新入库单明细失败"); + throw new JeecgBootException("更新入库单明细失败"); } } } @@ -343,7 +343,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai } @Override - @Transactional(rollbackFor = ServiceException.class) + @Transactional(rollbackFor = JeecgBootException.class) @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'详情取消组盘'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) public Result cancelReceiving(Integer id) { ReceiptContainerHeader receiptContainerHeader = getById(id); @@ -359,23 +359,23 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai for (ReceiptContainerDetail receiptContainerDetail : receiptContainerDetailList) { ReceiptDetail receiptDetail = receiptDetailService.getById(receiptContainerDetail.getReceiptDetailId()); if (receiptDetail == null) { - throw new ServiceException("取消组盘失败, 没有找到入库组盘详情,入库详情ID:" + receiptContainerDetail.getReceiptDetailId()); + throw new JeecgBootException("取消组盘失败, 没有找到入库组盘详情,入库详情ID:" + receiptContainerDetail.getReceiptDetailId()); } receiptDetail.setStatus(QuantityConstant.RECEIPT_HEADER_BUILD); receiptDetail.setTaskQty(receiptDetail.getTaskQty().subtract(receiptContainerDetail.getQty())); if (!receiptDetailService.updateById(receiptDetail)) { - throw new ServiceException("取消组盘失败, 更新入库明细失败,入库详情ID:" + receiptContainerDetail.getReceiptDetailId()); + throw new JeecgBootException("取消组盘失败, 更新入库明细失败,入库详情ID:" + receiptContainerDetail.getReceiptDetailId()); } if (!receiptContainerDetailService.removeById(receiptContainerDetail.getId())) { - throw new ServiceException("取消组盘失败, 删除入库组盘明细表失败,组盘详情ID:" + receiptContainerDetail.getId()); + throw new JeecgBootException("取消组盘失败, 删除入库组盘明细表失败,组盘详情ID:" + receiptContainerDetail.getId()); } if (!receiptHeaderService.updateReceiptHeaderStatus(receiptDetail.getReceiptId())) { - throw new ServiceException("取消组盘失败, 更新入库单头失败,入库单ID:" + receiptDetail.getReceiptId()); + throw new JeecgBootException("取消组盘失败, 更新入库单头失败,入库单ID:" + receiptDetail.getReceiptId()); } receiptDetailList.add(receiptDetail); } if (!this.removeById(id)) { - throw new ServiceException("取消组盘失败, 删除入库组盘头表失败,组盘ID:" + id); + throw new JeecgBootException("取消组盘失败, 删除入库组盘头表失败,组盘ID:" + id); } LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(receiptContainerDetailList)); return Result.ok("取消组盘成功"); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptDetailServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptDetailServiceImpl.java index 81a4a79..c657dcf 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptDetailServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptDetailServiceImpl.java @@ -21,7 +21,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.alibaba.fastjson.JSON; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import cn.monitor4all.logRecord.annotation.OperationLog; @@ -54,7 +54,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R public boolean save(ReceiptDetail entity) { BigDecimal qty = entity.getQty(); if (qty.compareTo(BigDecimal.ZERO) < 0) { - throw new ServiceException("单据数量不能小于0"); + throw new JeecgBootException("单据数量不能小于0"); } return super.save(entity); } @@ -92,18 +92,18 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R receiptDetail.setStatus(QuantityConstant.RECEIPT_HEADER_BUILD); boolean success = receiptDetailService.save(receiptDetail); if (!success) { - throw new ServiceException("添加失败, 保存入库单详情的时候报错"); + throw new JeecgBootException("添加失败, 保存入库单详情的时候报错"); } success = receiptHeaderService.updateReceiptHeader(receiptDetail.getReceiptId()); if (!success) { - throw new ServiceException("添加失败, 保存入库单详失败"); + throw new JeecgBootException("添加失败, 保存入库单详失败"); } LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(receiptDetail)));// 操作日志收集 return Result.OK("添加成功!"); } @Override - @Transactional(rollbackFor = ServiceException.class) + @Transactional(rollbackFor = JeecgBootException.class) @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'详情删除'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) public Result removeDetailById(String id) { ReceiptDetail receiptDetail = receiptDetailService.getById(id); @@ -123,18 +123,18 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R } boolean success = receiptDetailService.removeById(id); if (!success) { - throw new ServiceException("删除详情失败"); + throw new JeecgBootException("删除详情失败"); } success = receiptHeaderService.updateReceiptHeader(receiptDetail.getReceiptId()); if (!success) { - throw new ServiceException("更新入库单头数量失败"); + throw new JeecgBootException("更新入库单头数量失败"); } LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(receiptDetail)));// 操作日志收集 return Result.OK("删除成功!"); } @Override - @Transactional(rollbackFor = ServiceException.class) + @Transactional(rollbackFor = JeecgBootException.class) public Result removeDetailListById(List<String> idList) { Result result = null; for (String id : idList) { diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptHeaderServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptHeaderServiceImpl.java index b147d7c..3e02da6 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptHeaderServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptHeaderServiceImpl.java @@ -25,7 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -67,7 +67,7 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R public boolean delMain(String id, String reason) { ReceiptHeader receiptHeader = getById(id); if (receiptHeader.getFirstStatus().intValue() > QuantityConstant.RECEIPT_HEADER_BUILD) { - throw new ServiceException("不能删除非新建状态单据"); + throw new JeecgBootException("不能删除非新建状态单据"); } receiptHeaderHistoryService.saveById(id, reason); receiptDetailMapper.deleteByMainId(id); @@ -97,7 +97,7 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R } String code = createCode(receiptHeader.getType()); if (StringUtils.isEmpty(code)) { - throw new ServiceException("根据入库单据类型" + receiptHeader.getType() + "生成单号失败"); + throw new JeecgBootException("根据入库单据类型" + receiptHeader.getType() + "生成单号失败"); } receiptHeader.setCode(code); receiptHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_BUILD); @@ -176,7 +176,7 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R receiptHeader.setFirstStatus(maxStatus); receiptHeader.setLastStatus(minStatus); if (!receiptHeaderService.updateById(receiptHeader)) { - throw new ServiceException("更新入库单:" + receiptHeader.getCode() + " 头状态失败"); + throw new JeecgBootException("更新入库单:" + receiptHeader.getCode() + " 头状态失败"); } LogRecordContext.putVariable("minStatus", minStatus); LogRecordContext.putVariable("receiptHeader", receiptHeader); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeaderHistory/service/impl/ReceiptHeaderHistoryServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeaderHistory/service/impl/ReceiptHeaderHistoryServiceImpl.java index cca4790..533f51b 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeaderHistory/service/impl/ReceiptHeaderHistoryServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeaderHistory/service/impl/ReceiptHeaderHistoryServiceImpl.java @@ -4,7 +4,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader; @@ -110,7 +110,7 @@ public class ReceiptHeaderHistoryServiceImpl extends ServiceImpl<ReceiptHeaderHi receiptDetailHistoryList.add(receiptDetailHistory); } if (!receiptDetailHistoryService.saveBatch(receiptDetailHistoryList)) { - throw new ServiceException("批量新增失败"); + throw new JeecgBootException("批量新增失败"); } } } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java index ec7bf45..d5a8fb8 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java @@ -32,7 +32,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.alibaba.fastjson.JSON; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -70,7 +70,7 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl * @return */ @Override - @Transactional(rollbackFor = ServiceException.class) + @Transactional(rollbackFor = JeecgBootException.class) public Result<TaskHeader> receivingAndCreateTask(List<Receive> receiveList, String warehouseCode) { Result<ReceiptContainerHeader> result = receiving(receiveList, warehouseCode); if (result.isSuccess()) { @@ -90,7 +90,7 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl * 7.更新入库单状态 */ @Override - @Transactional(rollbackFor = ServiceException.class) + @Transactional(rollbackFor = JeecgBootException.class) @OperationLog(bizId = "''", bizType = "'物料追踪'", tag = "'入库组盘'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'详情组盘'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) public Result<ReceiptContainerHeader> receiving(List<Receive> receiveList, String warehouseCode) { @@ -134,7 +134,7 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getUnCompleteReceiptContainerByCode(containerCode, warehouseCode); if (receiptContainerHeader != null) { if (receiptContainerHeader.getStatus() >= QuantityConstant.RECEIPT_CONTAINER_TASK) { - throw new ServiceException("容器已经生成任务,不能放物料了!"); + throw new JeecgBootException("容器已经生成任务,不能放物料了!"); } } else { receiptContainerHeader = new ReceiptContainerHeader(); @@ -153,7 +153,7 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl } result = receiptContainerHeaderService.save(receiptContainerHeader); if (!result) { - throw new ServiceException("保存入库组盘头失败"); + throw new JeecgBootException("保存入库组盘头失败"); } } @@ -165,38 +165,38 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl // 收货数量 BigDecimal taskQty = receive.getTaskQty(); if (qty == null || taskQty == null) { - throw new ServiceException("收货数量或可收数量为空"); + throw new JeecgBootException("收货数量或可收数量为空"); } if (taskQty.compareTo(qty) > 0) { - throw new ServiceException("收货数量不能大于可收数量,收货数量:" + taskQty + "可收数量:" + qty); + throw new JeecgBootException("收货数量不能大于可收数量,收货数量:" + taskQty + "可收数量:" + qty); } if (taskQty.compareTo(BigDecimal.ZERO) <= 0) { continue; } ReceiptDetail receiptDetail = receiptDetailService.getById(receive.getId()); if (receiptDetail == null) { - throw new ServiceException("没有找到入库单详情,id:" + receive.getId()); + throw new JeecgBootException("没有找到入库单详情,id:" + receive.getId()); } ReceiptHeader receiptHeader = receiptHeaderService.getById(receiptDetail.getReceiptId()); if (receiptHeader == null) { - throw new ServiceException("没有找到入库单,id:" + receiptDetail.getReceiptId()); + throw new JeecgBootException("没有找到入库单,id:" + receiptDetail.getReceiptId()); } if (!receiptHeader.getWarehouseCode().equals(warehouseCode)) { - throw new ServiceException("仓库编码不一致,不能操作"); + throw new JeecgBootException("仓库编码不一致,不能操作"); } String materialCode = receiptDetail.getMaterialCode(); if (StringUtils.isEmpty(materialCode)) { - throw new ServiceException("物料编码为空"); + throw new JeecgBootException("物料编码为空"); } Material material = materialService.getMaterialByCode(materialCode); if (material == null) { - throw new ServiceException(materialCode + "物料不存在"); + throw new JeecgBootException(materialCode + "物料不存在"); } BigDecimal receiptQty = receiptDetail.getQty(); BigDecimal receiptTaskQty = receiptDetail.getTaskQty(); receiptTaskQty = receiptTaskQty.add(taskQty); if (receiptTaskQty.compareTo(receiptQty) > 0) { - throw new ServiceException("收货数量必须小于单据数量"); + throw new JeecgBootException("收货数量必须小于单据数量"); } receiptDetail.setTaskQty(receiptTaskQty); receiptDetailList.add(receiptDetail); @@ -236,13 +236,13 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl result = receiptDetailService.updateBatchById(receiptDetailList); if (!result) { - throw new ServiceException("批量更新入库单详情失败"); + throw new JeecgBootException("批量更新入库单详情失败"); } if (receiptContainerDetailList.size() > 0) { result = receiptContainerDetailService.saveBatch(receiptContainerDetailList); if (!result) { - throw new ServiceException("保存入库组盘详情失败"); + throw new JeecgBootException("保存入库组盘详情失败"); } } LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(receiptContainerDetailList)); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java index a7441b2..23cec79 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java @@ -40,7 +40,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.alibaba.fastjson.JSON; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -95,16 +95,16 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi String materialCode = shipmentDetail.getMaterialCode(); String inventoryStatus = shipmentDetail.getInventoryStatus(); if (StringUtils.isEmpty(warehouseCode)) { - throw new ServiceException("寻找库存详情时,出库详情没有仓库编码"); + throw new JeecgBootException("寻找库存详情时,出库详情没有仓库编码"); } if (StringUtils.isEmpty(companyCode)) { - throw new ServiceException("寻找库存详情时,出库详情没有货主编码"); + throw new JeecgBootException("寻找库存详情时,出库详情没有货主编码"); } if (StringUtils.isEmpty(materialCode)) { - throw new ServiceException("寻找库存详情时, 出库详情没有物料编码"); + throw new JeecgBootException("寻找库存详情时, 出库详情没有物料编码"); } if (StringUtils.isEmpty(inventoryStatus)) { - throw new ServiceException("寻找库存详情时, 出库详情没有物料品质"); + throw new JeecgBootException("寻找库存详情时, 出库详情没有物料品质"); } LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getWarehouseCode, warehouseCode).eq(InventoryDetail::getCompanyCode, companyCode) @@ -114,13 +114,13 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi } @Override - @Transactional(rollbackFor = ServiceException.class) + @Transactional(rollbackFor = JeecgBootException.class) public Result autoCombination(String shipmentCode, String warehouseCode) { LambdaQueryWrapper<ShipmentHeader> shipmentHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); shipmentHeaderLambdaQueryWrapper.eq(ShipmentHeader::getWarehouseCode, warehouseCode).eq(ShipmentHeader::getCode, shipmentCode); ShipmentHeader shipmentHeader = shipmentHeaderService.getOne(shipmentHeaderLambdaQueryWrapper); if (shipmentHeader == null) { - throw new ServiceException("系统没有此单据"); + throw new JeecgBootException("系统没有此单据"); } if (shipmentHeader.getLastStatus() >= QuantityConstant.SHIPMENT_HEADER_COMPLETED) { return Result.OK("出库单已经作业完毕"); @@ -135,7 +135,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi } Result result = shipmentCombinationService.autoCombinationDetail(shipmentDetail, null); if (!result.isSuccess()) { - throw new ServiceException(result.getMessage()); + throw new JeecgBootException(result.getMessage()); } } if (over) { @@ -145,7 +145,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi } @Override - @Transactional(rollbackFor = ServiceException.class) + @Transactional(rollbackFor = JeecgBootException.class) public Result autoCombinationDetail(ShipmentDetail shipmentDetail, BigDecimal shipQty) { // 出库数量 BigDecimal shipmentQty = shipmentDetail.getQty().subtract(shipmentDetail.getTaskQty()); @@ -196,7 +196,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi break; } if (shipmentQty.compareTo(BigDecimal.ZERO) < 0) { - throw new ServiceException("配盘时,出库数量不能小于0"); + throw new JeecgBootException("配盘时,出库数量不能小于0"); } CombinationModel combinationModel = new CombinationModel(); combinationModel.setShipmentDetail(shipmentDetail); @@ -211,14 +211,14 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi } Result result = shipmentCombinationService.combination(combinationModel); if (!result.isSuccess()) { - throw new ServiceException(result.getMessage()); + throw new JeecgBootException(result.getMessage()); } } return Result.OK("自动组盘成功", null); } @Override - @Transactional(rollbackFor = ServiceException.class) + @Transactional(rollbackFor = JeecgBootException.class) @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'详情配盘'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) public Result combination(CombinationModel combinationModel) { BigDecimal shipmentQty = combinationModel.getShipQty(); @@ -280,7 +280,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi inventoryDetail.setTaskQty(inventoryDetailTaskQty); success = inventoryDetailService.updateById(inventoryDetail); if (!success) { - throw new ServiceException("配盘时, 更新库存详情失败"); + throw new JeecgBootException("配盘时, 更新库存详情失败"); } shipmentDetailTaskQty = shipmentDetailTaskQty.add(shipmentQty); if (shipmentDetailTaskQty.compareTo(BigDecimal.ZERO) <= 0) { @@ -296,25 +296,25 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi shipmentDetail.setTaskQty(shipmentDetailTaskQty); success = shipmentDetailService.updateById(shipmentDetail); if (!success) { - throw new ServiceException("配盘时, 更新出库详情失败"); + throw new JeecgBootException("配盘时, 更新出库详情失败"); } ShipmentContainerHeader shipmentContainerHeader = addShipmentContainerHeader(inventoryDetail, shipmentDetail); if (shipmentContainerHeader == null) { - throw new ServiceException("配盘时, 新增出库组盘头失败"); + throw new JeecgBootException("配盘时, 新增出库组盘头失败"); } ShipmentContainerDetail shipmentContainerDetail = addShipmentContainerDetail(shipmentContainerHeader, combinationModel); if (shipmentContainerDetail == null) { - throw new ServiceException("配盘时, 新增出库组盘详情失败"); + throw new JeecgBootException("配盘时, 新增出库组盘详情失败"); } success = shipmentHeaderService.updateShipmentHeaderStatus(shipmentDetail.getShipmentId()); if (!success) { - throw new ServiceException("配盘时, 更新出库单失败"); + throw new JeecgBootException("配盘时, 更新出库单失败"); } LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(shipmentContainerDetail))); return Result.ok("配盘成功"); } - @Transactional(rollbackFor = ServiceException.class) + @Transactional(rollbackFor = JeecgBootException.class) public ShipmentContainerHeader addShipmentContainerHeader(InventoryDetail inventoryDetail, ShipmentDetail shipmentDetail) { String containerCode = inventoryDetail.getContainerCode(); String warehouseCode = inventoryDetail.getWarehouseCode(); @@ -349,13 +349,13 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi shipmentContainerHeader.setTaskType(taskType); boolean success = shipmentContainerHeaderService.save(shipmentContainerHeader); if (!success) { - throw new ServiceException("新增出库组盘头失败"); + throw new JeecgBootException("新增出库组盘头失败"); } return shipmentContainerHeader; } } - @Transactional(rollbackFor = ServiceException.class) + @Transactional(rollbackFor = JeecgBootException.class) public ShipmentContainerDetail addShipmentContainerDetail(ShipmentContainerHeader shipmentContainerHeader, CombinationModel combinationModel) { boolean success = false; BigDecimal shipmentQty = combinationModel.getShipQty(); @@ -374,12 +374,12 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi shipmentContainerDetail.setQty(shipmentContainerDetail.getQty().add(combinationModel.getShipQty())); success = shipmentContainerDetailService.updateById(shipmentContainerDetail); if (!success) { - throw new ServiceException("更新出库组盘详情失败"); + throw new JeecgBootException("更新出库组盘详情失败"); } } else { Material material = materialService.getMaterialByCode(materialCode); if (material == null) { - throw new ServiceException("出库单(" + shipmentDetail.getShipmentCode() + ")的物料(" + materialCode + ")不存在!"); + throw new JeecgBootException("出库单(" + shipmentDetail.getShipmentCode() + ")的物料(" + materialCode + ")不存在!"); } shipmentContainerDetail = new ShipmentContainerDetail(); shipmentContainerDetail.setWarehouseCode(shipmentContainerHeader.getWarehouseCode()); @@ -403,14 +403,14 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi shipmentContainerDetail.setProject(shipmentDetail.getProject()); success = shipmentContainerDetailService.save(shipmentContainerDetail); if (!success) { - throw new ServiceException("新建组盘明细失败,sql错误"); + throw new JeecgBootException("新建组盘明细失败,sql错误"); } } return shipmentContainerDetail; } @Override - @Transactional(rollbackFor = ServiceException.class) + @Transactional(rollbackFor = JeecgBootException.class) @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'出库任务生成'", extra = "#extraJsonString", msg = "'任务ID:' + #taskHeaderId + ',库位编码:' + #shipmentContainerHeader.getFromLocationCode() + ',容器编码:' + #shipmentContainerHeader.getContainerCode() + ',目标出入口:' + #shipmentContainerHeader.getToPort()", condition = "#shipmentContainerDetailList.size() > 0", recordReturnValue = true) @@ -460,11 +460,11 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi container.setStatus(QuantityConstant.STATUS_CONTAINER_LOCK); boolean success = containerService.updateById(container); if (!success) { - throw new ServiceException("生成出库任务时, 更新容器失败" + containerCode); + throw new JeecgBootException("生成出库任务时, 更新容器失败" + containerCode); } success = locationService.updateStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); if (!success) { - throw new ServiceException("生成出库任务时, 更新库位失败" + fromLocationCode); + throw new JeecgBootException("生成出库任务时, 更新库位失败" + fromLocationCode); } List<InventoryDetail> inventoryDetailList = inventoryDetailService.getInventoryDetailListByContainerCode(containerCode, warehouseCode); BigDecimal inventoryTotal = BigDecimal.ZERO; @@ -515,7 +515,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi taskHeader.setShipmentContainerHeaderId(shipmentContainerHeader.getId()); success = taskHeaderService.save(taskHeader); if (!success) { - throw new ServiceException("生成出库任务时, 创建任务失败"); + throw new JeecgBootException("生成出库任务时, 创建任务失败"); } int taskHeaderId = taskHeader.getId(); List<TaskDetail> taskDetailList = new ArrayList<>(); @@ -542,19 +542,19 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi } success = taskDetailService.saveBatch(taskDetailList); if (!success) { - throw new ServiceException("生成出库任务时, 创建任务详情失败"); + throw new JeecgBootException("生成出库任务时, 创建任务详情失败"); } shipmentContainerHeader.setStatus(QuantityConstant.SHIPMENT_CONTAINER_TASK); success = shipmentContainerHeaderService.updateById(shipmentContainerHeader); if (!success) { - throw new ServiceException("生成出库任务时, 更新出库组盘头失败"); + throw new JeecgBootException("生成出库任务时, 更新出库组盘头失败"); } InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode); if (inventoryHeader != null) { inventoryHeader.setContainerStatus(container.getStatus()); success = inventoryHeaderService.updateById(inventoryHeader); if (!success) { - throw new ServiceException("生成出库任务时, 更新库存头失败"); + throw new JeecgBootException("生成出库任务时, 更新库存头失败"); } } LogRecordContext.putVariable("taskHeaderId", taskHeaderId);// 操作日志收集 @@ -602,7 +602,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi if (removeInventoryList.size() > 0) { boolean success = inventoryDetailList.removeAll(removeInventoryList); if (!success) { - throw new ServiceException("移除库存失败"); + throw new JeecgBootException("移除库存失败"); } } return Result.ok(inventoryDetailList); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/service/impl/ShipmentContainerHeaderServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/service/impl/ShipmentContainerHeaderServiceImpl.java index c63c45b..4414471 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/service/impl/ShipmentContainerHeaderServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/service/impl/ShipmentContainerHeaderServiceImpl.java @@ -28,7 +28,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.alibaba.fastjson.JSON; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -140,12 +140,12 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont } int shipmentContainerStatus = shipmentContainerHeader.getStatus(); if (shipmentContainerStatus != QuantityConstant.SHIPMENT_CONTAINER_TASK) { - throw new ServiceException("取消出库任务时, 任务状态不为生成任务状态"); + throw new JeecgBootException("取消出库任务时, 任务状态不为生成任务状态"); } shipmentContainerHeader.setStatus(QuantityConstant.SHIPMENT_CONTAINER_BUILD); boolean success = updateById(shipmentContainerHeader); if (!success) { - throw new ServiceException("取消入库任务时, 更新入库组盘头失败"); + throw new JeecgBootException("取消入库任务时, 更新入库组盘头失败"); } List<ShipmentContainerDetail> shipmentContainerDetailList = @@ -154,7 +154,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont for (ShipmentContainerDetail shipmentContainerDetail : shipmentContainerDetailList) { ShipmentDetail shipmentDetail = shipmentDetailService.getById(shipmentContainerDetail.getShipmentDetailId()); if (shipmentDetail == null) { - throw new ServiceException("取消出库任务时, 没有找到出库单详情" + shipmentContainerDetail.getShipmentDetailId()); + throw new JeecgBootException("取消出库任务时, 没有找到出库单详情" + shipmentContainerDetail.getShipmentDetailId()); } shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_GROUPDISK); shipmentDetailList.add(shipmentDetail); @@ -162,13 +162,13 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont if (shipmentDetailList.size() != 0) { success = shipmentDetailService.updateBatchById(shipmentDetailList); if (!success) { - throw new ServiceException("取消出库任务时, 更新出库单详情头失败"); + throw new JeecgBootException("取消出库任务时, 更新出库单详情头失败"); } List<Integer> shipmentIdList = shipmentDetailList.stream().map(ShipmentDetail::getShipmentId).distinct().collect(Collectors.toList()); for (Integer shipmentId : shipmentIdList) { success = shipmentHeaderService.updateShipmentHeaderStatus(shipmentId); if (!success) { - throw new ServiceException("取消出库任务时, 更新出库单明细失败"); + throw new JeecgBootException("取消出库任务时, 更新出库单明细失败"); } } } @@ -179,7 +179,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont } @Override - @Transactional(rollbackFor = ServiceException.class) + @Transactional(rollbackFor = JeecgBootException.class) @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'详情取消配盘'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) public Result cancelCombine(Integer id) { ShipmentContainerHeader shipmentContainerHeader = this.getById(id); @@ -195,28 +195,28 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont for (ShipmentContainerDetail shipmentContainerDetail : shipmentContainerDetailList) { ShipmentDetail shipmentDetail = shipmentDetailService.getById(shipmentContainerDetail.getShipmentDetailId()); if (shipmentDetail == null) { - throw new ServiceException("取消出库配盘失败, 没有找到出库单,出库详情ID:" + shipmentContainerDetail.getShipmentDetailId()); + throw new JeecgBootException("取消出库配盘失败, 没有找到出库单,出库详情ID:" + shipmentContainerDetail.getShipmentDetailId()); } shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_BUILD); shipmentDetail.setTaskQty(shipmentDetail.getTaskQty().subtract(shipmentContainerDetail.getQty())); if (!shipmentDetailService.updateById(shipmentDetail)) { - throw new ServiceException("取消出库配盘失败, 更新出库明细失败,出库详情ID:" + shipmentContainerDetail.getShipmentDetailId()); + throw new JeecgBootException("取消出库配盘失败, 更新出库明细失败,出库详情ID:" + shipmentContainerDetail.getShipmentDetailId()); } if (!shipmentContainerDetailService.removeById(shipmentContainerDetail.getId())) { - throw new ServiceException("取消出库配盘失败, 删除出库组盘明细表失败,配盘详情ID:" + shipmentContainerDetail.getId()); + throw new JeecgBootException("取消出库配盘失败, 删除出库组盘明细表失败,配盘详情ID:" + shipmentContainerDetail.getId()); } if (!shipmentHeaderService.updateShipmentHeaderStatus(shipmentDetail.getShipmentId())) { - throw new ServiceException("取消出库配盘失败, 更新出库单头失败,出库单ID:" + shipmentDetail.getShipmentId()); + throw new JeecgBootException("取消出库配盘失败, 更新出库单头失败,出库单ID:" + shipmentDetail.getShipmentId()); } InventoryDetail inventoryDetail = inventoryDetailService.getById(shipmentContainerDetail.getInventoryDetailId()); inventoryDetail.setTaskQty(inventoryDetail.getTaskQty().subtract(shipmentContainerDetail.getQty())); if (!inventoryDetailService.updateById(inventoryDetail)) { - throw new ServiceException("取消出库配盘失败, 解锁库存详情失败,库存详情ID:" + inventoryDetail.getId()); + throw new JeecgBootException("取消出库配盘失败, 解锁库存详情失败,库存详情ID:" + inventoryDetail.getId()); } shipmentDetailList.add(shipmentDetail); } if (!this.removeById(id)) { - throw new ServiceException("取消出库配盘失败, 删除出库组盘头表失败,配盘ID:" + id); + throw new JeecgBootException("取消出库配盘失败, 删除出库组盘头表失败,配盘ID:" + id); } LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(shipmentContainerDetailList)); return Result.ok("取消配盘成功"); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/controller/ShipmentHeaderController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/controller/ShipmentHeaderController.java index 3fcd2cd..73edcbd 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/controller/ShipmentHeaderController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/controller/ShipmentHeaderController.java @@ -46,7 +46,7 @@ import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.servlet.ModelAndView; import com.alibaba.fastjson.JSON; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -259,11 +259,11 @@ public class ShipmentHeaderController extends JeecgController<ShipmentHeader, IS } boolean success = shipmentDetailService.removeById(id); if (!success) { - throw new ServiceException("删除详情失败"); + throw new JeecgBootException("删除详情失败"); } success = shipmentHeaderService.updateShipmentHeader(shipmentDetail.getShipmentId()); if (!success) { - throw new ServiceException("更新出库单头数量失败"); + throw new JeecgBootException("更新出库单头数量失败"); } LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(shipmentDetail)));// 操作日志收集 return Result.OK("删除成功!"); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentDetailServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentDetailServiceImpl.java index 86c9d6b..2a2826c 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentDetailServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentDetailServiceImpl.java @@ -1,7 +1,7 @@ package org.jeecg.modules.wms.shipment.shipmentHeader.service.impl; import com.alibaba.fastjson.JSON; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import org.jeecg.common.api.vo.Result; @@ -86,11 +86,11 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, shipmentDetail.setStatus(QuantityConstant.RECEIPT_HEADER_BUILD); boolean success = shipmentDetailService.save(shipmentDetail); if (!success) { - throw new ServiceException("添加失败, 保存出库单详情的时候报错"); + throw new JeecgBootException("添加失败, 保存出库单详情的时候报错"); } success = shipmentHeaderService.updateShipmentHeader(shipmentHeader.getId()); if (!success) { - throw new ServiceException("添加失败, 更新出库单失败"); + throw new JeecgBootException("添加失败, 更新出库单失败"); } LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(shipmentDetail)));// 操作日志收集 return Result.OK("添加成功!"); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java index 346f23a..7dcceab 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java @@ -1,6 +1,6 @@ package org.jeecg.modules.wms.shipment.shipmentHeader.service.impl; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import org.jeecg.common.api.vo.Result; @@ -86,7 +86,7 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, public boolean delMain(String id) { ShipmentHeader shipmentHeader = getById(id); if (shipmentHeader.getFirstStatus().intValue() > QuantityConstant.RECEIPT_HEADER_BUILD) { - throw new ServiceException("不能删除非新建状态单据"); + throw new JeecgBootException("不能删除非新建状态单据"); } boolean success = shipmentDetailMapper.deleteByMainId(id); if (!success) { @@ -102,7 +102,7 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, for (Serializable id : idList) { ShipmentHeader shipmentHeader = getById(id); if (shipmentHeader.getFirstStatus().intValue() > QuantityConstant.RECEIPT_HEADER_BUILD) { - throw new ServiceException("不能删除非新建状态单据"); + throw new JeecgBootException("不能删除非新建状态单据"); } shipmentDetailMapper.deleteByMainId(id.toString()); shipmentHeaderMapper.deleteById(id); @@ -122,7 +122,7 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, } String code = createCode(shipmentHeader.getType()); if (StringUtils.isEmpty(code)) { - throw new ServiceException("根据出库单类型" + shipmentHeader.getType() + "生成单号失败"); + throw new JeecgBootException("根据出库单类型" + shipmentHeader.getType() + "生成单号失败"); } shipmentHeader.setCode(code); shipmentHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_BUILD); @@ -194,7 +194,7 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, shipmentHeader.setFirstStatus(maxStatus); shipmentHeader.setLastStatus(minStatus); if (!shipmentHeaderService.updateById(shipmentHeader)) { - throw new ServiceException("更新出库单:" + shipmentHeader.getCode() + " 头状态失败"); + throw new JeecgBootException("更新出库单:" + shipmentHeader.getCode() + " 头状态失败"); } LogRecordContext.putVariable("minStatus", minStatus); LogRecordContext.putVariable("shipmentHeader", shipmentHeader); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeaderHistory/service/impl/ShipmentHeaderHistoryServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeaderHistory/service/impl/ShipmentHeaderHistoryServiceImpl.java index 0cc1a6a..ce02bb5 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeaderHistory/service/impl/ShipmentHeaderHistoryServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeaderHistory/service/impl/ShipmentHeaderHistoryServiceImpl.java @@ -3,7 +3,7 @@ package org.jeecg.modules.wms.shipment.shipmentHeaderHistory.service.impl; import java.math.BigDecimal; import java.util.Date; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader; @@ -106,7 +106,7 @@ public class ShipmentHeaderHistoryServiceImpl extends ServiceImpl<ShipmentHeader List<ShipmentDetailHistory> newList = shipmentDetailHistoryList.stream().peek(detail -> detail.setShipmentId(shipmentHeaderHistory.getId())).collect(Collectors.toList()); if (!shipmentDetailHistoryService.saveBatch(newList)) { - throw new ServiceException("批量新增失败"); + throw new JeecgBootException("批量新增失败"); } } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailChildServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailChildServiceImpl.java index 73d0a62..d940104 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailChildServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailChildServiceImpl.java @@ -123,7 +123,7 @@ public class CycleCountDetailChildServiceImpl extends ServiceImpl<CycleCountDeta cycleCountHeader.setStatusCyc(QuantityConstant.CYCLECOUNT_STATUS_REGISTERED); cycleCountHeader.setStocktakingAc(sysUser.getUsername()); - Result result = new Result(); + Result<Integer> result = new Result<Integer>(); result.setCode(200); result.setMessage("调整成功"); result.setResult(cycleCountHeader.getId()); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java index 37b75c4..104e87e 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java @@ -34,7 +34,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -257,7 +257,7 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap locationService.updateStatus(location.getContainerCode(), QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); cycleCountDetail.setTaskHeaderId(task.getId()); // 盘点明细修改状态task数据源 } else { - throw new ServiceException("盘点任务主表生成失败!"); + throw new JeecgBootException("盘点任务主表生成失败!"); } // 写入任务细表 @@ -280,7 +280,7 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap // taskDetail.setProjectNo(cycleCountDetail.getProjectNo()); taskDetail.setCompanyCode(cycleCountDetail.getCompanyCode()); if (taskDetailService.save(taskDetail) == false) { - throw new ServiceException("盘点任务明细生成失败!"); + throw new JeecgBootException("盘点任务明细生成失败!"); } // 修改子单状态 item.setChildStatus(QuantityConstant.CYCLECOUNT_STATUS_BUILDTASK); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountHeader/service/impl/CycleCountHeaderServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountHeader/service/impl/CycleCountHeaderServiceImpl.java index b0388ec..24c8328 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountHeader/service/impl/CycleCountHeaderServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountHeader/service/impl/CycleCountHeaderServiceImpl.java @@ -1,6 +1,6 @@ package org.jeecg.modules.wms.stocktaking.cycleCountHeader.service.impl; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import org.jeecg.common.api.vo.Result; @@ -44,7 +44,7 @@ public class CycleCountHeaderServiceImpl extends ServiceImpl<CycleCountHeaderMap public Result<CycleCountHeader> saveCycleCountHeader(CycleCountHeader cycleCountHeader) { String code = createCode(QuantityConstant.SHIPMENT_BILL_TYPE_PD); if (StringUtils.isEmpty(code)) { - throw new ServiceException("根据单据类型,生成单号失败"); + throw new JeecgBootException("根据单据类型,生成单号失败"); } cycleCountHeader.setCode(code); cycleCountHeader.setStocktakingAc("-"); @@ -67,7 +67,7 @@ public class CycleCountHeaderServiceImpl extends ServiceImpl<CycleCountHeaderMap LambdaQueryWrapper<CycleCountHeader> lamb = Wrappers.lambdaQuery(cyclecountHeader); cyclecountHeader = this.getOne(lamb); if(StringUtils.isNull(cyclecountHeader)){ - throw new ServiceException("没有找到盘点主单!"); + throw new JeecgBootException("没有找到盘点主单!"); } CycleCountDetail temp = new CycleCountDetail(); temp.setCycleCountHeadCode(cyclecountHeader.getCode()); @@ -76,7 +76,7 @@ public class CycleCountHeaderServiceImpl extends ServiceImpl<CycleCountHeaderMap LambdaQueryWrapper<CycleCountDetail> lam = Wrappers.lambdaQuery(temp); List<CycleCountDetail> list = cycleCountDetailService.list(lam); if(list.size() < 1){ - throw new ServiceException("明细为空!"); + throw new JeecgBootException("明细为空!"); } //当有子单的状态为100时触发主单的完成状态 //100状态只有全部完成才写入主单 @@ -107,7 +107,6 @@ public class CycleCountHeaderServiceImpl extends ServiceImpl<CycleCountHeaderMap @Transactional public String createCode(String receiptType) { - int i = 0; String code = null; Date now = new Date(); SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd"); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/agvTask/service/impl/AgvTaskServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/agvTask/service/impl/AgvTaskServiceImpl.java index 459c037..85fe26c 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/agvTask/service/impl/AgvTaskServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/agvTask/service/impl/AgvTaskServiceImpl.java @@ -22,7 +22,7 @@ import org.jeecg.utils.constant.QuantityConstant; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -72,7 +72,7 @@ public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> impl agvTask.setStatus(QuantityConstant.AGV_TASK_STATUS_RELEASE); boolean success = updateById(agvTask); if (!success) { - throw new ServiceException("更新AGV任务状态失败"); + throw new JeecgBootException("更新AGV任务状态失败"); } } return result; @@ -99,7 +99,7 @@ public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> impl if (fromLocation != null) { success = locationService.updateContainerCodeAndStatus(fromPort, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成AGV任务时,更新起始库位数据失败"); + throw new JeecgBootException("完成AGV任务时,更新起始库位数据失败"); } } else { fromPort = QuantityConstant.EMPTY_STRING; @@ -108,29 +108,29 @@ public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> impl if (toLocation != null) { success = locationService.updateContainerCodeAndStatus(toPort, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成AGV任务时,更新终点库位数据失败"); + throw new JeecgBootException("完成AGV任务时,更新终点库位数据失败"); } } else { toPort = QuantityConstant.EMPTY_STRING; } Container container = containerService.getContainerByCode(containerCode, warehouseCode); if (container == null) { - throw new ServiceException("完成AGV任务时,根据容器号没有找到容器"); + throw new JeecgBootException("完成AGV任务时,根据容器号没有找到容器"); } success = containerService.updateLocationCodeAndStatus(containerCode, toPort, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成AGV任务时,更新容器数据失败"); + throw new JeecgBootException("完成AGV任务时,更新容器数据失败"); } agvTask.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); success = updateById(agvTask); if (!success) { - throw new ServiceException("完成AGV任务时, 更新AGV任务失败"); + throw new JeecgBootException("完成AGV任务时, 更新AGV任务失败"); } TaskHeader taskHeader = taskHeaderService.getTaskHeaderByAgvTaskId(taskId); if (taskHeader != null) { Result result = taskHeaderService.completeTaskByWMS(taskHeader.getId()); if (!result.isSuccess()) { - throw new ServiceException("完成AGV任务时, 完成WCS任务失败"); + throw new JeecgBootException("完成AGV任务时, 完成WCS任务失败"); } } @@ -154,19 +154,19 @@ public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> impl if (fromLocation != null) { success = locationService.updateContainerCodeAndStatus(fromPort, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("取消AGV任务。 更新起始库位状态失败"); + throw new JeecgBootException("取消AGV任务。 更新起始库位状态失败"); } } Location toLocation = locationService.getLocationByCode(toPort, warehouseCode); if (toLocation != null) { success = locationService.updateContainerCodeAndStatus(toPort, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("取消AGV任务。 更新终点库位状态失败"); + throw new JeecgBootException("取消AGV任务。 更新终点库位状态失败"); } } Container container = containerService.getContainerByCode(containerCode, warehouseCode); if (container == null) { - throw new ServiceException("取消AGV任务。 根据容器号没有找到容器"); + throw new JeecgBootException("取消AGV任务。 根据容器号没有找到容器"); } String containerStatus = QuantityConstant.STATUS_CONTAINER_EMPTY; List<InventoryDetail> inventoryDetailList = inventoryDetailService.getInventoryDetailListByContainerCode(containerCode, warehouseCode); @@ -175,18 +175,18 @@ public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> impl } success = containerService.updateStatus(containerCode, containerStatus, warehouseCode); if (!success) { - throw new ServiceException("取消AGV任务。 更新容器状态失败"); + throw new JeecgBootException("取消AGV任务。 更新容器状态失败"); } int status = agvTask.getStatus(); if (status != QuantityConstant.AGV_TASK_STATUS_BUILD) { Result result = acsService.cancelAGVTask(agvTask); if (!result.isSuccess()) { - throw new ServiceException(result.getMessage()); + throw new JeecgBootException(result.getMessage()); } } success = removeById(taskId); if (!success) { - throw new ServiceException("取消agv任务失败,任务id:" + taskId); + throw new JeecgBootException("取消agv任务失败,任务id:" + taskId); } return Result.ok("取消AGV任务成功"); } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java index 4517590..3d91715 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java @@ -66,7 +66,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.alibaba.fastjson.JSON; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -250,7 +250,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea container.setLastStatus(container.getStatus()); boolean success = containerService.updateById(container); if (!success) { - throw new ServiceException("创建移库任务时,更新容器状态失败,容器号" + fromLocation.getContainerCode()); + throw new JeecgBootException("创建移库任务时,更新容器状态失败,容器号" + fromLocation.getContainerCode()); } // 3. 判断源库位旁边有托盘但是没有任务,那么不允许移库 @@ -286,20 +286,20 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea taskHeader.setPreTaskNo(preTaskNo); success = taskHeaderService.save(taskHeader); if (!success) { - throw new ServiceException("创建移库任务时,创建任务失败"); + throw new JeecgBootException("创建移库任务时,创建任务失败"); } success = locationService.updateStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); if (!success) { - throw new ServiceException("创建移库任务时, 库位" + fromLocationCode + "更新失败"); + throw new JeecgBootException("创建移库任务时, 库位" + fromLocationCode + "更新失败"); } success = locationService.updateStatus(toLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); if (!success) { - throw new ServiceException("创建移库任务时, 库位" + toLocationCode + "更新失败"); + throw new JeecgBootException("创建移库任务时, 库位" + toLocationCode + "更新失败"); } success = containerService.updateStatus(fromLocation.getContainerCode(), QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode); if (!success) { - throw new ServiceException("创建移库任务时,容器" + fromLocation.getContainerCode() + "更新失败"); + throw new JeecgBootException("创建移库任务时,容器" + fromLocation.getContainerCode() + "更新失败"); } return Result.OK("创建移库任务成功"); } @@ -347,16 +347,16 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea } success = inventoryDetailService.updateBatchById(inventoryDetailList); if (!success) { - throw new ServiceException("创建出库查看任务时,更新库存详情失败"); + throw new JeecgBootException("创建出库查看任务时,更新库存详情失败"); } } success = locationService.updateStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); if (!success) { - throw new ServiceException("创建出库查看任务时,更新库位状态失败"); + throw new JeecgBootException("创建出库查看任务时,更新库位状态失败"); } success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode); if (!success) { - throw new ServiceException("创建出库查看任务时,更新容器状态失败"); + throw new JeecgBootException("创建出库查看任务时,更新容器状态失败"); } TaskHeader taskHeader = new TaskHeader(); taskHeader.setWarehouseCode(warehouseCode); @@ -374,7 +374,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); success = taskHeaderService.save(taskHeader); if (!success) { - throw new ServiceException("创建出库查看任务时, 创建任务失败"); + throw new JeecgBootException("创建出库查看任务时, 创建任务失败"); } return Result.OK("创建出库查看任务成功"); } @@ -485,11 +485,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea int high = locationHigh.getHigh(); String toLocationCode = allocationService.allocation(allocationRule, locationTypeCodeList, high, zoneCode, roadWays, warehouseCode, containerCode, null); if (StringUtils.isEmpty(toLocationCode)) { - throw new ServiceException("创建空托盘组入库任务时,目标库位为空"); + throw new JeecgBootException("创建空托盘组入库任务时,目标库位为空"); } Result result = taskHeaderService.createManyEmptyIn(containerCode, toLocationCode, warehouseCode); if (!result.isSuccess()) { - throw new ServiceException(result.getMessage()); + throw new JeecgBootException(result.getMessage()); } return Result.ok("创建空托盘组入库任务成功"); } @@ -516,7 +516,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea } boolean success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode); if (!success) { - throw new ServiceException("创建空托盘组入库任务时, 更新容器状态失败"); + throw new JeecgBootException("创建空托盘组入库任务时, 更新容器状态失败"); } if (StringUtils.isNotEmpty(toLocationCode)) { Location toLocation = locationService.getLocationByCode(toLocationCode, warehouseCode); @@ -528,7 +528,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea } success = locationService.updateStatus(toLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); if (!success) { - throw new ServiceException("创建空托盘组入库任务时, 更新库位状态失败"); + throw new JeecgBootException("创建空托盘组入库任务时, 更新库位状态失败"); } zoneCode = toLocation.getZoneCode(); } @@ -542,7 +542,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); success = taskHeaderService.save(taskHeader); if (!success) { - throw new ServiceException("创建空托盘组入库任务时, 创建任务失败"); + throw new JeecgBootException("创建空托盘组入库任务时, 创建任务失败"); } return Result.ok("创建空托盘组入库任务成功"); } @@ -580,11 +580,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea } boolean success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode); if (!success) { - throw new ServiceException("创建空托盘组出库任务时, 更新容器状态失败"); + throw new JeecgBootException("创建空托盘组出库任务时, 更新容器状态失败"); } success = locationService.updateStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); if (!success) { - throw new ServiceException("创建空托盘组出库任务时, 更新库位状态失败"); + throw new JeecgBootException("创建空托盘组出库任务时, 更新库位状态失败"); } TaskHeader taskHeader = new TaskHeader(); taskHeader.setWarehouseCode(warehouseCode); @@ -597,7 +597,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); success = taskHeaderService.save(taskHeader); if (!success) { - throw new ServiceException("创建空托盘组出库任务时,生成任务失败"); + throw new JeecgBootException("创建空托盘组出库任务时,生成任务失败"); } return Result.ok("创建空托盘组出库任务成功"); } @@ -655,20 +655,20 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea boolean success = containerService.updateLocationCodeAndStatus(containerCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("处理空出失败, 更新容器状态失败"); + throw new JeecgBootException("处理空出失败, 更新容器状态失败"); } // 6、删除库位上的容器号,并设置状态为空闲 success = locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("处理空出失败, 更新库位状态失败"); + throw new JeecgBootException("处理空出失败, 更新库位状态失败"); } // 7、删除库存头失败 InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode); if (inventoryHeader != null) { success = inventoryHeaderService.removeById(inventoryHeader.getId()); if (!success) { - throw new ServiceException("处理空出失败, 删除库存头失败"); + throw new JeecgBootException("处理空出失败, 删除库存头失败"); } } // 8、删除库存详情失败 @@ -677,14 +677,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea List<Integer> idList = inventoryDetailList.stream().map(InventoryDetail::getId).collect(Collectors.toList());; success = inventoryDetailService.removeByIds(idList); if (!success) { - throw new ServiceException("处理空出失败, 删除库存详情失败"); + throw new JeecgBootException("处理空出失败, 删除库存详情失败"); } } // 9 更新单据 taskHeader.setExceptionState(QuantityConstant.EXCEPTION_TASK_HANDLE); success = taskHeaderService.updateById(taskHeader); if (!success) { - throw new ServiceException("处理空出失败,更新任务失败"); + throw new JeecgBootException("处理空出失败,更新任务失败"); } return Result.ok("处理空出成功"); } @@ -731,13 +731,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea toLocation.setStatus(QuantityConstant.STATUS_LOCATION_EMPTY); boolean success = locationService.updateById(toLocation); if (!success) { - throw new ServiceException("处理重入失败,更新库位失败"); + throw new JeecgBootException("处理重入失败,更新库位失败"); } } taskHeader.setExceptionState(QuantityConstant.EXCEPTION_TASK_HANDLE); boolean success = taskHeaderService.updateById(taskHeader); if (!success) { - throw new ServiceException("处理重入失败,更新任务失败"); + throw new JeecgBootException("处理重入失败,更新任务失败"); } return Result.ok("处理重入成功"); } @@ -762,7 +762,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea taskHeader.setExceptionState(QuantityConstant.EXCEPTION_TASK_HANDLE); boolean success = taskHeaderService.updateById(taskHeader); if (!success) { - throw new ServiceException("处理取货错失败,更新任务失败"); + throw new JeecgBootException("处理取货错失败,更新任务失败"); } return Result.ok("处理取货错成功"); } @@ -867,7 +867,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea result = taskHeaderService.completeManyEmptyOutTask(taskHeader); break; default: - throw new ServiceException("不支持的任务类型" + taskType); + throw new JeecgBootException("不支持的任务类型" + taskType); } return result; } @@ -920,12 +920,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea } Result result = wcsService.wcsTaskAssign(taskHeader); if (!result.isSuccess()) { - throw new ServiceException(result.getMessage()); + throw new JeecgBootException(result.getMessage()); } taskHeader.setStatus(QuantityConstant.TASK_STATUS_RELEASE); boolean success = taskHeaderService.updateById(taskHeader); if (!success) { - throw new ServiceException("下发wcs任务时, 更新任务状态失败"); + throw new JeecgBootException("下发wcs任务时, 更新任务状态失败"); } return Result.ok("执行下发任务成功"); @@ -973,13 +973,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea } boolean success = locationService.updateStatus(toLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); if (!success) { - throw new ServiceException("创建空托盘入库时,更新库位状态失败"); + throw new JeecgBootException("创建空托盘入库时,更新库位状态失败"); } } boolean success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode); if (!success) { - throw new ServiceException("创建空托盘入库时,更新容器状态失败"); + throw new JeecgBootException("创建空托盘入库时,更新容器状态失败"); } TaskHeader taskHeader = new TaskHeader(); taskHeader.setWarehouseCode(warehouseCode); @@ -990,7 +990,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); success = taskHeaderService.save(taskHeader); if (!success) { - throw new ServiceException("创建空托盘入库时,保存任务失败"); + throw new JeecgBootException("创建空托盘入库时,保存任务失败"); } return Result.OK("创建空托盘入库任务成功", taskHeader); } @@ -1039,11 +1039,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea } boolean success = locationService.updateStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); if (!success) { - throw new ServiceException("创建空托盘出库时,更新库位状态失败"); + throw new JeecgBootException("创建空托盘出库时,更新库位状态失败"); } success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode); if (!success) { - throw new ServiceException("创建空托盘出库时,更新容器状态失败"); + throw new JeecgBootException("创建空托盘出库时,更新容器状态失败"); } TaskHeader taskHeader = new TaskHeader(); taskHeader.setWarehouseCode(warehouseCode); @@ -1056,7 +1056,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea taskHeader.setToPortCode(toPortCode); success = taskHeaderService.save(taskHeader); if (!success) { - throw new ServiceException("创建空托盘出库时,保存任务失败"); + throw new JeecgBootException("创建空托盘出库时,保存任务失败"); } return Result.OK("创建空托盘出库任务成功"); } @@ -1092,11 +1092,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea return Result.ok("任务(" + taskHeader.getId() + ")任务已经是完成的!"); } if (taskDetailList.isEmpty()) { - throw new ServiceException("任务明细为空"); + throw new JeecgBootException("任务明细为空"); } Location toLocation = locationService.getLocationByCode(toLocationCode, warehouseCode); if (toLocation == null) { - throw new ServiceException("完成任务时,没有找到目的库位"); + throw new JeecgBootException("完成任务时,没有找到目的库位"); } InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode); if (inventoryHeader != null) { @@ -1122,7 +1122,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea inventoryHeader.setContainerStatus(QuantityConstant.STATUS_CONTAINER_SOME); inventoryHeader.setEnable(QuantityConstant.STATUS_ENABLE); if (!inventoryHeaderService.save(inventoryHeader)) { - throw new ServiceException("添加库存头失败"); + throw new JeecgBootException("添加库存头失败"); } } @@ -1132,7 +1132,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea for (TaskDetail taskDetail : taskDetailList) { ReceiptDetail receiptDetail = receiptDetailService.getById(taskDetail.getReceiptDetailId()); if (receiptDetail == null) { - throw new ServiceException("未找到ID:" + taskDetail.getReceiptDetailId() + "入库单明细"); + throw new JeecgBootException("未找到ID:" + taskDetail.getReceiptDetailId() + "入库单明细"); } // 操作记录统计用 taskDetail.setReceiptCode(receiptDetail.getReceiptCode()); @@ -1187,51 +1187,51 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea } success = receiptContainerHeaderService.updateStatusById(QuantityConstant.RECEIPT_CONTAINER_FINISHED, taskHeader.getReceiptContainerHeaderId()); if (!success) { - throw new ServiceException("完成入库任务时,更新入库组盘头表状态失败"); + throw new JeecgBootException("完成入库任务时,更新入库组盘头表状态失败"); } success = inventoryDetailService.saveBatch(inventoryDetailList); if (!success) { - throw new ServiceException("完成入库任务时,保存库存详情失败"); + throw new JeecgBootException("完成入库任务时,保存库存详情失败"); } success = inventoryTransactionService.saveBatch(inventoryTransactionList); if (!success) { - throw new ServiceException("完成入库任务时,保存库存交易失败"); + throw new JeecgBootException("完成入库任务时,保存库存交易失败"); } if (StringUtils.isEmpty(fromLocationCode)) { success = locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成入库任务时,更新源库位失败"); + throw new JeecgBootException("完成入库任务时,更新源库位失败"); } } success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成入库任务时,更新库位失败"); + throw new JeecgBootException("完成入库任务时,更新库位失败"); } taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); success = taskHeaderService.updateById(taskHeader); if (!success) { - throw new ServiceException("完成入库任务时,更新任务失败"); + throw new JeecgBootException("完成入库任务时,更新任务失败"); } success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_SOME, warehouseCode); if (!success) { - throw new ServiceException("完成入库任务时,更新容器失败"); + throw new JeecgBootException("完成入库任务时,更新容器失败"); } if (!combineInventoryDetail(taskHeader)) { - throw new ServiceException("合并入库库存失败"); + throw new JeecgBootException("合并入库库存失败"); } if (!receiptDetailService.updateBatchById(receiptDetaiList)) { - throw new ServiceException("完成入库任务时,更新入库单详情失败"); + throw new JeecgBootException("完成入库任务时,更新入库单详情失败"); } List<Integer> receiptIdList = receiptDetaiList.stream().map(ReceiptDetail::getReceiptId).distinct().collect(Collectors.toList()); for (Integer receiptId : receiptIdList) { success = receiptHeaderService.updateReceiptHeaderStatus(receiptId); if (!success) { - throw new ServiceException("完成入库任务时,更新入库单头失败"); + throw new JeecgBootException("完成入库任务时,更新入库单头失败"); } } receiptDetaiList = receiptDetaiList.stream().filter(t -> t.getStatus().equals(QuantityConstant.RECEIPT_HEADER_COMPLETED)).collect(Collectors.toList()); @@ -1271,17 +1271,17 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea return Result.ok("完成出库任务,(" + taskHeader.getId() + ")任务已经是完成的!"); } if (taskDetailList.isEmpty()) { - throw new ServiceException("完成出库任务,任务明细为空"); + throw new JeecgBootException("完成出库任务,任务明细为空"); } if (StringUtils.isEmpty(fromLocationCode)) { - throw new ServiceException("完成出库任务" + taskHeader.getId() + "没有起始库位,执行中止"); + throw new JeecgBootException("完成出库任务" + taskHeader.getId() + "没有起始库位,执行中止"); } if (StringUtils.isEmpty(toLocationCode) && taskType == QuantityConstant.TASK_TYPE_SORTINGSHIPMENT) { - throw new ServiceException("完成出库任务,任务" + taskHeader.getId() + "没有目的库位,执行中止"); + throw new JeecgBootException("完成出库任务,任务" + taskHeader.getId() + "没有目的库位,执行中止"); } InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode); if (inventoryHeader == null) { - throw new ServiceException("完成出库任务,出库任务" + taskHeader.getId() + "没有找到库存头"); + throw new JeecgBootException("完成出库任务,出库任务" + taskHeader.getId() + "没有找到库存头"); } List<InventoryTransaction> inventoryTransactionList = new ArrayList<>(); List<Integer> shipmentIdList = new ArrayList<>(); @@ -1289,11 +1289,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea for (TaskDetail taskDetail : taskDetailList) { ShipmentContainerDetail shipmentContainerDetail = shipmentContainerDetailService.getById(taskDetail.getShipmentContainerDetailId()); if (shipmentContainerDetail == null) { - throw new ServiceException("完成出库任务, 出库任务没有找到出库组盘详情" + taskDetail.getShipmentContainerDetailId()); + throw new JeecgBootException("完成出库任务, 出库任务没有找到出库组盘详情" + taskDetail.getShipmentContainerDetailId()); } ShipmentDetail shipmentDetail = shipmentDetailService.getById(taskDetail.getShipmentDetailId()); if (shipmentDetail == null) { - throw new ServiceException("完成出库任务, 出库任务没有找到出库详情" + taskDetail.getShipmentDetailId()); + throw new JeecgBootException("完成出库任务, 出库任务没有找到出库详情" + taskDetail.getShipmentDetailId()); } taskDetail.setShipmentCode(shipmentDetail.getShipmentCode()); if (shipmentDetail.getQty().compareTo(shipmentDetail.getTaskQty()) == 0) { @@ -1301,32 +1301,32 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea } else if (shipmentDetail.getQty().compareTo(shipmentDetail.getTaskQty()) > 0) { shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_OFF_SHELF); } else if (shipmentDetail.getQty().compareTo(shipmentDetail.getTaskQty()) < 0) { - throw new ServiceException("完成出库任务时, 出库单 单据数量不能小于配盘数量"); + throw new JeecgBootException("完成出库任务时, 出库单 单据数量不能小于配盘数量"); } shipmentDetailList.add(shipmentDetail); InventoryDetail inventoryDetail = inventoryDetailService.getById(taskDetail.getFromInventoryDetailId()); if (inventoryDetail == null) { - throw new ServiceException("完成出库任务,出库任务没有找到库存详情" + taskDetail.getFromInventoryDetailId()); + throw new JeecgBootException("完成出库任务,出库任务没有找到库存详情" + taskDetail.getFromInventoryDetailId()); } inventoryDetail.setTaskQty(inventoryDetail.getTaskQty().subtract(taskDetail.getQty())); inventoryDetail.setQty(inventoryDetail.getQty().subtract(taskDetail.getQty())); inventoryDetail.setLocationCode(toLocationCode); // 扣减后的库存不能小于0 if (inventoryDetail.getQty().compareTo(BigDecimal.ZERO) < 0) { - throw new ServiceException("完成出库任务,扣减库存大于wms库存"); + throw new JeecgBootException("完成出库任务,扣减库存大于wms库存"); } if (inventoryDetail.getQty().compareTo(BigDecimal.ZERO) == 0) { if (inventoryDetail.getTaskQty().compareTo(BigDecimal.ZERO) != 0) { - throw new ServiceException("完成出库任务,扣减库存的库存详情任务数量不为0"); + throw new JeecgBootException("完成出库任务,扣减库存的库存详情任务数量不为0"); } success = inventoryDetailService.removeById(inventoryDetail.getId()); if (!success) { - throw new ServiceException("完成出库任务,删除库存详情失败"); + throw new JeecgBootException("完成出库任务,删除库存详情失败"); } } else { success = inventoryDetailService.updateById(inventoryDetail); if (!success) { - throw new ServiceException("完成出库任务,更新库存详情失败"); + throw new JeecgBootException("完成出库任务,更新库存详情失败"); } } @@ -1356,78 +1356,78 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea if (inventoryDetailList.size() == 0) { success = inventoryHeaderService.removeById(inventoryHeader.getId()); if (!success) { - throw new ServiceException("完成出库任务,删除库存头失败"); + throw new JeecgBootException("完成出库任务,删除库存头失败"); } containerStatus = QuantityConstant.STATUS_CONTAINER_EMPTY; } else { if (taskType == QuantityConstant.TASK_TYPE_WHOLESHIPMENT) { - throw new ServiceException("完成整盘出库任务,不能还剩库存详情"); + throw new JeecgBootException("完成整盘出库任务,不能还剩库存详情"); } containerStatus = QuantityConstant.STATUS_CONTAINER_SOME; inventoryHeader.setContainerStatus(containerStatus); inventoryHeader.setLocationCode(toLocationCode); success = inventoryHeaderService.updateById(inventoryHeader); if (!success) { - throw new ServiceException("完成出库任务,更新库存头失败"); + throw new JeecgBootException("完成出库任务,更新库存头失败"); } } success = inventoryTransactionService.saveBatch(inventoryTransactionList); if (!success) { - throw new ServiceException("完成出库任务,保存库存详情失败"); + throw new JeecgBootException("完成出库任务,保存库存详情失败"); } taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); success = taskHeaderService.updateById(taskHeader); if (!success) { - throw new ServiceException("完成出库任务,保存任务头失败"); + throw new JeecgBootException("完成出库任务,保存任务头失败"); } if (taskType == QuantityConstant.TASK_TYPE_WHOLESHIPMENT) { success = locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成整盘出库任务,更新源库位失败"); + throw new JeecgBootException("完成整盘出库任务,更新源库位失败"); } containerService.updateLocationCodeAndStatus(containerCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成整盘出库任务,更新容器失败"); + throw new JeecgBootException("完成整盘出库任务,更新容器失败"); } } else if (taskType == QuantityConstant.TASK_TYPE_SORTINGSHIPMENT) { success = locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成分拣出库任务,更新源库位失败"); + throw new JeecgBootException("完成分拣出库任务,更新源库位失败"); } success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成分拣出库任务,更新目标库位失败"); + throw new JeecgBootException("完成分拣出库任务,更新目标库位失败"); } success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, containerStatus, warehouseCode); if (!success) { - throw new ServiceException("完成分拣出库任务,更新容器失败"); + throw new JeecgBootException("完成分拣出库任务,更新容器失败"); } } ShipmentContainerHeader shipmentContainerHeader = shipmentContainerHeaderService.getById(taskHeader.getShipmentContainerHeaderId()); if (shipmentContainerHeader == null) { - throw new ServiceException("完成出库任务,获取出库组盘头失败"); + throw new JeecgBootException("完成出库任务,获取出库组盘头失败"); } shipmentContainerHeader.setStatus(QuantityConstant.SHIPMENT_CONTAINER_FINISHED); success = shipmentContainerHeaderService.updateById(shipmentContainerHeader); if (!success) { - throw new ServiceException("完成出库任务,更新出库组盘头失败"); + throw new JeecgBootException("完成出库任务,更新出库组盘头失败"); } if (inventoryDetailList.size() != 0) { if (!combineInventoryDetail(taskHeader)) { - throw new ServiceException("合并入库库存失败"); + throw new JeecgBootException("合并入库库存失败"); } } success = shipmentDetailService.updateBatchById(shipmentDetailList); if (!success) { - throw new ServiceException("完成出库任务,更新出库详情失败"); + throw new JeecgBootException("完成出库任务,更新出库详情失败"); } shipmentIdList = shipmentIdList.stream().distinct().collect(Collectors.toList()); for (Integer shipmentId : shipmentIdList) { success = shipmentHeaderService.updateShipmentHeaderStatus(shipmentId); if (!success) { - throw new ServiceException("完成出库任务,更新出库单头失败"); + throw new JeecgBootException("完成出库任务,更新出库单头失败"); } } // 操作记录添加 @@ -1446,11 +1446,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode); if (inventoryHeader == null) { - throw new ServiceException("合并库存时, 没有找到库存头"); + throw new JeecgBootException("合并库存时, 没有找到库存头"); } List<InventoryDetail> inventoryDetailList = inventoryDetailService.getInventoryDetailListByInventoryHeaderId(inventoryHeader.getId()); if (inventoryDetailList.size() == 0) { - throw new ServiceException("合并库存时, 没有找到库存详情"); + throw new JeecgBootException("合并库存时, 没有找到库存详情"); } for (int i = 0; i < inventoryDetailList.size() - 1; i++) { for (int j = inventoryDetailList.size() - 1; j > i; j--) { @@ -1462,11 +1462,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea inventoryDetail1.setQty(totalQty); success = inventoryDetailService.updateById(inventoryDetail1); if (!success) { - throw new ServiceException("合并库存时, 更新库存详情失败:" + inventoryDetail1.getId()); + throw new JeecgBootException("合并库存时, 更新库存详情失败:" + inventoryDetail1.getId()); } success = inventoryDetailService.removeById(inventoryDetail2.getId()); if (!success) { - throw new ServiceException("合并库存时, 删除库存详情失败:" + inventoryDetail2.getId()); + throw new JeecgBootException("合并库存时, 删除库存详情失败:" + inventoryDetail2.getId()); } inventoryDetailList.remove(j); } @@ -1480,7 +1480,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea } Container container = containerService.getContainerByCode(containerCode, warehouseCode); if (container == null) { - throw new ServiceException("合并库存时, 没有找到容器, 容器号为" + containerCode); + throw new JeecgBootException("合并库存时, 没有找到容器, 容器号为" + containerCode); } inventoryHeader.setTotalQty(totalQty); inventoryHeader.setTotalLines(totalLines); @@ -1519,16 +1519,16 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea } boolean success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成空托盘入库任务时, 更新容器的库位号和状态失败"); + throw new JeecgBootException("完成空托盘入库任务时, 更新容器的库位号和状态失败"); } success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成空托盘入库任务时, 更新库位的容器号和状态失败"); + throw new JeecgBootException("完成空托盘入库任务时, 更新库位的容器号和状态失败"); } taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); success = taskHeaderService.updateById(taskHeader); if (!success) { - throw new ServiceException("完成空托盘入库任务时, 更新任务失败"); + throw new JeecgBootException("完成空托盘入库任务时, 更新任务失败"); } return Result.OK("完成空托盘入库成功"); } @@ -1587,13 +1587,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea for (CycleCountDetailChild child : children) { if (!child.getChildStatus().equals(QuantityConstant.CYCLECOUNT_STATUS_REGISTERED)) { - throw new ServiceException("当前任务里面还有没有进行登记的数据,不能完成任务"); + throw new JeecgBootException("当前任务里面还有没有进行登记的数据,不能完成任务"); } if (child.getInventoryDetaiId() != null) { InventoryDetail inventoryDetail = inventoryDetailService.getById(child.getInventoryDetaiId()); if (inventoryDetail == null) { - throw new ServiceException("盘点还没完成 库存明细单据就不存在了 可能出现了问题或者所容器没成功"); + throw new JeecgBootException("盘点还没完成 库存明细单据就不存在了 可能出现了问题或者所容器没成功"); } inventoryHeader.setTotalQty(inventoryHeader.getTotalQty().add(child.getGapQty())); inventoryDetail.setQty(child.getCountedQty()); @@ -1748,7 +1748,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea // 4.完成当前任务 if (!taskHeaderService.saveOrUpdate(taskHeader)) { - throw new ServiceException("盘点任务单据状态更新失败!"); + throw new JeecgBootException("盘点任务单据状态更新失败!"); } // 盘点明细状态 cycleCountDetail.setEnableStatus(QuantityConstant.CYCLECOUNT_STATUS_COMPLETED); @@ -1771,12 +1771,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode); } if (!success) { - throw new ServiceException("完成出库查看任务时,更新容器状态失败"); + throw new JeecgBootException("完成出库查看任务时,更新容器状态失败"); } } else { success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成出库查看任务时,更新容器状态失败"); + throw new JeecgBootException("完成出库查看任务时,更新容器状态失败"); } } return Result.OK("完成盘点任务成功"); @@ -1822,17 +1822,17 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea boolean success = containerService.updateLocationCodeAndStatus(containerCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成空托盘出库任务时, 更新容器的库位号和状态失败"); + throw new JeecgBootException("完成空托盘出库任务时, 更新容器的库位号和状态失败"); } success = locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成空托盘出库任务时, 更新库位的容器号和状态失败"); + throw new JeecgBootException("完成空托盘出库任务时, 更新库位的容器号和状态失败"); } taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); success = taskHeaderService.updateById(taskHeader); if (!success) { - throw new ServiceException("完成空托盘出库任务时, 更新任务失败"); + throw new JeecgBootException("完成空托盘出库任务时, 更新任务失败"); } return Result.OK("完成空托盘出库成功"); } @@ -1892,39 +1892,39 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea if (inventoryTransactionList.size() > 0) { success = inventoryTransactionService.saveBatch(inventoryTransactionList); if (!success) { - throw new ServiceException("完成移库任务时,保存库存交易失败"); + throw new JeecgBootException("完成移库任务时,保存库存交易失败"); } } taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); success = taskHeaderService.updateById(taskHeader); if (!success) { - throw new ServiceException("完成移库任务时, 更新任务失败"); + throw new JeecgBootException("完成移库任务时, 更新任务失败"); } if (inventoryDetailList.size() > 0) { success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_SOME, warehouseCode); if (!success) { - throw new ServiceException("完成移库任务时, 更新容器状态失败"); + throw new JeecgBootException("完成移库任务时, 更新容器状态失败"); } } else { success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成移库任务时, 更新容器状态失败"); + throw new JeecgBootException("完成移库任务时, 更新容器状态失败"); } } Container container = containerService.getContainerByCode(containerCode, warehouseCode); container.setLastStatus(QuantityConstant.EMPTY_STRING); success = containerService.updateById(container); if (!success) { - throw new ServiceException("完成移库任务时, 更新容器状态失败"); + throw new JeecgBootException("完成移库任务时, 更新容器状态失败"); } success = locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成移库任务时, 更新起始库位状态失败"); + throw new JeecgBootException("完成移库任务时, 更新起始库位状态失败"); } success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成移库任务时, 更新目标库位状态失败"); + throw new JeecgBootException("完成移库任务时, 更新目标库位状态失败"); } LambdaUpdateWrapper<InventoryHeader> inventoryHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate(); inventoryHeaderLambdaUpdateWrapper.eq(InventoryHeader::getWarehouseCode, warehouseCode).eq(InventoryHeader::getContainerCode, containerCode) @@ -1934,13 +1934,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea inventoryHeader.setLocationCode(toLocationCode); success = inventoryHeaderService.updateById(inventoryHeader); if (!success) { - throw new ServiceException("完成移库任务时, 更新库存头失败"); + throw new JeecgBootException("完成移库任务时, 更新库存头失败"); } } if (inventoryDetailList.size() != 0) { success = inventoryDetailService.updateBatchById(inventoryDetailList); if (!success) { - throw new ServiceException("完成移库任务时, 更新库存详情失败"); + throw new JeecgBootException("完成移库任务时, 更新库存详情失败"); } } return Result.OK("完成移库任务成功"); @@ -1988,16 +1988,16 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea } success = inventoryDetailService.updateBatchById(inventoryDetailList); if (!success) { - throw new ServiceException("完成出库查看任务时,更新库存详情失败"); + throw new JeecgBootException("完成出库查看任务时,更新库存详情失败"); } InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode); if (inventoryHeader == null) { - throw new ServiceException("完成出库查看任务时,没有找到库存头"); + throw new JeecgBootException("完成出库查看任务时,没有找到库存头"); } inventoryHeader.setLocationCode(toLocationCode); success = inventoryHeaderService.updateById(inventoryHeader); if (!success) { - throw new ServiceException("完成出库查看任务时,更新库存头失败"); + throw new JeecgBootException("完成出库查看任务时,更新库存头失败"); } if (fromLocationCode.equals(toLocationCode)) { success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_SOME, warehouseCode); @@ -2005,27 +2005,27 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_SOME, warehouseCode); } if (!success) { - throw new ServiceException("完成出库查看任务时,更新容器状态失败"); + throw new JeecgBootException("完成出库查看任务时,更新容器状态失败"); } } else { success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成出库查看任务时,更新容器状态失败"); + throw new JeecgBootException("完成出库查看任务时,更新容器状态失败"); } } success = locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成出库查看任务时,更新起始库位状态失败"); + throw new JeecgBootException("完成出库查看任务时,更新起始库位状态失败"); } success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成出库查看任务时,更新目标库位状态失败"); + throw new JeecgBootException("完成出库查看任务时,更新目标库位状态失败"); } taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); success = taskHeaderService.updateById(taskHeader); if (!success) { - throw new ServiceException("完成出库查看任务时,保存任务失败"); + throw new JeecgBootException("完成出库查看任务时,保存任务失败"); } return Result.ok("完成出库查看任务"); } @@ -2069,11 +2069,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); boolean success = taskHeaderService.updateById(taskHeader); if (!success) { - throw new ServiceException("创建跨站任务时, 更新任务失败"); + throw new JeecgBootException("创建跨站任务时, 更新任务失败"); } success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("创建跨站任务时, 更新容器状态失败"); + throw new JeecgBootException("创建跨站任务时, 更新容器状态失败"); } return Result.OK("完成跨站任务成功"); } @@ -2109,15 +2109,15 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); boolean success = taskHeaderService.updateById(taskHeader); if (!success) { - throw new ServiceException("完成空托盘组入库任务时, 更新任务失败"); + throw new JeecgBootException("完成空托盘组入库任务时, 更新任务失败"); } success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_MANY, warehouseCode); if (!success) { - throw new ServiceException("完成空托盘组入库任务时, 更新容器失败"); + throw new JeecgBootException("完成空托盘组入库任务时, 更新容器失败"); } success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成空托盘组入库任务时, 更新库位失败"); + throw new JeecgBootException("完成空托盘组入库任务时, 更新库位失败"); } return Result.ok("完成空托盘组入库任务成功"); } @@ -2157,15 +2157,15 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); boolean success = taskHeaderService.updateById(taskHeader); if (!success) { - throw new ServiceException("完成空托盘组出库任务时, 更新任务失败"); + throw new JeecgBootException("完成空托盘组出库任务时, 更新任务失败"); } success = containerService.updateLocationCodeAndStatus(containerCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成空托盘组出库任务时, 更新容器失败"); + throw new JeecgBootException("完成空托盘组出库任务时, 更新容器失败"); } success = locationService.updateContainerCodeAndStatus(toLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("完成空托盘组出库任务时, 更新库位失败"); + throw new JeecgBootException("完成空托盘组出库任务时, 更新库位失败"); } return Result.ok("完成空托盘组出库任务成功"); } @@ -2180,21 +2180,21 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea public Result cancelReceiptTask(TaskHeader taskHeader) { boolean success = receiptContainerHeaderService.cancelReceiptTask(taskHeader); if (!success) { - throw new ServiceException("取消入库任务时, 更新组盘头状态失败"); + throw new JeecgBootException("取消入库任务时, 更新组盘头状态失败"); } String containerCode = taskHeader.getContainerCode(); String warehouseCode = taskHeader.getWarehouseCode(); ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getUnCompleteReceiptContainerByCode(containerCode, warehouseCode); String value = parameterConfigurationService.getValueByCode(QuantityConstant.RULE_TASK_LOCATION); if (StringUtils.isEmpty(value)) { - throw new ServiceException("取消入库任务时, 没有获取到配置属性"); + throw new JeecgBootException("取消入库任务时, 没有获取到配置属性"); } int taskLocationRule = Integer.parseInt(value); if (taskLocationRule == QuantityConstant.RULE_TASK_NOT_LOCATION) { receiptContainerHeader.setToLocationCode(QuantityConstant.EMPTY_STRING); success = receiptContainerHeaderService.updateById(receiptContainerHeader); if (!success) { - throw new ServiceException("取消入库任务时, 更新组盘头状态失败!!"); + throw new JeecgBootException("取消入库任务时, 更新组盘头状态失败!!"); } } return Result.ok("取消入库任务成功"); @@ -2210,7 +2210,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea public Result cancelShipmentTask(TaskHeader taskHeader) { boolean success = shipmentContainerHeaderService.cancelShipmentTask(taskHeader); if (!success) { - throw new ServiceException("取消入库任务时, 更新组盘头状态失败"); + throw new JeecgBootException("取消入库任务时, 更新组盘头状态失败"); } return Result.ok("取消出库任务成功"); } @@ -2231,26 +2231,26 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea if (StringUtils.isNotEmpty(fromLocationCode)) { success = locationService.updateStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("取消任务时, 更新起始库位状态失败"); + throw new JeecgBootException("取消任务时, 更新起始库位状态失败"); } } if (StringUtils.isNotEmpty(toLocationCode)) { success = locationService.updateStatus(toLocationCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if (!success) { - throw new ServiceException("取消任务时, 更新目标库位状态失败"); + throw new JeecgBootException("取消任务时, 更新目标库位状态失败"); } } InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode); Container container = containerService.getContainerByCode(containerCode, warehouseCode); if (container == null) { - throw new ServiceException("取消任务时, 没有找到容器"); + throw new JeecgBootException("取消任务时, 没有找到容器"); } if (inventoryHeader != null) { container.setStatus(QuantityConstant.STATUS_CONTAINER_SOME); inventoryHeader.setContainerStatus(QuantityConstant.STATUS_CONTAINER_SOME); success = inventoryHeaderService.updateById(inventoryHeader); if (!success) { - throw new ServiceException("取消任务时, 更新库存成功"); + throw new JeecgBootException("取消任务时, 更新库存成功"); } } else { container.setStatus(QuantityConstant.STATUS_CONTAINER_EMPTY); @@ -2262,14 +2262,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea // if (StringUtils.isNotEmpty(fromLocationCode)) { // success = containerService.havaLocationCodeByContainer(fromLocationCode, warehouseCode); // if (success) { -// throw new ServiceException("库位表已经存在这个容器号,不能再写入"); +// throw new JeecgBootException("库位表已经存在这个容器号,不能再写入"); // } // } container.setLastStatus(QuantityConstant.EMPTY_STRING); // container.setLocationCode(fromLocationCode); success = containerService.updateById(container); if (!success) { - throw new ServiceException("取消任务时, 更新容器失败"); + throw new JeecgBootException("取消任务时, 更新容器失败"); } return Result.ok("取消任务成功"); } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/utils/OkHttpUtils.java b/huaheng-wms-core/src/main/java/org/jeecg/utils/OkHttpUtils.java index 82a1ad1..bb589ef 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/utils/OkHttpUtils.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/utils/OkHttpUtils.java @@ -3,7 +3,7 @@ package org.jeecg.utils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.TypeReference; import com.alibaba.fastjson.parser.Feature; -import com.aliyun.oss.ServiceException; +import org.jeecg.common.exception.JeecgBootException; import com.xkcoding.http.util.StringUtil; import antlr.StringUtils; @@ -120,7 +120,7 @@ public class OkHttpUtils { } else { String errorString = StrUtil.format("执行GET请求失败,url:{},header:{},param:{},responseCode:{},responseMessage:{}", url, JSON.toJSONString(headers), param, response.code(), response.message()); - throw new ServiceException(errorString); + throw new JeecgBootException(errorString); } return result; }