|
|
@@ -749,11 +749,18 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
public BasePageResult<InsOrders> queryPageOrder(OrderQueryVo orderQueryVo) {
|
|
|
Page<InsAreaCompany> page = PageRequest.buildPageRequest(orderQueryVo.getPageRequest());
|
|
|
Page<InsOrders> resultOrders;
|
|
|
-
|
|
|
+ Set<String> keys = redisTemplate.keys("FEE_AUDIT:*");
|
|
|
+ List<String> excludeKeys = new ArrayList<>();
|
|
|
+ String userId = BaseController.getUserId();
|
|
|
+ keys.forEach(x->{
|
|
|
+ if(!redisTemplate.opsForValue().get(x).equals(userId)){
|
|
|
+ excludeKeys.add(x.substring("FEE_AUDIT:".length(),x.length()));
|
|
|
+ }
|
|
|
+ });
|
|
|
//查询未审核
|
|
|
if (orderQueryVo.getAuditStatus() == null)
|
|
|
orderQueryVo.setAuditStatus("0"); //默认查询未审核
|
|
|
- resultOrders = insAreaCompanyService.getAuditOrders(page, orderQueryVo);
|
|
|
+ resultOrders = insAreaCompanyService.getAuditOrders(page, orderQueryVo,excludeKeys);
|
|
|
|
|
|
//查找机构来源字典 遍历
|
|
|
Map<String, DictionaryManagement> m = DictEnumConfig.getDmMap();
|
|
|
@@ -894,6 +901,14 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
|
|
|
@Override
|
|
|
public HttpResult<OrderVo> getByCompanyId(@NotBlank(message = "子订单不能为空") String companyId, String userId) {
|
|
|
+ //获取缓存内的锁的订单
|
|
|
+ String orderUserId = redisTemplate.opsForValue().get("FEE_AUDIT:" + companyId);
|
|
|
+ if(Objects.nonNull(orderUserId)){
|
|
|
+ if(!BaseController.getUserId().equals(orderUserId)){
|
|
|
+ throw new SystemException("订单正在审核中,请稍后再试");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ redisTemplate.opsForValue().set("FEE_AUDIT:"+companyId, BaseController.getUserId(),1800, TimeUnit.SECONDS);
|
|
|
OrderVo orderAndAreaCompany = baseMapper.getOrderAndAreaCompany(companyId);
|
|
|
//查询子订单的数据是否存在
|
|
|
InsAreaCompanyInfo insAreaCompanyInfo = insAreaCompanyInfoMapper.selectOne(new LambdaQueryWrapper<InsAreaCompanyInfo>()
|
|
|
@@ -1107,6 +1122,24 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
return HttpResult.ok("success", orderAndAreaCompany);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public HttpResult validateFeeDetail(@NotBlank(message = "子订单不能为空") String companyId, String userId) {
|
|
|
+ //获取缓存内的锁的订单
|
|
|
+ String orderUserId = redisTemplate.opsForValue().get("FEE_AUDIT:" + companyId);
|
|
|
+ if (Objects.nonNull(orderUserId)) {
|
|
|
+ if (!BaseController.getUserId().equals(orderUserId)) {
|
|
|
+ throw new SystemException("订单正在审核中,请稍后再试");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return HttpResult.ok("success");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public HttpResult liftFeeDetail(String companyId){
|
|
|
+ redisTemplate.delete("FEE_AUDIT:"+companyId);
|
|
|
+ return HttpResult.ok("解除占用成功");
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @version
|
|
|
* @author: hxl
|