|
|
@ -29,6 +29,7 @@ import com.elink.esua.epdc.dao.SubAuditRecordsLogDao; |
|
|
|
import com.elink.esua.epdc.dao.SubFileImgDao; |
|
|
|
import com.elink.esua.epdc.dao.SubPositionCheckDetailDao; |
|
|
|
import com.elink.esua.epdc.dao.SubPositionCheckInfoDao; |
|
|
|
import com.elink.esua.epdc.dto.DeptLevelAndLeaderDTO; |
|
|
|
import com.elink.esua.epdc.dto.SubPositionCheckDetailDTO; |
|
|
|
import com.elink.esua.epdc.dto.SysDeptDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.form.KpiGridIdsFormDTO; |
|
|
@ -158,6 +159,25 @@ public class SubPositionCheckDetailServiceImpl extends BaseServiceImpl<SubPositi |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void updateInfoDetailList(KpiSubCheckDetailFormDTO dto) { |
|
|
|
//先删除 在添加 1、根据infoid查询出它的详情 - 删除 2、根据详情id删除所有的文件信息
|
|
|
|
String infoId = dto.getInfoId(); |
|
|
|
String[] grids = dto.getGridIds(); |
|
|
|
SubPositionCheckInfoEntity entity = infoDao.selectById(infoId); |
|
|
|
String gridIds = gridIds(grids); |
|
|
|
String gridNames = gridNames(grids); |
|
|
|
entity.setGridIds(gridIds); |
|
|
|
entity.setGridNames(gridNames); |
|
|
|
infoDao.updateById(entity); |
|
|
|
//查询所有详情信息
|
|
|
|
List<SubPositionCheckDetailEntity> list = baseDao.selectCheckDetailByInfoId(infoId); |
|
|
|
updateDetailInfo(infoId,list,dto); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/* |
|
|
|
* |
|
|
|
* 存info表中数据 |
|
|
@ -190,6 +210,13 @@ public class SubPositionCheckDetailServiceImpl extends BaseServiceImpl<SubPositi |
|
|
|
checkInfoEntity.setGridNames(gridNames); |
|
|
|
checkInfoEntity.setSubmitTime(sdf1.format(date)); |
|
|
|
checkInfoEntity.setStatus("1"); |
|
|
|
//查询冗余字段信息
|
|
|
|
Result<DeptLevelAndLeaderDTO> allDeptInfos = adminFeignClient.getDeptInfoById(deptId,"0"); |
|
|
|
DeptLevelAndLeaderDTO deptLevelAndLeaderDto = allDeptInfos.getData(); |
|
|
|
checkInfoEntity.setParentDeptIds(deptLevelAndLeaderDto.getParentDeptIds()); |
|
|
|
checkInfoEntity.setParentDeptNames(deptLevelAndLeaderDto.getParentDeptNames()); |
|
|
|
checkInfoEntity.setAllDeptIds(deptLevelAndLeaderDto.getAllDeptIds()); |
|
|
|
checkInfoEntity.setAllDeptNames(deptLevelAndLeaderDto.getAllDeptNames()); |
|
|
|
infoDao.insert(checkInfoEntity); |
|
|
|
return checkInfoEntity.getId(); |
|
|
|
} |
|
|
@ -242,6 +269,10 @@ public class SubPositionCheckDetailServiceImpl extends BaseServiceImpl<SubPositi |
|
|
|
subFileImgEntity.setThumbnail(thumbnail[i]); |
|
|
|
fileImgDao.insert(subFileImgEntity); |
|
|
|
} |
|
|
|
}else { |
|
|
|
SubFileImgEntity subFileImgEntity = new SubFileImgEntity(); |
|
|
|
subFileImgEntity.setDetailId(detailId); |
|
|
|
fileImgDao.insert(subFileImgEntity); |
|
|
|
} |
|
|
|
String[] files = dto.getFiles(); |
|
|
|
if (files.length>0){ |
|
|
@ -253,6 +284,11 @@ public class SubPositionCheckDetailServiceImpl extends BaseServiceImpl<SubPositi |
|
|
|
fileImgDao.insert(subFileImgEntity); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
SubFileImgEntity subFileImgEntity = new SubFileImgEntity(); |
|
|
|
subFileImgEntity.setDetailId(detailId); |
|
|
|
fileImgDao.insert(subFileImgEntity); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/* |
|
|
@ -279,6 +315,29 @@ public class SubPositionCheckDetailServiceImpl extends BaseServiceImpl<SubPositi |
|
|
|
logDao.insert(entity); |
|
|
|
} |
|
|
|
|
|
|
|
/* |
|
|
|
* |
|
|
|
* 更新阵地详情 |
|
|
|
* @param infoId |
|
|
|
* @param list |
|
|
|
* @author wk |
|
|
|
* @date 2020-12-08 17:37 |
|
|
|
* @return void |
|
|
|
*/ |
|
|
|
void updateDetailInfo(String infoId, |
|
|
|
List<SubPositionCheckDetailEntity> list, |
|
|
|
KpiSubCheckDetailFormDTO dto){ |
|
|
|
for (SubPositionCheckDetailEntity entity:list) { |
|
|
|
String detailId = entity.getId(); |
|
|
|
//根据详情id查询所有文件信息
|
|
|
|
fileImgDao.deleteByDetailId(detailId); |
|
|
|
//删除详情表所有相关数据
|
|
|
|
baseDao.selectCheckDetailByInfoId(infoId); |
|
|
|
} |
|
|
|
//添加相关数据
|
|
|
|
addDetailDate(infoId,dto.getInfoDetail()); |
|
|
|
} |
|
|
|
|
|
|
|
/* |
|
|
|
* |
|
|
|
* 拼接网格id |
|
|
|