diff --git a/dq-financial-api/src/main/java/com/daqing/financial/crms/CustomerControllerApi.java b/dq-financial-api/src/main/java/com/daqing/financial/crms/CustomerControllerApi.java new file mode 100644 index 00000000..b788fc73 --- /dev/null +++ b/dq-financial-api/src/main/java/com/daqing/financial/crms/CustomerControllerApi.java @@ -0,0 +1,18 @@ +package com.daqing.financial.crms; + +import com.daqing.framework.model.response.ResponseResult; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; + +import java.util.Map; + +@Api(value = "客户相关操作", tags = "提供用户测评信息增删改查等相关方法") +public interface CustomerControllerApi { + + /** + * 列表展示 + */ + @ApiOperation(value = "列表展示", notes = "列表展示") + ResponseResult list(Map params); + +} diff --git a/dq-financial-api/src/main/java/com/daqing/financial/crms/TestFeignControllerApi.java b/dq-financial-api/src/main/java/com/daqing/financial/crms/TestFeignControllerApi.java deleted file mode 100644 index 59112eae..00000000 --- a/dq-financial-api/src/main/java/com/daqing/financial/crms/TestFeignControllerApi.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.daqing.financial.crms; - -public interface TestFeignControllerApi { -} diff --git a/dq-financial-crms/pom.xml b/dq-financial-crms/pom.xml index 8d91fd39..e9f92db3 100644 --- a/dq-financial-crms/pom.xml +++ b/dq-financial-crms/pom.xml @@ -35,6 +35,11 @@ dq-framework-utils 0.0.1-SNAPSHOT + + com.daqing.financial + dq-financial-api + 0.0.1-SNAPSHOT + org.springframework.boot spring-boot-starter-web diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CompanyCustomerController.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CompanyCustomerController.java deleted file mode 100644 index 8e4cee6b..00000000 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CompanyCustomerController.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.daqing.financial.crms.controller; - -import java.util.Arrays; -import java.util.Map; - -import com.daqing.framework.model.response.ResponseResult; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import com.daqing.framework.domain.crms.CompanyCustomerEntity; -import com.daqing.financial.crms.service.CompanyCustomerService; -import com.daqing.framework.utils.PageUtils; - -/** - * 企业类型客户信息表 - * - * @author gongsj - * @email gongsj@gmail.com - * @date 2020-09-08 09:57:32 - */ -@RestController -@RequestMapping("crms/companycustomer") -public class CompanyCustomerController { - @Autowired - private CompanyCustomerService companyCustomerService; - - /** - * 列表 - */ - @GetMapping("/list") - //@RequiresPermissions("crms:companycustomer:list") - public ResponseResult list(@RequestParam Map params){ - PageUtils page = companyCustomerService.queryPage(params); - - return ResponseResult.SUCCESS(); - } - - - /** - * 信息 - */ - @GetMapping("/info/{id}") - //@RequiresPermissions("crms:companycustomer:info") - public ResponseResult info(@PathVariable("id") Long id){ - CompanyCustomerEntity companyCustomer = companyCustomerService.getById(id); - - return ResponseResult.SUCCESS(); - } - - /** - * 保存 - */ - @PostMapping("/save") - //@RequiresPermissions("crms:companycustomer:save") - public ResponseResult save(@RequestBody CompanyCustomerEntity companyCustomer){ - companyCustomerService.save(companyCustomer); - - return ResponseResult.SUCCESS(); - } - - /** - * 修改 - */ - @PutMapping("/update") - //@RequiresPermissions("crms:companycustomer:update") - public ResponseResult update(@RequestBody CompanyCustomerEntity companyCustomer){ - companyCustomerService.updateById(companyCustomer); - - return ResponseResult.SUCCESS(); - } - - /** - * 删除 - */ - @DeleteMapping("/delete") - //@RequiresPermissions("crms:companycustomer:delete") - public ResponseResult delete(@RequestBody Long[] ids){ - companyCustomerService.removeByIds(Arrays.asList(ids)); - - return ResponseResult.SUCCESS(); - } - -} diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerController.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerController.java index a239d800..6b8b3c6a 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerController.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerController.java @@ -1,5 +1,7 @@ package com.daqing.financial.crms.controller; +import com.daqing.financial.crms.CustomerControllerApi; +import com.daqing.financial.crms.feign.HrmsFeignService; import com.daqing.financial.crms.service.CustomerService; import com.daqing.framework.domain.crms.CustomerEntity; import com.daqing.framework.model.response.ResponseResult; @@ -7,8 +9,7 @@ import com.daqing.framework.utils.PageUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.Arrays; -import java.util.Map; +import java.util.*; /** @@ -20,10 +21,14 @@ import java.util.Map; */ @RestController @RequestMapping("crms/customer") -public class CustomerController { +public class CustomerController implements CustomerControllerApi { + @Autowired private CustomerService customerService; + @Autowired + HrmsFeignService hrmsFeignService; + /** * 列表 */ @@ -31,8 +36,23 @@ public class CustomerController { //@RequiresPermissions("crms:customer:list") public ResponseResult list(@RequestParam Map params) { PageUtils page = customerService.queryPage(params); + List list = new ArrayList<>(); + list.add("张三"); + list.add("李四"); + list.add("王五"); + list.add("赵六"); + list.add("孙七"); + return new ResponseResult(true, 200, list, "success"); + } - return ResponseResult.SUCCESS(); + /** + * 列表 + */ + @GetMapping("/hrms_list") + //@RequiresPermissions("hrms:dept:list") + public ResponseResult hrmsList() { + Map params = new HashMap<>(); + return hrmsFeignService.list(params); } diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/PersonalCustomerController.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/PersonalCustomerController.java deleted file mode 100644 index 845d0ceb..00000000 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/PersonalCustomerController.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.daqing.financial.crms.controller; - -import com.daqing.financial.crms.service.PersonalCustomerService; -import com.daqing.framework.domain.crms.PersonalCustomerEntity; -import com.daqing.framework.model.response.ResponseResult; -import com.daqing.framework.utils.PageUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.Arrays; -import java.util.Map; - -/** - * 个人类型客户信息表 - * - * @author gongsj - * @email gongsj@gmail.com - * @date 2020-09-08 09:57:32 - */ -@RestController -@RequestMapping("crms/personalcustomer") -public class PersonalCustomerController { - @Autowired - private PersonalCustomerService personalCustomerService; - - /** - * 列表 - */ - @GetMapping("/list") - //@RequiresPermissions("crms:personalcustomer:list") - public ResponseResult list(@RequestParam Map params) { - PageUtils page = personalCustomerService.queryPage(params); - - return ResponseResult.SUCCESS(); - } - - - /** - * 信息 - */ - @GetMapping("/info/{id}") - //@RequiresPermissions("crms:personalcustomer:info") - public ResponseResult info(@PathVariable("id") Long id) { - PersonalCustomerEntity personalCustomer = personalCustomerService.getById(id); - - return ResponseResult.SUCCESS(); - } - - /** - * 保存 - */ - @PostMapping("/save") - //@RequiresPermissions("crms:personalcustomer:save") - public ResponseResult save(@RequestBody PersonalCustomerEntity personalCustomer) { - personalCustomerService.save(personalCustomer); - - return ResponseResult.SUCCESS(); - } - - /** - * 修改 - */ - @PutMapping("/update") - //@RequiresPermissions("crms:personalcustomer:update") - public ResponseResult update(@RequestBody PersonalCustomerEntity personalCustomer) { - personalCustomerService.updateById(personalCustomer); - - return ResponseResult.SUCCESS(); - } - - /** - * 删除 - */ - @DeleteMapping("/delete") - //@RequiresPermissions("crms:personalcustomer:delete") - public ResponseResult delete(@RequestBody Long[] ids) { - personalCustomerService.removeByIds(Arrays.asList(ids)); - - return ResponseResult.SUCCESS(); - } - -} diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/TestFeignController.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/TestFeignController.java deleted file mode 100644 index 081df766..00000000 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/TestFeignController.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.daqing.financial.crms.controller; - -import com.daqing.financial.crms.feign.HrmsFeignService; -import com.daqing.framework.model.response.ResponseResult; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 记录部门信息 - * - * @author gongsj - * @email gongsj@gmail.com - * @date 2020-09-07 16:26:04 - */ -@RestController -@RequestMapping("crms") -public class TestFeignController { - - @Autowired - HrmsFeignService hrmsFeignService; - - /** - * 列表 - */ - @GetMapping("/list") - //@RequiresPermissions("hrms:dept:list") - public ResponseResult list() { - List list = new ArrayList<>(); - list.add("张三"); - list.add("李四"); - list.add("王五"); - list.add("赵六"); - list.add("孙七"); - return new ResponseResult(true, 200, list, "success"); - } - - /** - * 列表 - */ - @GetMapping("/hrms_list") - //@RequiresPermissions("hrms:dept:list") - public ResponseResult hrmsList() { - Map params = new HashMap<>(); - return hrmsFeignService.list(params); - } -} diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/CompanyCustomerService.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/CompanyCustomerService.java deleted file mode 100644 index 673ee2e1..00000000 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/CompanyCustomerService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.daqing.financial.crms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.daqing.framework.domain.crms.CompanyCustomerEntity; -import com.daqing.framework.utils.PageUtils; - -import java.util.Map; - -/** - * 企业类型客户信息表 - * - * @author gongsj - * @email gongsj@gmail.com - * @date 2020-09-08 09:57:32 - */ -public interface CompanyCustomerService extends IService { - - PageUtils queryPage(Map params); -} - diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/PersonalCustomerService.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/PersonalCustomerService.java deleted file mode 100644 index 4e42a9db..00000000 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/PersonalCustomerService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.daqing.financial.crms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.daqing.framework.utils.PageUtils; -import com.daqing.framework.domain.crms.PersonalCustomerEntity; - -import java.util.Map; - -/** - * 个人类型客户信息表 - * - * @author gongsj - * @email gongsj@gmail.com - * @date 2020-09-08 09:57:32 - */ -public interface PersonalCustomerService extends IService { - - PageUtils queryPage(Map params); -} - diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CompanyCustomerServiceImpl.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CompanyCustomerServiceImpl.java deleted file mode 100644 index cb173c4c..00000000 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CompanyCustomerServiceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.daqing.financial.crms.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.daqing.financial.crms.dao.CompanyCustomerDao; -import com.daqing.financial.crms.service.CompanyCustomerService; -import com.daqing.framework.domain.crms.CompanyCustomerEntity; -import com.daqing.framework.utils.PageUtils; -import com.daqing.framework.utils.Query; -import org.springframework.stereotype.Service; - -import java.util.Map; - - -@Service("companyCustomerService") -public class CompanyCustomerServiceImpl extends ServiceImpl implements CompanyCustomerService { - - @Override - public PageUtils queryPage(Map params) { - IPage page = this.page( - new Query().getPage(params), - new QueryWrapper() - ); - - return new PageUtils(page); - } - -} \ No newline at end of file diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/PersonalCustomerServiceImpl.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/PersonalCustomerServiceImpl.java deleted file mode 100644 index 6abee02a..00000000 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/PersonalCustomerServiceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.daqing.financial.crms.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.daqing.financial.crms.dao.PersonalCustomerDao; -import com.daqing.financial.crms.service.PersonalCustomerService; -import com.daqing.framework.domain.crms.PersonalCustomerEntity; -import com.daqing.framework.utils.PageUtils; -import com.daqing.framework.utils.Query; -import org.springframework.stereotype.Service; - -import java.util.Map; - - -@Service("personalCustomerService") -public class PersonalCustomerServiceImpl extends ServiceImpl implements PersonalCustomerService { - - @Override - public PageUtils queryPage(Map params) { - IPage page = this.page( - new Query().getPage(params), - new QueryWrapper() - ); - - return new PageUtils(page); - } - -} \ No newline at end of file diff --git a/dq-financial-crms/src/main/resources/mapper/crms/CustomerDao.xml b/dq-financial-crms/src/main/resources/mapper/crms/CustomerDao.xml index 75cafeba..e277e9ad 100644 --- a/dq-financial-crms/src/main/resources/mapper/crms/CustomerDao.xml +++ b/dq-financial-crms/src/main/resources/mapper/crms/CustomerDao.xml @@ -14,6 +14,8 @@ + + diff --git a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/DeptController.java b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/DeptController.java index f706e90e..fc4eb2f4 100644 --- a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/DeptController.java +++ b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/DeptController.java @@ -1,6 +1,7 @@ package com.daqing.financial.hrms.controller; import java.util.Arrays; +import java.util.HashMap; import java.util.Map; import com.daqing.financial.hrms.feign.CrmsFeignService; @@ -35,7 +36,7 @@ public class DeptController { @GetMapping("/crms_list") //@RequiresPermissions("hrms:dept:list") public ResponseResult crmsList(){ - return crmsFeignService.list(); + return crmsFeignService.list(new HashMap<>()); } /** diff --git a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/feign/CrmsFeignService.java b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/feign/CrmsFeignService.java index 55052e2f..497d52e0 100644 --- a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/feign/CrmsFeignService.java +++ b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/feign/CrmsFeignService.java @@ -3,6 +3,9 @@ package com.daqing.financial.hrms.feign; import com.daqing.framework.model.response.ResponseResult; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.Map; /** * 这是一个声明式的远程调用 @@ -10,7 +13,7 @@ import org.springframework.web.bind.annotation.GetMapping; @FeignClient("dq-financial-crms") public interface CrmsFeignService { - @GetMapping("/crms/list") - ResponseResult list(); + @GetMapping("/crms/customer/list") + ResponseResult list(@RequestParam Map params); } diff --git a/dq-framework-common/src/main/java/com/daqing/framework/config/MybatisPlusConfig.java b/dq-framework-common/src/main/java/com/daqing/framework/config/MybatisPlusConfig.java new file mode 100644 index 00000000..b4637eb0 --- /dev/null +++ b/dq-framework-common/src/main/java/com/daqing/framework/config/MybatisPlusConfig.java @@ -0,0 +1,18 @@ +package com.daqing.framework.config; + +import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class MybatisPlusConfig { + /** + * mybatis-plus分页插件 + */ + @Bean + public PaginationInterceptor paginationInterceptor() { + PaginationInterceptor page = new PaginationInterceptor(); + page.setDialectType("mysql"); + return page; + } +} \ No newline at end of file diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/CustomerEntity.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/CustomerEntity.java index 783efa3b..cf1beb22 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/CustomerEntity.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/CustomerEntity.java @@ -12,7 +12,7 @@ import lombok.Data; * * @author gongsj * @email gongsj@gmail.com - * @date 2020-09-08 09:57:32 + * @date 2020-09-08 11:23:28 */ @Data @TableName("crms_customer") @@ -56,6 +56,14 @@ public class CustomerEntity implements Serializable { * 微信唯一标识 */ private String wechatId; + /** + * 0:未删除,1:已删除 + */ + private Integer delOrNot; + /** + * 0:启用,1:禁用 + */ + private Integer status; /** * 创建时间 */