|
@@ -13,6 +13,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
+import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.entity.EmployeeInfo;
|
|
|
import com.ym.mec.biz.dal.page.EmployeeInfoQueryInfo;
|
|
|
import com.ym.mec.biz.service.EmployeeInfoService;
|
|
@@ -25,11 +27,20 @@ public class EmployeeInfoController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private EmployeeInfoService employeeInfoService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
+
|
|
|
|
|
|
@ApiOperation(value = "新增员工信息")
|
|
|
@PostMapping("/insert")
|
|
|
@PreAuthorize("@pcs.hasPermissions('employeeInfo/insert')")
|
|
|
public Object insert(@RequestBody EmployeeInfo employeeInfo) {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ return failed("用户信息获取失败");
|
|
|
+ }
|
|
|
+ employeeInfo.setOperatorId(sysUser.getId());
|
|
|
Date date = new Date();
|
|
|
employeeInfo.setUpdateTime(date);
|
|
|
employeeInfo.setCreateTime(date);
|
|
@@ -41,6 +52,11 @@ public class EmployeeInfoController extends BaseController {
|
|
|
@PostMapping("/update")
|
|
|
@PreAuthorize("@pcs.hasPermissions('employeeInfo/update')")
|
|
|
public Object update(@RequestBody EmployeeInfo employeeInfo) {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ return failed("用户信息获取失败");
|
|
|
+ }
|
|
|
+ employeeInfo.setOperatorId(sysUser.getId());
|
|
|
Date date = new Date();
|
|
|
employeeInfo.setUpdateTime(date);
|
|
|
employeeInfoService.update(employeeInfo);
|