beta
路明慧 2 years ago
parent 70306e17a1
commit 65b07f8a21
  1. 3
      jianshui-invoice/src/main/java/com/jianshui/invoice/mapper/RedinfoMapper.java
  2. 27
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiV6ServiceImpl.java
  3. 4
      jianshui-invoice/src/main/resources/mapper/invoice/RedinfoMapper.xml

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jianshui.invoice.domain.Redinfo;
import com.jianshui.invoice.domain.Redinfodetail;
import com.jianshui.invoice.domain.dto.FindRedWordDTO;
import org.apache.ibatis.annotations.Param;
/**
* 红字信息表Mapper接口
@ -95,4 +96,6 @@ public interface RedinfoMapper extends BaseMapper<Redinfo> {
List<Redinfo> findRedInfoList(FindRedWordDTO dto);
Long getDetailId();
List<Redinfodetail> selectRedinfoDetailList(@Param("redInfoId") Long id);
}

@ -75,6 +75,7 @@ import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.text.ParseException;
import java.util.*;
import java.util.stream.Collectors;
/**
* 销项实现
@ -1990,6 +1991,8 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService {
return response;
}else if (WebServiceConstant.QRCODE.equals(finalServiceId)) {
// 获取人脸二维码
//查询状态还是返回二维码数据
//用不用入库
}else if (WebServiceConstant.SQHZFPXXQRD.equals(finalServiceId)) {
// 申请红字信息表
@ -2000,6 +2003,7 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService {
Redinfo redinfo = redinfoMapper.selectOne(queryWrapper);
HXResponse hxResponse = queryRedInfoByElepant(redinfo,companyservice);
return hxResponse;
}else if (WebServiceConstant.ADD_RED_INVOICE.equals(finalServiceId)) {
// 红字发票开具
@ -2026,6 +2030,7 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService {
}else if (WebServiceConstant.CXHZFPXXQRD.equals(finalServiceId)) {
// 查询红字信息表
} else if (WebServiceConstant.SHHZFPXXQRD.equals(finalServiceId)) {
// 审核红字信息表
@ -2070,7 +2075,7 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService {
//调用大象接口查询红字信息表明细
AjaxResult queryResult = null;
try {
queryResult = ElephantUtils.sendRequestWithoutTokenV6New(ElephantConstantsV6.QUERY_INVOICE_LOCALHOST, ElephantConstantsV6.QUERY_INVOICE_METHOD, JSONUtil.parse(param), companyservice);
queryResult = ElephantUtils.sendRequestWithoutTokenV6New(ElephantConstantsV6.QUERY_RED_CONFIRMATION_ITEM_LIST_LOCALHOST, ElephantConstantsV6.QUERY_RED_CONFIRMATION_ITEM_LIST_METHOD, JSONUtil.parse(param), companyservice);
} catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) {
log.error("【销项发票】【大象接口】【红字信息表申请】发票请求异常,请求报文{},销方信息{}", JSONUtil.parse(param).toString(), JSONObject.toJSONString(companyservice));
e.printStackTrace();
@ -2114,17 +2119,16 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService {
debugLog("红字订单更新主表信息失败",uuid,System.currentTimeMillis());
throw new JianshuiServiceException("红字订单更新主表信息失败");
}
//删除红字信息明细
redinfoMapper.deleteRedinfodetailByRedinfoId(redinfo.getId());
long id = redinfoMapper.getDetailId();
List<Redinfodetail> redinfodetailList = new ArrayList<>();
List<Redinfodetail> redinfodetails = redinfoMapper.selectRedinfoDetailList(redinfo.getId());
Map<Integer, Redinfodetail> redInfoMapByIndex = redinfodetails.stream().collect(Collectors.toMap(e -> e.getIndex(), e -> e));
for (ElephantRedInfoDetail elephantRedInfoDetail : elephantRedInfo.getHZQRXXMXLIST()) {
id++;
Redinfodetail redinfodetail = new Redinfodetail();
redinfodetail.setId(id);
Redinfodetail redinfodetail = redInfoMapByIndex.get(elephantRedInfoDetail.getXH().longValue());
redinfodetail.setBillno(redinfo.getRedInfoNo());
redinfodetail.setRedinfoId(redinfo.getId());
redinfodetail.setIndex(elephantRedInfoDetail.getXH());
@ -2142,6 +2146,9 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService {
redinfodetailList.add(redinfodetail);
}
//删除红字信息明细
redinfoMapper.deleteRedinfodetailByRedinfoId(redinfo.getId());
//批量插入
int count = redinfoMapper.batchRedinfodetail(redinfodetailList);
if(count <1){
debugLog("红字订单更新明细信息失败",uuid,System.currentTimeMillis());
@ -2150,9 +2157,9 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService {
//TODO 返回啥看看文档
redinfo.setRedinfodetailList(redinfodetailList);
return null;
return new HXResponse("200","查询成功",redinfo);
}

@ -362,4 +362,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getDetailId" resultType="java.lang.Long">
select id from redinfodetail order by id desc limit 1
</select>
<select id="selectRedinfoDetailList" parameterType="java.lang.Long" resultType="com.jianshui.invoice.domain.Redinfodetail">
select * from redinfodetail where redinfo_id = #{redInfoId}
</select>
</mapper>
Loading…
Cancel
Save