Commit ae31790d authored by huyuchen's avatar huyuchen

户配置代码提交

parent ed62538e
...@@ -55,35 +55,12 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap ...@@ -55,35 +55,12 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
@Override @Override
public R saveInfo(SysHouseHoldInfo sysHouseHoldInfo) { public R saveInfo(SysHouseHoldInfo sysHouseHoldInfo) {
SysHouseHoldInfo info = null; SysHouseHoldInfo info = this.getOne(Wrappers.<SysHouseHoldInfo>query().lambda()
if (null != sysHouseHoldInfo.getTown()){ .eq(SysHouseHoldInfo::getType,sysHouseHoldInfo.getType())
info = this.getOne(Wrappers.<SysHouseHoldInfo>query().lambda() .eq(SysHouseHoldInfo::getName,sysHouseHoldInfo.getName())
.eq(SysHouseHoldInfo::getType,info.getType())
.eq(SysHouseHoldInfo::getName,info.getName())
.eq(SysHouseHoldInfo::getTown,info.getTown())
.eq(SysHouseHoldInfo::getOrganName,info.getOrganName())
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
}
if (null != sysHouseHoldInfo.getCity() && null == sysHouseHoldInfo.getTown()){
info = this.getOne(Wrappers.<SysHouseHoldInfo>query().lambda()
.eq(SysHouseHoldInfo::getType,info.getType())
.eq(SysHouseHoldInfo::getName,info.getName())
.eq(SysHouseHoldInfo::getCity,info.getCity())
.eq(SysHouseHoldInfo::getOrganName,info.getOrganName())
.isNull(SysHouseHoldInfo::getTown)
.last(CommonConstants.LAST_ONE_SQL));
}
if (null != sysHouseHoldInfo.getProvince() && null == sysHouseHoldInfo.getCity()){
info = this.getOne(Wrappers.<SysHouseHoldInfo>query().lambda()
.eq(SysHouseHoldInfo::getType,info.getType())
.eq(SysHouseHoldInfo::getName,info.getName())
.eq(SysHouseHoldInfo::getProvince,info.getProvince())
.eq(SysHouseHoldInfo::getOrganName,info.getOrganName())
.isNull(SysHouseHoldInfo::getCity)
.last(CommonConstants.LAST_ONE_SQL));
}
if (null != info){ if (null != info){
return R.failed("对应户、地市、所属机构的配置已存在!"); return R.failed("对应账户性质、户名的配置已存在!");
} }
baseMapper.insert(sysHouseHoldInfo); baseMapper.insert(sysHouseHoldInfo);
return R.ok(); return R.ok();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment