|
@@ -5,6 +5,8 @@ import java.util.List;
|
|
|
|
|
|
import com.ruoyi.project.plant.domain.TStaffmgr;
|
|
|
import com.ruoyi.project.plant.service.ITStaffmgrService;
|
|
|
+import com.ruoyi.project.system.domain.SysUser;
|
|
|
+import com.ruoyi.project.system.service.ISysUserService;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -39,16 +41,25 @@ public class TAlarmPrincipalController extends BaseController
|
|
|
|
|
|
@Autowired
|
|
|
private ITStaffmgrService tStaffmgrService;
|
|
|
+ @Autowired
|
|
|
+ private ISysUserService sysUserService;
|
|
|
|
|
|
/**
|
|
|
* 查询预警管理负责人列表
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('system:principal:list')")
|
|
|
@GetMapping("/list")
|
|
|
public TableDataInfo list(TAlarmPrincipal tAlarmPrincipal)
|
|
|
{
|
|
|
startPage();
|
|
|
List<TAlarmPrincipal> list = tAlarmPrincipalService.selectTAlarmPrincipalList(tAlarmPrincipal);
|
|
|
+ for (TAlarmPrincipal t: list
|
|
|
+ ) {
|
|
|
+ SysUser user = sysUserService.selectUserByStaffId(t.getStaffid());
|
|
|
+ if (user != null) {
|
|
|
+ t.setPrincipalName(user.getNickName());
|
|
|
+ t.setPrincipalEmail(user.getEmail());
|
|
|
+ }
|
|
|
+ }
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
@@ -103,9 +114,11 @@ public class TAlarmPrincipalController extends BaseController
|
|
|
tAlarmPrincipal.setUpdaterCode(getUserId().toString());
|
|
|
tAlarmPrincipal.setUpdatedate(new Date());
|
|
|
//人员信息对应
|
|
|
- TStaffmgr staffmgr = tStaffmgrService.selectTStaffmgrByStaffId(tAlarmPrincipal.getStaffid());
|
|
|
- tAlarmPrincipal.setPrincipalName(staffmgr.getName());
|
|
|
- tAlarmPrincipal.setPrincipalEmail(staffmgr.getMail());
|
|
|
+ SysUser user = sysUserService.selectUserByStaffId(tAlarmPrincipal.getStaffid());
|
|
|
+ if (user!=null) {
|
|
|
+ tAlarmPrincipal.setPrincipalName(user.getNickName());
|
|
|
+ tAlarmPrincipal.setPrincipalEmail(user.getEmail());
|
|
|
+ }
|
|
|
return toAjax(tAlarmPrincipalService.updateTAlarmPrincipal(tAlarmPrincipal));
|
|
|
}
|
|
|
|