|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
@ -61,7 +62,7 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl<ChangeWelfareDao, |
|
|
|
return ConvertUtils.sourceToTarget(entityList, ChangeWelfareDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
private QueryWrapper<ChangeWelfareEntity> getWrapper(Map<String, Object> params){ |
|
|
|
private QueryWrapper<ChangeWelfareEntity> getWrapper(Map<String, Object> params) { |
|
|
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
|
|
|
String name = (String) params.get("name"); |
|
|
|
String idCard = (String) params.get("idCard"); |
|
|
@ -128,7 +129,7 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl<ChangeWelfareDao, |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result removeWelfare(ChangeWelfareDTO dto) { |
|
|
|
if(StringUtils.isBlank(dto.getId())){ |
|
|
|
if (StringUtils.isBlank(dto.getId())) { |
|
|
|
return new Result().error("id不可为空"); |
|
|
|
} |
|
|
|
dto.setRemoveDate(DateUtils.format(new Date())); |
|
|
@ -139,18 +140,22 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl<ChangeWelfareDao, |
|
|
|
@Override |
|
|
|
public Boolean checkWelfareByIdCard(CheckWelfareByIdCardDTO dto) { |
|
|
|
ChangeWelfareEntity entity = baseDao.selectByIdCard(dto.getIdCard()); |
|
|
|
return entity == null? false: true; |
|
|
|
return entity != null; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result saveWelfareInfo(ChangeWelfareDTO dto) { |
|
|
|
dto.setId(StringUtils.EMPTY); |
|
|
|
if (NumConstant.ZERO_STR.equals(dto.getIsWelfare())) { |
|
|
|
removeWelfare(dto); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
Map<String, Object> params = new HashMap<>(4); |
|
|
|
params.put("idCard", dto.getIdCard()); |
|
|
|
if (!list(params).isEmpty()) { |
|
|
|
return new Result().error("该人员已经迁入福利人口"); |
|
|
|
} |
|
|
|
dto.setJoinDate(DateUtils.format(new Date())); |
|
|
|
dto.setId(StringUtils.EMPTY); |
|
|
|
ChangeWelfareEntity entity = ConvertUtils.sourceToTarget(dto, ChangeWelfareEntity.class); |
|
|
|
insert(entity); |
|
|
|
return new Result(); |
|
|
|