We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
因为坑爹的框架,基于 online 表单 的表id只能是 string(uuid),非常不满足业务需要,被迫如此:
@Component("CgformEnhanceInsertSetId") public class CgformEnhanceInsertSetId implements CgformEnhanceJavaInter { // 定义类变量 private static final Map<String, Integer> predefinedMap; // 静态初始化块,用于初始化类变量 static { predefinedMap = new HashMap<>(); predefinedMap.put("库名.表名", 1); // 对应 online 表单开发中,设置的 "表名" // 可以根据需要添加更多元素 } @Autowired private JdbcTemplate jdbcTemplate; /** * @param tableName * @param json * @throws BusinessException */ @Override public void execute(String tableName, JSONObject json) throws BusinessException { if(predefinedMap.containsKey(tableName)) { // 查询对应表的 maxId,用于设置 maxId String sql = "SELECT COALESCE(MAX(id), 0) FROM " + tableName; Long maxId = jdbcTemplate.queryForObject(sql, Long.class); if (maxId != null) { json.put("id", ++maxId); } } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
因为坑爹的框架,基于 online 表单 的表id只能是 string(uuid),非常不满足业务需要,被迫如此:
The text was updated successfully, but these errors were encountered: