|
|
@@ -1,15 +1,11 @@
|
|
|
package nckd.jxccl.swc.utils;
|
|
|
|
|
|
-import com.grapecity.documents.excel.H;
|
|
|
+
|
|
|
import kd.bos.dataentity.entity.DynamicObject;
|
|
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
|
-import kd.bos.dataentity.utils.StringUtils;
|
|
|
import kd.bos.orm.query.QCP;
|
|
|
import kd.bos.orm.query.QFilter;
|
|
|
-import kd.hr.hbp.business.servicehelper.HRBaseServiceHelper;
|
|
|
import nckd.jxccl.swc.constants.SwcConstant;
|
|
|
-
|
|
|
-import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.ZoneId;
|
|
|
@@ -115,27 +111,26 @@ public class SwcUtils {
|
|
|
String endDateStr = dateToStr(endDate, 2);
|
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
- sb.append("/*dialect*/ SELECT c.femployeeid,d.fname empName,\n" +
|
|
|
- //" h.fnumber itemName,\n" +
|
|
|
- " d.fempnumber empNumber,\n" +
|
|
|
- " count(distinct to_char(b1.fpaydate,'yyyy-MM')) monthCount,\n" +
|
|
|
- " sum(g.fcalamountvalue) amount\n" +
|
|
|
- "from t_hsas_calpayrolltask b \n" +
|
|
|
- "left join t_hsas_calpayrolltask_a b1 on b1.fid = b.fid \n" +
|
|
|
- "left join t_hsas_calperson c on c.fcaltaskid = b.fid \n" +
|
|
|
- "left join t_hrpi_employee d on d.fid = c.femployeeid \n" +
|
|
|
- "left join t_hrpi_percre e on e.femployeeid = d.fid and e.fcredentialstypeid = '1010'\n" +
|
|
|
- "left join t_hsas_caltable f on f.fcaltaskid = b.fid and f.fcalpersonid = c.fid \n" +
|
|
|
- "left join t_hsas_caltableentry g on g.fid = f.fid \n" +
|
|
|
- "left join t_hsbs_salaryitem h on h.fid = g.fsalaryitemid \n" +
|
|
|
- "where 1 = 1 and b1.ftaskstatus in ('4','7','8','9') ---计算完成 9--已审核 7--审批处理中 8--审批通过 4 \n" +
|
|
|
- " and h.fnumber in ("+salaryitem+") \n");
|
|
|
- sb.append("and b1.fpaydate >= '"+startDateStr+"' \n");
|
|
|
- //sb.append("and b1.fpaydate >= '2025-01-01 00:00:00' \n");
|
|
|
- sb.append("and b1.fpaydate <= '"+endDateStr+"' \n");
|
|
|
- sb.append("and c.femployeeid in ("+empId+") \n");
|
|
|
- //sb.append("and c.femployeeid in (2311775636290546688) \n");
|
|
|
- sb.append("group by c.femployeeid,d.fname, d.fempnumber");
|
|
|
+ sb.append("/*dialect*/ SELECT c.femployeeid,d.fname empName, \n")
|
|
|
+ .append(" d.fempnumber empNumber, \n")
|
|
|
+ .append(" count(distinct to_char(b1.fpaydate,'yyyy-MM')) monthCount, \n")
|
|
|
+ .append(" sum(g.fcalamountvalue) amount \n")
|
|
|
+ .append("from t_hsas_calpayrolltask b \n")
|
|
|
+ .append("left join t_hsas_calpayrolltask_a b1 on b1.fid = b.fid \n")
|
|
|
+ .append("left join t_hsas_calperson c on c.fcaltaskid = b.fid \n")
|
|
|
+ .append("left join t_hrpi_employee d on d.fid = c.femployeeid \n")
|
|
|
+ .append("left join t_hrpi_percre e on e.femployeeid = d.fid and e.fcredentialstypeid = '1010'\n")
|
|
|
+ .append("left join t_hsas_caltable f on f.fcaltaskid = b.fid and f.fcalpersonid = c.fid \n")
|
|
|
+ .append("left join t_hsas_caltableentry g on g.fid = f.fid \n")
|
|
|
+ .append("left join t_hsbs_salaryitem h on h.fid = g.fsalaryitemid \n")
|
|
|
+ .append("where 1 = 1 and b1.ftaskstatus in ('4','7','8','9') ---计算完成 9--已审核 7--审批处理中 8--审批通过 4 \n")
|
|
|
+ .append("and h.fnumber in (").append(salaryitem).append(") \n")
|
|
|
+ .append("and b1.fpaydate >= '").append(startDateStr).append("' \n")
|
|
|
+ //.append("and b1.fpaydate >= '2025-01-01 00:00:00' \n")
|
|
|
+ .append("and b1.fpaydate <= '").append(endDateStr).append("' \n")
|
|
|
+ .append("and c.femployeeid in (").append(empId).append(") \n")
|
|
|
+ //.append("and c.femployeeid in (2311775636290546688) \n")
|
|
|
+ .append("group by c.femployeeid,d.fname, d.fempnumber");
|
|
|
|
|
|
return sb;
|
|
|
}
|