|
|
@@ -27,14 +27,12 @@ import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
import java.nio.charset.Charset;
|
|
|
import java.sql.Date;
|
|
|
+import java.sql.SQLException;
|
|
|
import java.text.MessageFormat;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
-/**
|
|
|
- * 胜生TXT下载
|
|
|
- */
|
|
|
public class CmpReportDynamicListHandlerEx extends CmpReportDynamicListHandler {
|
|
|
|
|
|
/**
|
|
|
@@ -136,8 +134,6 @@ public class CmpReportDynamicListHandlerEx extends CmpReportDynamicListHandler {
|
|
|
* @param ctbPeriodyear 统计年
|
|
|
* @param ctbMonth 统计月
|
|
|
* @param calNumber 计算规则
|
|
|
- *
|
|
|
- *
|
|
|
*/
|
|
|
public String getSql(Context ctx,String personId,String ctbPeriodyear,String ctbMonth,String calNumber) throws Exception {
|
|
|
SimpleDateFormat outputFormatter = new SimpleDateFormat("dd/MM/yyyy");
|
|
|
@@ -151,8 +147,8 @@ public class CmpReportDynamicListHandlerEx extends CmpReportDynamicListHandler {
|
|
|
query.append("person.CFPortuguesesurname personPX,").append("\n");
|
|
|
query.append("person.CFPortuguesename personPM,").append("\n");
|
|
|
query.append("sc.S5 s5,").append("\n");
|
|
|
- query.append("sc.S93 s93,").append("\n");
|
|
|
- query.append("res.FBIZDATE bizDate").append("\n");
|
|
|
+ query.append("sc.S94 s93,").append("\n");
|
|
|
+ query.append("res.FBIZDATE bizDate ").append("\n");
|
|
|
query.append("FROM T_HR_SCmpCalTable sc ").append("\n");
|
|
|
query.append("left join T_HR_SCalScheme ch on sc.FCALSCHEMEID = ch.fid").append("\n");
|
|
|
query.append("left join t_hr_personposition pp on sc.FPERSONID = pp.FPERSONID ").append("\n");
|
|
|
@@ -185,7 +181,7 @@ public class CmpReportDynamicListHandlerEx extends CmpReportDynamicListHandler {
|
|
|
String personPX = rowSet.getString("personPX") == null ? "" : rowSet.getString("personPX");//葡文姓
|
|
|
String personPM = rowSet.getString("personPM") == null ? "" : rowSet.getString("personPM");//葡文名
|
|
|
BigDecimal s5 = rowSet.getBigDecimal("s5");//应纳税所得额
|
|
|
- BigDecimal s93 = rowSet.getBigDecimal("s93");//职业税
|
|
|
+ BigDecimal s93 = rowSet.getBigDecimal("s93"); //測試環境 93 职业税s94
|
|
|
Date bizDate = rowSet.getDate("bizDate");//员工离职日期
|
|
|
if (bizDate != null){
|
|
|
leftStr = outputFormatter.format(bizDate);
|
|
|
@@ -193,21 +189,30 @@ public class CmpReportDynamicListHandlerEx extends CmpReportDynamicListHandler {
|
|
|
String[] s5split = convertToString(s5).split("\\.");
|
|
|
String strS5 = s5split[0];
|
|
|
if (StringUtils.isNotBlank(strS5)){
|
|
|
- if (convertToBigDecimal(strS5).compareTo(BigDecimal.ZERO) > 0){
|
|
|
+// if (convertToBigDecimal(strS5).compareTo(BigDecimal.ZERO) > 0){
|
|
|
s5Str += strLengthReturn(strS5,11,"0",0);
|
|
|
- }
|
|
|
+// }
|
|
|
+ }
|
|
|
+ if(s5split.length > 1) {
|
|
|
+ s5Str += s5split[1];
|
|
|
+
|
|
|
+ }else {
|
|
|
+ s5Str += "00" ;
|
|
|
}
|
|
|
- s5Str += s5split[1];
|
|
|
|
|
|
|
|
|
String[] s93split = convertToString(s93).split("\\.");
|
|
|
String strS93 = s93split[0];
|
|
|
if (StringUtils.isNotBlank(strS93)){
|
|
|
- if (convertToBigDecimal(strS93).compareTo(BigDecimal.ZERO) > 0){
|
|
|
+// if (convertToBigDecimal(strS93).compareTo(BigDecimal.ZERO) > 0){
|
|
|
s93Str += strLengthReturn(strS93,11,"0",0);
|
|
|
- }
|
|
|
+// }
|
|
|
+ }
|
|
|
+ if(s93split.length > 1) {
|
|
|
+ s93Str += s93split[1];
|
|
|
+ }else {
|
|
|
+ s93Str += "00" ;
|
|
|
}
|
|
|
- s93Str += s93split[1];
|
|
|
/**
|
|
|
* 员工对应组织 的 雇主编号 --7
|
|
|
* 营业税档案编号或僱主编号文字部份 空 --1
|
|
|
@@ -254,8 +259,12 @@ public class CmpReportDynamicListHandlerEx extends CmpReportDynamicListHandler {
|
|
|
}
|
|
|
|
|
|
public String convertToString(BigDecimal number) {
|
|
|
- BigDecimal bigDecimal = number.setScale(2, RoundingMode.HALF_UP.ordinal());
|
|
|
- return bigDecimal.toString();
|
|
|
+ if(null != number){
|
|
|
+ BigDecimal bigDecimal = number.setScale(2, RoundingMode.HALF_UP.ordinal());
|
|
|
+ return bigDecimal.toString();
|
|
|
+ } else {
|
|
|
+ return "0.00";
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|