库存仓库领用等修改

test
anthonywj 2 years ago
parent 2eb50644dc
commit 4f35b8365f

@ -180,6 +180,7 @@ public class InvWarehouseController extends BaseController {
return ResultVOUtils.error(500, "当前仓库不能为空!"); return ResultVOUtils.error(500, "当前仓库不能为空!");
} }
FilterInvSubWarehouseRequest filterInvSubWarehouseRequest = new FilterInvSubWarehouseRequest(); FilterInvSubWarehouseRequest filterInvSubWarehouseRequest = new FilterInvSubWarehouseRequest();
BeanUtils.copyProperties(filterInvWarehouseRequest, filterInvSubWarehouseRequest);
if (filterInvWarehouseRequest.getType() == null) { if (filterInvWarehouseRequest.getType() == null) {
filterInvSubWarehouseRequest.setAdvanceType(1); filterInvSubWarehouseRequest.setAdvanceType(1);
} }
@ -219,6 +220,20 @@ public class InvWarehouseController extends BaseController {
// return ResultVOUtils.error(500, "未找到!"); // return ResultVOUtils.error(500, "未找到!");
} }
/**
*
*
* @param filterInvWarehouseRequest
* @return
*/
@AuthRuleAnnotation("")
@GetMapping("spms/inv/warehouse/findLyInv")
public BaseResponse findLyInv(FilterInvSubWarehouseRequest filterInvWarehouseRequest) {
filterInvWarehouseRequest.setLyInvType(true);
List<InvWarehouseEntity> invWarehouseEntities = invWarehouseService.filterInvSubWarehouse(filterInvWarehouseRequest);
return ResultVOUtils.success(invWarehouseEntities);
}
@AuthRuleAnnotation("") @AuthRuleAnnotation("")
@GetMapping("spms/sub/inv/warehouse/filterSub") @GetMapping("spms/sub/inv/warehouse/filterSub")
@ -284,7 +299,7 @@ public class InvWarehouseController extends BaseController {
} }
InvWarehouseEntity originEntity = invWarehouseService.findByInvSubByCode(invWarehouseEntity.getCode()); InvWarehouseEntity originEntity = invWarehouseService.findByInvSubByCode(invWarehouseEntity.getCode());
if (!originEntity.getParentId().equals(invWarehouseEntity.getParentId()) || (originEntity.getParentCode() != null && !originEntity.getParentCode().equals(invWarehouseEntity.getParentCode()))) { if (!originEntity.getParentId().equals(invWarehouseEntity.getParentId()) || (StrUtil.isNotEmpty(originEntity.getParentCode()) && !originEntity.getParentCode().equals(invWarehouseEntity.getParentCode()))) {
Integer userCount = warehouseUserService.countUserBySubInvCode(invWarehouseEntity.getCode()); Integer userCount = warehouseUserService.countUserBySubInvCode(invWarehouseEntity.getCode());
if (userCount > 0) { if (userCount > 0) {
return ResultVOUtils.error(500, "修改部门或上级仓库时,请先移除该仓库关联用户!"); return ResultVOUtils.error(500, "修改部门或上级仓库时,请先移除该仓库关联用户!");

@ -242,7 +242,7 @@ public class IoOrderDetailBizController extends BaseController {
if (bussinessTypeEntity.getCheckWebNew() == 4 && bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { if (bussinessTypeEntity.getCheckWebNew() == 4 && bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
Integer count = invProductDetailService.vailStockCount(orderDetailBizEntity.getBindRlFk(), orderDetailBizEntity.getBatchNo(), orderDetailBizEntity.getSupId(), orderEntity.getDeptCode(), orderEntity.getInvCode(), null); Integer count = invProductDetailService.vailStockCount(orderDetailBizEntity.getBindRlFk(), orderDetailBizEntity.getBatchNo(), orderDetailBizEntity.getSupId(), orderEntity.getDeptCode(), orderEntity.getInvCode(), null);
count = IntUtil.value(count)-orderDetailBizEntity.getCount(); count = IntUtil.value(count) - orderDetailBizEntity.getCount();
if (count <= 0) { if (count <= 0) {
if (count == -1) { if (count == -1) {
@ -446,7 +446,7 @@ public class IoOrderDetailBizController extends BaseController {
ioOrderDetailBizEntity.setExpireDate(purReceiveDetailEntity.getExpireDate()); ioOrderDetailBizEntity.setExpireDate(purReceiveDetailEntity.getExpireDate());
ioOrderDetailBizEntity.setBatchNo(purReceiveDetailEntity.getBatchNo()); ioOrderDetailBizEntity.setBatchNo(purReceiveDetailEntity.getBatchNo());
ioOrderDetailBizEntity.setSupId(purReceiveDetailEntity.getSupId()); ioOrderDetailBizEntity.setSupId(purReceiveDetailEntity.getSupId());
ioOrderDetailBizEntity.setCount(purReceiveDetailEntity.getCount()); ioOrderDetailBizEntity.setCount(IntUtil.value(purReceiveDetailEntity.getCount()));
orderDetailBizService.insert(ioOrderDetailBizEntity); orderDetailBizService.insert(ioOrderDetailBizEntity);
} }
return ResultVOUtils.success("选入成功!"); return ResultVOUtils.success("选入成功!");

@ -116,7 +116,7 @@ public class InvPreinProductController extends BaseController {
@GetMapping("/spms/inv/pre/in/product/filterDetail") @GetMapping("/spms/inv/pre/in/product/filterDetail")
public BaseResponse filterInvPreProductDetail(FilterInvPreProductDetailRequest detailRequest) { public BaseResponse filterInvPreProductDetail(FilterInvPreProductDetailRequest detailRequest) {
if(!"".equals(detailRequest.getOrderBy())){ if (!"".equals(detailRequest.getOrderBy())) {
detailRequest.setOrderBy("updateTime"); detailRequest.setOrderBy("updateTime");
} }

@ -24,10 +24,7 @@ import com.glxp.api.service.purchase.impl.PurApplyDetailService;
import com.glxp.api.service.purchase.impl.PurApplyService; import com.glxp.api.service.purchase.impl.PurApplyService;
import com.glxp.api.service.purchase.impl.PurOrderDetailService; import com.glxp.api.service.purchase.impl.PurOrderDetailService;
import com.glxp.api.service.purchase.impl.PurPlanDetailService; import com.glxp.api.service.purchase.impl.PurPlanDetailService;
import com.glxp.api.util.CustomUtil; import com.glxp.api.util.*;
import com.glxp.api.util.MsDateUtil;
import com.glxp.api.util.GennerOrderUtils;
import com.glxp.api.util.OrderNoTypeBean;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -334,7 +331,7 @@ public class IoPurChangeService {
IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity(); IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity();
ioOrderDetailBizEntity.setOrderIdFk(ioOrderEntity.getBillNo()); ioOrderDetailBizEntity.setOrderIdFk(ioOrderEntity.getBillNo());
ioOrderDetailBizEntity.setBindRlFk(obj.getRelIdFk()); ioOrderDetailBizEntity.setBindRlFk(obj.getRelIdFk());
ioOrderDetailBizEntity.setCount(obj.getCount()); ioOrderDetailBizEntity.setCount(IntUtil.value(obj.getCount()));
ioOrderDetailBizEntity.setUuidFk(basicProductsEntity.getUuid()); ioOrderDetailBizEntity.setUuidFk(basicProductsEntity.getUuid());
ioOrderDetailBizEntity.setNameCode(basicProductsEntity.getNameCode()); ioOrderDetailBizEntity.setNameCode(basicProductsEntity.getNameCode());
ioOrderDetailBizEntity.setCoName(basicProductsEntity.getCpmctymc()); ioOrderDetailBizEntity.setCoName(basicProductsEntity.getCpmctymc());
@ -524,9 +521,9 @@ public class IoPurChangeService {
//根据单据设置时间间隔推移 //根据单据设置时间间隔推移
Date currentTime = new Date();//当前日期 Date currentTime = new Date();//当前日期
Calendar cal =Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTime(currentTime); cal.setTime(currentTime);
cal.add(Calendar.HOUR_OF_DAY,beforeTime); cal.add(Calendar.HOUR_OF_DAY, beforeTime);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//定义新的日期格式 SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//定义新的日期格式
String dateString = formatter.format(cal.getTime()); String dateString = formatter.format(cal.getTime());
Date date = null; Date date = null;

@ -157,13 +157,14 @@ public class PurOrderReceiveController extends BaseController {
@GetMapping("/udiwms/receive/order/filter") @GetMapping("/udiwms/receive/order/filter")
public BaseResponse filterReceive(FilterReceiveRequest filterReceiveRequest) { public BaseResponse filterReceive(FilterReceiveRequest filterReceiveRequest) {
if (filterReceiveRequest.getIsUser() != null && filterReceiveRequest.getIsUser()) { // if (filterReceiveRequest.getIsUser() != null && filterReceiveRequest.getIsUser()) {
AuthAdmin authAdmin = customerService.getUserBean();
filterReceiveRequest.setCreateUser(authAdmin.getId() + ""); //查询自己
}
if (filterReceiveRequest.getIsInvCode() != null && filterReceiveRequest.getIsInvCode()) {
// AuthAdmin authAdmin = customerService.getUserBean(); // AuthAdmin authAdmin = customerService.getUserBean();
filterReceiveRequest.setTargetInvCode("1000000"); // filterReceiveRequest.setCreateUser(authAdmin.getId() + ""); //查询自己
// }
if (filterReceiveRequest.getIsInvCode() != null && filterReceiveRequest.getIsInvCode()) {
AuthAdmin authAdmin = customerService.getUserBean();
filterReceiveRequest.setTargetInvCode(authAdmin.getLocInvCode());
// filterReceiveRequest.setTargetInvCode("1000000");
} }
List<ReceiveResponse> data = receiveService.filterList(filterReceiveRequest); List<ReceiveResponse> data = receiveService.filterList(filterReceiveRequest);

@ -94,6 +94,12 @@ public class InvWarehouseEntity {
@TableField(value = "updateTime") @TableField(value = "updateTime")
private Date updateTime; private Date updateTime;
/**
*
*/
@TableField(value = "lyInvType")
private Boolean lyInvType;
@TableField(exist = false) @TableField(exist = false)
public String thirdName; public String thirdName;

@ -21,4 +21,5 @@ public class FilterInvSubWarehouseRequest extends ListPageRequest {
private String key; private String key;
private Integer filterAdvanceType; private Integer filterAdvanceType;
private Boolean lyInvType;
} }

@ -3,6 +3,7 @@ package com.glxp.api.req.inv;
import com.glxp.api.util.page.ListPageRequest; import com.glxp.api.util.page.ListPageRequest;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
/** /**
@ -75,8 +76,7 @@ public class FilterInvPreProductDetailRequest extends ListPageRequest {
* *
*/ */
private String updateTime; private String updateTime;
private BigDecimal price;
} }

@ -116,4 +116,7 @@ public class FilterInvProductRequest extends ListPageRequest {
private String diCode; private String diCode;
private String basicPrductRemak1;
private String category;
} }

@ -23,4 +23,6 @@ public class InvSubWarehouseResponse {
private String parentInvName; private String parentInvName;
private Integer advanceType; private Integer advanceType;
private Boolean spUse; private Boolean spUse;
private Boolean lyInvType;
} }

@ -15,4 +15,5 @@ public class InvWarehouseThirdSysResponse {
//仓位名称 //仓位名称
private String name; private String name;
} }

@ -2,6 +2,7 @@ package com.glxp.api.res.inv;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
@ -131,5 +132,5 @@ public class InvPreProductDetailResponse {
// 货位名称 // 货位名称
private String spaceName; private String spaceName;
private BigDecimal price;
} }

@ -148,7 +148,7 @@ public class InvWarehouseServiceImpl extends ServiceImpl<InvWarehouseDao, InvWar
@Override @Override
public boolean updateInvSubWarehouse(InvWarehouseEntity invWarehouseEntity) { public boolean updateInvSubWarehouse(InvWarehouseEntity invWarehouseEntity) {
return invWarehouseDao.updateInvSubWarehouse(invWarehouseEntity); return invWarehouseDao.updateById(invWarehouseEntity)>0;
} }
@Override @Override

@ -4,7 +4,7 @@ server:
spring: spring:
datasource: datasource:
driver-class-name: com.p6spy.engine.spy.P6SpyDriver driver-class-name: com.p6spy.engine.spy.P6SpyDriver
jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_ph?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_pt?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root username: root
password: 123456 password: 123456
hikari: hikari:

@ -13,6 +13,10 @@
<if test="code != '' and code != null"> <if test="code != '' and code != null">
AND a.code = #{code} AND a.code = #{code}
</if> </if>
<if test="lyInvType != null">
AND a.lyInvType = #{lyInvType}
</if>
<if test="name != '' and name != null"> <if test="name != '' and name != null">
AND a.name like concat('%', #{name}, '%') AND a.name like concat('%', #{name}, '%')
</if> </if>
@ -83,7 +87,6 @@
INNER JOIN auth_warehouse_user on auth_warehouse.code = auth_warehouse_user.code INNER JOIN auth_warehouse_user on auth_warehouse.code = auth_warehouse_user.code
</if> </if>
<where> <where>
<if test="name != '' and name != null"> <if test="name != '' and name != null">
AND auth_warehouse.name like concat('%', #{name}, '%') AND auth_warehouse.name like concat('%', #{name}, '%')
</if> </if>
@ -210,58 +213,6 @@
WHERE parentId = #{code} WHERE parentId = #{code}
</delete> </delete>
<update id="updateInvSubWarehouse" parameterType="com.glxp.api.entity.auth.InvWarehouseEntity">
UPDATE auth_warehouse
<trim prefix="set" suffixOverrides=",">
<if test="name != null">
name=#{name},
</if>
<if test="code != null">
code=#{code},
</if>
<if test="parentId != null">
parentId=#{parentId},
</if>
<if test="remark != null">
remark=#{remark},
</if>
<if test="defaultInv != null">
defaultInv=#{defaultInv},
</if>
<if test="parentCode != null">
parentCode=#{parentCode},
</if>
<if test="thirdId != null">
thirdId=#{thirdId},
</if>
<if test="thirdId1 != null">
thirdId1=#{thirdId1},
</if>
<if test="thirdId2 != null">
thirdId2=#{thirdId2},
</if>
<if test="thirdId3 != null">
thirdId3=#{thirdId3},
</if>
<if test="thirdId4 != null">
thirdId4=#{thirdId4},
</if>
<if test="advanceType != null">
advanceType=#{advanceType},
</if>
<if test="updateTime != null">
updateTime=#{updateTime},
</if>
<if test="spUse != null">
spUse=#{spUse},
</if>
<if test="updateTime != null">
updateTime=#{updateTime},
</if>
</trim>
WHERE id = #{id}
</update>
<insert id="importInvSubWarehouse" parameterType="java.util.List"> <insert id="importInvSubWarehouse" parameterType="java.util.List">
replace replace
into auth_warehouse into auth_warehouse
@ -324,32 +275,76 @@
b.name as parentName, b.name as parentName,
a.parentCode, a.parentCode,
c.name parentInvName, c.name parentInvName,
a.spUse a.spUse,
a.lyInvType
FROM auth_warehouse a FROM auth_warehouse a
left join auth_dept b on a.parentId = b.code left join auth_dept b on a.parentId = b.code
left join auth_warehouse c on a.parentCode = c.code left join auth_warehouse c on a.parentCode = c.code
<where> <where>
<if test="id != '' and id != null"> <if test="id != '' and id != null">
AND a.id = #{id} AND a.id =
#{id}
</if> </if>
<if test="code != '' and code != null"> <if test="code != '' and code != null">
AND a.code = #{code} AND a
.
code
=
#{code}
</if> </if>
<if test="name != '' and name != null"> <if test="name != '' and name != null">
AND a.name like concat('%', #{name}, '%') AND a
.
name
like
concat
(
'%',
#{name},
'%'
)
</if> </if>
<if test="parentId != '' and parentId != null"> <if test="parentId != '' and parentId != null">
AND a.parentId = #{parentId} AND a
.
parentId
=
#{parentId}
</if> </if>
<if test="defaultInv != '' and defaultInv != null"> <if test="defaultInv != '' and defaultInv != null">
AND a.defaultInv = #{defaultInv} AND a
.
defaultInv
=
#{defaultInv}
</if> </if>
<if test="advanceType != null"> <if test="advanceType != null">
AND a.advanceType = #{advanceType} AND a
.
advanceType
=
#{advanceType}
</if> </if>
<if test="key != null and key != ''"> <if test="key != null and key != ''">
AND (a.name like concat('%', #{key}, '%') or AND (
a.code = #{key}) a
.
name
like
concat
(
'%',
#{key},
'%'
)
or
a
.
code
=
#{key}
)
</if> </if>
</where> </where>
</select> </select>

@ -41,6 +41,9 @@
<if test="batchNo == null and batchNo == ''"> <if test="batchNo == null and batchNo == ''">
AND batchNo is null AND batchNo is null
</if> </if>
<if test="price != null">
AND price = #{price}
</if>
<if test="productIdList != null and productIdList.size() != 0"> <if test="productIdList != null and productIdList.size() != 0">
AND relId in AND relId in
<foreach collection="productIdList" item="item" index="index" open="(" close=")" separator=","> <foreach collection="productIdList" item="item" index="index" open="(" close=")" separator=",">
@ -64,32 +67,32 @@
<select id="findGroupBySpace" resultType="com.glxp.api.res.inv.InvPreinProductResponse"> <select id="findGroupBySpace" resultType="com.glxp.api.res.inv.InvPreinProductResponse">
select ipp.id, select ipp.id,
ipp.nameCode, ipp.nameCode,
bp.cpmctymc, bp.cpmctymc,
ipp.relId, ipp.relId,
bp.ggxh, bp.ggxh,
ipp.batchNo, ipp.batchNo,
ipp.produceDate, ipp.produceDate,
ipp.expireDate, ipp.expireDate,
bp.ylqxzcrbarmc, bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh, bp.zczbhhzbapzbh,
ipp.inCount, ipp.inCount,
ipp.outCount, ipp.outCount,
ipp.reCount, ipp.reCount,
basic_corp.name supName, basic_corp.name supName,
ipp.supId, ipp.supId,
auth_dept.name deptName, auth_dept.name deptName,
auth_warehouse.name invName, auth_warehouse.name invName,
as.name spaceName, as.name spaceName,
ipp.deptCode, ipp.deptCode,
ipp.invCode ipp.invCode
from inv_prein_product_detail ipp from inv_prein_product_detail ipp
inner join basic_udirel on ipp.relId = basic_udirel.id inner join basic_udirel on ipp.relId = basic_udirel.id
inner join basic_products bp on basic_udirel.uuid = bp.uuid inner join basic_products bp on basic_udirel.uuid = bp.uuid
left join basic_corp on ipp.supId = basic_corp.erpId left join basic_corp on ipp.supId = basic_corp.erpId
left join auth_dept on auth_dept.code = ipp.deptCode left join auth_dept on auth_dept.code = ipp.deptCode
left join auth_warehouse on auth_warehouse.code = ipp.invCode left join auth_warehouse on auth_warehouse.code = ipp.invCode
left join auth_space `as` on ipp.code = `as`.code left join auth_space `as` on ipp.code = `as`.code
<where> <where>
<if test="cpmctymc != null and cpmctymc != ''"> <if test="cpmctymc != null and cpmctymc != ''">
AND bp.cpmctymc like concat('%', #{cpmctymc}, '%') AND bp.cpmctymc like concat('%', #{cpmctymc}, '%')
@ -166,21 +169,21 @@
</delete> </delete>
<select id="getInvProductInfo" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse"> <select id="getInvProductInfo" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse">
select ipd.code, select ipd.code,
ipd.relId, ipd.relId,
ipd.batchNo, ipd.batchNo,
ipd.serialNo, ipd.serialNo,
ipd.invSpaceCode, ipd.invSpaceCode,
ipd.invCode, ipd.invCode,
bp.cpmctymc productName, bp.cpmctymc productName,
bp.ggxh, bp.ggxh,
bp.measname, bp.measname,
bp.zczbhhzbapzbh, bp.zczbhhzbapzbh,
bp.manufactory, bp.manufactory,
(select name from auth_space s where s.code = ipd.invSpaceCode) invSpaceName, (select name from auth_space s where s.code = ipd.invSpaceCode) invSpaceName,
(select name from basic_corp bc where bc.erpId = ipd.supId) supName (select name from basic_corp bc where bc.erpId = ipd.supId) supName
from inv_prein_product_detail ipd from inv_prein_product_detail ipd
left join basic_udirel bu on bu.id = ipd.relId left join basic_udirel bu on bu.id = ipd.relId
left join basic_products bp on bp.uuid = bu.uuid left join basic_products bp on bp.uuid = bu.uuid
<where> <where>
<if test="invCode != null and invCode != ''"> <if test="invCode != null and invCode != ''">
AND ipd.invCode = #{invCode} AND ipd.invCode = #{invCode}
@ -201,7 +204,7 @@
<update id="batchBindSpace"> <update id="batchBindSpace">
update inv_prein_product_detail update inv_prein_product_detail
set invSpaceCode = #{invSpaceCode} set invSpaceCode = #{invSpaceCode}
where id in where id in
<foreach collection="ids" index="index" item="item" open="(" close=")" separator=","> <foreach collection="ids" index="index" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
@ -209,17 +212,17 @@
<select id="getInvPlaceOrderList" resultType="com.glxp.api.res.inout.IoOrderResponse"> <select id="getInvPlaceOrderList" resultType="com.glxp.api.res.inout.IoOrderResponse">
select ipd.orderId billNo, select ipd.orderId billNo,
(select name from basic_bussiness_type where action = o.action) billTypeName, (select name from basic_bussiness_type where action = o.action) billTypeName,
o.mainAction, o.mainAction,
o.fromCorp, o.fromCorp,
o.corpOrderId, o.corpOrderId,
o.fromType, o.fromType,
o.createTime, o.createTime,
o.auditTime, o.auditTime,
(select employeeName from auth_user where id = o.reviewUser) reviewUserName (select employeeName from auth_user where id = o.reviewUser) reviewUserName
from inv_prein_product_detail ipd from inv_prein_product_detail ipd
left join io_order o on ipd.orderId = o.billNo left join io_order o on ipd.orderId = o.billNo
<where> <where>
<if test="invCode != null and invCode != ''"> <if test="invCode != null and invCode != ''">
AND ipd.invCode = #{invCode} AND ipd.invCode = #{invCode}
@ -241,67 +244,67 @@
<select id="filterSpaceList" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse"> <select id="filterSpaceList" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse">
SELECT t1.nameCode, SELECT 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,
(SELECT NAME FROM auth_space WHERE auth_space.`code` = t1.invSpaceCode) AS invSpaceName, (SELECT NAME FROM auth_space WHERE auth_space.`code` = t1.invSpaceCode) AS invSpaceName,
SUM(t1.reCount) as count, SUM(t1.reCount) as count,
bp.cpmctymc as productName, bp.cpmctymc as productName,
bp.ggxh, bp.ggxh,
t1.batchNo, t1.batchNo,
t1.produceDate as productionDate, t1.produceDate as productionDate,
t1.expireDate, t1.expireDate,
bp.measname, bp.measname,
bp.zczbhhzbapzbh, bp.zczbhhzbapzbh,
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 inv_prein_product_detail t1 FROM 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>
<if test="code != null and code != ''"> <if test="code != null and code != ''">
AND t1.code = #{code} AND t1.code = #{code}
and t1.invSpaceCode IS NOT NULL and t1.invSpaceCode IS NOT NULL
and t1.invSpaceCode != '' and t1.invSpaceCode != ''
</if> </if>
<if test="invSpaceCode != null and invSpaceCode != ''"> <if test="invSpaceCode != null and invSpaceCode != ''">
AND t1.invSpaceCode = #{invSpaceCode} AND t1.invSpaceCode = #{invSpaceCode}
</if> </if>
</where> </where>
GROUP BY CODE, GROUP BY CODE,
invSpaceCode invSpaceCode
</select> </select>
<select id="findByGroupCode" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse"> <select id="findByGroupCode" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse">
select pd.id, select pd.id,
pd.code, pd.code,
pd.relId, pd.relId,
pd.batchNo, pd.batchNo,
pd.produceDate productionDate, pd.produceDate productionDate,
pd.expireDate, pd.expireDate,
bp.ggxh, bp.ggxh,
bp.cpmctymc productName, bp.cpmctymc productName,
bp.zczbhhzbapzbh, bp.zczbhhzbapzbh,
bp.ylqxzcrbarmc, bp.ylqxzcrbarmc,
bp.nameCode, bp.nameCode,
bp.manufactory, bp.manufactory,
pd.invSpaceCode, pd.invSpaceCode,
pd.invCode, pd.invCode,
ad.name deptName, ad.name deptName,
aw.name invName, aw.name invName,
sp.name invSpaceName, sp.name invSpaceName,
ifnull(sum(pd.inCount), 0) as inCount, ifnull(sum(pd.inCount), 0) as inCount,
ifnull(sum(pd.outCount), 0) as outCount, ifnull(sum(pd.outCount), 0) as outCount,
pd.inCount - pd.outCount 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
left join auth_dept ad on pd.deptCode = ad.code left join auth_dept ad on pd.deptCode = ad.code
left join auth_warehouse aw on pd.invCode = aw.code left join auth_warehouse aw on pd.invCode = aw.code
left join auth_space sp on pd.invSpaceCode = sp.code left join auth_space sp on pd.invSpaceCode = sp.code
and sp.invStorageCode = pd.deptCode and sp.invWarehouseCode = pd.invCode and sp.invStorageCode = pd.deptCode and sp.invWarehouseCode = pd.invCode
<where> <where>
<if test="invCode != null and invCode != ''"> <if test="invCode != null and invCode != ''">
AND pd.invCode = #{invCode} AND pd.invCode = #{invCode}
@ -316,21 +319,21 @@
<select id="findBySpaceList" resultType="com.glxp.api.entity.inv.InvPreInProductDetailEntity"> <select id="findBySpaceList" resultType="com.glxp.api.entity.inv.InvPreInProductDetailEntity">
select pd.id, select pd.id,
pd.code, pd.code,
pd.relId, pd.relId,
pd.batchNo, pd.batchNo,
pd.produceDate, pd.produceDate,
pd.expireDate, pd.expireDate,
pd.invSpaceCode, pd.invSpaceCode,
pd.deptCode, pd.deptCode,
pd.invCode, pd.invCode,
pd.supId, pd.supId,
pd.nameCode, pd.nameCode,
pd.invSpaceCode, pd.invSpaceCode,
ifnull(sum(pd.count), 0) as count, ifnull(sum(pd.count), 0) as count,
ifnull(sum(pd.inCount), 0) as inCount, ifnull(sum(pd.inCount), 0) as inCount,
ifnull(sum(pd.outCount), 0) as outCount, ifnull(sum(pd.outCount), 0) as outCount,
ifnull(sum(pd.reCount), 0) as reCount ifnull(sum(pd.reCount), 0) as reCount
from inv_prein_product_detail pd from inv_prein_product_detail pd
<where> <where>
reCount > 0 reCount > 0
@ -427,8 +430,7 @@
AND batchNo is null AND batchNo is null
</if> </if>
and inBatchNo > #{inBatchNo} and inBatchNo > #{inBatchNo}
LIMIT 1 LIMIT 1
</where> </where>
</select> </select>
</mapper> </mapper>

@ -88,6 +88,9 @@
<if test="code != null and code != ''"> <if test="code != null and code != ''">
AND code = #{code} AND code = #{code}
</if> </if>
<if test="price != null">
AND price = #{price}
</if>
<if test="mainAction != null and mainAction != ''"> <if test="mainAction != null and mainAction != ''">
AND mainAction = #{mainAction} AND mainAction = #{mainAction}
</if> </if>

@ -433,6 +433,8 @@
left join basic_corp on ip.supId = basic_corp.erpId left join basic_corp on ip.supId = basic_corp.erpId
left join auth_dept on auth_dept.code = ip.deptCode left join auth_dept on auth_dept.code = ip.deptCode
left join auth_warehouse on auth_warehouse.code = ip.invCode left join auth_warehouse on auth_warehouse.code = ip.invCode
left join basic_product_category_rel on basic_product_category_rel.relId = basic_udirel.id
left join basic_product_category on basic_product_category_rel.code = basic_product_category.code
left join inv_product_detail ipd on ip.invCode = ipd.invCode and ip.relIdFk = ipd.relId and left join inv_product_detail ipd on ip.invCode = ipd.invCode and ip.relIdFk = ipd.relId and
ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty') ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
<where> <where>
@ -491,6 +493,15 @@
<if test="invSpaceCode != null and invSpaceCode != ''"> <if test="invSpaceCode != null and invSpaceCode != ''">
AND ipd.invSpaceCode = #{invSpaceCode} AND ipd.invSpaceCode = #{invSpaceCode}
</if> </if>
<if test="basicPrductRemak1 != '' and basicPrductRemak1 != null">
AND bp.basicPrductRemak1 like concat('%', #{basicPrductRemak1}, '%')
</if>
<if test="manufactory != null and manufactory != ''">
and bp.manufactory LIKE concat('%', #{manufactory}, '%')
</if>
<if test="category != '' and category != null">
AND basic_product_category.name = #{category}
</if>
</where> </where>
group by ip.relIdFk group by ip.relIdFk
having reCount > 0 having reCount > 0

@ -283,3 +283,5 @@ CALL Pro_Temp_ColumnWork('inv_prein_product_detail', 'price', 'decimal(10, 2)',
CALL Pro_Temp_ColumnWork('inv_product_detail', 'outFlag', 'tinyint', 1); CALL Pro_Temp_ColumnWork('inv_product_detail', 'outFlag', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('inv_pre_product_detail', 'outFlag', 'tinyint', 1); CALL Pro_Temp_ColumnWork('inv_pre_product_detail', 'outFlag', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('inv_prein_product_detail', 'outFlag', 'tinyint', 1); CALL Pro_Temp_ColumnWork('inv_prein_product_detail', 'outFlag', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'lyInvType', 'tinyint', 1);

@ -1003,3 +1003,6 @@ CALL Pro_Temp_ColumnWork('io_stat_month', 'invCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_stat_quarter', 'invCode', 'varchar(255)', 1); CALL Pro_Temp_ColumnWork('io_stat_quarter', 'invCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_stat_year', 'invCode', 'varchar(255)', 1); CALL Pro_Temp_ColumnWork('io_stat_year', 'invCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('auth_warehouse', 'lyInvType', 'tinyint', 1);

Loading…
Cancel
Save