|
|
|
|
@ -40,6 +40,7 @@ import org.springblade.modules.business.vo.ApmRecordListVO; |
|
|
|
|
import org.springblade.modules.business.vo.ApmRecordVO; |
|
|
|
|
import org.springblade.modules.business.wrapper.ApmRecordWrapper; |
|
|
|
|
import org.springblade.modules.system.entity.Dept; |
|
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
@ -47,6 +48,7 @@ import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 控制器 |
|
|
|
|
@ -65,6 +67,8 @@ public class ApmRecordController extends BladeController { |
|
|
|
|
private final Sm2PublickeyProperties sm2PublickeyProperties; |
|
|
|
|
private final Sm2PrivatekeyProperties sm2PrivatekeyProperties; |
|
|
|
|
|
|
|
|
|
private final StringRedisTemplate stringRedisTemplate; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 详情 |
|
|
|
|
*/ |
|
|
|
|
@ -266,6 +270,11 @@ public class ApmRecordController extends BladeController { |
|
|
|
|
String cardNo = null; |
|
|
|
|
for (Map<String, Object> item : apmRecordMapList) { |
|
|
|
|
ApmRecord record = BeanUtil.copy(item, ApmRecord.class); |
|
|
|
|
cardNo = record.getCupCardNo(); |
|
|
|
|
Boolean absent = stringRedisTemplate.opsForValue().setIfAbsent(cardNo, cardNo, 5, TimeUnit.SECONDS); |
|
|
|
|
if(!absent){ |
|
|
|
|
return R.fail("请不要重复提交!"); |
|
|
|
|
} |
|
|
|
|
record.setApmDay(DateUtil.parse(item.get("apmDay").toString(), DateUtil.PATTERN_DATE)); |
|
|
|
|
record.setCreateDept(Long.parseLong(item.get("createDept").toString())); |
|
|
|
|
if (apmDay == null) { |
|
|
|
|
@ -349,7 +358,10 @@ public class ApmRecordController extends BladeController { |
|
|
|
|
/*if(!record.getCupCardNo().equals(cardNo)){ |
|
|
|
|
return R.fail(ErrorMsgEnum.PARAMS_CHECK_FAIL.getValue()); |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
Boolean absent = stringRedisTemplate.opsForValue().setIfAbsent(cardNo, cardNo, 5, TimeUnit.SECONDS); |
|
|
|
|
if(!absent){ |
|
|
|
|
return R.fail("请不要重复提交!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
record.setApmDay(DateUtil.parse(item.get("apmDay").toString(), DateUtil.PATTERN_DATE)); |
|
|
|
|
record.setCreateDept(Long.parseLong(item.get("createDept").toString())); |
|
|
|
|
|