
10 changed files with 286 additions and 18 deletions
@ -0,0 +1,25 @@ |
|||||
|
package com.yxt.anrui.fin.api.fintemptimepush; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
@ApiModel(value = "金蝶数据推送-临时表", description = "金蝶数据推送-临时表") |
||||
|
@TableName("fin_temp_time_push") |
||||
|
@Data |
||||
|
public class FinTempTimePush extends BaseEntity { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
|
||||
|
@ApiModelProperty("业务sid") |
||||
|
private String busSid; |
||||
|
@ApiModelProperty("业务类型") |
||||
|
private String busType; |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
package com.yxt.anrui.fin.api.fintemptimepush; |
||||
|
|
||||
|
import com.yxt.common.core.dto.Dto; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class FinTempTimePushDto implements Dto { |
||||
|
|
||||
|
private String createBySid; |
||||
|
@ApiModelProperty("业务sid") |
||||
|
private String busSid; |
||||
|
@ApiModelProperty("业务类型") |
||||
|
private String busType; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package com.yxt.anrui.fin.api.fintemptimepush; |
||||
|
|
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
|
||||
|
@Api(tags = "金蝶数据推送-临时表") |
||||
|
@FeignClient( |
||||
|
contextId = "anrui-fin-FinTempTimePush", |
||||
|
name = "anrui-fin", |
||||
|
path = "v1/FinTempTimePush") |
||||
|
public interface FinTempTimePushFeign { |
||||
|
|
||||
|
@ApiOperation("新增保存") |
||||
|
@PostMapping("/save") |
||||
|
public ResultBean save(@RequestBody FinTempTimePushDto dto); |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
/********************************************************* |
||||
|
********************************************************* |
||||
|
******************** ******************* |
||||
|
************* ************ |
||||
|
******* _oo0oo_ ******* |
||||
|
*** o8888888o *** |
||||
|
* 88" . "88 * |
||||
|
* (| -_- |) * |
||||
|
* 0\ = /0 * |
||||
|
* ___/`---'\___ * |
||||
|
* .' \\| |// '. *
|
||||
|
* / \\||| : |||// \ *
|
||||
|
* / _||||| -:- |||||- \ * |
||||
|
* | | \\\ - /// | | *
|
||||
|
* | \_| ''\---/'' |_/ | * |
||||
|
* \ .-\__ '-' ___/-. / * |
||||
|
* ___'. .' /--.--\ `. .'___ * |
||||
|
* ."" '< `.___\_<|>_/___.' >' "". * |
||||
|
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
||||
|
* \ \ `_. \_ __\ /__ _/ .-` / / * |
||||
|
* =====`-.____`.___ \_____/___.-`___.-'===== * |
||||
|
* `=---=' * |
||||
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
||||
|
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
||||
|
*********************************************************/ |
||||
|
package com.yxt.anrui.fin.biz.fintemptimepush; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.yxt.anrui.fin.api.fintemptimepush.FinTempTimePush; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface FinTempTimePushMapper extends BaseMapper<FinTempTimePush> { |
||||
|
|
||||
|
|
||||
|
List<FinTempTimePush> selListByBusType(@Param("busType") String busType); |
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.yxt.anrui.fin.biz.fintemptimepush.FinTempTimePushMapper"> |
||||
|
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
|
<!-- ${ew.customSqlSegment} --> |
||||
|
|
||||
|
|
||||
|
<select id="selListByBusType" resultType="com.yxt.anrui.fin.api.fintemptimepush.FinTempTimePush"> |
||||
|
select * |
||||
|
from fin_temp_time_push |
||||
|
where busType = #{busType} |
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,48 @@ |
|||||
|
/********************************************************* |
||||
|
********************************************************* |
||||
|
******************** ******************* |
||||
|
************* ************ |
||||
|
******* _oo0oo_ ******* |
||||
|
*** o8888888o *** |
||||
|
* 88" . "88 * |
||||
|
* (| -_- |) * |
||||
|
* 0\ = /0 * |
||||
|
* ___/`---'\___ * |
||||
|
* .' \\| |// '. *
|
||||
|
* / \\||| : |||// \ *
|
||||
|
* / _||||| -:- |||||- \ * |
||||
|
* | | \\\ - /// | | *
|
||||
|
* | \_| ''\---/'' |_/ | * |
||||
|
* \ .-\__ '-' ___/-. / * |
||||
|
* ___'. .' /--.--\ `. .'___ * |
||||
|
* ."" '< `.___\_<|>_/___.' >' "". * |
||||
|
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
||||
|
* \ \ `_. \_ __\ /__ _/ .-` / / * |
||||
|
* =====`-.____`.___ \_____/___.-`___.-'===== * |
||||
|
* `=---=' * |
||||
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
||||
|
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
||||
|
*********************************************************/ |
||||
|
package com.yxt.anrui.fin.biz.fintemptimepush; |
||||
|
|
||||
|
import com.yxt.anrui.fin.api.fintemptimepush.FinTempTimePushDto; |
||||
|
import com.yxt.anrui.fin.api.fintemptimepush.FinTempTimePushFeign; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
|
||||
|
@Api(tags = "金蝶数据推送-临时表") |
||||
|
@RestController("com.yxt.anrui.fin.biz.fintemptimepush.FinTempTimePushRest") |
||||
|
@RequestMapping("v1/FinTempTimePush") |
||||
|
public class FinTempTimePushRest implements FinTempTimePushFeign { |
||||
|
|
||||
|
@Autowired |
||||
|
private FinTempTimePushService finTempTimePushService; |
||||
|
@Override |
||||
|
public ResultBean save(FinTempTimePushDto dto) { |
||||
|
return finTempTimePushService.saveEntity(dto); |
||||
|
} |
||||
|
} |
@ -0,0 +1,52 @@ |
|||||
|
/********************************************************* |
||||
|
********************************************************* |
||||
|
******************** ******************* |
||||
|
************* ************ |
||||
|
******* _oo0oo_ ******* |
||||
|
*** o8888888o *** |
||||
|
* 88" . "88 * |
||||
|
* (| -_- |) * |
||||
|
* 0\ = /0 * |
||||
|
* ___/`---'\___ * |
||||
|
* .' \\| |// '. *
|
||||
|
* / \\||| : |||// \ *
|
||||
|
* / _||||| -:- |||||- \ * |
||||
|
* | | \\\ - /// | | *
|
||||
|
* | \_| ''\---/'' |_/ | * |
||||
|
* \ .-\__ '-' ___/-. / * |
||||
|
* ___'. .' /--.--\ `. .'___ * |
||||
|
* ."" '< `.___\_<|>_/___.' >' "". * |
||||
|
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
||||
|
* \ \ `_. \_ __\ /__ _/ .-` / / * |
||||
|
* =====`-.____`.___ \_____/___.-`___.-'===== * |
||||
|
* `=---=' * |
||||
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
||||
|
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
||||
|
*********************************************************/ |
||||
|
package com.yxt.anrui.fin.biz.fintemptimepush; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.yxt.anrui.fin.api.fintemptimepush.FinTempTimePush; |
||||
|
import com.yxt.anrui.fin.api.fintemptimepush.FinTempTimePushDto; |
||||
|
import com.yxt.common.base.service.MybatisBaseService; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Service |
||||
|
public class FinTempTimePushService extends MybatisBaseService<FinTempTimePushMapper, FinTempTimePush> { |
||||
|
|
||||
|
|
||||
|
public ResultBean saveEntity(FinTempTimePushDto dto) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
FinTempTimePush finTempTimePush = new FinTempTimePush(); |
||||
|
BeanUtil.copyProperties(dto,finTempTimePush); |
||||
|
baseMapper.insert(finTempTimePush); |
||||
|
return rb.success(); |
||||
|
} |
||||
|
|
||||
|
public List<FinTempTimePush> selListByBusType(String busType) { |
||||
|
return baseMapper.selListByBusType(busType); |
||||
|
} |
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
package com.yxt.anrui.fin.biz.fintemptimepush; |
||||
|
|
||||
|
import com.yxt.anrui.fin.api.fintemptimepush.FinTempTimePush; |
||||
|
import com.yxt.anrui.riskcenter.api.loanmonthlyaccrualapply.LoanMonthlyAccrualApplyFeign; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.scheduling.annotation.Scheduled; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.Collections; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author Administrator |
||||
|
* @description |
||||
|
* @date 2023/11/7 14:02 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class TimingPushService { |
||||
|
|
||||
|
@Autowired |
||||
|
private LoanMonthlyAccrualApplyFeign loanMonthlyAccrualApplyFeign; |
||||
|
@Autowired |
||||
|
private FinTempTimePushService finTempTimePushService; |
||||
|
|
||||
|
/** |
||||
|
* 定时推送月还计提凭证 |
||||
|
*/ |
||||
|
@Scheduled(cron = "0 0 3 2,3,4,5,6,7,8,9,10 * ? ") //每月2-10号 3点推送
|
||||
|
public void monthlyAccrualVoucher() { |
||||
|
List<FinTempTimePush> list = finTempTimePushService.selListByBusType("月还计提"); |
||||
|
list.removeAll(Collections.singleton(null)); |
||||
|
if (!list.isEmpty()) { |
||||
|
for (FinTempTimePush f : list) { |
||||
|
loanMonthlyAccrualApplyFeign.rePushVoucher(f.getBusSid()); |
||||
|
finTempTimePushService.deleteBySid(f.getSid()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
Loading…
Reference in new issue