| | |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration; |
| | | |
| | | /** |
| | | * å¯å¨ç¨åº |
| | |
| | | * @author ruoyi |
| | | */ |
| | | //@SpringBootApplication(scanBasePackages="com.smartor",exclude = { DataSourceAutoConfiguration.class }) |
| | | @SpringBootApplication(scanBasePackages={"com.ruoyi","com.smartor"},exclude = { DataSourceAutoConfiguration.class }) |
| | | @SpringBootApplication(scanBasePackages = {"com.ruoyi", "com.smartor"}, exclude = {DataSourceAutoConfiguration.class, MultipartAutoConfiguration.class}) |
| | | @MapperScan(value="com.smartor.mapper") |
| | | public class RuoYiApplication |
| | | { |
| | | public static void main(String[] args) |
| | | { |
| | | public class RuoYiApplication { |
| | | public static void main(String[] args) { |
| | | // System.setProperty("spring.devtools.restart.enabled", "false"); |
| | | SpringApplication.run(RuoYiApplication.class, args); |
| | | System.out.println("(â¥â â¿â )ï¾ï¾ è¥ä¾å¯å¨æå á(´ڡ`á)ï¾ \n" + |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import com.google.zxing.BarcodeFormat; |
| | | import com.google.zxing.WriterException; |
| | | import com.google.zxing.client.j2se.MatrixToImageWriter; |
| | | import com.google.zxing.common.BitMatrix; |
| | | import com.google.zxing.qrcode.QRCodeWriter; |
| | | import com.smartor.domain.Question; |
| | | import freemarker.template.Configuration; |
| | | import freemarker.template.Template; |
| | | import freemarker.template.TemplateException; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.StringWriter; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Api(description = "é®å·äºç»´ç ") |
| | | @RestController |
| | | @RequestMapping("/qrcode") |
| | | public class QRCodeController { |
| | | |
| | | private final Configuration configuration; |
| | | |
| | | public QRCodeController(Configuration configuration) { |
| | | this.configuration = configuration; |
| | | } |
| | | |
| | | /** |
| | | * é®å·é¢ç® |
| | | * |
| | | * @param reqid é®å·ID |
| | | * userid ç¨æ·ID |
| | | * @return |
| | | * @throws IOException |
| | | * @throws TemplateException |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(value = "/generateStaticHtml/{reqid}/{userid}", produces = MediaType.TEXT_HTML_VALUE) |
| | | public String generateStaticHtml(@PathVariable("reqid") String reqid, @PathVariable("userid") String userid) throws IOException, TemplateException { |
| | | // å建Freemarkeré
ç½® |
| | | Configuration configuration = new Configuration(Configuration.VERSION_2_3_31); |
| | | configuration.setClassForTemplateLoading(SvyLibTitleController.class, "/template"); |
| | | configuration.setDefaultEncoding("UTF-8"); |
| | | |
| | | try { |
| | | // å è½½æ¨¡æ¿ |
| | | Template template = configuration.getTemplate("question.ftl"); |
| | | |
| | | // åå¤é¢ç®æ°æ® |
| | | List<Question> questions = new ArrayList<>(); |
| | | |
| | | // åéé¢ |
| | | List<String> singleChoiceOptions = new ArrayList<>(); |
| | | singleChoiceOptions.add("Option 1"); |
| | | singleChoiceOptions.add("Option 2"); |
| | | singleChoiceOptions.add("Option 3"); |
| | | Question singleChoiceQuestion = new Question("singleChoice", "åéé¢111", "åéé¢é¢ç®1ï¼", singleChoiceOptions); |
| | | |
| | | List<String> singleChoiceOptions2 = new ArrayList<>(); |
| | | singleChoiceOptions2.add("Option 4"); |
| | | singleChoiceOptions2.add("Option 5"); |
| | | singleChoiceOptions2.add("Option 6"); |
| | | Question singleChoiceQuestion2 = new Question("singleChoice", "åéé¢222", "åéé¢é¢ç®2ï¼", singleChoiceOptions2); |
| | | |
| | | questions.add(singleChoiceQuestion); |
| | | questions.add(singleChoiceQuestion2); |
| | | |
| | | // å¤éé¢ |
| | | List<String> multipleChoiceOptions = new ArrayList<>(); |
| | | multipleChoiceOptions.add("Option A"); |
| | | multipleChoiceOptions.add("Option B"); |
| | | multipleChoiceOptions.add("Option C"); |
| | | Question multipleChoiceQuestion = new Question("multipleChoice", "å¤éé¢1", "Question 2: Select multiple options", multipleChoiceOptions); |
| | | questions.add(multipleChoiceQuestion); |
| | | |
| | | // é®çé¢ |
| | | Question openEndedQuestion = new Question("openEnded", "é®çé¢é¢", "é®çé¢é¢ç®1", null); |
| | | questions.add(openEndedQuestion); |
| | | |
| | | // å夿¨¡æ¿æ°æ® |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("questions", questions); |
| | | |
| | | // æ¸²ææ¨¡æ¿ |
| | | StringWriter writer = new StringWriter(); |
| | | template.process(data, writer); |
| | | String renderedTemplate = writer.toString(); |
| | | return writer.toString(); |
| | | // è¿å模æ¿å
容ç»å®¢æ·ç«¯ |
| | | // System.out.println(renderedTemplate); // è¿éåªæ¯ç¤ºä¾ï¼å®é
åºç¨ä¸åºå°å
容è¿åç»å®¢æ·ç«¯è¿è¡å±ç¤º |
| | | } catch (IOException | TemplateException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * @param reqid é®å·ID |
| | | * @param userid ç¨æ·ID |
| | | */ |
| | | @ApiOperation("è·åé®å·äºç»´ç ") |
| | | @GetMapping(value = "/getQRcode/{reqid}/{userid}") |
| | | public void getQRcode(@PathVariable("reqid") String reqid, @PathVariable("userid") String userid) { |
| | | String url = "http://192.168.2.10:8080/smartor/svytitle/generateStaticHtml"; |
| | | String filePath = "D:\\daima\\qrcode.png"; // ä¿åäºç»´ç å¾åçæä»¶è·¯å¾ |
| | | |
| | | generateQRCode(url, filePath); |
| | | |
| | | System.out.println("QR Code generated successfully!"); |
| | | } |
| | | |
| | | private void generateQRCode(String url, String filePath) { |
| | | QRCodeWriter qrCodeWriter = new QRCodeWriter(); |
| | | try { |
| | | BitMatrix bitMatrix = qrCodeWriter.encode(url, BarcodeFormat.QR_CODE, 500, 500); |
| | | |
| | | File outputFile = new File(filePath); |
| | | MatrixToImageWriter.writeToPath(bitMatrix, "PNG", outputFile.toPath()); |
| | | } catch (WriterException | IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * é®å¸ç»æå¤ç |
| | | * |
| | | * @param request |
| | | */ |
| | | @PostMapping(value = "/getFormDate") |
| | | public void getFormDate(HttpServletRequest request) { |
| | | Map<String, String[]> formData = request.getParameterMap(); |
| | | System.out.println(formData.toString()); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.smartor.controller; |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.smartor.domain.SvyLibTitleReq; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.smartor.domain.SvyLibTitle; |
| | | import com.smartor.domain.SvyLibTitleReq; |
| | | import com.smartor.service.ISvyLibTitleService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * é®å·Controller |
| | |
| | | /** |
| | | * æ°å¢é®å· |
| | | */ |
| | | @ApiOperation("æ°å¢é®å·") |
| | | @PreAuthorize("@ss.hasPermi('smartor:svytitle:add')") |
| | | @Log(title = "é®å·", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody SvyLibTitle svyLibTitle) { |
| | | @PostMapping("/addSvyLibTitle") |
| | | public AjaxResult addSvyLibTitle(@RequestBody SvyLibTitle svyLibTitle) { |
| | | return toAjax(svyLibTitleService.insertSvyLibTitle(svyLibTitle)); |
| | | } |
| | | |
| | |
| | | public AjaxResult remove(@PathVariable Long[] svyids) { |
| | | return toAjax(svyLibTitleService.deleteSvyLibTitleBySvyids(svyids)); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¹é导å
¥é®é¢ç® |
| | | */ |
| | | @ApiOperation("æ¹é导å
¥é®é®é¢ç®") |
| | | @PostMapping("/importLitTopic") |
| | | public AjaxResult importLitTopic(MultipartFile multipartFile) { |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser user = loginUser.getUser(); |
| | | return success(svyLibTopicService.importLitTopic(user, multipartFile)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导å
¥é¢ç®æ¨¡æ¿ |
| | | * |
| | | * @param response |
| | | */ |
| | | @ApiOperation("导å
¥é¢ç®æ¨¡æ¿") |
| | | @PostMapping("/importLitTopicTemplate") |
| | | public void importLitTopicTemplate(HttpServletResponse response) { |
| | | ExcelUtil<SvyLibTopicRes> util = new ExcelUtil<SvyLibTopicRes>(SvyLibTopicRes.class); |
| | | util.importTemplateExcel(response, "导å
¥é¢ç®"); |
| | | } |
| | | |
| | | /** |
| | | * è·åé¢ç® |
| | | */ |
| | | @ApiOperation("è·åé¢ç®") |
| | | @PostMapping("/showTopic") |
| | | public AjaxResult showTopic(@RequestBody SvyTopicReq svyTopicReq) { |
| | | return success(svyLibTopicService.showTopic(svyTopicReq)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.smartor.domain.SvyLibTopicRes; |
| | | import com.smartor.domain.SvyTopic; |
| | | import com.smartor.domain.SvyTopicReq; |
| | | import com.smartor.service.ISvyTopicService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * é¢ç®Controller |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-06-26 |
| | | */ |
| | | @Api(description = "é¢ç®") |
| | | @RestController |
| | | @RequestMapping("/system/topic") |
| | | public class SvyTopicController extends BaseController { |
| | | @Autowired |
| | | private ISvyTopicService svyTopicService; |
| | | |
| | | /** |
| | | * æ¥è¯¢é¢ç®å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:topic:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SvyTopic svyTopic) { |
| | | startPage(); |
| | | List<SvyTopic> list = svyTopicService.selectSvyTopicList(svyTopic); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导åºé¢ç®å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:topic:export')") |
| | | @Log(title = "é¢ç®", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SvyTopic svyTopic) { |
| | | List<SvyTopic> list = svyTopicService.selectSvyTopicList(svyTopic); |
| | | ExcelUtil<SvyTopic> util = new ExcelUtil<SvyTopic>(SvyTopic.class); |
| | | util.exportExcel(response, list, "é¢ç®æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * è·åé¢ç®è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:topic:query')") |
| | | @GetMapping(value = "/{topicid}") |
| | | public AjaxResult getInfo(@PathVariable("topicid") Long topicid) { |
| | | return success(svyTopicService.selectSvyTopicByTopicid(topicid)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢é¢ç® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:topic:add')") |
| | | @Log(title = "é¢ç®", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody SvyTopic svyTopic) { |
| | | return toAjax(svyTopicService.insertSvyTopic(svyTopic)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹é¢ç® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:topic:edit')") |
| | | @Log(title = "é¢ç®", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody SvyTopic svyTopic) { |
| | | return toAjax(svyTopicService.updateSvyTopic(svyTopic)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤é¢ç® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:topic:remove')") |
| | | @Log(title = "é¢ç®", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{topicids}") |
| | | public AjaxResult remove(@PathVariable Long[] topicids) { |
| | | return toAjax(svyTopicService.deleteSvyTopicByTopicids(topicids)); |
| | | } |
| | | |
| | | /** |
| | | * æ¹é导å
¥é®é¢ç® |
| | | */ |
| | | @ApiOperation("æ¹é导å
¥é¢ç®") |
| | | @PostMapping("/importTopic") |
| | | public AjaxResult importTopic(@RequestPart(value = "file") MultipartFile multipartFile) { |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser user = loginUser.getUser(); |
| | | return success(svyTopicService.importLitTopic(user, multipartFile)); |
| | | } |
| | | |
| | | /** |
| | | * 导å
¥é¢ç®æ¨¡æ¿ |
| | | * |
| | | * @param response |
| | | */ |
| | | @ApiOperation("导å
¥é¢ç®æ¨¡æ¿") |
| | | @PostMapping("/importTopicTemplate") |
| | | public void importTopicTemplate(HttpServletResponse response) { |
| | | ExcelUtil<SvyLibTopicRes> util = new ExcelUtil<SvyLibTopicRes>(SvyLibTopicRes.class); |
| | | util.importTemplateExcel(response, "导å
¥é¢ç®"); |
| | | } |
| | | |
| | | /** |
| | | * è·åé¢ç® |
| | | */ |
| | | @ApiOperation("è·åé¢ç®") |
| | | @PostMapping("/showTopic") |
| | | public AjaxResult showTopic(@RequestBody SvyTopicReq svyTopicReq) { |
| | | return success(svyTopicService.showTopic(svyTopicReq)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.core.config; |
| | | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.web.multipart.MultipartResolver; |
| | | import org.springframework.web.multipart.commons.CommonsMultipartResolver; |
| | | |
| | | @Configuration |
| | | public class UploadConfig { |
| | | @Bean(name = "multipartResolver") |
| | | public MultipartResolver multipartResolver() { |
| | | return new CommonsMultipartResolver(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <html> |
| | | <head> |
| | | <title>Questionnaire</title> |
| | | </head> |
| | | <body> |
| | | <h1>Questionnaire</h1> |
| | | |
| | | <form action="/smartor/svytitle/getFormDate" method="post"> |
| | | <#list questions as question> |
| | | <h2>${question.title}</h2> |
| | | |
| | | <#if question.type == "singleChoice"> |
| | | <#list question.options as option> |
| | | <input type="radio" name="${question.name}" value="${option}" id="${option}"> |
| | | <label for="${option}">${option}</label><br> |
| | | </#list> |
| | | </#if> |
| | | |
| | | <#if question.type == "multipleChoice"> |
| | | <#list question.options as option> |
| | | <input type="checkbox" name="${question.name}" value="${option}" id="${option}"> |
| | | <label for="${option}">${option}</label><br> |
| | | </#list> |
| | | </#if> |
| | | |
| | | <#if question.type == "openEnded"> |
| | | <textarea name="${question.name}" rows="4" cols="50"></textarea> |
| | | </#if> |
| | | |
| | | <br> |
| | | </#list> |
| | | |
| | | <input type="submit" value="Submit"> |
| | | </form> |
| | | </body> |
| | | </html> |
| | |
| | | <groupId>org.springframework</groupId> |
| | | <artifactId>spring-context-support</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.freemarker</groupId> |
| | | <artifactId>freemarker</artifactId> |
| | | <version>2.3.31</version> |
| | | </dependency> |
| | | <!-- SpringWeb模å --> |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-websocket</artifactId> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | </project> |
| | |
| | | // è¿æ»¤è¯·æ± |
| | | .authorizeRequests() |
| | | // 对äºç»å½login 注åregister éªè¯ç captchaImage å
许å¿åè®¿é® |
| | | .antMatchers("/login", "/register", "/captchaImage").permitAll() |
| | | .antMatchers("/login", "/register", "/captchaImage","/qrcode/generateStaticHtml","/qrcode/getQRcode","/qrcode/getFormDate").permitAll() |
| | | // éæèµæºï¼å¯å¿åè®¿é® |
| | | .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() |
| | | .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() |
| | |
| | | <artifactId>easypoi-spring-boot-starter</artifactId> |
| | | <version>4.4.0</version> |
| | | </dependency> |
| | | <!-- https://mvnrepository.com/artifact/com.sparkjava/spark-core --> |
| | | <dependency> |
| | | <groupId>com.sparkjava</groupId> |
| | | <artifactId>spark-core</artifactId> |
| | | <version>2.9.4</version> |
| | | </dependency> |
| | | <!-- https://mvnrepository.com/artifact/com.sparkjava/spark-template-freemarker --> |
| | | <dependency> |
| | | <groupId>com.sparkjava</groupId> |
| | | <artifactId>spark-template-freemarker</artifactId> |
| | | <version>2.7.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>core</artifactId> |
| | | <version>3.5.1</version> |
| | | </dependency> |
| | | |
| | | <!-- ZXing JavaSE --> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>javase</artifactId> |
| | | <version>3.5.1</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | |
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.domain; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * ç¾ç
å
³è对象 icd10_association |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-06-26 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "Icd10Association", description = "ç¾ç
å
³è对象") |
| | | public class Icd10Association { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ç¾ç
ç¼ç |
| | | */ |
| | | @ApiModelProperty(value = "ç¾ç
ç¼ç ") |
| | | @Excel(name = "ç¾ç
ç¼ç ") |
| | | private String icd10code; |
| | | |
| | | /** |
| | | * ç¾ç
åç§° |
| | | */ |
| | | @ApiModelProperty(value = "ç¾ç
åç§°") |
| | | @Excel(name = "ç¾ç
åç§°") |
| | | private String icd10name; |
| | | |
| | | /** |
| | | * é®å·ID |
| | | */ |
| | | @ApiModelProperty(value = "é®å·ID") |
| | | @Excel(name = "é®å·ID") |
| | | private Long svyid; |
| | | |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updatetime; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.domain; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class Question { |
| | | private String type; |
| | | private String name; |
| | | private String title; |
| | | private List<String> options; |
| | | |
| | | public Question(String type, String name, String title, List<String> options) { |
| | | this.type = type; |
| | | this.name = name; |
| | | this.title = title; |
| | | this.options = options; |
| | | } |
| | | } |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | @ApiModelProperty(value = "ç¾ç
åç§°") |
| | | private String icdname; |
| | | |
| | | /** |
| | | * ç¾ç
ID |
| | | */ |
| | | @ApiModelProperty(value = "ç¾ç
ID") |
| | | private List<String> icdID; |
| | | |
| | | /** |
| | | * é®å·é¢ç®éå |
| | | */ |
| | | @ApiModelProperty(value = "é®å·é¢ç®éå") |
| | | private List<SvyLibTopic> svyLibTopics; |
| | | |
| | | |
| | | |
| | | public SvyLibTitle(Long svyid, String icdname) { |
| | | this.svyid = svyid; |
| | |
| | | * @date 2023-03-03 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "SvyLibTopicAndOptionRes", description = "é®å·é¢ç®å±ç¤ºè¿å") |
| | | @ApiModel(value = "SvyLibTopicAndOptionRes", description = "é¢ç®å±ç¤ºè¿å") |
| | | public class SvyLibTopicAndOptionRes extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.domain; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * é¢ç®å¯¹è±¡ svy_topic |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-06-26 |
| | | */ |
| | | @Data |
| | | public class SvyTopic extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * èªå¢ID |
| | | */ |
| | | private Long topicid; |
| | | |
| | | /** |
| | | * é¢ç®ç±»å;æä¸¾ 1.åé 2å¤é 3填空 |
| | | */ |
| | | @Excel(name = " é¢ç®ç±»å;æä¸¾ 1.åé 2å¤é 3填空 ") |
| | | private Long topictype; |
| | | |
| | | /** |
| | | * é¢ç®Code |
| | | */ |
| | | @Excel(name = " é¢ç®Code ") |
| | | private String topiccode; |
| | | |
| | | /** |
| | | * é¢ç® |
| | | */ |
| | | @Excel(name = " é¢ç® ") |
| | | private String topic; |
| | | |
| | | /** |
| | | * é¢ç®æ ç¾ |
| | | */ |
| | | @Excel(name = "é¢ç®æ ç¾") |
| | | private String tag; |
| | | |
| | | /** |
| | | * æåº |
| | | */ |
| | | @Excel(name = " æåº ") |
| | | private Long sort; |
| | | |
| | | /** |
| | | * æ¯å¦å¿
å¡« |
| | | */ |
| | | @Excel(name = " æ¯å¦å¿
å¡« ") |
| | | private Long ismandatory; |
| | | |
| | | /** |
| | | * æ¯å¦éè |
| | | */ |
| | | @Excel(name = " æ¯å¦éè ") |
| | | private Long ishide; |
| | | |
| | | /** |
| | | * å 餿 è®° |
| | | */ |
| | | private String delFlag; |
| | | |
| | | /** |
| | | * æºæID |
| | | */ |
| | | @Excel(name = " æºæID ") |
| | | private String orgid; |
| | | |
| | | /** |
| | | * ä¸ä¼ æ è®° |
| | | */ |
| | | @Excel(name = " ä¸ä¼ æ è®° ") |
| | | private Long isupload; |
| | | |
| | | /** |
| | | * ä¸ä¼ æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = " ä¸ä¼ æ¶é´ ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date uploadTime; |
| | | |
| | | |
| | | /** |
| | | * ä¸ä¼ æ è®° |
| | | */ |
| | | @ApiModelProperty(name = "çæ¡") |
| | | private String answer; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.domain; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * é®é¢é项对象 SvyTopicoption |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-03-02 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "SvyLibTopicoption", description = "é®é¢é项对象") |
| | | public class SvyTopicoption extends BaseEntity { |
| | | |
| | | /** |
| | | * èªå¢ID |
| | | */ |
| | | @ApiModelProperty(name = "èªå¢ID") |
| | | private Long optionid; |
| | | |
| | | /** |
| | | * é¢ç®ID |
| | | */ |
| | | @ApiModelProperty(name = "é¢ç®ID") |
| | | @Excel(name = " é¢ç®ID ") |
| | | private Long topicid; |
| | | |
| | | /** |
| | | * é®å·ID |
| | | */ |
| | | @ApiModelProperty(name = "é®å·ID") |
| | | private Long svyid; |
| | | |
| | | /** |
| | | * é¢ç®ç±»å |
| | | */ |
| | | @ApiModelProperty(name = "é¢ç®ç±»å") |
| | | private Long topictype; |
| | | |
| | | /** |
| | | * é项Code |
| | | */ |
| | | @ApiModelProperty(name = "é项Code") |
| | | private String optioncode; |
| | | |
| | | /** |
| | | * é项å
容 |
| | | */ |
| | | @ApiModelProperty(name = "é项å
容") |
| | | private String optioncontent; |
| | | |
| | | /** |
| | | * æ¯å¦åå¨æç» |
| | | */ |
| | | @ApiModelProperty(name = "æ¯å¦å卿ç»") |
| | | private Long isexistdetail; |
| | | |
| | | /** |
| | | * æç»æ¯å¦å¿
å¡« |
| | | */ |
| | | @ApiModelProperty(name = "æç»æ¯å¦å¿
å¡«") |
| | | private Long detailismandatory; |
| | | |
| | | /** |
| | | * æ¯å¦å¼å¸¸é¡¹ç® |
| | | */ |
| | | @ApiModelProperty(name = "æ¯å¦å¼å¸¸é¡¹ç®") |
| | | private Long isexceptionitem; |
| | | |
| | | /** |
| | | * æ¯å¦è·è¿ |
| | | */ |
| | | @ApiModelProperty(name = "æ¯å¦è·è¿") |
| | | private Long istrack; |
| | | |
| | | /** |
| | | * åæ° |
| | | */ |
| | | @ApiModelProperty(name = "åæ°") |
| | | private Long score; |
| | | |
| | | /** |
| | | * æç¤º |
| | | */ |
| | | @ApiModelProperty(name = "æç¤º") |
| | | private String prompt; |
| | | |
| | | /** |
| | | * 跳转 |
| | | */ |
| | | @ApiModelProperty(name = "跳转") |
| | | private String jump; |
| | | |
| | | /** |
| | | * ç¶é项ID |
| | | */ |
| | | @ApiModelProperty(name = "ç¶é项ID") |
| | | private Long parentoptionid; |
| | | |
| | | /** |
| | | * æ¯å¦äºæ¥ |
| | | */ |
| | | @ApiModelProperty(name = "æ¯å¦äºæ¥") |
| | | private Long ismutex; |
| | | |
| | | /** |
| | | * éªè¯è§å |
| | | */ |
| | | @ApiModelProperty(name = "éªè¯è§å") |
| | | private String verifyrule; |
| | | |
| | | /** |
| | | * æåº |
| | | */ |
| | | @ApiModelProperty(name = "æåº") |
| | | private Long sort; |
| | | |
| | | /** |
| | | * éªè¯ç±»å;0.ä¸éªè¯ 1.æ´æ° 2.å°æ° 3.ææºå· 4.èº«ä»½è¯ 5.æ¥æ |
| | | */ |
| | | @ApiModelProperty(name = "éªè¯ç±»å;0.ä¸éªè¯ 1.æ´æ° 2.å°æ° 3.ææºå· 4.èº«ä»½è¯ 5.æ¥æ ") |
| | | private Long verificationtype; |
| | | |
| | | /** |
| | | * æ¯å¦éå¶èå´ |
| | | */ |
| | | @ApiModelProperty(name = "æ¯å¦éå¶èå´") |
| | | private Long isrange; |
| | | |
| | | /** |
| | | * æå°èå´ |
| | | */ |
| | | @ApiModelProperty(name = "æå°èå´") |
| | | private String minrange; |
| | | |
| | | /** |
| | | * æå¤§èå´ |
| | | */ |
| | | @ApiModelProperty(name = "æå¤§èå´") |
| | | private String maxrange; |
| | | |
| | | /** |
| | | * èå´é¿åº¦;ç¨äºå°æ°ä¿ç使° |
| | | */ |
| | | @ApiModelProperty(name = "èå´é¿åº¦;ç¨äºå°æ°ä¿ç使°") |
| | | private Long rangelength; |
| | | |
| | | /** |
| | | * æºæID |
| | | */ |
| | | @ApiModelProperty(name = "æºæID") |
| | | private String orgid; |
| | | |
| | | /** |
| | | * ä¸ä¸çæ¬ID |
| | | */ |
| | | @ApiModelProperty(name = "ä¸ä¸çæ¬ID") |
| | | private Long oldid; |
| | | |
| | | /** |
| | | * å 餿 è®° |
| | | */ |
| | | @ApiModelProperty(name = "å 餿 è®°") |
| | | private String delFlag; |
| | | |
| | | /** |
| | | * ä¸ä¼ æ è®° |
| | | */ |
| | | @ApiModelProperty(name = "ä¸ä¼ æ è®°") |
| | | private Long isupload; |
| | | |
| | | /** |
| | | * ä¸ä¼ æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(name = "ä¸ä¼ æ¶é´") |
| | | private Date uploadTime; |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.mapper; |
| | | |
| | | import com.smartor.domain.Icd10Association; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¾ç
å
³èMapperæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-06-26 |
| | | */ |
| | | @Mapper |
| | | public interface Icd10AssociationMapper { |
| | | /** |
| | | * æ¥è¯¢ç¾ç
å
³è |
| | | * |
| | | * @param icd10code ç¾ç
å
³èä¸»é® |
| | | * @return ç¾ç
å
³è |
| | | */ |
| | | public Icd10Association selectIcd10AssociationByIcd10code(String icd10code); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¾ç
å
³èå表 |
| | | * |
| | | * @param icd10Association ç¾ç
å
³è |
| | | * @return ç¾ç
å
³èéå |
| | | */ |
| | | public List<Icd10Association> selectIcd10AssociationList(Icd10Association icd10Association); |
| | | |
| | | /** |
| | | * æ°å¢ç¾ç
å
³è |
| | | * |
| | | * @param icd10Association ç¾ç
å
³è |
| | | * @return ç»æ |
| | | */ |
| | | public int insertIcd10Association(Icd10Association icd10Association); |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¾ç
å
³è |
| | | * |
| | | * @param icd10Association ç¾ç
å
³è |
| | | * @return ç»æ |
| | | */ |
| | | public int updateIcd10Association(Icd10Association icd10Association); |
| | | |
| | | /** |
| | | * å é¤ç¾ç
å
³è |
| | | * |
| | | * @param icd10code ç¾ç
å
³èä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteIcd10AssociationByIcd10code(String icd10code); |
| | | |
| | | /** |
| | | * æ¹éå é¤ç¾ç
å
³è |
| | | * |
| | | * @param icd10codes éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteIcd10AssociationByIcd10codes(String[] icd10codes); |
| | | } |
| | |
| | | package com.smartor.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.smartor.domain.SvyLibTitle; |
| | | import com.smartor.domain.SvyLibTitleReq; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * é®å·Mapperæ¥å£ |
| | |
| | | * @author ruoyi |
| | | * @date 2023-03-02 |
| | | */ |
| | | public interface SvyLibTitleMapper |
| | | { |
| | | @Mapper |
| | | public interface SvyLibTitleMapper { |
| | | /** |
| | | * æ¥è¯¢é®å· |
| | | * |
| | |
| | | public int deleteSvyLibTopicByTopicids(Long[] topicids); |
| | | |
| | | |
| | | public List<SvyLibTopicAndOptionRes> showTopic(SvyTopicReq svyTopicReq); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.mapper; |
| | | |
| | | import com.smartor.domain.SvyLibTopic; |
| | | import com.smartor.domain.SvyLibTopicAndOptionRes; |
| | | import com.smartor.domain.SvyTopic; |
| | | import com.smartor.domain.SvyTopicReq; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * é®å·é¢ç®Mapperæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-03-03 |
| | | */ |
| | | @Mapper |
| | | public interface SvyTopicMapper { |
| | | /** |
| | | * æ¥è¯¢é®å·é¢ç® |
| | | * |
| | | * @param topicid é®å·é¢ç®ä¸»é® |
| | | * @return é®å·é¢ç® |
| | | */ |
| | | public SvyTopic selectSvyTopicByTopicid(Long topicid); |
| | | |
| | | /** |
| | | * æ¥è¯¢é®å·é¢ç®å表 |
| | | * |
| | | * @param svyTopic é®å·é¢ç® |
| | | * @return é®å·é¢ç®éå |
| | | */ |
| | | public List<SvyTopic> selectSvyTopicList(SvyTopic svyTopic); |
| | | |
| | | /** |
| | | * æ°å¢é¢ç® |
| | | * |
| | | * @param svyTopic é®å·é¢ç® |
| | | * @return ç»æ |
| | | */ |
| | | public int insertSvyTopic(SvyTopic svyTopic); |
| | | |
| | | /** |
| | | * ä¿®æ¹é®å·é¢ç® |
| | | * |
| | | * @param svyTopic é®å·é¢ç® |
| | | * @return ç»æ |
| | | */ |
| | | public int updateSvyTopic(SvyTopic svyTopic); |
| | | |
| | | /** |
| | | * å é¤é®å·é¢ç® |
| | | * |
| | | * @param topicid é®å·é¢ç®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteSvyTopicByTopicid(Long topicid); |
| | | |
| | | /** |
| | | * æ¹éå é¤é®å·é¢ç® |
| | | * |
| | | * @param topicids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteSvyTopicByTopicids(Long[] topicids); |
| | | |
| | | public List<SvyLibTopicAndOptionRes> showTopic(SvyTopicReq svyTopicReq); |
| | | |
| | | |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.mapper; |
| | | |
| | | import com.smartor.domain.SvyTopicoption; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * é®å·é®é¢é项Mapperæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-03-02 |
| | | */ |
| | | @Mapper |
| | | public interface SvyTopicoptionMapper { |
| | | /** |
| | | * æ¥è¯¢é®å·é®é¢é项 |
| | | * |
| | | * @param optionid é®å·é®é¢éé¡¹ä¸»é® |
| | | * @return é®å·é®é¢é项 |
| | | */ |
| | | public SvyTopicoption selectSvyTopicoptionByOptionid(Long optionid); |
| | | |
| | | /** |
| | | * æ¥è¯¢é®å·é®é¢é项å表 |
| | | * |
| | | * @param svyTopicoption é®å·é®é¢é项 |
| | | * @return é®å·é®é¢é项éå |
| | | */ |
| | | public List<SvyTopicoption> selectSvyTopicoptionList(SvyTopicoption svyTopicoption); |
| | | |
| | | /** |
| | | * æ°å¢é®å·é®é¢é项 |
| | | * |
| | | * @param svyTopicoption é®å·é®é¢é项 |
| | | * @return ç»æ |
| | | */ |
| | | public int insertSvyTopicoption(SvyTopicoption svyTopicoption); |
| | | |
| | | /** |
| | | * ä¿®æ¹é®å·é®é¢é项 |
| | | * |
| | | * @param svyTopicoption é®å·é®é¢é项 |
| | | * @return ç»æ |
| | | */ |
| | | public int updateSvyTopicoption(SvyTopicoption svyTopicoption); |
| | | |
| | | /** |
| | | * å é¤é®å·é®é¢é项 |
| | | * |
| | | * @param optionid é®å·é®é¢éé¡¹ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteSvyTopicoptionByOptionid(Long optionid); |
| | | |
| | | /** |
| | | * æ¹éå é¤é®å·é®é¢é项 |
| | | * |
| | | * @param optionids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteSvyTopicoptionByOptionids(Long[] optionids); |
| | | |
| | | } |
| | |
| | | */ |
| | | public int deleteSvyLibTopicByTopicid(Long topicid); |
| | | |
| | | /** |
| | | * æ¹é导å
¥é®é®é¢ç® |
| | | * |
| | | * @param multipartFile |
| | | * @return |
| | | */ |
| | | public List<SvyLibTopicRes> importLitTopic(SysUser user, MultipartFile multipartFile); |
| | | |
| | | public SvyLibTopicRes showTopic(SvyTopicReq svyTopicReq); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.service; |
| | | |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.smartor.domain.SvyLibTopicAndOptionRes; |
| | | import com.smartor.domain.SvyLibTopicRes; |
| | | import com.smartor.domain.SvyTopic; |
| | | import com.smartor.domain.SvyTopicReq; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * é¢ç®Serviceæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-06-26 |
| | | */ |
| | | public interface ISvyTopicService { |
| | | /** |
| | | * æ¥è¯¢é¢ç® |
| | | * |
| | | * @param topicid é¢ç®ä¸»é® |
| | | * @return é¢ç® |
| | | */ |
| | | public SvyTopic selectSvyTopicByTopicid(Long topicid); |
| | | |
| | | /** |
| | | * æ¥è¯¢é¢ç®å表 |
| | | * |
| | | * @param svyTopic é¢ç® |
| | | * @return é¢ç®éå |
| | | */ |
| | | public List<SvyTopic> selectSvyTopicList(SvyTopic svyTopic); |
| | | |
| | | /** |
| | | * æ°å¢é¢ç® |
| | | * |
| | | * @param svyTopic é¢ç® |
| | | * @return ç»æ |
| | | */ |
| | | public int insertSvyTopic(SvyTopic svyTopic); |
| | | |
| | | /** |
| | | * ä¿®æ¹é¢ç® |
| | | * |
| | | * @param svyTopic é¢ç® |
| | | * @return ç»æ |
| | | */ |
| | | public int updateSvyTopic(SvyTopic svyTopic); |
| | | |
| | | /** |
| | | * æ¹éå é¤é¢ç® |
| | | * |
| | | * @param topicids éè¦å é¤çé¢ç®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteSvyTopicByTopicids(Long[] topicids); |
| | | |
| | | /** |
| | | * å é¤é¢ç®ä¿¡æ¯ |
| | | * |
| | | * @param topicid é¢ç®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteSvyTopicByTopicid(Long topicid); |
| | | |
| | | |
| | | /** |
| | | * æ¹é导å
¥é®é®é¢ç® |
| | | * |
| | | * @param multipartFile |
| | | * @return |
| | | */ |
| | | public List<SvyLibTopicRes> importLitTopic(SysUser user, MultipartFile multipartFile); |
| | | |
| | | public Map<String, List<SvyLibTopicAndOptionRes>> showTopic(SvyTopicReq svyTopicReq); |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.DtoConversionUtils; |
| | | import com.smartor.domain.Icd10Association; |
| | | import com.smartor.domain.SvyLibTitleReq; |
| | | import com.smartor.domain.SvyLibTopic; |
| | | import com.smartor.mapper.Icd10AssociationMapper; |
| | | import com.smartor.mapper.SvyLibTopicMapper; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import com.smartor.mapper.SvyLibTitleMapper; |
| | | import com.smartor.domain.SvyLibTitle; |
| | | import com.smartor.service.ISvyLibTitleService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * é®å·Serviceä¸å¡å±å¤ç |
| | |
| | | public class SvyLibTitleServiceImpl implements ISvyLibTitleService { |
| | | @Autowired |
| | | private SvyLibTitleMapper svyLibTitleMapper; |
| | | @Autowired |
| | | private Icd10AssociationMapper icd10AssociationMapper; |
| | | @Autowired |
| | | private SvyLibTopicMapper svyLibTopicMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢é®å· |
| | |
| | | * @param svyLibTitle é®å· |
| | | * @return ç»æ |
| | | */ |
| | | @Transactional |
| | | @Override |
| | | public int insertSvyLibTitle(SvyLibTitle svyLibTitle) { |
| | | svyLibTitle.setCreateTime(DateUtils.getNowDate()); |
| | | return svyLibTitleMapper.insertSvyLibTitle(svyLibTitle); |
| | | svyLibTitleMapper.insertSvyLibTitle(svyLibTitle); |
| | | //å
³èé®å·ç¾ç
|
| | | for (String icdId : svyLibTitle.getIcdID()) { |
| | | Icd10Association icd10Association = new Icd10Association(); |
| | | icd10Association.setIcd10code(icdId); |
| | | icd10Association.setSvyid(svyLibTitle.getSvyid()); |
| | | icd10AssociationMapper.insertIcd10Association(icd10Association); |
| | | } |
| | | //æ°å¢é®é¢é¢ç® |
| | | for (int i = 0; i < svyLibTitle.getSvyLibTopics().size(); i++) { |
| | | SvyLibTopic svyLibTopic = svyLibTitle.getSvyLibTopics().get(i); |
| | | svyLibTopicMapper.insertSvyLibTopic(svyLibTopic); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private SvyLibTopicMapper svyLibTopicMapper; |
| | | |
| | | @Autowired |
| | | private SvyLibTopicoptionMapper svyLibTopicoptionMapper; |
| | | // @Autowired |
| | | // private SvyLibTopicoptionMapper svyLibTopicoptionMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢é®å·é¢ç® |
| | |
| | | @Override |
| | | public int deleteSvyLibTopicByTopicid(Long topicid) { |
| | | return svyLibTopicMapper.deleteSvyLibTopicByTopicid(topicid); |
| | | } |
| | | |
| | | /** |
| | | * æ¹é导å
¥é®é®é¢ç® |
| | | * |
| | | * @param multipartFile |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public List<SvyLibTopicRes> importLitTopic(SysUser user, MultipartFile multipartFile) { |
| | | List<SvyLibTopicRes> svyLibTopicErrors = new ArrayList<>(); |
| | | |
| | | try { |
| | | Workbook workbook = new XSSFWorkbook(multipartFile.getInputStream()); |
| | | Sheet sheet = workbook.getSheetAt(0); |
| | | |
| | | //é®å·é¢ç®å¯¹è±¡ |
| | | SvyLibTopic svyLibTopic = new SvyLibTopic(); |
| | | |
| | | |
| | | for (int i = sheet.getFirstRowNum() + 1; i < sheet.getLastRowNum(); i++) { |
| | | SvyLibTopicRes svyLibTopicRes = new SvyLibTopicRes(); |
| | | |
| | | Row row = sheet.getRow(i); |
| | | //妿è¡ä¸ºç©ºï¼è¿è¡ä¸ä¸æ¬¡å¾ªç¯ |
| | | if (ObjectUtils.isEmpty(row.getCell(0)) && ObjectUtils.isEmpty(row.getCell(1)) && ObjectUtils.isEmpty(row.getCell(2))) { |
| | | continue; |
| | | } |
| | | //å¤ææ°æ®æ¯å¦æé®é¢ |
| | | svyLibTopicRes.setTopic(row.getCell(0).toString()); |
| | | if (ObjectUtils.isEmpty(row.getCell(0)) || StringUtils.isEmpty(row.getCell(0).toString())) { |
| | | svyLibTopicRes.setRemark("é¢ç®ä¸ºç©º,"); |
| | | } else { |
| | | //夿ä¸ä¸è¯¥é¢æ¯å¦å·²ç»å¨è¡¨éåºç° |
| | | SvyLibTopic svyLibTopic1 = new SvyLibTopic(); |
| | | svyLibTopic1.setTopic(row.getCell(0).toString()); |
| | | List<SvyLibTopic> svyLibTopics = svyLibTopicMapper.selectSvyLibTopicList(svyLibTopic1); |
| | | if (svyLibTopics.size() > 0) { |
| | | //å·²ç»åå¨äºï¼å°±ä¸åäº |
| | | continue; |
| | | } |
| | | } |
| | | svyLibTopicRes.setTag(row.getCell(1).toString()); |
| | | if (ObjectUtils.isEmpty(row.getCell(1)) || StringUtils.isEmpty(row.getCell(1).toString())) { |
| | | svyLibTopicRes.setRemark(StringUtils.isNotEmpty(svyLibTopicRes.getRemark()) ? svyLibTopicRes.getRemark() : "" + "ç±»å«ä¸ºç©º,"); |
| | | } |
| | | svyLibTopicRes.setTopictype(row.getCell(2).toString()); |
| | | if (ObjectUtils.isEmpty(row.getCell(2)) || StringUtils.isEmpty(row.getCell(2).toString())) { |
| | | svyLibTopicRes.setRemark(StringUtils.isNotEmpty(svyLibTopicRes.getRemark()) ? svyLibTopicRes.getRemark() : "" + "é¢ç®ç±»å为空,"); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(3))) { |
| | | svyLibTopicRes.setAnswer(row.getCell(3).toString()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(4))) { |
| | | svyLibTopicRes.setOptionA(row.getCell(4).toString()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(5))) { |
| | | svyLibTopicRes.setOptionB(row.getCell(5).toString()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(6))) { |
| | | svyLibTopicRes.setOptionC(row.getCell(6).toString()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(7))) { |
| | | svyLibTopicRes.setOptionD(row.getCell(7).toString()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(8))) { |
| | | svyLibTopicRes.setScore(row.getCell(8).toString()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(9))) { |
| | | svyLibTopicRes.setScore(row.getCell(9).toString()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(10))) { |
| | | svyLibTopicRes.setScore(row.getCell(10).toString()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(11))) { |
| | | svyLibTopicRes.setScore(row.getCell(11).toString()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(12))) { |
| | | svyLibTopicRes.setScore(row.getCell(12).toString()); |
| | | } |
| | | if (StringUtils.isNotEmpty(svyLibTopicRes.getRemark())) { |
| | | //说æè¯¥è¡æ°æ®æé®é¢ |
| | | svyLibTopicErrors.add(svyLibTopicRes); |
| | | continue; |
| | | } |
| | | |
| | | //æ°æ®æ²¡æé®é¢ï¼å¼å§æè¡¨ |
| | | svyLibTopic.setTopic(row.getCell(0).toString()); |
| | | if (row.getCell(2).toString().equals("åé")) { |
| | | svyLibTopic.setTopictype(1L); |
| | | } else if (row.getCell(2).toString().equals("å¤é")) { |
| | | svyLibTopic.setTopictype(2L); |
| | | } else { |
| | | svyLibTopic.setTopictype(3L); |
| | | } |
| | | svyLibTopic.setTopiccode(UUID.randomUUID().toString().replace("-", "")); |
| | | //é¢ç®ç±»å« |
| | | svyLibTopic.setTag(row.getCell(1).toString()); |
| | | svyLibTopic.setCreateBy(user.getUserName()); |
| | | svyLibTopic.setOrgid(user.getDeptId().toString()); |
| | | svyLibTopic.setUpdateBy(user.getUserName()); |
| | | svyLibTopic.setUpdateTime(new Date()); |
| | | svyLibTopic.setCreateTime(new Date()); |
| | | svyLibTopic.setDelFlag("0"); |
| | | //æ°å¢é¢ç®è¡¨ |
| | | svyLibTopicMapper.insertSvyLibTopic(svyLibTopic); |
| | | |
| | | //æ°å¢é¢ç®é项表 |
| | | SvyLibTopicoption svyLibTopicoption = new SvyLibTopicoption(); |
| | | svyLibTopicoption.setTopicid(svyLibTopic.getTopicid()); |
| | | svyLibTopicoption.setTopictype(svyLibTopic.getTopictype()); |
| | | svyLibTopicoption.setOptioncode(UUID.randomUUID().toString().replace("-", "")); |
| | | svyLibTopicoption.setCreateBy(user.getUserName()); |
| | | svyLibTopicoption.setCreateTime(new Date()); |
| | | svyLibTopicoption.setUpdateBy(user.getUserName()); |
| | | svyLibTopicoption.setUpdateTime(new Date()); |
| | | svyLibTopicoption.setDelFlag("0"); |
| | | if (svyLibTopicoption.getTopictype() == 3) { |
| | | //è§£çé¢ï¼ä¸éè¦å设置é项 |
| | | svyLibTopicoptionMapper.insertSvyLibTopicoption(svyLibTopicoption); |
| | | } else { |
| | | if (ObjectUtils.isNotEmpty(row.getCell(4))) { |
| | | if (StringUtils.isNotEmpty(row.getCell(4).toString())) { |
| | | svyLibTopicoption.setOptioncode("A"); |
| | | svyLibTopicoption.setOptioncontent(row.getCell(4).toString()); |
| | | svyLibTopicoption.setOptionid(null); |
| | | svyLibTopicoptionMapper.insertSvyLibTopicoption(svyLibTopicoption); |
| | | } |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(5))) { |
| | | if (StringUtils.isNotEmpty(row.getCell(5).toString())) { |
| | | svyLibTopicoption.setOptioncode("B"); |
| | | svyLibTopicoption.setOptioncontent(row.getCell(5).toString()); |
| | | svyLibTopicoption.setOptionid(null); |
| | | svyLibTopicoptionMapper.insertSvyLibTopicoption(svyLibTopicoption); |
| | | } |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(6))) { |
| | | if (StringUtils.isNotEmpty(row.getCell(6).toString())) { |
| | | svyLibTopicoption.setOptioncode("C"); |
| | | svyLibTopicoption.setOptioncontent(row.getCell(6).toString()); |
| | | svyLibTopicoption.setOptionid(null); |
| | | svyLibTopicoptionMapper.insertSvyLibTopicoption(svyLibTopicoption); |
| | | } |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(7))) { |
| | | if (StringUtils.isNotEmpty(row.getCell(7).toString())) { |
| | | svyLibTopicoption.setOptioncode("D"); |
| | | svyLibTopicoption.setOptioncontent(row.getCell(7).toString()); |
| | | svyLibTopicoption.setOptionid(null); |
| | | svyLibTopicoptionMapper.insertSvyLibTopicoption(svyLibTopicoption); |
| | | } |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(8))) { |
| | | if (StringUtils.isNotEmpty(row.getCell(8).toString())) { |
| | | svyLibTopicoption.setOptioncode("E"); |
| | | svyLibTopicoption.setOptioncontent(row.getCell(8).toString()); |
| | | svyLibTopicoption.setOptionid(null); |
| | | svyLibTopicoptionMapper.insertSvyLibTopicoption(svyLibTopicoption); |
| | | } |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(9))) { |
| | | if (StringUtils.isNotEmpty(row.getCell(9).toString())) { |
| | | svyLibTopicoption.setOptioncode("F"); |
| | | svyLibTopicoption.setOptioncontent(row.getCell(9).toString()); |
| | | svyLibTopicoption.setOptionid(null); |
| | | svyLibTopicoptionMapper.insertSvyLibTopicoption(svyLibTopicoption); |
| | | } |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(10))) { |
| | | if (StringUtils.isNotEmpty(row.getCell(10).toString())) { |
| | | svyLibTopicoption.setOptioncode("G"); |
| | | svyLibTopicoption.setOptioncontent(row.getCell(10).toString()); |
| | | svyLibTopicoption.setOptionid(null); |
| | | svyLibTopicoptionMapper.insertSvyLibTopicoption(svyLibTopicoption); |
| | | } |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(11))) { |
| | | if (StringUtils.isNotEmpty(row.getCell(11).toString())) { |
| | | svyLibTopicoption.setOptioncode("H"); |
| | | svyLibTopicoption.setOptioncontent(row.getCell(11).toString()); |
| | | svyLibTopicoption.setOptionid(null); |
| | | svyLibTopicoptionMapper.insertSvyLibTopicoption(svyLibTopicoption); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (CollectionUtils.isNotEmpty(svyLibTopicErrors)) { |
| | | return svyLibTopicErrors; |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public SvyLibTopicRes showTopic(SvyTopicReq svyTopicReq) { |
| | | List<SvyLibTopicAndOptionRes> svyLibTopicAndOptionRes = svyLibTopicMapper.showTopic(svyTopicReq); |
| | | Map<Long, List<SvyLibTopicAndOptionRes>> groupByAge = svyLibTopicAndOptionRes.stream().collect(Collectors.groupingBy(SvyLibTopicAndOptionRes::getTopicid)); |
| | | |
| | | return null; |
| | | } |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.service.impl; |
| | | |
| | | import com.google.gson.JsonObject; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.mapper.SvyTopicMapper; |
| | | import com.smartor.mapper.SvyTopicoptionMapper; |
| | | import com.smartor.service.ISvyTopicService; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * é¢ç®Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-06-26 |
| | | */ |
| | | @Service |
| | | public class SvyTopicServiceImpl implements ISvyTopicService { |
| | | @Autowired |
| | | private SvyTopicMapper svyTopicMapper; |
| | | @Autowired |
| | | private SvyTopicoptionMapper svyTopicoptionMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢é¢ç® |
| | | * |
| | | * @param topicid é¢ç®ä¸»é® |
| | | * @return é¢ç® |
| | | */ |
| | | @Override |
| | | public SvyTopic selectSvyTopicByTopicid(Long topicid) { |
| | | return svyTopicMapper.selectSvyTopicByTopicid(topicid); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢é¢ç®å表 |
| | | * |
| | | * @param svyTopic é¢ç® |
| | | * @return é¢ç® |
| | | */ |
| | | @Override |
| | | public List<SvyTopic> selectSvyTopicList(SvyTopic svyTopic) { |
| | | return svyTopicMapper.selectSvyTopicList(svyTopic); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢é¢ç® |
| | | * |
| | | * @param svyTopic é¢ç® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertSvyTopic(SvyTopic svyTopic) { |
| | | svyTopic.setCreateTime(DateUtils.getNowDate()); |
| | | return svyTopicMapper.insertSvyTopic(svyTopic); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹é¢ç® |
| | | * |
| | | * @param svyTopic é¢ç® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateSvyTopic(SvyTopic svyTopic) { |
| | | svyTopic.setUpdateTime(DateUtils.getNowDate()); |
| | | return svyTopicMapper.updateSvyTopic(svyTopic); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤é¢ç® |
| | | * |
| | | * @param topicids éè¦å é¤çé¢ç®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteSvyTopicByTopicids(Long[] topicids) { |
| | | return svyTopicMapper.deleteSvyTopicByTopicids(topicids); |
| | | } |
| | | |
| | | /** |
| | | * å é¤é¢ç®ä¿¡æ¯ |
| | | * |
| | | * @param topicid é¢ç®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteSvyTopicByTopicid(Long topicid) { |
| | | return svyTopicMapper.deleteSvyTopicByTopicid(topicid); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¹é导å
¥é®é®é¢ç® |
| | | * |
| | | * @param multipartFile |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public List<SvyLibTopicRes> importLitTopic(SysUser user, MultipartFile multipartFile) { |
| | | List<SvyLibTopicRes> svyLibTopicErrors = new ArrayList<>(); |
| | | |
| | | try { |
| | | Workbook workbook = new XSSFWorkbook(multipartFile.getInputStream()); |
| | | Sheet sheet = workbook.getSheetAt(0); |
| | | |
| | | //é®å·é¢ç®å¯¹è±¡ |
| | | SvyTopic svyTopic = new SvyTopic(); |
| | | |
| | | |
| | | for (int i = sheet.getFirstRowNum() + 1; i < sheet.getLastRowNum(); i++) { |
| | | SvyLibTopicRes svyLibTopicRes = new SvyLibTopicRes(); |
| | | |
| | | Row row = sheet.getRow(i); |
| | | //妿è¡ä¸ºç©ºï¼è¿è¡ä¸ä¸æ¬¡å¾ªç¯ |
| | | if (ObjectUtils.isEmpty(row.getCell(0)) && ObjectUtils.isEmpty(row.getCell(1)) && ObjectUtils.isEmpty(row.getCell(2))) { |
| | | continue; |
| | | } |
| | | //å¤ææ°æ®æ¯å¦æé®é¢ |
| | | svyLibTopicRes.setTopic(row.getCell(0).toString()); |
| | | if (ObjectUtils.isEmpty(row.getCell(0)) || StringUtils.isEmpty(row.getCell(0).toString())) { |
| | | svyLibTopicRes.setRemark("é¢ç®ä¸ºç©º,"); |
| | | } else { |
| | | //夿ä¸ä¸è¯¥é¢æ¯å¦å·²ç»å¨è¡¨éåºç° |
| | | SvyTopic svyLibTopic1 = new SvyTopic(); |
| | | svyLibTopic1.setTopic(row.getCell(0).toString()); |
| | | List<SvyTopic> svyLibTopics = svyTopicMapper.selectSvyTopicList(svyLibTopic1); |
| | | if (svyLibTopics.size() > 0) { |
| | | //å·²ç»åå¨äºï¼å°±ä¸åäº |
| | | continue; |
| | | } |
| | | } |
| | | svyLibTopicRes.setTag(row.getCell(1).toString()); |
| | | if (ObjectUtils.isEmpty(row.getCell(1)) || StringUtils.isEmpty(row.getCell(1).toString())) { |
| | | svyLibTopicRes.setRemark(StringUtils.isNotEmpty(svyLibTopicRes.getRemark()) ? svyLibTopicRes.getRemark() : "" + "ç±»å«ä¸ºç©º,"); |
| | | } |
| | | svyLibTopicRes.setTopictype(row.getCell(2).toString()); |
| | | if (ObjectUtils.isEmpty(row.getCell(2)) || StringUtils.isEmpty(row.getCell(2).toString())) { |
| | | svyLibTopicRes.setRemark(StringUtils.isNotEmpty(svyLibTopicRes.getRemark()) ? svyLibTopicRes.getRemark() : "" + "é¢ç®ç±»å为空,"); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(3))) { |
| | | svyLibTopicRes.setAnswer(row.getCell(3).toString()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(4))) { |
| | | svyLibTopicRes.setOptionA(row.getCell(4).toString()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(5))) { |
| | | svyLibTopicRes.setOptionB(row.getCell(5).toString()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(6))) { |
| | | svyLibTopicRes.setOptionC(row.getCell(6).toString()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(7))) { |
| | | svyLibTopicRes.setOptionD(row.getCell(7).toString()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(8))) { |
| | | svyLibTopicRes.setScore(row.getCell(8).toString()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(9))) { |
| | | svyLibTopicRes.setScore(row.getCell(9).toString()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(10))) { |
| | | svyLibTopicRes.setScore(row.getCell(10).toString()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(11))) { |
| | | svyLibTopicRes.setScore(row.getCell(11).toString()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(12))) { |
| | | svyLibTopicRes.setScore(row.getCell(12).toString()); |
| | | } |
| | | if (StringUtils.isNotEmpty(svyLibTopicRes.getRemark())) { |
| | | //说æè¯¥è¡æ°æ®æé®é¢ |
| | | svyLibTopicErrors.add(svyLibTopicRes); |
| | | continue; |
| | | } |
| | | |
| | | //æ°æ®æ²¡æé®é¢ï¼å¼å§æè¡¨ |
| | | svyTopic.setTopic(row.getCell(0).toString()); |
| | | if (row.getCell(2).toString().equals("åé") || row.getCell(2).toString().equals("1") || row.getCell(2).toString().equals("1.0")) { |
| | | svyTopic.setTopictype(1L); |
| | | } else if (row.getCell(2).toString().equals("å¤é") || row.getCell(2).toString().equals("2") || row.getCell(2).toString().equals("2.0")) { |
| | | svyTopic.setTopictype(2L); |
| | | } else { |
| | | svyTopic.setTopictype(3L); |
| | | } |
| | | svyTopic.setTopiccode(UUID.randomUUID().toString().replace("-", "")); |
| | | //é¢ç®ç±»å« |
| | | svyTopic.setTag(row.getCell(1).toString()); |
| | | svyTopic.setCreateBy(user.getUserName()); |
| | | svyTopic.setOrgid(user.getDeptId().toString()); |
| | | svyTopic.setUpdateBy(user.getUserName()); |
| | | svyTopic.setUpdateTime(new Date()); |
| | | svyTopic.setCreateTime(new Date()); |
| | | svyTopic.setDelFlag("0"); |
| | | svyTopic.setAnswer(row.getCell(3).toString()); |
| | | //æ°å¢é¢ç®è¡¨ |
| | | svyTopicMapper.insertSvyTopic(svyTopic); |
| | | |
| | | //æ°å¢é¢ç®é项表 |
| | | SvyTopicoption svyTopicoption = new SvyTopicoption(); |
| | | svyTopicoption.setTopicid(svyTopic.getTopicid()); |
| | | svyTopicoption.setTopictype(svyTopic.getTopictype()); |
| | | svyTopicoption.setOptioncode(UUID.randomUUID().toString().replace("-", "")); |
| | | svyTopicoption.setCreateBy(user.getUserName()); |
| | | svyTopicoption.setCreateTime(new Date()); |
| | | svyTopicoption.setUpdateBy(user.getUserName()); |
| | | svyTopicoption.setUpdateTime(new Date()); |
| | | svyTopicoption.setDelFlag("0"); |
| | | if (svyTopicoption.getTopictype() == 3) { |
| | | //è§£çé¢ï¼ä¸éè¦å设置é项 |
| | | svyTopicoptionMapper.insertSvyTopicoption(svyTopicoption); |
| | | } else { |
| | | if (ObjectUtils.isNotEmpty(row.getCell(4))) { |
| | | if (StringUtils.isNotEmpty(row.getCell(4).toString())) { |
| | | svyTopicoption.setOptioncode("A"); |
| | | svyTopicoption.setOptioncontent(row.getCell(4).toString()); |
| | | svyTopicoption.setOptionid(null); |
| | | svyTopicoptionMapper.insertSvyTopicoption(svyTopicoption); |
| | | } |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(5))) { |
| | | if (StringUtils.isNotEmpty(row.getCell(5).toString())) { |
| | | svyTopicoption.setOptioncode("B"); |
| | | svyTopicoption.setOptioncontent(row.getCell(5).toString()); |
| | | svyTopicoption.setOptionid(null); |
| | | svyTopicoptionMapper.insertSvyTopicoption(svyTopicoption); |
| | | } |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(6))) { |
| | | if (StringUtils.isNotEmpty(row.getCell(6).toString())) { |
| | | svyTopicoption.setOptioncode("C"); |
| | | svyTopicoption.setOptioncontent(row.getCell(6).toString()); |
| | | svyTopicoption.setOptionid(null); |
| | | svyTopicoptionMapper.insertSvyTopicoption(svyTopicoption); |
| | | } |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(7))) { |
| | | if (StringUtils.isNotEmpty(row.getCell(7).toString())) { |
| | | svyTopicoption.setOptioncode("D"); |
| | | svyTopicoption.setOptioncontent(row.getCell(7).toString()); |
| | | svyTopicoption.setOptionid(null); |
| | | svyTopicoptionMapper.insertSvyTopicoption(svyTopicoption); |
| | | } |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(8))) { |
| | | if (StringUtils.isNotEmpty(row.getCell(8).toString())) { |
| | | svyTopicoption.setOptioncode("E"); |
| | | svyTopicoption.setOptioncontent(row.getCell(8).toString()); |
| | | svyTopicoption.setOptionid(null); |
| | | svyTopicoptionMapper.insertSvyTopicoption(svyTopicoption); |
| | | } |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(9))) { |
| | | if (StringUtils.isNotEmpty(row.getCell(9).toString())) { |
| | | svyTopicoption.setOptioncode("F"); |
| | | svyTopicoption.setOptioncontent(row.getCell(9).toString()); |
| | | svyTopicoption.setOptionid(null); |
| | | svyTopicoptionMapper.insertSvyTopicoption(svyTopicoption); |
| | | } |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(10))) { |
| | | if (StringUtils.isNotEmpty(row.getCell(10).toString())) { |
| | | svyTopicoption.setOptioncode("G"); |
| | | svyTopicoption.setOptioncontent(row.getCell(10).toString()); |
| | | svyTopicoption.setOptionid(null); |
| | | svyTopicoptionMapper.insertSvyTopicoption(svyTopicoption); |
| | | } |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(11))) { |
| | | if (StringUtils.isNotEmpty(row.getCell(11).toString())) { |
| | | svyTopicoption.setOptioncode("H"); |
| | | svyTopicoption.setOptioncontent(row.getCell(11).toString()); |
| | | svyTopicoption.setOptionid(null); |
| | | svyTopicoptionMapper.insertSvyTopicoption(svyTopicoption); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (CollectionUtils.isNotEmpty(svyLibTopicErrors)) { |
| | | return svyLibTopicErrors; |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, List<SvyLibTopicAndOptionRes>> showTopic(SvyTopicReq svyTopicReq) { |
| | | List<SvyLibTopicAndOptionRes> svyLibTopicAndOptionRes = svyTopicMapper.showTopic(svyTopicReq); |
| | | Map<String, List<SvyLibTopicAndOptionRes>> groupByAge = svyLibTopicAndOptionRes.stream().collect(Collectors.groupingBy(SvyLibTopicAndOptionRes::getTopic)); |
| | | |
| | | return groupByAge; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | ## Configure logging for testing: optionally with log file |
| | | #log4j.rootLogger=WARI, stdout |
| | | ## log4j.rootLogger=WARN, stdout, logfile |
| | | # |
| | | #log4j.appender.stdout=org.apache.log1j.ConsoleAppender |
| | | #log4j.appender.stdout.layout=org.apache.logj.PatternLayout |
| | | #log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n |
| | | # |
| | | #log1j.appender.logfile=org.apache.log4j.FileAppender |
| | | #log4j.appender.logfile.File=target/spring.log |
| | | #log4j.appender.logfile.layout=org.apache.log1j.PatternLayout |
| | | #log1j.appender.logfile.layout.ConversionPattern=%d %p [%c] - %m%n |
| | | |
| | | log4j.logger.freemarker.cache=ERROR |
| | | log4j.logger.freemarker.beans=ERROR |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.smartor.mapper.Icd10AssociationMapper"> |
| | | |
| | | <resultMap type="com.smartor.domain.Icd10Association" id="Icd10AssociationResult"> |
| | | <result property="icd10code" column="icd10code" /> |
| | | <result property="icd10name" column="icd10name" /> |
| | | <result property="svyid" column="svyid" /> |
| | | <result property="updatetime" column="updatetime" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectIcd10AssociationVo"> |
| | | select icd10code, icd10name, svyid, updatetime from icd10_association |
| | | </sql> |
| | | |
| | | <select id="selectIcd10AssociationList" parameterType="com.smartor.domain.Icd10Association" resultMap="Icd10AssociationResult"> |
| | | <include refid="selectIcd10AssociationVo"/> |
| | | <where> |
| | | <if test="icd10code != null and icd10code != ''"> and icd10code = #{icd10code}</if> |
| | | <if test="icd10name != null and icd10name != ''"> and icd10name like concat('%', #{icd10name}, '%')</if> |
| | | <if test="svyid != null "> and svyid = #{svyid}</if> |
| | | <if test="updatetime != null "> and updatetime = #{updatetime}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectIcd10AssociationByIcd10code" parameterType="String" resultMap="Icd10AssociationResult"> |
| | | <include refid="selectIcd10AssociationVo"/> |
| | | where icd10code = #{icd10code} |
| | | </select> |
| | | |
| | | <insert id="insertIcd10Association" parameterType="com.smartor.domain.Icd10Association"> |
| | | insert into icd10_association |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="icd10code != null and icd10code != ''">icd10code,</if> |
| | | <if test="icd10name != null">icd10name,</if> |
| | | <if test="svyid != null">svyid,</if> |
| | | <if test="updatetime != null">updatetime,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="icd10code != null and icd10code != ''">#{icd10code},</if> |
| | | <if test="icd10name != null">#{icd10name},</if> |
| | | <if test="svyid != null">#{svyid},</if> |
| | | <if test="updatetime != null">#{updatetime},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateIcd10Association" parameterType="Icd10Association"> |
| | | update icd10_association |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="icd10name != null">icd10name = #{icd10name},</if> |
| | | <if test="svyid != null">svyid = #{svyid},</if> |
| | | <if test="updatetime != null">updatetime = #{updatetime},</if> |
| | | </trim> |
| | | where icd10code = #{icd10code} |
| | | </update> |
| | | |
| | | <delete id="deleteIcd10AssociationByIcd10code" parameterType="String"> |
| | | delete from icd10_association where icd10code = #{icd10code} |
| | | </delete> |
| | | |
| | | <delete id="deleteIcd10AssociationByIcd10codes" parameterType="String"> |
| | | delete from icd10_association where icd10code in |
| | | <foreach item="icd10code" collection="array" open="(" separator="," close=")"> |
| | | #{icd10code} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
| | |
| | | select topicid, oldid, svyid, topictype, topiccode, topic, sort, ismandatory, ishide, del_flag, orgid, create_by, create_time, update_by, update_time, isupload, upload_time,tag from svy_lib_topic |
| | | </sql> |
| | | |
| | | <select id="selectSvyLibTopicList" parameterType="SvyLibTopic" resultMap="SvyLibTopicResult"> |
| | | <select id="selectSvyLibTopicList" parameterType="com.smartor.domain.SvyLibTopic" resultMap="SvyLibTopicResult"> |
| | | <include refid="selectSvyLibTopicVo"/> |
| | | <where> |
| | | <if test="oldid != null "> and oldid = #{oldid}</if> |
| | |
| | | where topicid = #{topicid} |
| | | </select> |
| | | |
| | | <insert id="insertSvyLibTopic" parameterType="SvyLibTopic" useGeneratedKeys="true" keyProperty="topicid"> |
| | | <insert id="insertSvyLibTopic" parameterType="com.smartor.domain.SvyLibTopic" useGeneratedKeys="true" keyProperty="topicid"> |
| | | insert into svy_lib_topic |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="oldid != null">oldid,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateSvyLibTopic" parameterType="SvyLibTopic"> |
| | | <update id="updateSvyLibTopic" parameterType="com.smartor.domain.SvyLibTopic"> |
| | | update svy_lib_topic |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="oldid != null">oldid = #{oldid},</if> |
| | |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <select id="showTopic" resultType="com.smartor.domain.SvyLibTopicAndOptionRes" |
| | | parameterType="com.smartor.domain.SvyTopicReq"> |
| | | SELECT a.topicid, a.topiccode, a.topic, a.topictype, a.tag, b.optioncode, b.optioncontent |
| | | FROM svy_lib_topic a, |
| | | svy_lib_topicoption b |
| | | WHERE a.topicid = b.topicid |
| | | <if test="topic != null and topic != ''"> |
| | | and a.topic LIKE concat('%', #{topic}, '%') |
| | | </if> |
| | | <if test="topicType != null and topicType != ''"> |
| | | and a.topictype = #{topicType} |
| | | </if> |
| | | <if test="tag != null and tag != ''"> |
| | | and a.tag LIKE concat('%', #{tag}, '%') |
| | | </if> |
| | | GROUP BY a.topic, b.optioncode |
| | | </select> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.smartor.mapper.SvyTopicMapper"> |
| | | |
| | | <resultMap type="com.smartor.domain.SvyTopic" id="SvyTopicResult"> |
| | | <result property="topicid" column="topicid"/> |
| | | <result property="topictype" column="topictype"/> |
| | | <result property="topiccode" column="topiccode"/> |
| | | <result property="topic" column="topic"/> |
| | | <result property="tag" column="tag"/> |
| | | <result property="sort" column="sort"/> |
| | | <result property="ismandatory" column="ismandatory"/> |
| | | <result property="ishide" column="ishide"/> |
| | | <result property="delFlag" column="del_flag"/> |
| | | <result property="orgid" column="orgid"/> |
| | | <result property="createBy" column="create_by"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="isupload" column="isupload"/> |
| | | <result property="uploadTime" column="upload_time"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectSvyTopicVo"> |
| | | select topicid, |
| | | topictype, |
| | | topiccode, |
| | | topic, |
| | | tag, |
| | | sort, |
| | | ismandatory, |
| | | ishide, |
| | | del_flag, |
| | | orgid, |
| | | create_by, |
| | | create_time, |
| | | update_by, |
| | | update_time, |
| | | isupload, |
| | | upload_time |
| | | from svy_topic |
| | | </sql> |
| | | |
| | | <select id="selectSvyTopicList" parameterType="com.smartor.domain.SvyTopic" resultMap="SvyTopicResult"> |
| | | <include refid="selectSvyTopicVo"/> |
| | | <where> |
| | | <if test="topictype != null ">and topictype = #{topictype}</if> |
| | | <if test="topiccode != null and topiccode != ''">and topiccode = #{topiccode}</if> |
| | | <if test="topic != null and topic != ''">and topic = #{topic}</if> |
| | | <if test="tag != null and tag != ''">and tag = #{tag}</if> |
| | | <if test="sort != null ">and sort = #{sort}</if> |
| | | <if test="ismandatory != null ">and ismandatory = #{ismandatory}</if> |
| | | <if test="ishide != null ">and ishide = #{ishide}</if> |
| | | <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if> |
| | | <if test="isupload != null ">and isupload = #{isupload}</if> |
| | | <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectSvyTopicByTopicid" parameterType="Long" resultMap="SvyTopicResult"> |
| | | <include refid="selectSvyTopicVo"/> |
| | | where topicid = #{topicid} |
| | | </select> |
| | | |
| | | <insert id="insertSvyTopic" parameterType="com.smartor.domain.SvyTopic" useGeneratedKeys="true" |
| | | keyProperty="topicid"> |
| | | insert into svy_topic |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="topictype != null">topictype,</if> |
| | | <if test="topiccode != null and topiccode != ''">topiccode,</if> |
| | | <if test="topic != null">topic,</if> |
| | | <if test="tag != null">tag,</if> |
| | | <if test="sort != null">sort,</if> |
| | | <if test="ismandatory != null">ismandatory,</if> |
| | | <if test="ishide != null">ishide,</if> |
| | | <if test="delFlag != null and delFlag != ''">del_flag,</if> |
| | | <if test="orgid != null">orgid,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="isupload != null">isupload,</if> |
| | | <if test="uploadTime != null">upload_time,</if> |
| | | <if test="answer != null">answer,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="topictype != null">#{topictype},</if> |
| | | <if test="topiccode != null and topiccode != ''">#{topiccode},</if> |
| | | <if test="topic != null">#{topic},</if> |
| | | <if test="tag != null">#{tag},</if> |
| | | <if test="sort != null">#{sort},</if> |
| | | <if test="ismandatory != null">#{ismandatory},</if> |
| | | <if test="ishide != null">#{ishide},</if> |
| | | <if test="delFlag != null and delFlag != ''">#{delFlag},</if> |
| | | <if test="orgid != null">#{orgid},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="isupload != null">#{isupload},</if> |
| | | <if test="uploadTime != null">#{uploadTime},</if> |
| | | <if test="answer != null">#{answer},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateSvyTopic" parameterType="com.smartor.domain.SvyTopic"> |
| | | update svy_topic |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="topictype != null">topictype = #{topictype},</if> |
| | | <if test="topiccode != null and topiccode != ''">topiccode = #{topiccode},</if> |
| | | <if test="topic != null">topic = #{topic},</if> |
| | | <if test="tag != null">tag = #{tag},</if> |
| | | <if test="sort != null">sort = #{sort},</if> |
| | | <if test="ismandatory != null">ismandatory = #{ismandatory},</if> |
| | | <if test="ishide != null">ishide = #{ishide},</if> |
| | | <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if> |
| | | <if test="orgid != null">orgid = #{orgid},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="isupload != null">isupload = #{isupload},</if> |
| | | <if test="uploadTime != null">upload_time = #{uploadTime},</if> |
| | | </trim> |
| | | where topicid = #{topicid} |
| | | </update> |
| | | |
| | | <delete id="deleteSvyTopicByTopicid" parameterType="Long"> |
| | | delete |
| | | from svy_topic |
| | | where topicid = #{topicid} |
| | | </delete> |
| | | |
| | | <delete id="deleteSvyTopicByTopicids" parameterType="String"> |
| | | delete from svy_topic where topicid in |
| | | <foreach item="topicid" collection="array" open="(" separator="," close=")"> |
| | | #{topicid} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <select id="showTopic" resultType="com.smartor.domain.SvyLibTopicAndOptionRes" |
| | | parameterType="com.smartor.domain.SvyTopicReq"> |
| | | SELECT a.topicid, a.topiccode, a.topic, a.topictype, a.tag, b.optioncode, b.optioncontent |
| | | FROM svy_topic a, |
| | | svy_topicoption b |
| | | WHERE a.topicid = b.topicid |
| | | <if test="topic != null and topic != ''"> |
| | | and a.topic LIKE concat('%', #{topic}, '%') |
| | | </if> |
| | | <if test="topicType != null and topicType != ''"> |
| | | and a.topictype = #{topicType} |
| | | </if> |
| | | <if test="tag != null and tag != ''"> |
| | | and a.tag LIKE concat('%', #{tag}, '%') |
| | | </if> |
| | | GROUP BY a.topic, b.optioncode |
| | | </select> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.smartor.mapper.SvyTopicoptionMapper"> |
| | | |
| | | <resultMap type="com.smartor.domain.SvyTopicoption" id="SvyTopicoptionResult"> |
| | | <result property="optionid" column="optionid"/> |
| | | <result property="topicid" column="topicid"/> |
| | | <result property="svyid" column="svyid"/> |
| | | <result property="topictype" column="topictype"/> |
| | | <result property="optioncode" column="optioncode"/> |
| | | <result property="optioncontent" column="optioncontent"/> |
| | | <result property="isexistdetail" column="isexistdetail"/> |
| | | <result property="detailismandatory" column="detailismandatory"/> |
| | | <result property="isexceptionitem" column="isexceptionitem"/> |
| | | <result property="istrack" column="istrack"/> |
| | | <result property="score" column="score"/> |
| | | <result property="prompt" column="prompt"/> |
| | | <result property="jump" column="jump"/> |
| | | <result property="parentoptionid" column="parentoptionid"/> |
| | | <result property="ismutex" column="ismutex"/> |
| | | <result property="verifyrule" column="verifyrule"/> |
| | | <result property="sort" column="sort"/> |
| | | <result property="verificationtype" column="verificationtype"/> |
| | | <result property="isrange" column="isrange"/> |
| | | <result property="minrange" column="minrange"/> |
| | | <result property="maxrange" column="maxrange"/> |
| | | <result property="rangelength" column="rangelength"/> |
| | | <result property="orgid" column="orgid"/> |
| | | <result property="oldid" column="oldid"/> |
| | | <result property="delFlag" column="del_flag"/> |
| | | <result property="createBy" column="create_by"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="isupload" column="isupload"/> |
| | | <result property="uploadTime" column="upload_time"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectSvyTopicoptionVo"> |
| | | select optionid, |
| | | topicid, |
| | | svyid, |
| | | topictype, |
| | | optioncode, |
| | | optioncontent, |
| | | isexistdetail, |
| | | detailismandatory, |
| | | isexceptionitem, |
| | | istrack, |
| | | score, |
| | | prompt, |
| | | jump, |
| | | parentoptionid, |
| | | ismutex, |
| | | verifyrule, |
| | | sort, |
| | | verificationtype, |
| | | isrange, |
| | | minrange, |
| | | maxrange, |
| | | rangelength, |
| | | orgid, |
| | | oldid, |
| | | del_flag, |
| | | create_by, |
| | | create_time, |
| | | update_by, |
| | | update_time, |
| | | isupload, |
| | | upload_time |
| | | from svy_topicoption |
| | | </sql> |
| | | |
| | | <select id="selectSvyTopicoptionList" parameterType="com.smartor.domain.SvyTopicoption" |
| | | resultMap="SvyTopicoptionResult"> |
| | | <include refid="selectSvyTopicoptionVo"/> |
| | | <where> |
| | | <if test="topicid != null ">and topicid = #{topicid}</if> |
| | | <if test="svyid != null ">and svyid = #{svyid}</if> |
| | | <if test="topictype != null ">and topictype = #{topictype}</if> |
| | | <if test="optioncode != null and optioncode != ''">and optioncode = #{optioncode}</if> |
| | | <if test="optioncontent != null and optioncontent != ''">and optioncontent = #{optioncontent}</if> |
| | | <if test="isexistdetail != null ">and isexistdetail = #{isexistdetail}</if> |
| | | <if test="detailismandatory != null ">and detailismandatory = #{detailismandatory}</if> |
| | | <if test="isexceptionitem != null ">and isexceptionitem = #{isexceptionitem}</if> |
| | | <if test="istrack != null ">and istrack = #{istrack}</if> |
| | | <if test="score != null ">and score = #{score}</if> |
| | | <if test="prompt != null and prompt != ''">and prompt = #{prompt}</if> |
| | | <if test="jump != null and jump != ''">and jump = #{jump}</if> |
| | | <if test="parentoptionid != null ">and parentoptionid = #{parentoptionid}</if> |
| | | <if test="ismutex != null ">and ismutex = #{ismutex}</if> |
| | | <if test="verifyrule != null and verifyrule != ''">and verifyrule = #{verifyrule}</if> |
| | | <if test="sort != null ">and sort = #{sort}</if> |
| | | <if test="verificationtype != null ">and verificationtype = #{verificationtype}</if> |
| | | <if test="isrange != null ">and isrange = #{isrange}</if> |
| | | <if test="minrange != null and minrange != ''">and minrange = #{minrange}</if> |
| | | <if test="maxrange != null and maxrange != ''">and maxrange = #{maxrange}</if> |
| | | <if test="rangelength != null ">and rangelength = #{rangelength}</if> |
| | | <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if> |
| | | <if test="oldid != null ">and oldid = #{oldid}</if> |
| | | <if test="isupload != null ">and isupload = #{isupload}</if> |
| | | <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectSvyTopicoptionByOptionid" parameterType="Long" resultMap="SvyTopicoptionResult"> |
| | | <include refid="selectSvyTopicoptionVo"/> |
| | | where optionid = #{optionid} |
| | | </select> |
| | | |
| | | <insert id="insertSvyTopicoption" parameterType="com.smartor.domain.SvyTopicoption" useGeneratedKeys="true" |
| | | keyProperty="optionid"> |
| | | insert into svy_topicoption |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="topicid != null">topicid,</if> |
| | | <if test="svyid != null">svyid,</if> |
| | | <if test="topictype != null">topictype,</if> |
| | | <if test="optioncode != null">optioncode,</if> |
| | | <if test="optioncontent != null">optioncontent,</if> |
| | | <if test="isexistdetail != null">isexistdetail,</if> |
| | | <if test="detailismandatory != null">detailismandatory,</if> |
| | | <if test="isexceptionitem != null">isexceptionitem,</if> |
| | | <if test="istrack != null">istrack,</if> |
| | | <if test="score != null">score,</if> |
| | | <if test="prompt != null">prompt,</if> |
| | | <if test="jump != null">jump,</if> |
| | | <if test="parentoptionid != null">parentoptionid,</if> |
| | | <if test="ismutex != null">ismutex,</if> |
| | | <if test="verifyrule != null">verifyrule,</if> |
| | | <if test="sort != null">sort,</if> |
| | | <if test="verificationtype != null">verificationtype,</if> |
| | | <if test="isrange != null">isrange,</if> |
| | | <if test="minrange != null">minrange,</if> |
| | | <if test="maxrange != null">maxrange,</if> |
| | | <if test="rangelength != null">rangelength,</if> |
| | | <if test="orgid != null">orgid,</if> |
| | | <if test="oldid != null">oldid,</if> |
| | | <if test="delFlag != null and delFlag != ''">del_flag,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="isupload != null">isupload,</if> |
| | | <if test="uploadTime != null">upload_time,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="topicid != null">#{topicid},</if> |
| | | <if test="svyid != null">#{svyid},</if> |
| | | <if test="topictype != null">#{topictype},</if> |
| | | <if test="optioncode != null">#{optioncode},</if> |
| | | <if test="optioncontent != null">#{optioncontent},</if> |
| | | <if test="isexistdetail != null">#{isexistdetail},</if> |
| | | <if test="detailismandatory != null">#{detailismandatory},</if> |
| | | <if test="isexceptionitem != null">#{isexceptionitem},</if> |
| | | <if test="istrack != null">#{istrack},</if> |
| | | <if test="score != null">#{score},</if> |
| | | <if test="prompt != null">#{prompt},</if> |
| | | <if test="jump != null">#{jump},</if> |
| | | <if test="parentoptionid != null">#{parentoptionid},</if> |
| | | <if test="ismutex != null">#{ismutex},</if> |
| | | <if test="verifyrule != null">#{verifyrule},</if> |
| | | <if test="sort != null">#{sort},</if> |
| | | <if test="verificationtype != null">#{verificationtype},</if> |
| | | <if test="isrange != null">#{isrange},</if> |
| | | <if test="minrange != null">#{minrange},</if> |
| | | <if test="maxrange != null">#{maxrange},</if> |
| | | <if test="rangelength != null">#{rangelength},</if> |
| | | <if test="orgid != null">#{orgid},</if> |
| | | <if test="oldid != null">#{oldid},</if> |
| | | <if test="delFlag != null and delFlag != ''">#{delFlag},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="isupload != null">#{isupload},</if> |
| | | <if test="uploadTime != null">#{uploadTime},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateSvyTopicoption" parameterType="com.smartor.domain.SvyTopicoption"> |
| | | update svy_topicoption |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="topicid != null">topicid = #{topicid},</if> |
| | | <if test="svyid != null">svyid = #{svyid},</if> |
| | | <if test="topictype != null">topictype = #{topictype},</if> |
| | | <if test="optioncode != null">optioncode = #{optioncode},</if> |
| | | <if test="optioncontent != null">optioncontent = #{optioncontent},</if> |
| | | <if test="isexistdetail != null">isexistdetail = #{isexistdetail},</if> |
| | | <if test="detailismandatory != null">detailismandatory = #{detailismandatory},</if> |
| | | <if test="isexceptionitem != null">isexceptionitem = #{isexceptionitem},</if> |
| | | <if test="istrack != null">istrack = #{istrack},</if> |
| | | <if test="score != null">score = #{score},</if> |
| | | <if test="prompt != null">prompt = #{prompt},</if> |
| | | <if test="jump != null">jump = #{jump},</if> |
| | | <if test="parentoptionid != null">parentoptionid = #{parentoptionid},</if> |
| | | <if test="ismutex != null">ismutex = #{ismutex},</if> |
| | | <if test="verifyrule != null">verifyrule = #{verifyrule},</if> |
| | | <if test="sort != null">sort = #{sort},</if> |
| | | <if test="verificationtype != null">verificationtype = #{verificationtype},</if> |
| | | <if test="isrange != null">isrange = #{isrange},</if> |
| | | <if test="minrange != null">minrange = #{minrange},</if> |
| | | <if test="maxrange != null">maxrange = #{maxrange},</if> |
| | | <if test="rangelength != null">rangelength = #{rangelength},</if> |
| | | <if test="orgid != null">orgid = #{orgid},</if> |
| | | <if test="oldid != null">oldid = #{oldid},</if> |
| | | <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="isupload != null">isupload = #{isupload},</if> |
| | | <if test="uploadTime != null">upload_time = #{uploadTime},</if> |
| | | </trim> |
| | | where optionid = #{optionid} |
| | | </update> |
| | | |
| | | <delete id="deleteSvyTopicoptionByOptionid" parameterType="Long"> |
| | | delete |
| | | from svy_topicoption |
| | | where optionid = #{optionid} |
| | | </delete> |
| | | |
| | | <delete id="deleteSvyTopicoptionByOptionids" parameterType="String"> |
| | | delete from svy_topicoption where optionid in |
| | | <foreach item="optionid" collection="array" open="(" separator="," close=")"> |
| | | #{optionid} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!DOCTYPE html> |
| | | <html> |
| | | <head> |
| | | <title>é¢ç®è½¬æ¢åäºç»´ç çæ</title> |
| | | </head> |
| | | <body> |
| | | <h1>é¢ç®</h1> |
| | | <form id="quiz-form"> |
| | | <h2>åéé¢</h2> |
| | | <#list singleChoiceOptions as option> |
| | | <input type="radio" name="question1" value="${option}"> ${option}<br> |
| | | </#list> |
| | | |
| | | <h2>å¤éé¢</h2> |
| | | <#list multipleChoiceOptions as option> |
| | | <input type="checkbox" name="question2" value="${option}"> ${option}<br> |
| | | </#list> |
| | | |
| | | <input type="submit" value="æäº¤"> |
| | | </form> |
| | | </body> |
| | | </html> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!DOCTYPE html> |
| | | <html> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <title>Form</title> |
| | | </head> |
| | | <body> |
| | | <h1>${question}</h1> |
| | | <form action="/submit" method="POST"> |
| | | <ul> |
| | | <#list options as option> |
| | | <li> |
| | | <label> |
| | | <input type="checkbox" name="answer" value="${option}" /> ${option} |
| | | </label> |
| | | </li> |
| | | </#list> |
| | | </ul> |
| | | <input type="submit" value="Submit" /> |
| | | </form> |
| | | </body> |
| | | </html> |