|
@@ -55,6 +55,7 @@ import org.springblade.manager.vo.*;
|
|
|
import org.springblade.system.cache.ParamCache;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -418,7 +419,7 @@ public class TextdictInfoController extends BladeController {
|
|
|
int rowspan = element.attr("ROWSPAN").equals("") ? 0 : Integer.parseInt(element.attr("ROWSPAN"));
|
|
|
element.empty().append("<el-input :rows=" + rowspan * 2 + " id=" + keyname + " @mouseup.left=" + leftCli + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='textarea' placeholder=" + placeholder + " v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </el-input>");
|
|
|
} else if (textdictInfo.getTextId().equals("select")) { // 下拉框
|
|
|
- String selectText = " <el-select id=" + keyname + " v-model=" + vmode + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' @mouseup.right='RightClick(" + parm +")' keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">"; //v-model="+keyname+"
|
|
|
+ String selectText = " <el-select id=" + keyname + " v-model=" + vmode + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' @mouseup.right='RightClick(" + parm + ")' keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">"; //v-model="+keyname+"
|
|
|
List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
|
|
|
if (optionList != null && optionList.size() >= 1) {
|
|
|
for (int i = 0; i < optionList.size(); i++)
|
|
@@ -454,28 +455,28 @@ public class TextdictInfoController extends BladeController {
|
|
|
List<DateFormat> dateFormat = textdictInfo.getDateFormat();
|
|
|
String dataf = "YYYY年MM月DD日";
|
|
|
String dateType = "date";
|
|
|
- if(dateFormat!=null && dateFormat.size()>=1){
|
|
|
+ if (dateFormat != null && dateFormat.size() >= 1) {
|
|
|
Map<String, String> dateForm = ExcelInfoUtils.getDateFormat(dateFormat);
|
|
|
dataf = dateForm.get("format");
|
|
|
dateType = dateForm.get("type");
|
|
|
}
|
|
|
- if(dateType.equals("datetime")){
|
|
|
- element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='"+dateType+"' format='"+dataf+"' value-format='"+dataf+"' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' placeholder='" + placeholder + "'> </el-date-picker>");
|
|
|
- }else if(dateType.equals("date")){
|
|
|
- element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='"+dateType+"' format='"+dataf+"' value-format='"+dataf+"' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' placeholder='" + placeholder + "'> </el-date-picker>");
|
|
|
+ if (dateType.equals("datetime")) {
|
|
|
+ element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='" + dateType + "' format='" + dataf + "' value-format='" + dataf + "' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' placeholder='" + placeholder + "'> </el-date-picker>");
|
|
|
+ } else if (dateType.equals("date")) {
|
|
|
+ element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='" + dateType + "' format='" + dataf + "' value-format='" + dataf + "' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' placeholder='" + placeholder + "'> </el-date-picker>");
|
|
|
} else if (dateType.equals("time")) {
|
|
|
- element.empty().append("<el-time-picker @keyDowns='dateKeydown()' v-model=" + vmode + " format='"+dataf+"' value-format='"+dataf+"' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' placeholder='" + placeholder + "'> </el-time-picker>");
|
|
|
+ element.empty().append("<el-time-picker @keyDowns='dateKeydown()' v-model=" + vmode + " format='" + dataf + "' value-format='" + dataf + "' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' placeholder='" + placeholder + "'> </el-time-picker>");
|
|
|
}
|
|
|
- }else if (textdictInfo.getTextId().equals("daterange")) { // 时间段
|
|
|
+ } else if (textdictInfo.getTextId().equals("daterange")) { // 时间段
|
|
|
List<DateFormat> dateFormat = textdictInfo.getDateFormat();
|
|
|
String dataf = "YYYY年MM月DD日";
|
|
|
String sp3 = "至";
|
|
|
- if(dateFormat!=null && dateFormat.size()>=1){
|
|
|
+ if (dateFormat != null && dateFormat.size() >= 1) {
|
|
|
Map<String, String> dateForm = ExcelInfoUtils.getDateFormat(dateFormat);
|
|
|
dataf = dateForm.get("format");
|
|
|
sp3 = dateForm.get("sp3");
|
|
|
}
|
|
|
- element.empty().append("<el-date-picker @keyDowns='dateKeydown()' range-separator='"+sp3+"' v-model=" + vmode + " type='datetimerange' placeholder=" + placeholder + " start-placeholder='开始日期' end-placeholder='结束日期' format='"+dataf+"' trIndex=" + trindex + " @mouseup.right='RightClick(" + parm + ")' keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
|
|
|
+ element.empty().append("<el-date-picker @keyDowns='dateKeydown()' range-separator='" + sp3 + "' v-model=" + vmode + " type='datetimerange' placeholder=" + placeholder + " start-placeholder='开始日期' end-placeholder='结束日期' format='" + dataf + "' trIndex=" + trindex + " @mouseup.right='RightClick(" + parm + ")' keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
|
|
|
element.children().get(0).attr("@change", "datePickerChange($event,'" + keyname + "')");
|
|
|
|
|
|
} else if (textdictInfo.getTextId().equals("img")) { //图片
|
|
@@ -557,8 +558,14 @@ public class TextdictInfoController extends BladeController {
|
|
|
return R.success("操作成功");
|
|
|
}
|
|
|
|
|
|
+ List<WbsTreePrivate> wbsTreePrivatesEqual = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>lambdaQuery()
|
|
|
+ .eq(WbsTreePrivate::getProjectId, wbsTreePrivate.getProjectId())
|
|
|
+ .eq(WbsTreePrivate::getExcelId, wbsTreePrivate.getExcelId()));
|
|
|
+ List<Long> pKeyIds = wbsTreePrivatesEqual.stream().map(WbsTreePrivate::getPKeyId).collect(Collectors.toList());
|
|
|
+ String ids = StringUtils.join(pKeyIds, ",");
|
|
|
+
|
|
|
//删除历史数据
|
|
|
- String delSql = "delete from m_textdict_info where tab_id in(SELECT p_key_id from m_wbs_tree_contract where p_key_id!='"+tableId+"' and project_id="+wbsTreePrivate.getProjectId()+" and excel_id="+wbsTreePrivate.getExcelId()+") and type in(2,6) and excel_id is null";
|
|
|
+ String delSql = "delete from m_textdict_info where tab_id in("+ids+") and type in(2,6) and excel_id is null";
|
|
|
jdbcTemplate.execute(delSql);
|
|
|
|
|
|
// ------- 查询数据库是否存在 该该电签信息 ---------
|
|
@@ -570,9 +577,9 @@ public class TextdictInfoController extends BladeController {
|
|
|
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")){
|
|
|
+ if (jsonObject.containsKey("id")) {
|
|
|
textdictInfo.setId(jsonObject.getLong("id"));
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
textdictInfo.setId(SnowFlakeUtil.getId());
|
|
|
textdictInfo.setIsDeleted(0);
|
|
|
}
|
|
@@ -582,7 +589,7 @@ public class TextdictInfoController extends BladeController {
|
|
|
textdictInfo.setSigRoleId(jsonObject.getString("sigRoleId"));
|
|
|
|
|
|
textdictInfo.setTabId(tableId.toString());
|
|
|
- textdictInfo.setExcelId(wbsTreePrivate.getExcelId()+"");
|
|
|
+ textdictInfo.setExcelId(wbsTreePrivate.getExcelId() + "");
|
|
|
|
|
|
textdictInfo.setColName(jsonObject.getString("colName"));
|
|
|
textdictInfo.setSigRoleName(jsonObject.getString("sigRoleName"));
|
|
@@ -607,12 +614,10 @@ public class TextdictInfoController extends BladeController {
|
|
|
String replace = str1.replace("\\", "\\\\");
|
|
|
|
|
|
//修改同几点的数据
|
|
|
- String updateSqlP = "update m_wbs_tree_private set html_url = '" + replace + "' where p_key_id in (SELECT p_key_id from m_wbs_tree_contract where project_id="+wbsTreePrivate.getProjectId()+" and excel_id="+wbsTreePrivate.getExcelId()+")";
|
|
|
+ String updateSqlP = "update m_wbs_tree_private set html_url = '" + replace + "' where p_key_id in ("+ids+")";
|
|
|
jdbcTemplate.execute(updateSqlP);
|
|
|
|
|
|
- List<WbsTreePrivate> wbsTreePrivatesEqual = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>lambdaQuery()
|
|
|
- .eq(WbsTreePrivate::getProjectId, wbsTreePrivate.getProjectId())
|
|
|
- .eq(WbsTreePrivate::getExcelId, wbsTreePrivate.getExcelId()));
|
|
|
+
|
|
|
|
|
|
//修改对应合同段的htmlUrl,当前项目下对应合同段的节点
|
|
|
List<Long> cIdsList = wbsTreePrivatesEqual.stream().map(WbsTreePrivate::getId).distinct().collect(Collectors.toList());
|
|
@@ -634,6 +639,7 @@ public class TextdictInfoController extends BladeController {
|
|
|
return R.success("操作成功");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 保存默认值
|
|
|
*/
|
|
@@ -761,4 +767,103 @@ public class TextdictInfoController extends BladeController {
|
|
|
return R.success("操作成功");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @PostMapping("/save_sigInfo12313213")
|
|
|
+ @ApiOperationSupport(order = 72)
|
|
|
+ @ApiOperation(value = "保存电签", notes = "保存电签")
|
|
|
+ public void synDqidInfo() {
|
|
|
+ String qerysql = "select * from test_data_info where state =1 ";
|
|
|
+ List<Map<String, Object>> maps1 = jdbcTemplate.queryForList(qerysql);
|
|
|
+ if (maps1 != null && maps1.size() >= 0) {
|
|
|
+ for (Map<String, Object> dataInfo : maps1) {
|
|
|
+
|
|
|
+ String excel_id = dataInfo.get("excel_id") + "";
|
|
|
+ String p_key_id = dataInfo.get("p_key_id") + "";
|
|
|
+ try {
|
|
|
+ String sql = "select * from m_textdict_info where excel_id=" + excel_id + " and type in(2,6)";
|
|
|
+ WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.getByPKeyId(Long.parseLong(p_key_id));
|
|
|
+ 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");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
|
|
|
+
|
|
|
+ for (int i = 0; i < maps.size(); i++) {
|
|
|
+ Map<String, Object> data = maps.get(i);
|
|
|
+ String cole = data.get("col_key") + "";
|
|
|
+ String[] trtd = cole.split("__")[1].split("_");
|
|
|
+ Element element = trs.get(Integer.parseInt(trtd[0])).select("td").get(Integer.parseInt(trtd[1]));
|
|
|
+ element.removeAttr("dqId");
|
|
|
+ element.attr("dqId", data.get("id") + "");
|
|
|
+ if ((data.get("type") + "").equals("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");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String dataURL = wbsTreePrivate.getHtmlUrl().replace("/www/wwwroot", "");
|
|
|
+
|
|
|
+ File writeFile = new File(dataURL);
|
|
|
+ FileUtil.writeToFile(writeFile, doc.html(), Boolean.parseBoolean("UTF-8"));
|
|
|
+
|
|
|
+ String str1 = wbsTreePrivate.getHtmlUrl().replace("Desktop//privateUrl", "Desktop/privateUrl");
|
|
|
+ String replace = str1.replace("\\", "\\\\");
|
|
|
+
|
|
|
+ List<WbsTreePrivate> wbsTreePrivatesEqual = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>lambdaQuery()
|
|
|
+ .eq(WbsTreePrivate::getProjectId, wbsTreePrivate.getProjectId())
|
|
|
+ .eq(WbsTreePrivate::getExcelId, wbsTreePrivate.getExcelId()));
|
|
|
+
|
|
|
+ List<Long> pKeyIds = wbsTreePrivatesEqual.stream().map(WbsTreePrivate::getPKeyId).collect(Collectors.toList());
|
|
|
+ String ids = StringUtils.join(pKeyIds, ",");
|
|
|
+ //修改同几点的数据
|
|
|
+ String updateSqlP = "update m_wbs_tree_private set html_url = '" + replace + "' where p_key_id in (" + ids + ")";
|
|
|
+ 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 + ")";
|
|
|
+ jdbcTemplate.execute(updateSqlC);
|
|
|
+ }
|
|
|
+ String updatesql = "update test_data_info set state=2 where p_key_id=" + p_key_id + " and excel_id=" + excel_id + " ";
|
|
|
+ jdbcTemplate.execute(updatesql);
|
|
|
+ System.out.println("--------完成-------=" + p_key_id);
|
|
|
+ } catch (Exception e) {
|
|
|
+ String updatesql = "update test_data_info set state=3 where p_key_id=" + p_key_id + " and excel_id=" + excel_id + " ";
|
|
|
+ jdbcTemplate.execute(updatesql);
|
|
|
+ e.printStackTrace();
|
|
|
+ }finally {
|
|
|
+ System.out.println("1231231");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|