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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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