|
@@ -24,6 +24,7 @@ import com.qunzhixinxi.hnqz.admin.mapper.SysUserMapper;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.SysCsmUserRelationService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.SysDeptRelationService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.SysDeptService;
|
|
|
+import com.qunzhixinxi.hnqz.admin.service.SysEnterpriseAreaService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.WmDaAgentService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.WmDaDrugEntService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.WmDeptRegulationsService;
|
|
@@ -40,6 +41,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.PutMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
@@ -90,8 +92,36 @@ public class SysDeptController {
|
|
|
|
|
|
private final SysDeptRelationMapper sysDeptRelationMapper;
|
|
|
|
|
|
+ private final SysEnterpriseAreaService enterpriseAreaService;
|
|
|
+
|
|
|
private final SysCsmUserRelationService sysCsmUserRelationService;
|
|
|
|
|
|
+ /**
|
|
|
+ * 按照等级获取企业列表
|
|
|
+ *
|
|
|
+ * @param lv 企业等级
|
|
|
+ * @return 企业列表
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/list/{level}")
|
|
|
+ public R<List<SysDept>> listDeptsByLv(@PathVariable("level") Integer lv) {
|
|
|
+ List<SysDept> list = sysDeptService.list(Wrappers.<SysDept>lambdaQuery().eq(SysDept::getLevel, lv));
|
|
|
+
|
|
|
+ if (CollUtil.isNotEmpty(list)) {
|
|
|
+ Set<Long> collect = list.stream().mapToLong(SysDept::getDeptId).boxed().collect(Collectors.toSet());
|
|
|
+
|
|
|
+ Map<Long, List<Long>> longListMap = enterpriseAreaService.listEntAreas1(collect);
|
|
|
+
|
|
|
+ list.forEach(d -> {
|
|
|
+ List<Long> longs = longListMap.get(Long.valueOf(d.getDeptId()));
|
|
|
+ d.setAreaCodes(CollUtil.isNotEmpty(longs) ? longs : Collections.emptyList());
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return R.ok(list);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取登录用户企业的有效期
|
|
|
*
|