Commit 98792612 authored by hezhen's avatar hezhen

Merge branch 'base-modify' of http://113.105.137.151:22280/youjj/cloud-platform into base-modify

parents 06e548e0 3914b252
......@@ -126,7 +126,5 @@ public class AppUsersManageController extends BaseController<AppUserManageBiz,Ap
appUserLoginBiz.deleteAppUserById(id);
return ObjectRestResponse.succ();
}
}
......@@ -21,4 +21,10 @@ public class IntegralUserStatus {
private Long crtTime;
private Long updTime;
@Transient
private Long startTime;
@Transient
private Long endTime;
}
\ No newline at end of file
......@@ -8,11 +8,10 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.Query;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.activity.entity.IntegralRule;
import com.xxfc.platform.activity.entity.IntegralUserRecord;
import com.xxfc.platform.activity.entity.IntegralUserStatus;
import com.xxfc.platform.activity.mapper.IntegralRuleMapper;
import com.xxfc.platform.activity.user.UserInfoBiz;
import com.xxfc.platform.activity.vo.IntegralRuleDto;
import com.xxfc.platform.activity.vo.IntegralUserRecordDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -27,7 +26,8 @@ public class IntegralRuleBiz extends BaseBiz<IntegralRuleMapper, IntegralRule> {
UserInfoBiz userInfoBiz;
@Autowired
IntegralUserRecordBiz integralUserRecordBiz;
@Autowired
IntegralUserStatusBiz integralUserStatusBiz;
/**
* 添加、更新积分规则
* @param integralRule
......@@ -97,22 +97,17 @@ public class IntegralRuleBiz extends BaseBiz<IntegralRuleMapper, IntegralRule> {
Query query = new Query(integralRule);
PageDataVO<IntegralRule> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.selectAllByParam(integralRule));
//添加个人积分状态
pageDataVO.getData().forEach((a) -> getIntegralStatus(appUserDTO, a));
return ObjectRestResponse.succ(pageDataVO);
}
public boolean getIntegralStatus(AppUserDTO appUserDTO, IntegralRule integralRule) {
IntegralUserRecordDto integralUserRecordDto = new IntegralUserRecordDto();
integralUserRecordDto.setUserId(appUserDTO.getUserid());
integralUserRecordDto.setIntegralRuleCode(integralRule.getCode());
List<IntegralUserRecord> integralUserRecords = integralUserRecordBiz.getByUserAndTime(integralUserRecordDto).getData();
if(integralUserRecords == null || integralUserRecords.size() <=0 ) {
return false;
} else if(integralUserRecords.size() == integralRule.getNumber()){//记录 == 规则数 代表已经完成
return true;
} else {
return false;
public void getIntegralStatus(AppUserDTO appUserDTO, IntegralRule integralRule) {
IntegralUserStatus integralUserStatus1 = integralUserStatusBiz.selectByUserAndCode(integralRule.getCode(), appUserDTO.getUserid());
if(integralUserStatus1 != null) {
integralRule.setIntegralStatus(integralUserStatus1.getIntegralStatus());
}
}
}
......@@ -10,6 +10,8 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.TimeZone;
@Service
@Transactional
public class IntegralUserStatusBiz extends BaseBiz<IntegralUserStatusMapper, IntegralUserStatus> {
......@@ -28,9 +30,13 @@ public class IntegralUserStatusBiz extends BaseBiz<IntegralUserStatusMapper, Int
public IntegralUserStatus selectByUserAndCode(String code, Integer userId) {
if(!StringUtils.isAllBlank(code, userId + "")) {
long current = System.currentTimeMillis();
long startTime = current / (1000 * 3600 * 24) * (1000 * 3600 * 24) - TimeZone.getDefault().getRawOffset();
IntegralUserStatus integralUserStatus = new IntegralUserStatus();
integralUserStatus.setIntegralRuleCode(code);
integralUserStatus.setUserId(userId);
integralUserStatus.setStartTime(startTime);
integralUserStatus.setEndTime(startTime + 24 * 60 * 60 * 1000 - 1);
return mapper.selectByUserAndCode(integralUserStatus);
}
return null;
......
......@@ -31,15 +31,11 @@
<select id="selectAllByParam" resultType="com.xxfc.platform.activity.entity.IntegralRule" parameterType="com.xxfc.platform.activity.vo.IntegralRuleDto">
select i1.*, i2.integral_status from integral_rule i1
left join integral_user_status i2 on i1.code = i2.integral_rule_code
select i1.* from integral_rule i1
<where>
<if test="id != null">
and i1.id = #{id}
</if>
<if test="userId != null">
and i2.user_id = #{userId}
</if>
<if test="code != null">
and i1.code = #{code}
</if>
......
......@@ -11,5 +11,6 @@
<select id="selectByUserAndCode" resultType="com.xxfc.platform.activity.entity.IntegralUserStatus" parameterType="com.xxfc.platform.activity.entity.IntegralUserStatus">
select * from integral_user_status
where integral_rule_code = #{integralRuleCode} and user_id = #{userId}
and crt_time between #{startTime} and #{endTime} and integral_status =1
</select>
</mapper>
\ No newline at end of file
......@@ -20,7 +20,7 @@ public class MsgController {
return msgBiz.getMsgList(page, limit, type);
}
@PostMapping(value = "/hotMsg/list")
@PostMapping(value = "/app/unauth/hotMsg/list")
public ObjectRestResponse getHotMsgList(Integer page, Integer limit) {
return msgBiz.getHotMsgList(page, limit);
}
......
......@@ -9,11 +9,13 @@ import org.apache.commons.beanutils.BeanUtils;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* 每日购买会员订单统计
*
* @author Administrator
*/
@Service
......@@ -23,10 +25,10 @@ public class DailyMembersOrderStatisticsBiz extends BaseBiz<DailyMembersOrderSta
public boolean memberOrderStatistics() {
try {
HashMap<String, Object> resultMap = new HashMap<>();
Map<String,Object> travelGmv = mapper.getTravelGmv();
Map<String, Object> travelGmv = mapper.getTravelGmv();
resultMap.putAll(travelGmv);
DailyMembersOrderStatistics MembersStatistics = new DailyMembersOrderStatistics();
BeanUtils.copyProperties(MembersStatistics,resultMap);
BeanUtils.copyProperties(MembersStatistics, resultMap);
insertSelective(MembersStatistics);
return true;
} catch (Exception e) {
......@@ -34,4 +36,10 @@ public class DailyMembersOrderStatisticsBiz extends BaseBiz<DailyMembersOrderSta
return false;
}
}
@Override
public int insertSelectiveRe(DailyMembersOrderStatistics entity) {
entity.setCrtTime(new Date());
return mapper.insertSelective(entity);
}
}
......@@ -25,7 +25,7 @@ public class DailyOrderStatisticsBiz extends BaseBiz<DailyOrderStatisticsMapper,
@Autowired
private DailyMembersOrderStatisticsBiz membersStatisticsBiz;
// @Scheduled(cron = "0 0/1 * * * ?")
@Scheduled(cron = "0 0 2 * * ?")
public boolean statisticalOrder(){
boolean vehicleFlag = vehicleStatisticsBiz.StatisticsOfCarRentalOrders();
boolean travelFlag = travelStatisticsBiz.StatisticsOfTravelOrders();
......
package com.xxfc.platform.order.biz;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.util.EntityUtils;
import com.xxfc.platform.order.entity.DailyTravelOrderStatistics;
import com.xxfc.platform.order.mapper.DailyTravelOrderStatisticsMapper;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* 每日旅游订单统计
*
* @author Administrator
*/
@Service
......@@ -21,12 +24,12 @@ public class DailyTravelOrderStatisticsBiz extends BaseBiz<DailyTravelOrderStati
public boolean StatisticsOfTravelOrders() {
try {
HashMap<String, Object> resultMap = new HashMap<>();
Map<String,Object> travelGmv = mapper.getTravelGmv();
Map<String, Object> travelGmv = mapper.getTravelGmv();
BigDecimal travelPenalSum = mapper.getTravelPenalSum();
resultMap.putAll(travelGmv);
resultMap.put("penalSum",travelPenalSum);
resultMap.put("penalSum", travelPenalSum);
DailyTravelOrderStatistics TravelStatistics = new DailyTravelOrderStatistics();
BeanUtils.copyProperties(TravelStatistics,resultMap);
BeanUtils.copyProperties(TravelStatistics, resultMap);
insertSelective(TravelStatistics);
return true;
} catch (Exception e) {
......@@ -34,4 +37,10 @@ public class DailyTravelOrderStatisticsBiz extends BaseBiz<DailyTravelOrderStati
return false;
}
}
@Override
public int insertSelectiveRe(DailyTravelOrderStatistics entity) {
entity.setCrtTime(new Date());
return mapper.insertSelective(entity);
}
}
......@@ -2,6 +2,7 @@ package com.xxfc.platform.order.biz;
import com.alibaba.fastjson.JSON;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.xxfc.platform.order.entity.DailyMembersOrderStatistics;
import com.xxfc.platform.order.entity.DailyVehicleOrderStatistics;
import com.xxfc.platform.order.mapper.DailyVehicleOrderStatisticsMapper;
import com.xxfc.platform.order.pojo.DedDetailDTO;
......@@ -12,10 +13,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/** 每日租车订单统计
* @author Administrator
......@@ -102,4 +100,12 @@ public class DailyVehicleOrderStatisticsBiz extends BaseBiz<DailyVehicleOrderSta
return null;
}
@Override
public int insertSelectiveRe(DailyVehicleOrderStatistics entity) {
Date date = new Date();
entity.setCrtTime(new Date());
return mapper.insertSelective(entity);
}
}
......@@ -80,6 +80,13 @@ public class OrderDepositRefundRecordBiz extends BaseBiz<DepositRefundRecordMapp
return mapper.findByCrossIdAndStatus(map);
}
public void update(DepositRefundRecord depositRefundRecord) {
if(depositRefundRecord.getId() != null) {
updateSelectiveByIdRe(depositRefundRecord);
}
}
public List<DepositRefundRecord> selectByCrossId(Integer cross) {
List<DepositRefundRecord> list = mapper.selectByCrossId(cross);
for(DepositRefundRecord depositRefundRecord : list) {
......@@ -140,7 +147,7 @@ public class OrderDepositRefundRecordBiz extends BaseBiz<DepositRefundRecordMapp
BeanUtil.copyProperties(depositRefundRecord, newValue, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true));
newValue.setAmount(orderViolation.getPrice());
newValue.setRestAmount(depositRefundRecord.getTotalAmount().subtract(orderViolation.getPrice()));//减去违章金之后的押金
newValue.setIscomplete(true);
newValue.setIscomplete(false);
newValue.setId(null);
insertSelectiveRe(newValue);
depositRefundRecord.setIsshow(false);
......
......@@ -4,7 +4,10 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.IntervalUtil;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.xxfc.platform.order.biz.inner.OrderMsgBiz;
import com.xxfc.platform.order.contant.enumerate.*;
import com.xxfc.platform.order.entity.*;
......@@ -14,6 +17,7 @@ import com.xxfc.platform.universal.constant.DictionaryKey;
import com.xxfc.platform.universal.entity.Dictionary;
import com.xxfc.platform.universal.feign.ThirdFeign;
import com.xxfc.platform.universal.vo.OrderRefundVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.jexl2.MapContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -23,6 +27,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
......@@ -39,6 +44,7 @@ import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER;
* @date 2019-06-18 11:08:09
*/
@Service
@Slf4j
public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
@Autowired
ThirdFeign thirdFeign;
......@@ -61,6 +67,9 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
@Autowired
UserFeign userFeign;
@Autowired
OrderDepositRefundRecordBiz orderDepositRefundRecordBiz;
/**
* 退还部分押金
* @param orderMQDTO
......@@ -72,16 +81,25 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
//未退还, 进行挂起保留违章预备金 的退还
if(RefundStatusEnum.NONE.getCode().equals(orderMQDTO.getRefundStatus())) {
Integer crosstownTypeEnum;
Integer depositRefundRecordStatus;
//判断是否定损过
if(SYS_TRUE.equals(orderMQDTO.getOrderRentVehicleDetail().getFixedLossStatus())) {
crosstownTypeEnum = CrosstownTypeEnum.FIXED_LOSS.getCode();
depositRefundRecordStatus = DepositRefundStatus.FIXLOSSREFUND.getCode();
}else {
crosstownTypeEnum = CrosstownTypeEnum.ARRIVE.getCode();
depositRefundRecordStatus = DepositRefundStatus.REFUNDARRIVAL.getCode();
}
OrderVehicleCrosstown crosstown = crosstownBiz.selectOne(new OrderVehicleCrosstown(){{
setOrderId(orderMQDTO.getId());
setType(crosstownTypeEnum);
}});
if(null == crosstown) {
throw new BaseException(ResultCode.PARAM_ILLEGAL_CODE, new HashSet<String>(){{
add("退款第一部分押金失败,获取不了还车/定损记录,订单号:"+ orderMQDTO.getId());
}});
}
//还车扣除款 剩余的 钱,再减去违章预备金
BigDecimal refundAmont = crosstown.getRestDeposit().subtract(illegalReserve);
BigDecimal originalRefundAmount = crosstown.getRestDeposit().add(crosstown.getDeductionCost()).subtract(illegalReserve);
......@@ -93,6 +111,10 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
refundDesc += ")";
refundTrigger(orderMQDTO, orderMQDTO.getOrderRentVehicleDetail(), illegalReserve, originalRefundAmount, refundAmont, refundDesc, RefundStatusEnum.RESIDUE_ILLEGAL.getCode(), RefundTypeEnum.PART_DEPOSIT);
DepositRefundRecord depositRefundRecord = orderDepositRefundRecordBiz.findByCrossIdAndStatus(crosstown.getId(), depositRefundRecordStatus);
depositRefundRecord.setIscomplete(Boolean.TRUE);
orderDepositRefundRecordBiz.updateSelectiveById(depositRefundRecord);
orderMsgBiz.handelMsgDeposit(orderMQDTO.getOrderRentVehicleDetail(), orderMQDTO, userFeign.userDetailById(orderMQDTO.getUserId()).getData());
}
// else {
......@@ -220,7 +242,11 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
orv.setOrderNo(baseOrder.getNo());
orv.setRefundDesc(refundDesc+ refundAmount.toString());
orv.setRefundAmount(refundAmount.multiply(new BigDecimal("100")).intValue());
refundTradeNo = thirdFeign.refund(orv).getData();
ObjectRestResponse<String> result = thirdFeign.refund(orv);
refundTradeNo = result.getData();
if(null == refundTradeNo) {
log.error("退款没有refundTradeNo,订单号为:"+ baseOrder.getNo()+ ", 微服务调用结果为"+ JSONUtil.toJsonStr(result));
}
}
//记录订单退款记录
......
......@@ -232,8 +232,8 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
}
BigDecimal amount = new BigDecimal(cost.toString()).divide(new BigDecimal("1"), 2, BigDecimal.ROUND_UP);
orderVehicleCrosstownDto.setDeductionCost(amount);
//扣除费用和备用金
orderVehicleCrosstownDto.setRestDeposit(orderRentVehicleDetail.getDeposit().subtract(getAmount()).subtract(amount));
//扣除费用
orderVehicleCrosstownDto.setRestDeposit(orderRentVehicleDetail.getDeposit().subtract(amount));
//出车成功后修改订单状态
List<OrderVehicleCrosstownDto> oldValue = orderVehicleCrosstownBiz.selectByOrderId(orderVehicleCrosstownDto);
if (oldValue.size() == 1) {
......@@ -267,7 +267,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
ObjectRestResponse<OrderPageVO> objectRestResponse = baseOrderBiz.getOrderDetail(baseOrder.getNo());
if (objectRestResponse.getData() != null && objectRestResponse.getData().getOrderRentVehicleDetail() != null) {
//总押金-保留金
totalAmount = objectRestResponse.getData().getOrderRentVehicleDetail().getDeposit().subtract(getAmount());
totalAmount = objectRestResponse.getData().getOrderRentVehicleDetail().getDeposit();
}
if (baseOrder.getStatus() == OrderStatusEnum.ORDER_TOSTART.getCode()) {//交车
baseOrder.setStatus(OrderStatusEnum.ORDER_WAIT.getCode());
......@@ -277,8 +277,8 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
//添加非定损记录
DepositRefundRecord depositRefundRecord = new DepositRefundRecord();
depositRefundRecord.setAmount(orderVehicleCrosstown.getDeductionCost());
depositRefundRecord.setRestAmount(orderVehicleCrosstown.getRestDeposit());
depositRefundRecord.setTotalAmount(totalAmount);
depositRefundRecord.setRestAmount(totalAmount.subtract(getAmount()).subtract(orderVehicleCrosstown.getDeductionCost()));
depositRefundRecord.setTotalAmount(totalAmount.subtract(getAmount()));
depositRefundRecord.setCrosstownId(orderVehicleCrosstown.getId());
orderDepositRefundRecordBiz.saveNormalRecord(depositRefundRecord);
baseOrder.setStatus(OrderStatusEnum.ORDER_FINISH.getCode());
......@@ -290,8 +290,8 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
//添加定损记录
DepositRefundRecord depositRefundRecord = new DepositRefundRecord();
depositRefundRecord.setAmount(orderVehicleCrosstown.getDeductionCost());
depositRefundRecord.setRestAmount(orderVehicleCrosstown.getRestDeposit());
depositRefundRecord.setTotalAmount(totalAmount);
depositRefundRecord.setRestAmount(totalAmount.subtract(getAmount()).subtract(orderVehicleCrosstown.getDeductionCost()));
depositRefundRecord.setTotalAmount(totalAmount.subtract(getAmount()));
depositRefundRecord.setCrosstownId(orderVehicleCrosstown.getId());
orderDepositRefundRecordBiz.saveFixLossRecord(depositRefundRecord);
baseOrder.setStatus(OrderStatusEnum.ORDER_FIXED_LOSS.getCode());
......@@ -307,9 +307,9 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
depositRefundRecord.setIsshow(false);
orderDepositRefundRecordBiz.updateSelectiveByIdRe(depositRefundRecord);
newValue.setIscomplete(true); //发起退款显示
newValue.setAmount(orderVehicleCrosstown.getDeductionCost());
newValue.setRestAmount(orderVehicleCrosstown.getRestDeposit());
newValue.setTotalAmount(totalAmount);
depositRefundRecord.setAmount(orderVehicleCrosstown.getDeductionCost());
depositRefundRecord.setRestAmount(totalAmount.subtract(getAmount()).subtract(orderVehicleCrosstown.getDeductionCost()));
depositRefundRecord.setTotalAmount(totalAmount.subtract(getAmount()));
newValue.setCrosstownId(orderVehicleCrosstown.getId());
newValue.setId(null);
orderDepositRefundRecordBiz.insertSelectiveRe(newValue);
......
......@@ -445,6 +445,7 @@ public class OrderMsgBiz {
smsParams.add(otd.getStartAddr());
break;
case SmsTemplateDTO.PAY_G :
smsParams.add(baseOrder.getName());
smsParams.add(baseOrder.getRealAmount().toString());
smsParams.add(omd.getRentFreeNum().toString());
smsParams.add(appUserDTO.getRentFreeDays().toString());
......
......@@ -28,17 +28,19 @@ public class BaseOrderStatisticsJobHandler extends IJobHandler {
XxlJobLogger.log("-----定时器进入---baseOrderStatisticsHandler---");
log.info("-----定时器进入---baseOrderStatisticsHandler---");
boolean flag = statisticsBiz.statisticalOrder();
// boolean flag = statisticsBiz.statisticalOrder();
ReturnT returnT = new ReturnT();
if (flag) {
// if (flag) {
returnT.setCode(100);
returnT.setMsg("成功");
return returnT;
}else {
returnT.setCode(500);
returnT.setMsg("失败");
return returnT;
}
// }
// else {
// returnT.setCode(500);
// returnT.setMsg("失败");
// return returnT;
// }
} catch (Exception e) {
XxlJobLogger.log(e);
return FAIL;
......
......@@ -95,7 +95,7 @@ public class BackStageOrderController extends CommonBaseController implements Us
ObjectRestResponse<List<AppUserVo>> objectRestResponse = userFeign.getByUserIds(userIds);
log.info("获取用户信息:objectRestResponse = {}", objectRestResponse.getData());
Map<String, AppUserVo> appUserVoMap = objectRestResponse.getData() == null ? new HashMap<String, AppUserVo>()
: objectRestResponse.getData().parallelStream().collect(Collectors.toMap(v -> v.getUserid().toString(), v -> v));
: objectRestResponse.getData().parallelStream().collect(Collectors.toMap(v -> v.getUserid().toString().trim(), v -> v));
for (OrderListVo orderPageVO : list) {
AppUserVo appUserVo = appUserVoMap.get(orderPageVO.getUserId().toString());
......
......@@ -11,5 +11,6 @@
parameterType="java.lang.Integer">
select * from deposit_refund_record
where crosstown_id = #{crossId} and isshow = 1
order by status
</select>
</mapper>
\ No newline at end of file
......@@ -12,6 +12,7 @@ import com.xxfc.platform.universal.biz.MQServiceBiZ;
import com.xxfc.platform.universal.entity.IdInformation;
import com.xxfc.platform.universal.service.CertificationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.aop.framework.AopContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.core.task.TaskExecutor;
......@@ -21,6 +22,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
......@@ -46,9 +50,11 @@ public class CertificationController {
private TaskExecutor executor;
@Autowired
MQServiceBiZ mqServiceBiZ;
private MQServiceBiZ mqServiceBiZ;
private ExecutorService executorService = Executors.newCachedThreadPool();
/**
* 实名认证
* @param idInformation
......@@ -90,13 +96,17 @@ public class CertificationController {
if (type!=null&&type==0){
ObjectRestResponse<Integer> result = certificationService.certificate(idInformation);
if (result.getRel()) {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
CompletableFuture.supplyAsync(()->{
setIntegral(appUserDTO.getUserid(),result.getData());
}
});
thread.start();
return null;
},executorService);
// Thread thread = new Thread(new Runnable() {
// @Override
// public void run() {
// setIntegral(appUserDTO.getUserid(),result.getData());
// }
// });
// thread.start();
}
return result ;
}
......
......@@ -23,6 +23,10 @@ import org.springframework.stereotype.Service;
import java.sql.SQLException;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -41,6 +45,8 @@ public class TrafficViolationsService {
private String CODE;
@Value("${RETURN.TYPE}")
private String TYPE;
private ExecutorService executorService= Executors.newCachedThreadPool();
/**
* 下列参数,根据使用不同的公司的接口进行修改
*/
......@@ -190,6 +196,13 @@ public class TrafficViolationsService {
List<LicensePlateType> finalLicensePlateTypes = licensePlateTypes;
CompletableFuture.supplyAsync(()->{
insertLicensePlateType(finalLicensePlateTypes);
return null;
},executorService);
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
......
......@@ -380,7 +380,7 @@
<if test="startTime != null">
and v1.create_time between #{startTime} and #{endTime}
</if>
<if test="numberPlate != null">
<if test="numberPlate != null || numberPlate != ''">
and v2.number_plate = #{numberPlate}
</if>
<if test="status != null">
......
......@@ -383,6 +383,7 @@
<include refid="searchUsableSql"/>
and vm.id is not null
and vm.status = 1
and vm.isdel = 0
and bc.id is not null
GROUP BY model_id, company_id
<if test="lon != null and lat != null">, distance</if>
......@@ -597,6 +598,7 @@
<if test=" parkBranchCompanyId != null ">
and v.park_branch_company_id = #{parkBranchCompanyId}
</if>
and v.is_del = 0
</where>
</sql>
......
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