Browse Source

Merge branch 'develop' into release_temp

dev_shibei_match
sunyuchao 4 years ago
parent
commit
f465c3ac6a
  1. 4
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/ExUserServiceImpl.java
  2. 32
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java
  3. 18
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

4
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/ExUserServiceImpl.java

@ -85,10 +85,10 @@ public class ExUserServiceImpl extends BaseServiceImpl<ExUserDao, ExUserEntity>
}); });
//3.更新数据,不能新增,市平台信息表中必填的 //3.更新数据,不能新增,市平台信息表中必填的
if (!"add".equals(formDTO.getType())) { if (!"staff_create".equals(formDTO.getType())) {
baseDao.updateBatch(entityList); baseDao.updateBatch(entityList);
} }
/*if ("add".equals(formDTO.getType())) { /*if ("staff_create".equals(formDTO.getType())) {
insertBatch(entityList); insertBatch(entityList);
} else { } else {
baseDao.updateBatch(entityList); baseDao.updateBatch(entityList);

32
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java

@ -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;
} }
/** /**

18
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -349,15 +349,6 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
dto.setRoles(m); dto.setRoles(m);
CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId()); CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId());
//2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(fromDTO.getCustomerId());
mq.setOrgId(userEntity.getId());
mq.setOrgType("staff");
mq.setType("staff_create");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
return new Result<CustomerStaffDTO>().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class)); return new Result<CustomerStaffDTO>().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class));
} }
@ -432,15 +423,6 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
dto.setRoles(m); dto.setRoles(m);
CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId()); CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId());
//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 new Result(); return new Result();
} }

Loading…
Cancel
Save