Commit c0f19f8b authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents 5420b437 90795ba1
...@@ -21,7 +21,7 @@ public class ReferralCodeUtil { ...@@ -21,7 +21,7 @@ public class ReferralCodeUtil {
static { static {
PERMUTATION = permutation(LEN); PERMUTATION = permutation(LEN);
MAX_COMBINATION = combination(36, LEN); MAX_COMBINATION = combination(_stuffs.length, LEN);
} }
// public static void resetStuffs() { // public static void resetStuffs() {
......
...@@ -7,16 +7,15 @@ import com.github.wxiaoqi.security.admin.mapper.AppUserDetailMapper; ...@@ -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.rpc.service.AppPermissionService;
import com.github.wxiaoqi.security.admin.vo.AppUserVo; import com.github.wxiaoqi.security.admin.vo.AppUserVo;
import com.github.wxiaoqi.security.common.biz.BaseBiz; 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.beanutils.BeanUtils;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example; import tk.mybatis.mapper.entity.Example;
import java.time.Instant; import java.time.Instant;
import java.util.Collection; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -31,7 +30,8 @@ import java.util.stream.Collectors; ...@@ -31,7 +30,8 @@ import java.util.stream.Collectors;
public class AppUserDetailBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail> { public class AppUserDetailBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail> {
@Autowired
private AppUserLoginBiz appUserLoginBiz;
@Override @Override
@CacheClear(pre = "user{1.userid}") @CacheClear(pre = "user{1.userid}")
......
...@@ -220,4 +220,8 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> { ...@@ -220,4 +220,8 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
appUserLogin.setIsdel(0); appUserLogin.setIsdel(0);
mapper.updateByPrimaryKeySelective(appUserLogin); mapper.updateByPrimaryKeySelective(appUserLogin);
} }
public List<Integer> findAllExistUserIds(){
return mapper.selectAllExistUserIds();
}
} }
...@@ -17,4 +17,5 @@ public interface AppUserDetailMapper extends Mapper<AppUserDetail> { ...@@ -17,4 +17,5 @@ public interface AppUserDetailMapper extends Mapper<AppUserDetail> {
List<AppUserManageVo> selectAppUserManage(AppUserManageDTO appUserManageDTO); List<AppUserManageVo> selectAppUserManage(AppUserManageDTO appUserManageDTO);
void updateUserMemberStatusByUserId(@Param("userId") Integer userId,@Param("status") Integer status); 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; ...@@ -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.AppUserLogin;
import com.github.wxiaoqi.security.admin.entity.AppUserManage; import com.github.wxiaoqi.security.admin.entity.AppUserManage;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.additional.idlist.SelectByIdListMapper; import tk.mybatis.mapper.additional.idlist.SelectByIdListMapper;
import tk.mybatis.mapper.common.Mapper; import tk.mybatis.mapper.common.Mapper;
...@@ -24,4 +25,7 @@ public interface AppUserLoginMapper extends Mapper<AppUserLogin>, SelectByIdList ...@@ -24,4 +25,7 @@ public interface AppUserLoginMapper extends Mapper<AppUserLogin>, SelectByIdList
List<AppUserLogin> selectbyPhones(@Param("phones") List<String> phones); List<AppUserLogin> selectbyPhones(@Param("phones") List<String> phones);
int bindOpenId(AppUserLogin appUserLogin); int bindOpenId(AppUserLogin appUserLogin);
List<Integer> selectAllExistUserIds();
} }
\ No newline at end of file
...@@ -12,4 +12,8 @@ ...@@ -12,4 +12,8 @@
<update id="bindOpenId" parameterType="com.github.wxiaoqi.security.admin.entity.AppUserLogin"> <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 app_user_login SET wx_openid=#{wxOpenid},unionid=#{unionid},openid=#{openid} where id=#{id}
</update> </update>
<select id="selectAllExistUserIds" resultType="integer">
SELECT `id` FROM `app_user_login` WHERE `isdel`=0;
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -174,10 +174,13 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp ...@@ -174,10 +174,13 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
if (vehicle == null) { if (vehicle == null) {
return ObjectRestResponse.createFailedResult(500, "订单车辆不存在!"); return ObjectRestResponse.createFailedResult(500, "订单车辆不存在!");
} }
//判断车辆公里数 if( vehicle.getMileageLastUpdate() != null) {
if (orderVehicleCrosstownDto.getMileage() == null || orderVehicleCrosstownDto.getMileage() < vehicle.getMileageLastUpdate()) { //判断车辆公里数
return ObjectRestResponse.createFailedResult(500, "请输入车辆仪表盘实际公里数!"); if (orderVehicleCrosstownDto.getMileage() == null || orderVehicleCrosstownDto.getMileage() < vehicle.getMileageLastUpdate()) {
} return ObjectRestResponse.createFailedResult(500, "请输入车辆仪表盘实际公里数!");
}
}
} }
//调用车辆管理的出车还车 //调用车辆管理的出车还车
......
...@@ -15,7 +15,6 @@ import com.github.wxiaoqi.security.common.util.process.ResultCode; ...@@ -15,7 +15,6 @@ import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.order.biz.BaseOrderBiz; import com.xxfc.platform.order.biz.BaseOrderBiz;
import com.xxfc.platform.order.biz.OrderUserLicenseBiz; 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.OrderListVo;
import com.xxfc.platform.order.pojo.order.OrderPageVO; import com.xxfc.platform.order.pojo.order.OrderPageVO;
import com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto; import com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto;
...@@ -23,8 +22,10 @@ import com.xxfc.platform.order.pojo.order.QueryOrderDTO; ...@@ -23,8 +22,10 @@ import com.xxfc.platform.order.pojo.order.QueryOrderDTO;
import com.xxfc.platform.vehicle.common.RestResponse; import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.entity.BranchCompany; import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.entity.Vehicle; 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.feign.VehicleFeign;
import com.xxfc.platform.vehicle.pojo.CompanyDetail; import com.xxfc.platform.vehicle.pojo.CompanyDetail;
import com.xxfc.platform.vehicle.pojo.QueryMultiDTO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.Data; import lombok.Data;
...@@ -109,16 +110,23 @@ public class BackStageOrderController extends CommonBaseController implements Us ...@@ -109,16 +110,23 @@ public class BackStageOrderController extends CommonBaseController implements Us
orderPageVO.setVehicleNumberPlat(restResponse.getData().getNumberPlate()); orderPageVO.setVehicleNumberPlat(restResponse.getData().getNumberPlate());
} }
if (StringUtils.isNotBlank(orderPageVO.getOrderRentVehicleDetail().getMyDriverIds())) { if (StringUtils.isNotBlank(orderPageVO.getOrderRentVehicleDetail().getMyDriverIds())) {
List<OrderUserLicense> orderUserLicenses = orderUserLicenseBiz.selectByIds(orderPageVO.getOrderRentVehicleDetail().getMyDriverIds()).getData(); try {
QueryMultiDTO queryMultiDTO = new QueryMultiDTO();
if (orderUserLicenses != null && orderUserLicenses.size() > 0) { queryMultiDTO.setIds(orderPageVO.getOrderRentVehicleDetail().getMyDriverIds());
OrderVehicleCrosstownDto orderVehicleCrosstownDto = new OrderVehicleCrosstownDto(); List<VehicleUserLicense> orderUserLicenses = vehicleFeign.multi(queryMultiDTO).getData();
orderVehicleCrosstownDto.setLicenseIdCard(orderUserLicenses.get(0).getLicenseIdCard());
orderVehicleCrosstownDto.setLicenseImg(orderUserLicenses.get(0).getLicenseImg()); if (orderUserLicenses != null && orderUserLicenses.size() > 0) {
orderVehicleCrosstownDto.setLicenseName(orderUserLicenses.get(0).getLicenseName()); OrderVehicleCrosstownDto orderVehicleCrosstownDto = new OrderVehicleCrosstownDto();
orderVehicleCrosstownDto.setLicensePhone(orderUserLicenses.get(0).getLicensePhone()); orderVehicleCrosstownDto.setLicenseIdCard(orderUserLicenses.get(0).getIdCard());
orderPageVO.setOrderVehicleCrosstownDto(orderVehicleCrosstownDto); 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 @@ ...@@ -11,6 +11,5 @@
parameterType="java.lang.Integer"> parameterType="java.lang.Integer">
select * from deposit_refund_record select * from deposit_refund_record
where crosstown_id = #{crossId} and isshow = 1 where crosstown_id = #{crossId} and isshow = 1
order by status
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -72,6 +72,9 @@ public interface ThirdFeign { ...@@ -72,6 +72,9 @@ public interface ThirdFeign {
@RequestMapping(value = "/dictionary/getAll4Map", method = RequestMethod.GET) @RequestMapping(value = "/dictionary/getAll4Map", method = RequestMethod.GET)
public ObjectRestResponse<Map<String, Dictionary>> dictionaryGetAll4Map(); 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> { ...@@ -147,4 +147,11 @@ public class DictionaryBiz extends BaseBiz<DictionaryMapper, Dictionary> {
} }
return dictionaryVoList; 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 { ...@@ -56,6 +56,11 @@ public class DictionaryController {
return ObjectRestResponse.succ(dictionaryBiz.getAll4Map()); 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") @GetMapping(value = "/app/unauth/clearCache")
@ApiOperation(value = "清除缓存") @ApiOperation(value = "清除缓存")
@IgnoreUserToken @IgnoreUserToken
......
...@@ -24,6 +24,11 @@ ...@@ -24,6 +24,11 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.xxfc.platform</groupId>
<artifactId>xx-universal-api</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -19,7 +19,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; ...@@ -19,7 +19,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@EnableDiscoveryClient @EnableDiscoveryClient
@EnableScheduling @EnableScheduling
@EnableAceAuthClient @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 @EnableAceCache
@AddBasicConfiguration @AddBasicConfiguration
@tk.mybatis.spring.annotation.MapperScan(basePackages = "com.xxfc.platform.vehicle.mapper") @tk.mybatis.spring.annotation.MapperScan(basePackages = "com.xxfc.platform.vehicle.mapper")
......
package com.xxfc.platform.vehicle.jobhandler; 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.VehicleBiz;
import com.xxfc.platform.vehicle.biz.VehicleBookInfoBiz; import com.xxfc.platform.vehicle.biz.VehicleBookInfoBiz;
import com.xxfc.platform.vehicle.entity.VehicleBookInfo; import com.xxfc.platform.vehicle.entity.VehicleBookInfo;
...@@ -31,19 +33,25 @@ public class VehicleJobHandler extends IJobHandler { ...@@ -31,19 +33,25 @@ public class VehicleJobHandler extends IJobHandler {
@Autowired @Autowired
private VehicleBookInfoBiz vehicleBookInfoBiz; 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 @Override
public ReturnT<String> execute(String s) throws Exception { public ReturnT<String> execute(String s) throws Exception {
try { try {
List<String> existVehicleIds = vehicleBiz.findExistVehicleIds(); List<String> existVehicleIds = vehicleBiz.findExistVehicleIds();
Dictionary dictionary = thirdFeign.findDictionaryByTypeAndCode(DIC_VEHICLE_TYPE, DIC_VEHICLE_CODE);
LocalDate date = LocalDate.now(); LocalDate date = LocalDate.now();
int year = date.getYear(); int year = date.getYear();
int nowMonth = date.getMonthValue(); 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; year = month > nowMonth ? year : year + 1;
if ("8".equals(s) || "9".equals(s)){ String yearAndMonth = String.format("%d-%s", year, month>10?month:"0"+month);
month = Integer.valueOf(s);
}
String yearAndMonth = String.format("%d-%d", year, month);
XxlJobLogger.log("----查询到的车型ids:【{}】",existVehicleIds); XxlJobLogger.log("----查询到的车型ids:【{}】",existVehicleIds);
if (CollectionUtils.isNotEmpty(existVehicleIds)) { if (CollectionUtils.isNotEmpty(existVehicleIds)) {
List<VehicleBookInfo> bookInfos = existVehicleIds.stream().map(vehicleId -> { List<VehicleBookInfo> bookInfos = existVehicleIds.stream().map(vehicleId -> {
......
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