Commit 43b5268e authored by chenhao's avatar chenhao

提交孔繁明修改的字典表数据模型逻辑、和bug

parents bb09a3c3 7d9ff827
......@@ -8,6 +8,7 @@ import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.boot.biz.common.dto.DataDictionaryDto;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -111,6 +112,21 @@ public class DataDictionaryController extends BaseController {
return iDataDictionaryService.getById(id);
}
/**
* 根据id查询
*
* @param code
* @return
*/
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/code", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据code查询", notes = "根据code查询")
public DataDictionary selectByCode(HttpServletRequest request,@RequestParam("code") String code,@RequestParam("type") String type) {
return iDataDictionaryService.getByCode(code,type);
}
/**
* 列表分页查询
*
......@@ -163,7 +179,7 @@ public class DataDictionaryController extends BaseController {
@RequestMapping(value = "/gwmcDataDictionary/{type}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典", notes = "根据字典类型查询字典")
public ResponseModel<Object> gwmcDataDictionary(@PathVariable String type) throws Exception {
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
......@@ -173,7 +189,7 @@ public class DataDictionaryController extends BaseController {
return ResponseHelper.buildResponse(obj);
} else {
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName",
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2, "getName",
"getParent", null);
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type, JSON.toJSON(menus), time);
return ResponseHelper.buildResponse(menus);
......@@ -184,7 +200,7 @@ public class DataDictionaryController extends BaseController {
@RequestMapping(value = "/dataDictionary", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典2", notes = "根据字典类型查询字典2")
public ResponseModel<Object> getDictionary(@RequestParam String type) throws Exception {
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
......@@ -194,7 +210,7 @@ public class DataDictionaryController extends BaseController {
return ResponseHelper.buildResponse(obj);
} else {
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName",
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2, "getName",
"getParent", null);
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type, JSON.toJSON(menus), time);
return ResponseHelper.buildResponse(menus);
......@@ -205,7 +221,7 @@ public class DataDictionaryController extends BaseController {
@RequestMapping(value = "/gwmcDataDictionary/FireChemical/{type}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询危险品字典", notes = "根据字典类型查询危险品字典")
public ResponseModel<Object> gwmcDataDictionaryFireChemical(@PathVariable String type) throws Exception {
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
......@@ -215,7 +231,7 @@ public class DataDictionaryController extends BaseController {
return ResponseHelper.buildResponse(obj);
} else {
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0,
List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2,
"getName", "getParent", null);
MenuFrom Me = new MenuFrom("-1", "-1", "-1", "危化品库", "危化品库", "危化品库", "-1", null);
Me.setIsLeaf(false);
......@@ -242,7 +258,8 @@ public class DataDictionaryController extends BaseController {
} else {
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<MenuFrom> menus = null;
menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0, "getName",
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2, "getName",
"getParent", null);
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE_XIN + type, JSON.toJSON(menus), time);
objectObjectHashMap.put(type, menus);
......@@ -268,11 +285,13 @@ public class DataDictionaryController extends BaseController {
List<Menu> menus =null;
if ("YJLDDW".equals(type)) {
list = dataDictionaryMapper.getNoInLinkUnit();
menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName", "getParent",
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2, "getName", "getParent",
null);
} else {
list = iDataDictionaryService.list(queryWrapper);
menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName", "getParent",
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2, "getName", "getParent",
null);
}
// 创建根节点
......@@ -283,4 +302,6 @@ public class DataDictionaryController extends BaseController {
return ResponseHelper.buildResponse(menuList);
}
}
......@@ -22,4 +22,10 @@ public interface DataDictionaryMapper extends BaseMapper<DataDictionary> {
* @return
*/
public List<DataDictionary> getNoInLinkUnit();
/**
* 根据code值查询
* @return
*/
public DataDictionary getByCode(String code,String type);
}
......@@ -37,6 +37,9 @@ public class DataDictionary extends BaseEntity {
@ApiModelProperty(value = "父级")
private Long parent;
@ApiModelProperty(value = "类型说明")
private String typeDesc;
//新加排序字段
@ApiModelProperty(value = "排序字段")
private int sortNum;
......
......@@ -48,7 +48,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
return obj;
} else {
Collection<DataDictionary> list = this.list(queryWrapper);
List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0,
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2,
"getName", "getParent", null);
MenuFrom Me = new MenuFrom("-1", "-1", "-1", "危化品库", "危化品库", "危化品库", "-1", null);
Me.setIsLeaf(false);
......@@ -69,7 +70,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
return obj;
} else {
Collection<DataDictionary> list = this.list(queryWrapper);
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName"
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2, "getName"
, "getParent", null);
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type, JSON.toJSON(menus), time);
return menus;
......@@ -82,12 +84,19 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
queryWrapper.orderByAsc("sort_num");
Collection<DataDictionary> list = this.list(queryWrapper);
List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0, "getName"
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2, "getName"
, "getParent", null);
return menus;
}
public DataDictionary getByCode(String code,String type) {
DataDictionary byCode = dataDictionaryMapper.getByCode(code,type);
return byCode;
}
public List<DataDictionary> getDataDictionaryAndCount(){
List<DataDictionary> list= dataDictionaryMapper.getDataDictionaryListAndCount();
......
......@@ -47,4 +47,14 @@ WHERE
cbb.type = 'YJLDDW' and cbb.is_delete = 0
AND elink.count IS NOT NULL
</select>
<select id ="getByCode" resultType="com.yeejoin.amos.boot.biz.common.entity.DataDictionary">
SELECT
*
FROM
cb_data_dictionary cbb
WHERE
cbb.code = #{code} and cbb.is_delete = 0 and cbb.type = #{type}
</select>
</mapper>
......@@ -11,6 +11,8 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
/**
* 工作经历
*
......@@ -29,9 +31,11 @@ public class FirefightersWorkexperience extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "参加工作时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date workingHours;
@ApiModelProperty(value = "参加消防部门工作时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date fireWorkingHours;
@ApiModelProperty(value = "人员id")
......
......@@ -19,15 +19,15 @@ import java.util.Map;
* @date 2021-06-28
*/
public interface FireStationMapper extends BaseMapper<FireStation> {
// 微型消防站按时间倒叙排列add order by cb_fire_station.rec_date desc 2021-09-08 by kongfm
@Select("<script>"
+ "select * from cb_fire_station where cb_fire_station.is_delete=0 "
+ "<if test='par.name!=null'> and cb_fire_station.name like CONCAT('%',#{par.name},'%') </if>"
+ "<if test='par.bizCompanyId!=null'> and cb_fire_station.biz_company_id = #{par.bizCompanyId} </if>"
+ "<if test='par.bizCompanyCode!=null'> and cb_fire_station.biz_company_code like CONCAT('',#{par.bizCompanyCode},'%') </if>"
+"limit #{pageNum},#{pageSize}"
+" order by cb_fire_station.rec_date desc limit #{pageNum},#{pageSize}"
+ "</script>")
List<FireStationDto>getFireStation(@Param("pageNum")int pageNum,@Param("pageSize")int pageSize,@Param("par")FireStationDto par);
@Select("<script>"
......
......@@ -28,7 +28,7 @@
</if>
</select>
<!--消防队伍列表按时间倒叙排列order by x.rec_date desc 2021-09-08 by kongfm -->
<select id="getFireTeamForPage" resultType="com.yeejoin.amos.boot.module.common.api.dto.FireTeamCardDto">
SELECT
a.sequence_nbr sequenceNbr,
......@@ -63,6 +63,7 @@
and a.sequence_nbr = #{par.nodeId}
</if>
</if>
order by a.rec_date desc
</select>
<select id="listFireTeamDto" resultType="com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto">
select t.*, p.name parentName
......@@ -70,6 +71,8 @@
left join cb_fire_team p on t.parent = p.sequence_nbr
where t.is_delete = #{isDelete}
</select>
<!--消防队伍列表按时间倒叙排列order by x.rec_date desc 2021-09-08 by kongfm -->
<select id="listFireTeamById" resultType="com.yeejoin.amos.boot.module.common.api.entity.FireTeam">
SELECT *
FROM cb_fire_team
......@@ -77,6 +80,7 @@
<if test="teamId != null">
AND tree_code LIKE CONCAT((SELECT tree_code FROM cb_fire_team WHERE sequence_nbr = #{teamId}),'%');
</if>
order by cb_fire_team.rec_date desc
</select>
......
......@@ -9,7 +9,7 @@
where a.is_delete = 0
GROUP BY a.job_title_code
</select>
<!--消防队员列表按时间倒叙排列add desc 2021-09-08 by kongfm -->
<select id="getFirefighters"
resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto">
select a.*,b.areas_expertise areasExpertise ,b.areas_expertise_code areasExpertiseCode from cb_firefighters a LEFT JOIN cb_firefighters_post b on
......@@ -22,9 +22,9 @@
<if test='par.jobTitle!=null'>and a.job_title_code =#{par.jobTitle}</if>
<if test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code =#{par.areasExpertiseCode}</if>
<if test='par.areasExpertiseCode=="0"'>and b.areas_expertise_code is not null</if>
ORDER BY a.rec_date limit #{pageNum},#{pageSize}
ORDER BY a.rec_date desc limit #{pageNum},#{pageSize}
</select>
<!--消防队员列表按时间倒叙排列add desc 2021-09-08 by kongfm -->
<select id="getFirefightersCount" resultType="Map">
select COUNT(a.sequence_nbr) num from cb_firefighters a LEFT JOIN
cb_firefighters_post b on a.sequence_nbr=b.firefighters_id where
......@@ -38,7 +38,7 @@
<if test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code =#{par.areasExpertiseCode}</if>
<if test='par.areasExpertiseCode=="0"'>and b.areas_expertise_code is not null</if>
ORDER BY a.rec_date
ORDER BY a.rec_date desc
</select>
......
......@@ -130,7 +130,7 @@
b.instance_id=a.instance_id where a.unit_name is not null
</select>
<!--联动单位列表按时间倒叙排列add order by clu.rec_date desc 同时处理单位根节点-1时查询全部数据问题 2021-09-08 by kongfm -->
<select id="getEmergencyLinkageUnitList"
resultType="java.util.Map">
SELECT
......@@ -189,12 +189,15 @@
AND clu.linkage_unit_type =#{linkageUnitType}
</if>
<if
test="emergencyLinkageUnitCode != null and emergencyLinkageUnitCode != ''">
AND clu.emergency_linkage_unit_code =#{emergencyLinkageUnitCode}
test="emergencyLinkageUnitCode != null and emergencyLinkageUnitCode != '' ">
<if test="emergencyLinkageUnitCode != '-1'">
AND clu.emergency_linkage_unit_code =#{emergencyLinkageUnitCode}
</if>
</if>
<if
test="linkageUnitTypeCode != null and linkageUnitTypeCode != ''">
AND clu.linkage_unit_type_code =#{linkageUnitTypeCode}
</if>
order by clu.rec_date desc
</select>
</mapper>
......@@ -52,7 +52,7 @@
</if>
</select>
<!--机场单位人员按时间倒叙排列add order by u.rec_date desc 2021-09-08 by kongfm -->
<select id="selectPersonList" resultType="Map">
select * from (
SELECT
......@@ -86,6 +86,7 @@
u.sequence_nbr ,
u.biz_org_name ,
u.biz_org_code
order by u.rec_date desc
)a where a.sequenceNbr is not null
<if test="map.fieldsValue != null">
<foreach collection="map.fieldsValue.keys" item="item">AND a.${item} = #{map.fieldsValue[${item}]}</foreach>
......@@ -159,6 +160,7 @@
and biz_org_code like concat(#{bizOrgCode}, '%')
</select>
<!--消防队伍列表按时间倒叙排列order by x.rec_date desc 2021-09-08 by kongfm -->
<select id="queryOrgPersonDtoList" resultType="com.yeejoin.amos.boot.module.common.api.dto.OrgPersonExcelDto">
select u.*,
v.person_number,
......@@ -204,6 +206,7 @@
) v
on u.sequence_nbr = v.instance_id
where u.is_delete = #{isDelete}
order by u.rec_date desc
</select>
<select id="listOrgUserById" resultType="com.yeejoin.amos.boot.module.common.api.entity.OrgUsr">
SELECT *
......
......@@ -115,6 +115,7 @@
from cb_water_resource
where is_delete = #{isDelete}
</select>
<!--消防水源按时间倒叙排列add order by cb_water_resource.rec_date desc 2021-09-08 by kongfm -->
<select id="getWaterResourcePageByParams"
resultType="com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto">
select * from cb_water_resource where is_delete = 1
......@@ -133,6 +134,7 @@
<if test="belongBuildingId != null and belongBuildingId.size() > 0">
and find_in_set(belong_building_id, #{belongBuildingId}) > 0
</if>
order by cb_water_resource.rec_date desc
</select>
......
......@@ -31,6 +31,7 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourcePoolSer
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -92,13 +93,13 @@ public class WaterResourceController extends BaseController {
model.setResourceTypeName(resourceTypeEnum.get().getName());
model.setRealityImg(JSONArray.toJSONString(model.getRealityImgList()));
model.setOrientationImg(JSONArray.toJSONString(model.getOrientationImgList()));
if(model.getAddress()!=null){
/*2021-09-08 前端表示前端传递的address参数已经切割过,后端无需再切割获取 陈召 屏蔽代码 97-102行*/
/* if(model.getAddress()!=null){
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(model.getAddress());
model.setAddress(address.getString(BizConstant.ADDRESS));
model.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
}
}*/
if (!StringUtils.isEmpty(resourceType)) {
switch (resourceType) {
......@@ -168,12 +169,14 @@ public class WaterResourceController extends BaseController {
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新")
public ResponseModel<WaterResourceDto> updateBySequenceNbrWaterResource(@RequestBody WaterResourceDto model,
@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
if (StringUtils.isNotEmpty(model.getAddress())) {
/*2021-09-08 前端表示前端传递的address参数已经切割过,后端无需再切割获取 陈召 屏蔽代码 173-178行*/
/* if (StringUtils.isNotEmpty(model.getAddress())) {
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(model.getAddress());
model.setAddress(address.getString(BizConstant.ADDRESS));
model.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
}
}*/
// 更新基本信息
model.setSequenceNbr(sequenceNbr);
......
......@@ -29,6 +29,7 @@ public class FireChemicalServiceImpl extends BaseService<FireChemicalDto,FireChe
typeCode = null;
}
// BUG 2123 日常管理>辅助资源>危化品,危化品列表数据按创建时间倒序排列 by litw start
// 危化品按时间倒叙排列add rec_date 2021-09-08 by kongfm
return this.queryForPage(page, "rec_date", false,casNo, formula, name, typeCode, isDelete);
}
......
......@@ -30,7 +30,8 @@ public class FireExpertsServiceImpl extends BaseService<FireExpertsDto, FireExpe
@Condition(Operator.eq) Boolean isDelete,
@Condition(Operator.like) String name,
@Condition(Operator.eq) String expertCode) {
return this.queryForPage(page, null, false, isDelete, name, expertCode);
// 消防专家按时间倒叙排列add rec_date 2021-09-08 by kongfm
return this.queryForPage(page, "rec_date", false, isDelete, name, expertCode);
}
/**
......
......@@ -361,7 +361,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override
public List<FormValue> getFormValue(Long id) throws Exception {
// 动态表单数据
/*BUG2580 返回值为code值 修改为类型名称 2021-08-31 陈召 开始 */
List<DynamicFormInstanceDto> list = alertFormValueServiceImpl.listByCalledId(id);
List<FormValue> formValue = new ArrayList<>();
for (DynamicFormInstanceDto alertFormValue : list) {
......@@ -371,14 +371,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// alertFormValue.getFieldType(), alertFormValue.getFieldValueLabel(), alertFormValue.getBlock());
// formValue.add(value);
// } else {
/*修改为动态表单返回的数据参数量 2021-09-08 陈浩 结束 */
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(),
alertFormValue.getFieldType(), alertFormValue.getFieldValue(), alertFormValue.getBlock(),alertFormValue.getFieldValueLabel());
formValue.add(value);
/*修改为动态表单返回的数据参数量 2021-09-08 陈浩 结束 */
// }
/*BUG2580 返回值为code值 修改为类型名称 2021-08-31 陈召 开始 */
}
return formValue;
/*BUG2580 返回值为code值 修改为类型名称 2021-08-31 陈召 结束 */
}
public List<FormValue> getFormValueDetail(Long id) throws Exception {
......
......@@ -165,7 +165,8 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
Boolean isDelete,
@Condition(Operator.like) String aircraftModel,
String engineTypeCode, String fuelTypeCode) {
return this.queryForPage(page, null, false, isDelete, aircraftModel, engineTypeCode, fuelTypeCode);
// 航空器信息按时间倒叙排列add rec_date 2021-09-08 by kongfm
return this.queryForPage(page, "rec_date", false, isDelete, aircraftModel, engineTypeCode, fuelTypeCode);
}
/**
......
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