Commit 63b6a374 authored by KeYong's avatar KeYong

Merge branch 'develop_dl_3.7.0.7' of http://39.98.45.134:8090/moa/amos-boot-biz…

Merge branch 'develop_dl_3.7.0.7' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_3.7.0.7
parents 05375a4f fe6f1b24
...@@ -154,7 +154,7 @@ public class WaterResourceForExportDto extends BaseDto { ...@@ -154,7 +154,7 @@ public class WaterResourceForExportDto extends BaseDto {
@ExcelProperty(value = "高度(cm)", index = 11) @ExcelProperty(value = "高度(cm)", index = 11)
@ApiModelProperty(value = "高度(cm)") @ApiModelProperty(value = "高度(cm)")
private Float height; private Double height;
@ExcelIgnore @ExcelIgnore
@ApiModelProperty(value = "水源可用状态类别代码") @ApiModelProperty(value = "水源可用状态类别代码")
...@@ -184,15 +184,15 @@ public class WaterResourceForExportDto extends BaseDto { ...@@ -184,15 +184,15 @@ public class WaterResourceForExportDto extends BaseDto {
@ExcelProperty(value = "管网直径(cm)", index = 16) @ExcelProperty(value = "管网直径(cm)", index = 16)
@ApiModelProperty(value = "管网直径(cm)") @ApiModelProperty(value = "管网直径(cm)")
private Float pipeDiameter; private Double pipeDiameter;
@ExcelProperty(value = "进水管直径(cm)", index = 17) @ExcelProperty(value = "进水管直径(cm)", index = 17)
@ApiModelProperty(value = "进水管直径(cm)") @ApiModelProperty(value = "进水管直径(cm)")
private Float inletPipeDiameter; private Double inletPipeDiameter;
@ExcelProperty(value = "出水管直径(cm)", index = 18) @ExcelProperty(value = "出水管直径(cm)", index = 18)
@ApiModelProperty(value = "出水管直径(cm)") @ApiModelProperty(value = "出水管直径(cm)")
private Float outletPipeDiameter; private Double outletPipeDiameter;
@ExcelProperty(value = "加水车道数量(个)", index = 19) @ExcelProperty(value = "加水车道数量(个)", index = 19)
@ApiModelProperty(value = "加水车道数量(个)") @ApiModelProperty(value = "加水车道数量(个)")
...@@ -257,11 +257,11 @@ public class WaterResourceForExportDto extends BaseDto { ...@@ -257,11 +257,11 @@ public class WaterResourceForExportDto extends BaseDto {
@ExcelProperty(value = "容积(m³)", index = 28) @ExcelProperty(value = "容积(m³)", index = 28)
@ApiModelProperty(value = "容积(m³)") @ApiModelProperty(value = "容积(m³)")
private Float volume; private Double volume;
@ExcelProperty(value = "面积(㎡)", index = 29) @ExcelProperty(value = "面积(㎡)", index = 29)
@ApiModelProperty(value = "面积(㎡)") @ApiModelProperty(value = "面积(㎡)")
private Float area; private Double area;
@ExcelProperty(value = "水质情况", index = 30) @ExcelProperty(value = "水质情况", index = 30)
@ApiModelProperty(value = "水质情况") @ApiModelProperty(value = "水质情况")
...@@ -288,11 +288,11 @@ public class WaterResourceForExportDto extends BaseDto { ...@@ -288,11 +288,11 @@ public class WaterResourceForExportDto extends BaseDto {
@ExcelProperty(value = "取水高度(cm)", index = 34) @ExcelProperty(value = "取水高度(cm)", index = 34)
@ApiModelProperty(value = "取水高度(cm)") @ApiModelProperty(value = "取水高度(cm)")
private Float intakeHeight; private Double intakeHeight;
@ExcelProperty(value = "水源标高差(cm)", index = 35) @ExcelProperty(value = "水源标高差(cm)", index = 35)
@ApiModelProperty(value = "水源标高差(cm)") @ApiModelProperty(value = "水源标高差(cm)")
private Float elevationDifference; private Double elevationDifference;
@ExcelProperty(value = "停车位置", index = 36) @ExcelProperty(value = "停车位置", index = 36)
@ApiModelProperty(value = "停车位置") @ApiModelProperty(value = "停车位置")
...@@ -342,7 +342,7 @@ public class WaterResourceForExportDto extends BaseDto { ...@@ -342,7 +342,7 @@ public class WaterResourceForExportDto extends BaseDto {
// @ExplicitConstraint(indexNum = 42, sourceClass = CommonExplicitConstraint.class, method = "getEquipCategory") // @ExplicitConstraint(indexNum = 42, sourceClass = CommonExplicitConstraint.class, method = "getEquipCategory")
// @ExcelProperty(value = "设施分类名称", index = 42) // @ExcelProperty(value = "设施分类名称", index = 42)
private String equipCategoryName; private String equipCategoryName;
@ApiModelProperty("设施分类编码") @ApiModelProperty("设施分类编码")
@ExcelIgnore @ExcelIgnore
private String equipCategoryCode; private String equipCategoryCode;
...@@ -376,11 +376,11 @@ public class WaterResourceForExportDto extends BaseDto { ...@@ -376,11 +376,11 @@ public class WaterResourceForExportDto extends BaseDto {
@ExcelProperty(value = "最低报警水位(m)", index = 43) @ExcelProperty(value = "最低报警水位(m)", index = 43)
@ApiModelProperty(value = "最低报警水位(m)") @ApiModelProperty(value = "最低报警水位(m)")
private Float minWaterLevel; private Double minWaterLevel;
@ExcelProperty(value = "最高报警水位(m)", index = 44) @ExcelProperty(value = "最高报警水位(m)", index = 44)
@ApiModelProperty(value = "最高报警水位(m)") @ApiModelProperty(value = "最高报警水位(m)")
private Float maxWaterLevel; private Double maxWaterLevel;
@ExcelIgnore @ExcelIgnore
@ApiModelProperty("水池液位显示装置id") @ApiModelProperty("水池液位显示装置id")
......
...@@ -67,6 +67,10 @@ public class EquipmentCategory extends BaseEntity implements TreeNode<EquipmentC ...@@ -67,6 +67,10 @@ public class EquipmentCategory extends BaseEntity implements TreeNode<EquipmentC
@ApiModelProperty(value = "个数") @ApiModelProperty(value = "个数")
private Double count; private Double count;
@TableField(exist=false)
@ApiModelProperty(value = "个数")
private String countName;
@ApiModelProperty(value = "类型(car:车辆 equipment:装备)") @ApiModelProperty(value = "类型(car:车辆 equipment:装备)")
@TableField(exist=false) @TableField(exist=false)
private String type; private String type;
......
package com.yeejoin.amos.patrol.core.common.request;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializeConfig;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.fasterxml.jackson.databind.module.SimpleModule;
/**
* @description:
* @author: tw
* @createDate: 2023/4/13
*/
public class ToJson {
public static Object tojson(Object obj) {
Object ob=null;
if(obj!=null){
SerializeConfig serializeConfig = new SerializeConfig();
serializeConfig.put(Long.class, ToStringSerializer.instance);
serializeConfig.put(Long.TYPE, ToStringSerializer.instance);
String json = JSONObject
.toJSONString(obj, serializeConfig,
SerializerFeature.PrettyFormat);
ob=JSONObject.parse(json);
}
return ob;
}
}
...@@ -286,6 +286,35 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -286,6 +286,35 @@ public class EquipmentCategoryController extends AbstractBaseController {
return list; return list;
} }
@RequestMapping(value = "/itemType-tree", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "检查项类型统计树", notes = "检查项类型统计树")
public List<EquipmentCategory> countItemTree() {
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
List<EquipmentCategory> list = new ArrayList<>();
List<EquipmentCategory> equipmentCategories = this.listEquip();
List<EquipmentCategory> fireCategories = this.listFire();
fireCategories.get(0).setId(-2L);
fireCategories.get(0).setCode("-2");
List<EquipmentCategory> treeListByCustom = getTreeListByCustom(bizOrgCode);
list.addAll(equipmentCategories);
list.addAll(fireCategories);
list.addAll(treeListByCustom);
EquipmentCategory equipmentCategory = new EquipmentCategory();
equipmentCategory.setChildren(list);
equipmentCategory.setCode("-3");
equipmentCategory.setName("全部类型");
equipmentCategory.setId(-3L);
int countAll = StringUtils.isNotEmpty(bizOrgCode) ? equipmentCategoryMapper.countAll(bizOrgCode) : 0;
equipmentCategory.setCountName("全部类型" + "(" + countAll + ")");
equipmentCategory.setHasLowerClassification(true);
List<EquipmentCategory> result = new ArrayList<>();
result.add(equipmentCategory);
return result;
}
/** /**
* 除消防设施全量数据树形结构返回 * 除消防设施全量数据树形结构返回
...@@ -296,8 +325,12 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -296,8 +325,12 @@ public class EquipmentCategoryController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "除消防设施全量数据树形结构返回", notes = "除消防设施全量数据树形结构返回") @ApiOperation(httpMethod = "GET", value = "除消防设施全量数据树形结构返回", notes = "除消防设施全量数据树形结构返回")
public List<EquipmentCategory> listEquip() { public List<EquipmentCategory> listEquip() {
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService
.getEquipmentCategoryListNotFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode)); .getEquipmentCategoryListNotFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode),bizOrgCode);
List<EquipmentCategory> list = new ArrayList<>(); List<EquipmentCategory> list = new ArrayList<>();
List<EquipmentCategory> result = new ArrayList<>(); List<EquipmentCategory> result = new ArrayList<>();
Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>(); Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>();
...@@ -316,11 +349,13 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -316,11 +349,13 @@ public class EquipmentCategoryController extends AbstractBaseController {
} }
} }
}); });
String equipItemCount = iEquipmentCategoryService.getEquipItemCount(bizOrgCode);
getChildren(list, tmpMap); getChildren(list, tmpMap);
EquipmentCategory equipmentCategory = new EquipmentCategory(); EquipmentCategory equipmentCategory = new EquipmentCategory();
equipmentCategory.setChildren(list); equipmentCategory.setChildren(list);
equipmentCategory.setCode("-1"); equipmentCategory.setCode("-1");
equipmentCategory.setName("消防设备"); equipmentCategory.setName("消防设备");
equipmentCategory.setCountName("消防设备"+equipItemCount);
equipmentCategory.setId(0L); equipmentCategory.setId(0L);
equipmentCategory.setHasLowerClassification(true); equipmentCategory.setHasLowerClassification(true);
...@@ -337,8 +372,10 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -337,8 +372,10 @@ public class EquipmentCategoryController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "消防设施分类定义树", notes = "消防设施分类定义树") @ApiOperation(httpMethod = "GET", value = "消防设施分类定义树", notes = "消防设施分类定义树")
public List<EquipmentCategory> listFire() { public List<EquipmentCategory> listFire() {
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService
.getEquipmentCategoryListByFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode)); .getEquipmentCategoryListByFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode),bizOrgCode);
List<EquipmentCategory> list = new ArrayList<>(); List<EquipmentCategory> list = new ArrayList<>();
List<EquipmentCategory> result = new ArrayList<>(); List<EquipmentCategory> result = new ArrayList<>();
Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>(); Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>();
...@@ -358,11 +395,12 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -358,11 +395,12 @@ public class EquipmentCategoryController extends AbstractBaseController {
} }
}); });
getChildren(list, tmpMap); getChildren(list, tmpMap);
String fireItemCount = iEquipmentCategoryService.getFireItemCount(bizOrgCode);
EquipmentCategory equipmentCategory = new EquipmentCategory(); EquipmentCategory equipmentCategory = new EquipmentCategory();
equipmentCategory.setChildren(list); equipmentCategory.setChildren(list);
equipmentCategory.setCode("-1"); equipmentCategory.setCode("-1");
equipmentCategory.setName("消防设施"); equipmentCategory.setName("消防设施");
equipmentCategory.setCountName("消防设施"+fireItemCount);
equipmentCategory.setId(0L); equipmentCategory.setId(0L);
equipmentCategory.setHasLowerClassification(true); equipmentCategory.setHasLowerClassification(true);
...@@ -388,9 +426,9 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -388,9 +426,9 @@ public class EquipmentCategoryController extends AbstractBaseController {
} }
List<EquipmentCategory> result = new ArrayList<>(); List<EquipmentCategory> result = new ArrayList<>();
List<EquipmentCategory> listFireCategories = listFirePrivate(bizOrgCode); List<EquipmentCategory> listFireCategories = listFirePrivate(bizOrgCode);
List<EquipmentCategory> listEquipCategories = listEquipPrivate(bizOrgCode); //List<EquipmentCategory> listEquipCategories = listEquipPrivate(bizOrgCode);
List<EquipmentCategory> treeListByCustom = getTreeListByCustom(bizOrgCode); List<EquipmentCategory> treeListByCustom = getTreeListByCustom(bizOrgCode);
listFireCategories.addAll(listEquipCategories); //listFireCategories.addAll(listEquipCategories);
listFireCategories.addAll(treeListByCustom); listFireCategories.addAll(treeListByCustom);
EquipmentCategory equipmentCategory = new EquipmentCategory(); EquipmentCategory equipmentCategory = new EquipmentCategory();
equipmentCategory.setChildren(listFireCategories); equipmentCategory.setChildren(listFireCategories);
...@@ -416,6 +454,7 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -416,6 +454,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
int keyPartsTypeCount = StringUtils.isNotEmpty(bizOrgCode) ? equipmentCategoryMapper.countByKeyPartsType(bizOrgCode) : 0; int keyPartsTypeCount = StringUtils.isNotEmpty(bizOrgCode) ? equipmentCategoryMapper.countByKeyPartsType(bizOrgCode) : 0;
equipmentCategory.setCode("-4"); equipmentCategory.setCode("-4");
equipmentCategory.setName("重点部位" + "(" + keyPartsTypeCount + ")"); equipmentCategory.setName("重点部位" + "(" + keyPartsTypeCount + ")");
equipmentCategory.setCountName("重点部位" + "(" + keyPartsTypeCount + ")");
equipmentCategory.setPatrolNum(keyPartsTypeCount); equipmentCategory.setPatrolNum(keyPartsTypeCount);
equipmentCategory.setId(-4L); equipmentCategory.setId(-4L);
equipmentCategory.setParentId(-3L); equipmentCategory.setParentId(-3L);
...@@ -425,6 +464,7 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -425,6 +464,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
int customTypeCount = StringUtils.isNotEmpty(bizOrgCode) ? equipmentCategoryMapper.countByCustomType(bizOrgCode) : 0; int customTypeCount = StringUtils.isNotEmpty(bizOrgCode) ? equipmentCategoryMapper.countByCustomType(bizOrgCode) : 0;
equipmentCategory2.setCode("-5"); equipmentCategory2.setCode("-5");
equipmentCategory2.setName("自定义巡查点" + "(" + customTypeCount + ")"); equipmentCategory2.setName("自定义巡查点" + "(" + customTypeCount + ")");
equipmentCategory2.setCountName("自定义巡查点" + "(" + customTypeCount + ")");
equipmentCategory2.setPatrolNum(customTypeCount); equipmentCategory2.setPatrolNum(customTypeCount);
equipmentCategory2.setId(-5L); equipmentCategory2.setId(-5L);
equipmentCategory2.setParentId(-3L); equipmentCategory2.setParentId(-3L);
...@@ -433,9 +473,9 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -433,9 +473,9 @@ public class EquipmentCategoryController extends AbstractBaseController {
return result; return result;
} }
private List<EquipmentCategory> listFirePrivate(String bizOrgCode) { private List<EquipmentCategory> listFirePrivate(String bizOrgCode) {
List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService
.getEquipmentCategoryListByFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode)); .getEquipmentCategoryListByFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode),bizOrgCode);
List<EquipmentCategory> list = new ArrayList<>(); List<EquipmentCategory> list = new ArrayList<>();
List<EquipmentCategory> result = new ArrayList<>(); List<EquipmentCategory> result = new ArrayList<>();
Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>(); Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>();
...@@ -475,7 +515,7 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -475,7 +515,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
} }
private List<EquipmentCategory> listEquipPrivate(String bizOrgCode) { /* private List<EquipmentCategory> listEquipPrivate(String bizOrgCode) {
List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService
.getEquipmentCategoryListNotFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode)); .getEquipmentCategoryListNotFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode));
List<EquipmentCategory> list = new ArrayList<>(); List<EquipmentCategory> list = new ArrayList<>();
...@@ -510,7 +550,7 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -510,7 +550,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
equipmentCategory.setParentId(-3L); equipmentCategory.setParentId(-3L);
result.add(equipmentCategory); result.add(equipmentCategory);
return result; return result;
} }*/
/** /**
* *
......
...@@ -465,8 +465,10 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -465,8 +465,10 @@ public class FireFightingSystemController extends AbstractBaseController {
equipmentCategory = equipmentCategoryService.getById(equipmentCategory.getParentId()); equipmentCategory = equipmentCategoryService.getById(equipmentCategory.getParentId());
} }
} }
String classificationCode = equipTypeAmountPage.getEquipmentClassificationCode().replaceAll("0+$", ""); return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, equipTypeAmountPage.getEquipmentClassificationCode().replaceAll("0+$", ""), equipTypeAmountPage);
return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, classificationCode.length() % 2 == 0 ? classificationCode : classificationCode + "0", equipTypeAmountPage);
//String classificationCode = equipTypeAmountPage.getEquipmentClassificationCode().replaceAll("0+$", "");
//return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, classificationCode.length() % 2 == 0 ? classificationCode : classificationCode + "0", equipTypeAmountPage);
} else { } else {
if (null != equipTypeAmountPage.getIsDefect() && 1 == equipTypeAmountPage.getIsDefect()) { if (null != equipTypeAmountPage.getIsDefect() && 1 == equipTypeAmountPage.getIsDefect()) {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
......
...@@ -53,9 +53,14 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> { ...@@ -53,9 +53,14 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
int checkUsed( String id ); int checkUsed( String id );
List<EquipmentCategory> getEquipmentCategoryList(Integer head); List<EquipmentCategory> getEquipmentCategoryList(Integer head);
List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head); List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head,String bizOrgCode);
List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head); String getEquipItemCount(String bizOrgCode) ;
String getFireItemCount(String bizOrgCode) ;
List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head,String bizOrgCode);
int countByFireTypeAndCode(@Param("code") String code, @Param("bizOrgCode") String bizOrgCode); int countByFireTypeAndCode(@Param("code") String code, @Param("bizOrgCode") String bizOrgCode);
......
...@@ -47,9 +47,14 @@ public interface IEquipmentCategoryService extends IService<EquipmentCategory> { ...@@ -47,9 +47,14 @@ public interface IEquipmentCategoryService extends IService<EquipmentCategory> {
List<EquipmentCategory> getEquipmentCategoryList(Integer head); List<EquipmentCategory> getEquipmentCategoryList(Integer head);
List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head) ; List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head,String bizOrgCode) ;
List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head) ;
String getEquipItemCount(String bizOrgCode) ;
String getFireItemCount(String bizOrgCode) ;
List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head,String bizOrgCode) ;
/** /**
* 根据分类定义id获取对应所有子分类id * 根据分类定义id获取对应所有子分类id
......
...@@ -386,13 +386,24 @@ public class EquipmentCategoryServiceImpl extends ServiceImpl<EquipmentCategoryM ...@@ -386,13 +386,24 @@ public class EquipmentCategoryServiceImpl extends ServiceImpl<EquipmentCategoryM
return this.baseMapper.getEquipmentCategoryList(head); return this.baseMapper.getEquipmentCategoryList(head);
} }
public List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head) { public List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head,String bizOrgCode) {
return this.baseMapper.getEquipmentCategoryListNotFacilities(head); return this.baseMapper.getEquipmentCategoryListNotFacilities(head,bizOrgCode);
} }
public List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head) { public String getFireItemCount(String bizOrgCode) {
return this.baseMapper.getEquipmentCategoryListByFacilities(head); return this.baseMapper.getFireItemCount(bizOrgCode);
}
public String getEquipItemCount(String bizOrgCode) {
return this.baseMapper.getEquipItemCount(bizOrgCode);
}
public List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head,String bizOrgCode) {
return this.baseMapper.getEquipmentCategoryListByFacilities(head,bizOrgCode);
} }
......
...@@ -484,6 +484,7 @@ public class ExcelServiceImpl { ...@@ -484,6 +484,7 @@ public class ExcelServiceImpl {
} }
@Transactional
public Object commonUpload(MultipartFile multipartFile, ExcelDto excelDto, String uuidString, HttpServletRequest equest) throws Exception { public Object commonUpload(MultipartFile multipartFile, ExcelDto excelDto, String uuidString, HttpServletRequest equest) throws Exception {
switch (excelDto.getType()) { switch (excelDto.getType()) {
......
...@@ -17,6 +17,25 @@ ...@@ -17,6 +17,25 @@
<artifactId>amos-boot-module-patrol-api</artifactId> <artifactId>amos-boot-module-patrol-api</artifactId>
<version>${amos-biz-boot.version}</version> <version>${amos-biz-boot.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.1.1</version>
<exclusions>
<exclusion>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency> <dependency>
<groupId>com.yeejoin</groupId> <groupId>com.yeejoin</groupId>
<artifactId>amos-component-rule</artifactId> <artifactId>amos-component-rule</artifactId>
......
...@@ -12,6 +12,7 @@ import com.yeejoin.amos.patrol.business.dao.repository.IPointInputItemDao; ...@@ -12,6 +12,7 @@ import com.yeejoin.amos.patrol.business.dao.repository.IPointInputItemDao;
import com.yeejoin.amos.patrol.business.dto.InputItemDataDto; import com.yeejoin.amos.patrol.business.dto.InputItemDataDto;
import com.yeejoin.amos.patrol.business.dto.InputItemDataJsonlDto; import com.yeejoin.amos.patrol.business.dto.InputItemDataJsonlDto;
import com.yeejoin.amos.patrol.business.dto.InputItemExcelDto; import com.yeejoin.amos.patrol.business.dto.InputItemExcelDto;
import com.yeejoin.amos.patrol.business.dto.InputItemExcelVo;
import com.yeejoin.amos.patrol.business.feign.JcsFeignClient; import com.yeejoin.amos.patrol.business.feign.JcsFeignClient;
import com.yeejoin.amos.patrol.business.param.InputItemPageParam; import com.yeejoin.amos.patrol.business.param.InputItemPageParam;
import com.yeejoin.amos.patrol.business.param.InputItemParam; import com.yeejoin.amos.patrol.business.param.InputItemParam;
...@@ -25,6 +26,7 @@ import com.yeejoin.amos.patrol.business.vo.PointInputItemVo; ...@@ -25,6 +26,7 @@ import com.yeejoin.amos.patrol.business.vo.PointInputItemVo;
import com.yeejoin.amos.patrol.common.enums.DictTypeEnum; import com.yeejoin.amos.patrol.common.enums.DictTypeEnum;
import com.yeejoin.amos.patrol.core.common.request.CommonPageable; import com.yeejoin.amos.patrol.core.common.request.CommonPageable;
import com.yeejoin.amos.patrol.core.common.request.CommonRequest; import com.yeejoin.amos.patrol.core.common.request.CommonRequest;
import com.yeejoin.amos.patrol.core.common.request.ToJson;
import com.yeejoin.amos.patrol.core.enums.QueryOperatorEnum; import com.yeejoin.amos.patrol.core.enums.QueryOperatorEnum;
import com.yeejoin.amos.patrol.core.util.StringUtil; import com.yeejoin.amos.patrol.core.util.StringUtil;
import com.yeejoin.amos.patrol.dao.entity.InputItem; import com.yeejoin.amos.patrol.dao.entity.InputItem;
...@@ -370,9 +372,9 @@ public class InputItemController extends AbstractBaseController { ...@@ -370,9 +372,9 @@ public class InputItemController extends AbstractBaseController {
@RequestMapping(value = "/exportData", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/exportData", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public void exportData(HttpServletResponse response) { public void exportData(HttpServletResponse response) {
InputItemPageParam criterias = new InputItemPageParam(); InputItemPageParam criterias = new InputItemPageParam();
List<InputItemExcelDto> content = inputItemMapper.getInputItemInfoExcelNew(criterias); List<InputItemExcelVo> content = inputItemMapper.getInputItemInfoExcelNew(criterias);
//此处对数据做统一处理 拼接为易读内容 //此处对数据做统一处理 拼接为易读内容
for (InputItemExcelDto inputItemExcelDto : content) { for (InputItemExcelVo inputItemExcelDto : content) {
String text = ""; String text = "";
if (inputItemExcelDto.getItemType().equals("选择")&& !inputItemExcelDto.getDataJson().equals("[]")) { if (inputItemExcelDto.getItemType().equals("选择")&& !inputItemExcelDto.getDataJson().equals("[]")) {
List<Map> maps = JSONObject.parseArray(inputItemExcelDto.getDataJson(), Map.class); List<Map> maps = JSONObject.parseArray(inputItemExcelDto.getDataJson(), Map.class);
...@@ -395,7 +397,7 @@ public class InputItemController extends AbstractBaseController { ...@@ -395,7 +397,7 @@ public class InputItemController extends AbstractBaseController {
} }
} }
ExcelUtil.createTemplate(response,"检查项","检查项",content,InputItemExcelDto.class,null,true); ExcelUtil.createTemplate(response,"检查项","检查项",content,InputItemExcelVo.class,null,true);
} }
...@@ -537,7 +539,10 @@ public class InputItemController extends AbstractBaseController { ...@@ -537,7 +539,10 @@ public class InputItemController extends AbstractBaseController {
String companyBizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode(); String companyBizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
List<PointInputItemVo> list = inputItemService.queryCustomInputItemNew(params,orgCode,companyBizOrgCode); List<PointInputItemVo> list = inputItemService.queryCustomInputItemNew(params,orgCode,companyBizOrgCode);
return CommonResponseUtil.success(list); Object ov=ToJson.tojson(list);
return CommonResponseUtil.success(ov);
} }
/** /**
* 条件查询检查项 * 条件查询检查项
......
...@@ -11,6 +11,7 @@ import com.yeejoin.amos.patrol.business.util.CommonResponseUtil; ...@@ -11,6 +11,7 @@ import com.yeejoin.amos.patrol.business.util.CommonResponseUtil;
import com.yeejoin.amos.patrol.business.util.PlanPageParamUtil; import com.yeejoin.amos.patrol.business.util.PlanPageParamUtil;
import com.yeejoin.amos.patrol.core.common.request.CommonPageable; import com.yeejoin.amos.patrol.core.common.request.CommonPageable;
import com.yeejoin.amos.patrol.core.common.request.CommonRequest; import com.yeejoin.amos.patrol.core.common.request.CommonRequest;
import com.yeejoin.amos.patrol.core.common.request.ToJson;
import com.yeejoin.amos.patrol.dao.entity.Plan; import com.yeejoin.amos.patrol.dao.entity.Plan;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -238,7 +239,8 @@ public class PlanController extends AbstractBaseController { ...@@ -238,7 +239,8 @@ public class PlanController extends AbstractBaseController {
public CommonResponse queryPointById(@ApiParam(value = "计划id", required = true) @PathVariable(name = "id") Long id) { public CommonResponse queryPointById(@ApiParam(value = "计划id", required = true) @PathVariable(name = "id") Long id) {
Plan plan = planService.queryPlanById(id); Plan plan = planService.queryPlanById(id);
return CommonResponseUtil.success(plan); Object ob= ToJson.tojson(plan);
return CommonResponseUtil.success(ob);
} }
......
...@@ -225,15 +225,14 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -225,15 +225,14 @@ public class PlanTaskController extends AbstractBaseController {
@ApiOperation(value = "执行计划导出", notes = "执行计划导出") @ApiOperation(value = "执行计划导出", notes = "执行计划导出")
@GetMapping (value = "/reportPlanTaskNew", produces = "application/vnd.ms-excel;charset=UTF-8") @GetMapping (value = "/reportPlanTaskNew", produces = "application/vnd.ms-excel;charset=UTF-8")
public void planTaskReportNew( public void planTaskReportNew(
@ApiParam(value = "导出参数", required = false) @RequestBody(required = false)PlanTaskPageParam params, @ApiParam(value = "导出参数", required = false) PlanTaskPageParam params,
HttpServletResponse response) { HttpServletResponse response) {
try { try {
PlanTaskPageParam paramsk =new PlanTaskPageParam();
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
paramsk.setBizOrgCode(reginParams.getPersonIdentity().getCompanyBizOrgCode()); params.setBizOrgCode(reginParams.getPersonIdentity().getCompanyBizOrgCode());
List<PlanTaskVo> list = planTaskService.planTaskReportNew(paramsk); List<PlanTaskVo> list = planTaskService.planTaskReportNew(params);
String fileName = "计划执行" + new Date().getTime(); String fileName = "计划执行" + new Date().getTime();
FileHelper.exportExcel(list, "计划执行", "计划执行", PlanTaskVo.class, fileName + ".xls", response); FileHelper.exportExcel(list, "计划执行", "计划执行", PlanTaskVo.class, fileName + ".xls", response);
} catch (Exception e) { } catch (Exception e) {
......
...@@ -20,6 +20,7 @@ import com.yeejoin.amos.patrol.business.vo.*; ...@@ -20,6 +20,7 @@ import com.yeejoin.amos.patrol.business.vo.*;
import com.yeejoin.amos.patrol.core.async.AsyncTask; import com.yeejoin.amos.patrol.core.async.AsyncTask;
import com.yeejoin.amos.patrol.core.common.request.CommonPageable; import com.yeejoin.amos.patrol.core.common.request.CommonPageable;
import com.yeejoin.amos.patrol.core.common.request.CommonRequest; import com.yeejoin.amos.patrol.core.common.request.CommonRequest;
import com.yeejoin.amos.patrol.core.common.request.ToJson;
import com.yeejoin.amos.patrol.core.common.response.PointResponse; import com.yeejoin.amos.patrol.core.common.response.PointResponse;
import com.yeejoin.amos.patrol.dao.entity.*; import com.yeejoin.amos.patrol.dao.entity.*;
import com.yeejoin.amos.patrol.feign.RemoteSecurityService; import com.yeejoin.amos.patrol.feign.RemoteSecurityService;
...@@ -117,10 +118,9 @@ public class PointController extends AbstractBaseController { ...@@ -117,10 +118,9 @@ public class PointController extends AbstractBaseController {
public CommonResponse queryEquipPointInputItemNew(@ApiParam(value = "巡检点id", required = true) @RequestParam Long pointId) { public CommonResponse queryEquipPointInputItemNew(@ApiParam(value = "巡检点id", required = true) @RequestParam Long pointId) {
try { try {
List<Map<String, Object>> pointInputItemList = iPointService.queryEquipPointInputItem(pointId); List<Map<String, Object>> pointInputItemList = iPointService.queryEquipPointInputItem(pointId);
Page<Map<String, Object>> pag =new PageImpl<Map<String, Object>>(pointInputItemList); Page<Map<String, Object>> pag =new PageImpl<Map<String, Object>>(pointInputItemList);
Object ov= ToJson.tojson(pag);
return CommonResponseUtil.success(pag); return CommonResponseUtil.success(ov);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
return CommonResponseUtil.failure("查询巡检点的巡检项失败"); return CommonResponseUtil.failure("查询巡检点的巡检项失败");
...@@ -926,7 +926,7 @@ public class PointController extends AbstractBaseController { ...@@ -926,7 +926,7 @@ public class PointController extends AbstractBaseController {
} else { } else {
downData.add(new String[0]); downData.add(new String[0]);
} }
String [] downRows = {"2","3","4", "8","11","12","13","14"}; //下拉的列序号数组(序号从0开始) String [] downRows = {"2","3","4", "8","10","11","12","13"}; //下拉的列序号数组(序号从0开始)
try { try {
FileHelper.createExcelTemplate(fileName, handers, downData, downRows, response); FileHelper.createExcelTemplate(fileName, handers, downData, downRows, response);
...@@ -1431,7 +1431,10 @@ public class PointController extends AbstractBaseController { ...@@ -1431,7 +1431,10 @@ public class PointController extends AbstractBaseController {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String companyBizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode(); String companyBizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
return CommonResponseUtil.success(iPointService.queryPointList4RouteNew(companyBizOrgCode,riskSourceId, pointNo, name, pageNumber, pageSize,companyId)); Page Page=iPointService.queryPointList4RouteNew(companyBizOrgCode,riskSourceId, pointNo, name, pageNumber, pageSize,companyId);
Object ob=ToJson.tojson(Page);
return CommonResponseUtil.success(ob);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -18,6 +18,7 @@ import com.yeejoin.amos.patrol.core.async.AsyncTask; ...@@ -18,6 +18,7 @@ import com.yeejoin.amos.patrol.core.async.AsyncTask;
import com.yeejoin.amos.patrol.core.common.request.CommonPageable; import com.yeejoin.amos.patrol.core.common.request.CommonPageable;
import com.yeejoin.amos.patrol.core.common.request.CommonRequest; import com.yeejoin.amos.patrol.core.common.request.CommonRequest;
import com.yeejoin.amos.patrol.core.common.request.RoutePointInputItemRequest; import com.yeejoin.amos.patrol.core.common.request.RoutePointInputItemRequest;
import com.yeejoin.amos.patrol.core.common.request.ToJson;
import com.yeejoin.amos.patrol.core.common.response.RoutePointRespone; import com.yeejoin.amos.patrol.core.common.response.RoutePointRespone;
import com.yeejoin.amos.patrol.dao.entity.InputItem; import com.yeejoin.amos.patrol.dao.entity.InputItem;
import com.yeejoin.amos.patrol.dao.entity.Plan; import com.yeejoin.amos.patrol.dao.entity.Plan;
...@@ -140,7 +141,10 @@ public class RouteController extends AbstractBaseController { ...@@ -140,7 +141,10 @@ public class RouteController extends AbstractBaseController {
//2.查询 //2.查询
List<Route> routeList = routeService.queryRouteListNew(orgCode); List<Route> routeList = routeService.queryRouteListNew(orgCode);
List<Route> list = routeList.stream().filter(e -> e.getIsExist().equals("true")).collect(Collectors.toList()); List<Route> list = routeList.stream().filter(e -> e.getIsExist().equals("true")).collect(Collectors.toList());
return CommonResponseUtil.success(!Objects.isNull(isRemove) && 1 == isRemove ? routeList : list);
return CommonResponseUtil.success(!Objects.isNull(isRemove) && 1 == isRemove ? ToJson.tojson(routeList) : ToJson.tojson(list));
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
return CommonResponseUtil.failure("查询巡检路线信息失败"); return CommonResponseUtil.failure("查询巡检路线信息失败");
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.patrol.business.dao.mapper; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.patrol.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.patrol.business.dto.InputItemExcelDto; import com.yeejoin.amos.patrol.business.dto.InputItemExcelDto;
import com.yeejoin.amos.patrol.business.dto.InputItemExcelVo;
import com.yeejoin.amos.patrol.business.param.InputItemPageParam; import com.yeejoin.amos.patrol.business.param.InputItemPageParam;
import com.yeejoin.amos.patrol.business.vo.InputItemVo; import com.yeejoin.amos.patrol.business.vo.InputItemVo;
import com.yeejoin.amos.patrol.business.vo.PointInputItemVo; import com.yeejoin.amos.patrol.business.vo.PointInputItemVo;
...@@ -31,7 +32,7 @@ public interface InputItemMapper extends BaseMapper<InputItem> { ...@@ -31,7 +32,7 @@ public interface InputItemMapper extends BaseMapper<InputItem> {
public List<InputItemVo> getInputItemInfoNew(InputItemPageParam param); public List<InputItemVo> getInputItemInfoNew(InputItemPageParam param);
public List<InputItemExcelDto> getInputItemInfoExcelNew(InputItemPageParam param); public List<InputItemExcelVo> getInputItemInfoExcelNew(InputItemPageParam param);
Map<Long, Long> getAllCountInfo(); Map<Long, Long> getAllCountInfo();
......
...@@ -71,7 +71,7 @@ public class InputItemExcelDto extends BaseDto { ...@@ -71,7 +71,7 @@ public class InputItemExcelDto extends BaseDto {
@ExplicitConstraint(indexNum=11,source = {"是","否"}) @ExplicitConstraint(indexNum=11,source = {"是","否"})
@ExcelProperty(value = "是否必填", index = 11) @ExcelProperty(value = "是否必填", index = 11)
@ApiModelProperty(value = "是否必填") @ApiModelProperty(value = "是否必填")
private String isMust = "0"; private String isMust = "";
@ExplicitConstraint(indexNum=12,source = {"是","否"}) @ExplicitConstraint(indexNum=12,source = {"是","否"})
@ExcelProperty(value = "是否评分", index = 12) @ExcelProperty(value = "是否评分", index = 12)
...@@ -298,20 +298,27 @@ public class InputItemExcelDto extends BaseDto { ...@@ -298,20 +298,27 @@ public class InputItemExcelDto extends BaseDto {
} }
public String getKeyPartsType() { public String getKeyPartsType() {
return keyPartsType.equals("是")?"0":"1"; return keyPartsType;
// keyPartsType.equals("是")?"0":"1";
} }
public void setKeyPartsType(String keyPartsType) { public void setKeyPartsType(String keyPartsType) {
this.keyPartsType = StringUtils.isEmpty(keyPartsType) ? "1":keyPartsType; // this.keyPartsType = StringUtils.isEmpty(keyPartsType) ? "1":keyPartsType;
this.keyPartsType =StringUtils.isNotEmpty(keyPartsType) ? (keyPartsType.equals("是")?"0":"1") :keyPartsType;
} }
public String getCustomType() { public String getCustomType() {
return customType.equals("是")?"0":"1"; return customType;
} }
public void setCustomType(String customType) { /* public void setCustomType(String customType) {
this.customType = StringUtils.isEmpty(customType) ? "1":customType; this.customType = StringUtils.isEmpty(customType) ? "1":customType;
}*/
public void setCustomType(String customType) {
this.customType =StringUtils.isNotEmpty(customType) ? (customType.equals("是")?"0":"1") :customType;
} }
public String getUnit() { public String getUnit() {
...@@ -347,11 +354,11 @@ public class InputItemExcelDto extends BaseDto { ...@@ -347,11 +354,11 @@ public class InputItemExcelDto extends BaseDto {
} }
public String getLevel() { public String getLevel() {
return level == null? null :String.valueOf(PointLevelEnum.getValue(level)); return level ;
} }
public void setLevel(String level) { public void setLevel(String level) {
this.level = level; this.level = level == null? null :String.valueOf(PointLevelEnum.getValue(level));
} }
public long getCatalogId() { public long getCatalogId() {
......
...@@ -179,6 +179,7 @@ public class PointServiceImpl implements IPointService { ...@@ -179,6 +179,7 @@ public class PointServiceImpl implements IPointService {
} }
@Override @Override
@Transactional
public List<Long> addImportPoint(List<PointImportParam> list, String orgCode, String userId) { public List<Long> addImportPoint(List<PointImportParam> list, String orgCode, String userId) {
List<Long> ids = new ArrayList<>(); List<Long> ids = new ArrayList<>();
...@@ -192,6 +193,21 @@ public class PointServiceImpl implements IPointService { ...@@ -192,6 +193,21 @@ public class PointServiceImpl implements IPointService {
if (count > 0) {// 该单位已存在该编号的点 if (count > 0) {// 该单位已存在该编号的点
continue; continue;
} }
if (ObjectUtils.isEmpty(param.getChargePersonId())) {
throw new BadRequest("责任人不能为空");
}
if (!ObjectUtils.isEmpty(param.getName())) {
List<Point> result = iPointDao.findByName(param.getName(), null);
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(result)) {
throw new BadRequest(param.getName()+"该名称巡检点已存在");
}
}
if (!ObjectUtils.isEmpty(param.getPointNo())) {
List<Point> result = iPointDao.findByNo(param.getPointNo(), null);
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(result)) {
throw new BadRequest(param.getPointNo()+"该编号已存在");
}
}
point.setAddress(param.getAddress()); point.setAddress(param.getAddress());
point.setCatalogId(param.getCatalogId() == null ? 0 : param.getCatalogId()); point.setCatalogId(param.getCatalogId() == null ? 0 : param.getCatalogId());
// 负责人 // 负责人
......
...@@ -309,6 +309,23 @@ ...@@ -309,6 +309,23 @@
ec.parent_id, ec.parent_id,
ec.CODE, ec.CODE,
ec.NAME, ec.NAME,
CONCAT(
ec.NAME,
CONCAT(
'(',
(
SELECT
count( 1 )
FROM
p_input_item pit
WHERE
pit.equipment_type = ec.CODE
AND pit.is_delete = 0
AND pit.biz_org_code LIKE concat( '%', #{bizOrgCode}, '%' )
),
')'
)
) AS countNAME,
ec.is_consumptive, ec.is_consumptive,
ec.description, ec.description,
ec.industry_code, ec.industry_code,
...@@ -326,38 +343,72 @@ ...@@ -326,38 +343,72 @@
<select id="getEquipmentCategoryListByFacilities" resultMap="Category"> <select id="getEquipmentCategoryListByFacilities" resultMap="Category">
SELECT ec.id, SELECT ec.id,
ec.parent_id, ec.parent_id,
ec.CODE, ec.CODE,
ec.NAME, ec.NAME,
ec.is_consumptive, CONCAT(
ec.description, ec.NAME,
ec.industry_code, CONCAT(
ec.remark, '(',
ec.create_date, (
i.`name` as industryName, SELECT
IF(LEFT(ec.CODE, 1) = 2 and ec.industry_code = 2, 'car', 'equipment') count( 1 )
AS type FROM
p_input_item pit
WHERE
pit.equipment_type = ec.CODE
AND pit.is_delete = 0
AND pit.biz_org_code LIKE concat( '%', #{bizOrgCode}, '%' )
),
')'
)
) AS countNAME,
ec.is_consumptive,
ec.description,
ec.industry_code,
ec.remark,
ec.create_date,
i.`name` as industryName,
IF(LEFT(ec.CODE, 1) = 2 and ec.industry_code = 2, 'car', 'equipment')
AS type
FROM wl_equipment_category ec FROM wl_equipment_category ec
left join wl_industry i on ec.industry_code = i.code left join wl_industry i on ec.industry_code = i.code
WHERE WHERE
ec.code LIKE CONCAT ('930','%') ec.code LIKE CONCAT ('930','%')
UNION ALL UNION ALL
SELECT ec.id, SELECT ec.id,
ec.parent_id, ec.parent_id,
ec.code as CODE, ec.code as CODE,
ec.NAME, ec.NAME,
ec.is_consumptive, CONCAT(
ec.description, ec.NAME,
ec.industry_code, CONCAT(
ec.remark, '(',
ec.create_date, (
i.`name` as industryName, SELECT
IF(LEFT(ec.CODE, 1) = 2 and ec.industry_code = 2, 'car', 'equipment') count( 1 )
AS type FROM
p_input_item pit
WHERE
pit.equipment_type = ec.CODE
AND pit.is_delete = 0
AND pit.biz_org_code LIKE concat( '%', 'LSHLZ1yOrS3WfXqzjn', '%' )
),
')'
)
) AS countNAME,
ec.is_consumptive,
ec.description,
ec.industry_code,
ec.remark,
ec.create_date,
i.`name` as industryName,
IF(LEFT(ec.CODE, 1) = 2 and ec.industry_code = 2, 'car', 'equipment')
AS type
FROM wl_equipment_category ec FROM wl_equipment_category ec
left join wl_industry i on ec.industry_code = i.code left join wl_industry i on ec.industry_code = i.code
WHERE WHERE
<!-- (ec.code LIKE CONCAT ('92','%') and ec.parent_id = '1302863809086623746') or (ec.code LIKE CONCAT ('92','%') and ec.parent_id = '846')--> <!-- (ec.code LIKE CONCAT ('92','%') and ec.parent_id = '1302863809086623746') or (ec.code LIKE CONCAT ('92','%') and ec.parent_id = '846')-->
ec.code like CONCAT ('92', '%') ec.code like CONCAT ('92', '%')
</select> </select>
...@@ -555,4 +606,24 @@ ...@@ -555,4 +606,24 @@
AND is_delete = '0' AND is_delete = '0'
AND input_type!='1' AND input_type!='1'
</select> </select>
<select id="getEquipItemCount" resultType="java.lang.String">
SELECT
CONCAT('(' , COUNT(1) ,')') as countName
FROM
p_input_item pit
WHERE
pit.equipment_type is not null
AND is_delete = 0
AND pit.biz_org_code LIKE concat( '%', #{bizOrgCode}, '%' )
</select>
<select id="getFireItemCount" resultType="java.lang.String">
SELECT
CONCAT('(' , COUNT(1) ,')') as countName
FROM
p_input_item pit
WHERE
pit.facilities_type is not null
AND is_delete = 0
AND pit.biz_org_code LIKE concat( '%', #{bizOrgCode}, '%' )
</select>
</mapper> </mapper>
...@@ -4222,8 +4222,40 @@ ...@@ -4222,8 +4222,40 @@
if (SUM(a1.lastAlarmNum)>0,IFNULL( convert( ABS(SUM(a1.alarmNum)-SUM(a1.lastAlarmNum))/SUM(a1.lastAlarmNum),char(5)),'-'),ABS(SUM(a1.alarmNum)-SUM(a1.lastAlarmNum)))*100 as alarmWOW, if (SUM(a1.lastAlarmNum)>0,IFNULL( convert( ABS(SUM(a1.alarmNum)-SUM(a1.lastAlarmNum))/SUM(a1.lastAlarmNum),char(5)),'-'),ABS(SUM(a1.alarmNum)-SUM(a1.lastAlarmNum)))*100 as alarmWOW,
(CASE WHEN (SUM(a1.exepctionNum)-SUM(a1.lastExepctionNum)) &lt;0 THEN '减少' else '增加' end ) as status1, (CASE WHEN (SUM(a1.exepctionNum)-SUM(a1.lastExepctionNum)) &lt;0 THEN '减少' else '增加' end ) as status1,
(CASE WHEN (SUM(a1.alarmNum)-SUM(a1.lastAlarmNum)) &lt;0 THEN '减少' else '增加' end ) as status2, (CASE WHEN (SUM(a1.alarmNum)-SUM(a1.lastAlarmNum)) &lt;0 THEN '减少' else '增加' end ) as status2,
FORMAT(if(SUM(a1.num)>0, convert(SUM(a1.num - a1.exepctionNum)/SUM(a1.num),char(5)), SUM(a1.num - a1.exepctionNum))*100, 2) as normalRate, FORMAT(
FORMAT(if(SUM(a1.num)>0,convert(SUM(a1.faultNum)/SUM(a1.num),char(5)),SUM(a1.faultNum)) *100, 2) as faultRate, IF
(
SUM( a1.num ) > 0,
(
abs(
(
SUM( a1.num - a1.exepctionNum ) /
IF
( SUM( a1.num ) = 0, 1, SUM( a1.num ) )
)
)
),
SUM( a1.num - a1.exepctionNum )
) * 100,
2
) AS normalRate,
FORMAT(
IF
(
SUM( a1.num ) > 0,
(
abs(
(
SUM( a1.faultNum ) /
IF
( SUM( a1.num ) = 0, 1, SUM( a1.num ) )
)
)
),
SUM( a1.faultNum )
) * 100,
2
) AS faultRate,
a1.create_date a1.create_date
from from
(SELECT (SELECT
......
...@@ -179,48 +179,19 @@ ...@@ -179,48 +179,19 @@
ORDER BY create_date DESC ORDER BY create_date DESC
</select> </select>
<select id="queryCustomInputItemByPointId" resultType="com.yeejoin.amos.patrol.business.vo.PointInputItemVo"> <select id="queryCustomInputItemByPointId" resultType="com.yeejoin.amos.patrol.business.vo.PointInputItemVo">
-- SELECT
-- pii.id,
-- pii.org_code,
-- pii.name,
-- ppi.order_no as order_no,
-- pii.item_type ,
-- pii.is_must,
-- pii.input_json,
-- pii.catalog_id,
-- pii.is_delete,
-- pii.item_no,
-- pii.risk_desc,
-- pii.input_classify,
-- pii.picture_json,
-- pii.check_method,
-- pii.title,
-- pii.equipment_name,
-- pii.input_type,
-- pii.basis_json,
-- pii.level
-- FROM
-- p_point_classify ppc
-- LEFT JOIN p_point_inputitem ppi ON ppi.classify_ids = ppc.id
-- LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id
--
-- WHERE pii.is_delete = '0'
SELECT SELECT
pii.*, pii.*,
ppi.order_no as pOrderNo, ppi.order_no as pOrderNo,
ppi.id as pointItemId, ppi.id as pointItemId,
ppc.name as classifyNames, ppc.name as classifyNames,
ppc.id as classifyIds ppc.id as classifyIds
<!-- ,prpi.id as routePointItemId-->
FROM FROM
p_point_classify ppc p_point_classify ppc
LEFT JOIN p_point_inputitem ppi ON ppi.classify_ids = ppc.id and ppc.point_id=ppi.point_id LEFT JOIN p_point_inputitem ppi ON ppi.classify_ids = ppc.id and ppc.point_id=ppi.point_id
LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id
<!-- lEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = pii.id-->
WHERE pii.is_delete = '0' WHERE pii.is_delete = '0'
<if test="classifyId!=null and classifyId !='' "> AND ppc.id = #{classifyId}</if> <if test="classifyId!=null and classifyId !='' "> AND ppi.classify_ids = #{classifyId}</if>
<!-- <if test="pointId!=null and pointId !='' "> AND ppc.point_id = #{pointId}</if>-->
<!-- <if test="equipmentId!=null and equipmentId !='' "> AND ppc.equipment_id = #{equipmentId}</if>-->
</select> </select>
<select id="getInputItemListByitemNos" resultType="com.yeejoin.amos.patrol.business.vo.InputItemVo"> <select id="getInputItemListByitemNos" resultType="com.yeejoin.amos.patrol.business.vo.InputItemVo">
SELECT SELECT
...@@ -388,8 +359,8 @@ ...@@ -388,8 +359,8 @@
</choose> </choose>
</select> </select>
<select id="getInputItemInfoExcelNew" resultType="com.yeejoin.amos.patrol.business.dto.InputItemExcelDto"> <select id="getInputItemInfoExcelNew" resultType="com.yeejoin.amos.patrol.business.dto.InputItemExcelVo">
SELECT SELECT
a.id, a.id,
a.name, a.name,
a.item_no, a.item_no,
...@@ -402,40 +373,29 @@ ...@@ -402,40 +373,29 @@
a.input_classify, a.input_classify,
a.check_method, a.check_method,
(CASE a.equipment_type (CASE a.equipment_type
WHEN a.equipment_type is not null and a.equipment_type = '-1' WHEN '-1'
THEN '通用消防装备' THEN '通用消防装备'
ELSE ELSE
(select name from wl_equipment_category where code = a.equipment_type AND industry_code = 2) (select name from wl_equipment_category where code = a.equipment_type AND industry_code = 2)
END) as equipment_type, END) as equipment_type,
(CASE a.facilities_type (CASE a.facilities_type
WHEN a.facilities_type is not null and a.facilities_type = '-1' WHEN '-1'
THEN '通用消防设施' THEN '通用消防设施'
ELSE (select name from wl_equipment_category where code = a.facilities_type AND industry_code = 2) ELSE (select name from wl_equipment_category where code = a.facilities_type AND industry_code = 2)
END) as facilities_type, END) as facilities_type,
(CASE a.level (CASE a.level
WHEN 1 THEN WHEN 1 THEN
'1级' '级'
WHEN 2 THEN WHEN 2 THEN
'2级' '级'
WHEN 3 THEN WHEN 3 THEN
'3级' '级'
WHEN 4 THEN WHEN 4 THEN
'4级' '级'
ELSE ELSE
'5级' '五级'
END )AS level, IFNULL(a.key_parts_type,1) AS keyPartsType,
(CASE a.key_parts_type IFNULL(a.custom_type,1) AS customType,
WHEN 0 THEN
'是'
WHEN 1 THEN
'否'
END )AS keyPartsType,
(CASE a.custom_type
WHEN 0 THEN
'是'
WHEN 1 THEN
'否'
END )AS customType,
a.risk_desc, a.risk_desc,
a.data_json a.data_json
from from
......
...@@ -22,15 +22,15 @@ ...@@ -22,15 +22,15 @@
<!-- OR--> <!-- OR-->
<!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{beginDate} AND a.end_Time <![CDATA[>=]]> #{endDate}</if>)--> <!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{beginDate} AND a.end_Time <![CDATA[>=]]> #{endDate}</if>)-->
<!-- )--> <!-- )-->
<if test="beginDate!=null and endDate!=null and endDate != '' and endDate == null"> <if test="beginDate!=null and endDate!=null and endDate != '' and beginDate != ''">
and a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate} and a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate}
</if> </if>
<if test="beginDate==null and endDate != null and endDate != ''"> <if test="beginDate=='' and endDate != null and endDate != ''">
AND a.end_Time <![CDATA[<=]]> #{endDate} AND a.end_Time <![CDATA[<=]]> #{endDate}
</if> </if>
<if test="beginDate!=null and beginDate != '' and endDate == null"> <if test="beginDate!=null and beginDate != '' and endDate == ''">
and a.begin_Time <![CDATA[>=]]> #{beginDate} and a.begin_Time <![CDATA[>=]]> #{beginDate}
</if> </if>
...@@ -103,15 +103,15 @@ ...@@ -103,15 +103,15 @@
<!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{beginDate} AND a.end_Time <![CDATA[>=]]> #{endDate}</if>)--> <!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{beginDate} AND a.end_Time <![CDATA[>=]]> #{endDate}</if>)-->
<!-- )--> <!-- )-->
<if test="beginDate!=null and endDate!=null and endDate != '' and endDate == null"> <if test="beginDate!=null and endDate!=null and endDate != '' and beginDate != ''">
and a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate} and a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate}
</if> </if>
<if test="beginDate==null and endDate != null and endDate != ''"> <if test="beginDate=='' and endDate != null and endDate != ''">
AND a.end_Time <![CDATA[<=]]> #{endDate} AND a.end_Time <![CDATA[<=]]> #{endDate}
</if> </if>
<if test="beginDate!=null and beginDate != '' and endDate == null"> <if test="beginDate!=null and beginDate != '' and endDate == ''">
and a.begin_Time <![CDATA[>=]]> #{beginDate} and a.begin_Time <![CDATA[>=]]> #{beginDate}
</if> </if>
......
...@@ -1082,9 +1082,6 @@ ...@@ -1082,9 +1082,6 @@
LEFT JOIN p_point_classify ppc ON ppc.point_id = p.id LEFT JOIN p_point_classify ppc ON ppc.point_id = p.id
<where> <where>
p.is_delete = 0 p.is_delete = 0
<if test="orgCode !=null and orgCode !=''">
and p.org_code = #{orgCode}
</if>
<if test="bizOrgCode !=null and bizOrgCode !=''"> <if test="bizOrgCode !=null and bizOrgCode !=''">
and p.biz_org_code like CONCAT(#{bizOrgCode},'%') and p.biz_org_code like CONCAT(#{bizOrgCode},'%')
</if> </if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment