diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysTrainnumController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysTrainnumController.java index abe7cc8..a39d201 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysTrainnumController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysTrainnumController.java @@ -8,14 +8,18 @@ import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.system.domain.TdTrain; +import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ITdTrainService; +import com.ruoyi.web.controller.manager.SysAreaManager; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import java.util.List; +import java.util.Objects; @Controller @RequestMapping("/system/trainnum") @@ -24,6 +28,13 @@ public class SysTrainnumController extends BaseController { @Autowired private ITdTrainService tdTrainService; + @Resource + private SysAreaManager sysAreaManager; + + + @Resource + private ISysUserService sysUserService; + @RequiresPermissions("system:trainnum:view") @GetMapping() public String trainnum() @@ -58,6 +69,14 @@ public class SysTrainnumController extends BaseController { public AjaxResult export(TdTrain tdTrain) { List list = tdTrainService.selectTdTrainList(tdTrain); + list.forEach(tdTrain1 -> { + tdTrain1.setAREAID(sysAreaManager.getAreaName(tdTrain1.getAREAID())); + tdTrain1.setFRAMEWORK(sysAreaManager.getAreaName(tdTrain1.getFRAMEWORK())); + SysUser sysUser = sysUserService.selectUserById(Long.valueOf(tdTrain1.getUSERNAME())); + if(Objects.nonNull(sysUser)){ + tdTrain1.setUSERNAME(sysUser.getUserName()); + } + }); ExcelUtil util = new ExcelUtil(TdTrain.class); return util.exportExcel(list, "培训统计数据"); }