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.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;
@ -87,16 +92,19 @@ public class QuoteController extends BaseController {
} }
/** /**
* @title queryRedBookVersion * @title queryRedBookInfo
* @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("/redBookVer") @PostMapping("/redBookInfo")
public AjaxResult queryRedBookVersion() { public AjaxResult queryRedBookInfo() throws ParseException {
return success(quoteService.queryRedBookVer()); 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 org.apache.ibatis.annotations.Select;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @ClassName QuoteMapper * @ClassName QuoteMapper
@ -24,7 +25,7 @@ public interface QuoteMapper {
List<CalculateRBParamDto> queryRedBPriceByParams(@Param("params") List<CalculateRBParamDto> params); List<CalculateRBParamDto> queryRedBPriceByParams(@Param("params") List<CalculateRBParamDto> params);
String queryRedBookVer(); Map<String, String> queryRedBookInfo();
String queryRedBookLocalVer(); String queryRedBookLocalVer();
} }

View File

@ -4,6 +4,7 @@ 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
@ -19,7 +20,7 @@ public interface QuoteService {
List<CalculateRBParamDto> queryRedBPriceByParams(List<CalculateRBParamDto> params); List<CalculateRBParamDto> queryRedBPriceByParams(List<CalculateRBParamDto> params);
String queryRedBookVer(); Map<String, String> queryRedBookInfo();
String queryRedBookLocalVer(); String queryRedBookLocalVer();
} }

View File

@ -8,6 +8,7 @@ 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
@ -65,15 +66,15 @@ public class QuoteServiceImpl implements QuoteService {
/** /**
* @title queryRedBookVer * @title queryRedBookInfo
* @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 String queryRedBookVer() { public Map<String, String> queryRedBookInfo() {
return quoteMapper.queryRedBookVer(); return quoteMapper.queryRedBookInfo();
} }
/** /**

View File

@ -103,10 +103,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND a.电压等级 = v.电压等级; AND a.电压等级 = v.电压等级;
</select> </select>
<select id="queryRedBookVer" resultType="String"> <select id="queryRedBookInfo" resultType="Map">
SELECT MAX([uid_0]) AS redBookVer 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] FROM [RedBook].[dbo].[rb_productVersion] t
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 queryRedBookVer () { export function queryRedBookInfo () {
return request({ return request({
url: '/quote/redBookVer', url: '/quote/redBookInfo',
method: 'post', method: 'post',
}) })
} }
@ -37,3 +37,5 @@ 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-input :disabled="true" v-model="totalForm.currAdjDate" placeholder="当前调价日期"> <el-date-picker style="width: 175px" v-model="totalForm.currAdjDate" :disabled="disabledDatePicker" type="date" placeholder="请选择日期">
</el-input> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6" > <el-col :span="6" >
@ -285,24 +285,11 @@
</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.totalActualAmount" placeholder="当前铝价"> <el-input :disabled="true" v-model="totalForm.currAlumPrice" 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>
@ -587,7 +574,7 @@
</template> </template>
<script> <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"; import {getMaterial} from "@/api/material/material";
const commonRule = [ const commonRule = [
{ required: true, message: '不能为空值可填0', trigger: 'blur' }, { required: true, message: '不能为空值可填0', trigger: 'blur' },
@ -631,8 +618,12 @@ 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,
@ -686,7 +677,7 @@ export default {
}, },
created() { created() {
this.getRedBookVersion(); this.getRedBookInfo();
this.calculateTotal(); this.calculateTotal();
}, },
@ -697,11 +688,13 @@ export default {
async init () { async init () {
}, },
/**-------------获取红本版本号---------------**/ /**-------------获取红本信息,包括红本版本、铜价和铝价---------------**/
getRedBookVersion() { getRedBookInfo() {
queryRedBookVer().then(response => { queryRedBookInfo().then(response => {
redBookVer = response.msg redBookVer = response.data.uid;
console.log("redBookVer:" + redBookVer) this.totalForm.currAdjDate = response.data.currAdjDate.substring(0, 10);
this.totalForm.currCopperPrice = response.data.currCopperPrice;
this.totalForm.currAlumPrice = response.data.currAlumPrice
}); });
queryRedBookLocalVer().then(response => { queryRedBookLocalVer().then(response => {
redBookLocalVer = response.msg redBookLocalVer = response.msg