Commit 7bce00eb authored by chenzhao's avatar chenzhao

修改检查项导入导出模板下载中问题

parent a9a1ca7e
...@@ -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;
...@@ -370,9 +371,9 @@ public class InputItemController extends AbstractBaseController { ...@@ -370,9 +371,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 +396,7 @@ public class InputItemController extends AbstractBaseController { ...@@ -395,7 +396,7 @@ public class InputItemController extends AbstractBaseController {
} }
} }
ExcelUtil.createTemplate(response,"检查项","检查项",content,InputItemExcelDto.class,null,true); ExcelUtil.createTemplate(response,"检查项","检查项",content,InputItemExcelVo.class,null,true);
} }
......
...@@ -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.isEmpty(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.isEmpty(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() {
......
...@@ -388,7 +388,7 @@ ...@@ -388,7 +388,7 @@
</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,
...@@ -402,27 +402,27 @@ ...@@ -402,27 +402,27 @@
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, END )AS level,
(CASE a.key_parts_type (CASE a.key_parts_type
WHEN 0 THEN WHEN 0 THEN
......
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