能力申请表单及流程接口
This commit is contained in:
parent
fd4fc9016b
commit
ed53a011b2
|
@ -4,7 +4,9 @@
|
|||
<facet type="jpa" name="JPA">
|
||||
<configuration>
|
||||
<setting name="validation-enabled" value="true" />
|
||||
<datasource-mapping />
|
||||
<datasource-mapping>
|
||||
<factory-entry name="renren-admin" />
|
||||
</datasource-mapping>
|
||||
<naming-strategy-map />
|
||||
</configuration>
|
||||
</facet>
|
||||
|
|
|
@ -0,0 +1,127 @@
|
|||
package io.renren.modules.processForm.controller;
|
||||
|
||||
import io.renren.common.annotation.LogOperation;
|
||||
import io.renren.common.constant.Constant;
|
||||
import io.renren.common.page.PageData;
|
||||
import io.renren.common.utils.ExcelUtils;
|
||||
import io.renren.common.utils.Result;
|
||||
import io.renren.common.validator.AssertUtils;
|
||||
import io.renren.common.validator.ValidatorUtils;
|
||||
import io.renren.common.validator.group.AddGroup;
|
||||
import io.renren.common.validator.group.DefaultGroup;
|
||||
import io.renren.common.validator.group.UpdateGroup;
|
||||
import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
|
||||
import io.renren.modules.processForm.excel.TAbilityApplicationExcel;
|
||||
import io.renren.modules.processForm.service.TAbilityApplicationService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 能力申请表单
|
||||
*
|
||||
* @author Mark sunlightcs@gmail.com
|
||||
* @since 3.0 2022-04-13
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("processForm/tabilityapplication")
|
||||
@Api(tags="能力申请表单")
|
||||
public class TAbilityApplicationController {
|
||||
@Autowired
|
||||
private TAbilityApplicationService tAbilityApplicationService;
|
||||
|
||||
@GetMapping("page")
|
||||
@ApiOperation("分页")
|
||||
@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>> page(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||
PageData<TAbilityApplicationDTO> page = tAbilityApplicationService.page(params);
|
||||
|
||||
return new Result<PageData<TAbilityApplicationDTO>>().ok(page);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@ApiOperation("信息")
|
||||
public Result<TAbilityApplicationDTO> get(@PathVariable("id") Long id){
|
||||
TAbilityApplicationDTO data = tAbilityApplicationService.get(id);
|
||||
|
||||
return new Result<TAbilityApplicationDTO>().ok(data);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("保存")
|
||||
@LogOperation("保存")
|
||||
public Result save(@RequestBody TAbilityApplicationDTO dto){
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
|
||||
tAbilityApplicationService.save(dto);
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("businessKey", dto.getId().toString());
|
||||
|
||||
return new Result().ok(map);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改")
|
||||
@LogOperation("修改")
|
||||
public Result update(@RequestBody TAbilityApplicationDTO dto){
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
||||
|
||||
tAbilityApplicationService.update(dto);
|
||||
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除")
|
||||
@LogOperation("删除")
|
||||
public Result delete(@RequestBody Long[] ids){
|
||||
//效验数据
|
||||
AssertUtils.isArrayEmpty(ids, "id");
|
||||
|
||||
tAbilityApplicationService.delete(ids);
|
||||
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@PostMapping("updateInstanceId")
|
||||
@ApiOperation("更新实例ID")
|
||||
@LogOperation("更新实例ID")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "businessKey", value = "业务KEY", paramType = "query", required = true, dataType="String"),
|
||||
@ApiImplicitParam(name = "processInstanceId", value = "实例ID", paramType = "query",required = true, dataType="String")
|
||||
})
|
||||
public Result updateInstanceId(String businessKey, String processInstanceId){
|
||||
Long id = Long.valueOf(businessKey);
|
||||
tAbilityApplicationService.updateInstanceId(processInstanceId, id);
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@GetMapping("export")
|
||||
@ApiOperation("导出")
|
||||
@LogOperation("导出")
|
||||
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
|
||||
List<TAbilityApplicationDTO> list = tAbilityApplicationService.list(params);
|
||||
|
||||
ExcelUtils.exportExcelToTarget(response, null, "能力申请表单", list, TAbilityApplicationExcel.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package io.renren.modules.processForm.dao;
|
||||
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.processForm.entity.TAbilityApplicationEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 能力申请表单
|
||||
*
|
||||
* @author Mark sunlightcs@gmail.com
|
||||
* @since 3.0 2022-04-13
|
||||
*/
|
||||
@Mapper
|
||||
public interface TAbilityApplicationDao extends BaseDao<TAbilityApplicationEntity> {
|
||||
void updateInstanceId(String instanceId, Long id);
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package io.renren.modules.processForm.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 能力申请表单
|
||||
*
|
||||
* @author Mark sunlightcs@gmail.com
|
||||
* @since 3.0 2022-04-13
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "能力申请表单")
|
||||
public class TAbilityApplicationDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "申请人")
|
||||
private String user;
|
||||
@ApiModelProperty(value = "申请人电话")
|
||||
private String phone;
|
||||
@ApiModelProperty(value = "申请人单位")
|
||||
private String unit;
|
||||
@ApiModelProperty(value = "申请人所在地区")
|
||||
private String area;
|
||||
@ApiModelProperty(value = "申请应用系统")
|
||||
private String system;
|
||||
@ApiModelProperty(value = "申请场景")
|
||||
private String scene;
|
||||
@ApiModelProperty(value = "申请依据")
|
||||
private String basis;
|
||||
@ApiModelProperty(value = "申请附件")
|
||||
private String attachment;
|
||||
@ApiModelProperty(value = "实例ID")
|
||||
private String instanceId;
|
||||
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package io.renren.modules.processForm.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
/**
|
||||
* 能力申请表单
|
||||
*
|
||||
* @author Mark sunlightcs@gmail.com
|
||||
* @since 3.0 2022-04-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@TableName("t_ability_application")
|
||||
public class TAbilityApplicationEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 申请人
|
||||
*/
|
||||
private String user;
|
||||
/**
|
||||
* 申请人电话
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 申请人单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 申请人所在地区
|
||||
*/
|
||||
private String area;
|
||||
/**
|
||||
* 申请应用系统
|
||||
*/
|
||||
private String system;
|
||||
/**
|
||||
* 申请场景
|
||||
*/
|
||||
private String scene;
|
||||
/**
|
||||
* 申请依据
|
||||
*/
|
||||
private String basis;
|
||||
/**
|
||||
* 申请附件
|
||||
*/
|
||||
private String attachment;
|
||||
|
||||
/**
|
||||
* 实例ID
|
||||
*/
|
||||
private String instanceId;
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package io.renren.modules.processForm.excel;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
|
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 能力申请表单
|
||||
*
|
||||
* @author Mark sunlightcs@gmail.com
|
||||
* @since 3.0 2022-04-13
|
||||
*/
|
||||
@Data
|
||||
@ContentRowHeight(20)
|
||||
@HeadRowHeight(20)
|
||||
@ColumnWidth(25)
|
||||
public class TAbilityApplicationExcel {
|
||||
@ExcelProperty(value = "Long", index = 0)
|
||||
private Long id;
|
||||
@ExcelProperty(value = "申请人", index = 1)
|
||||
private String user;
|
||||
@ExcelProperty(value = "申请人电话", index = 2)
|
||||
private String phone;
|
||||
@ExcelProperty(value = "申请人单位", index = 3)
|
||||
private String unit;
|
||||
@ExcelProperty(value = "申请人所在地区", index = 4)
|
||||
private String area;
|
||||
@ExcelProperty(value = "申请应用系统", index = 5)
|
||||
private String system;
|
||||
@ExcelProperty(value = "申请场景", index = 6)
|
||||
private String scene;
|
||||
@ExcelProperty(value = "申请依据", index = 7)
|
||||
private String basis;
|
||||
@ExcelProperty(value = "申请附件", index = 8)
|
||||
private String attachment;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package io.renren.modules.processForm.service;
|
||||
|
||||
import io.renren.common.service.CrudService;
|
||||
import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
|
||||
import io.renren.modules.processForm.entity.TAbilityApplicationEntity;
|
||||
|
||||
/**
|
||||
* 能力申请表单
|
||||
*
|
||||
* @author Mark sunlightcs@gmail.com
|
||||
* @since 3.0 2022-04-13
|
||||
*/
|
||||
public interface TAbilityApplicationService extends CrudService<TAbilityApplicationEntity, TAbilityApplicationDTO> {
|
||||
|
||||
void updateInstanceId(String instanceId, Long id);
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package io.renren.modules.processForm.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.renren.common.service.impl.CrudServiceImpl;
|
||||
import io.renren.common.constant.Constant;
|
||||
import io.renren.modules.processForm.dao.TAbilityApplicationDao;
|
||||
import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
|
||||
import io.renren.modules.processForm.entity.TAbilityApplicationEntity;
|
||||
import io.renren.modules.processForm.service.TAbilityApplicationService;
|
||||
import io.renren.modules.security.user.SecurityUser;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 能力申请表单
|
||||
*
|
||||
* @author Mark sunlightcs@gmail.com
|
||||
* @since 3.0 2022-04-13
|
||||
*/
|
||||
@Service
|
||||
public class TAbilityApplicationServiceImpl extends CrudServiceImpl<TAbilityApplicationDao, TAbilityApplicationEntity, TAbilityApplicationDTO> implements TAbilityApplicationService {
|
||||
|
||||
@Override
|
||||
public QueryWrapper<TAbilityApplicationEntity> getWrapper(Map<String, Object> params){
|
||||
QueryWrapper<TAbilityApplicationEntity> wrapper = new QueryWrapper<>();
|
||||
|
||||
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateInstanceId(String instanceId, Long id) {
|
||||
baseDao.updateInstanceId(instanceId, id);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -4,9 +4,9 @@ spring:
|
|||
#MySQL
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
url: jdbc:mysql://127.0.0.1:3306/share_platform?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
url: jdbc:mysql://15.2.21.238:3310/share_platform?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
username: root
|
||||
password: 123456
|
||||
password: Hisense2019
|
||||
# #Oracle
|
||||
# driver-class-name: oracle.jdbc.OracleDriver
|
||||
# url: jdbc:oracle:thin:@192.168.10.10:1521:xe
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="io.renren.modules.processForm.dao.TAbilityApplicationDao">
|
||||
|
||||
<update id="updateInstanceId">
|
||||
update t_ability_application set instance_id = #{instanceId} where id = #{id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue