Browse Source

请假单监听

yuansh 1 year ago
parent
commit
24f7e1491f

+ 1 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/activiti/listener/ListenerIncidentTicketList.java

@@ -58,6 +58,7 @@ public class ListenerIncidentTicketList implements TaskListener, JavaDelegate {
 
 			IncidentTicket incidentTicket = new IncidentTicket();
 			incidentTicket.setId(id);
+			incidentTicket.setUpdateTime(new Date());
 			incidentTicket.setInvoicingDate(new Date());
 			incidentTicketService.updateById(incidentTicket);
 			List<IncidentTicketChildren> list1 = incidentTicketChildrenService.selectPlan(o.getPlanNumber());

+ 29 - 4
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/controller/IncidentTicketController.java

@@ -19,6 +19,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import org.apache.catalina.core.ApplicationContext;
 import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.system.api.ISysBaseAPI;
+import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.oa.entity.CdEnterpriseEnnouncement;
 import org.jeecg.modules.oa.entity.IncidentTicketMsg;
 import org.jeecg.modules.oa.mapper.IncidentTicketMapper;
@@ -84,10 +85,22 @@ public class IncidentTicketController {
 
 //		 DruidDataSource dataSource = ApplicationContext
 
-		String aa = "null,cc,cc,null,cc,null";
-		String bb = "cc,null,cc,null";
-		System.out.println(aa.replaceAll(",null","").replaceAll("null,",""));
+//		String aa = "null,cc,cc,null,cc,null";
+//		String bb = "cc,null,cc,null";
+//		System.out.println(aa.replaceAll(",null","").replaceAll("null,",""));
 
+
+		String date1 = "2022-02-15";//开票
+		String date2 = "2022-02-14";
+		System.out.println(date1.compareTo(date2));
+		if(date1.compareTo(date2) > 0) {
+			System.out.println("date1 大于 date2");
+		}
+		if(date1.compareTo(date2) < 0) {
+			System.out.println("false");
+		}else{
+			System.out.println("tre");
+		}
 	 }
 	 @RequestMapping(value = "/list1", method = RequestMethod.GET)
 	 public JSONObject list1(Map<String, Object> param) {
@@ -253,7 +266,7 @@ public class IncidentTicketController {
 		if(incidentTicketEntity==null) {
 			return Result.error("未找到对应数据");
 		}
-		incidentTicket.setInvoicingDate(new Date());
+//		incidentTicket.setInvoicingDate(new Date());
 		incidentTicketService.updateMain(incidentTicket, incidentTicketPage.getIncidentTicketChildrenList());
 		return Result.ok("编辑成功!");
 	}
@@ -431,6 +444,18 @@ public class IncidentTicketController {
 				incidentTicket.setInvoicingDate(incidentTicket.getCreateTime());
 			}
 		}
+		if(incidentTicket.getUpdateTime() == null){
+			incidentTicket.setUpdateTime(incidentTicket.getCreateTime());
+
+		}
+
+		String date1 = DateUtils.formatDate(incidentTicket.getInvoicingDate(),"yyyy-MM-dd");
+		String date2 = DateUtils.formatDate(incidentTicket.getUpdateTime(),"yyyy-MM-dd");
+//		System.out.println(date1.compareTo(date2));
+		if(date1.compareTo(date2) < 0) {
+			return Result.error("u8开票日期不能大于最后修改日期");
+		}
+
 		boolean res = true;
 
 		List<IncidentTicketChildren> childrenList = incidentTicketChildrenService.selectByMainId(incidentTicket.getId());

+ 9 - 7
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/LoginController.java

@@ -315,13 +315,15 @@ public class LoginController {
 
 		String is_possess = "0";
 		SysDepart sysDepart= sysDepartService.getById(orgCode);
-		List<SysDepart> list = sysDepartService.queryDepartsByUsernameByOrg(username,sysDepart.getOrgCode());
-
-		for(SysDepart o:list){
-			List<String> aa = sysBaseAPI.getDeptHeadByDepId(o.getId());
-			if(aa.size() > 0){
-				is_possess = "1";
-				return is_possess;
+		if(sysDepart != null && StringUtils.isNotBlank(sysDepart.getOrgCode())){
+			List<SysDepart> list = sysDepartService.queryDepartsByUsernameByOrg(username,sysDepart.getOrgCode());
+
+			for(SysDepart o:list){
+				List<String> aa = sysBaseAPI.getDeptHeadByDepId(o.getId());
+				if(aa.size() > 0){
+					is_possess = "1";
+					return is_possess;
+				}
 			}
 		}
 

+ 3 - 2
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java

@@ -652,9 +652,10 @@ public class SysUserController {
         ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
         //update-begin--Author:kangxiaolin  Date:20180825 for:[03]用户导出,如果选择数据则只导出相关数据--------------------
         String selections = request.getParameter("selections");
-       if(!oConvertUtils.isEmpty(selections)){
+        if(!oConvertUtils.isEmpty(selections)){
            queryWrapper.in("id",selections.split(","));
-       }
+        }
+        queryWrapper.notIn("sy_hire_type","离职");
         if(StringUtils.isNotBlank(address)){
             queryWrapper.orderByAsc("work_no");
         }else{