|
|
@ -1,12 +1,19 @@ |
|
|
|
package com.kms.yg.sz.controller; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.kms.common.utils.UserUtils; |
|
|
|
import com.kms.system.domain.SysXzqh; |
|
|
|
import com.kms.system.service.SysDeptService; |
|
|
|
import com.kms.system.service.SysXzqhService; |
|
|
|
import com.kms.yg.sz.domain.BsSgcSzSafeJbxx; |
|
|
|
import com.shuili.common.core.controller.BaseController; |
|
|
|
import com.shuili.common.core.domain.SearchParam; |
|
|
|
import com.shuili.common.core.domain.entity.SysDept; |
|
|
|
import com.shuili.common.core.domain.entity.SysUser; |
|
|
|
import com.shuili.common.utils.poi.ExcelUtil; |
|
|
|
import com.kms.common.utils.BaseEntityUtils; |
|
|
|
|
|
|
@ -60,7 +67,68 @@ public class BsSgcSzAqrwController extends BaseController |
|
|
|
@ApiOperation("水闸安全鉴定任务信息列表") |
|
|
|
public IPage list(@RequestBody SearchParam<BsSgcSzAqrw> sp) |
|
|
|
{ |
|
|
|
return bsSgcSzAqrwService.selectPage(sp); |
|
|
|
BsSgcSzAqrw projectInfo = sp.getData(); |
|
|
|
String adcd = null; |
|
|
|
if (projectInfo != null) { |
|
|
|
adcd = projectInfo.getAdcd(); |
|
|
|
} |
|
|
|
|
|
|
|
SysUser sysUser = UserUtils.getUser(); |
|
|
|
if (sysUser.getUserName().equals("admin")) { |
|
|
|
if (projectInfo != null && projectInfo.getAdcd() != null) { |
|
|
|
String infoAdcd = projectInfo.getAdcd(); |
|
|
|
QueryWrapper<SysXzqh> sysXzqhQueryWrapper = new QueryWrapper<>(); |
|
|
|
sysXzqhQueryWrapper.eq("XZQHDM", infoAdcd); |
|
|
|
SysXzqh xzqh = sysXzqhService.getOne(sysXzqhQueryWrapper); |
|
|
|
if (xzqh.getLayer().compareTo(BigDecimal.valueOf(1.000000000000000000000000000000)) == 0) { |
|
|
|
infoAdcd = xzqh.getXzqhdm().substring(0, 2); |
|
|
|
|
|
|
|
} else if (xzqh.getLayer().compareTo(BigDecimal.valueOf(2.000000000000000000000000000000)) == 0) { |
|
|
|
infoAdcd = xzqh.getXzqhdm().substring(0, 4); |
|
|
|
|
|
|
|
}else { |
|
|
|
infoAdcd = xzqh.getXzqhdm(); |
|
|
|
} |
|
|
|
return bsSgcSzAqrwService.selectPage(sp,infoAdcd); |
|
|
|
}else { |
|
|
|
return bsSgcSzAqrwService.selectPage(sp,null); |
|
|
|
} |
|
|
|
|
|
|
|
}else if (adcd == null) { |
|
|
|
SysUser user = UserUtils.getUser(); |
|
|
|
String deptId = user.getDeptId(); |
|
|
|
SysDept sysDept = sysDeptService.get(deptId); |
|
|
|
String xzqhId = sysDept.getXzqhId(); |
|
|
|
SysXzqh xzqh = sysXzqhService.getById(xzqhId); |
|
|
|
String substring = ""; |
|
|
|
if (xzqh.getLayer().compareTo(BigDecimal.valueOf(1.000000000000000000000000000000)) == 0) { |
|
|
|
substring = xzqh.getXzqhdm().substring(0, 2); |
|
|
|
|
|
|
|
} else if (xzqh.getLayer().compareTo(BigDecimal.valueOf(2.000000000000000000000000000000)) == 0) { |
|
|
|
substring = xzqh.getXzqhdm().substring(0, 4); |
|
|
|
|
|
|
|
}else { |
|
|
|
substring = xzqh.getXzqhdm(); |
|
|
|
} |
|
|
|
|
|
|
|
return bsSgcSzAqrwService.selectPage(sp,substring); |
|
|
|
}else { |
|
|
|
|
|
|
|
QueryWrapper<SysXzqh> sysXzqhQueryWrapper = new QueryWrapper<>(); |
|
|
|
sysXzqhQueryWrapper.eq("XZQHDM", adcd); |
|
|
|
|
|
|
|
SysXzqh xzqh = sysXzqhService.getOne(sysXzqhQueryWrapper); |
|
|
|
if (xzqh.getLayer().compareTo(BigDecimal.valueOf(1.000000000000000000000000000000)) == 0) { |
|
|
|
adcd = xzqh.getXzqhdm().substring(0, 2); |
|
|
|
|
|
|
|
} else if (xzqh.getLayer().compareTo(BigDecimal.valueOf(2.000000000000000000000000000000)) == 0) { |
|
|
|
adcd = xzqh.getXzqhdm().substring(0, 4); |
|
|
|
|
|
|
|
}else { |
|
|
|
adcd = xzqh.getXzqhdm(); |
|
|
|
} |
|
|
|
return bsSgcSzAqrwService.selectPage(sp, adcd); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|