10 files modified
1 files added
| | |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入notice") |
| | | public R submit(@RequestBody Notice notice) throws Exception { |
| | | //调用内网 |
| | | arg.test01(arg.url+"/blade-desk/notice/submit",notice); |
| | | return R.status(noticeService.saveOrUpdate(notice)); |
| | | } |
| | | |
| | |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入notice") |
| | | public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) throws Exception { |
| | | //调用内网 |
| | | // arg.test01(arg.url+"/blade-desk/notice/remove",ids); |
| | | boolean temp = noticeService.deleteLogic(Func.toLongList(ids)); |
| | | return R.status(temp); |
| | | } |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | int i = stb.lastIndexOf(","); |
| | | |
| | | return stb.substring(0, i) + "}"; |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | attach.setDeptid(deptid); |
| | | attach.setType(type); |
| | | attachService.save(attach); |
| | | arg.test01(arg.url+"/blade-resource/attach/save",attach); |
| | | // arg.test01(arg.url+"/blade-resource/attach/save",attach); |
| | | return attach.getId(); |
| | | } |
| | | |
| | |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.modules.system.entity.DictBiz; |
| | | import org.springblade.modules.system.node.TreeNode; |
| | | import org.springblade.modules.system.service.IDictBizService; |
| | | import org.springblade.modules.system.vo.DictBizVO; |
| | | import org.springblade.modules.system.wrapper.DictBizWrapper; |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取字典树 |
| | | */ |
| | | @GetMapping("/dic-tree") |
| | | public List<TreeNode> dicTree() { |
| | | return dictService.getTree(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | package org.springblade.modules.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.SqlParser; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.MapKey; |
| | | import org.springblade.modules.system.entity.DictBiz; |
| | | import org.springblade.modules.system.node.TreeNode; |
| | | import org.springblade.modules.system.vo.DictBizVO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Mapper 接口 |
| | |
| | | */ |
| | | List<DictBizVO> parentTree(); |
| | | |
| | | /** |
| | | * 获取字典树,list |
| | | */ |
| | | @SqlParser(filter=true) |
| | | List<TreeNode> getDicTreeList(); |
| | | |
| | | /** |
| | | * 获取字典树,map |
| | | */ |
| | | @MapKey(value = "id") |
| | | @SqlParser(filter=true) |
| | | Map<Long, TreeNode> getDicTreeMap(); |
| | | } |
| | |
| | | select id, parent_id, dict_value as title, id as "value", id as "key" from blade_dict_biz where is_deleted = 0 and parent_id = 0 |
| | | </select> |
| | | |
| | | <!--getDicTree list--> |
| | | <select id="getDicTreeList" resultType="org.springblade.modules.system.node.TreeNode"> |
| | | select |
| | | bdb.id, |
| | | bdb.dict_value as name, |
| | | bdb.parent_id parentId, |
| | | exists( |
| | | select 1 from blade_dict_biz bdb1 |
| | | where bdb1.parent_id = bdb.id and bdb1.is_sealed = 0 and bdb1.is_deleted = 0 |
| | | ) as hasChildren |
| | | from |
| | | blade_dict_biz bdb |
| | | </select> |
| | | |
| | | <!--getDicTree map--> |
| | | <select id="getDicTreeMap" resultType="org.springblade.modules.system.node.TreeNode"> |
| | | select |
| | | bdb.id, |
| | | bdb.dict_value as name, |
| | | bdb.parent_id parentId, |
| | | exists( |
| | | select 1 from blade_dict_biz bdb1 |
| | | where bdb1.parent_id = bdb.id and bdb1.is_sealed = 0 and bdb1.is_deleted = 0 |
| | | ) as hasChildren |
| | | from |
| | | blade_dict_biz bdb |
| | | where |
| | | 1=1 |
| | | |
| | | and bdb.parent_id = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package org.springblade.modules.system.node; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | | */ |
| | | @Data |
| | | public class TreeNode { |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | private Long id; |
| | | |
| | | /** |
| | | * 父id |
| | | */ |
| | | private Long parentId; |
| | | |
| | | /** |
| | | * 树节点名称 |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 子节点 |
| | | */ |
| | | private List<TreeNode> children = new ArrayList<>(); |
| | | |
| | | /** |
| | | * 是否有子节点 |
| | | */ |
| | | private Boolean hasChildren; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.modules.system.entity.DictBiz; |
| | | import org.springblade.modules.system.node.TreeNode; |
| | | import org.springblade.modules.system.vo.DictBizVO; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | List<DictBizVO> childList(Map<String, Object> dict, Long parentId); |
| | | |
| | | /** |
| | | * 获取字典树 |
| | | */ |
| | | List<TreeNode> getTree(); |
| | | } |
| | |
| | | import org.springblade.core.tool.utils.StringPool; |
| | | import org.springblade.modules.system.entity.DictBiz; |
| | | import org.springblade.modules.system.mapper.DictBizMapper; |
| | | import org.springblade.modules.system.node.TreeNode; |
| | | import org.springblade.modules.system.service.IDictBizService; |
| | | import org.springblade.modules.system.vo.DictBizVO; |
| | | import org.springblade.modules.system.wrapper.DictBizWrapper; |
| | |
| | | List<DictBiz> list = this.list(Condition.getQueryWrapper(dict, DictBiz.class).lambda().ne(DictBiz::getId, parentId).eq(DictBiz::getCode, parentDict.getCode()).orderByAsc(DictBiz::getSort)); |
| | | return DictBizWrapper.build().listNodeVO(list); |
| | | } |
| | | |
| | | /** |
| | | * 获取字典树 |
| | | */ |
| | | @Override |
| | | public List<TreeNode> getTree() { |
| | | // List<TreeNode> dicTreeList = baseMapper.getDicTreeList(); |
| | | Map<Long,TreeNode> map = baseMapper.getDicTreeMap(); |
| | | List<TreeNode> tree = new ArrayList<>(); |
| | | map.forEach((id,treeNode) ->{ |
| | | if (map.containsKey(treeNode.getParentId())){ |
| | | map.get(treeNode.getParentId()).getChildren().add(treeNode); |
| | | }else { |
| | | tree.add(treeNode); |
| | | } |
| | | }); |
| | | return tree; |
| | | } |
| | | } |
| | |
| | | @PostMapping("/save") |
| | | @ApiOperation(value = "新增", notes = "传入trainExam") |
| | | public R save(@RequestBody TrainExam trainExam) throws Exception { |
| | | arg.test01(arg.url+"/trainExam/save",trainExam); |
| | | return R.status(trainExamService.save(trainExam)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody TrainExam trainExam) throws Exception { |
| | | arg.test01(arg.url+"/trainExam/update",trainExam); |
| | | return R.status(trainExamService.updateById(trainExam)); |
| | | } |
| | | |
| | |
| | | @PostMapping("/update-audit") |
| | | public R updateAudit(@RequestBody TrainExam trainExam) throws Exception { |
| | | trainExam.setAuditTime(new Date()); |
| | | //内网数据同步 |
| | | arg.test01(arg.url+"/trainExam/update-audit",trainExam); |
| | | //审核通过,插入一条考试信息 |
| | | if (trainExam.getAuditStatus()==1){ |
| | | //查询考试申请 |
| | |
| | | trainExam.setCreateTime(new Date()); |
| | | trainExam.setAuditStatus(3); |
| | | } |
| | | arg.test01(arg.url+"/trainExam/submit",trainExam); |
| | | return R.status(trainExamService.saveOrUpdate(trainExam)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/remove") |
| | | public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { |
| | | arg.sendPostRemoveByIds(arg.url+"/trainExam/remove",ids); |
| | | return R.status(trainExamService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody TrainingRegistration trainingRegistration) throws Exception { |
| | | arg.test01(arg.url+"/trainingRegistration/update",trainingRegistration); |
| | | return R.status(trainingRegistrationService.updateById(trainingRegistration)); |
| | | } |
| | | |
| | |
| | | trainingRegistration.setTrainingTime(new Date()); |
| | | trainingRegistration.setCancel(1); |
| | | //默认报名未考试状态 |
| | | trainingRegistration.setIsExam(1); |
| | | // trainingRegistration.setIsExam(1); |
| | | //去生成准考证号码 |
| | | trainingRegistration.setCandidateNo(getCandidateNo(trainingRegistration)); |
| | | // trainingRegistration.setCandidateNo(getCandidateNo(trainingRegistration)); |
| | | //去生成考试编号 |
| | | // trainingRegistration.setApplyCode(getApplyCode(trainingRegistration)); |
| | | } |
| | | // arg.test01(arg.url+"/trainingRegistration/submit",trainingRegistration); |
| | | boolean status = trainingRegistrationService.saveOrUpdate(trainingRegistration); |
| | | if (status){ |
| | | return R.data(200,"报名成功"); |
| | |
| | | */ |
| | | @PostMapping("/remove") |
| | | public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { |
| | | arg.sendPostRemoveByIds(arg.url+"/trainingRegistration/remove",ids); |
| | | return R.status(trainingRegistrationService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |