bug修改
This commit is contained in:
parent
f459e21f05
commit
96b495dc43
@ -1284,11 +1284,6 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSubProject() {
|
|
||||||
UserInfo user = SecurityUtils.getUser();
|
|
||||||
return Objects.equals(user.getAccountType(), 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SystemUser> getSystemUserList(Map<String, Object> map) {
|
public List<SystemUser> getSystemUserList(Map<String, Object> map) {
|
||||||
@ -1511,6 +1506,12 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSubProject() {
|
||||||
|
UserInfo user = SecurityUtils.getUser();
|
||||||
|
return Objects.equals(user.getAccountType(), 6);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSupplier() {
|
public boolean isSupplier() {
|
||||||
UserInfo user = SecurityUtils.getUser();
|
UserInfo user = SecurityUtils.getUser();
|
||||||
|
|||||||
@ -103,17 +103,9 @@ public class ProjectEnterpriseController {
|
|||||||
@ApiImplicitParam(name = "id", value = "项目劳务公司关联ID", paramType = "body", required = true, dataType = "Integer")
|
@ApiImplicitParam(name = "id", value = "项目劳务公司关联ID", paramType = "body", required = true, dataType = "Integer")
|
||||||
@PostMapping(value = "/delete")
|
@PostMapping(value = "/delete")
|
||||||
public Result<ProjectEnterprise> delete(@RequestBody Map<String,Object> map) {
|
public Result<ProjectEnterprise> delete(@RequestBody Map<String,Object> map) {
|
||||||
Result<ProjectEnterprise> result = new Result<ProjectEnterprise>();
|
String id = MapUtils.getString(map, "id");
|
||||||
ProjectEnterprise projectEnterprise = projectEnterpriseService.getById(MapUtils.getString(map,"id"));
|
projectEnterpriseService.delete(id);
|
||||||
if(projectEnterprise==null) {
|
return Result.ok();
|
||||||
result.error500(MessageUtil.get("notFindErr"));
|
|
||||||
}else {
|
|
||||||
boolean ok = projectEnterpriseService.removeById(MapUtils.getString(map,"id"));
|
|
||||||
if(ok) {
|
|
||||||
result.successMsg(MessageUtil.get("deleteSucess"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -126,15 +118,8 @@ public class ProjectEnterpriseController {
|
|||||||
@ApiImplicitParam(name = "ids", value = "项目劳务公司关联ID字符串", paramType = "body", required = true, dataType = "String")
|
@ApiImplicitParam(name = "ids", value = "项目劳务公司关联ID字符串", paramType = "body", required = true, dataType = "String")
|
||||||
@PostMapping(value = "/deleteBatch")
|
@PostMapping(value = "/deleteBatch")
|
||||||
public Result<ProjectEnterprise> deleteBatch(@RequestBody Map<String,Object> map) {
|
public Result<ProjectEnterprise> deleteBatch(@RequestBody Map<String,Object> map) {
|
||||||
Result<ProjectEnterprise> result = new Result<ProjectEnterprise>();
|
projectEnterpriseService.deleteBatch(map);
|
||||||
String ids=MapUtils.getString(map,"ids");
|
return Result.ok();
|
||||||
if(ids==null || "".equals(ids.trim())) {
|
|
||||||
result.error500(MessageUtil.get("parameterErr"));
|
|
||||||
}else {
|
|
||||||
this.projectEnterpriseService.removeByIds(Arrays.asList(ids.split(",")));
|
|
||||||
result.successMsg(MessageUtil.get("deleteSucess"));
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -39,13 +39,11 @@ public class ProjectEnterprise implements Serializable {
|
|||||||
/**企业类型*/
|
/**企业类型*/
|
||||||
@Excel(name = "企业类型", width = 15)
|
@Excel(name = "企业类型", width = 15)
|
||||||
@ApiModelProperty(value="企业类型")
|
@ApiModelProperty(value="企业类型")
|
||||||
|
|
||||||
private java.lang.Long enterpriseTypeId ;
|
private java.lang.Long enterpriseTypeId ;
|
||||||
|
|
||||||
/**父级企业ID*/
|
/**父级企业ID*/
|
||||||
@Excel(name = "父级企业ID", width = 15)
|
@Excel(name = "父级企业ID", width = 15)
|
||||||
@ApiModelProperty(value="父级企业ID")
|
@ApiModelProperty(value="父级企业ID")
|
||||||
|
|
||||||
private java.lang.Long parentEnterpriseId ;
|
private java.lang.Long parentEnterpriseId ;
|
||||||
|
|
||||||
@Excel(name = "类型,1项目,2企业", width = 15)
|
@Excel(name = "类型,1项目,2企业", width = 15)
|
||||||
@ -57,14 +55,19 @@ public class ProjectEnterprise implements Serializable {
|
|||||||
private java.lang.String projectDirectorName ;
|
private java.lang.String projectDirectorName ;
|
||||||
|
|
||||||
@Excel(name = "项目负责人电话", width = 15)
|
@Excel(name = "项目负责人电话", width = 15)
|
||||||
@ApiModelProperty(value="项目负责人电话")
|
@ApiModelProperty(value = "项目负责人电话")
|
||||||
private java.lang.String projectDirectorPhone ;
|
private java.lang.String projectDirectorPhone;
|
||||||
|
|
||||||
/**排序*/
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
@Excel(name = "排序", width = 15)
|
@Excel(name = "排序", width = 15)
|
||||||
@ApiModelProperty(value="排序")
|
@ApiModelProperty(value = "排序")
|
||||||
private java.lang.Integer sortNum ;
|
private java.lang.Integer sortNum;
|
||||||
|
|
||||||
@ApiModelProperty(value="是否是项目部公司,1否,2是")
|
@ApiModelProperty(value = "是否是项目部公司,1否,2是")
|
||||||
private java.lang.Integer departmentType ;
|
private java.lang.Integer departmentType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "祖级列表")
|
||||||
|
private java.lang.String ancestors;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,4 +33,7 @@ public interface ProjectEnterpriseMapper extends BaseMapper<ProjectEnterprise> {
|
|||||||
void updateEnterpriseType(Map<String, Object> map);
|
void updateEnterpriseType(Map<String, Object> map);
|
||||||
|
|
||||||
List<Map<String, Object>> selectExternalEnterpriseList(Map<String, Object> map);
|
List<Map<String, Object>> selectExternalEnterpriseList(Map<String, Object> map);
|
||||||
|
|
||||||
|
void updateAncestors(@Param("oldAncestor") String oldAncestor, @Param("newAncestor") String newAncestor, @Param("projectSn") String projectSn, @Param("id") Long id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -102,4 +102,10 @@
|
|||||||
and a.social_code = #{socialCode}
|
and a.social_code = #{socialCode}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<update id="updateAncestors">
|
||||||
|
UPDATE project_enterprise
|
||||||
|
SET ancestors=REPLACE(ancestors, #{oldAncestor}, #{newAncestor})
|
||||||
|
WHERE ancestors LIKE N'${oldAncestor},${id}%' and project_sn = #{projectSn}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -30,4 +30,9 @@ public interface IProjectEnterpriseService extends IService<ProjectEnterprise> {
|
|||||||
Map<String, Object> bindProjectCompany(Map<String, Object> map);
|
Map<String, Object> bindProjectCompany(Map<String, Object> map);
|
||||||
|
|
||||||
List<Map<String, Object>> selectExternalEnterpriseList(Map<String, Object> map);
|
List<Map<String, Object>> selectExternalEnterpriseList(Map<String, Object> map);
|
||||||
|
|
||||||
|
void delete(String id);
|
||||||
|
|
||||||
|
void deleteBatch(Map<String, Object> map);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.zhgd.xmgl.modules.project.service.impl;
|
package com.zhgd.xmgl.modules.project.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@ -24,10 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@ -81,16 +79,48 @@ public class ProjectEnterpriseServiceImpl extends ServiceImpl<ProjectEnterpriseM
|
|||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
throw new OpenAlertException(MessageUtil.get("existsEnterpriseErr"));
|
throw new OpenAlertException(MessageUtil.get("existsEnterpriseErr"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean top = projectEnterprise.getParentEnterpriseId() == null || projectEnterprise.getParentEnterpriseId() == 0;
|
||||||
|
if (top) {
|
||||||
|
projectEnterprise.setParentEnterpriseId(0L);
|
||||||
|
projectEnterprise.setAncestors("0");
|
||||||
|
} else {
|
||||||
|
ProjectEnterprise pOrg = projectEnterpriseMapper.selectOne(new LambdaQueryWrapper<ProjectEnterprise>()
|
||||||
|
.eq(ProjectEnterprise::getId, projectEnterprise.getParentEnterpriseId()));
|
||||||
|
if (pOrg == null) {
|
||||||
|
throw new OpenAlertException("上级不存在");
|
||||||
|
}
|
||||||
|
projectEnterprise.setAncestors(pOrg.getAncestors() + "," + pOrg.getId());
|
||||||
|
}
|
||||||
projectEnterpriseMapper.insert(projectEnterprise);
|
projectEnterpriseMapper.insert(projectEnterprise);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void editProjectEnterprise(ProjectEnterprise projectEnterprise) {
|
public void editProjectEnterprise(ProjectEnterprise projectEnterprise) {
|
||||||
ProjectEnterprise projectEnterpriseEntity = projectEnterpriseMapper.selectById(projectEnterprise.getId());
|
ProjectEnterprise oldPo = projectEnterpriseMapper.selectById(projectEnterprise.getId());
|
||||||
if (projectEnterpriseEntity == null) {
|
if (oldPo == null) {
|
||||||
throw new OpenAlertException(MessageUtil.get("notFindErr"));
|
throw new OpenAlertException(MessageUtil.get("notFindErr"));
|
||||||
}
|
}
|
||||||
projectEnterpriseMapper.updateById(projectEnterprise);
|
|
||||||
|
if (!Objects.equals(oldPo.getParentEnterpriseId(), projectEnterprise.getParentEnterpriseId())) {
|
||||||
|
ProjectEnterprise pOrg = projectEnterpriseMapper.selectById(projectEnterprise.getParentEnterpriseId());
|
||||||
|
// 修改子部门
|
||||||
|
boolean top = projectEnterprise.getParentEnterpriseId() == null || projectEnterprise.getParentEnterpriseId() == 0;
|
||||||
|
if (top) {
|
||||||
|
projectEnterprise.setParentEnterpriseId(0L);
|
||||||
|
projectEnterprise.setAncestors("0");
|
||||||
|
} else {
|
||||||
|
if (pOrg == null) {
|
||||||
|
throw new OpenAlertException("上级部门不存在");
|
||||||
|
}
|
||||||
|
projectEnterprise.setAncestors(pOrg.getAncestors() + "," + pOrg.getId());
|
||||||
|
}
|
||||||
|
baseMapper.updateAncestors(oldPo.getAncestors(), projectEnterprise.getAncestors(), projectEnterprise.getProjectSn(), projectEnterprise.getId());
|
||||||
|
baseMapper.updateById(projectEnterprise);
|
||||||
|
} else {
|
||||||
|
projectEnterprise.setAncestors(null);
|
||||||
|
baseMapper.updateById(projectEnterprise);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -148,4 +178,29 @@ public class ProjectEnterpriseServiceImpl extends ServiceImpl<ProjectEnterpriseM
|
|||||||
public List<Map<String, Object>> selectExternalEnterpriseList(Map<String, Object> map) {
|
public List<Map<String, Object>> selectExternalEnterpriseList(Map<String, Object> map) {
|
||||||
return projectEnterpriseMapper.selectExternalEnterpriseList(map);
|
return projectEnterpriseMapper.selectExternalEnterpriseList(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(String id) {
|
||||||
|
ProjectEnterprise xzProjectOrg = baseMapper.selectById(id);
|
||||||
|
if (xzProjectOrg == null) {
|
||||||
|
throw new OpenAlertException("未找到对应实体");
|
||||||
|
}
|
||||||
|
List<ProjectEnterprise> xzProjectOrgs = baseMapper.selectList(new LambdaQueryWrapper<ProjectEnterprise>()
|
||||||
|
.eq(ProjectEnterprise::getParentEnterpriseId, id));
|
||||||
|
if (CollUtil.isNotEmpty(xzProjectOrgs)) {
|
||||||
|
throw new OpenAlertException("有下级劳务公司,无法删除");
|
||||||
|
}
|
||||||
|
baseMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteBatch(Map<String, Object> map) {
|
||||||
|
String ids = MapUtils.getString(map, "ids");
|
||||||
|
if (ids == null || "".equals(ids.trim())) {
|
||||||
|
throw new OpenAlertException(MessageUtil.get("parameterErr"));
|
||||||
|
}
|
||||||
|
for (String id : Arrays.asList(ids.split(","))) {
|
||||||
|
delete(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,19 +67,8 @@ public class QualityRegionController {
|
|||||||
@ApiOperation(value = "编辑质量—检查部位信息", notes = "编辑质量—检查部位信息" , httpMethod="POST")
|
@ApiOperation(value = "编辑质量—检查部位信息", notes = "编辑质量—检查部位信息" , httpMethod="POST")
|
||||||
@PostMapping(value = "/edit")
|
@PostMapping(value = "/edit")
|
||||||
public Result<QualityRegion> edit(@RequestBody QualityRegion qualityRegion) {
|
public Result<QualityRegion> edit(@RequestBody QualityRegion qualityRegion) {
|
||||||
Result<QualityRegion> result = new Result<QualityRegion>();
|
qualityRegionService.edit(qualityRegion);
|
||||||
QualityRegion qualityRegionEntity = qualityRegionService.getById(qualityRegion.getId());
|
return Result.ok();
|
||||||
if(qualityRegionEntity==null) {
|
|
||||||
result.error500(MessageUtil.get("notFindErr"));
|
|
||||||
}else {
|
|
||||||
boolean ok = qualityRegionService.updateById(qualityRegion);
|
|
||||||
|
|
||||||
if(ok) {
|
|
||||||
result.successMsg(MessageUtil.get("editSucess"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -83,6 +83,8 @@ public class QualityRegion implements Serializable {
|
|||||||
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
@ApiModelProperty(value = "祖级列表")
|
||||||
|
private java.lang.String ancestors;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<QualityRegion> children;
|
private List<QualityRegion> children;
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import com.zhgd.jeecg.common.mybatis.EntityMap;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import com.zhgd.xmgl.modules.quality.entity.QualityRegion;
|
import com.zhgd.xmgl.modules.quality.entity.QualityRegion;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 质量—检查部位
|
* @Description: 质量—检查部位
|
||||||
@ -24,4 +25,6 @@ public interface QualityRegionMapper extends BaseMapper<QualityRegion> {
|
|||||||
QualityRegion getPeerNewQualityRegion(Map<String, Object> param);
|
QualityRegion getPeerNewQualityRegion(Map<String, Object> param);
|
||||||
|
|
||||||
void updateDutyNull(String id);
|
void updateDutyNull(String id);
|
||||||
|
|
||||||
|
void updateAncestors(@Param("oldAncestor") String oldAncestor, @Param("newAncestor") String newAncestor, @Param("projectSn") String projectSn, @Param("id") Long id);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,4 +29,10 @@
|
|||||||
duty_name = null
|
duty_name = null
|
||||||
where duty_id = #{id}
|
where duty_id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="updateAncestors">
|
||||||
|
UPDATE quality_region
|
||||||
|
SET ancestors=REPLACE(ancestors, #{oldAncestor}, #{newAncestor})
|
||||||
|
WHERE ancestors LIKE N'${oldAncestor},${id}%' and project_sn = #{projectSn}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -20,4 +20,6 @@ public interface IQualityRegionService extends IService<QualityRegion> {
|
|||||||
void addQualityRegion(QualityRegion qualityRegion);
|
void addQualityRegion(QualityRegion qualityRegion);
|
||||||
|
|
||||||
void deleteQualityRegion(Map<String, Object> map);
|
void deleteQualityRegion(Map<String, Object> map);
|
||||||
|
|
||||||
|
void edit(QualityRegion qualityRegion);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,16 +1,18 @@
|
|||||||
package com.zhgd.xmgl.modules.quality.service.impl;
|
package com.zhgd.xmgl.modules.quality.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.lang.tree.TreeUtil;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||||
import com.zhgd.xmgl.modules.quality.entity.QualityRegion;
|
import com.zhgd.xmgl.modules.quality.entity.QualityRegion;
|
||||||
import com.zhgd.xmgl.modules.quality.mapper.QualityRegionMapper;
|
import com.zhgd.xmgl.modules.quality.mapper.QualityRegionMapper;
|
||||||
import com.zhgd.xmgl.modules.quality.service.IQualityRegionService;
|
import com.zhgd.xmgl.modules.quality.service.IQualityRegionService;
|
||||||
|
import com.zhgd.xmgl.modules.xz.entity.XzProjectOrg;
|
||||||
import com.zhgd.xmgl.util.ListUtils;
|
import com.zhgd.xmgl.util.ListUtils;
|
||||||
|
import com.zhgd.xmgl.util.MessageUtil;
|
||||||
import org.apache.commons.collections.MapUtils;
|
import org.apache.commons.collections.MapUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -54,55 +56,96 @@ public class QualityRegionServiceImpl extends ServiceImpl<QualityRegionMapper, Q
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addQualityRegion(QualityRegion qualityRegion) {
|
public void addQualityRegion(QualityRegion qualityRegion) {
|
||||||
if(qualityRegion.getParentRegion()==null){
|
if (qualityRegion.getParentRegion() == null) {
|
||||||
qualityRegion.setParentRegion(0L);
|
qualityRegion.setParentRegion(0L);
|
||||||
}
|
}
|
||||||
Map<String, Object> param=new HashMap<>();
|
Map<String, Object> param = new HashMap<>();
|
||||||
param.put("projectSn",qualityRegion.getProjectSn());
|
param.put("projectSn", qualityRegion.getProjectSn());
|
||||||
param.put("parentRegion",qualityRegion.getParentRegion());
|
param.put("parentRegion", qualityRegion.getParentRegion());
|
||||||
qualityRegion.setCreateTime(new Date());
|
qualityRegion.setCreateTime(new Date());
|
||||||
QualityRegion tempQualityRegion=qualityRegionMapper.getPeerNewQualityRegion(param);
|
QualityRegion tempQualityRegion = qualityRegionMapper.getPeerNewQualityRegion(param);
|
||||||
if(tempQualityRegion!=null){
|
if (tempQualityRegion != null) {
|
||||||
String end = tempQualityRegion.getRegionCode().substring(tempQualityRegion.getRegionCode().length() -2,tempQualityRegion.getRegionCode().length());
|
String end = tempQualityRegion.getRegionCode().substring(tempQualityRegion.getRegionCode().length() - 2, tempQualityRegion.getRegionCode().length());
|
||||||
String start = tempQualityRegion.getRegionCode().substring(0,tempQualityRegion.getRegionCode().length()-2);
|
String start = tempQualityRegion.getRegionCode().substring(0, tempQualityRegion.getRegionCode().length() - 2);
|
||||||
Integer num=Integer.valueOf(end)+1;
|
Integer num = Integer.valueOf(end) + 1;
|
||||||
if(num<10){
|
if (num < 10) {
|
||||||
start=start+"0"+num;
|
start = start + "0" + num;
|
||||||
}else{
|
} else {
|
||||||
start=start+num;
|
start = start + num;
|
||||||
}
|
}
|
||||||
qualityRegion.setRegionCode(start);
|
qualityRegion.setRegionCode(start);
|
||||||
}else{
|
} else {
|
||||||
if(qualityRegion.getParentRegion()==0){
|
if (qualityRegion.getParentRegion() == 0) {
|
||||||
qualityRegion.setRegionCode("01");
|
qualityRegion.setRegionCode("01");
|
||||||
}else{
|
} else {
|
||||||
QualityRegion parentQualityRegion=qualityRegionMapper.selectById(qualityRegion.getParentRegion());
|
QualityRegion parentQualityRegion = qualityRegionMapper.selectById(qualityRegion.getParentRegion());
|
||||||
String end = parentQualityRegion.getRegionCode().substring(parentQualityRegion.getRegionCode().length() -2,parentQualityRegion.getRegionCode().length());
|
String end = parentQualityRegion.getRegionCode().substring(parentQualityRegion.getRegionCode().length() - 2, parentQualityRegion.getRegionCode().length());
|
||||||
String start = parentQualityRegion.getRegionCode().substring(0,parentQualityRegion.getRegionCode().length()-2);
|
String start = parentQualityRegion.getRegionCode().substring(0, parentQualityRegion.getRegionCode().length() - 2);
|
||||||
Integer num=Integer.valueOf(end)+1;
|
Integer num = Integer.valueOf(end) + 1;
|
||||||
if(num<10){
|
if (num < 10) {
|
||||||
start=start+"0"+num;
|
start = start + "0" + num;
|
||||||
}else{
|
} else {
|
||||||
start=start+num;
|
start = start + num;
|
||||||
}
|
}
|
||||||
qualityRegion.setRegionCode(start);
|
qualityRegion.setRegionCode(start);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean top = qualityRegion.getParentRegion() == null || qualityRegion.getParentRegion() == 0;
|
||||||
|
if (top) {
|
||||||
|
qualityRegion.setParentRegion(0L);
|
||||||
|
qualityRegion.setAncestors("0");
|
||||||
|
} else {
|
||||||
|
QualityRegion pOrg = qualityRegionMapper.selectOne(new LambdaQueryWrapper<QualityRegion>()
|
||||||
|
.eq(QualityRegion::getId, qualityRegion.getParentRegion()));
|
||||||
|
if (pOrg == null) {
|
||||||
|
throw new OpenAlertException("上级不存在");
|
||||||
|
}
|
||||||
|
qualityRegion.setAncestors(pOrg.getAncestors() + "," + pOrg.getId());
|
||||||
|
}
|
||||||
qualityRegionMapper.insert(qualityRegion);
|
qualityRegionMapper.insert(qualityRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteQualityRegion(Map<String, Object> map) {
|
public void deleteQualityRegion(Map<String, Object> map) {
|
||||||
deleteRegion(MapUtils.getLong(map,"id"));
|
deleteRegion(MapUtils.getLong(map, "id"));
|
||||||
}
|
}
|
||||||
private void deleteRegion(Long id){
|
|
||||||
QueryWrapper<QualityRegion> queryWrapper=new QueryWrapper();
|
@Override
|
||||||
queryWrapper.lambda().eq(QualityRegion::getParentRegion,id);
|
public void edit(QualityRegion qualityRegion) {
|
||||||
List<QualityRegion> list=qualityRegionMapper.selectList(queryWrapper);
|
QualityRegion oldPo = getById(qualityRegion.getId());
|
||||||
if(list.size()>0){
|
if (oldPo == null) {
|
||||||
for(QualityRegion qualityRegion:list){
|
throw new OpenAlertException(MessageUtil.get("notFindErr"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Objects.equals(oldPo.getParentRegion(), qualityRegion.getParentRegion())) {
|
||||||
|
QualityRegion pOrg = qualityRegionMapper.selectById(qualityRegion.getParentRegion());
|
||||||
|
// 修改子部门
|
||||||
|
boolean top = qualityRegion.getParentRegion() == null || qualityRegion.getParentRegion() == 0;
|
||||||
|
if (top) {
|
||||||
|
qualityRegion.setParentRegion(0L);
|
||||||
|
qualityRegion.setAncestors("0");
|
||||||
|
} else {
|
||||||
|
if (pOrg == null) {
|
||||||
|
throw new OpenAlertException("上级部门不存在");
|
||||||
|
}
|
||||||
|
qualityRegion.setAncestors(pOrg.getAncestors() + "," + pOrg.getId());
|
||||||
|
}
|
||||||
|
baseMapper.updateAncestors(oldPo.getAncestors(), qualityRegion.getAncestors(), qualityRegion.getProjectSn(), qualityRegion.getId());
|
||||||
|
baseMapper.updateById(qualityRegion);
|
||||||
|
} else {
|
||||||
|
qualityRegion.setAncestors(null);
|
||||||
|
baseMapper.updateById(qualityRegion);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void deleteRegion(Long id) {
|
||||||
|
QueryWrapper<QualityRegion> queryWrapper = new QueryWrapper();
|
||||||
|
queryWrapper.lambda().eq(QualityRegion::getParentRegion, id);
|
||||||
|
List<QualityRegion> list = qualityRegionMapper.selectList(queryWrapper);
|
||||||
|
if (list.size() > 0) {
|
||||||
|
for (QualityRegion qualityRegion : list) {
|
||||||
deleteRegion(qualityRegion.getId());
|
deleteRegion(qualityRegion.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -239,11 +239,9 @@ public class XzTaskProgressController {
|
|||||||
return taskProgressService.exportXls(paramMap, request);
|
return taskProgressService.exportXls(paramMap, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "甘特图统计", notes = "甘特图统计", httpMethod = "POST")
|
||||||
@ApiOperation(value = "工作一览(统计)", notes = "工作一览(统计)", httpMethod = "POST")
|
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
|
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
|
||||||
@ApiImplicitParam(name = "type", value = "1.本月2.下月", paramType = "body", required = false, dataType = "Integer"),
|
|
||||||
})
|
})
|
||||||
@PostMapping(value = "/countTaskProgress")
|
@PostMapping(value = "/countTaskProgress")
|
||||||
public Result<CountTaskProgressVo> countTaskProgress(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
public Result<CountTaskProgressVo> countTaskProgress(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||||
|
|||||||
@ -164,6 +164,8 @@ public class XzTaskProgress implements Serializable {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "所属企业表外键ID")
|
@ApiModelProperty(value = "所属企业表外键ID")
|
||||||
private java.lang.Long enterpriseId;
|
private java.lang.Long enterpriseId;
|
||||||
|
@ApiModelProperty(value = "区域id")
|
||||||
|
private java.lang.Long qualityRegionId;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -5,10 +5,11 @@ import lombok.Data;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class CountTaskProgressVo {
|
public class CountTaskProgressVo {
|
||||||
@ApiModelProperty("工作总数")
|
@ApiModelProperty("项目总进度")
|
||||||
private Integer workCount;
|
private Double projectTotalProgress;
|
||||||
@ApiModelProperty("延迟工作(那按照实际开始时间来算,实际开始时间提前就算提前工作,实际开始时间逾期就算延迟工作)")
|
@ApiModelProperty("项目总天数")
|
||||||
private Integer delayCount;
|
private Integer projectTotalDayNum;
|
||||||
@ApiModelProperty("提前工作(那按照实际开始时间来算,实际开始时间提前就算提前工作,实际开始时间逾期就算延迟工作)")
|
@ApiModelProperty("项目剩余天数")
|
||||||
private Integer aheadCount;
|
private Integer projectSurplusDayNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user