|
|
@ -23,11 +23,11 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.dao.CustomerStaffOrganizationDao; |
|
|
|
import com.epmet.dto.CustomerStaffOrganizationDTO; |
|
|
|
import com.epmet.entity.CustomerStaffOrganizationEntity; |
|
|
|
import com.epmet.redis.CustomerStaffOrganizationRedis; |
|
|
|
import com.epmet.service.CustomerStaffOrganizationService; |
|
|
|
import com.epmet.dao.CustomerStaffAgencyDao; |
|
|
|
import com.epmet.dto.CustomerStaffAgencyDTO; |
|
|
|
import com.epmet.entity.CustomerStaffAgencyEntity; |
|
|
|
import com.epmet.redis.CustomerStaffAgencyRedis; |
|
|
|
import com.epmet.service.CustomerStaffAgencyService; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -38,59 +38,59 @@ import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
/** |
|
|
|
* 组织人员关系表 |
|
|
|
* 人员-机关单位关系表 |
|
|
|
* |
|
|
|
* @author generator generator@elink-cn.com |
|
|
|
* @since v1.0.0 2020-04-20 |
|
|
|
*/ |
|
|
|
@Service |
|
|
|
public class CustomerStaffOrganizationServiceImpl extends BaseServiceImpl<CustomerStaffOrganizationDao, CustomerStaffOrganizationEntity> implements CustomerStaffOrganizationService { |
|
|
|
public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl<CustomerStaffAgencyDao, CustomerStaffAgencyEntity> implements CustomerStaffAgencyService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private CustomerStaffOrganizationRedis customerStaffOrganizationRedis; |
|
|
|
private CustomerStaffAgencyRedis customerStaffAgencyRedis; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<CustomerStaffOrganizationDTO> page(Map<String, Object> params) { |
|
|
|
IPage<CustomerStaffOrganizationEntity> page = baseDao.selectPage( |
|
|
|
public PageData<CustomerStaffAgencyDTO> page(Map<String, Object> params) { |
|
|
|
IPage<CustomerStaffAgencyEntity> page = baseDao.selectPage( |
|
|
|
getPage(params, FieldConstant.CREATED_TIME, false), |
|
|
|
getWrapper(params) |
|
|
|
); |
|
|
|
return getPageData(page, CustomerStaffOrganizationDTO.class); |
|
|
|
return getPageData(page, CustomerStaffAgencyDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<CustomerStaffOrganizationDTO> list(Map<String, Object> params) { |
|
|
|
List<CustomerStaffOrganizationEntity> entityList = baseDao.selectList(getWrapper(params)); |
|
|
|
public List<CustomerStaffAgencyDTO> list(Map<String, Object> params) { |
|
|
|
List<CustomerStaffAgencyEntity> entityList = baseDao.selectList(getWrapper(params)); |
|
|
|
|
|
|
|
return ConvertUtils.sourceToTarget(entityList, CustomerStaffOrganizationDTO.class); |
|
|
|
return ConvertUtils.sourceToTarget(entityList, CustomerStaffAgencyDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
private QueryWrapper<CustomerStaffOrganizationEntity> getWrapper(Map<String, Object> params){ |
|
|
|
private QueryWrapper<CustomerStaffAgencyEntity> getWrapper(Map<String, Object> params){ |
|
|
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
|
|
|
|
|
|
|
QueryWrapper<CustomerStaffOrganizationEntity> wrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<CustomerStaffAgencyEntity> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|
|
|
|
|
|
|
return wrapper; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public CustomerStaffOrganizationDTO get(String id) { |
|
|
|
CustomerStaffOrganizationEntity entity = baseDao.selectById(id); |
|
|
|
return ConvertUtils.sourceToTarget(entity, CustomerStaffOrganizationDTO.class); |
|
|
|
public CustomerStaffAgencyDTO get(String id) { |
|
|
|
CustomerStaffAgencyEntity entity = baseDao.selectById(id); |
|
|
|
return ConvertUtils.sourceToTarget(entity, CustomerStaffAgencyDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void save(CustomerStaffOrganizationDTO dto) { |
|
|
|
CustomerStaffOrganizationEntity entity = ConvertUtils.sourceToTarget(dto, CustomerStaffOrganizationEntity.class); |
|
|
|
public void save(CustomerStaffAgencyDTO dto) { |
|
|
|
CustomerStaffAgencyEntity entity = ConvertUtils.sourceToTarget(dto, CustomerStaffAgencyEntity.class); |
|
|
|
insert(entity); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void update(CustomerStaffOrganizationDTO dto) { |
|
|
|
CustomerStaffOrganizationEntity entity = ConvertUtils.sourceToTarget(dto, CustomerStaffOrganizationEntity.class); |
|
|
|
public void update(CustomerStaffAgencyDTO dto) { |
|
|
|
CustomerStaffAgencyEntity entity = ConvertUtils.sourceToTarget(dto, CustomerStaffAgencyEntity.class); |
|
|
|
updateById(entity); |
|
|
|
} |
|
|
|
|