Commit 2a78d53403ab8d59c04d56acb283074d9757898c
Merge remote-tracking branch 'origin/master_0929' into master_0929
Showing
8 changed files
with
142 additions
and
94 deletions
| @@ -45,7 +45,7 @@ public class OfficeController extends DefaultBaseController { | @@ -45,7 +45,7 @@ public class OfficeController extends DefaultBaseController { | ||
| 45 | * 查询列表 | 45 | * 查询列表 |
| 46 | */ | 46 | */ |
| 47 | @ApiOperation("查询列表") | 47 | @ApiOperation("查询列表") |
| 48 | - @HasPermission({"base-data:office:query"}) | 48 | + @HasPermission({"base-data:section-office:query"}) |
| 49 | @GetMapping("/query") | 49 | @GetMapping("/query") |
| 50 | public InvokeResult<PageResult<GetOfficeBo>> query(@Valid QueryOfficeVo vo) { | 50 | public InvokeResult<PageResult<GetOfficeBo>> query(@Valid QueryOfficeVo vo) { |
| 51 | PageResult<Office> pageResult = officeService.query(getPageIndex(vo), getPageSize(vo), vo); | 51 | PageResult<Office> pageResult = officeService.query(getPageIndex(vo), getPageSize(vo), vo); |
| @@ -63,7 +63,7 @@ public class OfficeController extends DefaultBaseController { | @@ -63,7 +63,7 @@ public class OfficeController extends DefaultBaseController { | ||
| 63 | */ | 63 | */ |
| 64 | @ApiOperation("根据ID查询") | 64 | @ApiOperation("根据ID查询") |
| 65 | @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) | 65 | @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) |
| 66 | - @HasPermission({"base-data:office:query"}) | 66 | + @HasPermission({"base-data:section-office:query"}) |
| 67 | @GetMapping | 67 | @GetMapping |
| 68 | public InvokeResult<GetOfficeBo> get(@NotBlank(message = "id不能为空!") String id) { | 68 | public InvokeResult<GetOfficeBo> get(@NotBlank(message = "id不能为空!") String id) { |
| 69 | Office data = officeService.findById(id); | 69 | Office data = officeService.findById(id); |
| @@ -79,7 +79,7 @@ public class OfficeController extends DefaultBaseController { | @@ -79,7 +79,7 @@ public class OfficeController extends DefaultBaseController { | ||
| 79 | * 新增 | 79 | * 新增 |
| 80 | */ | 80 | */ |
| 81 | @ApiOperation("新增") | 81 | @ApiOperation("新增") |
| 82 | - @HasPermission({"base-data:office:add"}) | 82 | + @HasPermission({"base-data:section-office:add"}) |
| 83 | @PostMapping | 83 | @PostMapping |
| 84 | public InvokeResult<Void> create(@Valid CreateOfficeVo vo) { | 84 | public InvokeResult<Void> create(@Valid CreateOfficeVo vo) { |
| 85 | officeService.create(vo); | 85 | officeService.create(vo); |
| @@ -90,7 +90,7 @@ public class OfficeController extends DefaultBaseController { | @@ -90,7 +90,7 @@ public class OfficeController extends DefaultBaseController { | ||
| 90 | * 修改 | 90 | * 修改 |
| 91 | */ | 91 | */ |
| 92 | @ApiOperation("修改") | 92 | @ApiOperation("修改") |
| 93 | - @HasPermission({"base-data:office:modify"}) | 93 | + @HasPermission({"base-data:section-office:modify"}) |
| 94 | @PutMapping | 94 | @PutMapping |
| 95 | public InvokeResult<Void> update(@Valid UpdateOfficeVo vo) { | 95 | public InvokeResult<Void> update(@Valid UpdateOfficeVo vo) { |
| 96 | officeService.update(vo); | 96 | officeService.update(vo); |
| @@ -102,7 +102,7 @@ public class OfficeController extends DefaultBaseController { | @@ -102,7 +102,7 @@ public class OfficeController extends DefaultBaseController { | ||
| 102 | */ | 102 | */ |
| 103 | @ApiOperation("根据ID删除") | 103 | @ApiOperation("根据ID删除") |
| 104 | @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) | 104 | @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) |
| 105 | - @HasPermission({"base-data:office:delete"}) | 105 | + @HasPermission({"base-data:section-office:delete"}) |
| 106 | @DeleteMapping | 106 | @DeleteMapping |
| 107 | public InvokeResult<Void> deleteById(@NotBlank(message = "id不能为空!") String id) { | 107 | public InvokeResult<Void> deleteById(@NotBlank(message = "id不能为空!") String id) { |
| 108 | officeService.deleteById(id); | 108 | officeService.deleteById(id); |
| @@ -47,7 +47,7 @@ public class ProductVarietyController extends DefaultBaseController { | @@ -47,7 +47,7 @@ public class ProductVarietyController extends DefaultBaseController { | ||
| 47 | * 查询列表 | 47 | * 查询列表 |
| 48 | */ | 48 | */ |
| 49 | @ApiOperation("查询列表") | 49 | @ApiOperation("查询列表") |
| 50 | - @HasPermission({"base-data:variety:query"}) | 50 | + @HasPermission({"base-data:product-variety:query"}) |
| 51 | @GetMapping("/query") | 51 | @GetMapping("/query") |
| 52 | public InvokeResult<PageResult<GetProductVarietyBo>> query(@Valid QueryProductVarietyVo vo) { | 52 | public InvokeResult<PageResult<GetProductVarietyBo>> query(@Valid QueryProductVarietyVo vo) { |
| 53 | PageResult<ProductVariety> pageResult = productVarietyService.query(getPageIndex(vo), getPageSize(vo), vo); | 53 | PageResult<ProductVariety> pageResult = productVarietyService.query(getPageIndex(vo), getPageSize(vo), vo); |
| @@ -64,7 +64,7 @@ public class ProductVarietyController extends DefaultBaseController { | @@ -64,7 +64,7 @@ public class ProductVarietyController extends DefaultBaseController { | ||
| 64 | */ | 64 | */ |
| 65 | @ApiOperation("根据ID查询") | 65 | @ApiOperation("根据ID查询") |
| 66 | @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) | 66 | @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) |
| 67 | - @HasPermission({"base-data:variety:query"}) | 67 | + @HasPermission({"base-data:product-variety:query"}) |
| 68 | @GetMapping | 68 | @GetMapping |
| 69 | public InvokeResult<GetProductVarietyBo> get(@NotBlank(message = "id不能为空!") String id) { | 69 | public InvokeResult<GetProductVarietyBo> get(@NotBlank(message = "id不能为空!") String id) { |
| 70 | ProductVariety data = productVarietyService.findById(id); | 70 | ProductVariety data = productVarietyService.findById(id); |
| @@ -80,7 +80,7 @@ public class ProductVarietyController extends DefaultBaseController { | @@ -80,7 +80,7 @@ public class ProductVarietyController extends DefaultBaseController { | ||
| 80 | * 新增 | 80 | * 新增 |
| 81 | */ | 81 | */ |
| 82 | @ApiOperation("新增") | 82 | @ApiOperation("新增") |
| 83 | - @HasPermission({"base-data:variety:add"}) | 83 | + @HasPermission({"base-data:product-variety:add"}) |
| 84 | @PostMapping | 84 | @PostMapping |
| 85 | public InvokeResult<Void> create(@Valid CreateProductVarietyVo vo) { | 85 | public InvokeResult<Void> create(@Valid CreateProductVarietyVo vo) { |
| 86 | productVarietyService.create(vo); | 86 | productVarietyService.create(vo); |
| @@ -91,7 +91,7 @@ public class ProductVarietyController extends DefaultBaseController { | @@ -91,7 +91,7 @@ public class ProductVarietyController extends DefaultBaseController { | ||
| 91 | * 修改 | 91 | * 修改 |
| 92 | */ | 92 | */ |
| 93 | @ApiOperation("修改") | 93 | @ApiOperation("修改") |
| 94 | - @HasPermission({"base-data:variety:modify"}) | 94 | + @HasPermission({"base-data:product-variety:modify"}) |
| 95 | @PutMapping | 95 | @PutMapping |
| 96 | public InvokeResult<Void> update(@Valid UpdateProductVarietyVo vo) { | 96 | public InvokeResult<Void> update(@Valid UpdateProductVarietyVo vo) { |
| 97 | productVarietyService.update(vo); | 97 | productVarietyService.update(vo); |
| @@ -103,7 +103,7 @@ public class ProductVarietyController extends DefaultBaseController { | @@ -103,7 +103,7 @@ public class ProductVarietyController extends DefaultBaseController { | ||
| 103 | */ | 103 | */ |
| 104 | @ApiOperation("根据ID删除") | 104 | @ApiOperation("根据ID删除") |
| 105 | @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) | 105 | @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) |
| 106 | - @HasPermission({"base-data:variety:delete"}) | 106 | + @HasPermission({"base-data:product-variety:delete"}) |
| 107 | @DeleteMapping | 107 | @DeleteMapping |
| 108 | public InvokeResult<Void> deleteById(@NotBlank(message = "id不能为空!") String id) { | 108 | public InvokeResult<Void> deleteById(@NotBlank(message = "id不能为空!") String id) { |
| 109 | productVarietyService.deleteById(id); | 109 | productVarietyService.deleteById(id); |
| @@ -45,7 +45,7 @@ public class WorkshopController extends DefaultBaseController { | @@ -45,7 +45,7 @@ public class WorkshopController extends DefaultBaseController { | ||
| 45 | * 查询列表 | 45 | * 查询列表 |
| 46 | */ | 46 | */ |
| 47 | @ApiOperation("查询列表") | 47 | @ApiOperation("查询列表") |
| 48 | - @HasPermission({"base-data:workshop:query"}) | 48 | + @HasPermission({"base-data:maker:query"}) |
| 49 | @GetMapping("/query") | 49 | @GetMapping("/query") |
| 50 | public InvokeResult<PageResult<GetWorkshopBo>> query(@Valid QueryWorkshopVo vo) { | 50 | public InvokeResult<PageResult<GetWorkshopBo>> query(@Valid QueryWorkshopVo vo) { |
| 51 | 51 | ||
| @@ -63,7 +63,7 @@ public class WorkshopController extends DefaultBaseController { | @@ -63,7 +63,7 @@ public class WorkshopController extends DefaultBaseController { | ||
| 63 | * 新增 | 63 | * 新增 |
| 64 | */ | 64 | */ |
| 65 | @ApiOperation("新增") | 65 | @ApiOperation("新增") |
| 66 | - @HasPermission({"base-data:workshop:add"}) | 66 | + @HasPermission({"base-data:maker:add"}) |
| 67 | @PostMapping | 67 | @PostMapping |
| 68 | public InvokeResult<Void> create(@Valid CreateWorkshopVo vo) { | 68 | public InvokeResult<Void> create(@Valid CreateWorkshopVo vo) { |
| 69 | workshopService.create(vo); | 69 | workshopService.create(vo); |
| @@ -74,7 +74,7 @@ public class WorkshopController extends DefaultBaseController { | @@ -74,7 +74,7 @@ public class WorkshopController extends DefaultBaseController { | ||
| 74 | * 修改 | 74 | * 修改 |
| 75 | */ | 75 | */ |
| 76 | @ApiOperation("修改") | 76 | @ApiOperation("修改") |
| 77 | - @HasPermission({"base-data:workshop:modify"}) | 77 | + @HasPermission({"base-data:maker:modify"}) |
| 78 | @PutMapping | 78 | @PutMapping |
| 79 | public InvokeResult<Void> update(@Valid UpdateWorkshopVo vo) { | 79 | public InvokeResult<Void> update(@Valid UpdateWorkshopVo vo) { |
| 80 | workshopService.update(vo); | 80 | workshopService.update(vo); |
| @@ -86,7 +86,7 @@ public class WorkshopController extends DefaultBaseController { | @@ -86,7 +86,7 @@ public class WorkshopController extends DefaultBaseController { | ||
| 86 | */ | 86 | */ |
| 87 | @ApiOperation("根据ID删除") | 87 | @ApiOperation("根据ID删除") |
| 88 | @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) | 88 | @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) |
| 89 | - @HasPermission({"base-data:workshop:delete"}) | 89 | + @HasPermission({"base-data:maker:delete"}) |
| 90 | @DeleteMapping | 90 | @DeleteMapping |
| 91 | public InvokeResult<Void> deleteById(@NotBlank(message = "id不能为空!") String id) { | 91 | public InvokeResult<Void> deleteById(@NotBlank(message = "id不能为空!") String id) { |
| 92 | workshopService.deleteById(id); | 92 | workshopService.deleteById(id); |
| @@ -98,7 +98,7 @@ public class WorkshopController extends DefaultBaseController { | @@ -98,7 +98,7 @@ public class WorkshopController extends DefaultBaseController { | ||
| 98 | */ | 98 | */ |
| 99 | @ApiOperation("厂房详情") | 99 | @ApiOperation("厂房详情") |
| 100 | @ApiImplicitParam(value = "ID", name = "id", paramType = "query", required = true) | 100 | @ApiImplicitParam(value = "ID", name = "id", paramType = "query", required = true) |
| 101 | - @HasPermission({"base-data:workshop:query", "base-data:workshop:add", "base-data:workshop:modify"}) | 101 | + @HasPermission({"base-data:maker:query"}) |
| 102 | @GetMapping | 102 | @GetMapping |
| 103 | public InvokeResult<GetWorkshopBo> get(@NotBlank(message = "ID不能为空!") String id) { | 103 | public InvokeResult<GetWorkshopBo> get(@NotBlank(message = "ID不能为空!") String id) { |
| 104 | Workshop data = workshopService.findById(id); | 104 | Workshop data = workshopService.findById(id); |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/controller/customer/CustomerCreditController.java
| @@ -120,7 +120,7 @@ public class CustomerCreditController extends DefaultBaseController { | @@ -120,7 +120,7 @@ public class CustomerCreditController extends DefaultBaseController { | ||
| 120 | * 修改 | 120 | * 修改 |
| 121 | */ | 121 | */ |
| 122 | @ApiOperation("修改") | 122 | @ApiOperation("修改") |
| 123 | - @HasPermission({"customer-credit-manage:customer-credit-plan:modify"}) | 123 | + @HasPermission({"customer-credit-manage:customer-credit-plan:modify","customer-credit-manage:customer-credit-plan:change"}) |
| 124 | @PutMapping("/update") | 124 | @PutMapping("/update") |
| 125 | public InvokeResult<Void> update(@Valid @RequestBody UpdateCustomerCreditVo vo) { | 125 | public InvokeResult<Void> update(@Valid @RequestBody UpdateCustomerCreditVo vo) { |
| 126 | 126 |
| @@ -15,6 +15,7 @@ import com.lframework.xingyun.basedata.service.office.OfficeService; | @@ -15,6 +15,7 @@ import com.lframework.xingyun.basedata.service.office.OfficeService; | ||
| 15 | import com.lframework.xingyun.basedata.service.product.ProductVarietyService; | 15 | import com.lframework.xingyun.basedata.service.product.ProductVarietyService; |
| 16 | import com.lframework.xingyun.basedata.service.workshop.WorkshopService; | 16 | import com.lframework.xingyun.basedata.service.workshop.WorkshopService; |
| 17 | import com.lframework.xingyun.sc.bo.customer.develop.GetCustomerDevelopPlanBo; | 17 | import com.lframework.xingyun.sc.bo.customer.develop.GetCustomerDevelopPlanBo; |
| 18 | +import com.lframework.xingyun.sc.enums.ExportType; | ||
| 18 | import com.lframework.xingyun.sc.excel.customer.CustomerDevelopExportTaskWorker; | 19 | import com.lframework.xingyun.sc.excel.customer.CustomerDevelopExportTaskWorker; |
| 19 | import com.lframework.xingyun.sc.vo.customer.develop.QueryCustomerDevelopPlanVo; | 20 | import com.lframework.xingyun.sc.vo.customer.develop.QueryCustomerDevelopPlanVo; |
| 20 | import com.lframework.xingyun.sc.service.customer.CustomerDevelopPlanService; | 21 | import com.lframework.xingyun.sc.service.customer.CustomerDevelopPlanService; |
| @@ -160,6 +161,7 @@ public class CustomerDevelopPlanController extends DefaultBaseController { | @@ -160,6 +161,7 @@ public class CustomerDevelopPlanController extends DefaultBaseController { | ||
| 160 | @HasPermission({"customer-dev-manage:customer-dev-plan:export"}) | 161 | @HasPermission({"customer-dev-manage:customer-dev-plan:export"}) |
| 161 | @PostMapping("/export") | 162 | @PostMapping("/export") |
| 162 | public InvokeResult<Void> export(@Valid QueryCustomerDevelopPlanVo vo) { | 163 | public InvokeResult<Void> export(@Valid QueryCustomerDevelopPlanVo vo) { |
| 164 | + vo.setExportType(ExportType.CUSTOMER_DEVELOP.getCode()); | ||
| 163 | ExportTaskUtil.exportTask("客户开发信息", CustomerDevelopExportTaskWorker.class, vo); | 165 | ExportTaskUtil.exportTask("客户开发信息", CustomerDevelopExportTaskWorker.class, vo); |
| 164 | return InvokeResultBuilder.success(); | 166 | return InvokeResultBuilder.success(); |
| 165 | } | 167 | } |
| 1 | +package com.lframework.xingyun.sc.enums; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.annotation.EnumValue; | ||
| 4 | +import com.lframework.starter.web.core.enums.BaseEnum; | ||
| 5 | + | ||
| 6 | +public enum ExportType implements BaseEnum<String> { | ||
| 7 | + | ||
| 8 | + | ||
| 9 | + CUSTOMER_DEVELOP("CUSTOMER_DEVELOP", "客户开发"), CUSTOMER_CREDIT("CUSTOMER_CREDIT", "客户资信"); | ||
| 10 | + | ||
| 11 | + | ||
| 12 | + @EnumValue | ||
| 13 | + private final String code; | ||
| 14 | + | ||
| 15 | + private final String desc; | ||
| 16 | + | ||
| 17 | + ExportType(String code, String desc) { | ||
| 18 | + this.code = code; | ||
| 19 | + this.desc = desc; | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + @Override | ||
| 23 | + public String getCode() { | ||
| 24 | + return this.code; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + @Override | ||
| 28 | + public String getDesc() { | ||
| 29 | + return this.desc; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + | ||
| 33 | + /** | ||
| 34 | + * 通过code获取desc | ||
| 35 | + * @param code 状态码 | ||
| 36 | + * @return 描述信息 | ||
| 37 | + */ | ||
| 38 | + public static String getDescByCode(String code) { | ||
| 39 | + for (ExportType status : ExportType.values()) { | ||
| 40 | + if (status.getCode().equals(code)) { | ||
| 41 | + return status.getDesc(); | ||
| 42 | + } | ||
| 43 | + } | ||
| 44 | + return null; | ||
| 45 | + } | ||
| 46 | +} |
| @@ -545,87 +545,87 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM | @@ -545,87 +545,87 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM | ||
| 545 | 545 | ||
| 546 | getBaseMapper().update(updateWrapper); | 546 | getBaseMapper().update(updateWrapper); |
| 547 | //更新核心人员 | 547 | //更新核心人员 |
| 548 | -// List<UpdateCorePersonnelVo> corePersonnelListNew = vo.getCorePersonnelList(); | ||
| 549 | -// if (CollectionUtils.isNotEmpty(corePersonnelListNew)) { | ||
| 550 | -// Set<String> oldIds = corePersonnelList.stream().map(CorePersonnel::getId).collect(Collectors.toSet()); | ||
| 551 | -// Set<String> newIds = corePersonnelListNew.stream().map(UpdateCorePersonnelVo::getId).collect(Collectors.toSet()); | ||
| 552 | -// // 计算差异 | ||
| 553 | -// Set<String> addedIds = new HashSet<>(newIds); | ||
| 554 | -// addedIds.removeAll(oldIds); // 新增:new 有,old 没有 | ||
| 555 | -// | ||
| 556 | -// Set<String> removedIds = new HashSet<>(oldIds); | ||
| 557 | -// removedIds.removeAll(newIds); // 删除:old 有,new 没有 | ||
| 558 | -// | ||
| 559 | -// Set<String> unchangedIds = new HashSet<>(oldIds); | ||
| 560 | -// unchangedIds.retainAll(newIds); // 不变:交集 | ||
| 561 | -// | ||
| 562 | -// // 如果需要获取对应的实体对象(注意:id 唯一) | ||
| 563 | -// Map<String, CorePersonnel> oldMap = corePersonnelList.stream().collect(Collectors.toMap(CorePersonnel::getId, e -> e)); | ||
| 564 | -// Map<String, UpdateCorePersonnelVo> newMap = corePersonnelListNew.stream().collect(Collectors.toMap(UpdateCorePersonnelVo::getId, e -> e)); | ||
| 565 | -// | ||
| 566 | -// List<UpdateCorePersonnelVo> added = addedIds.stream().map(newMap::get).collect(Collectors.toList()); | ||
| 567 | -// List<CorePersonnel> removed = removedIds.stream().map(oldMap::get).collect(Collectors.toList()); | ||
| 568 | -// List<UpdateCorePersonnelVo> updated = unchangedIds.stream().map(newMap::get).collect(Collectors.toList()); | ||
| 569 | -// // 输出结果 | ||
| 570 | -// System.out.println("新增: " + added); | ||
| 571 | -// System.out.println("删除: " + removed); | ||
| 572 | -// System.out.println("修改: " + updated); | ||
| 573 | -// //新增 | ||
| 574 | -// for (UpdateCorePersonnelVo updateCorePersonnelVo : added) { | ||
| 575 | -// CreateCorePersonnelVo createCorePersonnelVo = new CreateCorePersonnelVo(); | ||
| 576 | -// createCorePersonnelVo.setCreditId(vo.getId()); | ||
| 577 | -// if (!StringUtil.isBlank(updateCorePersonnelVo.getPersonId())) { | ||
| 578 | -// createCorePersonnelVo.setPersonId(updateCorePersonnelVo.getPersonId()); | ||
| 579 | -// } | ||
| 580 | -// if (!StringUtil.isBlank(updateCorePersonnelVo.getName())) { | ||
| 581 | -// createCorePersonnelVo.setName(updateCorePersonnelVo.getName()); | ||
| 582 | -// } | ||
| 583 | -// if (!StringUtil.isBlank(updateCorePersonnelVo.getSex())) { | ||
| 584 | -// createCorePersonnelVo.setSex(updateCorePersonnelVo.getSex()); | ||
| 585 | -// } | ||
| 586 | -// if (!StringUtil.isBlank(updateCorePersonnelVo.getNativePlace())) { | ||
| 587 | -// createCorePersonnelVo.setNativePlace(updateCorePersonnelVo.getNativePlace()); | ||
| 588 | -// } | ||
| 589 | -// if (!StringUtil.isBlank(updateCorePersonnelVo.getAge())) { | ||
| 590 | -// createCorePersonnelVo.setAge(updateCorePersonnelVo.getAge()); | ||
| 591 | -// } | ||
| 592 | -// if (!StringUtil.isBlank(updateCorePersonnelVo.getPosition())) { | ||
| 593 | -// createCorePersonnelVo.setPosition(updateCorePersonnelVo.getPosition()); | ||
| 594 | -// } | ||
| 595 | -// if (!StringUtil.isBlank(updateCorePersonnelVo.getMobile())) { | ||
| 596 | -// createCorePersonnelVo.setMobile(updateCorePersonnelVo.getMobile()); | ||
| 597 | -// } | ||
| 598 | -// if (!StringUtil.isBlank(updateCorePersonnelVo.getPhone())) { | ||
| 599 | -// createCorePersonnelVo.setPhone(updateCorePersonnelVo.getPhone()); | ||
| 600 | -// } | ||
| 601 | -// if (!StringUtil.isBlank(updateCorePersonnelVo.getEmail())) { | ||
| 602 | -// createCorePersonnelVo.setEmail(updateCorePersonnelVo.getEmail()); | ||
| 603 | -// } | ||
| 604 | -// if (!StringUtil.isBlank(updateCorePersonnelVo.getAddress())) { | ||
| 605 | -// createCorePersonnelVo.setAddress(updateCorePersonnelVo.getAddress()); | ||
| 606 | -// } | ||
| 607 | -// corePersonnelService.create(createCorePersonnelVo); | ||
| 608 | -// } | ||
| 609 | -// //删除 | ||
| 610 | -// for (CorePersonnel corePersonnel : removed) { | ||
| 611 | -// corePersonnelService.deleteById(corePersonnel.getId()); | ||
| 612 | -// } | ||
| 613 | -// //修改 | ||
| 614 | -// for (UpdateCorePersonnelVo updateCorePersonnelVo : updated) { | ||
| 615 | -// corePersonnelService.update(updateCorePersonnelVo); | ||
| 616 | -// } | ||
| 617 | -// } else { | ||
| 618 | -// if (CollectionUtils.isNotEmpty(corePersonnelList)) { | ||
| 619 | -// for (CorePersonnel corePersonnel : corePersonnelList) { | ||
| 620 | -// corePersonnelService.deleteById(corePersonnel.getId()); | ||
| 621 | -// } | ||
| 622 | -// } | ||
| 623 | -// } | 548 | + List<UpdateCorePersonnelVo> corePersonnelListNew = vo.getCorePersonnelList(); |
| 549 | + if (CollectionUtils.isNotEmpty(corePersonnelListNew)) { | ||
| 550 | + Set<String> oldIds = corePersonnelList.stream().map(CorePersonnel::getId).collect(Collectors.toSet()); | ||
| 551 | + Set<String> newIds = corePersonnelListNew.stream().map(UpdateCorePersonnelVo::getId).collect(Collectors.toSet()); | ||
| 552 | + // 计算差异 | ||
| 553 | + Set<String> addedIds = new HashSet<>(newIds); | ||
| 554 | + addedIds.removeAll(oldIds); // 新增:new 有,old 没有 | ||
| 555 | + | ||
| 556 | + Set<String> removedIds = new HashSet<>(oldIds); | ||
| 557 | + removedIds.removeAll(newIds); // 删除:old 有,new 没有 | ||
| 558 | + | ||
| 559 | + Set<String> unchangedIds = new HashSet<>(oldIds); | ||
| 560 | + unchangedIds.retainAll(newIds); // 不变:交集 | ||
| 561 | + | ||
| 562 | + // 如果需要获取对应的实体对象(注意:id 唯一) | ||
| 563 | + Map<String, CorePersonnel> oldMap = corePersonnelList.stream().collect(Collectors.toMap(CorePersonnel::getId, e -> e)); | ||
| 564 | + Map<String, UpdateCorePersonnelVo> newMap = corePersonnelListNew.stream().collect(Collectors.toMap(UpdateCorePersonnelVo::getId, e -> e)); | ||
| 565 | + | ||
| 566 | + List<UpdateCorePersonnelVo> added = addedIds.stream().map(newMap::get).collect(Collectors.toList()); | ||
| 567 | + List<CorePersonnel> removed = removedIds.stream().map(oldMap::get).collect(Collectors.toList()); | ||
| 568 | + List<UpdateCorePersonnelVo> updated = unchangedIds.stream().map(newMap::get).collect(Collectors.toList()); | ||
| 569 | + // 输出结果 | ||
| 570 | + System.out.println("新增: " + added); | ||
| 571 | + System.out.println("删除: " + removed); | ||
| 572 | + System.out.println("修改: " + updated); | ||
| 573 | + //新增 | ||
| 574 | + for (UpdateCorePersonnelVo updateCorePersonnelVo : added) { | ||
| 575 | + CreateCorePersonnelVo createCorePersonnelVo = new CreateCorePersonnelVo(); | ||
| 576 | + createCorePersonnelVo.setCreditId(vo.getId()); | ||
| 577 | + if (!StringUtil.isBlank(updateCorePersonnelVo.getPersonId())) { | ||
| 578 | + createCorePersonnelVo.setPersonId(updateCorePersonnelVo.getPersonId()); | ||
| 579 | + } | ||
| 580 | + if (!StringUtil.isBlank(updateCorePersonnelVo.getName())) { | ||
| 581 | + createCorePersonnelVo.setName(updateCorePersonnelVo.getName()); | ||
| 582 | + } | ||
| 583 | + if (!StringUtil.isBlank(updateCorePersonnelVo.getSex())) { | ||
| 584 | + createCorePersonnelVo.setSex(updateCorePersonnelVo.getSex()); | ||
| 585 | + } | ||
| 586 | + if (!StringUtil.isBlank(updateCorePersonnelVo.getNativePlace())) { | ||
| 587 | + createCorePersonnelVo.setNativePlace(updateCorePersonnelVo.getNativePlace()); | ||
| 588 | + } | ||
| 589 | + if (!StringUtil.isBlank(updateCorePersonnelVo.getAge())) { | ||
| 590 | + createCorePersonnelVo.setAge(updateCorePersonnelVo.getAge()); | ||
| 591 | + } | ||
| 592 | + if (!StringUtil.isBlank(updateCorePersonnelVo.getPosition())) { | ||
| 593 | + createCorePersonnelVo.setPosition(updateCorePersonnelVo.getPosition()); | ||
| 594 | + } | ||
| 595 | + if (!StringUtil.isBlank(updateCorePersonnelVo.getMobile())) { | ||
| 596 | + createCorePersonnelVo.setMobile(updateCorePersonnelVo.getMobile()); | ||
| 597 | + } | ||
| 598 | + if (!StringUtil.isBlank(updateCorePersonnelVo.getPhone())) { | ||
| 599 | + createCorePersonnelVo.setPhone(updateCorePersonnelVo.getPhone()); | ||
| 600 | + } | ||
| 601 | + if (!StringUtil.isBlank(updateCorePersonnelVo.getEmail())) { | ||
| 602 | + createCorePersonnelVo.setEmail(updateCorePersonnelVo.getEmail()); | ||
| 603 | + } | ||
| 604 | + if (!StringUtil.isBlank(updateCorePersonnelVo.getAddress())) { | ||
| 605 | + createCorePersonnelVo.setAddress(updateCorePersonnelVo.getAddress()); | ||
| 606 | + } | ||
| 607 | + corePersonnelService.create(createCorePersonnelVo); | ||
| 608 | + } | ||
| 609 | + //删除 | ||
| 610 | + for (CorePersonnel corePersonnel : removed) { | ||
| 611 | + corePersonnelService.deleteById(corePersonnel.getId()); | ||
| 612 | + } | ||
| 613 | + //修改 | ||
| 614 | + for (UpdateCorePersonnelVo updateCorePersonnelVo : updated) { | ||
| 615 | + corePersonnelService.update(updateCorePersonnelVo); | ||
| 616 | + } | ||
| 617 | + } else { | ||
| 618 | + if (CollectionUtils.isNotEmpty(corePersonnelList)) { | ||
| 619 | + for (CorePersonnel corePersonnel : corePersonnelList) { | ||
| 620 | + corePersonnelService.deleteById(corePersonnel.getId()); | ||
| 621 | + } | ||
| 622 | + } | ||
| 623 | + } | ||
| 624 | OpLogUtil.setVariable("id", data.getId()); | 624 | OpLogUtil.setVariable("id", data.getId()); |
| 625 | OpLogUtil.setExtra(vo); | 625 | OpLogUtil.setExtra(vo); |
| 626 | 626 | ||
| 627 | //开启审核 | 627 | //开启审核 |
| 628 | -// flowInstanceWrapperService.startInstance(BPM_FLAG, data.getId(), BPM_FLAG, vo); | 628 | + flowInstanceWrapperService.startInstance(BPM_FLAG, data.getId(), BPM_FLAG, vo); |
| 629 | } | 629 | } |
| 630 | 630 | ||
| 631 | @OpLog(type = OtherOpLogType.class, name = "删除客户资信表,ID:{}", params = {"#id"}) | 631 | @OpLog(type = OtherOpLogType.class, name = "删除客户资信表,ID:{}", params = {"#id"}) |
| @@ -77,5 +77,5 @@ public class QueryCustomerDevelopPlanVo extends SortPageVo implements BaseVo, Se | @@ -77,5 +77,5 @@ public class QueryCustomerDevelopPlanVo extends SortPageVo implements BaseVo, Se | ||
| 77 | * 导出类型 | 77 | * 导出类型 |
| 78 | */ | 78 | */ |
| 79 | @ApiModelProperty("导出类型") | 79 | @ApiModelProperty("导出类型") |
| 80 | - private String exportType = "CUSTOMER_DEVELOP"; | 80 | + private String exportType; |
| 81 | } | 81 | } |