二级入库回调添加web端的处理逻辑

master
liuqingkun 2 months ago
parent 93b763473e
commit e8ba1390cc
  1. 59
      src/main/java/com/nov/KgLowDurable/pojo/entity/LdErstockOut.java
  2. 36
      src/main/java/com/nov/KgLowDurable/pojo/entity/LdErstockOutForm.java
  3. 11
      src/main/java/com/nov/KgLowDurable/service/Impl/LdTwoInventoryRecordServiceImpl.java

@ -32,22 +32,21 @@ public class LdErstockOut implements Serializable {
private Long id; private Long id;
/** /**
* 二级出库编号 * 企业微信编号
*/ */
@TableField("so_no") @TableField("sp_no")
private String soNo; private String spNo;
/** /**
* 申请人id * 申请人id
*/ */
@TableField("user_id") @TableField("user_id")
private String proposerId; private String userId;
/** /**
* 申请人姓名 * 申请人姓名
*/ */
@TableField("user_name") @TableField("user_name")
private String proposerName; private String userName;
/** /**
* 提交时间 * 提交时间
*/ */
@ -55,17 +54,21 @@ public class LdErstockOut implements Serializable {
@TableField("opt_time") @TableField("opt_time")
private Date optTime; private Date optTime;
/**
* 出库状态0-未出库1-已出库2-已驳回
*/
private String status;
/** /**
* 部门ID * 部门ID
*/ */
@TableField("department_id") @TableField("department")
private String departmentId; private String department;
/** /**
* 部门 * 审批人json
*/ */
@TableField("department") @TableField("department")
private String department; private String approvers;
/** /**
* 事由 * 事由
@ -74,41 +77,13 @@ public class LdErstockOut implements Serializable {
private String reason; private String reason;
/** /**
* 物资类型办公物资/其他物资 * 二级出库编号
*/
@TableField("material_type")
private String materialType;
/**
* 出库人ID
*/
@TableField("shipper_id")
private String shipperId;
/**
* 出库人名称
*/
@TableField("shipper_name")
private String shipperName;
/**
* 审批编号
*/
@TableField("sp_no")
private String spNo;
/**
* 出库状态0-未出库1-已出库2-已驳回
*/ */
private String status; @TableField("so_no")
private String soNo;
/** /**
* 分组名称 * 分组名称
*/ */
private String groupName; private String groupName;
/**
* 审批人员
*/
private String approvers;
} }

@ -37,24 +37,6 @@ public class LdErstockOutForm implements Serializable {
@TableField("out_id") @TableField("out_id")
private Long outId; private Long outId;
/**
* 二级出库单号
*/
@TableField("out_no")
private Long outNo;
/**
* 二级出库明细单号
*/
@TableField("out_detail_no")
private Long outDetailNo;
/**
* 物资ID
*/
@TableField("material_id")
private String materialId;
/** /**
* 二级库物资id易耗品是为空 物资编号 * 二级库物资id易耗品是为空 物资编号
*/ */
@ -73,12 +55,6 @@ public class LdErstockOutForm implements Serializable {
@TableField("model") @TableField("model")
private String model; private String model;
/**
* 类别耐用品/易耗品
*/
@TableField("type")
private String type;
/** /**
* 单位 * 单位
*/ */
@ -97,16 +73,16 @@ public class LdErstockOutForm implements Serializable {
@TableField("remark") @TableField("remark")
private String remark; private String remark;
/**
* 申请原因
*/
@TableField("reason")
private String reason;
/** /**
* 提交时间 * 提交时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@TableField("opt_time") @TableField("opt_time")
private Date optTime; private Date optTime;
/**
* 出库后剩余数量
*/
@TableField("remaining_num")
private String remainingNum;
} }

@ -11,6 +11,7 @@ import com.nov.KgLowDurable.mapper.LdTwoInventoryRecordMapper;
import com.nov.KgLowDurable.pojo.dto.ApproveDto; import com.nov.KgLowDurable.pojo.dto.ApproveDto;
import com.nov.KgLowDurable.pojo.entity.*; import com.nov.KgLowDurable.pojo.entity.*;
import com.nov.KgLowDurable.service.*; import com.nov.KgLowDurable.service.*;
import com.nov.KgLowDurable.util.Func;
import com.nov.KgLowDurable.util.StringUtils; import com.nov.KgLowDurable.util.StringUtils;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -138,8 +139,14 @@ public class LdTwoInventoryRecordServiceImpl extends ServiceImpl<LdTwoInventoryR
List<LdErstockOutForm> outFormList = ldErstockOutFromService.listByOutId(approveDto.getTwoOutStorageId()); List<LdErstockOutForm> outFormList = ldErstockOutFromService.listByOutId(approveDto.getTwoOutStorageId());
for (LdErstockOutForm ldErstockOutForm : outFormList) { for (LdErstockOutForm ldErstockOutForm : outFormList) {
// todo 移动端的类存储的是代码(YH)还是汉字(易耗品) // 物资编码
if (BatchConstant.CONSUMER.equals(ldErstockOutForm.getType())) { String code = "";
// 需要类别的话可以根据stock_id物资编码来判断,编码中第六七位会有NY或YH
if (Func.isNotEmpty(ldErstockOutForm.getStockId())) {
code = ldErstockOutForm.getStockId().substring(5, 7);
}
if (BatchConstant.CONSUMER.equals(code)) {
// 获取二级库存 // 获取二级库存
LdConsumerForm consumerForm = consumerFormService.getById(ldErstockOutForm.getStockId()); LdConsumerForm consumerForm = consumerFormService.getById(ldErstockOutForm.getStockId());
BigDecimal num = new BigDecimal(ldErstockOutForm.getNum()); BigDecimal num = new BigDecimal(ldErstockOutForm.getNum());

Loading…
Cancel
Save