diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java index ac96dfb2..5b2b5c14 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java @@ -9,6 +9,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.shiro.SecurityUtils; +import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.subject.Subject; import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; @@ -38,6 +39,8 @@ import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.IAnnu import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.IInstructorSheetService; import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.ITeamManagementService; import org.jeecg.modules.demo.awardpersion.entity.AwardPersion; +import org.jeecg.modules.demo.awardpersion.entity.AwardPersionMb; +import org.jeecg.modules.demo.awardpersion.entity.AwardPersionOptions; import org.jeecg.modules.demo.awardpersion.service.IAwardPersionService; import org.jeecg.modules.demo.comp.entity.Comp; import org.jeecg.modules.demo.comp.service.ICompService; @@ -47,13 +50,12 @@ import org.jeecg.modules.demo.expert.entity.Expert; import org.jeecg.modules.demo.expert.service.IExpertService; import org.jeecg.modules.demo.expscore.entity.ExpScore; import org.jeecg.modules.demo.expscore.service.IExpScoreService; +import org.jeecg.modules.demo.score_management.entity.ScoreManagement; import org.jeecg.modules.demo.scorepersion.entity.ScorePersion; import org.jeecg.modules.demo.scorepersion.service.IScorePersionService; -import org.jeecg.modules.demo.teamseq.entity.TeamSeq; -import org.jeecg.modules.demo.teamseq.service.ITeamSeqService; -import org.jeecg.modules.demo.teamseq.vo.TeamSeqVo; import org.jeecg.modules.demo.upfile_persion.entity.UpfilePersion; import org.jeecg.modules.demo.upfile_persion.service.IUpfilePersionService; +import org.jeecg.modules.system.entity.SysDict; import org.jeecg.modules.system.entity.SysUser; import org.jeecg.modules.system.service.ISysUserService; import org.jeecgframework.poi.excel.ExcelImportUtil; @@ -61,9 +63,7 @@ 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.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.ObjectUtils; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; @@ -74,7 +74,9 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.text.DecimalFormat; +import java.time.LocalDateTime; import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -137,9 +139,6 @@ public class AnnualCompPointController extends JeecgController list = compService.list(queryWrapperComp); - if (list.isEmpty()) { - return Result.error("未绑定比赛"); + if(list.isEmpty()){ + return Result.error("未绑定比赛"); } List ids = list.stream().map(Comp::getId).collect(Collectors.toList()); // 获取负责的年度比赛id QueryWrapper queryWrapperAnnual = new QueryWrapper<>(); /*queryWrapperAnnual.in(ids.size()!=0,"compid",ids);*/ - queryWrapperAnnual.in("compid", ids); + queryWrapperAnnual.in("compid",ids); List listAnnual = annualCompService.list(queryWrapperAnnual); - if (listAnnual.isEmpty()) { - return Result.error("未创建年度比赛"); + if(listAnnual.isEmpty()){ + return Result.error("未创建年度比赛"); } List annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); - queryWrapper.in("annual_comp_id", annualIds); - queryWrapper.eq("annual_comp_switch", "Y"); // 比赛必须是开启的 + queryWrapper.in("annual_comp_id",annualIds); + queryWrapper.eq("annual_comp_switch","Y"); // 比赛必须是开启的 Page page = new Page(pageNo, pageSize); IPage pageList = annualCompPointService.page(page, queryWrapper); - List records = pageList.getRecords(); - Optional.ofNullable(records).orElse(new LinkedList<>()).stream().forEach(point -> { - TeamSeq teamSeq = iTeamSeqService.getOne(new LambdaQueryWrapper().eq(TeamSeq::getPointId, point.getId())); - if (!ObjectUtils.isEmpty(teamSeq)) { - TeamSeqVo teamSeqVo = new TeamSeqVo(); - BeanUtils.copyProperties(teamSeq, teamSeqVo); - BeanUtils.copyProperties(teamSeqVo, point); - } - }); + return Result.OK(pageList); } /** * 教务处 显示所有 - * * @param annualCompPoint * @param pageNo * @param pageSize @@ -208,9 +198,9 @@ public class AnnualCompPointController extends JeecgController> listAdmin(AnnualCompPoint annualCompPoint, - @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, - HttpServletRequest req) { + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); Page page = new Page(pageNo, pageSize); IPage pageList = annualCompPointService.page(page, queryWrapper); @@ -220,7 +210,6 @@ public class AnnualCompPointController extends JeecgController> listdsh(AnnualCompPoint annualCompPoint, - @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, - HttpServletRequest req) { + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); - queryWrapper.eq("annual_comp_state", "1"); + queryWrapper.eq("annual_comp_state","1"); Page page = new Page(pageNo, pageSize); IPage pageList = annualCompPointService.page(page, queryWrapper); @@ -242,7 +231,6 @@ public class AnnualCompPointController extends JeecgController> listysh(AnnualCompPoint annualCompPoint, - @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, - HttpServletRequest req) { + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); - queryWrapper.eq("annual_comp_state", "2"); + queryWrapper.eq("annual_comp_state","2"); Page page = new Page(pageNo, pageSize); IPage pageList = annualCompPointService.page(page, queryWrapper); @@ -264,8 +252,8 @@ public class AnnualCompPointController extends JeecgController> listdbh(AnnualCompPoint annualCompPoint, - @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, - HttpServletRequest req) { + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); - queryWrapper.eq("annual_comp_state", "3"); + queryWrapper.eq("annual_comp_state","3"); Page page = new Page(pageNo, pageSize); IPage pageList = annualCompPointService.page(page, queryWrapper); @@ -288,7 +276,6 @@ public class AnnualCompPointController extends JeecgController> listZJ(AnnualCompPoint annualCompPoint, - @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, - HttpServletRequest req) { + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); // 获取当前登录用户 Subject subject = SecurityUtils.getSubject(); @@ -307,7 +294,8 @@ public class AnnualCompPointController extends JeecgController exqueryWrapper = new QueryWrapper<>(); exqueryWrapper.eq("user_id", loginUser.getId()); Expert expert = expertService.getOne(exqueryWrapper); - if (expert == null) { + if(expert==null) + { return Result.OK(null); } //开始获取exp-comp @@ -315,43 +303,46 @@ public class AnnualCompPointController extends JeecgController compExpList = compExpService.list(coexqueryWrapper); List compIdListss = new ArrayList<>(); - List compList = new ArrayList<>(); - if (compExpList.size() > 0) { + List compList =new ArrayList<>(); + if(compExpList.size()>0) + { for (CompExp compExps : compExpList) { compIdListss.add(compExps.getCompid()); } QueryWrapper coqueryWrapper = new QueryWrapper<>(); - coqueryWrapper.in("id", compIdListss); + coqueryWrapper.in("id",compIdListss); compList = compService.list(coqueryWrapper); } - List annualCompList = new ArrayList<>(); - if (compList.size() > 0) { + List annualCompList=new ArrayList<>(); + if(compList.size()>0) + { List needlist = new ArrayList<>(); - for (Comp comp : compList) { + for (Comp comp : compList){ needlist.add(comp.getId()); } QueryWrapper anncoqueryWrapper = new QueryWrapper<>(); - anncoqueryWrapper.in("compid", needlist); + anncoqueryWrapper.in("compid",needlist); annualCompList = annualCompService.list(anncoqueryWrapper); } List stringList = new ArrayList<>(); - if (annualCompList.size() > 0) { - for (AnnualComp annualComp : annualCompList) { + if(annualCompList.size()>0) + { + for (AnnualComp annualComp : annualCompList){ stringList.add(annualComp.getId()); } - queryWrapper.in("annual_comp_id", stringList); + queryWrapper.in("annual_comp_id",stringList); Page page = new Page(pageNo, pageSize); IPage pageList = annualCompPointService.page(page, queryWrapper); return Result.OK(pageList); - } else { + }else + { return Result.OK(null); } } /** * 学生端列表 - * * @param annualCompPoint * @param pageNo * @param pageSize @@ -360,14 +351,14 @@ public class AnnualCompPointController extends JeecgController> listStudent(AnnualCompPoint annualCompPoint, - @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, - HttpServletRequest req) { + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); // 这里状态是字符串,比较按照ascii值,如果状态数大于9,这里要改 - queryWrapper.ge("annual_comp_state", '5').or().eq("annual_comp_state", '2'); + queryWrapper.ge("annual_comp_state",'5').or().eq("annual_comp_state",'2'); // 比赛项目必须打开 - queryWrapper.eq("annual_comp_switch", "Y"); + queryWrapper.eq("annual_comp_switch","Y"); Page page = new Page(pageNo, pageSize); IPage pageList = annualCompPointService.page(page, queryWrapper); @@ -400,11 +391,9 @@ public class AnnualCompPointController extends JeecgController edit(@RequestBody AnnualCompPoint annualCompPoint) { - boolean isUpdate; - if (annualCompPoint.getAnnualCompState().equals("0") || annualCompPoint.getAnnualCompState().equals("4")) { + boolean isUpdate ; + if(annualCompPoint.getAnnualCompState().equals("0") && annualCompPoint.getAnnualCompState().equals("4") ){ isUpdate = annualCompPointService.updateById(annualCompPoint); - //更新团队赛队员积分计算配置 add by zhc 8.22 - iTeamSeqService.saveOrUpdate4TeamSeq(annualCompPoint); } else { return Result.error("当前状态不可修改"); } @@ -426,10 +415,11 @@ public class AnnualCompPointController extends JeecgController edit1(@RequestBody AnnualCompPoint annualCompPoint) { - boolean isUpdate = annualCompPointService.updateById(annualCompPoint); + boolean isUpdate = annualCompPointService.updateById(annualCompPoint); - if (!isUpdate) { + + if (!isUpdate){ return Result.error("编辑失败!"); } else { return Result.OK("编辑成功!"); @@ -447,16 +437,15 @@ public class AnnualCompPointController extends JeecgController delete(@RequestParam(name = "id", required = true) String id) { - AnnualCompPoint annualCompPoint = annualCompPointService.getById(id); - if (annualCompPoint.getAnnualCompState().equals("0") && annualCompPoint.getAnnualCompState().equals("4")) { + AnnualCompPoint annualCompPoint =annualCompPointService.getById(id); + if(annualCompPoint.getAnnualCompState().equals("0") && annualCompPoint.getAnnualCompState().equals("4") ) { System.out.println(id); annualCompPointService.removeById(id); - } else { + }else { return Result.error("当前状态不可删除"); } return Result.OK("删除成功!"); } - /** * 成绩汇总数据生成 * @@ -467,35 +456,35 @@ public class AnnualCompPointController extends JeecgController cjhz(@RequestParam(name = "id", required = true) String id, HttpServletRequest req) { + public Result cjhz(@RequestParam(name = "id", required = true) String id,HttpServletRequest req) { AnnualCompPoint annualCompPoint = annualCompPointService.getById(id); QueryWrapper queryWrappersc = new QueryWrapper<>(); - queryWrappersc.eq("annual_compid", annualCompPoint.getAnnualCompId()); - queryWrappersc.eq("annual_comp_p", annualCompPoint.getId()); + queryWrappersc.eq("annual_compid",annualCompPoint.getAnnualCompId()); + queryWrappersc.eq("annual_comp_p",annualCompPoint.getId()); List listsc = scorePersionService.list(queryWrappersc); - if (listsc.size() > 0) { - for (int k = 0; k < listsc.size(); k++) { + if(listsc.size()>0){ + for (int k = 0 ; k < listsc.size() ; k++){ scorePersionService.removeById(listsc.get(k).getId()); } } QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.select("bmcode,SUM(score) as score"); - queryWrapper.eq("ann_com_p", id); - queryWrapper.eq("ispf", "1"); + queryWrapper.eq("ann_com_p",id); + queryWrapper.eq("ispf","1"); queryWrapper.groupBy("bmcode"); List list = expScoreService.list(queryWrapper); - for (int i = 0; i < list.size(); i++) { + for (int i = 0 ; i < list.size() ; i++){ AnnComGroTopP annComGroTopP = new AnnComGroTopP(); QueryWrapper queryWrapperagt = QueryGenerator.initQueryWrapper(annComGroTopP, req.getParameterMap()); - queryWrapperagt.eq("bmcode", list.get(i).getBmcode()); + queryWrapperagt.eq("bmcode",list.get(i).getBmcode()); int score = list.get(i).getScore(); int ypzj = annComGroTopPService.list(queryWrapperagt).get(0).getYpzj(); - double df = (double) score / ypzj; + double df = (double)score/ypzj; DecimalFormat decimalFormat = new DecimalFormat("0.00"); String dfstr = decimalFormat.format(df); ScorePersion scorePersion = new ScorePersion(); QueryWrapper queryWrapper1 = new QueryWrapper<>(); - queryWrapper1.eq("bmcode", list.get(i).getBmcode()); + queryWrapper1.eq("bmcode",list.get(i).getBmcode()); List list1 = expScoreService.list(queryWrapper1); scorePersion.setAnnualid(list1.get(0).getAnnid()); scorePersion.setAnnualCompid(list1.get(0).getAnnalComp()); @@ -505,21 +494,21 @@ public class AnnualCompPointController extends JeecgController queryWrappersp = new QueryWrapper<>(); - queryWrappersp.eq("annualid", annualCompService.getById(annualCompPoint.getAnnualCompId()).getAnnualid()); - queryWrappersp.eq("annual_compid", annualCompPoint.getAnnualCompId()); - queryWrappersp.eq("annual_comp_p", id); + queryWrappersp.eq("annualid",annualCompService.getById(annualCompPoint.getAnnualCompId()).getAnnualid()); + queryWrappersp.eq("annual_compid",annualCompPoint.getAnnualCompId()); + queryWrappersp.eq("annual_comp_p",id); queryWrappersp.orderByDesc("score+0"); List listsp = scorePersionService.list(queryWrappersp); - for (int k = 0; k < listsp.size(); k++) { - if (k == 0) { + for (int k = 0 ; k < listsp.size() ;k++){ + if(k==0){ listsp.get(k).setSort(1); scorePersionService.updateById(listsp.get(k)); - } else { - if (listsp.get(k - 1).getScore().equals(listsp.get(k).getScore())) { - listsp.get(k).setSort(listsp.get(k - 1).getSort()); + }else{ + if(listsp.get(k-1).getScore().equals(listsp.get(k).getScore())){ + listsp.get(k).setSort(listsp.get(k-1).getSort()); scorePersionService.updateById(listsp.get(k)); - } else { - listsp.get(k).setSort(k + 1); + }else { + listsp.get(k).setSort(k+1); scorePersionService.updateById(listsp.get(k)); } } @@ -527,12 +516,12 @@ public class AnnualCompPointController extends JeecgController queryWrapperup = new QueryWrapper<>(); - queryWrapperup.eq("apply_code", list.get(b).getBmcode()); + queryWrapperup.eq("apply_code",list.get(b).getBmcode()); List listup = upfilePersionService.list(queryWrapperup); - if (listup.size() > 0) { + if(listup.size()>0){ up = listup.get(0); up.setStatus(1); upfilePersionService.updateById(up); @@ -540,7 +529,6 @@ public class AnnualCompPointController extends JeecgController cjcxhq(@RequestBody ScorePersion scorePersiontem, HttpServletRequest req) { + public Result cjcxhq(@RequestBody ScorePersion scorePersiontem,HttpServletRequest req) { ScorePersion scorePersionsc = new ScorePersion(); QueryWrapper queryWrappersc = QueryGenerator.initQueryWrapper(scorePersionsc, req.getParameterMap()); - queryWrappersc.eq("annualid", scorePersiontem.getAnnualid()); - queryWrappersc.eq("annual_compid", scorePersiontem.getAnnualCompid()); - queryWrappersc.eq("annual_comp_p", scorePersiontem.getAnnualCompP()); + queryWrappersc.eq("annualid",scorePersiontem.getAnnualid()); + queryWrappersc.eq("annual_compid",scorePersiontem.getAnnualCompid()); + queryWrappersc.eq("annual_comp_p",scorePersiontem.getAnnualCompP()); List listsc = scorePersionService.list(queryWrappersc); - if (listsc.size() > 0) { - for (int k = 0; k < listsc.size(); k++) { + if(listsc.size()>0){ + for (int k = 0 ; k < listsc.size() ; k++){ scorePersionService.removeById(listsc.get(k).getId()); } } AnnualCompPoint annualCompPoint = annualCompPointService.getById(scorePersiontem.getAnnualCompP()); QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.select("bmcode,SUM(score) as score"); - queryWrapper.eq("ann_com_p", scorePersiontem.getAnnualCompP()); - queryWrapper.eq("ispf", "1"); + queryWrapper.eq("ann_com_p",scorePersiontem.getAnnualCompP()); + queryWrapper.eq("ispf","1"); queryWrapper.groupBy("bmcode"); List list = expScoreService.list(queryWrapper); - for (int i = 0; i < list.size(); i++) { + for (int i = 0 ; i < list.size() ; i++){ AnnComGroTopP annComGroTopP = new AnnComGroTopP(); QueryWrapper queryWrapperagt = QueryGenerator.initQueryWrapper(annComGroTopP, req.getParameterMap()); - queryWrapperagt.eq("bmcode", list.get(i).getBmcode()); + queryWrapperagt.eq("bmcode",list.get(i).getBmcode()); int score = list.get(i).getScore(); int ypzj = annComGroTopPService.list(queryWrapperagt).get(0).getYpzj(); - double df = (double) score / ypzj; + double df = (double)score/ypzj; DecimalFormat decimalFormat = new DecimalFormat("0.00"); String dfstr = decimalFormat.format(df); ScorePersion scorePersion = new ScorePersion(); QueryWrapper queryWrapper1 = new QueryWrapper<>(); - queryWrapper1.eq("bmcode", list.get(i).getBmcode()); + queryWrapper1.eq("bmcode",list.get(i).getBmcode()); List list1 = expScoreService.list(queryWrapper1); scorePersion.setAnnualid(list1.get(0).getAnnid()); scorePersion.setAnnualCompid(list1.get(0).getAnnalComp()); @@ -590,21 +578,21 @@ public class AnnualCompPointController extends JeecgController queryWrappersp = new QueryWrapper<>(); - queryWrappersp.eq("annualid", annualCompService.getById(annualCompPoint.getAnnualCompId()).getAnnualid()); - queryWrappersp.eq("annual_compid", annualCompPoint.getAnnualCompId()); - queryWrappersp.eq("annual_comp_p", scorePersiontem.getAnnualCompP()); + queryWrappersp.eq("annualid",annualCompService.getById(annualCompPoint.getAnnualCompId()).getAnnualid()); + queryWrappersp.eq("annual_compid",annualCompPoint.getAnnualCompId()); + queryWrappersp.eq("annual_comp_p",scorePersiontem.getAnnualCompP()); queryWrappersp.orderByDesc("score+0"); List listsp = scorePersionService.list(queryWrappersp); - for (int k = 0; k < listsp.size(); k++) { - if (k == 0) { + for (int k = 0 ; k < listsp.size() ;k++){ + if(k==0){ listsp.get(k).setSort(1); scorePersionService.updateById(listsp.get(k)); - } else { - if (listsp.get(k - 1).getScore().equals(listsp.get(k).getScore())) { - listsp.get(k).setSort(listsp.get(k - 1).getSort()); + }else{ + if(listsp.get(k-1).getScore().equals(listsp.get(k).getScore())){ + listsp.get(k).setSort(listsp.get(k-1).getSort()); scorePersionService.updateById(listsp.get(k)); - } else { - listsp.get(k).setSort(k + 1); + }else { + listsp.get(k).setSort(k+1); scorePersionService.updateById(listsp.get(k)); } } @@ -612,12 +600,12 @@ public class AnnualCompPointController extends JeecgController queryWrapperup = new QueryWrapper<>(); - queryWrapperup.eq("apply_code", list.get(b).getBmcode()); + queryWrapperup.eq("apply_code",list.get(b).getBmcode()); List listup = upfilePersionService.list(queryWrapperup); - if (listup.size() > 0) { + if(listup.size()>0){ up = listup.get(0); up.setStatus(1); upfilePersionService.updateById(up); @@ -634,24 +622,24 @@ public class AnnualCompPointController extends JeecgController tffp(@RequestBody ScorePersion scorePersiontem, HttpServletRequest req) { + public Result tffp(@RequestBody ScorePersion scorePersiontem,HttpServletRequest req) { ScorePersion scorePersionsc = new ScorePersion(); QueryWrapper queryWrappersc = QueryGenerator.initQueryWrapper(scorePersionsc, req.getParameterMap()); - queryWrappersc.eq("annualid", scorePersiontem.getAnnualid()); - queryWrappersc.eq("annual_compid", scorePersiontem.getAnnualCompid()); - queryWrappersc.eq("annual_comp_p", scorePersiontem.getAnnualCompP()); - queryWrappersc.inSql("score", "SELECT score FROM score_persion GROUP BY score HAVING COUNT( score ) > 1"); + queryWrappersc.eq("annualid",scorePersiontem.getAnnualid()); + queryWrappersc.eq("annual_compid",scorePersiontem.getAnnualCompid()); + queryWrappersc.eq("annual_comp_p",scorePersiontem.getAnnualCompP()); + queryWrappersc.inSql("score","SELECT score FROM score_persion GROUP BY score HAVING COUNT( score ) > 1"); List listsc = scorePersionService.list(queryWrappersc); - if (listsc.size() > 0) { - for (int i = 0; i < listsc.size(); i++) { + if(listsc.size()>0){ + for (int i = 0 ; i < listsc.size(); i++){ ExpScore expScore = new ExpScore(); QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(expScore, req.getParameterMap()); - queryWrapper.eq("annid", listsc.get(i).getAnnualid()); - queryWrapper.eq("annal_comp", listsc.get(i).getAnnualCompid()); - queryWrapper.eq("ann_com_p", listsc.get(i).getAnnualCompP()); - queryWrapper.eq("bmcode", listsc.get(i).getEnrollCode()); + queryWrapper.eq("annid",listsc.get(i).getAnnualid()); + queryWrapper.eq("annal_comp",listsc.get(i).getAnnualCompid()); + queryWrapper.eq("ann_com_p",listsc.get(i).getAnnualCompP()); + queryWrapper.eq("bmcode",listsc.get(i).getEnrollCode()); List list = expScoreService.list(queryWrapper); ExpScore expScore1 = list.get(0); expScore1.setIspf("0"); @@ -673,154 +661,154 @@ public class AnnualCompPointController extends JeecgController pj(@RequestParam(name = "id", required = true) String id, HttpServletRequest req) { + public Result pj(@RequestParam(name = "id", required = true) String id,HttpServletRequest req) { AnnualCompPoint annualCompPoint = annualCompPointService.getById(id); AnnualCompAward annualCompAward = new AnnualCompAward(); QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompAward, req.getParameterMap()); - queryWrapper.eq("annucompid", id); + queryWrapper.eq("annucompid",id); List list = annualCompAwardService.list(queryWrapper); - if (list.size() == 0) { + if(list.size()==0){ return Result.error("未设置年度比赛奖项!"); } QueryWrapper queryWrapperap = new QueryWrapper<>(); - queryWrapperap.eq("annal_comp", annualCompPoint.getAnnualCompId()); - queryWrapperap.eq("annual_comp_p", annualCompPoint.getId()); + queryWrapperap.eq("annal_comp",annualCompPoint.getAnnualCompId()); + queryWrapperap.eq("annual_comp_p",annualCompPoint.getId()); List listap = awardPersionService.list(queryWrapperap); - if (listap.size() > 0) { - for (int k = 0; k < listap.size(); k++) { + if(listap.size()>0){ + for (int k = 0 ; k < listap.size() ; k++){ awardPersionService.removeById(listap.get(k).getId()); } } QueryWrapper queryWrappersp = new QueryWrapper<>(); - queryWrappersp.eq("annualid", annualCompService.getById(annualCompPoint.getAnnualCompId()).getAnnualid()); - queryWrappersp.eq("annual_compid", annualCompPoint.getAnnualCompId()); - queryWrappersp.eq("annual_comp_p", id); + queryWrappersp.eq("annualid",annualCompService.getById(annualCompPoint.getAnnualCompId()).getAnnualid()); + queryWrappersp.eq("annual_compid",annualCompPoint.getAnnualCompId()); + queryWrappersp.eq("annual_comp_p",id); queryWrappersp.orderByAsc("sort"); List listsp = scorePersionService.list(queryWrappersp); try { - for (int i = 0; i < list.size(); i++) { - if (list.get(i).getIsFirstPrize().equals("Y")) { - String name1 = list.get(i).getFirstPrize(); - String num1 = list.get(i).getFirstNum(); - for (int j = 0; j < Integer.valueOf(num1); j++) { - AwardPersion awardPersion = new AwardPersion(); - awardPersion.setAnnualid(listsp.get(j).getAnnualid()); - awardPersion.setAnnalComp(listsp.get(j).getAnnualCompid()); - awardPersion.setAnnualCompP(listsp.get(j).getAnnualCompP()); - awardPersion.setEnrollCode(listsp.get(j).getEnrollCode()); - awardPersion.setAwardname(name1); - awardPersion.setAwardsort(1); - awardPersion.setAwardid(list.get(i).getId()); - TeamManagement teamManagement = new TeamManagement(); - QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); - queryWrappertm.eq("enroll_code", listsp.get(j).getEnrollCode()); - List listtm = teamManagementService.list(queryWrappertm); - SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); - awardPersion.setStudentname(sysUser.getRealname()); - awardPersion.setStudentcode(sysUser.getWorkNo()); - awardPersionService.save(awardPersion); - } + for (int i = 0 ; i queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); + queryWrappertm.eq("enroll_code",listsp.get(j).getEnrollCode()); + List listtm = teamManagementService.list(queryWrappertm); + SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); + awardPersion.setStudentname(sysUser.getRealname()); + awardPersion.setStudentcode(sysUser.getWorkNo()); + awardPersionService.save(awardPersion); } - if (list.get(i).getIsSecondPrize().equals("Y")) { - String name2 = list.get(i).getSecondPrize(); - String num1 = list.get(i).getFirstNum(); - String num2 = list.get(i).getSecondNum(); - for (int j = Integer.valueOf(num1); j < (Integer.valueOf(num1) + Integer.valueOf(num2)); j++) { - AwardPersion awardPersion = new AwardPersion(); - awardPersion.setAnnualid(listsp.get(j).getAnnualid()); - awardPersion.setAnnalComp(listsp.get(j).getAnnualCompid()); - awardPersion.setAnnualCompP(listsp.get(j).getAnnualCompP()); - awardPersion.setEnrollCode(listsp.get(j).getEnrollCode()); - awardPersion.setAwardname(name2); - awardPersion.setAwardsort(2); - awardPersion.setAwardid(list.get(i).getId()); - TeamManagement teamManagement = new TeamManagement(); - QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); - queryWrappertm.eq("enroll_code", listsp.get(j).getEnrollCode()); - List listtm = teamManagementService.list(queryWrappertm); - SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); - awardPersion.setStudentname(sysUser.getRealname()); - awardPersion.setStudentcode(sysUser.getWorkNo()); - awardPersionService.save(awardPersion); - } + } + if(list.get(i).getIsSecondPrize().equals("Y")){ + String name2 = list.get(i).getSecondPrize(); + String num1 = list.get(i).getFirstNum(); + String num2 = list.get(i).getSecondNum(); + for(int j = Integer.valueOf(num1) ; j < (Integer.valueOf(num1)+Integer.valueOf(num2));j++){ + AwardPersion awardPersion = new AwardPersion(); + awardPersion.setAnnualid(listsp.get(j).getAnnualid()); + awardPersion.setAnnalComp(listsp.get(j).getAnnualCompid()); + awardPersion.setAnnualCompP(listsp.get(j).getAnnualCompP()); + awardPersion.setEnrollCode(listsp.get(j).getEnrollCode()); + awardPersion.setAwardname(name2); + awardPersion.setAwardsort(2); + awardPersion.setAwardid(list.get(i).getId()); + TeamManagement teamManagement = new TeamManagement(); + QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); + queryWrappertm.eq("enroll_code",listsp.get(j).getEnrollCode()); + List listtm = teamManagementService.list(queryWrappertm); + SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); + awardPersion.setStudentname(sysUser.getRealname()); + awardPersion.setStudentcode(sysUser.getWorkNo()); + awardPersionService.save(awardPersion); } - if (list.get(i).getIsThirdPrize().equals("Y")) { - String name3 = list.get(i).getThirdPrize(); - String num3 = list.get(i).getThirdNum(); - String num1 = list.get(i).getFirstNum(); - String num2 = list.get(i).getSecondNum(); - for (int j = (Integer.valueOf(num1) + Integer.valueOf(num2)); j < (Integer.valueOf(num1) + Integer.valueOf(num2) + Integer.valueOf(num3)); j++) { - AwardPersion awardPersion = new AwardPersion(); - awardPersion.setAnnualid(listsp.get(j).getAnnualid()); - awardPersion.setAnnalComp(listsp.get(j).getAnnualCompid()); - awardPersion.setAnnualCompP(listsp.get(j).getAnnualCompP()); - awardPersion.setEnrollCode(listsp.get(j).getEnrollCode()); - awardPersion.setAwardname(name3); - awardPersion.setAwardsort(3); - awardPersion.setAwardid(list.get(i).getId()); - TeamManagement teamManagement = new TeamManagement(); - QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); - queryWrappertm.eq("enroll_code", listsp.get(j).getEnrollCode()); - List listtm = teamManagementService.list(queryWrappertm); - SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); - awardPersion.setStudentname(sysUser.getRealname()); - awardPersion.setStudentcode(sysUser.getWorkNo()); - awardPersionService.save(awardPersion); - } + } + if(list.get(i).getIsThirdPrize().equals("Y")){ + String name3 = list.get(i).getThirdPrize(); + String num3 = list.get(i).getThirdNum(); + String num1 = list.get(i).getFirstNum(); + String num2 = list.get(i).getSecondNum(); + for(int j = (Integer.valueOf(num1)+Integer.valueOf(num2)) ; j < (Integer.valueOf(num1)+Integer.valueOf(num2)+Integer.valueOf(num3));j++){ + AwardPersion awardPersion = new AwardPersion(); + awardPersion.setAnnualid(listsp.get(j).getAnnualid()); + awardPersion.setAnnalComp(listsp.get(j).getAnnualCompid()); + awardPersion.setAnnualCompP(listsp.get(j).getAnnualCompP()); + awardPersion.setEnrollCode(listsp.get(j).getEnrollCode()); + awardPersion.setAwardname(name3); + awardPersion.setAwardsort(3); + awardPersion.setAwardid(list.get(i).getId()); + TeamManagement teamManagement = new TeamManagement(); + QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); + queryWrappertm.eq("enroll_code",listsp.get(j).getEnrollCode()); + List listtm = teamManagementService.list(queryWrappertm); + SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); + awardPersion.setStudentname(sysUser.getRealname()); + awardPersion.setStudentcode(sysUser.getWorkNo()); + awardPersionService.save(awardPersion); } - if (list.get(i).getIsFourthPrize().equals("Y")) { - String name4 = list.get(i).getFourthPrize(); - String num4 = list.get(i).getFourthNum(); - String num3 = list.get(i).getThirdNum(); - String num1 = list.get(i).getFirstNum(); - String num2 = list.get(i).getSecondNum(); - for (int j = (Integer.valueOf(num1) + Integer.valueOf(num2) + Integer.valueOf(num3)); j < (Integer.valueOf(num1) + Integer.valueOf(num2) + Integer.valueOf(num3) + Integer.valueOf(num4)); j++) { - AwardPersion awardPersion = new AwardPersion(); - awardPersion.setAnnualid(listsp.get(j).getAnnualid()); - awardPersion.setAnnalComp(listsp.get(j).getAnnualCompid()); - awardPersion.setAnnualCompP(listsp.get(j).getAnnualCompP()); - awardPersion.setEnrollCode(listsp.get(j).getEnrollCode()); - awardPersion.setAwardname(name4); - awardPersion.setAwardsort(4); - awardPersion.setAwardid(list.get(i).getId()); - TeamManagement teamManagement = new TeamManagement(); - QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); - queryWrappertm.eq("enroll_code", listsp.get(j).getEnrollCode()); - List listtm = teamManagementService.list(queryWrappertm); - SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); - awardPersion.setStudentname(sysUser.getRealname()); - awardPersion.setStudentcode(sysUser.getWorkNo()); - awardPersionService.save(awardPersion); - } + } + if(list.get(i).getIsFourthPrize().equals("Y")){ + String name4 = list.get(i).getFourthPrize(); + String num4 = list.get(i).getFourthNum(); + String num3 = list.get(i).getThirdNum(); + String num1 = list.get(i).getFirstNum(); + String num2 = list.get(i).getSecondNum(); + for(int j = (Integer.valueOf(num1)+Integer.valueOf(num2)+Integer.valueOf(num3)) ; j < (Integer.valueOf(num1)+Integer.valueOf(num2)+Integer.valueOf(num3)+Integer.valueOf(num4));j++){ + AwardPersion awardPersion = new AwardPersion(); + awardPersion.setAnnualid(listsp.get(j).getAnnualid()); + awardPersion.setAnnalComp(listsp.get(j).getAnnualCompid()); + awardPersion.setAnnualCompP(listsp.get(j).getAnnualCompP()); + awardPersion.setEnrollCode(listsp.get(j).getEnrollCode()); + awardPersion.setAwardname(name4); + awardPersion.setAwardsort(4); + awardPersion.setAwardid(list.get(i).getId()); + TeamManagement teamManagement = new TeamManagement(); + QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); + queryWrappertm.eq("enroll_code",listsp.get(j).getEnrollCode()); + List listtm = teamManagementService.list(queryWrappertm); + SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); + awardPersion.setStudentname(sysUser.getRealname()); + awardPersion.setStudentcode(sysUser.getWorkNo()); + awardPersionService.save(awardPersion); } - if (list.get(i).getIsFifthPrize().equals("Y")) { - String name5 = list.get(i).getFifthPrize(); - String num5 = list.get(i).getFifthNum(); - String num4 = list.get(i).getFourthNum(); - String num3 = list.get(i).getThirdNum(); - String num1 = list.get(i).getFirstNum(); - String num2 = list.get(i).getSecondNum(); - for (int j = (Integer.valueOf(num1) + Integer.valueOf(num2) + Integer.valueOf(num3) + Integer.valueOf(num4)); j < (Integer.valueOf(num1) + Integer.valueOf(num2) + Integer.valueOf(num3) + Integer.valueOf(num4) + Integer.valueOf(num5)); j++) { - AwardPersion awardPersion = new AwardPersion(); - awardPersion.setAnnualid(listsp.get(j).getAnnualid()); - awardPersion.setAnnalComp(listsp.get(j).getAnnualCompid()); - awardPersion.setAnnualCompP(listsp.get(j).getAnnualCompP()); - awardPersion.setEnrollCode(listsp.get(j).getEnrollCode()); - awardPersion.setAwardname(name5); - awardPersion.setAwardsort(5); - awardPersion.setAwardid(list.get(i).getId()); - TeamManagement teamManagement = new TeamManagement(); - QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); - queryWrappertm.eq("enroll_code", listsp.get(j).getEnrollCode()); - List listtm = teamManagementService.list(queryWrappertm); - SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); - awardPersion.setStudentname(sysUser.getRealname()); - awardPersion.setStudentcode(sysUser.getWorkNo()); - awardPersionService.save(awardPersion); - } + } + if(list.get(i).getIsFifthPrize().equals("Y")){ + String name5 = list.get(i).getFifthPrize(); + String num5 = list.get(i).getFifthNum(); + String num4 = list.get(i).getFourthNum(); + String num3 = list.get(i).getThirdNum(); + String num1 = list.get(i).getFirstNum(); + String num2 = list.get(i).getSecondNum(); + for(int j = (Integer.valueOf(num1)+Integer.valueOf(num2)+Integer.valueOf(num3)+Integer.valueOf(num4)) ; j < (Integer.valueOf(num1)+Integer.valueOf(num2)+Integer.valueOf(num3)+Integer.valueOf(num4)+Integer.valueOf(num5));j++){ + AwardPersion awardPersion = new AwardPersion(); + awardPersion.setAnnualid(listsp.get(j).getAnnualid()); + awardPersion.setAnnalComp(listsp.get(j).getAnnualCompid()); + awardPersion.setAnnualCompP(listsp.get(j).getAnnualCompP()); + awardPersion.setEnrollCode(listsp.get(j).getEnrollCode()); + awardPersion.setAwardname(name5); + awardPersion.setAwardsort(5); + awardPersion.setAwardid(list.get(i).getId()); + TeamManagement teamManagement = new TeamManagement(); + QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); + queryWrappertm.eq("enroll_code",listsp.get(j).getEnrollCode()); + List listtm = teamManagementService.list(queryWrappertm); + SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); + awardPersion.setStudentname(sysUser.getRealname()); + awardPersion.setStudentcode(sysUser.getWorkNo()); + awardPersionService.save(awardPersion); } } - } catch (Exception e) { + } + }catch (Exception e){ return Result.error("参与评奖人数少于年度比赛奖项设置的数量"); } annualCompPoint.setIsPj(1); @@ -828,7 +816,6 @@ public class AnnualCompPointController extends JeecgController cxhq(@RequestBody AwardPersion awardPersion, HttpServletRequest req) { + public Result cxhq(@RequestBody AwardPersion awardPersion,HttpServletRequest req) { AnnualCompAward annualCompAward = new AnnualCompAward(); QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompAward, req.getParameterMap()); - queryWrapper.eq("annucompid", awardPersion.getAnnualCompP()); + queryWrapper.eq("annucompid",awardPersion.getAnnualCompP()); List list = annualCompAwardService.list(queryWrapper); - if (list.size() == 0) { + if(list.size()==0){ return Result.error("未设置年度比赛奖项!"); } AwardPersion awardPersionqw = new AwardPersion(); QueryWrapper queryWrapperap = QueryGenerator.initQueryWrapper(awardPersionqw, req.getParameterMap()); - queryWrapperap.eq("annualid", awardPersion.getAnnualid()); - queryWrapperap.eq("annal_comp", awardPersion.getAnnalComp()); - queryWrapperap.eq("annual_comp_p", awardPersion.getAnnualCompP()); + queryWrapperap.eq("annualid",awardPersion.getAnnualid()); + queryWrapperap.eq("annal_comp",awardPersion.getAnnalComp()); + queryWrapperap.eq("annual_comp_p",awardPersion.getAnnualCompP()); List listap = awardPersionService.list(queryWrapperap); - if (listap.size() > 0) { - for (int k = 0; k < listap.size(); k++) { + if(listap.size()>0){ + for (int k = 0 ; k < listap.size() ; k++){ awardPersionService.removeById(listap.get(k).getId()); } } AnnualCompPoint annualCompPoint = annualCompPointService.getById(awardPersion.getAnnualCompP()); QueryWrapper queryWrappersp = new QueryWrapper<>(); - queryWrappersp.eq("annualid", annualCompService.getById(annualCompPoint.getAnnualCompId()).getAnnualid()); - queryWrappersp.eq("annual_compid", annualCompPoint.getAnnualCompId()); - queryWrappersp.eq("annual_comp_p", awardPersion.getAnnualCompP()); + queryWrappersp.eq("annualid",annualCompService.getById(annualCompPoint.getAnnualCompId()).getAnnualid()); + queryWrappersp.eq("annual_compid",annualCompPoint.getAnnualCompId()); + queryWrappersp.eq("annual_comp_p",awardPersion.getAnnualCompP()); queryWrappersp.orderByAsc("sort"); List listsp = scorePersionService.list(queryWrappersp); try { - for (int i = 0; i < list.size(); i++) { - if (list.get(i).getIsFirstPrize().equals("Y")) { - String name1 = list.get(i).getFirstPrize(); - String num1 = list.get(i).getFirstNum(); - for (int j = 0; j < Integer.valueOf(num1); j++) { - if (j < listsp.size()) { - AwardPersion awardPersion1 = new AwardPersion(); - awardPersion1.setAnnualid(listsp.get(j).getAnnualid()); - awardPersion1.setAnnalComp(listsp.get(j).getAnnualCompid()); - awardPersion1.setAnnualCompP(listsp.get(j).getAnnualCompP()); - awardPersion1.setEnrollCode(listsp.get(j).getEnrollCode()); - awardPersion1.setAwardname(name1); - awardPersion1.setAwardsort(1); - awardPersion1.setAwardid(list.get(i).getId()); - TeamManagement teamManagement = new TeamManagement(); - QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); - queryWrappertm.eq("enroll_code", listsp.get(j).getEnrollCode()); - List listtm = teamManagementService.list(queryWrappertm); - SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); - awardPersion1.setStudentname(sysUser.getRealname()); - awardPersion1.setStudentcode(sysUser.getWorkNo()); - awardPersionService.save(awardPersion1); - } - + for (int i = 0 ; i queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); + queryWrappertm.eq("enroll_code",listsp.get(j).getEnrollCode()); + List listtm = teamManagementService.list(queryWrappertm); + SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); + awardPersion1.setStudentname(sysUser.getRealname()); + awardPersion1.setStudentcode(sysUser.getWorkNo()); + awardPersionService.save(awardPersion1); } + } - if (list.get(i).getIsSecondPrize().equals("Y")) { - String name2 = list.get(i).getSecondPrize(); - String num1 = list.get(i).getFirstNum(); - String num2 = list.get(i).getSecondNum(); - for (int j = Integer.valueOf(num1); j < (Integer.valueOf(num1) + Integer.valueOf(num2)); j++) { - if (j < listsp.size()) { - AwardPersion awardPersion1 = new AwardPersion(); - awardPersion1.setAnnualid(listsp.get(j).getAnnualid()); - awardPersion1.setAnnalComp(listsp.get(j).getAnnualCompid()); - awardPersion1.setAnnualCompP(listsp.get(j).getAnnualCompP()); - awardPersion1.setEnrollCode(listsp.get(j).getEnrollCode()); - awardPersion1.setAwardname(name2); - awardPersion1.setAwardsort(2); - awardPersion1.setAwardid(list.get(i).getId()); - TeamManagement teamManagement = new TeamManagement(); - QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); - queryWrappertm.eq("enroll_code", listsp.get(j).getEnrollCode()); - List listtm = teamManagementService.list(queryWrappertm); - SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); - awardPersion1.setStudentname(sysUser.getRealname()); - awardPersion1.setStudentcode(sysUser.getWorkNo()); - awardPersionService.save(awardPersion1); - } + } + if(list.get(i).getIsSecondPrize().equals("Y")){ + String name2 = list.get(i).getSecondPrize(); + String num1 = list.get(i).getFirstNum(); + String num2 = list.get(i).getSecondNum(); + for(int j = Integer.valueOf(num1) ; j < (Integer.valueOf(num1)+Integer.valueOf(num2));j++){ + if(j queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); + queryWrappertm.eq("enroll_code", listsp.get(j).getEnrollCode()); + List listtm = teamManagementService.list(queryWrappertm); + SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); + awardPersion1.setStudentname(sysUser.getRealname()); + awardPersion1.setStudentcode(sysUser.getWorkNo()); + awardPersionService.save(awardPersion1); } } - if (list.get(i).getIsThirdPrize().equals("Y")) { - String name3 = list.get(i).getThirdPrize(); - String num3 = list.get(i).getThirdNum(); - String num1 = list.get(i).getFirstNum(); - String num2 = list.get(i).getSecondNum(); - for (int j = (Integer.valueOf(num1) + Integer.valueOf(num2)); j < (Integer.valueOf(num1) + Integer.valueOf(num2) + Integer.valueOf(num3)); j++) { - if (j < listsp.size()) { - AwardPersion awardPersion1 = new AwardPersion(); - awardPersion1.setAnnualid(listsp.get(j).getAnnualid()); - awardPersion1.setAnnalComp(listsp.get(j).getAnnualCompid()); - awardPersion1.setAnnualCompP(listsp.get(j).getAnnualCompP()); - awardPersion1.setEnrollCode(listsp.get(j).getEnrollCode()); - awardPersion1.setAwardname(name3); - awardPersion1.setAwardsort(3); - awardPersion1.setAwardid(list.get(i).getId()); - TeamManagement teamManagement = new TeamManagement(); - QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); - queryWrappertm.eq("enroll_code", listsp.get(j).getEnrollCode()); - List listtm = teamManagementService.list(queryWrappertm); - SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); - awardPersion1.setStudentname(sysUser.getRealname()); - awardPersion1.setStudentcode(sysUser.getWorkNo()); - awardPersionService.save(awardPersion1); - } + } + if(list.get(i).getIsThirdPrize().equals("Y")){ + String name3 = list.get(i).getThirdPrize(); + String num3 = list.get(i).getThirdNum(); + String num1 = list.get(i).getFirstNum(); + String num2 = list.get(i).getSecondNum(); + for(int j = (Integer.valueOf(num1)+Integer.valueOf(num2)) ; j < (Integer.valueOf(num1)+Integer.valueOf(num2)+Integer.valueOf(num3));j++){ + if(j queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); + queryWrappertm.eq("enroll_code", listsp.get(j).getEnrollCode()); + List listtm = teamManagementService.list(queryWrappertm); + SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); + awardPersion1.setStudentname(sysUser.getRealname()); + awardPersion1.setStudentcode(sysUser.getWorkNo()); + awardPersionService.save(awardPersion1); } } - if (list.get(i).getIsFourthPrize().equals("Y")) { - String name4 = list.get(i).getFourthPrize(); - String num4 = list.get(i).getFourthNum(); - String num3 = list.get(i).getThirdNum(); - String num1 = list.get(i).getFirstNum(); - String num2 = list.get(i).getSecondNum(); - for (int j = (Integer.valueOf(num1) + Integer.valueOf(num2) + Integer.valueOf(num3)); j < (Integer.valueOf(num1) + Integer.valueOf(num2) + Integer.valueOf(num3) + Integer.valueOf(num4)); j++) { - if (j < listsp.size()) { - AwardPersion awardPersion1 = new AwardPersion(); - awardPersion1.setAnnualid(listsp.get(j).getAnnualid()); - awardPersion1.setAnnalComp(listsp.get(j).getAnnualCompid()); - awardPersion1.setAnnualCompP(listsp.get(j).getAnnualCompP()); - awardPersion1.setEnrollCode(listsp.get(j).getEnrollCode()); - awardPersion1.setAwardname(name4); - awardPersion1.setAwardsort(4); - awardPersion1.setAwardid(list.get(i).getId()); - TeamManagement teamManagement = new TeamManagement(); - QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); - queryWrappertm.eq("enroll_code", listsp.get(j).getEnrollCode()); - List listtm = teamManagementService.list(queryWrappertm); - SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); - awardPersion1.setStudentname(sysUser.getRealname()); - awardPersion1.setStudentcode(sysUser.getWorkNo()); - awardPersionService.save(awardPersion1); - } + } + if(list.get(i).getIsFourthPrize().equals("Y")){ + String name4 = list.get(i).getFourthPrize(); + String num4 = list.get(i).getFourthNum(); + String num3 = list.get(i).getThirdNum(); + String num1 = list.get(i).getFirstNum(); + String num2 = list.get(i).getSecondNum(); + for(int j = (Integer.valueOf(num1)+Integer.valueOf(num2)+Integer.valueOf(num3)) ; j < (Integer.valueOf(num1)+Integer.valueOf(num2)+Integer.valueOf(num3)+Integer.valueOf(num4));j++){ + if(j queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); + queryWrappertm.eq("enroll_code", listsp.get(j).getEnrollCode()); + List listtm = teamManagementService.list(queryWrappertm); + SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); + awardPersion1.setStudentname(sysUser.getRealname()); + awardPersion1.setStudentcode(sysUser.getWorkNo()); + awardPersionService.save(awardPersion1); } } - if (list.get(i).getIsFifthPrize().equals("Y")) { - String name5 = list.get(i).getFifthPrize(); - String num5 = list.get(i).getFifthNum(); - String num4 = list.get(i).getFourthNum(); - String num3 = list.get(i).getThirdNum(); - String num1 = list.get(i).getFirstNum(); - String num2 = list.get(i).getSecondNum(); - for (int j = (Integer.valueOf(num1) + Integer.valueOf(num2) + Integer.valueOf(num3) + Integer.valueOf(num4)); j < (Integer.valueOf(num1) + Integer.valueOf(num2) + Integer.valueOf(num3) + Integer.valueOf(num4) + Integer.valueOf(num5)); j++) { - if (j < listsp.size()) { - AwardPersion awardPersion1 = new AwardPersion(); - awardPersion1.setAnnualid(listsp.get(j).getAnnualid()); - awardPersion1.setAnnalComp(listsp.get(j).getAnnualCompid()); - awardPersion1.setAnnualCompP(listsp.get(j).getAnnualCompP()); - awardPersion1.setEnrollCode(listsp.get(j).getEnrollCode()); - awardPersion1.setAwardname(name5); - awardPersion1.setAwardsort(5); - awardPersion1.setAwardid(list.get(i).getId()); - TeamManagement teamManagement = new TeamManagement(); - QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); - queryWrappertm.eq("enroll_code", listsp.get(j).getEnrollCode()); - List listtm = teamManagementService.list(queryWrappertm); - SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); - awardPersion1.setStudentname(sysUser.getRealname()); - awardPersion1.setStudentcode(sysUser.getWorkNo()); - awardPersionService.save(awardPersion1); - } + } + if(list.get(i).getIsFifthPrize().equals("Y")){ + String name5 = list.get(i).getFifthPrize(); + String num5 = list.get(i).getFifthNum(); + String num4 = list.get(i).getFourthNum(); + String num3 = list.get(i).getThirdNum(); + String num1 = list.get(i).getFirstNum(); + String num2 = list.get(i).getSecondNum(); + for(int j = (Integer.valueOf(num1)+Integer.valueOf(num2)+Integer.valueOf(num3)+Integer.valueOf(num4)) ; j < (Integer.valueOf(num1)+Integer.valueOf(num2)+Integer.valueOf(num3)+Integer.valueOf(num4)+Integer.valueOf(num5));j++){ + if(j queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); + queryWrappertm.eq("enroll_code", listsp.get(j).getEnrollCode()); + List listtm = teamManagementService.list(queryWrappertm); + SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); + awardPersion1.setStudentname(sysUser.getRealname()); + awardPersion1.setStudentcode(sysUser.getWorkNo()); + awardPersionService.save(awardPersion1); } } } - } catch (Exception e) { - return Result.error("参与评奖人数少于年度比赛奖项设置的数量"); } + }catch (Exception e){ + return Result.error("参与评奖人数少于年度比赛奖项设置的数量"); + } annualCompPoint.setIsPj(1); annualCompPointService.updateById(annualCompPoint); @@ -1045,7 +1032,7 @@ public class AnnualCompPointController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response, @RequestParam(name = "ndbsxmid", required = true) String ndbsxmid) { + public Result importExcel(HttpServletRequest request, HttpServletResponse response,@RequestParam(name = "ndbsxmid", required = true) String ndbsxmid) { //获取年度比赛项目 AnnualCompPoint annualCompPointss = annualCompPointService.getById(ndbsxmid); //获取队伍的人数 - int teamnumber = annualCompPointss.getTeacherNumber(); + int teamnumber =annualCompPointss.getTeacherNumber(); //获取教师熟练 int teachernumber = annualCompPointss.getTeacherNumber(); MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; @@ -1102,7 +1090,7 @@ public class AnnualCompPointController extends JeecgController list = ExcelImportUtil.importExcel(file.getInputStream(), AnnualCompPointMb.class, params); for (int i = 0; i < list.size(); i++) { QueryWrapper qw = new QueryWrapper<>(); @@ -1114,7 +1102,7 @@ public class AnnualCompPointController extends JeecgController teachernumber) { + if(itemsArray.length>teachernumber){ return Result.error("文件导入失败:第" + (i + 1) + "老师个数信息有误"); } } @@ -1163,14 +1151,14 @@ public class AnnualCompPointController extends JeecgController teacherZysList = Arrays.asList(teacherZys); List teacherYjfxlist = Arrays.asList(teacherYjfxs); List teacherPhonelist = Arrays.asList(teacherPhone); - for (int c = 0; c < teachernumber; c++) { + for (int c =0;c list = ExcelImportUtil.importExcel(file.getInputStream(), AnnualCompPointMb.class, params); for (int i = 0; i < list.size(); i++) { QueryWrapper qw = new QueryWrapper<>(); @@ -1200,7 +1188,7 @@ public class AnnualCompPointController extends JeecgController teachernumber) { + if(itemsArray.length>teachernumber){ return Result.error("文件导入失败:第" + (i + 1) + "老师个数信息有误"); } } @@ -1220,18 +1208,18 @@ public class AnnualCompPointController extends JeecgController teamnamelist = Arrays.asList(teaname); + List teamnamelist =Arrays.asList(teaname); //将学生的学号放入list String[] teamworkno = list.get(k).getStudentcode().split("%"); - List teamworknolist = Arrays.asList(teamworkno); - for (int a = 0; a < teamnumber; a++) { + List teamworknolist =Arrays.asList(teamworkno); + for(int a =0;a qw1 = new QueryWrapper<>(); - qw1.eq("work_no", teamworknolist.get(a)); + qw1.eq("work_no",teamworknolist.get(a)); List listsys1 = sysUserService.list(qw1); tm.setUserId(listsys1.get(a).getId()); - if (a == 0) { + if (a==0) { tm.setCaptain("1"); } teamManagementService.save(tm); @@ -1259,14 +1247,14 @@ public class AnnualCompPointController extends JeecgController teacherZysList = Arrays.asList(teacherZys); List teacherYjfxlist = Arrays.asList(teacherYjfxs); List teacherPhonelist = Arrays.asList(teacherPhone); - for (int c = 0; c < teachernumber; c++) { + for (int c =0;c= 0) { + if(msg!=null && msg.indexOf("Duplicate entry")>=0){ return Result.error("文件导入失败:有重复数据!"); - } else { + }else{ return Result.error("文件导入失败:" + e.getMessage()); } } finally { @@ -1307,14 +1295,12 @@ public class AnnualCompPointController extends JeecgController list = annualCompetitionProjectRegistrationService.query().eq("enroll_code", enrollCode).list(); if (list == null || list.size() == 0) @@ -1352,34 +1338,34 @@ public class AnnualCompPointController extends JeecgController tongfenfuping(@RequestParam(name = "id", required = true) String id) { - String iscf = annualCompPointService.tongfenfupingiscf(id); - if (iscf.equals("0")) { - return Result.error("没有发现同分现象"); - } else { - AnnualCompPoint annualCompPoint = annualCompPointService.getById(id); - AnnualComp annualComp = annualCompService.getById(annualCompPoint.getAnnualCompId()); - TongfenComp tongfenComp = new TongfenComp(); - tongfenComp.setComp(annualComp.getCompid()); - tongfenComp.setAnnualid(annualComp.getAnnualid()); - tongfenComp.setComppoint(id); - tongfenCompService.save(tongfenComp); - //获取重复的成绩 - List scorePersionList = tongfenCompinfoService.getscorePersionList(id); - for (int i = 0; i < scorePersionList.size(); i++) { - TongfenCompinfo tongfenCompinfo = new TongfenCompinfo(); - tongfenCompinfo.setScore(scorePersionList.get(i).getScore()); - tongfenCompinfo.setAnncomppid(id); - if (scorePersionList.get(i).getEnrollCode().substring(5, 7).equals("GR")) { - tongfenCompinfo.setIstd("个人"); - } else { - tongfenCompinfo.setIstd("团队"); - } - tongfenCompinfo.setCcode(scorePersionList.get(i).getEnrollCode()); - tongfenCompinfo.setZpfile(tongfenCompinfoService.geturl(scorePersionList.get(i).getEnrollCode())); - tongfenCompinfoService.save(tongfenCompinfo); - } - return Result.OK("已经完成数据统计"); - } + String iscf = annualCompPointService.tongfenfupingiscf(id); + if (iscf.equals("0")){ + return Result.error("没有发现同分现象"); + }else{ + AnnualCompPoint annualCompPoint = annualCompPointService.getById(id); + AnnualComp annualComp = annualCompService.getById(annualCompPoint.getAnnualCompId()); + TongfenComp tongfenComp = new TongfenComp(); + tongfenComp.setComp(annualComp.getCompid()); + tongfenComp.setAnnualid(annualComp.getAnnualid()); + tongfenComp.setComppoint(id); + tongfenCompService.save(tongfenComp); + //获取重复的成绩 + List scorePersionList =tongfenCompinfoService.getscorePersionList(id); + for (int i = 0; i < scorePersionList.size(); i++) { + TongfenCompinfo tongfenCompinfo= new TongfenCompinfo(); + tongfenCompinfo.setScore(scorePersionList.get(i).getScore()); + tongfenCompinfo.setAnncomppid(id); + if (scorePersionList.get(i).getEnrollCode().substring(5, 7).equals("GR")){ + tongfenCompinfo.setIstd("个人"); + }else { + tongfenCompinfo.setIstd("团队"); + } + tongfenCompinfo.setCcode(scorePersionList.get(i).getEnrollCode()); + tongfenCompinfo.setZpfile(tongfenCompinfoService.geturl(scorePersionList.get(i).getEnrollCode())); + tongfenCompinfoService.save(tongfenCompinfo); + } + return Result.OK("已经完成数据统计"); + } } @@ -1390,149 +1376,149 @@ public class AnnualCompPointController extends JeecgController zjsybsjs(HttpServletRequest req, @RequestParam(name = "recreateFlag") boolean recreateFlag) { + public Result zjsybsjs( HttpServletRequest req,@RequestParam(name = "recreateFlag") boolean recreateFlag) { final String ZJSYBSJS = "zjsybsjs"; Map map = new HashMap<>(); if (recreateFlag) { - //获取当前登录用户 - LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - - QueryWrapper exqueryWrapper = new QueryWrapper<>(); - exqueryWrapper.eq("user_id", user.getId()); - Expert expert = expertService.getOne(exqueryWrapper); - if (expert != null) { - QueryWrapper coexqueryWrapper = new QueryWrapper<>(); - coexqueryWrapper.eq("expid", expert.getId()); - List compExpList = compExpService.list(coexqueryWrapper); - if (compExpList.size() > 0) { - List compids = compExpList.stream().map(CompExp::getCompid).collect(Collectors.toList()); - QueryWrapper anncoqueryWrapper = new QueryWrapper<>(); - anncoqueryWrapper.in("compid", compids); - List annualCompList = annualCompService.list(anncoqueryWrapper); - List> jxzListMap = new ArrayList<>(); - List> lsListMap = new ArrayList<>(); - if (annualCompList.size() > 0) { - List ndbsids = annualCompList.stream().map(AnnualComp::getId).collect(Collectors.toList()); - //进行中年度比赛项目 - AnnualCompPoint annualCompPoint = new AnnualCompPoint(); - QueryWrapper queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); - queryWrapperacp.in("annual_comp_id", ndbsids); - queryWrapperacp.le("starttime", new Date()); - queryWrapperacp.ge("endtime", new Date()); - List listacp = annualCompPointService.list(queryWrapperacp); - map.put("jxzndbsxmNumber", listacp.size()); - if (listacp.size() > 6) { - for (int p = 0; p < 6; p++) { - Map mapall1 = new HashMap<>(); - mapall1.put("xh", p + 1); - mapall1.put("ndbs", annualCompService.getById(listacp.get(p).getAnnualCompId()).getName()); - mapall1.put("ndbsxm", listacp.get(p).getObjName()); - jxzListMap.add(mapall1); - } - } else { - for (int o = 0; o < listacp.size(); o++) { - Map mapall2 = new HashMap<>(); - mapall2.put("xh", o + 1); - mapall2.put("ndbs", annualCompService.getById(listacp.get(o).getAnnualCompId()).getName()); - mapall2.put("ndbsxm", listacp.get(o).getObjName()); - jxzListMap.add(mapall2); - } + //获取当前登录用户 + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + + QueryWrapper exqueryWrapper = new QueryWrapper<>(); + exqueryWrapper.eq("user_id", user.getId()); + Expert expert = expertService.getOne(exqueryWrapper); + if(expert!=null){ + QueryWrapper coexqueryWrapper = new QueryWrapper<>(); + coexqueryWrapper.eq("expid", expert.getId()); + List compExpList = compExpService.list(coexqueryWrapper); + if(compExpList.size()>0){ + List compids = compExpList.stream().map(CompExp::getCompid).collect(Collectors.toList()); + QueryWrapper anncoqueryWrapper = new QueryWrapper<>(); + anncoqueryWrapper.in("compid",compids); + List annualCompList = annualCompService.list(anncoqueryWrapper); + List> jxzListMap = new ArrayList<>(); + List> lsListMap = new ArrayList<>(); + if(annualCompList.size()>0){ + List ndbsids = annualCompList.stream().map(AnnualComp::getId).collect(Collectors.toList()); + //进行中年度比赛项目 + AnnualCompPoint annualCompPoint = new AnnualCompPoint(); + QueryWrapper queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); + queryWrapperacp.in("annual_comp_id",ndbsids); + queryWrapperacp.le("starttime",new Date()); + queryWrapperacp.ge("endtime",new Date()); + List listacp = annualCompPointService.list(queryWrapperacp); + map.put("jxzndbsxmNumber",listacp.size()); + if(listacp.size()>6){ + for (int p = 0 ; p < 6 ; p++){ + Map mapall1 = new HashMap<>(); + mapall1.put("xh",p+1); + mapall1.put("ndbs",annualCompService.getById(listacp.get(p).getAnnualCompId()).getName()); + mapall1.put("ndbsxm",listacp.get(p).getObjName()); + jxzListMap.add(mapall1); } - map.put("jxzndbsxmList", jxzListMap); - - //历史年度比赛项目 - QueryWrapper queryWrapperacpls = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); - queryWrapperacpls.in("annual_comp_id", ndbsids); - queryWrapperacpls.lt("endtime", new Date()); - List listacpls = annualCompPointService.list(queryWrapperacpls); - map.put("lsndbsxmNumber", listacpls.size()); - if (listacpls.size() > 6) { - for (int q = 0; q < 6; q++) { - Map mapall3 = new HashMap<>(); - mapall3.put("xh", q + 1); - mapall3.put("ndbs", annualCompService.getById(listacpls.get(q).getAnnualCompId()).getName()); - mapall3.put("ndbsxm", listacpls.get(q).getObjName()); - lsListMap.add(mapall3); - } - } else { - for (int w = 0; w < listacpls.size(); w++) { - Map mapall4 = new HashMap<>(); - mapall4.put("xh", w + 1); - mapall4.put("ndbs", annualCompService.getById(listacpls.get(w).getAnnualCompId()).getName()); - mapall4.put("ndbsxm", listacpls.get(w).getObjName()); - lsListMap.add(mapall4); - } + }else{ + for (int o = 0 ; o < listacp.size() ; o++){ + Map mapall2 = new HashMap<>(); + mapall2.put("xh",o+1); + mapall2.put("ndbs",annualCompService.getById(listacp.get(o).getAnnualCompId()).getName()); + mapall2.put("ndbsxm",listacp.get(o).getObjName()); + jxzListMap.add(mapall2); } - map.put("lsndbsxmList", lsListMap); - //进行中 国 省 市 校 - int gjj = 0; - int shengj = 0; - int shij = 0; - int xj = 0; - for (int i = 0; i < listacp.size(); i++) { - if (listacp.get(i).getObjLevel().equals("1809121223401168898")) { - //国家 - gjj = gjj + 1; - } - if (listacp.get(i).getObjLevel().equals("1809121301201313793")) { - //省 - shengj = shengj + 1; - } - if (listacp.get(i).getObjLevel().equals("1809121356582903809")) { - //市 - shij = shij + 1; - } - if (listacp.get(i).getObjLevel().equals("1809121454654119937")) { - //校 - xj = xj + 1; - } + } + map.put("jxzndbsxmList",jxzListMap); + + //历史年度比赛项目 + QueryWrapper queryWrapperacpls = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); + queryWrapperacpls.in("annual_comp_id",ndbsids); + queryWrapperacpls.lt("endtime",new Date()); + List listacpls = annualCompPointService.list(queryWrapperacpls); + map.put("lsndbsxmNumber",listacpls.size()); + if(listacpls.size()>6){ + for (int q = 0 ; q < 6 ; q++){ + Map mapall3 = new HashMap<>(); + mapall3.put("xh",q+1); + mapall3.put("ndbs",annualCompService.getById(listacpls.get(q).getAnnualCompId()).getName()); + mapall3.put("ndbsxm",listacpls.get(q).getObjName()); + lsListMap.add(mapall3); } - map.put("gjj", gjj); - map.put("shengj", shengj); - map.put("shij", shij); - map.put("xj", xj); - //历史 国 省 市 校 - int gjjls = 0; - int shengjls = 0; - int shijls = 0; - int xjls = 0; - for (int k = 0; k < listacpls.size(); k++) { - if (listacpls.get(k).getObjLevel().equals("1809121223401168898")) { - //国家 - gjjls = gjjls + 1; - } - if (listacpls.get(k).getObjLevel().equals("1809121301201313793")) { - //省 - shengjls = shengjls + 1; - } - if (listacpls.get(k).getObjLevel().equals("1809121356582903809")) { - //市 - shijls = shijls + 1; - } - if (listacpls.get(k).getObjLevel().equals("1809121454654119937")) { - //校 - xjls = xjls + 1; - } + }else{ + for (int w = 0 ; w < listacpls.size() ; w++){ + Map mapall4 = new HashMap<>(); + mapall4.put("xh",w+1); + mapall4.put("ndbs",annualCompService.getById(listacpls.get(w).getAnnualCompId()).getName()); + mapall4.put("ndbsxm",listacpls.get(w).getObjName()); + lsListMap.add(mapall4); } - map.put("gjjls", gjjls); - map.put("shengjls", shengjls); - map.put("shijls", shijls); - map.put("xjls", xjls); - } - } + map.put("lsndbsxmList",lsListMap); + //进行中 国 省 市 校 + int gjj = 0; + int shengj = 0; + int shij = 0; + int xj = 0; + for (int i = 0 ; i < listacp.size() ; i++){ + if(listacp.get(i).getObjLevel().equals("1809121223401168898")){ + //国家 + gjj = gjj+1; + } + if(listacp.get(i).getObjLevel().equals("1809121301201313793")){ + //省 + shengj = shengj+1; + } + if(listacp.get(i).getObjLevel().equals("1809121356582903809")){ + //市 + shij = shij+1; + } + if(listacp.get(i).getObjLevel().equals("1809121454654119937")){ + //校 + xj = xj+1; + } + } + map.put("gjj",gjj); + map.put("shengj",shengj); + map.put("shij",shij); + map.put("xj",xj); + //历史 国 省 市 校 + int gjjls = 0; + int shengjls = 0; + int shijls = 0; + int xjls = 0; + for (int k = 0 ; k < listacpls.size() ; k++){ + if(listacpls.get(k).getObjLevel().equals("1809121223401168898")){ + //国家 + gjjls = gjjls+1; + } + if(listacpls.get(k).getObjLevel().equals("1809121301201313793")){ + //省 + shengjls = shengjls+1; + } + if(listacpls.get(k).getObjLevel().equals("1809121356582903809")){ + //市 + shijls = shijls+1; + } + if(listacpls.get(k).getObjLevel().equals("1809121454654119937")){ + //校 + xjls = xjls+1; + } + } + map.put("gjjls",gjjls); + map.put("shengjls",shengjls); + map.put("shijls",shijls); + map.put("xjls",xjls); + } } + + } redisUtil.set(ZJSYBSJS, map); - return Result.OK(map); - } else { + return Result.OK(map); + }else { boolean hasKey = redisUtil.hasKey(ZJSYBSJS); if (hasKey) { return Result.OK(redisUtil.get(ZJSYBSJS)); } else { - return this.zjsybsjs(req, true); + return this.zjsybsjs(req,true); } } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/entity/AnnualCompPoint.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/entity/AnnualCompPoint.java index 3eafb0d9..bbfeafa3 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/entity/AnnualCompPoint.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/entity/AnnualCompPoint.java @@ -273,68 +273,20 @@ public class AnnualCompPoint implements Serializable { /** - * 第1序号 + * 位次号 */ - @ApiModelProperty(value = "第1序号") @TableField(exist = false) - private Integer teamSeqFirst; - /** - * 第1序号比值 - */ - @TableField(exist = false) - @ApiModelProperty(value = "第1序号比值") - private Integer teamSeqFirstVal; - - /** - * 第2序号 - */ - @TableField(exist = false) - @ApiModelProperty(value = "第1序号") - private Integer teamSeqSecond; - /** - * 第2序号比值 - */ - @ApiModelProperty(value = "第2序号比值") - @TableField(exist = false) - private Integer teamSeqSecondVal; - - /** - * 第3序号 - */ - @ApiModelProperty(value = "第3序号") - @TableField(exist = false) - private Integer teamSeqThird; - /** - * 第3序号比值 - */ - @ApiModelProperty(value = "第3序号比值") - @TableField(exist = false) - private Integer teamSeqThirdVal; + @Excel(name = "队员在队伍中的位次序号", width = 15) + @ApiModelProperty(value = "队员在队伍中的位次序号") + private Integer teamSeq; /** - * 第4序号 - */ - @ApiModelProperty(value = "第4序号") - @TableField(exist = false) - private Integer teamSeqFourth; - /** - * 第4序号比值 + * 位次号比值 */ - @ApiModelProperty(value = "第4序号比值") @TableField(exist = false) - private Integer teamSeqFourthVal; - /** - * 第5序号 - */ - @ApiModelProperty(value = "第5序号") - @TableField(exist = false) - private Integer teamSeqFifth; - /** - * 第5序号比值 - */ - @ApiModelProperty(value = "第5序号比值") - @TableField(exist = false) - private Integer teamSeqFifthVal; + @Excel(name = "队员在队伍中的位次序号比值", width = 15) + @ApiModelProperty(value = "队员在队伍中的位次序号比值") + private Integer teamSeqVal; } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/service/impl/AnnualCompPointServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/service/impl/AnnualCompPointServiceImpl.java index affc820f..45636d9b 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/service/impl/AnnualCompPointServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/service/impl/AnnualCompPointServiceImpl.java @@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint; @@ -14,15 +13,15 @@ import org.jeecg.modules.demo.annualcomp.entity.AnnualComp; import org.jeecg.modules.demo.annualcomp.service.impl.AnnualCompServiceImpl; import org.jeecg.modules.demo.annualcompaward.entity.AnnualCompAward; import org.jeecg.modules.demo.annualcompaward.mapper.AnnualCompAwardMapper; +import org.jeecg.modules.demo.objLevel.entity.ObjLevel; import org.jeecg.modules.demo.objLevel.service.impl.ObjLevelServiceImpl; import org.jeecg.modules.demo.projectlevel.entity.Projectlevel; import org.jeecg.modules.demo.projectlevel.service.IProjectlevelService; -import org.jeecg.modules.demo.teamseq.entity.TeamSeq; -import org.jeecg.modules.demo.teamseq.service.ITeamSeqService; -import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + import javax.servlet.http.HttpServletRequest; import java.time.LocalDate; import java.util.List; @@ -55,9 +54,6 @@ public class AnnualCompPointServiceImpl extends ServiceImpl> pageList(AnnualCompPoint annualCompPoint, Integer pageNo, Integer pageSize, HttpServletRequest req) { List levelList = projectlevelService.list(); diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/impl/PersonalCompScoreServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/impl/PersonalCompScoreServiceImpl.java index 703d7326..16c7f1cf 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/impl/PersonalCompScoreServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/impl/PersonalCompScoreServiceImpl.java @@ -39,6 +39,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Optional; import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; /** * @Description: 个人比赛积分 @@ -174,7 +175,8 @@ public class PersonalCompScoreServiceImpl extends ServiceImpl seqList = iTeamSeqService.list(new LambdaQueryWrapper().eq(TeamSeq::getPointId, annualCompPoint.getId())); + score.set(ComputeUtils.mul2(baseScore, this.covertVal(seqList, e))); PersonalCompScore bean = new PersonalCompScore(); bean.setAnnualCompId(annualCompId); bean.setAnnualCompP(annualCompPoint.getId()); @@ -228,27 +230,11 @@ public class PersonalCompScoreServiceImpl extends ServiceImpl teamSeq, TeamManagement en) { Integer weightVal = 100; - if (!ObjectUtils.isEmpty(teamSeq)) { - switch (en.getTeamSeq()) { - case 1: - weightVal = teamSeq.getTeamSeqFifthVal(); - break; - case 2: - weightVal = teamSeq.getTeamSeqSecondVal(); - break; - case 3: - weightVal = teamSeq.getTeamSeqThirdVal(); - break; - case 4: - weightVal = teamSeq.getTeamSeqFourthVal(); - break; - case 5: - weightVal = teamSeq.getTeamSeqFifthVal(); - break; - } + if (!ObjectUtils.isEmpty(teamSeq) && !ObjectUtils.isEmpty(en.getTeamSeq())) { + List seqSet = teamSeq.stream().filter(b -> b.getTeamSeq() == en.getTeamSeq()).collect(Collectors.toList()); + weightVal = seqSet.get(0).getTeamSeqVal(); } double val = ComputeUtils.div2(new Double(weightVal), ONE_HUNDRED); return val; diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/controller/AnnualCompGroupController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/controller/AnnualCompGroupController.java index 4f72232e..edbb7b0b 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/controller/AnnualCompGroupController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/controller/AnnualCompGroupController.java @@ -15,6 +15,10 @@ import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.demo.anncomgrotop.entity.AnnComGroTop; +import org.jeecg.modules.demo.anncomgrotop.service.IAnnComGroTopService; +import org.jeecg.modules.demo.anncomgrotopp.entity.AnnComGroTopP; +import org.jeecg.modules.demo.anncomgrotopp.service.IAnnComGroTopPService; import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint; import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService; import org.jeecg.modules.demo.annualcomp.entity.AnnualComp; @@ -28,10 +32,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; import org.jeecg.modules.demo.awardpersion.entity.AwardPersion; +import org.jeecg.modules.demo.chooseTopicPersion.entity.ChaoseTopicPersion; +import org.jeecg.modules.demo.chooseTopicPersion.service.IChaoseTopicPersionService; import org.jeecg.modules.demo.comp.entity.Comp; import org.jeecg.modules.demo.comp.service.ICompService; import org.jeecg.modules.demo.scoresta.entity.ScoreSta; import org.jeecg.modules.demo.scoresta.service.IScoreStaService; +import org.jeecg.modules.demo.upfile_persion.entity.UpfilePersion; +import org.jeecg.modules.demo.upfile_persion.service.IUpfilePersionService; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.entity.ExportParams; @@ -75,6 +83,18 @@ public class AnnualCompGroupController extends JeecgController zdfpzp(AnnualCompGroup annualCompGroup, HttpServletRequest req) { + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + QueryWrapper queryWrappercomp = new QueryWrapper<>(); + queryWrappercomp.eq("comp_admin", user.getUsername()); + List list = compService.list(queryWrappercomp); + if (list.size() == 0) { + return Result.error("分配失败,该用户无负责比赛"); + } + List ids = list.stream().map(Comp::getId).collect(Collectors.toList()); + QueryWrapper queryWrapperAnnual = new QueryWrapper<>(); + queryWrapperAnnual.in("compid", ids); + List listAnnual = annualCompService.list(queryWrapperAnnual); + if (listAnnual.size() == 0) { + return Result.error("分配失败,该用户无负责年度比赛"); + } + List annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompGroup, req.getParameterMap()); + queryWrapper.in(annualIds.size() != 0, "annal_comp", annualIds); + + + QueryWrapper queryWrapperacp = new QueryWrapper<>(); + queryWrapperacp.in("annual_comp_id", annualIds); + queryWrapperacp.eq("annual_comp_switch", "Y"); // 比赛必须是开启的 + List listacp = annualCompPointService.list(queryWrapperacp); + if (listacp.size() == 0) { + return Result.error("分配失败,该用户无负责年度比赛项目"); + } + List acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); + queryWrapper.in(acpIds.size() != 0, "ann_comp_p", acpIds); + + List pageList = annualCompGroupService.list(queryWrapper); + if (pageList.size() == 0) { + return Result.error("分配失败,无可分配的专家组"); + } + List annualids = pageList.stream().map(AnnualCompGroup::getAnnal).collect(Collectors.toList()); + List annualcpids = pageList.stream().map(AnnualCompGroup::getAnnCompP).collect(Collectors.toList()); + QueryWrapper queryWrapperup = new QueryWrapper<>(); + queryWrapperup.in("annual_id", annualids); + queryWrapperup.in("annual_comp_point_id", annualcpids); + queryWrapperup.eq("status", "0"); + + QueryWrapper queryWrapperagt = new QueryWrapper<>(); + //queryWrapperagt.eq("ann_com_gro_topid",xmtmid); + queryWrapperagt.in("annid", annualids); + queryWrapperagt.in("ann_com_p", annualcpids); + List listact = annComGroTopPService.list(queryWrapperagt); + String str = ""; + for (int i = 0; i < listact.size(); i++) { + str = str + listact.get(i).getBmcode() + ","; + } + if (str != "") { + queryWrapperup.notIn("apply_code", str.split(",")); + } + List listup = upfilePersionService.list(queryWrapperup); + //作品的年度比赛项目必须和组的年度比赛项目相同才可以分配作品 + for (int o = 0; o < listup.size(); o++) { + QueryWrapper queryWrapperctp1 = new QueryWrapper<>(); + queryWrapperctp1.eq("bmcode", listup.get(o).getApplyCode()); + List listctp1 = chaoseTopicPersionService.list(queryWrapperctp1); + if (listctp1.size() == 0) { + return Result.error(listup.get(o).getTopicName() + "未选题,绑定失败!"); + } + } + //List acgids = pageList.stream().map(AnnualCompGroup::getId).collect(Collectors.toList()); + int upsum = listup.size(); + int acgsum = pageList.size(); + int pjz = upsum / acgsum; + int syz = upsum % acgsum; + + for (int y = 0; y < pageList.size(); y++) { + QueryWrapper queryWrapperatp = new QueryWrapper<>(); + queryWrapperatp.eq("ann_com_p_g", pageList.get(y).getId()); + List listtop = annComGroTopService.list(queryWrapperatp); + int upnum = 0; + for (int i = 0; i < listup.size(); i++) { + if(upnum==pjz&&pjz!=0&&listup.size()>syz){ + break; + } + for (int k = 0; k < listtop.size(); k++) { + QueryWrapper queryWrapperctp = new QueryWrapper<>(); + queryWrapperctp.eq("bmcode", listup.get(i).getApplyCode()); + List listctp = chaoseTopicPersionService.list(queryWrapperctp); + if (listtop.get(k).getTopid().equals(listctp.get(0).getTimul())) { + AnnComGroTopP annComGroTopP = new AnnComGroTopP(); + annComGroTopP.setAnnComGroTopid(listtop.get(k).getId()); + annComGroTopP.setBmcode(listup.get(i).getApplyCode()); + annComGroTopP.setAnnid(listtop.get(k).getAnnid()); + annComGroTopP.setAnnComP(listtop.get(k).getAnnComP()); + annComGroTopP.setAnnComPG(listtop.get(k).getAnnComPG()); + annComGroTopP.setTopicName(listup.get(i).getTopicName()); + annComGroTopP.setTopid(listtop.get(k).getTopid()); + annComGroTopPService.save(annComGroTopP); + listup.remove(i); + upnum++; + i=-1; + break; + } + } + } + } + return Result.OK("自动分配作品成功"); + } + } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/seteacher/controller/SeteacherController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/seteacher/controller/SeteacherController.java new file mode 100644 index 00000000..78c5df61 --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/seteacher/controller/SeteacherController.java @@ -0,0 +1,351 @@ +package org.jeecg.modules.demo.seteacher.controller; + +import java.util.*; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.alibaba.fastjson.JSONObject; +import org.apache.shiro.SecurityUtils; +import org.jeecg.common.api.vo.Result; +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.PasswordUtil; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.base.service.BaseCommonService; +import org.jeecg.modules.demo.compexp.entity.CompExp; +import org.jeecg.modules.demo.expert.entity.Expert; +import org.jeecg.modules.demo.seteacher.entity.Seteacher; +import org.jeecg.modules.demo.seteacher.service.ISeteacherService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecg.modules.system.entity.*; +import org.jeecg.modules.system.service.ISysDictService; +import org.jeecg.modules.system.service.ISysRoleService; +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.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.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; + + /** + * @Description: seteacher + * @Author: jeecg-boot + * @Date: 2024-08-23 + * @Version: V1.0 + */ +@Api(tags="seteacher") +@RestController +@RequestMapping("/seteacher/seteacher") +@Slf4j +public class SeteacherController extends JeecgController { + @Autowired + private ISeteacherService seteacherService; + @Autowired + private BaseCommonService baseCommonService; + @Autowired + private ISysUserService sysUserService; + @Autowired + private ISysUserRoleService sysUserRoleService; + @Autowired + private ISysRoleService sysRoleService; + @Autowired + private ISysDictService sysDictService; + + /** + * 分页列表查询 + * + * @param seteacher + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "seteacher-分页列表查询") + @ApiOperation(value="seteacher-分页列表查询", notes="seteacher-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(Seteacher seteacher, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(seteacher, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = seteacherService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加教师信息 + * + * @param seteacher + * @return + */ + @AutoLog(value = "seteacher-添加") + @ApiOperation(value="seteacher-添加", notes="seteacher-添加") + @RequiresPermissions("seteacher:seteacher:add") + @PostMapping(value = "/add") + public Result add(@RequestBody Seteacher seteacher) { + seteacherService.save(seteacher); + return Result.OK("添加成功!"); + } + + @RequestMapping(value = "/addTEA", method = RequestMethod.POST) + public Result addZJ(@RequestBody JSONObject jsonObject) { + LoginUser userss= (LoginUser) SecurityUtils.getSubject().getPrincipal(); + //设置部门 + String selectedDeparts =""; + //根据user查找角色 + String roles = getRoleByUserId(userss.getId()); + //如果是学校管理员就就找到当前设置的院系,如果是院系管理员就直接获取所在院系 + if (roles.equals("superAdmin")){ + selectedDeparts = jsonObject.getString("selecteddeparts"); + }else{ + String roleid =findroles(userss); + selectedDeparts = roleid; + } + Result result = new Result(); + // String selectedRoles = jsonObject.getString("selectedroles"); + String selectedRoles = "1731948288626339844"; + String expSc = jsonObject.getString("expSc"); + String expResume = jsonObject.getString("expResume");//简介 + String expTitle = jsonObject.getString("expTitle"); + String teamajor = jsonObject.getString("teamajor");//专业 + String expXw = jsonObject.getString("expXw");//学位 + String expZc = jsonObject.getString("expZc");//职称 + String expYjfx = jsonObject.getString("expYjfx");//研究方向 + String expCsgz = jsonObject.getString("expCsgz");//从事工作 + try { + SysUser user = JSON.parseObject(jsonObject.toJSONString(), SysUser.class); + user.setCreateTime(new Date());//设置创建时间 + String salt = oConvertUtils.randomGen(8); + user.setSalt(salt); + String passwordEncode = PasswordUtil.encrypt(user.getUsername(), user.getPassword(), salt); + user.setPassword(passwordEncode); + user.setStatus(1); + user.setDelFlag(CommonConstant.DEL_FLAG_0); + //用户表字段org_code不能在这里设置他的值 + user.setOrgCode(null); + // 保存用户走一个service 保证事务 + //获取租户ids + String relTenantIds = jsonObject.getString("relTenantIds"); + sysUserService.saveUser(user, selectedRoles, selectedDeparts, relTenantIds); + baseCommonService.addLog("添加专家用户,username: " +user.getUsername() ,CommonConstant.LOG_TYPE_2, 2); + Seteacher expert = new Seteacher(); + expert.setUserId(user.getId()); + expert.setExpImg(user.getAvatar()); + expert.setExpSc(expSc); + expert.setExpResume(expResume); + expert.setExpTitle(expTitle); + expert.setName(user.getRealname()); + expert.setExpXw(expXw);//学位 + expert.setExpZc(expZc);//职称 + expert.setExpYjfx(expYjfx);//研究方向 + expert.setExpCsgz(expCsgz);//从事工作 + expert.setTeamajor(teamajor);//专业 + seteacherService.save(expert); + result.success("添加成功!"); + } catch (Exception e) { + log.error(e.getMessage(), e); + result.error500("操作失败"); + } + return result; + } + + //用于当前登录信息的部门设置 + private String findroles(LoginUser userss) { + SysDict sysDict = sysDictService.query().eq("org_code",userss.getOrgCode()).one(); + return sysDict.getId(); + + } + + + /** + * 1.2根据用户id获取用户角色信息 + * + * @param userId + * @return + */ + public String getRoleByUserId(String userId) { + SysUserRole userRoleList = sysUserRoleService.query().eq("user_id", userId).one(); + SysRole sysRole = sysRoleService.getById(userRoleList.getRoleId()); + + return sysRole.getRoleCode(); + } + + @RequestMapping(value = "/editTEA", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result editZJ(@RequestBody JSONObject jsonObject,HttpServletRequest req) { + Result result = new Result(); + try { + SysUser sysUser = sysUserService.getById(jsonObject.getString("id")); + baseCommonService.addLog("编辑用户,username: " +sysUser.getUsername() ,CommonConstant.LOG_TYPE_2, 2); + if(sysUser==null) { + result.error500("未找到对应实体"); + }else { + SysUser user = JSON.parseObject(jsonObject.toJSONString(), SysUser.class); + user.setUpdateTime(new Date()); + //String passwordEncode = PasswordUtil.encrypt(user.getUsername(), user.getPassword(), sysUser.getSalt()); + user.setPassword(sysUser.getPassword()); + String roles = "1731948288626339844"; + String departs = jsonObject.getString("selecteddeparts"); + String expSc = jsonObject.getString("expSc"); + String expResume = jsonObject.getString("expResume"); + String expTitle = jsonObject.getString("expTitle"); + String teamajor =jsonObject.getString("teamajor"); + String expXw = jsonObject.getString("expXw");//学位 + String expZc = jsonObject.getString("expZc");//职称 + String expYjfx = jsonObject.getString("expYjfx");//研究方向 + String expCsgz = jsonObject.getString("expCsgz");//从事工作 + + if(oConvertUtils.isEmpty(departs)){ + //vue3.0前端只传递了departIds + departs=user.getDepartIds(); + } + //用户表字段org_code不能在这里设置他的值 + user.setOrgCode(null); + // 修改用户走一个service 保证事务 + //获取租户ids + String relTenantIds = jsonObject.getString("relTenantIds"); + sysUserService.editUser(user, roles, departs, relTenantIds); + Seteacher expert = new Seteacher(); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(expert, req.getParameterMap()); + queryWrapper.eq("user_id",user.getId()); + List listex = seteacherService.list(queryWrapper); + expert = listex.get(0); + expert.setUserId(user.getId()); + expert.setExpImg(user.getAvatar()); + expert.setExpSc(expSc); + expert.setExpResume(expResume); + expert.setExpTitle(expTitle); + expert.setName(user.getRealname()); + expert.setExpXw(expXw);//学位 + expert.setTeamajor(teamajor);//专业 + expert.setExpZc(expZc);//职称 + expert.setExpYjfx(expYjfx);//研究方向 + expert.setExpCsgz(expCsgz);//从事工作 + + seteacherService.updateById(expert); + result.success("修改成功!"); + } + } catch (Exception e) { + log.error(e.getMessage(), e); + result.error500("操作失败"); + } + return result; + } + + + + + + /** + * 编辑 + * + * @param seteacher + * @return + */ + @AutoLog(value = "seteacher-编辑") + @ApiOperation(value="seteacher-编辑", notes="seteacher-编辑") + @RequiresPermissions("seteacher:seteacher:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody Seteacher seteacher) { + seteacherService.updateById(seteacher); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "seteacher-通过id删除") + @ApiOperation(value="seteacher-通过id删除", notes="seteacher-通过id删除") + @RequiresPermissions("seteacher:seteacher:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + seteacherService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "seteacher-批量删除") + @ApiOperation(value="seteacher-批量删除", notes="seteacher-批量删除") + @RequiresPermissions("seteacher:seteacher:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.seteacherService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "seteacher-通过id查询") + @ApiOperation(value="seteacher-通过id查询", notes="seteacher-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id,HttpServletRequest req) { + Seteacher seteacher = new Seteacher(); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(seteacher, req.getParameterMap()); + queryWrapper.eq("user_id",id); + seteacher=seteacherService.getOne(queryWrapper); + if(seteacher==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(seteacher); + } + + /** + * 导出excel + * + * @param request + * @param seteacher + */ + @RequiresPermissions("seteacher:seteacher:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, Seteacher seteacher) { + return super.exportXls(request, seteacher, Seteacher.class, "seteacher"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("seteacher:seteacher:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, Seteacher.class); + } + +} diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/seteacher/entity/Seteacher.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/seteacher/entity/Seteacher.java new file mode 100644 index 00000000..eb54dc88 --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/seteacher/entity/Seteacher.java @@ -0,0 +1,102 @@ +package org.jeecg.modules.demo.seteacher.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: seteacher + * @Author: jeecg-boot + * @Date: 2024-08-23 + * @Version: V1.0 + */ +@Data +@TableName("seteacher") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="seteacher对象", description="seteacher") +public class Seteacher implements Serializable { + private static final long serialVersionUID = 1L; + + /**id*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "id") + private String id; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private Date updateTime; + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private String sysOrgCode; + /**用户id*/ + @Excel(name = "用户id", width = 15) + @ApiModelProperty(value = "用户id") + private String userId; + /**专家照片*/ + @Excel(name = "专家照片", width = 15) + @ApiModelProperty(value = "专家照片") + private String expImg; + /**专家毕业院校*/ + @Excel(name = "专家毕业院校", width = 15) + @ApiModelProperty(value = "专家毕业院校") + private String expSc; + /**简介*/ + @Excel(name = "简介", width = 15) + @ApiModelProperty(value = "简介") + private String expResume; + /**专家学历*/ + @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 name; + /**专业*/ + @Excel(name = "专业", width = 15) + @ApiModelProperty(value = "专业") + private String teamajor; +} diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/seteacher/mapper/SeteacherMapper.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/seteacher/mapper/SeteacherMapper.java new file mode 100644 index 00000000..729ad607 --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/seteacher/mapper/SeteacherMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.demo.seteacher.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.demo.seteacher.entity.Seteacher; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: seteacher + * @Author: jeecg-boot + * @Date: 2024-08-23 + * @Version: V1.0 + */ +public interface SeteacherMapper extends BaseMapper { + +} diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/seteacher/mapper/xml/SeteacherMapper.xml b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/seteacher/mapper/xml/SeteacherMapper.xml new file mode 100644 index 00000000..03642c84 --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/seteacher/mapper/xml/SeteacherMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/seteacher/service/ISeteacherService.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/seteacher/service/ISeteacherService.java new file mode 100644 index 00000000..00d86be9 --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/seteacher/service/ISeteacherService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.demo.seteacher.service; + +import org.jeecg.modules.demo.seteacher.entity.Seteacher; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: seteacher + * @Author: jeecg-boot + * @Date: 2024-08-23 + * @Version: V1.0 + */ +public interface ISeteacherService extends IService { + +} diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/seteacher/service/impl/SeteacherServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/seteacher/service/impl/SeteacherServiceImpl.java new file mode 100644 index 00000000..46cea898 --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/seteacher/service/impl/SeteacherServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.demo.seteacher.service.impl; + +import org.jeecg.modules.demo.seteacher.entity.Seteacher; +import org.jeecg.modules.demo.seteacher.mapper.SeteacherMapper; +import org.jeecg.modules.demo.seteacher.service.ISeteacherService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: seteacher + * @Author: jeecg-boot + * @Date: 2024-08-23 + * @Version: V1.0 + */ +@Service +public class SeteacherServiceImpl extends ServiceImpl implements ISeteacherService { + +} diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/controller/TeamSeqController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/controller/TeamSeqController.java index 2dc5e340..ca8b49ae 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/controller/TeamSeqController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/controller/TeamSeqController.java @@ -1,5 +1,6 @@ package org.jeecg.modules.demo.teamseq.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -20,6 +21,9 @@ import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; /** * @Description: 团队赛队员积分计算配置 @@ -57,6 +61,15 @@ public class TeamSeqController extends JeecgController return Result.OK(pageList); } + @ApiOperation(value = "团队赛队员积分计算配置-分页列表查询", notes = "团队赛队员积分计算配置-分页列表查询") + @GetMapping(value = "/listByPointId") + public Result queryPageList(String pointId) { + List list = teamSeqService.list(new LambdaQueryWrapper().eq(TeamSeq::getPointId, pointId)); + Map map = new LinkedHashMap<>(); + map.put("records",list); + return Result.OK(map); + } + /** * 添加 * @@ -72,6 +85,15 @@ public class TeamSeqController extends JeecgController return Result.OK("添加成功!"); } + @AutoLog(value = "团队赛队员积分计算配置-添加") + @ApiOperation(value = "团队赛队员积分计算配置-添加", notes = "团队赛队员积分计算配置-添加") +// @RequiresPermissions("teamseq:team_seq:add") + @PostMapping(value = "/saveOrUpdate4TeamSeq") + public Result saveOrUpdate4TeamSeq(@RequestBody List seqList) { + teamSeqService.saveOrUpdate4TeamSeq(seqList); + return Result.OK("添加成功!"); + } + /** * 编辑 * diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/entity/TeamSeq.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/entity/TeamSeq.java index 01504454..316c056b 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/entity/TeamSeq.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/entity/TeamSeq.java @@ -68,61 +68,16 @@ public class TeamSeq implements Serializable { @ApiModelProperty(value = "年度比赛项目id") private String pointId; - - /** - * 第1序号 - */ - @Excel(name = "第1序号", width = 15) - @ApiModelProperty(value = "第1序号") - private Integer teamSeqFirst; - /** - * 第1序号比值 - */ - @Excel(name = "第1序号比值", width = 15) - @ApiModelProperty(value = "第1序号比值") - private Integer teamSeqFirstVal; - - /** - * 第2序号 - */ - @ApiModelProperty(value = "第1序号") - private Integer teamSeqSecond; - /** - * 第2序号比值 - */ - @ApiModelProperty(value = "第2序号比值") - private Integer teamSeqSecondVal; - - /** - * 第3序号 - */ - @ApiModelProperty(value = "第3序号") - private Integer teamSeqThird; - /** - * 第3序号比值 - */ - @ApiModelProperty(value = "第3序号比值") - private Integer teamSeqThirdVal; - - /** - * 第4序号 - */ - @ApiModelProperty(value = "第4序号") - private Integer teamSeqFourth; - /** - * 第4序号比值 - */ - @ApiModelProperty(value = "第4序号比值") - private Integer teamSeqFourthVal; - /** - * 第5序号 + * 位次号 */ - @ApiModelProperty(value = "第5序号") - private Integer teamSeqFifth; + @Excel(name = "队员在队伍中的位次序号", width = 15) + @ApiModelProperty(value = "队员在队伍中的位次序号") + private Integer teamSeq; /** - * 第5序号比值 + * 位次号比值 */ - @ApiModelProperty(value = "第5序号比值") - private Integer teamSeqFifthVal; + @Excel(name = "队员在队伍中的位次序号比值", width = 15) + @ApiModelProperty(value = "队员在队伍中的位次序号比值") + private Integer teamSeqVal; } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/service/ITeamSeqService.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/service/ITeamSeqService.java index 198d9427..bea209bb 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/service/ITeamSeqService.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/service/ITeamSeqService.java @@ -4,6 +4,8 @@ import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint; import org.jeecg.modules.demo.teamseq.entity.TeamSeq; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + /** * @Description: 团队赛队员积分计算配置 * @Author: jeecg-boot @@ -12,5 +14,5 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface ITeamSeqService extends IService { - void saveOrUpdate4TeamSeq(AnnualCompPoint point); + void saveOrUpdate4TeamSeq(List list); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/service/impl/TeamSeqServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/service/impl/TeamSeqServiceImpl.java index e76fa648..5bcd0ae5 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/service/impl/TeamSeqServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/service/impl/TeamSeqServiceImpl.java @@ -1,7 +1,7 @@ package org.jeecg.modules.demo.teamseq.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.jeecg.modules.demo.teamseq.entity.TeamSeq; import org.jeecg.modules.demo.teamseq.mapper.TeamSeqMapper; import org.jeecg.modules.demo.teamseq.service.ITeamSeqService; @@ -9,25 +9,26 @@ import org.jeecg.modules.demo.teamseq.vo.TeamSeqVo; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import java.util.List; /** * @Description: 团队赛队员积分计算配置 * @Author: jeecg-boot - * @Date: 2024-08-22 + * @Date: 2024-08-22 * @Version: V1.0 */ @Service public class TeamSeqServiceImpl extends ServiceImpl implements ITeamSeqService { @Override - public void saveOrUpdate4TeamSeq(AnnualCompPoint point) { - this.remove(new LambdaQueryWrapper().eq(TeamSeq::getPointId,point.getId())); - TeamSeqVo vo = new TeamSeqVo(); - BeanUtils.copyProperties(point,vo); - vo.setPointId(point.getId()); - TeamSeq teamSeq = new TeamSeq(); - BeanUtils.copyProperties(vo,teamSeq); - this.save(teamSeq); + public void saveOrUpdate4TeamSeq(List list) { + String pointId = list.get(0).getPointId(); + this.remove(new LambdaQueryWrapper().eq(TeamSeq::getPointId, pointId)); +// TeamSeqVo vo = new TeamSeqVo(); +// BeanUtils.copyProperties(point, vo); +// vo.setPointId(point.getId()); +// TeamSeq teamSeq = new TeamSeq(); +// BeanUtils.copyProperties(vo, teamSeq); + this.saveBatch(list); } } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/controller/UpfileGroupController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/controller/UpfileGroupController.java index 49a669a3..9ed2ed75 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/controller/UpfileGroupController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/controller/UpfileGroupController.java @@ -25,6 +25,7 @@ import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService; import org.jeecg.modules.demo.annualcomp.entity.AnnualComp; import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService; import org.jeecg.modules.demo.annualcompgroup.entity.AnnualCompGroup; +import org.jeecg.modules.demo.annualcompgroup.service.IAnnualCompGroupService; import org.jeecg.modules.demo.chooseTopicPersion.entity.ChaoseTopicPersion; import org.jeecg.modules.demo.chooseTopicPersion.service.IChaoseTopicPersionService; import org.jeecg.modules.demo.comp.entity.Comp; @@ -96,6 +97,9 @@ public class UpfileGroupController extends JeecgController zpidslisttemp = new ArrayList<>(); zpidslisttemp.addAll(zpidslist); + String ndbsxmid = annualCompGroupService.getById(xmtmid).getAnnCompP(); for (int h = 0 ; h < zpidslisttemp.size() ; h++){ QueryWrapper queryWrappertpp = new QueryWrapper<>(); - queryWrappertpp.eq("ann_com_p_g",xmtmid); + queryWrappertpp.eq("ann_com_p",ndbsxmid); List listtopp = annComGroTopPService.list(queryWrappertpp); for (int r = 0 ; r < listtopp.size() ; r++){ if(listtopp.get(r).getBmcode().equals(upfilePersionService.getById(zpidslisttemp.get(h)).getApplyCode())){ diff --git a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java index a0e964ec..10d3df8c 100644 --- a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java +++ b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java @@ -192,6 +192,44 @@ public class SysUserController { return result; } + /** + * 用于教师库管理 + * + * @param user + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@RequiresPermissions("system:user:listAll") + @RequestMapping(value = "/listTEAAll", method = RequestMethod.GET) + public Result> listTEAAll(SysUser user, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(user, req.getParameterMap()); + Result> result = new Result>(); + Page page = new Page(pageNo, pageSize); +// String roleId = req.getParameter("roleId"); + String roleId = "1731948288626339844"; + String username = req.getParameter("username"); + IPage pageList = sysUserService.getUserByRoleId(page,roleId,username); + //批量查询用户的所属部门 + //step.1 先拿到全部的 useids + //step.2 通过 useids,一次性查询用户的所属部门名字 + List userIds = pageList.getRecords().stream().map(SysUser::getId).collect(Collectors.toList()); + if (userIds != null && userIds.size() > 0) { + Map useDepNames = sysUserService.getDepNamesByUserIds(userIds); + pageList.getRecords().forEach(item -> + { + item.setOrgCodeTxt(useDepNames.get(item.getId())); + + }); + } + result.setSuccess(true); + result.setResult(pageList); + return result; + } + + /** * 获取系统用户数据(查询全部用户,不做租户隔离) * diff --git a/jeecgboot-vue3-master/src/views/annualCompPoint/committee/components/AnnualCompPointForm.vue b/jeecgboot-vue3-master/src/views/annualCompPoint/committee/components/AnnualCompPointForm.vue index 630c118e..39c4a9be 100644 --- a/jeecgboot-vue3-master/src/views/annualCompPoint/committee/components/AnnualCompPointForm.vue +++ b/jeecgboot-vue3-master/src/views/annualCompPoint/committee/components/AnnualCompPointForm.vue @@ -44,9 +44,13 @@ - + - {{ item.name }} + {{ + item.name + }} + @@ -66,18 +70,21 @@ - + - - + @@ -85,98 +92,22 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + 配置队伍位次比值 - - - - - @@ -186,7 +117,8 @@ - @@ -194,7 +126,8 @@ - @@ -212,7 +145,8 @@ - @@ -220,7 +154,8 @@ - @@ -229,7 +164,8 @@ - @@ -238,7 +174,8 @@ - @@ -246,16 +183,19 @@ - - @@ -270,7 +210,8 @@ - @@ -278,7 +219,8 @@ - @@ -296,10 +238,42 @@ + + + + + + + + + + + diff --git a/jeecgboot-vue3-master/src/views/system/userTEA/UserAgentModal.vue b/jeecgboot-vue3-master/src/views/system/userTEA/UserAgentModal.vue new file mode 100644 index 00000000..f191b996 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/system/userTEA/UserAgentModal.vue @@ -0,0 +1,45 @@ + + diff --git a/jeecgboot-vue3-master/src/views/system/userTEA/UserDrawer.vue b/jeecgboot-vue3-master/src/views/system/userTEA/UserDrawer.vue new file mode 100644 index 00000000..2391706c --- /dev/null +++ b/jeecgboot-vue3-master/src/views/system/userTEA/UserDrawer.vue @@ -0,0 +1,184 @@ + + diff --git a/jeecgboot-vue3-master/src/views/system/userTEA/UserQuitAgentModal.vue b/jeecgboot-vue3-master/src/views/system/userTEA/UserQuitAgentModal.vue new file mode 100644 index 00000000..f54a1e6c --- /dev/null +++ b/jeecgboot-vue3-master/src/views/system/userTEA/UserQuitAgentModal.vue @@ -0,0 +1,68 @@ + + diff --git a/jeecgboot-vue3-master/src/views/system/userTEA/UserQuitModal.vue b/jeecgboot-vue3-master/src/views/system/userTEA/UserQuitModal.vue new file mode 100644 index 00000000..70ca45a3 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/system/userTEA/UserQuitModal.vue @@ -0,0 +1,110 @@ + + + + + diff --git a/jeecgboot-vue3-master/src/views/system/userTEA/UserRecycleBinModal.vue b/jeecgboot-vue3-master/src/views/system/userTEA/UserRecycleBinModal.vue new file mode 100644 index 00000000..6c96bcbc --- /dev/null +++ b/jeecgboot-vue3-master/src/views/system/userTEA/UserRecycleBinModal.vue @@ -0,0 +1,138 @@ + + diff --git a/jeecgboot-vue3-master/src/views/system/userTEA/index.vue b/jeecgboot-vue3-master/src/views/system/userTEA/index.vue new file mode 100644 index 00000000..1354a90d --- /dev/null +++ b/jeecgboot-vue3-master/src/views/system/userTEA/index.vue @@ -0,0 +1,277 @@ + + + + + diff --git a/jeecgboot-vue3-master/src/views/system/userTEA/user.api.ts b/jeecgboot-vue3-master/src/views/system/userTEA/user.api.ts new file mode 100644 index 00000000..d79d67d1 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/system/userTEA/user.api.ts @@ -0,0 +1,301 @@ +import { defHttp } from '/src/utils/http/axios'; +import { Modal } from 'ant-design-vue'; + +enum Api { + listNoCareTenant = '/sys/user/listAll', + listZjNoCareTenant = '/sys/user/listTEAAll', + listzdzx = '/sys/user/listzdzx', + list = '/sys/user/list', + save = '/sys/user/add', + edit = '/sys/user/edit', + saveZJ = '/seteacher/seteacher/addTEA', + editZJ = '/expert/expert/editZJ', + queryExpertById = '/expert/expert/queryById', + agentSave = '/sys/sysUserAgent/add', + agentEdit = '/sys/sysUserAgent/edit', + getUserRole = '/sys/user/queryUserRole', + duplicateCheck = '/sys/duplicate/check', + deleteUser = '/sys/user/delete', + deleteBatch = '/sys/user/deleteBatch', + importExcel = '/sys/user/importExcel', + exportXls = '/sys/user/exportXls', + + recycleBinList = '/sys/user/recycleBin', + putRecycleBin = '/sys/user/putRecycleBin', + deleteRecycleBin = '/sys/user/deleteRecycleBin', + allRolesList = '/sys/role/queryall', + allRolesListNoByTenant = '/sys/role/queryallNoByTenant', + allRolesListExcludeByTenant = '/sys/role/queryallExcludeByTenant', + allTenantList = '/sys/tenant/queryList', + allPostList = '/sys/position/list', + userDepartList = '/sys/user/userDepartList', + changePassword = '/sys/user/changePassword', + frozenBatch = '/sys/user/frozenBatch', + getUserAgent = '/sys/sysUserAgent/queryByUserName', + syncUser = '/act/process/extActProcess/doSyncUser', + userQuitAgent = '/sys/user/userQuitAgent', + getQuitList = '/sys/user/getQuitList', + putCancelQuit = '/sys/user/putCancelQuit', + 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', +} +/** + * 根据userid判断是否为专家 + * @param params + */ +export const queryByUserId = (params) => { + return defHttp.get({ url: Api.queryByUserId, params },{ successMessageMode: 'none' }); +}; +/** + * 导出api + * @param 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 + */ +export const getImportUrl = Api.importExcel; +/** + * 列表接口(查询用户,通过租户隔离) + * @param params + */ +export const list = (params) => defHttp.get({ url: Api.list, params }); + +/** + * 列表接口(查询全部用户,不通过租户隔离) + * @param params + */ +export const listNoCareTenant = (params) => defHttp.get({ url: Api.listNoCareTenant, params }); + +/** + * 列表接口(查询角色为“专家”,不通过租户隔离) + * @param params + */ +export const listZjNoCareTenant = (params) => defHttp.get({ url: Api.listZjNoCareTenant, params }); + + +/** + * 列表接口(查询全部用户,不通过租户隔离) + * 适用于专家、学生、组委会查看自己的信息 + * @param params + */ +export const listzdzx = (params) => defHttp.get({ url: Api.listzdzx, params }); + +/** + * 用户角色接口 + * @param params + */ +export const getUserRoles = (params) => defHttp.get({ url: Api.getUserRole, params }, { errorMessageMode: 'none' }); +/** + * 专家信息接口 + * @param params + */ +export const queryExpertById = (params) => defHttp.get({ url: Api.queryExpertById, params }, { successMessageMode: 'none' }); + + +/** + * 删除用户 + */ +export const deleteUser = (params, handleSuccess) => { + return defHttp.delete({ url: Api.deleteUser, params }, { joinParamsToUrl: true }).then(() => { + handleSuccess(); + }); +}; +/** + * 批量删除用户 + * @param params + */ +export const batchDeleteUser = (params, handleSuccess) => { + Modal.confirm({ + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => { + handleSuccess(); + }); + }, + }); +}; +/** + * 保存或者更新用户 + * @param params + */ +export const saveOrUpdateUser = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({ url: url, params }); +}; +/** + * 保存或者更新专家用户 + * @param params + */ +export const saveOrUpdateUserZJ = (params, isUpdate) => { + let url = isUpdate ? Api.editZJ : Api.saveZJ; + return defHttp.post({ url: url, params }); +}; +/** + * 唯一校验 + * @param params + */ +export const duplicateCheck = (params) => defHttp.get({ url: Api.duplicateCheck, params }, { isTransformResponse: false }); +/** + * 获取全部角色(租户隔离) + * @param params + */ +export const getAllRolesList = (params) => defHttp.get({ url: Api.allRolesList, params }); +/** + * 获取全部角色(不租户隔离) + * @param params + */ +export const getAllRolesListNoByTenant = (params) => defHttp.get({ url: Api.allRolesListNoByTenant, params }); + + +/** + * 获取角色(排除:总管理) + * @param params + */ +export const getAllRolesListNoByExcludeTenant = (params) => defHttp.get({ url: Api.allRolesListExcludeByTenant, params }); + + +/** + * 获取全部租户 + */ +export const getAllTenantList = (params) => defHttp.get({ url: Api.allTenantList, params }); +/** + * 获取指定用户负责部门 + */ +export const getUserDepartList = (params) => defHttp.get({ url: Api.userDepartList, params }, { successMessageMode: 'none' }); +/** + * 获取全部职务 + */ +export const getAllPostList = (params) => { + return new Promise((resolve) => { + defHttp.get({ url: Api.allPostList, params }).then((res) => { + resolve(res.records); + }); + }); +}; +/** + * 回收站列表 + * @param params + */ +export const getRecycleBinList = (params) => defHttp.get({ url: Api.recycleBinList, params }); +/** + * 回收站还原 + * @param params + */ +export const putRecycleBin = (params, handleSuccess) => { + return defHttp.put({ url: Api.putRecycleBin, params }).then(() => { + handleSuccess(); + }); +}; +/** + * 回收站删除 + * @param params + */ +export const deleteRecycleBin = (params, handleSuccess) => { + return defHttp.delete({ url: Api.deleteRecycleBin, params }, { joinParamsToUrl: true }).then(() => { + handleSuccess(); + }); +}; +/** + * 修改密码 + * @param params + */ +export const changePassword = (params) => { + return defHttp.put({ url: Api.changePassword, params }); +}; +/** + * 冻结解冻 + * @param params + */ +export const frozenBatch = (params, handleSuccess) => { + return defHttp.put({ url: Api.frozenBatch, params }).then(() => { + handleSuccess(); + }); +}; +/** + * 获取用户代理 + * @param params + */ +export const getUserAgent = (params) => defHttp.get({ url: Api.getUserAgent, params }, { isTransformResponse: false }); +/** + * 保存或者更新用户代理 + * @param params + */ +export const saveOrUpdateAgent = (params) => { + let url = params.id ? Api.agentEdit : Api.agentSave; + return defHttp.post({ url: url, params }); +}; + +/** + * 用户同步流程 + * @param params + */ +export const syncUser = () => defHttp.put({ url: Api.syncUser }); + +/** + * 用户离职(新增代理人和用户状态变更操作) + * @param params + */ +export const userQuitAgent = (params) => { + return defHttp.put({ url: Api.userQuitAgent, params }); +}; + +/** + * 用户离职列表 + * @param params + */ +export const getQuitList = (params) => { + return defHttp.get({ url: Api.getQuitList, params }); +}; + +/** + * 取消离职 + * @param params + */ +export const putCancelQuit = (params, handleSuccess) => { + return defHttp.put({ url: Api.putCancelQuit, params }, { joinParamsToUrl: true }).then(() => { + handleSuccess(); + }); +}; + +/** + * 待审批获取列表数据 + */ +export const getUserTenantPageList = (params)=>{ + return defHttp.get({url:Api.getUserTenantPageList,params}) +} + +/** + * 更新租户状态 + * @param params + */ +export const updateUserTenantStatus = (params)=>{ + return defHttp.put({ url: Api.updateUserTenantStatus, params }, { joinParamsToUrl: true,isTransformResponse: false }); +} diff --git a/jeecgboot-vue3-master/src/views/system/userTEA/user.data.ts b/jeecgboot-vue3-master/src/views/system/userTEA/user.data.ts new file mode 100644 index 00000000..bbed1ed8 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/system/userTEA/user.data.ts @@ -0,0 +1,604 @@ +import { BasicColumn } from '/src/components/Table'; +import { FormSchema } from '/src/components/Table'; +import { getAllRolesListNoByTenant,getAllRolesListNoByExcludeTenant, getAllTenantList } from './user.api'; +import { rules } from '/src/utils/helper/validator'; +import { render } from '/src/utils/common/renderUtils'; +export const columns: BasicColumn[] = [ + { + title: '用户账号', + dataIndex: 'username', + width: 120, + }, + { + title: '用户姓名', + dataIndex: 'realname', + width: 100, + }, + { + title: '头像', + dataIndex: 'avatar', + width: 120, + customRender: render.renderAvatar, + }, + /*{ + title: '性别', + dataIndex: 'sex', + width: 80, + sorter: true, + customRender: ({ text }) => { + return render.renderDict(text, 'sex'); + }, + }, + { + title: '生日', + dataIndex: 'birthday', + width: 100, + },*/ + { + title: '手机号', + dataIndex: 'phone', + width: 100, + }, + { + title: '院系/部门', + width: 150, + dataIndex: 'orgCodeTxt', + }, +/* { + title: '负责部门', + width: 150, + dataIndex: 'departIds_dictText', + },*/ + { + title: '状态', + dataIndex: 'status_dictText', + width: 80, + }, +]; + +export const recycleColumns: BasicColumn[] = [ + { + title: '用户账号', + dataIndex: 'username', + width: 100, + }, + { + title: '用户姓名', + dataIndex: 'realname', + width: 100, + }, + { + title: '头像', + dataIndex: 'avatar', + width: 80, + customRender: render.renderAvatar, + }, + { + title: '性别', + dataIndex: 'sex', + width: 80, + sorter: true, + customRender: ({ text }) => { + return render.renderDict(text, 'sex'); + }, + }, +]; + +export const searchFormSchema: FormSchema[] = [ +/* { + label: '账号', + field: 'username', + component: 'JInput', + colProps: { span: 6 }, + },*/ + { + label: '名字', + field: 'realname', + component: 'JInput', + colProps: { span: 6 }, + }, + /*{ + label: '性别', + field: 'sex', + component: 'JDictSelectTag', + componentProps: { + dictCode: 'sex', + placeholder: '请选择性别', + stringToNumber: true, + }, + colProps: { span: 6 }, + },*/ + { + label: '手机号码', + field: 'phone', + component: 'Input', + colProps: { span: 6 }, + }, + { + label: '用户状态', + field: 'status', + component: 'JDictSelectTag', + componentProps: { + dictCode: 'user_status', + placeholder: '请选择状态', + stringToNumber: true, + }, + colProps: { span: 6 }, + }, +]; +export const formSchema: FormSchema[] = [ + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, + { + label: '专家账号', + field: 'username', + component: 'Input', + dynamicDisabled: ({ values }) => { + return !!values.id; + }, + dynamicRules: ({ model, schema }) => rules.duplicateCheckRule('sys_user', 'username', model, schema, true), + }, + { + label: '登录密码', + field: 'password', + component: 'StrengthMeter', + rules: [ + { + required: true, + message: '请输入登录密码', + }, + ], + }, + { + label: '确认密码', + field: 'confirmPassword', + component: 'InputPassword', + dynamicRules: ({ values }) => rules.confirmPassword(values, true), + }, + { + label: '用户姓名', + field: 'realname', + required: true, + component: 'Input', + }, + { + label: '工号', + field: 'workNo', + required: true, + component: 'Input', + dynamicRules: ({ model, schema }) => rules.duplicateCheckRule('sys_user', 'work_no', model, schema, true), + }, + /*{ + label: '职务', + field: 'post', + required: false, + component: 'JSelectPosition', + componentProps: { + rowKey: 'code', + labelKey: 'name', + }, + },*/ +/* { + label: '角色', + field: 'selectedroles', + dynamicDisabled: ({ values }) => { + return !!values.id; + }, + component: 'ApiSelect', + componentProps: { + api: getAllRolesListNoByExcludeTenant, + labelField: 'roleName', + valueField: 'id', + }, + },*/ + { + label: '所属部门', + field: 'selecteddeparts', + component: 'JSelectDept', + componentProps: ({ formActionType, formModel }) => { + return { + sync: false, + checkStrictly: true, + defaultExpandLevel: 2, + multiple:false, + onSelect: (options, values) => { + const { updateSchema } = formActionType; + //所属部门修改后更新负责部门下拉框数据 + updateSchema([ + { + field: 'departIds', + componentProps: { options }, + }, + ]); + //所属部门修改后更新负责部门数据 + formModel.departIds && (formModel.departIds = formModel.departIds.filter((item) => values.value.indexOf(item) > -1)); + }, + }; + }, + }, + /*{ + label: '租户', + field: 'relTenantIds', + component: 'ApiSelect', + componentProps: { + mode: 'multiple', + api: getAllTenantList, + numberToString: true, + labelField: 'name', + valueField: 'id', + }, + },*/ + /*{ + label: '身份', + field: 'userIdentity', + component: 'RadioGroup', + defaultValue: 1, + componentProps: ({ formModel }) => { + return { + options: [ + { label: '普通用户', value: 1, key: '1' }, + { label: '上级', value: 2, key: '2' }, + ], + onChange: () => { + formModel.userIdentity == 1 && (formModel.departIds = []); + }, + }; + }, + },*/ + /* { + label: '负责部门', + field: 'departIds', + component: 'Select', + componentProps: { + mode: 'multiple', + }, + ifShow: ({ values }) => values.userIdentity == 2, + },*/ + { + label: '头像', + field: 'avatar', + component: 'JImageUpload', + componentProps: { + fileMax: 1, + }, + }, + { + label: '生日', + field: 'birthday', + component: 'DatePicker', + }, + { + label: '性别', + field: 'sex', + component: 'JDictSelectTag', + componentProps: { + dictCode: 'sex', + placeholder: '请选择性别', + stringToNumber: true, + }, + }, + { + label: '邮箱', + field: 'email', + component: 'Input', + }, + { + label: '手机号码', + field: 'phone', + component: 'Input', + }, + /*{ + label: '座机', + field: 'telephone', + component: 'Input', + rules: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' }], + }, + { + label: '工作流引擎', + field: 'activitiSync', + defaultValue: 1, + component: 'JDictSelectTag', + componentProps: { + dictCode: 'activiti_sync', + type: 'radio', + stringToNumber: true, + }, + },*/ + { + label: '学历', + field: 'expTitle', + component: 'Input', + }, + + { + label: '专业', + field: 'teamajor', + component: 'Input', + }, + { + label: '学位', + field: 'expXw', + component: 'Input', + }, + { + 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', + component: 'Input', + show: false, + },*/ + /*{ + label: '比赛名称', + field: 'compName', + component: 'JPopup', + componentProps: ({ formActionType }) => { + const {setFieldsValue} = formActionType; + return{ + setFieldsValue:setFieldsValue, + code:"comp_select", + fieldConfig: [ + { source: 'id', target: 'compid' }, + { source: 'comp_name', target: 'compName' }, + ], + multi:true + } + }, + },*/ +/* { + label: '比赛状态', + field: 'stat', + component: 'JSwitch', + defaultValue: 'Y', + componentProps: {}, + },*/ +]; +export const formPasswordSchema: FormSchema[] = [ + { + label: '用户账号', + field: 'username', + component: 'Input', + componentProps: { readOnly: true }, + }, + { + label: '登录密码', + field: 'password', + component: 'StrengthMeter', + componentProps: { + placeholder: '请输入登录密码', + }, + rules: [ + { + required: true, + message: '请输入登录密码', + }, + ], + }, + { + label: '确认密码', + field: 'confirmPassword', + component: 'InputPassword', + dynamicRules: ({ values }) => rules.confirmPassword(values, true), + }, +]; + +export const formAgentSchema: FormSchema[] = [ + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, + { + field: 'userName', + label: '用户名', + component: 'Input', + componentProps: { + readOnly: true, + allowClear: false, + }, + }, + { + field: 'agentUserName', + label: '代理人用户名', + required: true, + component: 'JSelectUser', + componentProps: { + rowKey: 'username', + labelKey: 'realname', + maxSelectCount: 10, + }, + }, + { + field: 'startTime', + label: '代理开始时间', + component: 'DatePicker', + required: true, + componentProps: { + showTime: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss', + placeholder: '请选择代理开始时间', + }, + }, + { + field: 'endTime', + label: '代理结束时间', + component: 'DatePicker', + required: true, + componentProps: { + showTime: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss', + placeholder: '请选择代理结束时间', + }, + }, + { + field: 'status', + label: '状态', + component: 'JDictSelectTag', + defaultValue: '1', + componentProps: { + dictCode: 'valid_status', + type: 'radioButton', + }, + }, +]; +export const formQuitAgentSchema: FormSchema[] = [ + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, + { + field: 'userName', + label: '用户名', + component: 'Input', + componentProps: { + readOnly: true, + allowClear: false, + }, + }, + { + field: 'agentUserName', + label: '交接人员', + required: true, + component: 'JSelectUser', + componentProps: { + rowKey: 'username', + labelKey: 'realname', + maxSelectCount: 1, + }, + }, + { + field: 'startTime', + label: '交接开始时间', + component: 'DatePicker', + required: true, + componentProps: { + showTime: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss', + placeholder: '请选择交接开始时间', + getPopupContainer: () => document.body, + }, + }, + { + field: 'endTime', + label: '交接结束时间', + component: 'DatePicker', + required: true, + componentProps: { + showTime: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss', + placeholder: '请选择交接结束时间', + getPopupContainer: () => document.body, + }, + }, + { + field: 'status', + label: '状态', + component: 'JDictSelectTag', + defaultValue: '1', + componentProps: { + dictCode: 'valid_status', + type: 'radioButton', + }, + }, +]; + +//租户用户列表 +export const userTenantColumns: BasicColumn[] = [ + { + title: '用户账号', + dataIndex: 'username', + width: 120, + }, + { + title: '用户姓名', + dataIndex: 'realname', + width: 100, + }, + { + title: '头像', + dataIndex: 'avatar', + width: 120, + customRender: render.renderAvatar, + }, + { + title: '手机号', + dataIndex: 'phone', + width: 100, + }, + { + title: '部门', + width: 150, + dataIndex: 'orgCodeTxt', + }, + { + title: '状态', + dataIndex: 'status', + width: 80, + customRender: ({ text }) => { + if (text === '1') { + return '正常'; + } else if (text === '3') { + return '审批中'; + } else { + return '已拒绝'; + } + }, + }, +]; + +//用户租户搜索表单 +export const userTenantFormSchema: FormSchema[] = [ + { + label: '账号', + field: 'username', + component: 'Input', + colProps: { span: 6 }, + }, + { + label: '名字', + field: 'realname', + component: 'Input', + colProps: { span: 6 }, + }, + { + label: '性别', + field: 'sex', + component: 'JDictSelectTag', + componentProps: { + dictCode: 'sex', + placeholder: '请选择性别', + stringToNumber: true, + }, + colProps: { span: 6 }, + }, +]; diff --git a/jeecgboot-vue3-master/src/views/system/userTEA/userDetails.vue b/jeecgboot-vue3-master/src/views/system/userTEA/userDetails.vue new file mode 100644 index 00000000..59991ee3 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/system/userTEA/userDetails.vue @@ -0,0 +1,54 @@ + + diff --git a/jeecgboot-vue3-master/src/views/system/userTEA/userZJ.api.ts b/jeecgboot-vue3-master/src/views/system/userTEA/userZJ.api.ts new file mode 100644 index 00000000..91f8ce1a --- /dev/null +++ b/jeecgboot-vue3-master/src/views/system/userTEA/userZJ.api.ts @@ -0,0 +1,272 @@ +import { defHttp } from '/src/utils/http/axios'; +import { Modal } from 'ant-design-vue'; + +enum Api { + listNoCareTenant = '/sys/user/listAll', + listzdzx = '/sys/user/listzdzx', + list = '/sys/user/list', + save = '/sys/user/add', + edit = '/sys/user/edit', + saveZJ = '/seteacher/seteacher/addTEA', + editZJ = '/seteacher/seteacher/editTEA', + queryExpertById = '/seteacher/seteacher/queryById', + agentSave = '/sys/sysUserAgent/add', + agentEdit = '/sys/sysUserAgent/edit', + getUserRole = '/sys/user/queryUserRole', + duplicateCheck = '/sys/duplicate/check', + deleteUser = '/sys/user/delete', + deleteBatch = '/sys/user/deleteBatch', + importExcel = '/sys/user/importExcel', + exportXls = '/sys/user/exportXls', + recycleBinList = '/sys/user/recycleBin', + putRecycleBin = '/sys/user/putRecycleBin', + deleteRecycleBin = '/sys/user/deleteRecycleBin', + allRolesList = '/sys/role/queryall', + allRolesListNoByTenant = '/sys/role/queryallNoByTenant', + allRolesListExcludeByTenant = '/sys/role/queryallExcludeByTenant', + allTenantList = '/sys/tenant/queryList', + allPostList = '/sys/position/list', + userDepartList = '/sys/user/userDepartList', + changePassword = '/sys/user/changePassword', + frozenBatch = '/sys/user/frozenBatch', + getUserAgent = '/sys/sysUserAgent/queryByUserName', + syncUser = '/act/process/extActProcess/doSyncUser', + userQuitAgent = '/sys/user/userQuitAgent', + getQuitList = '/sys/user/getQuitList', + putCancelQuit = '/sys/user/putCancelQuit', + updateUserTenantStatus='/sys/tenant/updateUserTenantStatus', + getUserTenantPageList='/sys/tenant/getUserTenantPageList', + exportXlsMb = '/sys/user/exportXlsMb', + queryByUserId = '/expert/expert/queryByUserId', +} +/** + * 根据userid判断是否为专家 + * @param params + */ +export const queryByUserId = (params) => { + return defHttp.get({ url: Api.queryByUserId, params },{ successMessageMode: 'none' }); +}; +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; + +export const getExportUrlMb = Api.exportXlsMb; +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; +/** + * 列表接口(查询用户,通过租户隔离) + * @param params + */ +export const list = (params) => defHttp.get({ url: Api.list, params }); + +/** + * 列表接口(查询全部用户,不通过租户隔离) + * @param params + */ +export const listNoCareTenant = (params) => defHttp.get({ url: Api.listNoCareTenant, params }); + +/** + * 列表接口(查询全部用户,不通过租户隔离) + * 适用于专家、学生、组委会查看自己的信息 + * @param params + */ +export const listzdzx = (params) => defHttp.get({ url: Api.listzdzx, params }); + +/** + * 用户角色接口 + * @param params + */ +export const getUserRoles = (params) => defHttp.get({ url: Api.getUserRole, params }, { errorMessageMode: 'none' }); +/** + * 专家信息接口 + * @param params + */ +export const queryExpertById = (params) => defHttp.get({ url: Api.queryExpertById, params }, { successMessageMode: 'none' }); + + +/** + * 删除用户 + */ +export const deleteUser = (params, handleSuccess) => { + return defHttp.delete({ url: Api.deleteUser, params }, { joinParamsToUrl: true }).then(() => { + handleSuccess(); + }); +}; +/** + * 批量删除用户 + * @param params + */ +export const batchDeleteUser = (params, handleSuccess) => { + Modal.confirm({ + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => { + handleSuccess(); + }); + }, + }); +}; +/** + * 保存或者更新用户 + * @param params + */ +export const saveOrUpdateUser = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({ url: url, params }); +}; +/** + * 保存或者更新专家用户 + * @param params + */ +export const saveOrUpdateUserZJ = (params, isUpdate) => { + let url = isUpdate ? Api.editZJ : Api.saveZJ; + return defHttp.post({ url: url, params }); +}; +/** + * 唯一校验 + * @param params + */ +export const duplicateCheck = (params) => defHttp.get({ url: Api.duplicateCheck, params }, { isTransformResponse: false }); +/** + * 获取全部角色(租户隔离) + * @param params + */ +export const getAllRolesList = (params) => defHttp.get({ url: Api.allRolesList, params }); +/** + * 获取全部角色(不租户隔离) + * @param params + */ +export const getAllRolesListNoByTenant = (params) => defHttp.get({ url: Api.allRolesListNoByTenant, params }); + + +/** + * 获取角色(排除:总管理) + * @param params + */ +export const getAllRolesListNoByExcludeTenant = (params) => defHttp.get({ url: Api.allRolesListExcludeByTenant, params }); + + +/** + * 获取全部租户 + */ +export const getAllTenantList = (params) => defHttp.get({ url: Api.allTenantList, params }); +/** + * 获取指定用户负责部门 + */ +export const getUserDepartList = (params) => defHttp.get({ url: Api.userDepartList, params }, { successMessageMode: 'none' }); +/** + * 获取全部职务 + */ +export const getAllPostList = (params) => { + return new Promise((resolve) => { + defHttp.get({ url: Api.allPostList, params }).then((res) => { + resolve(res.records); + }); + }); +}; +/** + * 回收站列表 + * @param params + */ +export const getRecycleBinList = (params) => defHttp.get({ url: Api.recycleBinList, params }); +/** + * 回收站还原 + * @param params + */ +export const putRecycleBin = (params, handleSuccess) => { + return defHttp.put({ url: Api.putRecycleBin, params }).then(() => { + handleSuccess(); + }); +}; +/** + * 回收站删除 + * @param params + */ +export const deleteRecycleBin = (params, handleSuccess) => { + return defHttp.delete({ url: Api.deleteRecycleBin, params }, { joinParamsToUrl: true }).then(() => { + handleSuccess(); + }); +}; +/** + * 修改密码 + * @param params + */ +export const changePassword = (params) => { + return defHttp.put({ url: Api.changePassword, params }); +}; +/** + * 冻结解冻 + * @param params + */ +export const frozenBatch = (params, handleSuccess) => { + return defHttp.put({ url: Api.frozenBatch, params }).then(() => { + handleSuccess(); + }); +}; +/** + * 获取用户代理 + * @param params + */ +export const getUserAgent = (params) => defHttp.get({ url: Api.getUserAgent, params }, { isTransformResponse: false }); +/** + * 保存或者更新用户代理 + * @param params + */ +export const saveOrUpdateAgent = (params) => { + let url = params.id ? Api.agentEdit : Api.agentSave; + return defHttp.post({ url: url, params }); +}; + +/** + * 用户同步流程 + * @param params + */ +export const syncUser = () => defHttp.put({ url: Api.syncUser }); + +/** + * 用户离职(新增代理人和用户状态变更操作) + * @param params + */ +export const userQuitAgent = (params) => { + return defHttp.put({ url: Api.userQuitAgent, params }); +}; + +/** + * 用户离职列表 + * @param params + */ +export const getQuitList = (params) => { + return defHttp.get({ url: Api.getQuitList, params }); +}; + +/** + * 取消离职 + * @param params + */ +export const putCancelQuit = (params, handleSuccess) => { + return defHttp.put({ url: Api.putCancelQuit, params }, { joinParamsToUrl: true }).then(() => { + handleSuccess(); + }); +}; + +/** + * 待审批获取列表数据 + */ +export const getUserTenantPageList = (params)=>{ + return defHttp.get({url:Api.getUserTenantPageList,params}) +} + +/** + * 更新租户状态 + * @param params + */ +export const updateUserTenantStatus = (params)=>{ + return defHttp.put({ url: Api.updateUserTenantStatus, params }, { joinParamsToUrl: true,isTransformResponse: false }); +} diff --git a/jeecgboot-vue3-master/src/views/system/userTEA/userZJ.data.ts b/jeecgboot-vue3-master/src/views/system/userTEA/userZJ.data.ts new file mode 100644 index 00000000..a58ea02d --- /dev/null +++ b/jeecgboot-vue3-master/src/views/system/userTEA/userZJ.data.ts @@ -0,0 +1,771 @@ +import { BasicColumn } from '/src/components/Table'; +import { FormSchema } from '/src/components/Table'; +import { getAllRolesListNoByTenant,getAllRolesListNoByExcludeTenant, getAllTenantList } from './userZJ.api'; +import { rules } from '/src/utils/helper/validator'; +import { render } from '/src/utils/common/renderUtils'; +export const columns: BasicColumn[] = [ + { + title: '用户账号', + dataIndex: 'username', + width: 120, + }, + { + title: '用户姓名', + dataIndex: 'realname', + width: 100, + }, + { + title: '头像', + dataIndex: 'avatar', + width: 120, + customRender: render.renderAvatar, + }, + /* { + title: '性别', + dataIndex: 'sex', + width: 80, + sorter: true, + customRender: ({ text }) => { + return render.renderDict(text, 'sex'); + }, + }, + { + title: '生日', + dataIndex: 'birthday', + width: 100, + },*/ + { + title: '手机号', + dataIndex: 'phone', + width: 100, + }, + { + title: '部门', + width: 150, + dataIndex: 'orgCodeTxt', + }, + { + title: '负责部门', + width: 150, + dataIndex: 'departIds_dictText', + }, + { + title: '状态', + dataIndex: 'status_dictText', + width: 80, + }, +]; + +export const recycleColumns: BasicColumn[] = [ + { + title: '用户账号', + dataIndex: 'username', + width: 100, + }, + { + title: '用户姓名', + dataIndex: 'realname', + width: 100, + }, + { + title: '头像', + dataIndex: 'avatar', + width: 80, + customRender: render.renderAvatar, + }, + { + title: '性别', + dataIndex: 'sex', + width: 80, + sorter: true, + customRender: ({ text }) => { + return render.renderDict(text, 'sex'); + }, + }, +]; + +export const searchFormSchema: FormSchema[] = [ + { + label: '账号', + field: 'username', + component: 'JInput', + colProps: { span: 6 }, + }, + { + label: '名字', + field: 'realname', + component: 'JInput', + colProps: { span: 6 }, + }, + { + label: '性别', + field: 'sex', + component: 'JDictSelectTag', + componentProps: { + dictCode: 'sex', + placeholder: '请选择性别', + stringToNumber: true, + }, + colProps: { span: 6 }, + }, + { + label: '手机号码', + field: 'phone', + component: 'Input', + colProps: { span: 6 }, + }, + { + label: '用户状态', + field: 'status', + component: 'JDictSelectTag', + componentProps: { + dictCode: 'user_status', + placeholder: '请选择状态', + stringToNumber: true, + }, + colProps: { span: 6 }, + }, +]; +export const formSchemaZJ: FormSchema[] = [ + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, + { + label: '专家账号', + field: 'username', + component: 'Input', + dynamicDisabled: ({ values }) => { + return !!values.id; + }, + dynamicRules: ({ model, schema }) => rules.duplicateCheckRule('sys_user', 'username', model, schema, true), + }, + { + label: '登录密码', + field: 'password', + component: 'StrengthMeter', + rules: [ + { + required: true, + message: '请输入登录密码', + }, + ], + }, + { + label: '确认密码', + field: 'confirmPassword', + component: 'InputPassword', + dynamicRules: ({ values }) => rules.confirmPassword(values, true), + }, + { + label: '用户姓名', + field: 'realname', + required: true, + component: 'Input', + }, + { + label: '工号', + field: 'workNo', + required: true, + component: 'Input', + dynamicRules: ({ model, schema }) => rules.duplicateCheckRule('sys_user', 'work_no', model, schema, true), + }, + /*{ + label: '职务', + field: 'post', + required: false, + component: 'JSelectPosition', + componentProps: { + rowKey: 'code', + labelKey: 'name', + }, + },*/ + { + label: '角色', + field: 'selectedroles', + component: 'ApiSelect', + componentProps: { + api: getAllRolesListNoByExcludeTenant, + labelField: 'roleName', + valueField: 'id', + }, + }, + { + label: '所属部门', + field: 'selecteddeparts', + component: 'JSelectDept', + componentProps: ({ formActionType, formModel }) => { + return { + sync: false, + checkStrictly: true, + defaultExpandLevel: 2, + + onSelect: (options, values) => { + const { updateSchema } = formActionType; + //所属部门修改后更新负责部门下拉框数据 + updateSchema([ + { + field: 'departIds', + componentProps: { options }, + }, + ]); + //所属部门修改后更新负责部门数据 + formModel.departIds && (formModel.departIds = formModel.departIds.filter((item) => values.value.indexOf(item) > -1)); + }, + }; + }, + }, + /*{ + label: '租户', + field: 'relTenantIds', + component: 'ApiSelect', + componentProps: { + mode: 'multiple', + api: getAllTenantList, + numberToString: true, + labelField: 'name', + valueField: 'id', + }, + },*/ + /*{ + label: '身份', + field: 'userIdentity', + component: 'RadioGroup', + defaultValue: 1, + componentProps: ({ formModel }) => { + return { + options: [ + { label: '普通用户', value: 1, key: '1' }, + { label: '上级', value: 2, key: '2' }, + ], + onChange: () => { + formModel.userIdentity == 1 && (formModel.departIds = []); + }, + }; + }, + },*/ + /* { + label: '负责部门', + field: 'departIds', + component: 'Select', + componentProps: { + mode: 'multiple', + }, + ifShow: ({ values }) => values.userIdentity == 2, + },*/ + { + label: '头像', + field: 'avatar', + component: 'JImageUpload', + componentProps: { + fileMax: 1, + }, + }, + { + label: '生日', + field: 'birthday', + component: 'DatePicker', + }, + { + label: '性别', + field: 'sex', + component: 'JDictSelectTag', + componentProps: { + dictCode: 'sex', + placeholder: '请选择性别', + stringToNumber: true, + }, + }, + { + label: '邮箱', + field: 'email', + component: 'Input', + }, + { + label: '手机号码', + field: 'phone', + component: 'Input', + }, + /*{ + label: '座机', + field: 'telephone', + component: 'Input', + rules: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' }], + }, + { + label: '工作流引擎', + field: 'activitiSync', + defaultValue: 1, + component: 'JDictSelectTag', + componentProps: { + dictCode: 'activiti_sync', + type: 'radio', + stringToNumber: true, + }, + },*/ + { + label: '专家毕业院校', + field: 'expSc', + component: 'Input', + }, + { + label: '专家履历', + field: 'expResume', + component: 'InputTextArea', + }, + { + label: '专家学历', + field: 'expTitle', + component: 'Input', + }, + { + label: '比赛', + field: 'compid', + component: 'Input', + show: false, + }, + { + label: '比赛名称', + field: 'compName', + component: 'JPopup', + componentProps: ({ formActionType }) => { + const {setFieldsValue} = formActionType; + return{ + setFieldsValue:setFieldsValue, + code:"comp_select", + fieldConfig: [ + { source: 'id', target: 'compid' }, + { source: 'comp_name', target: 'compName' }, + ], + multi:true + } + }, + }, + { + label: '状态', + field: 'stat', + component: 'JSwitch', + componentProps:{ + }, + }, +]; + +export const formSchema: FormSchema[] = [ + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, + { + label: '用户账号', + field: 'username', + component: 'Input', + dynamicDisabled: ({ values }) => { + return !!values.id; + }, + dynamicRules: ({ model, schema }) => rules.duplicateCheckRule('sys_user', 'username', model, schema, true), + }, + { + label: '登录密码', + field: 'password', + component: 'StrengthMeter', + rules: [ + { + required: true, + message: '请输入登录密码', + }, + ], + }, + { + label: '确认密码', + field: 'confirmPassword', + component: 'InputPassword', + dynamicRules: ({ values }) => rules.confirmPassword(values, true), + }, + { + label: '用户姓名', + field: 'realname', + required: true, + component: 'Input', + }, + { + label: '工号', + field: 'workNo', + required: true, + component: 'Input', + dynamicRules: ({ model, schema }) => rules.duplicateCheckRule('sys_user', 'work_no', model, schema, true), + }, + { + label: '职务', + field: 'post', + required: false, + component: 'JSelectPosition', + componentProps: { + rowKey: 'code', + labelKey: 'name', + }, + }, + { + label: '角色', + field: 'selectedroles', + component: 'ApiSelect', + componentProps: { + mode: 'multiple', + api: getAllRolesListNoByTenant, + labelField: 'roleName', + valueField: 'id', + }, + }, + { + label: '所属部门', + field: 'selecteddeparts', + component: 'JSelectDept', + componentProps: ({ formActionType, formModel }) => { + return { + sync: false, + checkStrictly: true, + defaultExpandLevel: 2, + + onSelect: (options, values) => { + const { updateSchema } = formActionType; + //所属部门修改后更新负责部门下拉框数据 + updateSchema([ + { + field: 'departIds', + componentProps: { options }, + }, + ]); + //所属部门修改后更新负责部门数据 + formModel.departIds && (formModel.departIds = formModel.departIds.filter((item) => values.value.indexOf(item) > -1)); + }, + }; + }, + }, + { + label: '租户', + field: 'relTenantIds', + component: 'ApiSelect', + componentProps: { + mode: 'multiple', + api: getAllTenantList, + numberToString: true, + labelField: 'name', + valueField: 'id', + }, + }, + { + label: '身份', + field: 'userIdentity', + component: 'RadioGroup', + defaultValue: 1, + componentProps: ({ formModel }) => { + return { + options: [ + { label: '普通用户', value: 1, key: '1' }, + { label: '上级', value: 2, key: '2' }, + ], + onChange: () => { + formModel.userIdentity == 1 && (formModel.departIds = []); + }, + }; + }, + }, + { + label: '负责部门', + field: 'departIds', + component: 'Select', + componentProps: { + mode: 'multiple', + }, + ifShow: ({ values }) => values.userIdentity == 2, + }, + { + label: '头像', + field: 'avatar', + component: 'JImageUpload', + componentProps: { + fileMax: 1, + }, + }, + { + label: '生日', + field: 'birthday', + component: 'DatePicker', + }, + { + label: '性别', + field: 'sex', + component: 'JDictSelectTag', + componentProps: { + dictCode: 'sex', + placeholder: '请选择性别', + stringToNumber: true, + }, + }, + { + label: '邮箱', + field: 'email', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [ + { ...rules.duplicateCheckRule('sys_user', 'email', model, schema, true)[0] }, + { ...rules.rule('email', false)[0] }, + ]; + }, + }, + { + label: '手机号码', + field: 'phone', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [ + { ...rules.duplicateCheckRule('sys_user', 'phone', model, schema, true)[0] }, + { pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误' }, + ]; + }, + }, + { + label: '座机', + field: 'telephone', + component: 'Input', + rules: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' }], + }, + // { + // label: '工作流引擎', + // field: 'activitiSync', + // defaultValue: 1, + // component: 'JDictSelectTag', + // componentProps: { + // dictCode: 'activiti_sync', + // type: 'radio', + // stringToNumber: true, + // }, + // }, +]; + +export const formPasswordSchema: FormSchema[] = [ + { + label: '用户账号', + field: 'username', + component: 'Input', + componentProps: { readOnly: true }, + }, + { + label: '登录密码', + field: 'password', + component: 'StrengthMeter', + componentProps: { + placeholder: '请输入登录密码', + }, + rules: [ + { + required: true, + message: '请输入登录密码', + }, + ], + }, + { + label: '确认密码', + field: 'confirmPassword', + component: 'InputPassword', + dynamicRules: ({ values }) => rules.confirmPassword(values, true), + }, +]; + +export const formAgentSchema: FormSchema[] = [ + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, + { + field: 'userName', + label: '用户名', + component: 'Input', + componentProps: { + readOnly: true, + allowClear: false, + }, + }, + { + field: 'agentUserName', + label: '代理人用户名', + required: true, + component: 'JSelectUser', + componentProps: { + rowKey: 'username', + labelKey: 'realname', + maxSelectCount: 10, + }, + }, + { + field: 'startTime', + label: '代理开始时间', + component: 'DatePicker', + required: true, + componentProps: { + showTime: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss', + placeholder: '请选择代理开始时间', + }, + }, + { + field: 'endTime', + label: '代理结束时间', + component: 'DatePicker', + required: true, + componentProps: { + showTime: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss', + placeholder: '请选择代理结束时间', + }, + }, + { + field: 'status', + label: '状态', + component: 'JDictSelectTag', + defaultValue: '1', + componentProps: { + dictCode: 'valid_status', + type: 'radioButton', + }, + }, +]; + +export const formQuitAgentSchema: FormSchema[] = [ + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, + { + field: 'userName', + label: '用户名', + component: 'Input', + componentProps: { + readOnly: true, + allowClear: false, + }, + }, + { + field: 'agentUserName', + label: '交接人员', + required: true, + component: 'JSelectUser', + componentProps: { + rowKey: 'username', + labelKey: 'realname', + maxSelectCount: 1, + }, + }, + { + field: 'startTime', + label: '交接开始时间', + component: 'DatePicker', + required: true, + componentProps: { + showTime: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss', + placeholder: '请选择交接开始时间', + getPopupContainer: () => document.body, + }, + }, + { + field: 'endTime', + label: '交接结束时间', + component: 'DatePicker', + required: true, + componentProps: { + showTime: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss', + placeholder: '请选择交接结束时间', + getPopupContainer: () => document.body, + }, + }, + { + field: 'status', + label: '状态', + component: 'JDictSelectTag', + defaultValue: '1', + componentProps: { + dictCode: 'valid_status', + type: 'radioButton', + }, + }, +]; + +//租户用户列表 +export const userTenantColumns: BasicColumn[] = [ + { + title: '用户账号', + dataIndex: 'username', + width: 120, + }, + { + title: '用户姓名', + dataIndex: 'realname', + width: 100, + }, + { + title: '头像', + dataIndex: 'avatar', + width: 120, + customRender: render.renderAvatar, + }, + { + title: '手机号', + dataIndex: 'phone', + width: 100, + }, + { + title: '部门', + width: 150, + dataIndex: 'orgCodeTxt', + }, + { + title: '状态', + dataIndex: 'status', + width: 80, + customRender: ({ text }) => { + if (text === '1') { + return '正常'; + } else if (text === '3') { + return '审批中'; + } else { + return '已拒绝'; + } + }, + }, +]; + +//用户租户搜索表单 +export const userTenantFormSchema: FormSchema[] = [ + { + label: '账号', + field: 'username', + component: 'Input', + colProps: { span: 6 }, + }, + { + label: '名字', + field: 'realname', + component: 'Input', + colProps: { span: 6 }, + }, + { + label: '性别', + field: 'sex', + component: 'JDictSelectTag', + componentProps: { + dictCode: 'sex', + placeholder: '请选择性别', + stringToNumber: true, + }, + colProps: { span: 6 }, + }, +];