feat(bill):账单生成前后端代码补充提交;

master
jiyufei 3 months ago
parent cb06375025
commit 3feac22f86

@ -2,7 +2,9 @@ package jnpf.service;
import jnpf.model.contract.*; import jnpf.model.contract.*;
import jnpf.entity.*; import jnpf.entity.*;
import java.util.*; import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.entity.ContractEntity; import jnpf.entity.ContractEntity;
import jnpf.entity.SpacecontractEntity; import jnpf.entity.SpacecontractEntity;
@ -22,7 +24,7 @@ import java.util.List;
public interface ContractService extends IService<ContractEntity> { public interface ContractService extends IService<ContractEntity> {
List<ContractEntity> getList(ContractPagination contractPagination); List<ContractEntity> getList(ContractPagination contractPagination);
List<ContractEntity> getTypeList(ContractPagination contractPagination,String dataType); List<ContractEntity> getTypeList(ContractPagination contractPagination, String dataType);
ContractEntity getInfo(String id); ContractEntity getInfo(String id);
@ -33,14 +35,14 @@ public interface ContractService extends IService<ContractEntity> {
boolean update(String id, ContractEntity entity); boolean update(String id, ContractEntity entity);
//子表方法 //子表方法
List<SpacecontractEntity> getSpacecontractList(String id,ContractPagination contractPagination); List<SpacecontractEntity> getSpacecontractList(String id, ContractPagination contractPagination);
List<SpacecontractEntity> getSpacecontractList(String id); List<SpacecontractEntity> getSpacecontractList(String id);
//副表数据方法 //副表数据方法
String checkForm(ContractForm form,int i); String checkForm(ContractForm form, int i);
void saveOrUpdate(ContractForm contractForm,String id, boolean isSave) throws Exception; void saveOrUpdate(ContractForm contractForm, String id, boolean isSave) throws Exception;
/** /**
* *
@ -73,4 +75,20 @@ public interface ContractService extends IService<ContractEntity> {
* @return code * @return code
*/ */
String findCodeById(String id); String findCodeById(String id);
/**
* id
*
* @param contractPagination
* @return list
*/
List<ContractDTO> getSpacesById(ContractPagination contractPagination);
/**
* id
*
* @param contractPagination
* @return list
*/
List<ContractDevicesDTO> getDevicesById(ContractPagination contractPagination);
} }

@ -34,4 +34,12 @@ public interface EquipmentRentalRecordsService extends IService<EquipmentRentalR
void saveOrUpdate(EquipmentRentalRecordsForm equipmentRentalRecordsForm, String id, boolean isSave) throws Exception; void saveOrUpdate(EquipmentRentalRecordsForm equipmentRentalRecordsForm, String id, boolean isSave) throws Exception;
/**
* id
*
* @param merchantId id
* @param keyword
* @return list
*/
List<EquipmentRentalRecordsEntity> findByMerchantId(String merchantId, String keyword);
} }

@ -32,4 +32,13 @@ public interface SpacecontractService extends IService<SpacecontractEntity> {
* @param contractNumber * @param contractNumber
*/ */
void delData(String contractNumber); void delData(String contractNumber);
/**
*
*
* @param contractNumber
* @param keyWord
* @return list
*/
List<SpacecontractEntity> findByNum(String contractNumber,String keyWord);
} }

@ -30,6 +30,7 @@ import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel; import jnpf.base.model.ColumnDataModel;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel; import jnpf.database.model.superQuery.SuperJsonModel;
@ -610,8 +611,6 @@ public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTable
entity.setVersion(0); entity.setVersion(0);
entity.setSubmitter(userInfo.getUserId()); entity.setSubmitter(userInfo.getUserId());
entity.setSubmissionTime(DateUtil.getNowDate()); entity.setSubmissionTime(DateUtil.getNowDate());
entity.setConfirmPersonnel(userInfo.getUserId());
entity.setConfirmTime(DateUtil.getNowDate());
} else { } else {
entity.setCreationTime(DateUtil.getNowDate()); entity.setCreationTime(DateUtil.getNowDate());
} }
@ -625,9 +624,15 @@ public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTable
} }
if (billTableForm.getBillspacedetailList() != null) { if (billTableForm.getBillspacedetailList() != null) {
List<BillspacedetailEntity> tableField140 = JsonUtil.getJsonToList(billTableForm.getBillspacedetailList(), BillspacedetailEntity.class); List<BillspacedetailEntity> tableField140 = JsonUtil.getJsonToList(billTableForm.getBillspacedetailList(), BillspacedetailEntity.class);
for (BillspacedetailEntity entitys : tableField140) { //假如选择了相同的空间 后端直接去重
List<BillspacedetailEntity> list1 = tableField140.stream()
.filter(obj -> StringUtils.isNoneBlank(obj.getSpaceId()))
.collect(Collectors.toMap(BillspacedetailEntity::getSpaceId, obj -> obj, (o1, o2) -> o1)).values().stream().collect(Collectors.toList());
for (BillspacedetailEntity entitys : list1) {
entitys.setId(RandomUtil.uuId()); entitys.setId(RandomUtil.uuId());
entitys.setBillNumber(entity.getBillNumbe()); entitys.setBillNumber(entity.getBillNumbe());
entitys.setCreateBy(userInfo.getUserId());
entitys.setCreationTime(DateUtil.getNowDate());
if (isSave) { if (isSave) {
} else { } else {
} }
@ -642,9 +647,15 @@ public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTable
} }
if (billTableForm.getBilldevicedeatialList() != null) { if (billTableForm.getBilldevicedeatialList() != null) {
List<BilldevicedeatialEntity> tableField158 = JsonUtil.getJsonToList(billTableForm.getBilldevicedeatialList(), BilldevicedeatialEntity.class); List<BilldevicedeatialEntity> tableField158 = JsonUtil.getJsonToList(billTableForm.getBilldevicedeatialList(), BilldevicedeatialEntity.class);
for (BilldevicedeatialEntity entitys : tableField158) { //假如选择了相同的空间 后端直接去重
List<BilldevicedeatialEntity> list1 = tableField158.stream()
.filter(obj -> StringUtils.isNoneBlank(obj.getEquipmentNumber()))
.collect(Collectors.toMap(BilldevicedeatialEntity::getEquipmentNumber, obj -> obj, (o1, o2) -> o1)).values().stream().collect(Collectors.toList());
for (BilldevicedeatialEntity entitys : list1) {
entitys.setId(RandomUtil.uuId()); entitys.setId(RandomUtil.uuId());
entitys.setBillNumber(entity.getBillNumbe()); entitys.setBillNumber(entity.getBillNumbe());
entitys.setCreateBy(userInfo.getUserId());
entitys.setCreationTime(DateUtil.getNowDate());
if (isSave) { if (isSave) {
} else { } else {
} }
@ -662,6 +673,8 @@ public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTable
for (BillotherdeatialEntity entitys : tableField166) { for (BillotherdeatialEntity entitys : tableField166) {
entitys.setId(RandomUtil.uuId()); entitys.setId(RandomUtil.uuId());
entitys.setBillNumber(entity.getBillNumbe()); entitys.setBillNumber(entity.getBillNumbe());
entitys.setCreateBy(userInfo.getUserId());
entitys.setCreationTime(DateUtil.getNowDate());
if (isSave) { if (isSave) {
} else { } else {
} }
@ -681,6 +694,8 @@ public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTable
entity.setBillStatus("20"); entity.setBillStatus("20");
entity.setUpdateBy(userProvider.get().getUserId()); entity.setUpdateBy(userProvider.get().getUserId());
entity.setUpdateTime(DateUtil.getNowDate()); entity.setUpdateTime(DateUtil.getNowDate());
entity.setConfirmPersonnel(userProvider.get().getUserId());
entity.setConfirmTime(DateUtil.getNowDate());
boolean result = this.updateById(entity); boolean result = this.updateById(entity);
if (result) { if (result) {
return "确认成功"; return "确认成功";
@ -695,6 +710,7 @@ public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTable
if (ObjectUtil.isNull(entity)) { if (ObjectUtil.isNull(entity)) {
return "账单不存在"; return "账单不存在";
} }
entity.setBillAttachment(billTableForm.getBillAttachment().toString());
entity.setPayStatus(billTableForm.getPayStatus().toString()); entity.setPayStatus(billTableForm.getPayStatus().toString());
entity.setUpdateBy(userProvider.get().getUserId()); entity.setUpdateBy(userProvider.get().getUserId());
entity.setUpdateTime(DateUtil.getNowDate()); entity.setUpdateTime(DateUtil.getNowDate());

@ -1,5 +1,6 @@
package jnpf.service.impl; package jnpf.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -11,16 +12,14 @@ import jnpf.base.UserInfo;
import jnpf.base.model.ColumnDataModel; import jnpf.base.model.ColumnDataModel;
import jnpf.database.model.superQuery.SuperJsonModel; import jnpf.database.model.superQuery.SuperJsonModel;
import jnpf.entity.ContractEntity; import jnpf.entity.ContractEntity;
import jnpf.entity.EquipmentRentalRecordsEntity;
import jnpf.entity.ParkEntity; import jnpf.entity.ParkEntity;
import jnpf.entity.SpacecontractEntity; import jnpf.entity.SpacecontractEntity;
import jnpf.mapper.ContractMapper; import jnpf.mapper.ContractMapper;
import jnpf.model.QueryModel; import jnpf.model.QueryModel;
import jnpf.model.contract.*; import jnpf.model.contract.*;
import jnpf.permission.entity.UserEntity; import jnpf.permission.entity.UserEntity;
import jnpf.service.ContractService; import jnpf.service.*;
import jnpf.service.EnterpriseMerchantsService;
import jnpf.service.ParkService;
import jnpf.service.SpacecontractService;
import jnpf.util.*; import jnpf.util.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
@ -31,7 +30,6 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
@ -65,6 +63,9 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEnt
@Resource @Resource
private ParkService parkService; private ParkService parkService;
@Resource
private EquipmentRentalRecordsService equipmentRentalRecordsService;
@Override @Override
public List<ContractEntity> getList(ContractPagination contractPagination) { public List<ContractEntity> getList(ContractPagination contractPagination) {
@ -554,7 +555,9 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEnt
List<SpacecontractEntity> tableField130 = JsonUtil.getJsonToList(contractForm.getSpacecontractList(), SpacecontractEntity.class); List<SpacecontractEntity> tableField130 = JsonUtil.getJsonToList(contractForm.getSpacecontractList(), SpacecontractEntity.class);
int i = 1; int i = 1;
//假如选择了相同的空间 后端直接去重 //假如选择了相同的空间 后端直接去重
List<SpacecontractEntity> list1 = tableField130.stream().collect(Collectors.toMap(SpacecontractEntity::getSpaceId, obj -> obj, (o1, o2) -> o1)).values().stream().collect(Collectors.toList()); List<SpacecontractEntity> list1 = tableField130.stream()
.filter(obj -> StringUtils.isNoneBlank(obj.getSpaceId()))
.collect(Collectors.toMap(SpacecontractEntity::getSpaceId, obj -> obj, (o1, o2) -> o1)).values().stream().collect(Collectors.toList());
for (SpacecontractEntity entitys : list1) { for (SpacecontractEntity entitys : list1) {
if (StringUtils.isBlank(entitys.getSpaceId())) { if (StringUtils.isBlank(entitys.getSpaceId())) {
continue; continue;
@ -660,4 +663,44 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEnt
} }
return contract.getContractNumber(); return contract.getContractNumber();
} }
@Override
public List<ContractDTO> getSpacesById(ContractPagination contractPagination) {
ContractEntity contract = this.getById(contractPagination.getContractId());
if (ObjectUtil.isNull(contract)) {
return Collections.emptyList();
}
//查询绑定空间信息
List<SpacecontractEntity> byNum = spacecontractService.findByNum(contract.getContractNumber(), contractPagination.getKeyword());
if (ObjectUtil.isNull(byNum)) {
return Collections.emptyList();
}
return byNum.stream().map(obj -> {
ContractDTO contractDTO = BeanUtil.copyProperties(contract, ContractDTO.class);
contractDTO.setSpaceNumber(obj.getSpaceId());
contractDTO.setSpaceId(obj.getSpaceName());
return contractDTO;
}).collect(Collectors.toList());
}
@Override
public List<ContractDevicesDTO> getDevicesById(ContractPagination contractPagination) {
ContractEntity contract = this.getById(contractPagination.getContractId());
if (ObjectUtil.isNull(contract)) {
return Collections.emptyList();
}
//根据合同上的商户id 查询绑定的租赁设备
List<EquipmentRentalRecordsEntity> recordsEntities = equipmentRentalRecordsService.findByMerchantId(contract.getMerchantId(), contractPagination.getKeyword());
return recordsEntities.stream().map(obj -> {
ContractDevicesDTO devicesDTO = new ContractDevicesDTO();
devicesDTO.setId(contract.getId());
devicesDTO.setStartTime(obj.getStartTime());
devicesDTO.setEndTime(obj.getEndTime());
devicesDTO.setTotalRentalPrice(obj.getTotalLeasePrice());
devicesDTO.setLeaseNumber(obj.getLeaseNumber());
devicesDTO.setEquipmentNumber(obj.getEquipmentCoding());
devicesDTO.setEquipmentName(obj.getEquipmentName());
return devicesDTO;
}).collect(Collectors.toList());
}
} }

@ -1,50 +1,38 @@
package jnpf.service.impl; package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.EquipmentRentalRecordsMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.equipmentrentalrecords.*;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.util.GeneraterSwapUtil;
import jnpf.database.model.superQuery.SuperQueryJsonModel;
import jnpf.database.model.superQuery.ConditionJsonModel;
import jnpf.database.model.superQuery.SuperQueryConditionModel;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.util.concurrent.CompletableFuture;
import java.util.regex.Pattern;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
import jnpf.base.UserInfo; import jnpf.base.UserInfo;
import jnpf.base.model.ColumnDataModel;
import jnpf.database.model.superQuery.SuperJsonModel;
import jnpf.entity.EquipmentEntity;
import jnpf.entity.EquipmentRentalRecordsEntity;
import jnpf.mapper.EquipmentRentalRecordsMapper;
import jnpf.model.QueryModel;
import jnpf.model.equipmentrentalrecords.EquipmentRentalRecordsConstant;
import jnpf.model.equipmentrentalrecords.EquipmentRentalRecordsForm;
import jnpf.model.equipmentrentalrecords.EquipmentRentalRecordsPagination;
import jnpf.permission.entity.UserEntity; import jnpf.permission.entity.UserEntity;
import jnpf.service.EnterpriseMerchantsService;
import jnpf.service.EquipmentRentalRecordsService;
import jnpf.service.EquipmentService;
import jnpf.util.*;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.lang.reflect.Field;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/** /**
* EquipmentRentalRecords * EquipmentRentalRecords
@ -314,7 +302,7 @@ public class EquipmentRentalRecordsServiceImpl extends ServiceImpl<EquipmentRent
public String update(String id, EquipmentRentalRecordsEntity entity) { public String update(String id, EquipmentRentalRecordsEntity entity) {
//判断设备是否是可用状态 //判断设备是否是可用状态
EquipmentEntity equipment = equipmentService.getById(entity.getEquipmentId()); EquipmentEntity equipment = equipmentService.getById(entity.getEquipmentId());
if ("1".equals(equipment.getStatus())) { if (!"2".equals(equipment.getStatus())) {
return "该设备未归还,不可删除!"; return "该设备未归还,不可删除!";
} }
//异步更改状态 //异步更改状态
@ -407,4 +395,18 @@ public class EquipmentRentalRecordsServiceImpl extends ServiceImpl<EquipmentRent
CompletableFuture.runAsync(() -> equipmentService.updateStatus(entity.getEquipmentId(), status)); CompletableFuture.runAsync(() -> equipmentService.updateStatus(entity.getEquipmentId(), status));
} }
} }
@Override
public List<EquipmentRentalRecordsEntity> findByMerchantId(String merchantId, String keyword) {
QueryWrapper<EquipmentRentalRecordsEntity> entityQueryWrapper = new QueryWrapper<>();
entityQueryWrapper.lambda().eq(EquipmentRentalRecordsEntity::getMerchantId, merchantId);
if (StringUtils.isNoneBlank(keyword)) {
entityQueryWrapper.lambda().like(EquipmentRentalRecordsEntity::getEquipmentName, keyword);
}
List<EquipmentRentalRecordsEntity> list = this.list(entityQueryWrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
}
return list;
}
} }

@ -14,6 +14,7 @@ import jnpf.util.JsonUtil;
import jnpf.util.ServletUtil; import jnpf.util.ServletUtil;
import jnpf.util.UserProvider; import jnpf.util.UserProvider;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -29,7 +30,7 @@ import java.util.stream.Collectors;
* 2024-07-16 * 2024-07-16
*/ */
@Service @Service
public class SpacecontractServiceImpl extends ServiceImpl<SpacecontractMapper, SpacecontractEntity> implements SpacecontractService{ public class SpacecontractServiceImpl extends ServiceImpl<SpacecontractMapper, SpacecontractEntity> implements SpacecontractService {
@Autowired @Autowired
private GeneraterSwapUtil generaterSwapUtil; private GeneraterSwapUtil generaterSwapUtil;
@ -50,14 +51,14 @@ public class SpacecontractServiceImpl extends ServiceImpl<SpacecontractMapper, S
//子表过滤方法 //子表过滤方法
@Override @Override
public QueryWrapper<SpacecontractEntity> getChild(ContractPagination pagination, QueryWrapper<SpacecontractEntity> spacecontractQueryWrapper){ public QueryWrapper<SpacecontractEntity> getChild(ContractPagination pagination, QueryWrapper<SpacecontractEntity> spacecontractQueryWrapper) {
boolean pcPermission = false; boolean pcPermission = false;
boolean appPermission = false; boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc"); boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String ruleQueryJson = isPc?ContractConstant.getColumnData():ContractConstant.getAppColumnData(); String ruleQueryJson = isPc ? ContractConstant.getColumnData() : ContractConstant.getAppColumnData();
ColumnDataModel dataModel = JsonUtil.getJsonToBean(ruleQueryJson,ColumnDataModel.class); ColumnDataModel dataModel = JsonUtil.getJsonToBean(ruleQueryJson, ColumnDataModel.class);
String ruleJson = isPc?JsonUtil.getObjectToString(dataModel.getRuleList()):JsonUtil.getObjectToString(dataModel.getRuleListApp()); String ruleJson = isPc ? JsonUtil.getObjectToString(dataModel.getRuleList()) : JsonUtil.getObjectToString(dataModel.getRuleListApp());
if(isPc){ if (isPc) {
} }
return spacecontractQueryWrapper; return spacecontractQueryWrapper;
} }
@ -68,4 +69,18 @@ public class SpacecontractServiceImpl extends ServiceImpl<SpacecontractMapper, S
SpacecontractqueryWrapper.lambda().eq(SpacecontractEntity::getContractNumber, contractNumber); SpacecontractqueryWrapper.lambda().eq(SpacecontractEntity::getContractNumber, contractNumber);
this.remove(SpacecontractqueryWrapper); this.remove(SpacecontractqueryWrapper);
} }
@Override
public List<SpacecontractEntity> findByNum(String contractNumber, String keyWord) {
QueryWrapper<SpacecontractEntity> SpacecontractqueryWrapper = new QueryWrapper<>();
SpacecontractqueryWrapper.lambda().eq(SpacecontractEntity::getContractNumber, contractNumber);
if (StringUtils.isNoneBlank(keyWord)) {
SpacecontractqueryWrapper.lambda().like(SpacecontractEntity::getSpaceName, keyWord);
}
List<SpacecontractEntity> list = this.list(SpacecontractqueryWrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
}
return list;
}
} }

@ -80,11 +80,11 @@ public class BillTableController {
billTableMap.put("id", billTableMap.get("id")); billTableMap.put("id", billTableMap.get("id"));
//副表数据 //副表数据
//子表数据 //子表数据
List<BillspacedetailEntity> billspacedetailList = billTableService.getBillspacedetailList(entity.getId(), billTablePagination); List<BillspacedetailEntity> billspacedetailList = billTableService.getBillspacedetailList(entity.getBillNumbe(), billTablePagination);
billTableMap.put("tableField140", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billspacedetailList))); billTableMap.put("tableField140", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billspacedetailList)));
List<BilldevicedeatialEntity> billdevicedeatialList = billTableService.getBilldevicedeatialList(entity.getId(), billTablePagination); List<BilldevicedeatialEntity> billdevicedeatialList = billTableService.getBilldevicedeatialList(entity.getBillNumbe(), billTablePagination);
billTableMap.put("tableField158", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billdevicedeatialList))); billTableMap.put("tableField158", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billdevicedeatialList)));
List<BillotherdeatialEntity> billotherdeatialList = billTableService.getBillotherdeatialList(entity.getId(), billTablePagination); List<BillotherdeatialEntity> billotherdeatialList = billTableService.getBillotherdeatialList(entity.getBillNumbe(), billTablePagination);
billTableMap.put("tableField166", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billotherdeatialList))); billTableMap.put("tableField166", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billotherdeatialList)));
realList.add(billTableMap); realList.add(billTableMap);
} }
@ -187,11 +187,11 @@ public class BillTableController {
billTableMap.put("id", billTableMap.get("id")); billTableMap.put("id", billTableMap.get("id"));
//副表数据 //副表数据
//子表数据 //子表数据
List<BillspacedetailEntity> billspacedetailList = billTableService.getBillspacedetailList(entity.getId()); List<BillspacedetailEntity> billspacedetailList = billTableService.getBillspacedetailList(entity.getBillNumbe());
billTableMap.put("tableField140", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billspacedetailList))); billTableMap.put("tableField140", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billspacedetailList)));
List<BilldevicedeatialEntity> billdevicedeatialList = billTableService.getBilldevicedeatialList(entity.getId()); List<BilldevicedeatialEntity> billdevicedeatialList = billTableService.getBilldevicedeatialList(entity.getBillNumbe());
billTableMap.put("tableField158", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billdevicedeatialList))); billTableMap.put("tableField158", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billdevicedeatialList)));
List<BillotherdeatialEntity> billotherdeatialList = billTableService.getBillotherdeatialList(entity.getId()); List<BillotherdeatialEntity> billotherdeatialList = billTableService.getBillotherdeatialList(entity.getBillNumbe());
billTableMap.put("tableField166", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billotherdeatialList))); billTableMap.put("tableField166", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billotherdeatialList)));
billTableMap = generaterSwapUtil.swapDataDetail(billTableMap, BillTableConstant.getFormData(), "585025890216314949", false); billTableMap = generaterSwapUtil.swapDataDetail(billTableMap, BillTableConstant.getFormData(), "585025890216314949", false);
return ActionResult.success(billTableMap); return ActionResult.success(billTableMap);
@ -215,11 +215,11 @@ public class BillTableController {
billTableMap.put("id", billTableMap.get("id")); billTableMap.put("id", billTableMap.get("id"));
//副表数据 //副表数据
//子表数据 //子表数据
List<BillspacedetailEntity> billspacedetailList = billTableService.getBillspacedetailList(entity.getId()); List<BillspacedetailEntity> billspacedetailList = billTableService.getBillspacedetailList(entity.getBillNumbe());
billTableMap.put("billspacedetailList", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billspacedetailList))); billTableMap.put("billspacedetailList", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billspacedetailList)));
List<BilldevicedeatialEntity> billdevicedeatialList = billTableService.getBilldevicedeatialList(entity.getId()); List<BilldevicedeatialEntity> billdevicedeatialList = billTableService.getBilldevicedeatialList(entity.getBillNumbe());
billTableMap.put("billdevicedeatialList", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billdevicedeatialList))); billTableMap.put("billdevicedeatialList", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billdevicedeatialList)));
List<BillotherdeatialEntity> billotherdeatialList = billTableService.getBillotherdeatialList(entity.getId()); List<BillotherdeatialEntity> billotherdeatialList = billTableService.getBillotherdeatialList(entity.getBillNumbe());
billTableMap.put("billotherdeatialList", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billotherdeatialList))); billTableMap.put("billotherdeatialList", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billotherdeatialList)));
billTableMap = generaterSwapUtil.swapDataForm(billTableMap, BillTableConstant.getFormData(), BillTableConstant.TABLEFIELDKEY, BillTableConstant.TABLERENAMES); billTableMap = generaterSwapUtil.swapDataForm(billTableMap, BillTableConstant.getFormData(), BillTableConstant.TABLEFIELDKEY, BillTableConstant.TABLERENAMES);
return ActionResult.success(billTableMap); return ActionResult.success(billTableMap);

@ -27,6 +27,7 @@ import jnpf.service.SpacecontractService;
import jnpf.util.*; import jnpf.util.*;
import lombok.Cleanup; import lombok.Cleanup;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import oracle.jdbc.proxy.annotation.Post;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -48,7 +49,7 @@ import java.util.*;
*/ */
@Slf4j @Slf4j
@RestController @RestController
@Tag(name = "Contract" , description = "example") @Tag(name = "Contract", description = "example")
@RequestMapping("/api/example/Contract") @RequestMapping("/api/example/Contract")
public class ContractController { public class ContractController {
@ -69,16 +70,16 @@ public class ContractController {
private ConfigValueUtil configValueUtil; private ConfigValueUtil configValueUtil;
/** /**
* *
* *
* @param contractPagination * @param contractPagination
* @return * @return
*/ */
@Operation(summary = "获取列表") @Operation(summary = "获取列表")
@PostMapping("/getList") @PostMapping("/getList")
public ActionResult list(@RequestBody ContractPagination contractPagination)throws IOException{ public ActionResult list(@RequestBody ContractPagination contractPagination) throws IOException {
List<ContractEntity> list= contractService.getList(contractPagination); List<ContractEntity> list = contractService.getList(contractPagination);
List<Map<String, Object>> realList=new ArrayList<>(); List<Map<String, Object>> realList = new ArrayList<>();
for (ContractEntity entity : list) { for (ContractEntity entity : list) {
Map<String, Object> contractMap = JsonUtil.entityToMap(entity); Map<String, Object> contractMap = JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("id")); contractMap.put("id", contractMap.get("id"));
@ -89,7 +90,7 @@ public class ContractController {
realList.add(contractMap); realList.add(contractMap);
} }
//数据转换 //数据转换
realList = generaterSwapUtil.swapDataList(realList, ContractConstant.getFormData(), ContractConstant.getColumnData(), contractPagination.getModuleId(),false); realList = generaterSwapUtil.swapDataList(realList, ContractConstant.getFormData(), ContractConstant.getColumnData(), contractPagination.getModuleId(), false);
//返回对象 //返回对象
PageListVO vo = new PageListVO(); PageListVO vo = new PageListVO();
@ -98,39 +99,41 @@ public class ContractController {
vo.setPagination(page); vo.setPagination(page);
return ActionResult.success(vo); return ActionResult.success(vo);
} }
/** /**
* *
* *
* @param contractForm * @param contractForm
* @return * @return
*/ */
@PostMapping() @PostMapping()
@Operation(summary = "创建") @Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid ContractForm contractForm) { public ActionResult create(@RequestBody @Valid ContractForm contractForm) {
String b = contractService.checkForm(contractForm,0); String b = contractService.checkForm(contractForm, 0);
if (StringUtil.isNotEmpty(b)){ if (StringUtil.isNotEmpty(b)) {
return ActionResult.fail(b ); return ActionResult.fail(b);
} }
try{ try {
contractService.saveOrUpdate(contractForm, null ,true); contractService.saveOrUpdate(contractForm, null, true);
}catch(Exception e){ } catch (Exception e) {
return ActionResult.fail("新增数据失败"); return ActionResult.fail("新增数据失败");
} }
return ActionResult.success("创建成功"); return ActionResult.success("创建成功");
} }
/** /**
* Excel * Excel
* *
* @return * @return
*/ */
@Operation(summary = "导出Excel") @Operation(summary = "导出Excel")
@PostMapping("/Actions/Export") @PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody ContractPagination contractPagination) throws IOException { public ActionResult Export(@RequestBody ContractPagination contractPagination) throws IOException {
if (StringUtil.isEmpty(contractPagination.getSelectKey())){ if (StringUtil.isEmpty(contractPagination.getSelectKey())) {
return ActionResult.fail("请选择导出字段"); return ActionResult.fail("请选择导出字段");
} }
List<ContractEntity> list= contractService.getList(contractPagination); List<ContractEntity> list = contractService.getList(contractPagination);
List<Map<String, Object>> realList=new ArrayList<>(); List<Map<String, Object>> realList = new ArrayList<>();
for (ContractEntity entity : list) { for (ContractEntity entity : list) {
Map<String, Object> contractMap = JsonUtil.entityToMap(entity); Map<String, Object> contractMap = JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("id")); contractMap.put("id", contractMap.get("id"));
@ -141,98 +144,98 @@ public class ContractController {
realList.add(contractMap); realList.add(contractMap);
} }
//数据转换 //数据转换
realList = generaterSwapUtil.swapDataList(realList, ContractConstant.getFormData(), ContractConstant.getColumnData(), contractPagination.getModuleId(),false); realList = generaterSwapUtil.swapDataList(realList, ContractConstant.getFormData(), ContractConstant.getColumnData(), contractPagination.getModuleId(), false);
String[]keys=!StringUtil.isEmpty(contractPagination.getSelectKey())?contractPagination.getSelectKey():new String[0]; String[] keys = !StringUtil.isEmpty(contractPagination.getSelectKey()) ? contractPagination.getSelectKey() : new String[0];
UserInfo userInfo=userProvider.get(); UserInfo userInfo = userProvider.get();
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo); DownloadVO vo = this.creatModelExcel(configValueUtil.getTemporaryFilePath(), realList, keys, userInfo);
return ActionResult.success(vo); return ActionResult.success(vo);
} }
/** /**
* *
*/ */
public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){ public DownloadVO creatModelExcel(String path, List<Map<String, Object>> list, String[] keys, UserInfo userInfo) {
DownloadVO vo=DownloadVO.builder().build(); DownloadVO vo = DownloadVO.builder().build();
List<ExcelExportEntity> entitys=new ArrayList<>(); List<ExcelExportEntity> entitys = new ArrayList<>();
if(keys.length>0){ if (keys.length > 0) {
ExcelExportEntity tableField130ExcelEntity = new ExcelExportEntity("空间列表","tableField130"); ExcelExportEntity tableField130ExcelEntity = new ExcelExportEntity("空间列表", "tableField130");
List<ExcelExportEntity> tableField130List = new ArrayList<>(); List<ExcelExportEntity> tableField130List = new ArrayList<>();
for(String key:keys){ for (String key : keys) {
switch(key){ switch (key) {
case "contractNumber" : case "contractNumber":
entitys.add(new ExcelExportEntity("合同编号" ,"contractNumber")); entitys.add(new ExcelExportEntity("合同编号", "contractNumber"));
break; break;
case "contractName" : case "contractName":
entitys.add(new ExcelExportEntity("合同名称" ,"contractName")); entitys.add(new ExcelExportEntity("合同名称", "contractName"));
break; break;
case "pricingMethod" : case "pricingMethod":
entitys.add(new ExcelExportEntity("计价方式" ,"pricingMethod")); entitys.add(new ExcelExportEntity("计价方式", "pricingMethod"));
break; break;
case "signingDate" : case "signingDate":
entitys.add(new ExcelExportEntity("签订日期" ,"signingDate")); entitys.add(new ExcelExportEntity("签订日期", "signingDate"));
break; break;
case "parkId" : case "parkId":
entitys.add(new ExcelExportEntity("园区名称" ,"parkId")); entitys.add(new ExcelExportEntity("园区名称", "parkId"));
break; break;
case "merchantId" : case "merchantId":
entitys.add(new ExcelExportEntity("商户名称" ,"merchantId")); entitys.add(new ExcelExportEntity("商户名称", "merchantId"));
break; break;
case "totalRentalPrice" : case "totalRentalPrice":
entitys.add(new ExcelExportEntity("租金总价" ,"totalRentalPrice")); entitys.add(new ExcelExportEntity("租金总价", "totalRentalPrice"));
break; break;
case "totalDeposit" : case "totalDeposit":
entitys.add(new ExcelExportEntity("押金总计" ,"totalDeposit")); entitys.add(new ExcelExportEntity("押金总计", "totalDeposit"));
break; break;
case "payDeposit" : case "payDeposit":
entitys.add(new ExcelExportEntity("支付方式" ,"payDeposit")); entitys.add(new ExcelExportEntity("支付方式", "payDeposit"));
break; break;
case "returnDeposit" : case "returnDeposit":
entitys.add(new ExcelExportEntity("退还方式" ,"returnDeposit")); entitys.add(new ExcelExportEntity("退还方式", "returnDeposit"));
break; break;
case "startTime" : case "startTime":
entitys.add(new ExcelExportEntity("开始时间" ,"startTime")); entitys.add(new ExcelExportEntity("开始时间", "startTime"));
break; break;
case "endTime" : case "endTime":
entitys.add(new ExcelExportEntity("结束时间" ,"endTime")); entitys.add(new ExcelExportEntity("结束时间", "endTime"));
break; break;
case "leaseTerm" : case "leaseTerm":
entitys.add(new ExcelExportEntity("租期" ,"leaseTerm")); entitys.add(new ExcelExportEntity("租期", "leaseTerm"));
break; break;
case "contacts" : case "contacts":
entitys.add(new ExcelExportEntity("联系人" ,"contacts")); entitys.add(new ExcelExportEntity("联系人", "contacts"));
break; break;
case "contactsPhone" : case "contactsPhone":
entitys.add(new ExcelExportEntity("联系电话" ,"contactsPhone")); entitys.add(new ExcelExportEntity("联系电话", "contactsPhone"));
break; break;
case "contractStatus" : case "contractStatus":
entitys.add(new ExcelExportEntity("合同状态" ,"contractStatus")); entitys.add(new ExcelExportEntity("合同状态", "contractStatus"));
break; break;
case "creationTime" : case "creationTime":
entitys.add(new ExcelExportEntity("创建时间" ,"creationTime")); entitys.add(new ExcelExportEntity("创建时间", "creationTime"));
break; break;
case "contractExplain" : case "contractExplain":
entitys.add(new ExcelExportEntity("合同说明" ,"contractExplain")); entitys.add(new ExcelExportEntity("合同说明", "contractExplain"));
break; break;
case "contractEnclosure" : case "contractEnclosure":
entitys.add(new ExcelExportEntity("合同附件" ,"contractEnclosure")); entitys.add(new ExcelExportEntity("合同附件", "contractEnclosure"));
break; break;
case "tableField130-contractLineNumber": case "tableField130-contractLineNumber":
tableField130List.add(new ExcelExportEntity("合同行号" ,"contractLineNumber")); tableField130List.add(new ExcelExportEntity("合同行号", "contractLineNumber"));
break; break;
case "tableField130-spaceId": case "tableField130-spaceId":
tableField130List.add(new ExcelExportEntity("空间名称" ,"spaceId")); tableField130List.add(new ExcelExportEntity("空间名称", "spaceId"));
break; break;
case "tableField130-spaceArea": case "tableField130-spaceArea":
tableField130List.add(new ExcelExportEntity("空间面积" ,"spaceArea")); tableField130List.add(new ExcelExportEntity("空间面积", "spaceArea"));
break; break;
case "tableField130-totalRentalPrice": case "tableField130-totalRentalPrice":
tableField130List.add(new ExcelExportEntity("租金总价" ,"totalRentalPrice")); tableField130List.add(new ExcelExportEntity("租金总价", "totalRentalPrice"));
break; break;
default: default:
break; break;
} }
} }
if(tableField130List.size() > 0){ if (tableField130List.size() > 0) {
tableField130ExcelEntity.setList(tableField130List); tableField130ExcelEntity.setList(tableField130List);
entitys.add(tableField130ExcelEntity); entitys.add(tableField130ExcelEntity);
} }
@ -240,10 +243,10 @@ public class ContractController {
ExportParams exportParams = new ExportParams(null, "表单信息"); ExportParams exportParams = new ExportParams(null, "表单信息");
exportParams.setType(ExcelType.XSSF); exportParams.setType(ExcelType.XSSF);
try{ try {
@Cleanup Workbook workbook = new HSSFWorkbook(); @Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){ if (entitys.size() > 0) {
if (list.size()==0){ if (list.size() == 0) {
list.add(new HashMap<>()); list.add(new HashMap<>());
} }
//去除空数据 //去除空数据
@ -253,8 +256,8 @@ public class ContractController {
for (String key : keys) { for (String key : keys) {
//子表 //子表
if (key.toLowerCase().startsWith("tablefield")) { if (key.toLowerCase().startsWith("tablefield")) {
String tableField = key.substring(0, key.indexOf("-" )); String tableField = key.substring(0, key.indexOf("-"));
String field = key.substring(key.indexOf("-" ) + 1); String field = key.substring(key.indexOf("-") + 1);
Object o = map.get(tableField); Object o = map.get(tableField);
if (o != null) { if (o != null) {
List<Map<String, Object>> childList = (List<Map<String, Object>>) o; List<Map<String, Object>> childList = (List<Map<String, Object>>) o;
@ -280,7 +283,7 @@ public class ContractController {
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList(); List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList); entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList); dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList);
} }
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList); workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList);
@ -297,66 +300,72 @@ public class ContractController {
} }
return vo; return vo;
} }
/** /**
* *
* @param id *
* @param contractForm * @param id
* @return * @param contractForm
*/ * @return
*/
@PutMapping("/{id}") @PutMapping("/{id}")
@Operation(summary = "更新") @Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid ContractForm contractForm, public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ContractForm contractForm,
@RequestParam(value = "isImport", required = false) boolean isImport){ @RequestParam(value = "isImport", required = false) boolean isImport) {
contractForm.setId(id); contractForm.setId(id);
if (!isImport) { if (!isImport) {
String b = contractService.checkForm(contractForm,1); String b = contractService.checkForm(contractForm, 1);
if (StringUtil.isNotEmpty(b)){ if (StringUtil.isNotEmpty(b)) {
return ActionResult.fail(b ); return ActionResult.fail(b);
} }
} }
ContractEntity entity= contractService.getInfo(id); ContractEntity entity = contractService.getInfo(id);
if(entity!=null){ if (entity != null) {
try{ try {
contractService.saveOrUpdate(contractForm,id,false); contractService.saveOrUpdate(contractForm, id, false);
}catch(Exception e){ } catch (Exception e) {
return ActionResult.fail("修改数据失败"); return ActionResult.fail("修改数据失败");
} }
return ActionResult.success("更新成功"); return ActionResult.success("更新成功");
}else{ } else {
return ActionResult.fail("更新失败,数据不存在"); return ActionResult.fail("更新失败,数据不存在");
} }
} }
/** /**
* *
* @param id *
* @return * @param id
*/ * @return
*/
@Operation(summary = "删除") @Operation(summary = "删除")
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@Transactional @Transactional
public ActionResult delete(@PathVariable("id") String id){ public ActionResult delete(@PathVariable("id") String id) {
ContractEntity entity= contractService.getInfo(id); ContractEntity entity = contractService.getInfo(id);
if(entity!=null){ if (entity != null) {
//假删除 //假删除
entity.setDeleteMark(1); entity.setDeleteMark(1);
contractService.update(id, entity); contractService.update(id, entity);
} }
return ActionResult.success("删除成功"); return ActionResult.success("删除成功");
} }
/** /**
* () * ()
* 使- * 使-
* @param id *
* @return * @param id
*/ * @return
*/
@Operation(summary = "表单信息(详情页)") @Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}") @GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){ public ActionResult detailInfo(@PathVariable("id") String id) {
ContractEntity entity= contractService.getInfo(id); ContractEntity entity = contractService.getInfo(id);
if(entity==null){ if (entity == null) {
return ActionResult.fail("表单数据不存在!"); return ActionResult.fail("表单数据不存在!");
} }
Map<String, Object> contractMap=JsonUtil.entityToMap(entity); Map<String, Object> contractMap = JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("id")); contractMap.put("id", contractMap.get("id"));
//副表数据 //副表数据
//子表数据 //子表数据
@ -365,20 +374,22 @@ public class ContractController {
contractMap = generaterSwapUtil.swapDataDetail(contractMap, ContractConstant.getFormData(), "582839350958489605", false); contractMap = generaterSwapUtil.swapDataDetail(contractMap, ContractConstant.getFormData(), "582839350958489605", false);
return ActionResult.success(contractMap); return ActionResult.success(contractMap);
} }
/** /**
* () * ()
* 使- * 使-
* @param id *
* @return * @param id
*/ * @return
*/
@Operation(summary = "信息") @Operation(summary = "信息")
@GetMapping("/{id}") @GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){ public ActionResult info(@PathVariable("id") String id) {
ContractEntity entity= contractService.getInfo(id); ContractEntity entity = contractService.getInfo(id);
if(entity==null){ if (entity == null) {
return ActionResult.fail("表单数据不存在!"); return ActionResult.fail("表单数据不存在!");
} }
Map<String, Object> contractMap=JsonUtil.entityToMap(entity); Map<String, Object> contractMap = JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("id")); contractMap.put("id", contractMap.get("id"));
//副表数据 //副表数据
//子表数据 //子表数据
@ -408,4 +419,24 @@ public class ContractController {
return ActionResult.success(result); return ActionResult.success(result);
} }
@Operation(summary = "根据合同id查询绑定空间信息")
@PostMapping("/getSpacesById")
public ActionResult getSpacesById(@RequestBody ContractPagination contractPagination) {
PageListVO vo = new PageListVO();
vo.setList(contractService.getSpacesById(contractPagination));
PaginationVO page = JsonUtil.getJsonToBean(contractPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
@Operation(summary = "根据合同id查询绑定商户的设备信息")
@PostMapping("/getDevicesById")
public ActionResult getDevicesById(@RequestBody ContractPagination contractPagination) {
PageListVO vo = new PageListVO();
vo.setList(contractService.getDevicesById(contractPagination));
PaginationVO page = JsonUtil.getJsonToBean(contractPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
} }

@ -0,0 +1,52 @@
package jnpf.model.contract;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class ContractDTO implements Serializable {
/**
* id
*/
private String id;
/**
*
*/
private String contractNumber;
/**
*
*/
private String contractName;
/**
* id
*/
private String merchantId;
/**
* id
*/
private String merchantName;
/**
* id
*/
private String spaceNumber;
/**
*
*/
private String spaceId;
/**
*
*/
private Date startTime;
/**
*
*/
private Date endTime;
/**
*
*/
private BigDecimal totalRentalPrice;
}

@ -0,0 +1,45 @@
package jnpf.model.contract;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class ContractDevicesDTO implements Serializable {
/**
* id
*/
private String id;
/**
*
*/
private Date startTime;
/**
*
*/
private Date endTime;
/**
*
*/
private BigDecimal totalRentalPrice;
/**
*
*/
private String leaseNumber;
/**
*
*/
private String equipmentNumber;
/**
*
*/
private String equipmentName;
}

@ -3,11 +3,12 @@ package jnpf.model.contract;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data; import lombok.Data;
import jnpf.base.Pagination; import jnpf.base.Pagination;
import java.util.List; import java.util.List;
/** /**
*
* Contract * Contract
*
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
@ -15,34 +16,62 @@ import java.util.List;
*/ */
@Data @Data
public class ContractPagination extends Pagination { public class ContractPagination extends Pagination {
/** 查询key */ /**
private String[] selectKey; * key
/** json */ */
private String json; private String[] selectKey;
/** 数据类型 0-当前页1-全部数据 */ /**
private String dataType; * json
/** 高级查询 */ */
private String superQueryJson; private String json;
/** 功能id */ /**
* 0-1-
*/
private String dataType;
/**
*
*/
private String superQueryJson;
/**
* id
*/
private String moduleId; private String moduleId;
/** 菜单id */ /**
* id
*/
private String menuId; private String menuId;
/** 申请时间 */ /**
*
*/
@JsonProperty("creationTime") @JsonProperty("creationTime")
private Object creationTime; private Object creationTime;
/** 商户名称 */ /**
*
*/
@JsonProperty("merchantName") @JsonProperty("merchantName")
private Object merchantName; private Object merchantName;
/** 合同状态 */ /**
*
*/
@JsonProperty("contractStatus") @JsonProperty("contractStatus")
private Object contractStatus; private Object contractStatus;
/** 合同名称 */ /**
*
*/
@JsonProperty("contractName") @JsonProperty("contractName")
private Object contractName; private Object contractName;
/** 合同编号 */ /**
*
*/
@JsonProperty("contractNumber") @JsonProperty("contractNumber")
private Object contractNumber; private Object contractNumber;
/** 园区名称 */ /**
*
*/
@JsonProperty("parkId") @JsonProperty("parkId")
private Object parkId; private Object parkId;
/**
* id
**/
private String contractId;
} }

@ -1,356 +1,332 @@
<template> <template>
<transition name="el-zoom-in-center"> <transition name="el-zoom-in-center">
<div class="JNPF-preview-main"> <div class="JNPF-preview-main">
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" /> <Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
<div class="JNPF-common-page-header"> <div class="JNPF-common-page-header">
<el-page-header @back="goBack" <el-page-header @back="goBack" content="详情" />
content="详情"/> <div class="options">
<div class="options"> <el-button @click="goBack"> </el-button>
<el-button @click="goBack"> </el-button> </div>
</div>
</div>
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
<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="billNumbe" >
<p>{{dataForm.billNumbe}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="合同名称"
prop="contractId" >
<p>{{dataForm.contractId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="账单状态"
prop="billStatus" >
<p>{{ dataForm.billStatus }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<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="startTime" >
<p>{{dataForm.startTime}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<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="billAmount" >
<JnpfNumber v-model="dataForm.billAmount"
placeholder="账单金额" disabled
:step="1" >
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="通知方式"
prop="notificationMethod" >
<p>{{ dataForm.notificationMethod }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="通知时间"
prop="noticeTime" >
<p>{{dataForm.noticeTime}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="通知状态"
prop="notificationState" >
<p>{{ dataForm.notificationState }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="支付方式"
prop="payStatus" >
<p>{{ dataForm.payStatus }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="支付金额"
prop="payAmount" >
<JnpfNumber v-model="dataForm.payAmount"
placeholder="支付金额" disabled
:step="1" >
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="确认人"
prop="confirmPersonnel" >
<p>{{dataForm.confirmPersonnel}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="确认时间"
prop="confirmTime" >
<p>{{dataForm.confirmTime}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="相关附件"
prop="billAttachment" >
<JnpfUploadFile v-model="dataForm.billAttachment"
disabled
detailed :fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0" buttonText="点击上传" >
</JnpfUploadFile>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<el-tabs v-model="activegecbmb" tab-position="top" class="mb-20">
<el-tab-pane label="空间租金" name="1">
<el-col :span="24" >
<jnpf-form-tip-item label-width="0">
<el-table :data="dataForm.tableField140" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="spaceNumber" label="空间编码" >
<template slot-scope="scope">
<p>{{scope.row.spaceNumber}}</p>
</template>
</el-table-column>
<el-table-column prop="spaceId" label="空间名称" >
<template slot-scope="scope">
<p>{{scope.row.spaceId}}</p>
</template>
</el-table-column>
<el-table-column prop="startTime" label="开始时间" >
<template slot-scope="scope">
<p>{{scope.row.startTime}}</p>
</template>
</el-table-column>
<el-table-column prop="endTime" label="结束时间" >
<template slot-scope="scope">
<p>{{scope.row.endTime}}</p>
</template>
</el-table-column>
<el-table-column prop="billAmount" label="账单金额" >
<template slot-scope="scope">
<JnpfNumber v-model="scope.row.billAmount"
placeholder="账单金额" disabled
:step="1" >
</JnpfNumber>
</template>
</el-table-column>
<el-table-column prop="costDescription" label="费用说明" >
<template slot-scope="scope">
<p>{{scope.row.costDescription}}</p>
</template>
</el-table-column>
</el-table>
</jnpf-form-tip-item>
</el-col>
</el-tab-pane >
<el-tab-pane label="设备租金" name="2">
<el-col :span="24" >
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.tableField158" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="leaseNumber" label="租赁单号" >
<template slot-scope="scope">
<p>{{scope.row.leaseNumber}}</p>
</template>
</el-table-column>
<el-table-column prop="equipmentNumber" label="设备编码" >
<template slot-scope="scope">
<p>{{scope.row.equipmentNumber}}</p>
</template>
</el-table-column>
<el-table-column prop="equipmentName" label="设备名称" >
<template slot-scope="scope">
<p>{{scope.row.equipmentName}}</p>
</template>
</el-table-column>
<el-table-column prop="startTime" label="开始时间" >
<template slot-scope="scope">
<p>{{scope.row.startTime}}</p>
</template>
</el-table-column>
<el-table-column prop="endTime" label="结束时间" >
<template slot-scope="scope">
<p>{{scope.row.endTime}}</p>
</template>
</el-table-column>
<el-table-column prop="billAmount" label="账单金额" >
<template slot-scope="scope">
<JnpfNumber v-model="scope.row.billAmount"
placeholder="账单金额" disabled
:step="1" >
</JnpfNumber>
</template>
</el-table-column>
<el-table-column prop="costDescription" label="费用说明" >
<template slot-scope="scope">
<p>{{scope.row.costDescription}}</p>
</template>
</el-table-column>
</el-table>
</jnpf-form-tip-item>
</el-col>
</el-tab-pane >
<el-tab-pane label="其它费用" name="3KzarC2">
<el-col :span="24" >
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div> </div>
<el-table :data="dataForm.tableField166" size='mini' > <el-row :gutter="15" class=" main" :style="{ margin: '0 auto', width: '100%' }">
<el-table-column type="index" width="50" label="序号" align="center" /> <el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right">
<el-table-column prop="useAmount" label="使用量" > <template v-if="!loading">
<template slot-scope="scope"> <el-col :span="8">
<p>{{scope.row.useAmount}}</p> <jnpf-form-tip-item label="账单号" prop="billNumbe">
</template> <p>{{ dataForm.billNumbe }}</p>
</el-table-column> </jnpf-form-tip-item>
<el-table-column prop="startTime" label="开始时间" > </el-col>
<template slot-scope="scope"> <el-col :span="8">
<p>{{scope.row.startTime}}</p> <jnpf-form-tip-item label="合同名称" prop="contractId">
</template> <p>{{ dataForm.contractId }}</p>
</el-table-column> </jnpf-form-tip-item>
<el-table-column prop="endTime" label="结束时间" > </el-col>
<template slot-scope="scope"> <el-col :span="8">
<p>{{scope.row.endTime}}</p> <jnpf-form-tip-item label="账单状态" prop="billStatus">
</template> <p>{{ dataForm.billStatus }} </p>
</el-table-column> </jnpf-form-tip-item>
<el-table-column prop="billAmount" label="账单金额" > </el-col>
<template slot-scope="scope"> <el-col :span="8">
<JnpfNumber v-model="scope.row.billAmount" <jnpf-form-tip-item label="商户名称" prop="merchantId">
placeholder="账单金额" disabled <p>{{ dataForm.merchantId }}</p>
:step="1" > </jnpf-form-tip-item>
</JnpfNumber> </el-col>
</template> <el-col :span="8">
</el-table-column> <jnpf-form-tip-item label="开始时间" prop="startTime">
<el-table-column prop="costDescription" label="费用说明" > <p>{{ dataForm.startTime }}</p>
<template slot-scope="scope"> </jnpf-form-tip-item>
<p>{{scope.row.costDescription}}</p> </el-col>
</template> <el-col :span="8">
</el-table-column> <jnpf-form-tip-item label="结束时间" prop="endTime">
</el-table> <p>{{ dataForm.endTime }}</p>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
</el-tab-pane > <el-col :span="8">
</el-tabs> <jnpf-form-tip-item label="账单金额" prop="billAmount">
</el-col> <JnpfNumber v-model="dataForm.billAmount" placeholder="账单金额" disabled :step="1">
</template> </JnpfNumber>
</el-form> </jnpf-form-tip-item>
</el-row> </el-col>
</div> <el-col :span="8">
</transition> <jnpf-form-tip-item label="通知方式" prop="notificationMethod">
<p>{{ dataForm.notificationMethod }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="通知时间" prop="noticeTime">
<p>{{ dataForm.noticeTime }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="通知状态" prop="notificationState">
<p>{{ dataForm.notificationState }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="支付方式" prop="payStatus">
<p>{{ dataForm.payStatus }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="支付金额" prop="payAmount">
<JnpfNumber v-model="dataForm.payAmount" placeholder="支付金额" disabled :step="1">
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="确认人" prop="confirmPersonnel">
<p>{{ dataForm.confirmPersonnel }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="确认时间" prop="confirmTime">
<p>{{ dataForm.confirmTime }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="相关附件" prop="billAttachment">
<JnpfUploadFile v-model="dataForm.billAttachment" disabled detailed :fileSize="10"
sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0" buttonText="点击上传">
</JnpfUploadFile>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<el-tabs v-model="activegecbmb" tab-position="top" class="mb-20">
<el-tab-pane label="空间租金" name="1">
<el-col :span="24">
<jnpf-form-tip-item label-width="0">
<el-table :data="dataForm.tableField140" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="spaceNumber" label="空间编码">
<template slot-scope="scope">
<p>{{ scope.row.spaceNumber }}</p>
</template>
</el-table-column>
<el-table-column prop="spaceId" label="空间名称">
<template slot-scope="scope">
<p>{{ scope.row.spaceId }}</p>
</template>
</el-table-column>
<el-table-column prop="startTime" label="开始时间">
<template slot-scope="scope">
<p>{{ scope.row.startTime }}</p>
</template>
</el-table-column>
<el-table-column prop="endTime" label="结束时间">
<template slot-scope="scope">
<p>{{ scope.row.endTime }}</p>
</template>
</el-table-column>
<el-table-column prop="billAmount" label="账单金额">
<template slot-scope="scope">
<JnpfNumber v-model="scope.row.billAmount" placeholder="账单金额"
disabled :step="1">
</JnpfNumber>
</template>
</el-table-column>
<el-table-column prop="costDescription" label="费用说明">
<template slot-scope="scope">
<p>{{ scope.row.costDescription }}</p>
</template>
</el-table-column>
</el-table>
</jnpf-form-tip-item>
</el-col>
</el-tab-pane>
<el-tab-pane label="设备租金" name="2">
<el-col :span="24">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.tableField158" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="leaseNumber" label="租赁单号">
<template slot-scope="scope">
<p>{{ scope.row.leaseNumber }}</p>
</template>
</el-table-column>
<el-table-column prop="equipmentNumber" label="设备编码">
<template slot-scope="scope">
<p>{{ scope.row.equipmentNumber }}</p>
</template>
</el-table-column>
<el-table-column prop="equipmentName" label="设备名称">
<template slot-scope="scope">
<p>{{ scope.row.equipmentName }}</p>
</template>
</el-table-column>
<el-table-column prop="startTime" label="开始时间">
<template slot-scope="scope">
<p>{{ scope.row.startTime }}</p>
</template>
</el-table-column>
<el-table-column prop="endTime" label="结束时间">
<template slot-scope="scope">
<p>{{ scope.row.endTime }}</p>
</template>
</el-table-column>
<el-table-column prop="billAmount" label="账单金额">
<template slot-scope="scope">
<JnpfNumber v-model="scope.row.billAmount" placeholder="账单金额"
disabled :step="1">
</JnpfNumber>
</template>
</el-table-column>
<el-table-column prop="costDescription" label="费用说明">
<template slot-scope="scope">
<p>{{ scope.row.costDescription }}</p>
</template>
</el-table-column>
</el-table>
</jnpf-form-tip-item>
</el-col>
</el-tab-pane>
<el-tab-pane label="其它费用" name="3KzarC2">
<el-col :span="24">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.tableField166" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="useAmount" label="使用量">
<template slot-scope="scope">
<p>{{ scope.row.useAmount }}</p>
</template>
</el-table-column>
<el-table-column prop="startTime" label="开始时间">
<template slot-scope="scope">
<p>{{ scope.row.startTime }}</p>
</template>
</el-table-column>
<el-table-column prop="endTime" label="结束时间">
<template slot-scope="scope">
<p>{{ scope.row.endTime }}</p>
</template>
</el-table-column>
<el-table-column prop="billAmount" label="账单金额">
<template slot-scope="scope">
<JnpfNumber v-model="scope.row.billAmount" placeholder="账单金额"
disabled :step="1">
</JnpfNumber>
</template>
</el-table-column>
<el-table-column prop="costDescription" label="费用说明">
<template slot-scope="scope">
<p>{{ scope.row.costDescription }}</p>
</template>
</el-table-column>
</el-table>
</jnpf-form-tip-item>
</el-col>
</el-tab-pane>
</el-tabs>
</el-col>
</template>
</el-form>
</el-row>
</div>
</transition>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import { getConfigData } from '@/api/onlineDev/visualDev' import { getConfigData } from '@/api/onlineDev/visualDev'
import jnpf from '@/utils/jnpf' import jnpf from '@/utils/jnpf'
import Detail from '@/views/basic/dynamicModel/list/detail' import Detail from '@/views/basic/dynamicModel/list/detail'
import { thousandsFormat } from "@/components/Generator/utils/index" import { thousandsFormat } from "@/components/Generator/utils/index"
export default { export default {
components: { Detail}, components: { Detail },
props: [], props: [],
data() { data() {
return { return {
visible: false, visible: false,
detailVisible: false, detailVisible: false,
loading: false, loading: false,
dataForm: { dataForm: {
id :'', id: '',
billNumbe : '', billNumbe: '',
contractId : "", contractId: "",
billStatus : "10", billStatus: "10",
merchantId : '', merchantId: '',
startTime : '', startTime: '',
endTime : '', endTime: '',
billAmount : '', billAmount: '',
notificationMethod : "", notificationMethod: "",
noticeTime : '', noticeTime: '',
notificationState : "2", notificationState: "2",
payStatus : "1", payStatus: "1",
payAmount : '', payAmount: '',
confirmPersonnel : '', confirmPersonnel: '',
confirmTime : "", confirmTime: "",
billAttachment : [], billAttachment: [],
contractName : '', contractName: '',
merchantName : '', merchantName: '',
creationTime : "", creationTime: "",
contractNumber : '', contractNumber: '',
billspacedetailList:[], billspacedetailList: [],
billdevicedeatialList:[], billdevicedeatialList: [],
billotherdeatialList:[], billotherdeatialList: [],
}, },
activegecbmb:'3KzarC2', activegecbmb: '1',
billStatusOptions:[{"fullName":"待确认","id":"10"},{"fullName":"已确认","id":"20"},{"fullName":"已驳回","id":"30"},{"fullName":"部分结算","id":"40"},{"fullName":"已结算","id":"50"}], billStatusOptions: [{ "fullName": "待确认", "id": "10" }, { "fullName": "已确认", "id": "20" }, { "fullName": "已驳回", "id": "30" }, { "fullName": "部分结算", "id": "40" }, { "fullName": "已结算", "id": "50" }],
billStatusProps:{"label":"fullName","value":"id" }, billStatusProps: { "label": "fullName", "value": "id" },
notificationMethodOptions:[{"fullName":"口头","id":"1"},{"fullName":"书面","id":"2"}], notificationMethodOptions: [{ "fullName": "口头", "id": "1" }, { "fullName": "书面", "id": "2" }],
notificationMethodProps:{"label":"fullName","value":"id" }, notificationMethodProps: { "label": "fullName", "value": "id" },
notificationStateOptions:[{"fullName":"未通知","id":"1"},{"fullName":"已通知","id":"2"}], notificationStateOptions: [{ "fullName": "未通知", "id": "1" }, { "fullName": "已通知", "id": "2" }],
notificationStateProps:{"label":"fullName","value":"id" }, notificationStateProps: { "label": "fullName", "value": "id" },
payStatusOptions:[{"fullName":"现金","id":"1"},{"fullName":"转账","id":"2"},{"fullName":"汇票","id":"3"}], payStatusOptions: [{ "fullName": "现金", "id": "1" }, { "fullName": "转账", "id": "2" }, { "fullName": "汇票", "id": "3" }],
payStatusProps:{"label":"fullName","value":"id" }, payStatusProps: { "label": "fullName", "value": "id" },
} }
},
computed: {},
watch: {},
created() {
},
mounted() { },
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(formData, modelId, defaultValue)
})
})
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
}, },
computed: {},
watch: {},
created() {
goBack() {
this.$emit('refresh')
}, },
mounted() {}, init(id) {
methods: { this.dataForm.id = id || 0;
toDetail(defaultValue, modelId) { this.visible = true;
if (!defaultValue) return this.$nextTick(() => {
getConfigData(modelId).then(res => { if (this.dataForm.id) {
if (!res.data || !res.data.formData) return this.loading = true
let formData = JSON.parse(res.data.formData) request({
formData.popupType = 'general' url: '/api/example/BillTable/detail/' + this.dataForm.id,
this.detailVisible = true method: 'get'
this.$nextTick(() => { }).then(res => {
this.$refs.Detail.init(formData, modelId, defaultValue) this.dataInfo(res.data)
this.loading = false
}) })
}) }
},
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
},
goBack() { })
this.$emit('refresh')
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/example/BillTable/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
})
},
}, },
} },
}
</script> </script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,153 @@
<template>
<el-dialog title="选择空间" :close-on-click-modal="false" :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center"
lock-scroll append-to-body width="800px">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="10">
<el-form-item label="关键词">
<el-input v-model="keyword" placeholder="请输入关键词查询" clearable @keyup.enter.native="search()" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()">{{ $t('common.search') }}
</el-button>
<el-button icon="el-icon-refresh-right" @click="refresh()">{{ $t('common.reset') }}
</el-button>
</el-form-item>
</el-col>
</el-form>
<div class="JNPF-common-search-box-right">
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="search()" />
</el-tooltip>
</div>
</el-row>
<JNPF-table v-loading="listLoading" :data="list" hasC @selection-change="handleSelectionChange" :border="false">
<el-table-column prop="leaseNumber" label="租赁单号" align="center" sortable>
</el-table-column>
<el-table-column prop="equipmentNumber" label="设备编码" align="center">
</el-table-column>
<el-table-column prop="equipmentName" label="设备名称" align="center">
</el-table-column>
<el-table-column prop="startTime" label="开始时间" align="center" sortable>
<template slot-scope="scope">
<span>{{ formatTimestamp(scope.row.startTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="endTime" label="结束时间" align="center">
<template slot-scope="scope">
<span>{{ formatTimestamp(scope.row.endTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="totalRentalPrice" label="租金总价" align="center">
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="init" />
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">{{ $t('common.cancelButton') }}</el-button>
<el-button type="primary" @click="select()">{{ $t('common.confirmButton') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import {
GoodsList
} from '@/api/extend/order'
export default {
data() {
return {
visible: false,
listLoading: true,
keyword: '',
list: [],
total: 0,
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
excludeIdList: [],
checked: [],
contractId: ''
}
},
methods: {
formatTimestamp(timestamp) {
const date = new Date(timestamp);
return date.toLocaleString();
},
init(excludeIdList, contractId) {
this.visible = true
this.listLoading = true
if (excludeIdList && excludeIdList instanceof Array) {
this.excludeIdList = excludeIdList;
}
this.contractId = contractId
let query = {
...this.listQuery,
keyword: this.keyword,
excludeIdList: this.excludeIdList,
contractId: contractId,
}
console.log();
request({
url: `/api/example/Contract/getDevicesById`,
method: 'post',
data: query,
}).then(res => {
this.list = res.data.list
this.listLoading = false
this.total = res.data.list.length
if (res.data.list.length != 0) {
this.contractId = res.data.list[0].id
}
})
},
refresh() {
this.keyword = ''
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.init(this.excludeIdList, this.contractId)
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.init(this.excludeIdList, this.contractId)
},
select() {
if (!this.checked.length) return
this.visible = false
this.$emit('refreshDataList', this.checked)
},
handleSelectionChange(val) {
this.checked = val
}
}
}
</script>
<style lang="scss" scoped>
>>>.el-dialog__body {
height: 70vh;
padding: 0 0 10px !important;
display: flex;
flex-direction: column;
overflow: hidden;
.JNPF-common-search-box {
margin-bottom: 0;
.JNPF-common-search-box-right {
padding: 10px 10px 0 0;
}
}
}
</style>

@ -46,7 +46,7 @@
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.contractId" :rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.contractId"
placeholder="请选择合同" propsValue="id" popupWidth="800px" popupTitle="选择数据" placeholder="请选择合同" propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='contract_name' field='contractId' popupType="dialog" relationField='contract_name' field='contractId'
interfaceId="585026575217461317" :pageSize="20" interfaceId="585391932604156741" :pageSize="20"
:columnOptions="contractIdcolumnOptions" clearable :style='{ "width": "100%" }'> :columnOptions="contractIdcolumnOptions" clearable :style='{ "width": "100%" }'>
</JnpfPopupSelect> </JnpfPopupSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
@ -139,8 +139,8 @@
<el-col :span="8"> <el-col :span="8">
<jnpf-form-tip-item label="确认人" prop="confirmPersonnel"> <jnpf-form-tip-item label="确认人" prop="confirmPersonnel">
<JnpfInput v-model="dataForm.confirmPersonnel" <JnpfInput v-model="dataForm.confirmPersonnel"
@change="changeData('confirmPersonnel', -1)" placeholder="自动带入" disabled clearable @change="changeData('confirmPersonnel', -1)" placeholder="确认时自动带入" disabled
:style='{ "width": "100%" }'> clearable :style='{ "width": "100%" }'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
@ -149,7 +149,7 @@
<jnpf-form-tip-item label="确认时间" prop="confirmTime"> <jnpf-form-tip-item label="确认时间" prop="confirmTime">
<JnpfDatePicker v-model="dataForm.confirmTime" @change="changeData('confirmTime', -1)" <JnpfDatePicker v-model="dataForm.confirmTime" @change="changeData('confirmTime', -1)"
:startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')" :startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')"
placeholder="默认当前单据创建时间" disabled clearable :style='{ "width": "100%" }' type="date" placeholder="此单据确认的时间" disabled clearable :style='{ "width": "100%" }' type="date"
format="yyyy-MM-dd"> format="yyyy-MM-dd">
</JnpfDatePicker> </JnpfDatePicker>
</jnpf-form-tip-item> </jnpf-form-tip-item>
@ -202,8 +202,9 @@
<JnpfDatePicker v-model="scope.row.startTime" <JnpfDatePicker v-model="scope.row.startTime"
@change="changeData('billspacedetail-startTime', scope.$index)" @change="changeData('billspacedetail-startTime', scope.$index)"
:startTime="dateTime(false, 1, 1, '', '')" :startTime="dateTime(false, 1, 1, '', '')"
:endTime="dateTime(false, 1, 1, '', '')" placeholder="添加自动带入" :endTime="dateTime(false, 1, 1, '', '')"
disabled clearable :style='{ "width": "100%" }' type="date" placeholder="添加自动带入" disabled clearable
:style='{ "width": "100%" }' type="date"
format="yyyy-MM-dd"> format="yyyy-MM-dd">
</JnpfDatePicker> </JnpfDatePicker>
</template> </template>
@ -217,9 +218,9 @@
<JnpfDatePicker v-model="scope.row.endTime" <JnpfDatePicker v-model="scope.row.endTime"
@change="changeData('billspacedetail-endTime', scope.$index)" @change="changeData('billspacedetail-endTime', scope.$index)"
:startTime="dateTime(false, 1, 1, '', '')" :startTime="dateTime(false, 1, 1, '', '')"
:endTime="dateTime(false, 1, 1, '', '')" placeholder="请选择结束时间" :endTime="dateTime(false, 1, 1, '', '')"
clearable :style='{ "width": "100%" }' type="date" placeholder="请选择结束时间" clearable :style='{ "width": "100%" }'
format="yyyy-MM-dd"> type="date" format="yyyy-MM-dd">
</JnpfDatePicker> </JnpfDatePicker>
</template> </template>
</el-table-column> </el-table-column>
@ -230,7 +231,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInputNumber v-model="scope.row.billAmount" <JnpfInputNumber v-model="scope.row.billAmount"
@change="changeData('billspacedetail-billAmount', scope.$index)" @change="changeData('billspacedetail-billAmount', scope.$index)"
placeholder="账单金额" :step="1"> placeholder="账单金额" :step="1" :min="0">
</JnpfInputNumber> </JnpfInputNumber>
</template> </template>
</el-table-column> </el-table-column>
@ -253,7 +254,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="table-actions" @click="addbillspacedetailList()"> <div class="table-actions" @click="choiceSpaces()">
<el-button type="text" icon="el-icon-plus">添加</el-button> <el-button type="text" icon="el-icon-plus">添加</el-button>
</div> </div>
</jnpf-form-tip-item> </jnpf-form-tip-item>
@ -312,9 +313,9 @@
<JnpfDatePicker v-model="scope.row.startTime" <JnpfDatePicker v-model="scope.row.startTime"
@change="changeData('billdevicedeatial-startTime', scope.$index)" @change="changeData('billdevicedeatial-startTime', scope.$index)"
:startTime="dateTime(false, 1, 1, '', '')" :startTime="dateTime(false, 1, 1, '', '')"
:endTime="dateTime(false, 1, 1, '', '')" placeholder="请选择开始时间" :endTime="dateTime(false, 1, 1, '', '')"
clearable :style='{ "width": "100%" }' type="date" placeholder="请选择开始时间" clearable :style='{ "width": "100%" }'
format="yyyy-MM-dd"> type="date" format="yyyy-MM-dd">
</JnpfDatePicker> </JnpfDatePicker>
</template> </template>
</el-table-column> </el-table-column>
@ -327,9 +328,9 @@
<JnpfDatePicker v-model="scope.row.endTime" <JnpfDatePicker v-model="scope.row.endTime"
@change="changeData('billdevicedeatial-endTime', scope.$index)" @change="changeData('billdevicedeatial-endTime', scope.$index)"
:startTime="dateTime(false, 1, 1, '', '')" :startTime="dateTime(false, 1, 1, '', '')"
:endTime="dateTime(false, 1, 1, '', '')" placeholder="请选择结束时间" :endTime="dateTime(false, 1, 1, '', '')"
clearable :style='{ "width": "100%" }' type="date" placeholder="请选择结束时间" clearable :style='{ "width": "100%" }'
format="yyyy-MM-dd"> type="date" format="yyyy-MM-dd">
</JnpfDatePicker> </JnpfDatePicker>
</template> </template>
</el-table-column> </el-table-column>
@ -340,7 +341,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInputNumber v-model="scope.row.billAmount" <JnpfInputNumber v-model="scope.row.billAmount"
@change="changeData('billdevicedeatial-billAmount', scope.$index)" @change="changeData('billdevicedeatial-billAmount', scope.$index)"
placeholder="账单金额" :step="1"> placeholder="账单金额" :step="1" :min="0">
</JnpfInputNumber> </JnpfInputNumber>
</template> </template>
</el-table-column> </el-table-column>
@ -363,7 +364,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="table-actions" @click="addbilldevicedeatialList()"> <div class="table-actions" @click="choicedevices()">
<el-button type="text" icon="el-icon-plus">添加</el-button> <el-button type="text" icon="el-icon-plus">添加</el-button>
</div> </div>
</jnpf-form-tip-item> </jnpf-form-tip-item>
@ -397,9 +398,9 @@
<JnpfDatePicker v-model="scope.row.startTime" <JnpfDatePicker v-model="scope.row.startTime"
@change="changeData('billotherdeatial-startTime', scope.$index)" @change="changeData('billotherdeatial-startTime', scope.$index)"
:startTime="dateTime(false, 1, 1, '', '')" :startTime="dateTime(false, 1, 1, '', '')"
:endTime="dateTime(false, 1, 1, '', '')" placeholder="请选择开始时间" :endTime="dateTime(false, 1, 1, '', '')"
clearable :style='{ "width": "100%" }' type="date" placeholder="请选择开始时间" clearable :style='{ "width": "100%" }'
format="yyyy-MM-dd"> type="date" format="yyyy-MM-dd">
</JnpfDatePicker> </JnpfDatePicker>
</template> </template>
</el-table-column> </el-table-column>
@ -412,9 +413,9 @@
<JnpfDatePicker v-model="scope.row.endTime" <JnpfDatePicker v-model="scope.row.endTime"
@change="changeData('billotherdeatial-endTime', scope.$index)" @change="changeData('billotherdeatial-endTime', scope.$index)"
:startTime="dateTime(false, 1, 1, '', '')" :startTime="dateTime(false, 1, 1, '', '')"
:endTime="dateTime(false, 1, 1, '', '')" placeholder="请选择结束时间" :endTime="dateTime(false, 1, 1, '', '')"
clearable :style='{ "width": "100%" }' type="date" placeholder="请选择结束时间" clearable :style='{ "width": "100%" }'
format="yyyy-MM-dd"> type="date" format="yyyy-MM-dd">
</JnpfDatePicker> </JnpfDatePicker>
</template> </template>
</el-table-column> </el-table-column>
@ -425,7 +426,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInputNumber v-model="scope.row.billAmount" <JnpfInputNumber v-model="scope.row.billAmount"
@change="changeData('billotherdeatial-billAmount', scope.$index)" @change="changeData('billotherdeatial-billAmount', scope.$index)"
placeholder="账单金额" :step="1"> placeholder="账单金额" :step="1" :min="0">
</JnpfInputNumber> </JnpfInputNumber>
</template> </template>
</el-table-column> </el-table-column>
@ -461,6 +462,8 @@
</el-form> </el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog" <SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
@select="addForSelect" @close="selectDialogVisible = false" /> @select="addForSelect" @close="selectDialogVisible = false" />
<Spaces v-if="spacesVisible" ref="spacesBox" @refreshDataList="initSpaceList" />
<Devices v-if="devicesVisible" ref="devicesBox" @refreshDataList="initDeviceList" />
</el-row> </el-row>
</div> </div>
</transition> </transition>
@ -476,11 +479,15 @@ import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize' import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js' import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
import { thousandsFormat } from "@/components/Generator/utils/index" import { thousandsFormat } from "@/components/Generator/utils/index"
import Spaces from '@/views/scm/billtable/spaces'
import Devices from '@/views/scm/billtable/devices'
export default { export default {
components: {}, components: { Spaces ,Devices},
props: [], props: [],
data() { data() {
return { return {
spacesVisible: false,
devicesVisible: false,
dataFormSubmitType: 0, dataFormSubmitType: 0,
continueBtnLoading: false, continueBtnLoading: false,
index: 0, index: 0,
@ -580,7 +587,7 @@ export default {
version: 0, version: 0,
}, },
tableRequiredData: {}, tableRequiredData: {},
activegecbmb: '3KzarC2', activegecbmb: '1',
dataRule: dataRule:
{ {
contractId: [ contractId: [
@ -845,7 +852,7 @@ export default {
}, },
// //
initDefaultData() { initDefaultData() {
this.dataForm.confirmTime = new Date().getTime() // this.dataForm.confirmTime = new Date().getTime()
}, },
// //
@ -1102,6 +1109,51 @@ export default {
} }
this.childIndex = -1 this.childIndex = -1
}, },
choiceSpaces() {
if (this.dataForm.contractId == undefined) {
this.$message.error('请先选择合同名称!');
return;
}
this.spacesVisible = true
let excludeIdList = [];
for (let i = 0; i < this.dataForm.billspacedetailList.length; i++) {
excludeIdList.push(this.dataForm.billspacedetailList[i].storageId);
}
this.$nextTick(() => {
this.$refs.spacesBox.init(excludeIdList, this.dataForm.contractId)
})
},
initSpaceList(list) {
for (let i = 0; i < list.length; i++) {
const e = list[i];
this.dataForm.billspacedetailList.push(e)
}
},
choicedevices() {
if (this.dataForm.contractId == undefined) {
this.$message.error('请先选择合同名称!');
return;
}
this.devicesVisible = true
let excludeIdList = [];
for (let i = 0; i < this.dataForm.billdevicedeatialList.length; i++) {
excludeIdList.push(this.dataForm.billdevicedeatialList[i].storageId);
}
this.$nextTick(() => {
this.$refs.devicesBox.init(excludeIdList, this.dataForm.contractId)
})
},
initDeviceList(list) {
for (let i = 0; i < list.length; i++) {
const e = list[i];
this.dataForm.billdevicedeatialList.push(e)
}
},
}, },
} }

@ -0,0 +1,151 @@
<template>
<el-dialog title="选择空间" :close-on-click-modal="false" :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center"
lock-scroll append-to-body width="800px">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="10">
<el-form-item label="关键词">
<el-input v-model="keyword" placeholder="请输入关键词查询" clearable @keyup.enter.native="search()" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()">{{ $t('common.search') }}
</el-button>
<el-button icon="el-icon-refresh-right" @click="refresh()">{{ $t('common.reset') }}
</el-button>
</el-form-item>
</el-col>
</el-form>
<div class="JNPF-common-search-box-right">
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="search()" />
</el-tooltip>
</div>
</el-row>
<JNPF-table v-loading="listLoading" :data="list" hasC @selection-change="handleSelectionChange" :border="false">
<el-table-column prop="spaceNumber" label="空间ID" align="center" sortable>
</el-table-column>
<el-table-column prop="spaceId" label="空间名称" align="center">
</el-table-column>
<el-table-column prop="startTime" label="开始时间" align="center" sortable>
<template slot-scope="scope">
<span>{{ formatTimestamp(scope.row.startTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="endTime" label="结束时间" align="center">
<template slot-scope="scope">
<span>{{ formatTimestamp(scope.row.endTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="totalRentalPrice" label="租金总价" align="center">
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="init" />
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">{{ $t('common.cancelButton') }}</el-button>
<el-button type="primary" @click="select()">{{ $t('common.confirmButton') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import {
GoodsList
} from '@/api/extend/order'
export default {
data() {
return {
visible: false,
listLoading: true,
keyword: '',
list: [],
total: 0,
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
excludeIdList: [],
checked: [],
contractId: ''
}
},
methods: {
formatTimestamp(timestamp) {
const date = new Date(timestamp);
return date.toLocaleString();
},
init(excludeIdList, contractId) {
this.visible = true
this.listLoading = true
if (excludeIdList && excludeIdList instanceof Array) {
this.excludeIdList = excludeIdList;
}
this.contractId = contractId
let query = {
...this.listQuery,
keyword: this.keyword,
excludeIdList: this.excludeIdList,
contractId: contractId,
}
console.log();
request({
url: `/api/example/Contract/getSpacesById`,
method: 'post',
data: query,
}).then(res => {
this.list = res.data.list
this.listLoading = false
this.total = res.data.list.length
if (res.data.list.length != 0) {
this.contractId = res.data.list[0].id
}
})
},
refresh() {
this.keyword = ''
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.init(this.excludeIdList, this.contractId)
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.init(this.excludeIdList, this.contractId)
},
select() {
if (!this.checked.length) return
this.visible = false
this.$emit('refreshDataList', this.checked)
},
handleSelectionChange(val) {
this.checked = val
}
}
}
</script>
<style lang="scss" scoped>
>>>.el-dialog__body {
height: 70vh;
padding: 0 0 10px !important;
display: flex;
flex-direction: column;
overflow: hidden;
.JNPF-common-search-box {
margin-bottom: 0;
.JNPF-common-search-box-right {
padding: 10px 10px 0 0;
}
}
}
</style>

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save