Browse Source

修改网格力量bug

feature/dangjian
luyan 2 years ago
parent
commit
8aba267e4f
  1. 3
      esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/GridForceInfoDTO.java
  2. 12
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/GridForceInfoServiceImpl.java
  3. 3
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/consult/GridForceInfoDao.xml

3
esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/GridForceInfoDTO.java

@ -21,7 +21,6 @@ import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
@ -151,6 +150,6 @@ public class GridForceInfoDTO implements Serializable {
/**
* 新增是选择所属网格多选
*/
private List<Long[]> selectedDeptIds;
private String[] selectedDeptIds;
}

12
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/GridForceInfoServiceImpl.java

@ -84,7 +84,12 @@ public class GridForceInfoServiceImpl extends BaseServiceImpl<GridForceInfoDao,
@Override
public GridForceInfoDTO get(String id) {
GridForceInfoEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, GridForceInfoDTO.class);
GridForceInfoDTO dto = ConvertUtils.sourceToTarget(entity, GridForceInfoDTO.class);
if(StringUtils.isNotEmpty(entity.getAllDeptIds())){
dto.setDeptId(String.valueOf(entity.getDeptId()));
dto.setSelectedDeptIds(entity.getAllDeptIds().split(","));
}
return dto;
}
@Override
@ -126,6 +131,11 @@ public class GridForceInfoServiceImpl extends BaseServiceImpl<GridForceInfoDao,
@Transactional(rollbackFor = Exception.class)
public void update(GridForceInfoDTO dto) {
GridForceInfoEntity entity = ConvertUtils.sourceToTarget(dto, GridForceInfoEntity.class);
if (StringUtils.isNotEmpty(dto.getDeptId())) {
fillDeptInfoByGridId(entity, Long.valueOf(dto.getDeptId()));
}else {
throw new RenException("请选择所属部门");
}
updateById(entity);
}

3
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/consult/GridForceInfoDao.xml

@ -43,6 +43,9 @@
AND (find_in_set(#{gridId},PARENT_DEPT_IDS)
OR find_in_set(#{gridId},ALL_DEPT_IDS))
</if>
<if test="deptId != null and deptId != ''">
AND DEPT_ID = #{deptId}
</if>
ORDER BY
SORT ASC,
CREATED_TIME DESC

Loading…
Cancel
Save