From d795b95f2fc534037d903f98a2b57778277f4ce2 Mon Sep 17 00:00:00 2001
From: 杜洪波 <1074825718@qq.com>
Date: 星期一, 20 十月 2025 16:41:48 +0800
Subject: [PATCH] 资料清单变更
---
src/main/java/com/product/contract/service/ProjectInfoService.java | 72 +++++++++++++++++++++++++++++++++---
1 files changed, 66 insertions(+), 6 deletions(-)
diff --git a/src/main/java/com/product/contract/service/ProjectInfoService.java b/src/main/java/com/product/contract/service/ProjectInfoService.java
index 07b4f2a..b13d125 100644
--- a/src/main/java/com/product/contract/service/ProjectInfoService.java
+++ b/src/main/java/com/product/contract/service/ProjectInfoService.java
@@ -1,4 +1,7 @@
package com.product.contract.service;
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
import com.product.contract.config.CmnConst;
import com.product.contract.service.ide.IProjectInfoService;
import com.product.core.dao.BaseDao;
@@ -15,9 +18,7 @@
import org.springframework.stereotype.Component;
import com.product.common.lang.StringUtils;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
/**
* Copyright LX
@@ -45,7 +46,7 @@
* @throws BaseException
*/
public FieldSetEntity getProjectInfo(FieldSetEntity fs) throws BaseException {
- return baseDao.getFieldSetEntity(CmnConst.LX_PROJECT_INFO,fs.getUUID(),true);
+ return baseDao.getFieldSetEntity(CmnConst.PRODUCT_PROJECT_BUSINESS,fs.getUUID(),true);
}
/** 淇濆瓨椤圭洰淇℃伅
@@ -78,7 +79,66 @@
public boolean deleteProjectInfo(FieldSetEntity fs) {
String uuid = fs.getUUID();
String[] uuids = uuid.split(",");
- return baseDao.delete(CmnConst.LX_PROJECT_INFO, BaseUtil.buildQuestionMarkFilter(CmnConst.UUID, uuids.length, true), uuids);
+ return baseDao.delete(CmnConst.PRODUCT_PROJECT_BUSINESS, BaseUtil.buildQuestionMarkFilter(CmnConst.UUID, uuids.length, true), uuids);
+ }
+
+ /**
+ * 璁剧疆璧勬枡娓呭崟
+ * @param fse
+ * @throws BaseException
+ */
+ @Override
+ @Transactional
+ public void saveOrUpdate(FieldSetEntity fse) throws BaseException {
+
+ String dic_name = fse.getValues().get("dict_name").toString();
+ StringBuilder filterSb = new StringBuilder(64);
+ filterSb.append( " project_type = "+dic_name);
+ DataTableEntity dataListNew = fse.getSubData().get("product_project_manager_data_list");
+ for (int i = 0; i < dataListNew.getRows(); i++) {
+ FieldSetEntity fs = dataListNew.getData().get(i);
+ //姝ゆ椂涓烘柊澧炴暟鎹�
+ if(StringUtils.isEmpty(fs.getValues().get("uuid"))){
+ fs.setValue("project_type",dic_name);
+ fs.setValue("org_level_uuid", SpringMVCContextHolder.getCurrentUser().getOrg_level_uuid());
+ fs.setValue("created_by", SpringMVCContextHolder.getCurrentUser().getUser_id());
+ fs.setValue("created_utc_datetime",new Date());
+ baseDao.add(fs);
+ }else if(ObjectUtil.isNotEmpty(fs.getValues().get("~type~"))&&fs.getValues().get("~type~").toString().equals("del")){
+ StringBuilder filter = new StringBuilder(64);
+ filter.append( "uuid = '"+fs.getValues().get("uuid")+"'");
+ filter.append(" and id = "+fs.getValues().get("id"));
+ baseDao.delete("product_project_manager_data_list",filter.toString(),new Object[]{});
+ }else {
+ fs.setValue("updated_by",SpringMVCContextHolder.getCurrentUser().getUser_id());
+ fs.setValue("updated_utc_datetime",new Date());
+ baseDao.update(fs);
+ }
+
+
+
+ }
+
+ }
+
+ /**
+ * 鑾峰彇璧勬枡娓呭崟鍒楄〃(鍒嗛」鐩被鍨�)
+ * @param dict_value
+ * @return
+ * @throws BaseException
+ */
+ @Override
+ public JSONObject getDataList(String dict_value) throws BaseException {
+
+ JSONObject jsonObject=new JSONObject();
+ if(!StringUtils.isEmpty(dict_value)){
+ StringBuilder filterSb = new StringBuilder(64);;
+ filterSb.append( " project_type = "+dict_value);
+ DataTableEntity product_project_manager_data_list = baseDao.listTable("product_project_manager_data_list", filterSb.toString(), new Object[]{});
+ JSONArray objects = BaseUtil.dataTableEntityToJson(product_project_manager_data_list);
+ jsonObject.put("data",objects);
+ }
+ return jsonObject;
}
/**
@@ -100,7 +160,7 @@
}else {
filter = filter + " AND " + queryFilter;
}
- DataTableEntity dt = baseDao.listTable(CmnConst.LX_PROJECT_INFO,filter,new Object[]{},null,null,fs.getInteger(CmnConst.PAGESIZE), fs.getInteger(CmnConst.CPAGE));
+ DataTableEntity dt = baseDao.listTable(CmnConst.PRODUCT_PROJECT_BUSINESS,filter,new Object[]{},null,null,fs.getInteger(CmnConst.PAGESIZE), fs.getInteger(CmnConst.CPAGE));
baseDao.loadPromptData(dt);
return dt;
}
--
Gitblit v1.9.2