| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | @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 参数设置客户类型(私海/公海) |
| | |
| | | }); |
| | | } |
| | | this.saveOrUpdateBatch(userList); |
| | | return AjaxResult.success(true); |
| | | return R.ok(true); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return AjaxResult.error("导入失败"); |
| | | return R.fail("导入失败"); |
| | | } |
| | | |
| | | } |
| | |
| | | customer.setUsageStatus(0L); |
| | | customer.setUsageUser(0L); |
| | | customerMapper.updateById(customer); |
| | | |
| | | |
| | | // 删除该客户的所有共享关系 |
| | | customerUserService.remove( |
| | | new QueryWrapper<CustomerUser>().lambda() |
| | |
| | | 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); |
| | | } |
| | | |
| | | /** |
| | | * 下划线命名转驼峰命名 |
| | | */ |
| | |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | } |
| | | } |