Commit d8e8568a by 李小惠

修改工作流bug

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