diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java index eb53ca26..7e633940 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java @@ -41,6 +41,9 @@ import lombok.extern.slf4j.Slf4j; import org.jeecg.modules.demo.comp.entity.Comp; import org.jeecg.modules.demo.comp.service.ICompService; import org.jeecg.modules.system.entity.SysUser; +import org.jeecg.modules.system.entity.SysUserDepart; +import org.jeecg.modules.system.service.ISysDepartService; +import org.jeecg.modules.system.service.ISysUserDepartService; import org.jeecg.modules.system.service.ISysUserService; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.def.NormalExcelConstants; @@ -88,6 +91,10 @@ public class AwardPersionController extends JeecgController queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, req.getParameterMap()); + queryWrappersud.eq("user_id",sysUser.getId()); + awardPersion.setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode()); awardPersionService.save(awardPersion); AnnualCompPoint annualCompPoint = annualCompPointService.getById(awardPersion.getAnnualCompP()); annualCompPoint.setIsPj(1); @@ -206,6 +217,10 @@ public class AwardPersionController extends JeecgController queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, req.getParameterMap()); + queryWrappersud.eq("user_id",sysUser.getId()); + awardPersion.setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode()); awardPersionService.save(awardPersion); AnnualCompPoint annualCompPoint = annualCompPointService.getById(awardPersion.getAnnualCompP()); annualCompPoint.setIsPj(1); @@ -255,12 +270,20 @@ public class AwardPersionController extends JeecgController queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, req.getParameterMap()); + queryWrappersud.eq("user_id",sysUser.getId()); + awardPersion.setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode()); awardPersionService.updateById(awardPersion); return Result.OK("编辑成功!"); }else { SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); awardPersion.setStudentname(sysUser.getRealname()); awardPersion.setStudentcode(sysUser.getUsername()); + SysUserDepart sysUserDepart = new SysUserDepart(null,null); + QueryWrapper queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, req.getParameterMap()); + queryWrappersud.eq("user_id",sysUser.getId()); + awardPersion.setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode()); awardPersionService.updateById(awardPersion); return Result.OK("编辑成功!"); } @@ -459,6 +482,10 @@ public class AwardPersionController extends JeecgController listtm1 = teamManagementService.list(queryWrappertm1); SysUser sysUser = sysUserService.getById(listtm1.get(0).getUserId()); + SysUserDepart sysUserDepart = new SysUserDepart(null,null); + QueryWrapper queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, request.getParameterMap()); + queryWrappersud.eq("user_id",sysUser.getId()); + list.get(i).setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode()); if(listaca.get(0).getFirstPrize().equals(list.get(i).getAwardname())){ list.get(i).setAwardsort(1); list.get(i).setAwardid(listaca.get(0).getId()); @@ -490,6 +517,10 @@ public class AwardPersionController extends JeecgController queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, request.getParameterMap()); + queryWrappersud.eq("user_id",sysUser.getId()); + list.get(i).setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode()); if(listaca.get(0).getFirstPrize().equals(list.get(i).getAwardname())){ list.get(i).setAwardsort(1); list.get(i).setAwardid(listaca.get(0).getId()); diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/entity/AwardPersion.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/entity/AwardPersion.java index d3b993fb..c6da4338 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/entity/AwardPersion.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/entity/AwardPersion.java @@ -109,4 +109,8 @@ public class AwardPersion implements Serializable { @TableField(exist = false) @ApiModelProperty(value = "角色标识") private String rolename; + /**学生所属学院*/ + @ApiModelProperty(value = "学生所属学院") + private String studentorg; + }