This commit is contained in:
xd 2024-06-05 17:26:59 +08:00
parent fcedf22c8d
commit 84ade83cb6
11 changed files with 257 additions and 3 deletions

View File

@ -473,7 +473,7 @@ public class QuotController extends BaseController
sysOaQuot.setUserId(oauser.getUserId()); sysOaQuot.setUserId(oauser.getUserId());
sysOaQuot.setDepartmentId(oauser.getUserId()); sysOaQuot.setDepartmentId(oauser.getUserId());
sysOaQuot.setDepartmentId(oauser.getDepartmentId()); sysOaQuot.setDepartmentId(oauser.getDepartmentId());
sysOaQuot.setSubmissionTime(DateUtils.getTime()); sysOaQuot.setSubmissionTime(DateUtils.getDate());
sysOaQuot.setQuotId(UUID.fastUUID().toString()); sysOaQuot.setQuotId(UUID.fastUUID().toString());
sysOaQuot.setQuotCode(quot.getQuotCode()); sysOaQuot.setQuotCode(quot.getQuotCode());
sysOaQuot.setQuotSalesmanName(quot.getQuotSalesmanName()); sysOaQuot.setQuotSalesmanName(quot.getQuotSalesmanName());
@ -486,6 +486,7 @@ public class QuotController extends BaseController
sysOaQuot.setQuotLvPrice(quot.getQuotLvPrice()); sysOaQuot.setQuotLvPrice(quot.getQuotLvPrice());
sysOaQuot.setQuotTongPrice(quot.getQuotTongPrice()); sysOaQuot.setQuotTongPrice(quot.getQuotTongPrice());
sysOaQuot.setQuotMatpriceDiff(quot.getQuotMatpriceDiff()); sysOaQuot.setQuotMatpriceDiff(quot.getQuotMatpriceDiff());
sysOaQuot.setCreateTime(DateUtils.getNowDate());
sysOaQuot.setMaterials(quot.getQuotMaterialList()); sysOaQuot.setMaterials(quot.getQuotMaterialList());

View File

@ -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;
}
}

View File

@ -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<OASysQuot> selectOAQUOT();
/**
* 批量更新报价单-OA审批状态为已完成
* @param quotId
* @param state
* @param remark
*/
void updateQuotOAApprovalStatus(@Param("quotId") String quotId, @Param("state") String state, @Param("remark") String remark);
}

View File

@ -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<OASysQuot> selectOAQUOT();
/**
* 批量更新报价单-OA审批状态为已完成
* @param quotId
*/
void updateQuotOAApprovalStatus(String quotId,String state,String remark);
}

View File

@ -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<OASysQuot> selectOAQUOT() {
return aAQuotMapper.selectOAQUOT();
}
@Override
public void updateQuotOAApprovalStatus(String quotId, String state, String remark) {
aAQuotMapper.updateQuotOAApprovalStatus(quotId,state,remark);
}
}

View File

@ -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<OASysQuot> 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);
}
}
}
}

View File

@ -0,0 +1,23 @@
<?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.ruoyi.quartz.mapper.OAQuotMapper">
<select id="selectOAQUOT" resultType="OASysQuot">
select q.quot_id,sq.state,sq.remark
from quot q
inner join (
select t.quot_code,t.state,t.remark from (
select a.quot_code,a.state,a.remark, row_number() over(partition by quot_code order by create_time desc) rw
from sys_oa_quot a
where a.triggerflag = '1' and a.state in ('2','3')
) t where t.rw = 1
) sq on q.quot_code = sq.quot_code
where q.quot_oa_approval_status = '2'
</select>
<update id="updateQuotOAApprovalStatus">
update quot set quot_oa_approval_status = #{state},quot_oa_approval_remark = #{remark}
where quot_id = #{quotId}
</update>
</mapper>

View File

@ -151,6 +151,7 @@ public class Quot extends BaseEntity
private String quotJswApprovalStatus; private String quotJswApprovalStatus;
/** OA **/ /** OA **/
private String quotOAApprovalStatus; private String quotOAApprovalStatus;
private String quotOAApprovalStatusRemark;
/** 报价单-产品信息 */ /** 报价单-产品信息 */
private List<QuotMaterial> quotMaterialList; private List<QuotMaterial> quotMaterialList;
@ -427,4 +428,7 @@ public class Quot extends BaseEntity
public String getQuotOAApprovalStatus() { return quotOAApprovalStatus; } public String getQuotOAApprovalStatus() { return quotOAApprovalStatus; }
public void setQuotOAApprovalStatus(String quotOAApprovalStatus) { this.quotOAApprovalStatus = quotOAApprovalStatus; } public void setQuotOAApprovalStatus(String quotOAApprovalStatus) { this.quotOAApprovalStatus = quotOAApprovalStatus; }
public String getQuotOAApprovalStatusRemark() { return quotOAApprovalStatusRemark; }
public void setQuotOAApprovalStatusRemark(String quotOAApprovalStatusRemark) { this.quotOAApprovalStatusRemark = quotOAApprovalStatusRemark; }
} }

View File

@ -61,6 +61,12 @@ public class SysOaQuot extends BaseEntity
/** 整单料价价差率 */ /** 整单料价价差率 */
private String quotMatpriceDiff; private String quotMatpriceDiff;
/** OA审批状态 */
private String state;
/** OA审批备注 */
private String remark;
/** 明细 */ /** 明细 */
List<QuotMaterial> materials; List<QuotMaterial> materials;
@ -184,6 +190,16 @@ public class SysOaQuot extends BaseEntity
this.quotMatpriceDiff = quotMatpriceDiff; 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<QuotMaterial> getMaterials() { public List<QuotMaterial> getMaterials() {
return materials; return materials;
} }

View File

@ -64,6 +64,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="quotJswApprovalStatus" column="quot_jsw_approval_status" /> <result property="quotJswApprovalStatus" column="quot_jsw_approval_status" />
<result property="quotOAApprovalStatus" column="quot_oa_approval_status" /> <result property="quotOAApprovalStatus" column="quot_oa_approval_status" />
<result property="quotOAApprovalStatusRemark" column="quot_oa_approval_remark" />
</resultMap> </resultMap>
<resultMap id="QuotQuotMaterialResult" type="Quot" extends="QuotResult"> <resultMap id="QuotQuotMaterialResult" type="Quot" extends="QuotResult">
@ -121,7 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
h.quot_hj_code,h.quot_hj_pricing_date, h.quot_hj_code,h.quot_hj_pricing_date,
h.quot_hj_remark, 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 from quot a
<include refid="quotJoins"/> <include refid="quotJoins"/>
@ -165,7 +167,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
h.quot_hj_code,h.quot_hj_pricing_date, h.quot_hj_code,h.quot_hj_pricing_date,
h.quot_hj_remark, 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_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, 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"
<if test="quotLvPrice != null">quot_lv_price,</if> <if test="quotLvPrice != null">quot_lv_price,</if>
<if test="quotTongPrice != null">quot_tong_price,</if> <if test="quotTongPrice != null">quot_tong_price,</if>
<if test="quotMatpriceDiff != null">quot_matprice_diff,</if> <if test="quotMatpriceDiff != null">quot_matprice_diff,</if>
<if test="createTime != null">create_time,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null and userId != ''">#{userId},</if> <if test="userId != null and userId != ''">#{userId},</if>
@ -333,6 +336,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="quotLvPrice != null">#{quotLvPrice},</if> <if test="quotLvPrice != null">#{quotLvPrice},</if>
<if test="quotTongPrice != null">#{quotTongPrice},</if> <if test="quotTongPrice != null">#{quotTongPrice},</if>
<if test="quotMatpriceDiff != null">#{quotMatpriceDiff},</if> <if test="quotMatpriceDiff != null">#{quotMatpriceDiff},</if>
<if test="createTime != null">#{createTime},</if>
</trim> </trim>
</insert> </insert>

View File

@ -343,6 +343,13 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="8" v-if="this.form.quotOAApprovalStatus == '2' || this.form.quotOAApprovalStatus == '3'">
<el-col :span="24">
<el-form-item label="OA审批说明" prop="quotOAApprovalStatusRemark">
<el-input type="textarea" autosize v-model="form.quotOAApprovalStatusRemark" :disabled="true"/>
</el-form-item>
</el-col>
</el-row>
<el-divider content-position="left" class="customer_divider_text">反馈附件</el-divider> <el-divider content-position="left" class="customer_divider_text">反馈附件</el-divider>
<div v-hasPermi="['quot:quot:quotFkFile']" > <div v-hasPermi="['quot:quot:quotFkFile']" >
<el-upload class="upload-demo" <el-upload class="upload-demo"
@ -1100,6 +1107,7 @@ export default {
quotQuotationDate: null, quotQuotationDate: null,
quotQuotationRequire: null, quotQuotationRequire: null,
quotFeedbackExplanation: null, quotFeedbackExplanation: null,
quotOAApprovalStatusRemark: null,
quotApprovalStatus: null, quotApprovalStatus: null,
quotJsxzApprovalStatus: null, quotJsxzApprovalStatus: null,