From 5814d787ae40634f1a4e1f36889ea8074689b754 Mon Sep 17 00:00:00 2001 From: ma <1062634917@qq.com> Date: Sun, 25 Apr 2021 19:25:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E7=BC=BA=E9=99=B7,=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E7=99=BB=E5=BD=95=E9=97=AE=E9=A2=98,?= =?UTF-8?q?=E4=BA=A4=E4=BB=98=E7=89=A9=E9=BB=98=E8=AE=A4=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tall/persist/dao/TaskDeliverDao.java | 7 ++++ .../tall/persist/dao/TaskDetailDao.java | 8 +++-- .../ccsens/tall/service/InputDocService.java | 6 +++- .../ccsens/tall/service/ProRoleService.java | 2 +- .../tall/service/ProTaskDetailService.java | 33 ++++++++++++------ .../tall/service/TaskDeliverService.java | 16 ++++++++- tall/src/main/resources/application-dev.yml | 2 ++ tall/src/main/resources/application.yml | 4 +-- .../main/resources/mapper_dao/DeliverDao.xml | 34 +++++++++++++++++++ .../mapper_dao/ProDeliverHistoryRecordDao.xml | 9 +++-- .../resources/mapper_dao/TaskDetailDao.xml | 28 ++++++++++++++- .../main/java/com/ccsens/util/PropUtil.java | 5 +++ .../java/com/ccsens/util/WebConstant.java | 2 +- .../java/com/ccsens/util/wx/WxGzhUtil.java | 19 +++++++---- 14 files changed, 148 insertions(+), 27 deletions(-) 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/application.yml b/tall/src/main/resources/application.yml index b5408a3a..ebc544af 100644 --- a/tall/src/main/resources/application.yml +++ b/tall/src/main/resources/application.yml @@ -1,5 +1,5 @@ spring: profiles: - active: dev - include: util-dev,common + active: test + include: util-test,common 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/TaskDetailDao.xml b/tall/src/main/resources/mapper_dao/TaskDetailDao.xml index c6cfef4e..9ba713c6 100644 --- a/tall/src/main/resources/mapper_dao/TaskDetailDao.xml +++ b/tall/src/main/resources/mapper_dao/TaskDetailDao.xml @@ -539,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 @@ -727,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()); } From 52d272b970e039d2caa503e256696f21491ab0e3 Mon Sep 17 00:00:00 2001 From: hyy-alt <1041001226@qq.com> Date: Mon, 26 Apr 2021 09:21:36 +0800 Subject: [PATCH 2/2] 4.26 --- tall/src/main/resources/application.yml | 4 ++-- tall/src/main/resources/mapper_raw/ProRoleMapper.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tall/src/main/resources/application.yml b/tall/src/main/resources/application.yml index ebc544af..b5408a3a 100644 --- a/tall/src/main/resources/application.yml +++ b/tall/src/main/resources/application.yml @@ -1,5 +1,5 @@ spring: profiles: - active: test - include: util-test,common + active: dev + include: util-dev,common diff --git a/tall/src/main/resources/mapper_raw/ProRoleMapper.xml b/tall/src/main/resources/mapper_raw/ProRoleMapper.xml index 489aa8c5..b3775227 100644 --- a/tall/src/main/resources/mapper_raw/ProRoleMapper.xml +++ b/tall/src/main/resources/mapper_raw/ProRoleMapper.xml @@ -86,8 +86,8 @@ - order by ${orderByClause} - + order by ${orderByClause} +