Commit 0bf5d79e by 阳浪

投稿编号自动生产

parent c3ec8696
...@@ -51,6 +51,8 @@ public interface PublicationMapper extends BaseMapper<Publication> { ...@@ -51,6 +51,8 @@ public interface PublicationMapper extends BaseMapper<Publication> {
Integer querypublicationByTypeTwo(@Param("id") Long id); Integer querypublicationByTypeTwo(@Param("id") Long id);
String getNumberByCode(@Param("code") String code);
/** /**
* ---------------------分割线--------------- * ---------------------分割线---------------
......
...@@ -475,7 +475,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi ...@@ -475,7 +475,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
formatter.setMinimumIntegerDigits(4); formatter.setMinimumIntegerDigits(4);
formatter.setGroupingUsed(false); formatter.setGroupingUsed(false);
String idStr = formatter.format(numVal); String idStr = formatter.format(numVal);
return String.join(DateUtil.format(new Date(),"yyyy"), "TG", idStr); return String.join(DateUtil.format(new Date(),"yyyy"), publicationMapper.getNumberByCode("publication_number"), idStr);
} }
/** /**
......
...@@ -431,4 +431,7 @@ ...@@ -431,4 +431,7 @@
a.submit_time DESC, a.submit_time DESC,
a.id a.id
</select> </select>
<select id="getNumberByCode" resultType="java.lang.String">
SELECT value FROM cloud_system.dictionary where code=#{code}
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment