本地添加客户折扣查询接口和更新本地客户折扣配置定时任务
parent
85bb3de84b
commit
e129c6b91b
|
|
@ -0,0 +1,64 @@
|
|||
package com.cowr.local.ssjygl.customer;
|
||||
|
||||
import com.cowr.common.view.PageParam;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.CustomerDiscount;
|
||||
import com.cowr.ssjygl.customer.customerdiscount.CustomerDiscountPKValidator;
|
||||
import com.cowr.ssjygl.customer.customerdiscount.CustomerDiscountService;
|
||||
import com.jfinal.aop.Before;
|
||||
import com.jfinal.core.Controller;
|
||||
|
||||
/**
|
||||
* Generated by COWR Wed Dec 20 14:05:09 CST 2023
|
||||
* TableName: customer_discount
|
||||
* Remarks: 客户相关 - 客户折扣
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class CustomerDiscountController extends Controller {
|
||||
|
||||
/**
|
||||
* 分页查找 customer_discount 客户相关 - 客户折扣
|
||||
*/
|
||||
public void find(){
|
||||
|
||||
|
||||
PageParam pp = getBean(PageParam.class, "", true);
|
||||
String customerId = get("customerId");
|
||||
String customerName = get("customerName");
|
||||
String stm = get("stm");
|
||||
String etm = get("etm");
|
||||
renderJson(Result.object(CustomerDiscountService.me.find(pp,customerId,customerName,stm,etm)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按主键查找单个对象 customer_discount 客户相关 - 客户折扣
|
||||
*/
|
||||
@Before(CustomerDiscountPKValidator.class)
|
||||
public void findByPk(){
|
||||
CustomerDiscount model = getModel(CustomerDiscount.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(CustomerDiscountService.me.findByPk(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按主键查找单个对象 customer_discount 客户相关 - 客户折扣
|
||||
*/
|
||||
@Before(CustomerDiscountPKValidator.class)
|
||||
public void get(){
|
||||
CustomerDiscount model = getModel(CustomerDiscount.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(CustomerDiscountService.me.findByPk(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回所有 customer_discount 客户相关 - 客户折扣
|
||||
*/
|
||||
public void list(){
|
||||
renderJson(Result.object(CustomerDiscountService.me.list()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新当前时间已过期折扣配置
|
||||
*/
|
||||
public void updateDel(){
|
||||
renderJson(Result.object(CustomerDiscountService.me.updateDel()));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.cowr.local.ssjygl.jobs;
|
||||
|
||||
import com.cowr.ssjygl.customer.customerdiscount.CustomerDiscountService;
|
||||
import com.jfinal.log.Log;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2023/12/20.
|
||||
* 用于更新客户折扣配置
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
public class CustomerDiscountJob implements Job {
|
||||
private static Log log = Log.getLog(CustomerDiscountJob.class);
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
|
||||
try {
|
||||
int update = CustomerDiscountService.me.updateDel();
|
||||
log.info("客户折扣配置更新条数: %s",update);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -11,4 +11,8 @@ checkundonordercluster.enable=true
|
|||
# 删除超过2天的无用图片、打印生成的 excel
|
||||
cleartempfile.job=com.cowr.local.ssjygl.jobs.ClearTempFileJob
|
||||
cleartempfile.cron= 1 0 1 * * ?
|
||||
cleartempfile.enable=true
|
||||
cleartempfile.enable=true
|
||||
|
||||
CustomerDiscount.job=com.cowr.local.ssjygl.jobs.CustomerDiscountJob
|
||||
CustomerDiscount.cron= 0 0 0/1 * * ?
|
||||
CustomerDiscount.enable=true
|
||||
Loading…
Reference in New Issue