bug调整>体检管理移动端:

1:上年度体检医院显示不出来
2:人员类型改成人员类别
This commit is contained in:
2026-04-14 15:38:53 +08:00
parent 607204910f
commit 18b338aa98
4 changed files with 50 additions and 59 deletions
@@ -272,7 +272,7 @@ public class H5HealthCheckupController {
Sql sql = Sqls.create("""
select cu.id,cu.projectId,cu.userId,cu.userName,cu.sex,
cu.loginName,cu.phone,cu.card,cu.marriage,
u.personType
cu.personType
from health_checkup_user cu
left join sys_user u on cu.userId=u.id
$condition
@@ -99,8 +99,10 @@ public class HealthCheckupProjectServiceImpl extends BaseServiceImpl<HealthCheck
manyAddOrRenewUtil.asyncExecuteFastInsert(needInsertSelectionUsers, null);
Sql updateSql = Sqls.create("""
update health_checkup_user cu
left join sys_user u on cu.userId=u.id\s
set cu.phone=u.mobile,cu.card=u.idCard,cu.marriage=u.marriage,cu.personType=u.personType
left join health_checkup_project p on cu.projectId=p.id
left join sys_user u on cu.userId=u.id
set cu.phone=u.mobile,cu.card=u.idCard,cu.marriage=u.marriage
,cu.personType=(case when p.name like '%在职教职工%' then '在职教职工' when p.name like '%校聘高知%' then '校聘高知保健对象' else '' end)
where cu.projectId=@projectId2 and cu.confirmStatus!='1'
""");
updateSql.setParam("projectId2", healthCheckupProject.getId());
@@ -135,31 +137,25 @@ public class HealthCheckupProjectServiceImpl extends BaseServiceImpl<HealthCheck
* @return
*/
public String findLastYearHospital(HealthCheckupUserSelection healthCheckupUserSelection){
Cnd cndSelection = Cnd.NEW();
cndSelection.and("selectUserId","=",healthCheckupUserSelection.getSelectUserId());
cndSelection.and("projectId","=",healthCheckupUserSelection.getProjectId());
List<HealthCheckupUserSelection> checkupUserSelections = dao().query(HealthCheckupUserSelection.class, cndSelection);
if(CollectionUtil.isNotEmpty(checkupUserSelections)){
Date selectTime = checkupUserSelections.get(0).getSelectTime();
if(ObjectUtil.isNotEmpty(selectTime)){
Calendar instance = Calendar.getInstance();
instance.setTime(selectTime);
int year = instance.get(Calendar.YEAR);
LocalDate start = LocalDate.of(year - 1, 1, 1);
LocalDate end = LocalDate.of(year - 1, 12, 31);
Cnd lastYearCndSelection = Cnd.NEW();
lastYearCndSelection.and("selectUserId","=",healthCheckupUserSelection.getSelectUserId());
lastYearCndSelection.and("selectTime", ">=", start.toString()).and("selectTime", "<=", end.toString());
lastYearCndSelection.where().andNotIsNull("selectTime");
lastYearCndSelection.desc("selectTime");
List<HealthCheckupUserSelection> lastYearSelections = dao().query(HealthCheckupUserSelection.class, lastYearCndSelection);
if(CollectionUtil.isNotEmpty(lastYearSelections)) {
Cnd cnd = Cnd.NEW();
cnd.and("id","=",lastYearSelections.get(0).getSubjectId());
HealthCheckupProjectSubject projectSubject = dao().fetch(HealthCheckupProjectSubject.class, cnd);
if(ObjectUtil.isNotEmpty(projectSubject)) {
return projectSubject.getOptionName();
}
Date selectTime = new Date();
if(ObjectUtil.isNotEmpty(selectTime)) {
Calendar instance = Calendar.getInstance();
instance.setTime(selectTime);
int year = instance.get(Calendar.YEAR);
LocalDate start = LocalDate.of(year - 1, 1, 1);
LocalDate end = LocalDate.of(year - 1, 12, 31);
Cnd lastYearCndSelection = Cnd.NEW();
lastYearCndSelection.and("selectUserId","=",healthCheckupUserSelection.getSelectUserId());
lastYearCndSelection.and("selectTime", ">=", start.toString()).and("selectTime", "<=", end.toString());
lastYearCndSelection.where().andNotIsNull("selectTime");
lastYearCndSelection.desc("selectTime");
List<HealthCheckupUserSelection> lastYearSelections = dao().query(HealthCheckupUserSelection.class, lastYearCndSelection);
if(CollectionUtil.isNotEmpty(lastYearSelections)) {
Cnd cnd = Cnd.NEW();
cnd.and("id","=",lastYearSelections.get(0).getSubjectId());
HealthCheckupProjectSubject projectSubject = dao().fetch(HealthCheckupProjectSubject.class, cnd);
if(ObjectUtil.isNotEmpty(projectSubject)) {
return projectSubject.getOptionName();
}
}
}
@@ -18,7 +18,7 @@ layout("/layouts/platform_h5.html"){
v-model="formData.idCard"
:rules="[{ required: true, message: '请输入身份证号' }]">
</van-field>
<van-cell title="人员类型">{{formData.userState}}</van-cell>
<van-cell title="人员类型">{{userBaseMessage.personType}}</van-cell>
<van-field
input-align="right"
readonly
@@ -354,13 +354,12 @@ layout("/layouts/platform_h5.html"){
let projectId = GetQueryString("projectId")
await this.findSubject(projectId);
if (projectId) {
const {id, personType, birthday, unit} = this.$store.state.user
const {id, birthday, unit} = this.$store.state.user
await this.selectInfo(projectId);
await this.findUserBaseMessage(projectId, id);
await this.findLastYearHospital(projectId, id);
this.$set(this.formData, 'projectId', projectId)
this.$set(this.formData, 'idCard', this.userBaseMessage?.card)
this.$set(this.formData, 'userState', personType)
this.$set(this.formData, 'marriage', this.userBaseMessage?.marriage)
this.$set(this.formData, 'birthday', birthday)
this.$set(this.formData, 'unitName', unit.name)
@@ -33,8 +33,7 @@ layout("/layouts/platform_h5.html"){
name="phone"
readonly
required
v-model="formData.phone"
:rules="[{ required: false, message: '手机号码',trigger: ['blur', 'change'] },{ pattern: /^1[3456789]\d{9}$/, message: '输入正确的手机号码'}]">
v-model="formData.phone">
</van-field>
<van-field
input-align="right"
@@ -43,8 +42,7 @@ layout("/layouts/platform_h5.html"){
readonly
required
placeholder="请联系输入身份证号"
v-model="formData.card"
:rules="[{ required: true, message: '请输入子女身份证号', trigger: 'blur' }, {pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/, message: '请输入正确的身份证号码', trigger: 'blur'}]">
v-model="formData.card">
</van-field>
<van-cell title="人员类型">{{formData.personType}}</van-cell>
<van-cell title="婚姻状态">
@@ -58,10 +56,7 @@ layout("/layouts/platform_h5.html"){
</van-cell-group>
<!-- 按钮区域 -->
<div class="form-actions">
<van-button class="buttonClass"
@click-left="historyBack"
block
native-type="submit">返回</van-button>
<van-button class="buttonClass">返回</van-button>
</div>
</van-form>
</div>
@@ -117,26 +112,27 @@ layout("/layouts/platform_h5.html"){
},
// 执行提交
async doSubmit() {
const formData = clone(this.formData);
this.$dialog.confirm({
title: '温馨提示',
message: '您确定要提交吗?',
}).then(() => {
const toast = this.$toast.loading({
duration: 0,
forbidClick: true,
message: '提交中....',
});
this.$axios.post('/platform/healthCheckup/h5/doSubmitUserBaseMessage', formData).then(resp => {
if (resp.code === 0) {
toast.clear();
this.$toast.success(resp.msg)
this.historyBack()
}
})
}).catch(() => {
});
// const formData = clone(this.formData);
// this.$dialog.confirm({
// title: '温馨提示',
// message: '您确定要提交吗?',
// }).then(() => {
// const toast = this.$toast.loading({
// duration: 0,
// forbidClick: true,
// message: '提交中....',
// });
// this.$axios.post('/platform/healthCheckup/h5/doSubmitUserBaseMessage', formData).then(resp => {
// if (resp.code === 0) {
// toast.clear();
// this.$toast.success(resp.msg)
// this.historyBack()
// }
// })
// }).catch(() => {
//
// });
this.historyBack();
},
async selectInfo(projectId,userId) {
const resp = await this.$axios.post('/platform/healthCheckup/h5/findUserBaseMessageData', {projectId,userId});