预验收重新调整

master
anthonywj 2 years ago
parent 2a78301791
commit 1d506f43ff

@ -81,7 +81,6 @@ public class ConstantStatus {
public static final Integer BUS_TYPE_INVOICE = 4; //退货单单据类型
public static final Integer ACTION_TYPE_NORMAL = 1; //带票
public static final Integer ACTION_TYPE_PREIN = 2; //预验收
public static final Integer ACTION_TYPE_ADVANCE = 3; //寄售
@ -270,4 +269,11 @@ public class ConstantStatus {
public static final int PRINT_SUCCESS = 1; //已打印
//预验收库存状态 1:在库2已退回3.已使用
public static final int INVIN_IN = 1;
public static final int INVIN_BACK = 2;
public static final int INVIN_USE = 3;
}

@ -1,18 +1,13 @@
package com.glxp.api.controller.inout;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.inout.IoCodeLostEntity;
import com.glxp.api.entity.inout.IoCodeTempEntity;
import com.glxp.api.req.inout.FilterOrderDetailResultRequest;
import com.glxp.api.res.inout.AcceptOrderResponse;
import com.glxp.api.res.inout.IoOrderDetailResultResponse;
import com.glxp.api.service.inout.IoCodeLostService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -21,7 +16,6 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@RestController
public class IoCodeLostController extends BaseController {

@ -448,7 +448,7 @@ public class IoCodeTempController extends BaseController {
//校验预验收是否已存在
if (bussinessTypeEntity.getActionType() == ConstantStatus.ACTION_TYPE_PREIN) {
if (StrUtil.isNotEmpty(udiEntity.getSerialNo())) {
List<InvPreinDetailEntity> invProductDetailEntities = invPreinDetailService.findByCode(code);
List<InvPreinDetailEntity> invProductDetailEntities = invPreinDetailService.findUseByCode(code);
if (CollUtil.isNotEmpty(invProductDetailEntities)) {
return ResultVOUtils.error(500, "预验收库存已存在此UDI码,请检查后重试!");
}
@ -457,7 +457,7 @@ public class IoCodeTempController extends BaseController {
//校验预验收库存是否已存在
if (bussinessTypeEntity.isScanPreIn()) {
InvPreinDetailEntity invProductDetailEntity = invPreinDetailService.findOneByCode(code);
InvPreinDetailEntity invProductDetailEntity = invPreinDetailService.findUseOneByCode(code);
if (invProductDetailEntity == null) {
return ResultVOUtils.error(500, "预验收库存未存在此产品!");
} else {
@ -469,7 +469,7 @@ public class IoCodeTempController extends BaseController {
if (StrUtil.isEmpty(udiEntity.getSerialNo())) {//该单据已有该产品
//无序列号,则可能存在多个预验收入库单
IoCodeTempEntity codeTempEntity = codeTempService.findByUnique(orderId, code);
List<InvPreinDetailEntity> invPreinDetailEntities = invPreinDetailService.findByCode(code);
List<InvPreinDetailEntity> invPreinDetailEntities = invPreinDetailService.findUseByCode(code);
int count = 0;
for (InvPreinDetailEntity temp : invPreinDetailEntities) {
count = count + temp.getCount();

@ -77,7 +77,7 @@ public class InvPreinOrderController extends BaseController {
@AuthRuleAnnotation("")
@GetMapping("spms/prein/inv/products/getDetaiByCode")
public BaseResponse getDetaiByCode(FilterInvProductDetailRequest filterInvProductDetailRequest) {
InvPreinDetailEntity invProductDetailEntity = invPreinDetailService.findOneByCode(filterInvProductDetailRequest.getCode());
InvPreinDetailEntity invProductDetailEntity = invPreinDetailService.findUseOneByCode(filterInvProductDetailRequest.getCode());
if (invProductDetailEntity == null) {
return ResultVOUtils.error(500, "预验收库存未存在此产品!");
} else {
@ -88,7 +88,7 @@ public class InvPreinOrderController extends BaseController {
UdiEntity udiEntity = FilterUdiUtils.getUdi(filterInvProductDetailRequest.getCode());
if (StrUtil.isEmpty(udiEntity.getSerialNo())) {//该单据已有该产品
//无序列号,则可能存在多个预验收入库单
List<InvPreinDetailEntity> invPreinDetailEntities = invPreinDetailService.findByCode(filterInvProductDetailRequest.getCode());
List<InvPreinDetailEntity> invPreinDetailEntities = invPreinDetailService.findUseByCode(filterInvProductDetailRequest.getCode());
int count = 0;
for (InvPreinDetailEntity temp : invPreinDetailEntities) {
count = count + temp.getCount();

@ -72,6 +72,10 @@ public class IoCodeLostEntity {
@TableField(value = "remark")
private String remark;
@TableField(value = "nameCode")
private String nameCode;
public static final String COL_ID = "id";
public static final String COL_CODE = "code";

@ -223,7 +223,7 @@ public class IoOrderEntity {
@TableField(value = "processStatus")
private Integer processStatus; //退货单据处理状态
@TableField(value = "processStatus")
@TableField(value = "inCodeStatus")
private int inCodeStatus; //内部码生成状态
}

@ -60,6 +60,19 @@ public class InvPreinDetailEntity {
@TableField(value = "relId")
private Long relId;
/**
*
*/
@TableField(value = "`originCount`")
private int originCount;
/**
*
*/
@TableField(value = "originReCount")
private int originReCount;
/**
*
*/

@ -8,4 +8,17 @@ public class FilterInvPreinDetailRequest extends ListPageRequest {
private String orderId;
private String code;
private String productName;
private String ggxh;
private String manufactory;
private String zczbhhzbapzbh;
private String auditTime;
private String billNo;
private String invCode;
private String batchNo;
private String produceDate;
private String expireDate;
private String startAduditTime;
private String endAduditTime;
private String nameCode;
}

@ -56,11 +56,21 @@ public class InvPreinDetailResponse {
*/
private int count;
private Integer originReCount;
/**
*
*/
private int reCount;
private Integer status;
private String productName;
private String ggxh;
private String manufactory;
private String zczbhhzbapzbh;
private String auditTime;
private String billNo;
private String invName;
}

@ -657,8 +657,12 @@ public class IoCheckInoutService {
for (IoCodeEntity warehouseEntity : codeList) {
List<InvPreinDetailEntity> invProductDetailEntities = invPreinDetailService.findByCode(warehouseEntity.getCode());
if (invProductDetailEntities.size() > 0) {
for (InvPreinDetailEntity invPreinDetailEntity : invProductDetailEntities)
for (InvPreinDetailEntity invPreinDetailEntity : invProductDetailEntities) {
preInOrder.put(invPreinDetailEntity.getOrderId(), invPreinDetailEntity.getOrderId());
invPreinDetailEntity.setStatus(ConstantStatus.INVIN_USE);
invPreinDetailService.update(invPreinDetailEntity);
}
}
}
if (preInOrder.size() > 0) {
@ -673,7 +677,8 @@ public class IoCheckInoutService {
BasicBussinessTypeEntity preBusType = basicBussinessTypeService.findByAction(preInEntity.getAction());
//预验收不删除单号,方便后续查询
if (preBusType.isPreInBack()) { //预验收如果带回,则清空相关预验收库存;
invPreinDetailService.deleteByOrderId(preInEntity.getBillNo());
invPreinDetailService.updateBack(preInEntity.getBillNo());
// invPreinDetailService.deleteByOrderId(preInEntity.getBillNo());
} else { //预验收如果不带回,则清除已出库相关库存
for (IoCodeEntity codeEntity : codeList) {
if (StrUtil.isEmpty(codeEntity.getSerialNo())) {
@ -688,15 +693,17 @@ public class IoCheckInoutService {
if (count >= 0) {
isBreak = true;
if (count == 0) {
invPreinDetailService.deleteByCode(key, codeEntity.getCode());
// invPreinDetailService.deleteByCode(key, codeEntity.getCode());
} else {
invPreinDetailEntity.setStatus(ConstantStatus.INVIN_IN);
invPreinDetailEntity.setCount(count);
invPreinDetailService.update(invPreinDetailEntity);
}
int reCount = invPreinDetailEntity.getReCount() - codeEntity.getMyReCount();
if (reCount == 0) {
invPreinDetailService.deleteByCode(key, codeEntity.getCode());
// invPreinDetailService.deleteByCode(key, codeEntity.getCode());
} else {
invPreinDetailEntity.setStatus(ConstantStatus.INVIN_IN);
invPreinDetailEntity.setReCount(reCount);
invPreinDetailService.update(invPreinDetailEntity);
}
@ -705,7 +712,7 @@ public class IoCheckInoutService {
}
} else {
invPreinDetailService.deleteByCode(key, codeEntity.getCode());
// invPreinDetailService.deleteByCode(key, codeEntity.getCode());
}
}

@ -186,6 +186,9 @@ public class IoGenInvService {
InvPreinDetailEntity invPreinDetailEntity = new InvPreinDetailEntity();
BeanUtils.copyProperties(codeEntity, invPreinDetailEntity);
invPreinDetailEntity.setId(null);
invPreinDetailEntity.setStatus(ConstantStatus.INVIN_IN);
invPreinDetailEntity.setOriginCount(codeEntity.getCount());
invPreinDetailEntity.setOriginReCount(codeEntity.getReCount());
invPreinDetailEntities.add(invPreinDetailEntity);
});

@ -17,7 +17,12 @@ public interface InvPreinDetailService {
List<InvPreinDetailEntity> findByCode(String code);
InvPreinDetailEntity findOneByCode(String code);
// InvPreinDetailEntity findOneByCode(String code);
List<InvPreinDetailEntity> findUseByCode(String code);
InvPreinDetailEntity findUseOneByCode(String code);
int deleteByOrderId(String orderId);
@ -29,4 +34,6 @@ public interface InvPreinDetailService {
int update(InvPreinDetailEntity invPreinDetailEntity);
int updateBack(String orderId);
}

@ -3,6 +3,7 @@ package com.glxp.api.service.inv.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.dao.inv.InvPreinDetailDao;
import com.glxp.api.dao.inv.InvPreinOrderDao;
import com.glxp.api.entity.inv.InvPreProductDetailEntity;
@ -41,19 +42,34 @@ public class InvPreinDetailServiceImpl implements InvPreinDetailService {
}
@Override
public List<InvPreinDetailEntity> findByCode(String code) {
return invPreinDetailDao.selectList(new QueryWrapper<InvPreinDetailEntity>().eq("code", code));
public List<InvPreinDetailEntity> findUseByCode(String code) {
return invPreinDetailDao.selectList(new QueryWrapper<InvPreinDetailEntity>().eq("code", code).eq("status", ConstantStatus.INVIN_IN));
}
@Override
public InvPreinDetailEntity findOneByCode(String code) {
List<InvPreinDetailEntity> invPreinDetailEntities = invPreinDetailDao.selectList(new QueryWrapper<InvPreinDetailEntity>().eq("code", code).last("limit 1"));
public InvPreinDetailEntity findUseOneByCode(String code) {
List<InvPreinDetailEntity> invPreinDetailEntities = invPreinDetailDao.selectList(new QueryWrapper<InvPreinDetailEntity>().eq("code", code)
.eq("status", ConstantStatus.INVIN_IN).last("limit 1"));
if (CollUtil.isNotEmpty(invPreinDetailEntities)) {
return invPreinDetailEntities.get(0);
}
return null;
}
@Override
public List<InvPreinDetailEntity> findByCode(String code) {
return invPreinDetailDao.selectList(new QueryWrapper<InvPreinDetailEntity>().eq("code", code));
}
//
// @Override
// public InvPreinDetailEntity findOneByCode(String code) {
// List<InvPreinDetailEntity> invPreinDetailEntities = invPreinDetailDao.selectList(new QueryWrapper<InvPreinDetailEntity>().eq("code", code).last("limit 1"));
// if (CollUtil.isNotEmpty(invPreinDetailEntities)) {
// return invPreinDetailEntities.get(0);
// }
// return null;
// }
@Override
public int deleteByOrderId(String orderId) {
return invPreinDetailDao.delete(new QueryWrapper<InvPreinDetailEntity>().eq("orderId", orderId));
@ -81,8 +97,18 @@ public class InvPreinDetailServiceImpl implements InvPreinDetailService {
@Override
public int update(InvPreinDetailEntity invPreinDetailEntity) {
return invPreinDetailDao.updateById(invPreinDetailEntity);
}
@Override
public int updateBack(String orderId) {
InvPreinDetailEntity invPreinDetailEntity = new InvPreinDetailEntity();
invPreinDetailEntity.setStatus(ConstantStatus.INVIN_BACK);
invPreinDetailDao.update(invPreinDetailEntity, new QueryWrapper<InvPreinDetailEntity>().eq("orderId", orderId).ne("status", ConstantStatus.INVIN_USE));
return 1;
}
}

@ -4,16 +4,48 @@
<select id="filterList" parameterType="com.glxp.api.req.inv.FilterInvPreinDetailRequest"
resultType="com.glxp.api.res.inv.InvPreinDetailResponse">
select ic.*,
bp.cpmctymc productName
bp.cpmctymc productName,
bp.ggxh,
bp.manufactory,
bp.zczbhhzbapzbh,
inv_prein_order.auditTime,
inv_prein_order.billNo,
aw.name invName
from inv_prein_detail ic
left join basic_udirel bu on bu.id = ic.relId
left join basic_products bp on bu.uuid = bp.uuid
inner join inv_prein_order on orderId = inv_prein_order.billNo
left join basic_udirel bu on bu.id = ic.relId
left join basic_products bp on bu.uuid = bp.uuid
left join auth_warehouse aw on inv_prein_order.invCode = aw.code
<where>
<if test="orderId != null and orderId != ''">
AND ic.orderId = #{orderId}
</if>
<if test="code != null and code != ''">
and ic.code like concat('%',#{code},'%')
and ic.code like concat('%', #{code}, '%')
</if>
<if test="batchNo != null and batchNo != ''">
AND ic.batchNo = #{batchNo}
</if>
<if test="nameCode != null and nameCode != ''">
AND ic.nameCode = #{nameCode}
</if>
<if test="invCode != null and invCode != ''">
AND inv_prein_order.invCode = #{invCode}
</if>
<if test="productName != null and productName != ''">
AND bp.cpmctymc = #{productName}
</if>
<if test="ggxh != null and ggxh != ''">
and bp.ggxh like concat('%', #{ggxh}, '%')
</if>
<if test="manufactory != null and manufactory != ''">
AND bp.manufactory = #{manufactory}
</if>
<if test="zczbhhzbapzbh != null and zczbhhzbapzbh != ''">
AND bp.zczbhhzbapzbh = #{zczbhhzbapzbh}
</if>
<if test="startAduditTime != null and startAduditTime != '' and endAduditTime != null and endAduditTime != ''">
AND date_format(inv_prein_order.auditTime, '%Y-%m-%d') between date_format(#{startAduditTime}, '%Y-%m-%d') and date_format(#{endAduditTime}, '%Y-%m-%d')
</if>
</where>
group by ic.id

@ -5,7 +5,8 @@ CALL Pro_Temp_ColumnWork('io_order', 'syncStatus', 'tinyint ', 1);
CALL Pro_Temp_ColumnWork('io_order', 'busType', 'tinyint ', 1);
CALL Pro_Temp_ColumnWork('io_order', 'deliveryStatus', 'tinyint ', 1);
CALL Pro_Temp_ColumnWork('io_order', 'inCodeStatus', 'tinyint ', 1);
CALL Pro_Temp_ColumnWork('io_order', 'processStatus', 'tinyint ', 1);
CALL Pro_Temp_ColumnWork('io_code_lost', 'nameCode', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('thr_bustype_origin', 'thirdSysName', 'varchar(255) ', 3);
CALL Pro_Temp_ColumnWork('thr_system_bus_api', 'thirdBuyName', 'varchar(255) ', 3);
@ -79,3 +80,9 @@ CALL Pro_Temp_ColumnWork('pur_order', 'arrivalTime', 'datetime', 1);
CALL Pro_Temp_ColumnWork('pur_order_detail', 'planCount', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('inv_prein_detail', 'status', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('inv_prein_detail', 'originCount', 'int', 1);
CALL Pro_Temp_ColumnWork('inv_prein_detail', 'originReCount', 'int', 1);
CALL Pro_Temp_ColumnWork('io_code_lost', 'nameCode', 'varchar(255)', 1);

Loading…
Cancel
Save