Compare commits
4 Commits
35e42a5e0b
...
ff5d5e357b
Author | SHA1 | Date |
---|---|---|
|
ff5d5e357b | |
|
9c15c7d45a | |
|
6e6c883bdd | |
|
1cc4d5e064 |
|
@ -71,6 +71,15 @@ public class ZjMaterielSynchronizationEventEntity extends BaseEntity {
|
||||||
private String caccId;//
|
private String caccId;//
|
||||||
private String field0049;//认证信息
|
private String field0049;//认证信息
|
||||||
private String field0049code;//认证信息
|
private String field0049code;//认证信息
|
||||||
|
private String querycode;//
|
||||||
|
|
||||||
|
public String getQuerycode() {
|
||||||
|
return querycode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuerycode(String querycode) {
|
||||||
|
this.querycode = querycode;
|
||||||
|
}
|
||||||
|
|
||||||
public String getFormmain_id() {
|
public String getFormmain_id() {
|
||||||
return formmain_id;
|
return formmain_id;
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
parameterType = "com.hzya.frame.plugin.zjmaterielsynchronizationevent.entity.ZjMaterielSynchronizationEventEntity">
|
parameterType = "com.hzya.frame.plugin.zjmaterielsynchronizationevent.entity.ZjMaterielSynchronizationEventEntity">
|
||||||
SELECT max(cInvCode) from Inventory
|
SELECT max(cInvCode) from Inventory
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="field0043code != null and field0043code != ''"> and cInvCCode = #{field0043code} and cInvCode like concat(#{field0043code},'%') </if>
|
<if test="field0043code != null and field0043code != ''"> and cInvCCode = #{field0043code} and cInvCode like concat(#{querycode},'%') </if>
|
||||||
</trim>
|
</trim>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
@ -343,7 +343,7 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
**/
|
||||||
private void saveMaterielToU8(List<ZjMaterielSynchronizationEventEntity> list,List<InventoryEntity> inventoryEntities) throws Exception {
|
private void saveMaterielToU8(List<ZjMaterielSynchronizationEventEntity> list,List<InventoryEntity> inventoryEntities) throws Exception {
|
||||||
Map<String,Integer> lsh = new HashMap<>();//当前流水号
|
Map<String,String> lsh = new HashMap<>();//当前流水号
|
||||||
List<InventoryEntity> savedata = new ArrayList<>();
|
List<InventoryEntity> savedata = new ArrayList<>();
|
||||||
|
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
@ -352,10 +352,8 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
InventorySubEntity inventorySubEntity = new InventorySubEntity();
|
InventorySubEntity inventorySubEntity = new InventorySubEntity();
|
||||||
|
|
||||||
//获取最大流水号
|
//获取最大流水号
|
||||||
Integer maxnum = null;
|
String maxnum = null;
|
||||||
if(lsh.get(entity.getField0043code()) != null){
|
|
||||||
maxnum = lsh.get(entity.getField0043code());
|
|
||||||
}
|
|
||||||
StringBuffer wlcode = new StringBuffer();
|
StringBuffer wlcode = new StringBuffer();
|
||||||
//设置编码
|
//设置编码
|
||||||
if("新增".equals(entity.getField0018code()) ){
|
if("新增".equals(entity.getField0018code()) ){
|
||||||
|
@ -364,6 +362,7 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
|| entity.getField0043code().equals("12418")
|
|| entity.getField0043code().equals("12418")
|
||||||
|| entity.getField0043code().equals("12001")
|
|| entity.getField0043code().equals("12001")
|
||||||
|| entity.getField0043code().equals("12003")
|
|| entity.getField0043code().equals("12003")
|
||||||
|
|| entity.getField0043code().equals("12900")
|
||||||
|| entity.getField0043code().equals("12005")){
|
|| entity.getField0043code().equals("12005")){
|
||||||
//货品分类(12400-贴片电阻, 12500-贴片电容, 12418-贴片检测电阻, 12001-单面板, 12003-双面板, 12005-多层板)
|
//货品分类(12400-贴片电阻, 12500-贴片电容, 12418-贴片检测电阻, 12001-单面板, 12003-双面板, 12005-多层板)
|
||||||
//封装分类(贴片 0 , 其他 0 )
|
//封装分类(贴片 0 , 其他 0 )
|
||||||
|
@ -375,13 +374,37 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
// 整体逻辑 12400物料分类 0贴片 002流水号 01品牌号
|
// 整体逻辑 12400物料分类 0贴片 002流水号 01品牌号
|
||||||
//例:12400 0 002 01
|
//例:12400 0 002 01
|
||||||
//货品分类以这几个开头的。封装分类是贴片,依然填0
|
//货品分类以这几个开头的。封装分类是贴片,依然填0
|
||||||
|
if(lsh.get(entity.getField0043code()) != null){
|
||||||
|
maxnum = lsh.get(entity.getField0043code());
|
||||||
|
}
|
||||||
if(maxnum == null){
|
if(maxnum == null){
|
||||||
entity.setDataSourceCode(zju8);
|
entity.setDataSourceCode(zju8);
|
||||||
|
entity.setQuerycode(entity.getField0043code());
|
||||||
String num = zjMaterielSynchronizationEventDao.queryMaxLsh(entity);
|
String num = zjMaterielSynchronizationEventDao.queryMaxLsh(entity);
|
||||||
num = num.substring(entity.getField0043code().length(),entity.getField0043code().length()+4);
|
num = num.substring(entity.getField0043code().length(),entity.getField0043code().length()+4);
|
||||||
maxnum = Integer.valueOf(num);
|
maxnum = num;
|
||||||
}
|
}
|
||||||
String formattedNum = String.format("%04d", ++maxnum);
|
String formattedNum = null;
|
||||||
|
char firstChar = Character.toUpperCase(maxnum.charAt(0));
|
||||||
|
if("9999".equals(maxnum)){
|
||||||
|
maxnum = "A000";
|
||||||
|
formattedNum = "A000";
|
||||||
|
}else if(firstChar >= 'A' && firstChar <= 'Z'){
|
||||||
|
String hm = maxnum.substring(maxnum.length() - 3);
|
||||||
|
if("999".equals(hm)){
|
||||||
|
hm = "000";
|
||||||
|
firstChar++;
|
||||||
|
}else {
|
||||||
|
hm = String.format("%03d", Integer.valueOf(hm)+1);
|
||||||
|
}
|
||||||
|
maxnum = firstChar+hm;
|
||||||
|
formattedNum = firstChar+hm;
|
||||||
|
}else {
|
||||||
|
formattedNum = String.format("%04d", Integer.valueOf(maxnum)+1);
|
||||||
|
maxnum = String.valueOf(Integer.valueOf(maxnum)+1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
lsh.put(entity.getField0043code(),maxnum);
|
lsh.put(entity.getField0043code(),maxnum);
|
||||||
wlcode.append(entity.getField0043code()).append(formattedNum);
|
wlcode.append(entity.getField0043code()).append(formattedNum);
|
||||||
if(entity.getField0008code() != null && !"".equals(entity.getField0008code())){
|
if(entity.getField0008code() != null && !"".equals(entity.getField0008code())){
|
||||||
|
@ -403,16 +426,48 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
//是:勾选存货属性的委外,计划页面的委外属性
|
//是:勾选存货属性的委外,计划页面的委外属性
|
||||||
//否:取消勾选勾选存货属性的”委外”,计划页面的委外属性设置成“采购”
|
//否:取消勾选勾选存货属性的”委外”,计划页面的委外属性设置成“采购”
|
||||||
// 整体逻辑 12100物料分类 0非贴片 002流水号 01品牌号
|
// 整体逻辑 12100物料分类 0非贴片 002流水号 01品牌号
|
||||||
|
if(lsh.get(entity.getField0043code()) != null){
|
||||||
|
if(entity.getField0017code() != null && "A贴片类".equals(entity.getField0017code())){
|
||||||
|
maxnum = lsh.get(entity.getField0043code()+9);
|
||||||
|
}else {
|
||||||
|
maxnum = lsh.get(entity.getField0043code()+0);
|
||||||
|
}
|
||||||
|
}
|
||||||
if(maxnum == null){
|
if(maxnum == null){
|
||||||
entity.setDataSourceCode(zju8);
|
entity.setDataSourceCode(zju8);
|
||||||
|
if(entity.getField0017code() != null && "A贴片类".equals(entity.getField0017code())){
|
||||||
|
entity.setQuerycode(entity.getField0043code()+9);
|
||||||
|
}else {
|
||||||
|
entity.setQuerycode(entity.getField0043code()+0);
|
||||||
|
}
|
||||||
String num = zjMaterielSynchronizationEventDao.queryMaxLsh(entity);
|
String num = zjMaterielSynchronizationEventDao.queryMaxLsh(entity);
|
||||||
num = num.substring(entity.getField0043code().length()+1,entity.getField0043code().length()+4);
|
num = num.substring(entity.getField0043code().length()+1,entity.getField0043code().length()+4);
|
||||||
maxnum = Integer.valueOf(num);
|
maxnum = num;
|
||||||
}
|
}
|
||||||
String formattedNum = String.format("%03d", ++maxnum);
|
String formattedNum = null;
|
||||||
|
char firstChar = Character.toUpperCase(maxnum.charAt(0));
|
||||||
|
if("999".equals(maxnum)){
|
||||||
|
maxnum = "A00";
|
||||||
|
formattedNum = "A00";
|
||||||
|
}else if(firstChar >= 'A' && firstChar <= 'Z'){
|
||||||
|
String hm = maxnum.substring(maxnum.length() - 2);
|
||||||
|
if("99".equals(hm)){
|
||||||
|
hm = "00";
|
||||||
|
firstChar++;
|
||||||
|
}else {
|
||||||
|
hm = String.format("%02d", Integer.valueOf(hm)+1);
|
||||||
|
}
|
||||||
|
maxnum = firstChar+hm;
|
||||||
|
formattedNum = firstChar+hm;
|
||||||
|
}else {
|
||||||
|
formattedNum = String.format("%03d", Integer.valueOf(maxnum)+1);
|
||||||
|
maxnum = String.valueOf(Integer.valueOf(maxnum)+1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//String formattedNum = String.format("%03d", ++maxnum);
|
||||||
lsh.put(entity.getField0043code(),maxnum);
|
lsh.put(entity.getField0043code(),maxnum);
|
||||||
wlcode.append(entity.getField0043code());
|
wlcode.append(entity.getField0043code());
|
||||||
if(entity.getField0017code() != null && "贴片".equals(entity.getField0017code())){
|
if(entity.getField0017code() != null && "A贴片类".equals(entity.getField0017code())){
|
||||||
wlcode.append("9");
|
wlcode.append("9");
|
||||||
}else {
|
}else {
|
||||||
wlcode.append("0");
|
wlcode.append("0");
|
||||||
|
@ -428,19 +483,42 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
}else {
|
}else {
|
||||||
wlcode.append("00");
|
wlcode.append("00");
|
||||||
}
|
}
|
||||||
}else if(entity.getField0043code().startsWith("6") || entity.getField0043code().startsWith("7") || entity.getField0043code().startsWith("8") || entity.getField0043code().startsWith("8")){
|
}else if(entity.getField0043code().startsWith("6") || entity.getField0043code().startsWith("7") || entity.getField0043code().startsWith("8") || entity.getField0043code().startsWith("9")){
|
||||||
//货品分类(区分是否是”产品”通过分类首位6,7,8,9)
|
//货品分类(区分是否是”产品”通过分类首位6,7,8,9)
|
||||||
//当前分类最大流水号(编码第6-9是顺序号)
|
//当前分类最大流水号(编码第6-9是顺序号)
|
||||||
//最后2位默认11
|
//最后2位默认11
|
||||||
//整体逻辑 62100物料分类 0001流水 11默认
|
//整体逻辑 62100物料分类 0001流水 11默认
|
||||||
//例:62100 0001 11
|
//例:62100 0001 11
|
||||||
|
if(lsh.get(entity.getField0043code()) != null){
|
||||||
|
maxnum = lsh.get(entity.getField0043code());
|
||||||
|
}
|
||||||
if(maxnum == null){
|
if(maxnum == null){
|
||||||
entity.setDataSourceCode(zju8);
|
entity.setDataSourceCode(zju8);
|
||||||
|
entity.setQuerycode(entity.getField0043code());
|
||||||
String num = zjMaterielSynchronizationEventDao.queryMaxLsh(entity);
|
String num = zjMaterielSynchronizationEventDao.queryMaxLsh(entity);
|
||||||
num = num.substring(entity.getField0043code().length(),entity.getField0043code().length()+4);
|
num = num.substring(entity.getField0043code().length(),entity.getField0043code().length()+4);
|
||||||
maxnum = Integer.valueOf(num);
|
maxnum = num;
|
||||||
}
|
}
|
||||||
String formattedNum = String.format("%04d", ++maxnum);
|
String formattedNum = null;
|
||||||
|
char firstChar = Character.toUpperCase(maxnum.charAt(0));
|
||||||
|
if("9999".equals(maxnum)){
|
||||||
|
maxnum = "A000";
|
||||||
|
formattedNum = "A000";
|
||||||
|
}else if(firstChar >= 'A' && firstChar <= 'Z'){
|
||||||
|
String hm = maxnum.substring(maxnum.length() - 3);
|
||||||
|
if("999".equals(hm)){
|
||||||
|
hm = "000";
|
||||||
|
firstChar++;
|
||||||
|
}else {
|
||||||
|
hm = String.format("%03d", Integer.valueOf(hm)+1);
|
||||||
|
}
|
||||||
|
maxnum = firstChar+hm;
|
||||||
|
formattedNum = firstChar+hm;
|
||||||
|
}else {
|
||||||
|
formattedNum = String.format("%04d", Integer.valueOf(maxnum)+1);
|
||||||
|
maxnum = String.valueOf(Integer.valueOf(maxnum)+1);
|
||||||
|
}
|
||||||
|
|
||||||
lsh.put(entity.getField0043code(),maxnum);
|
lsh.put(entity.getField0043code(),maxnum);
|
||||||
wlcode.append(entity.getField0043code());
|
wlcode.append(entity.getField0043code());
|
||||||
wlcode.append(formattedNum);
|
wlcode.append(formattedNum);
|
||||||
|
@ -452,13 +530,35 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
//最后1位默认1
|
//最后1位默认1
|
||||||
//整体逻辑 A0110物料分类 00001流水 1默认
|
//整体逻辑 A0110物料分类 00001流水 1默认
|
||||||
//例:A0110 00001 1
|
//例:A0110 00001 1
|
||||||
|
if(lsh.get(entity.getField0043code()) != null){
|
||||||
|
maxnum = lsh.get(entity.getField0043code());
|
||||||
|
}
|
||||||
if(maxnum == null){
|
if(maxnum == null){
|
||||||
entity.setDataSourceCode(zju8);
|
entity.setDataSourceCode(zju8);
|
||||||
|
entity.setQuerycode(entity.getField0043code());
|
||||||
String num = zjMaterielSynchronizationEventDao.queryMaxLsh(entity);
|
String num = zjMaterielSynchronizationEventDao.queryMaxLsh(entity);
|
||||||
num = num.substring(entity.getField0043code().length(),entity.getField0043code().length()+5);
|
num = num.substring(entity.getField0043code().length(),entity.getField0043code().length()+5);
|
||||||
maxnum = Integer.valueOf(num);
|
maxnum = num;
|
||||||
|
}
|
||||||
|
String formattedNum = null;
|
||||||
|
char firstChar = Character.toUpperCase(maxnum.charAt(0));
|
||||||
|
if("99999".equals(maxnum)){
|
||||||
|
maxnum = "A0000";
|
||||||
|
formattedNum = "A0000";
|
||||||
|
}else if(firstChar >= 'A' && firstChar <= 'Z'){
|
||||||
|
String hm = maxnum.substring(maxnum.length() - 4);
|
||||||
|
if("9999".equals(hm)){
|
||||||
|
hm = "0000";
|
||||||
|
firstChar++;
|
||||||
|
}else {
|
||||||
|
hm = String.format("%04d", Integer.valueOf(hm)+1);
|
||||||
|
}
|
||||||
|
maxnum = firstChar+hm;
|
||||||
|
formattedNum = firstChar+hm;
|
||||||
|
}else {
|
||||||
|
formattedNum = String.format("%05d", Integer.valueOf(maxnum)+1);
|
||||||
|
maxnum = String.valueOf(Integer.valueOf(maxnum)+1);
|
||||||
}
|
}
|
||||||
String formattedNum = String.format("%05d", ++maxnum);
|
|
||||||
lsh.put(entity.getField0043code(),maxnum);
|
lsh.put(entity.getField0043code(),maxnum);
|
||||||
wlcode.append(entity.getField0043code());
|
wlcode.append(entity.getField0043code());
|
||||||
wlcode.append(formattedNum);
|
wlcode.append(formattedNum);
|
||||||
|
@ -617,9 +717,106 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
//if(entity.getField0018code() == null || "".equals(entity.getField0018code())){
|
//if(entity.getField0018code() == null || "".equals(entity.getField0018code())){
|
||||||
// return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的申请原因为空");
|
// return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的申请原因为空");
|
||||||
//}
|
//}
|
||||||
if("修改".equals(entity.getField0018code())){
|
if(!"新增".equals(entity.getField0018code())){
|
||||||
if(entity.getField0005() == null || "".equals(entity.getField0005())){
|
if(entity.getField0005() == null || "".equals(entity.getField0005())){
|
||||||
str.append("序号为"+entity.getField0004()+"明细行的货品编码为空。");
|
str.append("序号为"+entity.getField0004()+"明细行的货品编码为空。");
|
||||||
|
}else {
|
||||||
|
if(entity.getField0043code().equals("12400")
|
||||||
|
|| entity.getField0043code().equals("12500")
|
||||||
|
|| entity.getField0043code().equals("12418")
|
||||||
|
|| entity.getField0043code().equals("12001")
|
||||||
|
|| entity.getField0043code().equals("12003")
|
||||||
|
|| entity.getField0043code().equals("12900")
|
||||||
|
|| entity.getField0043code().equals("12005")){
|
||||||
|
//货品分类(12400-贴片电阻, 12500-贴片电容, 12418-贴片检测电阻, 12001-单面板, 12003-双面板, 12005-多层板)
|
||||||
|
//封装分类(贴片 0 , 其他 0 )
|
||||||
|
//当前分类最大流水号
|
||||||
|
//品牌(单据内填写品牌 01,未填写 00)
|
||||||
|
//是否委外
|
||||||
|
//是:勾选存货属性的委外,计划页面的委外属性
|
||||||
|
//否:取消勾选勾选存货属性的”委外”,计划页面的委外属性设置成“采购”
|
||||||
|
// 整体逻辑 12400物料分类 0贴片 002流水号 01品牌号
|
||||||
|
//例:12400 0 002 01
|
||||||
|
//货品分类以这几个开头的。封装分类是贴片,依然填0
|
||||||
|
String subStrfz = entity.getField0005().substring(5, 6);
|
||||||
|
if(subStrfz.equals("9")){
|
||||||
|
str.append("序号为"+entity.getField0004()+"明细行的物料编码的封装分类,编码对应不应该填写9");
|
||||||
|
}
|
||||||
|
String subStr = entity.getField0005().substring(9, 11);
|
||||||
|
if(entity.getField0008code() != null && !"".equals(entity.getField0008code())){
|
||||||
|
if("000".equals(entity.getField0008code())){
|
||||||
|
if(!subStr.equals("00")){
|
||||||
|
str.append("序号为"+entity.getField0004()+"明细行的物料编码品牌为000,编码对应应该填写00");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
if(!subStr.equals("01")){
|
||||||
|
str.append("序号为"+entity.getField0004()+"明细行的物料编码品牌存在,编码对应应该填写01");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
if(!subStr.equals("00")){
|
||||||
|
str.append("序号为"+entity.getField0004()+"明细行的物料编码品牌为空,应该填写00");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else if(entity.getField0043code().startsWith("1") || entity.getField0043code().startsWith("4") || entity.getField0043code().startsWith("5")){
|
||||||
|
//货品分类(区分是否是原材料通过分类首位1,4,5)
|
||||||
|
//封装分类(贴片 9 , 其他 0 )
|
||||||
|
//当前分类最大流水号
|
||||||
|
//品牌(单据内填写品牌 01,未填写 00)
|
||||||
|
//是否委外
|
||||||
|
//是:勾选存货属性的委外,计划页面的委外属性
|
||||||
|
//否:取消勾选勾选存货属性的”委外”,计划页面的委外属性设置成“采购”
|
||||||
|
// 整体逻辑 12100物料分类 0非贴片 002流水号 01品牌号
|
||||||
|
|
||||||
|
String subStrfz = entity.getField0005().substring(5, 6);
|
||||||
|
|
||||||
|
if(entity.getField0017code() != null && "A贴片类".equals(entity.getField0017code())){
|
||||||
|
if(!subStrfz.equals("9")){
|
||||||
|
str.append("序号为"+entity.getField0004()+"明细行的物料编码的封装分类为贴片,编码对应应该填写9");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
if(!subStrfz.equals("0")){
|
||||||
|
str.append("序号为"+entity.getField0004()+"明细行的物料编码的封装分类不是贴片,编码对应应该填写0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String subStr = entity.getField0005().substring(9, 11);
|
||||||
|
if(entity.getField0008code() != null && !"".equals(entity.getField0008code())){
|
||||||
|
if("000".equals(entity.getField0008code())){
|
||||||
|
if(!subStr.equals("00")){
|
||||||
|
str.append("序号为"+entity.getField0004()+"明细行的物料编码品牌为000,编码对应应该填写00");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
if(!subStr.equals("01")){
|
||||||
|
str.append("序号为"+entity.getField0004()+"明细行的物料编码品牌存在,编码对应应该填写01");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
if(!subStr.equals("00")){
|
||||||
|
str.append("序号为"+entity.getField0004()+"明细行的物料编码品牌为空,应该填写00");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else if(entity.getField0043code().startsWith("6") || entity.getField0043code().startsWith("7") || entity.getField0043code().startsWith("8") || entity.getField0043code().startsWith("9")){
|
||||||
|
//货品分类(区分是否是”产品”通过分类首位6,7,8,9)
|
||||||
|
//当前分类最大流水号(编码第6-9是顺序号)
|
||||||
|
//最后2位默认11
|
||||||
|
//整体逻辑 62100物料分类 0001流水 11默认
|
||||||
|
//例:62100 0001 11
|
||||||
|
String subStr = entity.getField0005().substring(9, 11);
|
||||||
|
if(!subStr.equals("11")){
|
||||||
|
str.append("序号为"+entity.getField0004()+"明细行的物料编码,末尾编码应该填写11");
|
||||||
|
}
|
||||||
|
|
||||||
|
}else if(entity.getField0043code().startsWith("A")){
|
||||||
|
//货品分类(区分是”软件”通过分类首位A)
|
||||||
|
//当前分类最大流水号(编码第6-10是顺序号)
|
||||||
|
//最后1位默认1
|
||||||
|
//整体逻辑 A0110物料分类 00001流水 1默认
|
||||||
|
//例:A0110 00001 1
|
||||||
|
String subStr = entity.getField0005().substring(10, 11);
|
||||||
|
if(!subStr.equals("1")){
|
||||||
|
str.append("序号为"+entity.getField0004()+"明细行的物料编码,末尾编码应该填写1");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//if(flag){
|
//if(flag){
|
||||||
|
|
|
@ -42,6 +42,34 @@ public class temButtom {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test01() {
|
public void test01() {
|
||||||
|
String maxnum = "89988";
|
||||||
|
|
||||||
|
String formattedNum = null;
|
||||||
|
char firstChar = Character.toUpperCase(maxnum.charAt(0));
|
||||||
|
if("99999".equals(maxnum)){
|
||||||
|
maxnum = "A0000";
|
||||||
|
formattedNum = "A0000";
|
||||||
|
}else if(firstChar >= 'A' && firstChar <= 'Z'){
|
||||||
|
String hm = maxnum.substring(maxnum.length() - 4);
|
||||||
|
if("9999".equals(hm)){
|
||||||
|
hm = "0000";
|
||||||
|
firstChar++;
|
||||||
|
}else {
|
||||||
|
hm = String.format("%04d", Integer.valueOf(hm)+1);
|
||||||
|
}
|
||||||
|
maxnum = firstChar+hm;
|
||||||
|
formattedNum = firstChar+hm;
|
||||||
|
}else {
|
||||||
|
formattedNum = String.format("%05d", Integer.valueOf(maxnum)+1);
|
||||||
|
maxnum = String.valueOf(Integer.valueOf(maxnum)+1);
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println(maxnum);
|
||||||
|
System.out.println(formattedNum);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String regex = "[\uFF00-\uFF5D\uFF5F-\uFFEF]";
|
String regex = "[\uFF00-\uFF5D\uFF5F-\uFFEF]";
|
||||||
// 编译正则表达式
|
// 编译正则表达式
|
||||||
Pattern pattern = Pattern.compile(regex);
|
Pattern pattern = Pattern.compile(regex);
|
||||||
|
|
Loading…
Reference in New Issue