zm
2024-10-23 81cb8be7291b6841d0709cf672c0a20ad5e35a5c
src/main/java/com/product/administration/service/PunchRecordService.java
@@ -56,11 +56,23 @@
      DataTableEntity dt=baseDao.listTable(CmnConst.PRODUCT_OA_PUNCH_RECORD, "created_by=?", new Object[] {SpringMVCContextHolder.getCurrentUser().getUser_id()}, null, CmnConst.CREATED_UTC_DATETIME+" DESC", fse.getInteger(CmnConst.PAGESIZE), fse.getInteger(CmnConst.CPAGE));
      for (int i=0;i<dt.getRows();i++){
         FieldSetEntity fieldSetEntity = dt.getData().get(i);
         String punch_time_one = fieldSetEntity.getValue("punch_time_one").toString();
         Date date1=new Date(punch_time_one);
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
         String sign_date = dateFormat.format(date1);
         fieldSetEntity.setValue("sign_date",sign_date);
         String punch_time_one = null;
         if (fieldSetEntity.getString("punch_time_one") != null) {
            punch_time_one=fieldSetEntity.getValue("punch_time_one").toString();
         }else if (fieldSetEntity.getString("punch_time_two") != null) {
            punch_time_one=fieldSetEntity.getValue("punch_time_two").toString();
         }else if (fieldSetEntity.getString("punch_time_three") != null) {
            punch_time_one=fieldSetEntity.getValue("punch_time_three").toString();
         }else if (fieldSetEntity.getString("punch_time_four") != null) {
            punch_time_one=fieldSetEntity.getValue("punch_time_four").toString();
         }
         String sign_date=null;
         if (null!=punch_time_one){
            Date date1=new Date(punch_time_one);
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
             sign_date = dateFormat.format(date1);
            fieldSetEntity.setValue("sign_date",sign_date);
         }
         DateFormat dateFormatGet = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         //获取早退迟到的分钟数
@@ -94,7 +106,7 @@
         StringBuilder sbReplenish=new StringBuilder();
         sbReplenish.append(" SELECT T1.id,T1.uuid,T1.created_by,T1.applicant,T1.replenish_date,T1.reason,");
         sbReplenish.append(" SUBSTRING_INDEX( SUBSTRING_INDEX( T1.replacement_card_type, ',', T2.digit + 1 ), ',',- 1 ) AS type ");
         sbReplenish.append(" FROM product_oa_replenish_punch T1 ");
         sbReplenish.append(" FROM (select * from product_oa_replenish_punch where flow_flag=2) T1 ");
         sbReplenish.append(" JOIN ( SELECT 0 AS digit UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 ) T2");
         sbReplenish.append(" ON T2.digit < ( length( T1.replacement_card_type )- length( REPLACE ( T1.replacement_card_type, ',', '' ))+ 1 )");
         sbReplenish.append(" where t1.created_by=? ");