Explorar el Código

fix 报考省市

he2802 hace 4 años
padre
commit
c950df1f76

+ 1 - 1
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/ServletUtils.java

@@ -24,7 +24,7 @@ public class ServletUtils
     public static String getEncoded(String tag)
     {
         String time = String.valueOf(System.currentTimeMillis()/1000);
-        return tag+time.substring(1)+(Math.random()*10);
+        return tag+Integer.valueOf(time.substring(1))+(int)((Math.random()*10));
     }
     /**
      * 获取String参数

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/ApplyAreasServiceImpl.java

@@ -73,7 +73,8 @@ public class ApplyAreasServiceImpl extends ServiceImpl<ApplyAreasMapper, ApplyAr
     @Override
     public Boolean insertByAddBo(ApplyAreasAddBo bo) {
         ApplyAreas add = BeanUtil.toBean(bo, ApplyAreas.class);
-        add.setCode(ServletUtils.getEncoded("SS"));
+        String code = ServletUtils.getEncoded("SS");
+        add.setCode(code);
         validEntityBeforeSave(add);
         add.setCreateTime(DateUtils.getNowTime());
         add.setUpdateTime(DateUtils.getNowTime());