|
|
@ -18,13 +18,19 @@ |
|
|
|
package com.epmet.service.impl; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
|
import com.epmet.dao.IcFormItemDao; |
|
|
|
import com.epmet.dao.IcFormItemOptionsDao; |
|
|
|
import com.epmet.dto.form.CustomerFormQueryDTO; |
|
|
|
import com.epmet.dto.form.EditIFormItemFormDTO; |
|
|
|
import com.epmet.dto.result.*; |
|
|
|
import com.epmet.entity.IcFormItemEntity; |
|
|
|
import com.epmet.service.IcFormItemService; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
@ -39,8 +45,11 @@ import java.util.stream.Collectors; |
|
|
|
* @author generator generator@elink-cn.com |
|
|
|
* @since v1.0.0 2021-10-26 |
|
|
|
*/ |
|
|
|
@Slf4j |
|
|
|
@Service |
|
|
|
public class IcFormItemServiceImpl extends BaseServiceImpl<IcFormItemDao, IcFormItemEntity> implements IcFormItemService { |
|
|
|
@Autowired |
|
|
|
private IcFormItemOptionsDao icFormItemOptionsDao; |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取居民信息的查询条件,组件列表 |
|
|
@ -152,4 +161,43 @@ public class IcFormItemServiceImpl extends BaseServiceImpl<IcFormItemDao, IcForm |
|
|
|
return d; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 修改组件的类型 |
|
|
|
* 来源于需求: |
|
|
|
* 16、所患大病、所患慢病更改为下拉框选择,慢病类型:高血压、类风湿、心脏病、肝硬化、糖尿病、其他;大病类别:恶性肿瘤、肾功能衰竭、肝硬化或急性肝坏死、脑中风、急性心机梗塞、急性坏死性胰腺炎、器官移植、系统性红斑狼疮、再生障碍性贫血、其他 |
|
|
|
* 17、人户状况更改为下拉框选择,类别:人户一致,人在户不在,户在人不在 |
|
|
|
* 18、居住情况类别缺少针对夫妻两人居住的类别,增加“其他”分类,类别:与子女同住、空巢、独居、其他 |
|
|
|
* |
|
|
|
* @param formDTO |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void editItemType(EditIFormItemFormDTO formDTO) { |
|
|
|
LambdaQueryWrapper<IcFormItemEntity> queryWrapper = new QueryWrapper<IcFormItemEntity>().lambda() |
|
|
|
.eq(StringUtils.isNotBlank(formDTO.getCustomerId()),IcFormItemEntity::getCustomerId, formDTO.getCustomerId()) |
|
|
|
.eq(StringUtils.isNotBlank(formDTO.getFormItemId()),IcFormItemEntity::getId,formDTO.getFormItemId()) |
|
|
|
.eq(IcFormItemEntity::getLabel,formDTO.getLabel()); |
|
|
|
List<IcFormItemEntity> list=baseDao.selectList(queryWrapper); |
|
|
|
if(CollectionUtils.isEmpty(list)){ |
|
|
|
return; |
|
|
|
} |
|
|
|
for(IcFormItemEntity entity:list){ |
|
|
|
//修改组件类型
|
|
|
|
entity.setItemType(formDTO.getItemType()); |
|
|
|
baseDao.updateById(entity); |
|
|
|
if(!CollectionUtils.isEmpty(formDTO.getOptions())){ |
|
|
|
//todo
|
|
|
|
// 先删除后新增
|
|
|
|
/*int sort=1; |
|
|
|
for(OptionDTO optionDTO:formDTO.getOptions()){ |
|
|
|
IcFormItemOptionsEntity optionsEntity=new IcFormItemOptionsEntity(); |
|
|
|
optionsEntity.setCustomerId(); |
|
|
|
|
|
|
|
}*/ |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|