|
|
@ -26,6 +26,7 @@ import com.alibaba.excel.write.metadata.WriteSheet; |
|
|
|
import com.alibaba.excel.write.metadata.fill.FillConfig; |
|
|
|
import com.alibaba.excel.write.metadata.fill.FillWrapper; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.epmet.commons.rocketmq.messages.IcResiUserAddMQMsg; |
|
|
|
import com.epmet.commons.tools.annotation.LoginUser; |
|
|
|
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
@ -45,11 +46,13 @@ import com.epmet.commons.tools.utils.IpUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
|
|
|
import com.epmet.constant.IcResiUserConstant; |
|
|
|
import com.epmet.constant.SystemMessageType; |
|
|
|
import com.epmet.dto.IcResiUserDTO; |
|
|
|
import com.epmet.dto.form.*; |
|
|
|
import com.epmet.dto.result.*; |
|
|
|
import com.epmet.enums.IcResiUserTableEnum; |
|
|
|
import com.epmet.excel.support.ExportResiUserItemDTO; |
|
|
|
import com.epmet.feign.EpmetMessageOpenFeignClient; |
|
|
|
import com.epmet.feign.OperCustomizeOpenFeignClient; |
|
|
|
import com.epmet.feign.OssFeignClient; |
|
|
|
import com.epmet.service.IcResiUserImportService; |
|
|
@ -114,6 +117,8 @@ public class IcResiUserController { |
|
|
|
private IcResiUserImportService icResiUserImportService; |
|
|
|
@Autowired |
|
|
|
private RedisUtils redisUtils; |
|
|
|
@Autowired |
|
|
|
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; |
|
|
|
|
|
|
|
{ |
|
|
|
// 初始化上传目录
|
|
|
@ -144,6 +149,14 @@ public class IcResiUserController { |
|
|
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|
|
|
ValidatorUtils.validateEntity(formDTO, DelIcResiUserFormDTO.IdGroup.class); |
|
|
|
icResiUserService.delete(formDTO); |
|
|
|
//推送MQ事件
|
|
|
|
IcResiUserAddMQMsg mqMsg = new IcResiUserAddMQMsg(); |
|
|
|
mqMsg.setCustomerId(tokenDto.getCustomerId()); |
|
|
|
mqMsg.setIcResiUser(formDTO.getIcResiUserId()); |
|
|
|
SystemMsgFormDTO form = new SystemMsgFormDTO(); |
|
|
|
form.setMessageType(SystemMessageType.IC_RESI_USER_DEL); |
|
|
|
form.setContent(mqMsg); |
|
|
|
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
@ -154,7 +167,15 @@ public class IcResiUserController { |
|
|
|
**/ |
|
|
|
@PostMapping("add") |
|
|
|
public Result add(@LoginUser TokenDto tokenDto, @RequestBody List<IcResiUserFormDTO> formDTO) { |
|
|
|
icResiUserService.add(tokenDto, formDTO); |
|
|
|
String resiUserId = icResiUserService.add(tokenDto, formDTO); |
|
|
|
//推送MQ事件
|
|
|
|
IcResiUserAddMQMsg mqMsg = new IcResiUserAddMQMsg(); |
|
|
|
mqMsg.setCustomerId(tokenDto.getCustomerId()); |
|
|
|
mqMsg.setIcResiUser(resiUserId); |
|
|
|
SystemMsgFormDTO form = new SystemMsgFormDTO(); |
|
|
|
form.setMessageType(SystemMessageType.IC_RESI_USER_ADD); |
|
|
|
form.setContent(mqMsg); |
|
|
|
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
@ -164,7 +185,15 @@ public class IcResiUserController { |
|
|
|
**/ |
|
|
|
@PostMapping("edit") |
|
|
|
public Result edit(@LoginUser TokenDto tokenDto, @RequestBody List<IcResiUserFormDTO> formDTO) { |
|
|
|
icResiUserService.edit(tokenDto, formDTO); |
|
|
|
String resiUserId = icResiUserService.edit(tokenDto, formDTO); |
|
|
|
//推送MQ事件
|
|
|
|
IcResiUserAddMQMsg mqMsg = new IcResiUserAddMQMsg(); |
|
|
|
mqMsg.setCustomerId(tokenDto.getCustomerId()); |
|
|
|
mqMsg.setIcResiUser(resiUserId); |
|
|
|
SystemMsgFormDTO form = new SystemMsgFormDTO(); |
|
|
|
form.setMessageType(SystemMessageType.IC_RESI_USER_EDIT); |
|
|
|
form.setContent(mqMsg); |
|
|
|
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|