Commit a4766f69 by 李小惠

修改测试的所有bug

parent 51d8b982
...@@ -131,24 +131,5 @@ public class InventoryDto implements Serializable { ...@@ -131,24 +131,5 @@ public class InventoryDto implements Serializable {
private String note ; private String note ;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 创建时间
*/
private String updateUser;
/**
* 更新时间
*/
private String createUser;
} }
...@@ -3,42 +3,25 @@ package com.junmp.jyzb.api.bean.dto; ...@@ -3,42 +3,25 @@ package com.junmp.jyzb.api.bean.dto;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@Data @Data
public class OrderDetailDto implements Serializable { public class OrderDetailDto implements Serializable {
private Long id; private String typeId;
private String orderId; private String typeName;
private String type; private Long sizeId;
private String equipmentType; private String sizeName;
private String equipmentTypeName; private String supplierId;
private Long equipmentSize; private String supplierName;
private String equipmentSizeName; private Integer planNum;
private Long equipment_supplier; private BigDecimal price;
private String equipmentSupplierName;
private String planNum;
private String actualNum;
private String price;
private String orderType;
private Date createTime;
private Date updateTime;
private String createUser;
private String updateUser;
} }
...@@ -3,15 +3,12 @@ package com.junmp.jyzb.api.bean.dto; ...@@ -3,15 +3,12 @@ package com.junmp.jyzb.api.bean.dto;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
@Data @Data
public class OrderDto implements Serializable { public class OrderDto implements Serializable {
private String id; private String id;
private String examineState;
private String processType;
/** /**
* 单据类型:入库单/出库单 * 单据类型:入库单/出库单
*/ */
...@@ -63,16 +60,12 @@ public class OrderDto implements Serializable { ...@@ -63,16 +60,12 @@ public class OrderDto implements Serializable {
/** /**
* 总价格 * 总价格
*/ */
private String price; private BigDecimal price;
/** /**
* 应入库数量 * 应入库数量
*/ */
private String inventoryQuantity; private String inventoryQuantity;
/** /**
* 附件地址
*/
private String attachmentLocation;
/**
* 单据包含的物资集合 * 单据包含的物资集合
*/ */
private String invList; private String invList;
......
...@@ -35,33 +35,16 @@ public class OrderMainDto implements Serializable { ...@@ -35,33 +35,16 @@ public class OrderMainDto implements Serializable {
private String endOrgUserName; private String endOrgUserName;
private String examineState;
private BigDecimal price; private BigDecimal price;
private Integer inventoryQuantity; private Integer inventoryQuantity;
private Integer actualQuantity;
private Integer manualState;
private Integer orderState;
private String attachmentLocation;
private String invList; private String invList;
/** private Date returnData;
* 创建时间
*/
private Date createTime;
/** private Date useDate;
* 更新时间
*/
private Date updateTime;
private String createUser; private String note;
private String updateUser;
} }
...@@ -60,6 +60,7 @@ public class InventoryReq extends BaseRequest { ...@@ -60,6 +60,7 @@ public class InventoryReq extends BaseRequest {
/** /**
* 货架位置 * 货架位置
*/ */
@NotBlank(message = "货架id不能为空",groups = {list.class})
private String shelfId; private String shelfId;
/** /**
......
package com.junmp.jyzb.api.bean.query; package com.junmp.jyzb.api.bean.query;
import com.junmp.v2.common.bean.request.BaseRequest;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
public class InventorySumReq { public class InventorySumReq extends BaseRequest {
/** /**
* 批次主键 * 批次主键
*/ */
......
package com.junmp.jyzb.api.bean.query; package com.junmp.jyzb.api.bean.query;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.junmp.v2.common.bean.request.BaseRequest; import com.junmp.v2.common.bean.request.BaseRequest;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@Data @Data
...@@ -20,23 +19,23 @@ public class OrderDetailReq extends BaseRequest { ...@@ -20,23 +19,23 @@ public class OrderDetailReq extends BaseRequest {
private String type; private String type;
private String equipmentType; private String typeId;
private String equipmentTypeName; private String typeName;
private Long equipmentSize; private Long sizeId;
private String equipmentSizeName; private String sizeName;
private Long equipment_supplier; private String supplierId;
private String equipmentSupplierName; private String supplierName;
private String planNum; private Integer planNum;
private String actualNum; private Integer actualNum;
private String price; private BigDecimal price;
private String orderType; private String orderType;
......
...@@ -58,7 +58,7 @@ public class OrderMainReq extends BaseRequest { ...@@ -58,7 +58,7 @@ public class OrderMainReq extends BaseRequest {
/** /**
* 组织机构id * 组织机构id
*/ */
@NotNull(message = "组织机构不能为空",groups = {edit.class}) @NotNull(message = "组织机构不能为空",groups = {edit.class, add.class})
private Long orgId; private Long orgId;
/** /**
......
...@@ -3,6 +3,7 @@ package com.junmp.jyzb.api.bean.req; ...@@ -3,6 +3,7 @@ package com.junmp.jyzb.api.bean.req;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
@Data @Data
public class DetailListReq implements Serializable { public class DetailListReq implements Serializable {
...@@ -17,24 +18,24 @@ public class DetailListReq implements Serializable { ...@@ -17,24 +18,24 @@ public class DetailListReq implements Serializable {
/** /**
* 类型id * 类型id
*/ */
private String equipmentType; private String typeId;
/** /**
* 类型名称 * 类型名称
*/ */
private String equipmentTypeName; private String typeName;
/** /**
* 号型 * 号型
*/ */
private String equipmentSize; private String sizeId;
private String equipmentSizeName; private String sizeName;
private Long equipmentSupplier; private String supplierId;
private String equipmentSupplierName; private String supplierName;
private String planNum; private Integer planNum;
private String price; private BigDecimal price;
} }
...@@ -14,11 +14,10 @@ import java.util.List; ...@@ -14,11 +14,10 @@ import java.util.List;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public class UpdateOrderReq extends BaseRequest implements Serializable { public class UpdateOrderReq extends BaseRequest implements Serializable {
@NotBlank(message = "id不能为空",groups = {edit.class}) @NotBlank(message = "id不能为空",groups = {edit.class})
private String Id; private String id;
private String examineState; private String examineState;
private String processType;
/** /**
* 单据类型:入库单/出库单 * 单据类型:入库单/出库单
*/ */
...@@ -33,6 +32,10 @@ public class UpdateOrderReq extends BaseRequest implements Serializable { ...@@ -33,6 +32,10 @@ public class UpdateOrderReq extends BaseRequest implements Serializable {
*/ */
private String bussinessType; private String bussinessType;
/** /**
* 业务类型中文简写(用于设置单据单号(订单号))
*/
private String bussinessBrief;
/**
* 订单号 * 订单号
*/ */
private String orderCode; private String orderCode;
...@@ -102,5 +105,7 @@ public class UpdateOrderReq extends BaseRequest implements Serializable { ...@@ -102,5 +105,7 @@ public class UpdateOrderReq extends BaseRequest implements Serializable {
*/ */
private List<DetailListReq> detailList; private List<DetailListReq> detailList;
} }
...@@ -109,10 +109,17 @@ public class InventoryController { ...@@ -109,10 +109,17 @@ public class InventoryController {
//查询箱门(cabinetBox下)所有装备简要信息列表(传递cabinetBoxId) //查询箱门(cabinetBox下)所有装备简要信息列表(传递cabinetBoxId)
@PostMapping("/searchEqsByBoxId") @PostMapping("/searchEqsByBoxId")
@ApiOperation("查询某一箱门下的所有装备简要信息") @ApiOperation("查询某一箱门下的所有装备简要信息(list)")
public ApiRes<List<EqsBriefDto>> searchEqsByBoxId(@RequestBody @Validated(ValidationApi.detail.class) CabinetBoxReq req){ public ApiRes<List<EqsBriefDto>> searchEqsByBoxId(@RequestBody @Validated(ValidationApi.detail.class) CabinetBoxReq req){
return ApiRes.success(inventoryService.searchEqsByBoxId(req)); return ApiRes.success(inventoryService.searchEqsByBoxId(req));
} }
//查询箱门(cabinetBox下)所有装备简要信息列表page(传递cabinetBoxId)
@PostMapping("/searchEqsByBoxIdPage")
@ApiOperation("查询某一箱门下的所有装备简要信息(page)")
public ApiRes<PageResult<EqsBriefDto>> searchEqsByBoxIdPage(@RequestBody @Validated(ValidationApi.detail.class) CabinetBoxReq req){
return ApiRes.success(inventoryService.searchEqsByBoxIdPage(req));
}
//查询单警柜箱门下的汇总信息(传递cabinetBoxId) //查询单警柜箱门下的汇总信息(传递cabinetBoxId)
@PostMapping("/EqsByCabinetBoxId") @PostMapping("/EqsByCabinetBoxId")
...@@ -139,12 +146,19 @@ public class InventoryController { ...@@ -139,12 +146,19 @@ public class InventoryController {
public ApiRes<PageResult<InventorySummary>> ShelfInventoryPage(@RequestBody @Validated(ValidationApi.edit.class) ShelfReq req){ public ApiRes<PageResult<InventorySummary>> ShelfInventoryPage(@RequestBody @Validated(ValidationApi.edit.class) ShelfReq req){
return ApiRes.success(inventoryService.ShelfInventoryPage(req)); return ApiRes.success(inventoryService.ShelfInventoryPage(req));
} }
@PostMapping("/ShelfInventoryDetail") @PostMapping("/ShelfInventoryDetail")
@ApiOperation(("/通过货架id查询每件装备信息简要")) @ApiOperation(("/通过货架id查询每件装备信息简要(list)"))
public ApiRes<List<EqsBriefDto>> AreaInventoryDetail(@RequestBody @Validated(ValidationApi.edit.class) ShelfReq req){ public ApiRes<List<EqsBriefDto>> AreaInventoryDetail(@RequestBody @Validated(ValidationApi.list.class) InventoryReq req){
return ApiRes.success(inventoryService.ShelfInventoryDetail(req)); return ApiRes.success(inventoryService.ShelfInventoryDetail(req));
} }
@PostMapping("/ShelfEqsPage")
@ApiOperation(("/通过货架id查询每件装备信息简要(page)"))
public ApiRes<PageResult<EqsBriefDto>> ShelfInventoryPage(@RequestBody @Validated(ValidationApi.list.class) InventoryReq req){
return ApiRes.success(inventoryService.ShelfInventoryPage(req));
}
//根据区域id查询装备信息汇总(list) //根据区域id查询装备信息汇总(list)
@PostMapping("/AreaInventoryList") @PostMapping("/AreaInventoryList")
@ApiOperation("根据区域id查询装备信息汇总(list)") @ApiOperation("根据区域id查询装备信息汇总(list)")
......
package com.junmp.jyzb.controller; package com.junmp.jyzb.controller;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.db.PageResult;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.junmp.jyzb.api.bean.dto.LogSummaryDto;
import com.junmp.jyzb.api.bean.dto.OrderDetailDto;
import com.junmp.jyzb.api.bean.dto.OrderDto; import com.junmp.jyzb.api.bean.dto.OrderDto;
import com.junmp.jyzb.api.bean.dto.OrderMainDto; import com.junmp.jyzb.api.bean.dto.OrderMainDto;
import com.junmp.jyzb.api.bean.query.OrderDetailReq;
import com.junmp.jyzb.api.bean.query.OrderMainReq; import com.junmp.jyzb.api.bean.query.OrderMainReq;
import com.junmp.jyzb.api.bean.req.UpdateOrderReq; import com.junmp.jyzb.api.bean.req.UpdateOrderReq;
import com.junmp.jyzb.entity.OrderMain;
import com.junmp.jyzb.service.LogSummaryService;
import com.junmp.jyzb.service.OrderLogService;
import com.junmp.jyzb.service.OrderService; import com.junmp.jyzb.service.OrderService;
import com.junmp.v2.common.bean.request.ValidationApi; import com.junmp.v2.common.bean.request.ValidationApi;
import com.junmp.v2.common.bean.response.ApiRes; import com.junmp.v2.common.bean.response.ApiRes;
import com.junmp.v2.db.api.page.PageResult;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -27,8 +19,6 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -27,8 +19,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@RestController @RestController
@Slf4j @Slf4j
...@@ -72,28 +62,19 @@ public class OrderController { ...@@ -72,28 +62,19 @@ public class OrderController {
return ApiRes.success(orderService.updateOrder(req)); return ApiRes.success(orderService.updateOrder(req));
} }
//根据任务单id查询对应的任务单信息 //查询任务列表(根据组织机构id)
@PostMapping("/GetOrderMain") @PostMapping("/GetOrderPage")
@ApiOperation("查询任务单信息") @ApiOperation("/查询任务列表")
public ApiRes<OrderMainDto> getOrderMain(@RequestBody @Validated(ValidationApi.detail.class)OrderMainReq req) { public ApiRes<PageResult<OrderMainDto>> getOrderPage(@RequestBody @Validated(ValidationApi.add.class)OrderMainReq req ){
OrderMainDto orderMainDto = orderService.showOrderMain(req); return ApiRes.success(orderService.getOrderPage(req));
return ApiRes.success(orderMainDto);
} }
//根据任务单id查询详细信息
@PostMapping("/GetOrderDetail") @PostMapping("/GetDetailById")
@ApiOperation("根据任务单id查看业务明细") @ApiOperation("根据任务单id查看业务明细")
public ApiRes<List<OrderDetailDto>> getOrderDetail(@RequestBody @Validated(ValidationApi.detail.class) OrderDetailReq req){ public ApiRes<OrderDto> GetDetailById(@RequestBody @Validated(ValidationApi.detail.class) OrderMainReq req){
List<OrderDetailDto> orderDetail = orderService.getOrderDetail(req); return ApiRes.success(orderService.GetDetailById(req));
return ApiRes.success(orderDetail);
} }
//查询任务列表
// @PostMapping("/GetOrgderPage")
// @ApiOperation("/查询任务列表")
// public ApiRes<PageResult<OrderMain>> getOrgderPage(@RequestBody @Validated(ValidationApi.edit.class)OrderMainReq req ){
// return ApiRes.success();
// }
// //将工作单添加到rabbitmq中去 // //将工作单添加到rabbitmq中去
// @PostMapping("/AddOrderRabbitMq") // @PostMapping("/AddOrderRabbitMq")
// @ApiOperation("将工作单添加到rabbitmq消息队列中去") // @ApiOperation("将工作单添加到rabbitmq消息队列中去")
......
...@@ -8,6 +8,7 @@ import lombok.Data; ...@@ -8,6 +8,7 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@Data @Data
...@@ -25,31 +26,31 @@ import java.util.Date; ...@@ -25,31 +26,31 @@ import java.util.Date;
private String type; private String type;
@TableField("equipment_type") @TableField("equipment_type")
private String equipmentType; private String typeId;
@TableField("equipment_type_name") @TableField("equipment_type_name")
private String equipmentTypeName; private String typeName;
@TableField("equipment_size") @TableField("equipment_size")
private Long equipmentSize; private Long sizeId;
@TableField("equipment_size_name") @TableField("equipment_size_name")
private String equipmentSizeName; private String sizeName;
@TableField("equipment_supplier") @TableField("equipment_supplier")
private Long equipmentSupplier; private String supplierId;
@TableField("equipment_supplier_name") @TableField("equipment_supplier_name")
private String equipmentSupplierName; private String supplierName;
@TableField("plan_num") @TableField("plan_num")
private String planNum; private Integer planNum;
@TableField("actual_num") @TableField("actual_num")
private String actualNum; private Integer actualNum;
@TableField("price") @TableField("price")
private String price; private BigDecimal price;
@TableField("order_type") @TableField("order_type")
private String orderType; private String orderType;
......
package com.junmp.jyzb.entity; package com.junmp.jyzb.entity;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import javax.xml.soap.Text;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@ApiModel(value="com-junmp-jyzb-domain-BussinessOrderMain")
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@TableName("bussiness_order_main") @TableName("bussiness_order_main")
public class OrderMain implements Serializable { public class OrderMain implements Serializable {
@TableId(value = "id",type = IdType.ASSIGN_UUID )
private String id; private String id;
@TableField("order_type") @TableField("order_type")
...@@ -60,6 +55,10 @@ public class OrderMain implements Serializable { ...@@ -60,6 +55,10 @@ public class OrderMain implements Serializable {
@TableField("examine_state") @TableField("examine_state")
private String examineState; private String examineState;
@TableField("form_item")
private String formItem;
@TableField("price") @TableField("price")
private BigDecimal price; private BigDecimal price;
...@@ -81,6 +80,15 @@ public class OrderMain implements Serializable { ...@@ -81,6 +80,15 @@ public class OrderMain implements Serializable {
@TableField("inv_list") @TableField("inv_list")
private String invList; private String invList;
@TableField("return_data")
private Date returnData;
@TableField("use_date")
private Date useDate;
@TableField("note")
private String note;
/** /**
* 创建时间 * 创建时间
*/ */
......
...@@ -17,7 +17,7 @@ import java.util.Date; ...@@ -17,7 +17,7 @@ import java.util.Date;
@TableName("bussiness_order_num") @TableName("bussiness_order_num")
public class OrderNum implements Serializable { public class OrderNum implements Serializable {
@TableId(value = "id",type = IdType.ASSIGN_UUID ) @TableId(value = "id",type = IdType.ASSIGN_UUID )
private Integer id; private String id;
@TableField("out_in_type") @TableField("out_in_type")
private String outInType; private String outInType;
......
...@@ -48,7 +48,8 @@ public interface InventoryService extends IService<Inventory> { ...@@ -48,7 +48,8 @@ public interface InventoryService extends IService<Inventory> {
PageResult<InventorySummary> ShelfInventoryPage(ShelfReq req); PageResult<InventorySummary> ShelfInventoryPage(ShelfReq req);
//通过货架id查询装备简要信息 //通过货架id查询装备简要信息
List<EqsBriefDto> ShelfInventoryDetail(ShelfReq req); List<EqsBriefDto> ShelfInventoryDetail(InventoryReq req);
PageResult<EqsBriefDto> ShelfInventoryPage(InventoryReq req);
//通过区域id查询装备信息汇总(list) //通过区域id查询装备信息汇总(list)
List<InventorySummary> AreaInventoryList(WarehouseAreaReq req); List<InventorySummary> AreaInventoryList(WarehouseAreaReq req);
...@@ -74,6 +75,6 @@ public interface InventoryService extends IService<Inventory> { ...@@ -74,6 +75,6 @@ public interface InventoryService extends IService<Inventory> {
//通过条件查询装备数量报表 //通过条件查询装备数量报表
List<EqsSumDto> GetListEquipment(InventoryReq req); List<EqsSumDto> GetListEquipment(InventoryReq req);
//查询箱门(cabinetBox下)所有装备简要信息列表page(传递cabinetBoxId)
PageResult<EqsBriefDto> searchEqsByBoxIdPage(CabinetBoxReq req);
} }
package com.junmp.jyzb.service; package com.junmp.jyzb.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.junmp.jyzb.api.bean.dto.OrderDetailDto;
import com.junmp.jyzb.api.bean.dto.OrderDto; import com.junmp.jyzb.api.bean.dto.OrderDto;
import com.junmp.jyzb.api.bean.dto.OrderMainDto; import com.junmp.jyzb.api.bean.dto.OrderMainDto;
import com.junmp.jyzb.api.bean.query.OrderDetailReq;
import com.junmp.jyzb.api.bean.query.OrderMainReq; import com.junmp.jyzb.api.bean.query.OrderMainReq;
import com.junmp.jyzb.api.bean.req.UpdateOrderReq; import com.junmp.jyzb.api.bean.req.UpdateOrderReq;
import com.junmp.jyzb.entity.OrderMain; import com.junmp.jyzb.entity.OrderMain;
import com.junmp.jyzb.utils.ResponseResult; import com.junmp.v2.db.api.page.PageResult;
import java.util.List;
import java.util.Map; import java.util.Map;
public interface OrderService extends IService<OrderMain> { public interface OrderService extends IService<OrderMain> {
...@@ -22,14 +17,17 @@ public interface OrderService extends IService<OrderMain> { ...@@ -22,14 +17,17 @@ public interface OrderService extends IService<OrderMain> {
Boolean updateOrder(UpdateOrderReq req); Boolean updateOrder(UpdateOrderReq req);
//通过任务单id获取任务单信息orderMain
OrderMainDto showOrderMain(OrderMainReq req);
//判断任务单是否存在 //判断任务单是否存在
OrderMain orderMainExist(String id); OrderMain orderMainExist(String id);
//根据任务单id查询详细信息
List<OrderDetailDto> getOrderDetail(OrderDetailReq req);
//查询任务列表(根据组织机构id)
PageResult<OrderMainDto> getOrderPage(OrderMainReq req);
//根据任务单id查看业务明细
OrderDto GetDetailById(OrderMainReq req);
//设置page的pageNo和pageSize的通用方法
public Map<String,Long> getPage(Long no,Long size);
} }
...@@ -8,6 +8,7 @@ import com.junmp.jyzb.api.bean.query.InventorySumReq; ...@@ -8,6 +8,7 @@ import com.junmp.jyzb.api.bean.query.InventorySumReq;
import com.junmp.jyzb.api.exception.enums.CabinetExceptionEnum; import com.junmp.jyzb.api.exception.enums.CabinetExceptionEnum;
import com.junmp.jyzb.entity.InventorySummary; import com.junmp.jyzb.entity.InventorySummary;
import com.junmp.jyzb.service.InventorySummaryService; import com.junmp.jyzb.service.InventorySummaryService;
import com.junmp.jyzb.service.OrderService;
import com.junmp.jyzb.service.PubOrgService; import com.junmp.jyzb.service.PubOrgService;
import com.junmp.v2.common.exception.base.ServiceException; import com.junmp.v2.common.exception.base.ServiceException;
import com.junmp.v2.db.api.factory.PageFactory; import com.junmp.v2.db.api.factory.PageFactory;
...@@ -18,6 +19,7 @@ import com.junmp.jyzb.mapper.InventorySummaryMapper; ...@@ -18,6 +19,7 @@ import com.junmp.jyzb.mapper.InventorySummaryMapper;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.Map;
@Service @Service
public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMapper, InventorySummary> implements InventorySummaryService { public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMapper, InventorySummary> implements InventorySummaryService {
...@@ -25,6 +27,9 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa ...@@ -25,6 +27,9 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
@Resource @Resource
private PubOrgService pubOrgService; private PubOrgService pubOrgService;
@Resource
private OrderService orderService;
//根据条件查询库存汇总信息 //根据条件查询库存汇总信息
@Override @Override
public PageResult<InventorySummary> getEquipmentInfo(InventorySumReq req) { public PageResult<InventorySummary> getEquipmentInfo(InventorySumReq req) {
...@@ -36,8 +41,15 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa ...@@ -36,8 +41,15 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
//如果传递了参数则判断是否存在,不存在则表示传递的参数一定不正确 //如果传递了参数则判断是否存在,不存在则表示传递的参数一定不正确
if (ObjectUtil.isNotNull(req.getLocationId())){ if (ObjectUtil.isNotNull(req.getLocationId())){
List<InventorySummary> list = list(new LambdaQueryWrapper<InventorySummary>().eq(InventorySummary::getLocationId, req.getLocationId())); List<InventorySummary> list = list(new LambdaQueryWrapper<InventorySummary>().eq(InventorySummary::getLocationId, req.getLocationId()));
//表示该单警柜或者仓库没有装备,那么直接返回一个空对象,设置一些简单的参数
if (list.size()==0){ if (list.size()==0){
throw new ServiceException(CabinetExceptionEnum.PARAMETER_ERROR); Map<String, Long> map = orderService.getPage(req.getPageNo(), req.getPageSize());
Page<InventorySummary> page=new Page<>(map.get("pageNo"), map.get("pageSize") );
InventorySummary inventorySummary = new InventorySummary();
list.add(inventorySummary);
page.setRecords(list);
return PageResultFactory.createPageResult(page);
} }
} }
LambdaQueryWrapper<InventorySummary> wp = createWrapper(req);//取出仓库中总数并计算 LambdaQueryWrapper<InventorySummary> wp = createWrapper(req);//取出仓库中总数并计算
......
...@@ -6,6 +6,8 @@ import com.junmp.jyzb.entity.OrderNum; ...@@ -6,6 +6,8 @@ import com.junmp.jyzb.entity.OrderNum;
import com.junmp.jyzb.mapper.OrderMainMapper; import com.junmp.jyzb.mapper.OrderMainMapper;
import com.junmp.jyzb.mapper.OrderNumMapper; import com.junmp.jyzb.mapper.OrderNumMapper;
import com.junmp.jyzb.service.OrderNumService; import com.junmp.jyzb.service.OrderNumService;
import org.springframework.stereotype.Service;
@Service
public class OrderNumServiceImpl extends ServiceImpl<OrderNumMapper, OrderNum> implements OrderNumService { public class OrderNumServiceImpl extends ServiceImpl<OrderNumMapper, OrderNum> implements OrderNumService {
} }
...@@ -160,7 +160,7 @@ delete from base_inventory_summary ...@@ -160,7 +160,7 @@ delete from base_inventory_summary
i.location_id as locationId, i.location_id as locationId,
</if> </if>
<if test="queryType=='cabinet'"> <if test="queryType=='cabinet'">
bcb.cabinet_id as locationId, (select id from base_cabinet where id =#{cabinetId}) as locationId,
</if> </if>
i.price as price, i.price as price,
i.shelf_id as shelfId, i.shelf_id as shelfId,
...@@ -183,7 +183,6 @@ delete from base_inventory_summary ...@@ -183,7 +183,6 @@ delete from base_inventory_summary
join base_equipment_size es on es.id = i.size_id join base_equipment_size es on es.id = i.size_id
join base_supplier s on s.id = i.supplier_id join base_supplier s on s.id = i.supplier_id
join pub_org po on i.org_id_int=po.org_id join pub_org po on i.org_id_int=po.org_id
join base_cabinet_box bcb on bcb.id=i.location_id
<if test="queryType == 'org'"> <if test="queryType == 'org'">
where org_id_int = #{orgId} where org_id_int = #{orgId}
</if> </if>
...@@ -193,6 +192,7 @@ delete from base_inventory_summary ...@@ -193,6 +192,7 @@ delete from base_inventory_summary
<if test="queryType == 'cabinet'"> <if test="queryType == 'cabinet'">
where location_id in (select id from base_cabinet_box where cabinet_id =#{cabinetId}) where location_id in (select id from base_cabinet_box where cabinet_id =#{cabinetId})
</if> </if>
ORDER BY i.type_id,i.size_id
</select> </select>
<select id="getSumByShelf" resultType="com.junmp.jyzb.entity.InventorySummary" <select id="getSumByShelf" resultType="com.junmp.jyzb.entity.InventorySummary"
parameterType="java.lang.String"> parameterType="java.lang.String">
...@@ -220,7 +220,8 @@ delete from base_inventory_summary ...@@ -220,7 +220,8 @@ delete from base_inventory_summary
join base_equipment_size s on s.id = bi.size_id join base_equipment_size s on s.id = bi.size_id
join pub_org po on bi.org_id_int = po.org_id join pub_org po on bi.org_id_int = po.org_id
WHERE location_type = 0 WHERE location_type = 0
GROUP BY type_id,size_id,bi.org_id_int,shelf_id)as t GROUP BY type_id,size_id,bi.org_id_int,shelf_id
ORDER BY type_id,size_id)as t
where shelf_id=#{shelfId} where shelf_id=#{shelfId}
</select> </select>
...@@ -249,7 +250,7 @@ delete from base_inventory_summary ...@@ -249,7 +250,7 @@ delete from base_inventory_summary
join pub_org po on bi.org_id_int = po.org_id join pub_org po on bi.org_id_int = po.org_id
WHERE location_type = 0 and bi.area_id=#{id} WHERE location_type = 0 and bi.area_id=#{id}
GROUP BY type_id,size_id,bi.org_id_int,bi.area_id GROUP BY type_id,size_id,bi.org_id_int,bi.area_id
ORDER BY type_id,size_id
</select> </select>
<select id="getSumByCabinetBox" resultType="com.junmp.jyzb.entity.InventorySummary" <select id="getSumByCabinetBox" resultType="com.junmp.jyzb.entity.InventorySummary"
parameterType="java.lang.String"> parameterType="java.lang.String">
...@@ -277,6 +278,7 @@ delete from base_inventory_summary ...@@ -277,6 +278,7 @@ delete from base_inventory_summary
join pub_org po on bi.org_id_int = po.org_id join pub_org po on bi.org_id_int = po.org_id
WHERE bi.location_type = 1 and bi.location_id=#{id} WHERE bi.location_type = 1 and bi.location_id=#{id}
GROUP BY location_id, type_id,size_id,bi.org_id_int GROUP BY location_id, type_id,size_id,bi.org_id_int
ORDER BY type_id,size_id
</select> </select>
<select id="GetListEquipment" resultType="com.junmp.jyzb.api.bean.dto.EqsSumDto"> <select id="GetListEquipment" resultType="com.junmp.jyzb.api.bean.dto.EqsSumDto">
SELECT SELECT
...@@ -369,7 +371,7 @@ delete from base_inventory_summary ...@@ -369,7 +371,7 @@ delete from base_inventory_summary
i.location_id as locationId, i.location_id as locationId,
</if> </if>
<if test="queryType=='cabinet'"> <if test="queryType=='cabinet'">
bcb.cabinet_id as locationId, (select id from base_cabinet where id =#{cabinetId}) as locationId,
</if> </if>
i.price as price, i.price as price,
i.shelf_id as shelfId, i.shelf_id as shelfId,
...@@ -392,7 +394,6 @@ delete from base_inventory_summary ...@@ -392,7 +394,6 @@ delete from base_inventory_summary
join base_equipment_size es on es.id = i.size_id join base_equipment_size es on es.id = i.size_id
join base_supplier s on s.id = i.supplier_id join base_supplier s on s.id = i.supplier_id
join pub_org po on i.org_id_int=po.org_id join pub_org po on i.org_id_int=po.org_id
join base_cabinet_box bcb on bcb.id=i.location_id
<if test="queryType == 'org'"> <if test="queryType == 'org'">
where org_id_int = #{orgId} where org_id_int = #{orgId}
</if> </if>
...@@ -402,6 +403,7 @@ delete from base_inventory_summary ...@@ -402,6 +403,7 @@ delete from base_inventory_summary
<if test="queryType == 'cabinet'"> <if test="queryType == 'cabinet'">
where location_id in (select id from base_cabinet_box where cabinet_id =#{cabinetId}) where location_id in (select id from base_cabinet_box where cabinet_id =#{cabinetId})
</if> </if>
ORDER BY i.type_id,i.size_id
</select> </select>
<select id="EqsByCabinetBoxIdPage" resultType="com.junmp.jyzb.entity.InventorySummary"> <select id="EqsByCabinetBoxIdPage" resultType="com.junmp.jyzb.entity.InventorySummary">
SELECT SELECT
...@@ -428,6 +430,7 @@ delete from base_inventory_summary ...@@ -428,6 +430,7 @@ delete from base_inventory_summary
join pub_org po on bi.org_id_int = po.org_id join pub_org po on bi.org_id_int = po.org_id
WHERE bi.location_type = 1 and bi.location_id=#{id} WHERE bi.location_type = 1 and bi.location_id=#{id}
GROUP BY location_id, type_id,size_id,bi.org_id_int GROUP BY location_id, type_id,size_id,bi.org_id_int
ORDER BY type_id,size_id
</select> </select>
<select id="ShelfInventoryPage" resultType="com.junmp.jyzb.entity.InventorySummary"> <select id="ShelfInventoryPage" resultType="com.junmp.jyzb.entity.InventorySummary">
select t.id,t.orgId,t.orgName,t.locationId,t.locationName,t.shelf_id,t.type_id,t.typeName,t.size_id,t.sizeName,t.number,t.price,t.stockNumber,t.outboundNumber,t.location_type select t.id,t.orgId,t.orgName,t.locationId,t.locationName,t.shelf_id,t.type_id,t.typeName,t.size_id,t.sizeName,t.number,t.price,t.stockNumber,t.outboundNumber,t.location_type
...@@ -454,7 +457,8 @@ delete from base_inventory_summary ...@@ -454,7 +457,8 @@ delete from base_inventory_summary
join base_equipment_size s on s.id = bi.size_id join base_equipment_size s on s.id = bi.size_id
join pub_org po on bi.org_id_int = po.org_id join pub_org po on bi.org_id_int = po.org_id
WHERE location_type = 0 WHERE location_type = 0
GROUP BY type_id,size_id,bi.org_id_int,shelf_id)as t GROUP BY type_id,size_id,bi.org_id_int,shelf_id
ORDER BY type_id,size_id)as t
where shelf_id=#{shelfId} where shelf_id=#{shelfId}
</select> </select>
<select id="AreaInventoryPage" resultType="com.junmp.jyzb.entity.InventorySummary"> <select id="AreaInventoryPage" resultType="com.junmp.jyzb.entity.InventorySummary">
...@@ -481,6 +485,7 @@ delete from base_inventory_summary ...@@ -481,6 +485,7 @@ delete from base_inventory_summary
join pub_org po on bi.org_id_int = po.org_id join pub_org po on bi.org_id_int = po.org_id
WHERE location_type = 0 and bi.area_id=#{id} WHERE location_type = 0 and bi.area_id=#{id}
GROUP BY type_id,size_id,bi.org_id_int,bi.area_id GROUP BY type_id,size_id,bi.org_id_int,bi.area_id
ORDER BY type_id,size_id
</select> </select>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论