Browse Source

Merge branch 'Optimize_code_dev_1'

master
HAHA 3 years ago
parent
commit
941f135d7a
  1. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java
  2. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java
  3. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java
  4. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java
  5. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
  6. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  7. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.40__add_column.sql
  8. 1
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  9. 24
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  10. 2
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java

@ -155,4 +155,9 @@ public class CustomerGridDTO implements Serializable {
* 弃用1正常使用0 * 弃用1正常使用0
*/ */
private Integer abandonFlag; private Integer abandonFlag;
/**
* 网格排序
*/
private Integer sort;
} }

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java

@ -78,4 +78,9 @@ public class EditGridFormDTO implements Serializable {
* 中心点位位置 * 中心点位位置
*/ */
private String centerAddress; private String centerAddress;
/**
* 网格排序
*/
private Integer sort;
} }

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java

@ -91,4 +91,9 @@ public class GridDetailResultDTO implements Serializable {
*/ */
private String mobile = ""; private String mobile = "";
/**
* 网格排序
*/
private Integer gridSort = 0;
} }

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java

@ -15,6 +15,7 @@ import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.send.SendMqMsgUtil; import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.CustomerGridService; import com.epmet.service.CustomerGridService;
import com.epmet.service.CustomerStaffAgencyService; import com.epmet.service.CustomerStaffAgencyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -26,6 +27,7 @@ import java.util.List;
*/ */
@RestController @RestController
@RequestMapping("grid") @RequestMapping("grid")
@Slf4j
public class GridController { public class GridController {
@Autowired @Autowired

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java

@ -202,7 +202,7 @@ public class BuildingServiceImpl implements BuildingService {
// agencyIdList.add(customerAgency.getId()); // agencyIdList.add(customerAgency.getId());
LambdaQueryWrapper<CustomerGridEntity> gridWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CustomerGridEntity> gridWrapper = new LambdaQueryWrapper<>();
gridWrapper.in(CustomerGridEntity::getPid, agencyIdList); gridWrapper.in(CustomerGridEntity::getPid, agencyIdList);
gridWrapper.last("ORDER BY CAST(GRID_NAME AS SIGNED),CONVERT(GRID_NAME using gbk)"); gridWrapper.last("ORDER BY sort,CAST(GRID_NAME AS SIGNED),CONVERT(GRID_NAME using gbk)");
List<CustomerGridEntity> customerGridList = customerGridDao.selectList(gridWrapper); List<CustomerGridEntity> customerGridList = customerGridDao.selectList(gridWrapper);
if (CollectionUtils.isEmpty(customerGridList)) { if (CollectionUtils.isEmpty(customerGridList)) {

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -343,6 +343,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
customerGridDTO.setGridType(editGridFormDTO.getGridType()); customerGridDTO.setGridType(editGridFormDTO.getGridType());
customerGridDTO.setContacts(editGridFormDTO.getContacts()); customerGridDTO.setContacts(editGridFormDTO.getContacts());
customerGridDTO.setMobile(editGridFormDTO.getMobile()); customerGridDTO.setMobile(editGridFormDTO.getMobile());
customerGridDTO.setSort(editGridFormDTO.getSort());
if(StringUtils.isNotBlank(editGridFormDTO.getLongitude())){ if(StringUtils.isNotBlank(editGridFormDTO.getLongitude())){
customerGridDTO.setLongitude(editGridFormDTO.getLongitude()); customerGridDTO.setLongitude(editGridFormDTO.getLongitude());
} }
@ -940,7 +941,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
} }
LambdaQueryWrapper<CustomerGridEntity> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CustomerGridEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CustomerGridEntity::getPid, agencyId); wrapper.eq(CustomerGridEntity::getPid, agencyId);
wrapper.last("ORDER BY CONVERT ( GRID_NAME USING gbk ) ASC"); wrapper.last("ORDER BY sort,CONVERT ( GRID_NAME USING gbk ) desc");
List<CustomerGridEntity> list = baseDao.selectList(wrapper); List<CustomerGridEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList(); return Collections.emptyList();

2
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.40__add_column.sql

@ -0,0 +1,2 @@
ALTER TABLE `epmet_gov_org`.`customer_grid`
ADD COLUMN `sort` int(11) NULL COMMENT '网格排序' AFTER `MOBILE`;

1
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -371,6 +371,7 @@
WHERE WHERE
cg.DEL_FLAG = '0' cg.DEL_FLAG = '0'
AND cg.PID =#{agencyId} AND cg.PID =#{agencyId}
order by cg.sort
</select> </select>
<select id="selectSubAgencyByPid" resultMap="treeMap"> <select id="selectSubAgencyByPid" resultMap="treeMap">

24
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -196,7 +196,8 @@
`code` AS 'code', `code` AS 'code',
grid_type AS 'gridType', grid_type AS 'gridType',
contacts AS 'contacts', contacts AS 'contacts',
mobile AS 'mobile' mobile AS 'mobile',
sort AS gridSort
FROM FROM
customer_grid customer_grid
WHERE WHERE
@ -256,6 +257,9 @@
<if test="centerAddress != null and centerAddress !=''"> <if test="centerAddress != null and centerAddress !=''">
CENTER_ADDRESS= #{centerAddress}, CENTER_ADDRESS= #{centerAddress},
</if> </if>
<if test="sort != null and sort != ''">
sort = #{sort},
</if>
UPDATED_TIME=NOW() UPDATED_TIME=NOW()
where where
id = #{id} id = #{id}
@ -314,7 +318,7 @@
DEL_FLAG = '0' DEL_FLAG = '0'
AND ABANDON_FLAG='0' AND ABANDON_FLAG='0'
AND PID = #{agencyId} AND PID = #{agencyId}
ORDER BY CREATED_TIME DESC ORDER BY sort,grid_name,CREATED_TIME DESC
<if test="null != pageSize and pageSize > 0"> <if test="null != pageSize and pageSize > 0">
LIMIT #{pageSize} LIMIT #{pageSize}
</if> </if>
@ -417,6 +421,8 @@
WHERE del_flag = '0' WHERE del_flag = '0'
and ABANDON_FLAG='0' and ABANDON_FLAG='0'
AND pid = #{agencyId} AND pid = #{agencyId}
order by
sort,grid_name
</select> </select>
<select id="selectAgencyGridMsgList" resultType="com.epmet.dto.result.AgencyGridList"> <select id="selectAgencyGridMsgList" resultType="com.epmet.dto.result.AgencyGridList">
@ -440,6 +446,8 @@
AND ca.del_flag = '0' AND ca.del_flag = '0'
and cg.ABANDON_FLAG='0' and cg.ABANDON_FLAG='0'
AND cg.pid = #{agencyId} AND cg.pid = #{agencyId}
order by
cg.sort,cg.grid_name
</select> </select>
<!-- 单客户-根据城市地区码前四位匹配到城市下所有网格 --> <!-- 单客户-根据城市地区码前四位匹配到城市下所有网格 -->
@ -474,8 +482,10 @@
</if> </if>
AND grid.customer_id = #{customerId} AND grid.customer_id = #{customerId}
ORDER BY ORDER BY
grid.customer_id, grid.sort,
CONVERT ( gridName USING gbk ) ASC CONVERT ( gridName USING gbk ) ASC,
grid.customer_id
LIMIT #{pageNo}, #{pageSize} LIMIT #{pageNo}, #{pageSize}
</select> </select>
@ -488,7 +498,9 @@
SELECT SELECT
a.id AS grid_id, a.id AS grid_id,
a.customer_id, a.customer_id,
concat( agency.fullname, '-', a.grid_name ) AS gridName concat( agency.fullname, '-', a.grid_name ) AS gridName,
a.sort as sort,
agency.fullname as fullName
FROM FROM
CUSTOMER_GRID a CUSTOMER_GRID a
LEFT JOIN ( LEFT JOIN (
@ -512,7 +524,7 @@
and a.ABANDON_FLAG='0' and a.ABANDON_FLAG='0'
AND a.customer_id = #{customerId} AND a.customer_id = #{customerId}
) AS c ) AS c
ORDER BY CONVERT ( gridName USING gbk ) ASC ORDER BY fullName,c.sort,CONVERT ( gridName USING gbk ) ASC
LIMIT #{pageNo}, #{pageSize} LIMIT #{pageNo}, #{pageSize}
</select> </select>

2
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -213,7 +213,7 @@
</foreach> </foreach>
</if> </if>
ORDER BY ORDER BY
IC_RESI_USER.GRID_ID ASC, IC_RESI_USER.GRID_ID desc,
IC_RESI_USER.VILLAGE_ID ASC, IC_RESI_USER.VILLAGE_ID ASC,
IC_RESI_USER.BUILD_ID ASC, IC_RESI_USER.BUILD_ID ASC,
IC_RESI_USER.UNIT_ID ASC, IC_RESI_USER.UNIT_ID ASC,

Loading…
Cancel
Save