Przeglądaj źródła

质量事故单

yuansh 1 rok temu
rodzic
commit
48be6bd543

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

@@ -8,15 +8,18 @@ import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.system.api.ISysBaseAPI;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.oa.entity.IncidentTicket;
 import org.jeecg.modules.oa.entity.IncidentTicketChildren;
 import org.jeecg.modules.oa.entity.IncidentTicketMsg;
 import org.jeecg.modules.oa.service.IIncidentTicketChildrenService;
 import org.jeecg.modules.oa.service.IIncidentTicketMsgService;
+import org.jeecg.modules.oa.service.IIncidentTicketService;
 import org.jeecg.modules.system.entity.SysUser;
 import org.jeecg.modules.system.mapper.SysUserMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -36,7 +39,8 @@ public class ListenerIncidentTicketList implements TaskListener, JavaDelegate {
 	private IIncidentTicketMsgService incidentTicketMsgService;
 	@Autowired
 	private SysUserMapper sysUserMapper;
-
+	@Autowired
+	private IIncidentTicketService incidentTicketService;
 
 
 	@Override
@@ -52,6 +56,10 @@ public class ListenerIncidentTicketList implements TaskListener, JavaDelegate {
 		Map<String,String> map = new HashMap<>();
 		for(IncidentTicketChildren o:list){
 
+			IncidentTicket incidentTicket = new IncidentTicket();
+			incidentTicket.setId(id);
+			incidentTicket.setInvoicingDate(new Date());
+			incidentTicketService.updateById(incidentTicket);
 			List<IncidentTicketChildren> list1 = incidentTicketChildrenService.selectPlan(o.getPlanNumber());
 			if(list1.size() > 0){
 

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

@@ -83,6 +83,11 @@ public class IncidentTicketController {
 //		 String user = dataSource.getUsername();//获取用户名
 
 //		 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,",""));
+
 	 }
 	 @RequestMapping(value = "/list1", method = RequestMethod.GET)
 	 public JSONObject list1(Map<String, Object> param) {
@@ -173,7 +178,7 @@ public class IncidentTicketController {
 			List<IncidentTicketMsg> list2 = incidentTicketMsgService.list(query);
 			if(list2.size() > 0) {
 				String result = list2.stream().map(IncidentTicketMsg::getUserName).collect(Collectors.joining(","));
-				o.setNoticerUser(result);
+				o.setNoticerUser(result.replaceAll(",null","").replaceAll("null,",""));
 			}
 
 			//1未处理 2已通知 3通知已反馈 4已推送 5已完结(提交) 6已完结
@@ -248,6 +253,7 @@ public class IncidentTicketController {
 		if(incidentTicketEntity==null) {
 			return Result.error("未找到对应数据");
 		}
+		incidentTicket.setInvoicingDate(new Date());
 		incidentTicketService.updateMain(incidentTicket, incidentTicketPage.getIncidentTicketChildrenList());
 		return Result.ok("编辑成功!");
 	}
@@ -383,11 +389,11 @@ public class IncidentTicketController {
 		if(incidentTicket==null) {
 			return Result.error("未找到对应数据");
 		}
-		if(!incidentTicket.getState().equals("3")){//1未处理 2已通知 3通知已反馈 4已推送 5已完结
-			return Result.error("此单据状态下无法推送");
+		if(incidentTicket.getState().equals("5")){//1未处理 2已通知 3通知已反馈 4已推送 5已完结
+			return Result.error("已完结状态下无法推送");
 		}
-		if(!incidentTicket.getState().equals("4")){//1未处理 2已通知 3通知已反馈 4已推送 5已完结
-			return Result.error("此单据状态下无法推送");
+		if(incidentTicket.getState().equals("4")){//1未处理 2已通知 3通知已反馈 4已推送 5已完结
+			return Result.error("已推送状态下无法再次推送");
 		}
 
 		String accidentNumber = incidentTicket.getBusinessType();//业务类型

+ 3 - 3
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/entity/IncidentTicket.java

@@ -41,9 +41,9 @@ public class IncidentTicket implements Serializable {
     @ApiModelProperty(value = "创建日期")
     private Date createTime;
 	/**u8开票日期*/
-	@Excel(name = "u8开票日期", width = 20, format = "yyyy-MM-dd")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern="yyyy-MM-dd")
+	@Excel(name = "u8开票日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "u8开票日期")
     private Date invoicingDate;
 	/**更新人*/

+ 3 - 3
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/vo/IncidentTicketPage.java

@@ -55,9 +55,9 @@ public class IncidentTicketPage {
 	@ApiModelProperty(value = "日期")
 	private String accidentData;
 	/**u8开票日期*/
-	@Excel(name = "u8开票日期", width = 20, format = "yyyy-MM-dd")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
-	@DateTimeFormat(pattern="yyyy-MM-dd")
+	@Excel(name = "u8开票日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
 	@ApiModelProperty(value = "u8开票日期")
 	private Date invoicingDate;
 	/**质量事故单主题*/

+ 6 - 1
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java

@@ -131,6 +131,8 @@ public class SysUserController {
             }
             if(deptList.size() > 0){
                 queryWrapper.lambda().in(SysUser::getId,deptList);
+            }else{
+                queryWrapper.lambda().in(SysUser::getId,"deptList");
             }
 
         }
@@ -688,8 +690,11 @@ public class SysUserController {
                 //TODO 临时借用这个字段用于页面展示
 //                item.setOrgCode(useDepNames.get(item.getId()));
 
+                if(StringUtils.isNotBlank(item.getSyHireType()) && item.getSyHireType().equals("离职")){
+                    return;
+                }
                 SysUserAddress add = new SysUserAddress();
-
+//                IFNULL(sy_Hire_Type,'在职') !='离职'
                 if(StringUtils.isNotBlank(item.getIfOa()) && item.getIfOa().equals("1")){
                     item.setIfOa("是");
                 }else{