From cc8e31ce088cf81d77118366fad97cf725de09d3 Mon Sep 17 00:00:00 2001 From: 13405411873 <1994398261@qq.com> Date: Mon, 28 Jul 2025 23:41:07 +0800 Subject: [PATCH] =?UTF-8?q?bug=20=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- asd-pc/common/utils/config.js | 40 +++++---- .../controller/PatientScriptController.java | 11 +++ .../ruoyi/script/entity/PatientScript.java | 2 + .../script/mapper/PatientScriptMapper.java | 1 + .../script/service/PatientScriptService.java | 2 + .../impl/PatientScriptServiceImpl.java | 10 ++- .../service/impl/AsdRecordServiceImpl.java | 8 +- .../mapper/system/PatientScriptMapper.xml | 12 ++- ruoyi-sh/src/views/cerebrum.vue | 6 +- ruoyi-sh/src/views/faCade.vue | 6 +- ruoyi-sh/src/views/system/shMenu/index.vue | 63 ++++++++++++- ruoyi-sh/src/views/system/shMenu2/index.vue | 90 ++++++++++++++++++- ruoyi-sh/src/views/system/shMenu2/scriptSh.js | 8 ++ ruoyi-ui/src/views/cerebrum.vue | 6 +- ruoyi-ui/src/views/faCade.vue | 6 +- 15 files changed, 227 insertions(+), 44 deletions(-) diff --git a/asd-pc/common/utils/config.js b/asd-pc/common/utils/config.js index ad48b46..5df310b 100644 --- a/asd-pc/common/utils/config.js +++ b/asd-pc/common/utils/config.js @@ -1,23 +1,33 @@ -//const baseUrl = "https://www.xishuibeishan.com/asdProject" -// const baseUrl = "https://www.xishuibeishan.com/asdProject" -//const baseUrl = "https://www.xishuibeishan.com/asdProject" -// const baseUrl = "http://192.168.31.25:8082/asdProject" const baseUrl = "https://www.jieyi-autism.com/asdProject" -//const baseUrl = "http://192.168.31.25:8082/asdProject" -// const baseUrl = "https://localhost/asdProject" -// const baseUrl = "https://43.140.199.34/jeecg-boot" -// const baseUrl = "http://43.140.199.34:8080/jeecg-boot" -// const basePicUrl = "http://43.140.199.34:8080/jeecg-boot/sys/common/static" -// const basePicUrl = "https://www.xishuibeishan.com/jeecg-boot/sys/common/static" const basePicUrl = "https://www.xishuibeishan.com/jeecg-boot/sys/common/static" -// const SOCKETAPI = "wss://howcode.online"; const SOCKETAPI1 = "https://www.xishuibeishan.com/jeecg-boot/messageServer/"; -// const SOCKETAPI1 = "wss://www.xishuibeishan.com/jeecg-boot/messageServer/"; -// const SOCKETAPI1 = "ws://43.140.199.34:8080/jeecg-boot/messageServer/"; + +// 应用信息 +const appInfo = { + // 应用名称 + name: "孑医测评", + // 应用版本 + version: "1.0", + // 应用logo + logo: "/static/logo.png'", + // 官方网站 + site_url: "http://ruoyi.vip", + // 政策协议 + agreements: [{ + title: "隐私政策", + url: "https://ruoyi.vip/protocol.html" + }, + { + title: "用户服务协议", + url: "https://ruoyi.vip/protocol.html" + } + ] +} export { baseUrl, basePicUrl, - SOCKETAPI1 -} \ No newline at end of file + SOCKETAPI1, + appInfo +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/script/controller/PatientScriptController.java b/ruoyi-admin/src/main/java/com/ruoyi/script/controller/PatientScriptController.java index 3a48877..60f34fe 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/script/controller/PatientScriptController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/script/controller/PatientScriptController.java @@ -60,6 +60,17 @@ public class PatientScriptController extends BaseController { return toAjax(this.patientScriptService.saveBatch(patientScripts)); } + /** + * 新增数据 + * + * @param patientScript 实体对象 + * @return 新增结果 + */ + @PostMapping("/updateNum") + public AjaxResult updateNum(@RequestBody PatientScript patientScript) throws IOException, InterruptedException { + return toAjax(this.patientScriptService.updateNum(patientScript)); + } + /** * 删除数据 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/script/entity/PatientScript.java b/ruoyi-admin/src/main/java/com/ruoyi/script/entity/PatientScript.java index 968c31f..069c385 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/script/entity/PatientScript.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/script/entity/PatientScript.java @@ -75,6 +75,8 @@ public class PatientScript extends BaseEntity { private String kydw; private String fzr; private String phone; + //排序 + private Integer orderNum; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/script/mapper/PatientScriptMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/script/mapper/PatientScriptMapper.java index d07ceba..a0c6f01 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/script/mapper/PatientScriptMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/script/mapper/PatientScriptMapper.java @@ -16,6 +16,7 @@ import java.util.List; public interface PatientScriptMapper { List selectList(PatientScript patientScript); void addData(PatientScript patientScript); + void updateNum(PatientScript patientScript); void updateStatus(PatientScript patientScript); void removeByIds(@Param("idList") List idList); PatientScript getById(@Param("id") Long id); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/script/service/PatientScriptService.java b/ruoyi-admin/src/main/java/com/ruoyi/script/service/PatientScriptService.java index 3c6c611..167d20c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/script/service/PatientScriptService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/script/service/PatientScriptService.java @@ -28,6 +28,8 @@ public interface PatientScriptService { Boolean saveBatch(List patientScripts) ; + Boolean updateNum(PatientScript patientScript); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/script/service/impl/PatientScriptServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/script/service/impl/PatientScriptServiceImpl.java index e1c0ba7..3d1547f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/script/service/impl/PatientScriptServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/script/service/impl/PatientScriptServiceImpl.java @@ -696,6 +696,12 @@ public class PatientScriptServiceImpl implements PatientScriptService { return true; } + @Override + public Boolean updateNum(PatientScript patientScript) { + scriptMapper.updateNum(patientScript); + return true; + } + // 每半小时执行一次 @Scheduled(cron = "0 0/3 * * * ?") public void scanData() throws IOException, InterruptedException, TemplateException { @@ -1159,9 +1165,7 @@ public class PatientScriptServiceImpl implements PatientScriptService { } } - }catch (Exception e){ - - } + }catch (Exception ignored){} } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/AsdRecordServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/AsdRecordServiceImpl.java index ab5bff3..f7b5e46 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/AsdRecordServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/AsdRecordServiceImpl.java @@ -464,7 +464,7 @@ public class AsdRecordServiceImpl implements IAsdRecordService reportMap.put("正常",itTmp.get("score").toString()); } }); - String[] contentRow ={it.getChildName(),it.getChildSex(), DateUtil.format(it.getBirthday(),"yyyy-MM-dd"),"中国",it.getNickName(),it.getPhone(),DateUtil.format(it.getRecordTime(),"yyyy-MM-dd") + String[] contentRow ={it.getChildName(),it.getChildSex(), DateUtil.format(it.getBirthday(),"yyyy-MM-dd"),"中国",it.getNickName(),it.getPhone(),DateUtil.format(it.getCreateTime(),"yyyy-MM-dd HH:mm") ,String.valueOf(Integer.valueOf(reportMap.get("冷漠")) +Integer.valueOf(reportMap.get("被动"))) ,reportMap.get("正常") ,reportMap.get("主动"),it.getReportResult(),it.getTotalScore().toString(),Optional.ofNullable(it.getTimeUse()).orElse(0).toString() }; List contentRowList = new ArrayList<>(); @@ -575,7 +575,7 @@ public class AsdRecordServiceImpl implements IAsdRecordService reportMap.put("正常",itTmp.get("score").toString()); } }); - String[] contentRow ={it.getChildName(),it.getChildSex(), DateUtil.format(it.getBirthday(),"yyyy-MM-dd"),"中国",it.getNickName(),it.getPhone(),DateUtil.format(it.getRecordTime(),"yyyy-MM-dd") + String[] contentRow ={it.getChildName(),it.getChildSex(), DateUtil.format(it.getBirthday(),"yyyy-MM-dd"),"中国",it.getNickName(),it.getPhone(),DateUtil.format(it.getCreateTime(),"yyyy-MM-dd HH:mm") ,reportMap.get("冷漠") ,reportMap.get("被动") ,reportMap.get("正常") ,reportMap.get("主动"),it.getReportResult(),it.getTotalScore().toString(),Optional.ofNullable(it.getTimeUse()).orElse(0).toString() }; List contentRowList = new ArrayList<>(); @@ -687,7 +687,7 @@ public class AsdRecordServiceImpl implements IAsdRecordService reportMap.put("感觉",itTmp.get("score").toString()); } }); - String[] contentRow ={it.getChildName(),it.getChildSex(), DateUtil.format(it.getBirthday(),"yyyy-MM-dd"),"中国",it.getNickName(),it.getPhone(),DateUtil.format(it.getRecordTime(),"yyyy-MM-dd") + String[] contentRow ={it.getChildName(),it.getChildSex(), DateUtil.format(it.getBirthday(),"yyyy-MM-dd"),"中国",it.getNickName(),it.getPhone(),DateUtil.format(it.getCreateTime(),"yyyy-MM-dd HH:mm") ,reportMap.get("语言") ,reportMap.get("运动") ,reportMap.get("交往") ,reportMap.get("生活自理"),reportMap.get("感觉"),it.getReportResult(),it.getTotalScore().toString(),Optional.ofNullable(it.getTimeUse()).orElse(0).toString() }; List contentRowList = new ArrayList<>(); @@ -776,7 +776,7 @@ public class AsdRecordServiceImpl implements IAsdRecordService reportMap.put("社交技能",itTmp.get("score").toString()); } }); - String[] contentRow ={it.getChildName(),it.getChildSex(), DateUtil.format(it.getBirthday(),"yyyy-MM-dd"),"中国",it.getNickName(),it.getPhone(),DateUtil.format(it.getRecordTime(),"yyyy-MM-dd") + String[] contentRow ={it.getChildName(),it.getChildSex(), DateUtil.format(it.getBirthday(),"yyyy-MM-dd"),"中国",it.getNickName(),it.getPhone(),DateUtil.format(it.getCreateTime(),"yyyy-MM-dd HH:mm") ,reportMap.get("想象力") ,reportMap.get("注意力切换能力") ,reportMap.get("沟通能力") ,reportMap.get("细节的注意"),reportMap.get("社交技能"),it.getReportResult(),it.getTotalScore().toString(),Optional.ofNullable(it.getTimeUse()).orElse(0).toString() }; List contentRowList = new ArrayList<>(); diff --git a/ruoyi-admin/src/main/resources/mapper/system/PatientScriptMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/PatientScriptMapper.xml index 1142c16..fcde31f 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/PatientScriptMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/PatientScriptMapper.xml @@ -32,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + update patient_script @@ -45,6 +45,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" repetition_time = #{repetitionTime} where id = #{id} + + update patient_script + set `order_num` = #{orderNum} + where id = #{id} + delete from patient_script where id in @@ -62,7 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and status= #{status} and `type`= #{type} - order by create_time desc + order by order_num asc,create_time desc + + + @@ -147,6 +161,12 @@ + + + + + +
删除
@@ -237,7 +257,8 @@ export default { form: [ { patientSex: '', - scanTime: '' + scanTime: '', + orderNum:1 } ], // 表单校验 @@ -267,6 +288,40 @@ export default { this.getList(); }, methods: { + + /** + * 限制只能输入正整数 + */ + onlyPositiveInteger(event) { + // 只允许数字键、退格键、删除键、Tab键、左箭头、右箭头 + const allowedKeys = ['Backspace', 'Delete', 'Tab', 'ArrowLeft', 'ArrowRight']; + if (allowedKeys.includes(event.key)) { + return; + } + + // 阻止非数字输入 + if (!/^[0-9]$/.test(event.key)) { + event.preventDefault(); + } + }, + + /** + * 处理排序号输入 + */ + handleOrderNumInput(row) { + // 确保输入的是正整数 + if (row.orderNum !== null && row.orderNum !== undefined) { + // 去除前导零 + if (typeof row.orderNum === 'string' && row.orderNum.length > 1 && row.orderNum[0] === '0') { + row.orderNum = parseInt(row.orderNum, 10) || ''; + } + + // 确保是正数 + if (row.orderNum <0) { + row.orderNum = 1; + } + } + }, /** 查询测评记录列表 */ getList() { this.loading = true; @@ -288,7 +343,8 @@ export default { this.form = [ { patientSex: '', - scanTime: '' + scanTime: '', + orderNum:1 } ]; this.resetForm("form"); @@ -413,7 +469,8 @@ export default { addItem() { this.form.push({ patientSex: '', - scanTime: '' + scanTime: '', + orderNum:1 }); }, removeItem(index) { diff --git a/ruoyi-sh/src/views/system/shMenu2/index.vue b/ruoyi-sh/src/views/system/shMenu2/index.vue index d6115cd..b938d05 100644 --- a/ruoyi-sh/src/views/system/shMenu2/index.vue +++ b/ruoyi-sh/src/views/system/shMenu2/index.vue @@ -30,6 +30,22 @@ + + + @@ -147,6 +163,11 @@ + + + + +
删除
@@ -172,7 +193,7 @@ import { getRecord, delRecord, addRecord, - updateRecord, + updateNum, exportReport } from "./scriptSh"; import request from '@/utils/request' @@ -237,7 +258,8 @@ export default { form: [ { patientSex: '', - scanTime: '' + scanTime: '', + orderNum:1 } ], // 表单校验 @@ -267,6 +289,56 @@ export default { this.getList(); }, methods: { + /** + * 限制只能输入正整数 + */ + onlyPositiveInteger(event) { + // 只允许数字键、退格键、删除键、Tab键、左箭头、右箭头 + const allowedKeys = ['Backspace', 'Delete', 'Tab', 'ArrowLeft', 'ArrowRight']; + if (allowedKeys.includes(event.key)) { + return; + } + + // 阻止非数字输入 + if (!/^[0-9]$/.test(event.key)) { + event.preventDefault(); + } + }, + + /** + * 处理排序号输入 + */ + handleOrderNumInput(row) { + // 确保输入的是正整数 + if (row.orderNum !== null && row.orderNum !== undefined) { + // 去除前导零 + if (typeof row.orderNum === 'string' && row.orderNum.length > 1 && row.orderNum[0] === '0') { + row.orderNum = parseInt(row.orderNum, 10) || ''; + } + + // 确保是正数 + if (row.orderNum <0) { + row.orderNum = 1; + } + } + }, + + /** + * 更新排序号 + */ + updateOrderNum(row) { + if (!row.orderNum || row.orderNum < 1) { + this.$message.warning("排序号必须为正整数"); + return; + } + + // 调用更新接口(需要在scriptSh.js中实现相应的更新方法) + updateNum({id: row.id, orderNum: row.orderNum}).then(response => { + this.$modal.msgSuccess("排序号更新成功"); + }).catch(() => { + this.$modal.msgError("排序号更新失败"); + }); + }, /** 查询测评记录列表 */ getList() { this.loading = true; @@ -288,7 +360,8 @@ export default { this.form = [ { patientSex: '', - scanTime: '' + scanTime: '', + orderNum:1 } ]; this.resetForm("form"); @@ -413,7 +486,8 @@ export default { addItem() { this.form.push({ patientSex: '', - scanTime: '' + scanTime: '', + orderNum:1 }); }, removeItem(index) { @@ -442,4 +516,12 @@ export default { margin-left: 45px; margin-bottom: 10px; } +input{ + width: 100px; + margin-right: 10px; + border: 1px solid #ccc; + height: 30px; + border-radius: 5px; + +} diff --git a/ruoyi-sh/src/views/system/shMenu2/scriptSh.js b/ruoyi-sh/src/views/system/shMenu2/scriptSh.js index 60ce461..23dc325 100644 --- a/ruoyi-sh/src/views/system/shMenu2/scriptSh.js +++ b/ruoyi-sh/src/views/system/shMenu2/scriptSh.js @@ -26,6 +26,14 @@ export function addRecord(data) { }) } +export function updateNum(data) { + return request({ + url: '/sys/patientScript/updateNum', + method: 'post', + data: data + }) +} + // 删除测评记录 diff --git a/ruoyi-ui/src/views/cerebrum.vue b/ruoyi-ui/src/views/cerebrum.vue index eaf39cf..a37dcc3 100644 --- a/ruoyi-ui/src/views/cerebrum.vue +++ b/ruoyi-ui/src/views/cerebrum.vue @@ -63,7 +63,7 @@
- 北京北山医疗科技有限公司 + 苏州领弦医疗科技有限公司
diff --git a/ruoyi-ui/src/views/faCade.vue b/ruoyi-ui/src/views/faCade.vue index 9b57baa..9ec677e 100644 --- a/ruoyi-ui/src/views/faCade.vue +++ b/ruoyi-ui/src/views/faCade.vue @@ -77,7 +77,7 @@
- 北京北山医疗科技有限公司 + 苏州领弦医疗科技有限公司