feat():合同管理空间问题提交;

master
jiyufei 3 months ago
parent 25e6635588
commit 1e707e01db

@ -1,5 +1,8 @@
package jnpf.service;
import jnpf.model.contract.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.entity.ContractEntity;
import jnpf.entity.SpacecontractEntity;
@ -14,7 +17,7 @@ import java.util.List;
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-16
* 2024-07-19
*/
public interface ContractService extends IService<ContractEntity> {
List<ContractEntity> getList(ContractPagination contractPagination);

@ -407,16 +407,17 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEnt
@Override
public boolean update(String id, ContractEntity entity) {
return this.updateById(entity);
boolean result = this.updateById(entity);
if (result) {
CompletableFuture.runAsync(() -> spacecontractService.delData(entity.getContractNumber()));
}
return result;
}
@Override
public void delete(ContractEntity entity) {
if (entity != null) {
boolean result = this.removeById(entity.getId());
if (result) {
CompletableFuture.runAsync(() -> spacecontractService.delData(entity.getContractNumber()));
}
this.removeById(entity.getId());
}
}
@ -486,6 +487,11 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEnt
if (StringUtil.isEmpty(form.getContactsPhone())) {
return "联系电话不能为空";
}
if (StringUtil.isNotEmpty(form.getContactsPhone())) {
if (!Pattern.compile("^1[3456789]\\d{9}$|^0\\d{2,3}-?\\d{7,8}$").matcher(String.valueOf(form.getContactsPhone())).matches()) {
return "请输入正确的联系方式";
}
}
//子表字段验证
if (form.getSpacecontractList() != null) {
for (SpacecontractModel t : form.getSpacecontractList()) {
@ -547,13 +553,13 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEnt
Map<String, ParkEntity> map = list.stream().collect(Collectors.toMap(ParkEntity::getId, Function.identity()));
List<SpacecontractEntity> tableField130 = JsonUtil.getJsonToList(contractForm.getSpacecontractList(), SpacecontractEntity.class);
int i = 1;
for (SpacecontractEntity entitys : tableField130) {
if (entitys.getSpaceId().contains(",")) {
String spaceId;
spaceId = entitys.getSpaceId().substring(1, entitys.getSpaceId().length() - 1).replaceAll("\"", "");
String[] numbers = spaceId.split(",");
entitys.setSpaceId(numbers[numbers.length - 1].trim());
//假如选择了相同的空间 后端直接去重
List<SpacecontractEntity> list1 = tableField130.stream().collect(Collectors.toMap(SpacecontractEntity::getSpaceId, obj -> obj, (o1, o2) -> o1)).values().stream().collect(Collectors.toList());
for (SpacecontractEntity entitys : list1) {
if (StringUtils.isBlank(entitys.getSpaceId())) {
continue;
}
entitys.setContractName(contractForm.getContractName());
entitys.setId(RandomUtil.uuId());
entitys.setContractNumber(entity.getContractNumber());
entitys.setContractLineNumber(String.valueOf(i));

@ -98,7 +98,6 @@ public class ContractController {
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
@ -119,7 +118,6 @@ public class ContractController {
}
return ActionResult.success("创建成功");
}
/**
* Excel
*
@ -299,10 +297,8 @@ public class ContractController {
}
return vo;
}
/**
*
*
* @param id
* @param contractForm
* @return
@ -330,10 +326,8 @@ public class ContractController {
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
*
* @param id
* @return
*/
@ -349,11 +343,9 @@ public class ContractController {
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
*
* @param id
* @return
*/
@ -373,11 +365,9 @@ public class ContractController {
contractMap = generaterSwapUtil.swapDataDetail(contractMap, ContractConstant.getFormData(), "582839350958489605", false);
return ActionResult.success(contractMap);
}
/**
* ()
* 使-
*
* @param id
* @return
*/

@ -15,114 +15,70 @@ import java.util.List;
*/
@Data
public class ContractForm {
/**
*
*/
/** 主键 */
private String id;
/**
*
**/
/** 子表数据 **/
@JsonProperty("spacecontractList")
private List<SpacecontractModel> spacecontractList;
/**
*
**/
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/**
*
**/
/** 合同编号 **/
@JsonProperty("contractNumber")
private String contractNumber;
/**
*
**/
/** 合同名称 **/
@JsonProperty("contractName")
private String contractName;
/**
*
**/
/** 计价方式 **/
@JsonProperty("pricingMethod")
private Object pricingMethod;
/**
*
**/
/** 签订日期 **/
@JsonProperty("signingDate")
private String signingDate;
/**
*
**/
/** 园区名称 **/
@JsonProperty("parkId")
private Object parkId;
/**
*
**/
/** 商户名称 **/
@JsonProperty("merchantId")
private Object merchantId;
/**
*
**/
/** 租金总价 **/
@JsonProperty("totalRentalPrice")
private String totalRentalPrice;
/**
*
**/
/** 押金总计 **/
@JsonProperty("totalDeposit")
private String totalDeposit;
/**
*
**/
/** 支付方式 **/
@JsonProperty("payDeposit")
private Object payDeposit;
/**
* 退
**/
/** 退还方式 **/
@JsonProperty("returnDeposit")
private Object returnDeposit;
/**
*
**/
/** 开始时间 **/
@JsonProperty("startTime")
private String startTime;
/**
*
**/
/** 结束时间 **/
@JsonProperty("endTime")
private String endTime;
/**
*
**/
/** 租期 **/
@JsonProperty("leaseTerm")
private String leaseTerm;
/**
*
**/
/** 联系人 **/
@JsonProperty("contacts")
private String contacts;
/**
*
**/
/** 联系电话 **/
@JsonProperty("contactsPhone")
private String contactsPhone;
/**
*
**/
/** 合同状态 **/
@JsonProperty("contractStatus")
private Object contractStatus;
/**
*
**/
/** 创建时间 **/
@JsonProperty("creationTime")
private String creationTime;
/**
*
**/
/** 合同说明 **/
@JsonProperty("contractExplain")
private String contractExplain;
/**
*
**/
/** 合同附件 **/
@JsonProperty("contractEnclosure")
private Object contractEnclosure;
}

@ -23,8 +23,7 @@ public class SpacecontractModel {
private String contractLineNumber;
/** 空间名称 **/
@JSONField(name = "spaceId")
private Object spaceId;
private String spaceId;
/** 空间面积 **/
@JSONField(name = "spaceArea")
private String spaceArea;

@ -3,7 +3,8 @@
<div class="JNPF-preview-main">
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
<div class="JNPF-common-page-header">
<el-page-header @back="goBack" content="详情" />
<el-page-header @back="goBack"
content="详情"/>
<div class="options">
<el-button @click="goBack"> </el-button>
</div>
@ -12,94 +13,113 @@
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="8" >
<jnpf-form-tip-item label="合同编号" prop="contractNumber">
<jnpf-form-tip-item label="合同编号"
prop="contractNumber" >
<p>{{dataForm.contractNumber}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="合同名称" prop="contractName">
<jnpf-form-tip-item label="合同名称"
prop="contractName" >
<p>{{dataForm.contractName}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="计价方式" prop="pricingMethod">
<jnpf-form-tip-item label="计价方式"
prop="pricingMethod" >
<p>{{ dataForm.pricingMethod }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="签订日期" prop="signingDate">
<jnpf-form-tip-item label="签订日期"
prop="signingDate" >
<p>{{dataForm.signingDate}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="园区名称" prop="parkName">
<p>{{ dataForm.parkName }}</p>
<jnpf-form-tip-item label="园区名称"
prop="parkId" >
<p>{{dataForm.parkId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="商户名称" prop="merchantId">
<jnpf-form-tip-item label="商户名称"
prop="merchantId" >
<p>{{dataForm.merchantId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="租金总价" prop="totalRentalPrice">
<jnpf-form-tip-item label="租金总价"
prop="totalRentalPrice" >
<p>{{dataForm.totalRentalPrice}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="押金总计" prop="totalDeposit">
<jnpf-form-tip-item label="押金总计"
prop="totalDeposit" >
<p>{{dataForm.totalDeposit}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="支付方式" prop="payDeposit">
<jnpf-form-tip-item label="支付方式"
prop="payDeposit" >
<p>{{ dataForm.payDeposit }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="退还方式" prop="returnDeposit">
<jnpf-form-tip-item label="退还方式"
prop="returnDeposit" >
<p>{{ dataForm.returnDeposit }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="开始时间" prop="startTime">
<jnpf-form-tip-item label="开始时间"
prop="startTime" >
<p>{{dataForm.startTime}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="结束时间" prop="endTime">
<jnpf-form-tip-item label="结束时间"
prop="endTime" >
<p>{{dataForm.endTime}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="租期" prop="leaseTerm">
<jnpf-form-tip-item label="租期"
prop="leaseTerm" >
<p>{{dataForm.leaseTerm}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="联系人" prop="contacts">
<jnpf-form-tip-item label="联系人"
prop="contacts" >
<p>{{dataForm.contacts}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="联系电话" prop="contactsPhone">
<jnpf-form-tip-item label="联系电话"
prop="contactsPhone" >
<p>{{dataForm.contactsPhone}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="合同状态" prop="contractStatus">
<jnpf-form-tip-item label="合同状态"
prop="contractStatus" >
<p>{{ dataForm.contractStatus }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="合同说明" prop="contractExplain">
<jnpf-form-tip-item label="合同说明"
prop="contractExplain" >
<p>{{dataForm.contractExplain}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="合同附件" prop="contractEnclosure">
<JnpfUploadFile v-model="dataForm.contractEnclosure" disabled detailed :fileSize="10"
sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0" buttonText="点击上传">
<jnpf-form-tip-item label="合同附件"
prop="contractEnclosure" >
<JnpfUploadFile v-model="dataForm.contractEnclosure"
disabled
detailed :fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0" buttonText="点击上传" >
</JnpfUploadFile>
</jnpf-form-tip-item>
</el-col>
@ -197,7 +217,6 @@ export default {
contractStatusOptions:[{"fullName":"待确认","id":"10"},{"fullName":"已确认","id":"20"},{"fullName":"已结案","id":"30"},{"fullName":"合同变更","id":"21"}],
contractStatusProps:{"label":"fullName","value":"id" },
spaceIdProps: { "label": "name", "value": "id", "children": "children" },
}
},
computed: {},

@ -74,10 +74,10 @@
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="商户名称" prop="merchantName">
<JnpfSelect v-model="dataForm.merchantName" @change="changeData('merchantName', -1)"
<jnpf-form-tip-item label="商户名称" prop="merchantId">
<JnpfSelect v-model="dataForm.merchantId" @change="changeData('merchantId', -1)"
placeholder="请选择" clearable :style='{ "width": "100%" }' filterable
:options="merchantNameOptions" :props="merchantNameProps">
:options="merchantIdOptions" :props="merchantIdProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
@ -201,19 +201,19 @@
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="空间名称" prop="spaceName">
<el-table-column label="空间名称" prop="spaceId">
<template slot="header" v-if="false">
<span class="required-sign">*</span>空间名称
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.spaceName"
@change="changeData('spacecontract-spaceName', scope.$index)"
<JnpfPopupSelect v-model="scope.row.spaceId"
@change="changeData('spacecontract-spaceId', scope.$index)"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.spacecontractspaceName" placeholder="请选择"
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='name' :field="'spaceName' + scope.$index"
interfaceId="582491427901014533" :pageSize="20"
:columnOptions="spacecontractspaceNamecolumnOptions" clearable
:templateJson="interfaceRes.spacecontractspaceId" placeholder="请选择空间"
hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='name' :field="'spaceId' + scope.$index"
interfaceId="584015452494104389" :pageSize="20"
:columnOptions="spacecontractspaceIdcolumnOptions" clearable
:style='{ "width": "100%" }'>
</JnpfPopupSelect>
</template>
@ -225,7 +225,7 @@
<template slot-scope="scope">
<JnpfInput v-model="scope.row.spaceArea"
@change="changeData('spacecontract-spaceArea', scope.$index)"
placeholder="请输入空间面积" disabled clearable :style='{ "width": "100%" }'>
placeholder="选择空间自动生成" disabled clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
@ -303,8 +303,8 @@ export default {
spacecontractList: {
contractLineNumber: '',
contractLineNumberOptions: [],
spaceName: '',
spaceNameOptions: [],
spaceId: '',
spaceIdOptions: [],
spaceArea: '',
spaceAreaOptions: [],
totalRentalPrice: '',
@ -320,7 +320,7 @@ export default {
pricingMethod: undefined,
signingDate: undefined,
parkId: undefined,
merchantName: undefined,
merchantId: undefined,
totalRentalPrice: undefined,
totalDeposit: undefined,
payDeposit: undefined,
@ -368,7 +368,7 @@ export default {
trigger: 'change'
},
],
merchantName: [
merchantId: [
{
required: true,
message: '请选择',
@ -416,7 +416,7 @@ export default {
startTime: [
{
required: true,
message: '请选择',
message: '请选择开始时间',
trigger: 'change'
},
],
@ -467,16 +467,16 @@ export default {
pricingMethodOptions: [{ "fullName": "月付", "id": "1" }, { "fullName": "季付", "id": "2" }, { "fullName": "年付", "id": "3" }],
pricingMethodProps: { "label": "fullName", "value": "id" },
parkIdOptions: [],
parkIdProps: { "label": "name", "value": "id" },
merchantNameOptions: [],
merchantNameProps: { "label": "cmp_nm", "value": "id" },
parkIdProps: { "label": "name", "value": "code" },
merchantIdOptions: [],
merchantIdProps: { "label": "cmp_nm", "value": "id" },
payDepositOptions: [{ "fullName": "选项1", "id": "1" }, { "fullName": "选项2", "id": "2" }],
payDepositProps: { "label": "fullName", "value": "id" },
returnDepositOptions: [{ "fullName": "选项一", "id": "1" }, { "fullName": "选项二", "id": "2" }],
returnDepositProps: { "label": "fullName", "value": "id" },
contractStatusOptions: [{ "fullName": "待确认", "id": "10" }, { "fullName": "已确认", "id": "20" }, { "fullName": "已结案", "id": "30" }, { "fullName": "待确认", "id": "21" }],
contractStatusOptions: [{ "fullName": "待确认", "id": "10" }, { "fullName": "已确认", "id": "20" }, { "fullName": "已结案", "id": "30" }, { "fullName": "合同变更", "id": "21" }],
contractStatusProps: { "label": "fullName", "value": "id" },
spacecontractspaceNamecolumnOptions: [{ "label": "空间编码", "value": "code" }, { "label": "空间名称", "value": "name" },],
spacecontractspaceIdcolumnOptions: [{ "label": "空间名称", "value": "name" }, { "label": "园区名称", "value": "park_name" }, { "label": "区域名称", "value": "area_name" },],
childIndex: -1,
isEdit: false,
interfaceRes: {
@ -485,7 +485,7 @@ export default {
pricingMethod: [],
signingDate: [],
parkId: [],
merchantName: [],
merchantId: [],
totalRentalPrice: [],
totalDeposit: [],
payDeposit: [],
@ -500,7 +500,7 @@ export default {
contractExplain: [],
contractEnclosure: [],
spacecontractcontractLineNumber: [],
spacecontractspaceName: [],
spacecontractspaceId: [],
spacecontractspaceArea: [],
spacecontracttotalRentalPrice: [],
},
@ -625,7 +625,7 @@ export default {
},
dataAll() {
this.getparkIdOptions();
this.getmerchantNameOptions();
this.getmerchantIdOptions();
},
spacecontractExist() {
let isOk = true;
@ -674,9 +674,9 @@ export default {
this.changeDataFormData(1, 'parkId', 'parkId', index, '')
})
},
getmerchantNameOptions() {
getmerchantIdOptions() {
const index = this.childIndex
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.merchantName))
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.merchantId))
for (let i = 0; i < templateJsonList.length; i++) {
let json = templateJsonList[i];
if (json.relationField) {
@ -695,8 +695,8 @@ export default {
}
getDataInterfaceRes('582842667524685829', template).then(res => {
let data = res.data
this.merchantNameOptions = data
this.changeDataFormData(1, 'merchantName', 'merchantName', index, '')
this.merchantIdOptions = data
this.changeDataFormData(1, 'merchantId', 'merchantId', index, '')
})
},
goBack() {
@ -815,7 +815,7 @@ export default {
addspacecontractList() {
let item = {
contractLineNumber: undefined,
spaceName: '',
spaceId: '',
spaceArea: undefined,
totalRentalPrice: undefined,
}

@ -96,7 +96,7 @@
{{ scope.row.contractStatus }}
</template>
</el-table-column>
<el-table-column prop="parkName" label="园区名称" align="left">
<el-table-column prop="parkId" label="园区名称" align="left">
</el-table-column>
<el-table-column prop="merchantName" label="商户名称" align="left">
</el-table-column>
@ -262,9 +262,9 @@ export default {
returnDepositProps: { "label": "fullName", "value": "id" },
contractStatusOptions: [{ "fullName": "待确认", "id": "10" }, { "fullName": "已确认", "id": "20" }, { "fullName": "已结案", "id": "30" }, { "fullName": "合同变更", "id": "21" }],
contractStatusProps: { "label": "fullName", "value": "id" },
tableField130_spaceIdOptions: [],
tableField130_spaceIdProps: { "label": "name", "value": "id", "children": "children" },
tableField130_spaceIdcolumnOptions: [{ "label": "空间名称", "value": "name" }, { "label": "园区名称", "value": "park_name" }, { "label": "区域名称", "value": "area_name" },],
interfaceRes: {
tableField130_spaceId: [],
},
}
},

Loading…
Cancel
Save