| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import jodd.util.StringUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import net.sf.ehcache.constructs.scheduledrefresh.OverseerJob; |
| | | import org.apache.ibatis.session.SqlSession; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @RestController |
| | | @RequestMapping("/hosp/project") |
| | | @Api(tags = "体检项目管理") |
| | | @Slf4j |
| | | public class TjProjectController extends BaseController { |
| | | @Resource |
| | | private ITjProjectService tjProjectService; |
| | |
| | | LambdaQueryWrapper<TjPackageProject> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjPackageProject::getProId, tjProject.getProId()); |
| | | List<TjPackageProject> list1 = ppservice.list(wq1); |
| | | if (null != list1 && list1.size() > 0) { |
| | | if (null != list1 && !list1.isEmpty()) { |
| | | return AjaxResult.error("该项目正在套餐中使用,暂时不能停用"); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | List<TjProject> list = tjProjectService.getTjProjectListBySoneId(String.valueOf(tjProject.getProId())); |
| | | if (null != list && list.size() > 0) { |
| | | if (null != list && !list.isEmpty()) { |
| | | for (TjProject project : list) { |
| | | project.setDeptId(tjProject.getDeptId()); |
| | | project.setProType(tjProject.getProType()); |
| | |
| | | } |
| | | } |
| | | List<TjConsumables> consumablesList = tjProject.getConsumablesList(); |
| | | if (null != consumablesList && consumablesList.size() > 0) { |
| | | if (null != consumablesList && !consumablesList.isEmpty()) { |
| | | LambdaQueryWrapper<TjProConsumables> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjProConsumables::getProId, tjProject.getProId()); |
| | | proConsumablesService.remove(wq); |
| | |
| | | } |
| | | } |
| | | List<TjStandard> tjStandardList = tjProject.getTjStandardList(); |
| | | if (null != tjStandardList && tjStandardList.size() > 0) { |
| | | if (null != tjStandardList && !tjStandardList.isEmpty()) { |
| | | for (TjStandard tjStandard : tjStandardList) { |
| | | if (null == tjStandard.getTjSex()) { |
| | | tjStandard.setTjSex(null); |
| | |
| | | if (null != proParentId) { |
| | | LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjProject::getProParentId, proParentId); |
| | | List<TjProject> projectList = tjProjectService.list(wq); |
| | | if (null != projectList && projectList.size() > 0) { |
| | | wq.eq(TjProject::getProStatus,0); |
| | | // List<TjProject> projectList = tjProjectService.list(wq); |
| | | List<TjProject> projectList = tjProjectService.getTjProjectListBySoneId(String.valueOf(proParentId)); |
| | | if (null != projectList && !projectList.isEmpty()) { |
| | | BigDecimal bigDecimal = new BigDecimal("0.00"); |
| | | for (TjProject project : projectList) { |
| | | bigDecimal = bigDecimal.add(project.getProPrice()); |
| | |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/plxgpym") |
| | | @ApiOperation(value = "批量修改拼音码") |
| | | public AjaxResult plxgpym(@RequestParam String tbname,@RequestParam String zd,@RequestParam String pymzd) { |
| | | String sql="SELECT 1"; |
| | | try { |
| | | sql="SELECT "+ zd +","+ pymzd +" FROM "+tbname; |
| | | |
| | | List<Map<String,Object>> projectList = tjProjectService.zdysqlcx(sql); |
| | | if(null !=projectList && !projectList.isEmpty()){ |
| | | for (Map<String, Object> map : projectList) { |
| | | Object zd1 = map.get(zd); |
| | | if(null !=zd1 && StringUtil.isNotBlank(zd1.toString())){ |
| | | String letter = PinyinUtil.getFirstLetter(zd1.toString(), ""); |
| | | sql="UPDATE "+ tbname +" "+ " set " +pymzd+" = "+ "'" +letter+"'"+" where "+zd+" = "+"'"+zd1+"'" ; |
| | | tjProjectService.zdysqlxg(sql); |
| | | } |
| | | } |
| | | } |
| | | return AjaxResult.success(projectList); |
| | | } catch (Exception e) { |
| | | log.info("sql查询失败"+ sql); |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |