库存货位查询

pro
anthonywj 2 years ago
parent e1c80c5360
commit be5f16b38d

@ -87,6 +87,7 @@ public class IdcServiceImpl implements IdcService {
private ScheduledDao scheduledDao; private ScheduledDao scheduledDao;
private String imagePath = FileConstant.COMMON_FILE_PATH; private String imagePath = FileConstant.COMMON_FILE_PATH;
/*获取拉取任务列表*/ /*获取拉取任务列表*/
@Override @Override
public BaseResponse taskList(HttpServletRequest request, Map<String, Object> params) { public BaseResponse taskList(HttpServletRequest request, Map<String, Object> params) {
@ -245,8 +246,7 @@ public class IdcServiceImpl implements IdcService {
/*上传失败重新上传*/ /*上传失败重新上传*/
private void asyncFailTask(String host) { private void asyncFailTask(String host) {
try try {
{
String filePathSlash = filePath.substring(filePath.length() - 1).equals("/") ? "" : "/"; String filePathSlash = filePath.substring(filePath.length() - 1).equals("/") ? "" : "/";
String sql = "select * from basic_export_status where status='1' and receiveStatus='0' where updateTime<date_sub(now(),interval 6 minute) order by updateTime"; String sql = "select * from basic_export_status where status='1' and receiveStatus='0' where updateTime<date_sub(now(),interval 6 minute) order by updateTime";
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
@ -1208,8 +1208,7 @@ public class IdcServiceImpl implements IdcService {
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
} }
} }
if (!(total > 0)) { if (!(total > 0)) {
@ -1357,8 +1356,6 @@ public class IdcServiceImpl implements IdcService {
} }
/*把列数据转Map*/ /*把列数据转Map*/
private Map<String, Object> getColumn(String tableName) { private Map<String, Object> getColumn(String tableName) {
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
@ -1465,6 +1462,7 @@ public class IdcServiceImpl implements IdcService {
} }
} }
private void writeFile(byte[] file, String filePath, String fileName) throws Exception { private void writeFile(byte[] file, String filePath, String fileName) throws Exception {
File targetFile = new File(filePath); File targetFile = new File(filePath);
if (!targetFile.exists()) { if (!targetFile.exists()) {

@ -104,6 +104,8 @@ public class HeartService {
@Resource @Resource
IoOrderInvoiceService orderInvoiceService; IoOrderInvoiceService orderInvoiceService;
@Resource
IoOrderInvoiceMapper ioOrderInvoiceMapper;
private final ApplicationContext applicationContext; private final ApplicationContext applicationContext;
//上传最近更新扫码单据 //上传最近更新扫码单据
@ -1396,6 +1398,7 @@ public class HeartService {
String fileFullPath = writeFile(filePrefix, NEW_ALL_ORDER, response.getData()); String fileFullPath = writeFile(filePrefix, NEW_ALL_ORDER, response.getData());
basicDownloadStatusEntity.setCacheFilePath(fileFullPath); basicDownloadStatusEntity.setCacheFilePath(fileFullPath);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace();
throw new RuntimeException(e); throw new RuntimeException(e);
} }
@ -1625,8 +1628,6 @@ public class HeartService {
private final IoCodeLostMapper ioCodeLostMapper; private final IoCodeLostMapper ioCodeLostMapper;
private final IoCodeRelMapper ioCodeRelMapper; private final IoCodeRelMapper ioCodeRelMapper;
@Resource
private final IoOrderInvoiceMapper ioOrderInvoiceMapper;
/** /**
* *
@ -1902,7 +1903,7 @@ public class HeartService {
List<IoOrderInvoiceEntity> orderInvoiceEntities = syncDataResponse.getOrderInvoiceEntities(); List<IoOrderInvoiceEntity> orderInvoiceEntities = syncDataResponse.getOrderInvoiceEntities();
for (IoOrderInvoiceEntity orderInvoiceEntity : orderInvoiceEntities) { for (IoOrderInvoiceEntity orderInvoiceEntity : orderInvoiceEntities) {
if (orderInvoiceEntity.getOrderIdFk().equals(orderEntity.getBillNo())) { if (orderInvoiceEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
orderInvoiceService.insertInvoice(orderInvoiceEntity); ioOrderInvoiceMapper.insertOrUpdate(orderInvoiceEntity);
} }
} }
} }

@ -230,8 +230,7 @@
</select> </select>
<select id="filterSpaceList" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse"> <select id="filterSpaceList" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse">
SELECT SELECT t1.nameCode,
t1.nameCode,
t1.relId, t1.relId,
(SELECT NAME FROM auth_dept WHERE auth_dept.`code` = t1.deptCode) AS deptName, (SELECT NAME FROM auth_dept WHERE auth_dept.`code` = t1.deptCode) AS deptName,
(SELECT NAME FROM auth_warehouse WHERE auth_warehouse.`code` = t1.invCode) AS invName, (SELECT NAME FROM auth_warehouse WHERE auth_warehouse.`code` = t1.invCode) AS invName,
@ -247,8 +246,7 @@
bp.ylqxzcrbarmc, bp.ylqxzcrbarmc,
bp.manufactory, bp.manufactory,
(SELECT `name` FROM basic_corp WHERE erpId = t1.supId) supName (SELECT `name` FROM basic_corp WHERE erpId = t1.supId) supName
FROM FROM inv_prein_product_detail t1
inv_prein_product_detail t1
LEFT JOIN basic_udirel bu ON bu.id = t1.relId LEFT JOIN basic_udirel bu ON bu.id = t1.relId
LEFT JOIN basic_products bp ON bp.uuid = bu.uuid LEFT JOIN basic_products bp ON bp.uuid = bu.uuid
<where> <where>
@ -261,8 +259,7 @@
AND t1.invSpaceCode = #{invSpaceCode} AND t1.invSpaceCode = #{invSpaceCode}
</if> </if>
</where> </where>
GROUP BY GROUP BY CODE,
CODE,
invSpaceCode invSpaceCode
</select> </select>
@ -285,9 +282,9 @@
ad.name deptName, ad.name deptName,
aw.name invName, aw.name invName,
sp.name invSpaceName, sp.name invSpaceName,
sum(pd.inCount) as inCount, ifnull(sum(pd.inCount), 0) as inCount,
sum(pd.outCount) as outCount, ifnull(sum(pd.outCount), 0) as outCount,
sum(pd.reCount) as reCount pd.inCount - pd.outCount as reCount
from inv_prein_product_detail pd from inv_prein_product_detail pd
left join basic_udirel bu on pd.relId = bu.id left join basic_udirel bu on pd.relId = bu.id
left join basic_products bp on bp.uuid = bu.uuid left join basic_products bp on bp.uuid = bu.uuid

@ -223,18 +223,14 @@
</select> </select>
<select id="getInventoryQuantity" resultType="Integer"> <select id="getInventoryQuantity" resultType="Integer">
SELECT ifnull(SUM(inCount), 0) - ifnull(SUM(outCount), 0) SELECT ifnull(SUM(inCount), 0) - ifnull(SUM(outCount), 0)
FROM FROM inv_pre_product_detail ipd
inv_pre_product_detail ipd WHERE CODE = #{code}
WHERE
CODE = #{code}
and (invSpaceCode is null or invSpaceCode = '') and (invSpaceCode is null or invSpaceCode = '')
</select> </select>
<select id="filterSpaceList" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse"> <select id="filterSpaceList" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse">
SELECT SELECT t1.nameCode,
t1.nameCode,
t1.relId, t1.relId,
(SELECT NAME FROM auth_dept WHERE auth_dept.`code` = t1.deptCode) AS deptName, (SELECT NAME FROM auth_dept WHERE auth_dept.`code` = t1.deptCode) AS deptName,
(SELECT NAME FROM auth_warehouse WHERE auth_warehouse.`code` = t1.invCode) AS invName, (SELECT NAME FROM auth_warehouse WHERE auth_warehouse.`code` = t1.invCode) AS invName,
@ -250,8 +246,7 @@
bp.ylqxzcrbarmc, bp.ylqxzcrbarmc,
bp.manufactory, bp.manufactory,
(SELECT `name` FROM basic_corp WHERE erpId = t1.supId) supName (SELECT `name` FROM basic_corp WHERE erpId = t1.supId) supName
FROM FROM inv_pre_product_detail t1
inv_pre_product_detail t1
LEFT JOIN basic_udirel bu ON bu.id = t1.relId LEFT JOIN basic_udirel bu ON bu.id = t1.relId
LEFT JOIN basic_products bp ON bp.uuid = bu.uuid LEFT JOIN basic_products bp ON bp.uuid = bu.uuid
<where> <where>
@ -262,8 +257,7 @@
AND t1.invSpaceCode = #{invSpaceCode} AND t1.invSpaceCode = #{invSpaceCode}
</if> </if>
</where> </where>
GROUP BY GROUP BY CODE,
CODE,
invSpaceCode invSpaceCode
</select> </select>
@ -286,9 +280,9 @@
ad.name deptName, ad.name deptName,
aw.name invName, aw.name invName,
sp.name invSpaceName, sp.name invSpaceName,
sum(pd.inCount) as inCount, ifnull(sum(pd.inCount), 0) as inCount,
sum(pd.outCount) as outCount, ifnull(sum(pd.outCount), 0) as outCount,
sum(pd.reCount) as reCount pd.inCount - pd.outCount as reCount
from inv_pre_product_detail pd from inv_pre_product_detail pd
left join basic_udirel bu on pd.relId = bu.id left join basic_udirel bu on pd.relId = bu.id
left join basic_products bp on bp.uuid = bu.uuid left join basic_products bp on bp.uuid = bu.uuid

@ -14,9 +14,9 @@
ipp.expireDate, ipp.expireDate,
bp.ylqxzcrbarmc, bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh, bp.zczbhhzbapzbh,
sum(ipp.inCount) as inCount, ifnull(sum(ipp.inCount), 0) as inCount,
sum(ipp.outCount) as outCount, ifnull(sum(ipp.outCount), 0) as outCount,
sum(ipp.reCount) as reCount, ipp.inCount - ipp.outCount as reCount,
basic_corp.name supName, basic_corp.name supName,
ipp.supId, ipp.supId,
auth_dept.name deptName, auth_dept.name deptName,
@ -345,18 +345,14 @@
</select> </select>
<select id="getInventoryQuantity" resultType="Integer"> <select id="getInventoryQuantity" resultType="Integer">
SELECT ifnull(SUM(inCount), 0) - ifnull(SUM(outCount), 0) SELECT ifnull(SUM(inCount), 0) - ifnull(SUM(outCount), 0)
FROM FROM inv_product_detail ipd
inv_product_detail ipd WHERE CODE = #{code}
WHERE
CODE = #{code}
and (invSpaceCode is null or invSpaceCode = '') and (invSpaceCode is null or invSpaceCode = '')
</select> </select>
<select id="filterSpaceList" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse"> <select id="filterSpaceList" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse">
SELECT SELECT t1.nameCode,
t1.nameCode,
t1.relId, t1.relId,
(SELECT NAME FROM auth_dept WHERE auth_dept.`code` = t1.deptCode) AS deptName, (SELECT NAME FROM auth_dept WHERE auth_dept.`code` = t1.deptCode) AS deptName,
(SELECT NAME FROM auth_warehouse WHERE auth_warehouse.`code` = t1.invCode) AS invName, (SELECT NAME FROM auth_warehouse WHERE auth_warehouse.`code` = t1.invCode) AS invName,
@ -372,8 +368,7 @@
bp.ylqxzcrbarmc, bp.ylqxzcrbarmc,
bp.manufactory, bp.manufactory,
(SELECT `name` FROM basic_corp WHERE erpId = t1.supId) supName (SELECT `name` FROM basic_corp WHERE erpId = t1.supId) supName
FROM FROM inv_product_detail t1
inv_product_detail t1
LEFT JOIN basic_udirel bu ON bu.id = t1.relId LEFT JOIN basic_udirel bu ON bu.id = t1.relId
LEFT JOIN basic_products bp ON bp.uuid = bu.uuid LEFT JOIN basic_products bp ON bp.uuid = bu.uuid
<where> <where>
@ -384,8 +379,7 @@
AND t1.invSpaceCode = #{invSpaceCode} AND t1.invSpaceCode = #{invSpaceCode}
</if> </if>
</where> </where>
GROUP BY GROUP BY CODE,
CODE,
invSpaceCode invSpaceCode
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save