Commit a305dc3e authored by fangxinjiang's avatar fangxinjiang

代码优化-fxj

parent 57746806
......@@ -69,7 +69,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 养老基数上限
*/
@ExcelAttribute(name = "养老基数上限", isNotEmpty = true,isFloat = true,max = "999999999.99",min = 0)
@ExcelAttribute(name = "养老基数上限", isNotEmpty = true,max = "999999999.99",min = 0)
@Schema(description = "养老基数上限")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("养老基数上限")
......@@ -78,7 +78,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 养老基数下限
*/
@ExcelAttribute(name = "养老基数下限", isNotEmpty = true,isFloat = true,max = "999999999.99",min = 0)
@ExcelAttribute(name = "养老基数下限", isNotEmpty = true,max = "999999999.99",min = 0)
@Schema(description = "养老基数下限")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("养老基数下限")
......@@ -87,7 +87,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 工伤基数上限
*/
@ExcelAttribute(name = "工伤基数上限",isFloat = true,max = "999999999.99",min = 0)
@ExcelAttribute(name = "工伤基数上限",max = "999999999.99",min = 0)
@Schema(description = "工伤基数上限")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("工伤基数上限")
......@@ -96,7 +96,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 工伤基数下限
*/
@ExcelAttribute(name = "工伤基数下限",isFloat = true,max = "999999999.99",min = 0)
@ExcelAttribute(name = "工伤基数下限",max = "999999999.99",min = 0)
@Schema(description = "工伤基数下限")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("工伤基数下限")
......@@ -105,7 +105,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 医疗基数上限
*/
@ExcelAttribute(name = "医疗基数上限",isFloat = true,max = "999999999.99",min = 0)
@ExcelAttribute(name = "医疗基数上限",max = "999999999.99",min = 0)
@Schema(description = "医疗基数上限")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("医疗基数上限")
......@@ -114,7 +114,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 医疗基数下限
*/
@ExcelAttribute(name = "医疗基数下限",isFloat = true,max = "999999999.99",min = 0)
@ExcelAttribute(name = "医疗基数下限",max = "999999999.99",min = 0)
@Schema(description = "医疗基数下限")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("医疗基数下限")
......@@ -123,7 +123,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 生育基数上限
*/
@ExcelAttribute(name = "生育基数上限",isFloat = true,max = "999999999.99",min = 0)
@ExcelAttribute(name = "生育基数上限",max = "999999999.99",min = 0)
@Schema(description = "生育基数上限")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("生育基数上限")
......@@ -132,7 +132,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 生育基数下限
*/
@ExcelAttribute(name = "生育基数下限",isFloat = true,max = "999999999.99",min = 0)
@ExcelAttribute(name = "生育基数下限",max = "999999999.99",min = 0)
@Schema(description = "生育基数下限")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("生育基数下限")
......@@ -141,7 +141,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 失业基数上限
*/
@ExcelAttribute(name = "失业基数上限",isFloat = true,max = "999999999.99",min = 0)
@ExcelAttribute(name = "失业基数上限",max = "999999999.99",min = 0)
@Schema(description = "失业基数上限")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("失业基数上限")
......@@ -150,7 +150,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 失业基数下限
*/
@ExcelAttribute(name = "失业基数下限",isFloat = true,max = "999999999.99",min = 0)
@ExcelAttribute(name = "失业基数下限",max = "999999999.99",min = 0)
@Schema(description = "失业基数下限")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("失业基数下限")
......@@ -159,7 +159,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 大病基数上限
*/
@ExcelAttribute(name = "大病基数上限",isFloat = true,max = "999999999.99",min = 0)
@ExcelAttribute(name = "大病基数上限",max = "999999999.99",min = 0)
@Schema(description = "大病基数上限")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("大病基数上限")
......@@ -168,7 +168,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 大病基数下限
*/
@ExcelAttribute(name = "大病基数下限",isFloat = true,max = "999999999.99",min = 0)
@ExcelAttribute(name = "大病基数下限",max = "999999999.99",min = 0)
@Schema(description = "大病基数下限")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("大病基数下限")
......@@ -222,7 +222,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 单位大病金额
*/
@ExcelAttribute(name = "单位大病金额",isFloat = true,max = "999999999.99",min = 0)
@ExcelAttribute(name = "单位大病金额",max = "999999999.99",min = 0)
@Schema(description = "单位大病金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位大病金额")
......@@ -231,7 +231,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 个人大病金额
*/
@ExcelAttribute(name = "个人大病金额",isFloat = true,max = "999999999.99",min = 0)
@ExcelAttribute(name = "个人大病金额",max = "999999999.99",min = 0)
@Schema(description = "个人大病金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人大病金额")
......@@ -249,7 +249,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 个人医疗比例
*/
@ExcelAttribute(name = "个人医疗比例", isNotEmpty = true,isFloat = true,max = "100.01",min = 0)
@ExcelAttribute(name = "个人医疗比例", isNotEmpty = true,max = "100.01",min = 0)
@Schema(description = "个人医疗比例")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人医疗比例")
......@@ -258,7 +258,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 单位生育缴纳比例
*/
@ExcelAttribute(name = "单位生育比例", isNotEmpty = true,isFloat = true,max = "100.01",min = 0)
@ExcelAttribute(name = "单位生育比例", isNotEmpty = true,max = "100.01",min = 0)
@Schema(description = "单位生育比例")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位生育比例")
......@@ -267,7 +267,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 单位养老缴纳比例
*/
@ExcelAttribute(name = "单位养老比例", isNotEmpty = true,isFloat = true,max = "100.01",min = 0)
@ExcelAttribute(name = "单位养老比例", isNotEmpty = true,max = "100.01",min = 0)
@Schema(description = "单位养老比例")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位养老比例")
......@@ -276,7 +276,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 个人养老比例
*/
@ExcelAttribute(name = "个人养老比例", isNotEmpty = true,isFloat = true,max = "100.01",min = 0)
@ExcelAttribute(name = "个人养老比例", isNotEmpty = true,max = "100.01",min = 0)
@Schema(description = "个人养老比例")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人养老比例")
......@@ -286,7 +286,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 单位工伤缴纳比例
*/
@ExcelAttribute(name = "单位工伤比例", isNotEmpty = true,isFloat = true,max = "100.01",min = 0)
@ExcelAttribute(name = "单位工伤比例", isNotEmpty = true,max = "100.01",min = 0)
@Schema(description = "单位工伤比例")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位工伤比例")
......@@ -295,7 +295,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 单位失业缴纳比例
*/
@ExcelAttribute(name = "单位失业比例", isNotEmpty = true,isFloat = true,max = "100.01",min = 0)
@ExcelAttribute(name = "单位失业比例", isNotEmpty = true,max = "100.01",min = 0)
@Schema(description = "单位失业比例")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位失业比例")
......@@ -304,7 +304,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 个人失业比例
*/
@ExcelAttribute(name = "个人失业比例", isNotEmpty = true,isFloat = true,max = "100.01",min = 0)
@ExcelAttribute(name = "个人失业比例", isNotEmpty = true,max = "100.01",min = 0)
@Schema(description = "个人失业比例")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人失业比例")
......@@ -313,7 +313,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 单位大病比例
*/
@ExcelAttribute(name = "单位大病比例",isFloat = true,max = "100.01",min = 0)
@ExcelAttribute(name = "单位大病比例",max = "100.01",min = 0)
@Schema(description = "单位大病比例")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位大病比例")
......@@ -322,7 +322,7 @@ public class SysBaseSetSocialInsertVo extends RowIndex implements Serializable {
/**
* 个人大病比例
*/
@ExcelAttribute(name = "个人大病比例",isFloat = true,max = "100.01",min = 0)
@ExcelAttribute(name = "个人大病比例",max = "100.01",min = 0)
@Schema(description = "个人大病比例")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人大病比例")
......
......@@ -653,7 +653,9 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
String insurancePension = null;
String startDateTemp = null;
String doMonthTemp = null;
for (int i = 0; i < excelVOList.size(); i++) {
infoVo = new SysBaseSetInfo();
excel = excelVOList.get(i);
hold = holdMap.get(excel.getDepartName());
......@@ -753,9 +755,7 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
infoVo.setLowerUnemployment(excel.getLowerPersion());
infoVo.setUpperLimit(excel.getUpPersion());
infoVo.setLowerLimit(excel.getLowerPersion());
//如果不是按比例后面要清空
excel.setUpBig(excel.getUpPersion());
excel.setLowerBig(excel.getLowerPersion());
}else if (CommonConstants.ONE_STRING.equals(excel.getIsSameBase())){
//工伤、医疗、生育、失业 必填
if (Common.isEmpty(excel.getUpInjury()) || Common.isEmpty(excel.getLowerInjury())
......@@ -781,10 +781,24 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
infoVo.setUpUnemployment(excel.getUpUnemployment());
infoVo.setLowerUnemployment(excel.getLowerUnemployment());
excel.setUpBig(excel.getUpBig());
excel.setLowerBig(excel.getLowerBig());
}
//各种比例需在0~100内
if (infoVo.getUpPersion().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getUpInjury().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getUpMedical().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getUpBirth().compareTo( BigDecimal.ZERO) < 0
|| infoVo.getUpUnemployment().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getLowerPersion().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getLowerInjury().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getLowerMedical().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getLowerBirth().compareTo( BigDecimal.ZERO) < 0
|| infoVo.getLowerUnemployment().compareTo(BigDecimal.ZERO) < 0){
errorMsg = new ErrorMessage(excel.getRowIndex(),"基数上下限不能小于0,请修改后重新提交",excel);
errorMessageList.add(errorMsg);
continue;
}
//养老基数下限不可大于养老基数上限
if (null != infoVo.getUpPersion()
&& null != infoVo.getLowerPersion()
......@@ -880,12 +894,12 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
infoVo.setUpBig(excel.getUpPersion());
infoVo.setLowerBig(excel.getLowerPersion());
}else {
//大病缴纳周期为按月缴纳方式为按比例需要填写金额 无值提示
//大病缴纳周期为按月缴纳方式为按比例需要填比例 无值提示
if (null == excel.getUpBig()
|| null == excel.getLowerBig()
|| excel.getLowerBig().compareTo(BigDecimal.ZERO) < 0
|| excel.getUpBig().compareTo(BigDecimal.ZERO) < 0){
errorMsg = new ErrorMessage(excel.getRowIndex(),"大病是否收取为是时,大病缴纳周期为“按月且按比例”的,单位或个人大病基数上下限字段必填,仅填写正确基数即可,请修改后重新提交",excel);
errorMsg = new ErrorMessage(excel.getRowIndex(),"大病基数上下限不可小于0,请修改后重新提交",excel);
errorMessageList.add(errorMsg);
continue;
}
......@@ -897,7 +911,7 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
|| null == excel.getPayPersonalPro()
|| excel.getPayPersonalPro().compareTo(BigDecimal.ZERO) < 0
|| excel.getPayPersonalPro().compareTo(BigDecimal.ZERO) < 0){
errorMsg = new ErrorMessage(excel.getRowIndex(),"大病是否收取为是时,大病缴纳周期为“按月”的,单位或个人大病比例字段必填,填写正确比例即可,请修改后重新提交",excel);
errorMsg = new ErrorMessage(excel.getRowIndex(),"大病是否收取为是时,大病缴纳周期为“按月”的,单位或个人大病比例字段必填,填写正确比例即可,请修改后重新提交",excel);
errorMessageList.add(errorMsg);
continue;
}
......@@ -913,7 +927,7 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
|| null == excel.getChargePersonal()
|| excel.getChargePersonal().compareTo(BigDecimal.ZERO) < 0
|| excel.getChargeCompany().compareTo(BigDecimal.ZERO) < 0){
errorMsg = new ErrorMessage(excel.getRowIndex(),"大病是否收取为是时,大病缴纳周期为“按年”或大病缴纳周期为“按月”且缴纳方式为“按定值”时,单位或个人大病金额字段必填,填写正确金额即可,请修改后重新提交",excel);
errorMsg = new ErrorMessage(excel.getRowIndex(),"大病是否收取为是时,大病缴纳周期为“按年”或大病缴纳周期为“按月”且缴纳方式为“按定值”时,单位或个人大病金额字段必填,填写正确金额即可,请修改后重新提交",excel);
errorMessageList.add(errorMsg);
continue;
}
......@@ -1046,22 +1060,6 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
errorMessageList.add(errorMsg);
continue;
}
//各种比例需在0~100内
if (infoVo.getUpPersion().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getUpInjury().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getUpMedical().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getUpBirth().compareTo( BigDecimal.ZERO) < 0
|| infoVo.getUpUnemployment().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getLowerPersion().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getLowerInjury().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getLowerMedical().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getLowerBirth().compareTo( BigDecimal.ZERO) < 0
|| infoVo.getLowerUnemployment().compareTo(BigDecimal.ZERO) < 0){
errorMsg = new ErrorMessage(excel.getRowIndex(),"基数上下限不能小于0,请修改后重新提交",excel);
errorMessageList.add(errorMsg);
continue;
}
//单位及个人比例合计
infoVo.setUnitProSum(BigDecimalUtils.safeAdd(infoVo.getUnitInjuryPro(),
infoVo.getUnitMedicalPro(),
......@@ -1084,12 +1082,6 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
errorMessageList.add(errorMsg);
continue;
}
if (infoVo.getUpBig().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getLowerBig().compareTo(BigDecimal.ZERO) < 0){
errorMsg = new ErrorMessage(excel.getRowIndex(),"大病上下限不可小于0,请修改后重新提交",excel);
errorMessageList.add(errorMsg);
continue;
}
}
infoVo.setStatus(CommonConstants.ZERO_INT);
infoVo.setBaseType(CommonConstants.ZERO_STRING);
......@@ -1250,7 +1242,7 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
}
if (excel.getLowerLimit().compareTo(BigDecimal.ZERO) < 0
|| excel.getUpperLimit().compareTo(BigDecimal.ZERO) < 0) {
errorMsg = new ErrorMessage(excel.getRowIndex(),"基数下限不可小于0,请修改后重新提交。",excel);
errorMsg = new ErrorMessage(excel.getRowIndex(),"基数下限不可小于0,请修改后重新提交。",excel);
errorMessageList.add(errorMsg);
continue;
}
......
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