Merge branch 'master' into test
commit
b8a9e47004
@ -0,0 +1,40 @@
|
|||||||
|
package com.glxp.api.controller.inout;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||||
|
import com.glxp.api.annotation.Log;
|
||||||
|
import com.glxp.api.common.res.BaseResponse;
|
||||||
|
import com.glxp.api.common.util.ResultVOUtils;
|
||||||
|
import com.glxp.api.constant.BusinessType;
|
||||||
|
import com.glxp.api.entity.inout.IoOrderInvoiceEntity;
|
||||||
|
import com.glxp.api.req.inout.IoOrderInvoiceRequest;
|
||||||
|
import com.glxp.api.req.inout.RefreshInoiceRequest;
|
||||||
|
import com.glxp.api.service.inout.IoOrderInvoiceService;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class IoOrderInvoiceController {
|
||||||
|
@Resource
|
||||||
|
IoOrderInvoiceService ioOrderInvoiceService;
|
||||||
|
RefreshInoiceRequest refreshInoiceRequest;
|
||||||
|
|
||||||
|
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/udiwms/inout/order/refrshInvoice")
|
||||||
|
@Log(title = "发票", businessType = BusinessType.INSERT)
|
||||||
|
public BaseResponse addBizProduct(@RequestBody RefreshInoiceRequest refreshInoiceRequest) {
|
||||||
|
|
||||||
|
IoOrderInvoiceRequest orderInvoiceRequest = new IoOrderInvoiceRequest();
|
||||||
|
BeanUtils.copyProperties(refreshInoiceRequest, orderInvoiceRequest);
|
||||||
|
List<IoOrderInvoiceEntity> orderInvoiceEntities = ioOrderInvoiceService.selectOrderInvoice(orderInvoiceRequest);
|
||||||
|
if (CollUtil.isEmpty(orderInvoiceEntities))
|
||||||
|
return ResultVOUtils.error(500, "查无发票信息!");
|
||||||
|
return ResultVOUtils.success(orderInvoiceEntities);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.glxp.api.req.inout;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class RefreshInoiceRequest {
|
||||||
|
private Long id;
|
||||||
|
private String orderIdFk;
|
||||||
|
private Long bizIdFk;
|
||||||
|
|
||||||
|
}
|
@ -1,25 +1,29 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.glxp.api.dao.inout.IoOrderInvoiceMapper">
|
<mapper namespace="com.glxp.api.dao.inout.IoOrderInvoiceMapper">
|
||||||
|
|
||||||
<insert id="insertInvoice" parameterType="com.glxp.api.entity.inout.IoOrderInvoiceEntity">
|
<insert id="insertInvoice" parameterType="com.glxp.api.entity.inout.IoOrderInvoiceEntity">
|
||||||
INSERT INTO io_order_invoice( orderIdFk, bindRlFk,batchNo, productDate, expireDate
|
INSERT INTO io_order_invoice(orderIdFk, bindRlFk, batchNo, productDate, expireDate)
|
||||||
)
|
|
||||||
values (#{orderIdFk},
|
values (#{orderIdFk},
|
||||||
#{bindRlFk},
|
#{bindRlFk},
|
||||||
#{batchNo},
|
#{batchNo},
|
||||||
#{productDate},
|
#{productDate},
|
||||||
#{expireDate}
|
#{expireDate})
|
||||||
)
|
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<select id="selectOrderInvoice" parameterType="com.glxp.api.entity.inout.IoOrderInvoiceEntity" resultType="com.glxp.api.entity.inout.IoOrderInvoiceEntity" >
|
<select id="selectOrderInvoice" parameterType="com.glxp.api.req.inout.IoOrderInvoiceRequest"
|
||||||
select * from io_order_invoice
|
resultType="com.glxp.api.entity.inout.IoOrderInvoiceEntity">
|
||||||
|
select *
|
||||||
|
from io_order_invoice
|
||||||
<where>
|
<where>
|
||||||
|
<if test="id != null">
|
||||||
|
AND id = #{id}
|
||||||
|
</if>
|
||||||
|
<if test="bizIdFk != null">
|
||||||
|
AND bizIdFk = #{bizIdFk}
|
||||||
|
</if>
|
||||||
<if test="orderIdFk != null and orderIdFk != ''">
|
<if test="orderIdFk != null and orderIdFk != ''">
|
||||||
AND orderIdFk = #{orderIdFk}
|
AND orderIdFk = #{orderIdFk}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue