1、筛选树
2、树的每级下的物料数量 3、检索(返回的数据需要带购物车id 查请领数量、置顶标识,是否已添加购物车):名称、规格型号、拼音、物料代码+筛选里面已选择的
This commit is contained in:
parent
a174388ccb
commit
e5db8cd238
|
|
@ -1,14 +1,18 @@
|
|||
package com.nu.modules.pad.invoicing.api;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nu.entity.MaterialCategoryEntity;
|
||||
import com.nu.entity.MaterialInfoEntity;
|
||||
import com.nu.modules.invoicing.api.IQinglingApi;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -22,6 +26,11 @@ public class InvoicingQldApi {
|
|||
@Autowired
|
||||
private IQinglingApi qinglingApi;
|
||||
|
||||
/**
|
||||
* 物料树查询(库房中已有物料)
|
||||
* @param configMaterialCategory
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取物料分类树", notes = "获取物料分类树")
|
||||
@GetMapping(value = "/getMaterialTreeData")
|
||||
public Result<List<Map<String, Object>>> getMaterialTreeData(MaterialCategoryEntity configMaterialCategory) {
|
||||
|
|
@ -30,4 +39,31 @@ public class InvoicingQldApi {
|
|||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物料三级分类对应类别下物料种类数量
|
||||
* @param configMaterialCategory
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="获取物料三级分类对应类别下物料种类数量", notes="获取物料三级分类对应类别下物料种类数量")
|
||||
@GetMapping(value = "/getTreeDataWlnum")
|
||||
public Result<Map<String,Object>> getTreeDataWlnum(MaterialCategoryEntity configMaterialCategory) {
|
||||
Map<String,Object> pageList = qinglingApi.getTreeDataWlnum(configMaterialCategory);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物料信息
|
||||
* @param materialInfoEntityDto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询物料信息-分页列表查询", notes = "查询物料信息-分页列表查询")
|
||||
@GetMapping(value = "/queryInvoicingList")
|
||||
public Result<IPage<MaterialInfoEntity>> queryInvoicingList(MaterialInfoEntity materialInfoEntityDto,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<MaterialInfoEntity> pageList = qinglingApi.queryInvoicingList(pageNo, pageSize, materialInfoEntityDto,req);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,4 +127,6 @@ public class MaterialInfoEntity implements Serializable {
|
|||
private String medicationName;
|
||||
private String isAdd;
|
||||
private String delId;
|
||||
|
||||
private String elderId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
package com.nu.modules.invoicing.api;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nu.entity.MaterialCategoryEntity;
|
||||
import com.nu.entity.MaterialInfoEntity;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -9,4 +12,8 @@ public interface IQinglingApi {
|
|||
|
||||
List<Map<String, Object>> getMaterialTreeData(MaterialCategoryEntity configMaterialCategory);
|
||||
|
||||
Map<String, Object> getTreeDataWlnum(MaterialCategoryEntity configMaterialCategory);
|
||||
|
||||
IPage<MaterialInfoEntity> queryInvoicingList(Integer pageNo, Integer pageSize, MaterialInfoEntity materialInfoEntityDto, HttpServletRequest req);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,27 @@
|
|||
package com.nu.modules.qld.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.entity.MaterialCategoryEntity;
|
||||
import com.nu.entity.MaterialInfoEntity;
|
||||
import com.nu.modules.ConfigMaterial.entity.ConfigMaterialCategory;
|
||||
import com.nu.modules.ConfigMaterial.entity.ConfigMaterialInfo;
|
||||
import com.nu.modules.ConfigMaterial.mapper.ConfigMaterialInfoMapper;
|
||||
import com.nu.modules.ConfigMaterial.service.IConfigMaterialCategoryService;
|
||||
import com.nu.modules.invoicing.api.IQinglingApi;
|
||||
import com.nu.modules.warehouseMaterialInfo.entity.BlWarehouseMaterialInfo;
|
||||
import com.nu.modules.warehouseMaterialInfo.mapper.BlWarehouseMaterialInfoMapper;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -22,13 +36,66 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
|
||||
@Autowired
|
||||
private IConfigMaterialCategoryService configMaterialCategoryService;
|
||||
@Autowired
|
||||
private ConfigMaterialInfoMapper configMaterialInfoMapper;
|
||||
@Autowired
|
||||
private BlWarehouseMaterialInfoMapper mterialInfoMapper;
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getMaterialTreeData(MaterialCategoryEntity materialCategoryEntity) {
|
||||
ConfigMaterialCategory configMaterialCategory = new ConfigMaterialCategory();
|
||||
BeanUtils.copyProperties(materialCategoryEntity,configMaterialCategory);
|
||||
List<Map<String,Object>> pageList = configMaterialCategoryService.getAllMaterialTreeData(configMaterialCategory);
|
||||
BeanUtils.copyProperties(materialCategoryEntity, configMaterialCategory);
|
||||
List<Map<String, Object>> pageList = configMaterialCategoryService.getAllMaterialTreeData(configMaterialCategory);
|
||||
return pageList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getTreeDataWlnum(MaterialCategoryEntity configMaterialCategory) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
QueryWrapper<ConfigMaterialInfo> queryWrapper = new QueryWrapper<ConfigMaterialInfo>();
|
||||
if (StringUtils.isEmpty(configMaterialCategory.getNuId())) {
|
||||
map.put("success", false);
|
||||
map.put("message", "参数错误");
|
||||
map.put("totalSize", null);
|
||||
return map;
|
||||
}
|
||||
queryWrapper.eq("a.del_flag", "0");
|
||||
queryWrapper.eq("a.iz_enabled", "Y");
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(configMaterialCategory.getCategoryId()), "b.category_id", configMaterialCategory.getCategoryId());
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(configMaterialCategory.getTypeId()), "b.type_id", configMaterialCategory.getTypeId());
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(configMaterialCategory.getMedicationId()), "b.medication_id", configMaterialCategory.getMedicationId());
|
||||
queryWrapper.in(StringUtils.isNotBlank(configMaterialCategory.getSuppliers()), "b.suppliers", configMaterialCategory.getSuppliers());
|
||||
List<ConfigMaterialInfo> list = configMaterialInfoMapper.getTreeDataWlnum(queryWrapper);
|
||||
map.put("success", true);
|
||||
map.put("message", "物料数量");
|
||||
map.put("totalSize", list.size());
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<MaterialInfoEntity> queryInvoicingList(Integer pageNo, Integer pageSize, MaterialInfoEntity materialInfoEntityDto, HttpServletRequest req) {
|
||||
if(StringUtils.isEmpty(materialInfoEntityDto.getNuId()) || StringUtils.isEmpty(materialInfoEntityDto.getElderId())){
|
||||
return new Page<>();
|
||||
}
|
||||
BlWarehouseMaterialInfo warehouseMaterialInfo = new BlWarehouseMaterialInfo();
|
||||
BeanUtils.copyProperties(materialInfoEntityDto, warehouseMaterialInfo);
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
QueryWrapper<BlWarehouseMaterialInfo> queryWrapper = QueryGenerator.initQueryWrapper(warehouseMaterialInfo, req.getParameterMap(), customeRuleMap);
|
||||
queryWrapper.apply(StringUtils.isNotBlank(warehouseMaterialInfo.getWlParamInfo()), "( material_name like '%" + warehouseMaterialInfo.getWlParamInfo() + "%' or material_no like '%" + warehouseMaterialInfo.getWlParamInfo() + "%' or pinyin like '%" + warehouseMaterialInfo.getWlParamInfo() + "%' or specification_model like '%" + warehouseMaterialInfo.getWlParamInfo() + "%' ) ");
|
||||
queryWrapper.eq(StringUtils.isNotBlank(warehouseMaterialInfo.getCategoryId()), "category_id", warehouseMaterialInfo.getCategoryId());
|
||||
queryWrapper.eq(StringUtils.isNotBlank(warehouseMaterialInfo.getTypeId()), "type_id", warehouseMaterialInfo.getTypeId());
|
||||
queryWrapper.eq(StringUtils.isNotBlank(warehouseMaterialInfo.getMedicationId()), "medication_id", warehouseMaterialInfo.getMedicationId());
|
||||
queryWrapper.in(StringUtils.isNotBlank(warehouseMaterialInfo.getSuppliers()), "suppliers", warehouseMaterialInfo.getSuppliers());
|
||||
if (StringUtils.isNotBlank(materialInfoEntityDto.getIsWaring()) && "1".equals(materialInfoEntityDto.getIsWaring())) {
|
||||
queryWrapper.apply("kcsl <= lower_limit");
|
||||
}
|
||||
queryWrapper.eq("del_flag", "0");
|
||||
queryWrapper.eq("iz_enabled", "Y");
|
||||
Page<BlWarehouseMaterialInfo> page = new Page<>(pageNo, pageSize);
|
||||
List<BlWarehouseMaterialInfo> list = mterialInfoMapper.selectListByZd(page, queryWrapper, materialInfoEntityDto);
|
||||
IPage<MaterialInfoEntity> entityPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal());
|
||||
entityPage.setRecords(BeanUtil.copyToList(list, MaterialInfoEntity.class));
|
||||
return entityPage;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -194,4 +194,9 @@ public class BlWarehouseMaterialInfo implements Serializable {
|
|||
private java.lang.String typeName;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String medicationName;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String zhiDingId;
|
||||
@TableField(exist = false)
|
||||
private Date zhiDingTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
/**
|
||||
* @Description: 库房物料配置信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-28
|
||||
* @Date: 2025-08-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface BlWarehouseMaterialInfoMapper extends BaseMapper<BlWarehouseMaterialInfo> {
|
||||
|
|
@ -24,11 +24,13 @@ public interface BlWarehouseMaterialInfoMapper extends BaseMapper<BlWarehouseMat
|
|||
|
||||
List<BlWarehouseMaterialInfo> getRemainingList(@Param("params") BlWarehouseMaterialInfo blWarehouseMaterialInfo);
|
||||
|
||||
void batchInsert(@Param("list")List<BlWarehouseMaterialInfo> list);
|
||||
void batchInsert(@Param("list") List<BlWarehouseMaterialInfo> list);
|
||||
|
||||
void deleteBatch(@Param("ids") String ids);
|
||||
|
||||
void deleteAllWuliao(@Param("nuId") String nuId);
|
||||
|
||||
List<BlWarehouseMaterialInfo> wlInfo(@Param(Constants.WRAPPER) QueryWrapper<BlWarehouseMaterialInfo> queryWrapper);
|
||||
|
||||
List<BlWarehouseMaterialInfo> selectListByZd(Page<BlWarehouseMaterialInfo> page, @Param(Constants.WRAPPER) QueryWrapper<BlWarehouseMaterialInfo> queryWrapper, @Param("dto") MaterialInfoEntity dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,4 +116,46 @@
|
|||
DELETE FROM nu_warehouse_material_info WHERE nu_id = #{nuId} and kcsl -0 <= 0
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
<select id="selectListByZd" resultType="com.nu.modules.warehouseMaterialInfo.entity.BlWarehouseMaterialInfo">
|
||||
select * from (
|
||||
select
|
||||
a.*,
|
||||
b.category_id,
|
||||
b.type_id,
|
||||
b.medication_id,
|
||||
b.material_name,
|
||||
b.pinyin,
|
||||
b.material_no,
|
||||
b.specification_model,
|
||||
b.suppliers,
|
||||
b.material_units,
|
||||
b.multi_unit_switch,
|
||||
b.one_unit,
|
||||
b.one_unit_proportion,
|
||||
b.one_unit_price,
|
||||
b.two_unit,
|
||||
b.two_unit_proportion,
|
||||
b.two_unit_price,
|
||||
b.multi_unit_type,
|
||||
b.upper_limit,
|
||||
b.lower_limit,
|
||||
b.tag_type,
|
||||
b.sales_unit_price,
|
||||
b.reference_unit_price,
|
||||
b.material_img,
|
||||
c.item_text as tagName,
|
||||
if(d.wl_id is null, '0', '1') as isAdd,
|
||||
e.id AS zhiDingId,
|
||||
e.create_time AS zhiDingTime
|
||||
from nu_warehouse_material_info a
|
||||
left join nu_config_material_info b on a.wl_id = b.id
|
||||
left join (select wl_id from nu_invoicing_qld_gwc where nu_id = #{dto.nuId} and elder_id = #{dto.elderId} GROUP BY wl_id) d on a.wl_id = d.wl_id
|
||||
left join sys_dict_item c on b.tag_type = c.item_value and c.dict_id = '1978662656563613698'
|
||||
left join nu_invoicing_qld_wlzd e on b.id = e.wl_id and e.nu_id = #{dto.nuId} and e.elder_id = #{dto.elderId}
|
||||
) a
|
||||
${ew.customSqlSegment}
|
||||
ORDER BY
|
||||
IF(e.id IS NULL, 0, 1) DESC,
|
||||
e.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue