Browse Source

出入库添加对应库存列表

humingfen 5 years ago
parent
commit
cbd7ea29de

+ 5 - 1
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceInventoryController.java

@ -62,6 +62,10 @@ public class IotDeviceInventoryController extends EnvelopRestEndpoint {
                                                                                              @RequestParam(value = "name", required = false) String name,
                                                                                              @ApiParam(name = "categoryCode", value = "设备类型标识")
                                                                                              @RequestParam(value = "categoryCode", required = false) String categoryCode,
                                                                                              @ApiParam(name = "hospital", value = "社区医院", defaultValue = "")
                                                                                                  @RequestParam(value = "hospital", required = false) String hospital,
                                                                                              @ApiParam(name = "productId", value = "产品id")
                                                                                                  @RequestParam(value = "productId", required = false) String productId,
                                                                                              @ApiParam(name = "type", value = "调拨类型(1入库 2设备调拨出库 3核销出库)")
                                                                                              @RequestParam(value = "type", required = false) Integer type,
                                                                                              @ApiParam(name = "page", value = "第几页", defaultValue = "1")
@ -69,7 +73,7 @@ public class IotDeviceInventoryController extends EnvelopRestEndpoint {
                                                                                              @ApiParam(name = "pageSize", value = "每页记录数")
                                                                                              @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        try {
            return deviceInventoryService.getDeviceInventoryLog(name, categoryCode, type, page, pageSize);
            return deviceInventoryService.getDeviceInventoryLog(name, categoryCode,hospital, productId, type, page, pageSize);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());

+ 7 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceInventoryService.java

@ -149,7 +149,7 @@ public class IotDeviceInventoryService extends BaseJpaService<IotDeviceInventory
        return deviceDOList.size();
    }
    public MixEnvelop<IotDeviceInventoryLogVO, IotDeviceInventoryLogVO> getDeviceInventoryLog(String name, String categoryCode, Integer type, Integer page, Integer pageSize) {
    public MixEnvelop<IotDeviceInventoryLogVO, IotDeviceInventoryLogVO> getDeviceInventoryLog(String name, String categoryCode, String hospital, String productId, Integer type, Integer page, Integer pageSize) {
        String sql = "SELECT l.*, count(d.id) num FROM `iot_device_inventory_log` l LEFT JOIN iot_device d on l.id = d.inventory_log_id where 1=1 ";
        if (StringUtils.isNotBlank(name)) {
            sql += "and l.name like '%" + name + "%' ";
@ -157,6 +157,12 @@ public class IotDeviceInventoryService extends BaseJpaService<IotDeviceInventory
        if (StringUtils.isNotBlank(categoryCode)) {
            sql += "and l.category_code = '" + categoryCode + "' ";
        }
        if (StringUtils.isNotBlank(productId)) {
            sql += "and l.product_id = '" + productId + "' ";
        }
        if (StringUtils.isNotBlank(hospital)) {
            sql += "and l.hospital = '" + hospital + "' ";
        }
        if (type != null) {
            sql += "and l.type = '" + type + "' ";
        }