Commit 0f8c4c2d authored by 韩桐桐's avatar 韩桐桐

fix():服务迁移,tcm和ymt统计接口迁移至statistics

parent 54ab7698
......@@ -25,6 +25,11 @@
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-tcm-api</artifactId>
<version>${amos-boot-biz.version}</version>
</dependency>
</dependencies>
<build>
......
package com.yeejoin.amos;
import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
import net.javacrumbs.shedlock.spring.annotation.EnableSchedulerLock;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -10,13 +9,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
import java.net.InetAddress;
import java.net.UnknownHostException;
......@@ -36,7 +32,8 @@ import java.net.UnknownHostException;
@EnableSwagger2WebMvc
@MapperScan({"org.typroject.tyboot.demo.face.orm.dao*", "org.typroject.tyboot.face.*.orm.dao*",
"org.typroject.tyboot.core.auth.face.orm.dao*", "org.typroject.tyboot.component.*.face.orm.dao*",
"com.yeejoin.amos.boot.module.**.api.mapper", "com.yeejoin.amos.boot.biz.common.dao.mapper"})
"com.yeejoin.amos.boot.module.**.api.mapper", "com.yeejoin.amos.boot.module.**.api.service",
"com.yeejoin.amos.boot.biz.common.dao.mapper"})
@ComponentScan(basePackages = {"org.typroject", "com.yeejoin.amos"})
public class AmosStatisticsApplication {
private static final Logger logger = LoggerFactory.getLogger(AmosStatisticsApplication.class);
......
......@@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.EnterpriseBizServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.PageParam;
import com.yeejoin.amos.boot.module.tcm.api.service.ITzBaseEnterpriseInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
......@@ -14,6 +16,8 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Map;
/**
* @author Administrator
*/
......@@ -22,10 +26,14 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
@Api(tags = "大屏-企业-业务API")
public class EnterpriseBizController {
private EnterpriseBizServiceImpl enterpriseBizService;
private final EnterpriseBizServiceImpl enterpriseBizService;
private final ITzBaseEnterpriseInfoService iTzBaseEnterpriseInfoService;
public EnterpriseBizController(EnterpriseBizServiceImpl enterpriseBizService) {
@Autowired
public EnterpriseBizController(EnterpriseBizServiceImpl enterpriseBizService,
ITzBaseEnterpriseInfoService iTzBaseEnterpriseInfoService) {
this.enterpriseBizService = enterpriseBizService;
this.iTzBaseEnterpriseInfoService = iTzBaseEnterpriseInfoService;
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
......@@ -35,4 +43,11 @@ public class EnterpriseBizController {
TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto) {
return ResponseHelper.buildResponse(enterpriseBizService.page(pageParam, tzBaseEnterpriseInfoDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/getInfoByUseCode/map", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据统一信用代码查询企业详情返回map", notes = "根据统一信用代码查询企业详情返回map")
public ResponseModel<Map<String, Object>> getInfoByUseCodeMap(String useCode) {
return ResponseHelper.buildResponse(iTzBaseEnterpriseInfoService.getInfoByUseCodeMap(useCode));
}
}
package com.yeejoin.amos.boot.module.statistcs.biz.controller;
import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.EquipmentBizServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory;
import com.yeejoin.amos.boot.module.ymt.api.service.IEquipmentCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map;
/**
* @author Administrator
*/
@RestController
@RequestMapping(value = "/dp/biz-equipment")
@Api(tags = "大屏-设备相关-业务API")
public class EquipmentBizController {
private final IEquipmentCategoryService equipmentCategoryService;
private final EquipmentBizServiceImpl equipmentBizServiceImpl;
@Autowired
public EquipmentBizController(IEquipmentCategoryService equipmentCategoryService,EquipmentBizServiceImpl equipmentBizServiceImpl) {
this.equipmentCategoryService = equipmentCategoryService;
this.equipmentBizServiceImpl = equipmentBizServiceImpl;
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/getFormRecordById/map", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "表格查询详情", notes = "表格查询详情")
public ResponseModel<Object> getFormRecordByIdMap(@RequestParam Map<String, Object> map) {
return ResponseHelper.buildResponse(equipmentCategoryService.getFormRecordByIdMap(map));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getChildren")
@ApiOperation(httpMethod = "GET", value = "通过设备种类code获取设备类别", notes = "通过设备种类code获取设备类别")
public ResponseModel<List<EquipmentCategory>> getChildren(String code) {
return ResponseHelper.buildResponse(equipmentBizServiceImpl.getChildren(code));
}
/**
* 获取管辖分局树
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/creatTree")
@ApiOperation(httpMethod = "GET", value = "获取管辖分局树", notes = "获取管辖分局树")
public ResponseModel<Object> creatTree() {
return ResponseHelper.buildResponse(equipmentCategoryService.getTree());
}
}
......@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONArray;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto;
import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.StCommonServiceImpl;
import com.yeejoin.amos.boot.module.statistics.api.vo.EquCategoryVo;
import com.yeejoin.amos.boot.module.tcm.flc.api.service.IRegUnitInfoService;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -13,6 +13,8 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Collection;
import java.util.List;
@RestController
......@@ -21,9 +23,12 @@ import java.util.List;
public class StCommonController extends BaseController {
private StCommonServiceImpl commonService;
private IRegUnitInfoService iregUnitInfoService;
public StCommonController(StCommonServiceImpl commonService) {
public StCommonController(StCommonServiceImpl commonService,
IRegUnitInfoService iregUnitInfoService) {
this.commonService = commonService;
this.iregUnitInfoService = iregUnitInfoService;
}
/**
......@@ -50,4 +55,12 @@ public class StCommonController extends BaseController {
return ResponseHelper.buildResponse(objects);
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/management-unit/tree")
@ApiOperation(httpMethod = "GET", value = "管辖机构树", notes = "管辖机构树")
public ResponseModel<Collection> managementUnitTree(@RequestParam(required = false) String orgCode) {
Collection result = iregUnitInfoService.getManagementUnitTree(orgCode);
return ResponseHelper.buildResponse(result);
}
}
package com.yeejoin.amos.boot.module.statistcs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author Administrator
*/
@Service
public class EquipmentBizServiceImpl {
private final EquipmentCategoryMapper equipmentCategoryMapper;
public EquipmentBizServiceImpl(EquipmentCategoryMapper equipmentCategoryMapper) {
this.equipmentCategoryMapper = equipmentCategoryMapper;
}
/**
* 设备字典,通过设备父类code,获得子类
*/
public List<EquipmentCategory> getChildren(String code) {
LambdaQueryWrapper<EquipmentCategory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(EquipmentCategory::getCode, code);
EquipmentCategory equipmentCategory = equipmentCategoryMapper.selectOne(wrapper);
LambdaQueryWrapper<EquipmentCategory> wrapper2 = new LambdaQueryWrapper<>();
wrapper2.eq(EquipmentCategory::getParentId, equipmentCategory.getId());
List<EquipmentCategory> equipmentCategories = equipmentCategoryMapper.selectList(wrapper2);
return equipmentCategories;
}
}
......@@ -8,7 +8,7 @@
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/tcm/baseEnterprise/getInfoByUseCode/map",
"apiPath":"/statistics/dp/biz-enterprise/getInfoByUseCode/map",
"params": {
"useCode": "{useUnitCode}"
}
......@@ -23,7 +23,7 @@
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/tcm/baseEnterprise/getInfoByUseCode/map",
"apiPath":"/statistics/dp/biz-enterprise/getInfoByUseCode/map",
"params": {
"useCode": "{useUnitCode}"
}
......
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