feat():测试问题修复以及代码优化调整;

master
jiyufei 3 months ago
parent eb68453c50
commit b0a6ff4d37

@ -595,12 +595,13 @@ public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTable
entity.setMerchantName(merchantName);
entity.setContractNumber(contract.getContractNumber());
//同一个合同只能创建一条
LambdaQueryWrapper<BillTableEntity> wrapper = new LambdaQueryWrapper<>(BillTableEntity.class)
.eq(BillTableEntity::getContractId, billTableForm.getContractId());
if (ObjectUtil.isNotNull(this.getOne(wrapper))) {
return "已存在相同合同数据!";
}
if (isSave) {
//同一个合同只能创建一条
LambdaQueryWrapper<BillTableEntity> wrapper = new LambdaQueryWrapper<>(BillTableEntity.class).eq(BillTableEntity::getContractId, billTableForm.getContractId());
if (ObjectUtil.isNotNull(this.getOne(wrapper))) {
return "已存在相同合同数据!";
}
//获取当前年月日
String currentDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
entity.setBillNumbe("ZD" + currentDate + RandomUtil.uuId().substring(0, 3));
@ -684,7 +685,7 @@ public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTable
if (result) {
return "success";
}
return "fail";
return "操作失败";
}
@Override

@ -139,12 +139,11 @@ public class BillTableController {
}
BillTableEntity entity = billTableService.getInfo(id);
if (entity != null) {
try {
billTableService.saveOrUpdate(billTableForm, id, false);
} catch (Exception e) {
return ActionResult.fail("修改数据失败");
String result = billTableService.saveOrUpdate(billTableForm, id, false);
if (result.contains("success")) {
return ActionResult.success("创建成功");
}
return ActionResult.success("更新成功");
return ActionResult.fail(result);
} else {
return ActionResult.fail("更新失败,数据不存在");
}
@ -235,7 +234,7 @@ public class BillTableController {
@Operation(summary = "结算录入")
public ActionResult entry(@PathVariable("id") String id, @RequestBody @Valid BillTableForm billTableForm) {
String result = billTableService.entry(id, billTableForm);
if (result.contains("成功")){
if (result.contains("成功")) {
return ActionResult.success(result);
}
return ActionResult.fail(result);

@ -439,4 +439,10 @@ public class ContractController {
return ActionResult.success(vo);
}
@Operation(summary = "根据合同id查询绑定商户")
@GetMapping("/getMerchantById/{id}")
public ActionResult getMerchantById(@PathVariable String id) {
return ActionResult.success(contractService.getInfo(id));
}
}

@ -61,8 +61,8 @@
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="商户名称" prop="merchantId">
<JnpfInput v-model="dataForm.merchantId" @change="changeData('merchantId', -1)"
placeholder="根据合同自动带入" disabled clearable :style='{ "width": "100%" }'>
<JnpfInput v-model="dataForm.merchantName" @change="changeData('merchantId', -1)"
placeholder="选择合同自动生成" disabled clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
@ -749,6 +749,14 @@ export default {
this.$emit('refreshDataList', true)
},
changeData(model, index) {
if (model == 'contractId' && (this.dataForm.contractId != null || this.dataForm.contractId != undefined)) {
request({
url: '/api/example/Contract/getMerchantById/' + this.dataForm.contractId,
method: 'get'
}).then(res => {
this.$set(this.dataForm, 'merchantId', res.data.merchantName);
});
}
this.isEdit = false
this.childIndex = index
let modelAll = model.split("-");

@ -76,7 +76,7 @@
</el-table-column>
<el-table-column prop="contractId" label="合同名称" align="center"width="200"fixed="left" >
</el-table-column>
<el-table-column prop="merchantId" label="商户名称" align="center"width="200"fixed="left" >
<el-table-column prop="merchantName" label="商户名称" align="center"width="200"fixed="left" >
</el-table-column>
<el-table-column label="账单状态" prop="billStatus" align="center"width="150">
<template slot-scope="scope">

Loading…
Cancel
Save