From e7fdc9967246ec64cc4f27d514c4ac1bdd488933 Mon Sep 17 00:00:00 2001
From: 杜洪波 <1074825718@qq.com>
Date: 星期一, 13 十月 2025 18:07:55 +0800
Subject: [PATCH] 代码提交
---
src/main/java/com/product/administration/service/PunchRecordService.java | 44 ++++++++++++++++++++++++++++----------------
1 files changed, 28 insertions(+), 16 deletions(-)
diff --git a/src/main/java/com/product/administration/service/PunchRecordService.java b/src/main/java/com/product/administration/service/PunchRecordService.java
index 83f72f5..48fe93b 100644
--- a/src/main/java/com/product/administration/service/PunchRecordService.java
+++ b/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=? ");
@@ -182,7 +194,7 @@
lateSb.append("涓婄彮鏈墦鍗�");
}
- if(ObjectUtil.isNotEmpty(fieldSetEntity.getValue("punch_time_four"))){
+ if(ObjectUtil.isNotEmpty(fieldSetEntity.getValue("punch_time_four"))&&ObjectUtil.isNotEmpty(fieldSetEntity.getValue("punch_range_four"))){
String punch_time_four = dateFormatHHmmss.format(fieldSetEntity.getValue("punch_time_four"));
punch_time_four_date = DateUtil.parse(punch_time_four);
if(punch_time_four_date.before(afternoon_work_off_date)){
@@ -213,7 +225,7 @@
int distance = Integer.parseInt(dataTableEntity.getData().get(0).getValue("distance").toString());
- if(ObjectUtil.isNotEmpty(fieldSetEntity.getValue("punch_time_one"))){
+ if(ObjectUtil.isNotEmpty(fieldSetEntity.getValue("punch_time_one"))&&ObjectUtil.isNotEmpty(fieldSetEntity.getValue("punch_range_one"))){
String punch_time_one1 = dateFormatHHmmss.format(fieldSetEntity.getValue("punch_time_one"));
punch_time_one_date = DateUtil.parse(punch_time_one1);
if(punch_time_one_date.after(morning_work_date)){
@@ -232,7 +244,7 @@
}
- if(ObjectUtil.isNotEmpty(fieldSetEntity.getValue("punch_time_two"))){
+ if(ObjectUtil.isNotEmpty(fieldSetEntity.getValue("punch_time_two"))&&ObjectUtil.isNotEmpty(fieldSetEntity.getValue("punch_range_two"))){
String punch_time_two= dateFormatHHmmss.format(fieldSetEntity.getValue("punch_time_two"));
punch_time_two_date = DateUtil.parse(punch_time_two);
if(punch_time_two_date.before(morning_work_off_date)){
@@ -248,7 +260,7 @@
}else {
earilySb.append("鏃╀笅鐝湭鎵撳崱"+" ");
}
- if(ObjectUtil.isNotEmpty(fieldSetEntity.getValue("punch_time_three"))){
+ if(ObjectUtil.isNotEmpty(fieldSetEntity.getValue("punch_time_three"))&&ObjectUtil.isNotEmpty(fieldSetEntity.getValue("punch_range_three"))){
String punch_time_three = dateFormatHHmmss.format(fieldSetEntity.getValue("punch_time_three"));
punch_time_three_date = DateUtil.parse(punch_time_three);
if(punch_time_three_date.after(afternoon_work_date)){
@@ -263,7 +275,7 @@
}else {
lateSb.append("鏃╀笂鐝湭鎵撳崱"+" ");
}
- if(ObjectUtil.isNotEmpty(fieldSetEntity.getValue("punch_time_four"))){
+ if(ObjectUtil.isNotEmpty(fieldSetEntity.getValue("punch_time_four"))&&ObjectUtil.isNotEmpty(fieldSetEntity.getValue("punch_range_four"))){
String punch_time_four = dateFormatHHmmss.format(fieldSetEntity.getValue("punch_time_four"));
punch_time_four_date = DateUtil.parse(punch_time_four);
if(punch_time_four_date.before(afternoon_work_off_date)){
@@ -287,10 +299,10 @@
}
}
- dt.setFieldFormat("punch_time_one", " HH:mm");
- dt.setFieldFormat("punch_time_two", " HH:mm");
- dt.setFieldFormat("punch_time_three", " HH:mm");
- dt.setFieldFormat("punch_time_four", " HH:mm");
+ dt.setFieldFormat("punch_time_one", "HH:mm");
+ dt.setFieldFormat("punch_time_two", "HH:mm");
+ dt.setFieldFormat("punch_time_three", "HH:mm");
+ dt.setFieldFormat("punch_time_four", "HH:mm");
baseDao.loadPromptData(dt);
return dt;
}
@@ -301,7 +313,7 @@
* @return
*/
public FieldSetEntity findRecordInfo(String uuid) {
- return baseDao.getFieldSetEntity(CmnConst.PRODUCT_OA_PUNCH_RECORD, uuid, true);
+ return baseDao.getFieldSetEntity(CmnConst.PRODUCT_OA_PUNCH_RECORD, uuid, false);
}
/**
--
Gitblit v1.9.2