# Conflicts: # jianshui-admin/src/main/java/com/jianshui/web/controller/platform/InvoiceAddController.javabeta-prop-all^2
commit
9b7622edb6
@ -0,0 +1,36 @@ |
|||||||
|
package com.jianshui.web.controller.platform; |
||||||
|
|
||||||
|
import com.jianshui.invoice.domain.dto.HXResponse; |
||||||
|
import com.jianshui.platform.dto.InvoiceDeliveryJsonDataDTO; |
||||||
|
import com.jianshui.platform.service.InvoiceDeliveryService; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: xingze |
||||||
|
* @Description: 发票交付 |
||||||
|
* @CreateTime: 2023-06-06 10:27 |
||||||
|
* @Version: 1.0 |
||||||
|
**/ |
||||||
|
@Api(tags={"发票交付"},value = "发票交付") |
||||||
|
@RestController |
||||||
|
@RequestMapping("/platForm") |
||||||
|
public class InvoiceDeliveryController { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private InvoiceDeliveryService invoiceDeliveryService; |
||||||
|
|
||||||
|
@ApiOperation("发票交付") |
||||||
|
@PostMapping("/invoiceDelivery") |
||||||
|
public Object invoiceDelivery(@RequestBody List<InvoiceDeliveryJsonDataDTO> dtos){ |
||||||
|
HXResponse response = invoiceDeliveryService.invoiceDelivery(dtos); |
||||||
|
return response; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,20 @@ |
|||||||
|
package com.jianshui.common.constant; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: xinzge |
||||||
|
* @Description: 用户登记信息常量类 |
||||||
|
* @CreateTime: 2023-06-06 13:35 |
||||||
|
* @Version: 1.0 |
||||||
|
**/ |
||||||
|
public class InvoiceAllYhdjConstants { |
||||||
|
/** |
||||||
|
* 异步 |
||||||
|
*/ |
||||||
|
public final static String ASYNC = "true"; |
||||||
|
|
||||||
|
/** |
||||||
|
* 同步 |
||||||
|
*/ |
||||||
|
public final static String SYNC = "false"; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,179 @@ |
|||||||
|
package com.jianshui.platform.domain; |
||||||
|
|
||||||
|
import com.jianshui.common.annotation.Excel; |
||||||
|
import com.jianshui.common.core.domain.BaseEntity; |
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle; |
||||||
|
|
||||||
|
/** |
||||||
|
* 发票交付对象 invoice_delivery |
||||||
|
* |
||||||
|
* @author jianshui |
||||||
|
* @date 2023-06-06 |
||||||
|
*/ |
||||||
|
public class InvoiceDelivery extends BaseEntity |
||||||
|
{ |
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
/** 主键 */ |
||||||
|
private Long id; |
||||||
|
|
||||||
|
/** 办税人身份证号 */ |
||||||
|
@Excel(name = "办税人身份证号") |
||||||
|
private String bsrysfzjhm; |
||||||
|
|
||||||
|
/** 地区编码 */ |
||||||
|
@Excel(name = "地区编码") |
||||||
|
private String dqbm; |
||||||
|
|
||||||
|
/** 交付类型0-邮箱 1-短信 */ |
||||||
|
@Excel(name = "交付类型0-邮箱 1-短信") |
||||||
|
private String jflx; |
||||||
|
|
||||||
|
/** 发票号码 */ |
||||||
|
@Excel(name = "发票号码") |
||||||
|
private String fphm; |
||||||
|
|
||||||
|
/** 购买方联系电话 */ |
||||||
|
@Excel(name = "购买方联系电话") |
||||||
|
private String gmflxdh; |
||||||
|
|
||||||
|
/** 购买方邮箱 */ |
||||||
|
@Excel(name = "购买方邮箱") |
||||||
|
private String gmfyx; |
||||||
|
|
||||||
|
/** 纳税人识别号 */ |
||||||
|
@Excel(name = "纳税人识别号") |
||||||
|
private String nsrsbh; |
||||||
|
|
||||||
|
/** 请求状态0-成功,1-失败 */ |
||||||
|
@Excel(name = "请求状态0-成功,1-失败") |
||||||
|
private String status; |
||||||
|
|
||||||
|
/** 请求通道0-大象,1-数科 */ |
||||||
|
@Excel(name = "请求通道0-大象,1-数科") |
||||||
|
private String type; |
||||||
|
|
||||||
|
/** 创建人id */ |
||||||
|
@Excel(name = "创建人id") |
||||||
|
private Long clerk; |
||||||
|
|
||||||
|
public void setId(Long id) |
||||||
|
{ |
||||||
|
this.id = id; |
||||||
|
} |
||||||
|
|
||||||
|
public Long getId() |
||||||
|
{ |
||||||
|
return id; |
||||||
|
} |
||||||
|
public void setBsrysfzjhm(String bsrysfzjhm) |
||||||
|
{ |
||||||
|
this.bsrysfzjhm = bsrysfzjhm; |
||||||
|
} |
||||||
|
|
||||||
|
public String getBsrysfzjhm() |
||||||
|
{ |
||||||
|
return bsrysfzjhm; |
||||||
|
} |
||||||
|
public void setDqbm(String dqbm) |
||||||
|
{ |
||||||
|
this.dqbm = dqbm; |
||||||
|
} |
||||||
|
|
||||||
|
public String getDqbm() |
||||||
|
{ |
||||||
|
return dqbm; |
||||||
|
} |
||||||
|
public void setJflx(String jflx) |
||||||
|
{ |
||||||
|
this.jflx = jflx; |
||||||
|
} |
||||||
|
|
||||||
|
public String getJflx() |
||||||
|
{ |
||||||
|
return jflx; |
||||||
|
} |
||||||
|
public void setFphm(String fphm) |
||||||
|
{ |
||||||
|
this.fphm = fphm; |
||||||
|
} |
||||||
|
|
||||||
|
public String getFphm() |
||||||
|
{ |
||||||
|
return fphm; |
||||||
|
} |
||||||
|
public void setGmflxdh(String gmflxdh) |
||||||
|
{ |
||||||
|
this.gmflxdh = gmflxdh; |
||||||
|
} |
||||||
|
|
||||||
|
public String getGmflxdh() |
||||||
|
{ |
||||||
|
return gmflxdh; |
||||||
|
} |
||||||
|
public void setGmfyx(String gmfyx) |
||||||
|
{ |
||||||
|
this.gmfyx = gmfyx; |
||||||
|
} |
||||||
|
|
||||||
|
public String getGmfyx() |
||||||
|
{ |
||||||
|
return gmfyx; |
||||||
|
} |
||||||
|
public void setNsrsbh(String nsrsbh) |
||||||
|
{ |
||||||
|
this.nsrsbh = nsrsbh; |
||||||
|
} |
||||||
|
|
||||||
|
public String getNsrsbh() |
||||||
|
{ |
||||||
|
return nsrsbh; |
||||||
|
} |
||||||
|
public void setStatus(String status) |
||||||
|
{ |
||||||
|
this.status = status; |
||||||
|
} |
||||||
|
|
||||||
|
public String getStatus() |
||||||
|
{ |
||||||
|
return status; |
||||||
|
} |
||||||
|
public void setType(String type) |
||||||
|
{ |
||||||
|
this.type = type; |
||||||
|
} |
||||||
|
|
||||||
|
public String getType() |
||||||
|
{ |
||||||
|
return type; |
||||||
|
} |
||||||
|
public void setClerk(Long clerk) |
||||||
|
{ |
||||||
|
this.clerk = clerk; |
||||||
|
} |
||||||
|
|
||||||
|
public Long getClerk() |
||||||
|
{ |
||||||
|
return clerk; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String toString() { |
||||||
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) |
||||||
|
.append("id", getId()) |
||||||
|
.append("bsrysfzjhm", getBsrysfzjhm()) |
||||||
|
.append("dqbm", getDqbm()) |
||||||
|
.append("jflx", getJflx()) |
||||||
|
.append("fphm", getFphm()) |
||||||
|
.append("gmflxdh", getGmflxdh()) |
||||||
|
.append("gmfyx", getGmfyx()) |
||||||
|
.append("nsrsbh", getNsrsbh()) |
||||||
|
.append("status", getStatus()) |
||||||
|
.append("type", getType()) |
||||||
|
.append("clerk", getClerk()) |
||||||
|
.append("createTime", getCreateTime()) |
||||||
|
.append("remark", getRemark()) |
||||||
|
.toString(); |
||||||
|
} |
||||||
|
} |
@ -1,4 +1,4 @@ |
|||||||
package com.jianshui.platform.domain.dto; |
package com.jianshui.platform.dto; |
||||||
|
|
||||||
import io.swagger.annotations.ApiModel; |
import io.swagger.annotations.ApiModel; |
||||||
import io.swagger.annotations.ApiModelProperty; |
import io.swagger.annotations.ApiModelProperty; |
@ -1,4 +1,4 @@ |
|||||||
package com.jianshui.platform.domain.dto; |
package com.jianshui.platform.dto; |
||||||
|
|
||||||
import io.swagger.annotations.ApiModel; |
import io.swagger.annotations.ApiModel; |
||||||
import io.swagger.annotations.ApiModelProperty; |
import io.swagger.annotations.ApiModelProperty; |
@ -0,0 +1,36 @@ |
|||||||
|
package com.jianshui.platform.dto; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: xingze |
||||||
|
* @Description: 发票交付类 |
||||||
|
* @CreateTime: 2023-06-06 10:32 |
||||||
|
* @Version: 1.0 |
||||||
|
**/ |
||||||
|
@ApiModel("发票交付") |
||||||
|
@Data |
||||||
|
public class InvoiceDeliveryDTO { |
||||||
|
@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; |
||||||
|
|
||||||
|
private InvoiceDeliveryJsonDataDTO jsonData; |
||||||
|
} |
@ -0,0 +1,35 @@ |
|||||||
|
package com.jianshui.platform.dto; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: xingze |
||||||
|
* @Description: 发票交付JsonData实体类 |
||||||
|
* @CreateTime: 2023-06-06 10:35 |
||||||
|
* @Version: 1.0 |
||||||
|
**/ |
||||||
|
@ApiModel("发票交付JsonData") |
||||||
|
@Data |
||||||
|
public class InvoiceDeliveryJsonDataDTO { |
||||||
|
|
||||||
|
@NotEmpty |
||||||
|
@ApiModelProperty("交付类型") |
||||||
|
private String jflx; |
||||||
|
|
||||||
|
@NotEmpty |
||||||
|
@ApiModelProperty("发票号码") |
||||||
|
private String fphm; |
||||||
|
|
||||||
|
@NotEmpty |
||||||
|
@ApiModelProperty("购买方联系电话") |
||||||
|
private String gmflxdh; |
||||||
|
|
||||||
|
@NotEmpty |
||||||
|
@ApiModelProperty("购买方邮箱") |
||||||
|
private String gmfyx; |
||||||
|
} |
@ -0,0 +1,17 @@ |
|||||||
|
package com.jianshui.platform.mapper; |
||||||
|
|
||||||
|
import com.jianshui.common.core.domain.entity.Companyservice; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
import org.apache.ibatis.annotations.Param; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: xingze |
||||||
|
* @Description: 企业信息持久层 |
||||||
|
* @CreateTime: 2023-06-06 12:05 |
||||||
|
* @Version: 1.0 |
||||||
|
**/ |
||||||
|
@Mapper |
||||||
|
public interface CompanyServiceMapper { |
||||||
|
|
||||||
|
Companyservice findByCompanyId(@Param("companyId") Long companyId); |
||||||
|
} |
@ -0,0 +1,63 @@ |
|||||||
|
package com.jianshui.platform.mapper; |
||||||
|
|
||||||
|
|
||||||
|
import com.jianshui.platform.domain.InvoiceDelivery; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* 发票交付Mapper接口 |
||||||
|
* |
||||||
|
* @author jianshui |
||||||
|
* @date 2023-06-06 |
||||||
|
*/ |
||||||
|
public interface InvoiceDeliveryMapper |
||||||
|
{ |
||||||
|
/** |
||||||
|
* 查询发票交付 |
||||||
|
* |
||||||
|
* @param id 发票交付主键 |
||||||
|
* @return 发票交付 |
||||||
|
*/ |
||||||
|
public InvoiceDelivery selectInvoiceDeliveryById(Long id); |
||||||
|
|
||||||
|
/** |
||||||
|
* 查询发票交付列表 |
||||||
|
* |
||||||
|
* @param invoiceDelivery 发票交付 |
||||||
|
* @return 发票交付集合 |
||||||
|
*/ |
||||||
|
public List<InvoiceDelivery> selectInvoiceDeliveryList(InvoiceDelivery invoiceDelivery); |
||||||
|
|
||||||
|
/** |
||||||
|
* 新增发票交付 |
||||||
|
* |
||||||
|
* @param invoiceDelivery 发票交付 |
||||||
|
* @return 结果 |
||||||
|
*/ |
||||||
|
public int insertInvoiceDelivery(InvoiceDelivery invoiceDelivery); |
||||||
|
|
||||||
|
/** |
||||||
|
* 修改发票交付 |
||||||
|
* |
||||||
|
* @param invoiceDelivery 发票交付 |
||||||
|
* @return 结果 |
||||||
|
*/ |
||||||
|
public int updateInvoiceDelivery(InvoiceDelivery invoiceDelivery); |
||||||
|
|
||||||
|
/** |
||||||
|
* 删除发票交付 |
||||||
|
* |
||||||
|
* @param id 发票交付主键 |
||||||
|
* @return 结果 |
||||||
|
*/ |
||||||
|
public int deleteInvoiceDeliveryById(Long id); |
||||||
|
|
||||||
|
/** |
||||||
|
* 批量删除发票交付 |
||||||
|
* |
||||||
|
* @param ids 需要删除的数据主键集合 |
||||||
|
* @return 结果 |
||||||
|
*/ |
||||||
|
public int deleteInvoiceDeliveryByIds(Long[] ids); |
||||||
|
} |
@ -0,0 +1,22 @@ |
|||||||
|
package com.jianshui.platform.service; |
||||||
|
|
||||||
|
import com.jianshui.invoice.domain.dto.HXResponse; |
||||||
|
import com.jianshui.platform.dto.InvoiceDeliveryJsonDataDTO; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: xinzge |
||||||
|
* @Description: 发票交付service接口 |
||||||
|
* @CreateTime: 2023-06-06 10:29 |
||||||
|
* @Version: 1.0 |
||||||
|
**/ |
||||||
|
public interface InvoiceDeliveryService { |
||||||
|
|
||||||
|
/** |
||||||
|
* 功能描述: 发票交付 |
||||||
|
* @param dtos 多张(单张)交付信息 |
||||||
|
* @return : com.jianshui.invoice.domain.dto.HXResponse |
||||||
|
*/ |
||||||
|
HXResponse invoiceDelivery(List<InvoiceDeliveryJsonDataDTO> dtos); |
||||||
|
} |
@ -0,0 +1,179 @@ |
|||||||
|
package com.jianshui.platform.service.impl; |
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil; |
||||||
|
import cn.hutool.core.util.StrUtil; |
||||||
|
import cn.hutool.json.JSONObject; |
||||||
|
import cn.hutool.json.JSONUtil; |
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.jianshui.common.constant.InvoiceAllYhdjConstants; |
||||||
|
import com.jianshui.common.constant.WebServiceConstant; |
||||||
|
import com.jianshui.common.core.domain.entity.Companyservice; |
||||||
|
import com.jianshui.common.core.domain.entity.SysUser; |
||||||
|
import com.jianshui.common.core.redis.RedisCache; |
||||||
|
import com.jianshui.common.utils.BeanToMapUtils; |
||||||
|
import com.jianshui.common.utils.SecurityUtils; |
||||||
|
import com.jianshui.common.utils.ValidateUtils; |
||||||
|
import com.jianshui.common.utils.jcsk.ApiHttp; |
||||||
|
import com.jianshui.common.utils.spring.SpringUtils; |
||||||
|
import com.jianshui.invoice.domain.dto.HXResponse; |
||||||
|
import com.jianshui.platform.domain.InvoiceDelivery; |
||||||
|
import com.jianshui.platform.dto.InvoiceDeliveryDTO; |
||||||
|
import com.jianshui.platform.dto.InvoiceDeliveryJsonDataDTO; |
||||||
|
import com.jianshui.platform.mapper.CompanyServiceMapper; |
||||||
|
import com.jianshui.platform.mapper.InvoiceDeliveryMapper; |
||||||
|
import com.jianshui.platform.service.InvoiceDeliveryService; |
||||||
|
import com.jianshui.system.domain.InvoiceAllApiLog; |
||||||
|
import com.jianshui.system.domain.InvoiceAllYhdj; |
||||||
|
import com.jianshui.system.mapper.InvoiceAllApiLogMapper; |
||||||
|
import com.jianshui.system.mapper.InvoiceAllYhdjMapper; |
||||||
|
import com.jianshui.system.mapper.SysUserMapper; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springframework.beans.BeanUtils; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import java.util.Date; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: xingze |
||||||
|
* @Description: 发票交付业务实现类 |
||||||
|
* @CreateTime: 2023-06-06 10:33 |
||||||
|
* @Version: 1.0 |
||||||
|
**/ |
||||||
|
@Service |
||||||
|
@Slf4j |
||||||
|
public class InvoiceDeliveryServiceImpl implements InvoiceDeliveryService { |
||||||
|
@Autowired |
||||||
|
private SysUserMapper sysUserMapper; |
||||||
|
@Autowired |
||||||
|
private CompanyServiceMapper companyServiceMapper; |
||||||
|
@Autowired |
||||||
|
private InvoiceAllYhdjMapper yhdjMapper; |
||||||
|
@Autowired |
||||||
|
private InvoiceDeliveryMapper invoiceDeliveryMapper; |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private InvoiceAllApiLogMapper allApiLogMapper; |
||||||
|
|
||||||
|
/** |
||||||
|
* 功能描述: 发票交付 |
||||||
|
* @param dtos 多张(单张)交付信息 |
||||||
|
* @return : com.jianshui.invoice.domain.dto.HXResponse |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
public HXResponse invoiceDelivery(List<InvoiceDeliveryJsonDataDTO> dtos) { |
||||||
|
//判空
|
||||||
|
if (dtos.isEmpty()){ |
||||||
|
return new HXResponse("传入信息为空,请检查信息!"); |
||||||
|
} |
||||||
|
//获取用户id
|
||||||
|
Long userId = SecurityUtils.getUserId(); |
||||||
|
//根据用户id获取用户信息
|
||||||
|
SysUser sysUser = sysUserMapper.selectUserById(userId); |
||||||
|
//根据企业id获取企业信息
|
||||||
|
Companyservice companyservice = companyServiceMapper.findByCompanyId(sysUser.getCompanyId()); |
||||||
|
//获取登记用户信息
|
||||||
|
InvoiceAllYhdj userInfo = getUserInfo(companyservice); |
||||||
|
if (BeanUtil.isEmpty(userInfo)) { |
||||||
|
return new HXResponse("未查询到登记信息!"); |
||||||
|
} |
||||||
|
//封装上游接口实体类
|
||||||
|
InvoiceDeliveryDTO invoiceDeliveryDTO = new InvoiceDeliveryDTO(); |
||||||
|
invoiceDeliveryDTO.setAsync(InvoiceAllYhdjConstants.SYNC); |
||||||
|
invoiceDeliveryDTO.setBsrysfzjhm(userInfo.getBsrysfzjhm()); |
||||||
|
invoiceDeliveryDTO.setDqbm(userInfo.getDqbm()); |
||||||
|
invoiceDeliveryDTO.setNsrsbh(userInfo.getNsrsbh()); |
||||||
|
//校验
|
||||||
|
ValidateUtils.validate(invoiceDeliveryDTO); |
||||||
|
ValidateUtils.validate(dtos); |
||||||
|
InvoiceDelivery invoiceDelivery = new InvoiceDelivery(); |
||||||
|
for (InvoiceDeliveryJsonDataDTO dto : dtos) { |
||||||
|
invoiceDeliveryDTO.setJsonData(dto); |
||||||
|
//发送请求获取结果
|
||||||
|
JSONObject result = null; |
||||||
|
try { |
||||||
|
//发送请求
|
||||||
|
result = ApiHttp.request(WebServiceConstant.INVOIVEDELIVERY, WebServiceConstant.URL, JSONUtil.parseObj(BeanToMapUtils.fastJsonBean2Map(invoiceDeliveryDTO)), companyservice); |
||||||
|
//结果解析
|
||||||
|
String code = result.get("code") != null ? result.get("code").toString() : ""; |
||||||
|
String msg = result.get("msg") != null ? result.get("msg").toString() : ""; |
||||||
|
String data = result.get("data") != null ? result.get("data").toString() : ""; |
||||||
|
if ("0000".equals(code) && StrUtil.isNotEmpty(data)) { |
||||||
|
//存入调用日志表
|
||||||
|
InvoiceAllApiLog allApiLog = new InvoiceAllApiLog(); |
||||||
|
allApiLog.setUrl(WebServiceConstant.INVOIVEDELIVERY); |
||||||
|
allApiLog.setSendMsg(invoiceDeliveryDTO.toString()); |
||||||
|
allApiLog.setResultMsg(JSONUtil.toJsonStr(result)); |
||||||
|
allApiLog.setCompany(companyservice.getSellertax()); |
||||||
|
allApiLog.setIdentityId(companyservice.getIdentity()); |
||||||
|
allApiLog.setCreateTime(new Date()); |
||||||
|
allApiLogMapper.insertInvoiceAllApiLog(allApiLog); |
||||||
|
//封装实体类
|
||||||
|
BeanUtils.copyProperties(invoiceDeliveryDTO, invoiceDelivery); |
||||||
|
invoiceDelivery.setJflx(dto.getJflx()); |
||||||
|
invoiceDelivery.setFphm(dto.getFphm()); |
||||||
|
invoiceDelivery.setGmflxdh(dto.getGmflxdh()); |
||||||
|
invoiceDelivery.setGmfyx(dto.getGmfyx()); |
||||||
|
invoiceDelivery.setStatus("0"); |
||||||
|
invoiceDelivery.setType("1"); |
||||||
|
invoiceDelivery.setClerk(sysUser.getUserId()); |
||||||
|
invoiceDelivery.setCreateTime(new Date()); |
||||||
|
//将数据存入业务表
|
||||||
|
invoiceDeliveryMapper.insertInvoiceDelivery(invoiceDelivery); |
||||||
|
} else { |
||||||
|
//封装实体类
|
||||||
|
BeanUtils.copyProperties(invoiceDeliveryDTO, invoiceDelivery); |
||||||
|
invoiceDelivery.setJflx(dto.getJflx()); |
||||||
|
invoiceDelivery.setFphm(dto.getFphm()); |
||||||
|
invoiceDelivery.setGmflxdh(dto.getGmflxdh()); |
||||||
|
invoiceDelivery.setGmfyx(dto.getGmfyx()); |
||||||
|
invoiceDelivery.setStatus("1"); |
||||||
|
invoiceDelivery.setType("1"); |
||||||
|
invoiceDelivery.setClerk(sysUser.getUserId()); |
||||||
|
invoiceDelivery.setCreateTime(new Date()); |
||||||
|
//将数据存入业务表
|
||||||
|
invoiceDeliveryMapper.insertInvoiceDelivery(invoiceDelivery); |
||||||
|
return new HXResponse(msg); |
||||||
|
} |
||||||
|
} catch (Exception e) { |
||||||
|
e.printStackTrace(); |
||||||
|
log.error("【金四服务类】【金财数科】【申请红字信息表】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
||||||
|
return new HXResponse("发票支付接口异常"); |
||||||
|
} |
||||||
|
} |
||||||
|
return new HXResponse("0000", "处理成功"); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 获取登记用户信息 |
||||||
|
*/ |
||||||
|
public InvoiceAllYhdj getUserInfo(Companyservice companyservice) { |
||||||
|
|
||||||
|
String identity = companyservice.getIdentity(); |
||||||
|
String sellertax = companyservice.getSellertax(); |
||||||
|
|
||||||
|
String key = WebServiceConstant.TOKEN_KEY + sellertax + "_"+ identity; |
||||||
|
|
||||||
|
RedisCache redisCache = SpringUtils.getBean(RedisCache.class); |
||||||
|
cn.hutool.json.JSONObject yhdjObj = redisCache.getCacheObject(key); |
||||||
|
|
||||||
|
if(JSONUtil.isNull(yhdjObj)){ |
||||||
|
// 查询用户登记参数
|
||||||
|
QueryWrapper<InvoiceAllYhdj> yhdjQueryWrapper = new QueryWrapper<>(); |
||||||
|
yhdjQueryWrapper.eq("nsrsbh", sellertax); |
||||||
|
yhdjQueryWrapper.eq("identity", identity); |
||||||
|
InvoiceAllYhdj invoiceAllYhdj = yhdjMapper.selectOne(yhdjQueryWrapper); |
||||||
|
|
||||||
|
cn.hutool.json.JSONObject obj = JSONUtil.parseObj(invoiceAllYhdj); |
||||||
|
Long exprieTime = System.currentTimeMillis(); // 过期时间
|
||||||
|
obj.put("exprieTime", exprieTime); |
||||||
|
redisCache.setCacheObject(key, obj); |
||||||
|
|
||||||
|
yhdjObj = obj; |
||||||
|
} |
||||||
|
|
||||||
|
return BeanUtil.copyProperties(yhdjObj,InvoiceAllYhdj.class); |
||||||
|
} |
||||||
|
} |
@ -1,6 +1,6 @@ |
|||||||
package com.jianshui.platform.domain.vo; |
package com.jianshui.platform.vo; |
||||||
|
|
||||||
import com.jianshui.platform.domain.dto.BillInfoDetailPDTO; |
import com.jianshui.platform.dto.BillInfoDetailPDTO; |
||||||
import io.swagger.annotations.ApiModel; |
import io.swagger.annotations.ApiModel; |
||||||
import io.swagger.annotations.ApiModelProperty; |
import io.swagger.annotations.ApiModelProperty; |
||||||
import lombok.Data; |
import lombok.Data; |
@ -0,0 +1,16 @@ |
|||||||
|
<?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="com.jianshui.platform.mapper.CompanyServiceMapper"> |
||||||
|
|
||||||
|
<resultMap id="companyServiceResultMap" type="Companyservice"> |
||||||
|
<id column="companyid" property="companyid"/> |
||||||
|
<result column="reback_type" property="rebackType"/> |
||||||
|
<result column="create_user" property="createUser"/> |
||||||
|
<result column="create_dept" property="createDept"/> |
||||||
|
</resultMap> |
||||||
|
<select id="findByCompanyId" resultMap="companyServiceResultMap"> |
||||||
|
select * from companyservice where companyid = #{companyId} |
||||||
|
</select> |
||||||
|
</mapper> |
@ -0,0 +1,109 @@ |
|||||||
|
<?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="com.jianshui.platform.mapper.InvoiceDeliveryMapper"> |
||||||
|
|
||||||
|
<resultMap type="InvoiceDelivery" id="InvoiceDeliveryResult"> |
||||||
|
<result property="id" column="id" /> |
||||||
|
<result property="bsrysfzjhm" column="bsrysfzjhm" /> |
||||||
|
<result property="dqbm" column="dqbm" /> |
||||||
|
<result property="jflx" column="jflx" /> |
||||||
|
<result property="fphm" column="fphm" /> |
||||||
|
<result property="gmflxdh" column="gmflxdh" /> |
||||||
|
<result property="gmfyx" column="gmfyx" /> |
||||||
|
<result property="nsrsbh" column="nsrsbh" /> |
||||||
|
<result property="status" column="status" /> |
||||||
|
<result property="type" column="type" /> |
||||||
|
<result property="clerk" column="clerk" /> |
||||||
|
<result property="createTime" column="create_time" /> |
||||||
|
<result property="remark" column="remark" /> |
||||||
|
</resultMap> |
||||||
|
|
||||||
|
<sql id="selectInvoiceDeliveryVo"> |
||||||
|
select id, bsrysfzjhm, dqbm, jflx, fphm, gmflxdh, gmfyx, nsrsbh, status, type, clerk, create_time, remark from invoice_delivery |
||||||
|
</sql> |
||||||
|
|
||||||
|
<select id="selectInvoiceDeliveryList" parameterType="InvoiceDelivery" resultMap="InvoiceDeliveryResult"> |
||||||
|
<include refid="selectInvoiceDeliveryVo"/> |
||||||
|
<where> |
||||||
|
<if test="bsrysfzjhm != null and bsrysfzjhm != ''"> and bsrysfzjhm = #{bsrysfzjhm}</if> |
||||||
|
<if test="dqbm != null and dqbm != ''"> and dqbm = #{dqbm}</if> |
||||||
|
<if test="jflx != null and jflx != ''"> and jflx = #{jflx}</if> |
||||||
|
<if test="fphm != null and fphm != ''"> and fphm = #{fphm}</if> |
||||||
|
<if test="gmflxdh != null and gmflxdh != ''"> and gmflxdh = #{gmflxdh}</if> |
||||||
|
<if test="gmfyx != null and gmfyx != ''"> and gmfyx = #{gmfyx}</if> |
||||||
|
<if test="nsrsbh != null and nsrsbh != ''"> and nsrsbh = #{nsrsbh}</if> |
||||||
|
<if test="status != null and status != ''"> and status = #{status}</if> |
||||||
|
<if test="type != null and type != ''"> and type = #{type}</if> |
||||||
|
<if test="clerk != null "> and clerk = #{clerk}</if> |
||||||
|
</where> |
||||||
|
</select> |
||||||
|
|
||||||
|
<select id="selectInvoiceDeliveryById" parameterType="Long" resultMap="InvoiceDeliveryResult"> |
||||||
|
<include refid="selectInvoiceDeliveryVo"/> |
||||||
|
where id = #{id} |
||||||
|
</select> |
||||||
|
|
||||||
|
<insert id="insertInvoiceDelivery" parameterType="InvoiceDelivery" useGeneratedKeys="true" keyProperty="id"> |
||||||
|
insert into invoice_delivery |
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||||
|
<if test="bsrysfzjhm != null and bsrysfzjhm != ''">bsrysfzjhm,</if> |
||||||
|
<if test="dqbm != null and dqbm != ''">dqbm,</if> |
||||||
|
<if test="jflx != null and jflx != ''">jflx,</if> |
||||||
|
<if test="fphm != null and fphm != ''">fphm,</if> |
||||||
|
<if test="gmflxdh != null and gmflxdh != ''">gmflxdh,</if> |
||||||
|
<if test="gmfyx != null and gmfyx != ''">gmfyx,</if> |
||||||
|
<if test="nsrsbh != null and nsrsbh != ''">nsrsbh,</if> |
||||||
|
<if test="status != null and status != ''">status,</if> |
||||||
|
<if test="type != null">type,</if> |
||||||
|
<if test="clerk != null">clerk,</if> |
||||||
|
<if test="createTime != null">create_time,</if> |
||||||
|
<if test="remark != null">remark,</if> |
||||||
|
</trim> |
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||||
|
<if test="bsrysfzjhm != null and bsrysfzjhm != ''">#{bsrysfzjhm},</if> |
||||||
|
<if test="dqbm != null and dqbm != ''">#{dqbm},</if> |
||||||
|
<if test="jflx != null and jflx != ''">#{jflx},</if> |
||||||
|
<if test="fphm != null and fphm != ''">#{fphm},</if> |
||||||
|
<if test="gmflxdh != null and gmflxdh != ''">#{gmflxdh},</if> |
||||||
|
<if test="gmfyx != null and gmfyx != ''">#{gmfyx},</if> |
||||||
|
<if test="nsrsbh != null and nsrsbh != ''">#{nsrsbh},</if> |
||||||
|
<if test="status != null and status != ''">#{status},</if> |
||||||
|
<if test="type != null">#{type},</if> |
||||||
|
<if test="clerk != null">#{clerk},</if> |
||||||
|
<if test="createTime != null">#{createTime},</if> |
||||||
|
<if test="remark != null">#{remark},</if> |
||||||
|
</trim> |
||||||
|
</insert> |
||||||
|
|
||||||
|
<update id="updateInvoiceDelivery" parameterType="InvoiceDelivery"> |
||||||
|
update invoice_delivery |
||||||
|
<trim prefix="SET" suffixOverrides=","> |
||||||
|
<if test="bsrysfzjhm != null and bsrysfzjhm != ''">bsrysfzjhm = #{bsrysfzjhm},</if> |
||||||
|
<if test="dqbm != null and dqbm != ''">dqbm = #{dqbm},</if> |
||||||
|
<if test="jflx != null and jflx != ''">jflx = #{jflx},</if> |
||||||
|
<if test="fphm != null and fphm != ''">fphm = #{fphm},</if> |
||||||
|
<if test="gmflxdh != null and gmflxdh != ''">gmflxdh = #{gmflxdh},</if> |
||||||
|
<if test="gmfyx != null and gmfyx != ''">gmfyx = #{gmfyx},</if> |
||||||
|
<if test="nsrsbh != null and nsrsbh != ''">nsrsbh = #{nsrsbh},</if> |
||||||
|
<if test="status != null and status != ''">status = #{status},</if> |
||||||
|
<if test="type != null">type = #{type},</if> |
||||||
|
<if test="clerk != null">clerk = #{clerk},</if> |
||||||
|
<if test="createTime != null">create_time = #{createTime},</if> |
||||||
|
<if test="remark != null">remark = #{remark},</if> |
||||||
|
</trim> |
||||||
|
where id = #{id} |
||||||
|
</update> |
||||||
|
|
||||||
|
<delete id="deleteInvoiceDeliveryById" parameterType="Long"> |
||||||
|
delete from invoice_delivery where id = #{id} |
||||||
|
</delete> |
||||||
|
|
||||||
|
<delete id="deleteInvoiceDeliveryByIds" parameterType="String"> |
||||||
|
delete from invoice_delivery where id in |
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")"> |
||||||
|
#{id} |
||||||
|
</foreach> |
||||||
|
</delete> |
||||||
|
</mapper> |
Reference in new issue