|
|
|
@ -16,6 +16,7 @@ import com.engine.organization.service.CardAccessService;
|
|
|
|
|
import com.engine.organization.transmethod.SystemTransMethod;
|
|
|
|
|
import com.engine.organization.util.HasRightUtil;
|
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
|
|
|
|
@ -140,22 +141,30 @@ public class CardAccessServiceImpl extends Service implements CardAccessService
|
|
|
|
|
String tableName = "JCL_ORG_CARDBUTTON";
|
|
|
|
|
int rowNum = Util.getIntValue((String) params.get("rownum"));
|
|
|
|
|
int count = 0;
|
|
|
|
|
List<Long> allIds = getCardButtonMapper().listAllId();
|
|
|
|
|
for (int i = 0; i < rowNum; i++) {
|
|
|
|
|
String recordIndex = "_" + i;
|
|
|
|
|
Map<String, Object> recordData = new HashMap<>();
|
|
|
|
|
recordData.put("name", params.get("name") + recordIndex);
|
|
|
|
|
recordData.put("status", params.get("status") + recordIndex);
|
|
|
|
|
recordData.put("url", params.get("url") + recordIndex);
|
|
|
|
|
recordData.put("roles", params.get("roles") + recordIndex);
|
|
|
|
|
String id = Util.null2String(params.get("id") + recordIndex);
|
|
|
|
|
recordData.put("name", params.get("name" + recordIndex));
|
|
|
|
|
recordData.put("status", params.get("status" + recordIndex));
|
|
|
|
|
recordData.put("url", params.get("url" + recordIndex));
|
|
|
|
|
recordData.put("roles", params.get("roles" + recordIndex));
|
|
|
|
|
String id = Util.null2String(params.get("id" + recordIndex));
|
|
|
|
|
if (StringUtils.isNotBlank(id)) {
|
|
|
|
|
// 更新
|
|
|
|
|
count += MapperProxyFactory.getProxy(ExtMapper.class).updateTable(ExtendInfoParams.builder().tableName(tableName).id(Long.parseLong(id)).params(recordData).build());
|
|
|
|
|
long buttonId = Long.parseLong(id);
|
|
|
|
|
count += MapperProxyFactory.getProxy(ExtMapper.class).updateTable(ExtendInfoParams.builder().tableName(tableName).id(buttonId).params(recordData).build());
|
|
|
|
|
allIds.remove(buttonId);
|
|
|
|
|
} else {
|
|
|
|
|
//插入
|
|
|
|
|
recordData.put("sys_default", 1);
|
|
|
|
|
recordData.put("delete_type", 0);
|
|
|
|
|
count += MapperProxyFactory.getProxy(ExtMapper.class).insertTable(ExtendInfoParams.builder().tableName(tableName).params(recordData).build());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtils.isNotEmpty(allIds)) {
|
|
|
|
|
count += getCardButtonMapper().deleteByIds(allIds);
|
|
|
|
|
}
|
|
|
|
|
return count;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|