代码更新

This commit is contained in:
2022-10-24 18:34:58 +08:00
parent 1c1f525000
commit 837a8a665f
2 changed files with 15 additions and 3 deletions

View File

@@ -162,6 +162,14 @@ public class WastecchangeServiceImpl implements WastecchangeService {
for (int i = 0; i < rf_arr.size(); i++) {
JSONObject json_rf_type = rf_arr.getJSONObject(i);
// 校验修正值必须为 -0.5 ~ 0.5 之间 或者为 99
double value = json_rf_type.getDoubleValue("value");
if (value != 99) {
if (!(-0.5 <= value && value <= 0.5)) {
throw new BadRequestException("修正值必须为-0.5~0.5的小时若无此软废修正值填为99");
}
}
HashMap<String, String> map = new HashMap<>();
map.put("flag", "2");
map.put("material_id", whereJson.getString("material_id"));
@@ -194,7 +202,12 @@ public class WastecchangeServiceImpl implements WastecchangeService {
JSONObject jsonExt_rf = extTab.query("material_id = '" + json.getString("material_id") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonExt_rf))
throw new BadRequestException("软废扩展属性不存在" + jsonExt_rf.getString("material_code"));
jsonExt_rf.put("c_balance", rf_c_balance);
if (value == 99) {
jsonExt_rf.put("c_balance", -1);
} else {
jsonExt_rf.put("c_balance", rf_c_balance);
}
extTab.update(jsonExt_rf);
}
}

View File

@@ -213,7 +213,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="碳平衡" prop="c_balance">
<el-input-number :precision="3" :step="0.001" :max="100" v-model="formData.c_balance" :controls="false" placeholder="%" style="width: 200px;"/>
<el-input-number :precision="3" :step="0.001" :min="-1000" :max="100" v-model="formData.c_balance" :controls="false" placeholder="%" style="width: 200px;"/>
<el-button type="success" icon="el-icon-refresh" v-if="is_sync" :loading="sync_flg" @click="sync">同步</el-button>
</el-form-item>
</el-col>
@@ -377,7 +377,6 @@ export default {
],
c_balance: [
{ required: true, message: '不能为空', trigger: 'blur' },
{ validator: numberOne }
],
ball_speed: [
{ required: true, message: '不能为空', trigger: 'blur' },