|
|
@ -20,9 +20,11 @@ package com.elink.esua.epdc.service.impl; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.constant.KpiFieldConstant; |
|
|
|
import com.elink.esua.epdc.dao.StreetPersonBaseDao; |
|
|
|
import com.elink.esua.epdc.dto.StreetPersonBaseDTO; |
|
|
@ -68,9 +70,9 @@ public class StreetPersonBaseServiceImpl extends BaseServiceImpl<StreetPersonBas |
|
|
|
} |
|
|
|
|
|
|
|
private QueryWrapper<StreetPersonBaseEntity> getWrapper(Map<String, Object> params){ |
|
|
|
String streetName = (String)params.get("street"); |
|
|
|
String streetId = (String)params.get("streetId"); |
|
|
|
QueryWrapper<StreetPersonBaseEntity> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.like(StringUtils.isNotBlank(streetName), "StREET", streetName); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(streetId), FieldConstant.STREET_ID, streetId); |
|
|
|
|
|
|
|
return wrapper; |
|
|
|
} |
|
|
@ -83,9 +85,15 @@ public class StreetPersonBaseServiceImpl extends BaseServiceImpl<StreetPersonBas |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void save(StreetPersonBaseDTO dto) { |
|
|
|
public Result save(StreetPersonBaseDTO dto) { |
|
|
|
// 判断街道人员底数是否重复插入
|
|
|
|
int isExist = baseDao.checkStreetIsExist(dto.getStreetId()); |
|
|
|
if (isExist > NumConstant.ZERO) { |
|
|
|
return new Result().error("该街道已设置人员底数,请选择其他街道"); |
|
|
|
} |
|
|
|
StreetPersonBaseEntity entity = ConvertUtils.sourceToTarget(dto, StreetPersonBaseEntity.class); |
|
|
|
insert(entity); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|