
15 changed files with 646 additions and 590 deletions
@ -0,0 +1,26 @@ |
|||
package com.yxt.anrui.portal.fegin.wms; |
|||
|
|||
import com.yxt.common.core.result.ResultBean; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.cloud.openfeign.SpringQueryMap; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.ResponseBody; |
|||
|
|||
/** |
|||
* @description: 商品盘点 |
|||
* @author: fzz |
|||
* @date: 2024/3/7 |
|||
**/ |
|||
@FeignClient( |
|||
contextId = "yxt-wms-WmsInventoryCheckbill", |
|||
name = "yxt-wms", |
|||
path = "v1/wmsinventorycheckbill" |
|||
) |
|||
public interface WmsInventoryCheckbillFeign { |
|||
|
|||
@ApiOperation("手机端-查询本分公司下代办数量:切换机构") |
|||
@GetMapping("/getToDoNum") |
|||
@ResponseBody |
|||
ResultBean<String> getToDoNum(@SpringQueryMap WmsToDoNumQuery wmsToDoNumQuery); |
|||
} |
@ -1,285 +1,322 @@ |
|||
<?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.yxt.wms.biz.inventory.wmsinventorycheckbill.WmsInventoryCheckbillMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
<select id="selectPageVo" resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbill.WmsInventoryCheckbillVo"> |
|||
SELECT |
|||
wic.sid, |
|||
wic.state, |
|||
wic.`remarks`, |
|||
wic.`nodeState`, |
|||
wic.`deptName`, |
|||
wic.`billNo`, |
|||
wic.`createTime`, |
|||
wic.`createByName`, |
|||
wic.`superviseName`, |
|||
IF( |
|||
wic.`checkState` = '1', |
|||
'盘点中', |
|||
'盘点完成' |
|||
) AS checkState, |
|||
wic.`procDefId`, |
|||
wic.`procInstId`, |
|||
SUM(wicd.bookCount) AS bookCount, |
|||
SUM(wicd.bookCount * cost) AS bookAmount, |
|||
SUM(wicd.realCount) AS realCount, |
|||
SUM(wicd.realCount * cost) AS realAmount, |
|||
SUM(wicd.bookCount) - SUM(wicd.realCount) AS notCount, |
|||
( |
|||
SUM(wicd.bookCount * cost) - SUM(wicd.realCount * cost) |
|||
) AS notAmount, |
|||
SUM(wicd.profitCount) AS profitCount, |
|||
SUM(wicd.profitCount * cost) AS profitAmount, |
|||
SUM(wicd.loseCount) AS loseCount, |
|||
SUM(wicd.loseCount * cost) AS loseAmount, |
|||
SUM(wicd.lossCount) AS lossCount, |
|||
SUM(wicd.lossCount * cost) AS lossAmount |
|||
FROM |
|||
wms_inventory_checkbill wic |
|||
LEFT JOIN wms_inventory_checkbill_detail wicd |
|||
ON wic.sid = wicd.`billSid` |
|||
LEFT JOIN anrui_portal.sys_organization AS s |
|||
ON wic.deptSid = s.sid |
|||
<where> ${ew.sqlSegment} </where> |
|||
</select> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
<select id="selectPageVo" resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbill.WmsInventoryCheckbillVo"> |
|||
SELECT |
|||
wic.sid, |
|||
wic.state, |
|||
wic.remarks, |
|||
wic.nodeState, |
|||
wic.deptName, |
|||
wic.billNo, |
|||
wic.createTime, |
|||
wic.createByName, |
|||
wic.superviseName, |
|||
IF( |
|||
wic.checkState = '1', |
|||
'盘点中', |
|||
'盘点完成' |
|||
) AS checkState, |
|||
wic.procDefId, |
|||
wic.procInstId, |
|||
SUM(wicd.bookCount) AS bookCount, |
|||
SUM(wicd.bookCount * cost) AS bookAmount, |
|||
SUM(wicd.realCount) AS realCount, |
|||
SUM(wicd.realCount * cost) AS realAmount, |
|||
SUM(wicd.bookCount) - SUM(wicd.realCount) AS notCount, |
|||
( |
|||
SUM(wicd.bookCount * cost) - SUM(wicd.realCount * cost) |
|||
) AS notAmount, |
|||
SUM(wicd.profitCount) AS profitCount, |
|||
SUM(wicd.profitCount * cost) AS profitAmount, |
|||
SUM(wicd.loseCount) AS loseCount, |
|||
SUM(wicd.loseCount * cost) AS loseAmount, |
|||
SUM(wicd.lossCount) AS lossCount, |
|||
SUM(wicd.lossCount * cost) AS lossAmount |
|||
FROM |
|||
wms_inventory_checkbill wic |
|||
LEFT JOIN wms_inventory_checkbill_detail wicd |
|||
ON wic.sid = wicd.billSid |
|||
LEFT JOIN anrui_portal.sys_organization AS s |
|||
ON wic.deptSid = s.sid |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="detailRackPageList" |
|||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailRackPageListVo"> |
|||
SELECT |
|||
billSid, |
|||
warehouseName, |
|||
warehouseArea, |
|||
warehouseRackSid, |
|||
warehouseRackName, |
|||
SUM(bookCount) AS bookCount, |
|||
SUM(bookCount * cost) AS bookAmount, |
|||
SUM(realCount) AS realCount, |
|||
SUM(realCount * cost) AS realAmount, |
|||
SUM(bookCount) - SUM(realCount) AS notCount, |
|||
(SUM(bookCount * cost) - SUM(realCount * cost)) AS notAmount, |
|||
SUM(profitCount) AS profitCount, |
|||
SUM(profitCount * cost) AS profitAmount, |
|||
SUM(loseCount) AS loseCount, |
|||
SUM(loseCount * cost) AS loseAmount, |
|||
SUM(lossCount) AS lossCount, |
|||
SUM(lossCount * cost) AS lossAmount |
|||
FROM |
|||
wms_inventory_checkbill_detail |
|||
<where> ${ew.sqlSegment} </where> |
|||
</select> |
|||
<select id="detailRackPageList" |
|||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailRackPageListVo"> |
|||
SELECT |
|||
billSid, |
|||
warehouseName, |
|||
warehouseArea, |
|||
warehouseRackSid, |
|||
warehouseRackName, |
|||
SUM(bookCount) AS bookCount, |
|||
SUM(bookCount * cost) AS bookAmount, |
|||
SUM(realCount) AS realCount, |
|||
SUM(realCount * cost) AS realAmount, |
|||
SUM(bookCount) - SUM(realCount) AS notCount, |
|||
(SUM(bookCount * cost) - SUM(realCount * cost)) AS notAmount, |
|||
SUM(profitCount) AS profitCount, |
|||
SUM(profitCount * cost) AS profitAmount, |
|||
SUM(loseCount) AS loseCount, |
|||
SUM(loseCount * cost) AS loseAmount, |
|||
SUM(lossCount) AS lossCount, |
|||
SUM(lossCount * cost) AS lossAmount |
|||
FROM |
|||
wms_inventory_checkbill_detail |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="detailGoodPageList" |
|||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailGoodPageListVo"> |
|||
SELECT |
|||
goodsID, |
|||
goodsSkuTitle, |
|||
goodsSkuCode, |
|||
warehouseName, |
|||
warehouseArea, |
|||
warehouseRackName, |
|||
unit, |
|||
cost, |
|||
bookCount, |
|||
bookCount * cost AS bookAmount, |
|||
realCount, |
|||
realCount * cost AS realAmount, |
|||
CASE |
|||
state |
|||
WHEN 2 |
|||
THEN '正常' |
|||
WHEN 3 |
|||
THEN '盘盈' |
|||
WHEN 4 |
|||
THEN '盘亏' |
|||
END AS state, |
|||
CASE |
|||
state |
|||
WHEN 2 |
|||
THEN 0 |
|||
WHEN 3 |
|||
THEN profitCount |
|||
WHEN 4 |
|||
THEN loseCount |
|||
END AS profitAndLoseCount, |
|||
CASE |
|||
state |
|||
WHEN 2 |
|||
THEN 0 |
|||
WHEN 3 |
|||
THEN profitCount * cost |
|||
WHEN 4 |
|||
THEN loseCount * cost |
|||
END AS profitAndLoseAmount, |
|||
lossCount, |
|||
lossCount * cost AS lossAmount, |
|||
remarks |
|||
FROM |
|||
wms_inventory_checkbill_detail |
|||
<where> ${ew.sqlSegment} </where> |
|||
</select> |
|||
<select id="detailGoodPageList" |
|||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailGoodPageListVo"> |
|||
SELECT |
|||
goodsID, |
|||
goodsSkuTitle, |
|||
goodsSkuCode, |
|||
warehouseName, |
|||
warehouseArea, |
|||
warehouseRackName, |
|||
unit, |
|||
cost, |
|||
bookCount, |
|||
bookCount * cost AS bookAmount, |
|||
realCount, |
|||
realCount * cost AS realAmount, |
|||
CASE |
|||
state |
|||
WHEN 2 |
|||
THEN '正常' |
|||
WHEN 3 |
|||
THEN '盘盈' |
|||
WHEN 4 |
|||
THEN '盘亏' |
|||
END AS state, |
|||
CASE |
|||
state |
|||
WHEN 2 |
|||
THEN 0 |
|||
WHEN 3 |
|||
THEN profitCount |
|||
WHEN 4 |
|||
THEN loseCount |
|||
END AS profitAndLoseCount, |
|||
CASE |
|||
state |
|||
WHEN 2 |
|||
THEN 0 |
|||
WHEN 3 |
|||
THEN profitCount * cost |
|||
WHEN 4 |
|||
THEN loseCount * cost |
|||
END AS profitAndLoseAmount, |
|||
lossCount, |
|||
lossCount * cost AS lossAmount, |
|||
remarks |
|||
FROM |
|||
wms_inventory_checkbill_detail |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="detailRackGoodPageList" |
|||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailRackGoodPageListVo"> |
|||
SELECT |
|||
sid, |
|||
goodsID, |
|||
goodsSkuTitle, |
|||
goodsSkuCode, |
|||
warehouseName, |
|||
warehouseArea, |
|||
warehouseRackName, |
|||
unit, |
|||
cost, |
|||
bookCount, |
|||
bookCount * cost AS bookAmount, |
|||
realCount, |
|||
realCount * cost AS realAmount, |
|||
CASE |
|||
state |
|||
WHEN 2 |
|||
THEN '正常' |
|||
WHEN 3 |
|||
THEN '盘盈' |
|||
WHEN 4 |
|||
THEN '盘亏' |
|||
END AS state, |
|||
CASE |
|||
state |
|||
WHEN 2 |
|||
THEN 0 |
|||
WHEN 3 |
|||
THEN profitCount |
|||
WHEN 4 |
|||
THEN loseCount |
|||
END AS profitAndLoseCount, |
|||
CASE |
|||
state |
|||
WHEN 2 |
|||
THEN 0 |
|||
WHEN 3 |
|||
THEN profitCount * cost |
|||
WHEN 4 |
|||
THEN loseCount * cost |
|||
END AS profitAndLoseAmount, |
|||
lossCount, |
|||
lossCount * cost AS lossAmount, |
|||
remarks |
|||
FROM |
|||
wms_inventory_checkbill_detail |
|||
<where> ${ew.sqlSegment} </where> |
|||
</select> |
|||
<select id="detailRackGoodPageList" |
|||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailRackGoodPageListVo"> |
|||
SELECT |
|||
sid, |
|||
goodsID, |
|||
goodsSkuTitle, |
|||
goodsSkuCode, |
|||
warehouseName, |
|||
warehouseArea, |
|||
warehouseRackName, |
|||
unit, |
|||
cost, |
|||
bookCount, |
|||
bookCount * cost AS bookAmount, |
|||
realCount, |
|||
realCount * cost AS realAmount, |
|||
CASE |
|||
state |
|||
WHEN 2 |
|||
THEN '正常' |
|||
WHEN 3 |
|||
THEN '盘盈' |
|||
WHEN 4 |
|||
THEN '盘亏' |
|||
END AS state, |
|||
CASE |
|||
state |
|||
WHEN 2 |
|||
THEN 0 |
|||
WHEN 3 |
|||
THEN profitCount |
|||
WHEN 4 |
|||
THEN loseCount |
|||
END AS profitAndLoseCount, |
|||
CASE |
|||
state |
|||
WHEN 2 |
|||
THEN 0 |
|||
WHEN 3 |
|||
THEN profitCount * cost |
|||
WHEN 4 |
|||
THEN loseCount * cost |
|||
END AS profitAndLoseAmount, |
|||
lossCount, |
|||
lossCount * cost AS lossAmount, |
|||
remarks |
|||
FROM |
|||
wms_inventory_checkbill_detail |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectNum" resultType="java.lang.String"> |
|||
select RIGHT (billNo, 4) |
|||
from wms_inventory_checkbill |
|||
where billNo LIKE concat(#{billNo}, '%') |
|||
order by billNo desc |
|||
limit 1 |
|||
<select id="selectNum" resultType="java.lang.String"> |
|||
select RIGHT (billNo, 4) |
|||
from wms_inventory_checkbill |
|||
where billNo LIKE concat(#{billNo}, '%') |
|||
order by billNo desc |
|||
limit 1 |
|||
</select> |
|||
|
|||
<select id="selectBySid" resultType="int"> |
|||
SELECT COUNT(*) |
|||
FROM wms_inventory_checkbill |
|||
WHERE nodeState != '待提交' |
|||
<select id="selectBySid" resultType="int"> |
|||
SELECT COUNT(*) |
|||
FROM wms_inventory_checkbill |
|||
WHERE nodeState != '待提交' |
|||
and find_in_set(sid, #{list}) |
|||
</select> |
|||
</select> |
|||
|
|||
<select id="checkState" resultType="java.lang.String"> |
|||
SELECT |
|||
checkState |
|||
FROM |
|||
wms_inventory_checkbill |
|||
WHERE deptSid = #{deptSid} |
|||
AND warehouseTypeKey = #{warehouseTypeKey} |
|||
ORDER BY createTime DESC |
|||
LIMIT 1 |
|||
</select> |
|||
<select id="checkState" resultType="java.lang.String"> |
|||
SELECT checkState |
|||
FROM wms_inventory_checkbill |
|||
WHERE deptSid = #{deptSid} |
|||
AND warehouseTypeKey = #{warehouseTypeKey} |
|||
ORDER BY createTime DESC LIMIT 1 |
|||
</select> |
|||
|
|||
<update id="updateFlowFiled"> |
|||
UPDATE wms_inventory_checkbill |
|||
SET nodeState=#{nodeState}, nodeId=#{taskDefKey} |
|||
<if test="nodeState == '已办结' or nodeState == '终止'"> |
|||
, finishTime = NOW() |
|||
</if> |
|||
<if test="procDefId != null and procDefId != ''"> |
|||
, procDefId=#{procDefId} |
|||
</if> |
|||
<if test="procInsId != null and procInsId != ''"> |
|||
, procInstId=#{procInsId} |
|||
</if> |
|||
<if test="taskId != null and taskId != ''"> |
|||
, taskId=#{taskId} |
|||
</if> |
|||
WHERE sid=#{sid} |
|||
<update id="updateFlowFiled"> |
|||
UPDATE wms_inventory_checkbill |
|||
SET nodeState=#{nodeState}, nodeId=#{taskDefKey} |
|||
<if test="nodeState == '已办结' or nodeState == '终止'"> |
|||
, finishTime = NOW() |
|||
</if> |
|||
<if test="procDefId != null and procDefId != ''"> |
|||
, procDefId=#{procDefId} |
|||
</if> |
|||
<if test="procInsId != null and procInsId != ''"> |
|||
, procInstId=#{procInsId} |
|||
</if> |
|||
<if test="taskId != null and taskId != ''"> |
|||
, taskId=#{taskId} |
|||
</if> |
|||
WHERE sid=#{sid} |
|||
</update> |
|||
|
|||
<select id="appDetailRackPageList" |
|||
<select id="appDetailRackPageList" |
|||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillPageVo"> |
|||
SELECT |
|||
c.sid, |
|||
d.warehouseRackSid AS houseSid, |
|||
CONCAT( |
|||
d.warehouseName, |
|||
'-', |
|||
z.zoneName, |
|||
'-', |
|||
d.warehouseArea, |
|||
'\n', |
|||
r.rackCode |
|||
) AS title, |
|||
SUM(bookCount) - SUM(realCount) AS surplusNumber, |
|||
SUM(bookCount) AS totalNumber, |
|||
SUM(loseCount) AS lossNumber, |
|||
SUM(lossCount) AS damageNumber, |
|||
SUM(profitCount) AS profitNumber, |
|||
SUM(realCount) AS actualNumber |
|||
FROM |
|||
wms_inventory_checkbill_detail d |
|||
LEFT JOIN wms_warehouse_rack r ON d.warehouseRackSid = r.sid |
|||
LEFT JOIN wms_warehouse_zone z on z.sid = r.zoneSid |
|||
LEFT JOIN wms_inventory_checkbill c |
|||
ON d.billSid = c.sid |
|||
<where> ${ew.sqlSegment} </where> |
|||
SELECT |
|||
c.sid, |
|||
d.warehouseRackSid AS houseSid, |
|||
CONCAT( |
|||
d.warehouseName, |
|||
'-', |
|||
z.zoneName, |
|||
'-', |
|||
d.warehouseArea, |
|||
'\n', |
|||
r.rackCode |
|||
) AS title, |
|||
SUM(bookCount) - SUM(realCount) AS surplusNumber, |
|||
SUM(bookCount) AS totalNumber, |
|||
SUM(loseCount) AS lossNumber, |
|||
SUM(lossCount) AS damageNumber, |
|||
SUM(profitCount) AS profitNumber, |
|||
SUM(realCount) AS actualNumber |
|||
FROM |
|||
wms_inventory_checkbill_detail d |
|||
LEFT JOIN wms_warehouse_rack r ON d.warehouseRackSid = r.sid |
|||
LEFT JOIN wms_warehouse_zone z on z.sid = r.zoneSid |
|||
LEFT JOIN wms_inventory_checkbill c |
|||
ON d.billSid = c.sid |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selPyByDeptSid" resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitin.InventoryBillVo"> |
|||
SELECT |
|||
wc.sid AS billSid, |
|||
wc.billNo |
|||
FROM |
|||
wms_inventory_checkbill wc |
|||
JOIN |
|||
(SELECT |
|||
SUM(wd.profitCount) AS total, |
|||
wd.billSid AS billSid |
|||
FROM |
|||
wms_inventory_checkbill_detail wd |
|||
GROUP BY wd.billSid) AS total_goods |
|||
WHERE wc.deptSid = #{deptSid} |
|||
AND wc.warehouseTypeKey = #{warehouseTypeKey} |
|||
AND total_goods.billSid = wc.sid |
|||
AND total_goods.total > 0 |
|||
AND wc.checkState = 2 |
|||
</select> |
|||
<select id="selPyByDeptSid" resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitin.InventoryBillVo"> |
|||
SELECT wc.sid AS billSid, |
|||
wc.billNo |
|||
FROM wms_inventory_checkbill wc |
|||
JOIN |
|||
(SELECT SUM(wd.profitCount) AS total, |
|||
wd.billSid AS billSid |
|||
FROM wms_inventory_checkbill_detail wd |
|||
GROUP BY wd.billSid) AS total_goods |
|||
WHERE wc.deptSid = #{deptSid} |
|||
AND wc.warehouseTypeKey = #{warehouseTypeKey} |
|||
AND total_goods.billSid = wc.sid |
|||
AND total_goods.total > 0 |
|||
AND wc.checkState = 2 |
|||
</select> |
|||
|
|||
<select id="selPkByDeptSid" resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitin.InventoryBillVo"> |
|||
SELECT |
|||
wc.sid AS billSid, |
|||
wc.billNo |
|||
FROM |
|||
wms_inventory_checkbill wc |
|||
JOIN |
|||
(SELECT |
|||
SUM(wd.loseCount) AS total, |
|||
wd.billSid AS billSid |
|||
FROM |
|||
wms_inventory_checkbill_detail wd |
|||
GROUP BY wd.billSid) AS total_goods |
|||
WHERE wc.deptSid = #{deptSid} |
|||
AND wc.warehouseTypeKey = #{warehouseTypeKey} |
|||
AND total_goods.billSid = wc.sid |
|||
AND total_goods.total > 0 |
|||
AND wc.checkState = 2 |
|||
</select> |
|||
<select id="selPkByDeptSid" resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitin.InventoryBillVo"> |
|||
SELECT wc.sid AS billSid, |
|||
wc.billNo |
|||
FROM wms_inventory_checkbill wc |
|||
JOIN |
|||
(SELECT SUM(wd.loseCount) AS total, |
|||
wd.billSid AS billSid |
|||
FROM wms_inventory_checkbill_detail wd |
|||
GROUP BY wd.billSid) AS total_goods |
|||
WHERE wc.deptSid = #{deptSid} |
|||
AND wc.warehouseTypeKey = #{warehouseTypeKey} |
|||
AND total_goods.billSid = wc.sid |
|||
AND total_goods.total > 0 |
|||
AND wc.checkState = 2 |
|||
</select> |
|||
|
|||
<select id="getToDoNum" resultType="java.lang.Integer"> |
|||
SELECT |
|||
COUNT(1) |
|||
FROM |
|||
(SELECT |
|||
c.sid, |
|||
d.warehouseRackSid AS houseSid, |
|||
CONCAT( |
|||
d.warehouseName, |
|||
'-', |
|||
z.zoneName, |
|||
'-', |
|||
d.warehouseArea, |
|||
'\n', |
|||
r.rackCode |
|||
) AS title, |
|||
SUM(bookCount) - SUM(realCount) AS surplusNumber, |
|||
SUM(bookCount) AS totalNumber, |
|||
SUM(loseCount) AS lossNumber, |
|||
SUM(lossCount) AS damageNumber, |
|||
SUM(profitCount) AS profitNumber, |
|||
SUM(realCount) AS actualNumber |
|||
FROM |
|||
wms_inventory_checkbill_detail d |
|||
LEFT JOIN wms_warehouse_rack r |
|||
ON d.warehouseRackSid = r.sid |
|||
LEFT JOIN wms_warehouse_zone z |
|||
ON z.sid = r.zoneSid |
|||
LEFT JOIN wms_inventory_checkbill c |
|||
ON d.billSid = c.sid |
|||
WHERE ( |
|||
c.createBySid = #{userSid} |
|||
AND c.checkState = 1 |
|||
AND c.warehouseTypeKey = 01 |
|||
) |
|||
GROUP BY d.warehouseRackSid) TOTAL |
|||
</select> |
|||
</mapper> |
@ -1,162 +1,174 @@ |
|||
<?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.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
<select id="selByMainSid" |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
<select id="selByMainSid" |
|||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailDetailsVo"> |
|||
SELECT |
|||
wicd.*, |
|||
wicd.goodsModel as carModel, |
|||
wicd.goodsSid as goodsSpuSid, |
|||
wicd.goodsName as goodsSpuName, |
|||
wicd.goodsCode as goodsSkuCode |
|||
FROM |
|||
wms_inventory_checkbill_detail wicd |
|||
LEFT JOIN wms_inventory wi |
|||
ON wicd.inventorySid = wi.`sid` |
|||
WHERE billSid = #{billSid} |
|||
</select> |
|||
SELECT wicd.*, |
|||
wicd.goodsModel as carModel, |
|||
wicd.goodsSid as goodsSpuSid, |
|||
wicd.goodsName as goodsSpuName, |
|||
wicd.goodsCode as goodsSkuCode |
|||
FROM wms_inventory_checkbill_detail wicd |
|||
LEFT JOIN wms_inventory wi |
|||
ON wicd.inventorySid = wi.`sid` |
|||
WHERE billSid = #{billSid} |
|||
</select> |
|||
|
|||
<select id="reportSumTotal" |
|||
<select id="reportSumTotal" |
|||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo"> |
|||
SELECT |
|||
IFNULL(SUM(wicd.bookCount),0) AS ypNum, |
|||
IFNULL(SUM(wicd.bookCount * cost) ,0) AS ypMoney, |
|||
IFNULL(SUM(wicd.realCount),0) AS spNum, |
|||
IFNULL(SUM(wicd.realCount * cost),0) AS spMoney, |
|||
IFNULL(SUM(wicd.profitCount),0) AS pyNum, |
|||
IFNULL(SUM(wicd.profitCount * cost),0) AS pyMoney, |
|||
IFNULL(SUM(wicd.loseCount),0) AS pkNum, |
|||
IFNULL(SUM(wicd.loseCount * cost),0) AS pkMoney, |
|||
IFNULL(SUM(lossCount),0) AS psNum, |
|||
IFNULL(SUM(lossCount * cost),0) AS psMoney |
|||
FROM |
|||
wms_inventory_checkbill_detail AS wicd |
|||
WHERE wicd.billSid = #{billSid} |
|||
GROUP BY wicd.billSid |
|||
</select> |
|||
SELECT IFNULL(SUM(wicd.bookCount), 0) AS ypNum, |
|||
IFNULL(SUM(wicd.bookCount * cost), 0) AS ypMoney, |
|||
IFNULL(SUM(wicd.realCount), 0) AS spNum, |
|||
IFNULL(SUM(wicd.realCount * cost), 0) AS spMoney, |
|||
IFNULL(SUM(wicd.profitCount), 0) AS pyNum, |
|||
IFNULL(SUM(wicd.profitCount * cost), 0) AS pyMoney, |
|||
IFNULL(SUM(wicd.loseCount), 0) AS pkNum, |
|||
IFNULL(SUM(wicd.loseCount * cost), 0) AS pkMoney, |
|||
IFNULL(SUM(lossCount), 0) AS psNum, |
|||
IFNULL(SUM(lossCount * cost), 0) AS psMoney |
|||
FROM wms_inventory_checkbill_detail AS wicd |
|||
WHERE wicd.billSid = #{billSid} |
|||
GROUP BY wicd.billSid |
|||
</select> |
|||
|
|||
<select id="reportSumWare" |
|||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo"> |
|||
SELECT |
|||
wicd.warehouseName, |
|||
IFNULL(SUM(wicd.bookCount),0) AS ypNum, |
|||
IFNULL(SUM(wicd.bookCount * cost) ,0) AS ypMoney, |
|||
IFNULL(SUM(wicd.realCount),0) AS spNum, |
|||
IFNULL(SUM(wicd.realCount * cost),0) AS spMoney, |
|||
IFNULL(SUM(wicd.profitCount),0) AS pyNum, |
|||
IFNULL(SUM(wicd.profitCount * cost),0) AS pyMoney, |
|||
IFNULL(SUM(wicd.loseCount),0) AS pkNum, |
|||
IFNULL(SUM(wicd.loseCount * cost),0) AS pkMoney, |
|||
IFNULL(SUM(lossCount),0) AS psNum, |
|||
IFNULL(SUM(lossCount * cost),0) AS psMoney |
|||
FROM |
|||
wms_inventory_checkbill_detail AS wicd |
|||
WHERE wicd.billSid = #{billSid} |
|||
GROUP BY wicd.warehouseSid |
|||
</select> |
|||
<select id="reportSumWare" |
|||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo"> |
|||
SELECT wicd.warehouseName, |
|||
IFNULL(SUM(wicd.bookCount), 0) AS ypNum, |
|||
IFNULL(SUM(wicd.bookCount * cost), 0) AS ypMoney, |
|||
IFNULL(SUM(wicd.realCount), 0) AS spNum, |
|||
IFNULL(SUM(wicd.realCount * cost), 0) AS spMoney, |
|||
IFNULL(SUM(wicd.profitCount), 0) AS pyNum, |
|||
IFNULL(SUM(wicd.profitCount * cost), 0) AS pyMoney, |
|||
IFNULL(SUM(wicd.loseCount), 0) AS pkNum, |
|||
IFNULL(SUM(wicd.loseCount * cost), 0) AS pkMoney, |
|||
IFNULL(SUM(lossCount), 0) AS psNum, |
|||
IFNULL(SUM(lossCount * cost), 0) AS psMoney |
|||
FROM wms_inventory_checkbill_detail AS wicd |
|||
WHERE wicd.billSid = #{billSid} |
|||
GROUP BY wicd.warehouseSid |
|||
</select> |
|||
|
|||
<select id="reportSumArea" |
|||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo"> |
|||
SELECT |
|||
CONCAT( |
|||
wicd.warehouseName, |
|||
'-', |
|||
wicd.warehouseArea |
|||
) AS warehouseAreaeName, |
|||
IFNULL(SUM(wicd.bookCount),0) AS ypNum, |
|||
IFNULL(SUM(wicd.bookCount * cost) ,0) AS ypMoney, |
|||
IFNULL(SUM(wicd.realCount),0) AS spNum, |
|||
IFNULL(SUM(wicd.realCount * cost),0) AS spMoney, |
|||
IFNULL(SUM(wicd.profitCount),0) AS pyNum, |
|||
IFNULL(SUM(wicd.profitCount * cost),0) AS pyMoney, |
|||
IFNULL(SUM(wicd.loseCount),0) AS pkNum, |
|||
IFNULL(SUM(wicd.loseCount * cost),0) AS pkMoney, |
|||
IFNULL(SUM(lossCount),0) AS psNum, |
|||
IFNULL(SUM(lossCount * cost),0) AS psMoney |
|||
FROM |
|||
wms_inventory_checkbill_detail AS wicd |
|||
WHERE wicd.billSid = #{billSid} |
|||
GROUP BY wicd.warehouseAreaSid |
|||
</select> |
|||
<select id="reportSumArea" |
|||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo"> |
|||
SELECT CONCAT( |
|||
wicd.warehouseName, |
|||
'-', |
|||
wz.zoneName, |
|||
'-', |
|||
wicd.warehouseArea |
|||
) AS warehouseAreaeName, |
|||
IFNULL(SUM(wicd.bookCount), 0) AS ypNum, |
|||
IFNULL(SUM(wicd.bookCount * cost), 0) AS ypMoney, |
|||
IFNULL(SUM(wicd.realCount), 0) AS spNum, |
|||
IFNULL(SUM(wicd.realCount * cost), 0) AS spMoney, |
|||
IFNULL(SUM(wicd.profitCount), 0) AS pyNum, |
|||
IFNULL(SUM(wicd.profitCount * cost), 0) AS pyMoney, |
|||
IFNULL(SUM(wicd.loseCount), 0) AS pkNum, |
|||
IFNULL(SUM(wicd.loseCount * cost), 0) AS pkMoney, |
|||
IFNULL(SUM(lossCount), 0) AS psNum, |
|||
IFNULL(SUM(lossCount * cost), 0) AS psMoney |
|||
FROM wms_inventory_checkbill_detail AS wicd |
|||
LEFT JOIN wms_warehouse_zone AS wz |
|||
ON wz.warehouseSid = wicd.warehouseSid |
|||
WHERE wicd.billSid = #{billSid} |
|||
GROUP BY wicd.warehouseAreaSid |
|||
</select> |
|||
|
|||
<update id="saveInventoryInfoZC"> |
|||
update wms_inventory_checkbill_detail set lossCount = #{dto.badNum},realCount = #{dto.num},profitCount = 0,loseCount = 0,remarks = #{dto.remarks},state = 2 where sid = #{dto.sid} |
|||
</update> |
|||
<update id="saveInventoryInfoZC"> |
|||
update wms_inventory_checkbill_detail |
|||
set lossCount = #{dto.badNum}, |
|||
realCount = #{dto.num}, |
|||
profitCount = 0, |
|||
loseCount = 0, |
|||
remarks = #{dto.remarks}, |
|||
state = 2 |
|||
where sid = #{dto.sid} |
|||
</update> |
|||
|
|||
<update id="saveInventoryInfoPY"> |
|||
update wms_inventory_checkbill_detail set lossCount = #{dto.badNum},realCount = #{dto.num},profitCount = #{pyCount},loseCount = 0,remarks = #{dto.remarks},state = 3 where sid = #{dto.sid} |
|||
</update> |
|||
<update id="saveInventoryInfoPY"> |
|||
update wms_inventory_checkbill_detail |
|||
set lossCount = #{dto.badNum}, |
|||
realCount = #{dto.num}, |
|||
profitCount = #{pyCount}, |
|||
loseCount = 0, |
|||
remarks = #{dto.remarks}, |
|||
state = 3 |
|||
where sid = #{dto.sid} |
|||
</update> |
|||
|
|||
<update id="saveInventoryInfoPK"> |
|||
update wms_inventory_checkbill_detail set lossCount = #{dto.badNum},realCount = #{dto.num},profitCount = 0,loseCount = #{pkCount},remarks = #{dto.remarks},state = 4 where sid = #{dto.sid} |
|||
</update> |
|||
<update id="saveInventoryInfoPK"> |
|||
update wms_inventory_checkbill_detail |
|||
set lossCount = #{dto.badNum}, |
|||
realCount = #{dto.num}, |
|||
profitCount = 0, |
|||
loseCount = #{pkCount}, |
|||
remarks = #{dto.remarks}, |
|||
state = 4 |
|||
where sid = #{dto.sid} |
|||
</update> |
|||
|
|||
<select id="scan" resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.HandleBean"> |
|||
SELECT |
|||
lossCount AS badNum, |
|||
goodsID, |
|||
goodsSkuTitle AS goodsName, |
|||
goodsSkuCode, |
|||
bookCount AS lockNum, |
|||
realCount AS num, |
|||
remarks, |
|||
sid, |
|||
unit |
|||
FROM |
|||
wms_inventory_checkbill_detail |
|||
WHERE billSid = #{sid} |
|||
AND goodsID = #{content} |
|||
AND warehouseRackSid = #{houseSid} |
|||
</select> |
|||
<select id="scan" resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.HandleBean"> |
|||
SELECT IF(lossCount IS NULL, 0, lossCount) AS badNum, |
|||
goodsID, |
|||
goodsSkuTitle AS goodsName, |
|||
goodsSkuCode, |
|||
bookCount AS lockNum, |
|||
realCount AS num, |
|||
remarks, |
|||
sid, |
|||
unit |
|||
FROM wms_inventory_checkbill_detail |
|||
WHERE billSid = #{sid} |
|||
AND goodsID = #{content} |
|||
AND warehouseRackSid = #{houseSid} |
|||
</select> |
|||
|
|||
<select id="sourceBillBySid" resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitindetail.WmsInventoryProfitinDetailDto"> |
|||
SELECT |
|||
goodsSpuSid AS goodsSid, |
|||
goodsSpuName, |
|||
goodsSkuSid, |
|||
goodsSkuTitle AS goodsName, |
|||
goodsSkuCode AS goodsCode, |
|||
goodsSkuOwnSpec AS goodsSpec, |
|||
manufacturerSid, |
|||
manufacturerName, |
|||
unit, |
|||
profitCount AS pyNum, |
|||
supplierSid, |
|||
supplierName, |
|||
profitCount AS inStorageNum |
|||
FROM |
|||
wms_inventory_checkbill_detail |
|||
WHERE billSid = #{sid} |
|||
AND profitCount > 0 |
|||
</select> |
|||
<select id="sourceBillBySid" |
|||
resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitindetail.WmsInventoryProfitinDetailDto"> |
|||
SELECT goodsSpuSid AS goodsSid, |
|||
goodsSpuName, |
|||
goodsSkuSid, |
|||
goodsSkuTitle AS goodsName, |
|||
goodsSkuCode AS goodsCode, |
|||
goodsSkuOwnSpec AS goodsSpec, |
|||
manufacturerSid, |
|||
manufacturerName, |
|||
unit, |
|||
profitCount AS pyNum, |
|||
supplierSid, |
|||
supplierName, |
|||
profitCount AS inStorageNum |
|||
FROM wms_inventory_checkbill_detail |
|||
WHERE billSid = #{sid} |
|||
AND profitCount > 0 |
|||
</select> |
|||
|
|||
<select id="sourceBillPkBySid" |
|||
resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitoutdetail.WmsInventoryProfitoutDetailDto"> |
|||
SELECT |
|||
d.goodsID, |
|||
d.goodsSpuSid AS goodsSid, |
|||
d.goodsSpuName, |
|||
d.goodsSkuSid, |
|||
d.goodsSkuTitle AS goodsName, |
|||
d.goodsSkuCode AS goodsCode, |
|||
d.goodsSkuOwnSpec AS goodsSpec, |
|||
d.manufacturerSid, |
|||
d.manufacturerName, |
|||
d.unit, |
|||
d.loseCount AS pKNum, |
|||
d.warehouseSid, |
|||
d.warehouseName, |
|||
d.warehouseRackSid, |
|||
d.warehouseRackName, |
|||
d.loseCount AS outStorageNum, |
|||
w.cost AS inStoragePrice |
|||
FROM |
|||
wms_inventory_checkbill_detail d |
|||
LEFT JOIN wms_inventory w |
|||
ON d.goodsID = w.goodsID |
|||
WHERE billSid = #{sid} |
|||
AND loseCount > 0 |
|||
</select> |
|||
<select id="sourceBillPkBySid" |
|||
resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitoutdetail.WmsInventoryProfitoutDetailDto"> |
|||
SELECT d.goodsID, |
|||
d.goodsSpuSid AS goodsSid, |
|||
d.goodsSpuName, |
|||
d.goodsSkuSid, |
|||
d.goodsSkuTitle AS goodsName, |
|||
d.goodsSkuCode AS goodsCode, |
|||
d.goodsSkuOwnSpec AS goodsSpec, |
|||
d.manufacturerSid, |
|||
d.manufacturerName, |
|||
d.unit, |
|||
d.loseCount AS pKNum, |
|||
d.warehouseSid, |
|||
d.warehouseName, |
|||
d.warehouseRackSid, |
|||
d.warehouseRackName, |
|||
d.loseCount AS outStorageNum, |
|||
w.cost AS inStoragePrice |
|||
FROM wms_inventory_checkbill_detail d |
|||
LEFT JOIN wms_inventory w |
|||
ON d.goodsID = w.goodsID |
|||
WHERE billSid = #{sid} |
|||
AND loseCount > 0 |
|||
</select> |
|||
</mapper> |
Loading…
Reference in new issue