Commit 7f607ba8 by jianan

新零时薪资单

parent fbee436d
......@@ -35,7 +35,9 @@ import com.yd.dal.entity.practitioner.payscale.PayScaleBasicInfo;
import com.yd.dal.entity.product.Product;
import com.yd.dal.entity.product.ProductE;
import com.yd.dal.entity.product.ProductPlan;
import com.yd.dal.entity.salary.AgAclSalary;
import com.yd.dal.mapper.practitioner.AgAclLifePractitionerSalaryMapper;
import com.yd.dal.mapper.salary.AgAclSalaryMapper;
import com.yd.dal.service.agms.AgmsFortuneDALService;
import com.yd.dal.service.customer.AclFileUploadDALService;
import com.yd.dal.service.customer.AclPractitionerDALService;
......@@ -111,6 +113,8 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
private N22SalaryService n22SalaryService;
@Autowired
private AgmsFortuneDALService agmsFortuneDalService;
@Autowired
private AgAclSalaryMapper agAclSalaryMapper;
@Override
public PolicyListQueryResponseVO policyListQuery(PolicyListQueryRequestVO requestVO) {
......@@ -378,7 +382,7 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
try {
if ("0".equals(isHistory)) {
// 查询本年
resultList = this.queryPayScaleListFromN22(requestVO);
resultList = this.queryNew(requestVO);
} else if ("1".equals(isHistory)) {
// 查询历史才需要执行
resultList = this.historyEG(requestVO);
......@@ -396,8 +400,59 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
return responseVO;
}
private List<PayScaleInfo> queryAll(PayScaleQueryRequestVO requestVO) throws Exception {
private List<PayScaleInfo> queryNew(PayScaleQueryRequestVO requestVO) throws Exception {
// 1.先查本地新基本法的薪资
List<AgAclSalary> newSalaryList = agAclSalaryMapper.queryListByPractitionerId(requestVO.getPractitionerId());
List<PayScaleInfo> salaryList = this.translateAgAclSalaryToPayScaleInfo(newSalaryList);
// 2.再查N22
List<PayScaleInfo> listN22 = this.queryPayScaleListFromN22(requestVO);
// 3.合并结果集,先取new的,再取N22的
Map<String, PayScaleInfo> map = new HashMap<>();
String yearMonth = "";
String year = "";
String month = "";
for (PayScaleInfo newSalary : salaryList) {
map.put(newSalary.getMonDtlPeriod(), newSalary);
}
for (PayScaleInfo infoN22 : listN22) {
year = infoN22.getYears() == null ? "0" : infoN22.getYears();
month = infoN22.getMonth() == null ? "0" : infoN22.getMonth();
yearMonth = this.getYearMonth(year, month);
infoN22.setMonDtlPeriod(yearMonth);
if (!map.containsKey(yearMonth)) {
map.put(yearMonth, infoN22);
}
}
ArrayList<PayScaleInfo> resultList = new ArrayList<>(map.values());
// 排序
resultList.sort(Comparator.comparing(PayScaleInfo :: getMonDtlPeriod).reversed());
return resultList;
}
private List<PayScaleInfo> translateAgAclSalaryToPayScaleInfo(List<AgAclSalary> newSalaryList) {
List<PayScaleInfo> resultList = new ArrayList<>();
PayScaleInfo payScaleInfo;
for (AgAclSalary item : newSalaryList) {
payScaleInfo = new PayScaleInfo();
payScaleInfo.setMonShId(item.getId());
payScaleInfo.setIsBasic(1);
payScaleInfo.setMonDtlPeriod(item.getYearMonth());
payScaleInfo.setMonDtlAmount(item.getAmount().doubleValue());
payScaleInfo.setMonDtlRAmount(item.getAfterTaxAmount().doubleValue());
resultList.add(payScaleInfo);
}
return resultList;
}
private List<PayScaleInfo> queryAll(PayScaleQueryRequestVO requestVO) throws Exception {
List<PayScaleInfo> listN22 = this.queryNew(requestVO);
List<PayScaleInfo> historyEG = this.historyEG(requestVO);
Map<String, PayScaleInfo> map = new HashMap<>();
......
......@@ -15,6 +15,7 @@ public class PayScaleInfo {
private String loginName;
private String years;
private String month;
private Integer isBasic;
public Long getMonShId() {
return monShId;
......@@ -147,4 +148,12 @@ public class PayScaleInfo {
", month='" + month + '\'' +
'}';
}
public Integer getIsBasic() {
return isBasic;
}
public void setIsBasic(Integer isBasic) {
this.isBasic = isBasic;
}
}
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