Commit 3893286f authored by hezhen's avatar hezhen

Merge branch 'master-chw' into dev-chw

parents 11b33d0a a5aa44ab
...@@ -240,6 +240,25 @@ public class CompanyInfoApplyBiz extends BaseBiz<CompanyInfoApplyMapper, Company ...@@ -240,6 +240,25 @@ public class CompanyInfoApplyBiz extends BaseBiz<CompanyInfoApplyMapper, Company
return companyInfoVo; return companyInfoVo;
} }
//自动审核
public void authAudit(){
List<CompanyInfoApply> list = mapper.getListByDay();
if (list != null && list.size() > 0 ){
for (CompanyInfoApply companyInfoApply : list){
CompanyInfoApply companyInfoApply1 = new CompanyInfoApply();
companyInfoApply1.setStatus(1);
companyInfoApply1.setId(companyInfoApply.getId());
try {
log.info("-----自动审核---id=="+companyInfoApply1.getId());
audit(companyInfoApply1);
}catch (Exception e){
log.error(e.getMessage(),e);
continue;
}
}
}
}
......
package com.github.wxiaoqi.security.admin.jobhandler;
import com.github.wxiaoqi.security.admin.biz.CompanyInfoApplyBiz;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 跨平台Http任务
*
* @author xuxueli 2018-09-16 03:48:34
*/
@JobHandler(value = "companyApplyHandler")
@Component
@Slf4j
public class CompanyApplyJobHandler extends IJobHandler {
@Autowired
CompanyInfoApplyBiz companyInfoApplyBiz;
@Override
public ReturnT<String> execute(String var1) {
try {
XxlJobLogger.log("-----定时器进入---companyApplyHandler---");
log.info("-----定时器进入---companyApplyHandler---");
companyInfoApplyBiz.authAudit();
return ReturnT.SUCCESS;
} catch (Exception e) {
XxlJobLogger.log(e);
return FAIL;
} finally {
}
}
}
\ No newline at end of file
...@@ -16,4 +16,7 @@ public interface CompanyInfoApplyMapper extends Mapper<CompanyInfoApply>, Select ...@@ -16,4 +16,7 @@ public interface CompanyInfoApplyMapper extends Mapper<CompanyInfoApply>, Select
@Select("SELECT * FROM company_info_apply WHERE branch_id=#{branchId} and form_type=2 ORDER BY upd_time DESC LIMIT 1") @Select("SELECT * FROM company_info_apply WHERE branch_id=#{branchId} and form_type=2 ORDER BY upd_time DESC LIMIT 1")
CompanyInfoApply getOneByOrderUpdTime(@Param("branchId")Long branchId); CompanyInfoApply getOneByOrderUpdTime(@Param("branchId")Long branchId);
@Select("SELECT * FROM company_info_apply WHERE `status` = 0 AND DATE_SUB(CURDATE(),INTERVAL 7 DAY) >= date(from_unixtime(crt_time/1000))")
List<CompanyInfoApply> getListByDay();
} }
\ No newline at end of file
...@@ -222,6 +222,27 @@ public class VehicleApplyBiz extends BaseBiz<VehicleApplyMapper, VehicleApply>{ ...@@ -222,6 +222,27 @@ public class VehicleApplyBiz extends BaseBiz<VehicleApplyMapper, VehicleApply>{
//自动审核
public void authAudit(){
List<VehicleApply> list = mapper.getListByDay();
if (list != null && list.size() > 0 ){
for (VehicleApply vehicleApply : list){
VehicleApply vehicleApply1 = new VehicleApply();
vehicleApply1.setApplyStatus(1);
vehicleApply1.setId(vehicleApply.getId());
try {
log.info("-----自动审核---id=="+vehicleApply1.getId());
audit(vehicleApply1);
}catch (Exception e){
log.error(e.getMessage(),e);
continue;
}
}
}
}
......
package com.xxfc.platform.vehicle.jobhandler;
import com.xxfc.platform.vehicle.biz.VehicleApplyBiz;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/1 11:28
*/
@JobHandler(value = "vehicleApplyhandler")
@Component("vehicleApplyhandler")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class VehicleApplyJobHandler extends IJobHandler {
private final VehicleApplyBiz vehicleApplyBiz;
@Override
public ReturnT<String> execute(String s) throws Exception {
try {
vehicleApplyBiz.authAudit();
return ReturnT.SUCCESS;
} catch (Exception ex) {
XxlJobLogger.log(ex);
return FAIL;
}
}
}
...@@ -19,4 +19,9 @@ public interface VehicleApplyMapper extends Mapper<VehicleApply>, SelectByIdList ...@@ -19,4 +19,9 @@ public interface VehicleApplyMapper extends Mapper<VehicleApply>, SelectByIdList
VehicleApply getOneByOrderUpdTime(@Param("vehicleId") String vehicleId); VehicleApply getOneByOrderUpdTime(@Param("vehicleId") String vehicleId);
List<VehicleApplyVo> selectListByApp(VehicleApplyFindDTO vehicleApplyFindDTO); List<VehicleApplyVo> selectListByApp(VehicleApplyFindDTO vehicleApplyFindDTO);
}
\ No newline at end of file
@Select("SELECT * FROM vehicle_apply WHERE `apply_status` = 0 AND DATE_SUB(CURDATE(),INTERVAL 7 DAY) >= date(from_unixtime(crt_time/1000))")
List<VehicleApply> getListByDay();
}
\ No newline at end of file
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