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

master
jiyufei 3 months ago
parent 78ccd8168b
commit cb06375025

@ -0,0 +1,16 @@
package jnpf.mapper;
import jnpf.entity.BillTableEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* BillTable
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-22
*/
public interface BillTableMapper extends BaseMapper<BillTableEntity> {
}

@ -0,0 +1,16 @@
package jnpf.mapper;
import jnpf.entity.BilldevicedeatialEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* BillTable
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-22
*/
public interface BilldevicedeatialMapper extends BaseMapper<BilldevicedeatialEntity> {
}

@ -0,0 +1,16 @@
package jnpf.mapper;
import jnpf.entity.BillotherdeatialEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* BillTable
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-22
*/
public interface BillotherdeatialMapper extends BaseMapper<BillotherdeatialEntity> {
}

@ -0,0 +1,16 @@
package jnpf.mapper;
import jnpf.entity.BillspacedetailEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* BillTable
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-22
*/
public interface BillspacedetailMapper extends BaseMapper<BillspacedetailEntity> {
}

@ -0,0 +1,65 @@
package jnpf.service;
import jnpf.model.billtable.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* BillTable
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-22
*/
public interface BillTableService extends IService<BillTableEntity> {
List<BillTableEntity> getList(BillTablePagination billTablePagination);
List<BillTableEntity> getTypeList(BillTablePagination billTablePagination, String dataType);
BillTableEntity getInfo(String id);
void delete(BillTableEntity entity);
void create(BillTableEntity entity);
boolean update(String id, BillTableEntity entity);
//子表方法
List<BillspacedetailEntity> getBillspacedetailList(String id, BillTablePagination billTablePagination);
List<BillspacedetailEntity> getBillspacedetailList(String id);
List<BilldevicedeatialEntity> getBilldevicedeatialList(String id, BillTablePagination billTablePagination);
List<BilldevicedeatialEntity> getBilldevicedeatialList(String id);
List<BillotherdeatialEntity> getBillotherdeatialList(String id, BillTablePagination billTablePagination);
List<BillotherdeatialEntity> getBillotherdeatialList(String id);
//副表数据方法
String checkForm(BillTableForm form, int i);
String saveOrUpdate(BillTableForm billTableForm, String id, boolean isSave);
/**
*
*
* @param id id
* @return
*/
String billConfirm(String id);
/**
*
*
* @param id id
* @param billTableForm
* @return
*/
String entry(String id, BillTableForm billTableForm);
}

@ -0,0 +1,18 @@
package jnpf.service;
import jnpf.model.billtable.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* BillTable
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-22
*/
public interface BilldevicedeatialService extends IService<BilldevicedeatialEntity> {
QueryWrapper<BilldevicedeatialEntity> getChild(BillTablePagination pagination,QueryWrapper<BilldevicedeatialEntity> billdevicedeatialQueryWrapper);
}

@ -0,0 +1,18 @@
package jnpf.service;
import jnpf.model.billtable.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* BillTable
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-22
*/
public interface BillotherdeatialService extends IService<BillotherdeatialEntity> {
QueryWrapper<BillotherdeatialEntity> getChild(BillTablePagination pagination,QueryWrapper<BillotherdeatialEntity> billotherdeatialQueryWrapper);
}

@ -0,0 +1,18 @@
package jnpf.service;
import jnpf.model.billtable.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* BillTable
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-22
*/
public interface BillspacedetailService extends IService<BillspacedetailEntity> {
QueryWrapper<BillspacedetailEntity> getChild(BillTablePagination pagination,QueryWrapper<BillspacedetailEntity> billspacedetailQueryWrapper);
}

@ -65,4 +65,12 @@ public interface ContractService extends IService<ContractEntity> {
* @return name
*/
String findNameById(String id);
/**
* id
*
* @param id id
* @return code
*/
String findCodeById(String id);
}

@ -0,0 +1,726 @@
package jnpf.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import jnpf.entity.*;
import jnpf.mapper.BillTableMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.billtable.*;
import java.math.BigDecimal;
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 java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.regex.Pattern;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
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.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
import javax.annotation.Resource;
/**
* BillTable
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-22
*/
@Service
@Slf4j
public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTableEntity> implements BillTableService {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private BillspacedetailService billspacedetailService;
@Autowired
private BilldevicedeatialService billdevicedeatialService;
@Autowired
private BillotherdeatialService billotherdeatialService;
@Resource
private EnterpriseMerchantsService enterpriseMerchantsService;
@Resource
private ContractService contractService;
@Override
public List<BillTableEntity> getList(BillTablePagination billTablePagination) {
return getTypeList(billTablePagination, billTablePagination.getDataType());
}
/**
*
*/
@Override
public List<BillTableEntity> getTypeList(BillTablePagination billTablePagination, String dataType) {
String userId = userProvider.get().getUserId();
List<String> AllIdList = new ArrayList();
List<List<String>> intersectionList = new ArrayList<>();
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String columnData = !isPc ? BillTableConstant.getAppColumnData() : BillTableConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total = 0;
int billTableNum = 0;
QueryWrapper<BillTableEntity> billTableQueryWrapper = new QueryWrapper<>();
int billdevicedeatialNum = 0;
QueryWrapper<BilldevicedeatialEntity> billdevicedeatialQueryWrapper = new QueryWrapper<>();
int billotherdeatialNum = 0;
QueryWrapper<BillotherdeatialEntity> billotherdeatialQueryWrapper = new QueryWrapper<>();
int billspacedetailNum = 0;
QueryWrapper<BillspacedetailEntity> billspacedetailQueryWrapper = new QueryWrapper<>();
long billdevicedeatialcount = billdevicedeatialService.count();
long billotherdeatialcount = billotherdeatialService.count();
long billspacedetailcount = billspacedetailService.count();
List<String> allSuperIDlist = new ArrayList<>();
String superOp = "";
if (ObjectUtil.isNotEmpty(billTablePagination.getSuperQueryJson())) {
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = billTablePagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<BillTableEntity> billTableSuperWrapper = new QueryWrapper<>();
billTableSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(billTableSuperWrapper, BillTableEntity.class, queryJson, "0"));
int billTableNum1 = billTableSuperWrapper.getExpression().getNormal().size();
if (billTableNum1 > 0) {
List<String> billTableList = this.list(billTableSuperWrapper).stream().map(BillTableEntity::getId).collect(Collectors.toList());
allSuperList.addAll(billTableList);
intersectionSuperList.add(billTableList);
superNum++;
}
String BilldevicedeatialTable = "yq_bill_device_deatial";
boolean BilldevicedeatialHasSql = queryJson.contains(BilldevicedeatialTable);
List<String> billdevicedeatialList = generaterSwapUtil.selectIdsByChildCondition(BillTableConstant.getTableList(), BilldevicedeatialTable, queryJson, null);
if (BilldevicedeatialHasSql) {
allSuperList.addAll(billdevicedeatialList);
intersectionSuperList.add(billdevicedeatialList);
superNum++;
}
String BillotherdeatialTable = "yq_bill_other_deatial";
boolean BillotherdeatialHasSql = queryJson.contains(BillotherdeatialTable);
List<String> billotherdeatialList = generaterSwapUtil.selectIdsByChildCondition(BillTableConstant.getTableList(), BillotherdeatialTable, queryJson, null);
if (BillotherdeatialHasSql) {
allSuperList.addAll(billotherdeatialList);
intersectionSuperList.add(billotherdeatialList);
superNum++;
}
String BillspacedetailTable = "yq_bill_space_detail";
boolean BillspacedetailHasSql = queryJson.contains(BillspacedetailTable);
List<String> billspacedetailList = generaterSwapUtil.selectIdsByChildCondition(BillTableConstant.getTableList(), BillspacedetailTable, queryJson, null);
if (BillspacedetailHasSql) {
allSuperList.addAll(billspacedetailList);
intersectionSuperList.add(billspacedetailList);
superNum++;
}
superOp = superNum > 0 ? superJsonModel.getMatchLogic() : "";
//and or
if (superOp.equalsIgnoreCase("and")) {
allSuperIDlist = generaterSwapUtil.getIntersection(intersectionSuperList);
} else {
allSuperIDlist = allSuperList;
}
}
List<String> allRuleIDlist = new ArrayList<>();
String ruleOp = "";
if (ObjectUtil.isNotEmpty(ruleJson)) {
List<String> allRuleList = new ArrayList<>();
List<List<String>> intersectionRuleList = new ArrayList<>();
SuperJsonModel ruleJsonModel = JsonUtil.getJsonToBean(ruleJson, SuperJsonModel.class);
int ruleNum = 0;
QueryWrapper<BillTableEntity> billTableSuperWrapper = new QueryWrapper<>();
billTableSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(billTableSuperWrapper, BillTableEntity.class, ruleJson, "0"));
int billTableNum1 = billTableSuperWrapper.getExpression().getNormal().size();
if (billTableNum1 > 0) {
List<String> billTableList = this.list(billTableSuperWrapper).stream().map(BillTableEntity::getId).collect(Collectors.toList());
allRuleList.addAll(billTableList);
intersectionRuleList.add(billTableList);
ruleNum++;
}
String BilldevicedeatialTable = "yq_bill_device_deatial";
boolean BilldevicedeatialHasSql = ruleJson.contains(BilldevicedeatialTable);
List<String> billdevicedeatialList = generaterSwapUtil.selectIdsByChildCondition(BillTableConstant.getTableList(), BilldevicedeatialTable, ruleJson, null);
if (BilldevicedeatialHasSql) {
allRuleList.addAll(billdevicedeatialList);
intersectionRuleList.add(billdevicedeatialList);
ruleNum++;
}
String BillotherdeatialTable = "yq_bill_other_deatial";
boolean BillotherdeatialHasSql = ruleJson.contains(BillotherdeatialTable);
List<String> billotherdeatialList = generaterSwapUtil.selectIdsByChildCondition(BillTableConstant.getTableList(), BillotherdeatialTable, ruleJson, null);
if (BillotherdeatialHasSql) {
allRuleList.addAll(billotherdeatialList);
intersectionRuleList.add(billotherdeatialList);
ruleNum++;
}
String BillspacedetailTable = "yq_bill_space_detail";
boolean BillspacedetailHasSql = ruleJson.contains(BillspacedetailTable);
List<String> billspacedetailList = generaterSwapUtil.selectIdsByChildCondition(BillTableConstant.getTableList(), BillspacedetailTable, ruleJson, null);
if (BillspacedetailHasSql) {
allRuleList.addAll(billspacedetailList);
intersectionRuleList.add(billspacedetailList);
ruleNum++;
}
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
//and or
if (ruleOp.equalsIgnoreCase("and")) {
allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList);
} else {
allRuleIDlist = allRuleList;
}
}
boolean pcPermission = false;
boolean appPermission = false;
if (isPc && pcPermission) {
if (!userProvider.get().getIsAdministrator()) {
Object billTableObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(billTableQueryWrapper, BillTableEntity.class, billTablePagination.getMenuId(), "0"));
if (ObjectUtil.isEmpty(billTableObj)) {
return new ArrayList<>();
} else {
billTableQueryWrapper = (QueryWrapper<BillTableEntity>) billTableObj;
if (billTableQueryWrapper.getExpression().getNormal().size() > 0) {
billTableNum++;
}
}
Object billdevicedeatialObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(billdevicedeatialQueryWrapper, BilldevicedeatialEntity.class, billTablePagination.getMenuId(), "0"));
if (ObjectUtil.isEmpty(billdevicedeatialObj)) {
return new ArrayList<>();
} else {
billdevicedeatialQueryWrapper = (QueryWrapper<BilldevicedeatialEntity>) billdevicedeatialObj;
if (billdevicedeatialQueryWrapper.getExpression().getNormal().size() > 0) {
billdevicedeatialNum++;
}
}
Object billotherdeatialObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(billotherdeatialQueryWrapper, BillotherdeatialEntity.class, billTablePagination.getMenuId(), "0"));
if (ObjectUtil.isEmpty(billotherdeatialObj)) {
return new ArrayList<>();
} else {
billotherdeatialQueryWrapper = (QueryWrapper<BillotherdeatialEntity>) billotherdeatialObj;
if (billotherdeatialQueryWrapper.getExpression().getNormal().size() > 0) {
billotherdeatialNum++;
}
}
Object billspacedetailObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(billspacedetailQueryWrapper, BillspacedetailEntity.class, billTablePagination.getMenuId(), "0"));
if (ObjectUtil.isEmpty(billspacedetailObj)) {
return new ArrayList<>();
} else {
billspacedetailQueryWrapper = (QueryWrapper<BillspacedetailEntity>) billspacedetailObj;
if (billspacedetailQueryWrapper.getExpression().getNormal().size() > 0) {
billspacedetailNum++;
}
}
}
}
if (!isPc && appPermission) {
if (!userProvider.get().getIsAdministrator()) {
Object billTableObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(billTableQueryWrapper, BillTableEntity.class, billTablePagination.getMenuId(), "0"));
if (ObjectUtil.isEmpty(billTableObj)) {
return new ArrayList<>();
} else {
billTableQueryWrapper = (QueryWrapper<BillTableEntity>) billTableObj;
if (billTableQueryWrapper.getExpression().getNormal().size() > 0) {
billTableNum++;
}
}
Object billdevicedeatialObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(billdevicedeatialQueryWrapper, BilldevicedeatialEntity.class, billTablePagination.getMenuId(), "0"));
if (ObjectUtil.isEmpty(billdevicedeatialObj)) {
return new ArrayList<>();
} else {
billdevicedeatialQueryWrapper = (QueryWrapper<BilldevicedeatialEntity>) billdevicedeatialObj;
if (billdevicedeatialQueryWrapper.getExpression().getNormal().size() > 0) {
billdevicedeatialNum++;
}
}
Object billotherdeatialObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(billotherdeatialQueryWrapper, BillotherdeatialEntity.class, billTablePagination.getMenuId(), "0"));
if (ObjectUtil.isEmpty(billotherdeatialObj)) {
return new ArrayList<>();
} else {
billotherdeatialQueryWrapper = (QueryWrapper<BillotherdeatialEntity>) billotherdeatialObj;
if (billotherdeatialQueryWrapper.getExpression().getNormal().size() > 0) {
billotherdeatialNum++;
}
}
Object billspacedetailObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(billspacedetailQueryWrapper, BillspacedetailEntity.class, billTablePagination.getMenuId(), "0"));
if (ObjectUtil.isEmpty(billspacedetailObj)) {
return new ArrayList<>();
} else {
billspacedetailQueryWrapper = (QueryWrapper<BillspacedetailEntity>) billspacedetailObj;
if (billspacedetailQueryWrapper.getExpression().getNormal().size() > 0) {
billspacedetailNum++;
}
}
}
}
if (isPc) {
if (ObjectUtil.isNotEmpty(billTablePagination.getCreationTime())) {
billTableNum++;
List CreationTimeList = JsonUtil.getJsonToList(billTablePagination.getCreationTime(), String.class);
Long fir = Long.valueOf(String.valueOf(CreationTimeList.get(0)));
Long sec = Long.valueOf(String.valueOf(CreationTimeList.get(1)));
billTableQueryWrapper.lambda().ge(BillTableEntity::getCreationTime, new Date(fir))
.le(BillTableEntity::getCreationTime, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
}
if (ObjectUtil.isNotEmpty(billTablePagination.getMerchantName())) {
billTableNum++;
String value = billTablePagination.getMerchantName() instanceof List ?
JsonUtil.getObjectToString(billTablePagination.getMerchantName()) :
String.valueOf(billTablePagination.getMerchantName());
billTableQueryWrapper.lambda().like(BillTableEntity::getMerchantName, value);
}
if (ObjectUtil.isNotEmpty(billTablePagination.getContractName())) {
billTableNum++;
String value = billTablePagination.getContractName() instanceof List ?
JsonUtil.getObjectToString(billTablePagination.getContractName()) :
String.valueOf(billTablePagination.getContractName());
billTableQueryWrapper.lambda().like(BillTableEntity::getContractName, value);
}
if (ObjectUtil.isNotEmpty(billTablePagination.getBillStatus())) {
billTableNum++;
List<String> idList = new ArrayList<>();
try {
String[][] billStatus = JsonUtil.getJsonToBean(billTablePagination.getBillStatus(), String[][].class);
for (int i = 0; i < billStatus.length; i++) {
if (billStatus[i].length > 0) {
idList.add(JsonUtil.getObjectToString(Arrays.asList(billStatus[i])));
}
}
} catch (Exception e1) {
try {
List<String> billStatus = JsonUtil.getJsonToList(billTablePagination.getBillStatus(), String.class);
if (billStatus.size() > 0) {
idList.addAll(billStatus);
}
} catch (Exception e2) {
idList.add(String.valueOf(billTablePagination.getBillStatus()));
}
}
billTableQueryWrapper.lambda().and(t -> {
idList.forEach(tt -> {
t.like(BillTableEntity::getBillStatus, tt).or();
});
});
}
}
if (billdevicedeatialNum > 0) {
List<String> billdevicedeatialIdList = billdevicedeatialService.list(billdevicedeatialQueryWrapper).stream().filter(t -> StringUtil.isNotEmpty(t.getBillNumber())).map(t -> t.getBillNumber()).collect(Collectors.toList());
long count = billdevicedeatialService.count();
if (count > 0) {
intersectionList.add(billdevicedeatialIdList);
}
AllIdList.addAll(billdevicedeatialIdList);
}
total += billdevicedeatialNum;
if (billotherdeatialNum > 0) {
List<String> billotherdeatialIdList = billotherdeatialService.list(billotherdeatialQueryWrapper).stream().filter(t -> StringUtil.isNotEmpty(t.getBillNumber())).map(t -> t.getBillNumber()).collect(Collectors.toList());
long count = billotherdeatialService.count();
if (count > 0) {
intersectionList.add(billotherdeatialIdList);
}
AllIdList.addAll(billotherdeatialIdList);
}
total += billotherdeatialNum;
if (billspacedetailNum > 0) {
List<String> billspacedetailIdList = billspacedetailService.list(billspacedetailQueryWrapper).stream().filter(t -> StringUtil.isNotEmpty(t.getBillNumber())).map(t -> t.getBillNumber()).collect(Collectors.toList());
long count = billspacedetailService.count();
if (count > 0) {
intersectionList.add(billspacedetailIdList);
}
AllIdList.addAll(billspacedetailIdList);
}
total += billspacedetailNum;
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total > 0) {
if (intersection.size() == 0) {
intersection.add("jnpfNullList");
}
billTableQueryWrapper.lambda().in(BillTableEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)) {
if (allSuperIDlist.size() == 0) {
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
billTableQueryWrapper.lambda().and(t -> t.in(BillTableEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)) {
if (allRuleIDlist.size() == 0) {
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
billTableQueryWrapper.lambda().and(t -> t.in(BillTableEntity::getId, finalAllRuleIDlist));
}
//假删除标志
billTableQueryWrapper.lambda().isNull(BillTableEntity::getDeleteMark);
//排序
if (StringUtil.isEmpty(billTablePagination.getSidx())) {
billTableQueryWrapper.lambda().orderByDesc(BillTableEntity::getId);
} else {
try {
String sidx = billTablePagination.getSidx();
String[] strs = sidx.split("_name");
BillTableEntity billTableEntity = new BillTableEntity();
Field declaredField = billTableEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
billTableQueryWrapper = "asc".equals(billTablePagination.getSort().toLowerCase()) ? billTableQueryWrapper.orderByAsc(value) : billTableQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if ("0".equals(dataType)) {
if ((total > 0 && AllIdList.size() > 0) || total == 0) {
Page<BillTableEntity> page = new Page<>(billTablePagination.getCurrentPage(), billTablePagination.getPageSize());
IPage<BillTableEntity> userIPage = this.page(page, billTableQueryWrapper);
return billTablePagination.setData(userIPage.getRecords(), userIPage.getTotal());
} else {
List<BillTableEntity> list = new ArrayList();
return billTablePagination.setData(list, list.size());
}
} else {
return this.list(billTableQueryWrapper);
}
}
@Override
public BillTableEntity getInfo(String id) {
QueryWrapper<BillTableEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(BillTableEntity::getId, id);
return this.getOne(queryWrapper);
}
@Override
public void create(BillTableEntity entity) {
this.save(entity);
}
@Override
public boolean update(String id, BillTableEntity entity) {
return this.updateById(entity);
}
@Override
public void delete(BillTableEntity entity) {
if (entity != null) {
this.removeById(entity.getId());
}
}
/**
* Billspacedetail
*/
@Override
public List<BillspacedetailEntity> getBillspacedetailList(String id, BillTablePagination billTablePagination) {
Map<String, Object> newtabMap = BillTableConstant.TABLEFIELDKEY.entrySet()
.stream().collect(Collectors.toMap(e -> e.getValue(), e -> e.getKey()));
String tableName = "billspacedetail";
tableName = newtabMap.get(tableName) == null ? tableName : newtabMap.get(tableName).toString();
QueryWrapper<BillspacedetailEntity> queryWrapper = new QueryWrapper<>();
queryWrapper = billspacedetailService.getChild(billTablePagination, queryWrapper);
queryWrapper.lambda().eq(BillspacedetailEntity::getBillNumber, id);
generaterSwapUtil.wrapperHandle(BillTableConstant.getColumnData(), BillTableConstant.getAppColumnData(), queryWrapper, BillspacedetailEntity.class, "sub", tableName);
return billspacedetailService.list(queryWrapper);
}
/**
* Billspacedetail
*/
@Override
public List<BillspacedetailEntity> getBillspacedetailList(String id) {
QueryWrapper<BillspacedetailEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(BillspacedetailEntity::getBillNumber, id);
return billspacedetailService.list(queryWrapper);
}
/**
* Billdevicedeatial
*/
@Override
public List<BilldevicedeatialEntity> getBilldevicedeatialList(String id, BillTablePagination billTablePagination) {
Map<String, Object> newtabMap = BillTableConstant.TABLEFIELDKEY.entrySet()
.stream().collect(Collectors.toMap(e -> e.getValue(), e -> e.getKey()));
String tableName = "billdevicedeatial";
tableName = newtabMap.get(tableName) == null ? tableName : newtabMap.get(tableName).toString();
QueryWrapper<BilldevicedeatialEntity> queryWrapper = new QueryWrapper<>();
queryWrapper = billdevicedeatialService.getChild(billTablePagination, queryWrapper);
queryWrapper.lambda().eq(BilldevicedeatialEntity::getBillNumber, id);
generaterSwapUtil.wrapperHandle(BillTableConstant.getColumnData(), BillTableConstant.getAppColumnData(), queryWrapper, BilldevicedeatialEntity.class, "sub", tableName);
return billdevicedeatialService.list(queryWrapper);
}
/**
* Billdevicedeatial
*/
@Override
public List<BilldevicedeatialEntity> getBilldevicedeatialList(String id) {
QueryWrapper<BilldevicedeatialEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(BilldevicedeatialEntity::getBillNumber, id);
return billdevicedeatialService.list(queryWrapper);
}
/**
* Billotherdeatial
*/
@Override
public List<BillotherdeatialEntity> getBillotherdeatialList(String id, BillTablePagination billTablePagination) {
Map<String, Object> newtabMap = BillTableConstant.TABLEFIELDKEY.entrySet()
.stream().collect(Collectors.toMap(e -> e.getValue(), e -> e.getKey()));
String tableName = "billotherdeatial";
tableName = newtabMap.get(tableName) == null ? tableName : newtabMap.get(tableName).toString();
QueryWrapper<BillotherdeatialEntity> queryWrapper = new QueryWrapper<>();
queryWrapper = billotherdeatialService.getChild(billTablePagination, queryWrapper);
queryWrapper.lambda().eq(BillotherdeatialEntity::getBillNumber, id);
generaterSwapUtil.wrapperHandle(BillTableConstant.getColumnData(), BillTableConstant.getAppColumnData(), queryWrapper, BillotherdeatialEntity.class, "sub", tableName);
return billotherdeatialService.list(queryWrapper);
}
/**
* Billotherdeatial
*/
@Override
public List<BillotherdeatialEntity> getBillotherdeatialList(String id) {
QueryWrapper<BillotherdeatialEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(BillotherdeatialEntity::getBillNumber, id);
return billotherdeatialService.list(queryWrapper);
}
/**
* i-0-1
*/
@Override
public String checkForm(BillTableForm form, int i) {
boolean isUp = StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id = "";
String countRecover = "";
if (isUp) {
id = form.getId();
}
//主表字段验证
// if (StringUtil.isEmpty(form.getMerchantId())) {
// return "商户名称不能为空";
// }
//子表字段验证
if (form.getBillspacedetailList() != null) {
}
if (form.getBilldevicedeatialList() != null) {
}
if (form.getBillotherdeatialList() != null) {
}
return countRecover;
}
/**
* ()
*
* @param id
* @param billTableForm
* @return
*/
@Override
@Transactional
public String saveOrUpdate(BillTableForm billTableForm, String id, boolean isSave) {
UserInfo userInfo = userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
billTableForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(BillTableConstant.getFormData(), billTableForm), BillTableForm.class);
BillTableEntity entity = JsonUtil.getJsonToBean(billTableForm, BillTableEntity.class);
ContractEntity contract = contractService.getInfo(billTableForm.getContractId());
//商户名称
String merchantName = enterpriseMerchantsService.findNameById(contract.getMerchantId());
String contractName = contractService.findNameById(billTableForm.getContractId());
entity.setMerchantId(contract.getMerchantId());
entity.setContractName(contractName);
entity.setMerchantName(merchantName);
entity.setContractNumber(contract.getContractNumber());
if (isSave) {
//同一个合同只能创建一条
LambdaQueryWrapper<BillTableEntity> wrapper = new LambdaQueryWrapper<>(BillTableEntity.class).eq(BillTableEntity::getContractId, billTableForm.getContractId());
if (ObjectUtil.isNotNull(this.getOne(wrapper))) {
return "已存在相同合同数据!";
}
//获取当前年月日
String currentDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
entity.setBillNumbe("ZD" + currentDate + RandomUtil.uuId().substring(0, 3));
String mainId = RandomUtil.uuId();
entity.setCreationTime(DateUtil.getNowDate());
entity.setCreateBy(userInfo.getUserId());
entity.setId(mainId);
entity.setVersion(0);
entity.setSubmitter(userInfo.getUserId());
entity.setSubmissionTime(DateUtil.getNowDate());
entity.setConfirmPersonnel(userInfo.getUserId());
entity.setConfirmTime(DateUtil.getNowDate());
} else {
entity.setCreationTime(DateUtil.getNowDate());
}
boolean result = this.saveOrUpdate(entity);
//Billspacedetail子表数据新增修改
if (!isSave) {
QueryWrapper<BillspacedetailEntity> BillspacedetailqueryWrapper = new QueryWrapper<>();
BillspacedetailqueryWrapper.lambda().eq(BillspacedetailEntity::getBillNumber, entity.getBillNumbe());
billspacedetailService.remove(BillspacedetailqueryWrapper);
}
if (billTableForm.getBillspacedetailList() != null) {
List<BillspacedetailEntity> tableField140 = JsonUtil.getJsonToList(billTableForm.getBillspacedetailList(), BillspacedetailEntity.class);
for (BillspacedetailEntity entitys : tableField140) {
entitys.setId(RandomUtil.uuId());
entitys.setBillNumber(entity.getBillNumbe());
if (isSave) {
} else {
}
billspacedetailService.saveOrUpdate(entitys);
}
}
//Billdevicedeatial子表数据新增修改
if (!isSave) {
QueryWrapper<BilldevicedeatialEntity> BilldevicedeatialqueryWrapper = new QueryWrapper<>();
BilldevicedeatialqueryWrapper.lambda().eq(BilldevicedeatialEntity::getBillNumber, entity.getBillNumbe());
billdevicedeatialService.remove(BilldevicedeatialqueryWrapper);
}
if (billTableForm.getBilldevicedeatialList() != null) {
List<BilldevicedeatialEntity> tableField158 = JsonUtil.getJsonToList(billTableForm.getBilldevicedeatialList(), BilldevicedeatialEntity.class);
for (BilldevicedeatialEntity entitys : tableField158) {
entitys.setId(RandomUtil.uuId());
entitys.setBillNumber(entity.getBillNumbe());
if (isSave) {
} else {
}
billdevicedeatialService.saveOrUpdate(entitys);
}
}
//Billotherdeatial子表数据新增修改
if (!isSave) {
QueryWrapper<BillotherdeatialEntity> BillotherdeatialqueryWrapper = new QueryWrapper<>();
BillotherdeatialqueryWrapper.lambda().eq(BillotherdeatialEntity::getBillNumber, entity.getBillNumbe());
billotherdeatialService.remove(BillotherdeatialqueryWrapper);
}
if (billTableForm.getBillotherdeatialList() != null) {
List<BillotherdeatialEntity> tableField166 = JsonUtil.getJsonToList(billTableForm.getBillotherdeatialList(), BillotherdeatialEntity.class);
for (BillotherdeatialEntity entitys : tableField166) {
entitys.setId(RandomUtil.uuId());
entitys.setBillNumber(entity.getBillNumbe());
if (isSave) {
} else {
}
billotherdeatialService.saveOrUpdate(entitys);
}
}
if (result) {
return "success";
}
return "fail";
}
@Override
public String billConfirm(String id) {
log.info("账单确认id{}", id);
BillTableEntity entity = this.getById(id);
entity.setBillStatus("20");
entity.setUpdateBy(userProvider.get().getUserId());
entity.setUpdateTime(DateUtil.getNowDate());
boolean result = this.updateById(entity);
if (result) {
return "确认成功";
}
return "确认失败";
}
@Override
public String entry(String id, BillTableForm billTableForm) {
log.info("结算录入,id:{},form:{}", id, billTableForm);
BillTableEntity entity = this.getById(id);
if (ObjectUtil.isNull(entity)) {
return "账单不存在";
}
entity.setPayStatus(billTableForm.getPayStatus().toString());
entity.setUpdateBy(userProvider.get().getUserId());
entity.setUpdateTime(DateUtil.getNowDate());
if (entity.getBillAmount().compareTo(entity.getPayAmount()) == 0) {
entity.setBillStatus("50");
} else {
//每次相加的支付金额
BigDecimal payAmount = entity.getPayAmount().add(billTableForm.getPayAmount());
//判断支付金额是否大于账单金额
if (entity.getBillAmount().compareTo(payAmount) < 0) {
return "支付金额不能大于账单金额,账单金额:" + entity.getBillAmount() + "元"
+ ",还需支付金额为:" + entity.getBillAmount().subtract(entity.getPayAmount());
}
entity.setPayAmount(payAmount);
if (entity.getBillAmount().compareTo(entity.getPayAmount()) != 0) {
entity.setBillStatus("40");
} else {
entity.setBillStatus("50");
}
}
if (this.updateById(entity)) {
if (entity.getPayAmount().compareTo(entity.getBillAmount()) < 0) {
return "结算录入成功,剩余支付额度为" + entity.getBillAmount().subtract(entity.getPayAmount());
}
return "结算录入成功";
}
return "结算录入失败";
}
}

@ -0,0 +1,59 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.BilldevicedeatialMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.billtable.*;
import java.math.BigDecimal;
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 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 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.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
/**
*
* BillTable
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-22
*/
@Service
public class BilldevicedeatialServiceImpl extends ServiceImpl<BilldevicedeatialMapper, BilldevicedeatialEntity> implements BilldevicedeatialService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
//子表过滤方法
@Override
public QueryWrapper<BilldevicedeatialEntity> getChild(BillTablePagination pagination, QueryWrapper<BilldevicedeatialEntity> billdevicedeatialQueryWrapper){
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String ruleQueryJson = isPc?BillTableConstant.getColumnData():BillTableConstant.getAppColumnData();
ColumnDataModel dataModel = JsonUtil.getJsonToBean(ruleQueryJson,ColumnDataModel.class);
String ruleJson = isPc?JsonUtil.getObjectToString(dataModel.getRuleList()):JsonUtil.getObjectToString(dataModel.getRuleListApp());
if(isPc){
}
return billdevicedeatialQueryWrapper;
}
}

@ -0,0 +1,59 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.BillotherdeatialMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.billtable.*;
import java.math.BigDecimal;
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 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 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.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
/**
*
* BillTable
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-22
*/
@Service
public class BillotherdeatialServiceImpl extends ServiceImpl<BillotherdeatialMapper, BillotherdeatialEntity> implements BillotherdeatialService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
//子表过滤方法
@Override
public QueryWrapper<BillotherdeatialEntity> getChild(BillTablePagination pagination, QueryWrapper<BillotherdeatialEntity> billotherdeatialQueryWrapper){
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String ruleQueryJson = isPc?BillTableConstant.getColumnData():BillTableConstant.getAppColumnData();
ColumnDataModel dataModel = JsonUtil.getJsonToBean(ruleQueryJson,ColumnDataModel.class);
String ruleJson = isPc?JsonUtil.getObjectToString(dataModel.getRuleList()):JsonUtil.getObjectToString(dataModel.getRuleListApp());
if(isPc){
}
return billotherdeatialQueryWrapper;
}
}

@ -0,0 +1,59 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.BillspacedetailMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.billtable.*;
import java.math.BigDecimal;
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 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 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.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
/**
*
* BillTable
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-22
*/
@Service
public class BillspacedetailServiceImpl extends ServiceImpl<BillspacedetailMapper, BillspacedetailEntity> implements BillspacedetailService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
//子表过滤方法
@Override
public QueryWrapper<BillspacedetailEntity> getChild(BillTablePagination pagination, QueryWrapper<BillspacedetailEntity> billspacedetailQueryWrapper){
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String ruleQueryJson = isPc?BillTableConstant.getColumnData():BillTableConstant.getAppColumnData();
ColumnDataModel dataModel = JsonUtil.getJsonToBean(ruleQueryJson,ColumnDataModel.class);
String ruleJson = isPc?JsonUtil.getObjectToString(dataModel.getRuleList()):JsonUtil.getObjectToString(dataModel.getRuleListApp());
if(isPc){
}
return billspacedetailQueryWrapper;
}
}

@ -576,14 +576,6 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEnt
}
}
public static void main(String[] args) {
String a = "[\"1\",\"2\",\"3\"]";
a = a.substring(1, a.length() - 1).replaceAll("\"", "");
String[] numbers = a.split(",");
String lastNumberStr = numbers[numbers.length - 1].trim();
System.out.println(lastNumberStr);
}
@Override
public String confirmation(ContractRequest request) {
log.info("合同确认id{}", request.getId());
@ -659,4 +651,13 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEnt
}
return contract.getContractName();
}
@Override
public String findCodeById(String id) {
ContractEntity contract = this.getById(id);
if (ObjectUtil.isNull(contract)) {
return "";
}
return contract.getContractNumber();
}
}

@ -0,0 +1,244 @@
package jnpf.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.exception.DataException;
import jnpf.permission.entity.UserEntity;
import jnpf.service.*;
import jnpf.entity.*;
import jnpf.util.*;
import jnpf.model.billtable.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.transaction.annotation.Transactional;
/**
* BillTable
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-22
*/
@Slf4j
@RestController
@Tag(name = "BillTable", description = "example")
@RequestMapping("/api/example/BillTable")
public class BillTableController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private BillTableService billTableService;
@Autowired
private BillspacedetailService billspacedetailService;
@Autowired
private BilldevicedeatialService billdevicedeatialService;
@Autowired
private BillotherdeatialService billotherdeatialService;
/**
*
*
* @param billTablePagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody BillTablePagination billTablePagination) throws IOException {
List<BillTableEntity> list = billTableService.getList(billTablePagination);
List<Map<String, Object>> realList = new ArrayList<>();
for (BillTableEntity entity : list) {
Map<String, Object> billTableMap = JsonUtil.entityToMap(entity);
billTableMap.put("id", billTableMap.get("id"));
//副表数据
//子表数据
List<BillspacedetailEntity> billspacedetailList = billTableService.getBillspacedetailList(entity.getId(), billTablePagination);
billTableMap.put("tableField140", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billspacedetailList)));
List<BilldevicedeatialEntity> billdevicedeatialList = billTableService.getBilldevicedeatialList(entity.getId(), billTablePagination);
billTableMap.put("tableField158", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billdevicedeatialList)));
List<BillotherdeatialEntity> billotherdeatialList = billTableService.getBillotherdeatialList(entity.getId(), billTablePagination);
billTableMap.put("tableField166", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billotherdeatialList)));
realList.add(billTableMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, BillTableConstant.getFormData(), BillTableConstant.getColumnData(), billTablePagination.getModuleId(), false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(billTablePagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param billTableForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid BillTableForm billTableForm) {
String b = billTableService.checkForm(billTableForm, 0);
if (StringUtil.isNotEmpty(b)) {
return ActionResult.fail(b);
}
String result = billTableService.saveOrUpdate(billTableForm, null, true);
if (result.contains("success")) {
return ActionResult.success("创建成功");
}
return ActionResult.fail(result);
}
/**
*
*
* @param id
* @param billTableForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid BillTableForm billTableForm,
@RequestParam(value = "isImport", required = false) boolean isImport) {
billTableForm.setId(id);
if (!isImport) {
String b = billTableService.checkForm(billTableForm, 1);
if (StringUtil.isNotEmpty(b)) {
return ActionResult.fail(b);
}
}
BillTableEntity entity = billTableService.getInfo(id);
if (entity != null) {
try {
billTableService.saveOrUpdate(billTableForm, id, false);
} catch (Exception e) {
return ActionResult.fail("修改数据失败");
}
return ActionResult.success("更新成功");
} else {
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
*
* @param id
* @return
*/
@Operation(summary = "删除")
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id) {
BillTableEntity entity = billTableService.getInfo(id);
if (entity != null) {
//假删除
entity.setDeleteMark(1);
billTableService.update(id, entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
*
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id) {
BillTableEntity entity = billTableService.getInfo(id);
if (entity == null) {
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> billTableMap = JsonUtil.entityToMap(entity);
billTableMap.put("id", billTableMap.get("id"));
//副表数据
//子表数据
List<BillspacedetailEntity> billspacedetailList = billTableService.getBillspacedetailList(entity.getId());
billTableMap.put("tableField140", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billspacedetailList)));
List<BilldevicedeatialEntity> billdevicedeatialList = billTableService.getBilldevicedeatialList(entity.getId());
billTableMap.put("tableField158", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billdevicedeatialList)));
List<BillotherdeatialEntity> billotherdeatialList = billTableService.getBillotherdeatialList(entity.getId());
billTableMap.put("tableField166", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billotherdeatialList)));
billTableMap = generaterSwapUtil.swapDataDetail(billTableMap, BillTableConstant.getFormData(), "585025890216314949", false);
return ActionResult.success(billTableMap);
}
/**
* ()
* 使-
*
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id) {
BillTableEntity entity = billTableService.getInfo(id);
if (entity == null) {
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> billTableMap = JsonUtil.entityToMap(entity);
billTableMap.put("id", billTableMap.get("id"));
//副表数据
//子表数据
List<BillspacedetailEntity> billspacedetailList = billTableService.getBillspacedetailList(entity.getId());
billTableMap.put("billspacedetailList", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billspacedetailList)));
List<BilldevicedeatialEntity> billdevicedeatialList = billTableService.getBilldevicedeatialList(entity.getId());
billTableMap.put("billdevicedeatialList", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billdevicedeatialList)));
List<BillotherdeatialEntity> billotherdeatialList = billTableService.getBillotherdeatialList(entity.getId());
billTableMap.put("billotherdeatialList", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billotherdeatialList)));
billTableMap = generaterSwapUtil.swapDataForm(billTableMap, BillTableConstant.getFormData(), BillTableConstant.TABLEFIELDKEY, BillTableConstant.TABLERENAMES);
return ActionResult.success(billTableMap);
}
@Operation(summary = "账单确认")
@GetMapping("/billConfirm/{id}")
public ActionResult billConfirm(@PathVariable("id") String id) {
return ActionResult.success(billTableService.billConfirm(id));
}
@PutMapping("/entry/{id}")
@Operation(summary = "结算录入")
public ActionResult entry(@PathVariable("id") String id, @RequestBody @Valid BillTableForm billTableForm) {
String result = billTableService.entry(id, billTableForm);
if (result.contains("成功")){
return ActionResult.success(result);
}
return ActionResult.fail(result);
}
}

@ -0,0 +1,85 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-22
*/
@Data
@TableName("yq_bill_table")
public class BillTableEntity {
@TableId(value ="ID" )
private String id;
@TableField("CREATE_BY")
private String createBy;
@TableField("CREATION_TIME")
private Date creationTime;
@TableField("UPDATE_BY")
private String updateBy;
@TableField("UPDATE_TIME")
private Date updateTime;
@TableField(value = "MERCHANT_ID" , updateStrategy = FieldStrategy.IGNORED)
private String merchantId;
@TableField(value = "MERCHANT_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String merchantName;
@TableField(value = "CONTRACT_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String contractName;
@TableField(value = "CONTRACT_ID" , updateStrategy = FieldStrategy.IGNORED)
private String contractId;
@TableField(value = "CONTRACT_NUMBER" , updateStrategy = FieldStrategy.IGNORED)
private String contractNumber;
@TableField(value = "BILL_NUMBE" , updateStrategy = FieldStrategy.IGNORED)
private String billNumbe;
@TableField(value = "START_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date startTime;
@TableField(value = "END_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date endTime;
@TableField("SUBMITTER")
private String submitter;
@TableField("SUBMISSION_TIME")
private Date submissionTime;
@TableField(value = "BILL_STATUS" , updateStrategy = FieldStrategy.IGNORED)
private String billStatus;
@TableField(value = "BILL_AMOUNT" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal billAmount;
@TableField(value = "NOTICE_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date noticeTime;
@TableField(value = "PAY_AMOUNT" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal payAmount;
@TableField(value = "PAY_STATUS" , updateStrategy = FieldStrategy.IGNORED)
private String payStatus;
@TableField("PAY_VOUCHER")
private String payVoucher;
@TableField(value = "NOTIFICATION_STATE" , updateStrategy = FieldStrategy.IGNORED)
private String notificationState;
@TableField(value = "NOTIFICATION_METHOD" , updateStrategy = FieldStrategy.IGNORED)
private String notificationMethod;
@TableField(value = "CONFIRM_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date confirmTime;
@TableField(value = "CONFIRM_PERSONNEL" , updateStrategy = FieldStrategy.IGNORED)
private String confirmPersonnel;
@TableField("CONFIRM_EXPLAIN")
private String confirmExplain;
@TableField(value = "BILL_ATTACHMENT" , updateStrategy = FieldStrategy.IGNORED)
private String billAttachment;
@TableField("REMARKS")
private String remarks;
@TableField("OPTIMISTIC_LOCK")
private Integer optimisticLock;
@TableField("CELETE_TAGS")
private Integer celeteTags;
@TableField("F_FLOW_ID")
private String flowId;
@TableField("F_DELETE_MARK")
private Integer deleteMark;
@TableField("F_VERSION")
private Integer version;
}

@ -0,0 +1,56 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-22
*/
@Data
@TableName("yq_bill_device_deatial")
public class BilldevicedeatialEntity {
@TableId(value ="ID" )
private String id;
@TableField("CREATE_BY")
private String createBy;
@TableField("CREATION_TIME")
private Date creationTime;
@TableField("UPDATE_BY")
private String updateBy;
@TableField("UPDATE_TIME")
private Date updateTime;
@TableField(value = "START_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date startTime;
@TableField(value = "END_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date endTime;
@TableField(value = "EQUIPMENT_NUMBER" , updateStrategy = FieldStrategy.IGNORED)
private String equipmentNumber;
@TableField(value = "EQUIPMENT_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String equipmentName;
@TableField("LEASE_ID")
private String leaseId;
@TableField(value = "LEASE_NUMBER" , updateStrategy = FieldStrategy.IGNORED)
private String leaseNumber;
@TableField("BILL_ID")
private String billId;
@TableField("BILL_NUMBER")
private String billNumber;
@TableField("USE_AMOUNT")
private String useAmount;
@TableField(value = "BILL_AMOUNT" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal billAmount;
@TableField(value = "COST_DESCRIPTION" , updateStrategy = FieldStrategy.IGNORED)
private String costDescription;
@TableField("REMARKS")
private String remarks;
@TableField("OPTIMISTIC_LOCK")
private Integer optimisticLock;
@TableField("CELETE_TAGS")
private Integer celeteTags;
}

@ -0,0 +1,48 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-22
*/
@Data
@TableName("yq_bill_other_deatial")
public class BillotherdeatialEntity {
@TableId(value ="ID" )
private String id;
@TableField("CREATE_BY")
private String createBy;
@TableField("CREATION_TIME")
private Date creationTime;
@TableField("UPDATE_BY")
private String updateBy;
@TableField("UPDATE_TIME")
private Date updateTime;
@TableField(value = "START_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date startTime;
@TableField(value = "END_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date endTime;
@TableField("BILL_ID")
private String billId;
@TableField("BILL_NUMBER")
private String billNumber;
@TableField(value = "USE_AMOUNT" , updateStrategy = FieldStrategy.IGNORED)
private String useAmount;
@TableField(value = "BILL_AMOUNT" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal billAmount;
@TableField(value = "COST_DESCRIPTION" , updateStrategy = FieldStrategy.IGNORED)
private String costDescription;
@TableField("REMARKS")
private String remarks;
@TableField("OPTIMISTIC_LOCK")
private Integer optimisticLock;
@TableField("CELETE_TAGS")
private Integer celeteTags;
}

@ -0,0 +1,56 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-22
*/
@Data
@TableName("yq_bill_space_detail")
public class BillspacedetailEntity {
@TableId(value ="ID" )
private String id;
@TableField("CREATE_BY")
private String createBy;
@TableField("CREATION_TIME")
private Date creationTime;
@TableField("UPDATE_BY")
private String updateBy;
@TableField("UPDATE_TIME")
private Date updateTime;
@TableField(value = "START_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date startTime;
@TableField(value = "END_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date endTime;
@TableField(value = "SPACE_ID" , updateStrategy = FieldStrategy.IGNORED)
private String spaceId;
@TableField("SPACE_NAME")
private String spaceName;
@TableField(value = "SPACE_NUMBER" , updateStrategy = FieldStrategy.IGNORED)
private String spaceNumber;
@TableField("BILL_ID")
private String billId;
@TableField("BILL_NUMBER")
private String billNumber;
@TableField("BILL_TYPE")
private String billType;
@TableField("USE_AMOUNT")
private String useAmount;
@TableField(value = "BILL_AMOUNT" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal billAmount;
@TableField(value = "COST_DESCRIPTION" , updateStrategy = FieldStrategy.IGNORED)
private String costDescription;
@TableField("REMARKS")
private String remarks;
@TableField("OPTIMISTIC_LOCK")
private Integer optimisticLock;
@TableField("CELETE_TAGS")
private Integer celeteTags;
}

@ -28,6 +28,10 @@ public class VehicleEntity {
private String vehicleColor;
@TableField(value = "VEHICLE_PHOTOS" , updateStrategy = FieldStrategy.IGNORED)
private String vehiclePhotos;
@TableField(value = "vehicle_weight" , updateStrategy = FieldStrategy.IGNORED)
private String vehicleWeight;
@TableField(value = "weight_tolerances" , updateStrategy = FieldStrategy.IGNORED)
private String weightTolerances;
@TableField(value = "CONTACTS_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String contactsName;
@TableField(value = "CONTACTS_PHONE" , updateStrategy = FieldStrategy.IGNORED)

@ -0,0 +1,89 @@
package jnpf.model.billtable;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* BillTable
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-22
*/
@Data
public class BillTableForm {
/** 主键 */
private String id;
/** 子表数据 **/
@JsonProperty("billspacedetailList")
private List<BillspacedetailModel> billspacedetailList;
/** 子表数据 **/
@JsonProperty("billdevicedeatialList")
private List<BilldevicedeatialModel> billdevicedeatialList;
/** 子表数据 **/
@JsonProperty("billotherdeatialList")
private List<BillotherdeatialModel> billotherdeatialList;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/** 账单号 **/
@JsonProperty("billNumbe")
private String billNumbe;
/** 合同名称 **/
@JsonProperty("contractId")
private String contractId;
/** 账单状态 **/
@JsonProperty("billStatus")
private Object billStatus;
/** 商户名称 **/
@JsonProperty("merchantId")
private String merchantId;
/** 开始时间 **/
@JsonProperty("startTime")
private String startTime;
/** 结束时间 **/
@JsonProperty("endTime")
private String endTime;
/** 账单金额 **/
@JsonProperty("billAmount")
private BigDecimal billAmount;
/** 通知方式 **/
@JsonProperty("notificationMethod")
private Object notificationMethod;
/** 通知时间 **/
@JsonProperty("noticeTime")
private String noticeTime;
/** 通知状态 **/
@JsonProperty("notificationState")
private Object notificationState;
/** 支付方式 **/
@JsonProperty("payStatus")
private Object payStatus;
/** 支付金额 **/
@JsonProperty("payAmount")
private BigDecimal payAmount;
/** 确认人 **/
@JsonProperty("confirmPersonnel")
private String confirmPersonnel;
/** 确认时间 **/
@JsonProperty("confirmTime")
private String confirmTime;
/** 相关附件 **/
@JsonProperty("billAttachment")
private Object billAttachment;
/** 合同名称 **/
@JsonProperty("contractName")
private String contractName;
/** 商户名称 **/
@JsonProperty("merchantName")
private String merchantName;
/** 创建时间 **/
@JsonProperty("creationTime")
private String creationTime;
/** 合同编号 **/
@JsonProperty("contractNumber")
private String contractNumber;
}

@ -0,0 +1,42 @@
package jnpf.model.billtable;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* BillTable
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-22
*/
@Data
public class BillTablePagination extends Pagination {
/** 查询key */
private String[] selectKey;
/** json */
private String json;
/** 数据类型 0-当前页1-全部数据 */
private String dataType;
/** 高级查询 */
private String superQueryJson;
/** 功能id */
private String moduleId;
/** 菜单id */
private String menuId;
/** 提交时间 */
@JsonProperty("creationTime")
private Object creationTime;
/** 商户名称 */
@JsonProperty("merchantName")
private Object merchantName;
/** 合同名称 */
@JsonProperty("contractName")
private Object contractName;
/** 账单状态 */
@JsonProperty("billStatus")
private Object billStatus;
}

@ -0,0 +1,45 @@
package jnpf.model.billtable;
import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
* BillTable
* V3.5
* : https://www.jnpfsoft.com
* JNPF
* 2024-07-22
*/
@Data
public class BilldevicedeatialModel {
/** 租赁单号 **/
@JSONField(name = "leaseNumber")
private String leaseNumber;
/** 设备编码 **/
@JSONField(name = "equipmentNumber")
private String equipmentNumber;
/** 设备名称 **/
@JSONField(name = "equipmentName")
private String equipmentName;
/** 开始时间 **/
@JSONField(name = "startTime")
private Long startTime;
/** 结束时间 **/
@JSONField(name = "endTime")
private Long endTime;
/** 账单金额 **/
@JSONField(name = "billAmount")
private BigDecimal billAmount;
/** 费用说明 **/
@JSONField(name = "costDescription")
private String costDescription;
}

@ -0,0 +1,39 @@
package jnpf.model.billtable;
import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
* BillTable
* V3.5
* : https://www.jnpfsoft.com
* JNPF
* 2024-07-22
*/
@Data
public class BillotherdeatialModel {
/** 使用量 **/
@JSONField(name = "useAmount")
private String useAmount;
/** 开始时间 **/
@JSONField(name = "startTime")
private Long startTime;
/** 结束时间 **/
@JSONField(name = "endTime")
private Long endTime;
/** 账单金额 **/
@JSONField(name = "billAmount")
private BigDecimal billAmount;
/** 费用说明 **/
@JSONField(name = "costDescription")
private String costDescription;
}

@ -0,0 +1,42 @@
package jnpf.model.billtable;
import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
* BillTable
* V3.5
* : https://www.jnpfsoft.com
* JNPF
* 2024-07-22
*/
@Data
public class BillspacedetailModel {
/** 空间编码 **/
@JSONField(name = "spaceNumber")
private String spaceNumber;
/** 空间名称 **/
@JSONField(name = "spaceId")
private String spaceId;
/** 开始时间 **/
@JSONField(name = "startTime")
private Long startTime;
/** 结束时间 **/
@JSONField(name = "endTime")
private Long endTime;
/** 账单金额 **/
@JSONField(name = "billAmount")
private BigDecimal billAmount;
/** 费用说明 **/
@JSONField(name = "costDescription")
private String costDescription;
}

@ -0,0 +1,356 @@
<template>
<transition name="el-zoom-in-center">
<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="详情"/>
<div class="options">
<el-button @click="goBack"> </el-button>
</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>
<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>
<script>
import request from '@/utils/request'
import { getConfigData } from '@/api/onlineDev/visualDev'
import jnpf from '@/utils/jnpf'
import Detail from '@/views/basic/dynamicModel/list/detail'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
components: { Detail},
props: [],
data() {
return {
visible: false,
detailVisible: false,
loading: false,
dataForm: {
id :'',
billNumbe : '',
contractId : "",
billStatus : "10",
merchantId : '',
startTime : '',
endTime : '',
billAmount : '',
notificationMethod : "",
noticeTime : '',
notificationState : "2",
payStatus : "1",
payAmount : '',
confirmPersonnel : '',
confirmTime : "",
billAttachment : [],
contractName : '',
merchantName : '',
creationTime : "",
contractNumber : '',
billspacedetailList:[],
billdevicedeatialList:[],
billotherdeatialList:[],
},
activegecbmb:'3KzarC2',
billStatusOptions:[{"fullName":"待确认","id":"10"},{"fullName":"已确认","id":"20"},{"fullName":"已驳回","id":"30"},{"fullName":"部分结算","id":"40"},{"fullName":"已结算","id":"50"}],
billStatusProps:{"label":"fullName","value":"id" },
notificationMethodOptions:[{"fullName":"口头","id":"1"},{"fullName":"书面","id":"2"}],
notificationMethodProps:{"label":"fullName","value":"id" },
notificationStateOptions:[{"fullName":"未通知","id":"1"},{"fullName":"已通知","id":"2"}],
notificationStateProps:{"label":"fullName","value":"id" },
payStatusOptions:[{"fullName":"现金","id":"1"},{"fullName":"转账","id":"2"},{"fullName":"汇票","id":"3"}],
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
},
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>

File diff suppressed because one or more lines are too long

@ -0,0 +1,657 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<div class="JNPF-common-page-header">
<el-page-header @back="goBack" />结算录入
<div class="options">
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"
:disabled='continueBtnLoading'> 确认</el-button>
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row :gutter="15" class=" main" :style="{ margin: '0 auto', width: '100%' }">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
label-position="right">
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="8">
<jnpf-form-tip-item label="账单号" prop="billNumbe">
<JnpfInput v-model="dataForm.billNumbe" @change="changeData('billNumbe', -1)"
placeholder="自动生成" disabled clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="账单状态" prop="billStatus">
<JnpfSelect v-model="dataForm.billStatus" @change="changeData('billStatus', -1)"
placeholder="请选择账单状态" clearable :style='{ "width": "100%" }'
:options="billStatusOptions" :props="billStatusProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="支付方式" prop="payStatus">
<JnpfSelect v-model="dataForm.payStatus" @change="changeData('payStatus', -1)"
placeholder="请选择支付方式" clearable :style='{ "width": "100%" }'
:options="payStatusOptions" :props="payStatusProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="支付金额" prop="payAmount">
<JnpfInputNumber v-model="dataForm.payAmount" @change="changeData('payAmount', -1)"
placeholder="支付金额" :step="1">
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="相关附件" prop="billAttachment">
<JnpfUploadFile v-model="dataForm.billAttachment"
@change="changeData('billAttachment', -1)" :fileSize="10" sizeUnit="MB" :limit="9"
pathType="defaultPath" :isAccount="0" buttonText="点击上传">
</JnpfUploadFile>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
</el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
@select="addForSelect" @close="selectDialogVisible = false" />
</el-row>
</div>
</transition>
</template>
<script>
import request from '@/utils/request'
import { mapGetters } from "vuex";
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
components: {},
props: [],
data() {
return {
dataFormSubmitType: 0,
continueBtnLoading: false,
index: 0,
prevDis: false,
nextDis: false,
allList: [],
visible: false,
loading: false,
btnLoading: false,
formRef: 'formRef',
setting: {},
eventType: '',
userBoxVisible: false,
selectDialogVisible: false,
currTableConf: {},
dataValueAll: {},
addTableConf: {
billspacedetailList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
billdevicedeatialList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
billotherdeatialList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
},
//
ableAll: {
},
tableRows: {
billspacedetailList: {
spaceNumber: '',
spaceNumberOptions: [],
spaceId: '',
spaceIdOptions: [],
startTime: '',
startTimeOptions: [],
endTime: '',
endTimeOptions: [],
billAmount: undefined,
billAmountOptions: [],
costDescription: '',
costDescriptionOptions: [],
enabledmark: undefined
},
billdevicedeatialList: {
leaseNumber: '',
leaseNumberOptions: [],
equipmentNumber: '',
equipmentNumberOptions: [],
equipmentName: '',
equipmentNameOptions: [],
startTime: '',
startTimeOptions: [],
endTime: '',
endTimeOptions: [],
billAmount: undefined,
billAmountOptions: [],
costDescription: '',
costDescriptionOptions: [],
enabledmark: undefined
},
billotherdeatialList: {
useAmount: '',
useAmountOptions: [],
startTime: '',
startTimeOptions: [],
endTime: '',
endTimeOptions: [],
billAmount: undefined,
billAmountOptions: [],
costDescription: '',
costDescriptionOptions: [],
enabledmark: undefined
},
},
Vmodel: "",
currVmodel: "",
dataForm: {
billNumbe: undefined,
contractId: undefined,
billStatus: "10",
merchantId: undefined,
startTime: undefined,
endTime: undefined,
billAmount: undefined,
notificationMethod: undefined,
noticeTime: undefined,
notificationState: "2",
payStatus: "1",
payAmount: undefined,
confirmPersonnel: undefined,
confirmTime: undefined,
billAttachment: [],
contractName: undefined,
merchantName: undefined,
creationTime: undefined,
contractNumber: undefined,
billspacedetailList: [],
billdevicedeatialList: [],
billotherdeatialList: [],
version: 0,
},
tableRequiredData: {},
activegecbmb: '3KzarC2',
dataRule:
{
contractId: [
{
required: true,
message: '请选择合同',
trigger: 'change'
},
],
billStatus: [
{
required: true,
message: '请至少选择一个',
trigger: 'change'
},
],
startTime: [
{
required: true,
message: '请选择开始时间',
trigger: 'change'
},
],
endTime: [
{
required: true,
message: '请选择结束时间',
trigger: 'change'
},
],
billAmount: [
{
required: true,
message: '账单金额',
trigger: ["blur", "change"]
},
],
notificationMethod: [
{
required: true,
message: '请选择通知方式',
trigger: 'change'
},
],
notificationState: [
{
required: true,
message: '请至少选择一个',
trigger: 'change'
},
],
},
contractIdcolumnOptions: [{ "label": "合同编码", "value": "contract_number" }, { "label": "合同名称", "value": "contract_name" }, { "label": "商户名称", "value": "merchant_name" }, { "label": "开始时间", "value": "start_time" }, { "label": "结束时间", "value": "end_time" }, { "label": "合同状态", "value": "contract_status_cn" },],
billStatusOptions: [{ "fullName": "待确认", "id": "10" }, { "fullName": "已确认", "id": "20" }, { "fullName": "已驳回", "id": "30" }, { "fullName": "部分结算", "id": "40" }, { "fullName": "已结算", "id": "50" }],
billStatusProps: { "label": "fullName", "value": "id" },
notificationMethodOptions: [{ "fullName": "口头", "id": "1" }, { "fullName": "书面", "id": "2" }],
notificationMethodProps: { "label": "fullName", "value": "id" },
notificationStateOptions: [{ "fullName": "未通知", "id": "1" }, { "fullName": "已通知", "id": "2" }],
notificationStateProps: { "label": "fullName", "value": "id" },
payStatusOptions: [{ "fullName": "现金", "id": "1" }, { "fullName": "转账", "id": "2" }, { "fullName": "汇票", "id": "3" }],
payStatusProps: { "label": "fullName", "value": "id" },
childIndex: -1,
isEdit: false,
interfaceRes: {
billNumbe: [],
contractId: [],
billStatus: [],
merchantId: [],
startTime: [],
endTime: [],
billAmount: [],
notificationMethod: [],
noticeTime: [],
notificationState: [],
payStatus: [],
payAmount: [],
confirmPersonnel: [],
confirmTime: [],
billAttachment: [],
contractName: [],
merchantName: [],
creationTime: [],
contractNumber: [],
billspacedetailspaceNumber: [],
billspacedetailspaceId: [],
billspacedetailstartTime: [],
billspacedetailendTime: [],
billspacedetailbillAmount: [],
billspacedetailcostDescription: [],
billdevicedeatialleaseNumber: [],
billdevicedeatialequipmentNumber: [],
billdevicedeatialequipmentName: [],
billdevicedeatialstartTime: [],
billdevicedeatialendTime: [],
billdevicedeatialbillAmount: [],
billdevicedeatialcostDescription: [],
billotherdeatialuseAmount: [],
billotherdeatialstartTime: [],
billotherdeatialendTime: [],
billotherdeatialbillAmount: [],
billotherdeatialcostDescription: [],
},
}
},
computed: {
...mapGetters(['userInfo'])
},
watch: {},
created() {
this.dataAll()
this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() { },
methods: {
prev() {
this.index--
if (this.index === 0) {
this.prevDis = true
}
this.nextDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
next() {
this.index++
if (this.index === this.allList.length - 1) {
this.nextDis = true
}
this.prevDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
getInfo(id) {
request({
url: '/api/example/BillTable/' + id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
});
},
goBack() {
this.visible = false
this.$emit('refreshDataList', true)
},
changeData(model, index) {
this.isEdit = false
this.childIndex = index
let modelAll = model.split("-");
let faceMode = "";
for (let i = 0; i < modelAll.length; i++) {
faceMode += modelAll[i];
}
for (let key in this.interfaceRes) {
if (key != faceMode) {
let faceReList = this.interfaceRes[key]
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options';
if (this[options]) {
this[options]()
}
this.changeData(key, index)
}
}
}
}
},
changeDataFormData(type, data, model, index, defaultValue) {
if (!this.isEdit) {
if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) {
this.dataForm[data][i][model] = defaultValue
} else if (index == i) {
this.dataForm[data][i][model] = defaultValue
}
}
} else {
this.dataForm[data] = defaultValue
}
}
},
dataAll() {
},
billspacedetailExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.billspacedetailList.length; i++) {
const e = this.dataForm.billspacedetailList[i];
}
return isOk;
},
billdevicedeatialExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.billdevicedeatialList.length; i++) {
const e = this.dataForm.billdevicedeatialList[i];
}
return isOk;
},
billotherdeatialExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.billotherdeatialList.length; i++) {
const e = this.dataForm.billotherdeatialList[i];
}
return isOk;
},
goBack() {
this.$emit('refresh')
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
init(id, isDetail, allList) {
this.prevDis = false
this.nextDis = false
this.allList = allList || []
if (allList.length) {
this.index = this.allList.findIndex(item => item.id === id)
if (this.index == 0) {
this.prevDis = true
}
if (this.index == this.allList.length - 1) {
this.nextDis = true
}
} else {
this.prevDis = true
this.nextDis = true
}
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/example/BillTable/' + this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
} else {
this.clearData()
this.initDefaultData()
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
initDefaultData() {
this.dataForm.confirmTime = new Date().getTime()
},
//
dataFormSubmit(type) {
this.dataFormSubmitType = type ? type : 0
this.$refs['formRef'].validate((valid) => {
if (valid) {
if (!this.billspacedetailExist()) return
if (!this.billdevicedeatialExist()) return
if (!this.billotherdeatialExist()) return
this.request()
}
})
},
request() {
let _data = this.dataList()
request({
url: '/api/example/BillTable/entry/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(() => {
this.btnLoading = false
this.continueBtnLoading = false
})
},
addbillspacedetailList() {
let item = {
spaceNumber: undefined,
spaceId: undefined,
startTime: undefined,
endTime: undefined,
billAmount: undefined,
costDescription: undefined,
}
this.getbillspacedetailList(item)
},
delbillspacedetailList(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.billspacedetailList.splice(index, 1);
}).catch(() => {
});
},
getbillspacedetailList(value) {
let item = { ...this.tableRows.billspacedetailList, ...value }
this.dataForm.billspacedetailList.push(item)
this.childIndex = this.dataForm.billspacedetailList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
},
addbilldevicedeatialList() {
let item = {
leaseNumber: undefined,
equipmentNumber: undefined,
equipmentName: undefined,
startTime: undefined,
endTime: undefined,
billAmount: undefined,
costDescription: undefined,
}
this.getbilldevicedeatialList(item)
},
delbilldevicedeatialList(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.billdevicedeatialList.splice(index, 1);
}).catch(() => {
});
},
getbilldevicedeatialList(value) {
let item = { ...this.tableRows.billdevicedeatialList, ...value }
this.dataForm.billdevicedeatialList.push(item)
this.childIndex = this.dataForm.billdevicedeatialList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
},
addbillotherdeatialList() {
let item = {
useAmount: undefined,
startTime: undefined,
endTime: undefined,
billAmount: undefined,
costDescription: undefined,
}
this.getbillotherdeatialList(item)
},
delbillotherdeatialList(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.billotherdeatialList.splice(index, 1);
}).catch(() => {
});
},
getbillotherdeatialList(value) {
let item = { ...this.tableRows.billotherdeatialList, ...value }
this.dataForm.billotherdeatialList.push(item)
this.childIndex = this.dataForm.billotherdeatialList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
},
openSelectDialog(key) {
this.currTableConf = this.addTableConf[key]
this.currVmodel = key
this.selectDialogVisible = true
this.$nextTick(() => {
this.$refs.selectDialog.init()
})
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i]
if (this['get' + this.currVmodel]) {
this['get' + this.currVmodel](t)
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData)
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = new Date().getTime()
} else if (timeType == 4) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
}
} else if (timeType == 5) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
let timeDataValue = null
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || '00:00:00'
if (timeDataValue.split(':').length == 3) {
timeDataValue = timeDataValue
} else {
timeDataValue = timeDataValue + ':00'
}
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format)
} else if (timeType == 4) {
let previousDate = '';
previousDate = getBeforeTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
} else if (timeType == 5) {
let previousDate = '';
previousDate = getLaterTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
}
}
return timeDataValue;
},
dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
for (let i = 0; i < _dataAll.billspacedetailList.length; i++) {
this.childIndex = i
}
for (let i = 0; i < _dataAll.billdevicedeatialList.length; i++) {
this.childIndex = i
}
for (let i = 0; i < _dataAll.billotherdeatialList.length; i++) {
this.childIndex = i
}
this.childIndex = -1
},
},
}
</script>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,571 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="提交时间">
<JnpfDateRangePicker v-model="query.creationTime" format="yyyy-MM-dd"
startPlaceholder="开始日期" endPlaceholder="结束日期" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="商户名称">
<el-input v-model="query.merchantName" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="合同名称">
<el-input v-model="query.contractName" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<template v-if="showAll">
<el-col :span="6">
<el-form-item label="账单状态">
<JnpfSelect v-model="query.billStatus" placeholder="请选择账单状态" clearable
:options="billStatusOptions" :props="billStatusProps" multiple>
</JnpfSelect>
</el-form-item>
</el-col>
</template>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
<el-button type="text" icon="el-icon-arrow-down" @click="showAll = true" v-if="!showAll">
展开
</el-button>
<el-button type="text" icon="el-icon-arrow-up" @click="showAll = false" v-else>
收起
</el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" @click="addOrUpdateHandle()">
</el-button>
<el-button type="success" icon="icon-ym el-icon-check" @click="billConfirm()">
</el-button>
<el-button type="primary" icon="icon-ym icon-ym-btn-edit" @click="settlementEntry()">
</el-button>
</div>
<div class="JNPF-common-head-right">
<el-tooltip content="高级查询" placement="top" v-if="true">
<el-link icon="icon-ym icon-ym-filter JNPF-common-head-icon" :underline="false"
@click="openSuperQuery()" />
</el-tooltip>
<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="initData()" />
</el-tooltip>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange'
:span-method="arraySpanMethod" @row-click="handleRowClick">
<el-table-column width="55" align="center">
<template slot-scope="scope">
<input type="radio" :value="scope.row.id" v-model="selectedRowId"
@change="handleSelectionChange">
</template>
</el-table-column>
<el-table-column prop="contractNumber" label="合同编号" align="left">
</el-table-column>
<el-table-column prop="contractId" label="合同名称" align="left">
</el-table-column>
<el-table-column prop="merchantId" label="商户名称" align="left">
</el-table-column>
<el-table-column label="账单状态" prop="billStatus" algin="left">
<template slot-scope="scope">
{{ scope.row.billStatus }}
</template>
</el-table-column>
<el-table-column prop="billAmount" label="账单金额" align="left">
<template slot-scope="scope" v-if="scope.row.billAmount">
<JnpfNumber v-model="scope.row.billAmount" :thousands="false" />
</template>
</el-table-column>
<el-table-column label="支付方式" prop="payStatus" algin="left">
<template slot-scope="scope">
{{ scope.row.payStatus }}
</template>
</el-table-column>
<el-table-column prop="payAmount" label="支付金额" align="left">
<template slot-scope="scope" v-if="scope.row.payAmount">
<JnpfNumber v-model="scope.row.payAmount" :thousands="false" />
</template>
</el-table-column>
<el-table-column label="通知方式" prop="notificationMethod" algin="left">
<template slot-scope="scope">
{{ scope.row.notificationMethod }}
</template>
</el-table-column>
<el-table-column label="通知状态" prop="notificationState" algin="left">
<template slot-scope="scope">
{{ scope.row.notificationState }}
</template>
</el-table-column>
<el-table-column prop="noticeTime" label="通知时间" align="left">
</el-table-column>
<el-table-column prop="confirmPersonnel" label="确认人" align="left">
</el-table-column>
<el-table-column prop="confirmTime" label="确认时间" align="left">
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row)">
</el-button>
<el-button type="text" class="JNPF-table-delBtn"
@click="handleDel(scope.row.id, scope.row)">删除
</el-button>
<el-button type="text" @click="goDetail(scope.row.id)">
</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
@pagination="initData" />
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<Entry v-if="entryVisible" ref="Entry" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible = false" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson"
@superQuery="superQuery" />
</div>
</template>
<script>
import request from '@/utils/request'
import { mapGetters } from "vuex";
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import JNPFForm from './form'
import Detail from './Detail'
import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getConfigData } from '@/api/onlineDev/visualDev'
import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize'
import columnList from './columnList'
import { thousandsFormat } from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
import Entry from './entry.vue';
export default {
components: {
JNPFForm,
Entry,
Detail,
ExportBox, ToFormDetail, SuperQuery
},
data() {
return {
selectedRowId: null,
keyword: '',
expandsTree: true,
refreshTree: true,
toFormDetailVisible: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList: [],
columnList,
showAll: false,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
creationTime: undefined,
merchantName: undefined,
contractName: undefined,
billStatus: undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id',
isLeaf: 'isLeaf'
},
list: [],
listData: [],
listLoading: true,
total: 0,
queryData: {},
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
formVisible: false,
entryVisible: false,
flowVisible: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
billStatusOptions: [{ "fullName": "待确认", "id": "10" }, { "fullName": "已确认", "id": "20" }, { "fullName": "已驳回", "id": "30" }, { "fullName": "部分结算", "id": "40" }, { "fullName": "已结算", "id": "50" }],
billStatusProps: { "label": "fullName", "value": "id" },
notificationMethodOptions: [{ "fullName": "口头", "id": "1" }, { "fullName": "书面", "id": "2" }],
notificationMethodProps: { "label": "fullName", "value": "id" },
notificationStateOptions: [{ "fullName": "未通知", "id": "1" }, { "fullName": "已通知", "id": "2" }],
notificationStateProps: { "label": "fullName", "value": "id" },
payStatusOptions: [{ "fullName": "现金", "id": "1" }, { "fullName": "转账", "id": "2" }, { "fullName": "汇票", "id": "3" }],
payStatusProps: { "label": "fullName", "value": "id" },
interfaceRes: {
contractId: [],
},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
this.getColumnList(),
this.initSearchDataAndListData()
this.queryData = JSON.parse(JSON.stringify(this.query))
},
methods: {
handleRowClick(row, event, column) {
this.selectedRowId = row.id;
this.listData = row;
},
handleSelectionChange(event) {
this.selectedRowId = event.target.value;
},
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.toFormDetailVisible = true
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
})
})
},
toggleTreeExpand(expands) {
this.refreshTree = false
this.expandsTree = expands
this.$nextTick(() => {
this.refreshTree = true
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null)
})
})
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data
const config = {
treeInterfaceId: "",
treeTemplateJson: []
}
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || ''
}
}
//
let query = {
paramList: config.treeTemplateJson || [],
}
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
})
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList)
},
transformColumnList(columnList) {
let list = []
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes('-')) {
list.push(e)
} else {
let prop = e.prop.split('-')[0]
let label = e.label.split('-')[0]
let vModel = e.prop.split('-')[1]
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
}
e.vModel = vModel
if (!this.expandObj.hasOwnProperty(`${prop}Expand`)) this.$set(this.expandObj, `${prop}Expand`, false)
if (!list.some(o => o.prop === prop)) list.push(newItem)
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e)
break
}
}
}
}
this.getMergeList(list)
this.getExportList(list)
return list
},
arraySpanMethod({ column }) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list))
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + '-child-first'
}
item.children.unshift(child)
}
})
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
})
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
})
}
})
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
})
}
})
},
getExportList(list) {
let exportList = []
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === 'table') {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j])
}
} else {
exportList.push(list[i])
}
}
this.exportList = exportList
},
goDetail(id) {
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
sortChange({ column, prop, order }) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
},
//
async initSearchData() {
},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId: this.menuId,
moduleId: '585025890216314949',
type: 1,
};
request({
url: `/api/example/BillTable/getList`,
method: 'post',
data: _query
}).then(res => {
var _list = res.data.list;
this.list = _list.map(o => ({
...o,
...this.expandObj,
}))
this.total = res.data.pagination.total
this.listLoading = false
})
},
handleDel(id, row) {
if (row.billStatus === '已确认' || row.billStatus === '部分结算' || row.billStatus === '已结算') {
this.$message.error('账单信息已确认,不允许删除,请确认!');
return;
}
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/example/BillTable/${id}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {
});
},
handelUpload() {
this.uploadBoxVisible = true
this.$nextTick(() => {
this.$refs.UploadBox.init("", "example/BillTable")
})
},
openSuperQuery() {
this.superQueryVisible = true
this.$nextTick(() => {
this.$refs.SuperQuery.init()
})
},
superQuery(queryJson) {
this.listQuery.superQueryJson = queryJson
this.listQuery.currentPage = 1
this.initData()
},
addOrUpdateHandle(row, isDetail) {
let id = row ? row.id : ""
if (id) {
if (row.billStatus === '已确认' || row.billStatus === '部分结算' || row.billStatus === '已结算') {
this.$message.error('账单信息已确认,不允许修改,请确认!');
return;
}
}
this.formVisible = true
this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail, this.list)
})
},
settlementEntry(isDetail) {
if (this.listData.length === 0 || this.listData === undefined) {
this.$message.error('请选择需要结算录入的单据');
return;
}
if (this.listData.billStatus === '待确认' || this.listData.billStatus === '已驳回' || this.listData.billStatus === '已结算') {
this.$message.error('该账单状态非已确认或部分结算状态,不允许输入结算金额,请确认!');
return;
}
this.entryVisible = true
this.$nextTick(() => {
this.$refs.Entry.init(this.listData.id, isDetail, this.listData)
})
},
exportData() {
this.exportBoxVisible = true
this.$nextTick(() => {
this.$refs.ExportBox.init(this.exportList)
})
},
download(data) {
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
request({
url: `/api/example/BillTable/Actions/Export`,
method: 'post',
data: query
}).then(res => {
if (!res.data.url) return
this.jnpf.downloadFile(res.data.url)
this.$refs.ExportBox.visible = false
this.exportBoxVisible = false
})
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.initData()
},
refresh(isrRefresh) {
this.formVisible = false
this.entryVisible = false
if (isrRefresh) this.reset()
},
reset() {
this.selectedRowId = null
this.query = JSON.parse(JSON.stringify(this.queryData))
this.search()
},
colseFlow(isrRefresh) {
this.flowVisible = false
if (isrRefresh) this.reset()
},
billConfirm() {
if (this.selectedRowId == null || this.selectedRowId == undefined) {
this.$message.error("请选择要确认的账单!");
return;
}
this.$confirm('确定确认该账单吗?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/example/BillTable/billConfirm/` + this.selectedRowId,
method: "get",
}).then(res => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000
});
this.selectedRowId = null;
this.initData();
})
}).catch(() => {
});
},
}
}
</script>

File diff suppressed because one or more lines are too long

@ -63,9 +63,9 @@
</el-button>
<el-button type="info" icon="icon-ym icon-ym-btn-download" @click="exportData()">
</el-button>
<el-button type="warning" icon="icon-ym icon-ym-btn-download" @click="showDialog = true"">合同确认
<el-button type="warning" icon="icon-ym el-icon-check" @click="showDialog = true"">合同确认
</el-button>
<el-button type="success" icon="icon-ym icon-ym-btn-download" @click="showEndDialog = true"">合同结束
<el-button type="success" icon="icon-ym el-icon-check" @click="showEndDialog = true"">合同结束
</el-button>
</div>
<div class="JNPF-common-head-right">

Loading…
Cancel
Save