List<String> newIds = new ArrayList<String>();
for (int len = 0; len < inputValues.length; len++) {
int i = 1;
for (Iterator it = insertService.retrieveParaServiceLinks()
.iterator(); it.hasNext();) {
DOParameterService dops = (DOParameterService) it
.next();
DOParameter dop = dops.getDop();
String value = null;
if (dop.getType() != null
&& dop.getType().intValue() == DOParameter.TYPE_FORM
&& dop.getDefaultValue() == null) {// //form类型直接从节目获取
log.info("Batch Parameter Name:::" + dop.getName());
String[] valueArray = uiForm.getValueArray(dop
.getName());
value = valueArray[len];
if ("".equals(value)) {
value = null;
}
} else {
value = dop.getValue();
}
if (dop.getType() != null
&& dop.getType().intValue() == DOParameter.TYPE_KEY) {
newIds.add(value);
}
value = dops.getAfterPattermValue(value);
insertService.putStatementAValue(pstmt, i, dops, value);
i++;
}
batchSize++;
pstmt.addBatch();
}
log.info("::batchSize:::" + batchSize);
pstmt.executeBatch();
/////多租户的处理
for(String anID : newIds){
insertService.dealMultiTenancy(null, con, anID);
}
}
// ////////////////////////////////////end 新增=====================
// ////////////修改 begin==============================================
DOBO refreshBO = aFm.getGridModel().getService().getBo();
String[] ids = uiForm.getValueArray("id");
if (ids != null && ids.length > 0) {
PreparedStatement pstmt = con.prepareStatement(updateService
.getTempSql());
for (int ii = 0; ii < ids.length; ii++) {
String idstr = ids[ii];
System.out.println("one isstr::" + idstr);
if (idstr != null) {
String[] vals = idstr.split(";﹕#");
HashMap<String, String> paras = new HashMap<String, String>();
String id = "";
if (vals != null && vals.length > 0) {
id = vals[0];
for (int j = 1; j < vals.length; j++) {
String aKeyValue = vals[j];
System.out.println("aKeyValue::::::" + aKeyValue);
String[] arrayKV = aKeyValue.split("﹕﹕");
String aValue = null;
if(arrayKV.length > 1){
aValue = arrayKV[1];
}
paras.put(arrayKV[0],aValue);
}
}
System.out.println("paras:::::" + paras);
BOInstance oldInstance = refreshBO.refreshContext(id);
String newKeyValue = null;
int i = 1;
for (Iterator it = updateService
.retrieveParaServiceLinks().iterator(); it
.hasNext();) {
DOParameterService dops = (DOParameterService) it
.next();
DOParameter dop = dops.getDop();
String value = null;
if (dop.getType() != null
&& dop.getType().intValue() == DOParameter.TYPE_FORM
&& dop.getDefaultValue() == null) {
log.info("批量修改参数的名称:::" + dop.getName());
value = paras.get(dop.getName());
if ("".equals(value)) {
value = null;
}
} else {
value = dop.getValue();
}
if (dop.getType() != null
&& dop.getType().intValue() == DOParameter.TYPE_KEY) {
newKeyValue = value;
}
value = dops.getAfterPattermValue(value);
updateService.putStatementAValue(pstmt, i, dops,
value);
i++;
}
batchSize++;