diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/controller/admin/BaseSupplierController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/controller/admin/BaseSupplierController.java index 28a7e0dd..106a4fb7 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/controller/admin/BaseSupplierController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/controller/admin/BaseSupplierController.java @@ -1,15 +1,13 @@ package cn.iocoder.yudao.module.supplier.controller.admin; import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; -import cn.iocoder.yudao.module.label.vo.LabelPageReqVO; -import cn.iocoder.yudao.module.label.vo.LabelRespVO; import cn.iocoder.yudao.module.supplier.entity.BaseSupplier; import cn.iocoder.yudao.module.supplier.service.BaseSupplierService; import cn.iocoder.yudao.module.supplier.vo.BaseSupplierPageReqVO; import cn.iocoder.yudao.module.supplier.vo.BaseSupplierRespVO; import cn.iocoder.yudao.module.supplier.vo.BaseSupplierSaveReqVO; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; @@ -123,8 +121,20 @@ public class BaseSupplierController { **/ @GetMapping("/list") @Operation(summary = "获得所有供应商") -// @PreAuthorize("@ss.hasPermission('supplier:base-supplier:query')") public CommonResult getBaseSupplierList(){ return success(baseSupplierService.list()); } + + /** + * 根据输入名称模糊查询供应商 + * @author 小李 + * @date 9:23 2024/9/13 + **/ + @GetMapping("/searchList") + @Operation(summary = "根据输入名称模糊查询供应商") + public CommonResult searchList(String name){ + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .like(BaseSupplier::getName,name); + return success(baseSupplierService.list(queryWrapper)); + } } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/service/BaseSupplierService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/service/BaseSupplierService.java index 14561d3f..d1cdc73d 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/service/BaseSupplierService.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/service/BaseSupplierService.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.supplier.service; -import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.supplier.entity.BaseSupplier; import cn.iocoder.yudao.module.supplier.vo.BaseSupplierPageReqVO; import cn.iocoder.yudao.module.supplier.vo.BaseSupplierRespVO; @@ -9,8 +8,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; -import javax.validation.Valid; - /** * 供应商 Service 接口 * @@ -28,6 +25,15 @@ public interface BaseSupplierService extends IService { **/ void saveBaseSupplier(BaseSupplierSaveReqVO saveReqVO); + /** + * 生成采购单选择供应商 + * @author PQZ + * @date 17:43 2024/10/25 + * @param supplierName 供应商名称 + * @return java.lang.String + **/ + String appSaveSupplier(String supplierName); + /** * 删除供应商信息 * diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/service/impl/BaseSupplierServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/service/impl/BaseSupplierServiceImpl.java index efc297cb..e2c686ed 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/service/impl/BaseSupplierServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/service/impl/BaseSupplierServiceImpl.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.module.supplier.service.impl; -import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.module.supplier.entity.BaseSupplier; import cn.iocoder.yudao.module.supplier.entity.BaseSupplierAccount; import cn.iocoder.yudao.module.supplier.mapper.BaseSupplierMapper; @@ -10,6 +10,7 @@ import cn.iocoder.yudao.module.supplier.service.BaseSupplierService; import cn.iocoder.yudao.module.supplier.vo.BaseSupplierPageReqVO; import cn.iocoder.yudao.module.supplier.vo.BaseSupplierRespVO; import cn.iocoder.yudao.module.supplier.vo.BaseSupplierSaveReqVO; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -51,6 +52,30 @@ public class BaseSupplierServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(BaseDO::getDeleted,0).eq(BaseSupplier::getName,supplierName); + List list = list(lambdaQueryWrapper); + if (!list.isEmpty()){ + //存在供应商 + return list.get(0).getId(); + } else { + BaseSupplier supplier = new BaseSupplier(); + supplier.setName(supplierName); + save(supplier); + return supplier.getId(); + } + } + /** * 删除供应商信息 diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java index 04941ab3..2e68139d 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java @@ -9,6 +9,8 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; +import cn.iocoder.yudao.module.custom.entity.CustomerMain; +import cn.iocoder.yudao.module.custom.service.CustomerMainService; import cn.iocoder.yudao.module.partner.entity.PartnerCustomerInfo; import cn.iocoder.yudao.module.partner.service.IPartnerCustomerInfoService; import cn.iocoder.yudao.module.partner.service.IPartnerWorkerService; @@ -38,6 +40,8 @@ import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; + /** * 【请填写功能名称】Service业务层处理 * @@ -68,7 +72,8 @@ public class InspectionInfoServiceImpl extends ServiceImpl voidRepairSo(@RequestBody DlRepairSoReqVO repairSoReqVO) { @@ -78,26 +78,26 @@ public class DlRepairSoController { /** * 采购单/领料单 查看 * + * @param id 主键 * @author 小李 * @date 9:34 2024/9/22 - * @param id 主键 - **/ + **/ @GetMapping("/get") @Operation(summary = "采购单/领料单 查看") - public CommonResult getRepairSoById(@RequestParam("id") String id){ + public CommonResult getRepairSoById(@RequestParam("id") String id) { return success(dlRepairSoService.getRepairSoById(id)); } /** * 员工确认领料 * + * @param id 单据ID 领料单主表 * @author 小李 * @date 11:58 2024/10/21 - * @param id 单据ID 领料单主表 - **/ + **/ @GetMapping("/confirmGet") @Operation(summary = "员工确认领料") - public CommonResult confirmGet(@RequestParam("id") String id){ + public CommonResult confirmGet(@RequestParam("id") String id) { dlRepairSoService.confirmGet(id); return CommonResult.ok(); } @@ -105,15 +105,31 @@ public class DlRepairSoController { /** * 员工确认退料 * + * @param id 退料单主表ID * @author 小李 * @date 19:41 2024/10/21 - * @param id 退料单主表ID - **/ + **/ @GetMapping("/confirmBack") @Operation(summary = "员工确认退料") - public CommonResult confirmBack(@RequestParam("id") String id){ + public CommonResult confirmBack(@RequestParam("id") String id) { dlRepairSoService.confirmBack(id); return CommonResult.ok(); } + + + /** + * 采购入库 + * + * @param repairSoReqVO DlRepairSoReqVO实体 + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + * @author PQZ + * @date 10:43 2024/10/25 + **/ + @PostMapping("/inWare") + @Operation(summary = "采购入库") + public CommonResult inWare(@RequestBody DlRepairSoReqVO repairSoReqVO) { + dlRepairSoService.inWare(repairSoReqVO); + return CommonResult.ok(); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java index 4e5fecc2..55f42979 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java @@ -18,6 +18,7 @@ import cn.iocoder.yudao.module.stockOperate.service.DlRepairSoService; import cn.iocoder.yudao.module.stockOperate.service.DlRepairSoiService; import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoReqVO; import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoRespVO; +import cn.iocoder.yudao.module.supplier.service.BaseSupplierService; import cn.iocoder.yudao.module.system.api.dept.DeptApi; import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; import cn.iocoder.yudao.module.system.api.user.AdminUserApi; @@ -36,6 +37,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.apache.commons.lang3.StringUtils; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; @@ -91,6 +93,8 @@ public class DlRepairSoServiceImpl extends ServiceImpl wares = items.stream().filter(item -> item.getItemType().equals("02")).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(wares)) { + // 单位字典 + List recordTypeList = dictDataApi.getDictDataList(DICT_REPAIR_UNIT); + Map unitMap = recordTypeList.stream().collect(Collectors.toMap(DictDataRespDTO::getValue,DictDataRespDTO::getLabel)); + Set ids = wares.stream().map(DlRepairTitemReqVO::getPartId).collect(Collectors.toSet()); List repairWares = waresService.listByIds(ids); - items.forEach(item -> repairWares.stream().filter(i -> i.getId().equals(item.getPartId())).findFirst().ifPresent(item::setWare)); + items.forEach(item -> { + repairWares.stream().filter(i -> i.getId().equals(item.getPartId())).findFirst().ifPresent(item::setWare); + item.setItemUnit(unitMap.get(item.getItemUnit())); + }); } result.setWares(wares); // 取附加 diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTwItemServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTwItemServiceImpl.java index 8975a29f..d4cc0054 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTwItemServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTwItemServiceImpl.java @@ -4,9 +4,10 @@ import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import cn.iocoder.yudao.module.project.entity.RepairWares; import cn.iocoder.yudao.module.project.service.RepairWaresService; +import cn.iocoder.yudao.module.system.api.dict.DictDataApi; +import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO; import cn.iocoder.yudao.module.tickets.entity.DlTwItem; import cn.iocoder.yudao.module.tickets.mapper.DlTwItemMapper; -import cn.iocoder.yudao.module.tickets.service.DlTicketWaresService; import cn.iocoder.yudao.module.tickets.service.DlTwItemService; import cn.iocoder.yudao.module.tickets.vo.DlTwItemReqVO; import cn.iocoder.yudao.module.tickets.vo.DlTwItemRespVO; @@ -20,6 +21,8 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import static cn.iocoder.yudao.common.RepairCons.DICT_REPAIR_UNIT; + /** * 针对表【dl_tw_item(工单配件申请/退回子表)】的数据库操作Service实现 * @@ -32,10 +35,8 @@ public class DlTwItemServiceImpl extends ServiceImpl @Resource private RepairWaresService repairWaresService; - @Resource - @Lazy - private DlTicketWaresService ticketWaresService; + private DictDataApi dictDataApi; @Resource @Lazy private RepairWaresService waresService; @@ -57,6 +58,9 @@ public class DlTwItemServiceImpl extends ServiceImpl for(Map map:typeMapList){ typeMap.put(map.get("id"),map.get("name")); } + // 单位字典 + List recordTypeList = dictDataApi.getDictDataList(DICT_REPAIR_UNIT); + Map unitMap = recordTypeList.stream().collect(Collectors.toMap(DictDataRespDTO::getValue,DictDataRespDTO::getLabel)); // 查配件详情 List ids = dlTwItems.stream().map(DlTwItem::getWaresId).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(ids)){ @@ -68,6 +72,7 @@ public class DlTwItemServiceImpl extends ServiceImpl .findFirst() .ifPresent(bean::setWares); bean.setTypeName(typeMap.get(bean.getWares().getType())); + bean.getWares().setUnit(unitMap.get(bean.getWares().getUnit())); return bean; }).collect(Collectors.toList()); } diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueDriverInfoServiceImpl.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueDriverInfoServiceImpl.java index 6653d5a5..372f0a7a 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueDriverInfoServiceImpl.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueDriverInfoServiceImpl.java @@ -3,9 +3,14 @@ package cn.iocoder.yudao.module.rescue.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.CoordinateUtil; import cn.hutool.http.HttpUtil; +import cn.iocoder.yudao.module.custom.entity.CustomerMain; +import cn.iocoder.yudao.module.custom.service.CustomerMainService; +import cn.iocoder.yudao.module.partner.entity.PartnerCustomerInfo; +import cn.iocoder.yudao.module.partner.service.IPartnerCustomerInfoService; import cn.iocoder.yudao.module.rescue.domain.*; import cn.iocoder.yudao.module.rescue.mapper.RescueDriverInfoMapper; import cn.iocoder.yudao.module.rescue.utils.RedissonDelayQueue; +import cn.iocoder.yudao.module.shop.entity.ShopUserCar; import cn.iocoder.yudao.module.system.api.dict.DictDataApi; import cn.iocoder.yudao.module.system.api.user.AdminUserApi; import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; @@ -72,6 +77,10 @@ public class RescueDriverInfoServiceImpl extends ServiceImpl userCarList = new ArrayList<>(); + ShopUserCar userCar = new ShopUserCar(); + userCar.setCarNo(rescueInfo.getLicenseNum()); + userCar.setCarModel(rescueInfo.getCarType()); + userCar.setCarBrand(rescueInfo.getCarBrand()); + userCar.setUserId(user.getId()); + userCarList.add(userCar); + + customerInfo.setUserCarList(userCarList); + + // 设置客户来源 + CustomerMain customerMain = new CustomerMain(); + customerMain.setDataFrom("02"); + customerMainService.saveOrUpdate(customerMain); + + // 调用插入客户信息的方法 + customerInfoService.insertPartnerCustomerInfo(customerInfo); + + //所在顶级机构 String redisKey = Redis_Driver_Key + driverInfo.getTenantId() + ":" + rescueInfo.getDriverId(); Object temp = redisCache.getCacheMapValue(redisKey, "rescueIds"); @@ -588,7 +624,7 @@ public class RescueDriverInfoServiceImpl extends ServiceImpl