协议接口优化
This commit is contained in:
parent
a1556100d2
commit
cb814d18b5
|
|
@ -548,8 +548,4 @@ public class GlobalConstants {
|
|||
*/
|
||||
public static final Long LONG_65535 = 65535L;
|
||||
|
||||
public static final int NUM_9 = 9;
|
||||
public static final int NUM_100 = 100;
|
||||
public static final int NUM_99 = 99;
|
||||
public static final int NUM_1000 = 1000;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,4 +49,7 @@ public class MaterialConstants {
|
|||
*/
|
||||
public static final Integer TEN_CONSTANT = 10;
|
||||
|
||||
/** 协议号的开头字母 */
|
||||
public static final String AGREEMENT_PREFIX = "XY";
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@ package com.bonus.material.basic.service.impl;
|
|||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.common.biz.constant.GlobalConstants;
|
||||
import com.bonus.common.biz.constant.MaterialConstants;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
|
@ -82,17 +81,13 @@ public class BmAgreementInfoServiceImpl implements IBmAgreementInfoService
|
|||
String result = format.replace("-", "");
|
||||
int num = bmAgreementInfoMapper.selectNumByMonth(nowDate);
|
||||
num = num + 1;
|
||||
String code = "";
|
||||
if (num > GlobalConstants.NUM_9 && num < GlobalConstants.NUM_100) {
|
||||
code = "XY" + result + "-00" + num;
|
||||
} else if (num > GlobalConstants.NUM_99 && num < GlobalConstants.NUM_1000) {
|
||||
code = "XY" + result + "-0" + num;
|
||||
} else {
|
||||
code = "XY" + result + "-000" + num;
|
||||
}
|
||||
return code;
|
||||
return MaterialConstants.AGREEMENT_PREFIX + result + String.format("-%05d", num);
|
||||
}
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// System.out.println(String.format("-%05d", 555));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 修改协议管理
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue