From 44af7b5ac4eedf176e7a20f1df1bfb49d39cea5e Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Fri, 7 Jun 2024 16:31:19 +0800 Subject: [PATCH] '123' --- .../java/com/ruoyi/quartz/task/QuotTask.java | 24 +++++------- .../java/com/ruoyi/quartz/task/RbTask.java | 37 +++++++++---------- .../com/ruoyi/quartz/util/ScheduleUtils.java | 6 +-- ruoyi-ui/src/views/quot/quot/index.vue | 21 +++++++++-- 4 files changed, 48 insertions(+), 40 deletions(-) diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/QuotTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/QuotTask.java index bded4d4..fb2f949 100644 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/QuotTask.java +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/QuotTask.java @@ -39,21 +39,17 @@ public class QuotTask * 检查OA报加单审批流程是否结束 */ public void OAQuot() throws Exception { - - Boolean lock= redisLock.getLock(getJobKey("OAQuotTaskLock"), 120, "OAQuotTask"); - if(lock){ - try{ - // 查询 报价单-OA审批状态为审批中的单号,并且在中间表显示流程已经结束的单据,根据单号更新 OA审批状态 - List quots = quotService.selectOAQUOT(); - for(OASysQuot sysoaquot:quots){ - // 批量更新报价单-OA审批状态,备注 - quotService.updateQuotOAApprovalStatus(sysoaquot.getQuotId(),sysoaquot.getState(),sysoaquot.getRemark()); - //将中间表 根据报价单号更新 isfinish=1 表示报价流程已结束 - quotService.updateOAQuotByQuotCode(sysoaquot.getQuotCode()); - } - }catch (Exception e) { - throw new Exception(e.getMessage(), e); + try{ + // 查询 报价单-OA审批状态为审批中的单号,并且在中间表显示流程已经结束的单据,根据单号更新 OA审批状态 + List quots = quotService.selectOAQUOT(); + for(OASysQuot sysoaquot:quots){ + // 批量更新报价单-OA审批状态,备注 + quotService.updateQuotOAApprovalStatus(sysoaquot.getQuotId(),sysoaquot.getState(),sysoaquot.getRemark()); + //将中间表 根据报价单号更新 isfinish=1 表示报价流程已结束 + quotService.updateOAQuotByQuotCode(sysoaquot.getQuotCode()); } + }catch (Exception e) { + throw new Exception(e.getMessage(), e); } } diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RbTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RbTask.java index 563ebab..db435d7 100644 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RbTask.java +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RbTask.java @@ -54,32 +54,29 @@ public class RbTask public void tongb() throws Exception { String rbVersionUid = testUtils.sapTjService.selRbVersionUid();//红本调价记录uid - Boolean lock= redisLock.getLock(getJobKey("rbTask"), 480, "rbTask"); - if(lock){ - //判断是否已执行调价 (6.3 redbook rb_productVersion 是否有新增uid and sta='1'、sdmdm1 调价日期今日的数据是否存在) - String locVersionUid = testUtils.sapTjService.selLocVersionUid();//本地红本调价记录uid + //判断是否已执行调价 (6.3 redbook rb_productVersion 是否有新增uid and sta='1'、sdmdm1 调价日期今日的数据是否存在) + String locVersionUid = testUtils.sapTjService.selLocVersionUid();//本地红本调价记录uid - String RbProductPriceCount = testUtils.sapTjService.selRbProductPriceVersionUid(rbVersionUid);//RbProductPrice表是否有更新 - String RbProductBasePriceCount = testUtils.sapTjService.selRbProductBasePriceVersionUid(rbVersionUid);//RbProductBasePrice表是否有更新 + String RbProductPriceCount = testUtils.sapTjService.selRbProductPriceVersionUid(rbVersionUid);//RbProductPrice表是否有更新 + String RbProductBasePriceCount = testUtils.sapTjService.selRbProductBasePriceVersionUid(rbVersionUid);//RbProductBasePrice表是否有更新 - try{ - if(!rbVersionUid.equals(locVersionUid) && Integer.valueOf(RbProductPriceCount)>0 && Integer.valueOf(RbProductBasePriceCount)>0) {//有新增调价版本并且有调价记录 - System.out.println("=======================开始同步!======================"); - testUtils.sapTjService.deleteLocProductPrice();//删除本地c_rb_product_price表数据 - List productPriceList = testUtils.sapTjService.getProductPriceList(rbVersionUid); - JDBCBatchInsert.insertRbProductPrice(productPriceList);//批量插入 + try{ + if(!rbVersionUid.equals(locVersionUid) && Integer.valueOf(RbProductPriceCount)>0 && Integer.valueOf(RbProductBasePriceCount)>0) {//有新增调价版本并且有调价记录 + System.out.println("=======================开始同步!======================"); + testUtils.sapTjService.deleteLocProductPrice();//删除本地c_rb_product_price表数据 + List productPriceList = testUtils.sapTjService.getProductPriceList(rbVersionUid); + JDBCBatchInsert.insertRbProductPrice(productPriceList);//批量插入 - testUtils.sapTjService.deleteLocProductBasePrice();//删除本地c_rb_productbase_price表数据 - List productBasePriceList = testUtils.sapTjService.getProductBasePriceList(rbVersionUid); - JDBCBatchInsert.insertRbProductBasePrice(productBasePriceList);//批量插入 + testUtils.sapTjService.deleteLocProductBasePrice();//删除本地c_rb_productbase_price表数据 + List productBasePriceList = testUtils.sapTjService.getProductBasePriceList(rbVersionUid); + JDBCBatchInsert.insertRbProductBasePrice(productBasePriceList);//批量插入 - testUtils.sapTjService.updateLocRbVersion(rbVersionUid);//更新本地c_rb_version表 + testUtils.sapTjService.updateLocRbVersion(rbVersionUid);//更新本地c_rb_version表 - } - redisCache.deleteObject(getJobKey("rbTask")); - }catch (Exception e) { - throw new Exception(e.getMessage(), e); } + redisCache.deleteObject(getJobKey("rbTask")); + }catch (Exception e) { + throw new Exception(e.getMessage(), e); } } diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java index 6f95a48..234be2d 100644 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java @@ -20,7 +20,7 @@ import com.ruoyi.quartz.domain.SysJob; /** * 定时任务工具类 - * + * * @author ruoyi * */ @@ -77,7 +77,7 @@ public class ScheduleUtils jobDetail.getJobDataMap().put(ScheduleConstants.TASK_PROPERTIES, job); //注册triggerListener ->项目多机部署时使用 -// scheduler.getListenerManager().addTriggerListener(new RedisTriggerListener()); + scheduler.getListenerManager().addTriggerListener(new RedisTriggerListener()); // 判断是否存在 if (scheduler.checkExists(getJobKey(jobId, jobGroup))) @@ -124,7 +124,7 @@ public class ScheduleUtils /** * 检查包名是否为白名单配置 - * + * * @param invokeTarget 目标字符串 * @return 结果 */ diff --git a/ruoyi-ui/src/views/quot/quot/index.vue b/ruoyi-ui/src/views/quot/quot/index.vue index d13c108..22ca90a 100644 --- a/ruoyi-ui/src/views/quot/quot/index.vue +++ b/ruoyi-ui/src/views/quot/quot/index.vue @@ -494,6 +494,7 @@ :action="uploadUrl" :headers="headers" :data="{ relation_id: this.form.quotId,file_type: 'quotXjFile' }" + :before-upload="beforeAvatarUpload" :on-success="handleAvatarSuccess" :show-file-list="false" :limit="1" @@ -1264,7 +1265,8 @@ export default { let self = this; this.$modal.confirm('是否确认修订所选报价单且更新状态为协助中?').then(function() { getReturnUpdateQuot(quotId).then(response => { - self.setInfo(response); + //self.setInfo(response); + this.$modal.msgSuccess("更改成功"); }); }).then(() => {}).catch(() => {}); }, @@ -1342,7 +1344,7 @@ export default { }); } else { addQuot(this.form).then(response => { - this.$modal.msgSuccess("新增成功"); + this.$modal.msgSuccess("创建成功"); const row = {'quotId':response.data.quotId} this.handleUpdate(row); @@ -1630,7 +1632,20 @@ export default { uploadFile(activeName){ this.activeName = activeName }, - + //上传前校验 + beforeAvatarUpload(file) { + let activeName = this.activeName; + if(activeName=='quotXjFile'){ + if(file.name.split('.')[1].toLowerCase() != 'xls' && file.name.split('.')[1].toLowerCase() != 'xlsx'){ + this.$modal.msgError("清单附件必须是Excel格式"); + return false; + } + } + /*const isLt2M = file.size / 1024 / 1024 < 2; // 小于2M + if ( !isLt2M ) { + console.log('文件大小超出2M'); + }*/ + }, //成功回调 handleAvatarSuccess(res) { let activeName = this.activeName;