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 {
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
......@@ -174,12 +174,15 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
if (vehicle == null) {
return ObjectRestResponse.createFailedResult(500, "订单车辆不存在!");
}
if( vehicle.getMileageLastUpdate() != null) {
//判断车辆公里数
if (orderVehicleCrosstownDto.getMileage() == null || orderVehicleCrosstownDto.getMileage() < vehicle.getMileageLastUpdate()) {
return ObjectRestResponse.createFailedResult(500, "请输入车辆仪表盘实际公里数!");
}
}
}
//调用车辆管理的出车还车
//出车
if (orderVehicleCrosstownDto.getType() == CrosstownTypeEnum.DEPARTURE.getCode()) { //交车
......
......@@ -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;
......@@ -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();
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).getLicenseIdCard());
orderVehicleCrosstownDto.setLicenseImg(orderUserLicenses.get(0).getLicenseImg());
orderVehicleCrosstownDto.setLicenseName(orderUserLicenses.get(0).getLicenseName());
orderVehicleCrosstownDto.setLicensePhone(orderUserLicenses.get(0).getLicensePhone());
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
......
......@@ -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 -> {
......
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