shenji 1 år sedan
förälder
incheckning
a479b4f0c5

+ 12 - 6
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java

@@ -1674,8 +1674,7 @@ public class SysUserController {
 //                    sysUserMapper.updateNextNoByNY(name);
 //                }
                 sysUserMapper.updateNextNoByNY(name); //每月清零
-            }
-            if(name.equals("BXDCode")){ //报销单号
+            }else if(name.equals("BXDCode")){ //报销单号
                sysUserMapper.updateNextNoByNYR(name); //每日清零
             }
 
@@ -1690,9 +1689,7 @@ public class SysUserController {
                 }else{
                     return "TW"+nowDate+"-"+codeVo.getSeqNo();
                 }
-            }
-
-            if(name.equals("BXDCode")){
+            }else if(name.equals("BXDCode")){
                 String nowDate = DateUtils.getDate("yyMMdd");
                 if(codeVo.getSeqNo() < 10){
                     return "TW-BXD"+nowDate+"-00"+codeVo.getSeqNo();
@@ -1701,9 +1698,18 @@ public class SysUserController {
                 }else{
                     return "TW-BXD"+nowDate+"-"+codeVo.getSeqNo();
                 }
+            }else{
+                String nowDate = DateUtils.getDate("yyMMdd");
+                if(codeVo.getSeqNo() < 10){
+                    return name+nowDate+"00"+codeVo.getSeqNo();
+                }else if(codeVo.getSeqNo() > 9 && codeVo.getSeqNo() < 100){
+                    return "name"+nowDate+"-0"+codeVo.getSeqNo();
+                }else{
+                    return name+nowDate+""+codeVo.getSeqNo();
+                }
             }
 
-            return String.valueOf(codeVo.getSeqNo());
+//            return String.valueOf(codeVo.getSeqNo());
         }catch (Exception e){
             return "";
         }