diff --git a/basic/src/main/java/com/djy/basic/Invoice/controller/InvoiceRecordController.java b/basic/src/main/java/com/djy/basic/Invoice/controller/InvoiceRecordController.java deleted file mode 100644 index 1ae5b6f..0000000 --- a/basic/src/main/java/com/djy/basic/Invoice/controller/InvoiceRecordController.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.djy.basic.Invoice.controller; - -import com.djy.basic.Invoice.service.InvoiceRecordService; -import com.djy.basic.Invoice.service.ParameterRecordService; -import com.djy.basic.Invoice.vo.req.InvoiceReq; -import com.djy.core.http.HttpResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/invoice") -@Tag(name = "InvoiceRecordController",description = "发票Controller") -public class InvoiceRecordController { - - private final InvoiceRecordService invoiceRecordService; - - @Autowired - private ParameterRecordService parameterRecordService; - - public InvoiceRecordController(InvoiceRecordService invoiceRecordService) { - this.invoiceRecordService = invoiceRecordService; - } - - @Operation(description = "获取发票详细信息") - @GetMapping("getInvoiceInfo") - public HttpResult getInvoiceInfo(InvoiceReq invoiceReq){ - this.invoiceRecordService.getInvoiceInfo(invoiceReq); - return HttpResult.ok(); - } - - @PostMapping("getParameter") - public HttpResult getParameter(@RequestBody String companyId){ - String amount = parameterRecordService.getAmount(companyId); - System.out.println(amount); - return HttpResult.ok(amount); - } - - -} diff --git a/basic/src/main/java/com/djy/basic/Invoice/model/InvoiceRecord.java b/basic/src/main/java/com/djy/basic/Invoice/model/InvoiceRecord.java deleted file mode 100644 index 8a2b22f..0000000 --- a/basic/src/main/java/com/djy/basic/Invoice/model/InvoiceRecord.java +++ /dev/null @@ -1,262 +0,0 @@ -package com.djy.basic.Invoice.model; - -import lombok.Data; - -import java.util.Date; - -/** - * @description invoiceRecord - * @author - * @date 2022-05-11 - */ -@Data -public class InvoiceRecord { - - private static final long serialVersionUID = 1L; - - /** - * gid - */ - private String gid; - - /** - * fromid - */ - private String fromid; - - /** - * fromsystem - */ - private String fromsystem; - - /** - * compid - */ - private String compid; - - /** - * buyername - */ - private String buyername; - - /** - * buyertaxnum - */ - private String buyertaxnum; - - /** - * buyertel - */ - private String buyertel; - - /** - * buyeraddress - */ - private String buyeraddress; - - /** - * buyeraccount - */ - private String buyeraccount; - - /** - * invoicedate - */ - private Date invoicedate; - - /** - * invoicetype - */ - private String invoicetype; - - /** - * salername - */ - private String salername; - - /** - * salertaxnum - */ - private String salertaxnum; - - /** - * salertel - */ - private String salertel; - - /** - * saleraddress - */ - private String saleraddress; - - /** - * saleraccount - */ - private String saleraccount; - - /** - * invoicecode - */ - private String invoicecode; - - /** - * invoicenum - */ - private String invoicenum; - - /** - * pushmode - */ - private String pushmode; - - /** - * buyerphone - */ - private String buyerphone; - - /** - * email - */ - private String email; - - /** - * invoiceline - */ - private String invoiceline; - - /** - * payee - */ - private String payee; - - /** - * checker - */ - private String checker; - - /** - * clerk - */ - private String clerk; - - /** - * orderno - */ - private String orderno; - - /** - * remark - */ - private String remark; - - /** - * createtime - */ - private Date createtime; - - /** - * createuser - */ - private String createuser; - - /** - * modifytime - */ - private Date modifytime; - - /** - * modifyuser - */ - private String modifyuser; - - /** - * status - */ - private String status; - - /** - * serialno - */ - private String serialno; - - /** - * invcode - */ - private String invcode; - - /** - * invnum - */ - private String invnum; - - /** - * total - */ - private Double total; - - /** - * totalwords - */ - private String totalwords; - - /** - * pdfurl - */ - private String pdfurl; - - /** - * pictureurl - */ - private String pictureurl; - - /** - * resultjson - */ - private String resultjson; - - /** - * requireremark - */ - private String requireremark; - - /** - * amountusd - */ - private Double amountusd; - - /** - * pdfnasurl - */ - private String pdfnasurl; - - /** - * extenddata - */ - private String extenddata; - - /** - * apisendtime - */ - private Date apisendtime; - - /** - * apireadtime - */ - private Date apireadtime; - - /** - * applyuser - */ - private String applyuser; - - /** - * clerkid - */ - private String clerkid; - - /** - * mblno - */ - private String mblno; - -} diff --git a/basic/src/main/java/com/djy/basic/Invoice/model/ParameterRecord.java b/basic/src/main/java/com/djy/basic/Invoice/model/ParameterRecord.java deleted file mode 100644 index 96da636..0000000 --- a/basic/src/main/java/com/djy/basic/Invoice/model/ParameterRecord.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.djy.basic.Invoice.model; - -import lombok.Data; - -import java.util.Date; - -/** - * @description invoiceRecord - * @author - * @date 2022-05-11 - */ -@Data -public class ParameterRecord { - - private String amount; - -} diff --git a/basic/src/main/java/com/djy/basic/Invoice/model/mapper/InvoiceRecordMapper.java b/basic/src/main/java/com/djy/basic/Invoice/model/mapper/InvoiceRecordMapper.java deleted file mode 100644 index 6b91814..0000000 --- a/basic/src/main/java/com/djy/basic/Invoice/model/mapper/InvoiceRecordMapper.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.djy.basic.Invoice.model.mapper; - -import com.djy.basic.Invoice.model.InvoiceRecord; -import com.djy.core.cmapper.CommonMapper; -import org.springframework.stereotype.Repository; - -@Repository -public interface InvoiceRecordMapper extends CommonMapper { -} diff --git a/basic/src/main/java/com/djy/basic/Invoice/model/mapper/ParameterMapper.java b/basic/src/main/java/com/djy/basic/Invoice/model/mapper/ParameterMapper.java deleted file mode 100644 index 6715f08..0000000 --- a/basic/src/main/java/com/djy/basic/Invoice/model/mapper/ParameterMapper.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.djy.basic.Invoice.model.mapper; - -import com.djy.basic.Invoice.model.InvoiceRecord; -import com.djy.basic.Invoice.model.ParameterRecord; -import com.djy.core.cmapper.CommonMapper; -import org.springframework.stereotype.Repository; - -@Repository -public interface ParameterMapper extends CommonMapper { - - String getAmount(String companyId); -} diff --git a/basic/src/main/java/com/djy/basic/Invoice/service/InvoiceRecordService.java b/basic/src/main/java/com/djy/basic/Invoice/service/InvoiceRecordService.java deleted file mode 100644 index f1c6bc3..0000000 --- a/basic/src/main/java/com/djy/basic/Invoice/service/InvoiceRecordService.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.djy.basic.Invoice.service; - -import com.djy.basic.Invoice.vo.req.InvoiceReq; - -public interface InvoiceRecordService { - - /** - * 获取发票信息 - * @param invoiceReq - */ - void getInvoiceInfo(InvoiceReq invoiceReq); -} diff --git a/basic/src/main/java/com/djy/basic/Invoice/service/ParameterRecordService.java b/basic/src/main/java/com/djy/basic/Invoice/service/ParameterRecordService.java deleted file mode 100644 index 96dc819..0000000 --- a/basic/src/main/java/com/djy/basic/Invoice/service/ParameterRecordService.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.djy.basic.Invoice.service; - -import com.djy.basic.Invoice.vo.req.InvoiceReq; - -public interface ParameterRecordService { - - String getAmount(String companyId); -} diff --git a/basic/src/main/java/com/djy/basic/Invoice/service/impl/InvoiceRecordServiceImpl.java b/basic/src/main/java/com/djy/basic/Invoice/service/impl/InvoiceRecordServiceImpl.java deleted file mode 100644 index 6464637..0000000 --- a/basic/src/main/java/com/djy/basic/Invoice/service/impl/InvoiceRecordServiceImpl.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.djy.basic.Invoice.service.impl; - -import com.djy.basic.Invoice.model.mapper.InvoiceRecordMapper; -import com.djy.basic.Invoice.service.InvoiceRecordService; -import com.djy.basic.Invoice.vo.req.InvoiceReq; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class InvoiceRecordServiceImpl implements InvoiceRecordService { - - @Autowired - private InvoiceRecordMapper invoiceRecordMapper; - - @Override - public void getInvoiceInfo(InvoiceReq invoiceReq) { - - } -} diff --git a/basic/src/main/java/com/djy/basic/Invoice/service/impl/ParameterRecordServiceImpl.java b/basic/src/main/java/com/djy/basic/Invoice/service/impl/ParameterRecordServiceImpl.java deleted file mode 100644 index 7cf98f1..0000000 --- a/basic/src/main/java/com/djy/basic/Invoice/service/impl/ParameterRecordServiceImpl.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.djy.basic.Invoice.service.impl; - -import com.djy.basic.Invoice.model.mapper.InvoiceRecordMapper; -import com.djy.basic.Invoice.model.mapper.ParameterMapper; -import com.djy.basic.Invoice.service.InvoiceRecordService; -import com.djy.basic.Invoice.service.ParameterRecordService; -import com.djy.basic.Invoice.vo.req.InvoiceReq; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class ParameterRecordServiceImpl implements ParameterRecordService { - - @Autowired - private ParameterMapper parameterMapper; - - - @Override - public String getAmount(String companyId) { - return parameterMapper.getAmount(companyId); - } -} diff --git a/basic/src/main/java/com/djy/basic/Invoice/vo/req/Bill.java b/basic/src/main/java/com/djy/basic/Invoice/vo/req/Bill.java deleted file mode 100644 index 74d7d15..0000000 --- a/basic/src/main/java/com/djy/basic/Invoice/vo/req/Bill.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.djy.basic.Invoice.vo.req; - -import lombok.Data; - -import java.util.List; - -@Data -public class Bill { - - private String BSNO; - - private String MBLNO; - - private String Yard; - - private String Vessel; - - private String Voyno; - - private String ETD; - - private String PortLoadId; - - private String PortLoad; - - private String PortDischargeId; - - private String PortDischarge; - - private String CntrTotal; - - private String PlaceReceiptId; - - private String PlaceReceipt; - - private String PlaceDeliveryId; - - private String PlaceDelivery; - - private String DestinationId; - - private String Destination; - - private List feeList; -} diff --git a/basic/src/main/java/com/djy/basic/Invoice/vo/req/Fee.java b/basic/src/main/java/com/djy/basic/Invoice/vo/req/Fee.java deleted file mode 100644 index 8ecdbbd..0000000 --- a/basic/src/main/java/com/djy/basic/Invoice/vo/req/Fee.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.djy.basic.Invoice.vo.req; - -import lombok.Data; - -@Data -public class Fee { - - private String FeeId; - - private String FeeName; - - private String CustomerName; - - private String Unit; - - private int UnitPrice; - - private int Quantity; - - private int Amount; - - private String Currency; - - private int ExchangeRate; - - private String Remark; - - private int Sort; - - private int TaxRate; - - private int NoTaxAmount; - - private int Tax; -} diff --git a/basic/src/main/java/com/djy/basic/Invoice/vo/req/InvoiceReq.java b/basic/src/main/java/com/djy/basic/Invoice/vo/req/InvoiceReq.java deleted file mode 100644 index 45d8d5d..0000000 --- a/basic/src/main/java/com/djy/basic/Invoice/vo/req/InvoiceReq.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.djy.basic.Invoice.vo.req; - -import lombok.Data; - -import java.util.List; - -@Data -public class InvoiceReq { - - private String LinkId; - - private String CompanyId; - - private String Email; - - private String BuyerName; - - private String BuyerTaxNum; - - private String BuyerTel; - - private String BuyerAddress; - - private String BuyerAccount; - - private String SalerName; - - private String SalerTaxNum; - - private String SalerTel; - - private String SalerAddress; - - private String SalerAccount; - - private String Payee; - - private String Checker; - - private String Clerk; - - private String RemarkTemplate; - - private List billList; -} diff --git a/basic/src/main/java/com/djy/basic/sysParamSet/controller/SysParamSetController.java b/basic/src/main/java/com/djy/basic/sysParamSet/controller/SysParamSetController.java index d9aec5c..999a979 100644 --- a/basic/src/main/java/com/djy/basic/sysParamSet/controller/SysParamSetController.java +++ b/basic/src/main/java/com/djy/basic/sysParamSet/controller/SysParamSetController.java @@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RestController; import java.util.List; @RestController -@RequestMapping("/api/sys_param_set") +@RequestMapping("/sysParam") @Tag(name = "SysParamSetController",description = "SysParamSet") public class SysParamSetController { diff --git a/invoice/src/main/java/com/djy/invoice/controller/InvLinkInfoController.java b/invoice/src/main/java/com/djy/invoice/controller/InvLinkInfoController.java index 360d56f..909bf53 100644 --- a/invoice/src/main/java/com/djy/invoice/controller/InvLinkInfoController.java +++ b/invoice/src/main/java/com/djy/invoice/controller/InvLinkInfoController.java @@ -28,7 +28,7 @@ public class InvLinkInfoController { private ParameterFeignClient parameterFeignClient; - @Operation(description = "外部调用接口") + @Operation(description = "上传发票链接数据") @PostMapping("getlink") public HttpResult getlink(@RequestBody String json) { return invLinkInfoService.getlink(json); @@ -43,7 +43,7 @@ public class InvLinkInfoController { // } - @Operation(description = "页面生成接口") + @Operation(description = "获取发票链接信息") @PostMapping("getInfo") public HttpResult getInfo(InvLinkInfo info) { @@ -53,7 +53,7 @@ public class InvLinkInfoController { } - @Operation(description = "发送发票") + @Operation(description = "开票") @PostMapping("uploadInvoice") public HttpResult uploadInvoice(InvLinkInfo info) { @@ -68,14 +68,14 @@ public class InvLinkInfoController { return HttpResult.ok(list); } - @Operation(description = "获取参数") - @PostMapping("getParameter") - public HttpResult getParameter() { - - String companyId ="9f3b3526-4dd4-4997-b974-1f2adb279389"; - HttpResult result = parameterFeignClient.getParameter(companyId); - return result; - } +// @Operation(description = "获取参数") +// @PostMapping("getParameter") +// public HttpResult getParameter() { +// +// String companyId ="9f3b3526-4dd4-4997-b974-1f2adb279389"; +// HttpResult result = parameterFeignClient.getParameter(companyId); +// return result; +// } diff --git a/invoice/src/main/java/com/djy/invoice/service/InvoiceSendTask.java b/invoice/src/main/java/com/djy/invoice/service/InvoiceSendTask.java index 05e4f8a..9a6a1aa 100644 --- a/invoice/src/main/java/com/djy/invoice/service/InvoiceSendTask.java +++ b/invoice/src/main/java/com/djy/invoice/service/InvoiceSendTask.java @@ -8,6 +8,7 @@ import com.djy.invoice.model.InvLinkTaskDto; import com.djy.invoice.model.mapper.InvInvoiceInfoMapper; import com.djy.invoice.model.mapper.InvInvoiceSplitMapper; import com.djy.invoice.model.mapper.InvLinkInfoMapper; +import lombok.extern.slf4j.Slf4j; import org.springframework.amqp.rabbit.connection.CorrelationData; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.factory.annotation.Autowired; @@ -22,18 +23,19 @@ import java.util.List; //@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) @Component +@Slf4j public class InvoiceSendTask { //定义交换机的名字 - public static String EXCHANGE_NAME; + public static String EXCHANGE_NAME; // public static String EXCHANGE_NAME = "boot_topic_exchange"; //定义队列的名字 // public static String QUEUE_NAME = "boot_queue"; - public static String QUEUE_NAME; + public static String QUEUE_NAME; - public static String ROUTING_KEY; + public static String ROUTING_KEY; @Autowired private RabbitTemplate rabbitTemplate; @@ -45,34 +47,36 @@ public class InvoiceSendTask { private InvInvoiceInfoMapper invInvoiceInfoMapper; @Scheduled(cron = "*/60 * * * * ?")//每个5秒执行一次任务(方法) - public void timeScheduled(){ - + public void timeScheduled() { //获取status是2的链表 List links = invLinkInfoMapper.selectByStatus(); - if(null != links && links.size()>0){ - + if (null != links && links.size() > 0) { + log.info("查询到{}条待处理消息发送的数据", links.size()); InvLinkTaskDto dto = null; - for(InvLinkInfo link : links){ + for (InvLinkInfo link : links) { dto = new InvLinkTaskDto(); //查询当前链表下的所有发票 List list = invInvoiceSplitMapper.getIdsBylinkdId(link.getGID()); + log.info(" 查询到链接{}下有{}条发票", link.getGID(), list.size()); - if(null !=list && list.size()>0){ + if (null != list && list.size() > 0) { List invoices = new ArrayList<>(); int size = list.size(); - for(int i=0;i itemList=new ArrayList();// 发票项目明细列表 - KpInvoiceItem item1 = new KpInvoiceItem(); // 项目明细1 - item1.setType("0"); - item1.setImei(""); // 商品IMIE号 - item1.setCode(""); // 商品编码 - item1.setAmount("2.9"); // 金额 - item1.setName("一档气费"); // 商品名称 - item1.setItemRemark(""); // 商品备注 - item1.setPrice("2.90"); // 商品单价 - item1.setQuantity("1"); // 数量 - item1.setTaxRate("0.10"); // 税率 - item1.setUom(""); // 单位 - item1.setCatalogCode("1100202020000000000"); //必选项 - itemList.add(item1); - kpInvoice.setItems(itemList); - kpParams.setInvoice(kpInvoice); - - //通知方式节点,最多支持三条 - Notice notice=new Notice(Notice.NOTICE_TYPE_EMAIL,"zhangdq@chinaeinv.cn");//邮件通知地址 - List notices=new ArrayList(); - notices.add(notice); - kpParams.setNotices(notices); - - return kpParams; - } +// public static KpParams getKpData() { +// KpParams kpParams = new KpParams(); +// //业务流水号信息 +// kpParams.setSerialNo("1ae23a31f00c477582b18f39175e297e"); // 操作流水号 +// kpParams.setPostTime(df.format(new Date())); // 请求发送时间 +// +// //关联订单信息 +// Order order = new Order(); // 订单信息 +// order.setOrderNo("1ae23a31f00c477582b18f39175e297e"); // 订单编号2.90 +// order.setTotalAmount("3.99"); // 消费者的用户名 +// kpParams.setOrder(order); +// +// //发票信息 +// KpInvoice kpInvoice = new KpInvoice(); // 发票信息 +// kpInvoice.setTotalAmount("2.9"); // 发票总金额 +// kpInvoice.setCustomerName("个人"); // 付款方名称,即发票抬头。 +// //kpInvoice.setCustomerCode(""); +// //kpInvoice.setCustomerAddress(" "); +// //kpInvoice.setCustomerBanmName(" "); +// kpInvoice.setDrawer("系统"); // 开票人 +// // kpInvoice.setPayee(""); +// //kpInvoice.setReviewer(""); +// kpInvoice.setTaxpayerCode(taxpayerCode); // 收款方纳税人识别号 +// kpInvoice.setRemark("发票备注信息"); // 发票备注 +// +// //发票明细内容,最多支持100条 +// List itemList=new ArrayList();// 发票项目明细列表 +// KpInvoiceItem item1 = new KpInvoiceItem(); // 项目明细1 +// item1.setType("0"); +// item1.setImei(""); // 商品IMIE号 +// item1.setCode(""); // 商品编码 +// item1.setAmount("2.9"); // 金额 +// item1.setName("一档气费"); // 商品名称 +// item1.setItemRemark(""); // 商品备注 +// item1.setPrice("2.90"); // 商品单价 +// item1.setQuantity("1"); // 数量 +// item1.setTaxRate("0.10"); // 税率 +// item1.setUom(""); // 单位 +// item1.setCatalogCode("1100202020000000000"); //必选项 +// itemList.add(item1); +// kpInvoice.setItems(itemList); +// kpParams.setInvoice(kpInvoice); +// +// //通知方式节点,最多支持三条 +// Notice notice=new Notice(Notice.NOTICE_TYPE_EMAIL,"zhangdq@chinaeinv.cn");//邮件通知地址 +// List notices=new ArrayList(); +// notices.add(notice); +// kpParams.setNotices(notices); +// +// return kpParams; +// } // 生成冲红发票参数 private static ChParams getChData() { diff --git a/invoice/src/main/java/com/djy/invoice/service/impl/InvLinkInfoServiceImpl.java b/invoice/src/main/java/com/djy/invoice/service/impl/InvLinkInfoServiceImpl.java index 92c595a..486088e 100644 --- a/invoice/src/main/java/com/djy/invoice/service/impl/InvLinkInfoServiceImpl.java +++ b/invoice/src/main/java/com/djy/invoice/service/impl/InvLinkInfoServiceImpl.java @@ -47,8 +47,8 @@ public class InvLinkInfoServiceImpl implements InvLinkInfoService { @Autowired private ParameterFeignClient parameterFeignClient; - private static String cmdName; - private static String cmdCxName; + private static String cmdName; //开票接口名 + private static String cmdCxName; //查询发票接口名 private static String SendTo; private static String SmtpConfig; @@ -85,7 +85,7 @@ public class InvLinkInfoServiceImpl implements InvLinkInfoService { public HttpResult getlink(String json) { - log.info("参数json====={}", json); + log.info("上传发票数据json====={}", json); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @@ -103,8 +103,9 @@ public class InvLinkInfoServiceImpl implements InvLinkInfoService { for (InvLinkInfo linkinfo : links) { - HttpResult result = parameterFeignClient.getParameter(linkinfo.getCompanyId()); - String amount = (String) result.getData(); + HttpResult result = parameterFeignClient.getCompanyParam(linkinfo.getCompanyId(), "INVOICE_CUSTOMER_AMOUNT_LIMIT"); + LinkedHashMap mapRtn = (LinkedHashMap) result.getData(); + String amount = (String) mapRtn.get("itemcode"); //判断开票限额格式和是否存在 if (null == amount) { @@ -337,8 +338,9 @@ public class InvLinkInfoServiceImpl implements InvLinkInfoService { InvInvoiceDetail detail = new InvInvoiceDetail(); detail.setGID(UUID.randomUUID().toString().replace("-", "")); detail.setInvId(invoice.getGID()); - detail.setGoodsName("1"); - detail.setGoodsCode("1001"); + detail.setGoodsName("代理海运费"); + detail.setGoodsCode("3040802010200000000"); + detail.setNum(BigDecimal.ONE); // detail.setPrice(feeinfo.getUnitPrice()); // detail.setNum(feeinfo.getQuantity()); detail.setWithTaxFlag("1"); @@ -352,13 +354,15 @@ public class InvLinkInfoServiceImpl implements InvLinkInfoService { detail.setTaxExcludedAmount(amount); } + detail.setTaxIncludedAmount(detail.getTaxExcludedAmount()); + detail.setPrice(detail.getTaxExcludedAmount()); detail.setSpecType(""); detail.setUnit(feeinfo.getUnit()); - detail.setFavouredPolicyFlag("0"); - detail.setFavouredPolicyName("0"); + detail.setFavouredPolicyFlag("1"); + detail.setFavouredPolicyName("免税"); detail.setZeroRateFlag("1"); - detail.setRemark("111"); +// detail.setRemark("111"); return detail; } @@ -398,8 +402,13 @@ public class InvLinkInfoServiceImpl implements InvLinkInfoService { if (null != fees && fees.size() > 0) { - HttpResult result = parameterFeignClient.getParameter(link.getCompanyId()); - String amountParam = (String) result.getData(); +// HttpResult result = parameterFeignClient.getParameter(link.getCompanyId()); +// String amountParam = (String) result.getData(); + + HttpResult result = parameterFeignClient.getCompanyParam(link.getCompanyId(), "INVOICE_CUSTOMER_AMOUNT_LIMIT"); + LinkedHashMap mapRtn = (LinkedHashMap) result.getData(); + String amountParam = (String) mapRtn.get("itemcode"); + BigDecimal invoiceAmount = new BigDecimal(amountParam); BigDecimal checkinvocie = new BigDecimal(0); @@ -765,6 +774,7 @@ public class InvLinkInfoServiceImpl implements InvLinkInfoService { // 生成新开发票参数 public KpParams getKpData(InvInvoiceInfo invoice) { + log.info("获取开票数据KpParams"); KpParams kpParams = new KpParams(); //业务流水号信息 kpParams.setSerialNo(invoice.getGID()); // 操作流水号 @@ -800,11 +810,11 @@ public class InvLinkInfoServiceImpl implements InvLinkInfoService { item1.setAmount(detail.getTaxExcludedAmount() + ""); // 金额 item1.setName(detail.getGoodsName()); // 商品名称 item1.setItemRemark(""); // 商品备注 - item1.setPrice(null); // 商品单价 - item1.setQuantity(null); // 数量 + item1.setPrice(detail.getPrice().toString()); // 商品单价 + item1.setQuantity(detail.getNum().toString()); // 数量 item1.setTaxRate("0"); // 税率 item1.setUom(detail.getUnit()); // 单位 - item1.setCatalogCode("1100202020000000000"); //必选项 + item1.setCatalogCode(detail.getGoodsCode()); //必选项 itemList.add(item1); kpInvoice.setItems(itemList); kpParams.setInvoice(kpInvoice); @@ -827,8 +837,11 @@ public class InvLinkInfoServiceImpl implements InvLinkInfoService { InvLinkInfo link = invLinkInfoMapper.selectByGID(info); - HttpResult result = parameterFeignClient.getParameter(link.getCompanyId()); - String amount = (String) result.getData(); +// HttpResult result = parameterFeignClient.getParameter(link.getCompanyId()); +// String amount = (String) result.getData(); + HttpResult result = parameterFeignClient.getCompanyParam(link.getCompanyId(), "INVOICE_CUSTOMER_AMOUNT_LIMIT"); + LinkedHashMap mapRtn = (LinkedHashMap) result.getData(); + String amount = (String) mapRtn.get("itemcode"); BigDecimal invoiceAmount = new BigDecimal(amount); @@ -1021,6 +1034,7 @@ public class InvLinkInfoServiceImpl implements InvLinkInfoService { data = new ResponseData(); log.info(df.format(new Date()) + "开始调用瑞宏开票接口" + ",invoiceId=" + invoice.getGID()); data = UploadData.doPost(cmdName, getKpData(invoice)); + log.info(df.format(new Date()) + "调用瑞宏开票返回" + data.getCode() + data.getMessage()); invoice.setSerialNo(data.getSerialNo()); invoice.setApiSendTime(df.parse(df.format(new Date()))); invInvoiceInfoMapper.updateById(invoice); @@ -1038,6 +1052,11 @@ public class InvLinkInfoServiceImpl implements InvLinkInfoService { return HttpResult.ok("发票已发送"); } + /** + * 读取发票 + * @param info + * @return + */ @Override public HttpResult getInvoice(InvLinkInfo info) { diff --git a/invoice/src/main/resources/logback-spring.xml b/invoice/src/main/resources/logback-spring.xml index 06aaa80..6eefd29 100644 --- a/invoice/src/main/resources/logback-spring.xml +++ b/invoice/src/main/resources/logback-spring.xml @@ -8,7 +8,7 @@ [%d{HH:mm:ss.SSS}][%p][%c{40}][%t] %m%n - DEBUG + INFO @@ -22,10 +22,8 @@ [%d{HH:mm:ss.SSS}][%p][%c{40}][%t] %m%n - + ERROR - ACCEPT - DENY @@ -37,7 +35,7 @@ [%d{HH:mm:ss.SSS}][%p][%c{40}][%t] %m%n - + DEBUG