|
@ -17,6 +17,7 @@ |
|
|
|
|
|
|
|
|
package com.epmet.controller; |
|
|
package com.epmet.controller; |
|
|
|
|
|
|
|
|
|
|
|
import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg; |
|
|
import com.epmet.commons.tools.annotation.LoginUser; |
|
|
import com.epmet.commons.tools.annotation.LoginUser; |
|
|
import com.epmet.commons.tools.annotation.RequirePermission; |
|
|
import com.epmet.commons.tools.annotation.RequirePermission; |
|
|
import com.epmet.commons.tools.enums.RequirePermissionEnum; |
|
|
import com.epmet.commons.tools.enums.RequirePermissionEnum; |
|
@ -36,6 +37,8 @@ import com.epmet.dto.*; |
|
|
import com.epmet.dto.form.*; |
|
|
import com.epmet.dto.form.*; |
|
|
import com.epmet.dto.result.*; |
|
|
import com.epmet.dto.result.*; |
|
|
import com.epmet.excel.CustomerStaffExcel; |
|
|
import com.epmet.excel.CustomerStaffExcel; |
|
|
|
|
|
import com.epmet.feign.EpmetMessageOpenFeignClient; |
|
|
|
|
|
import com.epmet.send.SendMqMsgUtil; |
|
|
import com.epmet.service.CustomerStaffService; |
|
|
import com.epmet.service.CustomerStaffService; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
@ -59,9 +62,10 @@ public class CustomerStaffController { |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private CustomerStaffService customerStaffService; |
|
|
private CustomerStaffService customerStaffService; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private LoginUserUtil loginUserUtil; |
|
|
private LoginUserUtil loginUserUtil; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; |
|
|
|
|
|
|
|
|
@GetMapping("page") |
|
|
@GetMapping("page") |
|
|
public Result<PageData<CustomerStaffDTO>> page(@RequestParam Map<String, Object> params) { |
|
|
public Result<PageData<CustomerStaffDTO>> page(@RequestParam Map<String, Object> params) { |
|
@ -214,7 +218,18 @@ public class CustomerStaffController { |
|
|
*/ |
|
|
*/ |
|
|
@PostMapping("addstaff") |
|
|
@PostMapping("addstaff") |
|
|
public Result<CustomerStaffDTO> addStaff(@RequestBody StaffSubmitFromDTO fromDTO){ |
|
|
public Result<CustomerStaffDTO> addStaff(@RequestBody StaffSubmitFromDTO fromDTO){ |
|
|
return customerStaffService.addStaff(fromDTO); |
|
|
Result<CustomerStaffDTO> result = customerStaffService.addStaff(fromDTO); |
|
|
|
|
|
|
|
|
|
|
|
//2021-10-18 推送mq,数据同步到中介库 start
|
|
|
|
|
|
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); |
|
|
|
|
|
mq.setCustomerId(fromDTO.getCustomerId()); |
|
|
|
|
|
mq.setOrgId(result.getData().getUserId()); |
|
|
|
|
|
mq.setOrgType("staff"); |
|
|
|
|
|
mq.setType("staff_create"); |
|
|
|
|
|
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); |
|
|
|
|
|
//2021-10-18 end
|
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -225,7 +240,18 @@ public class CustomerStaffController { |
|
|
*/ |
|
|
*/ |
|
|
@PostMapping("editstaff") |
|
|
@PostMapping("editstaff") |
|
|
public Result editStaff(@RequestBody StaffSubmitFromDTO fromDTO){ |
|
|
public Result editStaff(@RequestBody StaffSubmitFromDTO fromDTO){ |
|
|
return customerStaffService.editStaff(fromDTO); |
|
|
Result result = customerStaffService.editStaff(fromDTO); |
|
|
|
|
|
|
|
|
|
|
|
//2021-10-18 推送mq,数据同步到中介库 start
|
|
|
|
|
|
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); |
|
|
|
|
|
mq.setCustomerId(fromDTO.getCustomerId()); |
|
|
|
|
|
mq.setOrgId(fromDTO.getStaffId()); |
|
|
|
|
|
mq.setOrgType("staff"); |
|
|
|
|
|
mq.setType("staff_change"); |
|
|
|
|
|
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); |
|
|
|
|
|
//2021-10-18 end
|
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|