src/main/java/com/ruoyi/ai/tools/ApproveTodoTools.java
@@ -707,6 +707,7 @@ case 6 -> "报价审批"; case 7 -> "发货审批"; case 8 -> "危险作业审批"; case 9 -> "办公用品审批"; default -> "类型" + type; }; } src/main/java/com/ruoyi/approve/service/impl/ApproveNodeServiceImpl.java
@@ -301,6 +301,8 @@ return "发货审批"; case 8: return "危险作业审批"; case 9: return "办公用品审批"; } return null; } src/main/java/com/ruoyi/approve/service/impl/ApproveProcessServiceImpl.java
@@ -451,6 +451,8 @@ return "发货审批"; case 8: return "危险作业审批"; case 9: return "办公用品审批"; } return null; } src/main/java/com/ruoyi/basic/controller/CustomerController.java
@@ -10,13 +10,12 @@ import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.domain.R; import jakarta.servlet.http.HttpServletResponse; import lombok.AllArgsConstructor; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import jakarta.servlet.http.HttpServletResponse; import java.util.List; /** @@ -63,7 +62,7 @@ */ @Log(title = "客户档案", businessType = BusinessType.IMPORT) @PostMapping("/importData") public AjaxResult importData(MultipartFile file, Integer type) throws Exception { public R importData(MultipartFile file, Integer type) throws Exception { return customerService.importData(file, type); } @@ -72,8 +71,8 @@ * 获取客户档案详细信息 */ @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(customerService.selectCustomerDetailById(id)); public R getInfo(@PathVariable("id") Long id) { return R.ok(customerService.selectCustomerDetailById(id)); } /** @@ -81,8 +80,8 @@ */ @Log(title = "客户档案", businessType = BusinessType.INSERT) @PostMapping("/addCustomer") public AjaxResult add(@RequestBody Customer customer) { return toAjax(customerService.insertCustomer(customer)); public R add(@RequestBody Customer customer) { return R.ok(customerService.insertCustomer(customer)); } /** @@ -90,8 +89,8 @@ */ @Log(title = "客户档案", businessType = BusinessType.UPDATE) @PostMapping("/updateCustomer") public AjaxResult edit(@RequestBody Customer customer) { return toAjax(customerService.updateCustomer(customer)); public R edit(@RequestBody Customer customer) { return R.ok(customerService.updateCustomer(customer)); } /** @@ -99,11 +98,11 @@ */ @Log(title = "客户档案", businessType = BusinessType.DELETE) @DeleteMapping("/delCustomer") public AjaxResult remove(@RequestBody Long[] ids) { public R remove(@RequestBody Long[] ids) { if (ids == null || ids.length == 0) { return AjaxResult.error("请传入要删除的ID"); return R.fail("请传入要删除的ID"); } return toAjax(customerService.deleteCustomerByIds(ids)); return R.ok(customerService.deleteCustomerByIds(ids)); } /** @@ -120,9 +119,9 @@ */ @Log(title = "客户档案", businessType = BusinessType.OTHER) @PostMapping("/assignCustomer") public AjaxResult assignCustomer(@RequestBody CustomerDto customer) { public R assignCustomer(@RequestBody CustomerDto customer) { customerService.assignCustomer(customer); return AjaxResult.success(); return R.ok(); } /** @@ -130,9 +129,9 @@ */ @Log(title = "客户档案", businessType = BusinessType.OTHER) @PostMapping("/recycleCustomer") public AjaxResult recycleCustomer(@RequestBody CustomerDto customer) { public R recycleCustomer(@RequestBody CustomerDto customer) { customerService.recycleCustomer(customer); return AjaxResult.success(); return R.ok(); } /** @@ -140,8 +139,17 @@ */ @Log(title = "客户档案", businessType = BusinessType.OTHER) @PostMapping("/together") public AjaxResult together(@RequestBody CustomerDto customer) { public R together(@RequestBody CustomerDto customer) { customerService.together(customer); return AjaxResult.success(); return R.ok(); } /** * 私海客户流回公海 */ @Log(title = "客户档案", businessType = BusinessType.OTHER) @PostMapping("/back") public R back(Long id) { return R.ok(customerService.back(id)); } } src/main/java/com/ruoyi/basic/service/ICustomerService.java
@@ -6,7 +6,7 @@ import com.ruoyi.basic.dto.CustomerDto; import com.ruoyi.basic.pojo.Customer; import com.ruoyi.basic.vo.CustomerVo; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.domain.R; import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -77,7 +77,7 @@ List<CustomerVo> selectCustomerLists(CustomerDto customer); AjaxResult importData(MultipartFile file, Integer type); R importData(MultipartFile file, Integer type); IPage<CustomerVo> selectCustomerList(Page<CustomerDto> page, CustomerDto customer); @@ -91,4 +91,6 @@ * @param customerDto 客户DTO(包含客户ID和共享用户ID列表) */ void together(CustomerDto customerDto); Boolean back(Long id); } src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
@@ -10,18 +10,17 @@ import com.ruoyi.basic.dto.CustomerDto; import com.ruoyi.basic.dto.CustomerFollowUpDto; import com.ruoyi.basic.mapper.CustomerMapper; import com.ruoyi.basic.pojo.*; import com.ruoyi.basic.service.CustomerFollowUpFileService; import com.ruoyi.basic.service.CustomerFollowUpService; import com.ruoyi.basic.service.CustomerReturnVisitService; import com.ruoyi.basic.service.CustomerUserService; import com.ruoyi.basic.service.ICustomerService; import com.ruoyi.basic.pojo.Customer; import com.ruoyi.basic.pojo.CustomerFollowUp; import com.ruoyi.basic.pojo.CustomerFollowUpFile; import com.ruoyi.basic.pojo.CustomerUser; import com.ruoyi.basic.service.*; import com.ruoyi.basic.vo.CustomerVo; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.security.LoginUser; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.domain.R; import com.ruoyi.sales.mapper.SalesLedgerMapper; import com.ruoyi.sales.pojo.SalesLedger; import lombok.AllArgsConstructor; @@ -261,12 +260,12 @@ } @Override public AjaxResult importData(MultipartFile file, Integer type) { public R importData(MultipartFile file, Integer type) { try { ExcelUtil<Customer> util = new ExcelUtil<Customer>(Customer.class); List<Customer> userList = util.importExcel(file.getInputStream()); if (CollectionUtils.isEmpty(userList)) { return AjaxResult.warn("模板错误或导入数据为空"); return R.fail("模板错误或导入数据为空"); } // 根据 type 参数设置客户类型(私海/公海) @@ -276,10 +275,10 @@ }); } this.saveOrUpdateBatch(userList); return AjaxResult.success(true); return R.ok(true); } catch (Exception e) { e.printStackTrace(); return AjaxResult.error("导入失败"); return R.fail("导入失败"); } } @@ -371,6 +370,15 @@ customerUserService.saveBatch(customerUsers); } @Override public Boolean back(Long id) { //将客户的type改为1 且直接分配给当前用户 Customer customer = customerMapper.selectById(id); customer.setType(1); customer.setIsAssigned(1); return this.updateById(customer); } /** * 下划线命名转驼峰命名 */