|
|
@@ -4,14 +4,16 @@ import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import com.txz.cif.core.AbstractService;
|
|
|
import com.txz.cif.dao.RechargeRecordMapper;
|
|
|
+import com.txz.cif.dubbo.client.OperatingConfigDubboServiceClient;
|
|
|
import com.txz.cif.model.RechargeRecord;
|
|
|
import com.txz.cif.param.RechargeParam;
|
|
|
-import com.txz.cif.service.AccountService;
|
|
|
import com.txz.cif.service.FlowService;
|
|
|
import com.txz.cif.service.RechargeRecordService;
|
|
|
import com.txz.cif.web.bo.RechargeRecordBO;
|
|
|
import com.txz.cif.web.para.RecordParam;
|
|
|
import com.txz.cif.web.vo.ListVO;
|
|
|
+import com.txz.operating.dto.ConfigDTO;
|
|
|
+import com.txz.operating.result.Result;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import tk.mybatis.mapper.entity.Condition;
|
|
|
@@ -32,13 +34,13 @@ import java.util.List;
|
|
|
public class RechargeRecordServiceImpl extends AbstractService<RechargeRecord> implements RechargeRecordService {
|
|
|
@Resource
|
|
|
private RechargeRecordMapper rechargeRecordMapper;
|
|
|
-
|
|
|
+
|
|
|
@Resource
|
|
|
private FlowService flowService;
|
|
|
-
|
|
|
+
|
|
|
@Resource
|
|
|
- private AccountService accountService;
|
|
|
-
|
|
|
+ private OperatingConfigDubboServiceClient operatingConfigDubboServiceClient;
|
|
|
+
|
|
|
@Override
|
|
|
public void success(RechargeRecord record) {
|
|
|
update(RechargeRecord.builder()
|
|
|
@@ -58,20 +60,22 @@ public class RechargeRecordServiceImpl extends AbstractService<RechargeRecord> i
|
|
|
.transTime(record.getTransTime())
|
|
|
.build());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public void fail(RechargeRecord record) {
|
|
|
update(RechargeRecord.builder().id(record.getId()).status(3).build());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public void closeRecharge() {
|
|
|
- Date thirtyMinutesAgo = DateUtil.offsetMinute(new Date(), -30);
|
|
|
+ Result<ConfigDTO> rechargeOrderClosingTimeR = operatingConfigDubboServiceClient.getConfigByCode("recharge_order_closing_time");
|
|
|
+ int rechargeOrderClosingTime = Integer.parseInt(rechargeOrderClosingTimeR.getData().getValueInfo());
|
|
|
+ Date thirtyMinutesAgo = DateUtil.offsetMinute(new Date(), -rechargeOrderClosingTime);
|
|
|
Condition condition = new Condition(RechargeRecord.class);
|
|
|
Example.Criteria criteria = condition.createCriteria();
|
|
|
criteria.andEqualTo("status", 1);
|
|
|
criteria.andLessThan("createTime", thirtyMinutesAgo);
|
|
|
-
|
|
|
+
|
|
|
List<RechargeRecord> processingRecords = this.findByCondition(condition);
|
|
|
if (CollectionUtil.isEmpty(processingRecords)) {
|
|
|
return;
|
|
|
@@ -84,22 +88,22 @@ public class RechargeRecordServiceImpl extends AbstractService<RechargeRecord> i
|
|
|
.build());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public List<RechargeRecordBO> pageList(RecordParam param) {
|
|
|
return rechargeRecordMapper.pageList(param);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public ListVO pageParam(RecordParam param) {
|
|
|
return rechargeRecordMapper.pageParam(param);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public Integer countByUserId(HashMap map) {
|
|
|
return rechargeRecordMapper.countByUserId(map);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public BigDecimal sumByStatus(HashMap map) {
|
|
|
return rechargeRecordMapper.sumByStatus(map);
|