| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |