Commit ba10b0e3 authored by chenzhao's avatar chenzhao

检验业务定时作废

parent 9942e54d
......@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcOpeningApplicationRequstDto;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper 接口
*
......@@ -19,4 +21,6 @@ public interface JyjcOpeningApplicationMapper extends BaseMapper<JyjcOpeningAppl
@Param("jyjcOpeningApplicationRequstDto") JyjcOpeningApplicationRequstDto jyjcOpeningApplicationRequstDto, @Param("applyStartTime") String applyStartTime, @Param("applyendTime") String applyendTime);
void updatePromoter(@Param("id") Long id);
List<Long> selectOverdueData();
}
......@@ -56,6 +56,9 @@
order by sequence_nbr desc
</select>
<select id="selectOverdueData" resultType="java.lang.Long">
SELECT sequence_nbr FROM "tz_jyjc_opening_application" WHERE CURDATE() > expiry_date
</select>
<update id="updatePromoter">
UPDATE tz_jyjc_opening_application set promoter = null
......
package com.yeejoin.amos.boot.module.jyjc.biz.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcOpeningApplication;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcOpeningApplicationRequstDto;
import com.yeejoin.amos.boot.module.jyjc.biz.config.BaseException;
......@@ -9,6 +10,8 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
......@@ -39,6 +42,7 @@ import java.util.stream.Collectors;
@RestController
@Api(tags = "检验业务申请单api")
@RequestMapping(value = "/jyjc-opening-application")
@EnableScheduling
public class JyjcOpeningApplicationController extends BaseController {
@Autowired
......@@ -278,4 +282,29 @@ public class JyjcOpeningApplicationController extends BaseController {
String remark = (String) params.get("remark");
return ResponseHelper.buildResponse(jyjcOpeningApplicationServiceImpl.doDiscard(Long.parseLong(sequenceNbr), remark));
}
/**
* 自动作废
*
*
* @param
* @return {@link ResponseModel< List< TzBaseEnterpriseInfo>>}
* @author yangyang
* @throws
* @date 2023/12/22 16:13
*/
@Scheduled(cron = "0 0 0 * * ?")
public void timingDiscard() {
List<Long> longs = jyjcOpeningApplicationServiceImpl.selectOverdueData();
if (CollectionUtils.isNotEmpty(longs)){
for (Long aLong : longs) {
String remark = "到期作废";
jyjcOpeningApplicationServiceImpl.doDiscard(aLong, remark);
}
}
}
}
......@@ -584,4 +584,9 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
// 根据开通机构过滤
return tzBaseEnterpriseInfos.stream().filter(o -> StringUtils.isNotBlank(o.getUseCode()) && unitCodes.contains(o.getUseCode())).collect(Collectors.toList());
}
public List<Long> selectOverdueData(){
return jyjcOpeningApplicationMapper.selectOverdueData();
}
}
\ 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