master
liweidong-hj 3 months ago
parent ba8628b918
commit 69ca23c729
  1. 17
      src/main/java/com/nov/KgLowDurable/constant/OnePutApproverConstant.java
  2. 20
      src/main/java/com/nov/KgLowDurable/constant/TwoOutApproverConstant.java
  3. 18
      src/main/java/com/nov/KgLowDurable/controller/LdTwoOutStorageController.java
  4. 2
      src/main/java/com/nov/KgLowDurable/mapper/LdConsumerFormMapper.java
  5. 2
      src/main/java/com/nov/KgLowDurable/mapper/LdDurableFormMapper.java
  6. 1
      src/main/java/com/nov/KgLowDurable/pojo/dto/LdTwoInventoryDto.java
  7. 23
      src/main/java/com/nov/KgLowDurable/pojo/vo/GroupMaterialVO.java
  8. 20
      src/main/java/com/nov/KgLowDurable/pojo/vo/GroupResultVO.java
  9. 17
      src/main/java/com/nov/KgLowDurable/pojo/vo/GroupVO.java
  10. 3
      src/main/java/com/nov/KgLowDurable/service/ILdConsumerFormService.java
  11. 3
      src/main/java/com/nov/KgLowDurable/service/ILdDurableFormService.java
  12. 17
      src/main/java/com/nov/KgLowDurable/service/ILdTwoOutStorageService.java
  13. 16
      src/main/java/com/nov/KgLowDurable/service/IUserService.java
  14. 13
      src/main/java/com/nov/KgLowDurable/service/Impl/LdConsumerFormServiceImpl.java
  15. 4
      src/main/java/com/nov/KgLowDurable/service/Impl/LdDurableFormServiceImpl.java
  16. 9
      src/main/java/com/nov/KgLowDurable/service/Impl/LdTwoOutStorageDetailServiceImpl.java
  17. 43
      src/main/java/com/nov/KgLowDurable/service/Impl/LdTwoOutStorageServiceImpl.java
  18. 4
      src/main/java/com/nov/KgLowDurable/service/Impl/LdTwoPutStorageServiceImpl.java
  19. 101
      src/main/java/com/nov/KgLowDurable/service/Impl/UserServiceImpl.java
  20. 2
      src/main/resources/mapper/LdConsumerFormMapper.xml
  21. 2
      src/main/resources/mapper/LdDurableFormMapper.xml

@ -10,49 +10,41 @@ public class OnePutApproverConstant {
/** /**
* 入库人 - 文本控件 * 入库人 - 文本控件
* 对应表单中的"入库人"字段
*/ */
public static final String TEXT_INBOUND_PERSON = "Text-1753842895562"; public static final String TEXT_INBOUND_PERSON = "Text-1753842895562";
/** /**
* 采购单名称 - 文本控件 * 采购单名称 - 文本控件
* 对应表单中的"采购单名称"字段
*/ */
public static final String TEXT_PURCHASE_ORDER_NAME = "Text-1764895727005"; public static final String TEXT_PURCHASE_ORDER_NAME = "Text-1764895727005";
/** /**
* 入库单号 - 文本控件 * 入库单号 - 文本控件
* 对应表单中的"入库单号"字段
*/ */
public static final String TEXT_INBOUND_ORDER_NO = "Text-1765952634498"; public static final String TEXT_INBOUND_ORDER_NO = "Text-1765952634498";
/** /**
* 入库日期 - 日期控件 * 入库日期 - 日期控件
* 对应表单中的"入库日期"字段
*/ */
public static final String DATE_INBOUND_DATE = "Date-1765952657849"; public static final String DATE_INBOUND_DATE = "Date-1765952657849";
/** /**
* 入库人部门 - 文本控件 * 入库人部门 - 文本控件
* 对应表单中的"入库人部门"字段
*/ */
public static final String TEXT_DEPARTMENT = "Text-1767928426958"; public static final String TEXT_DEPARTMENT = "Text-1767928426958";
/** /**
* 物资类型 - 文本控件 * 物资类型 - 文本控件
* 对应表单中的"物资类型"字段
*/ */
public static final String TEXT_MATERIAL_TYPE = "Text-1767928458421"; public static final String TEXT_MATERIAL_TYPE = "Text-1767928458421";
/** /**
* 事由 - 文本域控件 * 事由 - 文本域控件
* 对应表单中的"事由"字段
*/ */
public static final String TEXTAREA_REASON = "Textarea-1765952756865"; public static final String TEXTAREA_REASON = "Textarea-1765952756865";
/** /**
* 物资列表 - 表格控件 * 物资列表 - 表格控件
* 对应表单中的物资明细表格
*/ */
public static final String TABLE_MATERIAL_LIST = "Table-1752131467618"; public static final String TABLE_MATERIAL_LIST = "Table-1752131467618";
@ -64,55 +56,46 @@ public class OnePutApproverConstant {
/** /**
* 物资名称 - 表格列文本控件 * 物资名称 - 表格列文本控件
* 对应表格中的"物资名称"
*/ */
public static final String TABLE_COL_MATERIAL_NAME = "Text-1764896053375"; public static final String TABLE_COL_MATERIAL_NAME = "Text-1764896053375";
/** /**
* 物资编号 - 表格列文本控件 * 物资编号 - 表格列文本控件
* 对应表格中的"物资编号"
*/ */
public static final String TABLE_COL_MATERIAL_CODE = "Text-1764896063342"; public static final String TABLE_COL_MATERIAL_CODE = "Text-1764896063342";
/** /**
* 规格型号 - 表格列文本控件 * 规格型号 - 表格列文本控件
* 对应表格中的"规格型号"
*/ */
public static final String TABLE_COL_SPECIFICATION = "Text-1753775946265"; public static final String TABLE_COL_SPECIFICATION = "Text-1753775946265";
/** /**
* 单位 - 表格列文本控件 * 单位 - 表格列文本控件
* 对应表格中的"单位"
*/ */
public static final String TABLE_COL_UNIT = "Text-1753775948881"; public static final String TABLE_COL_UNIT = "Text-1753775948881";
/** /**
* 类别 - 表格列文本控件 * 类别 - 表格列文本控件
* 对应表格中的"类别"
*/ */
public static final String TABLE_COL_CATEGORY = "Text-1767928477965"; public static final String TABLE_COL_CATEGORY = "Text-1767928477965";
/** /**
* 计划数量 - 表格列文本控件 * 计划数量 - 表格列文本控件
* 对应表格中的"计划数量"
*/ */
public static final String TABLE_COL_PLAN_QUANTITY = "Text-1765952944297"; public static final String TABLE_COL_PLAN_QUANTITY = "Text-1765952944297";
/** /**
* 已入库数量 - 表格列文本控件 * 已入库数量 - 表格列文本控件
* 对应表格中的"已入库数量"
*/ */
public static final String TABLE_COL_INBOUND_QUANTITY = "Text-1765952953209"; public static final String TABLE_COL_INBOUND_QUANTITY = "Text-1765952953209";
/** /**
* 单价 - 表格列文本控件 * 单价 - 表格列文本控件
* 对应表格中的"单价"
*/ */
public static final String TABLE_COL_UNIT_PRICE = "Text-1765952961761"; public static final String TABLE_COL_UNIT_PRICE = "Text-1765952961761";
/** /**
* 本次入库数量 - 表格列文本控件 * 本次入库数量 - 表格列文本控件
* 对应表格中的"本次入库数量"
*/ */
public static final String TABLE_COL_CURRENT_INBOUND_QUANTITY = "Text-1765952974081"; public static final String TABLE_COL_CURRENT_INBOUND_QUANTITY = "Text-1765952974081";

@ -9,31 +9,31 @@ public class TwoOutApproverConstant {
/** /**
* 领用人 - 文本控件 * 领用人 - 文本控件
* 对应表单中的"领用人"字段
*/ */
public static final String TEXT_RECEIVER = "Text-1753842895562"; public static final String TEXT_RECEIVER = "Text-1753842895562";
/** /**
* 部门 - 文本控件 * 部门 - 文本控件
* 对应表单中的"部门"字段
*/ */
public static final String TEXT_DEPARTMENT = "Text-1764895727005"; public static final String TEXT_DEPARTMENT = "Text-1764895727005";
/** /**
* 单号 - 文本控件 * 单号 - 文本控件
* 对应表单中的"单号"字段
*/ */
public static final String TEXT_ORDER_NO = "Text-1768182878024"; public static final String TEXT_ORDER_NO = "Text-1768182878024";
/**
* 单号 - 出库组别
*/
public static final String OUT_GROUP = "Text-1768268948529";
/** /**
* 事由 - 文本域控件 * 事由 - 文本域控件
* 对应表单中的"事由"字段
*/ */
public static final String TEXTAREA_REASON = "Textarea-1765250821333"; public static final String TEXTAREA_REASON = "Textarea-1765250821333";
/** /**
* 物资列表 - 表格控件 * 物资列表 - 表格控件
* 对应表单中的物资明细表格
*/ */
public static final String TABLE_MATERIAL_LIST = "Table-1752131467618"; public static final String TABLE_MATERIAL_LIST = "Table-1752131467618";
@ -41,61 +41,51 @@ public class TwoOutApproverConstant {
/** /**
* 物资名称 - 表格列文本控件 * 物资名称 - 表格列文本控件
* 对应表格中的"物资名称"
*/ */
public static final String TABLE_COL_MATERIAL_NAME = "Text-1764896053375"; public static final String TABLE_COL_MATERIAL_NAME = "Text-1764896053375";
/** /**
* 物资编号 - 表格列文本控件 * 物资编号 - 表格列文本控件
* 对应表格中的"物资编号"
*/ */
public static final String TABLE_COL_MATERIAL_CODE = "Text-1764896063342"; public static final String TABLE_COL_MATERIAL_CODE = "Text-1764896063342";
/** /**
* 规格型号 - 表格列文本控件 * 规格型号 - 表格列文本控件
* 对应表格中的"规格型号"
*/ */
public static final String TABLE_COL_SPECIFICATION = "Text-1753775946265"; public static final String TABLE_COL_SPECIFICATION = "Text-1753775946265";
/** /**
* 单位 - 表格列文本控件 * 单位 - 表格列文本控件
* 对应表格中的"单位"
*/ */
public static final String TABLE_COL_UNIT = "Text-1753775948881"; public static final String TABLE_COL_UNIT = "Text-1753775948881";
/** /**
* 类别 - 表格列文本控件 * 类别 - 表格列文本控件
* 对应表格中的"类别"
*/ */
public static final String TABLE_COL_CATEGORY = "Text-1768182193673"; public static final String TABLE_COL_CATEGORY = "Text-1768182193673";
// /** // /**
// * 单价 - 表格列(文本控件) // * 单价 - 表格列(文本控件)
// * 对应表格中的"单价"列
// */ // */
// public static final String TABLE_COL_UNIT_PRICE = "Text-1768182205649"; // public static final String TABLE_COL_UNIT_PRICE = "Text-1768182205649";
/** /**
* 出库人 - 表格列文本控件 * 出库人 - 表格列文本控件
* 对应表格中的"出库人"
*/ */
public static final String TABLE_COL_OUTBOUND_PERSON = "Text-1768182222649"; public static final String TABLE_COL_OUTBOUND_PERSON = "Text-1768182222649";
/** /**
* 出库数量 - 表格列文本控件 * 出库数量 - 表格列文本控件
* 对应表格中的"出库数量"
*/ */
public static final String TABLE_COL_OUTBOUND_QUANTITY = "Text-1753842938570"; public static final String TABLE_COL_OUTBOUND_QUANTITY = "Text-1753842938570";
/** /**
* 物资描述 - 表格列文本控件 * 物资描述 - 表格列文本控件
* 对应表格中的"物资描述"
*/ */
public static final String TABLE_COL_MATERIAL_DESCRIPTION = "Text-1764895768454"; public static final String TABLE_COL_MATERIAL_DESCRIPTION = "Text-1764895768454";
/** /**
* 库存 - 表格列文本控件 * 库存 - 表格列文本控件
* 对应表格中的"库存"
*/ */
public static final String TABLE_COL_INVENTORY = "Text-1768182234129"; public static final String TABLE_COL_INVENTORY = "Text-1768182234129";

@ -56,5 +56,23 @@ public class LdTwoOutStorageController {
return Result.OK(twoOutStorageService.getDetail(twoOutStorageId)); return Result.OK(twoOutStorageService.getDetail(twoOutStorageId));
} }
@GetMapping("/getOutGroupName")
@ApiOperationSort(4)
@ApiOperation(value = "获取二级出库分组名称", notes = "获取分组名称", httpMethod = "GET", response = Result.class)
public Result getOutGroupName() {
return Result.OK(twoOutStorageService.getOutGroupName());
}
@GetMapping("/getGroupMaterial")
@ApiOperationSort(5)
@ApiOperation(value = "获取物资清单", notes = "根据分组名称获取物资清单", httpMethod = "GET", response = Result.class)
public Result getGroupMaterial(@RequestParam String groupName,
@RequestParam String departmentId) {
return Result.OK(twoOutStorageService.getGroupMaterial(groupName,departmentId));
}
} }

@ -13,7 +13,7 @@ import java.util.List;
public interface LdConsumerFormMapper extends BaseMapper<LdConsumerForm> { public interface LdConsumerFormMapper extends BaseMapper<LdConsumerForm> {
LdConsumerForm selectByMaterialId(@Param("materialId") Long materialId); LdConsumerForm selectByMaterialId(@Param("materialId") Long materialId, @Param("demandDepartment") String demandDepartment);
List<LdConsumerForm> selectByDepartmentId(@Param("departmentId") String departmentId); List<LdConsumerForm> selectByDepartmentId(@Param("departmentId") String departmentId);

@ -15,7 +15,7 @@ public interface LdDurableFormMapper extends BaseMapper<LdDurableForm> {
List<LdDurableForm> selectDurableFormList(@Param("departmentId") String departmentId, @Param("materialName") String materialName, @Param("num") Integer num); List<LdDurableForm> selectDurableFormList(@Param("departmentId") String departmentId, @Param("materialName") String materialName, @Param("num") Integer num);
LdDurableForm selectByMaterialId(@Param("materialId") Long materialId); List<LdDurableForm> selectByMaterialId(@Param("materialId") Long materialId, @Param("departmentId") String departmentId);
List<LdTwoInventoryVO> selectByIds(@Param("durableIds") List<Long> durableIds); List<LdTwoInventoryVO> selectByIds(@Param("durableIds") List<Long> durableIds);
} }

@ -18,4 +18,5 @@ public class LdTwoInventoryDto {
* 物资类型 YH/NY * 物资类型 YH/NY
*/ */
private String type; private String type;
} }

@ -0,0 +1,23 @@
package com.nov.KgLowDurable.pojo.vo;
import lombok.Data;
import java.util.List;
/**
* @author: liweidong
* @create: 2026-01-14
* 分组物资类
*/
@Data
public class GroupMaterialVO {
private String materialName;
private String unit;
private String model;
private String materialCode;
private String remark;
private Long materialId;
private Integer applyNum;
private String picture;
private List<LdTwoInventoryVO> twoInventoryVOList;
}

@ -0,0 +1,20 @@
package com.nov.KgLowDurable.pojo.vo;
import lombok.Data;
import java.util.List;
/**
* @author: liweidong
* @create: 2026-01-14
* 分组结果类
*/
@Data
public class GroupResultVO {
private String groupName;
private Integer totalMaterials;
private Integer totalApplyNum;
private String year;
private List<GroupMaterialVO> materials;
private String quarter;
}

@ -0,0 +1,17 @@
package com.nov.KgLowDurable.pojo.vo;
import lombok.Data;
@Data
public class GroupVO {
/**
* 分组ID
*/
private String groupIds;
/**
* 分组名称
*/
private String groupName;
}

@ -17,9 +17,10 @@ public interface ILdConsumerFormService extends IService<LdConsumerForm> {
/** /**
* 根据物资ID查询二级易耗库存 * 根据物资ID查询二级易耗库存
* @param materialId * @param materialId
* @param demandDepartment
* @return * @return
*/ */
LdConsumerForm getByMaterialId(Long materialId); LdConsumerForm getByMaterialId(Long materialId, String demandDepartment);
/** /**
* 获取二级出库物资列表 * 获取二级出库物资列表

@ -36,9 +36,10 @@ public interface ILdDurableFormService extends IService<LdDurableForm> {
/** /**
* 根据物资ID 查询 * 根据物资ID 查询
* @param materialId * @param materialId
* @param departmentId
* @return * @return
*/ */
LdDurableForm getByMaterialId(Long materialId); List<LdDurableForm> getByMaterialId(Long materialId, String departmentId);
/** /**
* 根据IDS 擦汗讯 * 根据IDS 擦汗讯

@ -3,8 +3,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.nov.KgLowDurable.pojo.dto.LdTwoOutStorageDto; import com.nov.KgLowDurable.pojo.dto.LdTwoOutStorageDto;
import com.nov.KgLowDurable.pojo.entity.LdTwoOutStorage; import com.nov.KgLowDurable.pojo.entity.LdTwoOutStorage;
import com.nov.KgLowDurable.pojo.vo.GroupMaterialVO;
import com.nov.KgLowDurable.pojo.vo.GroupVO;
import com.nov.KgLowDurable.pojo.vo.LdTwoOutStorageInfoVO; import com.nov.KgLowDurable.pojo.vo.LdTwoOutStorageInfoVO;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
@ -38,4 +41,18 @@ public interface ILdTwoOutStorageService extends IService<LdTwoOutStorage> {
* @return * @return
*/ */
LdTwoOutStorageInfoVO getDetail(Long twoOutStorageId); LdTwoOutStorageInfoVO getDetail(Long twoOutStorageId);
/**
* 获取分组名称
* @return
*/
List<GroupVO> getOutGroupName();
/**
* 获取物资清单
* @param groupName
* @param departmentId
* @return
*/
List<GroupMaterialVO> getGroupMaterial(String groupName, String departmentId);
} }

@ -1,6 +1,8 @@
package com.nov.KgLowDurable.service; package com.nov.KgLowDurable.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.nov.KgLowDurable.pojo.entity.User; import com.nov.KgLowDurable.pojo.entity.User;
import com.nov.KgLowDurable.pojo.vo.GroupMaterialVO;
import com.nov.KgLowDurable.pojo.vo.GroupVO;
import com.nov.KgLowDurable.pojo.vo.UserInfoVO; import com.nov.KgLowDurable.pojo.vo.UserInfoVO;
import java.util.List; import java.util.List;
@ -46,4 +48,18 @@ public interface IUserService extends IService<User> {
* @param json * @param json
*/ */
void submitApproval(String json); void submitApproval(String json);
/**
* 获取分组名称
* @return
*/
List<GroupVO> getOutGroupName();
/**
* 获取物资清单
* @param groupName
* @param departmentId
* @return
*/
List<GroupMaterialVO> getGroupMaterial(String groupName, String departmentId);
} }

@ -3,23 +3,16 @@ package com.nov.KgLowDurable.service.Impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.nov.KgLowDurable.constant.BatchConstant;
import com.nov.KgLowDurable.exception.CustomerException;
import com.nov.KgLowDurable.mapper.LdConsumerFormMapper; import com.nov.KgLowDurable.mapper.LdConsumerFormMapper;
import com.nov.KgLowDurable.pojo.entity.LdConsumerForm; import com.nov.KgLowDurable.pojo.entity.LdConsumerForm;
import com.nov.KgLowDurable.pojo.entity.Role;
import com.nov.KgLowDurable.pojo.entity.RoleUser;
import com.nov.KgLowDurable.pojo.entity.User;
import com.nov.KgLowDurable.pojo.vo.LdTwoInventoryVO; import com.nov.KgLowDurable.pojo.vo.LdTwoInventoryVO;
import com.nov.KgLowDurable.service.*; import com.nov.KgLowDurable.service.*;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/** /**
* 服务实现类 * 服务实现类
@ -45,8 +38,8 @@ public class LdConsumerFormServiceImpl extends ServiceImpl<LdConsumerFormMapper,
IRoleService roleService; IRoleService roleService;
@Override @Override
public LdConsumerForm getByMaterialId(Long materialId) { public LdConsumerForm getByMaterialId(Long materialId, String demandDepartment) {
return consumerFormMapper.selectByMaterialId(materialId); return consumerFormMapper.selectByMaterialId(materialId,demandDepartment);
} }
@Override @Override

@ -59,8 +59,8 @@ public class LdDurableFormServiceImpl extends ServiceImpl<LdDurableFormMapper, L
} }
@Override @Override
public LdDurableForm getByMaterialId(Long materialId) { public List<LdDurableForm> getByMaterialId(Long materialId, String departmentId) {
return durableFormMapper.selectByMaterialId(materialId); return durableFormMapper.selectByMaterialId(materialId,departmentId);
} }
@Override @Override

@ -42,6 +42,15 @@ public class LdTwoOutStorageDetailServiceImpl extends ServiceImpl<LdTwoOutStorag
@Override @Override
public List getTwoOutInventory(List<LdTwoInventoryDto> materialDto) { public List getTwoOutInventory(List<LdTwoInventoryDto> materialDto) {
// //分组获取物资清单时处理materialCode字段
// List<String> materialCodes = materialDto.stream()
// .map(LdTwoInventoryDto::getMaterialCode)
// .filter(code -> code != null && !code.trim().isEmpty())
// .collect(Collectors.toList());
// if(!CollectionUtils.isEmpty(materialCodes)){
//
//
// }
// 获取易耗品类型的twoInventoryId列表 // 获取易耗品类型的twoInventoryId列表
List<Long> consumerIds = materialDto.stream() List<Long> consumerIds = materialDto.stream()
.filter(dto -> BatchConstant.CONSUMER.equals(dto.getType())) .filter(dto -> BatchConstant.CONSUMER.equals(dto.getType()))

@ -12,12 +12,11 @@ import com.nov.KgLowDurable.mapper.LdTwoOutStorageMapper;
import com.nov.KgLowDurable.pojo.dto.ApplyRequest.*; import com.nov.KgLowDurable.pojo.dto.ApplyRequest.*;
import com.nov.KgLowDurable.pojo.dto.LdTwoOutStorageDto; import com.nov.KgLowDurable.pojo.dto.LdTwoOutStorageDto;
import com.nov.KgLowDurable.pojo.entity.*; import com.nov.KgLowDurable.pojo.entity.*;
import com.nov.KgLowDurable.pojo.vo.LdOnePutStorageDetailVO; import com.nov.KgLowDurable.pojo.vo.*;
import com.nov.KgLowDurable.pojo.vo.LdTwoOutStorageInfoVO;
import com.nov.KgLowDurable.pojo.vo.UserInfoVO;
import com.nov.KgLowDurable.service.*; import com.nov.KgLowDurable.service.*;
import com.nov.KgLowDurable.util.SerialNumberUtil; import com.nov.KgLowDurable.util.SerialNumberUtil;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -25,6 +24,7 @@ import org.springframework.util.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 服务实现类 * 服务实现类
@ -215,4 +215,41 @@ public class LdTwoOutStorageServiceImpl extends ServiceImpl<LdTwoOutStorageMappe
.setLdTwoOutStorage(ldTwoOutStorage) .setLdTwoOutStorage(ldTwoOutStorage)
.setLdTwoOutStorageDetailList(ldTwoOutStorageDetailList); .setLdTwoOutStorageDetailList(ldTwoOutStorageDetailList);
} }
@Override
public List<GroupVO> getOutGroupName() {
return userService.getOutGroupName();
}
@Override
public List<GroupMaterialVO> getGroupMaterial(String groupName, String departmentId) {
List<GroupMaterialVO> materialVOList = userService.getGroupMaterial(groupName, departmentId);
if(!CollectionUtils.isEmpty(materialVOList)){
for (GroupMaterialVO groupMaterialVO : materialVOList) {
List<LdTwoInventoryVO> list = new ArrayList<>();
LdTwoInventoryVO ldTwoInventoryVO = new LdTwoInventoryVO();
//处理易耗
LdConsumerForm consumerForm = consumerFormService.getByMaterialId(groupMaterialVO.getMaterialId(), departmentId);
if(null != consumerForm){
BeanUtils.copyProperties(consumerForm, ldTwoInventoryVO);
}
//耐用
List<LdDurableForm> durableFormList = durableFormService.getByMaterialId(groupMaterialVO.getMaterialId(), departmentId);
List<LdTwoInventoryVO> collect = durableFormList.stream()
.map(form -> {
LdTwoInventoryVO vo = new LdTwoInventoryVO();
BeanUtils.copyProperties(form, vo);
return vo;
})
.collect(Collectors.toList());
list.add(ldTwoInventoryVO);
list.addAll(collect);
groupMaterialVO.setTwoInventoryVOList(list);
}
}
return materialVOList;
}
} }

@ -271,8 +271,8 @@ public class LdTwoPutStorageServiceImpl extends ServiceImpl<LdTwoPutStorageMappe
// 参数校验 // 参数校验
validateDetailForConsumer(detail); validateDetailForConsumer(detail);
// 处理库存 // 处理库存 本部门
LdConsumerForm inventory = consumerFormService.getByMaterialId(detail.getMaterialId()); LdConsumerForm inventory = consumerFormService.getByMaterialId(detail.getMaterialId(),detail.getDemandDepartment());
if (inventory == null) { if (inventory == null) {
// 新增库存 // 新增库存

@ -3,28 +3,22 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nov.KgLowDurable.mapper.UserMapper; import com.nov.KgLowDurable.mapper.UserMapper;
import com.nov.KgLowDurable.pojo.entity.Department; import com.nov.KgLowDurable.pojo.entity.*;
import com.nov.KgLowDurable.pojo.entity.LdApprove; import com.nov.KgLowDurable.pojo.vo.*;
import com.nov.KgLowDurable.pojo.entity.Role; import com.nov.KgLowDurable.service.*;
import com.nov.KgLowDurable.pojo.entity.User;
import com.nov.KgLowDurable.pojo.vo.UserInfoVO;
import com.nov.KgLowDurable.service.IDepartmentService;
import com.nov.KgLowDurable.service.ILdApproveService;
import com.nov.KgLowDurable.service.IUserService;
import com.nov.KgLowDurable.util.HttpUtils;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.http.util.EntityUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.stream.Collectors;
/** /**
* 服务实现类 * 服务实现类
@ -44,6 +38,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
@Autowired @Autowired
IDepartmentService departmentService; IDepartmentService departmentService;
@Override @Override
public UserInfoVO getUserInfo() throws Exception { public UserInfoVO getUserInfo() throws Exception {
// Map<String, String> headers = new HashMap<String, String>() {{ // Map<String, String> headers = new HashMap<String, String>() {{
@ -322,5 +317,87 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
// e.printStackTrace(); // e.printStackTrace();
// } // }
}
@Override
public List<GroupVO> getOutGroupName() {
// Map<String, String> headers = new HashMap<String, String>() {{
// put("Content-Type", "application/json");
// }};
//
// Map<String, String> querys = new HashMap<String, String>() {{
// }};
//
// String resp = null;
// try {
// resp = EntityUtils.toString(
// HttpUtils.doGet(
// "http://10.90.100.231:8132",
// "/ld-person-form/getOutGroupName",
// "GET",
// headers,
// querys
// ).getEntity()
// );
// } catch (Exception e) {
// e.printStackTrace();
// }
// JSONObject obj = JSON.parseObject(resp);
//
// if (!"200".equals(obj.getString("code"))) {
// throw new RuntimeException("失败: " + obj.getString("message"));
// }
String resp = "{\"success\":true,\"message\":\"获取所有可出库分组名称成功\",\"code\":200,\"result\":[{\"groupIds\":\"44\",\"groupName\":\"B分组\"},{\"groupIds\":null,\"groupName\":\"自由出库\"}],\"timestamp\":1768356690213}";
JSONObject obj = JSON.parseObject(resp);
List<GroupVO> list = obj.getJSONArray("result").toJavaList(GroupVO.class);
if(CollectionUtils.isEmpty(list)){
throw new RuntimeException("解析失败: " + obj.getString("message"));
}
return list;
}
@Override
public List<GroupMaterialVO> getGroupMaterial(String groupName, String departmentId) {
// Map<String, String> headers = new HashMap<String, String>() {{
// put("Content-Type", "application/json");
// }};
//
// Map<String, String> querys = new HashMap<String, String>() {{
// put("groupName",groupName);
// }};
//
// String resp = null;
// try {
// resp = EntityUtils.toString(
// HttpUtils.doGet(
// "http://10.90.100.231:8132",
// "/ld-person-form/getGroupMaterial",
// "GET",
// headers,
// querys
// ).getEntity()
// );
// } catch (Exception e) {
// e.printStackTrace();
// }
// JSONObject obj = JSON.parseObject(resp);
// if (!"200".equals(obj.getString("code"))) {
// throw new RuntimeException("失败: " + obj.getString("message"));
// }
String resp = "{\"success\":true,\"message\":\"获取物资需求清单成功\",\"code\":200,\"result\":{\"groupName\":\"A分组\",\"totalMaterials\":2,\"totalApplyNum\":6,\"year\":\"2026\",\"materials\":[{\"materialName\":\"A1复印纸\",\"unit\":null,\"model\":null,\"materialCode\":\"03001\",\"remark\":\"胶水\",\"materialId\":\"53\",\"applyNum\":4,\"picture\":null},{\"materialName\":\"文件夹1\",\"unit\":null,\"model\":null,\"materialCode\":\"03001\",\"remark\":\"文件夹\",\"materialId\":\"1\",\"applyNum\":2,\"picture\":null}],\"quarter\":\"1\"},\"timestamp\":1768352459318}";
JSONObject obj = JSON.parseObject(resp);
GroupResultVO result = JSON.parseObject(
obj.getJSONObject("result").toString(),
GroupResultVO.class
);
List<GroupMaterialVO> materialVOList = result.getMaterials();
return materialVOList;
} }
} }

@ -21,7 +21,7 @@
</resultMap> </resultMap>
<select id="selectByMaterialId" resultType="com.nov.KgLowDurable.pojo.entity.LdConsumerForm"> <select id="selectByMaterialId" resultType="com.nov.KgLowDurable.pojo.entity.LdConsumerForm">
select * from ld_consumer_form where material_id = #{materialId} select * from ld_consumer_form where material_id = #{materialId} and department_id = #{demandDepartment}
</select> </select>
<select id="selectByDepartmentId" resultType="com.nov.KgLowDurable.pojo.entity.LdConsumerForm"> <select id="selectByDepartmentId" resultType="com.nov.KgLowDurable.pojo.entity.LdConsumerForm">
select * from ld_consumer_form where department_id = #{departmentId} select * from ld_consumer_form where department_id = #{departmentId}

@ -35,7 +35,7 @@
</if> </if>
</select> </select>
<select id="selectByMaterialId" resultType="com.nov.KgLowDurable.pojo.entity.LdDurableForm"> <select id="selectByMaterialId" resultType="com.nov.KgLowDurable.pojo.entity.LdDurableForm">
select * from ld_durable_form where material_id = #{materialId} select * from ld_durable_form where material_id = #{materialId} and department_id =#{departmentId}
</select> </select>
<select id="selectByIds" resultType="com.nov.KgLowDurable.pojo.vo.LdTwoInventoryVO"> <select id="selectByIds" resultType="com.nov.KgLowDurable.pojo.vo.LdTwoInventoryVO">
select * from ld_durable_form where id in select * from ld_durable_form where id in

Loading…
Cancel
Save