11 changed files with 333 additions and 33 deletions
@ -0,0 +1,81 @@ |
|||
package com.qs.serve.modules.seeyon.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.IdType; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
/** |
|||
* 核销 |
|||
* @author YenHex |
|||
* @since 2023/1/3 |
|||
*/ |
|||
@Data |
|||
public class XltApticlaim implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 核销编号 */ |
|||
private String verificationCode; |
|||
|
|||
/** 费用编号(后缀表示详情子项) */ |
|||
@NotBlank(message = "费用编号(后缀表示详情子项)不能为空") |
|||
private String costCode; |
|||
|
|||
/** 费用编号 */ |
|||
@NotBlank(message = "费用编号不能为空") |
|||
private String costCode2; |
|||
|
|||
/** 客户编号 */ |
|||
@NotBlank(message = "客户编号不能为空") |
|||
private String cusCode; |
|||
|
|||
/** 金额 */ |
|||
private BigDecimal amount; |
|||
|
|||
/** 科目 */ |
|||
private String subjectCode; |
|||
|
|||
/** 费用科目描述 */ |
|||
private String subjectName; |
|||
|
|||
/** 申请类型 */ |
|||
private String expType; |
|||
|
|||
/** 单据类型 */ |
|||
private String applyType; |
|||
|
|||
/** 生效日期 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
private LocalDateTime effDate; |
|||
|
|||
/** 有无发票(0:没有 1:有) */ |
|||
private String invoiced; |
|||
|
|||
/** 新增时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
private LocalDateTime createTime; |
|||
|
|||
/** 处理状态(00:写入时初始状态 10: 处理成功 20: 处理失败) */ |
|||
private String status; |
|||
|
|||
/** 处理时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
private LocalDateTime dealTime; |
|||
|
|||
/** 主题 */ |
|||
private String topic; |
|||
|
|||
} |
@ -0,0 +1,99 @@ |
|||
package com.qs.serve.modules.seeyon.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.IdType; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.io.Serializable; |
|||
import java.time.LocalDateTime; |
|||
|
|||
/** |
|||
* @author YenHex |
|||
* @since 2023/1/4 |
|||
*/ |
|||
@Data |
|||
public class XltPaymentRecord implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 账套号 */ |
|||
@Length(max = 50,message = "账套号长度不能超过50字") |
|||
private String cAcc; |
|||
|
|||
/** 单据编号 */ |
|||
@Length(max = 50,message = "单据编号长度不能超过50字") |
|||
private String cFyCode; |
|||
|
|||
/** 单据名称 */ |
|||
@Length(max = 500,message = "单据名称长度不能超过500字") |
|||
private String cFyName; |
|||
|
|||
/** 制单日期 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
private LocalDateTime dDate; |
|||
|
|||
/** 开始日期 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
private LocalDateTime dFyDate1; |
|||
|
|||
/** 截止日期 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
private LocalDateTime dFyDate2; |
|||
|
|||
/** 费用编号 */ |
|||
@Length(max = 50,message = "费用编号长度不能超过50字") |
|||
private String cExpCode; |
|||
|
|||
/** 费用金额 */ |
|||
private Long nFyJe; |
|||
|
|||
/** 单据备注 */ |
|||
@Length(max = 500,message = "单据备注长度不能超过500字") |
|||
private String cFyMemo; |
|||
|
|||
/** 销路通录入人 */ |
|||
@Length(max = 50,message = "销路通录入人长度不能超过50字") |
|||
private String cXltUser; |
|||
|
|||
/** 销路通录入时间 */ |
|||
@Length(max = 50,message = "销路通录入时间长度不能超过50字") |
|||
private String dXltTime; |
|||
|
|||
/** BI同步执行人 */ |
|||
@Length(max = 50,message = "BI同步执行人长度不能超过50字") |
|||
private String cBIUser; |
|||
|
|||
/** BI同步执行时间 */ |
|||
@Length(max = 50,message = "BI同步执行时间长度不能超过50字") |
|||
private String dBITime; |
|||
|
|||
/** 客户编号 */ |
|||
@Length(max = 50,message = "客户编号长度不能超过50字") |
|||
private String cCusCode; |
|||
|
|||
/** 客户名称 */ |
|||
@Length(max = 200,message = "客户名称长度不能超过200字") |
|||
private String cCusName; |
|||
|
|||
/** 发票编号 */ |
|||
@Length(max = 50,message = "发票编号长度不能超过50字") |
|||
private String cSBVCode; |
|||
|
|||
/** 发货单 */ |
|||
@Length(max = 1000,message = "发货单长度不能超过1000字") |
|||
private String cDLCode; |
|||
|
|||
/** 发票核销日期 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
private LocalDateTime dHxDate; |
|||
|
|||
|
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.qs.serve.modules.seeyon.service; |
|||
|
|||
import com.qs.serve.common.model.dto.R; |
|||
import com.qs.serve.modules.seeyon.entity.XltApticlaim; |
|||
import com.qs.serve.modules.seeyon.entity.XltPaymentRecord; |
|||
|
|||
/** |
|||
* @author YenHex |
|||
* @since 2023/1/3 |
|||
*/ |
|||
public interface XiaoLuTonService { |
|||
|
|||
/** |
|||
* 保存核销记录 |
|||
* @param apticlaim |
|||
* @return |
|||
*/ |
|||
R<String> saveApticlaim(XltApticlaim apticlaim); |
|||
|
|||
|
|||
/** |
|||
* 保存支付记录 |
|||
* @param paymentRecord |
|||
* @return |
|||
*/ |
|||
R<String> savePaymentRecord(XltPaymentRecord paymentRecord); |
|||
|
|||
} |
@ -0,0 +1,52 @@ |
|||
package com.qs.serve.modules.seeyon.service.impl; |
|||
|
|||
import com.qs.serve.common.config.properties.SeeYonProperties; |
|||
import com.qs.serve.common.model.dto.R; |
|||
import com.qs.serve.common.util.Assert; |
|||
import com.qs.serve.common.util.HttpUtil; |
|||
import com.qs.serve.common.util.JsonUtil; |
|||
import com.qs.serve.modules.sys.service.SysUserService; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* @author YenHex |
|||
* @since 2023/1/4 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class SyBaseService { |
|||
|
|||
|
|||
private SeeYonProperties seeYonProperties; |
|||
private SysUserService sysUserService; |
|||
|
|||
public R<String> getBase(String url2, String title){ |
|||
String url = getBaseUrl(); |
|||
R<String> result = HttpUtil.doGetResult(url+url2,null); |
|||
if(result.getStatus()!=200){ |
|||
log.error("致远服务失败[{},{}] url2:{}",title,result.getMsg(),url2); |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
public R<String> postBase(String url2,Object param,String title){ |
|||
String url = getBaseUrl(); |
|||
R<String> result = HttpUtil.doPostResult(url + url2, JsonUtil.objectToJson(param),null); |
|||
if(result.getStatus()!=200){ |
|||
log.error("致远服务失败[{},{}]\nParam:{}",title,result.getMsg(),JsonUtil.objectToJson(param)); |
|||
} |
|||
log.debug("致远服务返回R<String>:{}",JsonUtil.objectToJson(result)); |
|||
return result; |
|||
} |
|||
|
|||
public String getBaseUrl(){ |
|||
if(!seeYonProperties.getEnable()){ |
|||
Assert.throwEx("远程服务未开启"); |
|||
} |
|||
return seeYonProperties.getUrl(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.qs.serve.modules.seeyon.service.impl; |
|||
|
|||
import com.qs.serve.common.model.dto.R; |
|||
import com.qs.serve.modules.seeyon.entity.XltApticlaim; |
|||
import com.qs.serve.modules.seeyon.entity.XltPaymentRecord; |
|||
import com.qs.serve.modules.seeyon.service.XiaoLuTonService; |
|||
import com.qs.serve.modules.tbs.common.TbsSeeYonConst; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* @author YenHex |
|||
* @since 2023/1/3 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class XiaoLuTonServiceImpl implements XiaoLuTonService { |
|||
|
|||
private SyBaseService syBaseService; |
|||
|
|||
@Override |
|||
public R<String> saveApticlaim(XltApticlaim apticlaim) { |
|||
String title = "保存核销记录"; |
|||
return syBaseService.postBase(TbsSeeYonConst.XLT_SAVE_CHECK,apticlaim,title); |
|||
} |
|||
|
|||
@Override |
|||
public R<String> savePaymentRecord(XltPaymentRecord paymentRecord) { |
|||
String title = "保存支付记录"; |
|||
return syBaseService.postBase(TbsSeeYonConst.XLT_SAVE_PAYMENT,paymentRecord,title); |
|||
} |
|||
|
|||
} |
Loading…
Reference in new issue