Merge branch 'master' of http://192.168.0.105:10010/r/zhba_management_w
Conflicts:
src/main/java/org/springblade/modules/desk/controller/NoticeController.java
src/main/java/org/springblade/modules/information/controller/InformationController.java
src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java
src/main/java/org/springblade/modules/training/controller/TrainExamController.java
src/main/java/org/springblade/modules/training/controller/TrainingRegistrationController.java
14 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); |
| | | } |
| | |
| | | List<Map<Object,Object>> selectDis(String deptid); |
| | | List<Map<Object,Object>> selectDisp(String deptid); |
| | | List<Map<Object,Object>> selectSoil(String deptid); |
| | | |
| | | /** |
| | | * 查询培训单位信息(可以报名) |
| | | * @param page |
| | | * @param information 保安单位信息对象 |
| | | * @return |
| | | */ |
| | | List<InformationVO> securityPage(IPage<InformationVO> page, @Param("information") InformationVO information); |
| | | } |
| | |
| | | LEFT JOIN (SELECT COUNT(*) AS numz, dept_id FROM blade_user GROUP BY dept_id) B ON A.deptid = B.dept_id |
| | | WHERE A.deptid = #{deptid} |
| | | </select> |
| | | |
| | | <!--查询培训单位信息(可以报名)--> |
| | | <select id="securityPage" resultType="org.springblade.modules.information.vo.InformationVO"> |
| | | select |
| | | si.*,bd.dept_name deptName |
| | | from |
| | | sys_information si |
| | | left join |
| | | blade_dept bd |
| | | on |
| | | si.departmentid = bd.id |
| | | left join |
| | | sys_train_exam ste |
| | | on |
| | | ste.dept_id = bd.id |
| | | where 1=1 |
| | | and ste.audit_status = 1 |
| | | <if test="information.deptName!=null and information.deptName!=''"> |
| | | and bd.dept_name like concat(concat('%', #{information.deptName}),'%') |
| | | </if> |
| | | <if test="information.representative!=null and information.representative!=''"> |
| | | and representative like concat(concat('%', #{information.representative}),'%') |
| | | </if> |
| | | <if test="information.stats!=null and information.stats!=''"> |
| | | and stats=#{stats} |
| | | </if> |
| | | <if test="information.jurisdiction!=null and information.jurisdiction!=''"> |
| | | and si.jurisdiction=#{jurisdiction} |
| | | </if> |
| | | <if test="information.departmentid!=null and information.departmentid!=''"> |
| | | and departmentid=#{departmentid} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | List<Map<Object,Object>> selectDis(String deptid); |
| | | List<Map<Object,Object>> selectDisp(String deptid); |
| | | List<Map<Object,Object>> selectSoil(String deptid); |
| | | |
| | | /** |
| | | * 查询培训单位信息(可以报名) |
| | | * @param page |
| | | * @param information 保安单位信息对象 |
| | | * @return |
| | | */ |
| | | IPage<InformationVO> securityPage(IPage<InformationVO> page, InformationVO information); |
| | | } |
| | |
| | | return baseMapper.selectSoil(deptid); |
| | | } |
| | | |
| | | /** |
| | | * 查询培训单位信息(可以报名) |
| | | * @param page |
| | | * @param information 保安单位信息对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<InformationVO> securityPage(IPage<InformationVO> page, InformationVO information) { |
| | | return page.setRecords(baseMapper.securityPage(page, information)); |
| | | } |
| | | } |
| | |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "InformationVO对象", description = "InformationVO对象") |
| | | public class InformationVO extends Information { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 单位名称 |
| | | */ |
| | | private String deptName; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @PostMapping("put-file-app") |
| | | public R putFileApp(@RequestParam MultipartFile file) throws IOException, ServerException, InsufficientDataException, InternalException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, XmlParserException, ErrorResponseException { |
| | | //填写你文件上传的地址以及相应信息 |
| | | String url = "http://223.82.109.183:2081"; |
| | | String access = "zhbaadmin"; |
| | | String secret = "zhbapassword"; |
| | | String url = "http://192.168.0.109:9000"; |
| | | String access = "minioadmin"; |
| | | String secret = "minioadmin"; |
| | | String bucket = "zhba"; |
| | | MinioClient minioClient = |
| | | MinioClient.builder() |
| | |
| | | .headers(headers) |
| | | .build()); |
| | | in.close(); |
| | | String urls = "http://223.82.109.183:2081/zhba/" + newName; |
| | | String urls = "http://192.168.0.109:9000/zhba/" + newName; |
| | | return R.data(urls); |
| | | } |
| | | |
| | |
| | | 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))); |
| | | } |
| | | |