代码自动生成
最近开发几个查询接口,从代码来看,基本的格式都是一样的。就想着写一个代码生成工具。直接生成代码。省时省力。经过测试,生成的代码完全可用,节省了至少80%的时间。这里做一个记录。以后有类似的情况就可以拿来改一改就可以用了。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 | package com.insigma.business.uploadreport.zCode; import cn.hutool.core.util.StrUtil; import java.io.*; import java.net.URISyntaxException; import java.util.*; /** * 自动生成代码 * 查询接口代码自动生成工具:只需定义好要生成的接口 功能名称,注释信息,列表接口和详情接口的入参出参。 * 就可以生成controller,service,mapper的相应方法。 * 注意:生成的provider中对应的查询方法是留空的。需要自己完善。 * * @author ank * @version 1.0 * @date 2022/7/5 10:37 */ public class AutomaticallyGenerateCode { /** * 指定路径文件 从 flagStr 按行添加 writeContent * @param writeContent * @param path * @param flagStr * @throws IOException * @throws URISyntaxException */ public static void write2File(List<String> writeContent, String path, String flagStr) throws IOException, URISyntaxException { // 创建临时文件 File outFile = File.createTempFile( "fileTmp" , ".tmp" ); // 源文件 File testFile = new File(path); // 源文件输入流 FileInputStream fis = new FileInputStream(testFile); BufferedReader in = new BufferedReader( new InputStreamReader(fis)); // 源文件输出流 FileOutputStream fos = new FileOutputStream(outFile); PrintWriter out = new PrintWriter(fos); // 保存一行数据 String thisLine; // jvm 退出 临时文件删除 outFile.deleteOnExit(); while ((thisLine = in.readLine()) != null ) { System.out.println(thisLine); // 当读取到目标行时 写入需要写入的内容 if (thisLine.equals(flagStr)) { writeContent.forEach(s-> { out.println(s); }); } // 输出读取到的数据 out.println(thisLine); } // 各种关 out.flush(); out.close(); in.close(); // 删除原始文件 testFile.delete(); // 把临时文件改名为原文件名 outFile.renameTo(testFile); } /** * 生成java文件 * @param writeContent * @param filepath * @throws IOException */ public static void autoGenJava(List<String> writeContent, String filepath) throws IOException { // 创建文件 File outFile = new File(filepath); // 源文件输出流 FileOutputStream fos = new FileOutputStream(outFile); PrintWriter out = new PrintWriter(fos); writeContent.forEach(s-> { out.println(s); }); // 各种关 out.flush(); out.close(); } /** * 生成vo对象 * @param param1 * @param param2 * @param listMap 列表vo对象的 <属性:注释> 键值对 * @param infoMap 详情vo对象的 <属性:注释> 键值对 * @throws IOException */ public static void autoGenVO(String param1, String param2, Map<String,String> listMap, Map<String,String> infoMap) throws IOException { String param3 = param2.replace( "情况" , "" ); String filepath = "D:\\editor\\workspace\\migrantWorkers\\managesystem-backend\\insiis-web\\src\\main\\java\\com\\insigma\\business\\uploadreport\\vo\\" + StrUtil.upperFirst(param2) + "VO.java" ; String filepath2 = "D:\\editor\\workspace\\migrantWorkers\\managesystem-backend\\insiis-web\\src\\main\\java\\com\\insigma\\business\\uploadreport\\vo\\" + StrUtil.upperFirst(param2) + "InfoVO.java" ; List<String> writeContent = new ArrayList<String>(); writeContent.add( "package com.insigma.business.uploadreport.vo;" ); writeContent.add( "" ); writeContent.add( "import io.swagger.annotations.ApiModelProperty;" ); writeContent.add( "import lombok.Data;" ); writeContent.add( "" ); writeContent.add( "import javax.validation.constraints.NotBlank;" ); writeContent.add( "" ); writeContent.add( "/**" ); writeContent.add( " * " +param1+ "列表传入参数" ); writeContent.add( " * @author ank" ); writeContent.add( " * @date 2022/07/04" ); writeContent.add( " */" ); writeContent.add( "@Data" ); writeContent.add( "public class " + StrUtil.upperFirst(param2) + "VO {" ); if ( null == listMap){ writeContent.add( "" ); writeContent.add( " @ApiModelProperty(\"所属省/市行政区划代码\")" ); writeContent.add( " private String aab301;" ); writeContent.add( "" ); writeContent.add( " @NotBlank(message = \"父级行政区划代码不能为空\")" ); writeContent.add( " @ApiModelProperty(\"父级行政区划代码\")" ); writeContent.add( " private String aaa148;" ); writeContent.add( "" ); writeContent.add( " @ApiModelProperty(\"" +param3+ "上报时间-开始\")" ); writeContent.add( " private String ape727_s;" ); writeContent.add( "" ); writeContent.add( " @ApiModelProperty(\"" +param3+ "上报时间-结束\")" ); writeContent.add( " private String ape727_e;" ); writeContent.add( "" ); } else { Set<Map.Entry<String, String>> entries = listMap.entrySet(); for (Map.Entry<String, String> entry : entries) { writeContent.add( "" ); writeContent.add( " @ApiModelProperty(\"" +entry.getValue()+ "\")" ); writeContent.add( " private String " +entry.getKey()+ ";" ); } } writeContent.add( "}" ); writeContent.add( "" ); List<String> writeContent2 = new ArrayList<String>(); writeContent2.add( "package com.insigma.business.uploadreport.vo;" ); writeContent2.add( "" ); writeContent2.add( "import io.swagger.annotations.ApiModelProperty;" ); writeContent2.add( "import lombok.Data;" ); writeContent2.add( "" ); writeContent2.add( "/**" ); writeContent2.add( " * " +param1+ "详情传入参数" ); writeContent2.add( " * @author ank" ); writeContent2.add( " * @date 2022/07/04" ); writeContent2.add( " */" ); writeContent2.add( "@Data" ); writeContent2.add( "public class " + StrUtil.upperFirst(param2) + "InfoVO {" ); Set<Map.Entry<String, String>> entries = infoMap.entrySet(); for (Map.Entry<String, String> entry : entries) { writeContent2.add( "" ); writeContent2.add( " @ApiModelProperty(\"" +entry.getValue()+ "\")" ); writeContent2.add( " private String " +entry.getKey()+ ";" ); } writeContent2.add( "" ); writeContent2.add( "" ); writeContent2.add( "}" ); writeContent2.add( "" ); try { AutomaticallyGenerateCode.autoGenJava(writeContent, filepath); AutomaticallyGenerateCode.autoGenJava(writeContent2, filepath2); } catch (IOException e) { e.printStackTrace(); } } /** * 生成dto对象 * @param param1 * @param param2 * @param listMap2 列表dto对象的 <属性:注释> 键值对 * @param infoMap2 详情dto对象的 <属性:注释> 键值对 * @throws IOException */ public static void autoGenDTO(String param1, String param2, Map<String,String> listMap2,Map<String,String> infoMap2) throws IOException { String param3 = param2.replace( "情况" , "" ); String filepath = "D:\\editor\\workspace\\migrantWorkers\\managesystem-backend\\insiis-web\\src\\main\\java\\com\\insigma\\business\\uploadreport\\dto\\" + StrUtil.upperFirst(param2) + "DTO.java" ; String filepath2 = "D:\\editor\\workspace\\migrantWorkers\\managesystem-backend\\insiis-web\\src\\main\\java\\com\\insigma\\business\\uploadreport\\dto\\" + StrUtil.upperFirst(param2) + "InfoDTO.java" ; List<String> writeContent = new ArrayList<String>(); writeContent.add( "package com.insigma.business.uploadreport.dto;" ); writeContent.add( "" ); writeContent.add( "" ); writeContent.add( "import com.insigma.business.util.excel.ExcelColumn;" ); writeContent.add( "import io.swagger.annotations.ApiModelProperty;" ); writeContent.add( "import lombok.Data;" ); writeContent.add( "" ); writeContent.add( "import java.io.Serializable;" ); writeContent.add( "" ); writeContent.add( "/**" ); writeContent.add( " * 查询" +param3+ "返回列表" ); writeContent.add( " * @author ank" ); writeContent.add( " * @date 2022/07/04" ); writeContent.add( " */" ); writeContent.add( "@Data" ); writeContent.add( "public class " + StrUtil.upperFirst(param2) + "DTO implements Serializable {" ); writeContent.add( "" ); writeContent.add( " private static final long serialVersionUID = 1L;" ); if ( null == listMap2){ writeContent.add( "" ); writeContent.add( " @ExcelColumn(title = \"地方名称\")" ); writeContent.add( " private String aaa146;" ); writeContent.add( "" ); writeContent.add( " private String aaf018;" ); writeContent.add( "" ); writeContent.add( " @ExcelColumn(title = \"" +param3+ "总数\")" ); writeContent.add( " private Integer total;" ); } else { Set<Map.Entry<String, String>> entries = listMap2.entrySet(); for (Map.Entry<String, String> entry : entries) { writeContent.add( "" ); writeContent.add( " @ApiModelProperty(\"" +entry.getValue()+ "\")" ); writeContent.add( " private String " +entry.getKey()+ ";" ); } } writeContent.add( "}" ); writeContent.add( "" ); List<String> writeContent2 = new ArrayList<String>(); writeContent2.add( "package com.insigma.business.uploadreport.dto;" ); writeContent2.add( "" ); writeContent2.add( "import io.swagger.annotations.ApiModelProperty;" ); writeContent2.add( "import lombok.Data;" ); writeContent2.add( "import java.io.Serializable;" ); writeContent2.add( "" ); writeContent2.add( "/**" ); writeContent2.add( " * " +param2+ "详情返回结果" ); writeContent2.add( " * @author ank" ); writeContent2.add( " * @date 2022/07/04" ); writeContent2.add( " */" ); writeContent2.add( "@Data" ); writeContent2.add( "public class " + StrUtil.upperFirst(param2) + "InfoDTO implements Serializable {" ); writeContent2.add( "" ); writeContent2.add( " private static final long serialVersionUID = 1L;" ); Set<Map.Entry<String, String>> entries = infoMap2.entrySet(); for (Map.Entry<String, String> entry : entries) { writeContent2.add( "" ); writeContent2.add( " @ApiModelProperty(\"" +entry.getValue()+ "\")" ); writeContent2.add( " private String " +entry.getKey()+ ";" ); } writeContent2.add( "" ); writeContent2.add( "" ); writeContent2.add( "}" ); writeContent2.add( "" ); try { AutomaticallyGenerateCode.autoGenJava(writeContent, filepath); AutomaticallyGenerateCode.autoGenJava(writeContent2, filepath2); } catch (IOException e) { e.printStackTrace(); } } /** * 生成controller方法 */ public static void autoGenControllerMethod(String param1,String param2){ String controllerPath = new String( "D:\\editor\\workspace\\migrantWorkers\\managesystem-backend\\insiis-web\\src\\main\\java\\com\\insigma\\business\\uploadreport\\controller\\LocalReportingController.java" ); String flagStr = "}" ; //插入方法内容 List<String> writeContent = new ArrayList<String>(); writeContent.add( "" ); writeContent.add( " /**" ); writeContent.add( " * " +param1+ "列表" ); writeContent.add( " * @param " +param2+ "VO" ); writeContent.add( " * @return" ); writeContent.add( " */" ); writeContent.add( " @ApiOperation(\"" +param1+ "列表\")" ); writeContent.add( " @PostMapping(\"/" +param2+ "/list\")" ); writeContent.add( " public ResponseMessage get" + StrUtil.upperFirst(param2) + "List(@Valid @RequestBody " + StrUtil.upperFirst(param2) + "VO " +param2+ "VO) {" ); writeContent.add( " return localReportingService.get" + StrUtil.upperFirst(param2) + "List(" +param2+ "VO);" ); writeContent.add( " }" ); writeContent.add( "" ); writeContent.add( " /**" ); writeContent.add( " * " +param1+ "详情" ); writeContent.add( " * @param " +param2+ "InfoVO" ); writeContent.add( " * @return" ); writeContent.add( " */" ); writeContent.add( " @ApiOperation(\"" +param1+ "详情\")" ); writeContent.add( " @PostMapping(\"/" +param2+ "/info\")" ); writeContent.add( " public ResponseMessage get" + StrUtil.upperFirst(param2) + "Info(@RequestBody " + StrUtil.upperFirst(param2) + "InfoVO " +param2+ "InfoVO) {" ); writeContent.add( " return localReportingService.get" + StrUtil.upperFirst(param2) + "Info(" +param2+ "InfoVO);" ); writeContent.add( " }" ); try { AutomaticallyGenerateCode.write2File(writeContent, controllerPath, flagStr); } catch (IOException e) { e.printStackTrace(); } catch (URISyntaxException e) { e.printStackTrace(); } } /** * 生成service方法 */ public static void autoGenServiceMethod(String param1,String param2){ String servicePath = new String( "D:\\editor\\workspace\\migrantWorkers\\managesystem-backend\\insiis-web\\src\\main\\java\\com\\insigma\\business\\uploadreport\\service\\LocalReportingService.java" ); String serviceImplPath = new String( "D:\\editor\\workspace\\migrantWorkers\\managesystem-backend\\insiis-web\\src\\main\\java\\com\\insigma\\business\\uploadreport\\service\\impl\\LocalReportingServiceImpl.java" ); String flagStr = "}" ; //插入方法内容 List<String> writeContent = new ArrayList<String>(); writeContent.add( "" ); writeContent.add( " /**" ); writeContent.add( " * " +param1+ "列表" ); writeContent.add( " * @param " +param2+ "VO" ); writeContent.add( " * @return" ); writeContent.add( " */" ); writeContent.add( " ResponseMessage get" + StrUtil.upperFirst(param2) + "List(" + StrUtil.upperFirst(param2) + "VO " +param2+ "VO);" ); writeContent.add( "" ); writeContent.add( " /**" ); writeContent.add( " * " +param1+ "详情" ); writeContent.add( " * @param " +param2+ "InfoVO" ); writeContent.add( " * @return" ); writeContent.add( " */" ); writeContent.add( " ResponseMessage get" + StrUtil.upperFirst(param2) + "Info(" + StrUtil.upperFirst(param2) + "InfoVO " +param2+ "InfoVO);" ); List<String> writeContent2 = new ArrayList<String>(); writeContent2.add( "" ); writeContent2.add( " @Override" ); writeContent2.add( " public ResponseMessage get" + StrUtil.upperFirst(param2) + "List(" + StrUtil.upperFirst(param2) + "VO " +param2+ "VO) {" ); writeContent2.add( " try {" ); writeContent2.add( " //获取数据" ); writeContent2.add( " List<" + StrUtil.upperFirst(param2) + "DTO> list = localReportingMapper.get" + StrUtil.upperFirst(param2) + "List(" +param2+ "VO);" ); writeContent2.add( " return ResponseMessage.ok(\"获取成功\", list);" ); writeContent2.add( " } catch (Exception e) {" ); writeContent2.add( " log.error(\"查询" +param1+ "-列表异常\", e);" ); writeContent2.add( " return ResponseMessage.error(\"查询" +param1+ "-列表异常\");" ); writeContent2.add( " }" ); writeContent2.add( " }" ); writeContent2.add( "" ); writeContent2.add( " @Override" ); writeContent2.add( " public ResponseMessage get" + StrUtil.upperFirst(param2) + "Info(" + StrUtil.upperFirst(param2) + "InfoVO " +param2+ "InfoVO) {" ); writeContent2.add( " try {" ); writeContent2.add( " //获取数据" ); writeContent2.add( " List<" + StrUtil.upperFirst(param2) + "InfoDTO> list = localReportingMapper.get" + StrUtil.upperFirst(param2) + "Info(" +param2+ "InfoVO);" ); writeContent2.add( " return ResponseMessage.ok(\"获取成功\", list);" ); writeContent2.add( " } catch (Exception e) {" ); writeContent2.add( " log.error(\"查询" +param1+ "详情异常\", e);" ); writeContent2.add( " return ResponseMessage.error(\"查询" +param1+ "详情异常\");" ); writeContent2.add( " }" ); writeContent2.add( " }" ); try { AutomaticallyGenerateCode.write2File(writeContent, servicePath, flagStr); AutomaticallyGenerateCode.write2File(writeContent2, serviceImplPath, flagStr); } catch (IOException e) { e.printStackTrace(); } catch (URISyntaxException e) { e.printStackTrace(); } } /** * 生成mapper方法 */ public static void autoGenMapperMethod(String param1,String param2){ String mapperPath = new String( "D:\\editor\\workspace\\migrantWorkers\\managesystem-backend\\insiis-web\\src\\main\\java\\com\\insigma\\business\\uploadreport\\mapper\\LocalReportingMapper.java" ); String providerPath = new String( "D:\\editor\\workspace\\migrantWorkers\\managesystem-backend\\insiis-web\\src\\main\\java\\com\\insigma\\business\\uploadreport\\mapper\\provider\\LocalReportingMapperProvider.java" ); String flagStr = "}" ; //插入方法内容 List<String> writeContent = new ArrayList<String>(); writeContent.add( "" ); writeContent.add( " /**" ); writeContent.add( " * " +param1+ "列表" ); writeContent.add( " * @param " +param2+ "VO" ); writeContent.add( " * @return" ); writeContent.add( " */" ); writeContent.add( " @SelectProvider(type = LocalReportingMapperProvider.class, method = \"get" + StrUtil.upperFirst(param2) + "List\")" ); writeContent.add( " List<" + StrUtil.upperFirst(param2) + "DTO> get" + StrUtil.upperFirst(param2) + "List(@Param(\"" +param2+ "Req\") " + StrUtil.upperFirst(param2) + "VO " +param2+ "VO);" ); writeContent.add( "" ); writeContent.add( " /**" ); writeContent.add( " * " +param1+ "详情" ); writeContent.add( " * @param " +param2+ "InfoVO" ); writeContent.add( " * @return" ); writeContent.add( " */" ); writeContent.add( " @SelectProvider(type = LocalReportingMapperProvider.class, method = \"get" + StrUtil.upperFirst(param2) + "Info\")" ); writeContent.add( " List<" + StrUtil.upperFirst(param2) + "InfoDTO> get" + StrUtil.upperFirst(param2) + "Info(@Param(\"" +param2+ "InfoReq\") " + StrUtil.upperFirst(param2) + "InfoVO " +param2+ "InfoVO);" ); List<String> writeContent2 = new ArrayList<String>(); writeContent2.add( " /**" ); writeContent2.add( " * " +param1+ "列表" ); writeContent2.add( " * @param " +param2+ "VO" ); writeContent2.add( " * @return" ); writeContent2.add( " */" ); writeContent2.add( " public String get" + StrUtil.upperFirst(param2) + "List(@Param(\"" +param2+ "Req\") " + StrUtil.upperFirst(param2) + "VO " +param2+ "VO) {" ); writeContent2.add( " SQL sql = new SQL();" ); writeContent2.add( " // TODO" ); writeContent2.add( " return sql.toString();" ); writeContent2.add( " }" ); writeContent2.add( "" ); writeContent2.add( " /**" ); writeContent2.add( " * " +param1+ "详情" ); writeContent2.add( " * @param " +param2+ "InfoVO" ); writeContent2.add( " * @return" ); writeContent2.add( " */" ); writeContent2.add( " public String get" + StrUtil.upperFirst(param2) + "Info(@Param(\"" +param2+ "InfoReq\") " + StrUtil.upperFirst(param2) + "InfoVO " +param2+ "InfoVO) {" ); writeContent2.add( " SQL sql = new SQL();" ); writeContent2.add( " // TODO" ); writeContent2.add( " return sql.toString();" ); writeContent2.add( " }" ); try { AutomaticallyGenerateCode.write2File(writeContent, mapperPath, flagStr); AutomaticallyGenerateCode.write2File(writeContent2, providerPath, flagStr); } catch (IOException e) { e.printStackTrace(); } catch (URISyntaxException e) { e.printStackTrace(); } } /** * 生成代码 * @param param1 功能注释 * @param param2 功能名 * @param listMap 列表查询参数 可为null * @param listMap2 列表返回参数 可为null * @param infoMap 详情查询参数 * @param infoMap2 详情返回属性 * @throws IOException * @throws URISyntaxException */ public static void genCode(String param1,String param2,Map listMap,Map listMap2,Map infoMap,Map infoMap2) throws IOException, URISyntaxException{ autoGenControllerMethod(param1,param2); autoGenServiceMethod(param1,param2); autoGenMapperMethod(param1,param2); autoGenVO(param1,param2,listMap,infoMap); autoGenDTO(param1,param2,listMap2,infoMap2); } public static void main(String[] args) throws IOException, URISyntaxException { // String param1 = "保证金情况"; // String param2 = "securityDeposit"; // // vo详情字段 传入参数 // Map<String,String> map = new HashMap<String,String>(); // map.put("aaf018","所属省行政区划代码"); // map.put("ape727_s","保证金信息上报时间-开始"); // map.put("ape727_e","保证金信息上报时间-结束"); // map.put("aaf017","所属市行政区划代码"); // map.put("aae044","项目名称"); // map.put("abb127","保证金缴纳主体"); // // dto详情字段 传出参数 // Map<String,String> map2 = new HashMap<String,String>(); // map2.put("aaa146","地方名称"); // map2.put("aae044","项目名称"); // map2.put("abb127","保证金缴纳主体名称"); // map2.put("abb156","保证金缴纳主体统一社会信用代码"); // map2.put("abb128","保证金缴纳方式"); // map2.put("abb129","应缴金额"); // map2.put("abe166","是否享受优惠政策"); // map2.put("abb131","减免缓金额"); // map2.put("ape727","保证金缴纳时间"); // genCode(param1,param2,null,null,infoMap,infoMap2); String param1 = "工资支付情况" ; String param2 = "salaryPayment" ; // vo列表字段 传入参数 Map<String,String> listMap = new HashMap<String,String>(); listMap.put( "aab301" , "所属行政区划代码(本级)" ); listMap.put( "aaa148" , "所属行政区划代码(父级)" ); listMap.put( "ape727_s" , "工资支付上报时间-开始" ); listMap.put( "ape727_e" , "工资支付上报时间-结束" ); // dto列表字段 传出参数 Map<String,String> listMap2 = new HashMap<String,String>(); listMap2.put( "aaa146" , "地方名称" ); listMap2.put( "aaf018" , "所属省行政区划代码" ); listMap2.put( "salaryTotal" , "应发工资总额度(万元)" ); listMap2.put( "netSalaryTotal" , "实发工资总额度(万元)" ); // vo详情字段 传入参数 Map<String,String> infoMap = new HashMap<String,String>(); infoMap.put( "aaf018" , "所属省行政区划代码" ); infoMap.put( "ape727_s" , "工资支付上报时间-开始" ); infoMap.put( "ape727_e" , "工资支付上报时间-结束" ); infoMap.put( "aaf017" , "所属市行政区划代码" ); infoMap.put( "aae044" , "项目名称" ); infoMap.put( "abe175" , "银行支付业务流水号" ); infoMap.put( "abc110" , "支付方式" ); // dto详情字段 传出参数 Map<String,String> infoMap2 = new HashMap<String,String>(); infoMap2.put( "abe121" , "支付账号" ); infoMap2.put( "aaa146" , "地方名称" ); infoMap2.put( "aae044" , "项目名称" ); infoMap2.put( "aae149" , "所属年月" ); infoMap2.put( "abc112Total" , "当月应发工资总额" ); infoMap2.put( "abc113Total" , "当月扣发工资总额" ); infoMap2.put( "abc114Total" , "当月实发工资总额" ); infoMap2.put( "attendanceTotal" , "当月考勤总人数" ); infoMap2.put( "abc117" , "工资发放人数" ); infoMap2.put( "abc110" , "工资支付方式" ); // genCode(param1,param2,listMap,listMap2,infoMap,infoMap2); // 编写查询sql //............2233 } } |
学如逆水行舟,不进则退
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)