Commit d8e8568a by 李小惠

修改工作流bug

parent c732a3a6
...@@ -77,6 +77,8 @@ public class InventoryReq extends BaseRequest { ...@@ -77,6 +77,8 @@ public class InventoryReq extends BaseRequest {
*/ */
@NotNull(message = "组织机构不能为空",groups = {export.class}) @NotNull(message = "组织机构不能为空",groups = {export.class})
private Long orgId; private Long orgId;
private String orgName;
/** /**
* 单警柜id * 单警柜id
*/ */
...@@ -105,8 +107,6 @@ public class InventoryReq extends BaseRequest { ...@@ -105,8 +107,6 @@ public class InventoryReq extends BaseRequest {
*/ */
private String locationState; private String locationState;
/** /**
* 生产日期 * 生产日期
*/ */
......
package com.junmp.jyzb.api.bean.req; package com.junmp.jyzb.api.bean.req;
import com.junmp.jyzb.api.bean.query.InventoryReq;
import lombok.Data; import lombok.Data;
import java.util.Date;
import java.util.List;
@Data @Data
public class CabinetInOutRecordsReq { public class CabinetInOutRecordsReq {
private String id; //组织机构id
private Long orgId; private Long orgId;
//组织机构名称
private String orgName; private String orgName;
//表示装备 //表示装备
private String device; private String device;
...@@ -13,40 +19,13 @@ public class CabinetInOutRecordsReq { ...@@ -13,40 +19,13 @@ public class CabinetInOutRecordsReq {
//出入设备:0手持机/1单警柜/2通道 //出入设备:0手持机/1单警柜/2通道
private Integer deviceType; private Integer deviceType;
/** private String cabinetId;
* 装备包ID //单警柜名称
*/
private String packageId;
/**
* 装备类型ID
*/
private String typeId;
/**
* 装备类型名称
*/
private String typeName;
/**
* 装备号型ID
*/
private String sizeId;
/**
* 装备号型
*/
private String sizeName;
/**
* 供应商
*/
private String supplierName;
/**
* 供应商ID
*/
private String supplierId;
//出入类型:0出库/1入库
private Integer outInState;
private String locationId;
private String locationName; private String locationName;
private String epc;
//操作时间
private Date useTIme;
private List<InventoryReq> inventoryList;
} }
...@@ -16,4 +16,9 @@ public class RabbitMqOrderReq implements Serializable { ...@@ -16,4 +16,9 @@ public class RabbitMqOrderReq implements Serializable {
private OrderDetailReq orderDetailReq; private OrderDetailReq orderDetailReq;
//具体装备epc //具体装备epc
private List<InventoryReq> inventoryReqList; private List<InventoryReq> inventoryReqList;
//设备标识
private String device;
//出入设备
private Integer deviceType;
} }
...@@ -224,15 +224,23 @@ public class InventoryController { ...@@ -224,15 +224,23 @@ public class InventoryController {
return ApiRes.success(inventoryService.BatchEditingInvsInfo(req)); return ApiRes.success(inventoryService.BatchEditingInvsInfo(req));
} }
//装备出入库记录(通过装备id) //装备出入库记录(根据单据id)
@PostMapping("/ShowInOutRecordsPage") @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")
@ApiOperation("出入库单据记录查询展示")
public ApiRes<PageResult<LogSummary>> ShowInOutRecordsByItems(@RequestBody @Validated(ValidationApi.detail.class) LogSummaryReq req){
return ApiRes.success(inventoryService.ShowInOutRecordsPage(req));
}
//通过装备id查询某一件装备的出入库记录 //通过装备id查询某一件装备的出入库记录
@PostMapping("/GetInOutRecordsByEqs") @PostMapping("/ShowInOutRecordsByEqs")
@ApiOperation("出入库单据记录查询展示") @ApiOperation("出入库单据记录查询展示")
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));
......
...@@ -41,7 +41,7 @@ public class Application implements Serializable { ...@@ -41,7 +41,7 @@ public class Application implements Serializable {
private String name; private String name;
/** /**
* 类型(0内部软件管理,1外部软件管理,2插件/环境安装包) * 类型(0内部软件管理,1外部软件管理,2插件/环境安装包,3导出模板维护,4导入模板维护
*/ */
private Integer type; private Integer type;
......
...@@ -75,8 +75,8 @@ public class LogDetail implements Serializable { ...@@ -75,8 +75,8 @@ public class LogDetail implements Serializable {
* 装备号型 * 装备号型
*/ */
@ApiModelProperty(value = "装备号型") @ApiModelProperty(value = "装备号型")
@TableField("equipment_size") @TableField("size_name")
private String equipmentSize; private String sizeName;
/** /**
...@@ -89,8 +89,8 @@ public class LogDetail implements Serializable { ...@@ -89,8 +89,8 @@ public class LogDetail implements Serializable {
* 供应商 * 供应商
*/ */
@ApiModelProperty(value = "供应商") @ApiModelProperty(value = "供应商")
@TableField("equipment_supplier") @TableField("supplier_name")
private String equipmentSupplier; private String supplierName;
/** /**
* 装备类型:0单件/1装备包 * 装备类型:0单件/1装备包
...@@ -106,6 +106,12 @@ public class LogDetail implements Serializable { ...@@ -106,6 +106,12 @@ public class LogDetail implements Serializable {
@TableField("error_state") @TableField("error_state")
private Integer errorState; private Integer errorState;
/**
* 出入库类型:0出库/1入库
*/
@ApiModelProperty(value = "出入库类型:0出库/1入库")
@TableField("out_in_state")
private String outInState;
/** /**
* 创建时间 * 创建时间
...@@ -148,13 +154,25 @@ public class LogDetail implements Serializable { ...@@ -148,13 +154,25 @@ public class LogDetail implements Serializable {
* 存储ID * 存储ID
*/ */
@ApiModelProperty(value = "存储ID") @ApiModelProperty(value = "存储ID")
@TableField("location_id")
private String locationId; private String locationId;
/** /**
* 存储名称:XX仓库,XX单警柜 * 存储名称:XX仓库,XX单警柜
*/ */
@ApiModelProperty(value = "存储名称") @ApiModelProperty(value = "存储名称")
@TableField("location_name")
private String locationName; 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; 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.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
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.ApiModel;
...@@ -9,14 +10,14 @@ import java.io.Serializable; ...@@ -9,14 +10,14 @@ import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import lombok.AllArgsConstructor; import lombok.*;
import lombok.Data;
import lombok.NoArgsConstructor;
@ApiModel(value = "com-junmp-jyzb-domain-LogSummary") @ApiModel(value = "com-junmp-jyzb-domain-LogSummary")
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Getter
@Setter
@TableName("base_log_summary") @TableName("base_log_summary")
public class LogSummary implements Serializable { public class LogSummary implements Serializable {
/** /**
...@@ -46,31 +47,19 @@ public class LogSummary implements Serializable { ...@@ -46,31 +47,19 @@ public class LogSummary implements Serializable {
@TableField("order_main_id") @TableField("order_main_id")
private String orderMainId; private String orderMainId;
/**
* 存储ID
*/
@ApiModelProperty(value = "存储ID")
@TableField("location_id")
private String locationId;
/**
* 存储名称:XX仓库,XX单警柜
*/
@ApiModelProperty(value = "存储名称")
@TableField("location_name")
private String locationName;
/** /**
* 设备标识 * 设备标识
*/ */
@ApiModelProperty(value = "设备标识") @ApiModelProperty(value = "设备标识")
@TableField(value = "device",updateStrategy = FieldStrategy.IGNORED)
private String device; private String device;
/** /**
* 出入设备:0手持机/1单警柜/2通道 * 出入设备:0手持机/1单警柜/2通道
*/ */
@ApiModelProperty(value = "出入设备:0手持机/1单警柜/2通道") @ApiModelProperty(value = "出入设备:0手持机/1单警柜/2通道")
@TableField("device_type") @TableField(value = "device_type",updateStrategy = FieldStrategy.IGNORED)
private Integer deviceType; private Integer deviceType;
/** /**
...@@ -93,12 +82,6 @@ public class LogSummary implements Serializable { ...@@ -93,12 +82,6 @@ public class LogSummary implements Serializable {
@TableField("user_name") @TableField("user_name")
private String userName; private String userName;
/**
* 出入库类型:0出库/1入库
*/
@ApiModelProperty(value = "出入库类型:0出库/1入库")
@TableField("out_in_state")
private Integer outInState;
/** /**
* 照片信息 * 照片信息
...@@ -141,4 +124,12 @@ public class LogSummary implements Serializable { ...@@ -141,4 +124,12 @@ public class LogSummary implements Serializable {
private List<LogDetail> logDetailList; private List<LogDetail> logDetailList;
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
...@@ -3,6 +3,7 @@ package com.junmp.jyzb.entity; ...@@ -3,6 +3,7 @@ package com.junmp.jyzb.entity;
import com.baomidou.mybatisplus.annotation.FieldFill; 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.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -60,6 +61,8 @@ import java.util.Date; ...@@ -60,6 +61,8 @@ import java.util.Date;
@TableField("order_type") @TableField("order_type")
private String orderType; private String orderType;
/** /**
* 创建时间 * 创建时间
*/ */
......
...@@ -23,11 +23,13 @@ import com.junmp.v2.sys.api.bean.user.dto.RoleUserDto; ...@@ -23,11 +23,13 @@ import com.junmp.v2.sys.api.bean.user.dto.RoleUserDto;
import com.junmp.v2.sys.api.bean.user.vo.QueryUserInfoVo; import com.junmp.v2.sys.api.bean.user.vo.QueryUserInfoVo;
import org.flowable.bpmn.model.Process; import org.flowable.bpmn.model.Process;
import org.flowable.bpmn.model.UserTask; import org.flowable.bpmn.model.UserTask;
import org.flowable.engine.HistoryService;
import org.flowable.engine.RepositoryService; import org.flowable.engine.RepositoryService;
import org.flowable.engine.TaskService; import org.flowable.engine.TaskService;
import org.flowable.engine.delegate.DelegateExecution; import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.ExecutionListener; import org.flowable.engine.delegate.ExecutionListener;
import com.junmp.junmpProcess.enums.AssigneeTypeEnums; import com.junmp.junmpProcess.enums.AssigneeTypeEnums;
import org.flowable.engine.history.HistoricProcessInstance;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -50,6 +52,9 @@ public class CounterSignListener implements ExecutionListener { ...@@ -50,6 +52,9 @@ public class CounterSignListener implements ExecutionListener {
private RepositoryService repositoryService; private RepositoryService repositoryService;
@Resource @Resource
private OrgUserMapper orgUserMapper; private OrgUserMapper orgUserMapper;
@Resource
private HistoryService historyService;
@Override @Override
public void notify(DelegateExecution execution) { public void notify(DelegateExecution execution) {
String currentActivityId = execution.getCurrentActivityId(); String currentActivityId = execution.getCurrentActivityId();
...@@ -178,13 +183,14 @@ public class CounterSignListener implements ExecutionListener { ...@@ -178,13 +183,14 @@ public class CounterSignListener implements ExecutionListener {
execution.setVariable(variable, assigneeList); execution.setVariable(variable, assigneeList);
assigneeList.forEach(userId->//为相应的用户推送消息 assigneeList.forEach(userId->//为相应的用户推送消息
{ {
MessageSendReq sendReq = new MessageSendReq(); MessageSendReq sendReq = new MessageSendReq();
sendReq.setReceiveUserIds(String.valueOf(userId)); sendReq.setReceiveUserIds(String.valueOf(userId));
sendReq.setMsgTitle("BizTypeEnum.YW.getDesc()"); sendReq.setMsgTitle("单据审批提示");
sendReq.setBizType("BizTypeEnum.YW.getValue()"); sendReq.setBizType("单据审批");
sendReq.setMsgContent("msgContent"); sendReq.setMsgContent("您有一条单据流程需要进行审批");
sendReq.setPriority("0"); sendReq.setPriority("0");
sendReq.setSendTime(DateTime.now()); sendReq.setSendTime(DateTime.now());
messageApi.sendMessage(sendReq); messageApi.sendMessage(sendReq);
...@@ -194,7 +200,7 @@ public class CounterSignListener implements ExecutionListener { ...@@ -194,7 +200,7 @@ public class CounterSignListener implements ExecutionListener {
req1.setReadFlag(0); req1.setReadFlag(0);
req1.setReceiveUserId(Long.valueOf(userId)); req1.setReceiveUserId(Long.valueOf(userId));
Integer count1 = messageApi.queryCount(req1); Integer count1 = messageApi.queryCount(req1);
messageApi.pushMsgToUser(String.valueOf(userId),count1); messageApi.pushMsgToUser(userId,count1);
}); });
} }
......
...@@ -12,4 +12,5 @@ import org.apache.ibatis.annotations.Param; ...@@ -12,4 +12,5 @@ import org.apache.ibatis.annotations.Param;
@Mapper @Mapper
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);
} }
\ No newline at end of file
...@@ -17,7 +17,7 @@ public class CabinetLogReceiver { ...@@ -17,7 +17,7 @@ public class CabinetLogReceiver {
@Resource @Resource
private InventorySummaryService inventorySummaryService; private InventorySummaryService inventorySummaryService;
@RabbitListener(queues = "cabinetInOutLog")//监听队列名 @RabbitListener(queues = "11111")//监听队列名
private void a(CabinetInOutRecordsReq req, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag){ private void a(CabinetInOutRecordsReq req, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag){
try { try {
......
...@@ -93,6 +93,7 @@ public interface InventoryService extends IService<Inventory> { ...@@ -93,6 +93,7 @@ public interface InventoryService extends IService<Inventory> {
//根据单据获取出入库记录 //根据单据获取出入库记录
PageResult<LogSummary> ShowInOutRecordsPage(LogSummaryReq req); PageResult<LogSummary> ShowInOutRecordsPage(LogSummaryReq req);
PageResult<LogSummary> ShowInOutRecordsByItems(LogSummaryReq req);
boolean test(RabbitMqOrderReq req); boolean test(RabbitMqOrderReq req);
} }
...@@ -570,25 +570,39 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory ...@@ -570,25 +570,39 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
officeExcelApi.easyExportDownload(param); officeExcelApi.easyExportDownload(param);
} }
//获取装备的出入库信息(根据装备id获取该装备的出入库记录)
@Override
public PageResult<LogDetail> getInOutRecords(InventoryReq req) {
//通过装备id获取出入库记录(判断id是否存在)
InventoryExist(req.getId());
LambdaQueryWrapper<LogDetail> eq = new LambdaQueryWrapper<LogDetail>().eq(LogDetail::getInventoryId,req.getId());
Page<LogDetail> page = logDetailService.page(PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize()), eq);
return PageResultFactory.createPageResult(page);
}
//根据单据查询出入库记录 //根据单据查询出入库记录
@Override @Override
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);
ipage.getRecords().forEach(logSummary -> {
List<LogDetail> list = logDetailService.list(new LambdaQueryWrapper<LogDetail>()
.eq(LogDetail::getSummaryId, logSummary.getId()));
logSummary.setLogDetailList(list);
});
page.setRecords(ipage.getRecords()); page.setRecords(ipage.getRecords());
return PageResultFactory.createPageResult(page); return PageResultFactory.createPageResult(page);
} }
//根据条件查询出入库记录
@Override
public PageResult<LogSummary> ShowInOutRecordsByItems(LogSummaryReq req) {
Page<LogSummary> page = PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize());
IPage<LogSummary> ipage=logSummaryMapper.ShowInOutRecordsByItems(page,req);
return null;
}
//获取装备的出入库信息(根据装备id获取该装备的出入库记录)
@Override
public PageResult<LogDetail> getInOutRecords(InventoryReq req) {
//通过装备id获取出入库记录(判断id是否存在)
InventoryExist(req.getId());
LambdaQueryWrapper<LogDetail> eq = new LambdaQueryWrapper<LogDetail>().eq(LogDetail::getInventoryId,req.getId());
Page<LogDetail> page = logDetailService.page(PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize()), eq);
return PageResultFactory.createPageResult(page);
}
//查询装备数量报表 //查询装备数量报表
@Override @Override
public List<EqsSumDto> GetListEquipment(InventoryReq req) { public List<EqsSumDto> GetListEquipment(InventoryReq req) {
......
...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.junmp.jyzb.api.bean.dto.InventorySumDto; import com.junmp.jyzb.api.bean.dto.InventorySumDto;
import com.junmp.jyzb.api.bean.dto.WarehouseDto; import com.junmp.jyzb.api.bean.dto.WarehouseDto;
import com.junmp.jyzb.api.bean.query.InventoryReq;
import com.junmp.jyzb.api.bean.query.InventorySumReq; import com.junmp.jyzb.api.bean.query.InventorySumReq;
import com.junmp.jyzb.api.bean.req.CabinetInOutRecordsReq; import com.junmp.jyzb.api.bean.req.CabinetInOutRecordsReq;
import com.junmp.jyzb.api.bean.req.RabbitMqOrderReq; import com.junmp.jyzb.api.bean.req.RabbitMqOrderReq;
...@@ -15,6 +16,7 @@ import com.junmp.v2.common.util.BeanPlusUtil; ...@@ -15,6 +16,7 @@ import com.junmp.v2.common.util.BeanPlusUtil;
import com.junmp.v2.db.api.factory.PageFactory; import com.junmp.v2.db.api.factory.PageFactory;
import com.junmp.v2.db.api.factory.PageResultFactory; import com.junmp.v2.db.api.factory.PageResultFactory;
import com.junmp.v2.db.api.page.PageResult; import com.junmp.v2.db.api.page.PageResult;
import liquibase.pro.packaged.L;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.junmp.jyzb.mapper.InventorySummaryMapper; import com.junmp.jyzb.mapper.InventorySummaryMapper;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -132,6 +134,7 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa ...@@ -132,6 +134,7 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
Inventory inventory = new Inventory(); Inventory inventory = new Inventory();
BeanPlusUtil.copyProperties(inventoryReq,inventory); BeanPlusUtil.copyProperties(inventoryReq,inventory);
inventory.setOrgId(orgId); inventory.setOrgId(orgId);
//新增装备
if (ObjectUtil.isNotNull(inventoryReq.getId())){ if (ObjectUtil.isNotNull(inventoryReq.getId())){
//修改状态 //修改状态
inventory.setId(UUID.randomUUID().toString()); inventory.setId(UUID.randomUUID().toString());
...@@ -157,7 +160,7 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa ...@@ -157,7 +160,7 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
inventoryService.updateBatchById(updateList); inventoryService.updateBatchById(updateList);
} }
//对装备进行记录,存入log表形成出入库记录 //对装备进行记录,存入log表形成出入库记录
Boolean c = insertLog(orderMain,addList,updateList); Boolean c = insertLog(req,orderMain,addList,updateList);
//对summary表中数据进行重新计算装备信息汇总 //对summary表中数据进行重新计算装备信息汇总
Boolean d = updateSummaryInsByOrder(orgId); Boolean d = updateSummaryInsByOrder(orgId);
...@@ -167,15 +170,15 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa ...@@ -167,15 +170,15 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
//对装备进行记录,存入log表形成出入库记录 //对装备进行记录,存入log表形成出入库记录
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean insertLog(OrderMain orderMain,List<Inventory> addList,List<Inventory> updateList ){ public Boolean insertLog(RabbitMqOrderReq req,OrderMain orderMain,List<Inventory> addList,List<Inventory> updateList ){
//插入log_summary //插入log_summary
LogSummary logSummary = new LogSummary(); LogSummary logSummary = new LogSummary();
logSummary.setDevice(req.getDevice());
logSummary.setDeviceType(req.getDeviceType());
if (orderMain.getOrderType().equals("in")){ if (orderMain.getOrderType().equals("in")){
logSummary.setOutInState(1);
logSummary.setOrgId(orderMain.getEndOrgId()); logSummary.setOrgId(orderMain.getEndOrgId());
logSummary.setOrgName(orderMain.getEndOrgName()); logSummary.setOrgName(orderMain.getEndOrgName());
}else { }else {
logSummary.setOutInState(0);
logSummary.setOrgId(orderMain.getStartOrgId()); logSummary.setOrgId(orderMain.getStartOrgId());
logSummary.setOrgName(orderMain.getStartOrgName()); logSummary.setOrgName(orderMain.getStartOrgName());
} }
...@@ -189,15 +192,17 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa ...@@ -189,15 +192,17 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
for (Inventory inventory:addList) { for (Inventory inventory:addList) {
LogDetail logDetail = new LogDetail(); LogDetail logDetail = new LogDetail();
BeanPlusUtil.copyProperties(inventory,logDetail); BeanPlusUtil.copyProperties(inventory,logDetail);
logDetail.setOutInState(orderMain.getOrderType());
logDetail.setSummaryId(logSummary.getId()); logDetail.setSummaryId(logSummary.getId());
logDetail.setOrderMainId(orderMain.getId()); logDetail.setOrderMainId(orderMain.getId());
logDetailList.add(logDetail); logDetailList.add(logDetail);
} }
} }
if (updateList.size()!=0 && ObjectUtil.isNotNull(updateList)){ if (updateList.size()!=0 && ObjectUtil.isNotNull(updateList)){
for (Inventory inventory:addList) { for (Inventory inventory:updateList) {
LogDetail logDetail = new LogDetail(); LogDetail logDetail = new LogDetail();
BeanPlusUtil.copyProperties(inventory,logDetail); BeanPlusUtil.copyProperties(inventory,logDetail);
logDetail.setOutInState(orderMain.getOrderType());
logDetail.setSummaryId(logSummary.getId()); logDetail.setSummaryId(logSummary.getId());
logDetail.setOrderMainId(orderMain.getId()); logDetail.setOrderMainId(orderMain.getId());
logDetailList.add(logDetail); logDetailList.add(logDetail);
...@@ -219,13 +224,23 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa ...@@ -219,13 +224,23 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
//单警柜返回数据 //单警柜返回数据
@Override @Override
@Transactional(rollbackFor = Exception.class)
public Boolean cabinetInOutRecords(CabinetInOutRecordsReq req) { public Boolean cabinetInOutRecords(CabinetInOutRecordsReq req) {
//修改inventory表中数据 //批量修改装备信息
Inventory inventory = new Inventory(); List<InventoryReq> inventoryList = req.getInventoryList();
BeanPlusUtil.copyProperties(req,inventory); boolean a=true;
boolean a = inventoryService.updateById(inventory); for (InventoryReq inventoryReq:inventoryList) {
Inventory inventory = new Inventory();
BeanPlusUtil.copyProperties(inventoryReq,inventory);
boolean result = inventoryService.updateById(inventory);
if (!result){
a=false;
break;
}
}
//修改summary表中数据 //修改summary表中数据
boolean b = updateSummaryInsByCabinet(req.getLocationId()); boolean b = updateSummaryInsByCabinet(req.getCabinetId());
//添加日志记录、 //添加日志记录、
Boolean c = insertCabinetLog(req); Boolean c = insertCabinetLog(req);
return (a && b && c); return (a && b && c);
...@@ -233,7 +248,6 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa ...@@ -233,7 +248,6 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
public boolean updateSummaryInsByCabinet(String locationId){ public boolean updateSummaryInsByCabinet(String locationId){
//根据箱门id查询出单警柜信息 //根据箱门id查询出单警柜信息
CabinetBox cabinetBox = cabinetBoxService.getById(locationId); CabinetBox cabinetBox = cabinetBoxService.getById(locationId);
//删除inventorysummary表中该单警柜数据 //删除inventorysummary表中该单警柜数据
boolean a = inventorySummaryMapper.deleteByCabinet(cabinetBox.getCabinetId()); boolean a = inventorySummaryMapper.deleteByCabinet(cabinetBox.getCabinetId());
//重新计算该单警柜下面的装备信息 //重新计算该单警柜下面的装备信息
...@@ -246,10 +260,18 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa ...@@ -246,10 +260,18 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
LogSummary logSummary = new LogSummary(); LogSummary logSummary = new LogSummary();
BeanPlusUtil.copyProperties(req,logSummary); BeanPlusUtil.copyProperties(req,logSummary);
boolean a = logSummaryService.save(logSummary); boolean a = logSummaryService.save(logSummary);
LogDetail logDetail = new LogDetail(); List<InventoryReq> inventoryList = req.getInventoryList();
BeanPlusUtil.copyProperties(req,logDetail); List<LogDetail> logDetailList=new ArrayList<>();
logDetail.setSummaryId(logSummary.getId()); for (InventoryReq inventoryReq:inventoryList) {
boolean b = logDetailService.save(logDetail); LogDetail logDetail = new LogDetail();
BeanPlusUtil.copyProperties(inventoryReq,logDetail);
logDetail.setCabinetId(req.getCabinetId());
logDetail.setLocationName(req.getLocationName());
logDetail.setOutInState(inventoryReq.getLocationState());
logDetail.setSummaryId(logSummary.getId());
logDetailList.add(logDetail);
}
boolean b = logDetailService.saveBatch(logDetailList);
return (a && b); return (a && b);
} }
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
SUM(CASE WHEN location_state = 'in' THEN 1 ELSE 0 END) AS stockNumber, SUM(CASE WHEN location_state = 'in' THEN 1 ELSE 0 END) AS stockNumber,
count(*) - SUM(CASE WHEN location_state = 'in' THEN 1 ELSE 0 END) AS outboundNumber, count(*) - SUM(CASE WHEN location_state = 'in' THEN 1 ELSE 0 END) AS outboundNumber,
sum(case when bi.state = 'destory' then 1 else 0 end) as destructionNumber, sum(case when bi.state = 'destory' then 1 else 0 end) as destructionNumber,
sum(case when bi.warranty_period=0 then 0 when DATE_ADD(bi.production_date,INTERVAL bi.warranty_period MONTH)<NOW() then 1 else 0 end )as expireNumber, sum(case when bi.warranty_period=0 then 0 when DATE_ADD(bi.production_date,INTERVAL bi.warranty_period MONTH) &lt; NOW() then 1 else 0 end )as expireNumber,
bi.location_type bi.location_type
FROM base_inventory bi FROM base_inventory bi
join base_cabinet_box bcb on bi.location_id = bcb.id join base_cabinet_box bcb on bi.location_id = bcb.id
......
...@@ -7,16 +7,17 @@ ...@@ -7,16 +7,17 @@
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id" />
<result column="org_id" jdbcType="VARCHAR" property="orgId" /> <result column="org_id" jdbcType="VARCHAR" property="orgId" />
<result column="org_name" jdbcType="VARCHAR" property="orgName" /> <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" jdbcType="VARCHAR" property="device" />
<result column="device_type" jdbcType="INTEGER" property="deviceType" /> <result column="device_type" jdbcType="INTEGER" property="deviceType" />
<result column="use_time" jdbcType="TIMESTAMP" property="useTime" /> <result column="use_time" jdbcType="TIMESTAMP" property="useTime" />
<result column="user_name" jdbcType="VARCHAR" property="userName" /> <result column="user_name" jdbcType="VARCHAR" property="userName" />
<result column="out_in_state" jdbcType="INTEGER" property="outInState" />
<result column="picture" jdbcType="VARCHAR" property="picture" /> <result column="picture" jdbcType="VARCHAR" property="picture" />
<collection property="logDetailList" ofType="com.junmp.jyzb.entity.LogDetail"> <collection property="logDetailList" ofType="com.junmp.jyzb.entity.LogDetail" >
<id column="id" property="id"/> <id column="id" property="id"/>
<result column="inventory_id" property="inventoryId"></result> <result column="inventory_id" property="inventoryId"></result>
<result column="order_main_id" property="orderMainId"></result> <result column="order_main_id" property="orderMainId"></result>
<result column="summary_id" property="summaryId"></result>
</collection> </collection>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -26,7 +27,12 @@ ...@@ -26,7 +27,12 @@
</sql> </sql>
<select id="ShowInOutRecordsPage" resultType="com.junmp.jyzb.entity.LogSummary"> <select id="ShowInOutRecordsPage" resultType="com.junmp.jyzb.entity.LogSummary">
select * from base_log_summary ls 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.order_main_id=#{req.orderMainId}
</select>
<select id="ShowInOutRecordsByItems" 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} where ls.org_id = #{req.orgId}
<if test="req.bussinessType != null and req.bussinessType !=''"> <if test="req.bussinessType != null and req.bussinessType !=''">
and ls.bussiness_type=#{req.bussinessType} and ls.bussiness_type=#{req.bussinessType}
......
...@@ -3,6 +3,7 @@ package com.junmp.junmpProcess.service.impl; ...@@ -3,6 +3,7 @@ package com.junmp.junmpProcess.service.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.PageUtil; import cn.hutool.core.util.PageUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
...@@ -25,6 +26,7 @@ import com.junmp.junmpProcess.vo.*; ...@@ -25,6 +26,7 @@ import com.junmp.junmpProcess.vo.*;
import com.junmp.v2.auth.api.bean.login.LoginUser; import com.junmp.v2.auth.api.bean.login.LoginUser;
import com.junmp.v2.auth.api.context.LoginContext; import com.junmp.v2.auth.api.context.LoginContext;
import com.junmp.v2.common.bean.response.ApiRes; import com.junmp.v2.common.bean.response.ApiRes;
import com.junmp.v2.common.util.BeanPlusUtil;
import com.junmp.v2.db.api.factory.PageResultFactory; import com.junmp.v2.db.api.factory.PageResultFactory;
import com.junmp.v2.db.api.page.PageResult; import com.junmp.v2.db.api.page.PageResult;
import com.junmp.v2.sys.user.entity.SysUser; import com.junmp.v2.sys.user.entity.SysUser;
...@@ -260,8 +262,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -260,8 +262,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
taskVO.setTaskId(task.getId()); taskVO.setTaskId(task.getId());
taskVO.setProcessInstanceId(task.getProcessInstanceId()); taskVO.setProcessInstanceId(task.getProcessInstanceId());
taskVO.setProcessDefinitionName(bpmnModel.getMainProcess().getName()); taskVO.setProcessDefinitionName(bpmnModel.getMainProcess().getName());
taskVO.setStartUser(JSONObject.parseObject(MapUtil.getStr(processVariables, START_USER_INFO), new TypeReference<ProcessUser>() { // taskVO.setStartUser(JSONObject.parseObject(MapUtil.getStr(processVariables, START_USER_INFO), new TypeReference<ProcessUser>() {
}).getUserInfo()); // }).getUserInfo());
String s = (String) processVariables.get(START_USER_INFO);
taskVO.setStartUser(JSONObject.parseObject(s, UserInfo.class));
taskVO.setOrderId(MapUtil.getStr(processVariables, ORDER_ID)); taskVO.setOrderId(MapUtil.getStr(processVariables, ORDER_ID));
taskVO.setOrderType(MapUtil.getStr(processVariables, ORDER_TYPE)); taskVO.setOrderType(MapUtil.getStr(processVariables, ORDER_TYPE));
...@@ -323,8 +327,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -323,8 +327,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
{ {
taskVO.setProcessDefinitionName(bpmnModel.getMainProcess().getName()); taskVO.setProcessDefinitionName(bpmnModel.getMainProcess().getName());
} }
taskVO.setStartUser(JSONObject.parseObject(MapUtil.getStr(processVariables, START_USER_INFO), new TypeReference<ProcessUser>() { // taskVO.setStartUser(JSONObject.parseObject(MapUtil.getStr(processVariables, START_USER_INFO), new TypeReference<ProcessUser>() {
}).getUserInfo()); // }).getUserInfo());
String s = (String) processVariables.get(START_USER_INFO);
taskVO.setStartUser(JSONObject.parseObject(s, UserInfo.class));
taskVO.setOrderId(MapUtil.getStr(processVariables, ORDER_ID)); taskVO.setOrderId(MapUtil.getStr(processVariables, ORDER_ID));
taskVO.setOrderType(MapUtil.getStr(processVariables, ORDER_TYPE)); taskVO.setOrderType(MapUtil.getStr(processVariables, ORDER_TYPE));
...@@ -387,9 +393,11 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -387,9 +393,11 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
historyProcessInstanceVO.setOrderId(MapUtil.getStr(processVariables, ORDER_ID)); historyProcessInstanceVO.setOrderId(MapUtil.getStr(processVariables, ORDER_ID));
historyProcessInstanceVO.setOrderType(MapUtil.getStr(processVariables, ORDER_TYPE)); historyProcessInstanceVO.setOrderType(MapUtil.getStr(processVariables, ORDER_TYPE));
historyProcessInstanceVO.setProcessDefinitionName(historicProcessInstance.getProcessDefinitionName()); historyProcessInstanceVO.setProcessDefinitionName(historicProcessInstance.getProcessDefinitionName());
historyProcessInstanceVO.setStartUser(JSONObject.parseObject(MapUtil.getStr(processVariables, START_USER_INFO), new TypeReference<ProcessUser>() { // historyProcessInstanceVO.setStartUser(JSONObject.parseObject(MapUtil.getStr(processVariables, START_USER_INFO), new TypeReference<ProcessUser>() {
}).getUserInfo()); // }).getUserInfo());
// historyProcessInstanceVO.setStartUser(StartUser) String s = (String) processVariables.get(START_USER_INFO);
historyProcessInstanceVO.setStartUser(JSONObject.parseObject(s, UserInfo.class));
historyProcessInstanceVO.setStartTime(historicProcessInstance.getStartTime()); historyProcessInstanceVO.setStartTime(historicProcessInstance.getStartTime());
historyProcessInstanceVO.setEndTime(historicProcessInstance.getEndTime()); historyProcessInstanceVO.setEndTime(historicProcessInstance.getEndTime());
Boolean flag = historicProcessInstance.getEndTime() == null ? false : true; Boolean flag = historicProcessInstance.getEndTime() == null ? false : true;
...@@ -549,14 +557,17 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -549,14 +557,17 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
} }
} }
// 根据 processInstanceId 查询正在执行的任务 // 根据 processInstanceId 查询正在执行的任务
Task currentTask = taskService.createTaskQuery() List<Task> list1 = taskService.createTaskQuery()
.processInstanceId(processInstanceId) .processInstanceId(processInstanceId)
.list().get(0); .list();
// 使用 Stream API 进行过滤和修改 if (list1.size()>0) {
taskDetailVOS.stream() Task currentTask =list1.get(0);
.filter(taskDetail -> taskDetail.getActivityId().equals(currentTask.getTaskDefinitionKey())) // 使用 Stream API 进行过滤和修改
.findFirst() taskDetailVOS.stream()
.ifPresent(matchingTask -> matchingTask.setTaskStatusWrapper("待审核")); .filter(taskDetail -> taskDetail.getActivityId().equals(currentTask.getTaskDefinitionKey()))
.findFirst()
.ifPresent(matchingTask -> matchingTask.setTaskStatusWrapper("待审核"));
}
JSONObject jsonForm = JSON.parseObject(formJson.toString()); JSONObject jsonForm = JSON.parseObject(formJson.toString());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论