Merge branch 'master' into docker_package
This commit is contained in:
commit
64e82a94fa
|
@ -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); // 是否为基础设施
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -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,6 +28,7 @@ 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;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,6 +44,54 @@ 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("分页")
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
|
@ -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);
|
||||||
|
|
|
@ -19,7 +19,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@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;
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@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;
|
||||||
|
|
||||||
|
|
|
@ -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}
|
||||||
|
|
Loading…
Reference in New Issue