|
@@ -0,0 +1,59 @@
|
|
|
+/*
|
|
|
+ * Copyright (c) 2014, 2022, Chengdu Minto Technology Co.,LTD. All rights reserved.
|
|
|
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
+ */
|
|
|
+
|
|
|
+package com.minto.app.task.manager;
|
|
|
+
|
|
|
+import com.minto.app.task.beans.TaskMemberBean;
|
|
|
+import com.minto.app.task.beans.TaskMemberPhaseReportConfig;
|
|
|
+import com.minto.app.task.beans.TaskTypeSettingBean;
|
|
|
+import com.minto.app.task.dao.ITaskListManagerDao;
|
|
|
+import com.minto.app.task.dao.ITaskMemberDao;
|
|
|
+import com.minto.app.task.dao.ITaskTypeSettingDao;
|
|
|
+import com.minto.core.common.AppContext;
|
|
|
+import com.minto.core.util.CollectionUtil;
|
|
|
+import com.minto.core.util.DateUtil;
|
|
|
+import com.minto.core.util.StringUtil;
|
|
|
+import com.minto.core.util.UUIDUtil;
|
|
|
+import com.minto.tip.common.exceptions.BusinessException;
|
|
|
+import org.hibernate.criterion.Criterion;
|
|
|
+import org.hibernate.criterion.Restrictions;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.sql.Array;
|
|
|
+import java.sql.SQLException;
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Created by tq on 2024/10/10.
|
|
|
+ */
|
|
|
+@Service("ITaskTypeSettingManager")
|
|
|
+public class TaskTypeSettingManagerImpl implements ITaskTypeSettingManager{
|
|
|
+ @Resource
|
|
|
+ private ITaskTypeSettingDao taskTypeSettingDao;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void saveListByTypeSettingStr(Long userId, Long taskId, String typeSettingStr) {
|
|
|
+ //先删除原有关联数据
|
|
|
+ Criterion c = Restrictions.eq("reference_id",taskId);
|
|
|
+ taskTypeSettingDao.delete(TaskTypeSettingBean.class,c);
|
|
|
+
|
|
|
+ if (StringUtil.isEmpty(typeSettingStr)) return;
|
|
|
+ List<TaskTypeSettingBean> taskTypeSettingBeanList = new ArrayList<>();
|
|
|
+ Arrays.stream(typeSettingStr.split(",")).forEach(e -> {
|
|
|
+ TaskTypeSettingBean bean = new TaskTypeSettingBean();
|
|
|
+ //重置当前操作对象id
|
|
|
+ Long uuidLong = UUIDUtil.UUIDLong();
|
|
|
+ bean.setId(uuidLong);
|
|
|
+ bean.setReferenceId(taskId);
|
|
|
+ bean.setTypeId(Long.parseLong(e));
|
|
|
+ bean.setCreateBy(userId);
|
|
|
+ bean.setCreateTime(DateUtil.now());
|
|
|
+ taskTypeSettingBeanList.add(bean);
|
|
|
+ });
|
|
|
+
|
|
|
+ taskTypeSettingDao.saveAll(taskTypeSettingBeanList);
|
|
|
+ }
|
|
|
+}
|