Commit 1098d231 authored by 朱晨阳's avatar 朱晨阳

Merge branch 'developer' into developer_bw

# Conflicts: # amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/CommonController.java
parents 09c9feb1 389dd2b5
......@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigInteger;
import java.util.List;
import java.util.Map;
......@@ -32,4 +33,6 @@ public interface FinancingInfoMapper extends BaseMapper<FinancingInfo> {
List<Map<String,Object>> selectRegion();
List<Map<String,Object>> selectRegionByParentCode(String parentCode, String level);
}
......@@ -132,4 +132,15 @@
PARENT_ID = '0'
</select>
<select id="selectRegionByParentCode" resultType="java.util.Map">
select
REGION_NAME regionName,
REGION_CODE regionCode
from
systemctl_region
where
PARENT_REGION_CODE = #{parentCode} and LEVEL = #{level}
</select>
</mapper>
......@@ -36,7 +36,13 @@ public class CommonController {
return ResponseHelper.buildResponse(financingInfoService.selectRegion());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/selectRegionByParentCode")
@ApiOperation(httpMethod = "GET", value = "查询省市区", notes = "查询省市区")
public ResponseModel<List<Map<String,Object>>> selectRegionByParentCode(@RequestParam(value = "parentCode", defaultValue = "0") String parentCode,
@RequestParam(value = "level", defaultValue = "1") String level) {
return ResponseHelper.buildResponse(financingInfoService.selectRegionByParentCode(parentCode, level));
}
/**
* 设备信息下载
......
......@@ -42,6 +42,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.annotation.Resource;
import java.math.BigInteger;
import java.util.*;
import java.util.stream.Collectors;
......@@ -133,11 +134,15 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
return page;
}
public List<Map<String,Object>> selectRegion(){
return financingInfoMapper.selectRegion();
}
public List<Map<String,Object>> selectRegionByParentCode(String parentCode, String level){
return financingInfoMapper.selectRegionByParentCode(parentCode, level);
}
/**
* 列表查询 示例
......
......@@ -217,11 +217,14 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
try {
List<Long> newRole = userDataZHDto.getRole();
List<Long> oldRole = JSONArray.parseArray(publicAgencyUser.getRole(), Long.class);
for (Long item : oldRole) {
if (!newRole.contains(item)) {
throw new BadRequest("角色只能增加, 不能删除");
if(userDataZHDto.getHasOperationRecords()) {
for (Long item : oldRole) {
if (!newRole.contains(item)) {
throw new BadRequest("角色只能增加, 不能删除");
}
}
}
//去掉空角色
List<Long> role = userDataZHDto.getRole();
if(CollectionUtil.isNotEmpty(role)){
......
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