新增配合配送系统远程调用接口
This commit is contained in:
@@ -7,9 +7,9 @@ spring:
|
||||
# 主库数据源
|
||||
master:
|
||||
# url: jdbc:mysql://101.132.133.142:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://192.168.1.20:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# url: jdbc:mysql://192.168.1.28:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# url: jdbc:mysql://192.168.1.192:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# url: jdbc:mysql://192.168.1.251:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://192.168.1.251:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# url: jdbc:mysql://localhost:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: shzg
|
||||
|
||||
@@ -69,8 +69,8 @@ spring:
|
||||
redis:
|
||||
# 地址
|
||||
# host: 101.132.133.142
|
||||
host: 192.168.1.20
|
||||
# host: 192.168.1.251
|
||||
# host: 192.168.1.28
|
||||
host: 192.168.1.251
|
||||
# host: localhost
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
|
||||
@@ -387,36 +387,64 @@
|
||||
a.ly_time,
|
||||
a.ck_lihuo_y,
|
||||
u.user_name AS ck_lihuo_y_name,
|
||||
ru.user_name AS lihuo_y_name
|
||||
ru.user_name AS lihuo_y_name,
|
||||
a.is_delivery AS is_delivery
|
||||
FROM (
|
||||
SELECT
|
||||
MIN(t.id) AS id,
|
||||
t.bill_no AS bill_no,
|
||||
MIN(t.bill_no_ck) AS bill_no_ck,
|
||||
MIN(t.rk_type) AS rk_type,
|
||||
MIN(t.wl_type) AS wl_type,
|
||||
MIN(t.cangku) AS cangku,
|
||||
MIN(t.rk_time) AS rk_time,
|
||||
MIN(t.lihuo_y) AS lihuo_y,
|
||||
MAX(t.is_chuku) AS is_chuku,
|
||||
MIN(t.xj) AS xj,
|
||||
MIN(t.xm_no) AS xm_no,
|
||||
MIN(t.xm_ms) AS xm_ms,
|
||||
MIN(t.xm_no_ck) AS xm_no_ck,
|
||||
MIN(t.xm_ms_ck) AS xm_ms_ck,
|
||||
MIN(t.gys_mc) AS gys_mc,
|
||||
MIN(t.wl_no) AS wl_no,
|
||||
MIN(t.wl_ms) AS wl_ms,
|
||||
MIN(t.gys_no) AS gys_no,
|
||||
MIN(t.sap_no) AS sap_no,
|
||||
MIN(t.ck_type) AS ck_type,
|
||||
MAX(t.ly_time) AS ly_time,
|
||||
MIN(t.ck_lihuo_y) AS ck_lihuo_y
|
||||
MIN(t.id) AS id,
|
||||
t.bill_no AS bill_no,
|
||||
MIN(t.bill_no_ck) AS bill_no_ck,
|
||||
MIN(t.rk_type) AS rk_type,
|
||||
MIN(t.wl_type) AS wl_type,
|
||||
MIN(t.cangku) AS cangku,
|
||||
MIN(t.rk_time) AS rk_time,
|
||||
MIN(t.lihuo_y) AS lihuo_y,
|
||||
MAX(t.is_chuku) AS is_chuku,
|
||||
MIN(t.xj) AS xj,
|
||||
MIN(t.xm_no) AS xm_no,
|
||||
MIN(t.xm_ms) AS xm_ms,
|
||||
MIN(t.xm_no_ck) AS xm_no_ck,
|
||||
MIN(t.xm_ms_ck) AS xm_ms_ck,
|
||||
MIN(t.gys_mc) AS gys_mc,
|
||||
MIN(t.wl_no) AS wl_no,
|
||||
MIN(t.wl_ms) AS wl_ms,
|
||||
MIN(t.gys_no) AS gys_no,
|
||||
MIN(t.sap_no) AS sap_no,
|
||||
MIN(t.ck_type) AS ck_type,
|
||||
MAX(t.ly_time) AS ly_time,
|
||||
MIN(t.ck_lihuo_y) AS ck_lihuo_y,
|
||||
MIN(t.is_delivery) AS is_delivery
|
||||
FROM (
|
||||
<include refid="selectRkInfoForGroup"/>
|
||||
SELECT
|
||||
ri.id,
|
||||
ri.bill_no,
|
||||
ri.bill_no_ck,
|
||||
ri.rk_type,
|
||||
ri.wl_type,
|
||||
ri.cangku,
|
||||
ri.rk_time,
|
||||
ri.lihuo_y,
|
||||
ri.is_chuku,
|
||||
ri.xj,
|
||||
ri.xm_no,
|
||||
ri.xm_ms,
|
||||
ri.xm_no_ck,
|
||||
ri.xm_ms_ck,
|
||||
ri.gys_mc,
|
||||
ri.wl_no,
|
||||
ri.wl_ms,
|
||||
ri.gys_no,
|
||||
ri.sap_no,
|
||||
ri.ck_type,
|
||||
ri.ly_time,
|
||||
ri.ck_lihuo_y,
|
||||
ri.pcode,
|
||||
ri.is_delete,
|
||||
ri.is_delivery
|
||||
FROM rk_info ri
|
||||
) t
|
||||
<where>
|
||||
<!-- 删除标记:默认0 -->
|
||||
<!-- is_delete -->
|
||||
<choose>
|
||||
<when test="q.isDelete != null and q.isDelete != ''">
|
||||
AND t.is_delete = #{q.isDelete}
|
||||
@@ -426,7 +454,7 @@
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
<!-- is_chuku 优先列表,其次单值 -->
|
||||
<!-- is_chuku / isChukuList -->
|
||||
<choose>
|
||||
<when test="q.isChukuList != null and q.isChukuList.size > 0">
|
||||
AND t.is_chuku IN
|
||||
@@ -439,7 +467,7 @@
|
||||
</when>
|
||||
</choose>
|
||||
|
||||
<!-- 关键词模糊 -->
|
||||
<!-- keyword -->
|
||||
<if test="q.keyword != null and q.keyword != ''">
|
||||
AND (
|
||||
t.xm_no LIKE concat('%', #{q.keyword}, '%')
|
||||
@@ -456,39 +484,42 @@
|
||||
)
|
||||
</if>
|
||||
|
||||
<!-- 维度筛选 -->
|
||||
<!-- 维度 -->
|
||||
<if test="q.rkType != null and q.rkType != ''"> AND t.rk_type LIKE concat('%', #{q.rkType}, '%') </if>
|
||||
<if test="q.wlType != null and q.wlType != ''"> AND t.wl_type LIKE concat('%', #{q.wlType}, '%') </if>
|
||||
<if test="q.cangku != null and q.cangku != ''"> AND t.cangku LIKE concat('%', #{q.cangku}, '%') </if>
|
||||
|
||||
<!-- 入库/领用时间范围(闭区间) -->
|
||||
<!-- 时间 -->
|
||||
<if test="q.startTime != null"><![CDATA[ AND t.rk_time >= #{q.startTime} ]]></if>
|
||||
<if test="q.endTime != null"><![CDATA[ AND t.rk_time <= #{q.endTime} ]]></if>
|
||||
<if test="q.lyStartTime!= null"><![CDATA[ AND t.ly_time >= #{q.lyStartTime}]]></if>
|
||||
<if test="q.lyEndTime != null"><![CDATA[ AND t.ly_time <= #{q.lyEndTime} ]]></if>
|
||||
|
||||
<!-- 其它等值/模糊 -->
|
||||
<if test="q.lihuoY != null and q.lihuoY != ''"> AND t.lihuo_y LIKE concat('%', #{q.lihuoY}, '%') </if>
|
||||
<if test="q.xj != null and q.xj != ''"> AND t.xj LIKE concat('%', #{q.xj}, '%') </if>
|
||||
<if test="q.billNo != null and q.billNo != ''"> AND t.bill_no LIKE concat('%', #{q.billNo}, '%') </if>
|
||||
<!-- 模糊字段 -->
|
||||
<if test="q.lihuoY != null and q.lihuoY != ''"> AND t.lihuo_y LIKE concat('%', #{q.lihuoY}, '%') </if>
|
||||
<if test="q.xj != null and q.xj != ''"> AND t.xj LIKE concat('%', #{q.xj}, '%') </if>
|
||||
<if test="q.billNo != null and q.billNo != ''"> AND t.bill_no LIKE concat('%', #{q.billNo}, '%') </if>
|
||||
<if test="q.billNoCk != null and q.billNoCk != ''"> AND t.bill_no_ck LIKE concat('%', #{q.billNoCk}, '%') </if>
|
||||
<if test="q.xmNo != null and q.xmNo != ''"> AND t.xm_no LIKE concat('%', #{q.xmNo}, '%') </if>
|
||||
<if test="q.xmMs != null and q.xmMs != ''"> AND t.xm_ms LIKE concat('%', #{q.xmMs}, '%') </if>
|
||||
<if test="q.wlNo != null and q.wlNo != ''"> AND t.wl_no LIKE concat('%', #{q.wlNo}, '%') </if>
|
||||
<if test="q.wlMs != null and q.wlMs != ''"> AND t.wl_ms LIKE concat('%', #{q.wlMs}, '%') </if>
|
||||
<if test="q.gysNo != null and q.gysNo != ''"> AND t.gys_no LIKE concat('%', #{q.gysNo}, '%') </if>
|
||||
<if test="q.gysMc != null and q.gysMc != ''"> AND t.gys_mc LIKE concat('%', #{q.gysMc}, '%') </if>
|
||||
<if test="q.sapNo != null and q.sapNo != ''"> AND t.sap_no LIKE concat('%', #{q.sapNo}, '%') </if>
|
||||
<if test="q.xh != null and q.xh != ''"> AND t.xh LIKE concat('%', #{q.xh}, '%') </if>
|
||||
<if test="q.pcode != null and q.pcode != ''"> AND t.pcode LIKE concat('%', #{q.pcode}, '%') </if>
|
||||
<if test="q.xmNo != null and q.xmNo != ''"> AND t.xm_no LIKE concat('%', #{q.xmNo}, '%') </if>
|
||||
<if test="q.xmMs != null and q.xmMs != ''"> AND t.xm_ms LIKE concat('%', #{q.xmMs}, '%') </if>
|
||||
<if test="q.wlNo != null and q.wlNo != ''"> AND t.wl_no LIKE concat('%', #{q.wlNo}, '%') </if>
|
||||
<if test="q.wlMs != null and q.wlMs != ''"> AND t.wl_ms LIKE concat('%', #{q.wlMs}, '%') </if>
|
||||
<if test="q.gysNo != null and q.gysNo != ''"> AND t.gys_no LIKE concat('%', #{q.gysNo}, '%') </if>
|
||||
<if test="q.gysMc != null and q.gysMc != ''"> AND t.gys_mc LIKE concat('%', #{q.gysMc}, '%') </if>
|
||||
<if test="q.sapNo != null and q.sapNo != ''"> AND t.sap_no LIKE concat('%', #{q.sapNo}, '%') </if>
|
||||
<if test="q.pcode != null and q.pcode != ''"> AND t.pcode LIKE concat('%', #{q.pcode}, '%') </if>
|
||||
|
||||
<!-- 若查询出库单据,则要求已生成出库单号 -->
|
||||
<if test="(q.isChuku != null and q.isChuku == 1)
|
||||
or (q.isChukuList != null and q.isChukuList.size > 0 and q.isChukuList.contains(1))">
|
||||
<if test="q.isDelivery != null and q.isDelivery != ''">
|
||||
AND t.is_delivery = #{q.isDelivery}
|
||||
</if>
|
||||
|
||||
<!-- 出库才要求 bill_no_ck 非空 -->
|
||||
<if test="(q.isChuku != null and q.isChuku == '1')
|
||||
or (q.isChukuList != null and q.isChukuList.size > 0 and q.isChukuList.contains('1'))">
|
||||
AND t.bill_no_ck IS NOT NULL
|
||||
</if>
|
||||
|
||||
<!-- 审核开启:剔除该 bill_no 下任意一条“审核失败”的明细 -->
|
||||
<!-- 审核 -->
|
||||
<if test="needAudit != null and needAudit == 1">
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
@@ -507,10 +538,11 @@
|
||||
LEFT JOIN stock_in_type si ON a.rk_type = si.type_code
|
||||
LEFT JOIN stock_out_type so ON a.ck_type = so.type_code
|
||||
LEFT JOIN sys_user u ON a.ck_lihuo_y = u.user_id
|
||||
LEFT JOIN material_type mt ON a.wl_type = mt.type_code
|
||||
LEFT JOIN sys_user ru ON a.lihuo_y = ru.user_id
|
||||
LEFT JOIN material_type mt ON a.wl_type = mt.type_code
|
||||
LEFT JOIN sys_user ru ON a.lihuo_y = ru.user_id
|
||||
ORDER BY a.rk_time DESC
|
||||
</select>
|
||||
|
||||
<!-- ================== /按单据分组查询 ================== -->
|
||||
|
||||
<select id="selectRkInfoById" parameterType="Long" resultMap="RkInfoResult">
|
||||
@@ -886,50 +918,6 @@
|
||||
ORDER BY t.rk_time DESC, t.id DESC
|
||||
</select>
|
||||
|
||||
<select id="selectDeliveryAll"
|
||||
parameterType="com.zg.project.wisdom.domain.RkInfo"
|
||||
resultMap="RkInfoResult">
|
||||
<include refid="selectRkInfoVo"/>
|
||||
<where>
|
||||
ri.is_delete = '0'
|
||||
AND ri.is_delivery = '1'
|
||||
AND ri.is_chuku = '1' <!-- 已出库,待配送 -->
|
||||
|
||||
<if test="billNoCk != null and billNoCk != ''">
|
||||
AND ri.bill_no_ck = #{billNoCk}
|
||||
</if>
|
||||
<if test="ckType != null and ckType != ''">
|
||||
AND ri.ck_type = #{ckType}
|
||||
</if>
|
||||
<if test="teamCode != null and teamCode != ''">
|
||||
AND ri.team_code = #{teamCode}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND ri.status = #{status}
|
||||
</if>
|
||||
|
||||
<if test="lyStartTime != null">
|
||||
AND ri.ly_time <![CDATA[ >= ]]> #{lyStartTime}
|
||||
</if>
|
||||
<if test="lyEndTime != null">
|
||||
AND ri.ly_time <![CDATA[ <= ]]> #{lyEndTime}
|
||||
</if>
|
||||
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (
|
||||
ri.xm_no_ck LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR ri.xm_ms_ck LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR ri.wl_no LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR ri.wl_ms LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR ri.gys_no LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR ri.gys_mc LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR ri.bill_no_ck LIKE CONCAT('%', #{keyword}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY ri.ly_time DESC, ri.id DESC
|
||||
</select>
|
||||
|
||||
<!-- 分页查询 rk_info 全量明细(支持 keyword 模糊过滤) -->
|
||||
<select id="selectAllRkInfo"
|
||||
parameterType="com.zg.project.wisdom.domain.RkInfo"
|
||||
@@ -1143,6 +1131,84 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDeliveryCkList"
|
||||
resultType="com.zg.project.wisdom.domain.RkInfo">
|
||||
|
||||
SELECT
|
||||
id,
|
||||
gys_jh_id AS gysJhId,
|
||||
rk_type AS rkType,
|
||||
wl_type AS wlType,
|
||||
cangku,
|
||||
rk_time AS rkTime,
|
||||
borrow_time AS borrowTime,
|
||||
return_time AS returnTime,
|
||||
lihuo_y AS lihuoY,
|
||||
is_chuku AS isChuku,
|
||||
bill_no AS billNo,
|
||||
bill_no_ck AS billNoCk,
|
||||
is_delivery AS isDelivery,
|
||||
remark,
|
||||
xj,
|
||||
xm_no AS xmNo,
|
||||
xm_ms AS xmMs,
|
||||
xm_no_ck AS xmNoCk,
|
||||
xm_ms_ck AS xmMsCk,
|
||||
wl_no AS wlNo,
|
||||
wl_ms AS wlMs,
|
||||
gys_no AS gysNo,
|
||||
gys_mc AS gysMc,
|
||||
jh_amt AS jhAmt,
|
||||
ht_dj AS htDj,
|
||||
sap_no AS sapNo,
|
||||
xh,
|
||||
jh_qty AS jhQty,
|
||||
ht_qty AS htQty,
|
||||
dw,
|
||||
real_qty AS realQty,
|
||||
pcode,
|
||||
pcode_id AS pcodeId,
|
||||
tray_code AS trayCode,
|
||||
entity_id AS entityId,
|
||||
ck_lihuo_y AS ckLihuoY,
|
||||
ck_type AS ckType,
|
||||
team_code AS teamCode,
|
||||
ck_remark AS ckRemark,
|
||||
ly_time AS lyTime,
|
||||
has_moved AS hasMoved,
|
||||
is_borrowed AS isBorrowed,
|
||||
fycde_1 AS fycde1,
|
||||
fycde_2 AS fycde2,
|
||||
is_delete AS isDelete,
|
||||
create_by AS createBy,
|
||||
create_time AS createTime,
|
||||
update_by AS updateBy,
|
||||
update_time AS updateTime
|
||||
FROM rk_info
|
||||
WHERE is_delete = '0'
|
||||
AND is_chuku = '1'
|
||||
AND is_delivery = '1'
|
||||
|
||||
<!-- 可选过滤:比如你以后想限定县局、项目等 -->
|
||||
<if test="q.xj != null and q.xj != ''">
|
||||
AND xj = #{q.xj}
|
||||
</if>
|
||||
<if test="q.xmNoCk != null and q.xmNoCk != ''">
|
||||
AND xm_no_ck = #{q.xmNoCk}
|
||||
</if>
|
||||
<if test="q.teamCode != null and q.teamCode != ''">
|
||||
AND team_code = #{q.teamCode}
|
||||
</if>
|
||||
<if test="q.lyStartTime != null">
|
||||
AND ly_time >= #{q.lyStartTime}
|
||||
</if>
|
||||
<if test="q.lyEndTime != null">
|
||||
AND ly_time <= #{q.lyEndTime}
|
||||
</if>
|
||||
|
||||
ORDER BY bill_no_ck, ly_time, id
|
||||
</select>
|
||||
|
||||
<update id="updateBillInfo" parameterType="com.zg.project.wisdom.domain.RkInfo">
|
||||
UPDATE rk_info
|
||||
<set>
|
||||
@@ -1154,4 +1220,11 @@
|
||||
WHERE bill_no = #{billNo}
|
||||
</update>
|
||||
|
||||
<update id="updateDeliveryStatus">
|
||||
UPDATE rk_info
|
||||
SET is_delivery = #{isDelivery}
|
||||
WHERE bill_no_ck = #{billNoCk}
|
||||
AND is_delete = '0'
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user