| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.hutool.extra.pinyin.PinyinUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ltkj.common.core.domain.entity.SysDept; |
| | | import com.ltkj.common.core.redis.RedisCache; |
| | |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ltkj.common.annotation.Log; |
| | | import com.ltkj.common.core.controller.BaseController; |
| | |
| | | */ |
| | | @GetMapping("/getDxList") |
| | | @ApiOperation(value = "选择体检项目选单项时调用的接口") |
| | | public AjaxResult getDxList() { |
| | | // LambdaQueryWrapper<TjProject> wq0 = new LambdaQueryWrapper<>(); |
| | | // wq0.eq(TjProject::getProParentId, 0); |
| | | List<TjProject> tjProjects = tjProjectService.getDxTjProjectList(); |
| | | public AjaxResult getDxList(@RequestParam(required = false) String pname) { |
| | | List<TjProject> tjProjects = tjProjectService.getDxTjProjectList(pname); |
| | | String config = configService.selectConfigByKey("tj_dxsxtj"); |
| | | if(null !=config && config.equals("N")){ |
| | | tjProjects = tjProjectService.getOpenDxTjProjectList(); |
| | | if (null != config && config.equals("N")) { |
| | | tjProjects = tjProjectService.getOpenDxTjProjectList(pname); |
| | | } |
| | | //上面的换sql |
| | | // final List<TjProject> tjProjects = tjProjectService.getProBySqlAndName(proName, checkType, deptId); |
| | | |
| | | if (tjProjects != null) { |
| | | for (TjProject project : tjProjects) { |
| | | List<TjProject> projectList = tjProjectService.getTjProjectListBySoneId(String.valueOf(project.getProId())); |
| | | project.setTjProjectList(projectList); |
| | | |
| | | // SysDept sysDept = deptService.selectDeptById(project.getDeptId()); |
| | | // if (sysDept!=null){ |
| | | // project.setDeptName(sysDept.getDeptName()); |
| | | // } |
| | | } |
| | | } |
| | | String key = configService.selectConfigByKey("is_open_sfxm"); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("list",tjProjects); |
| | | map.put("key",key); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("list", tjProjects); |
| | | map.put("key", key); |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/getAllChildListById") |
| | | @ApiOperation(value = "查询项目子项") |
| | | public AjaxResult getAllChildListById(@RequestParam(required = false)String proId, |
| | | public AjaxResult getAllChildListById(@RequestParam(required = false) String proId, |
| | | @RequestParam(required = false) String proName, |
| | | @RequestParam(required = false) String checkType) { |
| | | LambdaQueryWrapper<TjProject> wq=new LambdaQueryWrapper<>(); |
| | | if (proId!=null){ |
| | | wq.eq(TjProject::getProParentId,proId); |
| | | LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | if (proId != null) { |
| | | wq.eq(TjProject::getProParentId, proId); |
| | | } |
| | | if (proName!=null){ |
| | | wq.like(TjProject::getProName,proName); |
| | | if (proName != null) { |
| | | wq.like(TjProject::getProName, proName); |
| | | } |
| | | if (checkType!=null){ |
| | | wq.eq(TjProject::getProCheckType,checkType); |
| | | if (checkType != null) { |
| | | wq.eq(TjProject::getProCheckType, checkType); |
| | | } |
| | | List<TjProject> tjProjects = tjProjectService.list(wq); |
| | | // List<TjProject> tjProjects = tjProjectService.getAllChildListById(proId); |
| | |
| | | List<TjProject> tjProjects = tjProjectService.list(wq); |
| | | return AjaxResult.success(tjProjects); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | if (null != tjProject.getTjStandardList() && tjProject.getTjStandardList().size() > 0) { |
| | | tjProject.setProStandard(1); |
| | | } |
| | | tjProject.setProEngName(PinyinUtil.getFirstLetter(tjProject.getProName(),"")); |
| | | if (tjProjectService.save(tjProject)) { |
| | | if (null != tjProject.getSfxmId()) { |
| | | DictProSfxm proSfxm = new DictProSfxm(); |
| | |
| | | return AjaxResult.error("该项目正在套餐中使用,暂时不能停用"); |
| | | } |
| | | } |
| | | tjProject.setProEngName(PinyinUtil.getFirstLetter(tjProject.getProName(),"")); |
| | | if (tjProject.getProParentId() == 0) { |
| | | if (tjProjectService.updateById(tjProject)) { |
| | | if (dictProSfxmService.deletedProSfxm(tjProject.getProId())) { |
| | |
| | | @Log(title = "体检项目", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{proIds}") |
| | | @ApiOperation(value = "删除体检项目(可删除父项目和子项目)") |
| | | @Transactional |
| | | public AjaxResult remove(@PathVariable Long[] proIds) { |
| | | if (null == proIds || proIds.length <= 0) { |
| | | return AjaxResult.error("请选择要删除的项目"); |
| | |
| | | wq.eq(TjStandard::getProId, proId); |
| | | tjStandardService.remove(wq); |
| | | tjProjectService.removeById(project1.getProId()); |
| | | TjProject project = tjProjectService.getById(project1.getProParentId()); |
| | | project.setProPrice(tjProjectService.getMoneys(project1.getProParentId().toString())); |
| | | tjProjectService.updateById(project); |
| | | } |
| | | } |
| | | } |
| | |
| | | TjProject tjProject = tjProjectService.getById(proId); |
| | | return AjaxResult.success(tjProject); |
| | | } |
| | | // /** |
| | | // * 获取部门树列表 |
| | | // */ |
| | | // @GetMapping("/deptTree") |
| | | // @ApiOperation("获取部门树列表") |
| | | // public AjaxResult deptTree(SysDept dept) { |
| | | // return success(deptService.selectDeptTreeList(dept)); |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 选择体检项目选单项时调用的接口 |
| | | */ |
| | | @GetMapping("/getProParentIdDxList") |
| | | @ApiOperation(value = "选择体检项目(所有服项目)选单项时调用的接口") |
| | | public AjaxResult getProParentIdDxList(@RequestParam(required = false) String pname) { |
| | | List<TjProject> tjProjects = tjProjectService.getDxTjProjectList(pname); |
| | | String config = configService.selectConfigByKey("tj_dxsxtj"); |
| | | if (null != config && config.equals("N")) { |
| | | tjProjects = tjProjectService.getOpenDxTjProjectList(pname); |
| | | } |
| | | String key = configService.selectConfigByKey("is_open_sfxm"); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("list", tjProjects); |
| | | map.put("key", key); |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | @GetMapping("/getProSonDxList") |
| | | @ApiOperation(value = "选择体检项目(根据父项id选择子项)选单项时调用的接口") |
| | | public AjaxResult getProSonDxList(@RequestParam String proId) { |
| | | List<TjProject> projectList = tjProjectService.getTjProjectListBySoneId(proId); |
| | | String key = configService.selectConfigByKey("is_open_sfxm"); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("list", projectList); |
| | | map.put("key", key); |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | } |