Browse Source

公出列表修改打卡筛选与显示

anderx 2 years ago
parent
commit
c90f1d3989

+ 21 - 5
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -506,6 +506,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		StringBuffer str=new StringBuffer();
 		str=str.append("(").append(ad.getName()).append(")");
 		StringBuffer content=new StringBuffer().append("[").append(use.getUserNames()).append("]公司的外出申请,");
+		//上级审核
 		if(examineType==0){
 			p.setStatus(status);
 			if (status==0){
@@ -535,7 +536,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			//通知公出人切换成公出人审核人
 			a=adminMapper.selectByPrimaryKey(a.getReviewer());
 			if (status==2){//审核通过
-				str=str.append("同意,");
+				str=str.append("同意公出我的企业,").append(remarks);
+				content=content.append("已通过审核,请尽快审核。");
 				List<PublicExamine> publicExamines = publicExamineMapper.selectByPrid(use.getId());
 				int x=0;
 				for (PublicExamine pe : publicExamines) {
@@ -555,17 +557,20 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 				if (x==publicExamines.size()){
 					p.setPublicType(2);
 				}
-				addpublicLog(id, status, remarks);
+				addpublicLog(id, status, str.toString());
 			}else if (status==0){//审核驳回
-				str=str.append("驳回,");
+				str=str.append("不同意公出我的企业,").append(remarks);;
+				content=content.append("未通过审核,请修改后重新发起。");
 				p.setPublicType(3);
-				addpublicLog(id, 0, remarks);
+				p.setStatus(0);
+				addpublicLog(id, 0, str.toString());
 			}
 
 		}
 		AdminListBo my = adminMapper.getDeptNameByAid(TokenManager.getAdminId());
 		sendNoticeAndSoucket(a.getId(),status,content.toString());
 
+		publicReleaseMapper.updateByPrimaryKeySelective(p);
 		if (a.getOpenId()!=null) {
 			if (remarks.length()>19) {
 				remarks=remarks.substring(0, 15)+"...";
@@ -576,8 +581,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 
 			}
 			return res;
+		}else {
 		}
-		publicReleaseMapper.updateByPrimaryKeySelective(p);
 			return 1;
 	}
 
@@ -813,6 +818,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		List<OutPublicReleaseDetails> prdList = publicReleaseDetailsMapper.selectByPCid(id);
 		String str = "";
 		boolean flag=false;
+		Integer clockCount=0;
 		for (OutPublicReleaseDetails prd : prdList) {
 			if (prd.getUid().equals(uid)){
 				String aid = TokenManager.getAdminId();
@@ -845,8 +851,18 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 				publicReleaseLogMapper.insertSelective(log);
 				publicReleaseDetailsMapper.updateByPrimaryKeySelective(prd);
 				flag=true;
+				clockCount++;
+			}
+			if (prd.getClockIn()==1){
+				clockCount++;
 			}
 		}
+		if (prdList.size()==clockCount){
+			PublicRelease newp=new PublicRelease();
+			newp.setId(id);
+			newp.setClockIn(1);
+			publicReleaseMapper.updateByPrimaryKeySelective(newp);
+		}
 		if (!flag){
 			return 0;
 		}