Browse Source

导入导出开发

anderx 2 years ago
parent
commit
06cd598102
18 changed files with 158 additions and 250 deletions
  1. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ProjectTaskController.java
  2. 9 4
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
  3. 4 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
  4. 19 0
      ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java
  5. 20 1
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java
  6. 11 4
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java
  7. 8 4
      ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java
  8. 6 1
      ruoyi-system/src/main/java/com/ruoyi/project/bo/ProjectStaffRecordInput.java
  9. 2 0
      ruoyi-system/src/main/java/com/ruoyi/project/mapper/ProjectStaffRecordMapper.java
  10. 5 0
      ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectStaffRecordServiceImpl.java
  11. 7 0
      ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectStaffServiceImpl.java
  12. 1 1
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
  13. 1 1
      ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java
  14. 7 2
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
  15. 46 226
      ruoyi-system/src/main/java/com/ruoyi/weChat/service/WeChatService.java
  16. 6 0
      ruoyi-system/src/main/resources/mapper/project/ProjectStaffRecordMapper.xml
  17. 1 1
      ruoyi-system/src/main/resources/mapper/project/ProjectTaskMapper.xml
  18. 3 1
      ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ProjectTaskController.java

@@ -112,7 +112,7 @@ public class ProjectTaskController extends BaseController {
     public TableDataInfo listRecord( ProjectStaffRecordInput in){
         startPage();
         List<ProjectStaffRecordOut> list = projectStaffRecordService.listRecord(in);
-        return getDataTable(list);
+        return getDataTable(list,in.getPageNum());
     }
 
 
@@ -194,7 +194,7 @@ public class ProjectTaskController extends BaseController {
     public TableDataInfo list(ProjectListInput in){
         startPage();
         List<ProjectTaskListOut> list=projectTaskService.list(in);
-        return getDataTable(list);
+        return getDataTable(list,in.getPageNum());
     }
 
     /**

+ 9 - 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java

@@ -19,7 +19,7 @@ import com.ruoyi.system.service.ISysMenuService;
 
 /**
  * 登录验证
- * 
+ *
  * @author ruoyi
  */
 @RestController
@@ -36,7 +36,7 @@ public class SysLoginController
 
     /**
      * 登录方法
-     * 
+     *
      * @param loginBody 登录信息
      * @return 结果
      */
@@ -53,7 +53,7 @@ public class SysLoginController
 
     /**
      * 获取用户信息
-     * 
+     *
      * @return 用户信息
      */
     @GetMapping("getInfo")
@@ -64,7 +64,12 @@ public class SysLoginController
         Set<String> roles = permissionService.getRolePermission(user);
         // 权限集合
         Set<String> permissions = permissionService.getMenuPermission(user);
+        boolean ceo=false;
+        if (roles.contains("ceo")){
+            ceo=true;
+        }
         AjaxResult ajax = AjaxResult.success();
+        ajax.put("ceo", ceo);
         ajax.put("user", user);
         ajax.put("roles", roles);
         ajax.put("permissions", permissions);
@@ -73,7 +78,7 @@ public class SysLoginController
 
     /**
      * 获取路由信息
-     * 
+     *
      * @return 路由信息
      */
     @GetMapping("getRouters")

+ 4 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java

@@ -3,6 +3,8 @@ package com.ruoyi.web.controller.system;
 import java.util.List;
 import java.util.stream.Collectors;
 import javax.servlet.http.HttpServletResponse;
+
+import io.swagger.models.auth.In;
 import org.apache.commons.lang3.ArrayUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -255,7 +257,7 @@ public class SysUserController extends BaseController
      * @return
      */
     @GetMapping("/selectName")
-    public AjaxResult selectName(String name){
-        return success(userService.selectName(name));
+    public AjaxResult selectName(String name, Integer type){
+        return success(userService.selectName(name,type));
     }
 }

+ 19 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java

@@ -91,6 +91,25 @@ public class BaseController
     }
 
     /**
+     * 响应请求分页数据
+     */
+    @SuppressWarnings({ "rawtypes", "unchecked" })
+    protected TableDataInfo getDataTable(List<?> list,Integer page)
+    {
+        TableDataInfo rspData = new TableDataInfo();
+        rspData.setCode(HttpStatus.SUCCESS);
+        rspData.setMsg("查询成功");
+        rspData.setRows(list);
+        if (page==null){
+            rspData.setNext(2);
+        }else {
+            rspData.setNext(page+1);
+        }
+        rspData.setTotal(new PageInfo(list).getTotal());
+        return rspData;
+    }
+
+    /**
      * 返回成功
      */
     public AjaxResult success()

+ 20 - 1
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java

@@ -10,7 +10,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 
 /**
  * Entity基类
- * 
+ *
  * @author ruoyi
  */
 public class BaseEntity implements Serializable
@@ -42,6 +42,25 @@ public class BaseEntity implements Serializable
     @JsonInclude(JsonInclude.Include.NON_EMPTY)
     private Map<String, Object> params;
 
+    private Integer pageNum;
+    private Integer pageSize;
+
+    public Integer getPageNum() {
+        return pageNum;
+    }
+
+    public void setPageNum(Integer pageNum) {
+        this.pageNum = pageNum;
+    }
+
+    public Integer getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(Integer pageSize) {
+        this.pageSize = pageSize;
+    }
+
     public String getSearchValue()
     {
         return searchValue;

+ 11 - 4
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java

@@ -2,6 +2,8 @@ package com.ruoyi.common.core.domain.model;
 
 import com.alibaba.fastjson2.annotation.JSONField;
 import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.enums.UserRolesType;
+import com.ruoyi.common.utils.SecurityUtils;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.userdetails.UserDetails;
 import java.util.Collection;
@@ -9,7 +11,7 @@ import java.util.Set;
 
 /**
  * 登录用户身份权限
- * 
+ *
  * @author ruoyi
  */
 public class LoginUser implements UserDetails
@@ -71,6 +73,7 @@ public class LoginUser implements UserDetails
      */
     private SysUser user;
 
+
     public LoginUser()
     {
     }
@@ -144,7 +147,7 @@ public class LoginUser implements UserDetails
 
     /**
      * 指定用户是否解锁,锁定的用户无法进行身份验证
-     * 
+     *
      * @return
      */
     @JSONField(serialize = false)
@@ -156,7 +159,7 @@ public class LoginUser implements UserDetails
 
     /**
      * 指示是否已过期的用户的凭据(密码),过期的凭据防止认证
-     * 
+     *
      * @return
      */
     @JSONField(serialize = false)
@@ -168,7 +171,7 @@ public class LoginUser implements UserDetails
 
     /**
      * 是否可用 ,禁用的用户不能身份验证
-     * 
+     *
      * @return
      */
     @JSONField(serialize = false)
@@ -258,6 +261,10 @@ public class LoginUser implements UserDetails
         this.user = user;
     }
 
+
+
+
+
     @Override
     public Collection<? extends GrantedAuthority> getAuthorities()
     {

+ 8 - 4
ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java

@@ -13,7 +13,7 @@ import org.apache.commons.lang3.time.DateFormatUtils;
 
 /**
  * 时间工具类
- * 
+ *
  * @author ruoyi
  */
 public class DateUtils extends org.apache.commons.lang3.time.DateUtils
@@ -29,13 +29,13 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
     public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
 
     private static String[] parsePatterns = {
-            "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", 
+            "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
             "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
             "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
 
     /**
      * 获取当前Date型日期
-     * 
+     *
      * @return Date() 当前日期
      */
     public static Date getNowDate()
@@ -45,7 +45,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
 
     /**
      * 获取当前日期, 默认格式为yyyy-MM-dd
-     * 
+     *
      * @return String
      */
     public static String getDate()
@@ -78,6 +78,10 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
         return new SimpleDateFormat(format).format(date);
     }
 
+    public static final String parseStrYYYYMMDDHHMMSS(final Date date)
+    {
+        return new SimpleDateFormat(YYYYMMDDHHMMSS).format(date);
+    }
     public static final Date dateTime(final String format, final String ts)
     {
         try

+ 6 - 1
ruoyi-system/src/main/java/com/ruoyi/project/bo/ProjectStaffRecordInput.java

@@ -1,14 +1,19 @@
 package com.ruoyi.project.bo;
 
-public class ProjectStaffRecordInput {
+import com.ruoyi.common.core.domain.BaseEntity;
+
+public class ProjectStaffRecordInput extends BaseEntity {
 
     private Long aid;
     private Integer roleType;
+
     /**
      * 审核状态 0=未发起,1=待审核,2=已审核,3=驳回
      */
     private Integer processStatus;
 
+
+
     public Integer getProcessStatus() {
         return processStatus;
     }

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/project/mapper/ProjectStaffRecordMapper.java

@@ -20,4 +20,6 @@ public interface ProjectStaffRecordMapper {
     int updateByPrimaryKey(ProjectStaffRecord record);
 
     List<ProjectStaffRecordOut> selectList(ProjectStaffRecordInput in);
+
+    int selectById(Long id);
 }

+ 5 - 0
ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectStaffRecordServiceImpl.java

@@ -18,6 +18,7 @@ import com.ruoyi.project.mapper.ProjectStaffRecordMapper;
 import com.ruoyi.project.mapper.ProjectTaskMapper;
 import com.ruoyi.project.service.ProjectStaffRecordService;
 import com.ruoyi.system.mapper.SysUserMapper;
+import com.ruoyi.weChat.service.WeChatService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -41,6 +42,8 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
     private ProjectTaskMapper projectTaskMapper;
     @Autowired
     protected Validator validator;
+    @Autowired
+    private WeChatService weChatService;
 
     @Override
     public AjaxResult add(ProjectStaffRecord in) {
@@ -53,6 +56,8 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
             in.setProcessStatus(2);
             sysUserMapper.userAddDuration(userId,in.getDuration());
             projectTaskMapper.projectAddDuration(in.getPid(),in.getDuration());
+        }else {
+//            weChatService.addNotice();
         }
         addRecordLog(in);
         projectStaffRecordMapper.insertSelective(in);

+ 7 - 0
ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectStaffServiceImpl.java

@@ -3,6 +3,7 @@ package com.ruoyi.project.service.impl;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.project.domain.ProjectStaff;
 import com.ruoyi.project.mapper.ProjectStaffMapper;
+import com.ruoyi.project.mapper.ProjectStaffRecordMapper;
 import com.ruoyi.project.mapper.ProjectTaskMapper;
 import com.ruoyi.project.service.ProjectStaffService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -14,6 +15,8 @@ public class ProjectStaffServiceImpl implements ProjectStaffService {
     private ProjectStaffMapper projectStaffMapper;
     @Autowired
     private ProjectTaskMapper projectTaskMapper;
+    @Autowired
+    private ProjectStaffRecordMapper projectStaffRecordMapper;
     @Override
     public AjaxResult addStaff(ProjectStaff in) {
         int i = projectStaffMapper.insertSelective(in);
@@ -23,6 +26,10 @@ public class ProjectStaffServiceImpl implements ProjectStaffService {
 
     @Override
     public AjaxResult deleteStaff(ProjectStaff in) {
+        int sum = projectStaffRecordMapper.selectById(in.getId());
+        if (sum > 0) {
+            return AjaxResult.error("已存在打卡,请不要删除人员.");
+        }
         int i = projectStaffMapper.deleteByPrimaryKey(in.getId());
         if (i>0){
             projectTaskMapper.updateStaffName(in.getPid());

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java

@@ -125,7 +125,7 @@ public interface SysUserMapper
      */
     public SysUser checkEmailUnique(String email);
 
-    List<SysUser> selectName(String name);
+    List<SysUser> selectName(@Param("name") String name,@Param("roleId") Long roleId);
 
     void userAddDuration(@Param("userId") Long userId, @Param("duration") Double duration);
 }

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java

@@ -204,7 +204,7 @@ public interface ISysUserService
      */
     public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
 
-    Object selectName(String name);
+    Object selectName(String name,Integer type);
 
     String setOpenId(String code);
 }

+ 7 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java

@@ -5,6 +5,7 @@ import java.util.List;
 import java.util.stream.Collectors;
 import javax.validation.Validator;
 
+import com.ruoyi.common.enums.UserRolesType;
 import com.ruoyi.system.mapper.*;
 import com.ruoyi.system.service.ISysDeptService;
 import com.ruoyi.weChat.service.WeChatService;
@@ -548,8 +549,12 @@ public class SysUserServiceImpl implements ISysUserService
     }
 
     @Override
-    public Object selectName(String name) {
-        return userMapper.selectName(name);
+    public Object selectName(String name,Integer type){
+        Long roleId=null;
+        if (type==null)type=0;
+        if (type==0)roleId= UserRolesType.COMMON.getCode();
+        else if (type==1)roleId=UserRolesType.MANAGE.getCode();
+        return userMapper.selectName(name,roleId);
     }
 
     @Override

+ 46 - 226
ruoyi-system/src/main/java/com/ruoyi/weChat/service/WeChatService.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 
 import com.ruoyi.common.core.redis.RedisCache;
+import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.http.HttpUtils;
 import com.ruoyi.system.mapper.SysUserMapper;
 import org.slf4j.Logger;
@@ -43,7 +44,7 @@ public class WeChatService {
 	/**
 	 * 审批流程消息提醒
 	 */
-	private static final String PUBLIC_RELEASE_EXAMINE ="2L9AJWl2yNfgd83Fw_f_E6HiaEvPf109iw_xFtI8PXI";
+	private static final String SEND_TEMPLATE_ID ="2L9AJWl2yNfgd83Fw_f_E6HiaEvPf109iw_xFtI8PXI";
 
 
 
@@ -105,35 +106,37 @@ public class WeChatService {
 	}
 
 
-
+	public Integer addNotice(String openid ,Integer id, Date date, String remarks){
+		String str= DateUtils.parseStrYYYYMMDDHHMMSS(date);
+		return addNotice(openid,id,date,remarks);
+	}
 
 
 	/**
 	 * 推送微信订阅信息,跳转为公出信息
 	 * @param openid 发送对象微信openid
-	 * @param type 状态 0驳回 1发起 2同意
-	 * @param date 日期
-	 * @param aname 发送者名称
 	 * @param remarks 发送信息,不能大于十五个字
 	 */
-//	public Integer addNotice(String openid ,Integer type,Integer id, Date date, String aname,String remarks) {
-//		Map<String, Object> map=new HashMap<String, Object>();
-//		String accessToken=getAccessToken();
-//		String url=send_url.replace("ACCESS_TOKEN", accessToken);
-//		map.put("access_token", accessToken);
-//		map.put("touser", openid);
-//		map.put("page", "pages/egressDetails/index?id="+id);
-//		map.put("miniprogram_state", wxState);
-//		if (type==1) {
-//			map.put("template_id", PUBLIC_RELEASE_EXAMINE);
-//			map.put("data",getPublicData(type,date, aname,remarks));
-//		}else {
-//			map.put("template_id", PUBLIC_RELEASE_EXAMINE_RESULT);
-//			map.put("data",getPublicData(type,date, aname,remarks));
-//		}
-//		return SendHttpPost(map, url);
-//
-//	}
+	public Integer addNotice(String openid ,Integer id, String dateTime, String remarks) {
+		Map<String, Object> map=new HashMap<String, Object>();
+		String accessToken=getAccessToken();
+		String url=send_url.replace("ACCESS_TOKEN", accessToken);
+		map.put("access_token", accessToken);
+		map.put("touser", openid);
+		map.put("page", "pages/egressDetails/index?id="+id);
+		map.put("miniprogram_state", wxState);
+		map.put("template_id", SEND_TEMPLATE_ID);
+		map.put("data",getPublicData(dateTime,remarks));
+		String resString = HttpUtils.sendPost(url, map);
+		JSONObject res = JSON.parseObject(resString);
+		if (res.get("errcode")!=null) {
+			log.error(String.format("errcode={%s}",res.getInteger("errcode").toString()));
+			return res.getInteger("errcode");
+		}else {
+			return 1;
+		}
+
+	}
 //
 //	private Integer SendHttpPost(String params, String url) {
 //		String res= HttpUtils.sendPost(url,params);
@@ -144,208 +147,25 @@ public class WeChatService {
 //			return 1;
 //		}
 //	}
-//
-//	/**
-//	 * 推送微信订阅信息,跳转为报销信息
-//	 * @param openid 发送对象微信openid
-//	 * @param type 状态 0驳回 1发起 2同意
-//	 * @param date 日期
-//	 * @param aname 发送者名称
-//	 * @param remarks 发送信息,不能大于十五个字
-//	 */
-//	public Integer addExpenseAccountWeChatNotice(String openid ,Integer type,Integer id, Date date, String aname,String remarks) {
-//		if (openid==null )log.error("openId不能为空");
-//		Map<String, Object> map=new HashMap<String, Object>();
-//		String accessToken=getExpenseAccountAccessToken();
-//		String url=send_url.replace("ACCESS_TOKEN", accessToken);
-//		map.put("access_token", accessToken);
-//		map.put("touser", openid);
-//		//这里要替换成当前的
-//		map.put("page", "pages/egressDetails/index?id="+id);
-//		map.put("miniprogram_state", wxState);
-//		if (type==1) {
-//			map.put("template_id", EXPENSE_RELEASE_EXAMINE);
-//			map.put("data",getExpenseData(type,date, aname,remarks));
-//		}else {
-//			map.put("template_id", EXPENSE_RELEASE_EXAMINE_RESULT);
-//			map.put("data",getExpenseData(type,date, aname,remarks));
-//		}
-//		return SendHttpPost(map, url);
-//	}
-//
-//	/**
-//	 * 公出订阅消息组装
-//	 * @param type
-//	 * @param date
-//	 * @param aname
-//	 * @param remarks
-//	 * @return
-//	 */
-//	private Map<String, Object> getPublicData(Integer type,Date date, String aname, String remarks) {
-//		Map<String, Object> we=new HashMap<String, Object>();
-//		String strDate=DateUtils.formatDate(date, AFTConstants.YMDHMS_CHINESE);
-//		if (remarks.length()>20)remarks=remarks.substring(0,17)+"...";
-//		if (type==1) {
-//			Map<String, Object> v1=new HashMap<String, Object>();
-//			v1.put("value",strDate);
-//			we.put("time5", v1);
-//			Map<String, Object> v2=new HashMap<String, Object>();
-//			v2.put("value", aname);
-//			we.put("name3", v2);
-//			Map<String, Object> v3=new HashMap<String, Object>();
-//			v3.put("value", remarks);
-//			we.put("thing10", v3);
-//		}else {
-//			String thing2="";
-//			if (type==0){
-//				thing2="驳回";
-//			}else if (type==2){
-//				thing2="通过";
-//			}
-//			Map<String, Object> v1=new HashMap<String, Object>();
-//			v1.put("value",strDate);
-//			we.put("date3", v1);
-//			Map<String, Object> v2=new HashMap<String, Object>();
-//			v2.put("value", thing2);
-//			we.put("thing2", v2);
-//			Map<String, Object> v3=new HashMap<String, Object>();
-//			v3.put("value", remarks);
-//			we.put("thing6", v3);
-//		}
-//		return we;
-//	}
-//
-//
-//	/**
-//	 * 报销订阅消息组装
-//	 * @param type
-//	 * @param date
-//	 * @param aname
-//	 * @param remarks
-//	 * @return
-//	 */
-//	private Map<String, Object> getExpenseData(Integer type,Date date, String aname, String remarks) {
-//		Map<String, Object> we=new HashMap<String, Object>();
-//		String strDate=DateUtils.formatDate(date, AFTConstants.YMDHMS_CHINESE);
-//		if (remarks.length()>20)remarks=remarks.substring(0,17)+"...";
-//		if (type==1) {
-//			Map<String, Object> v2=new HashMap<String, Object>();
-//			we.put("thing4", v2);
-//			v2.put("value", aname);
-//			Map<String, Object> v1=new HashMap<String, Object>();
-//			we.put("time6", v1);
-//			v1.put("value",strDate);
-//			Map<String, Object> v3=new HashMap<String, Object>();
-//			we.put("thing2", v3);
-//			v3.put("value", remarks);
-//		}else {
-//			String thing5="";
-//			if (type==0){
-//				thing5="报销驳回";
-//			}else if (type==2){
-//				thing5="报销通过";
-//			}
-//			Map<String, Object> v1=new HashMap<String, Object>();
-//			we.put("time3", v1);
-//			v1.put("value",strDate);
-//			Map<String, Object> v2=new HashMap<String, Object>();
-//			we.put("thing5", v2);
-//			v2.put("value", thing5);
-//			Map<String, Object> v3=new HashMap<String, Object>();
-//			we.put("thing4", v3);
-//			v3.put("value", remarks);
-//		}
-//		return we;
-//	}
-//
-//
-//
-//
-//	public String getAccessToken() {
-//		Date date = new Date();
-//		if (redisUtil.presence("access_token")||redisUtil.presence("expires_in")) {
-//			String access_token=redisUtil.getString("access_token");
-//			String expires_in=redisUtil.getString("expires_in");
-//			if (date.getTime() < Long.valueOf(expires_in)) {
-//				LoggerUtils.debug(getClass(), "redis中获取accestoken");
-//				return access_token;
-//			} else {
-//				LoggerUtils.debug(getClass(), "accestoken超时重新获取");
-//				redisUtil.deleteString("access_token");
-//				redisUtil.deleteString("expires_in");
-//				return setSessionAccessToken(date,0);
-//			}
-//
-//		} else {
-//			return setSessionAccessToken(date,0);
-//		}
-//
-//
-//	}
-//
-//	public String getExpenseAccountAccessToken() {
-//		Date date = new Date();
-//		if (redisUtil.presence("expense_access_token")||redisUtil.presence("expense_expires_in")) {
-//			String access_token=redisUtil.getString("expense_access_token");
-//			String expires_in=redisUtil.getString("expense_expires_in");
-//			if (date.getTime() < Long.valueOf(expires_in)) {
-//				LoggerUtils.debug(getClass(), "redis中获取accestoken");
-//				return access_token;
-//			} else {
-//				LoggerUtils.debug(getClass(), "accestoken超时重新获取");
-//				redisUtil.deleteString("expense_access_token");
-//				redisUtil.deleteString("expense_expires_in");
-//				return setSessionAccessToken(date,1);
-//			}
-//
-//		} else {
-//			return setSessionAccessToken(date,1);
-//		}
-//
-//
-//	}
-//
-//
-//	/**
-//	 *
-//	 * @param date 参数
-//	 * @param type 0公出小程序 1报销小程序
-//	 * @return
-//	 */
-//	private String setSessionAccessToken(Date date,Integer type) {
-//		String url =null;
-//		if (type==0){
-//			url=String.format(
-//					"https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", appId,
-//					appSecret);
-//		}else if(type==1){
-//			url=String.format(
-//					"https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", expenseAppId,
-//					expenseAppSecret);
-//		}
-//
-//		JSONObject js = HttpUtils.httpGet(url);
-//		String errcode =js.getString("errcode");
-//		if (errcode!=null) {
-//			throw new  BusinessException("获取AccessToken失败!");
-//		}else {
-//			LoggerUtils.debug(AsyncUtils.class,"获取并存入AccessToken成功,accesstoken="+js.getString("access_token"));
-//		}
-//		String access_token = js.getString("access_token");
-//		Long expires_in = js.getLong("expires_in");
-//		//返回时间为秒需要计算换成毫秒
-//		expires_in=expires_in*1000;
-//		expires_in+=date.getTime();
-//		if (type==0){
-//			redisUtil.setString("access_token", access_token);
-//			redisUtil.setString("expires_in", expires_in.toString());
-//		}else if (type==1){
-//			redisUtil.setString("expense_access_token", access_token);
-//			redisUtil.setString("expense_expires_in", expires_in.toString());
-//		}
-//
-//		return access_token;
-//	}
-//
+
+	/**
+	 * 公出订阅消息组装
+	 * @param dateTime 时间
+	 * @param remarks 备注
+	 * @return
+	 */
+	private Map<String, Object> getPublicData(String dateTime,  String remarks) {
+		Map<String, Object> we=new HashMap<String, Object>();
+		if (remarks.length()>20)remarks=remarks.substring(0,17)+"...";
+			Map<String, Object> v1=new HashMap<String, Object>();
+			v1.put("value",dateTime);
+			we.put("time15", v1);
+			Map<String, Object> v2=new HashMap<String, Object>();
+			v2.put("value", remarks);
+			we.put("thing13", v2);
+		return we;
+	}
+
+
 
 }

+ 6 - 0
ruoyi-system/src/main/resources/mapper/project/ProjectStaffRecordMapper.xml

@@ -200,4 +200,10 @@
       and a.process_status= #{processStatus}
     </if>
   </select>
+    <select id="selectById" resultType="java.lang.Integer">
+      select count(*)
+      from project_staff_record a left join project_staff ps on a.aid = ps.aid
+      where a.pid=ps.pid
+      and ps.id = #{id}
+    </select>
 </mapper>

+ 1 - 1
ruoyi-system/src/main/resources/mapper/project/ProjectTaskMapper.xml

@@ -204,7 +204,7 @@
   <select id="selectList" resultMap="BaseResultOutMap">
     select
     a.id, a.aid, a.`name`, a.project_status , a.create_time, a.remark, a.admin_name, a.staff_name, a.project_number,
-    a.project_year, a.create_year, a.cross_year
+    a.project_year, a.create_year, a.cross_year,a.duration
     from project_task a
     <if test="companyId !=null">
       left join sys_user c on a.aid=c.user_id

+ 3 - 1
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -274,7 +274,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 	<select id="selectName" resultType="com.ruoyi.common.core.domain.entity.SysUser">
 		select user_id userId, user_name userName,nick_name nickName
-		from sys_user where user_id >1 and nick_name like concat('%',#{name},'%')
+		from sys_user
+		where user_id >1 and nick_name like concat('%',#{name},'%')
+		and user_id in (select user_id from sys_user_role where role_id = #{roleId})
 	</select>
 
 	<update id="userAddDuration">