|
@@ -1124,32 +1124,32 @@ public class ExcelTabController extends BladeController {
|
|
|
objs.add(jsonObject);
|
|
|
}
|
|
|
|
|
|
- String checkbox = "<hc-form-checkbox-group @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' :objs='" + objs + "' @change='checkboxGroupChange' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " placeholder=''> </hc-form-checkbox-group>";
|
|
|
+ String checkbox = "<hc-form-checkbox-group @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' :objs='" + objs + "' @change='checkboxGroupChange' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " placeholder=''> </hc-form-checkbox-group>";
|
|
|
data.empty().append(checkbox);
|
|
|
|
|
|
} else {
|
|
|
if (index_state) { // 区域内
|
|
|
if (rowspan >= 1) {
|
|
|
- data.empty().append("<el-input type='textarea' @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
|
|
|
+ data.empty().append("<el-input type='textarea' @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
|
|
|
} else {
|
|
|
- data.empty().append("<el-input type='text' @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
|
|
|
+ data.empty().append("<el-input type='text' @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
|
|
|
}
|
|
|
} else { // 区域外
|
|
|
if (j == 0) {
|
|
|
if (colspan == maxCol && i >= 1) {
|
|
|
if (rowspan >= 1) {
|
|
|
- data.empty().append("<el-input @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' type='textarea' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
|
|
|
+ data.empty().append("<el-input @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='textarea' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
|
|
|
} else {
|
|
|
- data.empty().append("<el-input @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' type='text' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
|
|
|
+ data.empty().append("<el-input @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='text' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
Element bforData = tds.get(j - 1);
|
|
|
if (!bforData.text().isEmpty() || bforData.html().indexOf("hc-form-checkbox-group") >= 0) {
|
|
|
if (rowspan >= 1) {
|
|
|
- data.empty().append("<el-input @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' type='textarea' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
|
|
|
+ data.empty().append("<el-input @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='textarea' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
|
|
|
} else {
|
|
|
- data.empty().append("<el-input @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' type='text' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
|
|
|
+ data.empty().append("<el-input @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='text' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1386,11 +1386,15 @@ public class ExcelTabController extends BladeController {
|
|
|
.eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId())
|
|
|
.eq(WbsTreeContract::getParentId, wbsTreeContract.getParentId()));
|
|
|
List<WbsTreeContract> wbsTreeContractList2 = wbsTreeContractList.stream().sorted(Comparator.comparing(WbsTreeContract::getCreateTime).reversed()).collect(Collectors.toList());
|
|
|
+ long tabGroupId = SnowFlakeUtil.getId();
|
|
|
+ // 添加所有
|
|
|
+ wbsTreeContractList2.forEach(WbsTreeContract -> WbsTreeContract.setTabGroupId(tabGroupId));
|
|
|
|
|
|
|
|
|
long newPkId = SnowFlakeUtil.getId();
|
|
|
wbsTreeContract.setPKeyId(newPkId);
|
|
|
wbsTreeContract.setCreateTime(new Date());
|
|
|
+ wbsTreeContract.setTabGroupId(tabGroupId);
|
|
|
String nodeName = wbsTreeContractList2.get(0).getNodeName();
|
|
|
|
|
|
if (nodeName.indexOf("__") >= 0) {
|
|
@@ -1409,15 +1413,14 @@ public class ExcelTabController extends BladeController {
|
|
|
String tabName = wbsTreeContract.getInitTableName();
|
|
|
// 字段查询 并去掉公式字段
|
|
|
|
|
|
- String colkeys = "SELECT GROUP_CONCAT(e_key) as colkeys from m_table_info a ,m_wbs_form_element b WHERE a.tab_en_name = '" + tabName + "' and a.id=b.f_id ";
|
|
|
+ String colkeys = "SELECT GROUP_CONCAT(COLUMN_NAME) as colkeys from information_schema.COLUMNS c where c.table_name='"+tabName+"' and COLUMN_NAME not in('id','p_key_id')";
|
|
|
Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(colkeys);
|
|
|
colkeys = stringObjectMap.get("colkeys") + "";
|
|
|
-
|
|
|
// 复制表数据
|
|
|
|
|
|
String querySql = "insert into " + tabName + " (id,p_key_id," + colkeys + ") select '" + newPkId + "','" + newPkId + "'," + colkeys + " from " + tabName + " where p_key_id=" + pkeyId;
|
|
|
jdbcTemplate.execute(querySql);
|
|
|
-
|
|
|
+ wbsTreeContractService.saveBatch(wbsTreeContractList2);
|
|
|
wbsTreeContractService.save(wbsTreeContract);
|
|
|
return R.data("成功");
|
|
|
}
|
|
@@ -1600,17 +1603,46 @@ public class ExcelTabController extends BladeController {
|
|
|
@ApiOperation(value = "填报页面数据保存", notes = "填报页面数据保存")
|
|
|
public R<String> saveBussData(@Valid @RequestBody JSONObject dataInfo, BladeUser bladeUser) throws Exception {
|
|
|
JSONArray dataArray = new JSONArray();
|
|
|
+
|
|
|
if (dataInfo.containsKey("dataInfo")) { // 节点保存
|
|
|
JSONObject jsonObject = dataInfo.getJSONObject("dataInfo");
|
|
|
dataArray = jsonObject.getJSONArray("orderList");
|
|
|
} else { // 单个保存
|
|
|
dataArray.add(dataInfo);
|
|
|
}
|
|
|
+
|
|
|
JSONObject tableInfo1 = dataArray.getJSONObject(0);
|
|
|
String nodeid = tableInfo1.getString("nodeId");
|
|
|
String contractId = tableInfo1.getString("contractId");
|
|
|
String projectId = tableInfo1.getString("projectId");
|
|
|
String classify = tableInfo1.getString("classify");
|
|
|
+ String groupId = tableInfo1.getString("tabGroupId");
|
|
|
+ String pkeyId = tableInfo1.getString("pkeyId");
|
|
|
+
|
|
|
+ //
|
|
|
+ String pkeyIds = pkeyId;
|
|
|
+ String groupIds = groupId;
|
|
|
+ for(int i=1;i<dataArray.size();i++){
|
|
|
+ JSONObject jsonObject = dataArray.getJSONObject(i);
|
|
|
+ pkeyIds +=","+ jsonObject.getString("pkeyId");;
|
|
|
+ groupIds +=","+ jsonObject.getString("tabGroupId");;
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotEmpty(groupIds)){
|
|
|
+ List<WbsTreeContract> wbsTreeContractList = this.wbsTreeContractService.getBaseMapper().selectList(
|
|
|
+ Wrappers.<WbsTreeContract>lambdaQuery()
|
|
|
+ .in(WbsTreeContract::getTabGroupId, groupIds)
|
|
|
+ .notIn(WbsTreeContract::getPKeyId,pkeyIds)
|
|
|
+ .eq(WbsTreeContract::getIsDeleted,BladeConstant.DB_NOT_DELETED)
|
|
|
+ );
|
|
|
+ if(wbsTreeContractList!=null && wbsTreeContractList.size()>=1){
|
|
|
+ for(WbsTreeContract data: wbsTreeContractList){
|
|
|
+ R bussDataInfo = this.getBussDataInfo(data.getPKeyId());
|
|
|
+ Object data1 = bussDataInfo.getData();
|
|
|
+ dataArray.add(data1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
List<TableInfo> tableInfoList = this.excelTabService.getTableInfoList(dataArray);
|
|
|
try {
|
|
|
this.excelTabService.formulaFillData(tableInfoList, Long.parseLong(nodeid));
|