下拉框值转换问题BUG修复

This commit is contained in:
dxfeng 2025-04-11 17:33:28 +08:00
parent b774090058
commit 1b575da679
4 changed files with 35 additions and 9 deletions

View File

@ -647,7 +647,7 @@ public class OfflineZipUnpackServiceImpl extends Service implements UnpackZipSer
* @param fieldMap
* @throws Exception
*/
private void processFieldForInsert(JsonNode jsonNode, Map<String, Object> insertMap,
private boolean processFieldForInsert(JsonNode jsonNode, Map<String, Object> insertMap,
DataConfigDetail fieldDetail, Map<String, Formfield> fieldMap) throws Exception {
String fieldName = fieldDetail.getFieldName();
JsonNode atNode = jsonNode.at(fieldDetail.getPath());
@ -655,17 +655,18 @@ public class OfflineZipUnpackServiceImpl extends Service implements UnpackZipSer
if (atNode != null) {
String value = atNode.asText();
if (StringUtils.isNotBlank(fieldDetail.getCondition()) && !value.equals(fieldDetail.getCondition())) {
return;
return true;
}
Formfield formfield = fieldMap.get(fieldName.toLowerCase());
if (formfield == null) {
return;
return false;
}
Object reallyValue = getFieldValue(fieldDetail, value, formfield);
insertMap.put(fieldName, reallyValue);
}
return false;
}
/**
@ -699,7 +700,10 @@ public class OfflineZipUnpackServiceImpl extends Service implements UnpackZipSer
Map<String, Object> insertMap = new IgnoreCaseHashMap<>();
for (DataConfigDetail fieldDetail : fieldList) {
processFieldForInsert(jsonNode, insertMap, fieldDetail, detailTableFieldMap);
boolean isReturn = processFieldForInsert(jsonNode, insertMap, fieldDetail, detailTableFieldMap);
if(isReturn){
return;
}
}
if (insertMap.isEmpty()) {

View File

@ -94,11 +94,11 @@ public class FieldConvertUtil {
if (value.contains("")) {
separator = "";
}
String[] split = value.split(",");
String[] split = value.split(separator);
for (String s : split) {
selectValues.add(ModeUtil.getSelectValue(formfield, s));
}
object = StringUtils.join(selectValues, separator);
object = StringUtils.join(selectValues, ",");
if (StringUtils.isBlank(Util.null2String(object))) {
if (isNumberOrCommaSeparatedNumbers(value)) {
object = value;
@ -137,7 +137,13 @@ public class FieldConvertUtil {
*/
public static String executeConvertSql(String convertSql, String value) {
RecordSet rs = new RecordSet();
rs.executeQuery(convertSql, value);
value = Util.null2String(value);
long count = convertSql.chars().filter(c -> c == '?').count();
List<String> paramsList = new ArrayList<>();
for (int i = 0; i < count; i++) {
paramsList.add(value);
}
rs.executeQuery(convertSql, paramsList);
if (rs.next()) {
return rs.getString(1);
}

View File

@ -66,4 +66,16 @@ public class FlowUtil {
bean.writeLog("wri==" + JSON.toJSONString(wri));
return workflowService.submitWorkflowRequest(wri, Util.getIntValue(requestId, 0), creator, "submit", opinions);
}
/**
* 提交流程到下一节点(机器人节点)
*
* @param requestId
* @param opinions
* @return
*/
public static String submitWorkflowRequest(String requestId, String opinions) {
WorkflowServiceImpl workflowService = new WorkflowServiceImpl();
return workflowService.submitWorkflowRequest(null, Util.getIntValue(requestId, 0), 0, "submit", opinions);
}
}

View File

@ -388,8 +388,12 @@ public class ModeUtil {
public static String getSelectValue(Formfield formfield, String selectName) {
String selectValue = "";
RecordSet rs = new RecordSet();
String detailTable = formfield.getDetailtable();
rs.executeQuery("select selectvalue from workflow_selectitem where fieldid =( select id from workflow_billfield where billid = ? and fieldname = ? and detailtable = ? ) and selectname = ?", formfield.getBillid(), formfield.getFieldname(), Util.null2String(detailTable), selectName);
String detailTable = Util.null2String(formfield.getDetailtable());
if (StringUtils.isNotBlank(detailTable)) {
rs.executeQuery("select selectvalue from workflow_selectitem where fieldid =( select id from workflow_billfield where billid = ? and fieldname = ? and detailtable = ? ) and selectname = ?", formfield.getBillid(), formfield.getFieldname(), Util.null2String(detailTable), selectName);
} else {
rs.executeQuery("select selectvalue from workflow_selectitem where fieldid =( select id from workflow_billfield where billid = ? and fieldname = ? AND (detailtable IS NULL OR detailtable = '') ) and selectname = ?", formfield.getBillid(), formfield.getFieldname(), selectName);
}
if (rs.next()) {
selectValue = rs.getString("selectvalue");
}