diff --git a/tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java b/tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java index ef73c024..33fd1b2e 100644 --- a/tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java +++ b/tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java @@ -73,6 +73,8 @@ public class TaskVo { private Byte routineLocation; @ApiModelProperty("入参") private String importParam; + @ApiModelProperty("任务配置") + private ProTaskShow proTaskConfig = new ProTaskShow(); public Long getDuration(){ if(ObjectUtil.isNotNull(beginTime) && ObjectUtil.isNotNull(endTime)) { return endTime - beginTime; @@ -101,6 +103,10 @@ public class TaskVo { private Long executorRole; @ApiModelProperty("负责人名称") private String executorRoleName; + @ApiModelProperty("检查人Id") + private Long checkerRole; + @ApiModelProperty("检查人名称") + private String checkerRoleName; @ApiModelProperty("开始时间") private Long beginTime; @ApiModelProperty("结束时间") diff --git a/tall/src/main/java/com/ccsens/tall/persist/dao/TaskDeliverDao.java b/tall/src/main/java/com/ccsens/tall/persist/dao/TaskDeliverDao.java index a453054a..42342ca2 100644 --- a/tall/src/main/java/com/ccsens/tall/persist/dao/TaskDeliverDao.java +++ b/tall/src/main/java/com/ccsens/tall/persist/dao/TaskDeliverDao.java @@ -40,4 +40,11 @@ public interface TaskDeliverDao extends ProTaskDeliverMapper{ * @return */ List selectOutputDocByTaskId(Long taskId); + + /** + * 根据交付物id 查询出当前项目的项目经理 + * @param deliverId 交付物id + * @return 项目经理的id + */ + List selectPMIdByDeliverId(Long deliverId); } diff --git a/tall/src/main/java/com/ccsens/tall/persist/dao/TaskDetailDao.java b/tall/src/main/java/com/ccsens/tall/persist/dao/TaskDetailDao.java index c104d575..b451322d 100644 --- a/tall/src/main/java/com/ccsens/tall/persist/dao/TaskDetailDao.java +++ b/tall/src/main/java/com/ccsens/tall/persist/dao/TaskDetailDao.java @@ -72,6 +72,10 @@ public interface TaskDetailDao extends ProTaskDetailMapper { */ List queryLwbsByProjectId(@Param("projectId")Long projectId, @Param("startTime")Long startTime, @Param("endTime")Long endTime, @Param("userId")Long userId); - - + /** + * 通过任务详情id查询项目下的经理角色id + * @param id 任务详情id + * @return 项目经理id + */ + Long selectPmByTaskId(Long id); } diff --git a/tall/src/main/java/com/ccsens/tall/service/InputDocService.java b/tall/src/main/java/com/ccsens/tall/service/InputDocService.java index 7215d756..23b17604 100644 --- a/tall/src/main/java/com/ccsens/tall/service/InputDocService.java +++ b/tall/src/main/java/com/ccsens/tall/service/InputDocService.java @@ -59,6 +59,8 @@ public class InputDocService implements IInputDocService { private ProDeliverHistoryRecordDao deliverHistoryRecordDao; @Resource private IProMemberService iProMemberService; + @Resource + private TaskDeliverService taskDeliverService; // @@ -222,8 +224,10 @@ public class InputDocService implements IInputDocService { */ @Override public List findDocByTask(InputDocDto.FindDocByTask param) { + //判断传入的是任务详情id还是分解id,返回分解id + Long taskId = taskDeliverService.isTaskOrSubTime(param.getTaskId()); //查询任务分解后 - ProTaskSubTime proTaskSubTime = taskSubTimeDao.selectByPrimaryKey(param.getTaskId()); + ProTaskSubTime proTaskSubTime = taskSubTimeDao.selectByPrimaryKey(taskId); if(ObjectUtil.isNull(proTaskSubTime)){ throw new BaseException(CodeEnum.NOT_TASK); } diff --git a/tall/src/main/java/com/ccsens/tall/service/ProRoleService.java b/tall/src/main/java/com/ccsens/tall/service/ProRoleService.java index 0b3a440c..07071b49 100644 --- a/tall/src/main/java/com/ccsens/tall/service/ProRoleService.java +++ b/tall/src/main/java/com/ccsens/tall/service/ProRoleService.java @@ -1012,7 +1012,7 @@ public class ProRoleService implements IProRoleService { */ @Override public void upRoleShowsOrder(QueryDto param) { - if(ObjectUtil.isNull(param.getParam().getRoleIds()) || param.getParam().getRoleIds().size()<=1){ + if(ObjectUtil.isNull(param.getParam().getRoleIds())){ throw new BaseException(CodeEnum.ZUISHAOCHUANLIANGE); } diff --git a/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java b/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java index 0cb77114..9e5e32b9 100644 --- a/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java +++ b/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java @@ -784,17 +784,30 @@ public class ProTaskDetailService implements IProTaskDetailService { taskDetail.setSecondTasks(new ArrayList<>()); taskDetail.getSecondTasks().addAll(groupTaskList); } + //查询此任务下的输入文档 + List inputDocInfos = proTaskInputDocDao.selectDocByTaskId(taskDetail.getDetailId()); + if (CollectionUtil.isNotEmpty(inputDocInfos)){ + taskDetail.setInputDoc(inputDocInfos); + } + //查询此任务下的输出文档 + List outputDocInfos = taskDeliverDao.selectOutputDocByTaskId(taskDetail.getDetailId()); + if (CollectionUtil.isNotEmpty(outputDocInfos)){ + taskDetail.setOutputDoc(outputDocInfos); + } + //设置检查人 + ProRole checkRole = proRoleDao.selectByPrimaryKey(task.getCheckerRole()); + if (ObjectUtil.isNotNull(checkRole)){ + taskDetail.setCheckerRole(checkRole.getId()); + taskDetail.setCheckerRoleName(checkRole.getName()); + }else{ + //根据任务id查询项目下项目经理 + Long pmId = taskDetailDao.selectPmByTaskId(task.getId()); + ProRole proRole = proRoleDao.selectByPrimaryKey(pmId); + taskDetail.setCheckerRole(proRole.getId()); + taskDetail.setCheckerRoleName(proRole.getName()); + } } - //查询此任务下的输入文档 - List inputDocInfos = proTaskInputDocDao.selectDocByTaskId(taskDetail.getDetailId()); - if (CollectionUtil.isNotEmpty(inputDocInfos)){ - taskDetail.setInputDoc(inputDocInfos); - } - //查询此任务下的输出文档 - List outputDocInfos = taskDeliverDao.selectOutputDocByTaskId(taskDetail.getDetailId()); - if (CollectionUtil.isNotEmpty(outputDocInfos)){ - taskDetail.setOutputDoc(outputDocInfos); - } + return taskDetail; } diff --git a/tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java b/tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java index fb10ea91..13c6de2b 100644 --- a/tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java +++ b/tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java @@ -248,6 +248,19 @@ public class TaskDeliverService implements ITaskDeliverService { postLogCheckerDao.insertSelective(postLogChecker); } } else { + //不选择检查人,检查人默认为项目经理 + //查找此项目下的项目经理 +// List pmIds = taskDeliverDao.selectPMIdByDeliverId(uploadDeliver.getDeliverId()); +// if (CollectionUtil.isNotEmpty(pmIds)){ +// for (Long pmId : pmIds) { +// ProTaskDeliverPostLogChecker postLogChecker=new ProTaskDeliverPostLogChecker(); +// postLogChecker.setId(snowflake.nextId()); +// postLogChecker.setDeliverPostLogId(deliverPostLog.getId()); +// postLogChecker.setCheckerId(pmId); +// //将经理id放入检查人list中,发送消息 +// uploadDeliver.getCheckerIdList().add(pmId); +// } +// } throw new BaseException(CodeEnum.NOT_CHECKER); } //修改交付物状态 @@ -1105,8 +1118,9 @@ public class TaskDeliverService implements ITaskDeliverService { */ @Override public List queryDeliverByTaskId(Long currentUserId, Long taskId) { + Long taskOrSubTime = isTaskOrSubTime(taskId); //查询分解后的任务 - ProTaskSubTime taskSubTime = taskSubTimeDao.selectByPrimaryKey(taskId); + ProTaskSubTime taskSubTime = taskSubTimeDao.selectByPrimaryKey(taskOrSubTime); if(ObjectUtil.isNull(taskSubTime)){ throw new BaseException(CodeEnum.NOT_TASK); } diff --git a/tall/src/main/resources/application-dev.yml b/tall/src/main/resources/application-dev.yml index 162cf7f7..e8f64049 100644 --- a/tall/src/main/resources/application-dev.yml +++ b/tall/src/main/resources/application-dev.yml @@ -47,4 +47,6 @@ project: redisUpdate: 0 redisUpdateUrl: http://localhost:8001/constant/updateAll/ filedeal: https://test.tall.wiki/filedeal/file/query + # 0测试 1生产 + wx_h5: 0 diff --git a/tall/src/main/resources/mapper_dao/DeliverDao.xml b/tall/src/main/resources/mapper_dao/DeliverDao.xml index f7aa0c79..c075bad6 100644 --- a/tall/src/main/resources/mapper_dao/DeliverDao.xml +++ b/tall/src/main/resources/mapper_dao/DeliverDao.xml @@ -300,4 +300,38 @@ WHERE ptd.task_detail_id = #{taskId} + + \ No newline at end of file diff --git a/tall/src/main/resources/mapper_dao/ProDeliverHistoryRecordDao.xml b/tall/src/main/resources/mapper_dao/ProDeliverHistoryRecordDao.xml index a621ce5c..d175f149 100644 --- a/tall/src/main/resources/mapper_dao/ProDeliverHistoryRecordDao.xml +++ b/tall/src/main/resources/mapper_dao/ProDeliverHistoryRecordDao.xml @@ -14,12 +14,14 @@ pdhr.content AS content, pm.id AS memberId, pm.nickname AS memberName, - pdhr.history_remark AS historyRemark + pdhr.history_remark AS historyRemark, + tid.name AS deliverName FROM t_pro_deliver_history_record AS pdhr LEFT JOIN t_pro_role AS pr ON pdhr.role_id = pr.id and pr.rec_status = 0 LEFT JOIN t_pro_task_input_record AS ptir ON ptir.id = pdhr.deliver_record_id LEFT JOIN t_pro_member AS pm ON pm.id = pdhr.member_id and pm.rec_status = 0 + LEFT JOIN t_pro_task_input_doc AS tid ON tid.id = pdhr.deliver_id WHERE pdhr.deliver_id = #{deliverId} and pdhr.rec_status = 0 @@ -37,12 +39,15 @@ pdhr.created_at AS createAt, pdhr.content AS content, pm.id AS memberId, - pm.nickname AS memberName + pm.nickname AS memberName, + pdhr.history_remark AS historyRemark, + tid.name AS deliverName FROM t_pro_deliver_history_record AS pdhr LEFT JOIN t_pro_role AS pr ON pdhr.role_id = pr.id and pr.rec_status = 0 LEFT JOIN t_pro_task_deliver_post_log AS ptdpl ON ptdpl.id = pdhr.deliver_record_id LEFT JOIN t_pro_member AS pm ON pm.id = pdhr.member_id and pm.rec_status = 0 + LEFT JOIN t_pro_task_deliver AS tid ON tid.id = pdhr.deliver_id WHERE pdhr.deliver_id = #{deliverId} and pdhr.rec_status = 0 diff --git a/tall/src/main/resources/mapper_dao/SysOperationDao.xml b/tall/src/main/resources/mapper_dao/SysOperationDao.xml index 6aeae11f..aaf74a30 100644 --- a/tall/src/main/resources/mapper_dao/SysOperationDao.xml +++ b/tall/src/main/resources/mapper_dao/SysOperationDao.xml @@ -85,10 +85,12 @@ t_sys_operation o WHERE o.rec_status = 0 + and o.project_id in #{id} + \ No newline at end of file diff --git a/tall/src/main/resources/mapper_dao/TaskDetailDao.xml b/tall/src/main/resources/mapper_dao/TaskDetailDao.xml index e8cdbddd..9ba713c6 100644 --- a/tall/src/main/resources/mapper_dao/TaskDetailDao.xml +++ b/tall/src/main/resources/mapper_dao/TaskDetailDao.xml @@ -22,6 +22,7 @@ + @@ -74,6 +75,7 @@ d.project_id as tProjectId, d.description as tDescription, d.executor_role as tExecutorRole, + d.checker_role as checkerRole, s.begin_time as tBeginTime, s.end_time as tEndTime, d.cycle as tCycle, @@ -537,7 +539,8 @@ t.executor_role as executorRole, (SELECT `name` FROM t_pro_role WHERE id = t.executor_role) as executorRoleName, d.id as deliverId, - d.`name` as deliverName + d.`name` as deliverName, + t.priority AS priority FROM t_pro_task_detail t LEFT JOIN t_pro_task_deliver d on t.id = d.task_detail_id @@ -725,4 +728,29 @@ + \ No newline at end of file diff --git a/util/src/main/java/com/ccsens/util/PropUtil.java b/util/src/main/java/com/ccsens/util/PropUtil.java index 8d89990f..9c68111c 100644 --- a/util/src/main/java/com/ccsens/util/PropUtil.java +++ b/util/src/main/java/com/ccsens/util/PropUtil.java @@ -30,6 +30,7 @@ public class PropUtil { public static String getWpsFilePath; public static String accessPath; public static String filedeal; + public static String wxH5; /**redis是否需要更新*/ public static String redisUpdate; public static String redisUpdateUrl; @@ -121,4 +122,8 @@ public class PropUtil { public void setRedisUpdateUrl(String redisUpdateUrl) { PropUtil.redisUpdateUrl = redisUpdateUrl; } + @Value("${project.wx_h5:}") + public static void setWxH5(String wxH5) { + PropUtil.wxH5 = wxH5; + } } diff --git a/util/src/main/java/com/ccsens/util/WebConstant.java b/util/src/main/java/com/ccsens/util/WebConstant.java index 930c663b..8a0fde3f 100644 --- a/util/src/main/java/com/ccsens/util/WebConstant.java +++ b/util/src/main/java/com/ccsens/util/WebConstant.java @@ -353,7 +353,7 @@ public class WebConstant { , Email(2,"Email"), Account(3,"账号") ,OAUTH2_Wx(4,"微信公众号网页授权登录"),Wx_H5(5,"网页微信登陆") ,OAUTH2_WeiBo(6,"微博"),WxEnterprise(7, "企业微信"), - OFFICIAL_ACCOUNT_WX(9,"微信公众号登录"); + OFFICIAL_ACCOUNT_WX(9,"微信公众号登录"),Wx_H5_TEST(10,"网页微信登陆测试"); // 钉钉是8 public int value; diff --git a/util/src/main/java/com/ccsens/util/wx/WxGzhUtil.java b/util/src/main/java/com/ccsens/util/wx/WxGzhUtil.java index a4a4cada..19e91f20 100644 --- a/util/src/main/java/com/ccsens/util/wx/WxGzhUtil.java +++ b/util/src/main/java/com/ccsens/util/wx/WxGzhUtil.java @@ -4,10 +4,7 @@ import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; import com.alibaba.fastjson.JSONException; import com.alibaba.fastjson.JSONObject; -import com.ccsens.util.DateUtil; -import com.ccsens.util.JacksonUtil; -import com.ccsens.util.RedisUtil; -import com.ccsens.util.WebConstant; +import com.ccsens.util.*; import com.ccsens.util.bean.wx.po.WxAccessToken; import com.ccsens.util.bean.wx.po.WxOauth2AccessToken; import com.ccsens.util.bean.wx.po.WxOauth2UserInfo; @@ -83,8 +80,11 @@ public class WxGzhUtil { private static final String APPID = "wx7af1bf1e14facf82"; private static final String SECRET = "a6613fae11b497639c0224b820aaf6d9"; - private static final String APPID_H5 = "wxd1842e073e0e6d91"; - private static final String SECRET_H5 = "96d69b79039caf92a2abafa999880cad"; + private static final String APPID_H5_TEST = "wxd1842e073e0e6d91"; + private static final String SECRET_H5_TEST = "96d69b79039caf92a2abafa999880cad"; + + private static final String APPID_H5 = "wxb842be1cf4c5cf78"; + private static final String SECRET_H5 = "ae9ec99c4fbbc7042b90698c3d05e21b"; private static final String appid_health = "wx2f9ef33e08053bbf"; private static final String secret_health = "af90801c26bc177681b2c39a603605b9"; @@ -129,6 +129,8 @@ public class WxGzhUtil { switch (identifyType){ case Wx_H5: return APPID_H5; + case Wx_H5_TEST: + return APPID_H5_TEST; case OAUTH2_Wx: default: return APPID; @@ -139,6 +141,8 @@ public class WxGzhUtil { switch (identifyType){ case Wx_H5: return SECRET_H5; + case Wx_H5_TEST: + return SECRET_H5_TEST; case OAUTH2_Wx: default: return SECRET; @@ -347,6 +351,9 @@ public class WxGzhUtil { * @throws BaseException 异常 */ public static WxOauth2UserInfo getOauth2UserInfo(WebConstant.IDENTIFY_TYPE identifyType,String code) throws BaseException { + if (StrUtil.isNotBlank(PropUtil.wxH5) && PropUtil.wxH5.equals("0")){ + identifyType = WebConstant.IDENTIFY_TYPE.Wx_H5_TEST; + } WxOauth2AccessToken wxOauth2AccessToken = getOauth2AccessToken(identifyType,code); return getOauth2UserInfo(wxOauth2AccessToken.getAccessToken(),wxOauth2AccessToken.getOpenId()); } diff --git a/util/src/main/java/com/ccsens/util/wx/WxXcxUtil.java b/util/src/main/java/com/ccsens/util/wx/WxXcxUtil.java index b115c96b..74a499ed 100644 --- a/util/src/main/java/com/ccsens/util/wx/WxXcxUtil.java +++ b/util/src/main/java/com/ccsens/util/wx/WxXcxUtil.java @@ -171,6 +171,9 @@ public class WxXcxUtil { private static final String appid_health = "wx2f9ef33e08053bbf"; private static final String secret_health = "af90801c26bc177681b2c39a603605b9"; + private static final String appid_enterprise = "wx808fa75921bd8f22"; + private static final String secret_enterprise = "8d2e95462bfeab363ee84776bc807859"; + private static final String mchid = ""; private static final String key = ""; @@ -184,6 +187,8 @@ public class WxXcxUtil { return appid_bh; case "health": return appid_health; + case "enterprise": + return appid_enterprise; default: return appid; } @@ -199,6 +204,8 @@ public class WxXcxUtil { return secret_bh; case "health": return secret_health; + case "enterprise": + return secret_enterprise; default: return secret; }