Commit e863b34d by 李小惠

修改出入库实体类以及其他层

parent d8e8568a
...@@ -41,11 +41,21 @@ public class LogSummaryReq extends BaseRequest { ...@@ -41,11 +41,21 @@ public class LogSummaryReq extends BaseRequest {
private String locationId; private String locationId;
/** /**
* 箱门id
*/
private String cabinetboxId;
/**
* 存储名称:XX仓库,XX单警柜 * 存储名称:XX仓库,XX单警柜
*/ */
private String locationName; private String locationName;
/** /**
* 0仓库,1单警柜
*/
private Integer locationType;
/**
* 设备标识 * 设备标识
*/ */
private String device; private String device;
......
...@@ -19,10 +19,11 @@ public class CabinetInOutRecordsReq { ...@@ -19,10 +19,11 @@ public class CabinetInOutRecordsReq {
//出入设备:0手持机/1单警柜/2通道 //出入设备:0手持机/1单警柜/2通道
private Integer deviceType; private Integer deviceType;
private String cabinetId; private String locationId;
//单警柜名称 //单警柜名称
private String locationName; private String locationName;
private String cabinetboxId;
//操作时间 //操作时间
private Date useTIme; private Date useTIme;
......
...@@ -4,8 +4,6 @@ import com.junmp.jyzb.api.bean.dto.*; ...@@ -4,8 +4,6 @@ import com.junmp.jyzb.api.bean.dto.*;
import com.junmp.jyzb.api.bean.query.*; import com.junmp.jyzb.api.bean.query.*;
import com.junmp.jyzb.api.bean.req.BatchEditingInvsReq; import com.junmp.jyzb.api.bean.req.BatchEditingInvsReq;
import com.junmp.jyzb.api.bean.req.EquipmentBindReq; import com.junmp.jyzb.api.bean.req.EquipmentBindReq;
import com.junmp.jyzb.api.bean.req.RabbitMqOrderReq;
import com.junmp.jyzb.entity.Inventory;
import com.junmp.jyzb.entity.InventorySummary; import com.junmp.jyzb.entity.InventorySummary;
import com.junmp.jyzb.entity.LogDetail; import com.junmp.jyzb.entity.LogDetail;
import com.junmp.jyzb.entity.LogSummary; import com.junmp.jyzb.entity.LogSummary;
...@@ -226,22 +224,22 @@ public class InventoryController { ...@@ -226,22 +224,22 @@ public class InventoryController {
//装备出入库记录(根据单据id) //装备出入库记录(根据单据id)
@PostMapping("/ShowInOutRecordsByOrder") @PostMapping("/ShowInOutRecordsByOrder")
@ApiOperation("出入库单据记录查询展示") @ApiOperation("出入库单据查询展示")
public ApiRes<PageResult<LogSummary>> ShowInOutRecordsPage(@RequestBody @Validated(ValidationApi.detail.class) LogSummaryReq req){ public ApiRes<PageResult<LogSummary>> ShowInOutRecordsPage(@RequestBody @Validated(ValidationApi.detail.class) LogSummaryReq req){
return ApiRes.success(inventoryService.ShowInOutRecordsPage(req)); return ApiRes.success(inventoryService.ShowInOutRecordsPage(req));
} }
//装备出入库记录(根据单据id //装备出入库记录(根据条件查询
@PostMapping("/ShowInOutRecordsByItems") @PostMapping("/ShowInOutRecordsByItems")
@ApiOperation("出入库单据记录查询展示") @ApiOperation("出入库记录条件查询展示")
public ApiRes<PageResult<LogSummary>> ShowInOutRecordsByItems(@RequestBody @Validated(ValidationApi.detail.class) LogSummaryReq req){ public ApiRes<PageResult<LogSummary>> ShowInOutRecordsByItems(@RequestBody @Validated(ValidationApi.detail.class) LogSummaryReq req){
return ApiRes.success(inventoryService.ShowInOutRecordsPage(req)); return ApiRes.success(inventoryService.ShowInOutRecordsPage(req));
} }
//通过装备id查询某一件装备的出入库记录 //通过装备id查询某一件装备的出入库记录
@PostMapping("/ShowInOutRecordsByEqs") @PostMapping("/ShowInOutRecordsByEqs")
@ApiOperation("出入库单据记录查询展示") @ApiOperation("出入库记录装备id查询展示")
public ApiRes<PageResult<LogDetail>> getInOutRecords(@RequestBody @Validated(ValidationApi.detail.class) InventoryReq req){ public ApiRes<PageResult<LogDetail>> getInOutRecords(@RequestBody @Validated(ValidationApi.detail.class) InventoryReq req){
return ApiRes.success(inventoryService.getInOutRecords(req)); return ApiRes.success(inventoryService.getInOutRecords(req));
} }
......
...@@ -70,6 +70,7 @@ public class OrderController { ...@@ -70,6 +70,7 @@ public class OrderController {
return ApiRes.success(orderMainService.updateOrder(req)); return ApiRes.success(orderMainService.updateOrder(req));
} }
//查询任务列表(根据组织机构id) //查询任务列表(根据组织机构id)
@PostMapping("/GetOrderPage") @PostMapping("/GetOrderPage")
@ApiOperation("/查询任务列表") @ApiOperation("/查询任务列表")
......
package com.junmp.jyzb.entity; package com.junmp.jyzb.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
@ApiModel(value = "com-junmp-jyzb-domain-LogDetail") /**
*
* @TableName base_log_detail
*/
@TableName(value ="base_log_detail")
@Data @Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("base_log_detail")
public class LogDetail implements Serializable { public class LogDetail implements Serializable {
/** /**
* 出入库明细ID * 出入库明细ID
*/ */
@ApiModelProperty(value = "出入库明细ID") private Long id;
private Integer id; /**
* 出入库汇总id
*/
@TableField(value = "summary_id")
private Long summaryId;
/** /**
* 物资id * 物资id
*/ */
@ApiModelProperty(value = "物资id") @TableField(value = "inventory_id")
@TableField("inventory_id")
private String inventoryId; private String inventoryId;
/** /**
* 出入库汇总ID * 单据ID
*/ */
@ApiModelProperty(value = "出入库汇总ID") @TableField(value = "order_main_id")
@TableField("summary_id") private String orderMainId;
private Integer summaryId;
/** /**
* 单据ID * 业务类型
*/ */
@ApiModelProperty(value = "单据ID") @TableField(value = "bussiness_type")
@TableField("order_main_id") private String bussinessType;
private String orderMainId;
/** /**
* EPC信息 * EPC信息
*/ */
@ApiModelProperty(value = "EPC信息") @TableField(value = "epc")
private String epc; private String epc;
/** /**
* 装备名称 * 装备类型id
*/ */
@ApiModelProperty(value = "装备名称id") @TableField(value = "type_id")
@TableField("type_id")
private String typeId; private String typeId;
/** /**
* 装备名称 * 装备类型名称
*/ */
@ApiModelProperty(value = "装备名称") @TableField(value = "type_name")
@TableField("type_name")
private String typeName; private String typeName;
/** /**
* 装备号型id * 装备号型id
*/ */
@ApiModelProperty(value = "装备号型id") @TableField(value = "size_id")
@TableField("size_id")
private String sizeId; private String sizeId;
/** /**
* 装备号型 * 装备号型名称
*/ */
@ApiModelProperty(value = "装备号型") @TableField(value = "size_name")
@TableField("size_name")
private String sizeName; private String sizeName;
/** /**
* 供应商id * 供应商id
*/ */
@ApiModelProperty(value = "供应商") @TableField(value = "supplier_id")
@TableField("supplier_id")
private String supplierId; private String supplierId;
/** /**
* 供应商 * 供应商名称
*/ */
@ApiModelProperty(value = "供应商") @TableField(value = "supplier_name")
@TableField("supplier_name")
private String supplierName; private String supplierName;
/** /**
* 装备类型:0单件/1装备包 * 装备类型:0单件/1装备包
*/ */
@ApiModelProperty(value = "装备类型:0单件/1装备包") @TableField(value = "equipment_type")
@TableField("equipment_type")
private Integer equipmentType; private Integer equipmentType;
/** /**
* 箱门id
*/
@TableField(value = "cabinetbox_id")
private String cabinetboxId;
/**
* 状态,0正常/1异常 * 状态,0正常/1异常
*/ */
@ApiModelProperty(value = "状态,0正常/1异常") @TableField(value = "error_state")
@TableField("error_state")
private Integer errorState; private Integer errorState;
/** /**
* 出入库类型:0出库/1入 * 出入状态:in入库,out出
*/ */
@ApiModelProperty(value = "出入库类型:0出库/1入库") @TableField(value = "out_in_state")
@TableField("out_in_state")
private String outInState; private String outInState;
/** /**
* 创建时间 * 创建时间
*/ */
@TableField(value = "create_time", fill = FieldFill.INSERT) @TableField(value = "create_time")
private Date createTime; private Date createTime;
/** /**
* 更新时间 * 更新时间
*/ */
@TableField(value = "update_time", fill = FieldFill.UPDATE) @TableField(value = "update_time")
private Date updateTime; private Date updateTime;
/** /**
* 更新人员 * 更新人员
*/ */
@TableField(value = "update_user", fill = FieldFill.INSERT) @TableField(value = "update_user")
private String updateUser; private String updateUser;
/** /**
* 创建人员 * 创建人员
*/ */
@TableField(value = "create_user", fill = FieldFill.UPDATE) @TableField(value = "create_user")
private String createUser; private String createUser;
/** /**
* 照片信息 * 照片信息
*/ */
@ApiModelProperty(value = "照片信息") @TableField(value = "picture")
private String picture; private String picture;
/** /**
* 作业设备:0手持机 1单警柜 2通道) * 出入设备:0手持机/1单警柜/2通道
*/ */
@ApiModelProperty(value = "业务类型") @TableField(value = "device_type")
@TableField("device_type")
private Integer deviceType; private Integer deviceType;
/** private static final long serialVersionUID = 1L;
* 存储ID
*/
@ApiModelProperty(value = "存储ID")
@TableField("location_id")
private String locationId;
/**
* 存储名称:XX仓库,XX单警柜
*/
@ApiModelProperty(value = "存储名称")
@TableField("location_name")
private String locationName;
/**
* 单警柜id
*/
@ApiModelProperty(value = "单警柜id")
@TableField("cabinet_id")
private String cabinetId;
@TableField(exist = false)
private String cabinetBoxNum;
private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
package com.junmp.jyzb.entity; package com.junmp.jyzb.entity;
import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import lombok.*; import lombok.Data;
@ApiModel(value = "com-junmp-jyzb-domain-LogSummary") /**
*
* @TableName base_log_summary
*/
@TableName(value ="base_log_summary")
@Data @Data
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
@TableName("base_log_summary")
public class LogSummary implements Serializable { public class LogSummary implements Serializable {
/** /**
* 出入库汇总ID * 出入库汇总ID
*/ */
@ApiModelProperty(value = "出入库汇总ID") private Long id;
private Integer id;
/** /**
* 组织机构ID * 组织机构ID
*/ */
@ApiModelProperty(value = "组织机构ID") @TableField(value = "org_id")
@TableField("org_id")
private Long orgId; private Long orgId;
/** /**
* 组织机构名称 * 组织机构名称
*/ */
@ApiModelProperty(value = "组织机构名称") @TableField(value = "org_name")
@TableField("org_name")
private String orgName; private String orgName;
/** /**
* 单据id * 单据ID
*/ */
@ApiModelProperty(value = "单据id") @TableField(value = "order_main_id")
@TableField("order_main_id")
private String orderMainId; private String orderMainId;
/** /**
* 设备标识 * 设备标识
*/ */
@ApiModelProperty(value = "设备标识") @TableField(value = "device")
@TableField(value = "device",updateStrategy = FieldStrategy.IGNORED)
private String device; private String device;
/** /**
* 出入设备:0手持机/1单警柜/2通道 * 出入设备:0手持机/1单警柜/2通道
*/ */
@ApiModelProperty(value = "出入设备:0手持机/1单警柜/2通道") @TableField(value = "device_type")
@TableField(value = "device_type",updateStrategy = FieldStrategy.IGNORED)
private Integer deviceType; private Integer deviceType;
/** /**
* 位置id(存放单警柜id或者是仓库id)
*/
@TableField(value = "location_id")
private String locationId;
/**
* 位置名称(单警柜,仓库)
*/
@TableField(value = "location_name")
private String locationName;
/**
* 所属位置(0仓库1单警柜)
*/
@TableField(value = "location_type")
private Integer locationType;
/**
* 操作时间 * 操作时间
*/ */
@ApiModelProperty(value = "操作时间") @TableField(value = "use_time")
@TableField("use_time")
private Date useTime; private Date useTime;
/** /**
* 业务类型 * 业务类型
*/ */
@ApiModelProperty(value = "业务类型") @TableField(value = "bussiness_type")
@TableField("bussiness_type")
private String bussinessType; private String bussinessType;
/** /**
* 操作人员姓名 * 操作人员姓名
*/ */
@ApiModelProperty(value = "操作人员姓名") @TableField(value = "user_name")
@TableField("user_name")
private String userName; private String userName;
/** /**
* 照片信息 * 照片信息
*/ */
@ApiModelProperty(value = "照片信息") @TableField(value = "picture")
private String picture; private String picture;
/** /**
* 装备记录集合,警棍、盾牌 * 装备记录集合,警棍/盾牌
*/ */
@ApiModelProperty(value = "装备记录集合") @TableField(value = "equipment_list")
@TableField("equipment_List")
private String equipmentList; private String equipmentList;
/** /**
* 创建时间 * 创建时间
*/ */
@TableField(value = "create_time", fill = FieldFill.INSERT) @TableField(value = "create_time")
private Date createTime; private Date createTime;
/** /**
* 更新时间 * 更新时间
*/ */
@TableField(value = "update_time", fill = FieldFill.UPDATE) @TableField(value = "update_time")
private Date updateTime; private Date updateTime;
/** /**
* 更新人员 * 更新人员
*/ */
@TableField(value = "update_user", fill = FieldFill.INSERT) @TableField(value = "update_user")
private String updateUser; private String updateUser;
/** /**
* 创建人员 * 创建人员
*/ */
@TableField(value = "create_user", fill = FieldFill.UPDATE) @TableField(value = "create_user")
private String createUser; private String createUser;
@TableField(exist = false) @TableField(exist = false)
...@@ -125,11 +129,5 @@ public class LogSummary implements Serializable { ...@@ -125,11 +129,5 @@ public class LogSummary implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public List<LogDetail> getLogDetailList() {
return logDetailList;
}
public void setLogDetailList(List<LogDetail> logDetailList) {
this.logDetailList = logDetailList;
}
} }
\ No newline at end of file
package com.junmp.jyzb.mapper; package com.junmp.jyzb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.junmp.jyzb.entity.LogDetail; import com.junmp.jyzb.entity.LogDetail;
import org.apache.ibatis.annotations.Mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@Mapper /**
* @author lxh专属坐骑
* @description 针对表【base_log_detail】的数据库操作Mapper
* @createDate 2023-10-13 08:29:42
* @Entity com.junmp.jyzb.entity.LogDetail
*/
public interface LogDetailMapper extends BaseMapper<LogDetail> { public interface LogDetailMapper extends BaseMapper<LogDetail> {
}
\ No newline at end of file }
package com.junmp.jyzb.mapper; package com.junmp.jyzb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.junmp.jyzb.api.bean.dto.LogSummaryDto;
import com.junmp.jyzb.api.bean.query.LogSummaryReq; import com.junmp.jyzb.api.bean.query.LogSummaryReq;
import com.junmp.jyzb.entity.LogSummary; import com.junmp.jyzb.entity.LogSummary;
import org.apache.ibatis.annotations.Mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@Mapper /**
* @author lxh专属坐骑
* @description 针对表【base_log_summary】的数据库操作Mapper
* @createDate 2023-10-13 08:29:36
* @Entity com.junmp.jyzb.entity.LogSummary
*/
public interface LogSummaryMapper extends BaseMapper<LogSummary> { public interface LogSummaryMapper extends BaseMapper<LogSummary> {
IPage<LogSummary> ShowInOutRecordsPage(Page<LogSummary> page,@Param("req") LogSummaryReq req); IPage<LogSummary> ShowInOutRecordsPage(Page<LogSummary> page, @Param("req") LogSummaryReq req);
IPage<LogSummary> ShowInOutRecordsByItems(Page<LogSummary> page,@Param("req") LogSummaryReq req); IPage<LogSummary> ShowInOutRecordsByWarehouse(Page<LogSummary> page,@Param("req") LogSummaryReq req);
} IPage<LogSummary> ShowInOutRecordsByCabinet(Page<LogSummary> page,@Param("req") LogSummaryReq req);
\ No newline at end of file // IPage<LogSummary> ShowInOutRecordsPage(Page<LogSummary> page,@Param("req") LogSummaryReq req);
// IPage<LogSummary> ShowInOutRecordsByItems(Page<LogSummary> page,@Param("req") LogSummaryReq req);
}
...@@ -11,13 +11,9 @@ import com.junmp.jyzb.entity.Inventory; ...@@ -11,13 +11,9 @@ import com.junmp.jyzb.entity.Inventory;
import com.junmp.jyzb.entity.InventorySummary; import com.junmp.jyzb.entity.InventorySummary;
import com.junmp.jyzb.entity.LogDetail; import com.junmp.jyzb.entity.LogDetail;
import com.junmp.jyzb.entity.LogSummary; import com.junmp.jyzb.entity.LogSummary;
import com.junmp.jyzb.utils.ResponseResult;
import com.junmp.v2.db.api.page.PageResult; import com.junmp.v2.db.api.page.PageResult;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.Map;
public interface InventoryService extends IService<Inventory> { public interface InventoryService extends IService<Inventory> {
//根据装备id查询出装备的详细信息 //根据装备id查询出装备的详细信息
......
package com.junmp.jyzb.service; package com.junmp.jyzb.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.junmp.jyzb.entity.LogDetail; import com.junmp.jyzb.entity.LogDetail;
public interface LogDetailService extends IService<LogDetail> { import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author lxh专属坐骑
* @description 针对表【base_log_detail】的数据库操作Service
* @createDate 2023-10-13 08:29:42
*/
public interface LogDetailService extends IService<LogDetail> {
} }
package com.junmp.jyzb.service; package com.junmp.jyzb.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.junmp.jyzb.entity.LogSummary; import com.junmp.jyzb.entity.LogSummary;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author lxh专属坐骑
* @description 针对表【base_log_summary】的数据库操作Service
* @createDate 2023-10-13 08:29:36
*/
public interface LogSummaryService extends IService<LogSummary> { public interface LogSummaryService extends IService<LogSummary> {
} }
...@@ -27,6 +27,7 @@ import org.springframework.stereotype.Service; ...@@ -27,6 +27,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -56,7 +57,8 @@ public class BusFormServiceImpl extends ServiceImpl<BusFormMapper, BusForm> impl ...@@ -56,7 +57,8 @@ public class BusFormServiceImpl extends ServiceImpl<BusFormMapper, BusForm> impl
busForm.setBussinessCode(orderNum.getBussinessType()+"-"+orderNum.getYear()+"-"+ busForm.setBussinessCode(orderNum.getBussinessType()+"-"+orderNum.getYear()+"-"+
LocalDateTime.now().getMonth().getValue()+"-"+LocalDateTime.now().getDayOfMonth()+"-"+codeValue); LocalDateTime.now().getMonth().getValue()+"-"+LocalDateTime.now().getDayOfMonth()+"-"+codeValue);
busForm.setCreateTime(DateTimeUtil.getCurrentDateTime()); busForm.setCreateTime(DateTimeUtil.getCurrentDateTime());
save(busForm); String id= UUID.randomUUID().toString();
busForm.setId(id);
//执行工作流 //执行工作流
if (req.getExamineState().equals("working")) if (req.getExamineState().equals("working"))
{ {
...@@ -67,8 +69,17 @@ public class BusFormServiceImpl extends ServiceImpl<BusFormMapper, BusForm> impl ...@@ -67,8 +69,17 @@ public class BusFormServiceImpl extends ServiceImpl<BusFormMapper, BusForm> impl
startProcessInstanceDTO.setUserId(req.getUserId()); startProcessInstanceDTO.setUserId(req.getUserId());
String ProcessInstanceId= FlowInstanceService.startProcessInstanceById(startProcessInstanceDTO); String ProcessInstanceId= FlowInstanceService.startProcessInstanceById(startProcessInstanceDTO);
busForm.setProcessId(ProcessInstanceId); busForm.setProcessId(ProcessInstanceId);
this.save(busForm);
}
if (req.getExamineState().equals("none")){//如果是草稿
if(ObjectUtil.isNotNull(req.getId())){
//已经是一个草稿,在点击提交的时候只需要更新即可,因为数据库中已经存在该单据
updateById(busForm);
}else {
//保存
this.save(busForm);
}
} }
updateById(busForm);
return busForm.getId(); return busForm.getId();
} }
......
...@@ -576,12 +576,14 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory ...@@ -576,12 +576,14 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
public PageResult<LogSummary> ShowInOutRecordsPage(LogSummaryReq req) { public PageResult<LogSummary> ShowInOutRecordsPage(LogSummaryReq req) {
Page<LogSummary> page = PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize()); Page<LogSummary> page = PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize());
IPage<LogSummary> ipage=logSummaryMapper.ShowInOutRecordsPage(page,req); IPage<LogSummary> ipage=logSummaryMapper.ShowInOutRecordsPage(page,req);
List<LogSummary> logSummaryList=new ArrayList<>();
ipage.getRecords().forEach(logSummary -> { ipage.getRecords().forEach(logSummary -> {
List<LogDetail> list = logDetailService.list(new LambdaQueryWrapper<LogDetail>() List<LogDetail> list = logDetailService.list(new LambdaQueryWrapper<LogDetail>()
.eq(LogDetail::getSummaryId, logSummary.getId())); .eq(LogDetail::getSummaryId, logSummary.getId()));
logSummary.setLogDetailList(list); logSummary.setLogDetailList(list);
logSummaryList.add(logSummary);
}); });
page.setRecords(ipage.getRecords()); page.setRecords(logSummaryList);
return PageResultFactory.createPageResult(page); return PageResultFactory.createPageResult(page);
} }
...@@ -589,8 +591,22 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory ...@@ -589,8 +591,22 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
@Override @Override
public PageResult<LogSummary> ShowInOutRecordsByItems(LogSummaryReq req) { public PageResult<LogSummary> ShowInOutRecordsByItems(LogSummaryReq req) {
Page<LogSummary> page = PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize()); Page<LogSummary> page = PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize());
IPage<LogSummary> ipage=logSummaryMapper.ShowInOutRecordsByItems(page,req); List<LogSummary> logSummaryList=new ArrayList<>();
return null; IPage<LogSummary> ipage;
if (req.getLocationType()==1){
ipage = logSummaryMapper.ShowInOutRecordsByWarehouse(page, req);
}else {
ipage=logSummaryMapper.ShowInOutRecordsByCabinet(page,req);
}
ipage.getRecords().forEach(logSummary -> {
List<LogDetail> list = logDetailService.list(new LambdaQueryWrapper<LogDetail>()
.eq(LogDetail::getSummaryId, logSummary.getId()));
logSummary.setLogDetailList(list);
logSummaryList.add(logSummary);
});
page.setRecords(logSummaryList);
return PageResultFactory.createPageResult(page);
} }
//获取装备的出入库信息(根据装备id获取该装备的出入库记录) //获取装备的出入库信息(根据装备id获取该装备的出入库记录)
......
...@@ -116,11 +116,12 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa ...@@ -116,11 +116,12 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
BeanPlusUtil.copyProperties(req.getOrderDetailReq(),orderDetail); BeanPlusUtil.copyProperties(req.getOrderDetailReq(),orderDetail);
orderDetailService.updateById(orderDetail); orderDetailService.updateById(orderDetail);
////对装备表进行更新或者插入 ////对装备表进行更新或者添加
//新增列表 //新增列表
List<Inventory> addList = new ArrayList<>(); List<Inventory> addList = new ArrayList<>();
//更新列表 //更新列表
List<Inventory> updateList = new ArrayList<>(); List<Inventory> updateList = new ArrayList<>();
//出库out,入库in
String bussinessState=orderMain.getOrderState(); String bussinessState=orderMain.getOrderState();
//组织机构 //组织机构
Long orgId; Long orgId;
...@@ -238,9 +239,8 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa ...@@ -238,9 +239,8 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
break; break;
} }
} }
//修改summary表中数据 //修改summary表中数据
boolean b = updateSummaryInsByCabinet(req.getCabinetId()); boolean b = updateSummaryInsByCabinet(req.getLocationId());
//添加日志记录、 //添加日志记录、
Boolean c = insertCabinetLog(req); Boolean c = insertCabinetLog(req);
return (a && b && c); return (a && b && c);
...@@ -259,14 +259,14 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa ...@@ -259,14 +259,14 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
public Boolean insertCabinetLog(CabinetInOutRecordsReq req){ public Boolean insertCabinetLog(CabinetInOutRecordsReq req){
LogSummary logSummary = new LogSummary(); LogSummary logSummary = new LogSummary();
BeanPlusUtil.copyProperties(req,logSummary); BeanPlusUtil.copyProperties(req,logSummary);
logSummary.setLocationType(1);
boolean a = logSummaryService.save(logSummary); boolean a = logSummaryService.save(logSummary);
List<InventoryReq> inventoryList = req.getInventoryList(); List<InventoryReq> inventoryList = req.getInventoryList();
List<LogDetail> logDetailList=new ArrayList<>(); List<LogDetail> logDetailList=new ArrayList<>();
for (InventoryReq inventoryReq:inventoryList) { for (InventoryReq inventoryReq:inventoryList) {
LogDetail logDetail = new LogDetail(); LogDetail logDetail = new LogDetail();
BeanPlusUtil.copyProperties(inventoryReq,logDetail); BeanPlusUtil.copyProperties(inventoryReq,logDetail);
logDetail.setCabinetId(req.getCabinetId()); logDetail.setCabinetboxId(req.getLocationId());
logDetail.setLocationName(req.getLocationName());
logDetail.setOutInState(inventoryReq.getLocationState()); logDetail.setOutInState(inventoryReq.getLocationState());
logDetail.setSummaryId(logSummary.getId()); logDetail.setSummaryId(logSummary.getId());
logDetailList.add(logDetail); logDetailList.add(logDetail);
......
...@@ -3,14 +3,20 @@ package com.junmp.jyzb.service.impl; ...@@ -3,14 +3,20 @@ package com.junmp.jyzb.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.junmp.jyzb.entity.LogDetail; import com.junmp.jyzb.entity.LogDetail;
import com.junmp.jyzb.service.LogDetailService; import com.junmp.jyzb.service.LogDetailService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.junmp.jyzb.mapper.LogDetailMapper; import com.junmp.jyzb.mapper.LogDetailMapper;
import org.springframework.stereotype.Service;
/**
* @author lxh专属坐骑
* @description 针对表【base_log_detail】的数据库操作Service实现
* @createDate 2023-10-13 08:29:42
*/
@Service @Service
public class LogDetailServiceImpl extends ServiceImpl<LogDetailMapper, LogDetail> implements LogDetailService { public class LogDetailServiceImpl extends ServiceImpl<LogDetailMapper, LogDetail>
implements LogDetailService{
@Resource
private LogDetailMapper logDetailMapper;
} }
...@@ -2,12 +2,21 @@ package com.junmp.jyzb.service.impl; ...@@ -2,12 +2,21 @@ package com.junmp.jyzb.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.junmp.jyzb.entity.LogSummary; import com.junmp.jyzb.entity.LogSummary;
import com.junmp.jyzb.mapper.LogSummaryMapper;
import com.junmp.jyzb.service.LogSummaryService; import com.junmp.jyzb.service.LogSummaryService;
import com.junmp.jyzb.mapper.LogSummaryMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/**
* @author lxh专属坐骑
* @description 针对表【base_log_summary】的数据库操作Service实现
* @createDate 2023-10-13 08:29:36
*/
@Service @Service
public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSummary> implements LogSummaryService { public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSummary>
implements LogSummaryService{
} }
package com.junmp.jyzb.service.impl; package com.junmp.jyzb.service.impl;
import com.junmp.jyzb.api.bean.query.InventorySumReq;
import com.junmp.jyzb.service.LogSummaryService;
import com.junmp.jyzb.service.MQProductService; import com.junmp.jyzb.service.MQProductService;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;
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.web.bind.annotation.PostMapping;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
......
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.junmp.jyzb.mapper.LogDetailMapper"> <mapper namespace="com.junmp.jyzb.mapper.LogDetailMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.entity.LogDetail">
<!--@mbg.generated--> <resultMap id="BaseResultMap" type="com.junmp.jyzb.entity.LogDetail">
<!--@Table base_log_detail--> <id property="id" column="id" jdbcType="BIGINT"/>
<id column="id" jdbcType="INTEGER" property="id" /> <result property="inventoryId" column="inventory_id" jdbcType="VARCHAR"/>
<result column="summary_id" jdbcType="INTEGER" property="summaryId" /> <result property="orderMainId" column="order_main_id" jdbcType="VARCHAR"/>
<result column="order_id" jdbcType="VARCHAR" property="orderId" /> <result property="bussinessType" column="bussiness_type" jdbcType="VARCHAR"/>
<result column="epc" jdbcType="VARCHAR" property="epc" /> <result property="epc" column="epc" jdbcType="VARCHAR"/>
<result column="equipment_name" jdbcType="VARCHAR" property="equipmentName" /> <result property="typeId" column="type_id" jdbcType="VARCHAR"/>
<result column="equipment_size" jdbcType="VARCHAR" property="equipmentSize" /> <result property="typeName" column="type_name" jdbcType="VARCHAR"/>
<result column="equipment_supplier" jdbcType="VARCHAR" property="equipmentSupplier" /> <result property="sizeId" column="size_id" jdbcType="VARCHAR"/>
<result column="equipment_type" jdbcType="INTEGER" property="equipmentType" /> <result property="sizeName" column="size_name" jdbcType="VARCHAR"/>
<result column="error_state" jdbcType="INTEGER" property="errorState" /> <result property="supplierId" column="supplier_id" jdbcType="VARCHAR"/>
<result column="note" jdbcType="VARCHAR" property="note" /> <result property="supplierName" column="supplier_name" jdbcType="VARCHAR"/>
</resultMap> <result property="equipmentType" column="equipment_type" jdbcType="INTEGER"/>
<sql id="Base_Column_List"> <result property="errorState" column="error_state" jdbcType="INTEGER"/>
<!--@mbg.generated--> <result property="outInState" column="out_in_state" jdbcType="VARCHAR"/>
id, summary_id, order_id, epc, equipment_name, equipment_size, equipment_supplier, <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
equipment_type, error_state, note <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</sql> <result property="updateUser" column="update_user" jdbcType="VARCHAR"/>
</mapper> <result property="createUser" column="create_user" jdbcType="VARCHAR"/>
\ No newline at end of file <result property="picture" column="picture" jdbcType="VARCHAR"/>
<result property="deviceType" column="device_type" jdbcType="INTEGER"/>
</resultMap>
<sql id="Base_Column_List">
id,inventory_id,order_main_id,
bussiness_type,epc,type_id,
type_name,size_id,size_name,
supplier_id,supplier_name,equipment_type,
error_state,out_in_state,create_time,
update_time,update_user,create_user,
picture,device_type
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.junmp.jyzb.mapper.LogSummaryMapper"> <mapper namespace="com.junmp.jyzb.mapper.LogSummaryMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.entity.LogSummary">
<!--@mbg.generated-->
<!--@Table base_log_summary-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="org_id" jdbcType="VARCHAR" property="orgId" />
<result column="org_name" jdbcType="VARCHAR" property="orgName" />
<result column="order_main_id" property="orderMainId"/>
<result column="device" jdbcType="VARCHAR" property="device" />
<result column="device_type" jdbcType="INTEGER" property="deviceType" />
<result column="use_time" jdbcType="TIMESTAMP" property="useTime" />
<result column="user_name" jdbcType="VARCHAR" property="userName" />
<result column="picture" jdbcType="VARCHAR" property="picture" />
<collection property="logDetailList" ofType="com.junmp.jyzb.entity.LogDetail" >
<id column="id" property="id"/>
<result column="inventory_id" property="inventoryId"></result>
<result column="order_main_id" property="orderMainId"></result>
<result column="summary_id" property="summaryId"></result>
</collection>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, org_id, org_name, warehouse_id, warehouse_name, device, device_type, use_time,
user_name, out_in_state, picture
</sql>
<select id="ShowInOutRecordsPage" resultType="com.junmp.jyzb.entity.LogSummary">
select * from base_log_summary ls
where ls.org_id = #{req.orgId} and ls.order_main_id=#{req.orderMainId}
</select>
<select id="ShowInOutRecordsByItems" resultType="com.junmp.jyzb.entity.LogSummary"> <resultMap id="BaseResultMap" type="com.junmp.jyzb.entity.LogSummary">
select * from base_log_summary ls <id property="id" column="id" jdbcType="BIGINT"/>
left join base_log_detail ld on ls.id = ld.summary_id <result property="orgId" column="org_id" jdbcType="BIGINT"/>
where ls.org_id = #{req.orgId} <result property="orgName" column="org_name" jdbcType="VARCHAR"/>
<if test="req.bussinessType != null and req.bussinessType !=''"> <result property="orderMainId" column="order_main_id" jdbcType="VARCHAR"/>
and ls.bussiness_type=#{req.bussinessType} <result property="device" column="device" jdbcType="VARCHAR"/>
</if> <result property="deviceType" column="device_type" jdbcType="INTEGER"/>
</select> <result property="locationId" column="location_id" jdbcType="VARCHAR"/>
<result property="locationName" column="location_name" jdbcType="VARCHAR"/>
<result property="locationType" column="location_type" jdbcType="INTEGER"/>
<result property="useTime" column="use_time" jdbcType="TIMESTAMP"/>
<result property="bussinessType" column="bussiness_type" jdbcType="VARCHAR"/>
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
<result property="picture" column="picture" jdbcType="VARCHAR"/>
<result property="equipmentList" column="equipment_List" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="updateUser" column="update_user" jdbcType="VARCHAR"/>
<result property="createUser" column="create_user" jdbcType="VARCHAR"/>
</resultMap>
</mapper> <sql id="Base_Column_List">
\ No newline at end of file id,org_id,org_name,
order_main_id,device,device_type,
location_id,location_name,location_type,
use_time,bussiness_type,user_name,
picture,equipment_List,create_time,
update_time,update_user,create_user
</sql>
<select id="ShowInOutRecordsPage" resultType="com.junmp.jyzb.entity.LogSummary">
select * from base_log_summary ls
where ls.org_id = #{req.orgId} and ls.order_main_id=#{req.orderMainId}
</select>
<select id="ShowInOutRecordsByWarehouse" resultType="com.junmp.jyzb.entity.LogSummary">
select * from base_log_summary ls
left join base_log_detail ld on ls.id = ld.summary_id
where ls.org_id = #{req.orgId} and ls.location_type=0
<if test="req.bussinessType != null and req.bussinessType !=''">
and ls.bussiness_type=#{req.bussinessType}
</if>
<if test="req.locationId != null and req.locationId !=''">
and ls.location_id=#{locationId}
</if>
<if test="req.typeId != null and req.typeId !=''">
and ld.type_id=#{req.typeId}
</if>
</select>
<select id="ShowInOutRecordsByCabinet" resultType="com.junmp.jyzb.entity.LogSummary">
select * from base_log_summary ls
left join base_log_detail ld on ls.id = ld.summary_id
where ls.org_id = #{req.orgId} and ls.location_type=1
<if test="req.locationId != null and req.locationId !=''">
and ls.location_id=#{req.locationId}
<if test="req.cabinetboxId != null and req.cabinetboxId !=''">
and ld.cabinetbox_id in (select id from base_cabinet_box cb where cb.cabinet_id=#{req.locationId})
</if>
</if>
</select>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论