Compare commits

..

No commits in common. "446e0b2efb66d6aa3a8238be384bd9b0f447245f" and "5839e71a4f2767ff36e8067f3cfd13e8e8c53dc6" have entirely different histories.

7 changed files with 41 additions and 48 deletions

View File

@ -12,12 +12,7 @@ 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;
@ -92,19 +87,16 @@ public class QuoteController extends BaseController {
}
/**
* @title queryRedBookInfo
* @description 获取红本信息包括版本号铜价和铝价
* @title queryRedBookVersion
* @description 获取红本版本号
* @author JIAL
* @updateTime 2024/3/11 11:24
* @return: com.ruoyi.common.core.domain.AjaxResult
*/
@DataSource(DataSourceType.REDBOOK)
@PostMapping("/redBookInfo")
public AjaxResult queryRedBookInfo() throws ParseException {
logger.info("开始记录");
Map<String, String> resultMap = quoteService.queryRedBookInfo();
logger.info(resultMap.toString());
return success(resultMap);
@PostMapping("/redBookVer")
public AjaxResult queryRedBookVersion() {
return success(quoteService.queryRedBookVer());
}
/**

View File

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

View File

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

View File

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

View File

@ -103,11 +103,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND a.电压等级 = v.电压等级;
</select>
<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 id="queryRedBookVer" resultType="String">
SELECT MAX([uid_0]) AS redBookVer
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 queryRedBookInfo () {
export function queryRedBookVer () {
return request({
url: '/quote/redBookInfo',
url: '/quote/redBookVer',
method: 'post',
})
}
@ -37,5 +37,3 @@ export function queryRedBookLocalVer () {
method: 'post',
})
}

View File

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