|
@@ -6,13 +6,13 @@ import com.usky.common.core.bean.CommonPage;
|
|
|
import com.usky.common.core.exception.BusinessException;
|
|
|
import com.usky.common.mybatis.core.AbstractCrudService;
|
|
|
import com.usky.common.security.utils.SecurityUtils;
|
|
|
-import com.usky.fire.domain.ContentOption;
|
|
|
+import com.usky.fire.domain.PatrolInspectionContentOption;
|
|
|
import com.usky.fire.domain.PatrolInspectionContent;
|
|
|
-import com.usky.fire.domain.SiteContent;
|
|
|
+import com.usky.fire.domain.PatrolInspectionSiteContent;
|
|
|
import com.usky.fire.mapper.PatrolInspectionContentMapper;
|
|
|
-import com.usky.fire.service.ContentOptionService;
|
|
|
+import com.usky.fire.service.PatrolInspectionContentOptionService;
|
|
|
import com.usky.fire.service.PatrolInspectionContentService;
|
|
|
-import com.usky.fire.service.SiteContentService;
|
|
|
+import com.usky.fire.service.PatrolInspectionSiteContentService;
|
|
|
import com.usky.fire.service.vo.PatrolInspectionContentExportVo;
|
|
|
import com.usky.fire.service.vo.PatrolInspectionContentVo;
|
|
|
import com.usky.system.model.LoginUser;
|
|
@@ -38,9 +38,9 @@ import java.util.stream.Collectors;
|
|
|
public class PatrolInspectionContentServiceImpl extends AbstractCrudService<PatrolInspectionContentMapper, PatrolInspectionContent> implements PatrolInspectionContentService {
|
|
|
|
|
|
@Autowired
|
|
|
- private ContentOptionService contentOptionService;
|
|
|
+ private PatrolInspectionContentOptionService contentOptionService;
|
|
|
@Autowired
|
|
|
- private SiteContentService siteContentService;
|
|
|
+ private PatrolInspectionSiteContentService siteContentService;
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -58,7 +58,7 @@ public class PatrolInspectionContentServiceImpl extends AbstractCrudService<Patr
|
|
|
if (patrolInspectionContentVo.getContentOptionList().size() > 0) {
|
|
|
Integer fid = patrolInspectionContent.getId();
|
|
|
for (int i = 0; i < patrolInspectionContentVo.getContentOptionList().size(); i++) {
|
|
|
- ContentOption contentOption = new ContentOption();
|
|
|
+ PatrolInspectionContentOption contentOption = new PatrolInspectionContentOption();
|
|
|
contentOption.setOptionName(patrolInspectionContentVo.getContentOptionList().get(i).getOptionName());
|
|
|
contentOption.setContentId(fid);
|
|
|
contentOption.setEnable(1);
|
|
@@ -72,9 +72,9 @@ public class PatrolInspectionContentServiceImpl extends AbstractCrudService<Patr
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public void updatePatrolInspectionContent(PatrolInspectionContentVo patrolInspectionContentVo) {
|
|
|
- LambdaQueryWrapper<SiteContent> queryWrapperOne = Wrappers.lambdaQuery();
|
|
|
- queryWrapperOne.eq(SiteContent::getContentId, patrolInspectionContentVo.getId());
|
|
|
- List<SiteContent> siteContentList = siteContentService.list(queryWrapperOne);
|
|
|
+ LambdaQueryWrapper<PatrolInspectionSiteContent> queryWrapperOne = Wrappers.lambdaQuery();
|
|
|
+ queryWrapperOne.eq(PatrolInspectionSiteContent::getContentId, patrolInspectionContentVo.getId());
|
|
|
+ List<PatrolInspectionSiteContent> siteContentList = siteContentService.list(queryWrapperOne);
|
|
|
if (siteContentList.size() <= 0) {
|
|
|
throw new BusinessException("巡检内容已绑定站点不可修改");
|
|
|
}
|
|
@@ -85,10 +85,10 @@ public class PatrolInspectionContentServiceImpl extends AbstractCrudService<Patr
|
|
|
patrolInspectionContent.setSubmissionMethod(patrolInspectionContentVo.getSubmissionMethod());
|
|
|
patrolInspectionContent.setCompanyId(patrolInspectionContentVo.getCompanyId());
|
|
|
this.updateById(patrolInspectionContent);
|
|
|
- LambdaQueryWrapper<ContentOption> queryWrapper = Wrappers.lambdaQuery();
|
|
|
- queryWrapper.eq(ContentOption::getEnable, 1)
|
|
|
- .eq(ContentOption::getContentId, patrolInspectionContentVo.getId());
|
|
|
- List<ContentOption> ContentOptionList = contentOptionService.list(queryWrapper);
|
|
|
+ LambdaQueryWrapper<PatrolInspectionContentOption> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.eq(PatrolInspectionContentOption::getEnable, 1)
|
|
|
+ .eq(PatrolInspectionContentOption::getContentId, patrolInspectionContentVo.getId());
|
|
|
+ List<PatrolInspectionContentOption> ContentOptionList = contentOptionService.list(queryWrapper);
|
|
|
if (ContentOptionList.size() > 0) {
|
|
|
for (int i = 0; i < ContentOptionList.size(); i++) {
|
|
|
ContentOptionList.get(i).setEnable(0);
|
|
@@ -97,7 +97,7 @@ public class PatrolInspectionContentServiceImpl extends AbstractCrudService<Patr
|
|
|
}
|
|
|
if (patrolInspectionContentVo.getContentOptionList().size() > 0) {
|
|
|
for (int i = 0; i < patrolInspectionContentVo.getContentOptionList().size(); i++) {
|
|
|
- ContentOption contentOption = new ContentOption();
|
|
|
+ PatrolInspectionContentOption contentOption = new PatrolInspectionContentOption();
|
|
|
contentOption.setOptionName(patrolInspectionContentVo.getContentOptionList().get(i).getOptionName());
|
|
|
contentOption.setContentId(patrolInspectionContentVo.getId());
|
|
|
if (patrolInspectionContentVo.getContentOptionList().get(i).getId() != 0 &&
|
|
@@ -119,9 +119,9 @@ public class PatrolInspectionContentServiceImpl extends AbstractCrudService<Patr
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public void delPatrolInspectionContent(Integer id) {
|
|
|
- LambdaQueryWrapper<SiteContent> queryWrapper = Wrappers.lambdaQuery();
|
|
|
- queryWrapper.eq(SiteContent::getContentId, id);
|
|
|
- List<SiteContent> siteContentList = siteContentService.list(queryWrapper);
|
|
|
+ LambdaQueryWrapper<PatrolInspectionSiteContent> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.eq(PatrolInspectionSiteContent::getContentId, id);
|
|
|
+ List<PatrolInspectionSiteContent> siteContentList = siteContentService.list(queryWrapper);
|
|
|
if (siteContentList.size() <= 0) {
|
|
|
throw new BusinessException("巡检内容正在使用中不可删除");
|
|
|
}
|
|
@@ -129,13 +129,13 @@ public class PatrolInspectionContentServiceImpl extends AbstractCrudService<Patr
|
|
|
patrolInspectionContent.setId(id);
|
|
|
patrolInspectionContent.setEnable(0);
|
|
|
this.updateById(patrolInspectionContent);
|
|
|
- LambdaQueryWrapper<ContentOption> queryWrapperOne = Wrappers.lambdaQuery();
|
|
|
- queryWrapperOne.eq(ContentOption::getContentId, id)
|
|
|
- .eq(ContentOption::getEnable, 1);
|
|
|
- List<ContentOption> contentOptionList = contentOptionService.list(queryWrapperOne);
|
|
|
+ LambdaQueryWrapper<PatrolInspectionContentOption> queryWrapperOne = Wrappers.lambdaQuery();
|
|
|
+ queryWrapperOne.eq(PatrolInspectionContentOption::getContentId, id)
|
|
|
+ .eq(PatrolInspectionContentOption::getEnable, 1);
|
|
|
+ List<PatrolInspectionContentOption> contentOptionList = contentOptionService.list(queryWrapperOne);
|
|
|
if (contentOptionList.size() > 0) {
|
|
|
for (int i = 0; i < contentOptionList.size(); i++) {
|
|
|
- ContentOption contentOption = new ContentOption();
|
|
|
+ PatrolInspectionContentOption contentOption = new PatrolInspectionContentOption();
|
|
|
contentOption.setId(contentOptionList.get(i).getId());
|
|
|
contentOption.setEnable(0);
|
|
|
contentOptionService.updateById(contentOption);
|
|
@@ -172,10 +172,10 @@ public class PatrolInspectionContentServiceImpl extends AbstractCrudService<Patr
|
|
|
for (int i = 0; i < patrolInspectionContentList.size(); i++) {
|
|
|
idList.add(patrolInspectionContentList.get(i).getId());
|
|
|
}
|
|
|
- LambdaQueryWrapper<ContentOption> queryWrapperOne = Wrappers.lambdaQuery();
|
|
|
- queryWrapperOne.eq(ContentOption::getEnable, 1)
|
|
|
- .in(ContentOption::getContentId, idList);
|
|
|
- List<ContentOption> contentOptionList = contentOptionService.list(queryWrapperOne);
|
|
|
+ LambdaQueryWrapper<PatrolInspectionContentOption> queryWrapperOne = Wrappers.lambdaQuery();
|
|
|
+ queryWrapperOne.eq(PatrolInspectionContentOption::getEnable, 1)
|
|
|
+ .in(PatrolInspectionContentOption::getContentId, idList);
|
|
|
+ List<PatrolInspectionContentOption> contentOptionList = contentOptionService.list(queryWrapperOne);
|
|
|
for (int i = 0; i < patrolInspectionContentList.size(); i++) {
|
|
|
PatrolInspectionContentVo patrolInspectionContentVo = new PatrolInspectionContentVo();
|
|
|
patrolInspectionContentVo.setXh(i+1);
|
|
@@ -188,7 +188,7 @@ public class PatrolInspectionContentServiceImpl extends AbstractCrudService<Patr
|
|
|
patrolInspectionContentVo.setCreator(patrolInspectionContentList.get(i).getCreator());
|
|
|
patrolInspectionContentVo.setCreateTime(patrolInspectionContentList.get(i).getCreateTime());
|
|
|
patrolInspectionContentVo.setEnable(patrolInspectionContentList.get(i).getEnable());
|
|
|
- List<ContentOption> contentOptionListOne = new ArrayList<>();
|
|
|
+ List<PatrolInspectionContentOption> contentOptionListOne = new ArrayList<>();
|
|
|
for (int j = 0; j < contentOptionList.size(); j++) {
|
|
|
if (patrolInspectionContentList.get(i).getId() == contentOptionList.get(j).getContentId()) {
|
|
|
contentOptionListOne.add(contentOptionList.get(j));
|
|
@@ -232,10 +232,10 @@ public class PatrolInspectionContentServiceImpl extends AbstractCrudService<Patr
|
|
|
for (int i = 0; i < patrolInspectionContentList.size(); i++) {
|
|
|
idList.add(patrolInspectionContentList.get(i).getId());
|
|
|
}
|
|
|
- LambdaQueryWrapper<ContentOption> queryWrapperOne = Wrappers.lambdaQuery();
|
|
|
- queryWrapperOne.eq(ContentOption::getEnable, 1)
|
|
|
- .in(ContentOption::getContentId, idList);
|
|
|
- List<ContentOption> contentOptionList = contentOptionService.list(queryWrapperOne);
|
|
|
+ LambdaQueryWrapper<PatrolInspectionContentOption> queryWrapperOne = Wrappers.lambdaQuery();
|
|
|
+ queryWrapperOne.eq(PatrolInspectionContentOption::getEnable, 1)
|
|
|
+ .in(PatrolInspectionContentOption::getContentId, idList);
|
|
|
+ List<PatrolInspectionContentOption> contentOptionList = contentOptionService.list(queryWrapperOne);
|
|
|
for (int i = 0; i < patrolInspectionContentList.size(); i++) {
|
|
|
PatrolInspectionContentExportVo patrolInspectionContentVo = new PatrolInspectionContentExportVo();
|
|
|
patrolInspectionContentVo.setXh(i+1);
|
|
@@ -248,7 +248,7 @@ public class PatrolInspectionContentServiceImpl extends AbstractCrudService<Patr
|
|
|
patrolInspectionContentVo.setCreator(patrolInspectionContentList.get(i).getCreator());
|
|
|
patrolInspectionContentVo.setCreateTime(patrolInspectionContentList.get(i).getCreateTime().format(df));
|
|
|
patrolInspectionContentVo.setEnable(patrolInspectionContentList.get(i).getEnable());
|
|
|
- List<ContentOption> contentOptionListOne = new ArrayList<>();
|
|
|
+ List<PatrolInspectionContentOption> contentOptionListOne = new ArrayList<>();
|
|
|
for (int j = 0; j < contentOptionList.size(); j++) {
|
|
|
if (patrolInspectionContentList.get(i).getId() == contentOptionList.get(j).getContentId()) {
|
|
|
contentOptionListOne.add(contentOptionList.get(j));
|