Commit 154eedc7 authored by jiaorz's avatar jiaorz

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

parents f8f0fea2 c0f19f8b
......@@ -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
......@@ -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);
}
}
......
......@@ -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