yuansh 2 rokov pred
rodič
commit
391a5801a2

+ 8 - 1
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/config/dataSource/OtherSource.java

@@ -8,7 +8,7 @@ import java.util.*;
 
 public class OtherSource {
 
-    public List<Map<String,String>> getSupplier() {
+    public List<Map<String,String>> getSupplier(String type) {
         String active = getProjectConfigActive("active");
         List<Map<String,String>> supplierList = new ArrayList<>();
 
@@ -38,7 +38,14 @@ public class OtherSource {
             Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
             con=DriverManager.getConnection(URL,USER,PASSWORD);
             sta =con.createStatement();
+
             String sql="select cVenCode,cVenName from all_supplier_view ";
+            if(type.equals("supplier")){
+                sql="select cVenCode,cVenName from all_supplier_view ";
+            }
+            if(type.equals("customer")){
+                sql="select cVenCode,cVenName from all_customer_view ";
+            }
             rs =sta.executeQuery(sql);
             while(rs.next()) {
                 Map<String,String> map = new HashMap<>();

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

@@ -3,16 +3,23 @@ package org.jeecg.modules.oa.controller;
 import java.io.UnsupportedEncodingException;
 import java.io.IOException;
 import java.net.URLDecoder;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
+import java.sql.Connection;
+import java.util.*;
 import java.util.stream.Collectors;
 
+import javax.activation.DataSource;
+import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.alibaba.druid.pool.DruidDataSource;
+import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
+import org.apache.catalina.core.ApplicationContext;
 import org.apache.commons.lang.StringUtils;
+import org.jeecg.common.system.api.ISysBaseAPI;
+import org.jeecg.modules.oa.entity.CdEnterpriseEnnouncement;
+import org.jeecg.modules.oa.mapper.IncidentTicketMapper;
+import org.jeecgframework.core.util.ApplicationContextUtil;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -31,6 +38,8 @@ import org.jeecg.modules.oa.service.IIncidentTicketChildrenService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
 import org.springframework.web.servlet.ModelAndView;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
@@ -58,7 +67,20 @@ public class IncidentTicketController {
 	private IIncidentTicketService incidentTicketService;
 	@Autowired
 	private IIncidentTicketChildrenService incidentTicketChildrenService;
-	
+	 @Autowired
+	 private IncidentTicketMapper incidentTicketMapper;
+	 @Autowired
+	 private ISysBaseAPI sysBaseAPI;
+
+	 public static void main(String[] args) {
+
+//		 DruidDataSource dataSource = ApplicationContextHelper.getBean("dataSource");//获取数据源
+//		 Connection connection = dataSource.getConnection();//获取连接
+//		 String user = dataSource.getUsername();//获取用户名
+
+//		 DruidDataSource dataSource = ApplicationContext
+	 }
+
 	/**
 	 * 分页列表查询
 	 *
@@ -76,8 +98,38 @@ public class IncidentTicketController {
 								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
 								   HttpServletRequest req) {
 		QueryWrapper<IncidentTicket> queryWrapper = QueryGenerator.initQueryWrapper(incidentTicket, req.getParameterMap());
+		queryWrapper.eq("1","1");
+		queryWrapper.last("and id in(select table_id from act_z_business where table_name='incident_ticket' and result = 2) order by create_time desc ");
+
 		Page<IncidentTicket> page = new Page<IncidentTicket>(pageNo, pageSize);
 		IPage<IncidentTicket> pageList = incidentTicketService.page(page, queryWrapper);
+
+		for (IncidentTicket o:pageList.getRecords()) {
+
+			List<IncidentTicketChildren> list = incidentTicketChildrenService.selectByMainId(o.getId());
+			String result = list.stream().map(IncidentTicketChildren::getPlanNumber).collect(Collectors.joining(","));
+			o.setJiHuaHao(result);
+
+			if(StringUtils.isNotBlank(o.getResponsibilityPerson1())){
+				LoginUser login = sysBaseAPI.getUserByName(o.getResponsibilityPerson1());
+				if(login != null){
+					o.setResponsibilityPerson1(login.getRealname());
+				}
+			}
+			if(StringUtils.isNotBlank(o.getResponsibilityPerson2())){
+				LoginUser login = sysBaseAPI.getUserByName(o.getResponsibilityPerson2());
+				if(login != null){
+					o.setResponsibilityPerson2(login.getRealname());
+				}
+			}
+			if(StringUtils.isNotBlank(o.getResponsibilityPerson3())){
+				LoginUser login = sysBaseAPI.getUserByName(o.getResponsibilityPerson3());
+				if(login != null){
+					o.setResponsibilityPerson3(login.getRealname());
+				}
+			}
+		}
+
 		return Result.ok(pageList);
 	}
 	
@@ -191,18 +243,19 @@ public class IncidentTicketController {
 		if(StringUtils.isBlank(ids) || StringUtils.isBlank(headId)|| StringUtils.isBlank(code)|| StringUtils.isBlank(title)){
 			return Result.error("参数不完整");
 		}
-		String info = incidentTicketService.noticeUser(ids,headId,code,title);
-		if(info.equals("false")){
-			return Result.error("数据异常,请联系管理员");
-		}else{
-			return Result.ok(info);
-		}
+		return incidentTicketService.noticeUser(ids,headId,code,title);
+//		String info = incidentTicketService.noticeUser(ids,headId,code,title);
+//		if(info.equals("false")){
+//			return Result.error("数据异常,请联系管理员");
+//		}else{
+//			return Result.ok(info);
+//		}
 
 	}
 
 
 	/**
-	 * 其他人员通知方珂
+	 * 其他人员通知方珂(反馈通知)
 	 *
 	 * @param headId
 	 * @return
@@ -215,12 +268,13 @@ public class IncidentTicketController {
 		if(StringUtils.isBlank(headId)|| StringUtils.isBlank(code)|| StringUtils.isBlank(title)){
 			return Result.error("参数不完整");
 		}
-		String info = incidentTicketService.noticeUserReturn(headId,code,title);
-		if(info.equals("false")){
-			return Result.error("数据异常,请联系管理员");
-		}else{
-			return Result.ok(info);
-		}
+		return incidentTicketService.noticeUserReturn(headId,code,title);
+//		String info = incidentTicketService.noticeUserReturn(headId,code,title);
+//		if(info.equals("false")){
+//			return Result.error("数据异常,请联系管理员");
+//		}else{
+//			return Result.ok(info);
+//		}
 
 	}
 
@@ -245,13 +299,7 @@ public class IncidentTicketController {
 			return Result.error("未找到对应数据");
 		}
 
-		if(incidentTicket.getState().equals("3")){//1未处理 2已通知 3通知已反馈 4已推送 5已完结
-			incidentTicket.setState("4");
-			incidentTicketService.save(incidentTicket);
-			return Result.ok("已完结");
-		}else{
-			return Result.ok("此单据状态下无法推送");
-		}
+		return incidentTicketService.propelling(incidentTicket);
 
 
 	}
@@ -278,10 +326,14 @@ public class IncidentTicketController {
 		//完结操作可跳过推送,直接完结
 		if(incidentTicket.getState().equals("3") || incidentTicket.getState().equals("4")){//1未处理 2已通知 3通知已反馈 4已推送 5已完结
 			incidentTicket.setState("5");
-			incidentTicketService.save(incidentTicket);
+			LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+			incidentTicket.setUpdateBy(sysUser.getUsername());
+			incidentTicket.setUpdateTime(new Date());
+//			incidentTicketService.save(incidentTicket);
+			incidentTicketMapper.updateById(incidentTicket);
 			return Result.ok("已完结");
 		}else{
-			return Result.ok("此单据状态下无法完结");
+			return Result.error("此单据状态下无法完结");
 		}
 
 

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

@@ -3,6 +3,7 @@ package org.jeecg.modules.oa.entity;
 import java.io.Serializable;
 import java.util.Date;
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
@@ -219,4 +220,7 @@ public class IncidentTicket implements Serializable {
 	@Excel(name = "1未处理 2已通知 3通知已反馈 4已推送 5已完结", width = 15)
     @ApiModelProperty(value = "1未处理 2已通知 3通知已反馈 4已推送 5已完结")
     private String state;
+
+	@TableField(exist = false)
+	private String jiHuaHao;//计划号(子表中数据,以逗号分割显示)
 }

+ 8 - 8
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/entity/IncidentTicketChildren.java

@@ -29,27 +29,27 @@ public class IncidentTicketChildren implements Serializable {
 	@ApiModelProperty(value = "主键")
 	private String id;
 	/**创建人*/
-	@Excel(name = "创建人", width = 15)
+//	@Excel(name = "创建人", width = 15)
 	@ApiModelProperty(value = "创建人")
 	private String createBy;
 	/**创建日期*/
-	@Excel(name = "创建日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+//	@Excel(name = "创建日期", 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 = "创建日期")
 	private Date createTime;
 	/**更新人*/
-	@Excel(name = "更新人", width = 15)
+//	@Excel(name = "更新人", width = 15)
 	@ApiModelProperty(value = "更新人")
 	private String updateBy;
 	/**更新日期*/
-	@Excel(name = "更新日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+//	@Excel(name = "更新日期", 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 = "更新日期")
 	private Date updateTime;
 	/**所属部门*/
-	@Excel(name = "所属部门", width = 15)
+//	@Excel(name = "所属部门", width = 15)
 	@ApiModelProperty(value = "所属部门")
 	private String sysOrgCode;
 	/**计划单号*/
@@ -85,14 +85,14 @@ public class IncidentTicketChildren implements Serializable {
 	@ApiModelProperty(value = "备注")
 	private String remark;
 	/**是否部门负责人*/
-	@Excel(name = "是否部门负责人", width = 15)
+//	@Excel(name = "是否部门负责人", width = 15)
 	@ApiModelProperty(value = "是否部门负责人")
 	private String isLeaders;
 	/**主表id*/
-	@ApiModelProperty(value = "主表id")
+//	@ApiModelProperty(value = "主表id")
 	private String incidentTicketId;
 	/**报错字段sort*/
-	@Excel(name = "报错字段sort", width = 15)
+//	@Excel(name = "报错字段sort", width = 15)
 	@ApiModelProperty(value = "报错字段sort")
 	private String sort;
 }

+ 6 - 2
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/service/IIncidentTicketService.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.oa.service;
 
+import org.jeecg.common.api.vo.Result;
 import org.jeecg.modules.oa.entity.IncidentTicketChildren;
 import org.jeecg.modules.oa.entity.IncidentTicket;
 import com.baomidou.mybatisplus.extension.service.IService;
@@ -37,6 +38,9 @@ public interface IIncidentTicketService extends IService<IncidentTicket> {
 	 */
 	public void delBatchMain (Collection<? extends Serializable> idList);
 
-	public String noticeUser(String ids,String headId,String code,String title);
-	public String noticeUserReturn(String headId,String code,String title);
+	public Result<?> noticeUser(String ids,String headId,String code,String title);
+
+	public Result<?> noticeUserReturn(String headId, String code, String title);
+
+	public Result<?> propelling(IncidentTicket incidentTicket);
 }

+ 84 - 32
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/service/impl/IncidentTicketServiceImpl.java

@@ -3,6 +3,7 @@ package org.jeecg.modules.oa.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.system.api.ISysBaseAPI;
 import org.jeecg.common.system.vo.LoginUser;
@@ -11,6 +12,7 @@ import org.jeecg.modules.oa.entity.IncidentTicketChildren;
 import org.jeecg.modules.oa.entity.IncidentTicketMsg;
 import org.jeecg.modules.oa.mapper.IncidentTicketChildrenMapper;
 import org.jeecg.modules.oa.mapper.IncidentTicketMapper;
+import org.jeecg.modules.oa.mapper.IncidentTicketMsgMapper;
 import org.jeecg.modules.oa.service.IIncidentTicketMsgService;
 import org.jeecg.modules.oa.service.IIncidentTicketService;
 import org.springframework.stereotype.Service;
@@ -18,10 +20,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import java.io.Serializable;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Collection;
+import java.util.*;
 
 /**
  * @Description: 森_工厂质量事故单-主表
@@ -34,6 +33,9 @@ public class IncidentTicketServiceImpl extends ServiceImpl<IncidentTicketMapper,
 
 	@Autowired
 	private IncidentTicketMapper incidentTicketMapper;
+
+	@Autowired
+	private IncidentTicketMsgMapper incidentTicketMsgMapper;
 	@Autowired
 	private IncidentTicketChildrenMapper incidentTicketChildrenMapper;
 	@Autowired
@@ -44,12 +46,57 @@ public class IncidentTicketServiceImpl extends ServiceImpl<IncidentTicketMapper,
 
 	@Override
 	@Transactional
-	public String noticeUser(String ids,String headId,String code,String title){
+	public Result<?> propelling(IncidentTicket incidentTicket){
+
+		if(!incidentTicket.getState().equals("3")){//1未处理 2已通知 3通知已反馈 4已推送 5已完结
+			return Result.error("此单据状态下无法推送");
+		}
+
+		LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+
+		//推送正文
+
+		String businessType = incidentTicket.getBusinessType();//业务类型
+		List<IncidentTicketChildren> childrenList = incidentTicketChildrenMapper.selectByMainId(incidentTicket.getId());
+
+		for (IncidentTicketChildren children:childrenList){
+
+
+
+
+		}
+
+
+
+
+
+
+
+
+
+		incidentTicket.setState("4");
+		incidentTicket.setUpdateBy(sysUser.getUsername());
+		incidentTicket.setUpdateTime(new Date());
+		incidentTicketMapper.updateById(incidentTicket);
+		return Result.ok("已推送");
+	}
+
+	@Override
+	@Transactional
+	public Result<?> noticeUser(String ids,String headId,String code,String title){
 
 		String[] idList = ids.split(",");
 		LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 		HashMap<String,Object> taskParam = new HashMap<>();
 
+		if(!sysUser.getUsername().equals("T0008")){
+			return Result.error("该功能仅方珂使用");
+		}
+
+//		Map<String ,Object> map = new HashMap<>();
+//		map.put("pk_incident_ticket",headId);
+//		incidentTicketMsgMapper.deleteByMap(map);
+
 		for(String o:idList){
 
 			sysBaseAPI.sendSysAnnouncement(sysUser,sysUser.getUsername(),o,"质量事故单",code+"  "+title, CommonConstant.MSG_CATEGORY_2,taskParam);
@@ -64,69 +111,74 @@ public class IncidentTicketServiceImpl extends ServiceImpl<IncidentTicketMapper,
 
 		IncidentTicket incidentTicketEntity = incidentTicketMapper.selectById(headId);
 		if(incidentTicketEntity==null) {
-			return "未找到对应数据";
+			return Result.error("未找到对应数据");
 		}
-		incidentTicketEntity.setState("2");//1未处理 2已通知 3通知已反馈 4已推送 5已完结
-//		incidentTicketEntity.setUpdateBy(sysUser.getUsername());
-//		incidentTicketEntity.setUpdateTime(new Date());
-//		incidentTicketMapper.updateById(incidentTicketEntity);
-		this.save(incidentTicketEntity);
 
-		return "已通知";
+		incidentTicketEntity.setState("2");//1未处理 2已通知 3通知已反馈 4已推送 5已完结
+		incidentTicketEntity.setUpdateBy(sysUser.getUsername());
+		incidentTicketEntity.setUpdateTime(new Date());
+		incidentTicketMapper.updateById(incidentTicketEntity);
+//		this.save(incidentTicketEntity);
+		return Result.error("已通知");
 	}
 
 
 	@Override
 	@Transactional
-	public String noticeUserReturn(String headId,String code,String title){
-
+	public Result<?> noticeUserReturn(String headId, String code, String title){
+		IncidentTicket incidentTicketEntity = incidentTicketMapper.selectById(headId);
+		if(StringUtils.isNotBlank(incidentTicketEntity.getState()) && !incidentTicketEntity.getState().equals("2")){
+			return Result.error("该单已反馈通知,无需重复操作");
+		}
 		LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 		LambdaQueryWrapper<IncidentTicketMsg> query = new LambdaQueryWrapper<IncidentTicketMsg>();
 		query.eq(IncidentTicketMsg::getPkIncidentTicket,headId);
 		List<IncidentTicketMsg> list = iIncidentTicketMsgService.list(query);
 
 		boolean isAuth = false;
-		boolean isComplete = true;
+//		boolean isComplete = true;
 
 		for (IncidentTicketMsg o:list){
 			String userId = o.getUserId();
 
 			if(userId.equals(sysUser.getUsername())){
 				if (StringUtils.isNotBlank(o.getConfirm()) && o.getConfirm().equals("已通知")){
-					return "您已通知,请勿重新操作";
+					return Result.error("您已通知,请勿重新操作");
 				}
 
 				o.setConfirm("已通知");
-				iIncidentTicketMsgService.save(o);
+				o.setUpdateBy(sysUser.getUsername());
+				o.setUpdateTime(new Date());
+				incidentTicketMsgMapper.updateById(o);
 				isAuth = true;
+				break;
 			}
 
-			if (StringUtils.isBlank(o.getConfirm()) || !o.getConfirm().equals("已通知")){
-				isComplete = false;
-			}
+//			if (StringUtils.isBlank(o.getConfirm()) || !o.getConfirm().equals("已通知")){
+//				isComplete = false;
+//			}
 		}
 
 		if(!isAuth){
-			return "您无权操作此事故单";
+			return Result.error("您无权操作此事故单");
 		}
 
 		HashMap<String,Object> taskParam = new HashMap<>();
 
-		sysBaseAPI.sendSysAnnouncement(sysUser,sysUser.getUsername(),"T0008","质量事故单",code+"  "+title, CommonConstant.MSG_CATEGORY_2,taskParam);
+		sysBaseAPI.sendSysAnnouncement(sysUser,sysUser.getUsername(),"T0008","质量事故单",code+"  "+title+" 财务对单人已处理完毕;", CommonConstant.MSG_CATEGORY_2,taskParam);
+
+//		if(isComplete){
 
-		if(isComplete){
-			IncidentTicket incidentTicketEntity = incidentTicketMapper.selectById(headId);
 			if(incidentTicketEntity==null) {
-				return "未找到对应数据";
+				return Result.error("未找到对应数据");
 			}
 			incidentTicketEntity.setState("3");//1未处理 2已通知 3通知已反馈 4已推送 5已完结
-//			incidentTicketEntity.setUpdateBy(sysUser.getUsername());
-//			incidentTicketEntity.setUpdateTime(new Date());
-//			incidentTicketMapper.updateById(incidentTicketEntity);
-			this.save(incidentTicketEntity);
-		}
-
-		return "已通知";
+			incidentTicketEntity.setUpdateBy(sysUser.getUsername());
+			incidentTicketEntity.setUpdateTime(new Date());
+			incidentTicketMapper.updateById(incidentTicketEntity);
+//			this.save(incidentTicketEntity);
+//		}
+		return Result.ok("已通知");
 	}
 
 

+ 19 - 2
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/service/impl/SyCarryServiceImpl.java

@@ -1,7 +1,9 @@
 package org.jeecg.modules.oa.service.impl;
 
+import com.baomidou.dynamic.datasource.annotation.DS;
 import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.SecurityUtils;
+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.DateUtils;
@@ -17,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import java.io.Serializable;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Collection;
 
@@ -172,6 +175,10 @@ public class SyCarryServiceImpl extends ServiceImpl<SyCarryMapper, SyCarry> impl
 				syCarry.setCkName(loginUser.getRealname());//仓库提交人
 				syCarry.setCkTime(new Date());//仓库提交时间
 				boolean ifAll = true;
+
+				LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+				HashMap<String,Object> taskParam = new HashMap<>();
+
 				List<SyCarryB> syCarryB2 = syCarryBMapper.selectByMainId(syCarry.getId());
 				for(SyCarryB o:syCarryB2){
 					if(StringUtils.isBlank(o.getJhyByData())){
@@ -184,17 +191,27 @@ public class SyCarryServiceImpl extends ServiceImpl<SyCarryMapper, SyCarry> impl
 						o.setJhyTime(DateUtils.getDate("yyyy-MM-dd HH:mm:ss"));
 						syCarryBMapper.updateById(o);
 					}
-
+					String[] jhyData = o.getJhyByData().split(",");
 					if(StringUtils.isBlank(o.getJhyBy())){
+
+						for(String q:jhyData){
+							if(StringUtils.isNotBlank(q) && q.equals("T0114")){
+								continue;
+							}
+							iSysBaseAPI.sendSysAnnouncement(sysUser,sysUser.getUsername(),q,"搬运工对账单","您有一个新的搬运工对账单需要签字,请查看: "+syCarry.getName(), CommonConstant.MSG_CATEGORY_2,taskParam);
+
+						}
+
 						ifAll = false;
 						continue;
 					}
 
 					String[] jhy = o.getJhyBy().split("/");
-					String[] jhyData = o.getJhyByData().split(",");
+
 					if(jhyData.length != jhy.length){
 						ifAll = false;
 					}
+
 				}
 				if(ifAll){
 					syCarry.setState("2");//0草稿,1仓库已提交(计划签字),2人事行政,3财务经理

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

@@ -27,27 +27,27 @@ public class IncidentTicketPage {
 	@ApiModelProperty(value = "主键")
 	private String id;
 	/**创建人*/
-	@Excel(name = "创建人", width = 15)
+//	@Excel(name = "创建人", width = 15)
 	@ApiModelProperty(value = "创建人")
 	private String createBy;
 	/**创建日期*/
-	@Excel(name = "创建日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+//	@Excel(name = "创建日期", 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 = "创建日期")
 	private Date createTime;
 	/**更新人*/
-	@Excel(name = "更新人", width = 15)
+//	@Excel(name = "更新人", width = 15)
 	@ApiModelProperty(value = "更新人")
 	private String updateBy;
 	/**更新日期*/
-	@Excel(name = "更新日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+//	@Excel(name = "更新日期", 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 = "更新日期")
 	private Date updateTime;
 	/**所属部门*/
-	@Excel(name = "所属部门", width = 15)
+//	@Excel(name = "所属部门", width = 15)
 	@ApiModelProperty(value = "所属部门")
 	private String sysOrgCode;
 	/**日期*/
@@ -179,7 +179,7 @@ public class IncidentTicketPage {
 	@ApiModelProperty(value = "情况说明")
 	private String presentationCondition;
 	/**附件上传*/
-	@Excel(name = "附件上传", width = 15)
+	//@Excel(name = "附件上传", width = 15)
 	@ApiModelProperty(value = "附件上传")
 	private String accessory;
 	/**填报人*/
@@ -187,27 +187,27 @@ public class IncidentTicketPage {
 	@ApiModelProperty(value = "填报人")
 	private String informant;
 	/**工厂签章*/
-	@Excel(name = "工厂签章", width = 15)
+//	@Excel(name = "工厂签章", width = 15)
 	@ApiModelProperty(value = "工厂签章")
 	private String factorySignature;
 	/**财务备注*/
-	@Excel(name = "财务备注", width = 15)
+//	@Excel(name = "财务备注", width = 15)
 	@ApiModelProperty(value = "财务备注")
 	private String financeRemark;
 	/**添加附件*/
-	@Excel(name = "添加附件", width = 15)
+//	@Excel(name = "添加附件", width = 15)
 	@ApiModelProperty(value = "添加附件")
 	private String accessory2;
 	/**是否部门负责人*/
-	@Excel(name = "是否部门负责人", width = 15)
+//	@Excel(name = "是否部门负责人", width = 15)
 	@ApiModelProperty(value = "是否部门负责人")
 	private String isLeaders;
 	/**森_工厂质量事故单(子)*/
-	@Excel(name = "森_工厂质量事故单(子)", width = 15)
+//	@Excel(name = "森_工厂质量事故单(子)", width = 15)
 	@ApiModelProperty(value = "森_工厂质量事故单(子)")
 	private String incidentTicketId;
 	/**子表控件*/
-	@Excel(name = "子表控件", width = 15)
+//	@Excel(name = "子表控件", width = 15)
 	@ApiModelProperty(value = "子表控件")
 	private String tableNameChildren;
 	/**1未处理 2已通知 3通知已反馈 4已推送 5已完结*/

+ 36 - 4
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java

@@ -56,6 +56,8 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
 import java.text.ParseException;
+import java.time.LocalDate;
+import java.time.temporal.TemporalAdjusters;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -974,9 +976,6 @@ public class SysUserController {
     }
 
 
-    public static void main(String[] args) {
-        System.out.println("asdfghj".substring(0,3));
-    }
 
     /**
      * 给指定部门添加对应的用户
@@ -1414,6 +1413,7 @@ public class SysUserController {
         if(userIds!=null && userIds.size()>0){
             Map<String,String>  useDepNames = sysUserService.getDepNamesByUserIds(userIds);
             pageList.getRecords().forEach(item->{
+//                pageList.getRecords().remove(item);
                 //TODO 临时借用这个字段用于页面展示
                 item.setOrgCode(useDepNames.get(item.getId()));
                 if(useDepNames.containsKey(item.getId())){
@@ -1455,7 +1455,8 @@ public class SysUserController {
 
         Map<String,Object> mapOne = new HashMap<>();
         OtherSource other = new OtherSource();
-        mapOne.put("supplierList",other.getSupplier());
+        mapOne.put("supplierList",other.getSupplier("supplier"));
+        mapOne.put("customerList",other.getSupplier("customer"));
         result.setData(mapOne);
 
         return result;
@@ -1493,7 +1494,28 @@ public class SysUserController {
         CodeVo codeVo=new CodeVo();
         codeVo.setSeqName(name);
         try {
+
+            if(name.equals("accidentCode")){
+                LocalDate with = LocalDate.now().with(TemporalAdjusters.firstDayOfMonth());
+                String nowDate = DateUtils.getDate("yyyy-MM-dd");
+                if(nowDate.equals(with.toString())){
+                    sysUserMapper.updateNextNo(name);
+                }
+            }
+
             sysUserMapper.getNextNo(codeVo);
+
+            if(name.equals("accidentCode")){
+                String nowDate = DateUtils.getDate("yyMMdd");
+                if(codeVo.getSeqNo() < 10){
+                    return "TW"+nowDate+"-00"+codeVo.getSeqNo();
+                }else if(codeVo.getSeqNo() > 9 && codeVo.getSeqNo() < 100){
+                    return "TW"+nowDate+"-0"+codeVo.getSeqNo();
+                }else{
+                    return "TW"+nowDate+"-"+codeVo.getSeqNo();
+                }
+            }
+
             return String.valueOf(codeVo.getSeqNo());
         }catch (Exception e){
             return "接口调用异常";
@@ -1501,6 +1523,16 @@ public class SysUserController {
 
     }
 
+    public static void main(String[] args) {
+        LocalDate with = LocalDate.now().with(TemporalAdjusters.firstDayOfMonth());
+        String nowDate = DateUtils.getDate("yyyy-MM-dd");
+        System.out.println(with.toString());
+        System.out.println(nowDate);
+        System.out.println(nowDate.equals(with.toString()));
+
+    }
+
+
     /**
      * 根据用户名查询用户信息
      * @param userId

+ 11 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysUserMapper.java

@@ -168,5 +168,16 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
 	 * @return
 	 */
 	List<SysUser> getUserByRoleCode(@Param("roleCode") String roleCode,@Param("username") String username);
+
+	/**
+	 * 自动编号
+	 * @param params
+	 */
 	void getNextNo(CodeVo params);
+
+	/**
+	 * 自动编号初始化
+	 * @param seqName
+	 */
+	int updateNextNo(String seqName);
 }

+ 4 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysUserMapper.xml

@@ -234,4 +234,8 @@
 		CALL nextSeqNo(#{seqName,mode=IN},#{seqNo,mode=OUT,jdbcType=BIGINT})
 	</select>
 
+	<update id="updateNextNo">
+		update sys_dict_item set item_value=0 ,update_time = now() where item_text = #{seqName}
+		and (update_time is null or DATE_FORMAT(update_time,'%Y-%m-%d') != DATE_FORMAT(NOW(),'%Y-%m-%d') )
+	</update>
 </mapper>

+ 8 - 3
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java

@@ -132,10 +132,15 @@ public class SysBaseApiImpl implements ISysBaseAPI {
 			return null;
 		}
 		BeanUtils.copyProperties(sysUser, loginUser);
-		SysPosition position = positionService.getOne(new LambdaQueryWrapper<SysPosition>().eq(SysPosition::getCode, sysUser.getPost()));
-		if (position != null) {
-			loginUser.setPostName(position.getName());
+		try {
+			SysPosition position = positionService.getOne(new LambdaQueryWrapper<SysPosition>().eq(SysPosition::getCode, sysUser.getPost()));
+			if (position != null) {
+				loginUser.setPostName(position.getName());
+			}
+		}catch (Exception e){
+
 		}
+
 		return loginUser;
 	}