Commit 08119240 by lal Committed by chenzg

提交

parent 40633759
......@@ -151,7 +151,7 @@ public class ClockInController {
String staputime = new SimpleDateFormat("HH:mm").format(punchstart);//应打卡开始时间
String entputime = new SimpleDateFormat("HH:mm").format(punchend);//应打卡结束时间
String DKputime = new SimpleDateFormat("HH:mm").format(time_);//打卡时间
boolean effectiveDate = ClockInTool.hourMinuteBetween(DKputime, staputime, entputime);
boolean effectiveDate = ClockInTool.hourMinuteBetween(DKputime, staputime, entputime,"HH:mm");
if (!effectiveDate) {
System.out.println("当前打卡时间不在范围内");
// 手动抛出异常
......
......@@ -269,13 +269,20 @@ public class ClockInTool {
* @return true在时间段内,false不在时间段内
* @throws Exception
*/
public static boolean hourMinuteBetween(String nowDate, String startDate, String endDate) throws Exception {
public static boolean hourMinuteBetween(String nowDate, String startDate, String endDate,String date_format){
SimpleDateFormat format = new SimpleDateFormat("HH:mm");
SimpleDateFormat format = new SimpleDateFormat(date_format);
Date now = format.parse(nowDate);
Date start = format.parse(startDate);
Date end = format.parse(endDate);
Date now = null;
Date start = null;
Date end = null;
try {
now = format.parse(nowDate);
start = format.parse(startDate);
end = format.parse(endDate);
} catch (ParseException e) {
e.printStackTrace();
}
long nowTime = now.getTime();
long startTime = start.getTime();
......@@ -334,6 +341,8 @@ public class ClockInTool {
df2 = new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss");
} else if (num == 2) {
df2 = new SimpleDateFormat("HH:mm");
}else if (num == 3) {
df2 = new SimpleDateFormat("yyyy-MM-dd' 'HH:mm");
}
return df2.format(date1);
......
......@@ -19,4 +19,6 @@ public interface KqglAssoRelationSummaryMapper extends BaseMapper<KqglAssoRelati
KqglAssoRelationSummary SecondaryValue(int userid, int approvaltype, String time);
List<KqglAssoRelationSummary> SpecificLeave(int userid,int approvaltype,String apptime);
List<KqglAssoRelationSummary> LeaveInvestigation(int userid,int approvaltype,String apptime);
}
......@@ -102,8 +102,8 @@
<select id="selectAdditionalList" resultMap="AdditionalMap">
SELECT emp.emp_num as empnum,
emp.`name` as empname,
IFNULL(c.name,'') as department,
gw.`name` as position
IFNULL(c.name,null) as department,
IFNULL(gw.`name`,null) as position
from yggl_main_emp emp
LEFT JOIN zzgl_bmgw_m as gw on gw.id = emp.bmgw_id
LEFT JOIN zzgl_bmgw_m as c ON c.id = gw.up_id
......
......@@ -65,6 +65,17 @@
and SUBSTR(res.app_time,1,7) = #{apptime}
</select>
<select id="LeaveInvestigation" resultMap="BaseResultMap">
select res.start_time,
res.end_time
from kqgl_asso_relation_summary res
where res.user_id = #{userid}
and res.approval_type = #{approvaltype}
and SUBSTR(res.app_time,1,7) = #{apptime}
GROUP BY res.start_time,res.end_time;
</select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoRelationSummary">
......
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