product
wangchuang 2 years ago
parent 116b77f15c
commit ea593ce4d6

@ -0,0 +1,394 @@
package jnpf.payment.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.config.ConfigValueUtil;
import jnpf.exception.DataException;
import jnpf.payment.entity.PaymentEntity;
import jnpf.payment.model.payment.*;
import jnpf.payment.service.PaymentService;
import jnpf.util.*;
import jnpf.util.enums.FileTypeEnum;
import jnpf.util.file.UploadUtil;
import lombok.Cleanup;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
*
* payment
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-11
*/
@Slf4j
@RestController
@Api(tags = "payment" , value = "example")
@RequestMapping("/api/example/Payment")
public class PaymentController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private ConfigValueUtil configValueUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private PaymentService paymentService;
/**
*
*
* @param paymentPagination
* @return
*/
@PostMapping("/getList")
public ActionResult list(@RequestBody PaymentPagination paymentPagination)throws IOException{
List<PaymentEntity> list= paymentService.getList(paymentPagination);
//处理id字段转名称若无需转或者为空可删除
for(PaymentEntity entity:list){
entity.setCreatorUserId(generaterSwapUtil.comSelectValue(entity.getCreatorUserId(), "last"));
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
entity.setLastModifyUserId(generaterSwapUtil.userSelectValue(entity.getLastModifyUserId()));
entity.setLastModifyUserName(generaterSwapUtil.userSelectValue(entity.getLastModifyUserName()));
entity.setDepartmentId(generaterSwapUtil.posSelectValue(entity.getDepartmentId()));
entity.setOrgnizeId(generaterSwapUtil.posSelectValue(entity.getOrgnizeId()));
}
List<PaymentListVO> listVO=JsonUtil.getJsonToList(list,PaymentListVO.class);
for(PaymentListVO paymentVO:listVO){
}
PageListVO vo=new PageListVO();
vo.setList(listVO);
PaginationVO page=JsonUtil.getJsonToBean(paymentPagination,PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param paymentCrForm
* @return
*/
@PostMapping
@Transactional
public ActionResult create(@RequestBody @Valid PaymentCrForm paymentCrForm) throws DataException {
String mainId =RandomUtil.uuId();
UserInfo userInfo=userProvider.get();
paymentCrForm.setCreatorUserId(StringUtil.isEmpty(userInfo.getDepartmentId()) ? userInfo.getOrganizeId() : userInfo.getDepartmentId());
paymentCrForm.setCreatorUserName(userInfo.getUserId());
paymentCrForm.setCreatorTime(DateUtil.getNow());
if(userInfo.getPositionIds()!=null&&userInfo.getPositionIds().length>0){
paymentCrForm.setDepartmentId(userInfo.getPositionIds()[0]);
}
if(userInfo.getPositionIds()!=null&&userInfo.getPositionIds().length>0){
paymentCrForm.setOrgnizeId(userInfo.getPositionIds()[0]);
}
PaymentEntity entity = JsonUtil.getJsonToBean(paymentCrForm, PaymentEntity.class);
entity.setId(mainId);
paymentService.save(entity);
return ActionResult.success("创建成功");
}
/**
*
*
* @return
*/
@ApiOperation("模板下载")
@GetMapping("/templateDownload")
public ActionResult<DownloadVO> TemplateDownload(){
UserInfo userInfo=userProvider.get();
DownloadVO vo=DownloadVO.builder().build();
try{
vo.setName("职员信息.xlsx");
vo.setUrl(UploaderUtil.uploaderFile("/api/Common/DownloadModel?encryption=" ,userInfo.getId()+"#"+"职员信息.xlsx"+"#"+"Temporary"));
}catch(Exception e){
log.error("信息导出Excel错误:{}" ,e.getMessage());
}
return ActionResult.success(vo);
}
/**
* Excel
*
* @return
*/
@ApiOperation("导出Excel")
@GetMapping("/Actions/Export")
public ActionResult Export(PaymentPaginationExportModel paymentPaginationExportModel) throws IOException {
if (StringUtil.isEmpty(paymentPaginationExportModel.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
PaymentPagination paymentPagination=JsonUtil.getJsonToBean(paymentPaginationExportModel, PaymentPagination.class);
List<PaymentEntity> list= paymentService.getTypeList(paymentPagination,paymentPaginationExportModel.getDataType());
//处理id字段转名称若无需转或者为空可删除
for(PaymentEntity entity:list){
entity.setCreatorUserId(generaterSwapUtil.comSelectValue(entity.getCreatorUserId(), "last"));
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
entity.setLastModifyUserId(generaterSwapUtil.userSelectValue(entity.getLastModifyUserId()));
entity.setLastModifyUserName(generaterSwapUtil.userSelectValue(entity.getLastModifyUserName()));
entity.setDepartmentId(generaterSwapUtil.posSelectValue(entity.getDepartmentId()));
entity.setOrgnizeId(generaterSwapUtil.posSelectValue(entity.getOrgnizeId()));
}
List<PaymentListVO> listVO=JsonUtil.getJsonToList(list,PaymentListVO.class);
for(PaymentListVO paymentVO:listVO){
}
//转换为map输出
List<Map<String, Object>>mapList=JsonUtil.getJsonToListMap(JsonUtil.getObjectToStringDateFormat(listVO,"yyyy-MM-dd HH:mm:ss"));
String[]keys=!StringUtil.isEmpty(paymentPaginationExportModel.getSelectKey())?paymentPaginationExportModel.getSelectKey().split(","):new String[0];
UserInfo userInfo=userProvider.get();
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),mapList,keys,userInfo);
return ActionResult.success(vo);
}
//导出表格
public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){
DownloadVO vo=DownloadVO.builder().build();
List<ExcelExportEntity> entitys=new ArrayList<>();
if(keys.length>0){
for(String key:keys){
switch(key){
case "businessdate" :
entitys.add(new ExcelExportEntity("业务日期" ,"businessdate"));
break;
case "documentno" :
entitys.add(new ExcelExportEntity("单据编号" ,"documentno"));
break;
case "suppliername" :
entitys.add(new ExcelExportEntity("客户" ,"suppliername"));
break;
case "currency" :
entitys.add(new ExcelExportEntity("币别" ,"currency"));
break;
case "paymentamount" :
entitys.add(new ExcelExportEntity("付款金额" ,"paymentamount"));
break;
case "paymentaccount" :
entitys.add(new ExcelExportEntity("付款账户" ,"paymentaccount"));
break;
case "paymentbank" :
entitys.add(new ExcelExportEntity("付款银行" ,"paymentbank"));
break;
case "paymenttype" :
entitys.add(new ExcelExportEntity("付款类型" ,"paymenttype"));
break;
case "settlementtype" :
entitys.add(new ExcelExportEntity("结算类型" ,"settlementtype"));
break;
case "status" :
entitys.add(new ExcelExportEntity("单据状态" ,"status"));
break;
case "creatorUserId" :
entitys.add(new ExcelExportEntity("创建人id" ,"creatorUserId"));
break;
case "creatorUserName" :
entitys.add(new ExcelExportEntity("创建人名称" ,"creatorUserName"));
break;
case "creatorTime" :
entitys.add(new ExcelExportEntity("创建时间" ,"creatorTime"));
break;
case "lastModifyUserId" :
entitys.add(new ExcelExportEntity("修改人id" ,"lastModifyUserId"));
break;
case "lastModifyUserName" :
entitys.add(new ExcelExportEntity("修改人名称" ,"lastModifyUserName"));
break;
case "lastModifyTime" :
entitys.add(new ExcelExportEntity("修改时间" ,"lastModifyTime"));
break;
case "departmentId" :
entitys.add(new ExcelExportEntity("部门id" ,"departmentId"));
break;
case "orgnizeId" :
entitys.add(new ExcelExportEntity("组织id" ,"orgnizeId"));
break;
default:
break;
}
}
}
ExportParams exportParams = new ExportParams(null, "表单信息");
exportParams.setType(ExcelType.XSSF);
try{
@Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list);
}
String name = "表单信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx";
String fileName = configValueUtil.getTemporaryFilePath() + name;
@Cleanup FileOutputStream output = new FileOutputStream(XSSEscape.escapePath(fileName));
workbook.write(output);
//上传文件
UploadUtil.uploadFile(configValueUtil.getFileType(), fileName, FileTypeEnum.TEMPORARY, name);
vo.setName(name);
vo.setUrl(UploaderUtil.uploaderFile(userInfo.getId() + "#" + name + "#" + "Temporary"));
} catch (Exception e) {
log.error("信息导出Excel错误:{}", e.getMessage());
e.printStackTrace();
}
return vo;
}
/**
*
*
* @param id
* @return
*/
@GetMapping("/{id}")
public ActionResult<PaymentInfoVO> info(@PathVariable("id") String id){
PaymentEntity entity= paymentService.getInfo(id);
PaymentInfoVO vo=JsonUtil.getJsonToBean(entity, PaymentInfoVO.class);
vo.setCreatorUserId(generaterSwapUtil.comSelectValue(vo.getCreatorUserId(), "last"));
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
if(vo.getCreatorTime()!=null){
vo.setCreatorTime(vo.getCreatorTime());
}
vo.setLastModifyUserId(generaterSwapUtil.userSelectValue(vo.getLastModifyUserId()));
vo.setLastModifyUserName(generaterSwapUtil.userSelectValue(vo.getLastModifyUserName()));
if(vo.getLastModifyTime()!=null){
vo.setLastModifyTime(vo.getLastModifyTime());
}
vo.setDepartmentId(generaterSwapUtil.posSelectValue(vo.getDepartmentId()));
vo.setOrgnizeId(generaterSwapUtil.posSelectValue(vo.getOrgnizeId()));
//子表
//副表
return ActionResult.success(vo);
}
/**
* ()
*
* @param id
* @return
*/
@GetMapping("/detail/{id}")
public ActionResult<PaymentInfoVO> detailInfo(@PathVariable("id") String id){
PaymentEntity entity= paymentService.getInfo(id);
PaymentInfoVO vo=JsonUtil.getJsonToBean(entity, PaymentInfoVO.class);
//子表数据转换
//附表数据转换
//添加到详情表单对象中
vo.setCreatorUserId(generaterSwapUtil.comSelectValue(vo.getCreatorUserId(), "last"));
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
vo.setLastModifyUserId(generaterSwapUtil.userSelectValue(vo.getLastModifyUserId()));
vo.setLastModifyUserName(generaterSwapUtil.userSelectValue(vo.getLastModifyUserName()));
vo.setDepartmentId(generaterSwapUtil.posSelectValue(vo.getDepartmentId()));
vo.setOrgnizeId(generaterSwapUtil.posSelectValue(vo.getOrgnizeId()));
return ActionResult.success(vo);
}
/**
*
*
* @param id
* @return
*/
@PutMapping("/{id}")
@Transactional
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid PaymentUpForm paymentUpForm) throws DataException {
UserInfo userInfo=userProvider.get();
PaymentEntity entity= paymentService.getInfo(id);
if(entity!=null){
// paymentCrForm.setCreatorUserId(StringUtil.isEmpty(userInfo.getDepartmentId()) ? userInfo.getOrganizeId() : userInfo.getDepartmentId());
// paymentCrForm.setCreatorUserName(userInfo.getUserId());
paymentUpForm.setCreatorUserId(entity.getCreatorUserId());
paymentUpForm.setLastModifyUserId(userInfo.getUserId());
paymentUpForm.setLastModifyUserName(userInfo.getUserId());
paymentUpForm.setLastModifyTime(DateUtil.getNow());
paymentUpForm.setDepartmentId(entity.getDepartmentId());
paymentUpForm.setOrgnizeId(entity.getOrgnizeId());
PaymentEntity subentity=JsonUtil.getJsonToBean(paymentUpForm, PaymentEntity.class);
subentity.setCreatorUserName(entity.getCreatorUserName());
subentity.setCreatorTime(entity.getCreatorTime());
paymentService.update(id, subentity);
System.out.println("#################");
System.out.println(subentity);
System.out.println(userInfo);
return ActionResult.success("更新成功");
}else{
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
*
* @param id
* @return
*/
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id){
PaymentEntity entity= paymentService.getInfo(id);
if(entity!=null){
paymentService.delete(entity);
}
return ActionResult.success("删除成功");
}
}

@ -0,0 +1,114 @@
package jnpf.payment.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-11
*/
@Data
@TableName("jg_payment")
public class PaymentEntity {
@TableId("ID")
private String id;
@TableField("CREATOR_USER_ID")
private String creatorUserId;
@TableField("CREATOR_USER_NAME")
private String creatorUserName;
@TableField("CREATOR_TIME")
private Date creatorTime;
@TableField("LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("LAST_MODIFY_USER_NAME")
private String lastModifyUserName;
@TableField("LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("DELETE_USER_ID")
private String deleteUserId;
@TableField("DELETE_USER_NAME")
private String deleteUserName;
@TableField("DELETE_TIME")
private Date deleteTime;
@TableField("DELETE_MARK")
private String deleteMark;
@TableField("ORGNIZE_ID")
private String orgnizeId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("DOCUMENTNO")
private String documentno;
@TableField("PAYMENTNO")
private String paymentno;
@TableField("PAYMENTAMOUNT")
private BigDecimal paymentamount;
@TableField("REQUESTEDAMOUNT")
private BigDecimal requestedamount;
@TableField("BUSINESSDATE")
private Date businessdate;
@TableField("DUEDATE")
private Date duedate;
@TableField("STATUS")
private String status;
@TableField("SUPPLIERCODE")
private String suppliercode;
@TableField("SUPPLIERNAME")
private String suppliername;
@TableField("CURRENCY")
private String currency;
@TableField("PAYMENTTYPE")
private String paymenttype;
@TableField("SETTLEMENTTYPE")
private String settlementtype;
@TableField("REMARK")
private String remark;
@TableField("COLLECTIONACCOUNT")
private String collectionaccount;
@TableField("COLLECTIONBANK")
private String collectionbank;
@TableField("PAYMENTACCOUNT")
private String paymentaccount;
@TableField("PAYMENTBANK")
private String paymentbank;
}

@ -0,0 +1,99 @@
package jnpf.payment.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-11
*/
@Data
@TableName("jg_payment_item0")
public class Payment_item0Entity {
@TableId("ID")
private String id;
@TableField("CREATOR_USER_ID")
private String creatorUserId;
@TableField("CREATOR_USER_NAME")
private String creatorUserName;
@TableField("CREATOR_TIME")
private Date creatorTime;
@TableField("LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("LAST_MODIFY_USER_NAME")
private String lastModifyUserName;
@TableField("LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("DELETE_USER_ID")
private String deleteUserId;
@TableField("DELETE_USER_NAME")
private String deleteUserName;
@TableField("DELETE_TIME")
private Date deleteTime;
@TableField("DELETE_MARK")
private String deleteMark;
@TableField("ORGNIZE_ID")
private String orgnizeId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("PAYMENT_ID")
private String paymentId;
@TableField("PAYMENTID")
private String paymentid;
@TableField("CARNUMBER")
private String carnumber;
@TableField("MATERIALNAME")
private String materialname;
@TableField("QUANTITY")
private BigDecimal quantity;
@TableField("PURCHASEPRICE")
private BigDecimal purchaseprice;
@TableField("TAXRATE")
private String taxrate;
@TableField("AMOUNT")
private BigDecimal amount;
@TableField("AMOUNTNOTTAX")
private BigDecimal amountnottax;
@TableField("TAXAMOUNT")
private BigDecimal taxamount;
@TableField("REMARK")
private String remark;
@TableField("ISPAY")
private String ispay;
}

@ -0,0 +1,17 @@
package jnpf.payment.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.payment.entity.PaymentEntity;
/**
*
* payment
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-11
*/
public interface PaymentMapper extends BaseMapper<PaymentEntity> {
}

@ -0,0 +1,17 @@
package jnpf.payment.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.payment.entity.Payment_item0Entity;
/**
*
* jg_payment_item0
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-11
*/
public interface Payment_item0Mapper extends BaseMapper<Payment_item0Entity> {
}

@ -0,0 +1,96 @@
package jnpf.payment.model.payment;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-11
*/
@Data
public class PaymentCrForm {
/** 业务日期 **/
@JsonProperty("businessdate")
private Long businessdate;
/** 单据编号 **/
@JsonProperty("documentno")
private String documentno;
/** 客户 **/
@JsonProperty("suppliername")
private String suppliername;
/** 币别 **/
@JsonProperty("currency")
private String currency;
/** 付款金额 **/
@JsonProperty("paymentamount")
private String paymentamount;
/** 付款账户 **/
@JsonProperty("paymentaccount")
private String paymentaccount;
/** 付款银行 **/
@JsonProperty("paymentbank")
private String paymentbank;
/** 付款类型 **/
@JsonProperty("paymenttype")
private String paymenttype;
/** 结算类型 **/
@JsonProperty("settlementtype")
private String settlementtype;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 创建人id **/
@JsonProperty("creatorUserId")
private String creatorUserId;
/** 创建人名称 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 创建时间 **/
@JsonProperty("creatorTime")
private String creatorTime;
/** 修改人id **/
@JsonProperty("lastModifyUserId")
private String lastModifyUserId;
/** 修改人名称 **/
@JsonProperty("lastModifyUserName")
private String lastModifyUserName;
/** 修改时间 **/
@JsonProperty("lastModifyTime")
private String lastModifyTime;
/** 部门id **/
@JsonProperty("departmentId")
private String departmentId;
/** 组织id **/
@JsonProperty("orgnizeId")
private String orgnizeId;
}

@ -0,0 +1,100 @@
package jnpf.payment.model.payment;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-11
*/
@Data
public class PaymentInfoVO{
/** 主键 **/
@JsonProperty("id")
private String id;
/** 业务日期 **/
@JsonProperty("businessdate")
private Long businessdate;
/** 单据编号 **/
@JsonProperty("documentno")
private String documentno;
/** 客户 **/
@JsonProperty("suppliername")
private String suppliername;
/** 币别 **/
@JsonProperty("currency")
private String currency;
/** 付款金额 **/
@JsonProperty("paymentamount")
private String paymentamount;
/** 付款账户 **/
@JsonProperty("paymentaccount")
private String paymentaccount;
/** 付款银行 **/
@JsonProperty("paymentbank")
private String paymentbank;
/** 付款类型 **/
@JsonProperty("paymenttype")
private String paymenttype;
/** 结算类型 **/
@JsonProperty("settlementtype")
private String settlementtype;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 创建人id **/
@JsonProperty("creatorUserId")
private String creatorUserId;
/** 创建人名称 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 创建时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("creatorTime")
private Date creatorTime;
/** 修改人id **/
@JsonProperty("lastModifyUserId")
private String lastModifyUserId;
/** 修改人名称 **/
@JsonProperty("lastModifyUserName")
private String lastModifyUserName;
/** 修改时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("lastModifyTime")
private Date lastModifyTime;
/** 部门id **/
@JsonProperty("departmentId")
private String departmentId;
/** 组织id **/
@JsonProperty("orgnizeId")
private String orgnizeId;
}

@ -0,0 +1,27 @@
package jnpf.payment.model.payment;
import lombok.Data;
import java.util.Date;
import jnpf.base.Pagination;
import java.util.List;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-11
*/
@Data
public class PaymentListQuery extends Pagination {
/** 单据编号 */
private String documentno;
/** 客户 */
private String suppliername;
/**
* id
*/
private String menuId;
}

@ -0,0 +1,120 @@
package jnpf.payment.model.payment;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigDecimal;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-11
*/
@Data
public class PaymentListVO{
/** 主键 */
private String id;
/** 业务日期 **/
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
@JsonProperty("businessdate")
private Date businessdate;
/** 单据编号 **/
@JsonProperty("documentno")
private String documentno;
/** 客户 **/
@JsonProperty("suppliername")
private String suppliername;
/** 币别 **/
@JsonProperty("currency")
private String currency;
/** 付款金额 **/
@JsonProperty("paymentamount")
private String paymentamount;
/** 付款账户 **/
@JsonProperty("paymentaccount")
private String paymentaccount;
/** 付款银行 **/
@JsonProperty("paymentbank")
private String paymentbank;
/** 付款类型 **/
@JsonProperty("paymenttype")
private String paymenttype;
/** 结算类型 **/
@JsonProperty("settlementtype")
private String settlementtype;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 创建人id **/
@JsonProperty("creatorUserId")
private String creatorUserId;
/** 创建人名称 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 创建时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("creatorTime")
private Date creatorTime;
/** 修改人id **/
@JsonProperty("lastModifyUserId")
private String lastModifyUserId;
/** 修改人名称 **/
@JsonProperty("lastModifyUserName")
private String lastModifyUserName;
/** 修改时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("lastModifyTime")
private Date lastModifyTime;
/** 部门id **/
@JsonProperty("departmentId")
private String departmentId;
/** 组织id **/
@JsonProperty("orgnizeId")
private String orgnizeId;
}

@ -0,0 +1,28 @@
package jnpf.payment.model.payment;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-11
*/
@Data
public class PaymentPagination extends Pagination {
/** 单据编号 */
private String documentno;
/** 客户 */
private String suppliername;
/**
* id
*/
private String menuId;
}

@ -0,0 +1,29 @@
package jnpf.payment.model.payment;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.*;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-11
*/
@Data
public class PaymentPaginationExportModel extends Pagination {
private String selectKey;
private String json;
private String dataType;
/** 单据编号 */
private String documentno;
/** 客户 */
private String suppliername;
}

@ -0,0 +1,112 @@
package jnpf.payment.model.payment;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-11
*/
@Data
public class PaymentUpForm{
/** 主键 */
private String id;
/** 业务日期 **/
@JsonProperty("businessdate")
private Long businessdate;
/** 单据编号 **/
@JsonProperty("documentno")
private String documentno;
/** 客户 **/
@JsonProperty("suppliername")
private String suppliername;
/** 币别 **/
@JsonProperty("currency")
private String currency;
/** 付款金额 **/
@JsonProperty("paymentamount")
private String paymentamount;
/** 付款账户 **/
@JsonProperty("paymentaccount")
private String paymentaccount;
/** 付款银行 **/
@JsonProperty("paymentbank")
private String paymentbank;
/** 付款类型 **/
@JsonProperty("paymenttype")
private String paymenttype;
/** 结算类型 **/
@JsonProperty("settlementtype")
private String settlementtype;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 创建人id **/
@JsonProperty("creatorUserId")
private String creatorUserId;
/** 创建人名称 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 创建时间 **/
@JsonProperty("creatorTime")
private String creatorTime;
/** 修改人id **/
@JsonProperty("lastModifyUserId")
private String lastModifyUserId;
/** 修改人名称 **/
@JsonProperty("lastModifyUserName")
private String lastModifyUserName;
/** 修改时间 **/
@JsonProperty("lastModifyTime")
private String lastModifyTime;
/** 部门id **/
@JsonProperty("departmentId")
private String departmentId;
/** 组织id **/
@JsonProperty("orgnizeId")
private String orgnizeId;
}

@ -0,0 +1,35 @@
package jnpf.payment.service;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.payment.entity.PaymentEntity;
import jnpf.payment.model.payment.PaymentPagination;
import java.util.List;
/**
*
* payment
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-11
*/
public interface PaymentService extends IService<PaymentEntity> {
List<PaymentEntity> getList(PaymentPagination paymentPagination);
List<PaymentEntity> getTypeList(PaymentPagination paymentPagination,String dataType);
PaymentEntity getInfo(String id);
void delete(PaymentEntity entity);
void create(PaymentEntity entity);
boolean update( String id, PaymentEntity entity);
// 子表方法
//列表子表数据方法
}

@ -0,0 +1,16 @@
package jnpf.payment.service;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.payment.entity.Payment_item0Entity;
/**
*
* jg_payment_item0
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-11
*/
public interface Payment_item0Service extends IService<Payment_item0Entity> {
}

@ -0,0 +1,259 @@
package jnpf.payment.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.payment.entity.PaymentEntity;
import jnpf.payment.entity.Payment_item0Entity;
import jnpf.payment.mapper.PaymentMapper;
import jnpf.payment.model.payment.PaymentPagination;
import jnpf.payment.service.PaymentService;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.permission.service.AuthorizeService;
import jnpf.util.ServletUtil;
import jnpf.util.StringUtil;
import jnpf.util.UserProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
/**
*
* payment
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-11
*/
@Service
public class PaymentServiceImpl extends ServiceImpl<PaymentMapper, PaymentEntity> implements PaymentService {
@Autowired
private UserProvider userProvider;
@Autowired
private AuthorizeService authorizeService;
@Override
public List<PaymentEntity> getList(PaymentPagination paymentPagination){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int paymentNum =0;
QueryWrapper<PaymentEntity> paymentQueryWrapper=new QueryWrapper<>();
int payment_item0Num =0;
QueryWrapper<Payment_item0Entity> payment_item0QueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = true;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object paymentObj=authorizeService.getCondition(new AuthorizeConditionModel(paymentQueryWrapper,paymentPagination.getMenuId(),"payment"));
if (ObjectUtil.isEmpty(paymentObj)){
return new ArrayList<>();
} else {
paymentQueryWrapper = (QueryWrapper<PaymentEntity>)paymentObj;
paymentNum++;
}
Object payment_item0Obj=authorizeService.getCondition(new AuthorizeConditionModel(payment_item0QueryWrapper,paymentPagination.getMenuId(),"payment_item0"));
if (ObjectUtil.isEmpty(payment_item0Obj)){
return new ArrayList<>();
} else {
payment_item0QueryWrapper = (QueryWrapper<Payment_item0Entity>)payment_item0Obj;
payment_item0Num++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object paymentObj=authorizeService.getCondition(new AuthorizeConditionModel(paymentQueryWrapper,paymentPagination.getMenuId(),"payment"));
if (ObjectUtil.isEmpty(paymentObj)){
return new ArrayList<>();
} else {
paymentQueryWrapper = (QueryWrapper<PaymentEntity>)paymentObj;
paymentNum++;
}
Object payment_item0Obj=authorizeService.getCondition(new AuthorizeConditionModel(payment_item0QueryWrapper,paymentPagination.getMenuId(),"payment_item0"));
if (ObjectUtil.isEmpty(payment_item0Obj)){
return new ArrayList<>();
} else {
payment_item0QueryWrapper = (QueryWrapper<Payment_item0Entity>)payment_item0Obj;
payment_item0Num++;
}
}
}
if(StringUtil.isNotEmpty(paymentPagination.getDocumentno())){
paymentNum++;
paymentQueryWrapper.lambda().like(PaymentEntity::getDocumentno,paymentPagination.getDocumentno());
}
if(StringUtil.isNotEmpty(paymentPagination.getSuppliername())){
paymentNum++;
paymentQueryWrapper.lambda().like(PaymentEntity::getSuppliername,paymentPagination.getSuppliername());
}
if(AllIdList.size()>0){
paymentQueryWrapper.lambda().in(PaymentEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(paymentPagination.getSidx())){
paymentQueryWrapper.lambda().orderByDesc(PaymentEntity::getBusinessdate);
}else{
try {
String sidx = paymentPagination.getSidx();
PaymentEntity paymentEntity = new PaymentEntity();
Field declaredField = paymentEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
paymentQueryWrapper="asc".equals(paymentPagination.getSort().toLowerCase())?paymentQueryWrapper.orderByAsc(value):paymentQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if((total>0 && AllIdList.size()>0) || total==0){
Page<PaymentEntity> page=new Page<>(paymentPagination.getCurrentPage(), paymentPagination.getPageSize());
IPage<PaymentEntity> userIPage=this.page(page, paymentQueryWrapper);
return paymentPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<PaymentEntity> list = new ArrayList();
return paymentPagination.setData(list, list.size());
}
}
@Override
public List<PaymentEntity> getTypeList(PaymentPagination paymentPagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int paymentNum =0;
QueryWrapper<PaymentEntity> paymentQueryWrapper=new QueryWrapper<>();
int payment_item0Num =0;
QueryWrapper<Payment_item0Entity> payment_item0QueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = true;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object paymentObj=authorizeService.getCondition(new AuthorizeConditionModel(paymentQueryWrapper,paymentPagination.getMenuId(),"payment"));
if (ObjectUtil.isEmpty(paymentObj)){
return new ArrayList<>();
} else {
paymentQueryWrapper = (QueryWrapper<PaymentEntity>)paymentObj;
paymentNum++;
}
Object payment_item0Obj=authorizeService.getCondition(new AuthorizeConditionModel(payment_item0QueryWrapper,paymentPagination.getMenuId(),"payment_item0"));
if (ObjectUtil.isEmpty(payment_item0Obj)){
return new ArrayList<>();
} else {
payment_item0QueryWrapper = (QueryWrapper<Payment_item0Entity>)payment_item0Obj;
payment_item0Num++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object paymentObj=authorizeService.getCondition(new AuthorizeConditionModel(paymentQueryWrapper,paymentPagination.getMenuId(),"payment"));
if (ObjectUtil.isEmpty(paymentObj)){
return new ArrayList<>();
} else {
paymentQueryWrapper = (QueryWrapper<PaymentEntity>)paymentObj;
paymentNum++;
}
Object payment_item0Obj=authorizeService.getCondition(new AuthorizeConditionModel(payment_item0QueryWrapper,paymentPagination.getMenuId(),"payment_item0"));
if (ObjectUtil.isEmpty(payment_item0Obj)){
return new ArrayList<>();
} else {
payment_item0QueryWrapper = (QueryWrapper<Payment_item0Entity>)payment_item0Obj;
payment_item0Num++;
}
}
}
if(StringUtil.isNotEmpty(paymentPagination.getDocumentno())){
paymentNum++;
paymentQueryWrapper.lambda().like(PaymentEntity::getDocumentno,paymentPagination.getDocumentno());
}
if(StringUtil.isNotEmpty(paymentPagination.getSuppliername())){
paymentNum++;
paymentQueryWrapper.lambda().like(PaymentEntity::getSuppliername,paymentPagination.getSuppliername());
}
if(AllIdList.size()>0){
paymentQueryWrapper.lambda().in(PaymentEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(paymentPagination.getSidx())){
paymentQueryWrapper.lambda().orderByDesc(PaymentEntity::getBusinessdate);
}else{
try {
String sidx = paymentPagination.getSidx();
PaymentEntity paymentEntity = new PaymentEntity();
Field declaredField = paymentEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
paymentQueryWrapper="asc".equals(paymentPagination.getSort().toLowerCase())?paymentQueryWrapper.orderByAsc(value):paymentQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<PaymentEntity> page=new Page<>(paymentPagination.getCurrentPage(), paymentPagination.getPageSize());
IPage<PaymentEntity> userIPage=this.page(page, paymentQueryWrapper);
return paymentPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<PaymentEntity> list = new ArrayList();
return paymentPagination.setData(list, list.size());
}
}else{
return this.list(paymentQueryWrapper);
}
}
@Override
public PaymentEntity getInfo(String id){
QueryWrapper<PaymentEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(PaymentEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(PaymentEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, PaymentEntity entity){
entity.setId(id);
return this.updateById(entity);
}
@Override
public void delete(PaymentEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
//子表方法
//列表子表数据方法
}

@ -0,0 +1,21 @@
package jnpf.payment.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.payment.entity.Payment_item0Entity;
import jnpf.payment.mapper.Payment_item0Mapper;
import jnpf.payment.service.Payment_item0Service;
import org.springframework.stereotype.Service;
/**
*
* jg_payment_item0
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-11
*/
@Service
public class Payment_item0ServiceImpl extends ServiceImpl<Payment_item0Mapper, Payment_item0Entity> implements Payment_item0Service {
}

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.payment.mapper.Jg_paymentMapper">
</mapper>

@ -0,0 +1,150 @@
<template>
<el-dialog title="详情"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="12" >
<el-form-item label="业务日期"
prop="businessdate" >
<p>{{jnpf.dateFormat(dataForm.businessdate)}}</p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="单据编号"
prop="documentno" >
<p>{{dataForm.documentno}}</p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="客户"
prop="suppliername" >
<p>{{dataForm.suppliername}}</p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="币别"
prop="currency" >
<p>{{ dataForm.currency | dynamicText(currencyOptions) }} </p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="付款金额"
prop="paymentamount" >
<p>{{dataForm.paymentamount}}</p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="付款账户"
prop="paymentaccount" >
<p>{{dataForm.paymentaccount}}</p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="付款银行"
prop="paymentbank" >
<p>{{dataForm.paymentbank}}</p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="付款类型"
prop="paymenttype" >
<p>{{ dataForm.paymenttype | dynamicText(paymenttypeOptions) }} </p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="结算类型"
prop="settlementtype" >
<p>{{ dataForm.settlementtype | dynamicText(settlementtypeOptions) }} </p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="单据状态"
prop="status" >
<p>{{ dataForm.status | dynamicText(statusOptions) }} </p>
</el-form-item>
</el-col>
</template>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import PrintBrowse from '@/components/PrintBrowse'
import jnpf from '@/utils/jnpf'
export default {
components: {PrintBrowse},
props: [],
data() {
return {
visible: false,
loading: false,
printBrowseVisible: false,
printId: '',
dataForm: {
id :'',
businessdate : '',
documentno : '',
suppliername : '',
currency : "0",
paymentamount : '',
paymentaccount : '',
paymentbank : '',
paymenttype : "",
settlementtype : "",
status : "",
creatorUserId : "",
creatorUserName : "",
creatorTime : "",
lastModifyUserId : "",
lastModifyUserName : "",
lastModifyTime : "",
departmentId : "",
orgnizeId : "",
},
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
paymenttypeOptions:[{"fullName":"贷款","id":"0"},{"fullName":"运费","id":"1"},{"fullName":"仓储","id":"2"}],
settlementtypeOptions:[{"fullName":"现金","id":"0"},{"fullName":"赊购","id":"1"},{"fullName":"网银","id":"2"},{"fullName":"银企直连","id":"3"},{"fullName":"银票","id":"4"},{"fullName":"商票","id":"5"}],
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"},{"fullName":"已付款","id":"3"}],
}
},
computed: {},
watch: {},
created() {
},
mounted() {},
methods: {
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/example/Payment/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
})
},
},
}
</script>

@ -0,0 +1,68 @@
<template>
<el-dialog title="导出数据" :close-on-click-modal="false" :visible.sync="visible"
class="JNPF-dialog JNPF-dialog_center" lock-scroll width="600px">
<el-form label-position="top" label-width="80px">
<el-form-item label="数据选择">
<el-radio-group v-model="type">
<el-radio :label="0">当前页面数据</el-radio>
<el-radio :label="1">全部页面数据</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="导出字段">
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll"
@change="handleCheckAllChange">全选</el-checkbox>
<el-checkbox-group v-model="columns" @change="handleCheckedChange">
<el-checkbox v-for="item in columnList" :label="item.prop" :key="item.prop">
{{item.label}}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible=false"> </el-button>
<el-button type="primary" @click="downLoad"> </el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data() {
return {
visible: false,
btnLoading: false,
type: 0,
columns: [],
checkAll: true,
isIndeterminate: false,
columnList: []
}
},
methods: {
init(columnList) {
this.visible = true
this.checkAll = true
this.isIndeterminate = false
this.columnList = columnList
this.columns = columnList.map(o => o.prop)
},
handleCheckAllChange(val) {
this.columns = val ? this.columnList.map(o => o.prop) : [];
this.isIndeterminate = false;
},
handleCheckedChange(value) {
let checkedCount = value.length;
this.checkAll = checkedCount === this.columnList.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.columnList.length;
},
downLoad() {
this.$emit('download', { dataType: this.type, selectKey: this.columns.join(',') })
}
}
}
</script>
<style lang="scss" scoped>
>>> .el-dialog__body {
padding: 20px !important;
}
</style>

@ -0,0 +1,258 @@
<template>
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="12" >
<el-form-item label="业务日期"
prop="businessdate" >
<el-date-picker v-model="dataForm.businessdate"
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="单据编号"
prop="documentno" >
<el-input v-model="dataForm.documentno"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="客户"
prop="suppliername" >
<el-input v-model="dataForm.suppliername"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="币别"
prop="currency" >
<el-select v-model="dataForm.currency"
placeholder="请选择" :style='{"width":"100%"}'>
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="付款金额"
prop="paymentamount" >
<el-input v-model="dataForm.paymentamount"
placeholder="请输入付款金额" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="付款账户"
prop="paymentaccount" >
<el-input v-model="dataForm.paymentaccount"
placeholder="请输入付款账户" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="付款银行"
prop="paymentbank" >
<el-input v-model="dataForm.paymentbank"
placeholder="请输入付款银行" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="付款类型"
prop="paymenttype" >
<el-select v-model="dataForm.paymenttype"
placeholder="请选择付款类型" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in paymenttypeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="结算类型"
prop="settlementtype" >
<el-select v-model="dataForm.settlementtype"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in settlementtypeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="单据状态"
prop="status" >
<el-select v-model="dataForm.status"
placeholder="请选择单据状态" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</el-form-item>
</el-col>
</template>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> </el-button>
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
export default {
components: {},
props: [],
data() {
return {
visible: false,
loading: false,
isDetail: false,
dataForm: {
businessdate : '',
documentno : '',
suppliername : '',
currency : "0",
paymentamount : '',
paymentaccount : '',
paymentbank : '',
paymenttype : "",
settlementtype : "",
status : "",
creatorUserId : "",
creatorUserName : "",
creatorTime : "",
lastModifyUserId : "",
lastModifyUserName : "",
lastModifyTime : "",
departmentId : "",
orgnizeId : "",
},
rules:
{
currency: [
{
required: true,
message: '请至少选择一个',
trigger: 'change'
},
],
paymentamount: [
],
paymentaccount: [
],
},
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
paymenttypeOptions:[{"fullName":"贷款","id":"0"},{"fullName":"运费","id":"1"},{"fullName":"仓储","id":"2"}],
settlementtypeOptions:[{"fullName":"现金","id":"0"},{"fullName":"赊购","id":"1"},{"fullName":"网银","id":"2"},{"fullName":"银企直连","id":"3"},{"fullName":"银票","id":"4"},{"fullName":"商票","id":"5"}],
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"},{"fullName":"已付款","id":"3"}],
}
},
computed: {},
watch: {},
created() {
},
mounted() {},
methods: {
clearData(data){
for (let key in data) {
if (data[key] instanceof Array) {
data[key] = [];
} else if (data[key] instanceof Object) {
this.clearData(data[key]);
} else {
data[key] = "";
}
}
},
init(id, isDetail) {
this.dataForm.id = id || 0;
this.visible = true;
this.isDetail = isDetail || false;
this.$nextTick(() => {
this.$refs['elForm'].resetFields();
if(this.dataForm.id){
this.loading = true
request({
url: '/api/example/Payment/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
}else{
this.clearData(this.dataForm)
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
dataFormSubmit() {
this.$refs['elForm'].validate((valid) => {
if (valid) {
this.request()
}
})
},
request() {
var _data =this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/example/Payment',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}else{
request({
url: '/api/example/Payment/'+this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}
},
dataList(){
var _data = JSON.parse(JSON.stringify(this.dataForm));
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
},
},
}
</script>

@ -0,0 +1,264 @@
<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="单据编号">
<el-input v-model="query.documentno" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="客户">
<el-input v-model="query.suppliername" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<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-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="el-icon-plus" @click="addOrUpdateHandle()">
</el-button>
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
</el-button>
</div>
<div class="JNPF-common-head-right">
<el-tooltip effect="dark" content="刷新" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
@click="reset()"/>
</el-tooltip>
<screenfull isContainer/>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' >
<el-table-column prop="businessdate" label="业务日期" width="0" align="left"
sortable="custom" />
<el-table-column prop="documentno" label="单据编号" width="0" align="left"
/>
<el-table-column prop="suppliername" label="客户" width="0" align="left"
/>
<el-table-column label="币别" width="0" prop="currency" algin="left"
>
<template slot-scope="scope">
{{ scope.row.currency | dynamicText(currencyOptions) }}
</template>
</el-table-column>
<el-table-column prop="paymentamount" label="付款金额" width="0" align="left"
/>
<el-table-column prop="paymentaccount" label="付款账户" width="0" align="left"
/>
<el-table-column prop="paymentbank" label="付款银行" width="0" align="left"
/>
<el-table-column label="付款类型" width="0" prop="paymenttype" algin="left"
>
<template slot-scope="scope">
{{ scope.row.paymenttype | dynamicText(paymenttypeOptions) }}
</template>
</el-table-column>
<el-table-column label="结算类型" width="0" prop="settlementtype" algin="left"
>
<template slot-scope="scope">
{{ scope.row.settlementtype | dynamicText(settlementtypeOptions) }}
</template>
</el-table-column>
<el-table-column label="单据状态" width="0" prop="status" algin="left"
>
<template slot-scope="scope">
{{ scope.row.status | dynamicText(statusOptions) }}
</template>
</el-table-column>
<el-table-column label="操作" fixed="right"
width="150" >
<template slot-scope="scope">
<el-button type="text"
@click="addOrUpdateHandle(scope.row.id)" >编辑
</el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</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"/>
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
</div>
</template>
<script>
import request from '@/utils/request'
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
import JNPFForm from './Form'
import ExportBox from './ExportBox'
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
import Detail from './Detail'
export default {
components: {JNPFForm, ExportBox,Detail},
data() {
return {
detailVisible: false,
query: {
documentno:undefined,
suppliername:undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id'
},
list: [],
listLoading: true,
total: 0,
listQuery: {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "businessdate",
},
formVisible: false,
exportBoxVisible: false,
columnList: [
{prop: 'businessdate', label: '业务日期'},
{prop: 'documentno', label: '单据编号'},
{prop: 'suppliername', label: '客户'},
{prop: 'currency', label: '币别'},
{prop: 'paymentamount', label: '付款金额'},
{prop: 'paymentaccount', label: '付款账户'},
{prop: 'paymentbank', label: '付款银行'},
{prop: 'paymenttype', label: '付款类型'},
{prop: 'settlementtype', label: '结算类型'},
{prop: 'status', label: '单据状态'},
],
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
currencyProps:{"label":"fullName","value":"id"},
paymenttypeOptions:[{"fullName":"贷款","id":"0"},{"fullName":"运费","id":"1"},{"fullName":"仓储","id":"2"}],
paymenttypeProps:{"label":"fullName","value":"id"},
settlementtypeOptions:[{"fullName":"现金","id":"0"},{"fullName":"赊购","id":"1"},{"fullName":"网银","id":"2"},{"fullName":"银企直连","id":"3"},{"fullName":"银票","id":"4"},{"fullName":"商票","id":"5"}],
settlementtypeProps:{"label":"fullName","value":"id"},
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"},{"fullName":"已付款","id":"3"}],
statusProps:{"label":"fullName","value":"id"},
}
},
computed: {
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
this.initData()
},
methods: {
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()
},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
menuId:this.menuId
};
request({
url: `/api/example/Payment/getList`,
method: 'post',
data: _query
}).then(res => {
var _list =[];
for(let i=0;i<res.data.list.length;i++){
let _data = res.data.list[i];
_list.push(_data)
}
this.list = _list
this.total = res.data.pagination.total
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/example/Payment/${id}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {
});
},
addOrUpdateHandle(id, isDetail) {
this.formVisible = true
this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail)
})
},
exportData() {
this.exportBoxVisible = true
this.$nextTick(() => {
this.$refs.ExportBox.init(this.columnList)
})
},
download(data) {
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
request({
url: `/api/example/Payment/Actions/Export`,
method: 'GET',
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,
pageSize: 20,
sort: "desc",
sidx: "businessdate",
}
this.initData()
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
for (let key in this.query) {
this.query[key] = undefined
}
this.search()
}
}
}
</script>
Loading…
Cancel
Save