|
@@ -247,8 +247,10 @@ public class TextdictInfoController extends BladeController {
|
|
|
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.update(Wrappers.<TextdictInfo>lambdaUpdate().in(TextdictInfo::getId, delIds).eq(TextdictInfo::getProjectId, wbsTreePrivate.getProjectId()).set(TextdictInfo::getIsDeleted, 1));
|
|
|
+ } else {
|
|
|
+ textdictInfoService.getBaseMapper().deleteBatchIds(delIds);
|
|
|
}
|
|
|
- textdictInfoService.getBaseMapper().deleteBatchIds(delIds);
|
|
|
|
|
|
return R.success("删除成功");
|
|
|
}
|
|
@@ -419,19 +421,186 @@ public class TextdictInfoController extends BladeController {
|
|
|
return R.success("操作成功");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 保存电签
|
|
|
+ */
|
|
|
+// @PostMapping("/save_sigInfo")
|
|
|
+// @ApiOperationSupport(order = 7)
|
|
|
+// @ApiOperation(value = "保存电签", notes = "保存电签")
|
|
|
+// @Transactional
|
|
|
+// public R<String> saveSigInfo(@Valid @RequestBody JSONObject dataInfo) throws Exception {
|
|
|
+// String redisValue = bladeRedis.get("save-eVis-lock:" + SecureUtil.getUserId());
|
|
|
+// if (StringUtils.isNotEmpty(redisValue) && redisValue.equals("1")) {
|
|
|
+// throw new ServiceException("请勿重复提交,请3秒后再尝试");
|
|
|
+// }
|
|
|
+// JSONArray jsonArray = dataInfo.getJSONArray("dataInfo");
|
|
|
+//
|
|
|
+// // -------- 移除所有html 的dqid -----
|
|
|
+// Long tableId = dataInfo.getLong("tabId"); //节点pkid
|
|
|
+// //当前清表信息
|
|
|
+// WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.getByPKeyId(tableId);
|
|
|
+// InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(wbsTreePrivate.getHtmlUrl());
|
|
|
+// String htmlString = IoUtil.readToString(inputStreamByUrl);
|
|
|
+// // 样式集合
|
|
|
+// Document doc = Jsoup.parse(htmlString);
|
|
|
+// //解析
|
|
|
+// Element table = doc.select("table").first();
|
|
|
+// Elements trs = table.select("tr");
|
|
|
+// //解析
|
|
|
+// Elements onlyInfo = doc.select("[:readonly]");
|
|
|
+// if (onlyInfo != null && onlyInfo.size() >= 1) {
|
|
|
+// for (Element element : onlyInfo) {
|
|
|
+// element.removeAttr(":readonly");
|
|
|
+// }
|
|
|
+// }
|
|
|
+// Elements tryInfo = doc.select("td[dqid]");
|
|
|
+// if (tryInfo != null && tryInfo.size() >= 1) {
|
|
|
+// for (Element element : tryInfo) {
|
|
|
+// element.removeAttr("dqid");
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if (jsonArray == null || jsonArray.size() == 0) {
|
|
|
+// return R.success("操作成功");
|
|
|
+// }
|
|
|
+//
|
|
|
+// List<WbsTreePrivate> wbsTreePrivatesEqual = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>lambdaQuery()
|
|
|
+// .eq(WbsTreePrivate::getProjectId, wbsTreePrivate.getProjectId())
|
|
|
+// .eq(WbsTreePrivate::getIsDeleted, 0)
|
|
|
+// .eq(WbsTreePrivate::getExcelId, wbsTreePrivate.getExcelId()));
|
|
|
+// List<Long> pKeyIds = wbsTreePrivatesEqual.stream().map(WbsTreePrivate::getPKeyId).collect(Collectors.toList());
|
|
|
+// 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);
|
|
|
+//
|
|
|
+// // 由于要实现电签 一对多(1个key 对应多个电签Id)
|
|
|
+// 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();
|
|
|
+// String keky = jsonObject.getString("colKey");
|
|
|
+//
|
|
|
+// String[] trtd = keky.split("__")[1].split("_");
|
|
|
+// Element element = trs.get(Integer.parseInt(trtd[0])).select("td").get(Integer.parseInt(trtd[1]));
|
|
|
+//
|
|
|
+// String id = element.children().get(0).attr("keyname");
|
|
|
+// if (jsonObject.containsKey("id")) {
|
|
|
+// textdictInfo.setId(jsonObject.getLong("id"));
|
|
|
+// } else {
|
|
|
+// textdictInfo.setId(SnowFlakeUtil.getId());
|
|
|
+// textdictInfo.setIsDeleted(0);
|
|
|
+// }
|
|
|
+// textdictInfo.setName("电签位置配置");
|
|
|
+// textdictInfo.setType(jsonObject.getInteger("type"));
|
|
|
+// textdictInfo.setColKey(id);
|
|
|
+// textdictInfo.setSigRoleId(jsonObject.getString("sigRoleId"));
|
|
|
+//
|
|
|
+// textdictInfo.setTabId(tableId.toString());
|
|
|
+// textdictInfo.setExcelId(wbsTreePrivate.getExcelId() + "");
|
|
|
+//
|
|
|
+// textdictInfo.setColName(jsonObject.getString("colName"));
|
|
|
+// textdictInfo.setSigRoleName(jsonObject.getString("sigRoleName"));
|
|
|
+// textdictInfo.setPyzbx(jsonObject.getDouble("pyzbx"));
|
|
|
+// textdictInfo.setPyzby(jsonObject.getDouble("pyzby"));
|
|
|
+// Integer timeState = jsonObject.getInteger("timeState");
|
|
|
+// textdictInfo.setTimeState(timeState);
|
|
|
+// if(timeState!=null && timeState==1){
|
|
|
+// textdictInfo.setTimeColKey(jsonObject.getString("timeColKey"));
|
|
|
+// textdictInfo.setTimeName(jsonObject.getString("timeName"));
|
|
|
+// }else{
|
|
|
+// textdictInfo.setTimeColKey("");
|
|
|
+// textdictInfo.setTimeName("");
|
|
|
+// }
|
|
|
+//
|
|
|
+// textdictInfo.setProjectId(wbsTreePrivate.getProjectId());
|
|
|
+//
|
|
|
+// //由于使用联合主键
|
|
|
+// TextdictInfo one = textdictInfoService.selectTextdictInfoOne(textdictInfo.getId()+"",textdictInfo.getSigRoleId(),textdictInfo.getProjectId());
|
|
|
+// if(ObjectUtil.isNotEmpty(one)){
|
|
|
+// textdictInfoService.saveOrUpdate(textdictInfo);
|
|
|
+// }else{
|
|
|
+// textdictInfoService.save(textdictInfo);
|
|
|
+// }
|
|
|
+// newTextDictInfos.add(textdictInfo);
|
|
|
+// dqIds.append(textdictInfo.getId()).append( ",");
|
|
|
+// String dqId = "";
|
|
|
+// if(keyMap.containsKey(keky)){
|
|
|
+// dqId = keyMap.get(keky)+"||"+textdictInfo.getId();
|
|
|
+// }else{
|
|
|
+// dqId=textdictInfo.getId()+"";
|
|
|
+// }
|
|
|
+// keyMap.put(keky,dqId);
|
|
|
+// element.removeAttr("dqId");
|
|
|
+// element.attr("dqId", keyMap.get(keky));
|
|
|
+// if (jsonObject.getInteger("type") == 2) { //个人签字 不能用户输入
|
|
|
+// if (element.html().indexOf("el-tooltip") >= 0) {
|
|
|
+// element.children().get(0).children().get(0).attr(":readonly", "true");
|
|
|
+// } else {
|
|
|
+// element.children().get(0).attr(":readonly", "true");
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// File writeFile = new File(wbsTreePrivate.getHtmlUrl());
|
|
|
+//// File writeFile = new File("D:\\file\\downfile\\1792757075013533696.html");
|
|
|
+// FileUtil.writeToFile(writeFile, doc.html(), Boolean.parseBoolean("UTF-8"));
|
|
|
+//
|
|
|
+// String str1 = wbsTreePrivate.getHtmlUrl().replace("Desktop//privateUrl", "Desktop/privateUrl");
|
|
|
+// String replace = str1.replace("\\", "\\\\");
|
|
|
+//
|
|
|
+// //修改同几点的数据
|
|
|
+// if(StringUtils.isNotBlank(ids)){
|
|
|
+// String updateSqlP = "update m_wbs_tree_private set html_url = '" + replace + "' where p_key_id in ("+ids+") and project_id="+wbsTreePrivate.getProjectId()+"";
|
|
|
+// jdbcTemplate.execute(updateSqlP);
|
|
|
+// }
|
|
|
+//
|
|
|
+// //修改对应合同段的htmlUrl,当前项目下对应合同段的节点
|
|
|
+// List<Long> cIdsList = wbsTreePrivatesEqual.stream().map(WbsTreePrivate::getId).distinct().collect(Collectors.toList());
|
|
|
+//
|
|
|
+// List<Long> cPkeyIds = wbsTreeContractService.getBaseMapper().selectList(Wrappers.<WbsTreeContract>lambdaQuery()
|
|
|
+// .eq(WbsTreeContract::getProjectId, wbsTreePrivate.getProjectId())
|
|
|
+// .eq(WbsTreeContract::getExcelId, wbsTreePrivate.getExcelId())
|
|
|
+// .in(WbsTreeContract::getId, cIdsList)).stream().map(WbsTreeContract::getPKeyId).collect(Collectors.toList());
|
|
|
+// String cPkeyIdsStr = StringUtils.join(cPkeyIds, ",");
|
|
|
+//
|
|
|
+// if (StringUtils.isNotEmpty(cPkeyIdsStr)) {
|
|
|
+// 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);
|
|
|
+//
|
|
|
+// return R.success("操作成功");
|
|
|
+// }
|
|
|
+
|
|
|
/**
|
|
|
* 保存电签
|
|
|
*/
|
|
|
@PostMapping("/save_sigInfo")
|
|
|
@ApiOperationSupport(order = 7)
|
|
|
- @ApiOperation(value = "保存电签", notes = "保存电签")
|
|
|
+ @ApiOperation(value = "保存电签(version 3.0)", notes = "保存电签(version 3.0)")
|
|
|
@Transactional
|
|
|
- public R<String> saveSigInfo(@Valid @RequestBody JSONObject dataInfo) throws Exception {
|
|
|
+ public R<String> saveSigInfoV3(@Valid @RequestBody JSONObject dataInfo) throws Exception {
|
|
|
String redisValue = bladeRedis.get("save-eVis-lock:" + SecureUtil.getUserId());
|
|
|
if (StringUtils.isNotEmpty(redisValue) && redisValue.equals("1")) {
|
|
|
throw new ServiceException("请勿重复提交,请3秒后再尝试");
|
|
|
}
|
|
|
JSONArray jsonArray = dataInfo.getJSONArray("dataInfo");
|
|
|
+ if (jsonArray == null || jsonArray.isEmpty()) {
|
|
|
+ return R.success("操作成功");
|
|
|
+ }
|
|
|
|
|
|
// -------- 移除所有html 的dqid -----
|
|
|
Long tableId = dataInfo.getLong("tabId"); //节点pkid
|
|
@@ -442,101 +611,98 @@ public class TextdictInfoController extends BladeController {
|
|
|
// 样式集合
|
|
|
Document doc = Jsoup.parse(htmlString);
|
|
|
//解析
|
|
|
- Element table = doc.select("table").first();
|
|
|
- Elements trs = table.select("tr");
|
|
|
- //解析
|
|
|
Elements onlyInfo = doc.select("[:readonly]");
|
|
|
- if (onlyInfo != null && onlyInfo.size() >= 1) {
|
|
|
+ if (onlyInfo != null && !onlyInfo.isEmpty()) {
|
|
|
for (Element element : onlyInfo) {
|
|
|
element.removeAttr(":readonly");
|
|
|
}
|
|
|
}
|
|
|
Elements tryInfo = doc.select("td[dqid]");
|
|
|
- if (tryInfo != null && tryInfo.size() >= 1) {
|
|
|
+ if (tryInfo != null && !tryInfo.isEmpty()) {
|
|
|
for (Element element : tryInfo) {
|
|
|
element.removeAttr("dqid");
|
|
|
}
|
|
|
}
|
|
|
- if (jsonArray == null || jsonArray.size() == 0) {
|
|
|
- return R.success("操作成功");
|
|
|
- }
|
|
|
-
|
|
|
- List<WbsTreePrivate> wbsTreePrivatesEqual = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>lambdaQuery()
|
|
|
- .eq(WbsTreePrivate::getProjectId, wbsTreePrivate.getProjectId())
|
|
|
- .eq(WbsTreePrivate::getIsDeleted, 0)
|
|
|
- .eq(WbsTreePrivate::getExcelId, wbsTreePrivate.getExcelId()));
|
|
|
- List<Long> pKeyIds = wbsTreePrivatesEqual.stream().map(WbsTreePrivate::getPKeyId).collect(Collectors.toList());
|
|
|
- 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);
|
|
|
|
|
|
+ // 查询历史数据
|
|
|
+ String querySql = String.format("SELECT * from m_textdict_info WHERE project_id = %d and excel_id = %d and type in (2, 6) and (SELECT 1 from m_wbs_tree_private WHERE p_key_id = tab_id and html_url = '%s' ) = 1"
|
|
|
+ , Long.parseLong(wbsTreePrivate.getProjectId()), wbsTreePrivate.getExcelId(), wbsTreePrivate.getHtmlUrl());
|
|
|
+ List<TextdictInfo> oldTextDictInfos = jdbcTemplate.query(querySql, new BeanPropertyRowMapper<>(TextdictInfo.class));
|
|
|
+ Map<String, TextdictInfo> oldTextDictInfoMap;
|
|
|
+ if (!oldTextDictInfos.isEmpty()) {
|
|
|
+ oldTextDictInfoMap = oldTextDictInfos.stream().collect(Collectors.toMap(item -> item.getProjectId() + item.getExcelId()
|
|
|
+ + (item.getColKey() != null && item.getColKey().contains("__") ? item.getColKey().split("__")[0] : item.getColKey())
|
|
|
+ + item.getSigRoleId(), textdictInfo -> textdictInfo));
|
|
|
+ } else {
|
|
|
+ oldTextDictInfoMap = new HashMap<>();
|
|
|
+ }
|
|
|
// 由于要实现电签 一对多(1个key 对应多个电签Id)
|
|
|
Map<String,String> keyMap = new HashMap<>();
|
|
|
+ //解析
|
|
|
+ Element table = doc.select("table").first();
|
|
|
+ Elements trs = table.select("tr");
|
|
|
|
|
|
// ------- 查询数据库是否存在 该该电签信息 ---------
|
|
|
StringBuilder dqIds = new StringBuilder();
|
|
|
List<TextdictInfo> newTextDictInfos = new ArrayList<>();
|
|
|
+ List<TextdictInfo> updateList = new ArrayList<>();
|
|
|
+ List<TextdictInfo> addList = new ArrayList<>();
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
|
|
- TextdictInfo textdictInfo = new TextdictInfo();
|
|
|
- String keky = jsonObject.getString("colKey");
|
|
|
-
|
|
|
- String[] trtd = keky.split("__")[1].split("_");
|
|
|
- Element element = trs.get(Integer.parseInt(trtd[0])).select("td").get(Integer.parseInt(trtd[1]));
|
|
|
+ String key = jsonObject.getString("colKey");
|
|
|
+ String sigRoleId = jsonObject.getString("sigRoleId");
|
|
|
|
|
|
- String id = element.children().get(0).attr("keyname");
|
|
|
- if (jsonObject.containsKey("id")) {
|
|
|
- textdictInfo.setId(jsonObject.getLong("id"));
|
|
|
+ TextdictInfo textdictInfo = new TextdictInfo();
|
|
|
+ Long id = jsonObject.getLong("id");
|
|
|
+ if (id != null && id > 0) {
|
|
|
+ textdictInfo.setId(id);
|
|
|
} else {
|
|
|
textdictInfo.setId(SnowFlakeUtil.getId());
|
|
|
textdictInfo.setIsDeleted(0);
|
|
|
}
|
|
|
textdictInfo.setName("电签位置配置");
|
|
|
textdictInfo.setType(jsonObject.getInteger("type"));
|
|
|
- textdictInfo.setColKey(id);
|
|
|
- textdictInfo.setSigRoleId(jsonObject.getString("sigRoleId"));
|
|
|
-
|
|
|
+ textdictInfo.setSigRoleId(sigRoleId);
|
|
|
textdictInfo.setTabId(tableId.toString());
|
|
|
textdictInfo.setExcelId(wbsTreePrivate.getExcelId() + "");
|
|
|
-
|
|
|
textdictInfo.setColName(jsonObject.getString("colName"));
|
|
|
textdictInfo.setSigRoleName(jsonObject.getString("sigRoleName"));
|
|
|
textdictInfo.setPyzbx(jsonObject.getDouble("pyzbx"));
|
|
|
textdictInfo.setPyzby(jsonObject.getDouble("pyzby"));
|
|
|
Integer timeState = jsonObject.getInteger("timeState");
|
|
|
textdictInfo.setTimeState(timeState);
|
|
|
- if(timeState!=null && timeState==1){
|
|
|
+ if(timeState == 1){
|
|
|
textdictInfo.setTimeColKey(jsonObject.getString("timeColKey"));
|
|
|
textdictInfo.setTimeName(jsonObject.getString("timeName"));
|
|
|
}else{
|
|
|
textdictInfo.setTimeColKey("");
|
|
|
textdictInfo.setTimeName("");
|
|
|
}
|
|
|
-
|
|
|
textdictInfo.setProjectId(wbsTreePrivate.getProjectId());
|
|
|
|
|
|
- //由于使用联合主键
|
|
|
- TextdictInfo one = textdictInfoService.selectTextdictInfoOne(textdictInfo.getId()+"",textdictInfo.getSigRoleId(),textdictInfo.getProjectId());
|
|
|
- if(ObjectUtil.isNotEmpty(one)){
|
|
|
- textdictInfoService.saveOrUpdate(textdictInfo);
|
|
|
- }else{
|
|
|
- textdictInfoService.save(textdictInfo);
|
|
|
+ String[] trtd = key.split("__")[1].split("_");
|
|
|
+ Element element = trs.get(Integer.parseInt(trtd[0])).select("td").get(Integer.parseInt(trtd[1]));
|
|
|
+ String colKey = element.children().get(0).attr("keyname");
|
|
|
+ textdictInfo.setColKey(colKey);
|
|
|
+
|
|
|
+ TextdictInfo info = oldTextDictInfoMap.get(wbsTreePrivate.getProjectId() + wbsTreePrivate.getExcelId() + (colKey != null && colKey.contains("__") ? colKey.split("__")[0] : colKey) + sigRoleId);
|
|
|
+ if (info != null) {
|
|
|
+ textdictInfo.setId(info.getId());
|
|
|
+ updateList.add(textdictInfo);
|
|
|
+ } else {
|
|
|
+ addList.add(textdictInfo);
|
|
|
}
|
|
|
newTextDictInfos.add(textdictInfo);
|
|
|
dqIds.append(textdictInfo.getId()).append( ",");
|
|
|
String dqId = "";
|
|
|
- if(keyMap.containsKey(keky)){
|
|
|
- dqId = keyMap.get(keky)+"||"+textdictInfo.getId();
|
|
|
+ if(keyMap.containsKey(key)){
|
|
|
+ dqId = keyMap.get(key)+"||"+textdictInfo.getId();
|
|
|
}else{
|
|
|
dqId=textdictInfo.getId()+"";
|
|
|
}
|
|
|
- keyMap.put(keky,dqId);
|
|
|
+ keyMap.put(key,dqId);
|
|
|
element.removeAttr("dqId");
|
|
|
- element.attr("dqId", keyMap.get(keky));
|
|
|
+ element.attr("dqId", keyMap.get(key));
|
|
|
if (jsonObject.getInteger("type") == 2) { //个人签字 不能用户输入
|
|
|
if (element.html().indexOf("el-tooltip") >= 0) {
|
|
|
element.children().get(0).children().get(0).attr(":readonly", "true");
|
|
@@ -546,25 +712,52 @@ public class TextdictInfoController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
File writeFile = new File(wbsTreePrivate.getHtmlUrl());
|
|
|
-// File writeFile = new File("D:\\file\\downfile\\1792757075013533696.html");
|
|
|
FileUtil.writeToFile(writeFile, doc.html(), Boolean.parseBoolean("UTF-8"));
|
|
|
-
|
|
|
String str1 = wbsTreePrivate.getHtmlUrl().replace("Desktop//privateUrl", "Desktop/privateUrl");
|
|
|
String replace = str1.replace("\\", "\\\\");
|
|
|
+ Set<Long> set = oldTextDictInfos.stream().map(TextdictInfo::getId).collect(Collectors.toSet());
|
|
|
+ // 先逻辑删除然后修改
|
|
|
+ this.textdictInfoService.update(Wrappers.<TextdictInfo>lambdaUpdate().eq(TextdictInfo::getProjectId, wbsTreePrivate.getProjectId())
|
|
|
+ .eq(TextdictInfo::getExcelId, wbsTreePrivate.getExcelId()).in(TextdictInfo::getType, 2, 6).in(TextdictInfo::getId, set).set(TextdictInfo::getIsDeleted, 1));
|
|
|
+ if (!updateList.isEmpty()) {
|
|
|
+ for (TextdictInfo info : updateList) {
|
|
|
+ this.textdictInfoService.update(Wrappers.<TextdictInfo>lambdaUpdate().eq(TextdictInfo::getId, info.getId()).eq(TextdictInfo::getProjectId, info.getProjectId())
|
|
|
+ .eq(TextdictInfo::getExcelId, info.getExcelId()).eq(TextdictInfo::getSigRoleId, info.getSigRoleId())
|
|
|
+ .set(info.getName() != null ,TextdictInfo::getName, info.getName())
|
|
|
+ .set(info.getType() != null ,TextdictInfo::getType, info.getType())
|
|
|
+ .set(info.getColName() != null, TextdictInfo::getColName, info.getColName())
|
|
|
+ .set(info.getSigRoleName() != null, TextdictInfo::getSigRoleName, info.getSigRoleName())
|
|
|
+ .set(info.getPyzbx() != null, TextdictInfo::getPyzbx, info.getPyzbx())
|
|
|
+ .set(info.getPyzby() != null, TextdictInfo::getPyzby, info.getPyzby())
|
|
|
+ .set(info.getTimeColKey() != null, TextdictInfo::getTimeColKey, info.getTimeColKey())
|
|
|
+ .set(info.getTimeName() != null, TextdictInfo::getTimeName, info.getTimeName())
|
|
|
+ .set(info.getColKey() != null, TextdictInfo::getColKey, info.getColKey())
|
|
|
+ .set(info.getTabId() != null,TextdictInfo::getTabId, info.getTabId())
|
|
|
+ .set(info.getTimeState() != null ,TextdictInfo::getTimeState, info.getTimeState()).set(TextdictInfo::getIsDeleted, 0));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!addList.isEmpty()) {
|
|
|
+ this.textdictInfoService.saveBatch(addList);
|
|
|
+ }
|
|
|
|
|
|
//修改同几点的数据
|
|
|
+ List<WbsTreePrivate> wbsTreePrivatesEqual = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>lambdaQuery()
|
|
|
+ .eq(WbsTreePrivate::getProjectId, wbsTreePrivate.getProjectId())
|
|
|
+ .eq(WbsTreePrivate::getIsDeleted, 0)
|
|
|
+ .eq(WbsTreePrivate::getExcelId, wbsTreePrivate.getExcelId()).eq(WbsTreePrivate::getHtmlUrl, wbsTreePrivate.getHtmlUrl()));
|
|
|
+ List<Long> pKeyIds = wbsTreePrivatesEqual.stream().map(WbsTreePrivate::getPKeyId).collect(Collectors.toList());
|
|
|
+ String ids = StringUtils.join(pKeyIds, ",");
|
|
|
if(StringUtils.isNotBlank(ids)){
|
|
|
String updateSqlP = "update m_wbs_tree_private set html_url = '" + replace + "' where p_key_id in ("+ids+") and project_id="+wbsTreePrivate.getProjectId()+"";
|
|
|
jdbcTemplate.execute(updateSqlP);
|
|
|
}
|
|
|
|
|
|
//修改对应合同段的htmlUrl,当前项目下对应合同段的节点
|
|
|
- List<Long> cIdsList = wbsTreePrivatesEqual.stream().map(WbsTreePrivate::getId).distinct().collect(Collectors.toList());
|
|
|
-
|
|
|
+ List<Long> cIdsList = wbsTreePrivatesEqual.stream().map(WbsTreePrivate::getPKeyId).distinct().collect(Collectors.toList());
|
|
|
List<Long> cPkeyIds = wbsTreeContractService.getBaseMapper().selectList(Wrappers.<WbsTreeContract>lambdaQuery()
|
|
|
.eq(WbsTreeContract::getProjectId, wbsTreePrivate.getProjectId())
|
|
|
.eq(WbsTreeContract::getExcelId, wbsTreePrivate.getExcelId())
|
|
|
- .in(WbsTreeContract::getId, cIdsList)).stream().map(WbsTreeContract::getPKeyId).collect(Collectors.toList());
|
|
|
+ .in(WbsTreeContract::getIsTypePrivatePid, cIdsList)).stream().map(WbsTreeContract::getPKeyId).collect(Collectors.toList());
|
|
|
String cPkeyIdsStr = StringUtils.join(cPkeyIds, ",");
|
|
|
|
|
|
if (StringUtils.isNotEmpty(cPkeyIdsStr)) {
|
|
@@ -572,18 +765,15 @@ public class TextdictInfoController extends BladeController {
|
|
|
jdbcTemplate.execute(updateSqlC);
|
|
|
}
|
|
|
BladeUser user = AuthUtil.getUser();
|
|
|
- DqOperationLog log = new DqOperationLog(wbsTreePrivate, user, "", 1, dataInfo.toJSONString(), JSON.toJSONString(oldTextdictInfos), JSON.toJSONString(newTextDictInfos));
|
|
|
+ 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);
|
|
|
-
|
|
|
return R.success("操作成功");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 保存默认值
|
|
|
*/
|