Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-07-11 18:12:54 +08:00
commit 64e82a94fa
7 changed files with 296 additions and 196 deletions

View File

@ -180,8 +180,8 @@ public class AbilityCenterControllerV2 {
put("key", processStartDTO.getBusinessKey()); // 归属该部门申请的表单id put("key", processStartDTO.getBusinessKey()); // 归属该部门申请的表单id
put("deptId", deptId); // 归属部门 put("deptId", deptId); // 归属部门
put("id", applyFlag); //申请id put("id", applyFlag); //申请id
put("creator", user == null ? null : user.getId()); // 创建人 put("creator", user == null ? null : user.getId().toString()); // 创建人
put("userId", user == null ? null : user.getId()); // 创建人 put("userId", user == null ? null : user.getId().toString()); // 创建人
put("basic_facilities", basic_facilities); // 是否为基础设施 put("basic_facilities", basic_facilities); // 是否为基础设施
} }
}); });

View File

@ -14,6 +14,8 @@ import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
import io.renren.modules.processForm.excel.TAbilityApplicationExcel; import io.renren.modules.processForm.excel.TAbilityApplicationExcel;
import io.renren.modules.processForm.service.TAbilityApplicationService; import io.renren.modules.processForm.service.TAbilityApplicationService;
import io.renren.modules.security.user.SecurityUser; import io.renren.modules.security.user.SecurityUser;
import io.renren.modules.security.user.UserDetail;
import io.renren.modules.sys.dto.SysDeptDTO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
@ -26,31 +28,80 @@ import javax.servlet.http.HttpServletResponse;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* 能力申请表单 * 能力申请表单
* *
* @author Mark sunlightcs@gmail.com * @author Mark sunlightcs@gmail.com
* @since 3.0 2022-04-13 * @since 3.0 2022-04-13
*/ */
@RestController @RestController
@RequestMapping("processForm/tabilityapplication") @RequestMapping("processForm/tabilityapplication")
@Api(tags="能力申请表单") @Api(tags = "能力申请表单")
public class TAbilityApplicationController { public class TAbilityApplicationController {
@Autowired @Autowired
private TAbilityApplicationService tAbilityApplicationService; private TAbilityApplicationService tAbilityApplicationService;
/**
* 根据申请时的情况做出分页
*
* @param params
* @return
*/
@GetMapping("my_page")
@ApiOperation("我的申请分页")
@LogOperation("我的申请分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String")
})
public Result<PageData<TAbilityApplicationDTO>> myPage(@ApiIgnore @RequestParam Map<String, Object> params) {
final UserDetail user = SecurityUser.getUser();
params.put("abilityprocess_v2", Boolean.TRUE); // 是否根据流程 abilityprocess_v2 来分页
params.put("user_id", user == null ? null : user.getId());
PageData<TAbilityApplicationDTO> page = tAbilityApplicationService.page(params);
return new Result<PageData<TAbilityApplicationDTO>>().ok(page);
}
@GetMapping("getByApplyFlag/{applyFlag}")
@ApiOperation("根据申请标识获取能力申请信息")
@LogOperation("根据申请标识获取能力申请信息")
public Result<Map<String, List<TAbilityApplicationDTO>>> getByApplyFlag(@PathVariable("applyFlag") String applyFlag) {
final UserDetail user = SecurityUser.getUser();
Map<String, Object> params = new HashMap<String, Object>() {
{
put("apply_flag", applyFlag); // 限定
put("user_id", user == null ? null : user.getId()); // 只出本人
}
};
List<TAbilityApplicationDTO> applicationDTOS = tAbilityApplicationService.list(params);
Map<String, List<TAbilityApplicationDTO>> result =
applicationDTOS.stream().collect(Collectors.groupingBy(t -> {
SysDeptDTO sysDeptDTO = t.getResourceOwnerDept();
if (sysDeptDTO == null) {
return "无部门信息"; // 无部门信息
} else {
return sysDeptDTO.getName();
}
}));
return new Result<Map<String, List<TAbilityApplicationDTO>>>().ok(result);
}
@GetMapping("page") @GetMapping("page")
@ApiOperation("分页") @ApiOperation("分页")
@LogOperation("分页") @LogOperation("分页")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType="int") , @ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String")
}) })
public Result<PageData<TAbilityApplicationDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){ public Result<PageData<TAbilityApplicationDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
PageData<TAbilityApplicationDTO> page = tAbilityApplicationService.page(params); PageData<TAbilityApplicationDTO> page = tAbilityApplicationService.page(params);
return new Result<PageData<TAbilityApplicationDTO>>().ok(page); return new Result<PageData<TAbilityApplicationDTO>>().ok(page);
@ -59,7 +110,7 @@ public class TAbilityApplicationController {
@GetMapping("{id}") @GetMapping("{id}")
@ApiOperation("信息") @ApiOperation("信息")
@LogOperation("信息") @LogOperation("信息")
public Result<TAbilityApplicationDTO> get(@PathVariable("id") Long id){ public Result<TAbilityApplicationDTO> get(@PathVariable("id") Long id) {
TAbilityApplicationDTO data = tAbilityApplicationService.get(id); TAbilityApplicationDTO data = tAbilityApplicationService.get(id);
return new Result<TAbilityApplicationDTO>().ok(data); return new Result<TAbilityApplicationDTO>().ok(data);
@ -68,7 +119,7 @@ public class TAbilityApplicationController {
@PostMapping @PostMapping
@ApiOperation("保存") @ApiOperation("保存")
@LogOperation("保存") @LogOperation("保存")
public Result save(@RequestBody TAbilityApplicationDTO dto){ public Result save(@RequestBody TAbilityApplicationDTO dto) {
//效验数据 //效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
@ -85,7 +136,7 @@ public class TAbilityApplicationController {
@PutMapping @PutMapping
@ApiOperation("修改") @ApiOperation("修改")
@LogOperation("修改") @LogOperation("修改")
public Result update(@RequestBody TAbilityApplicationDTO dto){ public Result update(@RequestBody TAbilityApplicationDTO dto) {
//效验数据 //效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
@ -97,7 +148,7 @@ public class TAbilityApplicationController {
@DeleteMapping @DeleteMapping
@ApiOperation("删除") @ApiOperation("删除")
@LogOperation("删除") @LogOperation("删除")
public Result delete(@RequestBody Long[] ids){ public Result delete(@RequestBody Long[] ids) {
//效验数据 //效验数据
AssertUtils.isArrayEmpty(ids, "id"); AssertUtils.isArrayEmpty(ids, "id");
@ -110,10 +161,10 @@ public class TAbilityApplicationController {
@ApiOperation("更新实例ID") @ApiOperation("更新实例ID")
@LogOperation("更新实例ID") @LogOperation("更新实例ID")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "businessKey", value = "业务KEY", paramType = "query", required = true, dataType="String"), @ApiImplicitParam(name = "businessKey", value = "业务KEY", paramType = "query", required = true, dataType = "String"),
@ApiImplicitParam(name = "processInstanceId", value = "实例ID", paramType = "query",required = true, dataType="String") @ApiImplicitParam(name = "processInstanceId", value = "实例ID", paramType = "query", required = true, dataType = "String")
}) })
public Result updateInstanceId(String businessKey, String processInstanceId){ public Result updateInstanceId(String businessKey, String processInstanceId) {
Long id = Long.valueOf(businessKey); Long id = Long.valueOf(businessKey);
tAbilityApplicationService.updateInstanceId(processInstanceId, id); tAbilityApplicationService.updateInstanceId(processInstanceId, id);
return new Result(); return new Result();

View File

@ -19,7 +19,7 @@ import java.util.List;
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@TableName("t_ability_application") @TableName(value = "t_ability_application", autoResultMap = true)
public class TAbilityApplicationEntity implements Serializable { public class TAbilityApplicationEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -98,7 +98,6 @@ public class TAbilityApplicationEntity implements Serializable {
/** /**
* 摄像头列表 * 摄像头列表
*/ */
// @TableField(value = "camera_list", typeHandler = FastjsonTypeHandler.class)
private String cameraList; private String cameraList;
/** /**
@ -115,7 +114,7 @@ public class TAbilityApplicationEntity implements Serializable {
/** /**
* 应用场景 * 应用场景
*/ */
@TableField(value = "application_scene", typeHandler = FastjsonTypeHandler.class) @TableField(value = "`application_scene`", typeHandler = FastjsonTypeHandler.class)
private List<String> applicationScene; private List<String> applicationScene;
/** /**
@ -137,5 +136,6 @@ public class TAbilityApplicationEntity implements Serializable {
/** /**
* 资源所属部门信息 * 资源所属部门信息
*/ */
@TableField(value = "`resource_owner_dept`", typeHandler = FastjsonTypeHandler.class)
private SysDeptDTO resourceOwnerDept; private SysDeptDTO resourceOwnerDept;
} }

View File

@ -8,6 +8,8 @@ import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
import io.renren.modules.processForm.entity.TAbilityApplicationEntity; import io.renren.modules.processForm.entity.TAbilityApplicationEntity;
import io.renren.modules.processForm.service.TAbilityApplicationService; import io.renren.modules.processForm.service.TAbilityApplicationService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@ -22,15 +24,38 @@ import java.util.stream.Collectors;
*/ */
@Service @Service
public class TAbilityApplicationServiceImpl extends CrudServiceImpl<TAbilityApplicationDao, TAbilityApplicationEntity, TAbilityApplicationDTO> implements TAbilityApplicationService { public class TAbilityApplicationServiceImpl extends CrudServiceImpl<TAbilityApplicationDao, TAbilityApplicationEntity, TAbilityApplicationDTO> implements TAbilityApplicationService {
private static final Logger logger = LoggerFactory.getLogger(TAbilityApplicationServiceImpl.class);
@Override @Override
public QueryWrapper<TAbilityApplicationEntity> getWrapper(Map<String, Object> params) { public QueryWrapper<TAbilityApplicationEntity> getWrapper(Map<String, Object> params) {
QueryWrapper<TAbilityApplicationEntity> wrapper = new QueryWrapper<>(); QueryWrapper<TAbilityApplicationEntity> wrapper = new QueryWrapper<>();
params.keySet().stream().filter(index -> null != params.get(index)).forEach(index -> {
switch (index) { //
case "abilityprocess_v2":
wrapper.select("DISTINCT apply_flag ,id ,`user` ,phone ,unit ,area ,system ,scene ,basis ,attachment ,instance_id ,user_id ,enclosure ,title ,application_system ,application_scene ,application_background ,effect_wish ,apply_number ,resource_owner_dept ,del_flag");
wrapper.isNotNull(Boolean.valueOf(params.get("abilityprocess_v2").toString()), "apply_flag");
wrapper.isNotNull(Boolean.valueOf(params.get("abilityprocess_v2").toString()), "instance_id");
wrapper.groupBy(Boolean.valueOf(params.get("abilityprocess_v2").toString()), "apply_flag")
.groupBy("id");
break;
case "user_id":
wrapper.eq(params.get("user_id") != null, "user_id", Long.valueOf(params.get("user_id").toString()));
break;
case "apply_flag":
wrapper.eq(params.get("apply_flag") != null, "apply_flag", params.get("apply_flag").toString());
break;
}
});
wrapper.orderByDesc("id");
return wrapper; return wrapper;
} }
@Override
public List<TAbilityApplicationDTO> list(Map<String, Object> params) {
List<TAbilityApplicationEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, currentDtoClass());
}
@Override @Override
public void updateInstanceId(String instanceId, Long id) { public void updateInstanceId(String instanceId, Long id) {
baseDao.updateInstanceId(instanceId, id); baseDao.updateInstanceId(instanceId, id);

View File

@ -18,122 +18,122 @@ import java.util.List;
* @since 1.0 2022-04-13 * @since 1.0 2022-04-13
*/ */
@Data @Data
@EqualsAndHashCode(callSuper=false) @EqualsAndHashCode(callSuper = false)
@TableName("tb_data_resource") @TableName(value = "tb_data_resource", autoResultMap = true)
public class ResourceEntity extends BaseEntity { public class ResourceEntity extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 类型基础设施数据资源等 * 类型基础设施数据资源等
*/ */
private String type; private String type;
/** /**
* 名称 * 名称
*/ */
private String name; private String name;
/** /**
* 描述 * 描述
*/ */
private String description; private String description;
/** /**
* 链接URL * 链接URL
*/ */
private String link; private String link;
/** /**
* api请求方式 * api请求方式
*/ */
private String apiMethodType; private String apiMethodType;
/** /**
* apiURL * apiURL
*/ */
private String apiUrl; private String apiUrl;
/** /**
* groupID * groupID
*/ */
private String groupId; private String groupId;
/** /**
* 所属部门 * 所属部门
*/ */
private Long deptId; private Long deptId;
/** /**
* 部门联系人 * 部门联系人
*/ */
private String deptContacts; private String deptContacts;
/** /**
* 联系电话 * 联系电话
*/ */
private String deptPhone; private String deptPhone;
/** /**
* 共享类型 * 共享类型
*/ */
private String shareType; private String shareType;
/** /**
* 共享方式 * 共享方式
*/ */
private String shareMode; private String shareMode;
/** /**
* 共享条件 * 共享条件
*/ */
private String shareCondition; private String shareCondition;
/** /**
* 地区编码 * 地区编码
*/ */
private Long districtId; private Long districtId;
/** /**
* 访问量 * 访问量
*/ */
private Long visits; private Long visits;
/** /**
* 删除标志0:正常1:已删除9其他 * 删除标志0:正常1:已删除9其他
*/ */
private Integer delFlag; private Integer delFlag;
/** /**
* 修改人 * 修改人
*/ */
@TableField(fill = FieldFill.INSERT_UPDATE) @TableField(fill = FieldFill.INSERT_UPDATE)
private Long updater; private Long updater;
/** /**
* 修改时间 * 修改时间
*/ */
@TableField(fill = FieldFill.INSERT_UPDATE) @TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateDate; private Date updateDate;
/** /**
* 备用字段 * 备用字段
*/ */
private String note1; private String note1;
/** /**
* 备用字段 * 备用字段
*/ */
private String note2; private String note2;
/** /**
* 备用字段 * 备用字段
*/ */
private String note3; private String note3;
/** /**
* 备用字段 * 备用字段
*/ */
private String note4; private String note4;
/** /**
* 备用字段 * 备用字段
*/ */
private String note5; private String note5;
/** /**
* 附件 * 附件
*/ */
private String enclosure; private String enclosure;
/** /**
* 下架理由 * 下架理由
*/ */
private String undercarriageReason; private String undercarriageReason;
/** /**
* 提起下架人员 * 提起下架人员
*/ */
private String undercarriageUserName; private String undercarriageUserName;
@TableField(value = "info_list", typeHandler = FastjsonTypeHandler.class) @TableField(value = "info_list", typeHandler = FastjsonTypeHandler.class)
private List<AttrEntity> infoList; private List<AttrEntity> infoList;
} }

View File

@ -5,6 +5,7 @@ import io.renren.modules.monitor.entity.CameraChannel;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -15,64 +16,64 @@ import java.util.List;
* @since 1.0 2022-04-16 * @since 1.0 2022-04-16
*/ */
@Data @Data
@EqualsAndHashCode(callSuper=false) @EqualsAndHashCode(callSuper = false)
@TableName("tb_resource_car") @TableName(value = "tb_resource_car", autoResultMap = true)
public class ResourceCarEntity { public class ResourceCarEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId @TableId
private Long id; private Long id;
/** /**
* 用户IDsys_user主键 * 用户IDsys_user主键
*/ */
private Long userId; private Long userId;
/** /**
* 资源IDtb_data_resource主键 * 资源IDtb_data_resource主键
*/ */
private Long resourceId; private Long resourceId;
/** /**
* 删除标志0:正常1:已删除9:其他 * 删除标志0:正常1:已删除9:其他
*/ */
private Integer delFlag; private Integer delFlag;
/** /**
* 创建时间 * 创建时间
*/ */
@TableField(fill = FieldFill.INSERT) @TableField(fill = FieldFill.INSERT)
private Date createDate; private Date createDate;
/** /**
* 创建人 * 创建人
*/ */
@TableField(fill = FieldFill.INSERT) @TableField(fill = FieldFill.INSERT)
private Long creator; private Long creator;
/** /**
* 修改时间 * 修改时间
*/ */
@TableField(fill = FieldFill.INSERT_UPDATE) @TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateDate; private Date updateDate;
/** /**
* 修改人 * 修改人
*/ */
@TableField(fill = FieldFill.INSERT_UPDATE) @TableField(fill = FieldFill.INSERT_UPDATE)
private Long updater; private Long updater;
/** /**
* 摄像头列表 * 摄像头列表
*/ */
@TableField(value = "note1", typeHandler = FastjsonTypeHandler.class) @TableField(value = "note1", typeHandler = FastjsonTypeHandler.class)
private List<CameraChannel> note1; private List<CameraChannel> note1;
/** /**
* 备用字段 * 备用字段
*/ */
private String note2; private String note2;
/** /**
* 备用字段 * 备用字段
*/ */
private String note3; private String note3;
/** /**
* 备用字段 * 备用字段
*/ */
private String note4; private String note4;
/** /**
* 备用字段 * 备用字段
*/ */
private String note5; private String note5;
} }

View File

@ -27,6 +27,29 @@
<result property="resourceOwnerDept" column="resource_owner_dept" <result property="resourceOwnerDept" column="resource_owner_dept"
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/> typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
</resultMap> </resultMap>
<resultMap id="resourceDTO" type="io.renren.modules.processForm.dto.TAbilityApplicationDTO">
<result property="id" column="id"/>
<result property="user" column="user"/>
<result property="phone" column="phone"/>
<result property="unit" column="unit"/>
<result property="area" column="area"/>
<result property="system" column="system"/>
<result property="scene" column="scene"/>
<result property="basis" column="basis"/>
<result property="attachment" column="attachment"/>
<result property="instanceId" column="instance_id"/>
<result property="resourceId" column="resource_id"/>
<result property="userId" column="user_id"/>
<result property="approveStatus" column="approve_status"/>
<result property="delFlag" column="del_flag"/>
<result property="enclosure" column="enclosure"/>
<result property="cameraList" column="camera_list"/>
<result property="applicationScene" column="application_scene"
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
<result property="applyFlag" column="apply_flag"/>
<result property="resourceOwnerDept" column="resource_owner_dept"
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
</resultMap>
<update id="updateInstanceId"> <update id="updateInstanceId">
update t_ability_application set instance_id = #{instanceId} where id = #{id} update t_ability_application set instance_id = #{instanceId} where id = #{id}