Commit 1b8c4d62 by jianan

临时薪资单2

parent f95cc6e3
......@@ -137,51 +137,68 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
String practitionerIdEG = requestVO.getPractitionerIdEG();
Long practitionerId = requestVO.getPractitionerId();
if(!Strings.isNullOrEmpty(practitionerIdEG) && practitionerId != null){
List<PayScaleInfo> payScaleInfoListAll = aclPractitionerDALService.findPayScaleByPractitionerEG(practitionerIdEG);
if(!payScaleInfoListAll.isEmpty()){
Map<String,String> dtlTypeMap = new HashMap<>();
Map<String,String> titleMap = new HashMap<>();
List<OptionsEGolden> optionsEGoldenList = mdDropOptionsDALService.findByMasterIdsE(Collections.singletonList(101));
optionsEGoldenList.forEach(i->dtlTypeMap.put(i.getOptAttr(),i.getOptName()));
List<OptionsEGolden> titleList = mdDropOptionsDALService.findAllTitleEG();
titleList.forEach(i->titleMap.put(i.getTitleCode(),i.getTitleName()));
Map<Long,PayScaleInfo> payScaleInfoMap = new HashMap<>();
PayScaleInfo payScaleInfo;
Long time;
for(PayScaleInfo item : payScaleInfoListAll){
time = item.getMonDtlPeriod();
if(payScaleInfoMap.containsKey(time)){
payScaleInfo = payScaleInfoMap.get(time);
calculateRAmount(payScaleInfo,item);
}else{
calculateRAmount(item,item);
item.setMonDtlItem("实发薪水");
payScaleInfoMap.put(time,item);
item.setDrpTitleCode(titleMap.get(item.getDrpTitleCode()));
item.setMonDtlType(dtlTypeMap.get(item.getMonDtlType()));
}
}
//修改金钱格式
for(PayScaleInfo item : payScaleInfoListAll){
item.setMonDtlRAmount(CommonUtil.doubleFormat(item.getMonDtlRAmount(),2));
}
List<PayScaleInfo> resultList = new ArrayList<>(payScaleInfoMap.values());
// 加入临时薪资表的数据
List<AgAclLifePractitionerSalary> list = practitionerSalaryMapper.queryListByPractitionerId(practitionerId);
responseVO.setList(list);
// if(!Strings.isNullOrEmpty(practitionerIdEG)){
// List<PayScaleInfo> payScaleInfoListAll = aclPractitionerDALService.findPayScaleByPractitionerEG(practitionerIdEG);
// if(!payScaleInfoListAll.isEmpty()){
// Map<String,String> dtlTypeMap = new HashMap<>();
// Map<String,String> titleMap = new HashMap<>();
// List<OptionsEGolden> optionsEGoldenList = mdDropOptionsDALService.findByMasterIdsE(Collections.singletonList(101));
// optionsEGoldenList.forEach(i->dtlTypeMap.put(i.getOptAttr(),i.getOptName()));
// List<OptionsEGolden> titleList = mdDropOptionsDALService.findAllTitleEG();
// titleList.forEach(i->titleMap.put(i.getTitleCode(),i.getTitleName()));
// Map<Integer,PayScaleInfo> payScaleInfoMap = new HashMap<>();
// PayScaleInfo payScaleInfo;
// Integer time;
// for(PayScaleInfo item : payScaleInfoListAll){
// time = item.getMonDtlPeriod();
// if(payScaleInfoMap.containsKey(time)){
// payScaleInfo = payScaleInfoMap.get(time);
// calculateRAmount(payScaleInfo,item);
// }else{
// calculateRAmount(item,item);
// item.setMonDtlItem("实发薪水");
// payScaleInfoMap.put(time,item);
// item.setDrpTitleCode(titleMap.get(item.getDrpTitleCode()));
// item.setMonDtlType(dtlTypeMap.get(item.getMonDtlType()));
//
// }
// }
// //修改金钱格式
// for(PayScaleInfo item : payScaleInfoListAll){
// item.setMonDtlRAmount(CommonUtil.doubleFormat(item.getMonDtlRAmount(),2));
// }
// List<PayScaleInfo> resultList = new ArrayList<>(payScaleInfoMap.values());
// resultList.sort(Comparator.comparingInt(PayScaleInfo :: getMonDtlPeriod).reversed());
// responseVO.setPayScaleInfos(resultList);
// }
// responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
// }else{
// String[] params = {"practitionerIdEG"};
// responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("610002", params)));
// }
translateObj(list, resultList);
// 排序
resultList.sort(Comparator.comparingLong(PayScaleInfo :: getMonDtlPeriod).reversed());
responseVO.setPayScaleInfos(resultList);
}
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
}else{
String[] params = {"practitionerIdEG, practitionerId"};
responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("610002", params)));
}
return responseVO;
}
private void translateObj(List<AgAclLifePractitionerSalary> list, List<PayScaleInfo> resultList) {
PayScaleInfo payScaleInfo;
for (AgAclLifePractitionerSalary salary : list) {
payScaleInfo = new PayScaleInfo();
payScaleInfo.setMonShId(salary.getId());
payScaleInfo.setPdfOssPath(salary.getPdfOssPath());
payScaleInfo.setMonDtlPeriod(Long.valueOf(salary.getYearMonth()));
payScaleInfo.setMonDtlAmount(salary.getPayableAmount().doubleValue());
payScaleInfo.setMonDtlRAmount(salary.getNetAmount().doubleValue());
resultList.add(payScaleInfo);
}
}
@Override
public PayScalePdfResponseVO payScalePdf(PayScalePdfRequestVO requestVO) {
PayScalePdfResponseVO responseVO = new PayScalePdfResponseVO();
......@@ -452,8 +469,8 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
private void calculateRAmount(PayScaleInfo payScaleInfoMain, PayScaleInfo payScaleInfoElse) {
if(payScaleInfoMain != null && payScaleInfoElse != null){
Integer shIdMain = payScaleInfoMain.getMonShId();
Integer shIdElse = payScaleInfoElse.getMonShId();
Long shIdMain = payScaleInfoMain.getMonShId();
Long shIdElse = payScaleInfoElse.getMonShId();
Double all = payScaleInfoMain.getMonDtlRAmount();
double allA = (shIdMain.equals(shIdElse))? 0D : payScaleInfoMain.getMonDtlAmount();
Double temp = payScaleInfoElse.getMonDtlAmount();
......
package com.yd.api.practitioner.vo.payscale;
public class PayScaleInfo {
private Integer monShId;
private Long monShId;
private String salMstId;
private String drpTitleCode;
private String monDtlType;
private String monDtlItem;
private Integer monDtlPeriod;
private Long monDtlPeriod;
private Double monDtlAmount;
private Double monDtlRAmount;
private String createDate;
private String createUser;
private String pdfOssPath;
public Integer getMonShId() {
public Long getMonShId() {
return monShId;
}
public void setMonShId(Integer monShId) {
public void setMonShId(Long monShId) {
this.monShId = monShId;
}
......@@ -84,11 +85,19 @@ public class PayScaleInfo {
this.createUser = createUser;
}
public Integer getMonDtlPeriod() {
public Long getMonDtlPeriod() {
return monDtlPeriod;
}
public void setMonDtlPeriod(Integer monDtlPeriod) {
public void setMonDtlPeriod(Long monDtlPeriod) {
this.monDtlPeriod = monDtlPeriod;
}
public String getPdfOssPath() {
return pdfOssPath;
}
public void setPdfOssPath(String pdfOssPath) {
this.pdfOssPath = pdfOssPath;
}
}
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