JAVA全系列 教程
3762个小节阅读:7088.2k
目录
C语言快速入门
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
序号 | 接口名称 | 接口地址 | 请求类型 |
---|---|---|---|
1 | 查询批次库存及价格 | /erp/inventoryLog/listInventoryLogForPage | get |
参数名称 | 是否必须 |
---|---|
pageNum | 否 |
pageSize | 否 |
返回JSON数据
名称 | 类型 | 其他信息 |
---|---|---|
total | int | |
code | int | |
msg | String | |
data | object [] | item 类型: object |
├─ inventoryLogId | String | |
├─ purchaseId | String | |
├─ medicinesId | String | |
├─ inventoryLogNum | int | |
├─ tradePrice | int | |
├─ tradeTotalAmount | int | |
├─ batchNumber | String | |
├─ medicinesName | String | |
├─ medicinesType | String | |
├─ prescriptionType | String | |
├─ producterId | String | |
├─ conversion | int | |
├─ unit | String | |
├─ createTime | String | |
├─ createBy | String | |
├─ providerId | String |
xxxxxxxxxx
package com.bjsxt.dto;
import ...
/**
*
*/
@ApiModel(value = "com-bjsxt-dto-InventoryLogDto")
@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
public class InventoryLogDto extends BaseDto {
/**
* 采购单据ID
*/
@ApiModelProperty(value = "采购单据ID")
private String purchaseId;
/**
* 药品名称
*/
@ApiModelProperty(value = "药品名称")
private String medicinesName;
/**
* 药品分类 sys_dict_data表his_medicines_type
*/
@ApiModelProperty(value = "药品分类 sys_dict_data表his_medicines_type")
private String medicinesType;
/**
* 处方类型 sys_dict_data表his_prescription_type
*/
@ApiModelProperty(value = "处方类型 sys_dict_data表his_prescription_type")
private String prescriptionType;
/**
* 生产厂家ID
*/
@ApiModelProperty(value = "生产厂家ID")
private String producterId;
}
xxxxxxxxxx
package com.bjsxt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bjsxt.domain.InventoryLog;
/**
*
*/
public interface InventoryLogMapper extends BaseMapper<InventoryLog> {
}
InventoryLogMapper.xml
xxxxxxxxxx
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bjsxt.mapper.InventoryLogMapper">
<resultMap id="BaseResultMap" type="com.bjsxt.domain.InventoryLog">
<!--@mbg.generated-->
<!--@Table stock_inventory_log-->
<id column="inventory_log_id" jdbcType="VARCHAR" property="inventoryLogId" />
<result column="purchase_id" jdbcType="VARCHAR" property="purchaseId" />
<result column="medicines_id" jdbcType="VARCHAR" property="medicinesId" />
<result column="inventory_log_num" jdbcType="INTEGER" property="inventoryLogNum" />
<result column="trade_price" jdbcType="DECIMAL" property="tradePrice" />
<result column="trade_total_amount" jdbcType="DECIMAL" property="tradeTotalAmount" />
<result column="batch_number" jdbcType="VARCHAR" property="batchNumber" />
<result column="medicines_name" jdbcType="VARCHAR" property="medicinesName" />
<result column="medicines_type" jdbcType="CHAR" property="medicinesType" />
<result column="prescription_type" jdbcType="CHAR" property="prescriptionType" />
<result column="producter_id" jdbcType="VARCHAR" property="producterId" />
<result column="conversion" jdbcType="INTEGER" property="conversion" />
<result column="unit" jdbcType="VARCHAR" property="unit" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
inventory_log_id, purchase_id, medicines_id, inventory_log_num, trade_price, trade_total_amount,
batch_number, medicines_name, medicines_type, prescription_type, producter_id, `conversion`,
unit, create_time, create_by
</sql>
</mapper>
xxxxxxxxxx
package com.bjsxt.service;
import com.bjsxt.dto.InventoryLogDto;
import com.bjsxt.vo.DataGridView;
/**
*
*/
public interface InventoryLogService {
/**
* 分页查询
*
* @param inventoryLogDto
* @return
*/
DataGridView listInventoryLogPage(InventoryLogDto inventoryLogDto);
}
xxxxxxxxxx
package com.bjsxt.service.impl;
import ...
/**
*
* 代表当前类里面的Medicines这个主就去只调一次,不重试
*/
@Service
public class InventoryLogServiceImpl implements InventoryLogService {
@Autowired
private InventoryLogMapper inventoryLogMapper;
@Override
public DataGridView listInventoryLogPage(InventoryLogDto inventoryLogDto) {
Page<InventoryLog> page=new Page<>(inventoryLogDto.getPageNum(),inventoryLogDto.getPageSize());
QueryWrapper<InventoryLog> qw=new QueryWrapper<>();
qw.like(StringUtils.isNotBlank(inventoryLogDto.getPurchaseId()),
InventoryLog.COL_PURCHASE_ID,inventoryLogDto.getPurchaseId());
qw.like(StringUtils.isNotBlank(inventoryLogDto.getMedicinesName()),
InventoryLog.COL_MEDICINES_NAME,inventoryLogDto.getMedicinesName());
qw.eq(StringUtils.isNotBlank(inventoryLogDto.getMedicinesType()),
InventoryLog.COL_MEDICINES_TYPE,inventoryLogDto.getMedicinesType());
qw.eq(StringUtils.isNotBlank(inventoryLogDto.getPrescriptionType()),
InventoryLog.COL_PRESCRIPTION_TYPE,inventoryLogDto.getPrescriptionType());
qw.eq(StringUtils.isNotBlank(inventoryLogDto.getProducterId()),
InventoryLog.COL_PRODUCTER_ID,inventoryLogDto.getProducterId());
qw.eq(StringUtils.isNotBlank(inventoryLogDto.getPrescriptionType()),
InventoryLog.COL_PRESCRIPTION_TYPE,inventoryLogDto.getPrescriptionType());
qw.ge(inventoryLogDto.getBeginTime()!=null,InventoryLog.COL_CREATE_TIME,
inventoryLogDto.getBeginTime());
qw.le(inventoryLogDto.getEndTime()!=null,InventoryLog.COL_CREATE_TIME,
inventoryLogDto.getEndTime());
qw.orderByDesc(InventoryLog.COL_CREATE_TIME);
this.inventoryLogMapper.selectPage(page,qw);
return new DataGridView(page.getTotal(),page.getRecords());
}
}
xxxxxxxxxx
package com.bjsxt.controller.erp;
import ...
/**
* @Auther:
* @Description:入库记录控制器
*/
@RestController
@RequestMapping("erp/inventoryLog")
public class InventoryLogController {
@Reference//使用dubbo的引用
private InventoryLogService inventoryLogService;
/**
* 分页查询
*/
@GetMapping("listInventoryLogForPage")
public AjaxResult listMedicinesForPage(InventoryLogDto inventoryLogDto){
DataGridView gridView = this.inventoryLogService.listInventoryLogPage(inventoryLogDto);
return AjaxResult.success("查询成功",gridView.getData(),gridView.getTotal());
}
}
查询批次库存/erp/inventoryLog/listInventoryLogForPage