危大bug修改

This commit is contained in:
guoshengxiong 2024-05-12 00:50:52 +08:00
parent 6a9a17942b
commit 34dbf92d8f
9 changed files with 31 additions and 12 deletions

View File

@ -142,6 +142,7 @@ public class SystemUserController {
@ApiOperation(value = "根据企业或项目SN查找账号列表", notes = "根据企业或项目SN查找账号列表", httpMethod = "POST") @ApiOperation(value = "根据企业或项目SN查找账号列表", notes = "根据企业或项目SN查找账号列表", httpMethod = "POST")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "sn", required = true, value = "企业或项目SN", paramType = "body"), @ApiImplicitParam(name = "sn", required = true, value = "企业或项目SN", paramType = "body"),
@ApiImplicitParam(name = "type", required = true, value = "1=默认2查询项目账号和新用户", paramType = "body"),
}) })
@PostMapping(value = "/getSystemUserBySn") @PostMapping(value = "/getSystemUserBySn")
public Result<List<SystemUser>> getSystemUserBySn(@RequestBody Map<String, Object> map) { public Result<List<SystemUser>> getSystemUserBySn(@RequestBody Map<String, Object> map) {

View File

@ -30,7 +30,7 @@ import java.util.Set;
@Mapper @Mapper
public interface SystemUserMapper extends BaseMapper<SystemUser> { public interface SystemUserMapper extends BaseMapper<SystemUser> {
List<SystemUser> getSystemUserBySn(@Param("p") Map<String, Object> map); List<SystemUser> getSystemUserBySn(@Param("param") Map<String, Object> map);
SystemUser findByUsername(@Param("account") String account); SystemUser findByUsername(@Param("account") String account);

View File

@ -5,8 +5,17 @@
SELECT a.*, jb.job_name SELECT a.*, jb.job_name
from system_user a from system_user a
LEFT JOIN organization_job jb ON a.job_id = jb.id LEFT JOIN organization_job jb ON a.job_id = jb.id
WHERE a.sn = #{p.sn} WHERE a.sn = #{param.sn}
and a.account_type in (1, 2, 3, 4, 5, 7) <if test="param.type == '1'.toString()">
and a.account_type in (1, 2, 3, 4, 5, 7)
</if>
<if test="param.type == '2'.toString()">
and a.account_type in (5)
</if>
<if test="param.type == '3'.toString()">
and ( a.account_type = 5 or ( a.account_type = 10 and a.user_id in (select distinct t.user_id from
xz_system_user_to_company_project t where a.user_id = t.user_id and t.type = 2 and t.sn = #{param.sn})))
</if>
</select> </select>
<select id="getProjectChilderSystemUserList" resultType="com.zhgd.xmgl.modules.basicdata.entity.SystemUser" <select id="getProjectChilderSystemUserList" resultType="com.zhgd.xmgl.modules.basicdata.entity.SystemUser"
parameterType="map"> parameterType="map">

View File

@ -28,6 +28,12 @@ public interface ISystemUserService extends IService<SystemUser> {
void updateUserPassWord(Map<String, Object> map); void updateUserPassWord(Map<String, Object> map);
/**
* 根据企业或项目SN查找账号列表
*
* @param map
* @return
*/
List<SystemUser> getSystemUserBySn(Map<String, Object> map); List<SystemUser> getSystemUserBySn(Map<String, Object> map);
Long saveSystemUser(SystemUser systemUser); Long saveSystemUser(SystemUser systemUser);

View File

@ -198,6 +198,7 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
map.put("companyType", "4"); map.put("companyType", "4");
List<EntityMap> list = companyMapper.getChildCompanyList(map); List<EntityMap> list = companyMapper.getChildCompanyList(map);
List<EntityMap> projectList = projectMapper.getProjectListBySn(map); List<EntityMap> projectList = projectMapper.getProjectListBySn(map);
map.put("type", 1);
List<SystemUser> sysList1 = systemUserMapper.getSystemUserBySn(map); List<SystemUser> sysList1 = systemUserMapper.getSystemUserBySn(map);
List<SystemUser> sysList2 = systemUserMapper.getChildComapnySystemUserList(map); List<SystemUser> sysList2 = systemUserMapper.getChildComapnySystemUserList(map);
List<SystemUser> sysList3 = systemUserMapper.getChildComapnyProjectSystemUserList(map); List<SystemUser> sysList3 = systemUserMapper.getChildComapnyProjectSystemUserList(map);

View File

@ -785,6 +785,7 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
@Override @Override
public List<SystemUser> getSystemUserBySn(Map<String, Object> map) { public List<SystemUser> getSystemUserBySn(Map<String, Object> map) {
map.put("type", 1);
return systemUserMapper.getSystemUserBySn(map); return systemUserMapper.getSystemUserBySn(map);
} }

View File

@ -10,9 +10,9 @@
a.plan_start_time!='' a.plan_start_time!=''
and a.plan_end_time >=DATE_FORMAT(now(),"%Y-%m-%d") and a.plan_start_time &lt;=DATE_FORMAT(now(),"%Y-%m-%d") and a.plan_end_time >=DATE_FORMAT(now(),"%Y-%m-%d") and a.plan_start_time &lt;=DATE_FORMAT(now(),"%Y-%m-%d")
then 2 then 2
else 1 END) engineering_state, else 1 END) as engineering_state,
if(a.final_acceptance_status=1 and now()>=if(LENGTH(a.plan_end_time) = 10, CONCAT(DATE_FORMAT(a.plan_end_time, if(a.final_acceptance_status=1 and now() >= if(LENGTH(a.plan_end_time) = 10, CONCAT(DATE_FORMAT(a.plan_end_time,
'%Y-%m-%d'), ' 23:59:59'), a.plan_end_time),1,0) isOverdue '%Y-%m-%d'), ' 23:59:59'), a.plan_end_time),1,0) as isOverdue
from dangerous_engineering_record a from dangerous_engineering_record a
LEFT JOIN (SELECT engineering_id,COUNT(1) hidden_danger_num LEFT JOIN (SELECT engineering_id,COUNT(1) hidden_danger_num
from xz_security_quality_inspection_record from xz_security_quality_inspection_record

View File

@ -593,11 +593,11 @@
rectifiedNumRatioTimely rectifiedNumRatioTimely
from (SELECT count(*) totalNum, from (SELECT count(*) totalNum,
IFNULL(SUM((CASE WHEN hdir.status != 2 THEN 1 ELSE 0 END)), 0) rectifiedNum, IFNULL(SUM((CASE WHEN hdir.status != 2 THEN 1 ELSE 0 END)), 0) rectifiedNum,
IFNULL(SUM((CASE WHEN hdir.status != 2 and change_limit_time &lt; now() THEN 1 ELSE 0 END)), 0)
rectifiedNumTimely,
IFNULL(SUM((CASE WHEN hdir.status != 2 and change_limit_time > now() THEN 1 ELSE 0 END)), 0) IFNULL(SUM((CASE WHEN hdir.status != 2 and change_limit_time > now() THEN 1 ELSE 0 END)), 0)
rectifiedNumTimely,
IFNULL(SUM((CASE WHEN hdir.status != 2 and change_limit_time &lt; now() THEN 1 ELSE 0 END)), 0)
overTimeRectifiedNum, overTimeRectifiedNum,
IFNULL(SUM((CASE WHEN hdir.status = 2 and change_limit_time > now() THEN 1 ELSE 0 END)), 0) IFNULL(SUM((CASE WHEN hdir.status = 2 and change_limit_time &lt; now() THEN 1 ELSE 0 END)), 0)
overTimeNotRectifiedNum, overTimeNotRectifiedNum,
su.real_name as workerName su.real_name as workerName
from xz_security_quality_inspection_record hdir from xz_security_quality_inspection_record hdir
@ -637,11 +637,11 @@
from (SELECT count(*) totalNum, from (SELECT count(*) totalNum,
count(*) createDangerNum, count(*) createDangerNum,
IFNULL(SUM((CASE WHEN hdir.status != 2 THEN 1 ELSE 0 END)), 0) rectifiedNum, IFNULL(SUM((CASE WHEN hdir.status != 2 THEN 1 ELSE 0 END)), 0) rectifiedNum,
IFNULL(SUM((CASE WHEN hdir.status != 2 and change_limit_time &lt; now() THEN 1 ELSE 0 END)), 0) IFNULL(SUM((CASE WHEN hdir.status != 2 and change_limit_time > now() THEN 1 ELSE 0 END)), 0)
rectifiedNumTimely, rectifiedNumTimely,
su.real_name as workerName su.real_name as workerName
from xz_security_quality_inspection_record hdir from xz_security_quality_inspection_record hdir
left join system_user su on su.user_id = hdir.change_id left join system_user su on su.user_id = hdir.inspect_man_id
WHERE record_type = 1 WHERE record_type = 1
and hdir.status != 6 and hdir.status != 6
and project_sn = #{param.projectSn} and project_sn = #{param.projectSn}
@ -665,7 +665,7 @@
rectifiedNumRatioTimely rectifiedNumRatioTimely
from (SELECT count(*) totalNum, from (SELECT count(*) totalNum,
IFNULL(SUM((CASE WHEN t.status != 2 THEN 1 ELSE 0 END)), 0) rectifiedNum, IFNULL(SUM((CASE WHEN t.status != 2 THEN 1 ELSE 0 END)), 0) rectifiedNum,
IFNULL(SUM((CASE WHEN t.status != 2 and change_limit_time &lt; now() THEN 1 ELSE 0 END)), 0) IFNULL(SUM((CASE WHEN t.status != 2 and change_limit_time > now() THEN 1 ELSE 0 END)), 0)
rectifiedNumTimely, rectifiedNumTimely,
ei.enterprise_name ei.enterprise_name
from xz_security_quality_inspection_record t from xz_security_quality_inspection_record t

View File

@ -94,6 +94,7 @@ public class XzDangerousEngineeringAcceptanceServiceImpl extends ServiceImpl<XzD
xzDangerousEngineeringAcceptance.setApplyAcceptanceUserId(userId); xzDangerousEngineeringAcceptance.setApplyAcceptanceUserId(userId);
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("userId", userId); map.put("userId", userId);
map.put("projectSn", xzDangerousEngineeringAcceptance.getProjectSn());
List<SystemUser> userList = systemUserService.getProjectChilderSystemUserList(map); List<SystemUser> userList = systemUserService.getProjectChilderSystemUserList(map);
if (CollUtil.isNotEmpty(userList)) { if (CollUtil.isNotEmpty(userList)) {
xzDangerousEngineeringAcceptance.setApplyAcceptanceUnitId(userList.get(0).getEnterpriseId()); xzDangerousEngineeringAcceptance.setApplyAcceptanceUnitId(userList.get(0).getEnterpriseId());