Commit b1d72671 authored by 单奇雲's avatar 单奇雲

bug

parent 340b3168
...@@ -45,6 +45,9 @@ public class AccidentTypeController extends BaseController { ...@@ -45,6 +45,9 @@ public class AccidentTypeController extends BaseController {
public CommonResponse queryRiskLevelPage(@ApiParam(value = "查询条件", required = false) @RequestBody(required = false) List<CommonRequest> queryRequests, public CommonResponse queryRiskLevelPage(@ApiParam(value = "查询条件", required = false) @RequestBody(required = false) List<CommonRequest> queryRequests,
@ApiParam(value = "分页参数", required = true) CommonPageable commonPageable) { @ApiParam(value = "分页参数", required = true) CommonPageable commonPageable) {
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable); CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
param.setOrgCode(orgCode);
Page<HashMap<String, Object>> list = iAccidentTypeService.queryAccidentTypePage(getToken(),getProduct(),getAppKey(),param); Page<HashMap<String, Object>> list = iAccidentTypeService.queryAccidentTypePage(getToken(),getProduct(),getAppKey(),param);
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
} }
......
...@@ -57,6 +57,8 @@ public class CommonPageInfoParam extends CommonPageable { ...@@ -57,6 +57,8 @@ public class CommonPageInfoParam extends CommonPageable {
*/ */
private Long riskSourceId; private Long riskSourceId;
private String orgCode;
public String getEquipType() { public String getEquipType() {
return equipType; return equipType;
} }
...@@ -146,4 +148,18 @@ public class CommonPageInfoParam extends CommonPageable { ...@@ -146,4 +148,18 @@ public class CommonPageInfoParam extends CommonPageable {
public void setRiskSourceId(Long riskSourceId) { public void setRiskSourceId(Long riskSourceId) {
this.riskSourceId = riskSourceId; this.riskSourceId = riskSourceId;
} }
/**
* @return the orgCode
*/
public String getOrgCode() {
return orgCode;
}
/**
* @param orgCode the orgCode to set
*/
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
} }
...@@ -15,7 +15,7 @@ public class FireEquipmentParam { ...@@ -15,7 +15,7 @@ public class FireEquipmentParam {
@Excel(name = "装备分类(设备类_0,耗材类_1,视频监控_2,灭火器材_3)", replace = {"设备类_0", "耗材类_1", "视频监控_2", "灭火器材_3"}, orderNum = "2") @Excel(name = "装备分类(设备类_0,耗材类_1,视频监控_2,灭火器材_3)", replace = {"设备类_0", "耗材类_1", "视频监控_2", "灭火器材_3"}, orderNum = "2")
private Integer equipClassify; private Integer equipClassify;
@Excel(name = "装备类型", orderNum = "3") @Excel(name = "装备类型(必填)", orderNum = "3")
private String equipType; private String equipType;
@Excel(name = "三维坐标", orderNum = "4") @Excel(name = "三维坐标", orderNum = "4")
...@@ -27,7 +27,7 @@ public class FireEquipmentParam { ...@@ -27,7 +27,7 @@ public class FireEquipmentParam {
@Excel(name = "是否室内(必填 0/1)", replace = {"否_0", "是_1"}, orderNum = "6") @Excel(name = "是否室内(必填 0/1)", replace = {"否_0", "是_1"}, orderNum = "6")
private Integer isIndoor; private Integer isIndoor;
@Excel(name = "装备名称", orderNum = "7") @Excel(name = "装备名称(必填)", orderNum = "7")
private String name; private String name;
@Excel(name = "保养周期", orderNum = "8") @Excel(name = "保养周期", orderNum = "8")
......
...@@ -9,7 +9,7 @@ public class WaterResourceParam { ...@@ -9,7 +9,7 @@ public class WaterResourceParam {
@Excel(name = "编号(必填)", width = 20) @Excel(name = "编号(必填)", width = 20)
private String code; private String code;
@Excel(name = "名称", orderNum = "1", width = 20) @Excel(name = "名称(必填)", orderNum = "1", width = 20)
private String name; private String name;
@Excel(name = "类型(消火栓_1,消防水池_2,喷淋_3)", replace = {"消火栓_1", "消防水池_2", "喷淋_3"}, orderNum = "3") @Excel(name = "类型(消火栓_1,消防水池_2,喷淋_3)", replace = {"消火栓_1", "消防水池_2", "喷淋_3"}, orderNum = "3")
......
...@@ -14,6 +14,7 @@ import com.yeejoin.amos.fas.business.param.FireEquipmentPointParam; ...@@ -14,6 +14,7 @@ import com.yeejoin.amos.fas.business.param.FireEquipmentPointParam;
import com.yeejoin.amos.fas.business.param.WaterResourceParam; import com.yeejoin.amos.fas.business.param.WaterResourceParam;
import com.yeejoin.amos.fas.business.service.intfc.IExcelService; import com.yeejoin.amos.fas.business.service.intfc.IExcelService;
import com.yeejoin.amos.fas.business.service.intfc.IFireEquipPontService; import com.yeejoin.amos.fas.business.service.intfc.IFireEquipPontService;
import com.yeejoin.amos.fas.business.util.StringUtil;
import com.yeejoin.amos.fas.core.util.CommonResponse; import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.dao.entity.RiskSource; import com.yeejoin.amos.fas.dao.entity.RiskSource;
import com.yeejoin.amos.fas.dao.entity.WaterResource; import com.yeejoin.amos.fas.dao.entity.WaterResource;
...@@ -60,6 +61,12 @@ public class ExcelServiceImpl implements IExcelService { ...@@ -60,6 +61,12 @@ public class ExcelServiceImpl implements IExcelService {
List<FireEquipmentParam> saveList = Lists.newArrayList(); List<FireEquipmentParam> saveList = Lists.newArrayList();
List<FireEquipmentParam> updateList = Lists.newArrayList(); List<FireEquipmentParam> updateList = Lists.newArrayList();
list.forEach(fireEquipment -> { list.forEach(fireEquipment -> {
if(!StringUtil.isNotEmpty(fireEquipment.getEquipType())
|| !StringUtil.isNotEmpty(fireEquipment.getName())
|| !StringUtil.isNotEmpty(fireEquipment.getCode())) {
throw new YeeException("请检查必填项是否为空!");
}
String code = fireEquipment.getCode(); String code = fireEquipment.getCode();
String riskSourceCode = fireEquipment.getRiskSourceCode(); String riskSourceCode = fireEquipment.getRiskSourceCode();
Optional<RiskSource> riskSourceOptional = riskSourceDao.findByCode(riskSourceCode); Optional<RiskSource> riskSourceOptional = riskSourceDao.findByCode(riskSourceCode);
...@@ -68,6 +75,12 @@ public class ExcelServiceImpl implements IExcelService { ...@@ -68,6 +75,12 @@ public class ExcelServiceImpl implements IExcelService {
}else { }else {
throw new YeeException("编号: [" + riskSourceCode + "] 风险区域不存在!"); throw new YeeException("编号: [" + riskSourceCode + "] 风险区域不存在!");
} }
if(fireEquipment.getMaintenanceCycle() == null) {
fireEquipment.setMaintenanceCycle(0);
}
if(fireEquipment.getNumber() == null) {
fireEquipment.setNumber(0);
}
FireEquipmentEntity fireEquipmentEntity = equipmentMap.get(code); FireEquipmentEntity fireEquipmentEntity = equipmentMap.get(code);
if (fireEquipmentEntity == null) { if (fireEquipmentEntity == null) {
saveList.add(fireEquipment); saveList.add(fireEquipment);
...@@ -147,6 +160,10 @@ public class ExcelServiceImpl implements IExcelService { ...@@ -147,6 +160,10 @@ public class ExcelServiceImpl implements IExcelService {
List<WaterResourceParam> saveList = Lists.newArrayList(); List<WaterResourceParam> saveList = Lists.newArrayList();
List<WaterResourceParam> updateList = Lists.newArrayList(); List<WaterResourceParam> updateList = Lists.newArrayList();
list.forEach(warerRes -> { list.forEach(warerRes -> {
if(!StringUtil.isNotEmpty(warerRes.getName())
|| !StringUtil.isNotEmpty(warerRes.getCode())) {
throw new YeeException("请检查必填项是否为空!");
}
String riskSourceCode = warerRes.getRiskSourceCode(); String riskSourceCode = warerRes.getRiskSourceCode();
Optional<RiskSource> riskSourceOptional = riskSourceDao.findByCode(riskSourceCode); Optional<RiskSource> riskSourceOptional = riskSourceDao.findByCode(riskSourceCode);
if(riskSourceOptional.isPresent()) { if(riskSourceOptional.isPresent()) {
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
f_accident_type a f_accident_type a
<trim prefix="WHERE" prefixOverrides="AND "> <trim prefix="WHERE" prefixOverrides="AND ">
<if test="name!=null"> and a.name like concat(concat("%",#{name}),"%") </if> <if test="name!=null"> and a.name like concat(concat("%",#{name}),"%") </if>
<if test="orgCode!=null"> and (a.org_code like concat(#{orgCode},'%') OR a.org_code = #{orgCode})</if>
</trim> </trim>
</select> </select>
<!--分页查询 --> <!--分页查询 -->
...@@ -51,6 +52,7 @@ ...@@ -51,6 +52,7 @@
left join f_evaluation_model fem on fem.id = a.evaluation_sid left join f_evaluation_model fem on fem.id = a.evaluation_sid
<trim prefix="WHERE" prefixOverrides="AND "> <trim prefix="WHERE" prefixOverrides="AND ">
<if test="name!=null"> and a.name like concat(concat("%",#{name}),"%") </if> <if test="name!=null"> and a.name like concat(concat("%",#{name}),"%") </if>
<if test="orgCode!=null"> and (a.org_code like concat(#{orgCode},'%') OR a.org_code = #{orgCode})</if>
</trim> </trim>
order by a.id order by a.id
<choose> <choose>
......
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