/**
* 生成全局编码 规则 xxx+yyyyMMdd+001
* @param moduleName 统一传三位码
* @return
*/
public String genDateSerNo(String moduleName){
LocalDateTime now = LocalDateTime.now();
String date = DateUtil.format(now, DatePattern.PURE_DATE_PATTERN);
String prefix = moduleName + date;
return genSerNo(prefix, 3);
}
/**
* 获取自动编码调用公共的测试案例
*
* @return
*/
@RequestMapping(value = "/autoRuleCode")
@ResponseBody
public Object autoRuleCode() {
HrxbSelPlanPublish hrxbSelPlanPublish = new HrxbSelPlanPublish();
//生成自动编码
hrxbSelPlanPublish.setPlanCode(orderNoUtils.genDateSerNo("xbjh"));
return this.buildSuccess(hrxbSelPlanPublish);
}