修改字段
parent
6410222278
commit
a772e06c6f
|
|
@ -0,0 +1,28 @@
|
|||
package com.zcloud.basic.info.event;
|
||||
|
||||
import com.jjb.saas.framework.event.consumer.MessageConsumer;
|
||||
import com.jjb.saas.framework.event.consumer.MsgConsumer;
|
||||
import com.zcloud.gbscommon.event.department.ZcDepartmentEvent;
|
||||
import com.zcloud.gbscommon.event.user.ZcUserEvent;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lin
|
||||
*/
|
||||
@Component
|
||||
@MsgConsumer(tag = "zcloud:department:name")
|
||||
public class DepartmentUpdateAuditStatusConsumer implements MessageConsumer<ZcDepartmentEvent> {
|
||||
// private RemoteEventPublisher eventPublisher;
|
||||
|
||||
// public UserUpdateAuditStatusConsumer(RemoteEventPublisher eventPublisher) {
|
||||
// this.eventPublisher = eventPublisher;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void consume(ZcDepartmentEvent event) {
|
||||
|
||||
System.out.println(event.getDepartmentId());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -33,32 +33,32 @@ import java.util.ArrayList;
|
|||
public class CorpInfoXgfController {
|
||||
private final CorpInfoXgfServiceI corpInfoXgfService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@ApiOperation("新增相关方企业")
|
||||
@PostMapping("/save")
|
||||
public SingleResponse<CorpInfoXgfCO> add(@Validated @RequestBody CorpInfoXgfAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
return corpInfoXgfService.add(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("分页")
|
||||
@ApiOperation("相关方企业分页")
|
||||
@PostMapping("/list")
|
||||
public PageResponse<CorpInfoXgfCO> page(@RequestBody CorpInfoXgfPageQry qry) {
|
||||
return corpInfoXgfService.listPage(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("所有数据")
|
||||
@ApiOperation(value = "所有数据",hidden = true)
|
||||
@PostMapping("/listAll")
|
||||
public MultiResponse<CorpInfoXgfCO> listAll() {
|
||||
return MultiResponse.of(new ArrayList<CorpInfoXgfCO>());
|
||||
}
|
||||
|
||||
@ApiOperation("详情")
|
||||
@ApiOperation("相关方企业详情")
|
||||
@PostMapping("/info/{id}")
|
||||
public SingleResponse<CorpInfoXgfCO> getInfoById(@PathVariable("id") Long id) {
|
||||
return SingleResponse.of(corpInfoXgfService.info(id));
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@ApiOperation("相关方企业删除")
|
||||
@PostMapping("/remove/{id}")
|
||||
public Response remove(@PathVariable("id") Long id) {
|
||||
corpInfoXgfService.remove(id);
|
||||
|
|
@ -72,7 +72,7 @@ public class CorpInfoXgfController {
|
|||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("修改")
|
||||
@ApiOperation("相关方企业修改")
|
||||
@PostMapping("/edit")
|
||||
public SingleResponse edit(@Validated @RequestBody CorpInfoXgfUpdateCmd corpInfoXgfUpdateCmd) {
|
||||
corpInfoXgfService.edit(corpInfoXgfUpdateCmd);
|
||||
|
|
|
|||
|
|
@ -8,10 +8,8 @@ import com.alibaba.cola.dto.SingleResponse;
|
|||
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.jjb.saas.system.client.dept.facade.DeptFacade;
|
||||
import com.jjb.saas.system.client.dept.response.DeptCO;
|
||||
import com.zcloud.basic.info.api.DepartmentServiceI;
|
||||
import com.zcloud.basic.info.dto.*;
|
||||
import com.zcloud.basic.info.dto.clientobject.CorpDepartmentCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentTreeInfoCO;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -21,6 +19,7 @@ import org.apache.dubbo.config.annotation.DubboReference;
|
|||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -30,23 +29,26 @@ import java.util.List;
|
|||
* @Author zhaokai
|
||||
* @Date 2025-10-29 16:03:19
|
||||
*/
|
||||
@Api(tags = "部门表")
|
||||
@Api(tags = "部门管理")
|
||||
@RequestMapping("/${application.gateway}/department")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class DepartmentController {
|
||||
private final DepartmentServiceI departmentService;
|
||||
|
||||
@DubboReference
|
||||
private DeptFacade deptFacade;
|
||||
|
||||
@ApiOperation("新增")
|
||||
|
||||
|
||||
@ApiOperation("新增部门")
|
||||
@PostMapping("/save")
|
||||
public SingleResponse<DepartmentCO> add(@Validated @RequestBody DepartmentAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
return departmentService.add(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("分页")
|
||||
@ApiOperation("查询部门分页")
|
||||
@PostMapping("/list")
|
||||
public PageResponse<DepartmentCO> page(@Validated @RequestBody DepartmentPageQry qry) {
|
||||
return departmentService.listPage(qry);
|
||||
|
|
@ -54,18 +56,18 @@ public class DepartmentController {
|
|||
|
||||
@ApiOperation("所有数据")
|
||||
@PostMapping("/listAll")
|
||||
public MultiResponse<DeptCO> listAll() {
|
||||
return deptFacade.getTreeByCurrentOrgId();
|
||||
// return MultiResponse.of(new ArrayList<DepartmentCO>());
|
||||
public MultiResponse<DepartmentCO> listAll() {
|
||||
// return deptFacade.getTreeByCurrentOrgId();
|
||||
return MultiResponse.of(new ArrayList<DepartmentCO>());
|
||||
}
|
||||
|
||||
@ApiOperation("详情")
|
||||
@ApiOperation("部门详情")
|
||||
@PostMapping("/info/{id}")
|
||||
public SingleResponse<DepartmentCO> getInfoById(@PathVariable("id") Long id) {
|
||||
return SingleResponse.of(departmentService.info(id));
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@ApiOperation("部门删除")
|
||||
@PostMapping("/remove/{id}")
|
||||
public Response remove(@PathVariable("id") Long id) {
|
||||
departmentService.remove(id);
|
||||
|
|
@ -79,13 +81,13 @@ public class DepartmentController {
|
|||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("修改")
|
||||
@ApiOperation("部门修改")
|
||||
@PostMapping("/edit")
|
||||
public SingleResponse edit(@Validated @RequestBody DepartmentUpdateCmd departmentUpdateCmd) {
|
||||
departmentService.edit(departmentUpdateCmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
@ApiOperation("所有数据")
|
||||
@ApiOperation("部门树状所有数据")
|
||||
@PostMapping("/listTree")
|
||||
public List<DepartmentTreeInfoCO> listTree(@Validated @RequestBody DepartmentTreeQry qry) {
|
||||
return departmentService.listTree(qry);
|
||||
|
|
|
|||
|
|
@ -9,12 +9,14 @@ import com.zcloud.basic.info.dto.DepartmentUpdateCmd;
|
|||
import com.zcloud.basic.info.persistence.dataobject.DepartmentDO;
|
||||
import com.zcloud.basic.info.persistence.repository.DepartmentRepository;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
|
|
@ -24,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
@Slf4j
|
||||
public class DepartmentUpdateExe {
|
||||
private final DepartmentGateway departmentGateway;
|
||||
private final DepartmentRepository departmentRepository;
|
||||
|
|
@ -51,6 +54,12 @@ public class DepartmentUpdateExe {
|
|||
|
||||
if(!departmentDO.getName().equals(departmentE.getName())){
|
||||
//TODO 名字不一样,发送mq
|
||||
|
||||
// ZcDepartmentEvent message = new ZcDepartmentEvent();
|
||||
// message.setDepartmentId(departmentDO.getId());
|
||||
// message.setDepartmentName(departmentDO.getName());
|
||||
// remoteEventPublisher.sendMessage(message, EventTagConst.departmentNameTag);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue