|
|
@@ -4,11 +4,9 @@ import jakarta.servlet.http.HttpServletResponse;
|
|
|
import jakarta.validation.constraints.NotEmpty;
|
|
|
import jakarta.validation.constraints.NotNull;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
-import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.dromara.common.core.domain.R;
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
import org.dromara.common.core.validate.AddGroup;
|
|
|
-import org.dromara.common.excel.core.ExcelResult;
|
|
|
import org.dromara.common.excel.utils.ExcelUtil;
|
|
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
|
|
import org.dromara.common.log.annotation.Log;
|
|
|
@@ -16,22 +14,18 @@ import org.dromara.common.log.enums.BusinessType;
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
import org.dromara.common.web.core.BaseController;
|
|
|
-import org.dromara.customer.domain.bo.CustomerInfoBo;
|
|
|
-import org.dromara.customer.domain.bo.CustomerListBo;
|
|
|
-import org.dromara.customer.domain.bo.CustomerSalesInfoBo;
|
|
|
-import org.dromara.customer.domain.bo.MessagePublishCustomerBo;
|
|
|
+import org.dromara.customer.domain.bo.*;
|
|
|
import org.dromara.customer.domain.dto.SetCustomerInfoTagDto;
|
|
|
import org.dromara.customer.domain.vo.*;
|
|
|
-import org.dromara.customer.listener.CustomerImportListener;
|
|
|
+import org.dromara.customer.service.ICustomerDictService;
|
|
|
import org.dromara.customer.service.ICustomerInfoService;
|
|
|
-import org.dromara.system.api.RemoteProductTaxrateService;
|
|
|
-import org.dromara.system.api.*;
|
|
|
-import org.springframework.http.MediaType;
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+import org.dromara.system.api.domain.vo.RemoteComCompanyVo;
|
|
|
+import org.dromara.system.api.domain.vo.RemoteDeptVo;
|
|
|
+import org.dromara.system.api.domain.vo.RemoteDictDataVo;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -46,25 +40,6 @@ import java.util.List;
|
|
|
@RestController
|
|
|
@RequestMapping("/customerInfo")
|
|
|
public class CustomerInfoController extends BaseController {
|
|
|
- @DubboReference
|
|
|
- private RemoteComCompanyService remoteComCompanyService;
|
|
|
-
|
|
|
- @DubboReference
|
|
|
- private RemoteCreditLevelService remoteCreditLevelService;
|
|
|
- @DubboReference
|
|
|
- private RemoteComCurrencyService remoteComCurrencyService;
|
|
|
-
|
|
|
- @DubboReference
|
|
|
- private RemoteComCustomerTypeService remoteComCustomerTypeService;
|
|
|
- @DubboReference
|
|
|
- private RemoteProductTaxrateService remoteProductTaxrateService;
|
|
|
- @DubboReference
|
|
|
- private RemoteComCustomerLevelService remoteComCustomerLevelService;
|
|
|
- @DubboReference
|
|
|
- private RemoteComStaffService remoteComStaffService;
|
|
|
-
|
|
|
- @DubboReference
|
|
|
- private RemoteErpStaffService remoteErpStaffService;
|
|
|
|
|
|
private final ICustomerInfoService customerInfoService;
|
|
|
|
|
|
@@ -228,20 +203,58 @@ public class CustomerInfoController extends BaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 导入数据
|
|
|
- *
|
|
|
- * @param file 导入文件
|
|
|
- * @param updateSupport 是否更新已存在数据
|
|
|
+ * 查询客户公海信息列表
|
|
|
+ */
|
|
|
+ @SaCheckPermission("customer:pool:list")
|
|
|
+ @GetMapping("/highseas")
|
|
|
+ public TableDataInfo<HighSeasListVo> highSeasList(HighSeasQueryBo bo, PageQuery pageQuery) {
|
|
|
+ return customerInfoService.queryHighSeasPage(bo, pageQuery);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 认领客户
|
|
|
+ */
|
|
|
+ @SaCheckPermission("customer:pool:claim")
|
|
|
+ @Log(title = "客户公海", businessType = BusinessType.UPDATE)
|
|
|
+ @PostMapping("/claim")
|
|
|
+ public R<Void> claim(@RequestBody ClaimBo bo) {
|
|
|
+ return toAjax(customerInfoService.claim(bo));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分配客户
|
|
|
+ */
|
|
|
+ @SaCheckPermission("customer:pool:allocate")
|
|
|
+ @Log(title = "客户公海", businessType = BusinessType.UPDATE)
|
|
|
+ @GetMapping("/allocate")
|
|
|
+ public R<Void> allocate(Long id, Long userId) {
|
|
|
+ return toAjax(customerInfoService.allocate(id, userId));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 退回到公海
|
|
|
+ */
|
|
|
+ @SaCheckPermission("customer:pool:release")
|
|
|
+ @Log(title = "客户公海", businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping("/release")
|
|
|
+ public R<Void> releaseToPool(Long customerId, String reason) {
|
|
|
+ return toAjax(customerInfoService.releaseToPool(customerId, reason));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取归属公司下拉列表
|
|
|
*/
|
|
|
- @Log(title = "客户信息", businessType = BusinessType.IMPORT)
|
|
|
- @PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
|
|
- public R<Void> importData(@RequestPart("file") MultipartFile file, boolean updateSupport) throws Exception {
|
|
|
- ExcelResult<CustomerInfoImportVo> result = ExcelUtil.importExcel(file.getInputStream(), CustomerInfoImportVo.class, new CustomerImportListener(updateSupport, remoteComCompanyService, remoteComCustomerLevelService, remoteCreditLevelService, remoteComCurrencyService, remoteComCustomerTypeService, remoteProductTaxrateService, remoteComStaffService, remoteErpStaffService));
|
|
|
- return R.ok(result.getAnalysis());
|
|
|
+ @GetMapping("/companyOptionList")
|
|
|
+ public R<List<RemoteComCompanyVo>> companyOptionList() {
|
|
|
+ return R.ok(customerInfoService.selectCompanyOptionList());
|
|
|
}
|
|
|
|
|
|
- @PostMapping("/importTemplate")
|
|
|
- public void importTemplate(HttpServletResponse response) {
|
|
|
- ExcelUtil.exportExcel(new ArrayList<>(), "客户数据", CustomerInfoImportVo.class, response);
|
|
|
+ /**
|
|
|
+ * 获取客户等级下拉列表
|
|
|
+ */
|
|
|
+ @GetMapping("/levelOptionList")
|
|
|
+ public R<List<RemoteDictDataVo>> levelOptionList() {
|
|
|
+ return R.ok(customerInfoService.selectLevelOptionList());
|
|
|
}
|
|
|
}
|
|
|
+
|