|
|
@ -68,6 +68,10 @@ public class IcFormServiceImpl extends BaseServiceImpl<IcFormDao, IcFormEntity> |
|
|
|
private IcFormItemGroupDao icFormItemGroupDao; |
|
|
|
@Autowired |
|
|
|
private IcFormQueryBuilderDao icFormQueryBuilderDao; |
|
|
|
@Autowired |
|
|
|
private IcResiCategoryStatsConfigDao icResiCategoryStatsConfigDao; |
|
|
|
@Autowired |
|
|
|
private IcResiCategoryWarnConfigDao icResiCategoryWarnConfigDao; |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取居民信息表单 |
|
|
@ -145,6 +149,10 @@ public class IcFormServiceImpl extends BaseServiceImpl<IcFormDao, IcFormEntity> |
|
|
|
defaultIcForm.setId(newFormId); |
|
|
|
defaultIcForm.setCustomerId(customerId); |
|
|
|
defaultIcForm.setAreaCode(areaCode); |
|
|
|
defaultIcForm.setCreatedBy("init_user"); |
|
|
|
defaultIcForm.setCreatedTime(new Date()); |
|
|
|
defaultIcForm.setUpdatedBy("init_user"); |
|
|
|
defaultIcForm.setUpdatedTime(new Date()); |
|
|
|
|
|
|
|
int insert = baseDao.insert(defaultIcForm); |
|
|
|
log.info("insert icForm:" + insert); |
|
|
@ -163,7 +171,10 @@ public class IcFormServiceImpl extends BaseServiceImpl<IcFormDao, IcFormEntity> |
|
|
|
item.setFormId(newFormId); |
|
|
|
item.setAreaCode(areaCode); |
|
|
|
item.setParentItemId(newPrefixed + item.getParentItemId()); |
|
|
|
item.setItemGroupId(newPrefixed + item.getItemGroupId()); |
|
|
|
//分组Id 为0 说明不村子分组 则直接不设置 仍然为0
|
|
|
|
if (!NumConstant.ZERO_STR.equals(item.getItemGroupId())){ |
|
|
|
item.setItemGroupId(newPrefixed + item.getItemGroupId()); |
|
|
|
} |
|
|
|
String optionSourceValue = item.getOptionSourceValue(); |
|
|
|
if (StringUtils.isNotBlank(optionSourceValue) && optionSourceValue.contains(StrConstant.QUESTION_MARK)){ |
|
|
|
//多个参数
|
|
|
@ -173,6 +184,10 @@ public class IcFormServiceImpl extends BaseServiceImpl<IcFormDao, IcFormEntity> |
|
|
|
} |
|
|
|
item.setOptionSourceValue(optionSourceValue); |
|
|
|
} |
|
|
|
item.setCreatedBy("init_user"); |
|
|
|
item.setCreatedTime(new Date()); |
|
|
|
item.setUpdatedBy("init_user"); |
|
|
|
item.setUpdatedTime(new Date()); |
|
|
|
log.debug("item:"+ JSON.toJSONString(item)); |
|
|
|
icFormItemDao.insert(item); |
|
|
|
}); |
|
|
@ -186,6 +201,10 @@ public class IcFormServiceImpl extends BaseServiceImpl<IcFormDao, IcFormEntity> |
|
|
|
item.setCustomerId(customerId); |
|
|
|
item.setFormId(newFormId); |
|
|
|
item.setItemId(newPrefixed + item.getItemId()); |
|
|
|
item.setCreatedBy("init_user"); |
|
|
|
item.setCreatedTime(new Date()); |
|
|
|
item.setUpdatedBy("init_user"); |
|
|
|
item.setUpdatedTime(new Date()); |
|
|
|
log.debug("option:"+ JSON.toJSONString(item)); |
|
|
|
icFormItemOptionsDao.insert(item); |
|
|
|
}); |
|
|
@ -198,6 +217,10 @@ public class IcFormServiceImpl extends BaseServiceImpl<IcFormDao, IcFormEntity> |
|
|
|
item.setId(newPrefixed + item.getId()); |
|
|
|
item.setCustomerId(customerId); |
|
|
|
item.setFormId(newFormId); |
|
|
|
item.setCreatedBy("init_user"); |
|
|
|
item.setCreatedTime(new Date()); |
|
|
|
item.setUpdatedBy("init_user"); |
|
|
|
item.setUpdatedTime(new Date()); |
|
|
|
log.debug("group:"+ JSON.toJSONString(item)); |
|
|
|
icFormItemGroupDao.insert(item); |
|
|
|
}); |
|
|
@ -210,10 +233,42 @@ public class IcFormServiceImpl extends BaseServiceImpl<IcFormDao, IcFormEntity> |
|
|
|
item.setId(newPrefixed + item.getId()); |
|
|
|
item.setCustomerId(customerId); |
|
|
|
item.setFormItemId(newPrefixed + item.getFormItemId()); |
|
|
|
item.setCreatedBy("init_user"); |
|
|
|
item.setCreatedTime(new Date()); |
|
|
|
item.setUpdatedBy("init_user"); |
|
|
|
item.setUpdatedTime(new Date()); |
|
|
|
log.debug("query:"+ JSON.toJSONString(item)); |
|
|
|
icFormQueryBuilderDao.insert(item); |
|
|
|
}); |
|
|
|
|
|
|
|
LambdaQueryWrapper<IcResiCategoryStatsConfigEntity> wrapperStats = new LambdaQueryWrapper<>(); |
|
|
|
wrapperStats.eq(IcResiCategoryStatsConfigEntity::getCustomerId, defaultCustomerId); |
|
|
|
List<IcResiCategoryStatsConfigEntity> statsConfigList = icResiCategoryStatsConfigDao.selectList(wrapperStats); |
|
|
|
statsConfigList.forEach(item -> { |
|
|
|
item.setId(newPrefixed + item.getId()); |
|
|
|
item.setCustomerId(customerId); |
|
|
|
item.setCreatedBy("init_user"); |
|
|
|
item.setCreatedTime(new Date()); |
|
|
|
item.setUpdatedBy("init_user"); |
|
|
|
item.setUpdatedTime(new Date()); |
|
|
|
log.debug("stats:"+ JSON.toJSONString(item)); |
|
|
|
icResiCategoryStatsConfigDao.insert(item); |
|
|
|
}); |
|
|
|
|
|
|
|
LambdaQueryWrapper<IcResiCategoryWarnConfigEntity> wrapperWarn = new LambdaQueryWrapper<>(); |
|
|
|
wrapperWarn.eq(IcResiCategoryWarnConfigEntity::getCustomerId, defaultCustomerId); |
|
|
|
List<IcResiCategoryWarnConfigEntity> warnConfigList = icResiCategoryWarnConfigDao.selectList(wrapperWarn); |
|
|
|
warnConfigList.forEach(item -> { |
|
|
|
item.setId(newPrefixed + item.getId()); |
|
|
|
item.setCustomerId(customerId); |
|
|
|
item.setCreatedBy("init_user"); |
|
|
|
item.setCreatedTime(new Date()); |
|
|
|
item.setUpdatedBy("init_user"); |
|
|
|
item.setUpdatedTime(new Date()); |
|
|
|
log.debug("stats:"+ JSON.toJSONString(item)); |
|
|
|
icResiCategoryWarnConfigDao.insert(item); |
|
|
|
}); |
|
|
|
|
|
|
|
return "初始化成功!客户ID:" + customerId + " formCode:" + formCode; |
|
|
|
} |
|
|
|
} |
|
|
|