diff --git a/src/main/java/com/nov/KgLowDurable/pojo/entity/LdErstockOut.java b/src/main/java/com/nov/KgLowDurable/pojo/entity/LdErstockOut.java index 2ad5439..d5e427f 100644 --- a/src/main/java/com/nov/KgLowDurable/pojo/entity/LdErstockOut.java +++ b/src/main/java/com/nov/KgLowDurable/pojo/entity/LdErstockOut.java @@ -32,22 +32,21 @@ public class LdErstockOut implements Serializable { private Long id; /** - * 二级出库编号 + * 企业微信编号 */ - @TableField("so_no") - private String soNo; + @TableField("sp_no") + private String spNo; + /** * 申请人id */ @TableField("user_id") - private String proposerId; - + private String userId; /** * 申请人姓名 */ @TableField("user_name") - private String proposerName; - + private String userName; /** * 提交时间 */ @@ -55,17 +54,21 @@ public class LdErstockOut implements Serializable { @TableField("opt_time") private Date optTime; + /** + * 出库状态:0-未出库;1-已出库;2-已驳回 + */ + private String status; /** * 部门ID */ - @TableField("department_id") - private String departmentId; + @TableField("department") + private String department; /** - * 部门 + * 审批人json */ @TableField("department") - private String department; + private String approvers; /** * 事由 @@ -74,41 +77,13 @@ public class LdErstockOut implements Serializable { 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 approvers; } \ No newline at end of file diff --git a/src/main/java/com/nov/KgLowDurable/pojo/entity/LdErstockOutForm.java b/src/main/java/com/nov/KgLowDurable/pojo/entity/LdErstockOutForm.java index 425f525..53a2aa0 100644 --- a/src/main/java/com/nov/KgLowDurable/pojo/entity/LdErstockOutForm.java +++ b/src/main/java/com/nov/KgLowDurable/pojo/entity/LdErstockOutForm.java @@ -37,24 +37,6 @@ public class LdErstockOutForm implements Serializable { @TableField("out_id") private Long outId; - /** - * 二级出库单号 - */ - @TableField("out_no") - private Long outNo; - - /** - * 二级出库明细单号 - */ - @TableField("out_detail_no") - private Long outDetailNo; - - /** - * 物资ID - */ - @TableField("material_id") - private String materialId; - /** * 二级库物资id(易耗品是为空) 物资编号 */ @@ -73,12 +55,6 @@ public class LdErstockOutForm implements Serializable { @TableField("model") private String model; - /** - * 类别:耐用品/易耗品 - */ - @TableField("type") - private String type; - /** * 单位 */ @@ -97,16 +73,16 @@ public class LdErstockOutForm implements Serializable { @TableField("remark") private String remark; - /** - * 申请原因 - */ - @TableField("reason") - private String reason; - /** * 提交时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @TableField("opt_time") private Date optTime; + + /** + * 出库后剩余数量 + */ + @TableField("remaining_num") + private String remainingNum; } \ No newline at end of file diff --git a/src/main/java/com/nov/KgLowDurable/service/Impl/LdTwoInventoryRecordServiceImpl.java b/src/main/java/com/nov/KgLowDurable/service/Impl/LdTwoInventoryRecordServiceImpl.java index 2c9b485..09fa90b 100644 --- a/src/main/java/com/nov/KgLowDurable/service/Impl/LdTwoInventoryRecordServiceImpl.java +++ b/src/main/java/com/nov/KgLowDurable/service/Impl/LdTwoInventoryRecordServiceImpl.java @@ -11,6 +11,7 @@ import com.nov.KgLowDurable.mapper.LdTwoInventoryRecordMapper; import com.nov.KgLowDurable.pojo.dto.ApproveDto; import com.nov.KgLowDurable.pojo.entity.*; import com.nov.KgLowDurable.service.*; +import com.nov.KgLowDurable.util.Func; import com.nov.KgLowDurable.util.StringUtils; import lombok.AllArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; @@ -138,8 +139,14 @@ public class LdTwoInventoryRecordServiceImpl extends ServiceImpl outFormList = ldErstockOutFromService.listByOutId(approveDto.getTwoOutStorageId()); 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()); BigDecimal num = new BigDecimal(ldErstockOutForm.getNum());