liupeng 4 tahun lalu
induk
melakukan
6ca0f90776

+ 22 - 0
code/sapparent/sapservice/src/main/java/org/fouram/entity/SapCheckdate.java

@@ -0,0 +1,22 @@
+package org.fouram.entity;
+
+import java.io.Serializable;
+
+import org.apache.ibatis.type.Alias;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@Alias(value = "SapCheckdate")
+public class SapCheckdate implements Serializable {
+	private static final long serialVersionUID = 1L;
+
+	private String id;
+	private String checkinDay;
+}

+ 4 - 5
code/sapparent/sapservice/src/main/java/org/fouram/mapper/SapCheckMapper.xml

@@ -63,7 +63,7 @@
 			d.checkinDate as checkoffDate,d.exceptionType as checkoffException,e.checkinDate as checkoutDate1,g.checkinDate as checkoutDate2,
 			d.checkinDate as checkoffDate,d.exceptionType as checkoffException,e.checkinDate as checkoutDate1,g.checkinDate as checkoutDate2,
 			f.createdDateTime as leaveCreatedTime, f.startDate as leaveStartDate,
 			f.createdDateTime as leaveCreatedTime, f.startDate as leaveStartDate,
 			f.endDate as leaveEndDate,f.deductionQuantity as leaveDay,f.`comment` as leaveComment, m.`day` as bukaDay, '正常' as result
 			f.endDate as leaveEndDate,f.deductionQuantity as leaveDay,f.`comment` as leaveComment, m.`day` as bukaDay, '正常' as result
-		from wx_user a join sap_checkdate b on b.weekday = 1 and a.delFlag=0 
+		from wx_user a join sap_checkdate b on a.delFlag=0 
 			and b.checkinDay >= #{startDay} and b.checkinDay <= #{endDay}
 			and b.checkinDay >= #{startDay} and b.checkinDay <= #{endDay}
 		LEFT JOIN sap_checkin c on a.userId = c.userId and b.checkinDay = c.checkinDay
 		LEFT JOIN sap_checkin c on a.userId = c.userId and b.checkinDay = c.checkinDay
 		LEFT JOIN sap_checkoff d on a.userId = d.userId and b.checkinDay = d.checkinDay
 		LEFT JOIN sap_checkoff d on a.userId = d.userId and b.checkinDay = d.checkinDay
@@ -83,8 +83,7 @@
 		replace(group_concat(case when a.checkinDay = '2020-05-14' then a.result else '' end ),',','') as '2020-05-14',
 		replace(group_concat(case when a.checkinDay = '2020-05-14' then a.result else '' end ),',','') as '2020-05-14',
 		replace(group_concat(case when a.checkinDay = '2020-05-15' then a.result else '' end ),',','') as '2020-05-15'
 		replace(group_concat(case when a.checkinDay = '2020-05-15' then a.result else '' end ),',','') as '2020-05-15'
 		from sap_check_report a, sap_checkdate b 
 		from sap_check_report a, sap_checkdate b 
-		where b.weekday = 1 and a.checkinDay=b.checkinDay 
-		where a.checkinDay >= #{startDay} and a.checkinDay <= #{endDay}
+		where a.checkinDay=b.checkinDay and a.checkinDay >= #{startDay} and a.checkinDay <= #{endDay}
 		group by a.userId, a.name;
 		group by a.userId, a.name;
 	</select>
 	</select>
 	
 	
@@ -154,7 +153,7 @@
 			checkinDate,checkinException,checkoffDate,checkoffException,checkoutDate1,checkoutDate2,leaveCreatedTime,
 			checkinDate,checkinException,checkoffDate,checkoffException,checkoutDate1,checkoutDate2,leaveCreatedTime,
 			leaveStartDate,leaveEndDate,leaveDay,leaveComment,bukaDay,result
 			leaveStartDate,leaveEndDate,leaveDay,leaveComment,bukaDay,result
 		from sap_check_report a, sap_checkdate b, wx_user c 
 		from sap_check_report a, sap_checkdate b, wx_user c 
-		where b.weekday = 1 and a.checkinDay=b.checkinDay and a.userId = c.userId
+		where a.checkinDay=b.checkinDay and a.userId = c.userId
 		<if test="departId != null and departId != ''">
 		<if test="departId != null and departId != ''">
 			and (a.firstDepartId=#{departId} or a.secondDepartId=#{departId})
 			and (a.firstDepartId=#{departId} or a.secondDepartId=#{departId})
 		</if>
 		</if>
@@ -179,7 +178,7 @@
 	<select id="findUserReportTotal" resultType="Long">
 	<select id="findUserReportTotal" resultType="Long">
 		SELECT count(1) 
 		SELECT count(1) 
 		from sap_check_report a, sap_checkdate b, wx_user c 
 		from sap_check_report a, sap_checkdate b, wx_user c 
-		where b.weekday = 1 and a.checkinDay=b.checkinDay and a.userId = c.userId
+		where a.checkinDay=b.checkinDay and a.userId = c.userId
 		<if test="departId != null and departId != ''">
 		<if test="departId != null and departId != ''">
 			and (a.firstDepartId=#{departId} or a.secondDepartId=#{departId})
 			and (a.firstDepartId=#{departId} or a.secondDepartId=#{departId})
 		</if>
 		</if>

+ 11 - 0
code/sapparent/sapservice/src/main/java/org/fouram/mapper/SapCheckdateMapper.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="SapCheckdateMapper">
+	<select id="queryOneByCheckinDay" resultType="SapCheckdate">
+		select * from sap_checkdate where checkinDay = #{checkinDay}
+	</select>
+
+	<insert id="saveOne">
+		insert into sap_checkdate(checkinDay) values(#{checkinDay})
+	</insert>
+</mapper>

+ 19 - 0
code/sapparent/sapservice/src/main/java/org/fouram/service/SapCheckdateService.java

@@ -0,0 +1,19 @@
+package org.fouram.service;
+
+import org.fouram.core.base.service.BaseService;
+import org.fouram.entity.SapCheckdate;
+import org.springframework.stereotype.Service;
+
+@Service
+public class SapCheckdateService extends BaseService {
+
+	public SapCheckdate queryOneByCheckinDay(String checkinDay) throws Exception {
+		return (SapCheckdate) findObject("SapCheckdateMapper.queryOneByCheckinDay", checkinDay);
+	}
+	
+	public void saveCheckout(String checkinDay) throws Exception {
+		if(queryOneByCheckinDay(checkinDay) == null) {
+			save("SapCheckdateMapper.saveOne", checkinDay);
+		}
+	}
+}