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" ?> |
<?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.yxt.wms.biz.inventory.wmsinventorycheckbill.WmsInventoryCheckbillMapper"> |
<mapper namespace="com.yxt.wms.biz.inventory.wmsinventorycheckbill.WmsInventoryCheckbillMapper"> |
||||
<!-- <where> ${ew.sqlSegment} </where>--> |
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
<!-- ${ew.customSqlSegment} --> |
<!-- ${ew.customSqlSegment} --> |
||||
<select id="selectPageVo" resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbill.WmsInventoryCheckbillVo"> |
<select id="selectPageVo" resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbill.WmsInventoryCheckbillVo"> |
||||
SELECT |
SELECT |
||||
wic.sid, |
wic.sid, |
||||
wic.state, |
wic.state, |
||||
wic.`remarks`, |
wic.remarks, |
||||
wic.`nodeState`, |
wic.nodeState, |
||||
wic.`deptName`, |
wic.deptName, |
||||
wic.`billNo`, |
wic.billNo, |
||||
wic.`createTime`, |
wic.createTime, |
||||
wic.`createByName`, |
wic.createByName, |
||||
wic.`superviseName`, |
wic.superviseName, |
||||
IF( |
IF( |
||||
wic.`checkState` = '1', |
wic.checkState = '1', |
||||
'盘点中', |
'盘点中', |
||||
'盘点完成' |
'盘点完成' |
||||
) AS checkState, |
) AS checkState, |
||||
wic.`procDefId`, |
wic.procDefId, |
||||
wic.`procInstId`, |
wic.procInstId, |
||||
SUM(wicd.bookCount) AS bookCount, |
SUM(wicd.bookCount) AS bookCount, |
||||
SUM(wicd.bookCount * cost) AS bookAmount, |
SUM(wicd.bookCount * cost) AS bookAmount, |
||||
SUM(wicd.realCount) AS realCount, |
SUM(wicd.realCount) AS realCount, |
||||
SUM(wicd.realCount * cost) AS realAmount, |
SUM(wicd.realCount * cost) AS realAmount, |
||||
SUM(wicd.bookCount) - SUM(wicd.realCount) AS notCount, |
SUM(wicd.bookCount) - SUM(wicd.realCount) AS notCount, |
||||
( |
( |
||||
SUM(wicd.bookCount * cost) - SUM(wicd.realCount * cost) |
SUM(wicd.bookCount * cost) - SUM(wicd.realCount * cost) |
||||
) AS notAmount, |
) AS notAmount, |
||||
SUM(wicd.profitCount) AS profitCount, |
SUM(wicd.profitCount) AS profitCount, |
||||
SUM(wicd.profitCount * cost) AS profitAmount, |
SUM(wicd.profitCount * cost) AS profitAmount, |
||||
SUM(wicd.loseCount) AS loseCount, |
SUM(wicd.loseCount) AS loseCount, |
||||
SUM(wicd.loseCount * cost) AS loseAmount, |
SUM(wicd.loseCount * cost) AS loseAmount, |
||||
SUM(wicd.lossCount) AS lossCount, |
SUM(wicd.lossCount) AS lossCount, |
||||
SUM(wicd.lossCount * cost) AS lossAmount |
SUM(wicd.lossCount * cost) AS lossAmount |
||||
FROM |
FROM |
||||
wms_inventory_checkbill wic |
wms_inventory_checkbill wic |
||||
LEFT JOIN wms_inventory_checkbill_detail wicd |
LEFT JOIN wms_inventory_checkbill_detail wicd |
||||
ON wic.sid = wicd.`billSid` |
ON wic.sid = wicd.billSid |
||||
LEFT JOIN anrui_portal.sys_organization AS s |
LEFT JOIN anrui_portal.sys_organization AS s |
||||
ON wic.deptSid = s.sid |
ON wic.deptSid = s.sid |
||||
<where> ${ew.sqlSegment} </where> |
<where> |
||||
</select> |
${ew.sqlSegment} |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
<select id="detailRackPageList" |
<select id="detailRackPageList" |
||||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailRackPageListVo"> |
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailRackPageListVo"> |
||||
SELECT |
SELECT |
||||
billSid, |
billSid, |
||||
warehouseName, |
warehouseName, |
||||
warehouseArea, |
warehouseArea, |
||||
warehouseRackSid, |
warehouseRackSid, |
||||
warehouseRackName, |
warehouseRackName, |
||||
SUM(bookCount) AS bookCount, |
SUM(bookCount) AS bookCount, |
||||
SUM(bookCount * cost) AS bookAmount, |
SUM(bookCount * cost) AS bookAmount, |
||||
SUM(realCount) AS realCount, |
SUM(realCount) AS realCount, |
||||
SUM(realCount * cost) AS realAmount, |
SUM(realCount * cost) AS realAmount, |
||||
SUM(bookCount) - SUM(realCount) AS notCount, |
SUM(bookCount) - SUM(realCount) AS notCount, |
||||
(SUM(bookCount * cost) - SUM(realCount * cost)) AS notAmount, |
(SUM(bookCount * cost) - SUM(realCount * cost)) AS notAmount, |
||||
SUM(profitCount) AS profitCount, |
SUM(profitCount) AS profitCount, |
||||
SUM(profitCount * cost) AS profitAmount, |
SUM(profitCount * cost) AS profitAmount, |
||||
SUM(loseCount) AS loseCount, |
SUM(loseCount) AS loseCount, |
||||
SUM(loseCount * cost) AS loseAmount, |
SUM(loseCount * cost) AS loseAmount, |
||||
SUM(lossCount) AS lossCount, |
SUM(lossCount) AS lossCount, |
||||
SUM(lossCount * cost) AS lossAmount |
SUM(lossCount * cost) AS lossAmount |
||||
FROM |
FROM |
||||
wms_inventory_checkbill_detail |
wms_inventory_checkbill_detail |
||||
<where> ${ew.sqlSegment} </where> |
<where> |
||||
</select> |
${ew.sqlSegment} |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
<select id="detailGoodPageList" |
<select id="detailGoodPageList" |
||||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailGoodPageListVo"> |
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailGoodPageListVo"> |
||||
SELECT |
SELECT |
||||
goodsID, |
goodsID, |
||||
goodsSkuTitle, |
goodsSkuTitle, |
||||
goodsSkuCode, |
goodsSkuCode, |
||||
warehouseName, |
warehouseName, |
||||
warehouseArea, |
warehouseArea, |
||||
warehouseRackName, |
warehouseRackName, |
||||
unit, |
unit, |
||||
cost, |
cost, |
||||
bookCount, |
bookCount, |
||||
bookCount * cost AS bookAmount, |
bookCount * cost AS bookAmount, |
||||
realCount, |
realCount, |
||||
realCount * cost AS realAmount, |
realCount * cost AS realAmount, |
||||
CASE |
CASE |
||||
state |
state |
||||
WHEN 2 |
WHEN 2 |
||||
THEN '正常' |
THEN '正常' |
||||
WHEN 3 |
WHEN 3 |
||||
THEN '盘盈' |
THEN '盘盈' |
||||
WHEN 4 |
WHEN 4 |
||||
THEN '盘亏' |
THEN '盘亏' |
||||
END AS state, |
END AS state, |
||||
CASE |
CASE |
||||
state |
state |
||||
WHEN 2 |
WHEN 2 |
||||
THEN 0 |
THEN 0 |
||||
WHEN 3 |
WHEN 3 |
||||
THEN profitCount |
THEN profitCount |
||||
WHEN 4 |
WHEN 4 |
||||
THEN loseCount |
THEN loseCount |
||||
END AS profitAndLoseCount, |
END AS profitAndLoseCount, |
||||
CASE |
CASE |
||||
state |
state |
||||
WHEN 2 |
WHEN 2 |
||||
THEN 0 |
THEN 0 |
||||
WHEN 3 |
WHEN 3 |
||||
THEN profitCount * cost |
THEN profitCount * cost |
||||
WHEN 4 |
WHEN 4 |
||||
THEN loseCount * cost |
THEN loseCount * cost |
||||
END AS profitAndLoseAmount, |
END AS profitAndLoseAmount, |
||||
lossCount, |
lossCount, |
||||
lossCount * cost AS lossAmount, |
lossCount * cost AS lossAmount, |
||||
remarks |
remarks |
||||
FROM |
FROM |
||||
wms_inventory_checkbill_detail |
wms_inventory_checkbill_detail |
||||
<where> ${ew.sqlSegment} </where> |
<where> |
||||
</select> |
${ew.sqlSegment} |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
<select id="detailRackGoodPageList" |
<select id="detailRackGoodPageList" |
||||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailRackGoodPageListVo"> |
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailRackGoodPageListVo"> |
||||
SELECT |
SELECT |
||||
sid, |
sid, |
||||
goodsID, |
goodsID, |
||||
goodsSkuTitle, |
goodsSkuTitle, |
||||
goodsSkuCode, |
goodsSkuCode, |
||||
warehouseName, |
warehouseName, |
||||
warehouseArea, |
warehouseArea, |
||||
warehouseRackName, |
warehouseRackName, |
||||
unit, |
unit, |
||||
cost, |
cost, |
||||
bookCount, |
bookCount, |
||||
bookCount * cost AS bookAmount, |
bookCount * cost AS bookAmount, |
||||
realCount, |
realCount, |
||||
realCount * cost AS realAmount, |
realCount * cost AS realAmount, |
||||
CASE |
CASE |
||||
state |
state |
||||
WHEN 2 |
WHEN 2 |
||||
THEN '正常' |
THEN '正常' |
||||
WHEN 3 |
WHEN 3 |
||||
THEN '盘盈' |
THEN '盘盈' |
||||
WHEN 4 |
WHEN 4 |
||||
THEN '盘亏' |
THEN '盘亏' |
||||
END AS state, |
END AS state, |
||||
CASE |
CASE |
||||
state |
state |
||||
WHEN 2 |
WHEN 2 |
||||
THEN 0 |
THEN 0 |
||||
WHEN 3 |
WHEN 3 |
||||
THEN profitCount |
THEN profitCount |
||||
WHEN 4 |
WHEN 4 |
||||
THEN loseCount |
THEN loseCount |
||||
END AS profitAndLoseCount, |
END AS profitAndLoseCount, |
||||
CASE |
CASE |
||||
state |
state |
||||
WHEN 2 |
WHEN 2 |
||||
THEN 0 |
THEN 0 |
||||
WHEN 3 |
WHEN 3 |
||||
THEN profitCount * cost |
THEN profitCount * cost |
||||
WHEN 4 |
WHEN 4 |
||||
THEN loseCount * cost |
THEN loseCount * cost |
||||
END AS profitAndLoseAmount, |
END AS profitAndLoseAmount, |
||||
lossCount, |
lossCount, |
||||
lossCount * cost AS lossAmount, |
lossCount * cost AS lossAmount, |
||||
remarks |
remarks |
||||
FROM |
FROM |
||||
wms_inventory_checkbill_detail |
wms_inventory_checkbill_detail |
||||
<where> ${ew.sqlSegment} </where> |
<where> |
||||
</select> |
${ew.sqlSegment} |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
<select id="selectNum" resultType="java.lang.String"> |
<select id="selectNum" resultType="java.lang.String"> |
||||
select RIGHT (billNo, 4) |
select RIGHT (billNo, 4) |
||||
from wms_inventory_checkbill |
from wms_inventory_checkbill |
||||
where billNo LIKE concat(#{billNo}, '%') |
where billNo LIKE concat(#{billNo}, '%') |
||||
order by billNo desc |
order by billNo desc |
||||
limit 1 |
limit 1 |
||||
</select> |
</select> |
||||
|
|
||||
<select id="selectBySid" resultType="int"> |
<select id="selectBySid" resultType="int"> |
||||
SELECT COUNT(*) |
SELECT COUNT(*) |
||||
FROM wms_inventory_checkbill |
FROM wms_inventory_checkbill |
||||
WHERE nodeState != '待提交' |
WHERE nodeState != '待提交' |
||||
and find_in_set(sid, #{list}) |
and find_in_set(sid, #{list}) |
||||
</select> |
</select> |
||||
|
|
||||
<select id="checkState" resultType="java.lang.String"> |
<select id="checkState" resultType="java.lang.String"> |
||||
SELECT |
SELECT checkState |
||||
checkState |
FROM wms_inventory_checkbill |
||||
FROM |
WHERE deptSid = #{deptSid} |
||||
wms_inventory_checkbill |
AND warehouseTypeKey = #{warehouseTypeKey} |
||||
WHERE deptSid = #{deptSid} |
ORDER BY createTime DESC LIMIT 1 |
||||
AND warehouseTypeKey = #{warehouseTypeKey} |
</select> |
||||
ORDER BY createTime DESC |
|
||||
LIMIT 1 |
|
||||
</select> |
|
||||
|
|
||||
<update id="updateFlowFiled"> |
<update id="updateFlowFiled"> |
||||
UPDATE wms_inventory_checkbill |
UPDATE wms_inventory_checkbill |
||||
SET nodeState=#{nodeState}, nodeId=#{taskDefKey} |
SET nodeState=#{nodeState}, nodeId=#{taskDefKey} |
||||
<if test="nodeState == '已办结' or nodeState == '终止'"> |
<if test="nodeState == '已办结' or nodeState == '终止'"> |
||||
, finishTime = NOW() |
, finishTime = NOW() |
||||
</if> |
</if> |
||||
<if test="procDefId != null and procDefId != ''"> |
<if test="procDefId != null and procDefId != ''"> |
||||
, procDefId=#{procDefId} |
, procDefId=#{procDefId} |
||||
</if> |
</if> |
||||
<if test="procInsId != null and procInsId != ''"> |
<if test="procInsId != null and procInsId != ''"> |
||||
, procInstId=#{procInsId} |
, procInstId=#{procInsId} |
||||
</if> |
</if> |
||||
<if test="taskId != null and taskId != ''"> |
<if test="taskId != null and taskId != ''"> |
||||
, taskId=#{taskId} |
, taskId=#{taskId} |
||||
</if> |
</if> |
||||
WHERE sid=#{sid} |
WHERE sid=#{sid} |
||||
</update> |
</update> |
||||
|
|
||||
<select id="appDetailRackPageList" |
<select id="appDetailRackPageList" |
||||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillPageVo"> |
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillPageVo"> |
||||
SELECT |
SELECT |
||||
c.sid, |
c.sid, |
||||
d.warehouseRackSid AS houseSid, |
d.warehouseRackSid AS houseSid, |
||||
CONCAT( |
CONCAT( |
||||
d.warehouseName, |
d.warehouseName, |
||||
'-', |
'-', |
||||
z.zoneName, |
z.zoneName, |
||||
'-', |
'-', |
||||
d.warehouseArea, |
d.warehouseArea, |
||||
'\n', |
'\n', |
||||
r.rackCode |
r.rackCode |
||||
) AS title, |
) AS title, |
||||
SUM(bookCount) - SUM(realCount) AS surplusNumber, |
SUM(bookCount) - SUM(realCount) AS surplusNumber, |
||||
SUM(bookCount) AS totalNumber, |
SUM(bookCount) AS totalNumber, |
||||
SUM(loseCount) AS lossNumber, |
SUM(loseCount) AS lossNumber, |
||||
SUM(lossCount) AS damageNumber, |
SUM(lossCount) AS damageNumber, |
||||
SUM(profitCount) AS profitNumber, |
SUM(profitCount) AS profitNumber, |
||||
SUM(realCount) AS actualNumber |
SUM(realCount) AS actualNumber |
||||
FROM |
FROM |
||||
wms_inventory_checkbill_detail d |
wms_inventory_checkbill_detail d |
||||
LEFT JOIN wms_warehouse_rack r ON d.warehouseRackSid = r.sid |
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_warehouse_zone z on z.sid = r.zoneSid |
||||
LEFT JOIN wms_inventory_checkbill c |
LEFT JOIN wms_inventory_checkbill c |
||||
ON d.billSid = c.sid |
ON d.billSid = c.sid |
||||
<where> ${ew.sqlSegment} </where> |
<where> |
||||
|
${ew.sqlSegment} |
||||
|
</where> |
||||
</select> |
</select> |
||||
|
|
||||
<select id="selPyByDeptSid" resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitin.InventoryBillVo"> |
<select id="selPyByDeptSid" resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitin.InventoryBillVo"> |
||||
SELECT |
SELECT wc.sid AS billSid, |
||||
wc.sid AS billSid, |
wc.billNo |
||||
wc.billNo |
FROM wms_inventory_checkbill wc |
||||
FROM |
JOIN |
||||
wms_inventory_checkbill wc |
(SELECT SUM(wd.profitCount) AS total, |
||||
JOIN |
wd.billSid AS billSid |
||||
(SELECT |
FROM wms_inventory_checkbill_detail wd |
||||
SUM(wd.profitCount) AS total, |
GROUP BY wd.billSid) AS total_goods |
||||
wd.billSid AS billSid |
WHERE wc.deptSid = #{deptSid} |
||||
FROM |
AND wc.warehouseTypeKey = #{warehouseTypeKey} |
||||
wms_inventory_checkbill_detail wd |
AND total_goods.billSid = wc.sid |
||||
GROUP BY wd.billSid) AS total_goods |
AND total_goods.total > 0 |
||||
WHERE wc.deptSid = #{deptSid} |
AND wc.checkState = 2 |
||||
AND wc.warehouseTypeKey = #{warehouseTypeKey} |
</select> |
||||
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 id="selPkByDeptSid" resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitin.InventoryBillVo"> |
||||
SELECT |
SELECT wc.sid AS billSid, |
||||
wc.sid AS billSid, |
wc.billNo |
||||
wc.billNo |
FROM wms_inventory_checkbill wc |
||||
FROM |
JOIN |
||||
wms_inventory_checkbill wc |
(SELECT SUM(wd.loseCount) AS total, |
||||
JOIN |
wd.billSid AS billSid |
||||
(SELECT |
FROM wms_inventory_checkbill_detail wd |
||||
SUM(wd.loseCount) AS total, |
GROUP BY wd.billSid) AS total_goods |
||||
wd.billSid AS billSid |
WHERE wc.deptSid = #{deptSid} |
||||
FROM |
AND wc.warehouseTypeKey = #{warehouseTypeKey} |
||||
wms_inventory_checkbill_detail wd |
AND total_goods.billSid = wc.sid |
||||
GROUP BY wd.billSid) AS total_goods |
AND total_goods.total > 0 |
||||
WHERE wc.deptSid = #{deptSid} |
AND wc.checkState = 2 |
||||
AND wc.warehouseTypeKey = #{warehouseTypeKey} |
</select> |
||||
AND total_goods.billSid = wc.sid |
|
||||
AND total_goods.total > 0 |
<select id="getToDoNum" resultType="java.lang.Integer"> |
||||
AND wc.checkState = 2 |
SELECT |
||||
</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> |
</mapper> |
@ -1,162 +1,174 @@ |
|||||
<?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.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailMapper"> |
<mapper namespace="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailMapper"> |
||||
<!-- <where> ${ew.sqlSegment} </where>--> |
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
<!-- ${ew.customSqlSegment} --> |
<!-- ${ew.customSqlSegment} --> |
||||
<select id="selByMainSid" |
<select id="selByMainSid" |
||||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailDetailsVo"> |
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailDetailsVo"> |
||||
SELECT |
SELECT wicd.*, |
||||
wicd.*, |
wicd.goodsModel as carModel, |
||||
wicd.goodsModel as carModel, |
wicd.goodsSid as goodsSpuSid, |
||||
wicd.goodsSid as goodsSpuSid, |
wicd.goodsName as goodsSpuName, |
||||
wicd.goodsName as goodsSpuName, |
wicd.goodsCode as goodsSkuCode |
||||
wicd.goodsCode as goodsSkuCode |
FROM wms_inventory_checkbill_detail wicd |
||||
FROM |
LEFT JOIN wms_inventory wi |
||||
wms_inventory_checkbill_detail wicd |
ON wicd.inventorySid = wi.`sid` |
||||
LEFT JOIN wms_inventory wi |
WHERE billSid = #{billSid} |
||||
ON wicd.inventorySid = wi.`sid` |
</select> |
||||
WHERE billSid = #{billSid} |
|
||||
</select> |
|
||||
|
|
||||
<select id="reportSumTotal" |
<select id="reportSumTotal" |
||||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo"> |
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo"> |
||||
SELECT |
SELECT IFNULL(SUM(wicd.bookCount), 0) AS ypNum, |
||||
IFNULL(SUM(wicd.bookCount),0) AS ypNum, |
IFNULL(SUM(wicd.bookCount * cost), 0) AS ypMoney, |
||||
IFNULL(SUM(wicd.bookCount * cost) ,0) AS ypMoney, |
IFNULL(SUM(wicd.realCount), 0) AS spNum, |
||||
IFNULL(SUM(wicd.realCount),0) AS spNum, |
IFNULL(SUM(wicd.realCount * cost), 0) AS spMoney, |
||||
IFNULL(SUM(wicd.realCount * cost),0) AS spMoney, |
IFNULL(SUM(wicd.profitCount), 0) AS pyNum, |
||||
IFNULL(SUM(wicd.profitCount),0) AS pyNum, |
IFNULL(SUM(wicd.profitCount * cost), 0) AS pyMoney, |
||||
IFNULL(SUM(wicd.profitCount * cost),0) AS pyMoney, |
IFNULL(SUM(wicd.loseCount), 0) AS pkNum, |
||||
IFNULL(SUM(wicd.loseCount),0) AS pkNum, |
IFNULL(SUM(wicd.loseCount * cost), 0) AS pkMoney, |
||||
IFNULL(SUM(wicd.loseCount * cost),0) AS pkMoney, |
IFNULL(SUM(lossCount), 0) AS psNum, |
||||
IFNULL(SUM(lossCount),0) AS psNum, |
IFNULL(SUM(lossCount * cost), 0) AS psMoney |
||||
IFNULL(SUM(lossCount * cost),0) AS psMoney |
FROM wms_inventory_checkbill_detail AS wicd |
||||
FROM |
WHERE wicd.billSid = #{billSid} |
||||
wms_inventory_checkbill_detail AS wicd |
GROUP BY wicd.billSid |
||||
WHERE wicd.billSid = #{billSid} |
</select> |
||||
GROUP BY wicd.billSid |
|
||||
</select> |
|
||||
|
|
||||
<select id="reportSumWare" |
<select id="reportSumWare" |
||||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo"> |
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo"> |
||||
SELECT |
SELECT wicd.warehouseName, |
||||
wicd.warehouseName, |
IFNULL(SUM(wicd.bookCount), 0) AS ypNum, |
||||
IFNULL(SUM(wicd.bookCount),0) AS ypNum, |
IFNULL(SUM(wicd.bookCount * cost), 0) AS ypMoney, |
||||
IFNULL(SUM(wicd.bookCount * cost) ,0) AS ypMoney, |
IFNULL(SUM(wicd.realCount), 0) AS spNum, |
||||
IFNULL(SUM(wicd.realCount),0) AS spNum, |
IFNULL(SUM(wicd.realCount * cost), 0) AS spMoney, |
||||
IFNULL(SUM(wicd.realCount * cost),0) AS spMoney, |
IFNULL(SUM(wicd.profitCount), 0) AS pyNum, |
||||
IFNULL(SUM(wicd.profitCount),0) AS pyNum, |
IFNULL(SUM(wicd.profitCount * cost), 0) AS pyMoney, |
||||
IFNULL(SUM(wicd.profitCount * cost),0) AS pyMoney, |
IFNULL(SUM(wicd.loseCount), 0) AS pkNum, |
||||
IFNULL(SUM(wicd.loseCount),0) AS pkNum, |
IFNULL(SUM(wicd.loseCount * cost), 0) AS pkMoney, |
||||
IFNULL(SUM(wicd.loseCount * cost),0) AS pkMoney, |
IFNULL(SUM(lossCount), 0) AS psNum, |
||||
IFNULL(SUM(lossCount),0) AS psNum, |
IFNULL(SUM(lossCount * cost), 0) AS psMoney |
||||
IFNULL(SUM(lossCount * cost),0) AS psMoney |
FROM wms_inventory_checkbill_detail AS wicd |
||||
FROM |
WHERE wicd.billSid = #{billSid} |
||||
wms_inventory_checkbill_detail AS wicd |
GROUP BY wicd.warehouseSid |
||||
WHERE wicd.billSid = #{billSid} |
</select> |
||||
GROUP BY wicd.warehouseSid |
|
||||
</select> |
|
||||
|
|
||||
<select id="reportSumArea" |
<select id="reportSumArea" |
||||
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo"> |
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo"> |
||||
SELECT |
SELECT CONCAT( |
||||
CONCAT( |
wicd.warehouseName, |
||||
wicd.warehouseName, |
'-', |
||||
'-', |
wz.zoneName, |
||||
wicd.warehouseArea |
'-', |
||||
) AS warehouseAreaeName, |
wicd.warehouseArea |
||||
IFNULL(SUM(wicd.bookCount),0) AS ypNum, |
) AS warehouseAreaeName, |
||||
IFNULL(SUM(wicd.bookCount * cost) ,0) AS ypMoney, |
IFNULL(SUM(wicd.bookCount), 0) AS ypNum, |
||||
IFNULL(SUM(wicd.realCount),0) AS spNum, |
IFNULL(SUM(wicd.bookCount * cost), 0) AS ypMoney, |
||||
IFNULL(SUM(wicd.realCount * cost),0) AS spMoney, |
IFNULL(SUM(wicd.realCount), 0) AS spNum, |
||||
IFNULL(SUM(wicd.profitCount),0) AS pyNum, |
IFNULL(SUM(wicd.realCount * cost), 0) AS spMoney, |
||||
IFNULL(SUM(wicd.profitCount * cost),0) AS pyMoney, |
IFNULL(SUM(wicd.profitCount), 0) AS pyNum, |
||||
IFNULL(SUM(wicd.loseCount),0) AS pkNum, |
IFNULL(SUM(wicd.profitCount * cost), 0) AS pyMoney, |
||||
IFNULL(SUM(wicd.loseCount * cost),0) AS pkMoney, |
IFNULL(SUM(wicd.loseCount), 0) AS pkNum, |
||||
IFNULL(SUM(lossCount),0) AS psNum, |
IFNULL(SUM(wicd.loseCount * cost), 0) AS pkMoney, |
||||
IFNULL(SUM(lossCount * cost),0) AS psMoney |
IFNULL(SUM(lossCount), 0) AS psNum, |
||||
FROM |
IFNULL(SUM(lossCount * cost), 0) AS psMoney |
||||
wms_inventory_checkbill_detail AS wicd |
FROM wms_inventory_checkbill_detail AS wicd |
||||
WHERE wicd.billSid = #{billSid} |
LEFT JOIN wms_warehouse_zone AS wz |
||||
GROUP BY wicd.warehouseAreaSid |
ON wz.warehouseSid = wicd.warehouseSid |
||||
</select> |
WHERE wicd.billSid = #{billSid} |
||||
|
GROUP BY wicd.warehouseAreaSid |
||||
|
</select> |
||||
|
|
||||
<update id="saveInventoryInfoZC"> |
<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 wms_inventory_checkbill_detail |
||||
</update> |
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 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 wms_inventory_checkbill_detail |
||||
</update> |
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 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 wms_inventory_checkbill_detail |
||||
</update> |
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 id="scan" resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.HandleBean"> |
||||
SELECT |
SELECT IF(lossCount IS NULL, 0, lossCount) AS badNum, |
||||
lossCount AS badNum, |
goodsID, |
||||
goodsID, |
goodsSkuTitle AS goodsName, |
||||
goodsSkuTitle AS goodsName, |
goodsSkuCode, |
||||
goodsSkuCode, |
bookCount AS lockNum, |
||||
bookCount AS lockNum, |
realCount AS num, |
||||
realCount AS num, |
remarks, |
||||
remarks, |
sid, |
||||
sid, |
unit |
||||
unit |
FROM wms_inventory_checkbill_detail |
||||
FROM |
WHERE billSid = #{sid} |
||||
wms_inventory_checkbill_detail |
AND goodsID = #{content} |
||||
WHERE billSid = #{sid} |
AND warehouseRackSid = #{houseSid} |
||||
AND goodsID = #{content} |
</select> |
||||
AND warehouseRackSid = #{houseSid} |
|
||||
</select> |
|
||||
|
|
||||
<select id="sourceBillBySid" resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitindetail.WmsInventoryProfitinDetailDto"> |
<select id="sourceBillBySid" |
||||
SELECT |
resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitindetail.WmsInventoryProfitinDetailDto"> |
||||
goodsSpuSid AS goodsSid, |
SELECT goodsSpuSid AS goodsSid, |
||||
goodsSpuName, |
goodsSpuName, |
||||
goodsSkuSid, |
goodsSkuSid, |
||||
goodsSkuTitle AS goodsName, |
goodsSkuTitle AS goodsName, |
||||
goodsSkuCode AS goodsCode, |
goodsSkuCode AS goodsCode, |
||||
goodsSkuOwnSpec AS goodsSpec, |
goodsSkuOwnSpec AS goodsSpec, |
||||
manufacturerSid, |
manufacturerSid, |
||||
manufacturerName, |
manufacturerName, |
||||
unit, |
unit, |
||||
profitCount AS pyNum, |
profitCount AS pyNum, |
||||
supplierSid, |
supplierSid, |
||||
supplierName, |
supplierName, |
||||
profitCount AS inStorageNum |
profitCount AS inStorageNum |
||||
FROM |
FROM wms_inventory_checkbill_detail |
||||
wms_inventory_checkbill_detail |
WHERE billSid = #{sid} |
||||
WHERE billSid = #{sid} |
AND profitCount > 0 |
||||
AND profitCount > 0 |
</select> |
||||
</select> |
|
||||
|
|
||||
<select id="sourceBillPkBySid" |
<select id="sourceBillPkBySid" |
||||
resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitoutdetail.WmsInventoryProfitoutDetailDto"> |
resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitoutdetail.WmsInventoryProfitoutDetailDto"> |
||||
SELECT |
SELECT d.goodsID, |
||||
d.goodsID, |
d.goodsSpuSid AS goodsSid, |
||||
d.goodsSpuSid AS goodsSid, |
d.goodsSpuName, |
||||
d.goodsSpuName, |
d.goodsSkuSid, |
||||
d.goodsSkuSid, |
d.goodsSkuTitle AS goodsName, |
||||
d.goodsSkuTitle AS goodsName, |
d.goodsSkuCode AS goodsCode, |
||||
d.goodsSkuCode AS goodsCode, |
d.goodsSkuOwnSpec AS goodsSpec, |
||||
d.goodsSkuOwnSpec AS goodsSpec, |
d.manufacturerSid, |
||||
d.manufacturerSid, |
d.manufacturerName, |
||||
d.manufacturerName, |
d.unit, |
||||
d.unit, |
d.loseCount AS pKNum, |
||||
d.loseCount AS pKNum, |
d.warehouseSid, |
||||
d.warehouseSid, |
d.warehouseName, |
||||
d.warehouseName, |
d.warehouseRackSid, |
||||
d.warehouseRackSid, |
d.warehouseRackName, |
||||
d.warehouseRackName, |
d.loseCount AS outStorageNum, |
||||
d.loseCount AS outStorageNum, |
w.cost AS inStoragePrice |
||||
w.cost AS inStoragePrice |
FROM wms_inventory_checkbill_detail d |
||||
FROM |
LEFT JOIN wms_inventory w |
||||
wms_inventory_checkbill_detail d |
ON d.goodsID = w.goodsID |
||||
LEFT JOIN wms_inventory w |
WHERE billSid = #{sid} |
||||
ON d.goodsID = w.goodsID |
AND loseCount > 0 |
||||
WHERE billSid = #{sid} |
</select> |
||||
AND loseCount > 0 |
|
||||
</select> |
|
||||
</mapper> |
</mapper> |
Loading…
Reference in new issue