bug修改

This commit is contained in:
guoshengxiong 2024-04-23 00:06:32 +08:00
parent 4b1293b58e
commit a8fe40f59b
25 changed files with 250 additions and 130 deletions

View File

@ -163,6 +163,8 @@ public class SystemUserController {
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", required = true, value = "项目SN", paramType = "body"),
@ApiImplicitParam(name = "workerName", required = false, value = "姓名", paramType = "body"),
@ApiImplicitParam(name = "workerId", required = false, value = "劳务人员id", paramType = "body"),
@ApiImplicitParam(name = "enterpriseId", required = false, value = "企业id", paramType = "body"),
})
@PostMapping(value = "/getProjectChilderSystemUserList")
public Result<List<SystemUser>> getProjectChilderSystemUserList(@RequestBody Map<String, Object> map) {

View File

@ -25,7 +25,7 @@ import io.swagger.annotations.ApiModelProperty;
public class BaseAction implements Serializable {
private static final long serialVersionUID = 1L;
/**资源ID*/
/**资源ID*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value="资源ID")
private java.lang.Long actionId ;
@ -43,7 +43,6 @@ public class BaseAction implements Serializable {
private java.lang.String actionDesc ;
/**资源父节点(所属菜单)*/
@Excel(name = "资源父节点(所属菜单)", width = 15)
@ApiModelProperty(value="资源父节点(所属菜单)")
private java.lang.Long menuId ;
/**优先级 越小越靠前*/

View File

@ -20,6 +20,12 @@
<if test="workerName != null and workerName != ''">
and d.worker_name like CONCAT(CONCAT('%', #{workerName}), '%')
</if>
<if test="workerId != null and workerId != ''">
and d.id = #{workerId}
</if>
<if test="enterpriseId != null and enterpriseId != ''">
and d.enterprise_id = #{enterpriseId}
</if>
</select>
<select id="findByUsername" resultType="com.zhgd.xmgl.modules.basicdata.entity.SystemUser" parameterType="string">
select *

View File

@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.Map;
@ -105,5 +106,4 @@ public class DangerousEngineeringControlItemController {
}
}

View File

@ -20,6 +20,7 @@ import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
/**
@ -76,19 +77,8 @@ public class DangerousEngineeringRecordController {
@ApiOperation(value = "编辑现场危大工程信息", notes = "编辑现场危大工程信息" , httpMethod="POST")
@PostMapping(value = "/edit")
public Result<DangerousEngineeringRecord> edit(@RequestBody DangerousEngineeringRecord dangerousEngineeringRecord) {
Result<DangerousEngineeringRecord> result = new Result<DangerousEngineeringRecord>();
DangerousEngineeringRecord dangerousEngineeringRecordEntity = dangerousEngineeringRecordService.getById(dangerousEngineeringRecord.getId());
if(dangerousEngineeringRecordEntity==null) {
result.error500(MessageUtil.get("notFindErr"));
}else {
boolean ok = dangerousEngineeringRecordService.updateById(dangerousEngineeringRecord);
if(ok) {
result.successMsg(MessageUtil.get("editSucess"));
}
}
return result;
dangerousEngineeringRecordService.edit(dangerousEngineeringRecord);
return Result.ok();
}
/**
@ -119,13 +109,23 @@ public class DangerousEngineeringRecordController {
* @param
* @return
*/
@ApiOperation(value = "通过id查询现场危大工程信息", notes = "通过id查询现场危大工程信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "现场危大工程ID", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/queryById")
public Result<EntityMap> getDangerousEngineeringById(@RequestBody Map<String,Object> map) {
@ApiOperation(value = "通过id查询现场危大工程信息", notes = "通过id查询现场危大工程信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "现场危大工程ID", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/queryById")
public Result<EntityMap> getDangerousEngineeringById(@RequestBody Map<String, Object> map) {
return Result.success(dangerousEngineeringRecordService.getDangerousEngineeringById(map));
}
@ApiOperation(value = "结束危大工程", notes = "结束危大工程", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "现场危大工程ID", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/endEngineer")
public Result endEngineer(@ApiIgnore @RequestBody Map<String, Object> paramMap) {
dangerousEngineeringRecordService.endEngineer(paramMap);
return Result.ok();
}
}

View File

@ -30,11 +30,9 @@ public class DangerousEngineeringControlItem implements Serializable {
/**危大工程ID*/
@Excel(name = "危大工程ID", width = 15)
@ApiModelProperty(value="危大工程ID")
private java.lang.Long engineeringId ;
/**管控要点ID*/
@Excel(name = "管控要点ID", width = 15)
@ApiModelProperty(value="管控要点ID")
private java.lang.Long controlId ;
/**管控要点分类*/

View File

@ -115,19 +115,26 @@ public class DangerousEngineeringRecord implements Serializable {
private java.lang.Integer securityConstructionSchemeType ;
/**安全专项施工方案附件*/
@Excel(name = "安全专项施工方案附件", width = 15)
@ApiModelProperty(value="安全专项施工方案附件")
private java.lang.String securityConstructionSchemeFile ;
/**是否完成专项施工方案交底1未完成2完成*/
@ApiModelProperty(value = "安全专项施工方案附件")
private java.lang.String securityConstructionSchemeFile;
/**
* 是否完成专项施工方案交底1未完成2完成
*/
@Excel(name = "是否完成专项施工方案交底1未完成2完成", width = 15)
@ApiModelProperty(value="是否完成专项施工方案交底1未完成2完成")
private java.lang.Integer specialConstructionSchemeType ;
/**专项施工方案附件*/
@ApiModelProperty(value = "是否完成专项施工方案交底1未完成2完成")
private java.lang.Integer specialConstructionSchemeType;
/**
* 专项施工方案附件
*/
@Excel(name = "专项施工方案附件", width = 15)
@ApiModelProperty(value="专项施工方案附件")
private java.lang.String specialConstructionSchemeFile ;
@TableField(exist = false)
@ApiModelProperty(value="类别描述列表")
@ApiModelProperty(value = "专项施工方案附件")
private java.lang.String specialConstructionSchemeFile;
@ApiModelProperty(value = "责任人id")
private java.lang.Long personLiableId;
@ApiModelProperty(value = "已结束1是0否")
private java.lang.Integer isEnd;
@TableField(exist = false)
@ApiModelProperty(value = "类别描述列表")
private List<DangerousEngineeringChooseTypeDescribe> typeDescribeList;
@TableField(exist = false)

View File

@ -24,14 +24,13 @@ import io.swagger.annotations.ApiModelProperty;
public class DangerousEngineeringTypeControlContent implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value="id")
private java.lang.Long id ;
/**分类ID*/
@Excel(name = "分类ID", width = 15)
@ApiModelProperty(value="分类ID")
private java.lang.Long typeId ;
/**管控要的分类*/
@ -57,6 +56,5 @@ public class DangerousEngineeringTypeControlContent implements Serializable {
@TableField(exist = false)
@ApiModelProperty(value="分类描述ID")
private java.lang.Long describeId ;
}

View File

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 危大工程类别描述
* @author pds
* @date 2021-06-28
* @date 2021-06-28
* @version V1.0
*/
@Mapper
@ -19,4 +19,6 @@ public interface DangerousEngineeringTypeDescribeMapper extends BaseMapper<Dange
List<DangerousEngineeringTypeDescribe> selectTypeDescribeList(Map<String, Object> map);
List<DangerousEngineeringTypeDescribe> selectTypeDescribeListByTypeId(Map<String, Object> map);
Boolean isSuperDangerByEngineeringId(String id);
}

View File

@ -7,6 +7,5 @@
select *
from dangerous_engineering_choose_type_describe
where engineering_id=#{engineeringId}
</select>
</mapper>

View File

@ -7,16 +7,19 @@
(case when a.build_end_time is not null and a.build_end_time!='' and a.build_end_time &lt;DATE_FORMAT(now(),"%Y-%m-%d") then 3
when a.build_end_time is not null and a.build_end_time!='' and a.build_start_time is not null and a.build_start_time!=''
and a.build_end_time >=DATE_FORMAT(now(),"%Y-%m-%d") and a.build_start_time &lt;=DATE_FORMAT(now(),"%Y-%m-%d") then 2
else 1 END) engineering_state
else 1 END) engineering_state
from dangerous_engineering_record a
LEFT JOIN (SELECT engineering_id,COUNT(1) hidden_danger_num
from hidden_danger_inspection_record
WHERE project_sn=#{param.projectSn} AND `status` in (2,3) AND engineering_id is not NULL
GROUP BY engineering_id) tp ON a.id=tp.engineering_id
WHERE a.project_sn=#{param.projectSn}
<if test="param.engineeringName!=null and param.engineeringName!=''">
<if test="param.engineeringName != null and param.engineeringName != ''">
and a.engineering_name like CONCAT(CONCAT('%',#{param.engineeringName}),'%')
</if>
<if test="param.personLiableId != null and param.personLiableId != ''">
and a.person_liable_id = #{param.personLiableId}
</if>
order by a.create_time desc
</select>
<select id="getDangerousEngineeringById" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">

View File

@ -38,6 +38,5 @@
SELECT b.*
from dangerous_engineering_type_describe_control a INNER JOIN dangerous_engineering_type_control_content b ON a.control_id=b.id
WHERE a.describe_id=#{describeId}
</select>
</mapper>

View File

@ -9,10 +9,18 @@
ORDER BY a.type_id
</select>
<select id="selectTypeDescribeListByTypeId" resultType="com.zhgd.xmgl.modules.dangerous.entity.DangerousEngineeringTypeDescribe">
<select id="selectTypeDescribeListByTypeId"
resultType="com.zhgd.xmgl.modules.dangerous.entity.DangerousEngineeringTypeDescribe">
SELECT a.id,a.describe_name,a.type_id,a.danger_type,b.type_name
from dangerous_engineering_type_describe a INNER JOIN dangerous_engineering_type b ON a.type_id=b.id
WHERE a.type_id=#{typeId}
ORDER BY a.type_id
</select>
<select id="isSuperDangerByEngineeringId" resultType="java.lang.Boolean">
SELECT ifnull(if(sum(if(a.danger_type=2,1,0))>0,1,0),0)
from dangerous_engineering_type_describe a INNER JOIN dangerous_engineering_choose_type_describe b ON
a.id=b.describe_id
where b.engineering_id=#{engineeringId}
</select>
</mapper>

View File

@ -21,4 +21,7 @@ public interface IDangerousEngineeringRecordService extends IService<DangerousEn
void saveDangerousEngineeringRecord(DangerousEngineeringRecord dangerousEngineeringRecord);
void edit(DangerousEngineeringRecord dangerousEngineeringRecord);
void endEngineer(Map<String, Object> paramMap);
}

View File

@ -1,21 +1,23 @@
package com.zhgd.xmgl.modules.dangerous.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.basicdata.service.impl.SystemUserServiceImpl;
import com.zhgd.xmgl.modules.dangerous.entity.*;
import com.zhgd.xmgl.modules.dangerous.mapper.DangerousEngineeringChooseTypeDescribeMapper;
import com.zhgd.xmgl.modules.dangerous.mapper.DangerousEngineeringProgressRecordMapper;
import com.zhgd.xmgl.modules.dangerous.mapper.DangerousEngineeringRecordMapper;
import com.zhgd.xmgl.modules.dangerous.mapper.DangerousEngineeringTypeControlContentMapper;
import com.zhgd.xmgl.modules.dangerous.mapper.*;
import com.zhgd.xmgl.modules.dangerous.service.IDangerousEngineeringControlItemService;
import com.zhgd.xmgl.modules.dangerous.service.IDangerousEngineeringRecordService;
import com.zhgd.xmgl.modules.worker.mapper.EnterpriseInfoMapper;
import com.zhgd.xmgl.security.util.SecurityUtils;
import com.zhgd.xmgl.util.MessageUtil;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
@ -23,12 +25,14 @@ import java.util.*;
/**
* @Description: 现场危大工程
* @author pds
* @date 2021-06-28
* @date 2021-06-28
* @version V1.0
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class DangerousEngineeringRecordServiceImpl extends ServiceImpl<DangerousEngineeringRecordMapper, DangerousEngineeringRecord> implements IDangerousEngineeringRecordService {
@Autowired
private DangerousEngineeringAcceptanceCheckMapper dangerousEngineeringAcceptanceCheckMapper;
@Autowired
private DangerousEngineeringRecordMapper dangerousEngineeringRecordMapper;
@Autowired
@ -41,35 +45,33 @@ public class DangerousEngineeringRecordServiceImpl extends ServiceImpl<Dangerous
private IDangerousEngineeringControlItemService dangerousEngineeringControlItemService;
@Autowired
private DangerousEngineeringProgressRecordMapper dangerousEngineeringProgressRecordMapper;
@Autowired
private SystemUserServiceImpl systemUserService;
@Autowired
private DangerousEngineeringTypeDescribeMapper dangerousEngineeringTypeDescribeMapper;
@Autowired
private DangerousEngineeringControlItemMapper dangerousEngineeringControlItemMapper;
@Override
public IPage<EntityMap> queryDangerousEngineeringPageList(Map<String, Object> map) {
int pageNo = Integer.parseInt(map.getOrDefault("pageNo", 1).toString());
int pageSize = Integer.parseInt(map.getOrDefault("pageSize", 10).toString());
Page<EntityMap> page = new Page<>(pageNo, pageSize);
List<EntityMap> list=dangerousEngineeringRecordMapper.queryDangerousEngineeringPageList(page, map);
if(list.size()>0){
for(EntityMap data:list){
/*String responsibilityCompany= MapUtils.getString(data,"responsibilityCompany");
StringBuilder stringBuilder=new StringBuilder();
if(StringUtils.isNotEmpty(responsibilityCompany)){
for (String enterpriseId:responsibilityCompany.split(",")){
EnterpriseInfo info=enterpriseInfoMapper.selectById(enterpriseId);
if(info!=null) {
if (stringBuilder.length() > 0) {
stringBuilder.append(",");
}
stringBuilder.append(info.getEnterpriseName());
}
}
}
data.put("responsibility_company_name",stringBuilder.toString());*/
List<DangerousEngineeringChooseTypeDescribe> chooseTypeDescribeList=dangerousEngineeringChooseTypeDescribeMapper.getChooseTypeDescribeList(MapUtils.getString(data,"id"));
data.put("choose_type_describe_list",chooseTypeDescribeList);
Map<String, Object> count=dangerousEngineeringControlItemService.selectEngineeringControlItemCount(MapUtils.getString(data,"id"));
data.put("control_item_count",count);
DangerousEngineeringProgressRecord progressRecord=dangerousEngineeringProgressRecordMapper.selectNewestEngineeringProgressRecord(MapUtils.getString(data,"id"));
data.put("progressRecord",progressRecord);
if (systemUserService.isSubProject()) {
map.put("personLiableId", SecurityUtils.getUser().getUserId());
}
List<EntityMap> list = dangerousEngineeringRecordMapper.queryDangerousEngineeringPageList(page, map);
if (list.size() > 0) {
for (EntityMap data : list) {
String id = MapUtils.getString(data, "id");
List<DangerousEngineeringChooseTypeDescribe> chooseTypeDescribeList = dangerousEngineeringChooseTypeDescribeMapper.getChooseTypeDescribeList(id);
data.put("choose_type_describe_list", chooseTypeDescribeList);
Map<String, Object> count = dangerousEngineeringControlItemService.selectEngineeringControlItemCount(id);
data.put("control_item_count", count);
DangerousEngineeringProgressRecord progressRecord = dangerousEngineeringProgressRecordMapper.selectNewestEngineeringProgressRecord(id);
data.put("progressRecord", progressRecord);
Boolean isSuperDanger = dangerousEngineeringTypeDescribeMapper.isSuperDangerByEngineeringId(id);
data.put("isSuperDanger", isSuperDanger);
}
}
return page.setRecords(list);
@ -77,24 +79,10 @@ public class DangerousEngineeringRecordServiceImpl extends ServiceImpl<Dangerous
@Override
public EntityMap getDangerousEngineeringById(Map<String, Object> map) {
EntityMap data=dangerousEngineeringRecordMapper.getDangerousEngineeringById(map);
if (data!=null){
/*String responsibilityCompany= MapUtils.getString(data,"responsibilityCompany");
StringBuilder stringBuilder=new StringBuilder();
if(StringUtils.isNotEmpty(responsibilityCompany)){
for (String enterpriseId:responsibilityCompany.split(",")){
EnterpriseInfo info=enterpriseInfoMapper.selectById(enterpriseId);
if(info!=null) {
if (stringBuilder.length() > 0) {
stringBuilder.append(",");
}
stringBuilder.append(info.getEnterpriseName());
}
}
}
data.put("responsibility_company_name",stringBuilder.toString());*/
List<DangerousEngineeringChooseTypeDescribe> chooseTypeDescribeList=dangerousEngineeringChooseTypeDescribeMapper.getChooseTypeDescribeList(MapUtils.getString(data,"id"));
data.put("choose_type_describe_list",chooseTypeDescribeList);
EntityMap data = dangerousEngineeringRecordMapper.getDangerousEngineeringById(map);
if (data != null) {
List<DangerousEngineeringChooseTypeDescribe> chooseTypeDescribeList = dangerousEngineeringChooseTypeDescribeMapper.getChooseTypeDescribeList(MapUtils.getString(data, "id"));
data.put("choose_type_describe_list", chooseTypeDescribeList);
}
return data;
}
@ -103,21 +91,31 @@ public class DangerousEngineeringRecordServiceImpl extends ServiceImpl<Dangerous
public void saveDangerousEngineeringRecord(DangerousEngineeringRecord dangerousEngineeringRecord) {
dangerousEngineeringRecord.setCreateTime(new Date());
dangerousEngineeringRecordMapper.insert(dangerousEngineeringRecord);
if(dangerousEngineeringRecord.getTypeDescribeList()!=null&&dangerousEngineeringRecord.getTypeDescribeList().size()>0){
for (DangerousEngineeringChooseTypeDescribe typeDescribe:dangerousEngineeringRecord.getTypeDescribeList()){
typeDescribe.setEngineeringId(dangerousEngineeringRecord.getId());
replaceTypeDescribeAndControllerContent(dangerousEngineeringRecord);
}
private void replaceTypeDescribeAndControllerContent(DangerousEngineeringRecord dangerousEngineeringRecord) {
Long id = dangerousEngineeringRecord.getId();
dangerousEngineeringChooseTypeDescribeMapper.delete(new LambdaQueryWrapper<DangerousEngineeringChooseTypeDescribe>()
.eq(DangerousEngineeringChooseTypeDescribe::getEngineeringId, id)
);
if (dangerousEngineeringRecord.getTypeDescribeList() != null && dangerousEngineeringRecord.getTypeDescribeList().size() > 0) {
for (DangerousEngineeringChooseTypeDescribe typeDescribe : dangerousEngineeringRecord.getTypeDescribeList()) {
typeDescribe.setEngineeringId(id);
dangerousEngineeringChooseTypeDescribeMapper.insert(typeDescribe);
}
}
dangerousEngineeringControlItemMapper.delete(new LambdaQueryWrapper<DangerousEngineeringControlItem>()
.eq(DangerousEngineeringControlItem::getEngineeringId, id));
//保存管控要点
if(dangerousEngineeringRecord.getControlItemList()!=null&&dangerousEngineeringRecord.getControlItemList().size()>0){
Map<String,Object> param=new HashMap<>();
param.put("list",dangerousEngineeringRecord.getControlItemList());
List<DangerousEngineeringTypeControlContent> list=dangerousEngineeringTypeControlContentMapper.selectUserCheckControlContentList(param);
List<DangerousEngineeringControlItem> itemList=new ArrayList<>();
for (DangerousEngineeringTypeControlContent content:list){
DangerousEngineeringControlItem item=new DangerousEngineeringControlItem();
item.setEngineeringId(dangerousEngineeringRecord.getId());
if (dangerousEngineeringRecord.getControlItemList() != null && dangerousEngineeringRecord.getControlItemList().size() > 0) {
Map<String, Object> param = new HashMap<>();
param.put("list", dangerousEngineeringRecord.getControlItemList());
List<DangerousEngineeringTypeControlContent> list = dangerousEngineeringTypeControlContentMapper.selectUserCheckControlContentList(param);
List<DangerousEngineeringControlItem> itemList = new ArrayList<>();
for (DangerousEngineeringTypeControlContent content : list) {
DangerousEngineeringControlItem item = new DangerousEngineeringControlItem();
item.setEngineeringId(id);
item.setControlTypeName(content.getControlTypeName());
item.setControlContent(content.getControlContent());
item.setControlId(content.getId());
@ -128,4 +126,38 @@ public class DangerousEngineeringRecordServiceImpl extends ServiceImpl<Dangerous
dangerousEngineeringControlItemService.saveBatch(itemList);
}
}
@Override
public void edit(DangerousEngineeringRecord dangerousEngineeringRecord) {
Long id = dangerousEngineeringRecord.getId();
DangerousEngineeringRecord dangerousEngineeringRecordEntity = getById(id);
if (dangerousEngineeringRecordEntity == null) {
throw new OpenAlertException(MessageUtil.get("notFindErr"));
}
updateById(dangerousEngineeringRecord);
replaceTypeDescribeAndControllerContent(dangerousEngineeringRecord);
}
@Override
public void endEngineer(Map<String, Object> paramMap) {
Long id = MapUtils.getLong(paramMap, "id");
paramMap.put("engineeringId", id);
EntityMap data = dangerousEngineeringRecordMapper.getDangerousEngineeringById(paramMap);
Integer hiddenDangerNum = MapUtils.getInteger(data, "hiddenDangerNum");
if (hiddenDangerNum > 0) {
throw new OpenAlertException("当前存在未销隐患");
}
List<EntityMap> list = dangerousEngineeringAcceptanceCheckMapper.selectAcceptanceCheckList(paramMap);
if (CollUtil.isNotEmpty(list)) {
EntityMap entityMap = list.get(list.size() - 1);
Integer acceptanceResult = MapUtils.getInteger(entityMap, "acceptanceResult");
if (!Objects.equals(acceptanceResult, 1)) {
throw new OpenAlertException("当前验收未合格");
}
}
DangerousEngineeringRecord record = new DangerousEngineeringRecord();
record.setId(id);
record.setIsEnd(1);
baseMapper.updateById(record);
}
}

View File

@ -42,7 +42,7 @@ public interface EnterpriseInfoMapper extends BaseMapper<EnterpriseInfo> {
IPage<EntityMap> getXzSupplierPage(@Param("map") Map<String, Object> map, @Param("page") Page<EnterpriseInfo> qp);
EnterpriseInfo getXzSupplierByUserId(Map<String, Object> map);
EnterpriseInfo getXzSupplierByUserId(Long userId);
EnterpriseInfo getXzSupplierBySocialCode(Map<String, Object> map);

View File

@ -428,6 +428,10 @@
#{item}
</foreach>
</if>
<if test="supplierEnterpriseId != null and supplierEnterpriseId != ''">
AND (w1.enterprise_id = #{supplierEnterpriseId} OR w1.enterprise_id IN ( SELECT t.enterprise_id FROM
project_enterprise t WHERE find_in_set(#{projectEnterpriseId}, ancestors) ))
</if>
</where>
</select>
<select id="selectPresenceWorkerPersonTypeTotal" resultType="java.util.Map" parameterType="java.util.Map">
@ -440,8 +444,12 @@
INNER JOIN worker_attendance_presence p ON w1.person_sn = p.person_sn
Left JOIN team_info g ON (w1.project_sn = g.project_sn and w1.team_id = g.id)
<where>
<if test="supplierEnterpriseId != null and supplierEnterpriseId != ''">
AND (w1.enterprise_id = #{supplierEnterpriseId} OR w1.enterprise_id IN ( SELECT t.enterprise_id FROM
project_enterprise t WHERE find_in_set(#{projectEnterpriseId}, ancestors) ))
</if>
<if test="projectSn != null and projectSn != ''">
w1.project_sn = #{projectSn}
and w1.project_sn = #{projectSn}
</if>
and w1.inService_type = 1
<!--and p.create_time>=CONCAT(DATE_FORMAT(now(),"%Y-%m-%d"),' 00:00:00')-->
@ -971,6 +979,10 @@
from worker_info w1
INNER JOIN worker_attendance p ON w1.person_sn = p.person_sn
<where>
<if test="supplierEnterpriseId != null and supplierEnterpriseId != ''">
AND (w1.enterprise_id = #{supplierEnterpriseId} OR w1.enterprise_id IN ( SELECT t.enterprise_id FROM
project_enterprise t WHERE find_in_set(#{projectEnterpriseId}, ancestors) ))
</if>
<if test="projectSn != null and projectSn != ''">
and w1.project_sn = #{projectSn}
</if>
@ -1002,6 +1014,10 @@
and w1.inService_type = 1
and p.create_time &lt;= CONCAT(DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -1 DAY), "%Y-%m-%d"), ' 23:59:59')
and p.create_time >= CONCAT(DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -1 DAY), "%Y-%m-%d"), ' 00:00:00')
<if test="supplierEnterpriseId != null and supplierEnterpriseId != ''">
AND (w1.enterprise_id = #{supplierEnterpriseId} OR w1.enterprise_id IN ( SELECT t.enterprise_id FROM
project_enterprise t WHERE find_in_set(#{projectEnterpriseId}, ancestors) ))
</if>
<if test="userEnterpriseId != null and userEnterpriseId != ''">
and FIND_IN_SET(w1.enterprise_id, #{userEnterpriseId})
</if>

View File

@ -172,6 +172,10 @@
INNER JOIN worker_safe_education_worker w2 ON w1.id = w2.edu_id
INNER JOIN worker_info w3 ON w2.worker_id = w3.id
WHERE w3.inService_type = 1
<if test="supplierEnterpriseId != null and supplierEnterpriseId != ''">
AND (w3.enterprise_id = #{supplierEnterpriseId} OR w3.enterprise_id IN ( SELECT t.enterprise_id FROM
project_enterprise t WHERE find_in_set(#{projectEnterpriseId}, ancestors) ))
</if>
<if test="projectSn != null and projectSn != ''">
and w3.project_sn = #{projectSn}
</if>

View File

@ -44,6 +44,7 @@ import com.zhgd.xmgl.modules.worker.entity.vo.*;
import com.zhgd.xmgl.modules.worker.enums.EduTypeEnum;
import com.zhgd.xmgl.modules.worker.mapper.*;
import com.zhgd.xmgl.modules.worker.service.*;
import com.zhgd.xmgl.modules.xz.service.impl.XzSupplierQualificationApplyServiceImpl;
import com.zhgd.xmgl.security.util.SecurityUtils;
import com.zhgd.xmgl.util.*;
import lombok.extern.slf4j.Slf4j;
@ -77,6 +78,9 @@ import java.util.stream.Collectors;
@Slf4j
@Transactional(rollbackFor = Exception.class)
public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerInfo> implements IWorkerInfoService {
@Autowired
private XzSupplierQualificationApplyServiceImpl xzSupplierQualificationApplyService;
@Autowired
private AsyncJiLianDa asyncJiLianDa;
@Autowired
@ -509,6 +513,11 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
public PersonTypeAndEduStatisticsVo selectPersonTypeAndEduStatistics(Map<String, Object> map) {
Map<String, Object> data = new HashMap<>();
Map<String, Object> personType = new HashMap<>();
if (systemUserService.isSupplier()) {
EnterpriseInfo info = xzSupplierQualificationApplyService.getSupplierInfoByUserId(SecurityUtils.getUser().getUserId());
map.put("projectEnterpriseId", info.getProjectEnterpriseId());
map.put("supplierEnterpriseId", info.getId());
}
Map<String, Object> toaltPerson = workerInfoMapper.selectWorkerPersonTypeTotal(map);
Map<String, Object> presencePerson = workerInfoMapper.selectPresenceWorkerPersonTypeTotal(map);
Map<String, Object> attendancePerson = workerInfoMapper.selectAttendanceWorkerPersonTypeTotal(map);
@ -524,6 +533,11 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
@Override
public Map<String, Object> selectWorkerPersonTypeStatistics(Map<String, Object> map) {
if (systemUserService.isSupplier()) {
EnterpriseInfo info = xzSupplierQualificationApplyService.getSupplierInfoByUserId(SecurityUtils.getUser().getUserId());
map.put("projectEnterpriseId", info.getProjectEnterpriseId());
map.put("supplierEnterpriseId", info.getId());
}
Map<String, Object> toaltPerson = workerInfoMapper.selectWorkerPersonTypeTotal(map);
Map<String, Object> presencePerson = workerInfoMapper.selectPresenceWorkerPersonTypeTotal(map);
Map<String, Object> attendancePerson = workerInfoMapper.selectAttendanceWorkerPersonTypeTotal(map);

View File

@ -239,16 +239,6 @@ public class XzTaskProgressController {
return taskProgressService.exportXls(paramMap, request);
}
@ApiOperation(value = "甘特图统计", notes = "甘特图统计", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "enterpriseId", value = "企业id", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/countTaskProgress")
public Result<CountTaskProgressVo> countTaskProgress(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
return Result.success(taskProgressService.countTaskProgress(paramMap));
}
@ApiOperation(value = "状态统计", notes = "状态统计", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
@ -264,4 +254,14 @@ public class XzTaskProgressController {
taskProgressService.updateById(taskProgress);
return Result.ok();
}
@ApiOperation(value = "甘特图统计", notes = "甘特图统计", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "enterpriseId", value = "企业id", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/countTaskProgress")
public Result<CountTaskProgressVo> countTaskProgress(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
return Result.success(taskProgressService.countTaskProgress(paramMap));
}
}

View File

@ -153,10 +153,23 @@
</select>
<select id="getMaxMinProgress" resultType="com.zhgd.xmgl.modules.xz.entity.vo.CountTaskProgressVo">
select *
select ifnull(DATEDIFF(max(p.finish_date), min(p.start_date)),0) projectTotalDayNum,
ifnull(if(max(p.finish_date)>now(),DATEDIFF(max(p.finish_date), now()),0),0) projectSurplusDayNum
from xz_task_progress p
join quality_region qr on qr.id = p.quality_region_id
join project_enterprise pe on pe.enterprise_id = p.enterprise_id
where 1 = 1
join quality_region qr on qr.id = p.quality_region_id
join project_enterprise pe on pe.enterprise_id = p.enterprise_id
where pe.project_sn = #{projectSn}
<if test="qualityRegionId != null and qualityRegionId != ''">
AND (p.quality_region_id = #{qualityRegionId} OR p.quality_region_id IN ( SELECT t.id FROM quality_region t
WHERE find_in_set(#{qualityRegionId}, ancestors) ))
</if>
<if test="enterpriseId != null and enterpriseId != ''">
AND (p.enterprise_id = #{enterpriseId} OR p.enterprise_id IN ( SELECT t.id FROM project_enterprise t WHERE
find_in_set(#{enterpriseId}, ancestors) ))
</if>
<if test="supplierEnterpriseId != null and supplierEnterpriseId != ''">
AND (p.enterprise_id = #{supplierEnterpriseId} OR p.enterprise_id IN ( SELECT t.id FROM project_enterprise t
WHERE find_in_set(#{supplierEnterpriseId}, ancestors) ))
</if>
</select>
</mapper>

View File

@ -172,9 +172,7 @@ public class XzSupplierQualificationApplyServiceImpl extends ServiceImpl<XzSuppl
@Transactional(rollbackFor = Exception.class, propagation = Propagation.NESTED)
public EnterpriseInfo getSupplierInfoByUserId(Long applyUserId) {
Map<String, Object> eiMap = new HashMap<>();
eiMap.put("userId", applyUserId);
EnterpriseInfo ei = enterpriseInfoMapper.getXzSupplierByUserId(eiMap);
EnterpriseInfo ei = enterpriseInfoMapper.getXzSupplierByUserId(applyUserId);
if (ei == null) {
throw new OpenAlertException("请先填写供应商信息");
}

View File

@ -89,7 +89,8 @@ public class XzSupplierServiceImpl extends ServiceImpl<EnterpriseInfoMapper, Ent
@Override
public EnterpriseInfo getXzSupplierByUserId(Map<String, Object> map) {
return enterpriseInfoMapper.getXzSupplierByUserId(map);
Long userId = MapUtils.getLong(map, "userId");
return enterpriseInfoMapper.getXzSupplierByUserId(userId);
}
@Override

View File

@ -19,12 +19,15 @@ import com.zhgd.xmgl.enums.ParamEnum;
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
import com.zhgd.xmgl.modules.basicdata.mapper.SystemUserMapper;
import com.zhgd.xmgl.modules.basicdata.service.UploadFileService;
import com.zhgd.xmgl.modules.basicdata.service.impl.SystemUserServiceImpl;
import com.zhgd.xmgl.modules.taskprogress.entity.TaskProgressMaterialRel;
import com.zhgd.xmgl.modules.taskprogress.entity.TaskProgressMaterialRelPlan;
import com.zhgd.xmgl.modules.taskprogress.mapper.TaskProgressMapper;
import com.zhgd.xmgl.modules.taskprogress.mapper.TaskProgressMaterialRelMapper;
import com.zhgd.xmgl.modules.taskprogress.mapper.TaskProgressMaterialRelPlanMapper;
import com.zhgd.xmgl.modules.taskprogress.service.ITaskProgressService;
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
import com.zhgd.xmgl.modules.worker.mapper.EnterpriseInfoMapper;
import com.zhgd.xmgl.modules.xz.entity.XzTaskProgress;
import com.zhgd.xmgl.modules.xz.entity.XzTaskProgressAlarm;
import com.zhgd.xmgl.modules.xz.entity.XzTaskProgressContent;
@ -70,6 +73,12 @@ import java.util.stream.Collectors;
@Transactional(rollbackFor = Exception.class)
@Slf4j
public class XzTaskProgressServiceImpl extends ServiceImpl<XzTaskProgressMapper, XzTaskProgress> implements IXzTaskProgressService {
@Autowired
private XzSupplierQualificationApplyServiceImpl xzSupplierQualificationApplyService;
@Autowired
private EnterpriseInfoMapper enterpriseInfoMapper;
@Autowired
private SystemUserServiceImpl systemUserService;
@Value("${basePath}")
private String basePath;
@Autowired
@ -495,11 +504,19 @@ public class XzTaskProgressServiceImpl extends ServiceImpl<XzTaskProgressMapper,
.orderByDesc(XzTaskProgressTotal::getCreateDate)
.last("limit 1")
);
CountTaskProgressVo vo = baseMapper.countTaskProgress(paramMap);
if (xzTaskProgressTotal == null) {
CountTaskProgressVo vo = new CountTaskProgressVo();
if (xzTaskProgressTotal != null) {
vo.setProjectTotalProgress(xzTaskProgressTotal.getChangeAfter());
} else {
vo.setProjectTotalProgress(0D);
}
if (systemUserService.isSupplier()) {
EnterpriseInfo info = xzSupplierQualificationApplyService.getSupplierInfoByUserId(SecurityUtils.getUser().getUserId());
paramMap.put("supplierEnterpriseId", info.getId());
}
CountTaskProgressVo vo1 = baseMapper.getMaxMinProgress(paramMap);
vo.setProjectTotalDayNum(vo1.getProjectTotalDayNum());
vo.setProjectSurplusDayNum(vo1.getProjectSurplusDayNum());
return vo;
}

View File

@ -90,6 +90,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
http.authorizeRequests()
//请求路径允许访问
.antMatchers("/xmgl/recognition/checkFace").permitAll()
.antMatchers("/xmgl/base/device/login").permitAll()
.antMatchers("/xmgl/magic/**").permitAll()
.antMatchers("/xmgl/magic/web/**").permitAll()