修改下架时间——先默认挂3个月

This commit is contained in:
sh
2026-02-10 15:48:43 +08:00
parent 9faf79ef72
commit 69c3113fc2
4 changed files with 29 additions and 3 deletions

View File

@@ -11,7 +11,9 @@ import com.ruoyi.common.annotation.BussinessLog;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SiteSecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@@ -231,6 +233,9 @@ public class AppJobController extends BaseController
return AjaxResult.error(errorMsg);
}
job.setJobStatus("0");//上架
if(StringUtils.isBlank(job.getDownTime())){
job.setDownTime(DateUtils.getMonthThree(DateUtils.YYYY_MM_DD_HH_MM_SS));
}
jobService.publishJob(job);
return success();
}

View File

@@ -132,6 +132,9 @@ public class CmsJobController extends BaseController
return AjaxResult.error(errorMsg);
}
job.setJobStatus("0");//上架
if(StringUtils.isBlank(job.getDownTime())){
job.setDownTime(DateUtils.getMonthThree(DateUtils.YYYY_MM_DD_HH_MM_SS));
}
// 无敏感词,执行插入
return toAjax(jobService.insertJob(job));
}
@@ -151,6 +154,9 @@ public class CmsJobController extends BaseController
String errorMsg = "描述中包含敏感词:" + String.join("", sensitiveWords);
return AjaxResult.error(errorMsg);
}
if(StringUtils.isBlank(job.getDownTime())){
job.setDownTime(DateUtils.getMonthThree(DateUtils.YYYY_MM_DD_HH_MM_SS));
}
return toAjax(jobService.updateJob(job));
}
@@ -460,9 +466,6 @@ public class CmsJobController extends BaseController
@ApiOperation("岗位上架")
@PutMapping("/jobUp/{jobId}")
public AjaxResult jobUp(@PathVariable("jobId") Long jobId) throws CryptoClient.CryptoException {
String aa=encryptDecryptUtil.sm3Hash("2026-02-04 19:10:13");
System.out.println(aa);
System.out.println(encryptDecryptUtil.sm3Verify("2026-02-04 19:10:13",aa));
if(jobId==null){
return error("岗位id为空");
}

View File

@@ -1390,6 +1390,7 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
Job job=new Job();
job.setJobId(jobId);
job.setJobStatus("0");
job.setDownTime(DateUtils.getMonthThree(DateUtils.YYYY_MM_DD_HH_MM_SS));
//刷新单条数据
int i=jobMapper.updateStatus(job);
iesJobSearchService.updateJob(jobId);

View File

@@ -9,6 +9,7 @@ import java.time.LocalTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;
import org.apache.commons.lang3.time.DateFormatUtils;
@@ -246,4 +247,20 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
return null;
}
}
/**
* 获取3个月以后
* @param fmt
* @return
*/
public static String getMonthThree(String fmt){
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH, 3);
Date now = new Date();
Date threeMonthsLater = calendar.getTime();
SimpleDateFormat sdf = new SimpleDateFormat(fmt);
System.out.println("当前时间:" + sdf.format(now));
System.out.println("当前时间+3个月" + sdf.format(threeMonthsLater));
return sdf.format(threeMonthsLater);
}
}