bug修改

busUser
anthonywj 2 years ago
parent 97a48dfa1b
commit 9c49f5ed8e

@ -37,6 +37,8 @@ public class StockOrderUploadController {
*/
@GetMapping("/udiwms/stock/order/upload/filter")
public BaseResponse filter(StockOrderUploadRequest request) {
// 已验收单据才能上传
request.setOrderStatus("5");
List<StockOrderEntity> list = stockOrderService.filter(request);
PageInfo<StockOrderEntity> pageInfo = new PageInfo<>(list);
List<StockOrderResponse> responses = new ArrayList<>();

@ -46,5 +46,5 @@ public class StockOrderDetailEntity {
private String measname;
private String supId;
private Integer realCount;
}

@ -75,4 +75,6 @@ public class ErpOrderEntity {
private String code;
private Integer codeId;
private Integer realCount;
}

@ -2,6 +2,8 @@ package com.glxp.api.admin.res.inventory;
import lombok.Data;
import java.util.Date;
@Data
public class InvProductResponse {
private Integer id;
@ -28,6 +30,10 @@ public class InvProductResponse {
private String price;
private String orderIdFk;
private Date auditTime;
private Date createTime;
public Integer getInCount() {
if (inCount == null)
return 0;

@ -921,7 +921,8 @@ public class IoTransInoutService {
OrderEntity preInEntity = orderService.findById(key);
preInEntity.setPreOutBillNo(orderEntity.getId());
orderService.updateOrder(preInEntity);
if (bussinessTypeEntity.isPreInBack()) { //预验收带回
BussinessTypeEntity preBusType = bussinessTypeService.findBTByAction(preInEntity.getAction());
if (preBusType.isPreInBack()) { //预验收带回
invPreInProductService.deleteByOrderIdFk(preInEntity.getId());
invPreInProductDetailService.deleteByOrderIdFk(preInEntity.getId());
} else {

@ -104,7 +104,7 @@ public class OrderSubmitTask implements SchedulingConfigurer {
}
if (curTime1 - lastTime1 > timeInterval1) {
submitOrder(syncUploadDataSetEntity);
submitProducts();
// submitProducts();
redisUtil.set(Constant.LAST_THIRD_UPLOAD_TIME, curTime1);
}

@ -6,7 +6,7 @@
resultType="com.glxp.api.admin.entity.business.StockOrderEntity">
SELECT *
FROM stock_order
INNER JOIN inv_warehouse_user on stock_order.locStorageCode = inv_warehouse_user.`code`
INNER JOIN inv_warehouse_user on stock_order.locStorageCode = inv_warehouse_user.`code`
where status = 'success'
group by stock_order.id
</select>
@ -15,7 +15,7 @@
resultType="com.glxp.api.admin.entity.business.StockOrderEntity">
select *
from stock_order
INNER JOIN inv_warehouse_user on stock_order.locStorageCode = inv_warehouse_user.`code`
INNER JOIN inv_warehouse_user on stock_order.locStorageCode = inv_warehouse_user.`code`
where `status` = '101'
group by stock_order.id
ORDER BY id DESC
@ -166,14 +166,14 @@
auth_dept.name deptName,
auth_user.employeeName reviewUserName
FROM stock_order
left join basic_bustype_local on stock_order.billType = basic_bustype_local.action
LEFT JOIN inv_warehouse ON stock_order.locStorageCode = inv_warehouse.`code`
LEFT JOIN inv_warehouse_sub ON stock_order.locStorageCode = inv_warehouse.`code`
LEFT JOIN inv_warehouse_sub iws ON stock_order.invWarehouseCode = iws.`code`
LEFT JOIN inv_warehouse_sub iws2 ON stock_order.fromSubInvCode = iws2.`code`
LEFT JOIN inv_warehouse_user on inv_warehouse_sub.code = inv_warehouse_user.`code`
left join auth_dept on stock_order.dept = auth_dept.code
left join auth_user on stock_order.reviewUser = auth_user.id
left join basic_bustype_local on stock_order.billType = basic_bustype_local.action
LEFT JOIN inv_warehouse ON stock_order.locStorageCode = inv_warehouse.`code`
LEFT JOIN inv_warehouse_sub ON stock_order.locStorageCode = inv_warehouse.`code`
LEFT JOIN inv_warehouse_sub iws ON stock_order.invWarehouseCode = iws.`code`
LEFT JOIN inv_warehouse_sub iws2 ON stock_order.fromSubInvCode = iws2.`code`
LEFT JOIN inv_warehouse_user on inv_warehouse_sub.code = inv_warehouse_user.`code`
left join auth_dept on stock_order.dept = auth_dept.code
left join auth_user on stock_order.reviewUser = auth_user.id
<where>
<if test="id != '' and id != null">
and stock_order.id = #{id}
@ -295,7 +295,7 @@
resultType="com.glxp.api.admin.entity.business.StockOrderEntity">
SELECT stock_order.*
FROM stock_order
INNER JOIN basic_entrust_accept on locStorageCode = basic_entrust_accept.curInv
INNER JOIN basic_entrust_accept on locStorageCode = basic_entrust_accept.curInv
<where>
<if test="status != '' and status != null">
and status = #{status}
@ -390,14 +390,14 @@
thr_products.manufactory thrManufactory
FROM stock_order
INNER JOIN stock_order_detail on stock_order.id = stock_order_detail.orderIdFk
LEFT JOIN inv_warehouse ON stock_order.locStorageCode = inv_warehouse.`code`
LEFT JOIN inv_warehouse_sub ON stock_order.invWarehouseCode = inv_warehouse_sub.`code`
LEFT JOIN inv_warehouse_user on inv_warehouse_sub.code = inv_warehouse_user.`code`
left join basic_udirel on stock_order_detail.productId = basic_udirel.id
left JOIN basic_products on basic_products.uuid = basic_udirel.uuid
left join auth_dept on stock_order.dept = auth_dept.`code`
left join thr_products on basic_udirel.mainId = thr_products.`code`
INNER JOIN stock_order_detail on stock_order.id = stock_order_detail.orderIdFk
LEFT JOIN inv_warehouse ON stock_order.locStorageCode = inv_warehouse.`code`
LEFT JOIN inv_warehouse_sub ON stock_order.invWarehouseCode = inv_warehouse_sub.`code`
LEFT JOIN inv_warehouse_user on inv_warehouse_sub.code = inv_warehouse_user.`code`
left join basic_udirel on stock_order_detail.productId = basic_udirel.id
left JOIN basic_products on basic_products.uuid = basic_udirel.uuid
left join auth_dept on stock_order.dept = auth_dept.`code`
left join thr_products on basic_udirel.mainId = thr_products.`code`
<where>
<if test="id != '' and id != null">
and stock_order.id = #{id}
@ -463,11 +463,11 @@
thr_products.registerNo thrRegisterNo,
thr_products.manufactory thrManufactory
from io_codes
INNER JOIN basic_udirel on io_codes.relId = basic_udirel.id
INNER JOIN basic_products on basic_products.uuid = basic_udirel.uuid
LEFT JOIN inv_warehouse ON io_codes.locStorageCode = inv_warehouse.`code`
left join inv_warehouse_sub on io_codes.invWarehouseCode = inv_warehouse_sub.code
left join thr_products on basic_udirel.mainId = thr_products.`code`
INNER JOIN basic_udirel on io_codes.relId = basic_udirel.id
INNER JOIN basic_products on basic_products.uuid = basic_udirel.uuid
LEFT JOIN inv_warehouse ON io_codes.locStorageCode = inv_warehouse.`code`
left join inv_warehouse_sub on io_codes.invWarehouseCode = inv_warehouse_sub.code
left join thr_products on basic_udirel.mainId = thr_products.`code`
<where>
<if test="orderId != '' and orderId != null">
and io_codes.orderId = #{orderId}
@ -483,11 +483,11 @@
FROM stock_order
WHERE (supplementNo IS NULL OR supplementNo = '')
AND billType IN (
SELECT localAction
FROM basic_bussiness_type
WHERE supplementOrderType IS NOT NULL
OR supplementOrderType
!= '')
SELECT localAction
FROM basic_bussiness_type
WHERE supplementOrderType IS NOT NULL
OR supplementOrderType
!= '')
</select>
<select id="findById" resultType="com.glxp.api.admin.entity.business.StockOrderEntity">
@ -510,14 +510,15 @@
select id
from stock_order
where billNo in (
select erpFk
from io_order
where erpFk in
(select billNo
from stock_order
where stock_order.billType in (select code from basic_third_sys_bus_api))
and exportStatus = 0 and wzUploadStatus is null
)
select erpFk
from io_order
where erpFk in
(select billNo
from stock_order
where stock_order.billType in (select code from basic_third_sys_bus_api))
and exportStatus = 0
and stock_order.status = 5
)
and stock_order.orderIdFk is not null
</select>
@ -537,10 +538,10 @@
<select id="selectUploadList" resultType="com.glxp.api.admin.entity.business.StockOrderEntity">
select t1.*
from stock_order t1
left join io_order t2 on t1.billNo = t2.erpFk
left join io_order t2 on t1.billNo = t2.erpFk
<where>
t2.erpFk is not null
and t1.orderIdFk = t2.id
and t1.orderIdFk = t2.id
<if test="request.billNo != null and request.billNo != ''">
AND ((t1.billNo like concat('%', #{request.billNo}, '%') and t2.erpFk like concat('%',
#{request.billNo},

@ -2,10 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.glxp.api.admin.dao.inventory.InvPreInProductDao">
<select id="filterInvProduct" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductRequest"
resultType="com.glxp.api.admin.entity.inventory.InvProductEntity">
SELECT * FROM inv_prein_product
SELECT *
FROM inv_prein_product
<where>
<if test="productsName != '' and productsName != null">
AND productsName = #{productsName}
@ -69,7 +69,6 @@
SELECT *
FROM inv_prein_product
WHERE id = #{id}
</select>
@ -86,7 +85,7 @@
AND supId is NULL
</if>
<if test="batchNo != '' and batchNo != null and batchNo!='empty'">
<if test="batchNo != '' and batchNo != null and batchNo != 'empty'">
AND batchNo = #{batchNo}
</if>
<if test="batchNo == 'empty'">
@ -102,7 +101,6 @@
AND invWarehouseCode = #{invWarehouseCode}
</if>
</where>
</select>
<select id="selectExit" parameterType="Map"
resultType="com.glxp.api.admin.entity.inventory.InvProductEntity">
@ -113,37 +111,56 @@
</where>
limit 1
</select>
<!-- and supId = #{supId}-->
<!-- and supId = #{supId}
sum(inv_prein_product.inCount) as inCount,
sum(inv_prein_product.outCount) as outCount,
sum(inv_prein_product.reCount) as reCount,
-->
<select id="filterJoinInvProduct" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductRequest"
resultType="com.glxp.api.admin.res.inventory.InvProductResponse">
SELECT
inv_prein_product.id,
basic_products.cpmctymc,basic_products.nameCode,inv_prein_product.relIdFk,basic_products.ggxh,
inv_prein_product.batchNo
,inv_prein_product.productionDate,inv_prein_product.expireDate,
basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh,
sum(inv_prein_product.inCount) as inCount,
sum(inv_prein_product.outCount) as outCount,
sum(inv_prein_product.reCount) as reCount, inv_prein_product.customerId,
basic_corp.name companyName,inv_prein_product.supId,inv_prein_product.unitFk ,inv_warehouse.name
invStorageName,inv_prein_product.invStorageCode,inv_prein_product.price,inv_warehouse_sub.name invSubStorageName
,inv_prein_product.invWarehouseCode,inv_prein_product.orderIdFk
SELECT inv_prein_product.id,
basic_products.cpmctymc,
basic_products.nameCode,
inv_prein_product.relIdFk,
basic_products.ggxh,
inv_prein_product.batchNo,
inv_prein_product.productionDate,
inv_prein_product.expireDate,
basic_products.ylqxzcrbarmc,
basic_products.zczbhhzbapzbh,
inv_prein_product.customerId,
basic_corp.name companyName,
inv_prein_product.supId,
inv_prein_product.unitFk,
inv_warehouse.name
invStorageName,
inv_prein_product.invStorageCode,
inv_prein_product.price,
inv_warehouse_sub.name
invSubStorageName,
inv_prein_product.invWarehouseCode,
inv_prein_product.orderIdFk,
io_order.createTime,
io_order.auditTime
FROM inv_prein_product
inner join basic_udirel on inv_prein_product.relIdFk = basic_udirel.id
inner join basic_products on basic_udirel.uuid = basic_products.uuid
left join basic_corp on inv_prein_product.supId=basic_corp.erpId
left join inv_warehouse on inv_warehouse.code=inv_prein_product.invStorageCode
left join inv_warehouse_sub on inv_warehouse_sub.code = inv_prein_product.invWarehouseCode
inner join basic_udirel on inv_prein_product.relIdFk = basic_udirel.id
inner join basic_products on basic_udirel.uuid = basic_products.uuid
left join basic_corp on inv_prein_product.supId = basic_corp.erpId
left join inv_warehouse on inv_warehouse.code = inv_prein_product.invStorageCode
left join inv_warehouse_sub on inv_warehouse_sub.code = inv_prein_product.invWarehouseCode
left join io_order on inv_prein_product.orderIdFk = io_order.id
<where>
basic_products.diType=1
basic_products.diType = 1
<if test="cpmctymc != '' and cpmctymc != null">
AND basic_products.cpmctymc like concat('%',#{cpmctymc},'%')
AND basic_products.cpmctymc like concat('%', #{cpmctymc}, '%')
</if>
<if test="productsName != null and productsName != ''">
AND basic_products.cpmctymc like concat('%',#{productsName},'%')
AND basic_products.cpmctymc like concat('%', #{productsName}, '%')
</if>
<if test="nameCode != '' and nameCode != null">
AND basic_products.nameCode like concat('%',#{nameCode},'%')
AND basic_products.nameCode like concat('%', #{nameCode}, '%')
</if>
<if test="relIdFk != '' and relIdFk != null">
AND inv_prein_product.relIdFk = #{relIdFk}
@ -156,10 +173,10 @@
</if>
<if test="ggxh != '' and ggxh != null">
AND basic_products.ggxh like concat('%',#{ggxh},'%')
AND basic_products.ggxh like concat('%', #{ggxh}, '%')
</if>
<if test="batchNo != '' and batchNo != null">
AND inv_prein_product.batchNo like concat('%',#{batchNo},'%')
AND inv_prein_product.batchNo like concat('%', #{batchNo}, '%')
</if>
<if test="productionDate != '' and productionDate != null">
AND inv_prein_product.productionDate = #{productionDate}
@ -202,21 +219,22 @@
GROUP BY #{groupType}
</if>
group by inv_prein_product.orderIdFk
order by inv_prein_product.updateTime desc
order by inv_prein_product.updateTime desc
</select>
<insert id="insertInvProduct" keyProperty="id"
parameterType="com.glxp.api.admin.entity.inventory.InvProductEntity">
insert INTO inv_prein_product
(productsName, nameCode, relIdFk, ggxh, batchNo,
productionDate, expireDate, ylqxzcrbarmc, zczbhhzbapzbh,
inCount, outCount, reCount, customerId, supId, unitFk, invStorageCode, invWarehouseCode, price, updateTime,
orderIdFk)
(productsName, nameCode, relIdFk, ggxh, batchNo,
productionDate, expireDate, ylqxzcrbarmc, zczbhhzbapzbh,
inCount, outCount, reCount, customerId, supId, unitFk, invStorageCode, invWarehouseCode, price,
updateTime,
orderIdFk)
values (#{productsName}, #{nameCode},
#{relIdFk}, #{ggxh}, #{batchNo},
#{productionDate}, #{expireDate},
#{ylqxzcrbarmc}, #{zczbhhzbapzbh},
#{inCount}, #{outCount}, #{reCount}, #{customerId}, #{supId}, #{unitFk}
, #{invStorageCode}, #{invWarehouseCode}, #{price}, #{updateTime}, #{orderIdFk})
, #{invStorageCode}, #{invWarehouseCode}, #{price}, #{updateTime}, #{orderIdFk})
</insert>
@ -241,29 +259,67 @@
<update id="updateInvProduct" parameterType="com.glxp.api.admin.entity.inventory.InvProductEntity">
UPDATE inv_prein_product
<trim prefix="set" suffixOverrides=",">
<if test="productsName != null">productsName=#{productsName},</if>
<if test="nameCode != null">nameCode=#{nameCode},</if>
<if test="relIdFk != null">relIdFk=#{relIdFk},</if>
<if test="ggxh != null">ggxh=#{ggxh},</if>
<if test="batchNo != null">batchNo=#{batchNo},</if>
<if test="productionDate != null">productionDate=#{productionDate},</if>
<if test="expireDate != null">expireDate=#{expireDate},</if>
<if test="ylqxzcrbarmc != null">ylqxzcrbarmc=#{ylqxzcrbarmc},</if>
<if test="zczbhhzbapzbh != null">zczbhhzbapzbh=#{zczbhhzbapzbh},</if>
<if test="inCount != null">inCount=#{inCount},</if>
<if test="outCount != null">outCount=#{outCount},</if>
<if test="reCount != null">reCount=#{reCount},</if>
<if test="customerId != null">customerId=#{customerId},</if>
<if test="supId != null">supId=#{supId},</if>
<if test="unitFk != null">unitFk=#{unitFk},</if>
<if test="invStorageCode != null">invStorageCode=#{invStorageCode},</if>
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
<if test="price != null">price=#{price},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="orderIdFk != null">orderIdFk=#{orderIdFk},</if>
<if test="productsName != null">
productsName=#{productsName},
</if>
<if test="nameCode != null">
nameCode=#{nameCode},
</if>
<if test="relIdFk != null">
relIdFk=#{relIdFk},
</if>
<if test="ggxh != null">
ggxh=#{ggxh},
</if>
<if test="batchNo != null">
batchNo=#{batchNo},
</if>
<if test="productionDate != null">
productionDate=#{productionDate},
</if>
<if test="expireDate != null">
expireDate=#{expireDate},
</if>
<if test="ylqxzcrbarmc != null">
ylqxzcrbarmc=#{ylqxzcrbarmc},
</if>
<if test="zczbhhzbapzbh != null">
zczbhhzbapzbh=#{zczbhhzbapzbh},
</if>
<if test="inCount != null">
inCount=#{inCount},
</if>
<if test="outCount != null">
outCount=#{outCount},
</if>
<if test="reCount != null">
reCount=#{reCount},
</if>
<if test="customerId != null">
customerId=#{customerId},
</if>
<if test="supId != null">
supId=#{supId},
</if>
<if test="unitFk != null">
unitFk=#{unitFk},
</if>
<if test="invStorageCode != null">
invStorageCode=#{invStorageCode},
</if>
<if test="invWarehouseCode != null">
invWarehouseCode=#{invWarehouseCode},
</if>
<if test="price != null">
price=#{price},
</if>
<if test="updateTime != null">
updateTime=#{updateTime},
</if>
<if test="orderIdFk != null">
orderIdFk=#{orderIdFk},
</if>
</trim>
WHERE id = #{id}
</update>
</mapper>
</mapper>

@ -40,3 +40,7 @@ create table if not exists `io_code_lost` (
CALL Pro_Temp_ColumnWork('basic_bustype_local', 'preInBack', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('stock_order_detail', 'realCount', 'int', 1);
CALL Pro_Temp_ColumnWork('io_order_detail', 'realCount', 'int', 1);

Loading…
Cancel
Save