JayChou 4 months ago
commit fe81d16f11
  1. 128
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java
  2. 5
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/entity/AwardPersion.java
  3. 12
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/controller/CompSystemBigScreenController.java
  4. 4
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenService.java
  5. 137
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenServiceImpl.java
  6. 3
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/vo/CompVo.java
  7. 326
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java
  8. 135
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/entity/UserExpertExcel.java
  9. 173
      jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java
  10. 4
      jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/SysUser.java
  11. 2
      jeecg-boot-master/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml
  12. 5
      jeecgboot-vue3-master/src/api/common/api.ts
  13. 260
      jeecgboot-vue3-master/src/components/Form/src/jeecg/components/JImageUploadzs.vue
  14. 23
      jeecgboot-vue3-master/src/utils/common/compUtils.ts
  15. 31
      jeecgboot-vue3-master/src/utils/common/renderUtils.ts
  16. 12
      jeecgboot-vue3-master/src/views/awardpersion/AwardPersion.api.ts
  17. 6
      jeecgboot-vue3-master/src/views/awardpersion/AwardPersion.data.ts
  18. 42
      jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList.vue
  19. 284
      jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList1.vue
  20. 148
      jeecgboot-vue3-master/src/views/awardpersion/components/AwardPersionForm2.vue
  21. 75
      jeecgboot-vue3-master/src/views/awardpersion/components/AwardPersionModal2.vue
  22. 7
      jeecgboot-vue3-master/src/views/system/user/UserDrawerZJ.vue
  23. 20
      jeecgboot-vue3-master/src/views/system/user/user.data.js
  24. 6
      jeecgboot-vue3-master/src/views/system/user/user.data.ts
  25. 40
      jeecgboot-vue3-master/src/views/system/user/userZJ.data.ts
  26. 22
      jeecgboot-vue3-master/src/views/system/userZJ/UserDrawer.vue
  27. 19
      jeecgboot-vue3-master/src/views/system/userZJ/index.vue
  28. 21
      jeecgboot-vue3-master/src/views/system/userZJ/user.api.ts
  29. 4
      jeecgboot-vue3-master/src/views/system/userZJ/user.data.ts

@ -40,11 +40,10 @@ 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.demo.scorepersion.entity.ScorePersion;
import org.jeecg.modules.system.entity.SysRole;
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.jeecg.modules.system.service.*;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
@ -92,9 +91,11 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
@Resource
private JeecgBaseConfig jeecgBaseConfig;
@Autowired
private ISysUserDepartService sysUserDepartService;
@Autowired
private ISysDepartService sysDepartService;
@Autowired
private ISysRoleService sysRoleService;
@Autowired
private ISysUserRoleService sysUserRoleService;
/**
* 分页列表查询
@ -114,29 +115,54 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
HttpServletRequest req) {
//逻辑变动:奖项管理针对学生(上传证书和查询),组委会(全部都可以),学院(上传和查询),学校(教务处)(全部都可以),做一下数据筛选以及操作列权限
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
Comp comp = new Comp();
QueryWrapper<Comp> queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap());
queryWrappercomp.like("comp_admin",user.getUsername());
List<Comp> list = compService.list(queryWrappercomp);
List<String> ids = list.stream().map(Comp::getId).collect(Collectors.toList());
QueryWrapper<AnnualComp> queryWrapperAnnual = new QueryWrapper<>();
queryWrapperAnnual.in(ids.size()!=0,"compid",ids);
List<AnnualComp> listAnnual = annualCompService.list(queryWrapperAnnual);
List<String> annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList());
QueryWrapper<AwardPersion> queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap());
queryWrapper.in(annualIds.size()!=0,"annal_comp",annualIds);
List<SysRole> sysRoleList = sysUserRoleService.getUserRoleByUserId(user.getId());
if(sysRoleList.get(0).getId().equals("1724327596426760194")){
//学生(上传证书和查询)(根据学号查询筛选)
Page<AwardPersion> page = new Page<AwardPersion>(pageNo, pageSize);
QueryWrapper<AwardPersion> queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap());
queryWrapper.eq("studentcode",user.getUsername());
IPage<AwardPersion> pageList = awardPersionService.page(page, queryWrapper);
return Result.OK(pageList);
}else if(sysRoleList.get(0).getId().equals("1693451972151386114")){
//组委会(全部都可以)(根据比赛负责人查询比赛id筛选)
Comp comp = new Comp();
QueryWrapper<Comp> queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap());
queryWrappercomp.like("comp_admin",user.getUsername());
List<Comp> list = compService.list(queryWrappercomp);
List<String> ids = list.stream().map(Comp::getId).collect(Collectors.toList());
QueryWrapper<AnnualComp> queryWrapperAnnual = new QueryWrapper<>();
queryWrapperAnnual.in(ids.size()!=0,"compid",ids);
List<AnnualComp> listAnnual = annualCompService.list(queryWrapperAnnual);
List<String> annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList());
QueryWrapper<AwardPersion> queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap());
queryWrapper.in(annualIds.size()!=0,"annal_comp",annualIds);
AnnualCompPoint annualCompPoint = new AnnualCompPoint();
QueryWrapper<AnnualCompPoint> queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap());
queryWrapperacp.in(annualIds.size()!=0,"annual_comp_id",annualIds);
queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的
List<AnnualCompPoint> listacp = annualCompPointService.list(queryWrapperacp);
List<String> acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList());
queryWrapper.in(acpIds.size()!=0,"annual_comp_p",acpIds);
AnnualCompPoint annualCompPoint = new AnnualCompPoint();
QueryWrapper<AnnualCompPoint> queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap());
queryWrapperacp.in(annualIds.size()!=0,"annual_comp_id",annualIds);
queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的
List<AnnualCompPoint> listacp = annualCompPointService.list(queryWrapperacp);
List<String> acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList());
queryWrapper.in(acpIds.size()!=0,"annual_comp_p",acpIds);
Page<AwardPersion> page = new Page<AwardPersion>(pageNo, pageSize);
IPage<AwardPersion> pageList = awardPersionService.page(page, queryWrapper);
return Result.OK(pageList);
}else if(sysRoleList.get(0).getId().equals("1693452352310517762")){
//学院(上传和查询)(根据部门查询数据,该学院下所有学生的获奖信息)
Page<AwardPersion> page = new Page<AwardPersion>(pageNo, pageSize);
QueryWrapper<AwardPersion> queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap());
queryWrapper.eq("studentorg",sysDepartService.queryDepartsByUsername(user.getUsername()).get(0).getOrgCode());
IPage<AwardPersion> pageList = awardPersionService.page(page, queryWrapper);
return Result.OK(pageList);
}else {
//学校和超级管理员(全部都可以)(查全部数据)
Page<AwardPersion> page = new Page<AwardPersion>(pageNo, pageSize);
QueryWrapper<AwardPersion> queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap());
IPage<AwardPersion> pageList = awardPersionService.page(page, queryWrapper);
return Result.OK(pageList);
}
Page<AwardPersion> page = new Page<AwardPersion>(pageNo, pageSize);
IPage<AwardPersion> pageList = awardPersionService.page(page, queryWrapper);
return Result.OK(pageList);
}
@ -204,10 +230,7 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
SysUser sysUser = sysUserService.getById(listtm1.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername());
SysUserDepart sysUserDepart = new SysUserDepart(null,null);
QueryWrapper<SysUserDepart> queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, req.getParameterMap());
queryWrappersud.eq("user_id",sysUser.getId());
awardPersion.setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode());
awardPersion.setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).getOrgCode());
awardPersionService.save(awardPersion);
AnnualCompPoint annualCompPoint = annualCompPointService.getById(awardPersion.getAnnualCompP());
annualCompPoint.setIsPj(1);
@ -217,15 +240,16 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername());
SysUserDepart sysUserDepart = new SysUserDepart(null,null);
QueryWrapper<SysUserDepart> queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, req.getParameterMap());
queryWrappersud.eq("user_id",sysUser.getId());
awardPersion.setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode());
awardPersion.setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).getOrgCode());
awardPersionService.save(awardPersion);
AnnualCompPoint annualCompPoint = annualCompPointService.getById(awardPersion.getAnnualCompP());
annualCompPoint.setIsPj(1);
annualCompPointService.updateById(annualCompPoint);
return Result.OK("添加成功!");
/* SysUserDepart sysUserDepart = new SysUserDepart(null,null);
QueryWrapper<SysUserDepart> queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, req.getParameterMap());
queryWrappersud.eq("user_id",sysUser.getId());
awardPersion.setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode());*/
}
}
@ -270,20 +294,14 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
SysUser sysUser = sysUserService.getById(listtm1.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername());
SysUserDepart sysUserDepart = new SysUserDepart(null,null);
QueryWrapper<SysUserDepart> queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, req.getParameterMap());
queryWrappersud.eq("user_id",sysUser.getId());
awardPersion.setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode());
awardPersion.setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).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<SysUserDepart> queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, req.getParameterMap());
queryWrappersud.eq("user_id",sysUser.getId());
awardPersion.setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode());
awardPersion.setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).getOrgCode());
awardPersionService.updateById(awardPersion);
return Result.OK("编辑成功!");
}
@ -482,10 +500,7 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
queryWrappertm1.eq("captain","1");
List<TeamManagement> listtm1 = teamManagementService.list(queryWrappertm1);
SysUser sysUser = sysUserService.getById(listtm1.get(0).getUserId());
SysUserDepart sysUserDepart = new SysUserDepart(null,null);
QueryWrapper<SysUserDepart> queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, request.getParameterMap());
queryWrappersud.eq("user_id",sysUser.getId());
list.get(i).setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode());
list.get(i).setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).getOrgCode());
if(listaca.get(0).getFirstPrize().equals(list.get(i).getAwardname())){
list.get(i).setAwardsort(1);
list.get(i).setAwardid(listaca.get(0).getId());
@ -517,10 +532,7 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
}else {
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
SysUserDepart sysUserDepart = new SysUserDepart(null,null);
QueryWrapper<SysUserDepart> queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, request.getParameterMap());
queryWrappersud.eq("user_id",sysUser.getId());
list.get(i).setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode());
list.get(i).setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).getOrgCode());
if(listaca.get(0).getFirstPrize().equals(list.get(i).getAwardname())){
list.get(i).setAwardsort(1);
list.get(i).setAwardid(listaca.get(0).getId());
@ -587,4 +599,18 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
//return super.importExcel(request, response, AwardPersion.class);
}
/**
* 上传证书
*
* @param
* @return
*/
@AutoLog(value = "上传证书")
@ApiOperation(value="上传证书", notes="上传证书")
@PostMapping(value = "/sczs")
public Result<String> sczs(@RequestBody AwardPersion awardPersion,HttpServletRequest req) {
awardPersionService.updateById(awardPersion);
return Result.OK("成功!");
}
}

@ -113,4 +113,9 @@ public class AwardPersion implements Serializable {
@ApiModelProperty(value = "学生所属学院")
private String studentorg;
/**上传证书*/
@ApiModelProperty(value = "上传证书")
private String sczs;
}

@ -71,4 +71,16 @@ public class CompSystemBigScreenController /*extends JeecgController*/ {
return Result.ok(compSystemBigScreenService.nengLi());
}
@ApiOperation(value = "河南机电-院系获奖大屏数据", notes = "河南机电-院系获奖大屏数据")
@GetMapping(value = "/huoJiang")
public Result huoJiang() {
return Result.ok(compSystemBigScreenService.huoJiang());
}
@ApiOperation(value = "河南机电-院系各比赛类型得分大屏数据", notes = "河南机电-院系各比赛类型得分大屏数据")
@GetMapping(value = "/deFei")
public Result deFei() {
return Result.ok(compSystemBigScreenService.deFei());
}
}

@ -17,4 +17,8 @@ public interface CompSystemBigScreenService {
List<Map<String, Object>> canSai();
Object nengLi();
Object huoJiang();
Object deFei();
}

@ -15,6 +15,7 @@ import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint;
import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService;
import org.jeecg.modules.demo.annualScore.entity.PersonalCompScore;
import org.jeecg.modules.demo.annualScore.entity.PersonalCompTotalScore;
import org.jeecg.modules.demo.annualScore.service.IDepartCompTotalScoreService;
import org.jeecg.modules.demo.annualScore.service.IPersonalCompScoreService;
import org.jeecg.modules.demo.annualScore.service.IPersonalCompTotalScoreService;
import org.jeecg.modules.demo.annualcomp.entity.AnnualComp;
@ -67,6 +68,9 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
@Autowired
private ISysDepartService iSysDepartService;
@Autowired
private IDepartCompTotalScoreService iDepartCompTotalScoreService;
@Autowired
private IAnnualCompetitionProjectRegistrationService iAnnualCompetitionProjectRegistrationService;
@Autowired
@ -168,6 +172,94 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
return resultList;
}
@Override
public List<Map<String, Object>> huoJiang() {
List<Map<String, Object>> resultList = new LinkedList<>();
//二级部门
List<SysDepart> departList = iSysDepartService.list(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getParentId, BASE_PARENT_ID));
Optional.ofNullable(departList).orElse(new LinkedList<>()).stream().forEach(depart -> {
Map<String, Object> resultMap = new LinkedHashMap<>();
//部门报名人数
List<AnnualCompetitionProjectRegistration> registrationList = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>()
.eq(AnnualCompetitionProjectRegistration::getSysOrgCode, depart.getOrgCode()));
//部门得奖人数
List<AwardPersion> awardPersionList = iAwardPersionService.list(new LambdaQueryWrapper<AwardPersion>()
.in(AwardPersion::getSysOrgCode, depart.getOrgCode())
.orderByAsc(AwardPersion::getAwardname));
Map<String, List<AwardPersion>> awardNameListMap = Optional.ofNullable(awardPersionList).orElse(new LinkedList<>()).stream()
.collect(Collectors.groupingBy(AwardPersion::getAwardname));
//遍历分组后的结果
DecimalFormat decimalFormat = new DecimalFormat();
decimalFormat.setMaximumFractionDigits(2); // 保留两位小数
decimalFormat.setRoundingMode(RoundingMode.HALF_UP); // 设置具体的进位机制
List<CompVo> vos = new ArrayList<>();
Optional.ofNullable(awardNameListMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> {
double ratio = ComputeUtils.div2(value.size(), registrationList.size());
CompVo vo = new CompVo();
vo.setCompOrganId(depart.getId());
vo.setCompOrganName(depart.getDepartName());
vo.setNumber(registrationList.size());
vo.setAwardName(key);
vo.setAwardNumber(value.size());
vo.setAwardRatio(ratio + "");
vos.add(vo);
});
if (!ObjectUtils.isEmpty(awardNameListMap)) {
CompVo noAwardVo = new CompVo();
noAwardVo.setCompOrganId(depart.getId());
noAwardVo.setCompOrganName(depart.getDepartName());
noAwardVo.setNumber(registrationList.size());
noAwardVo.setAwardName("未获取");
noAwardVo.setAwardNumber(registrationList.size() - awardPersionList.size());
double ratio2 = ComputeUtils.div2(registrationList.size() - awardPersionList.size(), registrationList.size());
noAwardVo.setAwardRatio(ratio2 + "");
vos.add(noAwardVo);
}
resultMap.put(depart.getDepartName(), vos);
resultList.add(resultMap);
});
return resultList;
}
@Override
public List<Map<String, Object>> deFei() {
List<Map<String, Object>> resultList = new LinkedList<>();
//二级部门
List<SysDepart> departList = iSysDepartService.list(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getParentId, BASE_PARENT_ID));
Optional.ofNullable(departList).orElse(new LinkedList<>()).stream().forEach(depart -> {
Map<String, Object> resultMap = new LinkedHashMap<>();
List<Comp> compList = iCompService.list(new LambdaQueryWrapper<Comp>().eq(Comp::getCompOrgan, depart.getParentId()));
//比赛类型
Map<String, List<Comp>> compTypeListMap = Optional.ofNullable(compList).orElse(new LinkedList<>()).stream()
.collect(Collectors.groupingBy(Comp::getCompTypeId));
//TODO
//遍历分组后的结果
// DecimalFormat decimalFormat = new DecimalFormat();
// decimalFormat.setMaximumFractionDigits(2); // 保留两位小数
// decimalFormat.setRoundingMode(RoundingMode.HALF_UP); // 设置具体的进位机制
// List<CompVo> vos = new ArrayList<>();
// Optional.ofNullable(compTypeListMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> {
//
// double ratio = ComputeUtils.div2(value.size(), registrationList.size());
// CompVo vo = new CompVo();
// vo.setCompOrganId(depart.getId());
// vo.setCompOrganName(depart.getDepartName());
// vo.setNumber(registrationList.size());
// vo.setAwardName(key);
// vo.setAwardNumber(value.size());
// vo.setAwardRatio(ratio + "");
// vos.add(vo);
// });
resultMap.put(depart.getDepartName(), null);
resultList.add(resultMap);
});
return resultList;
}
/**
* @description: 单项比赛数据展示
* 使用大数据页面的形式全面展示某项比赛的各种综合数据包括年度比赛列表比赛项目数参赛人数统计多维度能力评价分析数据近五年比赛人数对比比赛获奖列表参赛人员积分列表需要提供功能截图
@ -611,9 +703,13 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
annualCompList.stream().forEach(ac -> {
AnnualCompPoint annualCompPoint = iAnnualCompPointService.getOne(new LambdaQueryWrapper<AnnualCompPoint>().eq(AnnualCompPoint::getAnnualCompId, ac.getId()));
if (!ObjectUtils.isEmpty(annualCompPoint)) {
long personCount4CompTemp = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>().
eq(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPoint.getId()));
personCount4Comp.getAndUpdate(val -> val.add(new BigDecimal(personCount4CompTemp)));
List<AnnualCompetitionProjectRegistration> list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>()
.eq(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPoint.getId()));
if (!ObjectUtils.isEmpty(list)) {
Set<String> entryFormats = list.stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet());
long personCount4CompTemp = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(TeamManagement::getEnrollCode, entryFormats));
personCount4Comp.getAndUpdate(val -> val.add(new BigDecimal(personCount4CompTemp)));
}
}
});
}
@ -633,9 +729,13 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
Optional.ofNullable(annualCompPointList).orElse(new LinkedList<>()).stream().forEach(p -> {
CompVo compVo = new CompVo();
BeanUtils.copyProperties(p, compVo);
Long numberCount = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>()
List<AnnualCompetitionProjectRegistration> list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>()
.eq(AnnualCompetitionProjectRegistration::getAnnualCompid, p.getId()));
compVo.setNumber(numberCount.intValue());
if (!ObjectUtils.isEmpty(list)) {
Set<String> entryFormats = list.stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet());
Long count = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(TeamManagement::getEnrollCode, entryFormats));
compVo.setNumber(count.intValue());
}
AnnualComp annualComp = iAnnualCompService.getById(p.getAnnualCompId());
if (!ObjectUtils.isEmpty(annualComp)) {
Comp comp = iCompService.getById(annualComp.getCompid());
@ -675,12 +775,15 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
compVo.setAnnualCompPointNumber(annualCompPointList.size());
Set<String> annualCompPointIds = Optional.ofNullable(annualCompPointList).orElse(new ArrayList<>()).stream().map(annualCompPoint -> annualCompPoint.getId()).collect(Collectors.toSet());
if (!ObjectUtils.isEmpty(annualCompPointIds)) {
//报名表
List<AnnualCompetitionProjectRegistration> list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>()
.in(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPointIds)
.eq(AnnualCompetitionProjectRegistration::getSysOrgCode, sysDepart.getOrgCode())
);
compVo.setNumber(list.size());
//报名表,只存本次的报名编号和项目id
List<AnnualCompetitionProjectRegistration> annualCompetitionProjectRegistrationList = iAnnualCompetitionProjectRegistrationService
.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>()
.in(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPointIds));
if (!ObjectUtils.isEmpty(annualCompetitionProjectRegistrationList)) {
Set<String> entryFormats = annualCompetitionProjectRegistrationList.stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet());
Long count = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(TeamManagement::getEnrollCode, entryFormats));
compVo.setNumber(count.intValue());
}
}
}
compVoList.add(compVo);
@ -713,9 +816,15 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
Set<String> annualCompPointIds = Optional.ofNullable(annualCompPointList).orElse(new ArrayList<>()).stream().map(annualCompPoint -> annualCompPoint.getId()).collect(Collectors.toSet());
if (!ObjectUtils.isEmpty(annualCompPointIds)) {
//报名表
List<AnnualCompetitionProjectRegistration> list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>()
.in(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPointIds));
compVo.setNumber(list.size());
//报名表,只存本次的报名编号和项目id
List<AnnualCompetitionProjectRegistration> annualCompetitionProjectRegistrationList = iAnnualCompetitionProjectRegistrationService
.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>()
.in(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPointIds));
if (!ObjectUtils.isEmpty(annualCompetitionProjectRegistrationList)) {
Set<String> entryFormats = annualCompetitionProjectRegistrationList.stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet());
Long count = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(TeamManagement::getEnrollCode, entryFormats));
compVo.setNumber(count.intValue());
}
}
compVoList.add(compVo);
});

@ -44,6 +44,9 @@ public class CompVo implements Serializable {
@ApiModelProperty(value = "获取人数")
private Integer awardNumber;
@ApiModelProperty(value = "获取比率")
private String awardRatio;
@ApiModelProperty(value = "年度比赛状态")
private String status;
}

@ -1,22 +1,29 @@
package org.jeecg.modules.demo.expert.controller;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.ImportExcelUtil;
import org.jeecg.common.util.PasswordUtil;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.JeecgBaseConfig;
import org.jeecg.modules.base.service.BaseCommonService;
import org.jeecg.modules.demo.annualcomp.entity.AnnualComp;
import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService;
@ -24,6 +31,7 @@ import org.jeecg.modules.demo.annualcompgroup.service.IAnnualCompGroupService;
import org.jeecg.modules.demo.compexp.entity.CompExp;
import org.jeecg.modules.demo.compexp.service.ICompExpService;
import org.jeecg.modules.demo.expert.entity.Expert;
import org.jeecg.modules.demo.expert.entity.UserExpertExcel;
import org.jeecg.modules.demo.expert.service.IExpertService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -34,14 +42,21 @@ import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.demo.expgroup.entity.ExpGroup;
import org.jeecg.modules.demo.expgroup.service.IExpGroupService;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.entity.SysUserDepart;
import org.jeecg.modules.system.entity.SysUserRole;
import org.jeecg.modules.system.service.ISysUserDepartService;
import org.jeecg.modules.system.service.ISysUserRoleService;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
@ -84,9 +99,19 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
@Autowired
private IExpGroupService expGroupService;
@Resource
private JeecgBaseConfig jeecgBaseConfig;
@Value("${jeecg.path.upload}")
private String upLoadPath;
//角色
@Autowired
private ISysUserRoleService sysUserRoleService;
//用户部门
@Autowired
private ISysUserDepartService sysUserDepartService;
/**
* 分页列表查询
@ -209,17 +234,22 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
QueryWrapper<Expert> queryWrapper = QueryGenerator.initQueryWrapper(expert, req.getParameterMap());
queryWrapper.eq("user_id",id);
List<Expert> list = expertService.list(queryWrapper);
if(list.size()==0) {
return Result.error("未找到对应数据");
}
Expert model=list.get(0);
CompExp compExp = new CompExp();
QueryWrapper<CompExp> queryWrapper1 = QueryGenerator.initQueryWrapper(compExp, req.getParameterMap());
queryWrapper1.eq("expid",list.get(0).getId());
queryWrapper1.eq("expid",model.getId());
List<CompExp> list1 = compExpService.list(queryWrapper1);
if(list.size()==0) {
return Result.error("未找到对应数据");
if(list1.size()>0) {
CompExp compExpModel=list1.get(0);
model.setCompid(compExpModel.getCompid());
model.setStat(compExpModel.getStat());
model.setCompName(compExpModel.getCompName());
}
list.get(0).setCompid(list1.get(0).getCompid());
list.get(0).setStat(list1.get(0).getStat());
list.get(0).setCompName(list1.get(0).getCompName());
return Result.OK(list.get(0));
return Result.OK(model);
}
/**
@ -246,7 +276,8 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
@RequestMapping(value = "/addZJ", method = RequestMethod.POST)
public Result<SysUser> addZJ(@RequestBody JSONObject jsonObject) {
Result<SysUser> result = new Result<SysUser>();
String selectedRoles = jsonObject.getString("selectedroles");
// String selectedRoles = jsonObject.getString("selectedroles");
String selectedRoles = "1731948288626339841";
String selectedDeparts = jsonObject.getString("selecteddeparts");
String expSc = jsonObject.getString("expSc");
String expResume = jsonObject.getString("expResume");//简介
@ -289,16 +320,13 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
expert.setExpYjfx(expYjfx);//研究方向
expert.setExpCsgz(expCsgz);//从事工作
expertService.save(expert);
/* expertService.save(expert);
CompExp compExp = new CompExp();
compExp.setCompid(compid);
compExp.setCompName(compName);
compExp.setExpid(expert.getId());
compExp.setStat(stat);
compExpService.save(compExp);
compExpService.save(compExp);*/
result.success("添加成功!");
} catch (Exception e) {
log.error(e.getMessage(), e);
@ -360,7 +388,7 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
expert.setExpCsgz(expCsgz);//从事工作
expertService.updateById(expert);
CompExp compExp = new CompExp();
/* CompExp compExp = new CompExp();
QueryWrapper<CompExp> queryWrapper1 = QueryGenerator.initQueryWrapper(compExp, req.getParameterMap());
queryWrapper1.eq("expid",expert.getId());
List<CompExp> listce = compExpService.list(queryWrapper1);
@ -369,7 +397,7 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
compExp.setCompName(compName);
compExp.setExpid(expert.getId());
compExp.setStat(stat);
compExpService.updateById(compExp);
compExpService.updateById(compExp);*/
result.success("修改成功!");
}
} catch (Exception e) {
@ -380,28 +408,256 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
}
/**
* 导出excel
* 导出excel模板
*
* @param request
* @param expert
*/
//@RequiresPermissions("expert:expert:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, Expert expert) {
return super.exportXls(request, expert, Expert.class, "专家表");
@RequestMapping(value = "/exportXlsMb")
public ModelAndView exportXlsMb(HttpServletRequest request, Expert expert) {
//return super.exportXls(request, expert, Expert.class, "专家表");
//LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// Step.2 获取导出数据
List<UserExpertExcel> exportList = new ArrayList<>();
// Step.3 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
//此处设置的filename无效 ,前端会重更新设置一下
mv.addObject(NormalExcelConstants.FILE_NAME, "专家表导入模板");
mv.addObject(NormalExcelConstants.CLASS, UserExpertExcel.class);
//update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
ExportParams exportParams=new ExportParams("专家表导入模板", "仅允许专家导入" , "专家表导入模板");
exportParams.setImageBasePath(jeecgBaseConfig.getPath().getUpload());
//update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
mv.addObject(NormalExcelConstants.PARAMS,exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
return mv;
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
//@RequiresPermissions("expert:expert:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, Expert.class);
}
/**
* 导出excel
*
* @param request
* @param sysUser
*/
//@RequiresPermissions("system:user:export")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(SysUser sysUser,HttpServletRequest request) {
// Step.1 组装查询条件
QueryWrapper<SysUser> queryWrapper = QueryGenerator.initQueryWrapper(sysUser, request.getParameterMap());
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
//update-begin--Author:kangxiaolin Date:20180825 for:[03]用户导出,如果选择数据则只导出相关数据--------------------
String selections = request.getParameter("selections");
if(!oConvertUtils.isEmpty(selections)){
queryWrapper.in("id",selections.split(","));
}
//角色
String rolesIds = "1731948288626339841";
if (oConvertUtils.isNotEmpty(rolesIds)) {
List<String> roleIds = Arrays.asList(rolesIds.split(","));
// 使用 exists 子查询方式查询
// 注意:MyBatis-Plus 不直接支持 exists 语法,因此我们使用 inSql 来模拟这个行为
queryWrapper.inSql(
"id",
"SELECT user_id FROM sys_user_role WHERE role_id IN ("
+ StringUtils.join(roleIds.stream().map(id -> "'" + id + "'").collect(Collectors.toList()), ",")
+ ")"
);
}
//update-end--Author:kangxiaolin Date:20180825 for:[03]用户导出,如果选择数据则只导出相关数据----------------------
List<SysUser> pageList = sysUserService.list(queryWrapper);
//批量查询用户的所属部门
//step.1 先拿到全部的 useids
List<String> userIds = pageList.stream().map(SysUser::getId).collect(Collectors.toList());
//step.2 通过 useids,一次性查询用户的所属部门名字
if (!userIds.isEmpty()) {
Map<String, String> depNames = sysUserService.getDepNamesByUserIds(userIds);
// 更新 SysUser 对象,添加部门名称
pageList.forEach(user -> user.setDepartIds(depNames.get(user.getId())));
}
List<UserExpertExcel> exportList = new ArrayList<>();
// 遍历 SysUser 列表
for (SysUser item : pageList) {
// 创建 UserExpertExcel 实例
UserExpertExcel excelItem = new UserExpertExcel();
// 复制 SysUser 的信息
try {
excelItem.setUsername(item.getUsername());//登录账号
excelItem.setWorkNo(item.getWorkNo());//工号
excelItem.setRealname(item.getRealname());//真实姓名
excelItem.setBirthday(item.getBirthday());//生日
excelItem.setSex(item.getSex());//
excelItem.setEmail(item.getEmail());//电子邮件
excelItem.setPhone(item.getPhone());//电话
excelItem.setDepartIds(item.getDepartIds());//负责部门
excelItem.setStatus(item.getStatus());//状态
} catch (Exception e) {
// 处理异常,比如属性类型不匹配
e.printStackTrace();
}
// 创建 QueryWrapper 实例
QueryWrapper<Expert> queryWrapperExpert = new QueryWrapper<>();
queryWrapperExpert.eq("user_id", item.getId());
// 执行查询
Expert exp = expertService.getOne(queryWrapperExpert);
// 如果 Expert 存在,则复制 Expert 的信息
if (exp != null) {
try {
excelItem.setName(exp.getName());//专家名称
excelItem.setExpTitle(exp.getExpTitle());//专家学历
excelItem.setExpZc(exp.getExpZc());//职称
excelItem.setExpXw(exp.getExpXw());//学位
excelItem.setExpCsgz(exp.getExpCsgz());//从事工作
excelItem.setExpYjfx(exp.getExpYjfx());//研究方向
excelItem.setExpSc(exp.getExpSc());//专家毕业院校
excelItem.setExpResume(exp.getExpResume());//简介
} catch (Exception e) {
// 处理异常,比如属性类型不匹配
e.printStackTrace();
}
}
// 将 UserExpertExcel 添加到列表中
exportList.add(excelItem);
}
//导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "用户列表");
mv.addObject(NormalExcelConstants.CLASS, UserExpertExcel.class);
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
ExportParams exportParams = new ExportParams("专家列表数据", "导出人:"+user.getRealname(), "导出信息");
exportParams.setImageBasePath(upLoadPath);
mv.addObject(NormalExcelConstants.PARAMS, exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
return mv;
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response)throws IOException {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
// 错误信息
List<String> errorMessage = new ArrayList<>();
int successLines = 0, errorLines = 0;
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<UserExpertExcel> listSysUsers = ExcelImportUtil.importExcel(file.getInputStream(), UserExpertExcel.class, params);
for (int i = 0; i < listSysUsers.size(); i++) {
SysUserRole sysUserRole = new SysUserRole();
UserExpertExcel userExpertExcel = listSysUsers.get(i);
SysUser user=new SysUser();
user.setUsername(userExpertExcel.getUsername());//登录账号
user.setWorkNo(userExpertExcel.getWorkNo());//工号
user.setRealname(userExpertExcel.getRealname());//真实姓名
user.setBirthday(userExpertExcel.getBirthday());//生日
user.setSex(userExpertExcel.getSex());//
user.setEmail(userExpertExcel.getEmail());//电子邮件
user.setPhone(userExpertExcel.getPhone());//电话
user.setDepartIds(userExpertExcel.getDepartIds());//负责部门
user.setStatus(userExpertExcel.getStatus());//状态
user.setPassword("Admin123.");
// 密码加密加盐
String salt = oConvertUtils.randomGen(8);
user.setSalt(salt);
String passwordEncode = PasswordUtil.encrypt(user.getUsername(), user.getPassword(), salt);
user.setPassword(passwordEncode);
try {
if (user.getUsername()=="" || user.getUsername().isEmpty() || user.getUsername()==null) {
}else {
user.setDelFlag(0);
sysUserService.save(user);
sysUserRole.setUserId(user.getId());
sysUserRole.setRoleId("1731948288626339841");
sysUserRoleService.save(sysUserRole);
//专家表
// 执行查询
Expert exp = new Expert();
// 如果 Expert 存在,则复制 Expert 的信息
try {
exp.setUserId(user.getId());//
exp.setName(userExpertExcel.getName());//专家名称
exp.setExpTitle(userExpertExcel.getExpTitle());//专家学历
exp.setExpZc(userExpertExcel.getExpZc());//职称
exp.setExpXw(userExpertExcel.getExpXw());//学位
exp.setExpCsgz(userExpertExcel.getExpCsgz());//从事工作
exp.setExpYjfx(userExpertExcel.getExpYjfx());//研究方向
exp.setExpSc(userExpertExcel.getExpSc());//专家毕业院校
exp.setExpResume(userExpertExcel.getExpResume());//简介
expertService.save(exp);
} catch (Exception e) {
// 处理异常,比如属性类型不匹配
e.printStackTrace();
}
}
successLines++;
} catch (Exception e) {
errorLines++;
String message = e.getMessage().toLowerCase();
int lineNumber = i + 1;
// 通过索引名判断出错信息
if (message.contains(CommonConstant.SQL_INDEX_UNIQ_SYS_USER_USERNAME)) {
errorMessage.add("第 " + lineNumber + " 行:用户名已经存在,忽略导入。");
} else if (message.contains(CommonConstant.SQL_INDEX_UNIQ_SYS_USER_WORK_NO)) {
errorMessage.add("第 " + lineNumber + " 行:工号已经存在,忽略导入。");
} else if (message.contains(CommonConstant.SQL_INDEX_UNIQ_SYS_USER_PHONE)) {
errorMessage.add("第 " + lineNumber + " 行:手机号已经存在,忽略导入。");
} else if (message.contains(CommonConstant.SQL_INDEX_UNIQ_SYS_USER_EMAIL)) {
errorMessage.add("第 " + lineNumber + " 行:电子邮件已经存在,忽略导入。");
} else if (message.contains(CommonConstant.SQL_INDEX_UNIQ_SYS_USER)) {
errorMessage.add("第 " + lineNumber + " 行:违反表唯一性约束。");
} else {
errorMessage.add("第 " + lineNumber + " 行:未知错误,忽略导入");
log.error(e.getMessage(), e);
}
}
// 批量将部门和用户信息建立关联关系
String departIds = userExpertExcel.getDepartIds();
if (StringUtils.isNotBlank(departIds)) {
String userId = user.getId();
String[] departIdArray = departIds.split(",");
List<SysUserDepart> userDepartList = new ArrayList<>(departIdArray.length);
for (String departId : departIdArray) {
userDepartList.add(new SysUserDepart(userId, departId));
}
sysUserDepartService.saveBatch(userDepartList);
}
}
} catch (Exception e) {
errorMessage.add("发生异常:" + e.getMessage());
log.error(e.getMessage(), e);
} finally {
try {
file.getInputStream().close();
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
}
return ImportExcelUtil.imporReturnRes(errorLines,successLines,errorMessage);
}
}

@ -0,0 +1,135 @@
package org.jeecg.modules.demo.expert.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @Description: 专家表导出导入表
* @Author: jeecg-boot
* @Date: 2023-10-11
* @Version: V1.0
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="expert对象", description="专家表")
public class UserExpertExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 登录账号
*/
@Excel(name = "登录账号(必填且唯一)", width = 15)
private String username;
/**
* 工号唯一键
*/
@Excel(name = "工号(唯一)", width = 15)
private String workNo;
/**
* 真实姓名
*/
@Excel(name = "真实姓名(必填)", width = 15)
private String realname;
/**
* 生日
*/
@Excel(name = "生日(yyyy-MM-dd)", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date birthday;
/**
* 性别1 2
*/
@Excel(name = "性别(1:男 2:女)", width = 15,dicCode="sex")
@Dict(dicCode = "sex")
private Integer sex;
/**
* 电子邮件
*/
@Excel(name = "电子邮件(唯一)", width = 15)
private String email;
/**
* 电话
*/
@Excel(name = "电话(唯一)", width = 15)
private String phone;
/**
* 负责部门
*/
@Excel(name="院系",width = 15,dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
@Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
private String departIds;
/**专家名称*/
@Excel(name = "专家名称", width = 15)
@ApiModelProperty(value = "专家名称")
private String name;
/**专家学历*/
@Excel(name = "专家学历", width = 15)
@ApiModelProperty(value = "专家学历")
private String expTitle;
/**学位*/
@Excel(name = "学位", width = 15)
@ApiModelProperty(value = "学位")
private String expXw;
/**职称*/
@Excel(name = "职称", width = 15)
@ApiModelProperty(value = "职称")
private String expZc;
/**研究方向*/
@Excel(name = "研究方向", width = 15)
@ApiModelProperty(value = "研究方向")
private String expYjfx;
/**从事工作*/
@Excel(name = "从事工作", width = 15)
@ApiModelProperty(value = "从事工作")
private String expCsgz;
/**专家毕业院校*/
@Excel(name = "专家毕业院校", width = 15)
@ApiModelProperty(value = "专家毕业院校")
private String expSc;
/**简介*/
@Excel(name = "简介", width = 15)
@ApiModelProperty(value = "简介")
private String expResume;
/**
* 状态(1正常 2冻结
*/
@Excel(name = "状态(1:正常 2:冻结 )", width = 15,dicCode="user_status")
@Dict(dicCode = "user_status")
private Integer status;
}

@ -45,6 +45,9 @@ public class CommonController {
@Value(value = "${jeecg.path.upload}")
private String uploadpath;
@Value(value = "${jeecg.path.uploadzs}")
private String uploadpathzs;
/**
* 本地local miniominio 阿里alioss
*/
@ -126,6 +129,114 @@ public class CommonController {
return result;
}
/**
* 证书上传统一方法
* @param request
* @param response
* @return
*/
@PostMapping(value = "/uploadzs")
public Result<?> uploadzs(HttpServletRequest request, HttpServletResponse response) throws Exception {
Result<?> result = new Result<>();
String savePath = "";
String bizPath = request.getParameter("biz");
//LOWCOD-2580 sys/common/upload接口存在任意文件上传漏洞
if (oConvertUtils.isNotEmpty(bizPath)) {
if(bizPath.contains(SymbolConstant.SPOT_SINGLE_SLASH) || bizPath.contains(SymbolConstant.SPOT_DOUBLE_BACKSLASH)){
throw new JeecgBootException("上传目录bizPath,格式非法!");
}
}
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
// 获取上传文件对象
MultipartFile file = multipartRequest.getFile("file");
if(oConvertUtils.isEmpty(bizPath)){
if(CommonConstant.UPLOAD_TYPE_OSS.equals(uploadType)){
//未指定目录,则用阿里云默认目录 upload
bizPath = "uploadzs";
//result.setMessage("使用阿里云文件上传时,必须添加目录!");
//result.setSuccess(false);
//return result;
}else{
bizPath = "";
}
}
if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)){
//update-begin-author:liusq date:20221102 for: 过滤上传文件类型
FileTypeFilter.fileTypeFilter(file);
//update-end-author:liusq date:20221102 for: 过滤上传文件类型
//update-begin-author:lvdandan date:20200928 for:修改JEditor编辑器本地上传
savePath = this.uploadLocalzs(file,bizPath);
//update-begin-author:lvdandan date:20200928 for:修改JEditor编辑器本地上传
/** 富文本编辑器及markdown本地上传时采用返回链接方式
//针对jeditor编辑器如何使 lcaol模式,采用 base64格式存储
String jeditor = request.getParameter("jeditor");
if(oConvertUtils.isNotEmpty(jeditor)){
result.setMessage(CommonConstant.UPLOAD_TYPE_LOCAL);
result.setSuccess(true);
return result;
}else{
savePath = this.uploadLocal(file,bizPath);
}
*/
}else{
//update-begin-author:taoyan date:20200814 for:文件上传改造
savePath = CommonUtils.upload(file, bizPath, uploadType);
//update-end-author:taoyan date:20200814 for:文件上传改造
}
if(oConvertUtils.isNotEmpty(savePath)){
result.setMessage(savePath);
result.setSuccess(true);
}else {
result.setMessage("上传失败!");
result.setSuccess(false);
}
return result;
}
/**
* 本地文件上传
* @param mf 文件
* @param bizPath 自定义路径
* @return
*/
private String uploadLocalzs(MultipartFile mf,String bizPath){
try {
String ctxPath = uploadpathzs;
String fileName = null;
File file = new File(ctxPath + File.separator + bizPath + File.separator );
if (!file.exists()) {
// 创建文件根目录
file.mkdirs();
}
// 获取文件名
String orgName = mf.getOriginalFilename();
orgName = CommonUtils.getFileName(orgName);
if(orgName.indexOf(SymbolConstant.SPOT)!=-1){
fileName = orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.lastIndexOf("."));
}else{
fileName = orgName+ "_" + System.currentTimeMillis();
}
String savePath = file.getPath() + File.separator + fileName;
File savefile = new File(savePath);
FileCopyUtils.copy(mf.getBytes(), savefile);
String dbpath = null;
if(oConvertUtils.isNotEmpty(bizPath)){
dbpath = bizPath + File.separator + fileName;
}else{
dbpath = fileName;
}
if (dbpath.contains(SymbolConstant.DOUBLE_BACKSLASH)) {
dbpath = dbpath.replace(SymbolConstant.DOUBLE_BACKSLASH, SymbolConstant.SINGLE_SLASH);
}
return dbpath;
} catch (IOException e) {
log.error(e.getMessage(), e);
}
return "";
}
/**
* 本地文件上传
* @param mf 文件
@ -267,6 +378,68 @@ public class CommonController {
}
/**
* 预览图片&下载文件
* 请求地址http://localhost:8080/common/static/{user/20190119/e1fe9925bc315c60addea1b98eb1cb1349547719_1547866868179.jpg}
*
* @param request
* @param response
*/
@GetMapping(value = "/staticzs/**")
public void viewzs(HttpServletRequest request, HttpServletResponse response) {
// ISO-8859-1 ==> UTF-8 进行编码转换
String imgPath = extractPathFromPattern(request);
if(oConvertUtils.isEmpty(imgPath) || CommonConstant.STRING_NULL.equals(imgPath)){
return;
}
// 其余处理略
InputStream inputStream = null;
OutputStream outputStream = null;
try {
imgPath = imgPath.replace("..", "").replace("../","");
if (imgPath.endsWith(SymbolConstant.COMMA)) {
imgPath = imgPath.substring(0, imgPath.length() - 1);
}
String filePath = uploadpathzs + File.separator + imgPath;
File file = new File(filePath);
if(!file.exists()){
response.setStatus(404);
throw new RuntimeException("文件["+imgPath+"]不存在..");
}
// 设置强制下载不打开
response.setContentType("application/force-download");
response.addHeader("Content-Disposition", "attachment;fileName=" + new String(file.getName().getBytes("UTF-8"),"iso-8859-1"));
inputStream = new BufferedInputStream(new FileInputStream(filePath));
outputStream = response.getOutputStream();
byte[] buf = new byte[1024];
int len;
while ((len = inputStream.read(buf)) > 0) {
outputStream.write(buf, 0, len);
}
response.flushBuffer();
} catch (IOException e) {
log.error("预览文件失败" + e.getMessage());
response.setStatus(404);
e.printStackTrace();
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
if (outputStream != null) {
try {
outputStream.close();
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
}
}
// /**
// * 下载文件
// * 请求地址:http://localhost:8080/common/download/{user/20190119/e1fe9925bc315c60addea1b98eb1cb1349547719_1547866868179.jpg}

@ -88,13 +88,13 @@ public class SysUser implements Serializable {
/**
* 电子邮件
*/
@Excel(name = "电子邮件", width = 15)
@Excel(name = "电子邮件(唯一)", width = 15)
private String email;
/**
* 电话
*/
@Excel(name = "电话", width = 15)
@Excel(name = "电话(唯一)", width = 15)
private String phone;
/**

@ -184,6 +184,8 @@ jeecg:
path:
#文件上传根目录 设置
upload: /opt/upFiles
#文件上传根目录 设置
uploadzs: /opt/upFileszs
#webapp文件路径
webapp: /opt/webapp
shiro:

@ -21,6 +21,11 @@ enum Api {
*/
export const uploadUrl = `${baseUploadUrl}/sys/common/upload`;
/**
*
*/
export const uploadUrlzs = `${baseUploadUrl}/sys/common/uploadzs`;
/**
*
* @param params

@ -0,0 +1,260 @@
<template>
<div class="clearfix">
<a-upload
:listType="listType"
accept="image/*"
:multiple="multiple"
:action="uploadUrlzs"
:headers="headers"
:data="{ biz: bizPath }"
v-model:fileList="uploadFileList"
:beforeUpload="beforeUpload"
:disabled="disabled"
@change="handleChange"
@preview="handlePreview"
>
<div v-if="uploadVisible">
<div v-if="listType == 'picture-card'">
<LoadingOutlined v-if="loading" />
<UploadOutlined v-else />
<div class="ant-upload-text">{{ text }}</div>
</div>
<a-button v-if="listType == 'picture'" :disabled="disabled">
<UploadOutlined></UploadOutlined>
{{ text }}
</a-button>
</div>
</a-upload>
<a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel()">
<img alt="example" style="width: 100%" :src="previewImage" />
</a-modal>
</div>
</template>
<script lang="ts">
import { defineComponent, PropType, ref, reactive, watchEffect, computed, unref, watch, onMounted } from 'vue';
import { LoadingOutlined, UploadOutlined } from '@ant-design/icons-vue';
import { useRuleFormItem } from '/@/hooks/component/useFormItem';
import { propTypes } from '/@/utils/propTypes';
import { useAttrs } from '/@/hooks/core/useAttrs';
import { useMessage } from '/@/hooks/web/useMessage';
import { getFileAccessHttpUrlzs, getRandom } from '/@/utils/common/compUtils';
import { uploadUrlzs } from '/@/api/common/api';
import { getToken } from '/@/utils/auth';
const { createMessage, createErrorModal } = useMessage();
export default defineComponent({
name: 'JImageUpload',
components: { LoadingOutlined, UploadOutlined },
inheritAttrs: false,
props: {
//
value: propTypes.oneOfType([propTypes.string, propTypes.array]),
//
listType: {
type: String,
required: false,
default: 'picture-card',
},
//
text: {
type: String,
required: false,
default: '上传',
},
//
bizPath: {
type: String,
required: false,
default: 'temp',
},
//
disabled: {
type: Boolean,
required: false,
default: false,
},
//
fileMax: {
type: Number,
required: false,
default: 1,
},
},
emits: ['options-change', 'change', 'update:value'],
setup(props, { emit, refs }) {
const emitData = ref<any[]>([]);
const attrs = useAttrs();
const [state] = useRuleFormItem(props, 'value', 'change', emitData);
//
const getFileName = (path) => {
if (path.lastIndexOf('\\') >= 0) {
let reg = new RegExp('\\\\', 'g');
path = path.replace(reg, '/');
}
return path.substring(path.lastIndexOf('/') + 1);
};
//token
const headers = ref<object>({
'X-Access-Token': getToken(),
});
//
const loading = ref<boolean>(false);
//
const initTag = ref<boolean>(true);
//
let uploadFileList = ref<any[]>([]);
//
const previewImage = ref<string | undefined>('');
//
const previewVisible = ref<boolean>(false);
//
const multiple = computed(() => {
return props['fileMax'] > 1;
});
//
const uploadVisible = computed(() => {
return uploadFileList.value.length < props['fileMax'];
});
/**
* 监听value变化
*/
watch(
() => props.value,
(val, prevCount) => {
//update-begin---author:liusq ---date:20230601 forissues/556JImageUploadvalue------------
if (val && val instanceof Array) {
val = val.join(',');
}
if (initTag.value == true) {
initFileList(val);
}
},
{ immediate: true }
//update-end---author:liusq ---date:20230601 forissues/556JImageUploadvalue------------
);
/**
* 初始化文件列表
*/
function initFileList(paths) {
if (!paths || paths.length == 0) {
uploadFileList.value = [];
return;
}
let files = [];
let arr = paths.split(',');
arr.forEach((value) => {
let url = getFileAccessHttpUrlzs(value);
files.push({
uid: getRandom(10),
name: getFileName(value),
status: 'done',
url: url,
response: {
status: 'history',
message: value,
},
});
});
uploadFileList.value = files;
}
/**
* 上传前校验
*/
function beforeUpload(file) {
let fileType = file.type;
if (fileType.indexOf('image') < 0) {
createMessage.info('请上传图片');
return false;
}
}
/**
* 文件上传结果回调
*/
function handleChange({ file, fileList, event }) {
initTag.value = false;
uploadFileList.value = fileList;
if (file.status === 'error') {
createMessage.error(`${file.name} 上传失败.`);
}
let fileUrls = [];
//
if (file.status != 'uploading') {
fileList.forEach((file) => {
if (file.status === 'done') {
//update-begin---author:wangshuai ---date:20221121 for[issues/248]使,------------
initTag.value = true;
//update-end---author:wangshuai ---date:20221121 for[issues/248]使,------------
fileUrls.push(file.response.message);
}
});
if (file.status === 'removed') {
handleDelete(file);
}
}
// emitData.value = fileUrls.join(',');
state.value = fileUrls.join(',');
emit('update:value', fileUrls.join(','));
}
/**
* 删除图片
*/
function handleDelete(file) {
//
console.log(file);
}
/**
* 预览图片
*/
function handlePreview(file) {
previewImage.value = file.url || file.thumbUrl;
previewVisible.value = true;
}
function getAvatarView() {
if (uploadFileList.length > 0) {
let url = uploadFileList[0].url;
return getFileAccessHttpUrlzs(url, null);
}
}
function handleCancel() {
previewVisible.value = false;
}
return {
state,
attrs,
previewImage,
previewVisible,
uploadFileList,
multiple,
headers,
loading,
uploadUrlzs,
beforeUpload,
uploadVisible,
handlePreview,
handleCancel,
handleChange,
};
},
});
</script>
<style scoped>
.ant-upload-select-picture-card i {
font-size: 32px;
color: #999;
}
.ant-upload-select-picture-card .ant-upload-text {
margin-top: 8px;
color: #666;
}
</style>

@ -28,6 +28,29 @@ export const getFileAccessHttpUrl = (fileUrl, prefix = 'http') => {
return result;
};
/**
* 访
* @param fileUrl
* @param prefix(http) http/https
*/
export const getFileAccessHttpUrlzs = (fileUrl, prefix = 'http') => {
let result = fileUrl;
try {
if (fileUrl && fileUrl.length > 0 && !fileUrl.startsWith(prefix)) {
//判断是否是数组格式
let isArray = fileUrl.indexOf('[') != -1;
if (!isArray) {
let prefix = `${baseApiUrl}/sys/common/staticzs/`;
// 判断是否已包含前缀
if (!fileUrl.startsWith(prefix)) {
result = `${prefix}${fileUrl}`;
}
}
}
} catch (err) {}
return result;
};
/**
* window.resize
*/

@ -1,6 +1,6 @@
import { h } from 'vue';
import { Avatar, Tag, Tooltip } from 'ant-design-vue';
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
import { getFileAccessHttpUrl,getFileAccessHttpUrlzs } from '/@/utils/common/compUtils';
import { Tinymce } from '/@/components/Tinymce';
import Icon from '/@/components/Icon';
import { getDictItemsByCode } from '/@/utils/dict/index';
@ -83,6 +83,35 @@ const render = {
);
//update-end-author:taoyan date:2022-5-24 for: VUEN-1084 【vue3】online表单测试发现的新问题 41、生成的代码,树默认图大小未改
},
/**
*
* @param text
*/
renderImagezs: ({ text }) => {
if (!text) {
//update-begin-author:taoyan date:2022-5-24 for: VUEN-1084 【vue3】online表单测试发现的新问题 41、生成的代码,树默认图大小未改
return h(
Avatar,
{ shape: 'square', size: 25 },
{
icon: () => h(Icon, { icon: 'ant-design:file-image-outlined', size: 25 }),
}
);
}
let avatarList = text.split(',');
return h(
'span',
avatarList.map((item) => {
return h(Avatar, {
src: getFileAccessHttpUrlzs(item),
shape: 'square',
size: 25,
style: { marginRight: '5px' },
});
})
);
//update-end-author:taoyan date:2022-5-24 for: VUEN-1084 【vue3】online表单测试发现的新问题 41、生成的代码,树默认图大小未改
},
/**
* Tooltip
* @param text

@ -16,7 +16,7 @@ enum Api {
queryCompId = '/annualcompgroup/annualCompGroup/queryCompId',
queryOptions = '/awardpersion/awardPersion/queryOptions',
personalAbilityEvaluation = '/abilityEvaluation/personalAbilityEvaluation/personalAbilityEvaluation2',
sczs='/awardpersion/awardPersion/sczs',
}
@ -91,6 +91,16 @@ export const saveOrUpdate1 = (params, isUpdate) => {
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}
/**
*
* @param params
* @param isUpdate
*/
export const sczs = (params, isUpdate) => {
let url = isUpdate ? Api.sczs : Api.sczs;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}
// 个人能力量化
export const personalAbilityEvaluation = (params,handleSuccess) => {
createConfirm({

@ -39,6 +39,12 @@ export const columns: BasicColumn[] = [
align: "center",
dataIndex: 'studentname'
},
{
title: '证书',
align: "center",
dataIndex: 'sczs',
customRender: render.renderImagezs,
},
/* {
title: '状态',
align: "center",

@ -54,7 +54,7 @@
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
<TableAction :actions="getTableAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
@ -72,6 +72,7 @@
<!-- 表单区域 -->
<AwardPersionModal ref="registerModal" @success="handleSuccess"></AwardPersionModal>
<AwardPersionModal1 ref="registerModal1" @success="handleSuccess"></AwardPersionModal1>
<AwardPersionModal2 ref="registerModal2" @success="handleSuccess"></AwardPersionModal2>
</div>
</template>
@ -92,6 +93,7 @@
import { downloadFile } from '/@/utils/common/renderUtils';
import AwardPersionModal from './components/AwardPersionModal.vue'
import AwardPersionModal1 from './components/AwardPersionModal1.vue'
import AwardPersionModal2 from './components/AwardPersionModal2.vue'
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
import {collectScore} from "/@/views/annualCompPoint/committee/AnnualCompPoint.api";
@ -101,6 +103,7 @@
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const registerModal1 = ref();
const registerModal2 = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls,onExportXlsMb } = useListPage({
tableProps: {
@ -181,6 +184,14 @@
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 上传证书事件
*/
async function sczs(record) {
registerModal2.value.disableSubmit = false;
registerModal2.value.add(record);
}
/**
* 批量删除事件
*/
@ -206,16 +217,27 @@
* 操作栏
*/
function getTableAction(record) {
return [
{
const actions = [];
actions.unshift({
label: '上传证书',
onClick: sczs.bind(null, record),
});
actions.unshift({
label: '编辑',
onClick: handleEdit.bind(null, record),
},
// {
// label: '',
// onClick: handlePersonalAbilityEvaluation.bind(null, record),
// },
];
});
actions.unshift({
label: '详情',
onClick: handleDetail.bind(null, record),
});
actions.unshift({
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
});
return actions;
}
/**
@ -232,7 +254,7 @@
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
}
},
]
}

@ -0,0 +1,284 @@
<template>
<div>
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="8">
<a-form-item label="年度" name="annualid">
<j-dict-select-tag placeholder="请选择年度" v-model:value="queryParam.annualid" dictCode="annual,annual_name,id"/>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="报名编号" name="enrollCode">
<a-input placeholder="请输入报名编号" v-model:value="queryParam.enrollCode"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
</a>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button>批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
<template #pcaSlot="{text}">
{{ getAreaTextByCode(text) }}
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<AwardPersionModal ref="registerModal" @success="handleSuccess"></AwardPersionModal>
<AwardPersionModal1 ref="registerModal1" @success="handleSuccess"></AwardPersionModal1>
<AwardPersionModal2 ref="registerModal2" @success="handleSuccess"></AwardPersionModal2>
</div>
</template>
<script lang="ts" name="awardpersion-awardPersion" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './AwardPersion.data';
import {
list,
deleteOne,
batchDelete,
getImportUrl,
getExportUrl,
getExportUrlMb,
// personalAbilityEvaluation
} from './AwardPersion.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import AwardPersionModal from './components/AwardPersionModal.vue'
import AwardPersionModal1 from './components/AwardPersionModal1.vue'
import AwardPersionModal2 from './components/AwardPersionModal2.vue'
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
import {collectScore} from "/@/views/annualCompPoint/committee/AnnualCompPoint.api";
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const registerModal1 = ref();
const registerModal2 = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls,onExportXlsMb } = useListPage({
tableProps: {
title: '获奖管理',
api: list,
columns,
canResize:false,
useSearchForm: false,
actionColumn: {
width: 230,
fixed: 'right',
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: "获奖管理",
url: getExportUrl,
params: queryParam,
},
exportConfigMb: {
name: "获奖管理",
url: getExportUrlMb,
params: null,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
});
const wrapperCol = reactive({
xs: { span: 24 },
sm: { span: 16 },
});
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 重新获取事件
*/
function cxhq() {
registerModal1.value.disableSubmit = false;
registerModal1.value.add();
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 上传证书事件
*/
async function sczs(record) {
registerModal2.value.disableSubmit = false;
registerModal2.value.add(record);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
// /**
// *
// */
// function handlePersonalAbilityEvaluation(record: Recordable) {
// personalAbilityEvaluation({annualCompP: record.annualCompP, enrollCode: record.enrollCode}, handleSuccess);
// }
/**
* 操作栏
*/
function getTableAction(record) {
const actions = [];
actions.unshift({
label: '上传证书',
onClick: sczs.bind(null, record),
});
actions.unshift({
label: '详情',
onClick: handleDetail.bind(null, record),
});
return actions;
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
},
]
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust{
width: calc(50% - 15px);
min-width: 100px !important;
}
.query-group-split-cust{
width: 30px;
display: inline-block;
text-align: center
}
}
</style>

@ -0,0 +1,148 @@
<template>
<a-spin :spinning="confirmLoading">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="12">
<a-form-item label="上传证书" v-bind="validateInfos.sczs" :label-col="{ span: 10, offset: 1 }">
<j-image-upload v-model:value="formData.sczs" :disabled="disabled" />
</a-form-item>
</a-col>
<!-- <a-col :span="24">
<a-form-item label="状态" v-bind="validateInfos.status">
<j-dict-select-tag v-model:value="formData.status" dictCode="sh_status" placeholder="请选择状态" :disabled="disabled"/>
</a-form-item>
</a-col>-->
<!-- <a-col :span="24">
<a-form-item label="奖项" v-bind="validateInfos.awardid">
<a-input v-model:value="formData.awardid" placeholder="请输入奖项" :disabled="disabled"></a-input>
</a-form-item>
</a-col>-->
</a-row>
</a-form>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted,watch } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
import { getValueType } from '/@/utils';
import { sczs,queryCompId } from '../AwardPersion.api';
import { Form } from 'ant-design-vue';
import { duplicateValidate } from '/@/utils/helper/validator'
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUploadzs.vue';
let strst = ref();
let ndbsxm = ref();
let options= ref();
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: ()=>{} },
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
sczs: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {
sczs: [{ required: true, message: '请上传证书!' }],
};
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
//
const disabled = computed(()=>{
if(props.formBpm === true){
if(props.formData.disabled === false){
return false;
}else{
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add(record) {
edit(record);
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
//
Object.assign(formData, record);
});
}
/**
* 提交数据
*/
async function submitForm() {
//
await validate();
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
/* let awardsort = model.awardname;
let awardname = model.awardsort;
model.awardname = awardname;
model.awardsort = awardsort;*/
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
await sczs(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
min-height: 500px !important;
overflow-y: auto;
padding: 24px 24px 24px 24px;
}
</style>

@ -0,0 +1,75 @@
<template>
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<AwardPersionForm2 ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></AwardPersionForm2>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import AwardPersionForm2 from './AwardPersionForm2.vue'
const title = ref<string>('');
const width = ref<number>(400);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add(record) {
title.value = '上传证书';
visible.value = true;
nextTick(() => {
registerForm.value.add(record);
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style>
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>

@ -68,6 +68,13 @@
data.record.compid = Expert.compid;
data.record.compName = Expert.compName;
data.record.stat = Expert.stat;
data.record.expXw = Expert.expXw;
data.record.expZc = Expert.expZc;
data.record.expYjfx = Expert.expYjfx;
data.record.expCsgz = Expert.expCsgz;
}
} catch (error) {}

@ -37,16 +37,16 @@ export const columns = [
dataIndex: 'phone',
width: 100,
},
{
title: '部门',
width: 150,
dataIndex: 'orgCodeTxt',
},
{
title: '负责部门',
width: 150,
dataIndex: 'departIds_dictText',
},
{
title: '院系/部门',
width: 150,
dataIndex: 'orgCodeTxt',
},
{
title: '角色',
width: 150,
dataIndex: 'roleTxt',
},
{
title: '状态',
dataIndex: 'status_dictText',

@ -40,14 +40,14 @@ export const columns: BasicColumn[] = [
width: 100,
},
{
title: '部门',
title: '院系/部门',
width: 150,
dataIndex: 'orgCodeTxt',
},
{
title: '负责部门',
title: '角色',
width: 150,
dataIndex: 'departIds_dictText',
dataIndex: 'roleTxt',
},
{
title: '状态',

@ -182,16 +182,16 @@ export const formSchemaZJ: FormSchema[] = [
labelKey: 'name',
},
},*/
{
/* {
label: '角色',
field: 'selectedroles',
component: 'ApiSelect',
componentProps: {
api: getAllRolesListNoByExcludeTenant,
api: getAllRolesListNoByTenant,
labelField: 'roleName',
valueField: 'id',
},
},
},*/
{
label: '所属部门',
field: 'selecteddeparts',
@ -306,20 +306,40 @@ export const formSchemaZJ: FormSchema[] = [
},
},*/
{
label: '专家毕业院校',
field: 'expSc',
label: '学历',
field: 'expTitle',
component: 'Input',
},
{
label: '专家履历',
field: 'expResume',
component: 'InputTextArea',
label: '学位',
field: 'expXw',
component: 'Input',
},
{
label: '专家学历',
field: 'expTitle',
label: '职称',
field: 'expZc',
component: 'Input',
},
{
label: '研究方向',
field: 'expYjfx',
component: 'Input',
},
{
label: '从事工作',
field: 'expCsgz',
component: 'Input',
},
{
label: '毕业院校',
field: 'expSc',
component: 'Input',
},
{
label: '简介',
field: 'expResume',
component: 'InputTextArea',
},
{
label: '比赛',
field: 'compid',

@ -20,6 +20,7 @@
import { useDrawerAdaptiveWidth } from '/@/hooks/jeecg/useAdaptiveWidth';
import { getTenantId } from "/@/utils/auth";
import {saveOrUpdateUserZJ} from "/@/views/system/userZJ/userZJ.api";
import {queryExpertById} from "/@/views/system/user/userZJ.api";
// Emits
const emit = defineEmits(['success', 'register']);
@ -59,6 +60,27 @@
}
} catch (error) {}
try {
const Expert = await queryExpertById({ id: data.record.id });
console.log(Expert);
if (Expert!=null) {
data.record.expSc = Expert.expSc;
data.record.expResume = Expert.expResume;
data.record.expTitle = Expert.expTitle;
data.record.compid = Expert.compid;
data.record.compName = Expert.compName;
data.record.stat = Expert.stat;
data.record.expXw = Expert.expXw;
data.record.expZc = Expert.expZc;
data.record.expYjfx = Expert.expYjfx;
data.record.expCsgz = Expert.expCsgz;
}
} catch (error) {}
///
const userDepart = await getUserDepartList({ userId: data.record.id });
if (userDepart && userDepart.length > 0) {

@ -6,9 +6,9 @@
<template #tableTitle>
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleCreate"> 新增</a-button>
<!-- <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>-->
<!-- <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls" >导入</j-upload-button>-->
<!-- <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXlsMb"> 模板</a-button>-->
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls" >导入</j-upload-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXlsMb"> 模板</a-button>
<JThirdAppButton biz-type="user" :selected-row-keys="selectedRowKeys" syncToApp syncToLocal @sync-finally="onSyncFinally" />
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
@ -62,7 +62,7 @@
import { useModal } from '/@/components/Modal';
import { useMessage } from '/@/hooks/web/useMessage';
import { columns, searchFormSchema } from './user.data';
import { listZjNoCareTenant, deleteUser, batchDeleteUser, getImportUrl, getExportUrl, frozenBatch, syncUser,queryByUserId,getExportUrlMb } from './user.api';
import { listZjNoCareTenant, deleteUser, batchDeleteUser, getZjImportUrl, getExportZjUrl, frozenBatch, syncUser,queryByUserId,getExportZjUrlMb } from './user.api';
import {usePermission} from "/@/hooks/web/usePermission";
import {defHttp} from "../../../utils/http/axios";
@ -95,16 +95,16 @@
},
},
exportConfig: {
name: '用户列表',
url: getExportUrl,
name: '专家列表',
url: getExportZjUrl,
},
exportConfigMb: {
name: "导模板",
url: getExportUrlMb,
name: "导模板",
url: getExportZjUrlMb,
params: null,
},
importConfig: {
url: getImportUrl,
url: getZjImportUrl,
},
});
@ -127,7 +127,6 @@
*/
async function handleEdit(record: Recordable) {
await queryByUserId({ id: record.id }).then(res => {
openDrawer(true, {
record,
isUpdate: true,

@ -19,6 +19,7 @@ enum Api {
deleteBatch = '/sys/user/deleteBatch',
importExcel = '/sys/user/importExcel',
exportXls = '/sys/user/exportXls',
recycleBinList = '/sys/user/recycleBin',
putRecycleBin = '/sys/user/putRecycleBin',
deleteRecycleBin = '/sys/user/deleteRecycleBin',
@ -38,6 +39,13 @@ enum Api {
updateUserTenantStatus='/sys/tenant/updateUserTenantStatus',
getUserTenantPageList='/sys/tenant/getUserTenantPageList',
exportXlsMb = '/sys/user/exportXlsMb',
//导出专家
exportZjXls = '/expert/expert/exportXls',
//导出专家模板
exportZjXlsMb = '/expert/expert/exportXlsMb',
//导入专家
getZjImportUrl = '/expert/expert/importExcel',
queryByUserId = '/expert/expert/queryByUserId',
}
/**
@ -54,6 +62,19 @@ export const queryByUserId = (params) => {
export const getExportUrl = Api.exportXls;
export const getExportUrlMb = Api.exportXlsMb;
/**
*
*/
export const getExportZjUrl = Api.exportZjXls;
/**
*
*/
export const getExportZjUrlMb = Api.exportZjXlsMb;
/**
*
*/
export const getZjImportUrl = Api.getZjImportUrl;
/**
* api
*/

@ -349,7 +349,7 @@ export const formSchema: FormSchema[] = [
component: 'Input',
show: false,
},
{
/*{
label: '比赛名称',
field: 'compName',
component: 'JPopup',
@ -365,7 +365,7 @@ export const formSchema: FormSchema[] = [
multi:true
}
},
},
},*/
{
label: '状态',
field: 'stat',

Loading…
Cancel
Save