Forráskód Böngészése

首页获取最近打卡信息修改

anderx 1 éve%!(EXTRA string=óta)
szülő
commit
197b08bdaf

+ 5 - 0
src/main/java/com/goafanti/common/dao/PublicReleaseMapper.java

@@ -5,6 +5,7 @@ import com.goafanti.common.model.OutPublicReleaseCount;
 import com.goafanti.common.model.PublicRelease;
 import com.goafanti.weChat.bo.OutPublicRelease;
 import com.goafanti.weChat.bo.OutPublicReleaseAndDetails;
+import com.goafanti.weChat.bo.OutPublicReleaseList;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.Date;
@@ -56,4 +57,8 @@ public interface PublicReleaseMapper {
     List<OutFinanceCount> selectByaidAndDate(@Param("aid") String aid, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
     List<PublicRelease> selectByOrderNo(String orderNo);
+
+    List<PublicRelease> selectMyNewPublic(String adminId);
+
+    OutPublicReleaseList selectOutListBoById(Integer id);
 }

+ 18 - 0
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -723,5 +723,23 @@
         from public_release
         where order_no= #{orderNo}
     </select>
+    <select id="selectMyNewPublic" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        where a.status in(1,2)  and a.aid = #{aid}
+        order by a.release_start desc limit 10
+    </select>
+    <select id="selectOutListBoById" resultType="com.goafanti.weChat.bo.OutPublicReleaseList">
+        select  a.id ,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.aid,a.public_type publicType,
+                date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,
+                date_format(a.update_time ,'%Y-%m-%d %H:%i:%S') updateTimes,a.update_status updateStatus,a.district_name districtName,
+                a.assist,a.assist_aid assistAid,a.assist_aid_name assistAidName,a.type,a.main_name mainName,a.reject_name rejectName,
+                a.assistant_aid assistantAid ,a.assistant_name assistantName,a.public_again publicAgain,a.user_names userNames,
+                ea.total_amount expenseAmount ,a.clock_in clockIn,c2.name reviewerName,a.tech_start_process techStartProcess
+        from public_release a  left join admin c on a.aid =c.id
+                               left join admin c2 on c.reviewer=c2.id
+                               left join (select * from expense_account where status in (0,1,2,3)) ea on a.id =ea.prid
+        where a.id= #{id}
+    </select>
 </mapper>
 

+ 26 - 7
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -1346,15 +1346,34 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 
 	@Override
 	public Object getMyNewPublic() {
-		List<OutPublicReleaseList> myPublic = getMyPublic(0,1);
-		if (myPublic.isEmpty()){
-			List<OutPublicReleaseList> myPublic2 = getMyPublic(0,0);
-			if (!myPublic2.isEmpty()){
-				return myPublic2.get(0);
+		List<PublicRelease> myPublic=publicReleaseMapper.selectMyNewPublic(TokenManager.getAdminId());
+		Integer id=null;
+		long count=999999;
+		for (PublicRelease e : myPublic) {
+			long time = e.getReleaseStart().getTime();
+			long time2 = e.getReleaseEnd().getTime();
+			long nowTime=System.currentTimeMillis();
+			if ((nowTime-time)/(1000*60)<count){
+				count=(time-nowTime)/(1000*60);
+				id=e.getId();
+			}
+			if ((time2-nowTime)/(1000*60)<count){
+				count=(time2-nowTime)/(1000*60);
+				id=e.getId();
 			}
-		}else {
-			return myPublic.get(0);
 		}
+		if (id!=null){
+			return publicReleaseMapper.selectOutListBoById(id);
+		}
+//		List<OutPublicReleaseList> myPublic = getMyPublic(0,1);
+//		if (myPublic.isEmpty()){
+//			List<OutPublicReleaseList> myPublic2 = getMyPublic(0,0);
+//			if (!myPublic2.isEmpty()){
+//				return myPublic2.get(0);
+//			}
+//		}else {
+//			return myPublic.get(0);
+//		}
 		return null;
 	}