Commit 1525bb9c by 李小惠

111

parents fed07cb0 90b00e00
package com.junmp.jyzb.api.bean.req;
import com.junmp.v2.common.bean.request.ValidationApi;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
public class UpdateOrderReq {
private String Id;
private String examineState;
private String processType;
/**
* 状态
*/
@NotNull(message = "状态不能为空", groups = {ValidationApi.updateStatus.class})
private String orderType;
/**
* 单据类型:入库单/出库单
*/
private String processId;
/**
* 工作流ID
*/
private String bussinessType;
/**
* 单据业务类型
*/
private String orderCode;
/**
* 订单号
*/
private String startOrgId;
/**
* 发物单位
*/
private String startOrgName;
/**
* 发物单位名称
*/
private String endOrgId;
/**
* 收物单位
*/
private String endOrgName;
/**
* 发物单位负责人id
*/
private String startOrgUserId;
/**
* 发物单位负责人姓名
*/
private String startOrgUserName;
/**
* 收物单位负责人id
*/
private String endOrgUserId;
/**
* 收物单位负责人姓名
*/
private String endOrgUserName;
/**
* 总价格
*/
private String price;
/**
* 应入库数量
*/
private String inventoryQuantity;
/**
* 附件地址
*/
private String attachmentLocation;
/**
* 单据包含的物资集合
*/
private String invList;
/**
* 表单内容
*/
private String formItem;
// /**
// * 表单内容
// */
// private String detailList;
/**
* 组织机构列表
*/
private List<String> deleteList;
/**
* 组织机构列表
*/
private List<DetailList> detailList;
@Data
public class DetailList {
/**
* 类型
*/
private String Id;
/**
* 类型
*/
private String typeId;
/**
* 类型名称
*/
private String typeName;
/**
* 号型
*/
private String sizeId;
private String sizeName;
private String supplierId;
private String supplierName;
private String planNum;
private String price;
}
}
package com.junmp.jyzb.api.exception.enums;
import com.junmp.v2.common.constant.CommonConstant;
import com.junmp.v2.common.exception.IExceptionEnum;
import lombok.Getter;
@Getter
public enum OrderExceptionEnum implements IExceptionEnum {
ORDER_NOT_EXIST(CommonConstant.DEFAULT_USER_ERROR_CODE,"单据不存在"),
ERROR_COMMOAND(CommonConstant.DEFAULT_USER_ERROR_CODE,"操作有误,无法既删除又修改"),
ORDER_CAN_NOT_UPDATE(CommonConstant.DEFAULT_USER_ERROR_CODE,"进行中的单据无法修改");
/**
* 错误编码
*/
private final Integer code;
/**
* 提示用户信息
*/
private final String message;
OrderExceptionEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
}
package com.junmp.jyzb.controller;
import cn.hutool.core.util.ObjectUtil;
import com.junmp.jyzb.api.bean.query.ProductSkuReq;
import com.junmp.jyzb.api.bean.req.UpdateOrderReq;
import com.junmp.jyzb.service.OrderService;
import com.junmp.jyzb.utils.ResponseResult;
import com.junmp.v2.common.bean.request.ValidationApi;
import com.junmp.v2.common.bean.response.ApiRes;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -23,11 +29,23 @@ public class OrderController {
@PostMapping("/AddOrder")
@ApiOperation("新增任务单")
public ResponseResult addOrder(@RequestBody Map<String,Object> msg) {
ResponseResult returnMsg = orderService.addOrder(msg);
return null;
public ApiRes<String> addOrder(@RequestBody UpdateOrderReq req) {
if (ObjectUtil.isNotEmpty(req.getProcessId()))
{
req.setExamineState("none");
}
else
{
req.setExamineState("working");
}
return ApiRes.success(orderService.AddOrder(req));
}
@PostMapping("/AddFinishOrder")
@ApiOperation("新增已完成的任务单")
public ApiRes<String> AddFinishOrder(@RequestBody @Validated(ValidationApi.add.class) UpdateOrderReq req) {
req.setExamineState("finished");
return ApiRes.success(orderService.AddOrder(req));
}
@PostMapping("/ShowOrder")
@ApiOperation("查询任务列表")
public ResponseResult showOrder(@RequestBody Map<String,Object> msg) {
......@@ -37,9 +55,8 @@ public class OrderController {
@PostMapping("/UpdateOrder")
@ApiOperation("修改任务单")
public ResponseResult updateOrder(@RequestBody Map<String,Object> msg) {
ResponseResult returnMsg =orderService.updateOrder(msg);
return null;
public ApiRes<Boolean> updateOrder(@RequestBody @Validated(ValidationApi.add.class) UpdateOrderReq req) {
return ApiRes.success(orderService.updateOrder(req));
}
@PostMapping("/GetOrderDetail")
......
package com.junmp.jyzb.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("bussiness_order_detail")
public class OrderDetail implements Serializable {
@TableField("id")
private Long id;
@TableField("order_id")
private String orderId;
@TableField("type")
private String type;
@TableField("equipment_type")
private String equipmentType;
@TableField("equipment_type_name")
private String equipmentTypeName;
@TableField("equipment_size")
private Long equipmentSize;
@TableField("equipment_size_name")
private String equipmentSizeName;
@TableField("equipment_supplier")
private Long equipment_supplier;
@TableField("equipment_supplier_name")
private String equipmentSupplierName;
@TableField("plan_num")
private String planNum;
@TableField("actual_num")
private String actualNum;
@TableField("price")
private String price;
@TableField("order_type")
private String orderType;
/**
* 创建时间
*/
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
/**
* 更新时间
*/
@TableField(value = "update_time", fill = FieldFill.UPDATE)
private Date updateTime;
@TableField("create_user")
private String createUser;
@TableField("update_user")
private String updateUser;
}
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.ApiModel;
......@@ -8,6 +9,7 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.xml.soap.Text;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
......@@ -19,13 +21,16 @@ import java.util.Date;
@TableName("bussiness_order_main")
public class OrderMain implements Serializable {
@TableField("id")
private Long id;
private String id;
@TableField("order_type")
private String orderType;
@TableField("process_id")
private String processId;
@TableField("examine_state")
private String examineState;
@TableField("bussiness_type")
private String bussinessType;
......@@ -78,10 +83,20 @@ public class OrderMain implements Serializable {
@TableField("inv_list")
private String invList;
@TableField("create_time")
@TableField("form_item")
private String formItem;
@TableField("order_detail")
private Text orderDetail;
/**
* 创建时间
*/
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField("update_time")
/**
* 更新时间
*/
@TableField(value = "update_time", fill = FieldFill.UPDATE)
private Date updateTime;
@TableField("create_user")
......
package com.junmp.jyzb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.junmp.jyzb.entity.OrderDetail;
import com.junmp.jyzb.entity.Product;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface OrderDetailMapper extends BaseMapper<OrderDetail> {
}
package com.junmp.jyzb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.junmp.jyzb.entity.OrderMain;
import com.junmp.jyzb.entity.Product;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@Mapper
public interface OrderMainMapper {
public interface OrderMainMapper extends BaseMapper<OrderMain> {
Long addOrder(OrderMain order);
List<Map<String, Object>> showOrder(String orgId);
......
package com.junmp.jyzb.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.junmp.jyzb.entity.EquipmentType;
import com.junmp.jyzb.entity.OrderDetail;
import java.util.List;
public interface OrderDetailService extends IService<OrderDetail> {
List<OrderDetail> QueryList(String orderId);
}
package com.junmp.jyzb.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.junmp.jyzb.api.bean.req.UpdateOrderReq;
import com.junmp.jyzb.entity.OrderDetail;
import com.junmp.jyzb.entity.OrderMain;
import com.junmp.jyzb.utils.ResponseResult;
import java.util.Map;
public interface OrderService {
ResponseResult addOrder(Map<String, Object> msg);
public interface OrderService extends IService<OrderMain> {
String AddOrder(UpdateOrderReq req);
ResponseResult showOrder(Map<String, Object> msg);
ResponseResult updateOrder(Map<String, Object> msg);
Boolean updateOrder(UpdateOrderReq req);
ResponseResult getOrderDetail(Map<String, Object> msg);
}
package com.junmp.jyzb.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.junmp.jyzb.api.bean.query.QueryEquipmentSizeReq;
import com.junmp.jyzb.api.bean.req.UpdateOrderReq;
import com.junmp.jyzb.api.exception.enums.OrderExceptionEnum;
import com.junmp.jyzb.entity.*;
import com.junmp.jyzb.mapper.OrderDetailMapper;
import com.junmp.jyzb.mapper.OrderMainMapper;
import com.junmp.jyzb.service.OrderDetailService;
import com.junmp.jyzb.service.OrderService;
import com.junmp.v2.common.exception.base.ServiceException;
import com.junmp.v2.db.api.factory.PageFactory;
import com.junmp.v2.db.api.factory.PageResultFactory;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class OrderDetailServiceImpl extends ServiceImpl<OrderDetailMapper, OrderDetail> implements OrderDetailService {
public List<OrderDetail> QueryList(String orderId) {
LambdaQueryWrapper<OrderDetail> wrapper = new LambdaQueryWrapper<>();
//根据主单据查询
wrapper.eq(ObjectUtil.isNotEmpty(orderId), OrderDetail::getOrderId, orderId);
return this.list(wrapper);
}
}
package com.junmp.jyzb.service.impl;
import com.junmp.jyzb.entity.OrderMain;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.junmp.jyzb.api.bean.req.UpdateEquipmentSizeReq;
import com.junmp.jyzb.api.bean.req.UpdateOrderReq;
import com.junmp.jyzb.api.exception.enums.OrderExceptionEnum;
import com.junmp.jyzb.api.exception.enums.ProductExceptionEnum;
import com.junmp.jyzb.entity.*;
import com.junmp.jyzb.mapper.OrderMainMapper;
import com.junmp.jyzb.service.OrderDetailService;
import com.junmp.jyzb.service.OrderService;
import com.junmp.jyzb.utils.DateTimeUtil;
import com.junmp.jyzb.utils.HttpStatus;
import com.junmp.jyzb.utils.ResponseResult;
import com.junmp.jyzb.utils.ReturnMsg;
import com.junmp.v2.common.exception.base.ServiceException;
import com.junmp.v2.common.util.BeanPlusUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
import static com.junmp.jyzb.utils.CheckBlank.checkNotBlank;
@Service
public class OrderServiceImpl implements OrderService {
public class OrderServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain> implements OrderService {
@Resource
private OrderMainMapper orderMapper;
private OrderDetailService orderDetailService;
@Resource
private OrderMainMapper orderMapper;
@Transactional
@Override
public ResponseResult addOrder(Map<String, Object> msg) {
try {
checkNotBlank(msg.get("orderType"), "orderType不能为空");
checkNotBlank(msg.get("processId"), "processId不能为空");
checkNotBlank(msg.get("bussinessType"), "bussinessType不能为空");
checkNotBlank(msg.get("orderCode"), "orderCode不能为空");
checkNotBlank(msg.get("orgId"), "orgId不能为空");
checkNotBlank(msg.get("inventoryQuantity"), "inventoryQuantity不能为空");
checkNotBlank(msg.get("manualState"), "manualState不能为空");
checkNotBlank(msg.get("orderState"), "orderState不能为空");
checkNotBlank(msg.get("attachmentLocation"), "attachmentLocation不能为空");
checkNotBlank(msg.get("invList"), "invList不能为空");
} catch (IllegalArgumentException e) {
return new ResponseResult(HttpStatus.ERROR, ReturnMsg.ERROR,e.getMessage());
}
public String AddOrder(UpdateOrderReq req) {
OrderMain order = new OrderMain();
//生成当前时间
Date currentDate = DateTimeUtil.getCurrentDateTime();
order.setCreateTime(currentDate);
order.setUpdateTime(currentDate);
order.setOrderType((String) msg.get("orderType"));
order.setProcessId((String) msg.get("processId"));
order.setBussinessType((String) msg.get("bussinessType"));
order.setOrderCode((String) msg.get("orderCode"));
order.setInventoryQuantity((Integer) msg.get("inventoryQuantity"));
order.setManualState((Integer) msg.get("manualState"));
order.setOrderState((Integer) msg.get("orderState"));
order.setAttachmentLocation((String) msg.get("attachmentLocation"));
order.setInvList((String) msg.get("invList"));
Long id = orderMapper.addOrder(order);
return new ResponseResult(HttpStatus.SUCCESS, ReturnMsg.PASS,id);
String orderId=UUID.randomUUID().toString();
BeanPlusUtil.copyProperties(req, order);
order.setId(orderId);
List<OrderDetail> detailList = new ArrayList<>();
req.getDetailList().forEach(p->
{
OrderDetail detail=new OrderDetail();
BeanPlusUtil.copyProperties(p, detail);
detail.setOrderId(orderId);
detailList.add(detail);
});
orderDetailService.saveBatch(detailList);
this.save(order);
return orderId;
}
@Override
......@@ -73,46 +66,61 @@ public class OrderServiceImpl implements OrderService {
return new ResponseResult(HttpStatus.SUCCESS, ReturnMsg.PASS,allMsg);
}
@Transactional
@Override
public ResponseResult updateOrder(Map<String, Object> msg) {
try {
checkNotBlank(msg.get("id"), "id不能为空");
checkNotBlank(msg.get("orderType"), "orderType不能为空");
checkNotBlank(msg.get("processId"), "processId不能为空");
checkNotBlank(msg.get("bussinessType"), "bussinessType不能为空");
checkNotBlank(msg.get("orderCode"), "orderCode不能为空");
checkNotBlank(msg.get("orgId"), "orgId不能为空");
checkNotBlank(msg.get("inventoryQuantity"), "inventoryQuantity不能为空");
checkNotBlank(msg.get("manualState"), "manualState不能为空");
checkNotBlank(msg.get("orderState"), "orderState不能为空");
checkNotBlank(msg.get("attachmentLocation"), "attachmentLocation不能为空");
checkNotBlank(msg.get("invList"), "invList不能为空");
} catch (IllegalArgumentException e) {
return new ResponseResult(HttpStatus.ERROR, ReturnMsg.ERROR,e.getMessage());
public Boolean updateOrder(UpdateOrderReq req) {
OrderMain order = this.query(req);
if (!order.getExamineState().equals("none"))
{
throw new ServiceException(OrderExceptionEnum.ORDER_CAN_NOT_UPDATE);
}
List<OrderDetail> updateList= orderDetailService.QueryList(order.getId());
List<String> updateCheckList=new ArrayList<>();
List<OrderDetail> addList = new ArrayList<>();
req.getDetailList().forEach(detail -> {
updateCheckList.add(detail.getId()); // 将id转换为String并添加到updateList中
});
boolean checkResult = this.hasCommonElements(updateCheckList,req.getDeleteList());
if (req.getDeleteList().size()>0)
{
orderDetailService.removeBatchByIds(req.getDeleteList());
}
req.getDetailList().forEach(p->
{
if (p.getId()!=null)//修改
{
updateList.forEach(detail->
{
if (detail.getId().equals(p.getId()))
{
BeanPlusUtil.copyProperties(p, detail);
}
});
OrderMain order = new OrderMain();
//生成当前时间
order.setId((Long) msg.get("id"));
Date currentDate = DateTimeUtil.getCurrentDateTime();
order.setUpdateTime(currentDate);
order.setOrderType((String) msg.get("orderType"));
order.setProcessId((String) msg.get("processId"));
order.setBussinessType((String) msg.get("bussinessType"));
order.setOrderCode((String) msg.get("orderCode"));
order.setInventoryQuantity((Integer) msg.get("inventoryQuantity"));
order.setManualState((Integer) msg.get("manualState"));
order.setOrderState((Integer) msg.get("orderState"));
order.setAttachmentLocation((String) msg.get("attachmentLocation"));
order.setInvList((String) msg.get("invList"));
orderMapper.updateOrder(order);
}
else//新增
{
OrderDetail detail=new OrderDetail();
BeanPlusUtil.copyProperties(p, detail);
detail.setOrderId(order.getId());
addList.add(detail);
}
return new ResponseResult(HttpStatus.SUCCESS, ReturnMsg.PASS);
});
orderDetailService.updateBatchById(updateList);
orderDetailService.saveBatch(addList);
this.save(order);
return true;
}
public boolean hasCommonElements(List<?> list1, List<?> list2) {
for (Object item1 : list1) {
if (list2.contains(item1)) {
return true; // 找到相同值
}
}
return false; // 没有相同值
}
@Override
......@@ -128,4 +136,14 @@ public class OrderServiceImpl implements OrderService {
return new ResponseResult(HttpStatus.SUCCESS, ReturnMsg.PASS,oneMsg);
}
private OrderMain query(UpdateOrderReq req) {
OrderMain order = this.getById(req.getId());
if (ObjectUtil.isNull(order)) {
throw new ServiceException(OrderExceptionEnum.ORDER_NOT_EXIST);
}
return order;
}
}
......@@ -20,8 +20,6 @@ import java.util.*;
@Service
public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> implements SupplierService {
@Resource
private SupplierMapper supplierMapper;
@Override
......
......@@ -13,11 +13,6 @@ import com.junmp.jyzb.service.SupplierTypeService;
@Service
public class SupplierTypeServiceImpl extends ServiceImpl<SupplierTypeMapper, SupplierType> implements SupplierTypeService{
@Resource
private SupplierTypeMapper supplierTypeMapper;
private LambdaQueryWrapper<SupplierType> createWrapper(SupplierTypeReq req) {
LambdaQueryWrapper<SupplierType> wrapper = new LambdaQueryWrapper<>();
if (ObjectUtil.isEmpty(req)) {
......
......@@ -36,26 +36,11 @@
<artifactId>amqp-client</artifactId>
<version>5.9.0</version>
</dependency>
<!--引入rabbitmq的相关依赖-->
<!-- <dependency>-->
<!-- <groupId>com.rabbitmq</groupId>-->
<!-- <artifactId>amqp-client</artifactId>-->
<!-- <version>5.7.2</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.3.2</version>
</dependency>
<!-- &lt;!&ndash; 整合到spring项目需要导入此依赖 &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.amqp</groupId>-->
<!-- <artifactId>spring-rabbit</artifactId>-->
<!-- <version>2.3.10</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
......@@ -71,11 +56,6 @@
<version>${lombok.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.amqp</groupId>-->
<!-- <artifactId>spring-rabbit-test</artifactId>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
......@@ -127,13 +107,6 @@
</exclusion>
</exclusions>
</dependency>
<!--
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
<version>${mybatis-plus.dynamic.vesion}</version>
</dependency>
-->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
......@@ -228,11 +201,6 @@
<version>3.0.0</version>
<scope>compile</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework</groupId>-->
<!-- <artifactId>spring-webmvc</artifactId>-->
<!-- <version>5.3.19</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.junmp.v2</groupId>
<artifactId>junmp-v2-common</artifactId>
......
//package com.junmp.junmpProcess.controller;
//
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import com.junmp.jyzb.utils.ResponseResult;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.extern.slf4j.Slf4j;
//import com.junmp.junmpProcess.common.Result;
//import com.junmp.junmpProcess.dto.ApplyDTO;
//import com.junmp.junmpProcess.dto.HandleDataDTO;
//import com.junmp.junmpProcess.dto.StartProcessInstanceDTO;
//import com.junmp.junmpProcess.dto.TaskDTO;
//import com.junmp.junmpProcess.entity.ProcessTemplates;
//import com.junmp.junmpProcess.service.Bussiness.WorkProcessService;
//import com.junmp.junmpProcess.vo.HandleDataVO;
//import com.junmp.junmpProcess.vo.HistoryProcessInstanceVO;
//import com.junmp.junmpProcess.vo.MultiVO;
//import com.junmp.junmpProcess.vo.TaskVO;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//import java.util.Map;
//
//@Slf4j
//@RestController
//@RequestMapping("/MainProcess")
//@Api(tags = "和Flowable有关的接口")
//public class MainProcessController {
//
// @Autowired
// private WorkProcessService ProcessService;
//
//
// @ApiOperation(value = "通过模板id查看流程信息 会附带流程定义id", notes = "获取所有Demo数据列表")
// @GetMapping(value = "process/detail")
// public Result<ProcessTemplates> detail(@RequestParam("templateId") String templateId) {
// return ProcessService.detail(templateId);
// }
//
// @ApiOperation("新建流程")
// @PostMapping("process/create")
// public Result<Object> create(@RequestBody StartProcessInstanceDTO startProcessInstanceDTO) {
// return ProcessService.start(startProcessInstanceDTO);
// }
//
// @ApiOperation("通过流程定义id启动流程")
// @PostMapping("process/start")
// public Result<Object> start(@RequestBody StartProcessInstanceDTO startProcessInstanceDTO) {
// return ProcessService.start(startProcessInstanceDTO);
// }
//
// @ApiOperation("查看我发起的流程")
// @PostMapping("process/applyList")
// public Result<Page<HistoryProcessInstanceVO>> applyList(@RequestBody ApplyDTO applyDTO) {
// return ProcessService.applyList(applyDTO);
// }
//
// @ApiOperation("查看我的待办")
// @PostMapping("process/toDoList")
// public Result<Page<TaskVO>> toDoList(@RequestBody TaskDTO taskDTO) {
// return ProcessService.toDoList(taskDTO);
// }
//
// @ApiOperation("查看我的已办")
// @PostMapping("process/doneList")
// public Result<Page<TaskVO>> doneList(@RequestBody TaskDTO taskDTO) {
// return ProcessService.doneList(taskDTO);
// }
//
// @ApiOperation("同意按钮")
// @PostMapping("/agree")
// public Result agree(@RequestBody HandleDataDTO handleDataDTO) {
// return ProcessService.agree(handleDataDTO);
// }
//
// @ApiOperation("委派按钮")
// @PostMapping("/delegateTask")
// public Result delegateTask(@RequestBody HandleDataDTO handleDataDTO) {
// return ProcessService.delegateTask(handleDataDTO);
//
// }
//
// @ApiOperation("委派人完成的按钮")
// @PostMapping("/resolveTask")
// public Result resolveTask(@RequestBody HandleDataDTO handleDataDTO) {
// return ProcessService.resolveTask(handleDataDTO);
// }
//
//
// @ApiOperation("拒绝按钮")
// @PostMapping("/refuse")
// public ResponseResult refuse(@RequestBody HandleDataDTO handleDataDTO) {
// return ProcessService.refuse(handleDataDTO);
// }
//
// @ApiOperation("撤销按钮")
// @PostMapping("/revoke")
// public Result revoke(@RequestBody HandleDataDTO handleDataDTO) {
// return ProcessService.revoke(handleDataDTO);
// }
//
//
// @ApiOperation("转办按钮")
// @PostMapping("/assignee")
// public Result assignee(@RequestBody HandleDataDTO handleDataDTO) {
// return ProcessService.assignee(handleDataDTO);
// }
//
//
// @ApiOperation("退回按钮")
// @PostMapping("/rollback")
// public Result rollback(@RequestBody HandleDataDTO handleDataDTO) {
// return ProcessService.rollback(handleDataDTO);
// }
//
//
// @ApiOperation("加签按钮")
// @PostMapping("/addMulti")
// public Result addMulti(@RequestBody HandleDataDTO handleDataDTO) {
// return ProcessService.addMulti(handleDataDTO);
// }
//
//
// @ApiOperation("查到签上的人")
// @PostMapping("/queryMultiUsersInfo")
// public Result<List<MultiVO>> queryMultiUsersInfo(@RequestBody Map<String, Object> map) {
// return ProcessService.queryMultiUsersInfo(map);
// }
//
// @ApiOperation("减签按钮")
// @PostMapping("/deleteMulti")
// public Result deleteMulti(@RequestBody List<String> executionIds) {
// return ProcessService.deleteMulti(executionIds);
// }
//
//
// @ApiOperation("评论按钮")
// @PostMapping("/comments")
// public Result comments(@RequestBody HandleDataDTO handleDataDTO) {
// return ProcessService.comments(handleDataDTO);
// }
//
// @ApiOperation("通过流程实例id查看详情")
// @PostMapping("process/instanceInfo")
// public Result<HandleDataVO> instanceInfo(@RequestBody HandleDataDTO HandleDataDTO) {
// return ProcessService.instanceInfo(HandleDataDTO);
// }
//// @ApiOperation("上传文件")
//// @PostMapping("upLoadFile")
//// public Result<AttachmentVO> upLoadFile(@RequestParam("file") MultipartFile file, HttpServletRequest request){
//// return ProcessService.upLoadFile(file,request);
//// }
//// @ApiOperation("下载文件")
//// @PostMapping("downLoadFile")
//// public void downLoadFile(@RequestParam("name") String name){
//// ProcessService.downLoadFile(name);
//// }
//}
//
//package com.junmp.junmpProcess.controller;
//
//import io.swagger.annotations.Api;
//import lombok.extern.slf4j.Slf4j;
//import com.junmp.junmpProcess.common.R;
//import com.junmp.junmpProcess.dto.FlowEngineDTO;
//import com.junmp.junmpProcess.entity.ProcessTemplates;
//import com.junmp.junmpProcess.service.Bussiness.SettingService;
//import com.junmp.junmpProcess.vo.TemplateGroupVo;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import java.lang.reflect.InvocationTargetException;
//import java.util.List;
//
///**
// * @author : willian fu
// * @date : 2020/9/17
// */
//@Slf4j
//@RestController
//@RequestMapping("/Setting")
//@Api(tags = "和表单有关的接口")
//
//
//public class SettingController {
//
// @Autowired
// private SettingService settingService;
//
// /**
// * 1>
// *
// * @param flowEngineDTO
// * @return
// * @throws InvocationTargetException
// * @throws IllegalAccessException
// */
// @PostMapping("/form")
// public Object saveForm(@RequestBody FlowEngineDTO flowEngineDTO) throws InvocationTargetException, IllegalAccessException {
// settingService.jsonToBpmn(flowEngineDTO);
// return R.ok("保存成功");
// }
//
// /**
// * 查询所有表单分组
// *
// * @return
// */
// @GetMapping("form/group")
// public Object getFormGroups() {
// return settingService.getFormGroups(null, null);
// }
//
// /**
// * 表单分组排序
// *
// * @param groups 分组数据
// * @return 排序结果
// */
// @PutMapping("form/group/sort")
// public Object formGroupsSort(@RequestBody List<TemplateGroupVo> groups) {
// return settingService.formGroupsSort(groups);
// }
//
// /**
// * 修改分组
// *
// * @param id 分组ID
// * @param name 分组名
// * @return 修改结果
// */
// @PutMapping("form/group")
// public Object updateFormGroupName(@RequestParam Integer id,
// @RequestParam String name) {
// return settingService.updateFormGroupName(id, name);
// }
//
// /**
// * 新增表单分组
// *
// * @param name 分组名
// * @return 添加结果
// */
// @PostMapping("form/group")
// public Object createFormGroup(@RequestParam String name) {
// return settingService.createFormGroup(name);
// }
//
// /**
// * 删除分组
// *
// * @param id 分组ID
// * @return 删除结果
// */
// @DeleteMapping("form/group")
// public Object deleteFormGroup(@RequestParam Integer id) {
// return settingService.deleteFormGroup(id);
// }
//
// /**
// * 查询表单模板数据
// *
// * @param templateId 模板id
// * @return 模板详情数据
// */
// @GetMapping("form/detail/{formId}")
// public Object getFormTemplateById(@PathVariable("formId") String templateId) {
// return settingService.getFormTemplateById(templateId);
// }
//
// /**
// * 编辑表单
// *
// * @param templateId 摸板ID
// * @param type 类型 stop using delete
// * @return 操作结果
// */
// @PutMapping("form")
// public Object updateForm(@RequestParam String templateId,
// @RequestParam String type,
// @RequestParam(required = false) Integer groupId) {
// return settingService.updateForm(templateId, type, groupId);
// }
//
// /**
// * 编辑表单详情
// *
// * @param template 表单模板信息
// * @return 修改结果
// */
// @PutMapping("form/detail")
// public Object updateFormDetail(@RequestBody ProcessTemplates template) {
// return settingService.updateFormDetail(template);
// }
//}
//package com.junmp.junmpProcess.controller;
//
//import cn.hutool.core.collection.CollUtil;
//import cn.hutool.core.map.MapUtil;
//import com.alibaba.fastjson.JSONObject;
//import com.alibaba.fastjson.TypeReference;
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import com.fasterxml.jackson.databind.ObjectMapper;
//import com.fasterxml.jackson.databind.node.ObjectNode;
//import com.junmp.junmpProcess.dto.*;
//import com.junmp.junmpProcess.dto.json.*;
//import com.junmp.junmpProcess.exception.WorkFlowException;
//import com.junmp.junmpProcess.vo.*;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.apache.commons.lang3.StringUtils;
//import org.flowable.bpmn.model.BpmnModel;
//import org.flowable.bpmn.model.FlowElement;
//import org.flowable.bpmn.model.Process;
//import org.flowable.common.engine.impl.identity.Authentication;
//import org.flowable.engine.HistoryService;
//import org.flowable.engine.RepositoryService;
//import org.flowable.engine.RuntimeService;
//import org.flowable.engine.TaskService;
//import org.flowable.engine.history.HistoricActivityInstance;
//import org.flowable.engine.history.HistoricProcessInstance;
//import org.flowable.engine.impl.persistence.entity.ExecutionEntity;
//import org.flowable.engine.repository.Model;
//import org.flowable.engine.repository.ProcessDefinition;
//import org.flowable.engine.runtime.Execution;
//import org.flowable.engine.runtime.ProcessInstance;
//import org.flowable.engine.runtime.ProcessInstanceBuilder;
//import org.flowable.engine.task.Attachment;
//import org.flowable.engine.task.Comment;
//import org.flowable.task.api.DelegationState;
//import org.flowable.task.api.Task;
//import org.flowable.task.api.history.HistoricTaskInstance;
//import com.junmp.junmpProcess.common.Result;
//import com.junmp.junmpProcess.entity.ProcessTemplates;
//import com.junmp.junmpProcess.service.Repository.ProcessTemplateService;
//import com.junmp.junmpProcess.service.Repository.UserService;
//import org.springframework.web.bind.annotation.*;
//
//import javax.annotation.Resource;
//import java.io.UnsupportedEncodingException;
//import java.util.*;
//import java.util.stream.Collectors;
//
//import static com.junmp.junmpProcess.common.CommonConstants.*;
//import static com.junmp.junmpProcess.common.WorkFlowConstants.PROCESS_PREFIX;
//import static com.junmp.junmpProcess.utils.BpmnModelUtils.getChildNode;
//
///**
// * @author : willian fu
// * @version : 1.0
// */
//@RestController
//@RequestMapping("/workspace")
//@Api(tags = "原版flowable")
//public class WorkspaceProcessController {
//
// @Resource
// private ProcessTemplateService processTemplateService;
// @Resource
// private RepositoryService repositoryService;
// @Resource
// private RuntimeService runtimeService;
// @Resource
// private HistoryService historyService;
// @Resource
// private TaskService taskService;
// @Resource
// private UserService userService;
//
// @ApiOperation("通过模板id查看流程信息 会附带流程定义id")
// @GetMapping("process/detail")
// public Result<ProcessTemplates> detail(@RequestParam("templateId") String templateId) {
// ProcessTemplates processTemplates = processTemplateService.getById(templateId);
// processTemplates.setLogo(processTemplates.getIcon());
// processTemplates.setFormId(processTemplates.getTemplateId());
// processTemplates.setFormName(processTemplates.getTemplateName());
// ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey(PROCESS_PREFIX + templateId).latestVersion().singleResult();
// if (processDefinition == null) {
// throw new WorkFlowException("该流程暂未接入Flowable,请重试");
// }
// processTemplates.setProcessDefinitionId(processDefinition.getId());
// return Result.OK(processTemplates);
// }
//
// @ApiOperation("通过流程定义id启动流程")
// @PostMapping("process/start")
// public Result<Object> start(@RequestBody StartProcessInstanceDTO startProcessInstanceDTO) {
// try {
// JSONObject formData = startProcessInstanceDTO.getFormData();
// JunmpUserInfo startUserInfo = startProcessInstanceDTO.getStartUserInfo();
// Authentication.setAuthenticatedUserId(startUserInfo.getUserId());
// Map<String, Object> processVariables = new HashMap<>();
// processVariables.put(FORM_VAR, formData);
// processVariables.put(PROCESS_STATUS, BUSINESS_STATUS_1);
// processVariables.put(START_USER_INFO, JSONObject.toJSONString(startUserInfo));
// ArrayList<JunmpUserInfo> userInfos = CollUtil.newArrayList(startUserInfo);
// processVariables.put("root", JSONObject.toJSONString(userInfos));
// Map formValue = JSONObject.parseObject(formData.toJSONString(), new TypeReference<Map>() {
// });
// processVariables.putAll(formValue);
// ProcessInstanceBuilder processInstanceBuilder = runtimeService.createProcessInstanceBuilder();
// ProcessInstance processInstance = processInstanceBuilder
// .processDefinitionId(startProcessInstanceDTO.getProcessDefinitionId())
// .variables(processVariables)
// .businessStatus(BUSINESS_STATUS_1)
// .start();
// return Result.OK(processInstance.getId());
// } catch (Exception e) {
// Throwable cause = e.getCause();
// if (cause instanceof WorkFlowException) {
// WorkFlowException workFlowException = (WorkFlowException) cause;
// return Result.error(workFlowException.getMessage());
// }
// e.printStackTrace();
// return Result.error("启动流程失败");
// }
// }
//
//
// @ApiOperation("查看我发起的流程")
// @PostMapping("process/applyList")
// public Result<Page<HistoryProcessInstanceVO>> applyList(@RequestBody ApplyDTO applyDTO) {
// List<HistoricProcessInstance> historicProcessInstances =
// historyService.createHistoricProcessInstanceQuery()
// .includeProcessVariables()
// .startedBy(applyDTO.getCurrentUserInfo().getId())
// .orderByProcessInstanceStartTime().desc()
// .listPage((applyDTO.getPageNo() - 1) * applyDTO.getPageSize(), applyDTO.getPageSize());
// long count = historyService.createHistoricProcessInstanceQuery()
// .startedBy(applyDTO.getCurrentUserInfo().getId()).count();
// List<HistoryProcessInstanceVO> historyProcessInstanceVOS = new ArrayList<>();
// Page<HistoryProcessInstanceVO> page = new Page<>();
// for (HistoricProcessInstance historicProcessInstance : historicProcessInstances) {
// Map<String, Object> processVariables = historicProcessInstance.getProcessVariables();
// HistoryProcessInstanceVO historyProcessInstanceVO = new HistoryProcessInstanceVO();
// historyProcessInstanceVO.setProcessInstanceId(historicProcessInstance.getId());
// historyProcessInstanceVO.setProcessDefinitionName(historicProcessInstance.getProcessDefinitionName());
// historyProcessInstanceVO.setStartUser(JSONObject.parseObject(MapUtil.getStr(processVariables, START_USER_INFO), new TypeReference<UserInfo>() {
// }));
// historyProcessInstanceVO.setStartTime(historicProcessInstance.getStartTime());
// historyProcessInstanceVO.setEndTime(historicProcessInstance.getEndTime());
// Boolean flag = historicProcessInstance.getEndTime() == null ? false : true;
// historyProcessInstanceVO.setCurrentActivityName(getCurrentName(historicProcessInstance.getId(), flag, historicProcessInstance.getProcessDefinitionId()));
// historyProcessInstanceVO.setBusinessStatus(MapUtil.getStr(processVariables, PROCESS_STATUS));
//
//
// long totalTimes = historicProcessInstance.getEndTime() == null ?
// (Calendar.getInstance().getTimeInMillis() - historicProcessInstance.getStartTime().getTime()) :
// (historicProcessInstance.getEndTime().getTime() - historicProcessInstance.getStartTime().getTime());
// long dayCount = totalTimes / (1000 * 60 * 60 * 24);//计算天
// long restTimes = totalTimes % (1000 * 60 * 60 * 24);//剩下的时间用于计于小时
// long hourCount = restTimes / (1000 * 60 * 60);//小时
// restTimes = restTimes % (1000 * 60 * 60);
// long minuteCount = restTimes / (1000 * 60);
//
// String spendTimes = dayCount + "天" + hourCount + "小时" + minuteCount + "分";
// historyProcessInstanceVO.setDuration(spendTimes);
// historyProcessInstanceVOS.add(historyProcessInstanceVO);
// }
// page.setRecords(historyProcessInstanceVOS);
// page.setCurrent(applyDTO.getPageNo());
// page.setSize(applyDTO.getPageSize());
// page.setTotal(count);
// return Result.OK(page);
// }
//
//
// private String getCurrentName(String processInstanceId, Boolean flag, String processDefinitionId) {
// if (flag) {
// return "流程已结束";
// }
// Execution execution = runtimeService.createExecutionQuery().executionId(processInstanceId).singleResult();
// String activityId = execution.getActivityId();
// if (StringUtils.isBlank(activityId)) {
// return "";
// } else {
// BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId);
// FlowElement flowElement = bpmnModel.getMainProcess().getFlowElement(activityId);
// return flowElement.getName();
// }
//
// }
//
// @ApiOperation("查看我的待办")
// @PostMapping("process/toDoList")
// public Result<Page<TaskVO>> toDoList(@RequestBody TaskDTO taskDTO) {
// List<Task> tasks = taskService.createTaskQuery().taskAssignee(taskDTO.getCurrentUserInfo().getId())
// .includeProcessVariables()
// .orderByTaskCreateTime().desc()
// .listPage((taskDTO.getPageNo() - 1) * taskDTO.getPageSize(), taskDTO.getPageSize());
// long count = taskService.createTaskQuery().taskAssignee(taskDTO.getCurrentUserInfo().getId()).count();
// List<TaskVO> taskVOS = new ArrayList<>();
// Page<TaskVO> page = new Page<>();
// for (Task task : tasks) {
// HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(task.getProcessInstanceId()).singleResult();
// BpmnModel bpmnModel = repositoryService.getBpmnModel(task.getProcessDefinitionId());
// Map<String, Object> processVariables = task.getProcessVariables();
// TaskVO taskVO = new TaskVO();
// 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<UserInfo>() {
// }));
// taskVO.setStartTime(historicProcessInstance.getStartTime());
// Execution execution = runtimeService.createExecutionQuery().executionId(task.getProcessInstanceId()).singleResult();
// String activityId = execution.getActivityId();
// if (StringUtils.isBlank(activityId)) {
// taskVO.setCurrentActivityName("");
// } else {
// FlowElement flowElement = bpmnModel.getMainProcess().getFlowElement(activityId);
// taskVO.setCurrentActivityName(flowElement.getName());
// }
//
// taskVO.setBusinessStatus(MapUtil.getStr(processVariables, PROCESS_STATUS));
// taskVO.setTaskCreatedTime(task.getCreateTime());
// DelegationState delegationState = task.getDelegationState();
// if (delegationState != null) {
// taskVO.setDelegationState(delegationState);
// }
// taskVOS.add(taskVO);
//
// }
// page.setRecords(taskVOS);
// page.setCurrent(taskDTO.getPageNo());
// page.setSize(taskDTO.getPageSize());
// page.setTotal(count);
// return Result.OK(page);
// }
//
// @ApiOperation("查看我的已办")
// @PostMapping("process/doneList")
// public Result<Page<TaskVO>> doneList(@RequestBody TaskDTO taskDTO) {
// List<HistoricTaskInstance> tasks = historyService.createHistoricTaskInstanceQuery()
// .taskAssignee(taskDTO.getCurrentUserInfo().getId())
// .finished()
// .includeProcessVariables()
// .orderByTaskCreateTime().desc()
// .listPage((taskDTO.getPageNo() - 1) * taskDTO.getPageSize(), taskDTO.getPageSize());
// long count = historyService.createHistoricTaskInstanceQuery()
// .taskAssignee(taskDTO.getCurrentUserInfo().getId()).count();
// List<TaskVO> taskVOS = new ArrayList<>();
// Page<TaskVO> page = new Page<>();
// for (HistoricTaskInstance task : tasks) {
// HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(task.getProcessInstanceId()).singleResult();
// Boolean flag = historicProcessInstance.getEndTime() == null ? false : true;
// BpmnModel bpmnModel = repositoryService.getBpmnModel(task.getProcessDefinitionId());
// Map<String, Object> processVariables = task.getProcessVariables();
// TaskVO taskVO = new TaskVO();
// 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<UserInfo>() {
// }));
// taskVO.setStartTime(historicProcessInstance.getStartTime());
// taskVO.setCurrentActivityName(getCurrentName(task.getProcessInstanceId(), flag, task.getProcessDefinitionId()));
// taskVO.setBusinessStatus(MapUtil.getStr(processVariables, PROCESS_STATUS));
// taskVO.setEndTime(task.getEndTime());
//
// long totalTimes = task.getEndTime() == null ?
// (Calendar.getInstance().getTimeInMillis() - task.getStartTime().getTime()) :
// (task.getEndTime().getTime() - task.getStartTime().getTime());
// long dayCount = totalTimes / (1000 * 60 * 60 * 24);//计算天
// long restTimes = totalTimes % (1000 * 60 * 60 * 24);//剩下的时间用于计于小时
// long hourCount = restTimes / (1000 * 60 * 60);//小时
// restTimes = restTimes % (1000 * 60 * 60);
// long minuteCount = restTimes / (1000 * 60);
// String spendTimes = dayCount + "天" + hourCount + "小时" + minuteCount + "分";
// taskVO.setDuration(spendTimes);
// taskVOS.add(taskVO);
// }
//
// page.setRecords(taskVOS);
// page.setCurrent(taskDTO.getPageNo());
// page.setSize(taskDTO.getPageSize());
// page.setTotal(count);
// return Result.OK(page);
// }
//
// @ApiOperation("同意按钮")
// @PostMapping("/agree")
// public Result agree(@RequestBody HandleDataDTO handleDataDTO) {
// UserInfo currentUserInfo = handleDataDTO.getCurrentUserInfo();
// List<AttachmentDTO> attachments = handleDataDTO.getAttachments();
// String comments = handleDataDTO.getComments();
// JSONObject formData = handleDataDTO.getFormData();
// String taskId = handleDataDTO.getTaskId();
// Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
// Map<String, Object> map = new HashMap<>();
// if (formData != null && formData.size() > 0) {
// Map formValue = JSONObject.parseObject(formData.toJSONString(), new TypeReference<Map>() {
// });
// map.putAll(formValue);
// map.put(FORM_VAR, formData);
// }
//
// runtimeService.setVariables(task.getProcessInstanceId(), map);//设置进入当前流程
// Authentication.setAuthenticatedUserId(currentUserInfo.getId());
// if (StringUtils.isNotBlank(comments)) {
// taskService.addComment(task.getId(), task.getProcessInstanceId(), "opinion", comments);
// }
// if (attachments != null && attachments.size() > 0) {
// for (AttachmentDTO attachment : attachments) {
// taskService.createAttachment("option", taskId, task.getProcessInstanceId(), attachment.getName(), attachment.getName(), attachment.getUrl());
// }
// }
//
// if (StringUtils.isNotBlank(handleDataDTO.getSignInfo())) {
// taskService.addComment(task.getId(), task.getProcessInstanceId(), "sign", handleDataDTO.getSignInfo());
// }
//
//
// taskService.complete(task.getId());
// return Result.OK();
// }
//
// @ApiOperation("委派按钮")
// @PostMapping("/delegateTask")
// public Result delegateTask(@RequestBody HandleDataDTO handleDataDTO) {
// UserInfo currentUserInfo = handleDataDTO.getCurrentUserInfo();
// List<AttachmentDTO> attachments = handleDataDTO.getAttachments();
// String comments = handleDataDTO.getComments();
// JSONObject formData = handleDataDTO.getFormData();
// String taskId = handleDataDTO.getTaskId();
// Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
// Map<String, Object> map = new HashMap<>();
// if (formData != null && formData.size() > 0) {
// Map formValue = JSONObject.parseObject(formData.toJSONString(), new TypeReference<Map>() {
// });
// map.putAll(formValue);
// map.put(FORM_VAR, formData);
// }
//
// runtimeService.setVariables(task.getProcessInstanceId(), map);
// Authentication.setAuthenticatedUserId(currentUserInfo.getId());
// if (StringUtils.isNotBlank(comments)) {
// taskService.addComment(task.getId(), task.getProcessInstanceId(), "opinion", comments);
// }
// if (attachments != null && attachments.size() > 0) {
// for (AttachmentDTO attachment : attachments) {
// taskService.createAttachment("option", taskId, task.getProcessInstanceId(), attachment.getName(), attachment.getName(), attachment.getUrl());
// }
// }
//
// if (StringUtils.isNotBlank(handleDataDTO.getSignInfo())) {
// taskService.addComment(task.getId(), task.getProcessInstanceId(), "sign", handleDataDTO.getSignInfo());
// }
//
// UserInfo delegateUserInfo = handleDataDTO.getDelegateUserInfo();
// taskService.delegateTask(task.getId(), delegateUserInfo.getId());
// return Result.OK();
// }
//
// @ApiOperation("委派人完成的按钮")
// @PostMapping("/resolveTask")
// public Result resolveTask(@RequestBody HandleDataDTO handleDataDTO) {
// UserInfo currentUserInfo = handleDataDTO.getCurrentUserInfo();
// List<AttachmentDTO> attachments = handleDataDTO.getAttachments();
// String comments = handleDataDTO.getComments();
// JSONObject formData = handleDataDTO.getFormData();
// String taskId = handleDataDTO.getTaskId();
// Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
// Map<String, Object> map = new HashMap<>();
// if (formData != null && formData.size() > 0) {
// Map formValue = JSONObject.parseObject(formData.toJSONString(), new TypeReference<Map>() {
// });
// map.putAll(formValue);
// map.put(FORM_VAR, formData);
// }
//
// runtimeService.setVariables(task.getProcessInstanceId(), map);
// Authentication.setAuthenticatedUserId(currentUserInfo.getId());
// if (StringUtils.isNotBlank(comments)) {
// taskService.addComment(task.getId(), task.getProcessInstanceId(), "opinion", comments);
// }
// if (attachments != null && attachments.size() > 0) {
// for (AttachmentDTO attachment : attachments) {
// taskService.createAttachment("option", taskId, task.getProcessInstanceId(), attachment.getName(), attachment.getName(), attachment.getUrl());
// }
// }
//
// if (StringUtils.isNotBlank(handleDataDTO.getSignInfo())) {
// taskService.addComment(task.getId(), task.getProcessInstanceId(), "sign", handleDataDTO.getSignInfo());
// }
//
// taskService.resolveTask(taskId);
// return Result.OK();
// }
//
//
// @ApiOperation("拒绝按钮")
// @PostMapping("/refuse")
// public Result refuse(@RequestBody HandleDataDTO handleDataDTO) {
// UserInfo currentUserInfo = handleDataDTO.getCurrentUserInfo();
// Authentication.setAuthenticatedUserId(currentUserInfo.getId());
// List<AttachmentDTO> attachments = handleDataDTO.getAttachments();
// String comments = handleDataDTO.getComments();
// JSONObject formData = handleDataDTO.getFormData();
// String taskId = handleDataDTO.getTaskId();
// Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
// Map<String, Object> map = new HashMap<>();
// if (formData != null && formData.size() > 0) {
// Map formValue = JSONObject.parseObject(formData.toJSONString(), new TypeReference<Map>() {
// });
// map.putAll(formValue);
// map.put(FORM_VAR, formData);
// }
// map.put(PROCESS_STATUS, BUSINESS_STATUS_3);
// runtimeService.setVariables(task.getProcessInstanceId(), map);
// if (StringUtils.isNotBlank(comments)) {
// taskService.addComment(task.getId(), task.getProcessInstanceId(), "opinion", comments);
// }
// if (attachments != null && attachments.size() > 0) {
// for (AttachmentDTO attachment : attachments) {
// taskService.createAttachment("option", taskId, task.getProcessInstanceId(), attachment.getName(), attachment.getName(), attachment.getUrl());
// }
// }
//
// if (StringUtils.isNotBlank(handleDataDTO.getSignInfo())) {
// taskService.addComment(task.getId(), task.getProcessInstanceId(), "sign", handleDataDTO.getSignInfo());
// }
// runtimeService.deleteProcessInstance(task.getProcessInstanceId(), "拒绝");
// return Result.OK();
// }
//
// @ApiOperation("撤销按钮")
// @PostMapping("/revoke")
// public Result revoke(@RequestBody HandleDataDTO handleDataDTO) {
// UserInfo currentUserInfo = handleDataDTO.getCurrentUserInfo();
// Authentication.setAuthenticatedUserId(currentUserInfo.getId());
// List<AttachmentDTO> attachments = handleDataDTO.getAttachments();
// String comments = handleDataDTO.getComments();
// JSONObject formData = handleDataDTO.getFormData();
// String taskId = handleDataDTO.getTaskId();
// HistoricTaskInstance task = historyService.createHistoricTaskInstanceQuery().taskId(taskId).singleResult();
// Map<String, Object> map = new HashMap<>();
// if (formData != null && formData.size() > 0) {
// Map formValue = JSONObject.parseObject(formData.toJSONString(), new TypeReference<Map>() {
// });
// map.putAll(formValue);
// map.put(FORM_VAR, formData);
// }
// map.put(PROCESS_STATUS, BUSINESS_STATUS_2);
// runtimeService.setVariables(task.getProcessInstanceId(), map);
// if (StringUtils.isNotBlank(comments)) {
// taskService.addComment(task.getId(), task.getProcessInstanceId(), "opinion", comments);
// }
// if (attachments != null && attachments.size() > 0) {
// for (AttachmentDTO attachment : attachments) {
// taskService.createAttachment("option", taskId, task.getProcessInstanceId(), attachment.getName(), attachment.getName(), attachment.getUrl());
// }
// }
//
// if (StringUtils.isNotBlank(handleDataDTO.getSignInfo())) {
// taskService.addComment(task.getId(), task.getProcessInstanceId(), "sign", handleDataDTO.getSignInfo());
// }
// runtimeService.deleteProcessInstance(task.getProcessInstanceId(), "撤销");
// return Result.OK();
// }
//
//
// @ApiOperation("转办按钮")
// @PostMapping("/assignee")
// public Result assignee(@RequestBody HandleDataDTO handleDataDTO) {
// UserInfo currentUserInfo = handleDataDTO.getCurrentUserInfo();
// Authentication.setAuthenticatedUserId(currentUserInfo.getId());
// List<AttachmentDTO> attachments = handleDataDTO.getAttachments();
// String comments = handleDataDTO.getComments();
// JSONObject formData = handleDataDTO.getFormData();
// String taskId = handleDataDTO.getTaskId();
// Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
// Map<String, Object> map = new HashMap<>();
// if (formData != null && formData.size() > 0) {
// Map formValue = JSONObject.parseObject(formData.toJSONString(), new TypeReference<Map>() {
// });
// map.putAll(formValue);
// map.put(FORM_VAR, formData);
// }
// map.put(PROCESS_STATUS, BUSINESS_STATUS_1);
// runtimeService.setVariables(task.getProcessInstanceId(), map);
// if (StringUtils.isNotBlank(comments)) {
// taskService.addComment(task.getId(), task.getProcessInstanceId(), "opinion", comments);
// }
// if (attachments != null && attachments.size() > 0) {
// for (AttachmentDTO attachment : attachments) {
// taskService.createAttachment("option", taskId, task.getProcessInstanceId(), attachment.getName(), attachment.getName(), attachment.getUrl());
// }
// }
//
// if (StringUtils.isNotBlank(handleDataDTO.getSignInfo())) {
// taskService.addComment(task.getId(), task.getProcessInstanceId(), "sign", handleDataDTO.getSignInfo());
// }
// taskService.setAssignee(taskId, handleDataDTO.getTransferUserInfo().getId());
// return Result.OK();
// }
//
//
// @ApiOperation("退回按钮")
// @PostMapping("/rollback")
// public Result rollback(@RequestBody HandleDataDTO handleDataDTO) {
// UserInfo currentUserInfo = handleDataDTO.getCurrentUserInfo();
// Authentication.setAuthenticatedUserId(currentUserInfo.getId());
// List<AttachmentDTO> attachments = handleDataDTO.getAttachments();
// String comments = handleDataDTO.getComments();
// JSONObject formData = handleDataDTO.getFormData();
// String taskId = handleDataDTO.getTaskId();
// String processInstanceId = handleDataDTO.getProcessInstanceId();
// List<Task> list = taskService.createTaskQuery().processInstanceId(processInstanceId).list();
// Task task = null;
// List<String> taskIds = new ArrayList<>();
//
// for (Task task1 : list) {
// if (task1.getId().equals(taskId)) {
// task = task1;
// }
// taskIds.add(task1.getTaskDefinitionKey());
// }
//
//
// Map<String, Object> map = new HashMap<>();
// if (formData != null && formData.size() > 0) {
// Map formValue = JSONObject.parseObject(formData.toJSONString(), new TypeReference<Map>() {
// });
// map.putAll(formValue);
// map.put(FORM_VAR, formData);
// }
// map.put(PROCESS_STATUS, BUSINESS_STATUS_3);
// runtimeService.setVariables(task.getProcessInstanceId(), map);
// if (StringUtils.isNotBlank(comments)) {
// taskService.addComment(task.getId(), task.getProcessInstanceId(), "opinion", comments);
// }
// if (attachments != null && attachments.size() > 0) {
// for (AttachmentDTO attachment : attachments) {
// taskService.createAttachment("option", taskId, task.getProcessInstanceId(), attachment.getName(), attachment.getName(), attachment.getUrl());
// }
// }
//
// if (StringUtils.isNotBlank(handleDataDTO.getSignInfo())) {
// taskService.addComment(task.getId(), task.getProcessInstanceId(), "sign", handleDataDTO.getSignInfo());
// }
//
//
// runtimeService.createChangeActivityStateBuilder()
// .processInstanceId(task.getProcessInstanceId())
// .moveActivityIdsToSingleActivityId(taskIds, handleDataDTO.getRollbackId())
// .changeState();
// return Result.OK();
// }
//
//
// @ApiOperation("加签按钮")
// @PostMapping("/addMulti")
// public Result addMulti(@RequestBody HandleDataDTO handleDataDTO) {
// UserInfo currentUserInfo = handleDataDTO.getCurrentUserInfo();
// Authentication.setAuthenticatedUserId(currentUserInfo.getId());
// List<AttachmentDTO> attachments = handleDataDTO.getAttachments();
// String comments = handleDataDTO.getComments();
// JSONObject formData = handleDataDTO.getFormData();
// String taskId = handleDataDTO.getTaskId();
// Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
// Map<String, Object> map = new HashMap<>();
// if (formData != null && formData.size() > 0) {
// Map formValue = JSONObject.parseObject(formData.toJSONString(), new TypeReference<Map>() {
// });
// map.putAll(formValue);
// map.put(FORM_VAR, formData);
// }
// map.put(PROCESS_STATUS, BUSINESS_STATUS_1);
// runtimeService.setVariables(task.getProcessInstanceId(), map);
// if (StringUtils.isNotBlank(comments)) {
// taskService.addComment(task.getId(), task.getProcessInstanceId(), "opinion", comments);
// }
// if (attachments != null && attachments.size() > 0) {
// for (AttachmentDTO attachment : attachments) {
// taskService.createAttachment("option", taskId, task.getProcessInstanceId(), attachment.getName(), attachment.getName(), attachment.getUrl());
// }
// }
//
// if (StringUtils.isNotBlank(handleDataDTO.getSignInfo())) {
// taskService.addComment(task.getId(), task.getProcessInstanceId(), "sign", handleDataDTO.getSignInfo());
// }
//
// Map<String, Object> variableMap = new HashMap<>();
// variableMap.put("assigneeName", handleDataDTO.getMultiAddUserInfo().getId());
// ExecutionEntity execution = (ExecutionEntity) runtimeService.addMultiInstanceExecution(task.getTaskDefinitionKey(), task.getProcessInstanceId(), variableMap);
// return Result.OK();
// }
//
//
// @ApiOperation("查到签上的人")
// @PostMapping("/queryMultiUsersInfo")
// public Result<List<MultiVO>> queryMultiUsersInfo(@RequestBody Map<String, Object> map) {
// String taskId = MapUtil.getStr(map, "taskId");
// Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
// List<Task> list = taskService.createTaskQuery()
// .processInstanceId(task.getProcessInstanceId())
// .taskDefinitionKey(task.getTaskDefinitionKey()).list();
// Iterator<Task> iterator = list.iterator();
// List<MultiVO> multiVOList = new ArrayList<>();
// while (iterator.hasNext()) {
// Task next = iterator.next();
// if (!taskId.equals(next.getId())) {
// MultiVO multiVO = new MultiVO();
// multiVO.setTaskId(next.getId());
// multiVO.setProcessInstanceId(next.getProcessInstanceId());
// multiVO.setExecutionId(next.getExecutionId());
// multiVO.setUserId(next.getAssignee());
// multiVOList.add(multiVO);
// }
//
// }
// return Result.OK(multiVOList);
// }
//
// @ApiOperation("减签按钮")
// @PostMapping("/deleteMulti")
// public Result deleteMulti(@RequestBody List<String> executionIds) {
// for (String executionId : executionIds) {
// runtimeService.deleteMultiInstanceExecution(executionId, true);
// }
// return Result.OK();
// }
//
// /**
// * 添加流程模型并返回modelId
// *
// * @param processId 流程唯一标识key
// * @param processAuthor 流程作者
// * @param name 流程名称
// * @param modelname 模型名称
// * @param description 模型描述
// * @param category 模型分类
// * @return
// * @throws UnsupportedEncodingException
// */
// protected String createModel(String processId, String processAuthor, String name, String modelname, String description, String category) throws UnsupportedEncodingException {
//
// ObjectMapper objectMapper = new ObjectMapper();
// ObjectNode editorNode = objectMapper.createObjectNode();
// editorNode.put("id", "canvs");
// editorNode.put("resourceId", "canvs");
// ObjectNode stencilSetNode = objectMapper.createObjectNode();
//
// //命名空间(禁止修改)
// stencilSetNode.put("namespace", "http://b3mn.org/stencilset/bpmn2.0#");
//
// //流程节点作者
// stencilSetNode.put("author", "");
// editorNode.set("stencilset", stencilSetNode);
// ObjectNode propertiesNode = objectMapper.createObjectNode();
//
// //流程唯一标识
// propertiesNode.put("process_id", processId);
//
// //流程作者
// propertiesNode.put("process_author", processAuthor);
//
// //流程名称
// propertiesNode.put("name", name);
// editorNode.set("properties", propertiesNode);
//
// ObjectNode modelObjectNode = objectMapper.createObjectNode();
//
// //模型名称
// modelObjectNode.put("name", modelname);
//
// //模型版本
// modelObjectNode.put("revision", 1);
//
// //模型描述
// modelObjectNode.put("description", description);
// Model modelData = repositoryService.newModel();
//
// //模型分类
// modelData.setCategory(category);
// modelData.setDeploymentId(null);
// modelData.setKey(null);
// modelData.setMetaInfo(modelObjectNode.toString());
//
// //模型名称
// modelData.setName(modelname);
// modelData.setTenantId("");
// modelData.setVersion(1);
//
// //保存模型,存储数据到表:act_re_model 流程设计模型部署表
// repositoryService.saveModel(modelData);
//
// //保存资源,存储数据到表:act_ge_bytearray 二进制数据表
// repositoryService.addModelEditorSource(modelData.getId(), editorNode.toString().getBytes("utf-8"));
//
// return modelData.getId();
// }
//
//
// @ApiOperation("评论按钮")
// @PostMapping("/comments")
// public Result comments(@RequestBody HandleDataDTO handleDataDTO) {
// UserInfo currentUserInfo = handleDataDTO.getCurrentUserInfo();
// Authentication.setAuthenticatedUserId(currentUserInfo.getId());
// List<AttachmentDTO> attachments = handleDataDTO.getAttachments();
// String comments = handleDataDTO.getComments();
// JSONObject formData = handleDataDTO.getFormData();
// String taskId = handleDataDTO.getTaskId();
// Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
// Map<String, Object> map = new HashMap<>();
// if (formData != null && formData.size() > 0) {
// Map formValue = JSONObject.parseObject(formData.toJSONString(), new TypeReference<Map>() {
// });
// map.putAll(formValue);
// map.put(FORM_VAR, formData);
// }
// map.put(PROCESS_STATUS, BUSINESS_STATUS_1);
// runtimeService.setVariables(task.getProcessInstanceId(), map);
// if (StringUtils.isNotBlank(comments)) {
// taskService.addComment(task.getId(), task.getProcessInstanceId(), "comments", comments);
// }
// if (attachments != null && attachments.size() > 0) {
// for (AttachmentDTO attachment : attachments) {
// taskService.createAttachment("option", taskId, task.getProcessInstanceId(), attachment.getName(), attachment.getName(), attachment.getUrl());
// }
// }
//
// if (StringUtils.isNotBlank(handleDataDTO.getSignInfo())) {
// taskService.addComment(task.getId(), task.getProcessInstanceId(), "sign", handleDataDTO.getSignInfo());
// }
// return Result.OK();
// }
//
// @ApiOperation("通过流程实例id查看详情")
// @PostMapping("process/instanceInfo")
// public Result<HandleDataVO> instanceInfo(@RequestBody HandleDataDTO HandleDataDTO) {
// String processInstanceId = HandleDataDTO.getProcessInstanceId();
// HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId)
// .includeProcessVariables().singleResult();
// String processDefinitionKey = historicProcessInstance.getProcessDefinitionKey();
// ProcessTemplates processTemplates = processTemplateService.getById(processDefinitionKey.replace(PROCESS_PREFIX, ""));
// processTemplates.setLogo(processTemplates.getIcon());
// processTemplates.setFormId(processTemplates.getTemplateId());
// processTemplates.setFormName(processTemplates.getTemplateName());
// processTemplates.setProcessDefinitionId(historicProcessInstance.getProcessDefinitionId());
//
// HandleDataVO handleDataVO = new HandleDataVO();
// Map<String, Object> processVariables = historicProcessInstance.getProcessVariables();
//
// handleDataVO.setProcessInstanceId(historicProcessInstance.getId());
// JSONObject jsonObject = (JSONObject) processVariables.get(FORM_VAR);
// handleDataVO.setFormData(jsonObject);
// String process = processTemplates.getProcessJson();
// ChildNode childNode = JSONObject.parseObject(process, new TypeReference<ChildNode>() {
// });
// SettingsInfo settingsInfo = JSONObject.parseObject(processTemplates.getSettings(), new TypeReference<SettingsInfo>() {
// });
// Boolean sign = settingsInfo.getSign();
// ChildNode currentNode = null;
// if (StringUtils.isNotBlank(HandleDataDTO.getTaskId())) {
// HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery().taskId(HandleDataDTO.getTaskId()).singleResult();
// currentNode = getChildNode(childNode, historicTaskInstance.getTaskDefinitionKey());
// List<FormOperates> formPerms = currentNode.getProps().getFormPerms();
// if (CollUtil.isNotEmpty(formPerms)) {
// Iterator<FormOperates> iterator = formPerms.iterator();
// while (iterator.hasNext()) {
// FormOperates next = iterator.next();
// if ("H".equals(next.getPerm())) {
// iterator.remove();
// if (jsonObject != null) {
// jsonObject.remove(next.getId());
// }
// }
// }
// }
// handleDataVO.setCurrentNode(currentNode);
// handleDataVO.setTaskId(HandleDataDTO.getTaskId());
// }
//
// if (sign) {
// handleDataVO.setSignFlag(true);
// }
// if (StringUtils.isNotBlank(HandleDataDTO.getTaskId())) {
// if (currentNode != null) {
// if (currentNode.getProps().getSign()) {
// handleDataVO.setSignFlag(true);
// } else {
// handleDataVO.setSignFlag(false);
// }
// }
// }
//
//
// List<HistoricActivityInstance> list = historyService.createHistoricActivityInstanceQuery().processInstanceId(historicProcessInstance.getId()).list();
// Map<String, List<HistoricActivityInstance>> historicActivityInstanceMap = new HashMap<>();
// for (HistoricActivityInstance historicActivityInstance : list) {
// List<HistoricActivityInstance> historicActivityInstances = historicActivityInstanceMap.get(historicActivityInstance.getActivityId());
// if (historicActivityInstances == null) {
// historicActivityInstances = new ArrayList<>();
// historicActivityInstances.add(historicActivityInstance);
// historicActivityInstanceMap.put(historicActivityInstance.getActivityId(), historicActivityInstances);
// } else {
// historicActivityInstances.add(historicActivityInstance);
// historicActivityInstanceMap.put(historicActivityInstance.getActivityId(), historicActivityInstances);
// }
// }
//
// Process mainProcess = repositoryService.getBpmnModel(historicProcessInstance.getProcessDefinitionId()).getMainProcess();
// Collection<FlowElement> flowElements = mainProcess.getFlowElements();
//
// List<String> runningList = new ArrayList<>();
// handleDataVO.setRunningList(runningList);
// List<String> endList = new ArrayList<>();
// handleDataVO.setEndList(endList);
// List<String> noTakeList = new ArrayList<>();
// handleDataVO.setNoTakeList(noTakeList);
// Map<String, List<TaskDetailVO>> deatailMap = new HashMap<>();
// List<Comment> processInstanceComments = taskService.getProcessInstanceComments(historicProcessInstance.getId());
// List<Attachment> processInstanceAttachments = taskService.getProcessInstanceAttachments(historicProcessInstance.getId());
// for (FlowElement flowElement : flowElements) {
// List<TaskDetailVO> detailVOList = new ArrayList<>();
// List<HistoricActivityInstance> historicActivityInstanceList = historicActivityInstanceMap.get(flowElement.getId());
// if (CollUtil.isNotEmpty(historicActivityInstanceList)) {
// for (HistoricActivityInstance historicActivityInstance : historicActivityInstanceList) {
// if (historicActivityInstance.getEndTime() != null) {
// if ("startEvent".equalsIgnoreCase(historicActivityInstance.getActivityType()) || "endEvent".equalsIgnoreCase(historicActivityInstance.getActivityType())) {
// TaskDetailVO taskDetailVO = new TaskDetailVO();
// taskDetailVO.setActivityId(historicActivityInstance.getActivityId());
// taskDetailVO.setName(historicActivityInstance.getActivityName());
// taskDetailVO.setCreateTime(historicActivityInstance.getStartTime());
// taskDetailVO.setEndTime(historicActivityInstance.getEndTime());
// detailVOList.add(taskDetailVO);
// deatailMap.put(historicActivityInstance.getActivityId(), detailVOList);
// endList.add(historicActivityInstance.getActivityId());
// } else if ("userTask".equalsIgnoreCase(historicActivityInstance.getActivityType())) {
// List<TaskDetailVO> voList = deatailMap.get(historicActivityInstance.getActivityId());
// List<HistoricActivityInstance> activityInstanceList = list.stream().filter(h -> h.getActivityId().equals(historicActivityInstance.getActivityId()) && h.getEndTime() != null).collect(Collectors.toList());
// if (voList != null) {
// collectUserTaskInfo(processInstanceComments, processInstanceAttachments, historicActivityInstance, voList, activityInstanceList);
// } else {
// voList = new ArrayList<>();
// collectUserTaskInfo(processInstanceComments, processInstanceAttachments, historicActivityInstance, voList, activityInstanceList);
// }
// deatailMap.put(historicActivityInstance.getActivityId(), voList);
// endList.add(historicActivityInstance.getActivityId());
// } else if ("serviceTask".equalsIgnoreCase(historicActivityInstance.getActivityType())) {
//
// }
// } else {
// if ("userTask".equalsIgnoreCase(historicActivityInstance.getActivityType())) {
// List<TaskDetailVO> voList = deatailMap.get(historicActivityInstance.getActivityId());
// List<HistoricActivityInstance> activityInstanceList = list.stream().filter(h -> h.getActivityId().equals(historicActivityInstance.getActivityId()) && h.getEndTime() == null).collect(Collectors.toList());
// if (voList != null) {
// collectUserTaskInfo(processInstanceComments, processInstanceAttachments, historicActivityInstance, voList, activityInstanceList);
// } else {
// voList = new ArrayList<>();
// collectUserTaskInfo(processInstanceComments, processInstanceAttachments, historicActivityInstance, voList, activityInstanceList);
// }
// deatailMap.put(historicActivityInstance.getActivityId(), voList);
// if (endList.contains(historicActivityInstance.getActivityId())) {
// endList.remove(historicActivityInstance.getActivityId());
// runningList.add(historicActivityInstance.getActivityId());
// } else {
// runningList.add(historicActivityInstance.getActivityId());
// }
// } else if ("serviceTask".equalsIgnoreCase(historicActivityInstance.getActivityType())) {
//
// }
// }
// }
// } else {
// noTakeList.add(flowElement.getId());
// }
// }
// handleDataVO.setProcessTemplates(processTemplates);
// handleDataVO.setDetailVOList(deatailMap);
// return Result.OK(handleDataVO);
// }
//
// private void collectUserTaskInfo(List<Comment> processInstanceComments,
// List<Attachment> processInstanceAttachments,
// HistoricActivityInstance historicActivityInstance,
// List<TaskDetailVO> voList,
// List<HistoricActivityInstance> activityInstanceList) {
// for (HistoricActivityInstance activityInstance : activityInstanceList) {
// TaskDetailVO taskDetailVO = new TaskDetailVO();
// taskDetailVO.setTaskId(activityInstance.getTaskId());
// taskDetailVO.setActivityId(activityInstance.getActivityId());
// taskDetailVO.setName(activityInstance.getActivityName());
// taskDetailVO.setCreateTime(activityInstance.getStartTime());
// taskDetailVO.setEndTime(activityInstance.getEndTime());
// Comment signComment = processInstanceComments.stream().filter(h -> h.getTaskId().equals(historicActivityInstance.getTaskId()) && h.getType().equals("sign")).findFirst().orElse(null);
// if (signComment != null) {
// taskDetailVO.setSignImage(signComment.getFullMessage());
// }
// List<Attachment> attachments = processInstanceAttachments.stream().filter(h -> h.getTaskId().equals(historicActivityInstance.getTaskId())).collect(Collectors.toList());
// if (CollUtil.isNotEmpty(attachments)) {
// List<AttachmentVO> attachmentVOList = new ArrayList<>();
// for (Attachment attachment : attachments) {
// AttachmentVO attachmentVO = new AttachmentVO();
// attachmentVO.setId(attachment.getId());
// attachmentVO.setName(attachment.getName());
// attachmentVO.setUrl(attachment.getUrl());
// attachmentVOList.add(attachmentVO);
// }
// taskDetailVO.setAttachmentVOList(attachmentVOList);
// }
//
// List<Comment> options = processInstanceComments.stream().filter(h -> h.getTaskId().equals(historicActivityInstance.getTaskId()) && h.getType().equals("opinion")).collect(Collectors.toList());
// if (CollUtil.isNotEmpty(options)) {
// List<OptionVO> optionVOList = new ArrayList<>();
// for (Comment option : options) {
// OptionVO optionVO = new OptionVO();
// optionVO.setComments(option.getFullMessage());
// optionVO.setUserId(option.getUserId());
//// optionVO.setUserName();
// optionVO.setCreateTime(option.getTime());
// optionVOList.add(optionVO);
// }
// taskDetailVO.setOptionVOList(optionVOList);
// }
//
// List<Comment> comments = processInstanceComments.stream().filter(h -> h.getTaskId().equals(historicActivityInstance.getTaskId()) && h.getType().equals("comments")).collect(Collectors.toList());
// if (CollUtil.isNotEmpty(comments)) {
// List<CommentVO> commentsVOList = new ArrayList<>();
// for (Comment comment : comments) {
// CommentVO commentVO = new CommentVO();
// commentVO.setComments(comment.getFullMessage());
// commentVO.setUserId(comment.getUserId());
//// commentVO.setUserName();
// commentVO.setCreateTime(comment.getTime());
// commentsVOList.add(commentVO);
// }
// taskDetailVO.setCommentVOList(commentsVOList);
// }
//
// voList.add(taskDetailVO);
//
//
// }
// }
//
//
//// @ApiOperation("上传文件")
//// @PostMapping("upLoadFile")
//// public Result<AttachmentVO> upLoadFile(@RequestParam("file") MultipartFile file, HttpServletRequest request){
//// MinioUploadUtil minioUploadUtil = SpringContextHolder.getBean(MinioUploadUtil.class);
//// MinioClient minioClient = SpringContextHolder.getBean(MinioClient.class);
//// AttachmentVO attachmentVO= new AttachmentVO();
//// attachmentVO.setName(file.getOriginalFilename());
//// minioUploadUtil.uploadFile(file, "java", file.getOriginalFilename());
//// try {
//// String url = minioClient.getPresignedObjectUrl(
//// GetPresignedObjectUrlArgs.builder()
//// .bucket("java")
//// .object(file.getOriginalFilename())
//// .expiry(7, TimeUnit.DAYS) // 设置5秒的超时时间。
//// .method(Method.GET)
//// .build());
//// attachmentVO.setUrl(url);
//// } catch (ErrorResponseException e) {
//// e.printStackTrace();
//// } catch (InsufficientDataException e) {
//// e.printStackTrace();
//// } catch (InternalException e) {
//// e.printStackTrace();
//// } catch (InvalidKeyException e) {
//// e.printStackTrace();
//// } catch (InvalidResponseException e) {
//// e.printStackTrace();
//// } catch (IOException e) {
//// e.printStackTrace();
//// } catch (NoSuchAlgorithmException e) {
//// e.printStackTrace();
//// } catch (XmlParserException e) {
//// e.printStackTrace();
//// } catch (ServerException e) {
//// e.printStackTrace();
//// }
//// return Result.OK(attachmentVO);
//// }
//// @ApiOperation("下载文件")
//// @PostMapping("downLoadFile")
//// public void downLoadFile(@RequestParam("name") String name){
//// MinioUploadUtil minioUploadUtil = SpringContextHolder.getBean(MinioUploadUtil.class);
//// minioUploadUtil.downFile(name,"java",name);
//// }
//
//}
package com.junmp.junmpProcess.mapper;//package org.jeecg.junmpProcess.mapper;
//
//
//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
//import org.apache.ibatis.annotations.Mapper;
//
//@Mapper
//public interface ProcessMapper extends BaseMapper<Process> {
//}
//package org.modules.junmpProcess.utils;
//
//import lombok.Cleanup;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.fileupload.FileItem;
//import org.apache.commons.fileupload.FileItemFactory;
//import org.apache.commons.fileupload.disk.DiskFileItem;
//import org.apache.commons.fileupload.disk.DiskFileItemFactory;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.web.multipart.MultipartFile;
//import org.springframework.web.multipart.commons.CommonsMultipartFile;
//
//import java.io.*;
//import java.text.DateFormat;
//import java.text.DecimalFormat;
//import java.text.SimpleDateFormat;
//import java.util.ArrayList;
//import java.util.Arrays;
//import java.util.Date;
//import java.util.List;
//import java.util.zip.ZipEntry;
//import java.util.zip.ZipOutputStream;
//
///**
// *
// */
//@Slf4j
//@SuppressWarnings("all")
//public class FileUtil {
//
// /**
// * 判断文件夹是否存在
// *
// * @param filePath 文件地址
// * @return
// */
// public static boolean fileIsExists(String filePath) {
// File f = new File(XSSEscape.escapePath(filePath));
// if (!f.exists()) {
// return false;
// }
// return true;
// }
//
// /**
// * 判断文件是否存在
// *
// * @param filePath
// * @return
// */
// public static boolean fileIsFile(String filePath) {
// File f = new File(XSSEscape.escapePath(filePath));
// if (!f.isFile()) {
// return false;
// }
// return true;
// }
//
// /**
// * 创建文件
// *
// * @param filePath 文件地址
// * @param fileName 文件名
// * @return
// */
// public static boolean createFile(String filePath, String fileName) {
// String strFilePath = XSSEscape.escapePath(filePath + fileName);
// ;
// File file = new File(XSSEscape.escapePath(filePath));
// if (!file.exists()) {
// /** 注意这里是 mkdirs()方法 可以创建多个文件夹 */
// file.mkdirs();
// }
// File subfile = new File(strFilePath);
// if (!subfile.exists()) {
// try {
// boolean b = subfile.createNewFile();
// return b;
// } catch (IOException e) {
// e.printStackTrace();
// }
// } else {
// return true;
// }
// return false;
// }
//
// /**
// * 创建文件夹
// *
// * @param filePath 文件夹地址
// * @return
// */
// public static void createDirs(String filePath) {
// File file = new File(XSSEscape.escapePath(filePath));
// if (!file.exists()) {
// /** 注意这里是 mkdirs()方法 可以创建多个文件夹 */
// file.mkdirs();
// }
// }
//
// /**
// * 遍历文件夹下当前文件
// *
// * @param file 地址
// */
// public static List<File> getFile(File file) {
// List<File> list = new ArrayList<>();
// File[] fileArray = file.listFiles();
// if (fileArray == null) {
// return list;
// } else {
// for (File f : fileArray) {
// if (f.isFile()) {
// list.add(0, f);
// }
// }
// }
// return list;
// }
//
// /**
// * 遍历文件夹下所有文件
// *
// * @param file 地址
// */
// public static List<File> getFile(File file, List<File> list) {
// File[] fileArray = file.listFiles();
// if (fileArray == null) {
// return list;
// } else {
// for (File f : fileArray) {
// if (f.isFile()) {
// list.add(0, f);
// } else {
// getFile(f, list);
// }
// }
// }
// return list;
// }
//
// /**
// * 删除文件或文件夹以及子文件夹和子文件等 【注意】请谨慎调用该方法,避免删除重要文件
// *
// * @param file
// */
// public static void deleteFileAll(File file) {
// if (file.exists()) {
// if (file.isFile()) {
// // 文件
// log.info(file.getAbsolutePath() + " 删除中...");
// file.delete();
// log.info("删除成功!");
// return;
// } else {
// // 文件夹
// File[] files = file.listFiles();
// for (int i = 0; i < files.length; i++) {
// deleteFileAll(files[i]);
// }
// file.delete();
// }
// } else {
// log.info(file.getAbsolutePath() + " 文件不存在!");
// }
// }
//
// /**
// * 删除单个文件
// *
// * @param filePath 文件路径
// */
// public static void deleteFile(String filePath) {
// File file = new File(XSSEscape.escapePath(filePath));
// if (file.exists() && file.isFile()) {
// file.delete();
// }
// }
//
// /**
// * 删除空文件夹、空的子文件夹
// *
// * @param file
// * @author cielo
// */
// public static void deleteEmptyDirectory(File file) {
// if (file != null && file.exists() && file.isDirectory()) {
// File[] files = file.listFiles();
// if (files != null && files.length > 0) {
// for (int i = 0; i < files.length; i++) {
// deleteEmptyDirectory(files[i]);
// }
// // 子文件夹里的删除完后,重新获取。判断空的子文件删除后,该文件夹是否为空
// files = file.listFiles();
// }
// if (files == null || files.length == 0) {
// String absolutePath = file.getAbsolutePath();
// file.delete();
// log.info("删除空文件夹!路径:" + absolutePath);
// }
// }
// }
//
// /**
// * 删除tmp文件
// *
// * @param multipartFile
// * @return
// */
// public static boolean deleteTmp(MultipartFile multipartFile) {
// try {
// CommonsMultipartFile commonsMultipartFile = (CommonsMultipartFile) multipartFile;
// DiskFileItem diskFileItem = (DiskFileItem) commonsMultipartFile.getFileItem();
// File storeLocation = diskFileItem.getStoreLocation();
// FileUtil.deleteEmptyDirectory(storeLocation);
// return true;
// } catch (Exception e) {
// log.error("删除tmp文件失败,错误:" + e.getMessage());
// return false;
// }
// }
//
// /**
// * 打开目录
// *
// * @param path
// */
// public static void open(String path) {
// // 打开输出目录
// try {
// String osName = System.getProperty("os.name");
// if (osName != null) {
// if (osName.contains("Mac")) {
// Runtime.getRuntime().exec("open " + path);
// } else if (osName.contains("Windows")) {
// Runtime.getRuntime().exec("cmd /c start " + path);
// } else {
// log.debug("文件输出目录:" + path);
// }
// }
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
//
// /**
// * 向文件中添加内容
// *
// * @param strcontent 内容
// * @param filePath 地址
// * @param fileName 文件名
// */
// public static void writeToFile(String strcontent, String filePath, String fileName) {
// //生成文件夹之后,再生成文件,不然会出错
// String strFilePath = filePath + fileName;
// // 每次写入时,都换行写
// File subfile = new File(XSSEscape.escapePath(strFilePath));
// RandomAccessFile raf = null;
// try {
// /** 构造函数 第二个是读写方式 */
// raf = new RandomAccessFile(subfile, "rw");
// /** 将记录指针移动到该文件的最后 */
// raf.seek(subfile.length());
// /** 向文件末尾追加内容 */
// raf.write(strcontent.getBytes());
// raf.close();
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
//
// /**
// * 修改文件内容(覆盖或者添加)
// *
// * @param path 文件地址
// * @param content 覆盖内容
// * @param append 指定了写入的方式,是覆盖写还是追加写(true=追加)(false=覆盖)
// */
// public static void modifyFile(String path, String content, boolean append) {
// try {
// @Cleanup FileWriter fileWriter = new FileWriter(path, append);
// @Cleanup BufferedWriter writer = new BufferedWriter(fileWriter);
// writer.append(content);
// writer.flush();
// writer.close();
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
//
// /**
// * 读取文件内容
// *
// * @param filePath 地址
// * @param filename 名称
// * @return 返回内容
// */
// public static String getString(String filePath, String filename) {
// StringBuffer sb = new StringBuffer("");
// String line;
// try {
// @Cleanup FileInputStream inputStream = new FileInputStream(new File(XSSEscape.escapePath(filePath + filename)));
// @Cleanup InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "UTF-8");
// @Cleanup BufferedReader reader = new BufferedReader(inputStreamReader);
// while ((line = reader.readLine()) != null) {
// sb.append(line);
// sb.append("\n");
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
// return sb.toString();
// }
//
// /**
// * 重命名文件
// *
// * @param oldPath 原来的文件地址
// * @param newPath 新的文件地址
// */
// public static void renameFile(String oldPath, String newPath) {
// File oleFile = new File(oldPath);
// File newFile = new File(newPath);
// //执行重命名
// oleFile.renameTo(newFile);
// }
//
// /**
// * 复制文件
// *
// * @param fromFile 要复制的文件目录
// * @param toFile 要粘贴的文件目录
// * @return 是否复制成功
// */
// public static boolean copy(String fromFile, String toFile) {
// //要复制的文件目录
// File[] currentFiles;
// File root = new File(fromFile);
// //如同判断SD卡是否存在或者文件是否存在
// //如果不存在则 return出去
// if (!root.exists()) {
// return false;
// }
// //如果存在则获取当前目录下的全部文件 填充数组
// currentFiles = root.listFiles();
// //目标目录
// File targetDir = new File(toFile);
// //创建目录
// if (!targetDir.exists()) {
// targetDir.mkdirs();
// }
// //遍历要复制该目录下的全部文件
// for (int i = 0; i < currentFiles.length; i++) {
// if (currentFiles[i].isDirectory()) {
// //如果当前项为子目录 进行递归
// copy(currentFiles[i].getPath() + "/", toFile + currentFiles[i].getName() + "/");
// } else {
// //如果当前项为文件则进行文件拷贝
// copyFile(currentFiles[i].getPath(), toFile + currentFiles[i].getName());
// }
// }
// return true;
// }
//
// /**
// * 文件拷贝
// * 要复制的目录下的所有非子目录(文件夹)文件拷贝
// *
// * @param fromFile
// * @param toFile
// * @return
// */
// public static boolean copyFile(String fromFile, String toFile) {
// try {
// @Cleanup InputStream fosfrom = new FileInputStream(XSSEscape.escapePath(fromFile));
// @Cleanup OutputStream fosto = new FileOutputStream(XSSEscape.escapePath(toFile));
// byte[] bt = new byte[1024];
// int c;
// while ((c = fosfrom.read(bt)) > 0) {
// fosto.write(bt, 0, c);
// }
// fosfrom.close();
// fosto.close();
// return true;
// } catch (Exception ex) {
// return false;
// }
// }
//
// /**
// * 文件拷贝
// *
// * @param fromFile
// * @param toFile
// * @param fileName
// * @return
// */
// public static boolean copyFile(String fromFile, String toFile, String fileName) {
// try {
// //目标目录
// File targetDir = new File(toFile);
// //创建目录
// if (!targetDir.exists()) {
// targetDir.mkdirs();
// }
// @Cleanup InputStream fosfrom = new FileInputStream(fromFile);
// @Cleanup OutputStream fosto = new FileOutputStream(toFile + fileName);
// byte[] bt = new byte[1024];
// int c;
// while ((c = fosfrom.read(bt)) > 0) {
// fosto.write(bt, 0, c);
// }
// fosfrom.close();
// fosto.close();
// return true;
// } catch (Exception ex) {
// return false;
// }
// }
//
// /**
// * 保存文件
// *
// * @param inputStream
// * @param path
// * @param fileName
// */
// public static void write(InputStream inputStream, String path, String fileName) {
// OutputStream os = null;
// long dateStr = System.currentTimeMillis();
// try {
// // 1K的数据缓冲
// byte[] bs = new byte[1024];
// // 读取到的数据长度
// int len;
// // 输出的文件流保存到本地文件
// File tempFile = new File(XSSEscape.escapePath(path));
// if (!tempFile.exists()) {
// tempFile.mkdirs();
// }
// String newFileName = tempFile.getPath() + File.separator + fileName;
// log.info("保存文件:" + newFileName);
// os = new FileOutputStream(XSSEscape.escapePath(newFileName));
// // 开始读取
// while ((len = inputStream.read(bs)) != -1) {
// os.write(bs, 0, len);
// }
// } catch (IOException e) {
// log.error("生成excel失败");
// } catch (Exception e) {
// log.error("生成excel失败");
// } finally {
// // 完毕,关闭所有链接
// try {
// if (os != null) {
// os.close();
// }
// inputStream.close();
// } catch (IOException e) {
// log.error("关闭链接失败" + e.getMessage());
// }
// }
// }
//
// /**
// * 写入文件
// *
// * @param inputStream
// * @param path
// * @param fileName
// */
// public static void writeFile(InputStream inputStream, String path, String fileName) {
// OutputStream os = null;
// try {
// // 1K的数据缓冲
// byte[] bs = new byte[1024];
// // 读取到的数据长度
// int len;
// // 输出的文件流保存到本地文件
// File tempFile = new File(XSSEscape.escapePath(path));
// if (!tempFile.exists()) {
// tempFile.mkdirs();
// }
// String newFileName = tempFile.getPath() + File.separator + fileName;
// log.info("保存文件:" + newFileName);
// os = new FileOutputStream(XSSEscape.escapePath(newFileName));
// // 开始读取
// while ((len = inputStream.read(bs)) != -1) {
// os.write(bs, 0, len);
// }
// } catch (IOException e) {
// log.error("生成excel失败");
// } catch (Exception e) {
// log.error("生成excel失败");
// } finally {
// // 完毕,关闭所有链接
// try {
// if (os != null) {
// os.close();
// }
// inputStream.close();
// } catch (IOException e) {
// log.error("关闭链接失败" + e.getMessage());
// }
// }
// }
//
// /**
// * 上传文件
// *
// * @param file 文件
// * @param filePath 保存路径
// * @param fileName 保存名称
// */
// public static void upFile(MultipartFile file, String filePath, String fileName) {
// try {
// String escapeFilePath = XSSEscape.escape(filePath);
// String escapeFileName = XSSEscape.escape(fileName);
// // 输出的文件流保存到本地文件
// File tempFile = new File(escapeFilePath);
// if (!tempFile.exists()) {
// tempFile.mkdirs();
// }
// File f = new File(escapeFilePath, escapeFileName);
// //将上传的文件存储到指定位置
// file.transferTo(f);
// } catch (Exception e) {
// log.error(e.getMessage());
// }
// }
//
// /**
// * 读取文件修改时间
// */
// public static String getCreateTime(String filePath) {
// DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// File file = new File(XSSEscape.escapePath(filePath));
// // 毫秒数
// long modifiedTime = file.lastModified();
// // 通过毫秒数构造日期 即可将毫秒数转换为日期
// Date date = new Date(modifiedTime);
// String dateString = format.format(date);
// return dateString;
// }
//
// /**
// * 获取文件类型
// */
// public static String getFileType(File file) {
// if (file.isFile()) {
// String fileName = file.getName();
// String fileTyle = fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length());
// return fileTyle;
// }
// return null;
// }
//
// /**
// * 获取文件类型
// */
// public static String getFileType(String fileName) {
// int lastIndexOf = fileName.lastIndexOf(".") + 1;
// //获取文件的后缀名 jpg
// String suffix = fileName.substring(lastIndexOf);
// return suffix;
// }
//
// /**
// * 获取文件大小
// *
// * @param data
// * @return
// */
// public static String getSize(String data) {
// String size = "";
// if (data != null && !StringUtils.isEmpty(data)) {
// long fileS = Long.parseLong(data);
// DecimalFormat df = new DecimalFormat("#.00");
// if (fileS < 1024) {
// size = df.format((double) fileS) + "BT";
// } else if (fileS < 1048576) {
// size = df.format((double) fileS / 1024) + "KB";
// } else if (fileS < 1073741824) {
// size = df.format((double) fileS / 1048576) + "MB";
// } else {
// size = df.format((double) fileS / 1073741824) + "GB";
// }
// } else {
// size = "0BT";
// }
// return size;
// }
//
// private static final int BUFFER_SIZE = 2 * 1024;
//
// /**
// * 压缩文件夹
// *
// * @param srcDir 压缩文件夹路径
// * @param outDir 压缩文件路径
// * @param keepDirStructure 是否保留原来的目录结构,
// * true:保留目录结构;
// * false:所有文件跑到压缩包根目录下(注意:不保留目录结构可能会出现同名文件,会压缩失败)
// * @throws RuntimeException 压缩失败会抛出运行时异常
// */
// public static void toZip(String outDir, boolean keepDirStructure, String... srcDir) {
// try {
// @Cleanup OutputStream out = new FileOutputStream(new File(XSSEscape.escapePath(outDir)));
// @Cleanup ZipOutputStream zos = null;
// try {
// zos = new ZipOutputStream(out);
// List<File> sourceFileList = new ArrayList<File>();
// for (String dir : srcDir) {
// File sourceFile = new File(XSSEscape.escapePath(dir));
// sourceFileList.add(sourceFile);
// }
// compress(sourceFileList, zos, keepDirStructure);
// } catch (Exception e) {
// throw new RuntimeException("zip error from ZipUtils", e);
// } finally {
// if (zos != null) {
// try {
// zos.close();
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
// }
// } catch (Exception e) {
// log.error("压缩失败:{}", e.getMessage());
// }
// }
//
// /**
// * 递归压缩方法
// *
// * @param sourceFile 源文件
// * @param zos zip输出流
// * @param name 压缩后的名称
// * @param keepDirStructure 是否保留原来的目录结构,
// * true:保留目录结构;
// * false:所有文件跑到压缩包根目录下(注意:不保留目录结构可能会出现同名文件,会压缩失败)
// * @throws Exception
// */
// private static void compress(File sourceFile, ZipOutputStream zos, String name, boolean keepDirStructure) throws Exception {
// byte[] buf = new byte[BUFFER_SIZE];
// if (sourceFile.isFile()) {
// zos.putNextEntry(new ZipEntry(name));
// int len;
// @Cleanup FileInputStream in = new FileInputStream(sourceFile);
// while ((len = in.read(buf)) != -1) {
// zos.write(buf, 0, len);
// }
// zos.closeEntry();
// in.close();
// } else {
// File[] listFiles = sourceFile.listFiles();
// if (listFiles == null || listFiles.length == 0) {
// if (keepDirStructure) {
// zos.putNextEntry(new ZipEntry(name + "/"));
// zos.closeEntry();
// }
// } else {
// for (File file : listFiles) {
// if (keepDirStructure) {
// compress(file, zos, name + "/" + file.getName(),
// keepDirStructure);
// } else {
// compress(file, zos, file.getName(), keepDirStructure);
// }
// }
// }
// }
// }
//
// private static void compress(List<File> sourceFileList, ZipOutputStream zos, boolean keepDirStructure) throws Exception {
// byte[] buf = new byte[BUFFER_SIZE];
// for (File sourceFile : sourceFileList) {
// String name = sourceFile.getName();
// if (sourceFile.isFile()) {
// zos.putNextEntry(new ZipEntry(name));
// int len;
// @Cleanup FileInputStream in = new FileInputStream(sourceFile);
// while ((len = in.read(buf)) != -1) {
// zos.write(buf, 0, len);
// }
// zos.closeEntry();
// in.close();
// } else {
// File[] listFiles = sourceFile.listFiles();
// if (listFiles == null || listFiles.length == 0) {
// if (keepDirStructure) {
// zos.putNextEntry(new ZipEntry(name + "/"));
// zos.closeEntry();
// }
// } else {
// for (File file : listFiles) {
// if (keepDirStructure) {
// compress(file, zos, name + "/" + file.getName(),
// keepDirStructure);
// } else {
// compress(file, zos, file.getName(),
// keepDirStructure);
// }
//
// }
// }
// }
// }
// }
//
// //=================================判断文件后缀==========================
//
// /**
// * 允许文件类型
// *
// * @param fileType 文件所有类型
// * @param fileExtension 当前文件类型
// * @return
// */
// public static boolean fileType(String fileType, String fileExtension) {
// String[] allowExtension = fileType.split(",");
// return Arrays.asList(allowExtension).contains(fileExtension.toLowerCase());
// }
//
// /**
// * 允许图片类型
// *
// * @param imageType 图片所有类型
// * @param fileExtension 当前图片类型
// * @return
// */
// public static boolean imageType(String imageType, String fileExtension) {
// String[] allowExtension = imageType.split(",");
// return Arrays.asList(allowExtension).contains(fileExtension.toLowerCase());
// }
//
// /**
// * 允许上传大小
// *
// * @param fileSize 文件大小
// * @param maxSize 最大的文件
// * @return
// */
// public static boolean fileSize(Long fileSize, int maxSize) {
// if (fileSize > maxSize) {
// return true;
// }
// return false;
// }
//
// /**
// * 导入生成临时文件后,获取文件内容
// *
// * @param multipartFile 文件
// * @param filePath 路径
// * @return
// */
// public static String getFileContent(MultipartFile multipartFile, String filePath) {
// //文件名
// String fileName = multipartFile.getName();
// //上传到项目文件路径中
// FileUtil.upFile(multipartFile, filePath, fileName);
// //读取文件文件内容
// String fileContent = FileUtil.getString(filePath, fileName);
// return fileContent;
// }
//
// /**
// * 判断是否为json格式且不为空
// *
// * @param multipartFile
// * @param type 类型
// * @return
// */
// public static boolean existsSuffix(MultipartFile multipartFile, String type) {
// if (!multipartFile.getOriginalFilename().endsWith("." + type) || multipartFile.getSize() < 1) {
// return true;
// }
// return false;
// }
//
// /**
// * File转MultipartFile
// *
// * @param file
// * @return
// */
// public static MultipartFile createFileItem(File file) {
// FileItemFactory factory = new DiskFileItemFactory(16, null);
// FileItem item = factory.createItem("textField", "text/plain", true, file.getName());
// int bytesRead = 0;
// byte[] buffer = new byte[8192];
// try {
// @Cleanup FileInputStream fis = new FileInputStream(file);
// OutputStream os = item.getOutputStream();
// while ((bytesRead = fis.read(buffer, 0, 8192)) != -1) {
// os.write(buffer, 0, bytesRead);
// }
// os.close();
// fis.close();
// } catch (IOException e) {
// e.printStackTrace();
// }
// MultipartFile multipartFile = new CommonsMultipartFile(item);
// return multipartFile;
// }
//
//}
package com.junmp.junmpProcess.utils;//package org.jeecg.junmpProcess.utils;
//
//import io.minio.*;
//import io.minio.http.Method;
//import io.minio.messages.Bucket;
//import lombok.Cleanup;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.stereotype.Component;
//import org.springframework.web.multipart.MultipartFile;
//
//import javax.annotation.Resource;
//import javax.servlet.ServletOutputStream;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.*;
//import java.net.URLEncoder;
//import java.util.List;
//import java.util.stream.Collectors;
//
///**
// * minio文件上传工具类
// */
//@Component
//@Slf4j
//public class MinioUploadUtil {
// @Resource(name = "minioClient")
// private MinioClient minioClient;
//
// /**
// * 上传文件
// *
// * @param file
// * @param bucketName
// * @param fileName
// * @return
// */
// public void uploadFile(MultipartFile file, String bucketName, String fileName) {
// //判断文件是否为空
// if (null == file || 0 == file.getSize()) {
// log.error("文件不能为空");
// }
// //判断存储桶是否存在
// bucketExists(bucketName);
// //文件名
// if(file != null){
// String originalFilename = file.getOriginalFilename();
// //新的文件名 = 存储桶文件名_时间戳.后缀名
// assert originalFilename != null;
// //开始上传
// try {
// @Cleanup InputStream inputStream = file.getInputStream();
// minioClient.putObject(
// PutObjectArgs.builder().bucket(bucketName).object(fileName).stream(
// inputStream, file.getSize(), -1)
// .contentType(file.getContentType())
// .build());
// } catch (Exception e) {
// log.error(e.getMessage());
// }
// }
// }
//
// /**
// * 上传文件(可以传空) 数据备份使用
// * @param filePath
// * @param bucketName
// * @param fileName
// * @throws IOException
// */
// public void uploadFiles(String filePath, String bucketName, String fileName) throws IOException {
// MultipartFile file = FileUtil.createFileItem(new File(XSSEscape.escapePath(filePath)));
// //开始上传
// try {
// @Cleanup InputStream inputStream = file.getInputStream();
// minioClient.putObject(
// PutObjectArgs.builder().bucket(bucketName).object(fileName).stream(
// inputStream, file.getSize(), -1)
// .contentType(file.getContentType())
// .build());
// } catch (Exception e) {
// log.error(e.getMessage());
// }
// }
//
// /**
// * 下载文件
// *
// * @param fileName 文件名
// * @param bucketName 桶名(文件夹)
// * @return
// */
// public void downFile(String fileName, String bucketName, String downName) {
// InputStream inputStream = null;
// try {
// inputStream = minioClient.getObject(
// GetObjectArgs.builder()
// .bucket(bucketName)
// .object(fileName)
// .build());
// //下载文件
// HttpServletResponse response = ServletUtil.getResponse();
// HttpServletRequest request = ServletUtil.getRequest();
// try {
// @Cleanup BufferedInputStream bis = new BufferedInputStream(inputStream);
// if (StringUtils.isNotEmpty(downName)) {
// fileName = downName;
// }
// response.setCharacterEncoding("UTF-8");
// response.setContentType("text/plain");
// if(fileName.contains(".svg")){
// response.setContentType("image/svg+xml");
// }
// //编码的文件名字,关于中文乱码的改造
// String codeFileName = "";
// String agent = request.getHeader("USER-AGENT").toLowerCase();
// if (-1 != agent.indexOf("msie") || -1 != agent.indexOf("trident")) {
// //IE
// codeFileName = URLEncoder.encode(fileName, "UTF-8");
// } else if (-1 != agent.indexOf("mozilla")) {
// //火狐,谷歌
// codeFileName = new String(fileName.getBytes("UTF-8"), "iso-8859-1");
// } else {
// codeFileName = URLEncoder.encode(fileName, "UTF-8");
// }
// response.setHeader("Content-Disposition", "attachment;filename=" + XSSEscape.escape(new String(codeFileName.getBytes(), "utf-8")));
// @Cleanup OutputStream os = response.getOutputStream();
// int i;
// byte[] buff = new byte[1024 * 8];
// while ((i = bis.read(buff)) != -1) {
// os.write(buff, 0, i);
// }
// os.flush();
// } catch (Exception e) {
// e.printStackTrace();
// } finally {
// try {
// inputStream.close();
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
// } catch (Exception e) {
// log.error(e.getMessage());
// } finally {
// if (inputStream!=null){
// try {
// inputStream.close();
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
// }
// }
//
// /**
// * 返回图片
// *
// * @param fileName 文件名
// * @param bucketName 桶名(文件夹)
// * @return
// */
// public void dowloadMinioFile(String fileName, String bucketName) {
// try {
// @Cleanup InputStream inputStream = minioClient.getObject(
// GetObjectArgs.builder()
// .bucket(bucketName)
// .object(fileName)
// .build());
// @Cleanup ServletOutputStream outputStream1 = ServletUtil.getResponse().getOutputStream();
// //读取指定路径下面的文件
// @Cleanup OutputStream outputStream = new BufferedOutputStream(outputStream1);
// //创建存放文件内容的数组
// byte[] buff = new byte[1024];
// //所读取的内容使用n来接收
// int n;
// //当没有读取完时,继续读取,循环
// while ((n = inputStream.read(buff)) != -1) {
// //将字节数组的数据全部写入到输出流中
// outputStream.write(buff, 0, n);
// }
// //强制将缓存区的数据进行输出
// outputStream.flush();
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
//
//
// /**
// * 获取資源
// *
// * @param fileName
// * @param bucketName
// */
// public String getFile(String fileName, String bucketName) {
// String objectUrl = null;
// try {
// objectUrl = minioClient.getPresignedObjectUrl(
// GetPresignedObjectUrlArgs.builder()
// .method(Method.GET)
// .bucket(bucketName)
// .object(fileName)
// .build());
// } catch (Exception e) {
// log.error(e.getMessage());
// }
// return objectUrl;
// }
//
// /**
// * 下载文件
// *
// * @param fileName 文件名称
// * @param bucketName 存储桶名称
// * @return
// */
// public InputStream downloadMinio(String fileName, String bucketName) {
// try {
// @Cleanup InputStream stream =
// minioClient.getObject(
// GetObjectArgs.builder().bucket(bucketName).object(fileName).build());
// return stream;
// } catch (Exception e) {
// e.printStackTrace();
// log.info(e.getMessage());
// return null;
// }
// }
//
// /**
// * 获取全部bucket
// *
// * @return
// */
// public List<String> getAllBuckets() throws Exception {
// return minioClient.listBuckets().stream().map(Bucket::name).collect(Collectors.toList());
// }
//
// /**
// * 根据bucketName删除信息
// *
// * @param bucketName bucket名称
// */
// public void removeBucket(String bucketName) throws Exception {
// minioClient.removeBucket(RemoveBucketArgs.builder().bucket(bucketName).build());
// }
//
// /**
// * 删除一个对象
// *
// * @param name
// * @return
// */
// public boolean removeFile(String bucketName, String name) {
// boolean isOK = true;
// try {
// minioClient.removeObject(RemoveObjectArgs.builder().bucket(bucketName).object(name).build());
// } catch (Exception e) {
// e.printStackTrace();
// isOK = false;
// }
// return isOK;
// }
//
// /**
// * 检查存储桶是否已经存在(不存在不创建)
// *
// * @param name
// * @return
// */
// public boolean bucketExists(String name) {
// boolean isExist = false;
// try {
// isExist = minioClient.bucketExists(getBucketExistsArgs(name));
// } catch (Exception e) {
// e.printStackTrace();
// }
// return isExist;
// }
//
// /**
// * 检查存储桶是否已经存在(不存在则创建)
// *
// * @param name
// * @return
// */
// public void bucketExistsCreate(String name) {
// try {
// minioClient.bucketExists(getBucketExistsArgs(name));
// minioClient.makeBucket(getMakeBucketArgs(name));
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
//
//
//
//
//
//
// /**
// * String转MakeBucketArgs
// *
// * @param name
// * @return
// */
// public static MakeBucketArgs getMakeBucketArgs(String name) {
// return MakeBucketArgs.builder().bucket(name).build();
// }
//
// /**
// * String转BucketExistsArgs
// *
// * @param name
// * @return
// */
// public static BucketExistsArgs getBucketExistsArgs(String name) {
// return BucketExistsArgs.builder().bucket(name).build();
// }
//
//
//
//
//}
//package com.junmp.junmpProcess.utils;
//
//import com.alibaba.fastjson.JSONObject;
//import com.baomidou.mybatisplus.core.toolkit.Constants;
//import lombok.Cleanup;
//import org.springframework.web.context.request.RequestAttributes;
//import org.springframework.web.context.request.RequestContextHolder;
//import org.springframework.web.context.request.ServletRequestAttributes;
//
//import javax.servlet.ServletInputStream;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import javax.servlet.http.HttpSession;
//import java.io.IOException;
//
///**
// *
// */
//public class ServletUtil {
//
// /**
// * 获取ServletPath
// */
// public static String getServletPath() {
// return ServletUtil.getRequest().getServletPath();
// }
//
//
// /**
// * 获取Request Payload
// */
// public static String getPayload() {
// try {
// @Cleanup ServletInputStream is = ServletUtil.getRequest().getInputStream();
// int nRead = 1;
// int nTotalRead = 0;
// byte[] bytes = new byte[10240 * 20];
// while (nRead > 0) {
// nRead = is.read(bytes, nTotalRead, bytes.length - nTotalRead);
// if (nRead > 0) {
// nTotalRead = nTotalRead + nRead;
// }
// }
// String str = new String(bytes, 0, nTotalRead, Constants.UTF_8);
// return str;
// } catch (IOException e) {
// e.printStackTrace();
// return "";
// }
// }
//
//
// /**
// * 获取User-Agent
// */
// public static String getUserAgent() {
// return ServletUtil.getHeader("User-Agent");
// }
//
// /**
// * 判断是否是手机端登陆
// */
// public static boolean getIsMobileDevice() {
// return isMobileDevice(ServletUtil.getUserAgent());
// }
//
// /**
// * 获取HTTP头信息
// */
// public static String getHeader(String name) {
// if (getRequest() != null) {
// return getRequest().getHeader(name);
// }
// return null;
// }
//
// /**
// * 获取表单参数
// */
// public static String getParameter(String name) {
// return getRequest().getParameter(name);
// }
//
//
// /**
// * 获取request
// */
// public static HttpServletRequest getRequest() {
// if (getRequestAttributes() != null) {
// return getRequestAttributes().getRequest();
// }
// return null;
// }
//
// /**
// * 获取response
// */
// public static HttpServletResponse getResponse() {
// return getRequestAttributes().getResponse();
// }
//
// /**
// * 获取session
// */
// public static HttpSession getSession() {
// return getRequest().getSession();
// }
//
// public static ServletRequestAttributes getRequestAttributes() {
// RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
// return (ServletRequestAttributes) attributes;
// }
//
// /**
// * 将字符串渲染到客户端
// *
// * @param response 渲染对象
// * @param string 待渲染的字符串
// * @return null
// */
// public static String renderString(HttpServletResponse response, String string) {
// try {
// response.setHeader("Access-Control-Allow-Origin", "*");
// response.setHeader("Cache-Control", "no-cache");
// response.setContentType("application/json");
// response.setCharacterEncoding(Constants.UTF_8);
// response.getWriter().print(string);
// } catch (IOException e) {
// e.printStackTrace();
// }
// return null;
// }
//
// /**
// * 是否是Ajax异步请求
// *
// * @param request
// */
// public static boolean isAjaxRequest(HttpServletRequest request) {
// String accept = request.getHeader("accept");
// if (accept != null && accept.indexOf("application/json") != -1) {
// return true;
// }
// String xRequestedWith = request.getHeader("X-Requested-With");
// if (xRequestedWith != null && xRequestedWith.indexOf("XMLHttpRequest") != -1) {
// return true;
// }
// String uri = request.getRequestURI();
// if (inStringIgnoreCase(uri, ".json", ".xml")) {
// return true;
// }
// String ajax = request.getParameter("__ajax");
// if (inStringIgnoreCase(ajax, "json", "xml")) {
// return true;
// }
// return false;
// }
//
// /**
// * 是否包含字符串
// *
// * @param str 验证字符串
// * @param strs 字符串组
// * @return 包含返回true
// */
// public static boolean inStringIgnoreCase(String str, String... strs) {
// if (str != null && strs != null) {
// for (String s : strs) {
// if (str.equalsIgnoreCase((s.trim()))) {
// return true;
// }
// }
// }
// return false;
// }
//
// /**
// * 返回JSONObject对象
// */
// public static JSONObject getJsonObject() throws Exception {
// String builder = ServletUtil.getPayload();
// return JSONObject.parseObject(builder);
// }
//
// /**
// * 判断是否是移动设备
// *
// * @param requestHeader
// * @return
// */
// public static boolean isMobileDevice(String requestHeader) {
// String[] deviceArray = new String[]{"android", "windows phone", "iphone", "ios", "ipad", "mqqbrowser"};
// if (requestHeader == null) {
// return false;
// }
// requestHeader = requestHeader.toLowerCase();
// for (int i = 0; i < deviceArray.length; i++) {
// if (requestHeader.indexOf(deviceArray[i]) > 0) {
// return true;
// }
// }
// return false;
// }
//}
//package org.modules.junmpProcess.utils;
//
//import lombok.extern.slf4j.Slf4j;
//import org.owasp.validator.html.AntiSamy;
//import org.owasp.validator.html.CleanResults;
//import org.owasp.validator.html.Policy;
//
//import java.io.InputStream;
//import java.util.regex.Matcher;
//import java.util.regex.Pattern;
//
///**
// * 防止XSS注入
// */
//@Slf4j
//public class XSSEscape {
//
//
// /**
// * 非法路径符号
// */
// private static final Pattern PATH_PATTERN = Pattern.compile("\\.\\.\\|\\.\\./|~/|~\\|[<]|>|\"|[*]|[|]|[?]", Pattern.CASE_INSENSITIVE);
//
// private static InputStream inputStream;
// private static Policy policy;
// private static Policy emptyPolicy;
//
// static {
// try {
// inputStream = XSSEscape.class.getClassLoader().getResourceAsStream("antisamy-ebay.xml");
// policy = Policy.getInstance(inputStream);
// inputStream.close();
// inputStream = XSSEscape.class.getClassLoader().getResourceAsStream("antisamy-empty.xml");
// emptyPolicy = Policy.getInstance(inputStream);
// inputStream.close();
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
//
// /**
// * 跨站式脚本攻击字符串过滤
// *
// * @param character 需要转义的字符串
// */
// public static String escape(String character) {
// try {
// AntiSamy antiSamy = new AntiSamy();
// CleanResults scan = antiSamy.scan(character, policy);
// String str = scan.getCleanHTML();
// str = str.replaceAll("&quot;", "\"");
// str = str.replaceAll("&amp;", "&");
// str = str.replaceAll("&lt;", "<");
// str = str.replaceAll("&gt;", ">");
// return str;
// } catch (Exception e) {
// log.error("转换错误:" + e.getMessage());
// }
// return null;
// }
//
//
// /**
// * 此方法伪过滤
// *
// * @param character 需要转义的字符串
// */
// public static String escapeEmpty(String character) {
// try {
// AntiSamy antiSamy = new AntiSamy();
// CleanResults scan = antiSamy.scan(character, emptyPolicy);
// return scan.getCleanHTML();
// } catch (Exception e) {
// }
// return character;
// }
//
// /**
// * 过滤非法路径
// *
// * @param path
// * @return
// */
// public static String escapePath(String path) {
// Matcher matcher = PATH_PATTERN.matcher(path);
// return escapeEmpty(matcher.replaceAll("").replaceAll("\\.\\.", "."));
// }
//
//
//}
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!--
W3C rules retrieved from:
http://www.w3.org/TR/html401/struct/global.html
-->
<anti-samy-rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="antisamy.xsd">
<directives>
<directive name="omitXmlDeclaration" value="true"/>
<directive name="omitDoctypeDeclaration" value="true"/>
<directive name="maxInputSize" value="20000"/>
<directive name="useXHTML" value="true"/>
<directive name="formatOutput" value="true"/>
<!--
remember, this won't work for relative URIs - AntiSamy doesn't
know anything about the URL or your web structure
-->
<directive name="embedStyleSheets" value="false"/>
</directives>
<common-regexps>
<!--
From W3C:
This attribute assigns a class name or set of class names to an
element. Any number of elements may be assigned the same class
name or names. Multiple class names must be separated by white
space characters.
-->
<!-- The 16 colors defined by the HTML Spec (also used by the CSS Spec) -->
<regexp name="colorName"
value="(aqua|black|blue|fuchsia|gray|grey|green|lime|maroon|navy|olive|purple|red|silver|teal|white|yellow)"/>
<!-- HTML/CSS Spec allows 3 or 6 digit hex to specify color -->
<regexp name="colorCode" value="(#([0-9a-fA-F]{6}|[0-9a-fA-F]{3}))"/>
<regexp name="anything" value=".*"/>
<regexp name="numberOrPercent" value="(\d)+(%{0,1})"/>
<regexp name="paragraph" value="([\p{L}\p{N},'\.\s\-_\(\)]|&amp;[0-9]{2};)*"/>
<regexp name="htmlId" value="[a-zA-Z0-9\:\-_\.]+"/>
<regexp name="htmlTitle"
value="[\p{L}\p{N}\s\-_',:\[\]!\./\\\(\)&amp;]*"/> <!-- force non-empty with a '+' at the end instead of '*' -->
<regexp name="htmlClass" value="[a-zA-Z0-9\s,\-_]+"/>
<regexp name="onsiteURL"
value="^(?!//)(?![\p{L}\p{N}\\\.\#@\$%\+&amp;;\-_~,\?=/!]*(&amp;colon))[\p{L}\p{N}\\\.\#@\$%\+&amp;;\-_~,\?=/!]*"/>
<regexp name="offsiteURL"
value="(\s)*((ht|f)tp(s?)://|mailto:)[\p{L}\p{N}]+[\p{L}\p{N}\p{Zs}\.\#@\$%\+&amp;;:\-_~,\?=/!\(\)]*(\s)*"/>
<regexp name="boolean" value="(true|false)"/>
<regexp name="singlePrintable" value="[a-zA-Z0-9]{1}"/> <!-- \w allows the '_' character -->
<!-- This is for elements (ex: elemName { ... }) -->
<regexp name="cssElementSelector" value="[a-zA-Z0-9\-_]+|\*"/>
<!-- This is to list out any element names that are *not* valid -->
<regexp name="cssElementExclusion" value=""/>
<!-- This if for classes (ex: .className { ... }) -->
<regexp name="cssClassSelector" value="\.[a-zA-Z0-9\-_]+"/>
<!-- This is to list out any class names that are *not* valid -->
<regexp name="cssClassExclusion" value=""/>
<!-- This is for ID selectors (ex: #myId { ... } -->
<regexp name="cssIDSelector" value="#[a-zA-Z0-9\-_]+"/>
<!-- This is to list out any IDs that are *not* valid - FIXME: What should the default be to avoid div hijacking? *? -->
<regexp name="cssIDExclusion" value=""/>
<!-- This is for pseudo-element selector (ex. foo:pseudo-element { ... } -->
<regexp name="cssPseudoElementSelector" value=":[a-zA-Z0-9\-_]+"/>
<!-- This is to list out any psuedo-element names that are *not* valid -->
<regexp name="cssPsuedoElementExclusion" value=""/>
<!-- This is for attribute selectors (ex. foo[attr=value] { ... } -->
<regexp name="cssAttributeSelector" value="\[[a-zA-Z0-9\-_]+((=|~=|\|=){1}[a-zA-Z0-9\-_]+){1}\]"/>
<!-- This is to list out any attribute names that are *not* valid -->
<regexp name="cssAttributeExclusion" value=""/>
<!-- This is for resources referenced from CSS (such as background images and other imported stylesheets) -->
<regexp name="cssOnsiteUri" value="url\(([\p{L}\p{N}\\/\.\?=\#&amp;;\-_~]+|\#(\w)+)\)"/>
<regexp name="cssOffsiteUri"
value="url\((\s)*((ht|f)tp(s?)://)[\p{L}\p{N}]+[~\p{L}\p{N}\p{Zs}\-_\.@#$%&amp;;:,\?=/\+!]*(\s)*\)"/>
<!-- This if for CSS Identifiers -->
<regexp name="cssIdentifier" value="[a-zA-Z0-9\-_]+"/>
<!-- This is for comments within CSS (ex. /* comment */) -->
<regexp name="cssCommentText" value="[\p{L}\p{N}\-_,\/\\\.\s\(\)!\?\=\$#%\^&amp;:&quot;']+"/>
<regexp name="integer" value="(-|\+)?[0-9]+"/>
<regexp name="positiveInteger" value="(\+)?[0-9]+"/>
<regexp name="number" value="(-|\+)?([0-9]+(\.[0-9]+)?)"/>
<regexp name="angle" value="(-|\+)?([0-9]+(\.[0-9]+)?)(deg|grads|rad)"/>
<regexp name="time" value="([0-9]+(\.[0-9]+)?)(ms|s)"/>
<regexp name="frequency" value="([0-9]+(\.[0-9]+)?)(hz|khz)"/>
<regexp name="length" value="((-|\+)?0|(-|\+)?([0-9]+(\.[0-9]+)?)(em|ex|px|in|cm|mm|pt|pc))"/>
<regexp name="positiveLength" value="((\+)?0|(\+)?([0-9]+(\.[0-9]+)?)(em|ex|px|in|cm|mm|pt|pc))"/>
<regexp name="percentage" value="(-|\+)?([0-9]+(\.[0-9]+)?)%"/>
<regexp name="positivePercentage" value="(\+)?([0-9]+(\.[0-9]+)?)%"/>
<regexp name="absolute-size" value="(xx-small|x-small|small|medium|large|x-large|xx-large)"/>
<regexp name="relative-size" value="(larger|smaller)"/>
<!-- Used for CSS Color specifications (complex regexp expresses integer values of 0-255) -->
<regexp name="rgbCode"
value="rgb\(([1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5]),([1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5]),([1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\)"/>
<!-- CSS2 Allowed System Color Values -->
<regexp name="systemColor"
value="(activeborder|activecaption|appworkspace|background|buttonface|buttonhighlight|buttonshadow|buttontext|captiontext|graytext|highlight|highlighttext|inactiveborder|inactivecaption|inactivecaptiontext|infobackground|infotext|menu|menutext|scrollbar|threeddarkshadow|threedface|threedhighlight|threedlightshadow|threedshadow|window|windowframe|windowtext)"/>
</common-regexps>
<!--
Tag.name = a, b, div, body, etc.
Tag.action = filter: remove tags, but keep content, validate: keep content as long as it passes rules, remove: remove tag and contents
Attribute.name = id, class, href, align, width, etc.
Attribute.onInvalid = what to do when the attribute is invalid, e.g., remove the tag (removeTag), remove the attribute (removeAttribute), filter the tag (filterTag)
Attribute.description = What rules in English you want to tell the users they can have for this attribute. Include helpful things so they'll be able to tune their HTML
-->
<!--
Some attributes are common to all (or most) HTML tags. There aren't many that qualify for this. You have to make sure there's no
collisions between any of these attribute names with attribute names of other tags that are for different purposes.
-->
<common-attributes>
<!-- Common to all HTML tags -->
<attribute name="id"
description="The 'id' of any HTML attribute should not contain anything besides letters and numbers">
<regexp-list>
<regexp name="htmlId"/>
</regexp-list>
</attribute>
<attribute name="class"
description="The 'class' of any HTML attribute is usually a single word, but it can also be a list of class names separated by spaces">
<regexp-list>
<regexp name="htmlClass"/>
</regexp-list>
</attribute>
<attribute name="lang"
description="The 'lang' attribute tells the browser what language the element's attribute values and content are written in">
<regexp-list>
<regexp value="[a-zA-Z]{2,20}"/>
</regexp-list>
</attribute>
<attribute name="title"
description="The 'title' attribute provides text that shows up in a 'tooltip' when a user hovers their mouse over the element">
<regexp-list>
<regexp name="htmlTitle"/>
</regexp-list>
</attribute>
<attribute name="alt"
description="The 'alt' attribute provides alternative text to users when its visual representation is not available">
<regexp-list>
<regexp name="paragraph"/>
</regexp-list>
</attribute>
<!-- the "style" attribute will be validated by an inline stylesheet scanner, so no need to define anything here - i hate having to special case this but no other choice -->
<attribute name="style"
description="The 'style' attribute provides the ability for users to change many attributes of the tag's contents using a strict syntax"/>
<attribute name="media">
<regexp-list>
<regexp value="[a-zA-Z0-9,\-\s]+"/>
</regexp-list>
<literal-list>
<literal value="screen"/>
<literal value="tty"/>
<literal value="tv"/>
<literal value="projection"/>
<literal value="handheld"/>
<literal value="print"/>
<literal value="braille"/>
<literal value="aural"/>
<literal value="all"/>
</literal-list>
</attribute>
<!-- Anchor related -->
<!-- onInvalid="filterTag" has been removed as per suggestion at OWASP SJ 2007 - just "name" is valid -->
<attribute name="href">
<regexp-list>
<regexp name="onsiteURL"/>
<regexp name="offsiteURL"/>
</regexp-list>
</attribute>
<attribute name="name">
<regexp-list>
<regexp value="[a-zA-Z0-9\-_\$]+"/>
<!--
have to allow the $ for .NET controls - although,
will users be supplying input that has server-generated
.NET control names? methinks not, but i want to pass my
test cases
-->
</regexp-list>
</attribute>
<attribute name="shape" description="The 'shape' attribute defines the shape of the selectable area">
<literal-list>
<literal value="default"/>
<literal value="rect"/>
<literal value="circle"/>
<literal value="poly"/>
</literal-list>
</attribute>
<!-- Table attributes -->
<attribute name="border">
<regexp-list>
<regexp name="number"/>
</regexp-list>
</attribute>
<attribute name="cellpadding">
<regexp-list>
<regexp name="number"/>
</regexp-list>
</attribute>
<attribute name="cellspacing">
<regexp-list>
<regexp name="number"/>
</regexp-list>
</attribute>
<attribute name="colspan">
<regexp-list>
<regexp name="number"/>
</regexp-list>
</attribute>
<attribute name="rowspan">
<regexp-list>
<regexp name="number"/>
</regexp-list>
</attribute>
<attribute name="background">
<regexp-list>
<regexp name="onsiteURL"/>
</regexp-list>
</attribute>
<attribute name="bgcolor">
<regexp-list>
<regexp name="colorName"/>
<regexp name="colorCode"/>
</regexp-list>
</attribute>
<attribute name="abbr">
<regexp-list>
<regexp name="paragraph"/>
</regexp-list>
</attribute>
<attribute name="headers" description="The 'headers' attribute is a space-separated list of cell IDs">
<regexp-list>
<regexp value="[a-zA-Z0-9\s*]*"/>
</regexp-list>
</attribute>
<attribute name="charoff">
<regexp-list>
<regexp value="numberOrPercent"/>
</regexp-list>
</attribute>
<attribute name="char">
<regexp-list>
<regexp value=".{0,1}"/>
</regexp-list>
</attribute>
<attribute name="axis" description="The 'headers' attribute is a comma-separated list of related header cells">
<regexp-list>
<regexp value="[a-zA-Z0-9\s*,]*"/>
</regexp-list>
</attribute>
<attribute name="nowrap"
description="The 'nowrap' attribute tells the browser not to wrap text that goes over one line">
<regexp-list>
<regexp name="anything"/>
<!-- <regexp value="(nowrap){0,1}"/> -->
</regexp-list>
</attribute>
<!-- Common positioning attributes -->
<attribute name="width">
<regexp-list>
<regexp name="numberOrPercent"/>
</regexp-list>
</attribute>
<attribute name="height">
<regexp-list>
<regexp name="numberOrPercent"/>
</regexp-list>
</attribute>
<attribute name="align"
description="The 'align' attribute of an HTML element is a direction word, like 'left', 'right' or 'center'">
<literal-list>
<literal value="center"/>
<literal value="middle"/>
<literal value="left"/>
<literal value="right"/>
<literal value="justify"/>
<literal value="char"/>
</literal-list>
</attribute>
<attribute name="valign"
description="The 'valign' attribute of an HTML attribute is a direction word, like 'baseline','bottom','middle' or 'top'">
<literal-list>
<literal value="baseline"/>
<literal value="bottom"/>
<literal value="middle"/>
<literal value="top"/>
</literal-list>
</attribute>
<!-- Intrinsic JavaScript Events -->
<attribute name="onFocus"
description="The 'onFocus' event is executed when the control associated with the tag gains focus">
<literal-list>
<literal value="javascript:void(0)"/>
<literal value="javascript:history.go(-1)"/>
</literal-list>
</attribute>
<attribute name="onBlur"
description="The 'onBlur' event is executed when the control associated with the tag loses focus">
<literal-list>
<literal value="javascript:void(0)"/>
<literal value="javascript:history.go(-1)"/>
</literal-list>
</attribute>
<attribute name="onClick"
description="The 'onClick' event is executed when the control associated with the tag is clicked">
<literal-list>
<literal value="javascript:void(0)"/>
<literal value="javascript:history.go(-1)"/>
</literal-list>
</attribute>
<attribute name="onDblClick"
description="The 'onDblClick' event is executed when the control associated with the tag is clicked twice immediately">
<literal-list>
<literal value="javascript:void(0)"/>
<literal value="javascript:history.go(-1)"/>
</literal-list>
</attribute>
<attribute name="onMouseDown"
description="The 'onMouseDown' event is executed when the control associated with the tag is clicked but not yet released">
<literal-list>
<literal value="javascript:void(0)"/>
<literal value="javascript:history.go(-1)"/>
</literal-list>
</attribute>
<attribute name="onMouseUp"
description="The 'onMouseUp' event is executed when the control associated with the tag is clicked after the button is released">
<literal-list>
<literal value="javascript:void(0)"/>
<literal value="javascript:history.go(-1)"/>
</literal-list>
</attribute>
<attribute name="onMouseOver"
description="The 'onMouseOver' event is executed when the user's mouse hovers over the control associated with the tag">
<literal-list>
<literal value="javascript:void(0)"/>
<literal value="javascript:history.go(-1)"/>
</literal-list>
</attribute>
<attribute name="scope" description="The 'scope' attribute defines what's covered by the header cells">
<literal-list>
<literal value="row"/>
<literal value="col"/>
<literal value="rowgroup"/>
<literal value="colgroup"/>
</literal-list>
</attribute>
<!-- If you want users to be able to mess with tabindex, uncomment this -->
<!--
<attribute name="tabindex" description="...">
<regexp-list>
<regexp name="number"/>
</regexp-list>
</attribute>
-->
<!-- Input/form related common attributes -->
<attribute name="disabled">
<regexp-list>
<regexp name="anything"/>
</regexp-list>
</attribute>
<attribute name="readonly">
<regexp-list>
<regexp name="anything"/>
</regexp-list>
</attribute>
<attribute name="accesskey">
<regexp-list>
<regexp name="anything"/>
</regexp-list>
</attribute>
<attribute name="size">
<regexp-list>
<regexp name="number"/>
</regexp-list>
</attribute>
<attribute name="autocomplete">
<literal-list>
<literal value="on"/>
<literal value="off"/>
</literal-list>
</attribute>
<attribute name="rows">
<regexp-list>
<regexp name="number"/>
</regexp-list>
</attribute>
<attribute name="cols">
<regexp-list>
<regexp name="number"/>
</regexp-list>
</attribute>
</common-attributes>
<!--
This requires normal updates as browsers continue to diverge from the W3C and each other. As long as the browser wars continue
this is going to continue. I'm not sure war is the right word for what's going on. Doesn't somebody have to win a war after
a while? Even wars of attrition, surely?
-->
<global-tag-attributes>
<!-- Not valid in base, head, html, meta, param, script, style, and title elements. -->
<attribute name="id"/>
<attribute name="style"/>
<attribute name="title"/>
<attribute name="class"/>
<!-- Not valid in base, br, frame, frameset, hr, iframe, param, and script elements. -->
<attribute name="lang"/>
</global-tag-attributes>
<tags-to-encode>
<tag>g</tag>
<tag>grin</tag>
</tags-to-encode>
<tag-rules>
<!-- Tags related to JavaScript -->
<tag name="script" action="remove"/>
<tag name="noscript"
action="validate"/> <!-- although no javascript can fire inside a noscript tag, css is still a viable attack vector -->
<!-- Frame & related tags -->
<tag name="iframe" action="remove"/>
<tag name="frameset" action="remove"/>
<tag name="frame" action="remove"/>
<!-- Form related tags -->
<tag name="label" action="validate">
<attribute name="for">
<regexp-list>
<regexp name="htmlId"/>
</regexp-list>
</attribute>
</tag>
<!-- All formatting tags -->
<tag name="h1" action="validate"/>
<tag name="h2" action="validate"/>
<tag name="h3" action="validate"/>
<tag name="h4" action="validate"/>
<tag name="h5" action="validate"/>
<tag name="h6" action="validate"/>
<tag name="p" action="validate">
<attribute name="align"/>
</tag>
<tag name="i" action="validate"/>
<tag name="b" action="validate"/>
<tag name="u" action="validate"/>
<tag name="strong" action="validate"/>
<tag name="em" action="validate"/>
<tag name="small" action="validate"/>
<tag name="big" action="validate"/>
<tag name="pre" action="validate"/>
<tag name="code" action="validate"/>
<tag name="cite" action="validate"/>
<tag name="samp" action="validate"/>
<tag name="sub" action="validate"/>
<tag name="sup" action="validate"/>
<tag name="strike" action="validate"/>
<tag name="center" action="validate"/>
<tag name="blockquote" action="validate"/>
<tag name="hr" action="validate"/>
<tag name="br" action="validate"/>
<tag name="font" action="validate">
<attribute name="color">
<regexp-list>
<regexp name="colorName"/>
<regexp name="colorCode"/>
</regexp-list>
</attribute>
<attribute name="face">
<regexp-list>
<regexp value="[\w;, \-]+"/>
</regexp-list>
</attribute>
<attribute name="size">
<regexp-list>
<regexp value="(\+|-){0,1}(\d)+"/>
</regexp-list>
</attribute>
</tag>
<!-- Anchor and anchor related tags -->
<tag name="a" action="validate">
<!-- onInvalid="filterTag" has been removed as per suggestion at OWASP SJ 2007 - just "name" is valid -->
<attribute name="href"/>
<attribute name="onFocus"/>
<attribute name="onBlur"/>
<attribute name="nohref">
<regexp-list>
<regexp name="anything"/>
</regexp-list>
</attribute>
<attribute name="rel">
<literal-list>
<literal value="nofollow"/>
</literal-list>
</attribute>
<attribute name="name"/>
</tag>
<tag name="map" action="validate"/>
<!-- base tag removed per demo - this could be enabled with literal-list values you allow -->
<!--
<tag name="base" action="validate">
<attribute name="href"/>
</tag>
-->
<!-- Stylesheet Tags -->
<tag name="style" action="validate">
<attribute name="type">
<literal-list>
<literal value="text/css"/>
</literal-list>
</attribute>
<attribute name="media"/>
</tag>
<tag name="span" action="validate"/>
<tag name="div" action="validate">
<attribute name="align"/>
</tag>
<!-- <attribute name="id"/> what could an attacker do if they could overwrite an existing div definition? prolly something bad -->
<!-- <attribute name="class"/> what could an attacker do if they could specify any class in the namespace? prolly something bad -->
<!-- Image & image related tags -->
<tag name="img" action="validate">
<attribute name="src" onInvalid="removeTag">
<regexp-list>
<regexp name="onsiteURL"/>
<regexp name="offsiteURL"/>
</regexp-list>
</attribute>
<attribute name="name"/>
<attribute name="alt"/>
<attribute name="height"/>
<attribute name="width"/>
<attribute name="border"/>
<attribute name="align"/>
<attribute name="hspace">
<regexp-list>
<regexp name="number"/>
</regexp-list>
</attribute>
<attribute name="vspace">
<regexp-list>
<regexp name="number"/>
</regexp-list>
</attribute>
</tag>
<!-- no way to do this safely without hooking up the same code to @import to embed the remote stylesheet (malicious user could change offsite resource to be malicious after validation -->
<!-- <attribute name="href" onInvalid="removeTag"/> -->
<tag name="link" action="validate">
<!-- <attribute name="href" onInvalid="removeTag"/> -->
<attribute name="media"/>
<attribute name="type" onInvalid="removeTag">
<literal-list>
<literal value="text/css"/>
<literal value="application/rss+xml"/>
<literal value="image/x-icon"/>
</literal-list>
</attribute>
<attribute name="rel">
<literal-list>
<literal value="stylesheet"/>
<literal value="shortcut icon"/>
<literal value="search"/>
<literal value="copyright"/>
<literal value="top"/>
<literal value="alternate"/>
</literal-list>
</attribute>
</tag>
<!-- List tags -->
<tag name="ul" action="validate"/>
<tag name="ol" action="validate"/>
<tag name="li" action="validate"/>
<!-- Dictionary tags -->
<tag name="dd" action="truncate"/>
<tag name="dl" action="truncate"/>
<tag name="dt" action="truncate"/>
<!-- Table tags (tbody, thead, tfoot)-->
<tag name="thead" action="validate">
<attribute name="align"/>
<attribute name="char"/>
<attribute name="charoff"/>
<attribute name="valign"/>
</tag>
<tag name="tbody" action="validate">
<attribute name="align"/>
<attribute name="char"/>
<attribute name="charoff"/>
<attribute name="valign"/>
</tag>
<tag name="tfoot" action="validate">
<attribute name="align"/>
<attribute name="char"/>
<attribute name="charoff"/>
<attribute name="valign"/>
</tag>
<tag name="table" action="validate">
<attribute name="height"/>
<attribute name="width"/>
<attribute name="border"/>
<attribute name="bgcolor"/>
<attribute name="cellpadding"/>
<attribute name="cellspacing"/>
<attribute name="background"/>
<attribute name="align"/>
<attribute name="noresize">
<literal-list>
<literal value="noresize"/>
<literal value=""/>
</literal-list>
</attribute>
</tag>
<tag name="td" action="validate">
<attribute name="background"/>
<attribute name="bgcolor"/>
<attribute name="abbr"/>
<attribute name="axis"/>
<attribute name="headers"/>
<attribute name="scope"/>
<attribute name="nowrap"/>
<attribute name="height"/>
<attribute name="width"/>
<attribute name="align"/>
<attribute name="char"/>
<attribute name="charoff"/>
<attribute name="valign"/>
<attribute name="colspan"/>
<attribute name="rowspan"/>
</tag>
<tag name="th" action="validate">
<attribute name="abbr"/>
<attribute name="axis"/>
<attribute name="headers"/>
<attribute name="scope"/>
<attribute name="nowrap"/>
<attribute name="bgcolor"/>
<attribute name="height"/>
<attribute name="width"/>
<attribute name="align"/>
<attribute name="char"/>
<attribute name="charoff"/>
<attribute name="valign"/>
<attribute name="colspan"/>
<attribute name="rowspan"/>
</tag>
<tag name="tr" action="validate">
<attribute name="height"/>
<attribute name="width"/>
<attribute name="align"/>
<attribute name="valign"/>
<attribute name="char"/>
<attribute name="charoff"/>
<attribute name="background"/>
</tag>
<tag name="colgroup" action="validate">
<attribute name="span">
<regexp-list>
<regexp name="number"/>
</regexp-list>
</attribute>
<attribute name="width"/>
<attribute name="align"/>
<attribute name="char"/>
<attribute name="charoff"/>
<attribute name="valign"/>
</tag>
<tag name="col" action="validate">
<attribute name="align"/>
<attribute name="char"/>
<attribute name="charoff"/>
<attribute name="valign"/>
<attribute name="span">
<regexp-list>
<regexp name="number"/>
</regexp-list>
</attribute>
<attribute name="width"/>
</tag>
<tag name="fieldset" action="validate"/>
<tag name="legend" action="validate"/>
</tag-rules>
<!-- CSS validation processing rules -->
<css-rules>
<property name="azimuth"
description="This property is most likely to be implemented by mixing the same signal into different channels at differing volumes.">
<literal-list>
<literal value="left-side"/>
<literal value="far-left"/>
<literal value="left"/>
<literal value="center-left"/>
<literal value="center"/>
<literal value="center-right"/>
<literal value="right"/>
<literal value="far-right"/>
<literal value="right-side"/>
<literal value="behind"/>
<literal value="leftwards"/>
<literal value="rightwards"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="angle"/>
</regexp-list>
</property>
<property name="background"
description="The 'background' property is a shorthand property for setting the individual background properties (i.e., 'background-color', 'background-image', 'background-repeat', 'background-attachment' and 'background-position') at the same place in the style sheet.">
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="background-color"/>
<shorthand name="background-image"/>
<shorthand name="background-repeat"/>
<shorthand name="background-attachment"/>
<shorthand name="background-position"/>
</shorthand-list>
</property>
<property name="background-attachment"
description="If a background image is specified, this property specifies whether it is fixed with regard to the viewport ('fixed') or scrolls along with the document ('scroll').">
<literal-list>
<literal value="scroll"/>
<literal value="fixed"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="background-color"
description="This property sets the background color of an element, either a &lt;color&gt; value or the keyword 'transparent', to make the underlying colors shine through.">
<literal-list>
<literal value="transparent"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="colorName"/>
<regexp name="colorCode"/>
<regexp name="rgbCode"/>
<regexp name="systemColor"/>
</regexp-list>
</property>
<property name="background-image" description="This property sets the background image of an element.">
<literal-list>
<literal value="none"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="cssOffsiteUri"/>
<regexp name="cssOnsiteUri"/>
</regexp-list>
</property>
<property name="background-position"
description="If a background image has been specified, this property specifies its initial position.">
<literal-list>
<literal value="top"/>
<literal value="center"/>
<literal value="bottom"/>
<literal value="left"/>
<literal value="center"/>
<literal value="right"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="percentage"/>
<regexp name="length"/>
</regexp-list>
</property>
<property name="background-repeat"
description="If a background image is specified, this property specifies whether the image is repeated (tiled), and how.">
<literal-list>
<literal value="repeat"/>
<literal value="repeat-x"/>
<literal value="repeat-y"/>
<literal value="no-repeat"/>
<literal value="inherit"/>
</literal-list>
</property>
<!-- Begin simple properties -->
<property name="border-collapse" default="collapse" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="collapse"/>
<literal value="separate"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="border-color" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="transparent"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="colorName"/>
<regexp name="colorCode"/>
<regexp name="rgbCode"/>
<regexp name="systemColor"/>
</regexp-list>
</property>
<property name="border-top-color" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="colorName"/>
<regexp name="colorCode"/>
<regexp name="rgbCode"/>
<regexp name="systemColor"/>
</regexp-list>
</property>
<property name="border-right-color" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="colorName"/>
<regexp name="colorCode"/>
<regexp name="rgbCode"/>
<regexp name="systemColor"/>
</regexp-list>
</property>
<property name="border-bottom-color" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="colorName"/>
<regexp name="colorCode"/>
<regexp name="rgbCode"/>
<regexp name="systemColor"/>
</regexp-list>
</property>
<property name="border-left-color" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="colorName"/>
<regexp name="colorCode"/>
<regexp name="rgbCode"/>
<regexp name="systemColor"/>
</regexp-list>
</property>
<property name="bottom" default="auto" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="auto"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="length"/>
<regexp name="percentage"/>
</regexp-list>
</property>
<property name="caption-side" default="top" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="top"/>
<literal value="bottom"/>
<literal value="left"/>
<literal value="right"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="clear" default="none" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="none"/>
<literal value="left"/>
<literal value="right"/>
<literal value="both"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="color" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="colorName"/>
<regexp name="colorCode"/>
<regexp name="rgbCode"/>
<regexp name="systemColor"/>
</regexp-list>
</property>
<property name="cue-after" default="none" description="">
<category-list>
<category value="aural"/>
</category-list>
<literal-list>
<literal value="none"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="cssOffsiteUri"/>
<regexp name="cssOnsiteUri"/>
</regexp-list>
</property>
<property name="cue-before" default="none" description="">
<category-list>
<category value="aural"/>
</category-list>
<literal-list>
<literal value="none"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="cssOffsiteUri"/>
<regexp name="cssOnsiteUri"/>
</regexp-list>
</property>
<property name="direction" default="ltr" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="ltr"/>
<literal value="rtl"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="display" default="inline" description="">
<category-list>
<category value="all"/>
</category-list>
<literal-list>
<literal value="inline"/>
<literal value="block"/>
<literal value="list-item"/>
<literal value="run-in"/>
<literal value="compact"/>
<literal value="marker"/>
<literal value="table"/>
<literal value="inline-table"/>
<literal value="table-row-group"/>
<literal value="table-header-group"/>
<literal value="table-footer-group"/>
<literal value="table-row"/>
<literal value="table-column-group"/>
<literal value="table-column"/>
<literal value="table-cell"/>
<literal value="table-caption"/>
<literal value="none"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="elevation" default="level" description="">
<category-list>
<category value="aural"/>
</category-list>
<literal-list>
<literal value="below"/>
<literal value="level"/>
<literal value="above"/>
<literal value="higher"/>
<literal value="lower"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="angle"/>
</regexp-list>
</property>
<property name="empty-cells" default="show" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="show"/>
<literal value="hide"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="float" default="none" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="left"/>
<literal value="right"/>
<literal value="none"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="font-size" default="medium" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="absolute-size"/>
<regexp name="relative-size"/>
<regexp name="length"/>
<regexp name="percentage"/>
</regexp-list>
</property>
<property name="font-size-adjust" default="none" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="none"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="number"/>
</regexp-list>
</property>
<property name="font-stretch" default="normal" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="normal"/>
<literal value="wider"/>
<literal value="narrower"/>
<literal value="ultra-condensed"/>
<literal value="extra-condensed"/>
<literal value="condensed"/>
<literal value="semi-condensed"/>
<literal value="semi-expanded"/>
<literal value="expanded"/>
<literal value="extra-expanded"/>
<literal value="ultra-expanded"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="font-style" default="normal" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="normal"/>
<literal value="italic"/>
<literal value="oblique"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="font-variant" default="normal" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="normal"/>
<literal value="small-caps"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="font-weight" default="normal" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="normal"/>
<literal value="bold"/>
<literal value="bolder"/>
<literal value="lighter"/>
<literal value="100"/>
<literal value="200"/>
<literal value="300"/>
<literal value="400"/>
<literal value="500"/>
<literal value="600"/>
<literal value="700"/>
<literal value="800"/>
<literal value="900"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="height" default="auto" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="auto"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="length"/>
<regexp name="percentage"/>
</regexp-list>
</property>
<property name="left" default="auto" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="auto"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="length"/>
<regexp name="percentage"/>
</regexp-list>
</property>
<property name="letter-spacing" default="normal" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="normal"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="length"/>
</regexp-list>
</property>
<property name="line-height" default="normal" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="normal"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="number"/>
<regexp name="length"/>
<regexp name="percentage"/>
</regexp-list>
</property>
<property name="list-style-image" default="none" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="none"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="cssOffsiteUri"/>
<regexp name="cssOnsiteUri"/>
</regexp-list>
</property>
<property name="list-style-position" default="outside" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inside"/>
<literal value="outside"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="list-style-type" default="disc" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="disc"/>
<literal value="circle"/>
<literal value="square"/>
<literal value="decimal"/>
<literal value="decimal-leading-zero"/>
<literal value="lower-roman"/>
<literal value="upper-roman"/>
<literal value="lower-greek"/>
<literal value="lower-alpha"/>
<literal value="lower-latin"/>
<literal value="upper-alpha"/>
<literal value="upper-latin"/>
<literal value="hebrew"/>
<literal value="armenian"/>
<literal value="georgian"/>
<literal value="cjk-ideographic"/>
<literal value="hiragana"/>
<literal value="katakana"/>
<literal value="hiragana-iroha"/>
<literal value="katakana-iroha"/>
<literal value="none"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="marker-offset" default="auto" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="auto"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="length"/>
</regexp-list>
</property>
<property name="max-height" default="none" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="none"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="length"/>
<regexp name="percentage"/>
</regexp-list>
</property>
<property name="max-width" default="none" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="none"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="length"/>
<regexp name="percentage"/>
</regexp-list>
</property>
<property name="min-height" default="0" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="length"/>
<regexp name="percentage"/>
</regexp-list>
</property>
<property name="min-width" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="length"/>
<regexp name="percentage"/>
</regexp-list>
</property>
<property name="orphans" default="2" description="">
<category-list>
<category value="visual"/>
<category value="paged"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="integer"/>
</regexp-list>
</property>
<property name="outline-color" default="invert" description="">
<category-list>
<category value="visual"/>
<category value="interactive"/>
</category-list>
<literal-list>
<literal value="invert"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="colorName"/>
<regexp name="colorCode"/>
<regexp name="rgbCode"/>
<regexp name="systemColor"/>
</regexp-list>
</property>
<property name="overflow" default="visible" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="visible"/>
<literal value="hidden"/>
<literal value="scroll"/>
<literal value="auto"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="page-break-after" default="auto" description="">
<category-list>
<category value="visual"/>
<category value="paged"/>
</category-list>
<literal-list>
<literal value="auto"/>
<literal value="always"/>
<literal value="avoid"/>
<literal value="left"/>
<literal value="right"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="page-break-before" default="auto" description="">
<category-list>
<category value="visual"/>
<category value="paged"/>
</category-list>
<literal-list>
<literal value="auto"/>
<literal value="always"/>
<literal value="avoid"/>
<literal value="left"/>
<literal value="right"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="page-break-inside" default="auto" description="">
<category-list>
<category value="visual"/>
<category value="paged"/>
</category-list>
<literal-list>
<literal value="avoid"/>
<literal value="auto"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="pause-after" description="">
<category-list>
<category value="aural"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="time"/>
<regexp name="percentage"/>
</regexp-list>
</property>
<property name="pause-before" description="">
<category-list>
<category value="aural"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="time"/>
<regexp name="percentage"/>
</regexp-list>
</property>
<property name="pitch" default="medium" description="">
<category-list>
<category value="aural"/>
</category-list>
<literal-list>
<literal value="x-low"/>
<literal value="low"/>
<literal value="medium"/>
<literal value="high"/>
<literal value="x-high"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="frequency"/>
</regexp-list>
</property>
<property name="pitch-range" default="50" description="">
<category-list>
<category value="aural"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="number"/>
</regexp-list>
</property>
<property name="position" default="static" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="static"/>
<!-- possible to perform phishing attacks with the following -->
<!--
<literal value="relative"/>
<literal value="absolute"/>
<literal value="fixed"/>
-->
<literal value="inherit"/>
</literal-list>
</property>
<property name="richness" default="50" description="">
<category-list>
<category value="aural"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="number"/>
</regexp-list>
</property>
<property name="right" default="auto" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="auto"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="length"/>
<regexp name="percentage"/>
</regexp-list>
</property>
<property name="size" default="auto" description="">
<category-list>
<category value="visual"/>
<category value="paged"/>
</category-list>
<literal-list>
<literal value="auto"/>
<literal value="portrait"/>
<literal value="landscape"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="length"/>
</regexp-list>
</property>
<property name="speak" default="normal" description="">
<category-list>
<category value="aural"/>
</category-list>
<literal-list>
<literal value="normal"/>
<literal value="none"/>
<literal value="spell-out"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="speak-header" default="once" description="">
<category-list>
<category value="aural"/>
</category-list>
<literal-list>
<literal value="once"/>
<literal value="always"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="speak-numeral" default="continuous" description="">
<category-list>
<category value="aural"/>
</category-list>
<literal-list>
<literal value="digits"/>
<literal value="continuous"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="speak-punctuation" default="none" description="">
<category-list>
<category value="aural"/>
</category-list>
<literal-list>
<literal value="code"/>
<literal value="none"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="speech-rate" default="medium" description="">
<category-list>
<category value="aural"/>
</category-list>
<literal-list>
<literal value="x-slow"/>
<literal value="slow"/>
<literal value="medium"/>
<literal value="fast"/>
<literal value="x-fast"/>
<literal value="faster"/>
<literal value="slower"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="number"/>
</regexp-list>
</property>
<property name="stress" default="50" description="">
<category-list>
<category value="aural"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="number"/>
</regexp-list>
</property>
<property name="table-layout" default="auto" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="auto"/>
<literal value="fixed"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="text-indent" default="0" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="length"/>
<regexp name="percentage"/>
</regexp-list>
</property>
<property name="text-transform" default="none" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="capitalize"/>
<literal value="uppercase"/>
<literal value="lowercase"/>
<literal value="none"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="top" default="auto" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="auto"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="length"/>
<regexp name="percentage"/>
</regexp-list>
</property>
<property name="unicode-bidi" default="normal" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="normal"/>
<literal value="embed"/>
<literal value="bidi-override"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="vertical-align" default="baseline" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="baseline"/>
<literal value="sub"/>
<literal value="super"/>
<literal value="top"/>
<literal value="text-top"/>
<literal value="middle"/>
<literal value="bottom"/>
<literal value="text-bottom"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="percentage"/>
<regexp name="length"/>
</regexp-list>
</property>
<property name="visibility" default="inherit" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="visible"/>
<literal value="hidden"/>
<literal value="collapse"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="volume" default="medium" description="">
<category-list>
<category value="aural"/>
</category-list>
<literal-list>
<literal value="silent"/>
<literal value="x-soft"/>
<literal value="soft"/>
<literal value="medium"/>
<literal value="loud"/>
<literal value="x-loud"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="number"/>
<regexp name="percentage"/>
</regexp-list>
</property>
<property name="white-space" default="normal" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="normal"/>
<literal value="pre"/>
<literal value="nowrap"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="widows" default="2" description="">
<category-list>
<category value="visual"/>
<category value="paged"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="integer"/>
</regexp-list>
</property>
<property name="width" default="auto" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="auto"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="length"/>
<regexp name="percentage"/>
</regexp-list>
</property>
<property name="word-spacing" default="normal" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="normal"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="length"/>
</regexp-list>
</property>
<!-- end simple properties -->
<!-- begin medium properties -->
<property name="border-style" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
<literal value="none"/>
<literal value="hidden"/>
<literal value="dotted"/>
<literal value="dashed"/>
<literal value="solid"/>
<literal value="double"/>
<literal value="groove"/>
<literal value="ridge"/>
<literal value="inset"/>
<literal value="outset"/>
</literal-list>
</property>
<property name="border-top-style" default="none" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
</property>
<property name="border-right-style" default="none" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="border-style"/>
</shorthand-list>
</property>
<property name="border-bottom-style" default="none" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="border-style"/>
</shorthand-list>
</property>
<property name="border-left-style" default="none" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="border-style"/>
</shorthand-list>
</property>
<property name="border-top-width" default="medium" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="border-width"/>
</shorthand-list>
</property>
<property name="border-right-width" default="medium" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="border-width"/>
</shorthand-list>
</property>
<property name="border-bottom-width" default="medium" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="border-width"/>
</shorthand-list>
</property>
<property name="border-left-width" default="medium" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="border-width"/>
</shorthand-list>
</property>
<property name="border-width" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
<literal value="thin"/>
<literal value="medium"/>
<literal value="thick"/>
</literal-list>
<regexp-list>
<regexp name="length"/>
</regexp-list>
</property>
<property name="margin" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
<literal value="auto"/>
</literal-list>
<regexp-list>
<regexp name="positiveLength"/>
<regexp name="positivePercentage"/>
</regexp-list>
</property>
<property name="margin-top" default="0" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="margin"/>
</shorthand-list>
</property>
<property name="margin-right" default="0" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="margin"/>
</shorthand-list>
</property>
<property name="margin-bottom" default="0" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="margin"/>
</shorthand-list>
</property>
<property name="margin-left" default="0" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="margin"/>
</shorthand-list>
</property>
<property name="outline-style" default="none" description="">
<category-list>
<category value="visual"/>
<category value="interactive"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="border-style"/>
</shorthand-list>
</property>
<property name="outline-width" default="medium" description="">
<category-list>
<category value="visual"/>
<category value="interactive"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="border-width"/>
</shorthand-list>
</property>
<property name="padding" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="length"/>
<regexp name="percentage"/>
</regexp-list>
</property>
<property name="padding-top" default="0" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="padding"/>
</shorthand-list>
</property>
<property name="padding-right" default="0" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="padding"/>
</shorthand-list>
</property>
<property name="padding-bottom" default="0" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="padding"/>
</shorthand-list>
</property>
<property name="padding-left" default="0" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="padding"/>
</shorthand-list>
</property>
<!-- end medium properties -->
<!-- begin hard properties -->
<property name="border" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="colorName"/>
<regexp name="colorCode"/>
<regexp name="rgbCode"/>
<regexp name="systemColor"/>
</regexp-list>
<shorthand-list>
<shorthand name="border-width"/>
<shorthand name="border-style"/>
</shorthand-list>
</property>
<property name="border-top" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="colorName"/>
<regexp name="colorCode"/>
<regexp name="rgbCode"/>
<regexp name="systemColor"/>
</regexp-list>
<shorthand-list>
<shorthand name="border-top-width"/>
<shorthand name="border-style"/>
</shorthand-list>
</property>
<property name="border-right" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="colorName"/>
<regexp name="colorCode"/>
<regexp name="rgbCode"/>
<regexp name="systemColor"/>
</regexp-list>
<shorthand-list>
<shorthand name="border-top-width"/>
<shorthand name="border-style"/>
</shorthand-list>
</property>
<property name="border-bottom" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="colorName"/>
<regexp name="colorCode"/>
<regexp name="rgbCode"/>
<regexp name="systemColor"/>
</regexp-list>
<shorthand-list>
<shorthand name="border-top-width"/>
<shorthand name="border-style"/>
</shorthand-list>
</property>
<property name="border-left" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="colorName"/>
<regexp name="colorCode"/>
<regexp name="rgbCode"/>
<regexp name="systemColor"/>
</regexp-list>
<shorthand-list>
<shorthand name="border-top-width"/>
<shorthand name="border-style"/>
</shorthand-list>
</property>
<property name="cue" description="">
<category-list>
<category value="aural"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="cue-before"/>
<shorthand name="cue-after"/>
</shorthand-list>
</property>
<property name="list-style" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="list-style-type"/>
<shorthand name="list-style-position"/>
<shorthand name="list-style-image"/>
</shorthand-list>
</property>
<property name="marks" default="none" description="">
<category-list>
<category value="visual"/>
<category value="paged"/>
</category-list>
<literal-list>
<literal value="crop"/>
<literal value="cross"/>
<literal value="none"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="outline" description="">
<category-list>
<category value="visual"/>
<category value="interactive"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="outline-color"/>
<shorthand name="outline-style"/>
<shorthand name="outline-width"/>
</shorthand-list>
</property>
<property name="pause" description="">
<category-list>
<category value="aural"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="time"/>
<regexp name="percentage"/>
</regexp-list>
</property>
<property name="text-decoration" default="none" description="">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="none"/>
<literal value="underline"/>
<literal value="overline"/>
<literal value="line-through"/>
<literal value="blink"/>
<literal value="inherit"/>
</literal-list>
</property>
<!-- end hard properties -->
<!-- begin manual properties -->
<property name="border-spacing" default="0"
description="The lengths specify the distance that separates adjacent cell borders. If one length is specified, it gives both the horizontal and vertical spacing. If two are specified, the first gives the horizontal spacing and the second the vertical spacing. Lengths may not be negative.">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="length"/>
</regexp-list>
</property>
<property name="clip" default="auto"
description="The 'clip' property applies to elements that have a 'overflow' property with a value other than 'visible'.">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="auto"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="length"/>
</regexp-list>
</property>
<property name="counter-increment" default="none"
description="The 'counter-increment' property accepts one or more names of counters (identifiers), each one optionally followed by an integer.">
<category-list>
<category value="all"/>
</category-list>
<literal-list>
<literal value="none"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="cssIdentifier"/>
<regexp name="integer"/>
</regexp-list>
</property>
<property name="cursor" default="auto"
description="This property specifies the type of cursor to be displayed for the pointing device.">
<category-list>
<category value="visual"/>
<category value="interactive"/>
</category-list>
<literal-list>
<literal value="auto"/>
<literal value="inherit"/>
<literal value="crosshair"/>
<literal value="default"/>
<literal value="pointer"/>
<literal value="move"/>
<literal value="e-resize"/>
<literal value="ne-resize"/>
<literal value="nw-resize"/>
<literal value="n-resize"/>
<literal value="se-resize"/>
<literal value="sw-resize"/>
<literal value="s-resize"/>
<literal value="w-resize| text"/>
<literal value="wait"/>
<literal value="help"/>
</literal-list>
<regexp-list>
<regexp name="cssOffsiteUri"/>
<regexp name="cssOnsiteUri"/>
</regexp-list>
</property>
<property name="text-shadow" default="none"
description="This property accepts a comma-separated list of shadow effects to be applied to the text of the element.">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="none"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="colorName"/>
<regexp name="colorCode"/>
<regexp name="rgbCode"/>
<regexp name="systemColor"/>
<regexp name="length"/>
</regexp-list>
</property>
<property name="font"
description="The 'font' property is, except as described below, a shorthand property for setting 'font-style', 'font-variant', 'font-weight', 'font-size', 'line-height', and 'font-family', at the same place in the style sheet.">
<category-list>
<category value="visual"/>
</category-list>
<literal-list>
<literal value="/"/>
<literal value="caption"/>
<literal value="icon"/>
<literal value="menu"/>
<literal value="message-box"/>
<literal value="small-caption"/>
<literal value="status-bar"/>
<literal value="inherit"/>
</literal-list>
<shorthand-list>
<shorthand name="font-style"/>
<shorthand name="font-variant"/>
<shorthand name="font-weight"/>
<shorthand name="font-size"/>
<shorthand name="line-height"/>
<shorthand name="font-family"/>
</shorthand-list>
</property>
<property name="font-family"
description="This property specifies a prioritized list of font family names and/or generic family names.">
<category-list>
<category value="visual"/>
</category-list>
<!-- allowing only generic font families -->
<literal-list>
<literal value="serif"/>
<literal value="arial"/>
<literal value="lucida console"/>
<literal value="sans-serif"/>
<literal value="cursive"/>
<literal value="verdana"/>
<literal value="fantasy"/>
<literal value="monospace"/>
</literal-list>
<regexp-list>
<regexp value="[\w,\-&apos;&quot; ]+"/>
</regexp-list>
</property>
<property name="page"
description="The 'page' property can be used to specify a particular type of page where an element should be displayed.">
<category-list>
<category value="visual"/>
<category value="paged"/>
</category-list>
<literal-list>
<literal value="auto"/>
</literal-list>
<regexp-list>
<regexp name="cssIdentifier"/>
</regexp-list>
</property>
<property name="play-during" default="auto"
description="Similar to the 'cue-before' and 'cue-after' properties, this property specifies a sound to be played as a background while an element's content is spoken.">
<category-list>
<category value="aural"/>
</category-list>
<literal-list>
<literal value="mix"/>
<literal value="repeat"/>
<literal value="none"/>
<literal value="auto"/>
<literal value="inherit"/>
</literal-list>
<regexp-list>
<regexp name="cssOffsiteUri"/>
<regexp name="cssOnsiteUri"/>
</regexp-list>
</property>
<property name="text-align" description="This property describes how inline content of a block is aligned.">
<category-list>
<category value="visual"/>
</category-list>
<!-- For safety, ignoring string alignment which can be used to line table cells on characters -->
<literal-list>
<literal value="left"/>
<literal value="right"/>
<literal value="center"/>
<literal value="justify"/>
<literal value="inherit"/>
</literal-list>
</property>
<property name="voice-family"
description="The value is a comma-separated, prioritized list of voice family names (compare with 'font-family').">
<category-list>
<category value="aural"/>
</category-list>
<!-- Allowing only generic voice family -->
<literal-list>
<literal value="male"/>
<literal value="female"/>
<literal value="child"/>
<literal value="inherit"/>
</literal-list>
</property>
<!-- end manual properties -->
</css-rules>
<allowed-empty-tags>
<literal-list>
<literal value="br"/>
<literal value="hr"/>
<literal value="a"/>
<literal value="img"/>
<literal value="link"/>
<literal value="iframe"/>
<literal value="script"/>
<literal value="object"/>
<literal value="applet"/>
<literal value="frame"/>
<literal value="base"/>
<literal value="param"/>
<literal value="meta"/>
<literal value="input"/>
<literal value="textarea"/>
<literal value="embed"/>
<literal value="basefont"/>
<literal value="col"/>
<literal value="div"/>
</literal-list>
</allowed-empty-tags>
</anti-samy-rules>
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!--
W3C rules retrieved from:
http://www.w3.org/TR/html401/struct/global.html
-->
<anti-samy-rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="antisamy.xsd">
<directives>
<directive name="omitXmlDeclaration" value="true"/>
<directive name="omitDoctypeDeclaration" value="true"/>
<directive name="maxInputSize" value="0"/>
<directive name="useXHTML" value="true"/>
<directive name="formatOutput" value="false"/>
<!--
remember, this won't work for relative URIs - AntiSamy doesn't
know anything about the URL or your web structure
-->
<directive name="embedStyleSheets" value="false"/>
</directives>
<common-regexps>
</common-regexps>
<!--
Tag.name = a, b, div, body, etc.
Tag.action = filter: remove tags, but keep content, validate: keep content as long as it passes rules, remove: remove tag and contents
Attribute.name = id, class, href, align, width, etc.
Attribute.onInvalid = what to do when the attribute is invalid, e.g., remove the tag (removeTag), remove the attribute (removeAttribute), filter the tag (filterTag)
Attribute.description = What rules in English you want to tell the users they can have for this attribute. Include helpful things so they'll be able to tune their HTML
-->
<!--
Some attributes are common to all (or most) HTML tags. There aren't many that qualify for this. You have to make sure there's no
collisions between any of these attribute names with attribute names of other tags that are for different purposes.
-->
<common-attributes>
</common-attributes>
<!--
This requires normal updates as browsers continue to diverge from the W3C and each other. As long as the browser wars continue
this is going to continue. I'm not sure war is the right word for what's going on. Doesn't somebody have to win a war after
a while? Even wars of attrition, surely?
-->
<global-tag-attributes>
</global-tag-attributes>
<tags-to-encode>
</tags-to-encode>
<tag-rules>
</tag-rules>
<!-- CSS validation processing rules -->
<css-rules>
<!-- end manual properties -->
</css-rules>
<allowed-empty-tags>
</allowed-empty-tags>
</anti-samy-rules>
# 应用服务器
server:
tomcat:
uri-encoding: UTF-8 #tomcat编码
port: 8999 #tomcat端口
#===================== 数据源配置 =====================
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: ${MYSQL_USER:root} #junmp
password: ${MYSQL_PWD:root} #123456
url: jdbc:mysql://${MYSQL_HOST:127.0.0.1}:${MYSQL_PORT:3306}/${MYSQL_DB:jyzb03}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true&queryTimeout=2400&nullCatalogMeansCurrent=true
#===================== Redis配置 =====================
redis:
database: 1 #缓存库编号
host: 127.0.0.1
port: 6379
password:
timeout: 3000 #超时时间(单位:秒)
lettuce: #Lettuce为Redis的Java驱动包
pool:
max-active: 8 # 连接池最大连接数
max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
min-idle: 0 # 连接池中的最小空闲连接
max-idle: 8 # 连接池中的最大空闲连接
mail:
host: smtp.qq.com #邮件服务器的host
password: sb #邮件服务器的发件人密码
username: 6666@qq.com #邮件服务器的发件人
port: 25 #smtp默认端口
protocol: smtp #使用smtp协议
default-encoding: UTF-8 #邮件使用的字符集
properties:
mail:
debug: true #启调试模式(发送邮件的细节都能看出来) 默认值为fasle
debug.auth: true
smtp:
auth: true #如果为true ,则尝试使用auth命令对用户进行身份验证 默认为false
connectiontimeout: 20000 #套接字连接超时值(毫秒)。默认值为无限超时。
sendpartial: true #如果为true 并且邮件有一些有效和无效的地址 并使用SendFailException 报告部分失败, 如果设置为false(默认值) 如果存在无效的收件人地址, 则不会将邮件发送给任何收件人
starttls:
#如果为true,则在发出任何登录命令之前,启用starttl命令(如果服务器支持) 将连接切换到受TLS保护的连接,请注意,必须配置适当的信任存储,以便客户端信任服务器的证书,默认为false
enable: true
# 如果为true,则需要使用 starttl命令,如果服务器不支持此命令,或者该命令失败,connect()将失败,默认为false 如果此设置为true james邮件服务器会报错 STARTTLS is required but host does not support STARTTLS
required: false
timeout: 20000 #I/O超时值(ms) 默认为无限超时
userset: true #如果设置为true,则在isConnected()中使用RSET命令而不是NOOP命令 在某些情况下,sendmail在执行许多NOOP命令后响应缓存,使用RSET可以避免这个sendMail问题,默认为false
flowable:
dmn:
enabled: false
cmmn:
enabled: false
idm:
enabled: false
async-history-executor-activate: false
async-executor-activate: false
check-process-definitions: false
content:
enabled: false
app:
enabled: false
eventregistry:
enabled: false
config:
minio:
endpoint: http://192.168.0.147:9000/ #服务端地址
accessKey: admin #账号
secretKey: test. #密码
fileHost: http://192.168.0.147:9000/ #地址
spring: #环境 dev|test|pro|preview
profiles:
active: dev
servlet:
multipart: #文件传输配置
max-file-size: 100MB #单个数据大小限制
max-request-size: 100MB #请求总数据大小限制
enabled: true #是否启用分段上传支持
mvc:
hiddenmethod: #隐式方法过滤器
filter:
enabled: true #默认关闭。开启以支持:PUT,DELETE表单提交方法
jackson: #序列化和反序列化json框架
serialization:
write-dates-as-timestamps: true #是否写入日期时间时间戳格式
time-zone: GMT+8 #指定日期格式化时区
main:
allow-bean-definition-overriding: true #允许同名bean后者覆盖,默认:true
allow-circular-references: true #允许Bean相互引用,默认:false
server:
error:
whitelabel:
enabled: false
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!--日志格式应用spring boot默认的格式,也可以自己更改-->
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<!--定义日志存放的位置,默认存放在项目启动的相对路径的目录-->
<springProperty scope="context" name="LOG_PATH" source="log.path" defaultValue="log/systemLog"/>
<!-- ****************************************************************************************** -->
<!-- ****************************** 本地开发只在控制台打印日志 ************************************ -->
<!-- ****************************************************************************************** -->
<springProfile name="dev">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
<charset>utf-8</charset>
</encoder>
</appender>
<!--默认所有的包以info-->
<root level="info">
<appender-ref ref="STDOUT"/>
</root>
<!--各个服务的包在本地执行的时候,打开debug模式-->
<logger name="com" level="debug" additivity="false">
<appender-ref ref="STDOUT"/>
</logger>
</springProfile>
<!-- ********************************************************************************************** -->
<!-- **** 放到服务器上不管在什么环境都只在文件记录日志,控制台(catalina.out)打印logback捕获不到的日志 **** -->
<!-- ********************************************************************************************** -->
<springProfile name="test,pro,me,preview">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
<charset>utf-8</charset>
</encoder>
</appender>
<!-- 日志记录器,日期滚动记录,level为 ERROR 日志 -->
<appender name="FILE_ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${LOG_PATH}/log_error.log</file>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
<fileNamePattern>${LOG_PATH}/error/%d{yyyy-MM-dd,aux}/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<!--日志最大的历史7天-->
<maxHistory>7</maxHistory>
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
命名日志文件,例如log-error-2013-12-21.0.log -->
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<!-- 追加方式记录日志 -->
<append>true</append>
<!-- 日志文件的格式 -->
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${FILE_LOG_PATTERN}</pattern>
<charset>utf-8</charset>
</encoder>
<!-- 此日志文件只记录error级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>error</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 日志记录器,日期滚动记录,level为 INFO 日志 -->
<appender name="FILE_INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${LOG_PATH}/log_info.log</file>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
<fileNamePattern>${LOG_PATH}/info/%d{yyyy-MM-dd,aux}/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<!--日志最大的历史7天-->
<maxHistory>7</maxHistory>
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
命名日志文件,例如log-error-2013-12-21.0.log -->
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<!-- 追加方式记录日志 -->
<append>true</append>
<!-- 日志文件的格式 -->
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${FILE_LOG_PATTERN}</pattern>
<charset>utf-8</charset>
</encoder>
<!-- 此日志文件只记录info级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>info</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 日志记录器,日期滚动记录,level为 WARN 日志 -->
<appender name="FILE_WARN" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${LOG_PATH}/log_warn.log</file>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
<fileNamePattern>${LOG_PATH}/warn/%d{yyyy-MM-dd,aux}/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<!--日志最大的历史7天-->
<maxHistory>7</maxHistory>
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
命名日志文件,例如log-error-2013-12-21.0.log -->
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<!-- 追加方式记录日志 -->
<append>true</append>
<!-- 日志文件的格式 -->
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${FILE_LOG_PATTERN}</pattern>
<charset>utf-8</charset>
</encoder>
<!-- 此日志文件只记录warn级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>warn</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 日志记录器,日期滚动记录,level为 DEBUG 日志 -->
<appender name="FILE_DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${LOG_PATH}/log_debug.log</file>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
<fileNamePattern>${LOG_PATH}/debug/%d{yyyy-MM-dd,aux}/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<!--日志最大的历史7天-->
<maxHistory>7</maxHistory>
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
命名日志文件,例如log-error-2013-12-21.0.log -->
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<!-- 追加方式记录日志 -->
<append>true</append>
<!-- 日志文件的格式 -->
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${FILE_LOG_PATTERN}</pattern>
<charset>utf-8</charset>
</encoder>
<!-- 此日志文件只记录debug级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>debug</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 日志记录器,日期滚动记录,level为 ALL 日志 -->
<appender name="FILE_ALL" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${LOG_PATH}/log_total.log</file>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
<fileNamePattern>${LOG_PATH}/total/%d{yyyy-MM-dd,aux}/log-total-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<!--日志最大的历史7天-->
<maxHistory>7</maxHistory>
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
命名日志文件,例如log-error-2013-12-21.0.log -->
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<!-- 追加方式记录日志 -->
<append>true</append>
<!-- 日志文件的格式 -->
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${FILE_LOG_PATTERN}</pattern>
<charset>utf-8</charset>
</encoder>
</appender>
<!--记录到文件时-->
<root level="info">
<appender-ref ref="STDOUT"/>
<appender-ref ref="FILE_ERROR"/>
<appender-ref ref="FILE_INFO"/>
<appender-ref ref="FILE_WARN"/>
<appender-ref ref="FILE_DEBUG"/>
<appender-ref ref="FILE_ALL"/>
</root>
</springProfile>
</configuration>
......@@ -15,6 +15,7 @@
<module>jyzb-biz</module>
<module>jyzb-process</module>
<module>jyzb-common</module>
<module>jyzb-mq</module>
</modules>
<parent>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论