Kaynağa Gözat

业务系统调用ccpm只读数据代码优化

user5 2 yıl önce
ebeveyn
işleme
55104e5e33

+ 16 - 7
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -654,21 +654,30 @@ public class WorkProjectNotifyController extends BaseController {
 	 */
 	public void formatNotifyResp(List<WorkProjectNotify> list) {
 		if (list.size() > 0) {
+			List<Dict> dictList = DictUtils.getDictList("project_notify_type");
 			for (WorkProjectNotify info: list) {
 				// 获取流程类型
-				String typeLabel = DictUtils.getDictLabel(info.getType(),"project_notify_type","");
-				info.setTypeLabel(typeLabel);
+				for (Dict dict : dictList) {
+					if (info.getType().equals(dict.getValue())){
+						info.setTypeLabel(dict.getLabel());
+						break;
+					}
+				}
+				/*String typeLabel = DictUtils.getDictLabel(info.getType(),"project_notify_type","");
+				info.setTypeLabel(typeLabel);*/
 				// 获取流程提交人
-				if (Objects.nonNull(info.getCreateBy())) {
+				/*if (Objects.nonNull(info.getCreateBy())) {
 					User cUser = UserUtils.getByUserId(info.getCreateBy().getId());
 					if (Objects.nonNull(cUser)) {
 						info.setCreateUserName(cUser.getName());
 					}
-				}
+				}*/
 				// 获取流程审核人
-				User audit = UserUtils.getByUserId(info.getAuditor());
-				if (Objects.nonNull(audit)) {
-					info.setAuditUserName(audit.getName());
+				if(StringUtils.isNotBlank(info.getAuditor())){
+					User audit = UserUtils.getByUserId(info.getAuditor());
+					if (Objects.nonNull(audit)) {
+						info.setAuditUserName(audit.getName());
+					}
 				}
 				// 设置所属系统为ccpm
 				info.setBelongProject("ccpm");

+ 3 - 1
src/main/resources/mappings/modules/workprojectnotify/WorkProjectNotifyDao.xml

@@ -680,8 +680,10 @@
 		<include refid="workProjectNotifyColumns"/>
 		,a.wap_begin_date AS "wapCreateDate"
 		,a.wap_over_date AS "wapEndDate"
+		,su.name as "createUserName"
 		FROM work_project_notify a
 		<include refid="workProjectNotifyJoins"/>
+		left join sys_user su on a.create_by = su.id
 		<where>
 			a.del_flag = #{DEL_FLAG_NORMAL}
 			<if test="title != null and title != ''">
@@ -742,7 +744,7 @@
 			where process_instance_id in(select process_id from work_activity_process_user where user_id = #{user.id} and type=1)
 			and del_flag = 0 and (remarks !='[强制撤销]' or remarks is null) and is_approval != 0
 			)
-			and remarks != '待通知'
+			and a.remarks != '待通知'
 			and a.notify_user = #{user.id}
 		</where>
 		<choose>