parent
21862134f8
commit
4e8b48be6e
@ -0,0 +1,29 @@ |
||||
package com.dxhy.order.consumer.modules.user.controller; |
||||
|
||||
import com.dxhy.order.consumer.modules.user.domain.SyncUserDTO; |
||||
import com.dxhy.order.consumer.modules.user.service.IUserService; |
||||
import com.dxhy.order.model.R; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.validation.annotation.Validated; |
||||
import org.springframework.web.bind.annotation.PostMapping; |
||||
import org.springframework.web.bind.annotation.RequestBody; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
/** |
||||
* @Description 人员接口 主动拉取人员 |
||||
* @Author 巩权林 |
||||
* @Date 2023/3/22 08:18 |
||||
**/ |
||||
@RestController |
||||
@RequestMapping("/sync_user") |
||||
public class SyncUserController { |
||||
|
||||
@Autowired |
||||
private IUserService userService; |
||||
|
||||
@PostMapping("/sync") |
||||
public R sync(@RequestBody @Validated SyncUserDTO dto) { |
||||
return userService.syncUser(dto); |
||||
} |
||||
} |
@ -0,0 +1,20 @@ |
||||
package com.dxhy.order.consumer.modules.user.domain; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import javax.validation.constraints.NotBlank; |
||||
|
||||
/** |
||||
* @Description |
||||
* @Author 巩权林 |
||||
* @Date 2023/3/22 08:28 |
||||
**/ |
||||
@Data |
||||
public class SyncUserDTO { |
||||
|
||||
/** |
||||
* 自行编码 |
||||
*/ |
||||
@NotBlank(message = "人员编码不能为空!") |
||||
private String code; |
||||
} |
@ -0,0 +1,9 @@ |
||||
package com.dxhy.order.consumer.modules.user.service; |
||||
|
||||
import com.dxhy.order.consumer.modules.user.domain.SyncUserDTO; |
||||
import com.dxhy.order.model.R; |
||||
|
||||
public interface IUserService { |
||||
|
||||
public R syncUser(SyncUserDTO dto); |
||||
} |
@ -0,0 +1,30 @@ |
||||
package com.dxhy.order.consumer.modules.user.service; |
||||
|
||||
import com.dxhy.order.consumer.modules.user.domain.SyncUserDTO; |
||||
import com.dxhy.order.consumer.openapi.service.ISDEnregyService; |
||||
import com.dxhy.order.model.R; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* @Description 同步人员 |
||||
* @Author 巩权林 |
||||
* @Date 2023/3/22 08:28 |
||||
**/ |
||||
@Service |
||||
public class UserServiceImpl implements IUserService { |
||||
|
||||
@Autowired |
||||
private ISDEnregyService sdEnregyService; |
||||
|
||||
/** |
||||
* 同步人员 |
||||
* |
||||
* @param dto |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public R syncUser(SyncUserDTO dto) { |
||||
return sdEnregyService.proactiveSyncMdmUser(dto.getCode()); |
||||
} |
||||
} |
Loading…
Reference in new issue