2023-03-01 09:05:03 +08:00
|
|
|
package com.engine.salary.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.engine.core.impl.Service;
|
|
|
|
|
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
2023-03-03 16:57:52 +08:00
|
|
|
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
2023-03-01 09:05:03 +08:00
|
|
|
import com.engine.salary.entity.extemp.po.ExtEmpPO;
|
|
|
|
|
import com.engine.salary.mapper.extemp.ExternalEmployeeMapper;
|
|
|
|
|
import com.engine.salary.service.ExtEmpService;
|
|
|
|
|
import com.engine.salary.util.db.MapperProxyFactory;
|
2023-03-03 16:57:52 +08:00
|
|
|
import com.engine.salary.util.page.PageInfo;
|
|
|
|
|
import com.engine.salary.util.page.SalaryPageUtil;
|
|
|
|
|
import dm.jdbc.util.IdGenerator;
|
2023-03-01 09:05:03 +08:00
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
2023-03-03 16:57:52 +08:00
|
|
|
import org.springframework.beans.BeanUtils;
|
2023-03-01 09:05:03 +08:00
|
|
|
|
|
|
|
|
import java.util.Collection;
|
2023-03-03 16:57:52 +08:00
|
|
|
import java.util.Date;
|
2023-03-01 09:05:03 +08:00
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 累计专项
|
|
|
|
|
* <p>Copyright: Copyright (c) 2022</p>
|
|
|
|
|
* <p>Company: 泛微软件</p>
|
|
|
|
|
*
|
|
|
|
|
* @author qiantao
|
|
|
|
|
* @version 1.0
|
|
|
|
|
**/
|
|
|
|
|
public class ExtEmpServiceImpl extends Service implements ExtEmpService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ExternalEmployeeMapper getExternalEmployeeMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(ExternalEmployeeMapper.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<ExtEmpPO> list(ExtEmpQueryParam param) {
|
2023-03-03 16:57:52 +08:00
|
|
|
return getExternalEmployeeMapper().listSome(ExtEmpPO.builder().username(param.getUsername()).build());
|
2023-03-01 09:05:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2023-03-03 16:57:52 +08:00
|
|
|
public PageInfo<ExtEmpPO> listPage(ExtEmpQueryParam param) {
|
|
|
|
|
List<ExtEmpPO> extEmpPOS = list(param);
|
|
|
|
|
return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), extEmpPOS, ExtEmpPO.class);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void save(ExtEmpSaveParam param) {
|
|
|
|
|
ExtEmpPO po = new ExtEmpPO();
|
|
|
|
|
BeanUtils.copyProperties(param, po);
|
|
|
|
|
|
|
|
|
|
po.setId(IdGenerator.generate());
|
|
|
|
|
po.setCreator((long) user.getUID());
|
|
|
|
|
po.setModifier((long) user.getUID());
|
|
|
|
|
Date now = new Date();
|
|
|
|
|
po.setCreateTime(now);
|
|
|
|
|
po.setUpdateTime(now);
|
|
|
|
|
po.setDeleteType(0);
|
|
|
|
|
|
2023-03-01 09:05:03 +08:00
|
|
|
getExternalEmployeeMapper().insertIgnoreNull(po);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2023-03-03 16:57:52 +08:00
|
|
|
public void update(ExtEmpSaveParam param) {
|
|
|
|
|
ExtEmpPO po = new ExtEmpPO();
|
|
|
|
|
BeanUtils.copyProperties(param, po);
|
|
|
|
|
|
|
|
|
|
po.setModifier((long) user.getUID());
|
|
|
|
|
Date now = new Date();
|
|
|
|
|
po.setUpdateTime(now);
|
|
|
|
|
|
2023-03-01 09:05:03 +08:00
|
|
|
getExternalEmployeeMapper().updateIgnoreNull(po);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void delete(Collection<Long> ids) {
|
|
|
|
|
if (CollectionUtils.isNotEmpty(ids)) {
|
|
|
|
|
ids.forEach(getExternalEmployeeMapper()::delete);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|