销项合并测试:全电发票查询

beta-enc
dongxiaoke 2 years ago
parent 2aad5f7b24
commit 33cf801e09
  1. 18
      jianshui-invoice/src/main/java/com/jianshui/invoice/domain/dto/api/InvoiceAllFileAcquisitionTWODTO.java
  2. 6
      jianshui-invoice/src/main/java/com/jianshui/invoice/domain/dto/api/jcsk/FileAcquisitionTwoDTO.java
  3. 42
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/JcskInvoiceApiServiceImpl.java
  4. 4
      jianshui-invoice/src/main/java/com/jianshui/invoice/utils/JcskTest.java
  5. 6
      jianshui-system/src/main/java/com/jianshui/system/service/IInvoiceAllApiLogService.java
  6. 7
      jianshui-system/src/main/java/com/jianshui/system/service/IInvoiceAllYhdjService.java
  7. 8
      jianshui-system/src/main/java/com/jianshui/system/service/impl/InvoiceAllApiLogServiceImpl.java
  8. 9
      jianshui-system/src/main/java/com/jianshui/system/service/impl/InvoiceAllYhdjServiceImpl.java

@ -14,24 +14,6 @@ import javax.validation.constraints.NotEmpty;
@Data
public class InvoiceAllFileAcquisitionTWODTO {
@NotEmpty
@ApiModelProperty(value = "true")
private String async;
@NotEmpty
@ApiModelProperty(value = "办税人身份证号")
private String bsrysfzjhm;
@NotEmpty
@ApiModelProperty(value = "*地区编码(参考码表)")
private String dqbm;
@NotEmpty
@ApiModelProperty(value = "*纳税人识别号")
private String nsrsbh;
@NotEmpty
@ApiModelProperty(value = "全电发票号码")
private String fphm;

@ -1,9 +1,13 @@
package com.jianshui.invoice.domain.dto.api.jcsk;
import cn.hutool.json.JSON;
import cn.hutool.json.JSONObject;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import java.util.List;
import java.util.Map;
/**
* 通用查询接口DTO
@ -39,4 +43,6 @@ public class FileAcquisitionTwoDTO {
private String kprq;
private Map<String,Object> jsonData;
}

@ -720,6 +720,23 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
public HXResponse getFileUrl(InvoiceAllFileAcquisitionTWODTO invoiceAllFileAcquisitionTWODTO, Companyservice companyservice) {
FileAcquisitionTwoDTO fileAcquisitionDTO = BeanUtil.copyProperties(invoiceAllFileAcquisitionTWODTO, FileAcquisitionTwoDTO.class);
// 查询用户信息组装
InvoiceAllYhdj yhdj = getUserInfo(companyservice);
if(BeanUtil.isEmpty(yhdj)){
return new HXResponse("未查询到登记信息!");
}
fileAcquisitionDTO.setAsync("true");
fileAcquisitionDTO.setNsrsbh(yhdj.getNsrsbh());
fileAcquisitionDTO.setBsrysfzjhm(yhdj.getBsrysfzjhm());
fileAcquisitionDTO.setDqbm(yhdj.getDqbm());
Map<String,Object> map = new JSONObject();
map.put("fphm",fileAcquisitionDTO.getFphm());
map.put("kprq",fileAcquisitionDTO.getKprq());
fileAcquisitionDTO.setJsonData(map);
ValidateUtils.validate(fileAcquisitionDTO);
cn.hutool.json.JSONObject result = null;
@ -746,6 +763,9 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
allApiLog.setCreateTime(new Date());
allApiLogMapper.insertInvoiceAllApiLog(allApiLog);
HXResponse response = new HXResponse("0000", "同步成功");
response.put("data", JSONUtil.parse(data));
return response;
} else {
return new HXResponse(msg);
}
@ -756,8 +776,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
}
HXResponse response = new HXResponse("0000", "同步成功", result);
return response;
}
@Override
@ -1248,6 +1267,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
}
}
// TODO: 2023/3/29 返回数据处理
response.put("data", JSONUtil.parse(data));
}
else if (WebServiceConstant.ADD_RED_INVOICE.equals(finalServiceId)) {
// 查找原发票信息
@ -1308,6 +1328,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
} else if (WebServiceConstant.QDFPWJHQ.equals(finalServiceId)) {
// 审核红字信息表
// TODO: 全电发票文件获取
response.put("data", JSONUtil.parse(data));
} else if (WebServiceConstant.QRCODE.equals(finalServiceId)) {
response.put("data", JSONUtil.parse(data));
} else if (WebServiceConstant.SQHZFPXXQRD.equals(finalServiceId)) {
@ -1360,6 +1381,8 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
response.put("data", addRedInfoInvoiceTWOVO);
}
}else{
response.put("data",JSONUtil.parse(data));
}
return response;
} else {
@ -1434,4 +1457,19 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
}
/**
* 用户信息处理
*/
public InvoiceAllYhdj getUserInfo(Companyservice companyservice){
// 查询用户登记参数
QueryWrapper<InvoiceAllYhdj> yhdjQueryWrapper = new QueryWrapper<>();
yhdjQueryWrapper.eq("nsrsbh", companyservice.getSellertax());
yhdjQueryWrapper.eq("identity", companyservice.getIdentity());
InvoiceAllYhdj invoiceAllYhdj = yhdjMapper.selectOne(yhdjQueryWrapper);
return invoiceAllYhdj;
}
}

@ -80,14 +80,14 @@ public class JcskTest {
" \"bsryxm\": \"贾宁\",\n" +
" \"dlsf\": \"7\",\n" +
" \"dlsfmm\": \"139690jn\",\n" +
" \"dlfs\": \"3\",\n" +
" \"dlfs\": \"2\",\n" +
" \"dlmm\": \"139690jn\",\n" +
" \"dlzh\": \"37028519930620441X\",\n" +
" \"nsrmc\": \"城阳区兴顺通制冷设备维修服务部\",\n" +
" \"nsrsbh\": \"92370214MACAAEK16E\",\n" +
" \"bsrysfzjhm\": \"37028519930620441X\",\n" +
" \"bsrysjhm\": \"13969067208\",\n" +
" \"zjh\": \"\",\n" +
" \"zjh\": \"16556821252\",\n" +
" \"loginType\": \"1\"\n" +
" }\n" +
"}";

@ -1,6 +1,8 @@
package com.jianshui.invoiceall.service;
package com.jianshui.system.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jianshui.system.domain.InvoiceAllApiLog;
/**
@ -9,7 +11,7 @@ import com.jianshui.system.domain.InvoiceAllApiLog;
* @author jianshui
* @date 2022-12-13
*/
public interface IInvoiceAllApiLogService
public interface IInvoiceAllApiLogService extends IService<InvoiceAllApiLog>
{
/**
* 查询API调用记录-金四

@ -1,6 +1,9 @@
package com.jianshui.invoiceall.service;
package com.jianshui.system.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jianshui.system.domain.InvoiceAllApiLog;
import com.jianshui.system.domain.InvoiceAllYhdj;
/**
@ -9,7 +12,7 @@ import com.jianshui.system.domain.InvoiceAllYhdj;
* @author jianshui
* @date 2022-12-13
*/
public interface IInvoiceAllYhdjService
public interface IInvoiceAllYhdjService extends IService<InvoiceAllYhdj>
{
/**
* 查询金四-用户登记

@ -1,12 +1,14 @@
package com.jianshui.invoiceall.service.impl;
package com.jianshui.system.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jianshui.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jianshui.system.mapper.InvoiceAllApiLogMapper;
import com.jianshui.system.domain.InvoiceAllApiLog;
import com.jianshui.invoiceall.service.IInvoiceAllApiLogService;
import com.jianshui.system.service.IInvoiceAllApiLogService;
/**
* API调用记录-金四Service业务层处理
@ -15,7 +17,7 @@ import com.jianshui.invoiceall.service.IInvoiceAllApiLogService;
* @date 2022-12-13
*/
@Service
public class InvoiceAllApiLogServiceImpl implements IInvoiceAllApiLogService
public class InvoiceAllApiLogServiceImpl extends ServiceImpl<InvoiceAllApiLogMapper, InvoiceAllApiLog> implements IInvoiceAllApiLogService
{
@Autowired
private InvoiceAllApiLogMapper invoiceAllApiLogMapper;

@ -1,12 +1,15 @@
package com.jianshui.invoiceall.service.impl;
package com.jianshui.system.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jianshui.system.domain.InvoiceAllApiLog;
import com.jianshui.system.mapper.InvoiceAllApiLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jianshui.system.mapper.InvoiceAllYhdjMapper;
import com.jianshui.system.domain.InvoiceAllYhdj;
import com.jianshui.invoiceall.service.IInvoiceAllYhdjService;
import com.jianshui.system.service.IInvoiceAllYhdjService;
/**
* 金四-用户登记Service业务层处理
@ -15,7 +18,7 @@ import com.jianshui.invoiceall.service.IInvoiceAllYhdjService;
* @date 2022-12-13
*/
@Service
public class InvoiceAllYhdjServiceImpl implements IInvoiceAllYhdjService
public class InvoiceAllYhdjServiceImpl extends ServiceImpl<InvoiceAllYhdjMapper, InvoiceAllYhdj> implements IInvoiceAllYhdjService
{
@Autowired
private InvoiceAllYhdjMapper invoiceAllYhdjMapper;
Loading…
Cancel
Save