This commit is contained in:
JIAL 2024-03-15 09:21:06 +08:00
parent fbc56c776a
commit 02d1c9cdce
7 changed files with 48 additions and 41 deletions

View File

@ -12,7 +12,12 @@ import com.ruoyi.quote.service.QuoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
import static com.ruoyi.common.utils.PageUtils.startPage;
@ -87,16 +92,19 @@ public class QuoteController extends BaseController {
}
/**
* @title queryRedBookVersion
* @description 获取红本版本号
* @title queryRedBookInfo
* @description 获取红本信息包括版本号铜价和铝价
* @author JIAL
* @updateTime 2024/3/11 11:24
* @return: com.ruoyi.common.core.domain.AjaxResult
*/
@DataSource(DataSourceType.REDBOOK)
@PostMapping("/redBookVer")
public AjaxResult queryRedBookVersion() {
return success(quoteService.queryRedBookVer());
@PostMapping("/redBookInfo")
public AjaxResult queryRedBookInfo() throws ParseException {
logger.info("开始记录");
Map<String, String> resultMap = quoteService.queryRedBookInfo();
logger.info(resultMap.toString());
return success(resultMap);
}
/**

View File

@ -7,6 +7,7 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/**
* @ClassName QuoteMapper
@ -24,7 +25,7 @@ public interface QuoteMapper {
List<CalculateRBParamDto> queryRedBPriceByParams(@Param("params") List<CalculateRBParamDto> params);
String queryRedBookVer();
Map<String, String> queryRedBookInfo();
String queryRedBookLocalVer();
}

View File

@ -4,6 +4,7 @@ import com.ruoyi.quote.domain.CalculateRBParamDto;
import com.ruoyi.quote.domain.MaterialDto;
import java.util.List;
import java.util.Map;
/**
* @ClassName QuoteService
@ -19,7 +20,7 @@ public interface QuoteService {
List<CalculateRBParamDto> queryRedBPriceByParams(List<CalculateRBParamDto> params);
String queryRedBookVer();
Map<String, String> queryRedBookInfo();
String queryRedBookLocalVer();
}

View File

@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* @ClassName QuoteServiceImpl
@ -65,15 +66,15 @@ public class QuoteServiceImpl implements QuoteService {
/**
* @title queryRedBookVer
* @description 获取红本价最新版本
* @title queryRedBookInfo
* @description 获取红本信息包括版本号铜价和铝价
* @author JIAL
* @updateTime 2024/3/11 11:13
* @return: java.lang.String
*/
@Override
public String queryRedBookVer() {
return quoteMapper.queryRedBookVer();
public Map<String, String> queryRedBookInfo() {
return quoteMapper.queryRedBookInfo();
}
/**

View File

@ -103,10 +103,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND a.电压等级 = v.电压等级;
</select>
<select id="queryRedBookVer" resultType="String">
SELECT MAX([uid_0]) AS redBookVer
FROM [RedBook].[dbo].[rb_productVersion]
WHERE [sta_0] IN ('0', '1');
<select id="queryRedBookInfo" resultType="Map">
SELECT t.uid_0 AS uid, t.date_0 AS currAdjDate, t.tong_price_0 AS currCopperPrice, t.lv_price_0 AS currAlumPrice
FROM [RedBook].[dbo].[rb_productVersion] t
WHERE [sta_0] IN ('0', '1')
AND t.uid_0 = (SELECT MAX(uid_0) FROM [RedBook].[dbo].[rb_productVersion] WHERE [sta_0] IN ('0', '1'))
</select>
<select id="queryRedBookLocalVer" resultType="String">

View File

@ -24,9 +24,9 @@ export function queryRedBPriceByParams (query) {
})
}
export function queryRedBookVer () {
export function queryRedBookInfo () {
return request({
url: '/quote/redBookVer',
url: '/quote/redBookInfo',
method: 'post',
})
}
@ -37,3 +37,5 @@ export function queryRedBookLocalVer () {
method: 'post',
})
}

View File

@ -272,8 +272,8 @@
<el-row>
<el-col :span="6">
<el-form-item label="当前调价日期" title="当前调价日期">
<el-input :disabled="true" v-model="totalForm.currAdjDate" placeholder="当前调价日期">
</el-input>
<el-date-picker style="width: 175px" v-model="totalForm.currAdjDate" :disabled="disabledDatePicker" type="date" placeholder="请选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6" >
@ -285,24 +285,11 @@
</el-col>
<el-col :span="6" >
<el-form-item label="当前铝价" title="当前铝价">
<el-input :disabled="true" v-model="totalForm.totalActualAmount" placeholder="当前铝价">
<el-input :disabled="true" v-model="totalForm.currAlumPrice" placeholder="当前铝价">
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6" >
<el-form-item title="">
<span slot="label">
合计差异
<el-tooltip :content="'总差异 = (厂价金额合计 - 成本金额合计) / 厂价金额合计'" placement="top">
<i class="el-icon-question"></i>
</el-tooltip>
</span>
<el-input :disabled="true" v-model="totalForm.totalDifferenceValue" placeholder="总差异">
<template slot="append">%</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
@ -587,7 +574,7 @@
</template>
<script>
import {queryMaterialListByParam, queryRedBCostByParams, queryRedBPriceByParams, queryRedBookVer, queryRedBookLocalVer } from "@/api/quote/quote";
import {queryMaterialListByParam, queryRedBCostByParams, queryRedBPriceByParams, queryRedBookInfo, queryRedBookLocalVer } from "@/api/quote/quote";
import {getMaterial} from "@/api/material/material";
const commonRule = [
{ required: true, message: '不能为空值可填0', trigger: 'blur' },
@ -631,8 +618,12 @@ export default {
totalFinExpenses: 0,
totalFactoryAmount: 0,
totalActualAmount: 0,
totalDifferenceValue: 0
totalDifferenceValue: 0,
currAdjDate: 0,
currCopperPrice: 0,
currAlumPrice: 0
},
disabledDatePicker: true, // ,
formRules: {
'officeExpense.value': commonRule,
'travelExpense.value': commonRule,
@ -686,7 +677,7 @@ export default {
},
created() {
this.getRedBookVersion();
this.getRedBookInfo();
this.calculateTotal();
},
@ -697,11 +688,13 @@ export default {
async init () {
},
/**-------------获取红本版本号---------------**/
getRedBookVersion() {
queryRedBookVer().then(response => {
redBookVer = response.msg
console.log("redBookVer:" + redBookVer)
/**-------------获取红本信息,包括红本版本、铜价和铝价---------------**/
getRedBookInfo() {
queryRedBookInfo().then(response => {
redBookVer = response.data.uid;
this.totalForm.currAdjDate = response.data.currAdjDate.substring(0, 10);
this.totalForm.currCopperPrice = response.data.currCopperPrice;
this.totalForm.currAlumPrice = response.data.currAlumPrice
});
queryRedBookLocalVer().then(response => {
redBookLocalVer = response.msg