发票交付接口开发1

beta-enc
kane 2 years ago
parent 85d772e4be
commit ff4540a390
  1. 67
      jianshui-platform/src/main/java/com/jianshui/platform/mapper/InvoiceDeliveryMapper.java
  2. 24
      jianshui-platform/src/main/java/com/jianshui/platform/service/impl/InvoiceDeliveryServiceImpl.java
  3. 108
      jianshui-platform/src/main/resources/com/jianshui/platform/mapper/InvoiceDeliveryMapper.xml

@ -1,22 +1,63 @@
package com.jianshui.platform.mapper;
import com.jianshui.platform.domain.InvoiceDelivery;
import com.jianshui.platform.dto.InvoiceDeliveryDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @Author: xinzge
* @Description: 发票交付持久层
* @CreateTime: 2023-06-06 14:33
* @Version: 1.0
**/
@Mapper
public interface InvoiceDeliveryMapper {
* 发票交付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 invoiceDelivery 发票交付信息
* @return : void
* 批量删除发票交付
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
void insertInvoiceDelivery(InvoiceDelivery invoiceDelivery);
public int deleteInvoiceDeliveryByIds(Long[] ids);
}

@ -122,23 +122,23 @@ public class InvoiceDeliveryServiceImpl implements InvoiceDeliveryService {
//将数据存入业务表
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());
//封装实体类
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("发票支付接口异常");
}
}

@ -1,11 +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">
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>
<insert id="insertInvoiceDelivery" parameterType="InvoiceDelivery">
insert into invoice_delivery(bsrysfzjhm,dqbm,jflx,fphm,gmflxdh,gmfyx,nsrsbh)
values (#{bsrysfzjhm},#{dqbm},#{jflx},#{fphm},#{gmflxdh},#{gmfyx},#{nsrsbh})
<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>
Loading…
Cancel
Save