Browse Source

修改铸造成功的返回时间格式

master
long 3 years ago
parent
commit
aa8c2c0008
  1. 2
      conflux-admin/pom.xml
  2. 10
      conflux-admin/src/main/java/com/conflux/web/controller/nft/service/impl/ConfluxServiceImpl.java
  3. 9
      conflux-common/src/main/java/com/conflux/common/utils/DateUtils.java
  4. 2
      conflux-system/src/main/resources/mapper/system/NftCollectionMapper.xml

2
conflux-admin/pom.xml

@ -99,7 +99,7 @@
<dependency> <dependency>
<groupId>io.github.conflux-chain</groupId> <groupId>io.github.conflux-chain</groupId>
<artifactId>conflux.web3j</artifactId> <artifactId>conflux.web3j</artifactId>
<version>1.1.0</version> <version>1.2.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.code.gson</groupId> <groupId>com.google.code.gson</groupId>

10
conflux-admin/src/main/java/com/conflux/web/controller/nft/service/impl/ConfluxServiceImpl.java

@ -2,6 +2,7 @@ package com.conflux.web.controller.nft.service.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.conflux.common.core.domain.AjaxResult; import com.conflux.common.core.domain.AjaxResult;
import com.conflux.common.utils.DateUtils;
import com.conflux.common.utils.StringUtils; import com.conflux.common.utils.StringUtils;
import com.conflux.common.utils.sign.Md5Utils; import com.conflux.common.utils.sign.Md5Utils;
import com.conflux.common.utils.uuid.IdUtils; import com.conflux.common.utils.uuid.IdUtils;
@ -179,7 +180,7 @@ public class ConfluxServiceImpl implements ConfluxService {
nftLog.setNftNum(checkArgs.getIds().length); nftLog.setNftNum(checkArgs.getIds().length);
nftLogService.insertNftLog(nftLog); nftLogService.insertNftLog(nftLog);
log.info("上链日志----->:{" + contractConfig.getUnitName() + "}{" + new Date() + "}{" + checkArgs.getIds().length + "}"); log.info("上链日志----->:{" + contractConfig.getUnitName() + "}{" + new Date() + "}{" + checkArgs.getIds().length + "}");
//使用线程铸造
executor.execute(() -> { executor.execute(() -> {
boolean isFalg = true; boolean isFalg = true;
while (isFalg) { while (isFalg) {
@ -247,9 +248,12 @@ public class ConfluxServiceImpl implements ConfluxService {
} }
List<NftCollection> nftCollections = nftCollectionService.selectNftCollectionListByIds(checkArgs.getIds(), 2); List<NftCollection> nftCollections = nftCollectionService.selectNftCollectionListByIds(checkArgs.getIds(), 2);
if (nftCollections.size() > 0) { if (nftCollections.size() > 0) {
List list = new ArrayList(); List<Map> list = new ArrayList();
for (NftCollection n : nftCollections) { for (NftCollection n : nftCollections) {
list.add(n.getInformationTableId()); Map<String,Object> map=new HashMap<>();
map.put("informationTableId",n.getInformationTableId());
map.put("successTime", DateUtils.dateToStr(n.getUpdatedTime()));
list.add(map);
} }
return AjaxResult.success("铸造成功的id", list); return AjaxResult.success("铸造成功的id", list);
} }

9
conflux-common/src/main/java/com/conflux/common/utils/DateUtils.java

@ -184,4 +184,13 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault()); ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
return Date.from(zdt.toInstant()); return Date.from(zdt.toInstant());
} }
public static String dateToStr(Date time){
SimpleDateFormat simpleDateFormat=new SimpleDateFormat(YYYY_MM_DD_HH_MM_SS);
String format = simpleDateFormat.format(time);
return format;
}
public static void main(String[] args) {
System.out.println(dateToStr(new Date()));
}
} }

2
conflux-system/src/main/resources/mapper/system/NftCollectionMapper.xml

@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where information_table_id = #{hexTokenId} where information_table_id = #{hexTokenId}
</select> </select>
<select id="selectNftCollectionListByIds" resultMap="NftCollectionResult"> <select id="selectNftCollectionListByIds" resultMap="NftCollectionResult">
select id,information_table_id from nft_collection select id,information_table_id,updated_time from nft_collection
where information_table_id in where information_table_id in
<foreach collection="stringIds" item="item" index="index" open="(" separator="," close=")"> <foreach collection="stringIds" item="item" index="index" open="(" separator="," close=")">
#{item} #{item}

Loading…
Cancel
Save