From 84ade83cb6751da0cd6de3d42c1dbddc30ada223 Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Wed, 5 Jun 2024 17:26:59 +0800 Subject: [PATCH] '123' --- .../web/controller/quot/QuotController.java | 3 +- .../com/ruoyi/quartz/domain/OASysQuot.java | 48 ++++++++++++++++ .../com/ruoyi/quartz/mapper/OAQuotMapper.java | 30 ++++++++++ .../ruoyi/quartz/service/OAQuotService.java | 27 +++++++++ .../service/impl/OAQuotServiceImpl.java | 36 ++++++++++++ .../com/ruoyi/quartz/task/OAQuotTask.java | 57 +++++++++++++++++++ .../resources/mapper/quartz/OAQuotMapper.xml | 23 ++++++++ .../main/java/com/ruoyi/quot/domain/Quot.java | 4 ++ .../java/com/ruoyi/quot/domain/SysOaQuot.java | 16 ++++++ .../main/resources/mapper/quot/QuotMapper.xml | 8 ++- ruoyi-ui/src/views/quot/quot/index.vue | 8 +++ 11 files changed, 257 insertions(+), 3 deletions(-) create mode 100644 ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/OASysQuot.java create mode 100644 ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/OAQuotMapper.java create mode 100644 ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/OAQuotService.java create mode 100644 ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/OAQuotServiceImpl.java create mode 100644 ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/OAQuotTask.java create mode 100644 ruoyi-quartz/src/main/resources/mapper/quartz/OAQuotMapper.xml diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java index 21b00f5..db89ab4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java @@ -473,7 +473,7 @@ public class QuotController extends BaseController sysOaQuot.setUserId(oauser.getUserId()); sysOaQuot.setDepartmentId(oauser.getUserId()); sysOaQuot.setDepartmentId(oauser.getDepartmentId()); - sysOaQuot.setSubmissionTime(DateUtils.getTime()); + sysOaQuot.setSubmissionTime(DateUtils.getDate()); sysOaQuot.setQuotId(UUID.fastUUID().toString()); sysOaQuot.setQuotCode(quot.getQuotCode()); sysOaQuot.setQuotSalesmanName(quot.getQuotSalesmanName()); @@ -486,6 +486,7 @@ public class QuotController extends BaseController sysOaQuot.setQuotLvPrice(quot.getQuotLvPrice()); sysOaQuot.setQuotTongPrice(quot.getQuotTongPrice()); sysOaQuot.setQuotMatpriceDiff(quot.getQuotMatpriceDiff()); + sysOaQuot.setCreateTime(DateUtils.getNowDate()); sysOaQuot.setMaterials(quot.getQuotMaterialList()); diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/OASysQuot.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/OASysQuot.java new file mode 100644 index 0000000..0116023 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/OASysQuot.java @@ -0,0 +1,48 @@ +package com.ruoyi.quartz.domain; + +import com.ruoyi.common.core.domain.BaseEntity; + +import java.util.Date; +import java.util.List; + +/** + * 报价对象 SysOaQuot + * + * @author ruoyi + * @date 2024-04-01 + */ +public class OASysQuot +{ + /** 报价单id */ + private String quotId; + + /** OA审批状态 */ + private String state; + + /** OA审批备注 */ + private String remark; + + public String getQuotId() { + return quotId; + } + + public void setQuotId(String quotId) { + this.quotId = quotId; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/OAQuotMapper.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/OAQuotMapper.java new file mode 100644 index 0000000..0d3c430 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/OAQuotMapper.java @@ -0,0 +1,30 @@ +package com.ruoyi.quartz.mapper; + +import com.ruoyi.quartz.domain.OASysQuot; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 报价Mapper接口 + * + * @author ruoyi + * @date 2024-04-01 + */ +public interface OAQuotMapper +{ + + /** + * 查询 报价单-OA审批状态为审批中的单号,并且在中间表显示流程已经结束的单据,根据单号更新 OA审批状态 + * @return + */ + List selectOAQUOT(); + + /** + * 批量更新报价单-OA审批状态为已完成 + * @param quotId + * @param state + * @param remark + */ + void updateQuotOAApprovalStatus(@Param("quotId") String quotId, @Param("state") String state, @Param("remark") String remark); +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/OAQuotService.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/OAQuotService.java new file mode 100644 index 0000000..8e3f163 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/OAQuotService.java @@ -0,0 +1,27 @@ +package com.ruoyi.quartz.service; + +import com.ruoyi.quartz.domain.OASysQuot; + +import java.util.List; + +/** + * 报价Service接口 + * + * @author ruoyi + * @date 2024-04-01 + */ +public interface OAQuotService +{ + + /** + * 查询 报价单-OA审批状态为审批中的单号,并且在中间表显示流程已经结束的单据,根据单号更新 OA审批状态 + * @return + */ + List selectOAQUOT(); + + /** + * 批量更新报价单-OA审批状态为已完成 + * @param quotId + */ + void updateQuotOAApprovalStatus(String quotId,String state,String remark); +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/OAQuotServiceImpl.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/OAQuotServiceImpl.java new file mode 100644 index 0000000..55ede91 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/OAQuotServiceImpl.java @@ -0,0 +1,36 @@ +package com.ruoyi.quartz.service.impl; + +import com.ruoyi.quartz.domain.OASysQuot; +import com.ruoyi.quartz.mapper.OAQuotMapper; +import com.ruoyi.quartz.service.OAQuotService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 报价Service业务层处理 + * + * @author ruoyi + * @date 2024-04-01 + */ +@Service +public class OAQuotServiceImpl implements OAQuotService +{ + @Resource + private OAQuotMapper aAQuotMapper; + + /** + * 查询 报价单-OA审批状态为审批中的单号,并且在中间表显示流程已经结束的单据,根据单号更新 OA审批状态 + * @return + */ + @Override + public List selectOAQUOT() { + return aAQuotMapper.selectOAQUOT(); + } + + @Override + public void updateQuotOAApprovalStatus(String quotId, String state, String remark) { + aAQuotMapper.updateQuotOAApprovalStatus(quotId,state,remark); + } +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/OAQuotTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/OAQuotTask.java new file mode 100644 index 0000000..299cd36 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/OAQuotTask.java @@ -0,0 +1,57 @@ +package com.ruoyi.quartz.task; + +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.core.redis.RedisLock; +import com.ruoyi.quartz.domain.OASysQuot; +import com.ruoyi.quartz.service.OAQuotService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import javax.annotation.PostConstruct; +import javax.annotation.Resource; +import java.util.List; + +/** + * 定时任务调度-同步红本数据库 + * + * @author ruoyi + */ +@Component("OAQuotTask") +public class OAQuotTask +{ + @Autowired + private RedisCache redisCache; + + @Autowired + private RedisLock redisLock; + + @Resource + private OAQuotService quotService; + + public static OAQuotTask testUtils; + + @PostConstruct + public void init() { + testUtils = this; + } + + /** + * 检查OA报加单审批流程是否结束 + */ + public void OAQuot() throws Exception { + + Boolean lock= redisLock.getLock("OAQuotTask", -1, "1"); + if(lock){ + try{ + // 查询 报价单-OA审批状态为审批中的单号,并且在中间表显示流程已经结束的单据,根据单号更新 OA审批状态 + List quots = quotService.selectOAQUOT(); + for(OASysQuot sysoaquot:quots){ + // 批量更新报价单-OA审批状态,备注 + quotService.updateQuotOAApprovalStatus(sysoaquot.getQuotId(),sysoaquot.getState(),sysoaquot.getRemark()); + } + redisCache.deleteObject("OAQuotTask"); + }catch (Exception e) { + throw new Exception(e.getMessage(), e); + } + } + } +} diff --git a/ruoyi-quartz/src/main/resources/mapper/quartz/OAQuotMapper.xml b/ruoyi-quartz/src/main/resources/mapper/quartz/OAQuotMapper.xml new file mode 100644 index 0000000..f799886 --- /dev/null +++ b/ruoyi-quartz/src/main/resources/mapper/quartz/OAQuotMapper.xml @@ -0,0 +1,23 @@ + + + + + + + update quot set quot_oa_approval_status = #{state},quot_oa_approval_remark = #{remark} + where quot_id = #{quotId} + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/Quot.java b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/Quot.java index 6f95fe7..04b6f73 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/Quot.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/Quot.java @@ -151,6 +151,7 @@ public class Quot extends BaseEntity private String quotJswApprovalStatus; /** OA **/ private String quotOAApprovalStatus; + private String quotOAApprovalStatusRemark; /** 报价单-产品信息 */ private List quotMaterialList; @@ -427,4 +428,7 @@ public class Quot extends BaseEntity public String getQuotOAApprovalStatus() { return quotOAApprovalStatus; } public void setQuotOAApprovalStatus(String quotOAApprovalStatus) { this.quotOAApprovalStatus = quotOAApprovalStatus; } + public String getQuotOAApprovalStatusRemark() { return quotOAApprovalStatusRemark; } + + public void setQuotOAApprovalStatusRemark(String quotOAApprovalStatusRemark) { this.quotOAApprovalStatusRemark = quotOAApprovalStatusRemark; } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/SysOaQuot.java b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/SysOaQuot.java index 665b4fe..48513c0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/SysOaQuot.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/SysOaQuot.java @@ -61,6 +61,12 @@ public class SysOaQuot extends BaseEntity /** 整单料价价差率 */ private String quotMatpriceDiff; + /** OA审批状态 */ + private String state; + + /** OA审批备注 */ + private String remark; + /** 明细 */ List materials; @@ -184,6 +190,16 @@ public class SysOaQuot extends BaseEntity this.quotMatpriceDiff = quotMatpriceDiff; } + public String getState() { return state; } + + public void setState(String state) { this.state = state; } + + @Override + public String getRemark() { return remark; } + + @Override + public void setRemark(String remark) { this.remark = remark; } + public List getMaterials() { return materials; } diff --git a/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml b/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml index 77cfdb3..096d06d 100644 --- a/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml @@ -64,6 +64,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -121,7 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" h.quot_hj_code,h.quot_hj_pricing_date, h.quot_hj_remark, - a.quot_jsw_approval_status,a.quot_oa_approval_status + a.quot_jsw_approval_status,a.quot_oa_approval_status,a.quot_oa_approval_remark from quot a @@ -165,7 +167,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" h.quot_hj_code,h.quot_hj_pricing_date, h.quot_hj_remark, - a.quot_jsw_approval_status,a.quot_oa_approval_status, + a.quot_jsw_approval_status,a.quot_oa_approval_status,a.quot_oa_approval_remark, b.mat_id as sub_mat_id, b.mat_xingh as sub_mat_xingh, b.mat_guig as sub_mat_guig, b.mat_diany as sub_mat_diany, b.mat_standard as sub_mat_standard, b.mat_danw as sub_mat_danw, b.mat_sl as sub_mat_sl, @@ -316,6 +318,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" quot_lv_price, quot_tong_price, quot_matprice_diff, + create_time, #{userId}, @@ -333,6 +336,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{quotLvPrice}, #{quotTongPrice}, #{quotMatpriceDiff}, + #{createTime}, diff --git a/ruoyi-ui/src/views/quot/quot/index.vue b/ruoyi-ui/src/views/quot/quot/index.vue index b39dd21..6c5ffc9 100644 --- a/ruoyi-ui/src/views/quot/quot/index.vue +++ b/ruoyi-ui/src/views/quot/quot/index.vue @@ -343,6 +343,13 @@ + + + + + + + 反馈附件