关联发货单张数字段增加
This commit is contained in:
parent
6c32016e37
commit
f5015283f2
|
|
@ -42,6 +42,33 @@ public class InvoiceApp extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
RoleDateUtils roleDateUtils;
|
RoleDateUtils roleDateUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 分页查询根据客户id和商品编码查询发货单信息
|
||||||
|
* @author: lj
|
||||||
|
* @date: 2024/5/8
|
||||||
|
**/
|
||||||
|
@ResponseBody
|
||||||
|
@ApiOperation("分页查询根据客户id和商品编码查询发货单信息")
|
||||||
|
@RequestMapping(value = "/pageFHDList", method = RequestMethod.POST)
|
||||||
|
public Map<String, Object> pageFHDList(
|
||||||
|
@ApiParam(required = true, value = "客户id") @RequestParam(required = true) String clientId,
|
||||||
|
@ApiParam(required = true, value = "商品编码") @RequestParam(required = true) String goodsCode,
|
||||||
|
@ApiParam(required = true, value = "页码", defaultValue = "1") @RequestParam(value = "page") Integer pageNum,
|
||||||
|
@ApiParam(required = true, value = "每页条数", defaultValue = "10") @RequestParam(value = "pageSize") Integer pageSize,
|
||||||
|
HttpServletRequest request) {
|
||||||
|
Map<String, Object> result = new HashMap<String, Object>();
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
String token = request.getHeader("token");
|
||||||
|
if (!redisService.exists(token)) {
|
||||||
|
return AjaxResult.error(ErrorUtils.IS_NOT_LOGIN_ERROR, "用户未登录");
|
||||||
|
}
|
||||||
|
params.put("clientId", clientId);
|
||||||
|
params.put("goodsCode", goodsCode);
|
||||||
|
params.put("page", pageNum);
|
||||||
|
params.put("pageSize", pageSize);
|
||||||
|
return toPage(invoiceService.pageList(params, ".pageFHDList"));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 分页查询
|
* @description: 分页查询
|
||||||
* @author: mzr
|
* @author: mzr
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,30 @@
|
||||||
<select id="findCode" parameterType="map" resultType="Integer">
|
<select id="findCode" parameterType="map" resultType="Integer">
|
||||||
SELECT count(1) AS "num" FROM crm_invoice_info WHERE invoice_no = #{invoiceNo}
|
SELECT count(1) AS "num" FROM crm_invoice_info WHERE invoice_no = #{invoiceNo}
|
||||||
</select>
|
</select>
|
||||||
|
<!-- 分页查询根据客户id和商品编码查询发货单信息 -->
|
||||||
|
<select id="pageFHDList" parameterType="map" resultType="map">
|
||||||
|
SELECT
|
||||||
|
a.id,
|
||||||
|
a.invoice_id "invoiceId",
|
||||||
|
nvl(a.major_num, '') "majorNum",
|
||||||
|
nvl(a.auxiliary_num, '') "auxiliaryNum",
|
||||||
|
nvl(a.actual_major_num, '') "actualMajorNum",
|
||||||
|
nvl(a.actual_auxiliary_num, '') "actualAuxiliaryNum",
|
||||||
|
b.INVOICE_NO "invoiceNo",
|
||||||
|
b.INVOICE_DATE "invoiceDate",
|
||||||
|
b.DELIVERY_TIME "deliveryTime"
|
||||||
|
FROM crm_invoice_detail a
|
||||||
|
LEFT JOIN crm_invoice_info b ON a.invoice_id = b.id
|
||||||
|
<where>
|
||||||
|
<if test="clientId != null and clientId != ''">
|
||||||
|
and b.client_id = #{clientId}
|
||||||
|
</if>
|
||||||
|
<if test="goodsNo != null and goodsNo != ''">
|
||||||
|
AND a.GOODS_NO = #{goodsNo}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY a.create_time DESC
|
||||||
|
</select>
|
||||||
<!-- 列表擦查询 -->
|
<!-- 列表擦查询 -->
|
||||||
<select id="pageList" parameterType="map" resultMap="crmInvoiceInfoMap">
|
<select id="pageList" parameterType="map" resultMap="crmInvoiceInfoMap">
|
||||||
SELECT
|
SELECT
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,9 @@
|
||||||
LEFT JOIN crm_invoice_detail b ON a.goods_no = b.goods_no
|
LEFT JOIN crm_invoice_detail b ON a.goods_no = b.goods_no
|
||||||
LEFT JOIN crm_invoice_info c on b.invoice_id = c.id
|
LEFT JOIN crm_invoice_info c on b.invoice_id = c.id
|
||||||
<where>
|
<where>
|
||||||
|
<if test="goodsNo != null and goodsNo != ''">
|
||||||
|
AND a.GOODS_NO = #{goodsNo}
|
||||||
|
</if>
|
||||||
<if test="clientId != null and clientId != ''">
|
<if test="clientId != null and clientId != ''">
|
||||||
AND c.client_id = #{clientId}
|
AND c.client_id = #{clientId}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,13 @@
|
||||||
<result column="remark" property="remark" jdbcType="VARCHAR" />
|
<result column="remark" property="remark" jdbcType="VARCHAR" />
|
||||||
<result column="prod_date" property="prodDate" jdbcType="VARCHAR" />
|
<result column="prod_date" property="prodDate" jdbcType="VARCHAR" />
|
||||||
<result column="distributor_name" property="clientName" jdbcType="VARCHAR" />
|
<result column="distributor_name" property="clientName" jdbcType="VARCHAR" />
|
||||||
|
<result column="join_fhd_num" property="joinFhdNum" jdbcType="VARCHAR" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<!-- 表查询字段 -->
|
<!-- 表查询字段 -->
|
||||||
<sql id="allColumns">
|
<sql id="allColumns">
|
||||||
a.id, a.bill_id, a.bill_no, a.bill_date, a.client_id, a.confirm_status, a.create_time, a.goods_id,
|
a.id, a.bill_id, a.bill_no, a.bill_date, a.client_id, a.confirm_status, a.create_time, a.goods_id,
|
||||||
a.goods_no, a.last_num, a.count_num, a.diff_num, a.company_id, a.remark, a.prod_date,
|
a.goods_no, a.last_num, a.count_num, a.diff_num, a.company_id, a.remark, a.prod_date,a.join_fhd_num,
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 根据条件参数查询盘点子表列表 -->
|
<!-- 根据条件参数查询盘点子表列表 -->
|
||||||
|
|
@ -93,7 +94,7 @@
|
||||||
SELECT * FROM (
|
SELECT * FROM (
|
||||||
SELECT
|
SELECT
|
||||||
c.distributor_name, a.goods_no, a.prod_date, b.goods_name, b.unit_name, b.specifications, b.goods_type_name,
|
c.distributor_name, a.goods_no, a.prod_date, b.goods_name, b.unit_name, b.specifications, b.goods_type_name,
|
||||||
a.count_num,
|
a.count_num,a.join_fhd_num,
|
||||||
ROW_NUMBER () OVER(PARTITION BY a.client_id,a.goods_no ORDER BY a.bill_date DESC, a.create_time
|
ROW_NUMBER () OVER(PARTITION BY a.client_id,a.goods_no ORDER BY a.bill_date DESC, a.create_time
|
||||||
DESC) AS rn
|
DESC) AS rn
|
||||||
FROM crm_inventory_detail a
|
FROM crm_inventory_detail a
|
||||||
|
|
@ -218,7 +219,7 @@
|
||||||
INSERT INTO crm_inventory_detail (
|
INSERT INTO crm_inventory_detail (
|
||||||
id, bill_id, bill_no, bill_date, client_id, confirm_status, create_time, goods_id,
|
id, bill_id, bill_no, bill_date, client_id, confirm_status, create_time, goods_id,
|
||||||
goods_no, goods_name, unit_id, unit_name, specifications, goods_type_id, goods_type_name, last_num,
|
goods_no, goods_name, unit_id, unit_name, specifications, goods_type_id, goods_type_name, last_num,
|
||||||
count_num, diff_num, company_id, remark, prod_date
|
count_num, diff_num, company_id, remark, prod_date,join_fhd_num
|
||||||
) VALUES (
|
) VALUES (
|
||||||
#{id,jdbcType=VARCHAR},
|
#{id,jdbcType=VARCHAR},
|
||||||
#{billId,jdbcType=VARCHAR},
|
#{billId,jdbcType=VARCHAR},
|
||||||
|
|
@ -240,7 +241,8 @@
|
||||||
#{diffNum,jdbcType=VARCHAR},
|
#{diffNum,jdbcType=VARCHAR},
|
||||||
#{companyId,jdbcType=VARCHAR},
|
#{companyId,jdbcType=VARCHAR},
|
||||||
#{remark,jdbcType=VARCHAR},
|
#{remark,jdbcType=VARCHAR},
|
||||||
#{prodDate,jdbcType=VARCHAR}
|
#{prodDate,jdbcType=VARCHAR},
|
||||||
|
#{joinFhdNum,jdbcType=VARCHAR}
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
@ -249,7 +251,7 @@
|
||||||
INSERT INTO crm_inventory_detail (
|
INSERT INTO crm_inventory_detail (
|
||||||
id, bill_id, bill_no, bill_date, client_id, confirm_status, create_time, goods_id,
|
id, bill_id, bill_no, bill_date, client_id, confirm_status, create_time, goods_id,
|
||||||
goods_no, goods_name, unit_id, unit_name, specifications, goods_type_id, goods_type_name, last_num,
|
goods_no, goods_name, unit_id, unit_name, specifications, goods_type_id, goods_type_name, last_num,
|
||||||
count_num, diff_num, company_id, remark, prod_date
|
count_num, diff_num, company_id, remark, prod_date,join_fhd_num
|
||||||
)
|
)
|
||||||
<foreach collection="list" index="index" item="item" separator="UNION ALL">
|
<foreach collection="list" index="index" item="item" separator="UNION ALL">
|
||||||
SELECT
|
SELECT
|
||||||
|
|
@ -273,7 +275,8 @@
|
||||||
#{item.diffNum,jdbcType=VARCHAR},
|
#{item.diffNum,jdbcType=VARCHAR},
|
||||||
#{item.companyId,jdbcType=VARCHAR},
|
#{item.companyId,jdbcType=VARCHAR},
|
||||||
#{item.remark,jdbcType=VARCHAR},
|
#{item.remark,jdbcType=VARCHAR},
|
||||||
#{item.prodDate,jdbcType=VARCHAR}
|
#{item.prodDate,jdbcType=VARCHAR},
|
||||||
|
#{item.joinFhdNum,jdbcType=VARCHAR}
|
||||||
FROM DUAL
|
FROM DUAL
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
|
||||||
|
|
@ -111,4 +111,8 @@ public class CrmInventoryDetail implements java.io.Serializable {
|
||||||
@Excel(name = "客户名称", width = 20, orderNum = "0")
|
@Excel(name = "客户名称", width = 20, orderNum = "0")
|
||||||
private String clientName;
|
private String clientName;
|
||||||
|
|
||||||
|
/** 关联发货单张数 */
|
||||||
|
@ApiModelProperty(value = "关联发货单张数")
|
||||||
|
private String joinFhdNum;
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue