Commit e1c50059 authored by hanfeng's avatar hanfeng

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

parents b3ddaf2b bbdbfb62
......@@ -21,7 +21,7 @@ public class ReferralCodeUtil {
static {
PERMUTATION = permutation(LEN);
MAX_COMBINATION = combination(36, LEN);
MAX_COMBINATION = combination(_stuffs.length, LEN);
}
// public static void resetStuffs() {
......
......@@ -7,16 +7,15 @@ import com.github.wxiaoqi.security.admin.mapper.AppUserDetailMapper;
import com.github.wxiaoqi.security.admin.rpc.service.AppPermissionService;
import com.github.wxiaoqi.security.admin.vo.AppUserVo;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.util.ReferralCodeUtil;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import java.time.Instant;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
......@@ -31,7 +30,8 @@ import java.util.stream.Collectors;
public class AppUserDetailBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail> {
@Autowired
private AppUserLoginBiz appUserLoginBiz;
@Override
@CacheClear(pre = "user{1.userid}")
......
......@@ -220,4 +220,8 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
appUserLogin.setIsdel(0);
mapper.updateByPrimaryKeySelective(appUserLogin);
}
public List<Integer> findAllExistUserIds(){
return mapper.selectAllExistUserIds();
}
}
......@@ -17,4 +17,5 @@ public interface AppUserDetailMapper extends Mapper<AppUserDetail> {
List<AppUserManageVo> selectAppUserManage(AppUserManageDTO appUserManageDTO);
void updateUserMemberStatusByUserId(@Param("userId") Integer userId,@Param("status") Integer status);
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ package com.github.wxiaoqi.security.admin.mapper;
import com.github.wxiaoqi.security.admin.entity.AppUserLogin;
import com.github.wxiaoqi.security.admin.entity.AppUserManage;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.additional.idlist.SelectByIdListMapper;
import tk.mybatis.mapper.common.Mapper;
......@@ -24,4 +25,7 @@ public interface AppUserLoginMapper extends Mapper<AppUserLogin>, SelectByIdList
List<AppUserLogin> selectbyPhones(@Param("phones") List<String> phones);
int bindOpenId(AppUserLogin appUserLogin);
List<Integer> selectAllExistUserIds();
}
\ No newline at end of file
......@@ -12,4 +12,8 @@
<update id="bindOpenId" parameterType="com.github.wxiaoqi.security.admin.entity.AppUserLogin">
UPDATE app_user_login SET wx_openid=#{wxOpenid},unionid=#{unionid},openid=#{openid} where id=#{id}
</update>
<select id="selectAllExistUserIds" resultType="integer">
SELECT `id` FROM `app_user_login` WHERE `isdel`=0;
</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);
}
......
......@@ -341,12 +341,13 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> {
AppUserDTO appUserDTO = userFeign.userDetailById(baseOrder.getUserId()).getData();
//处理App用户提醒短信的发送
orderMsgBiz.handelAppUserMsg(orvd, omd, baseOrder, appUserDTO);
// orderMsgBiz.handelAppUserMsg(orvd, omd, baseOrder, appUserDTO);
orderMsgBiz.handelMsgPayNew(orvd, otd, omd, baseOrder, appUserDTO);
//处理后台用户提醒短信的发送
orderMsgBiz.handelBgUserMsg4Pay(orvd, baseOrder, appUserDTO, OrderMsgBiz.RENT_PAY);
// orderMsgBiz.handelBgUserMsg4Pay(orvd, baseOrder, appUserDTO, OrderMsgBiz.RENT_PAY);
sendOrderMq(orvd, otd, omd, baseOrder, OrderMQDTO.ORDER_PAY);
if (OrderTypeEnum.MEMBER.getCode().equals(baseOrder.getType())) {
if(OrderTypeEnum.MEMBER.getCode().equals(baseOrder.getType())) {
sendOrderMq(orvd, otd, omd, baseOrder, OrderMQDTO.ORDER_FINISH);
}
}
......
......@@ -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) {
......
......@@ -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));
}
}
//记录订单退款记录
......
......@@ -174,10 +174,13 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
if (vehicle == null) {
return ObjectRestResponse.createFailedResult(500, "订单车辆不存在!");
}
//判断车辆公里数
if (orderVehicleCrosstownDto.getMileage() == null || orderVehicleCrosstownDto.getMileage() < vehicle.getMileageLastUpdate()) {
return ObjectRestResponse.createFailedResult(500, "请输入车辆仪表盘实际公里数!");
}
if( vehicle.getMileageLastUpdate() != null) {
//判断车辆公里数
if (orderVehicleCrosstownDto.getMileage() == null || orderVehicleCrosstownDto.getMileage() < vehicle.getMileageLastUpdate()) {
return ObjectRestResponse.createFailedResult(500, "请输入车辆仪表盘实际公里数!");
}
}
}
//调用车辆管理的出车还车
......@@ -229,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) {
......@@ -264,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());
......@@ -274,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());
......@@ -287,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());
......@@ -304,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());
......
......@@ -15,7 +15,6 @@ import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.order.biz.BaseOrderBiz;
import com.xxfc.platform.order.biz.OrderUserLicenseBiz;
import com.xxfc.platform.order.entity.OrderUserLicense;
import com.xxfc.platform.order.pojo.order.OrderListVo;
import com.xxfc.platform.order.pojo.order.OrderPageVO;
import com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto;
......@@ -23,8 +22,10 @@ import com.xxfc.platform.order.pojo.order.QueryOrderDTO;
import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.entity.Vehicle;
import com.xxfc.platform.vehicle.entity.VehicleUserLicense;
import com.xxfc.platform.vehicle.feign.VehicleFeign;
import com.xxfc.platform.vehicle.pojo.CompanyDetail;
import com.xxfc.platform.vehicle.pojo.QueryMultiDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
......@@ -94,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());
......@@ -109,16 +110,23 @@ public class BackStageOrderController extends CommonBaseController implements Us
orderPageVO.setVehicleNumberPlat(restResponse.getData().getNumberPlate());
}
if (StringUtils.isNotBlank(orderPageVO.getOrderRentVehicleDetail().getMyDriverIds())) {
List<OrderUserLicense> orderUserLicenses = orderUserLicenseBiz.selectByIds(orderPageVO.getOrderRentVehicleDetail().getMyDriverIds()).getData();
if (orderUserLicenses != null && orderUserLicenses.size() > 0) {
OrderVehicleCrosstownDto orderVehicleCrosstownDto = new OrderVehicleCrosstownDto();
orderVehicleCrosstownDto.setLicenseIdCard(orderUserLicenses.get(0).getLicenseIdCard());
orderVehicleCrosstownDto.setLicenseImg(orderUserLicenses.get(0).getLicenseImg());
orderVehicleCrosstownDto.setLicenseName(orderUserLicenses.get(0).getLicenseName());
orderVehicleCrosstownDto.setLicensePhone(orderUserLicenses.get(0).getLicensePhone());
orderPageVO.setOrderVehicleCrosstownDto(orderVehicleCrosstownDto);
}
try {
QueryMultiDTO queryMultiDTO = new QueryMultiDTO();
queryMultiDTO.setIds(orderPageVO.getOrderRentVehicleDetail().getMyDriverIds());
List<VehicleUserLicense> orderUserLicenses = vehicleFeign.multi(queryMultiDTO).getData();
if (orderUserLicenses != null && orderUserLicenses.size() > 0) {
OrderVehicleCrosstownDto orderVehicleCrosstownDto = new OrderVehicleCrosstownDto();
orderVehicleCrosstownDto.setLicenseIdCard(orderUserLicenses.get(0).getIdCard());
orderVehicleCrosstownDto.setLicenseImg(orderUserLicenses.get(0).getImg());
orderVehicleCrosstownDto.setLicenseName(orderUserLicenses.get(0).getName());
orderVehicleCrosstownDto.setLicensePhone(orderUserLicenses.get(0).getPhone());
orderPageVO.setOrderVehicleCrosstownDto(orderVehicleCrosstownDto);
}
} catch (Exception e) {
log.info("获取驾驶人信息失败!");
}
}
}
......
......@@ -11,6 +11,5 @@
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
......@@ -72,6 +72,9 @@ public interface ThirdFeign {
@RequestMapping(value = "/dictionary/getAll4Map", method = RequestMethod.GET)
public ObjectRestResponse<Map<String, Dictionary>> dictionaryGetAll4Map();
@PostMapping("/dictionary/type_code")
public Dictionary findDictionaryByTypeAndCode(@RequestParam(value = "type") String type,@RequestParam(value = "code") String code);
/***************************************** 违章 ********************************************/
......
......@@ -147,4 +147,11 @@ public class DictionaryBiz extends BaseBiz<DictionaryMapper, Dictionary> {
}
return dictionaryVoList;
}
public Dictionary findDictionaryByTypeAndCode(String type, String code) {
Dictionary dictionary = new Dictionary();
dictionary.setType(type);
dictionary.setCode(code);
return mapper.selectOne(dictionary);
}
}
......@@ -56,6 +56,11 @@ public class DictionaryController {
return ObjectRestResponse.succ(dictionaryBiz.getAll4Map());
}
@PostMapping("/type_code")
public Dictionary findDictionaryByTypeAndCode(@RequestParam(value = "type") String type,@RequestParam(value = "code") String code){
return dictionaryBiz.findDictionaryByTypeAndCode(type,code);
}
@GetMapping(value = "/app/unauth/clearCache")
@ApiOperation(value = "清除缓存")
@IgnoreUserToken
......
......@@ -76,6 +76,8 @@ public interface VehicleFeign {
@RequestMapping(value = "/user/license/company/getOne", method = RequestMethod.GET)
public RestResponse<VehicleUserLicense> getOne(
@RequestParam(value="id",defaultValue="0")Integer id) throws Exception ;
@RequestMapping(value = "/user/license/multi", method = RequestMethod.GET)
public ObjectRestResponse<List<VehicleUserLicense>> multi(QueryMultiDTO dto) throws Exception;
/**
* 获取优质车型接口
......
package com.xxfc.platform.vehicle.pojo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class QueryMultiDTO{
@ApiModelProperty(value = "主键逗号分割")
public String ids;
}
\ No newline at end of file
......@@ -24,6 +24,11 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.xxfc.platform</groupId>
<artifactId>xx-universal-api</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
......
......@@ -19,7 +19,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@EnableDiscoveryClient
@EnableScheduling
@EnableAceAuthClient
@EnableFeignClients(value = {"com.github.wxiaoqi.security","com.xxfc.platform.vehicle.feign"},defaultConfiguration = HeaderConfig.class)
@EnableFeignClients(value = {"com.github.wxiaoqi.security","com.xxfc.platform.*.feign"},defaultConfiguration = HeaderConfig.class)
@EnableAceCache
@AddBasicConfiguration
@tk.mybatis.spring.annotation.MapperScan(basePackages = "com.xxfc.platform.vehicle.mapper")
......
package com.xxfc.platform.vehicle.jobhandler;
import com.xxfc.platform.universal.entity.Dictionary;
import com.xxfc.platform.universal.feign.ThirdFeign;
import com.xxfc.platform.vehicle.biz.VehicleBiz;
import com.xxfc.platform.vehicle.biz.VehicleBookInfoBiz;
import com.xxfc.platform.vehicle.entity.VehicleBookInfo;
......@@ -31,19 +33,25 @@ public class VehicleJobHandler extends IJobHandler {
@Autowired
private VehicleBookInfoBiz vehicleBookInfoBiz;
@Autowired
private ThirdFeign thirdFeign;
private static final String DIC_VEHICLE_TYPE="VEHICLE";
private static final String DIC_VEHICLE_CODE="VEHICLE_JOB";
@Override
public ReturnT<String> execute(String s) throws Exception {
try {
List<String> existVehicleIds = vehicleBiz.findExistVehicleIds();
Dictionary dictionary = thirdFeign.findDictionaryByTypeAndCode(DIC_VEHICLE_TYPE, DIC_VEHICLE_CODE);
LocalDate date = LocalDate.now();
int year = date.getYear();
int nowMonth = date.getMonthValue();
int month = nowMonth + VehicleBookInfoBiz.MONTH_INTERVAL > 12 ? (VehicleBookInfoBiz.MONTH_INTERVAL + nowMonth) - 12 : nowMonth + VehicleBookInfoBiz.MONTH_INTERVAL;
int betweenMonth = Integer.valueOf(dictionary.getDetail()).intValue();
int month = nowMonth + betweenMonth> 12 ? (betweenMonth + nowMonth) - 12 : nowMonth + betweenMonth;
year = month > nowMonth ? year : year + 1;
if ("8".equals(s) || "9".equals(s)){
month = Integer.valueOf(s);
}
String yearAndMonth = String.format("%d-%d", year, month);
String yearAndMonth = String.format("%d-%s", year, month>10?month:"0"+month);
XxlJobLogger.log("----查询到的车型ids:【{}】",existVehicleIds);
if (CollectionUtils.isNotEmpty(existVehicleIds)) {
List<VehicleBookInfo> bookInfos = existVehicleIds.stream().map(vehicleId -> {
......
......@@ -4,17 +4,16 @@ import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.vehicle.biz.VehicleLicenseBiz;
import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.common.VehicleBaseController;
import com.xxfc.platform.vehicle.constant.ResCode.ResCode;
import com.xxfc.platform.vehicle.entity.VehicleUserLicense;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.vehicle.pojo.QueryMultiDTO;
import com.xxfc.platform.vehicle.pojo.VehicleUserLicenseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import tk.mybatis.mapper.entity.Example;
......@@ -86,10 +85,6 @@ public class VehicleLicenseController extends VehicleBaseController<VehicleLicen
return baseBiz.del(id);
}
@Data
public class QueryMultiDTO{
@ApiModelProperty(value = "主键逗号分割")
public String ids;
}
}
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