|
@@ -35,14 +35,19 @@ import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
|
import org.springblade.core.redis.cache.BladeRedis;
|
|
|
+import org.springblade.core.secure.BladeUser;
|
|
|
+import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.secure.utils.SecureUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.*;
|
|
|
+import org.springblade.manager.entity.DqOperationLog;
|
|
|
import org.springblade.manager.entity.TextdictInfo;
|
|
|
import org.springblade.manager.entity.WbsTreeContract;
|
|
|
import org.springblade.manager.entity.WbsTreePrivate;
|
|
|
import org.springblade.manager.mapper.WbsTreePrivateMapper;
|
|
|
+import org.springblade.manager.service.IDqOperationLogService;
|
|
|
import org.springblade.manager.service.ITextdictInfoService;
|
|
|
+import org.springblade.manager.service.impl.DqOperationLogServiceImpl;
|
|
|
import org.springblade.manager.service.impl.WbsTreeContractServiceImpl;
|
|
|
import org.springblade.manager.utils.ExcelInfoUtils;
|
|
|
import org.springblade.manager.utils.FileUtils;
|
|
@@ -58,10 +63,7 @@ import java.io.File;
|
|
|
import java.io.FileInputStream;
|
|
|
import java.io.FileNotFoundException;
|
|
|
import java.io.InputStream;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -81,6 +83,7 @@ public class TextdictInfoController extends BladeController {
|
|
|
private final WbsTreeContractServiceImpl wbsTreeContractService;
|
|
|
private final BladeRedis bladeRedis;
|
|
|
private final JdbcTemplate jdbcTemplate;
|
|
|
+ private final IDqOperationLogService dqOperationLogService;
|
|
|
|
|
|
/**
|
|
|
* 详情
|
|
@@ -237,9 +240,14 @@ public class TextdictInfoController extends BladeController {
|
|
|
File writeFile = new File(wbsTreePrivate.getHtmlUrl());
|
|
|
FileUtil.writeToFile(writeFile, doc.html(), Boolean.parseBoolean("UTF-8"));
|
|
|
}
|
|
|
-
|
|
|
//批量删除
|
|
|
delIds.add(ids);
|
|
|
+ if (textdictInfo.getType() == 6 || textdictInfo.getType() == 2) {
|
|
|
+ JSONObject param = new JSONObject();
|
|
|
+ param.put("ids", ids);
|
|
|
+ param.put("tabId", tabId);
|
|
|
+ dqOperationLogService.save(new DqOperationLog(wbsTreePrivate, AuthUtil.getUser(), String.join( ",", delIds), 2,param.toJSONString(), JSON.toJSONString(query), ""));
|
|
|
+ }
|
|
|
textdictInfoService.getBaseMapper().deleteBatchIds(delIds);
|
|
|
|
|
|
return R.success("删除成功");
|
|
@@ -461,6 +469,8 @@ public class TextdictInfoController extends BladeController {
|
|
|
String ids = StringUtils.join(pKeyIds, ",");
|
|
|
|
|
|
//删除历史数据
|
|
|
+ String querySql = "select * from m_textdict_info where (tab_id in(SELECT p_key_id from m_wbs_tree_private where project_id='"+wbsTreePrivate.getProjectId()+"' and excel_id='"+wbsTreePrivate.getExcelId()+"' and type=2 and is_deleted=0) or (excel_id="+wbsTreePrivate.getExcelId()+" AND project_id='"+wbsTreePrivate.getProjectId()+"')) and project_id="+wbsTreePrivate.getProjectId()+" and type in(2,6) ";
|
|
|
+ List<TextdictInfo> oldTextdictInfos = jdbcTemplate.query(querySql, new BeanPropertyRowMapper<>(TextdictInfo.class));
|
|
|
String delSql = "delete from m_textdict_info where (tab_id in(SELECT p_key_id from m_wbs_tree_private where project_id='"+wbsTreePrivate.getProjectId()+"' and excel_id='"+wbsTreePrivate.getExcelId()+"' and type=2 and is_deleted=0) or (excel_id="+wbsTreePrivate.getExcelId()+" AND project_id='"+wbsTreePrivate.getProjectId()+"')) and project_id="+wbsTreePrivate.getProjectId()+" and type in(2,6) ";
|
|
|
jdbcTemplate.execute(delSql);
|
|
|
|
|
@@ -468,6 +478,8 @@ public class TextdictInfoController extends BladeController {
|
|
|
Map<String,String> keyMap = new HashMap<>();
|
|
|
|
|
|
// ------- 查询数据库是否存在 该该电签信息 ---------
|
|
|
+ StringBuilder dqIds = new StringBuilder();
|
|
|
+ List<TextdictInfo> newTextDictInfos = new ArrayList<>();
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
|
|
TextdictInfo textdictInfo = new TextdictInfo();
|
|
@@ -514,6 +526,8 @@ public class TextdictInfoController extends BladeController {
|
|
|
}else{
|
|
|
textdictInfoService.save(textdictInfo);
|
|
|
}
|
|
|
+ newTextDictInfos.add(textdictInfo);
|
|
|
+ dqIds.append(textdictInfo.getId()).append( ",");
|
|
|
String dqId = "";
|
|
|
if(keyMap.containsKey(keky)){
|
|
|
dqId = keyMap.get(keky)+"||"+textdictInfo.getId();
|
|
@@ -557,7 +571,12 @@ public class TextdictInfoController extends BladeController {
|
|
|
String updateSqlC = "update m_wbs_tree_contract set html_url = '" + replace + "' where p_key_id in (" + cPkeyIdsStr + ") and project_id="+wbsTreePrivate.getProjectId()+"";
|
|
|
jdbcTemplate.execute(updateSqlC);
|
|
|
}
|
|
|
-
|
|
|
+ BladeUser user = AuthUtil.getUser();
|
|
|
+ DqOperationLog log = new DqOperationLog(wbsTreePrivate, user, "", 1, dataInfo.toJSONString(), JSON.toJSONString(oldTextdictInfos), JSON.toJSONString(newTextDictInfos));
|
|
|
+ if (dqIds.length() > 1) {
|
|
|
+ log.setBusinessId(dqIds.deleteCharAt(dqIds.length() - 1).toString());
|
|
|
+ }
|
|
|
+ dqOperationLogService.save(log);
|
|
|
bladeRedis.set("save-eVis-lock:" + SecureUtil.getUserId(), "1");
|
|
|
bladeRedis.expire("save-eVis-lock:" + SecureUtil.getUserId(), 3);
|
|
|
|