
24 changed files with 699 additions and 10 deletions
@ -0,0 +1,30 @@ |
|||||
|
package com.supervise.rms.api.businessriskdata; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-06-06-14:46 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "任务执行数据表", description = "任务执行数据表") |
||||
|
@TableName("business_risk_data") |
||||
|
public class BusinessRiskData extends BaseEntity { |
||||
|
//列入经营异常名录原因
|
||||
|
private String addReason; |
||||
|
//列入日期
|
||||
|
private String addDate; |
||||
|
//移出经营异常名录原因(保留字段)
|
||||
|
private String romoveReason; |
||||
|
//移出日期(保留字段)
|
||||
|
private String removeDate; |
||||
|
//作出决定机关
|
||||
|
private String decisionOffice; |
||||
|
//移出决定机关(保留字段)
|
||||
|
private String removeDecisionOffice; |
||||
|
//企业时间Sid
|
||||
|
private String buSid; |
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
package com.supervise.rms.api.businessriskdata; |
||||
|
|
||||
|
import com.yxt.common.core.dto.Dto; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-06-06-14:53 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class BusinessRiskDataDto implements Dto { |
||||
|
private Integer id; |
||||
|
private String sid; |
||||
|
|
||||
|
//列入经营异常名录原因
|
||||
|
private String addReason; |
||||
|
//列入日期
|
||||
|
private String addDate; |
||||
|
//移出经营异常名录原因(保留字段)
|
||||
|
private String romoveReason; |
||||
|
//移出日期(保留字段)
|
||||
|
private String removeDate; |
||||
|
//作出决定机关
|
||||
|
private String decisionOffice; |
||||
|
//移出决定机关(保留字段)
|
||||
|
private String removeDecisionOffice; |
||||
|
//企业时间Sid
|
||||
|
private String buSid; |
||||
|
|
||||
|
//状态码
|
||||
|
private String Status; |
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
package com.supervise.rms.api.businessriskdata; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-06-06-16:22 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class BusinessRiskDataQuery implements Query { |
||||
|
private Integer id; |
||||
|
private String sid; |
||||
|
|
||||
|
//列入经营异常名录原因
|
||||
|
private String addReason; |
||||
|
//列入日期
|
||||
|
private String addDate; |
||||
|
//移出经营异常名录原因(保留字段)
|
||||
|
private String romoveReason; |
||||
|
//移出日期(保留字段)
|
||||
|
private String removeDate; |
||||
|
//作出决定机关
|
||||
|
private String decisionOffice; |
||||
|
//移出决定机关(保留字段)
|
||||
|
private String removeDecisionOffice; |
||||
|
//企业时间Sid
|
||||
|
private String buSid; |
||||
|
//企业名称
|
||||
|
private String businessName; |
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
package com.supervise.rms.api.businessriskdata; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-06-06-16:22 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class BusinessRiskDataVo implements Vo { |
||||
|
private Integer id; |
||||
|
private String sid; |
||||
|
|
||||
|
//列入经营异常名录原因
|
||||
|
private String addReason; |
||||
|
//列入日期
|
||||
|
private String addDate; |
||||
|
//移出经营异常名录原因(保留字段)
|
||||
|
private String romoveReason; |
||||
|
//移出日期(保留字段)
|
||||
|
private String removeDate; |
||||
|
//作出决定机关
|
||||
|
private String decisionOffice; |
||||
|
//移出决定机关(保留字段)
|
||||
|
private String removeDecisionOffice; |
||||
|
//企业时间Sid
|
||||
|
private String buSid; |
||||
|
private String businessName; |
||||
|
private String executionTime; |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
package com.supervise.rms.api.businessriskdate; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.supervise.rms.api.businessriskdata.BusinessRiskDataDto; |
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-06-06-14:48 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "任务执行时间表", description = "任务执行时间表") |
||||
|
@TableName("business_risk_date") |
||||
|
public class BusinessRiskDate extends BaseEntity { |
||||
|
private String executionTime; |
||||
|
private String businessName; |
||||
|
private List<BusinessRiskDataDto> dataList; |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.supervise.rms.api.businessriskdate; |
||||
|
|
||||
|
import com.supervise.rms.api.businessriskdata.BusinessRiskDataDto; |
||||
|
import com.yxt.common.core.dto.Dto; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-06-06-14:50 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class BusinessRiskDateDto implements Dto { |
||||
|
private Integer id; |
||||
|
private String sid; |
||||
|
private String executionTime; |
||||
|
private String businessName; |
||||
|
private List<BusinessRiskDataDto> dataList; |
||||
|
} |
@ -0,0 +1,42 @@ |
|||||
|
package com.supervise.rms.api.enterpriseinformation; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-06-07-9:17 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "企业信息表", description = "企业信息表") |
||||
|
@TableName("enterprise_information") |
||||
|
public class EnterpriseInformation extends BaseEntity { |
||||
|
//企业名称
|
||||
|
private String enterpriseName; |
||||
|
//企业简称
|
||||
|
private String enterpriseAbbreviation; |
||||
|
//银行账户
|
||||
|
private String bankAccount; |
||||
|
//账号
|
||||
|
private String accountNumber; |
||||
|
//开户行
|
||||
|
private String openingBankName; |
||||
|
//法人
|
||||
|
private String juridicalPerson; |
||||
|
//营业执照号
|
||||
|
private String businessLicenseNumber; |
||||
|
//地址
|
||||
|
private String address; |
||||
|
//省
|
||||
|
private String province; |
||||
|
//市
|
||||
|
private String city; |
||||
|
//区
|
||||
|
private String county; |
||||
|
//联系人
|
||||
|
private String contacts; |
||||
|
//电话
|
||||
|
private String telephone; |
||||
|
} |
@ -1,7 +1,24 @@ |
|||||
package com.supervise.rms.api.supplier; |
package com.supervise.rms.api.supplier; |
||||
|
|
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
import org.springframework.stereotype.Component; |
import org.springframework.stereotype.Component; |
||||
|
|
||||
@Component |
@Component |
||||
public class SupplierFeignFallback implements SupplierFeign { |
public class SupplierFeignFallback implements SupplierFeign { |
||||
|
@Override |
||||
|
public ResultBean saveSupplier(SupplierDto supplierDto) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<PagerVo<SupplierVo>> listPage(PagerQuery<SupplierQuery> pq) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<SupplierDetailsVo> fetchDetailsBySid(String sid) { |
||||
|
return null; |
||||
|
} |
||||
} |
} |
||||
|
@ -0,0 +1,20 @@ |
|||||
|
package com.supervise.rms.biz.businessriskdata; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||
|
import com.supervise.rms.api.businessriskdata.BusinessRiskData; |
||||
|
import com.supervise.rms.api.businessriskdata.BusinessRiskDataVo; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-06-06-15:48 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface BusinessRiskDataMapper extends BaseMapper<BusinessRiskData> { |
||||
|
|
||||
|
IPage<BusinessRiskDataVo> selectPageVo(IPage<BusinessRiskData> page, @Param(Constants.WRAPPER) Wrapper<BusinessRiskData> qw); |
||||
|
} |
@ -0,0 +1,12 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.supervise.rms.biz.businessriskdata.BusinessRiskDataMapper"> |
||||
|
<select id="selectPageVo" resultType="com.supervise.rms.api.businessriskdata.BusinessRiskDataVo"> |
||||
|
select e.businessName,e.executionTime,a.* |
||||
|
from business_risk_date e |
||||
|
left join business_risk_data a on e.sid = a.buSid |
||||
|
<where> |
||||
|
${ew.sqlSegment} |
||||
|
</where> |
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,35 @@ |
|||||
|
package com.supervise.rms.biz.businessriskdata; |
||||
|
|
||||
|
import com.supervise.rms.api.businessriskdata.BusinessRiskDataQuery; |
||||
|
import com.supervise.rms.api.businessriskdata.BusinessRiskDataVo; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-06-06-15:44 |
||||
|
*/ |
||||
|
@Api(tags = "任务执行数据表") |
||||
|
@RestController("com.supervise.rmc.biz.businessriskdata.BusinessRiskDataRest") |
||||
|
@RequestMapping("v1/businessData") |
||||
|
public class BusinessRiskDataRest { |
||||
|
|
||||
|
@Autowired |
||||
|
private BusinessRiskDataService businessRiskDataService; |
||||
|
|
||||
|
@ApiOperation("查询该企业信息") |
||||
|
@PostMapping("/listPage") |
||||
|
public ResultBean listPage(@RequestBody PagerQuery<BusinessRiskDataQuery> pq){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
PagerVo<BusinessRiskDataVo> vo = businessRiskDataService.listPage(pq); |
||||
|
return rb.success().setData(vo); |
||||
|
} |
||||
|
} |
@ -0,0 +1,42 @@ |
|||||
|
package com.supervise.rms.biz.businessriskdata; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.supervise.rms.api.businessriskdata.BusinessRiskData; |
||||
|
import com.supervise.rms.api.businessriskdata.BusinessRiskDataDto; |
||||
|
import com.supervise.rms.api.businessriskdata.BusinessRiskDataQuery; |
||||
|
import com.supervise.rms.api.businessriskdata.BusinessRiskDataVo; |
||||
|
import com.yxt.common.base.service.MybatisBaseService; |
||||
|
import com.yxt.common.base.utils.PagerUtil; |
||||
|
import com.yxt.common.base.utils.StringUtils; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-06-06-15:48 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class BusinessRiskDataService extends MybatisBaseService<BusinessRiskDataMapper, BusinessRiskData> { |
||||
|
|
||||
|
public void save(BusinessRiskDataDto dto){ |
||||
|
BusinessRiskData data = new BusinessRiskData(); |
||||
|
BeanUtil.copyProperties(dto,data); |
||||
|
baseMapper.insert(data); |
||||
|
} |
||||
|
|
||||
|
public PagerVo<BusinessRiskDataVo> listPage(PagerQuery<BusinessRiskDataQuery> pq){ |
||||
|
BusinessRiskDataQuery params = pq.getParams(); |
||||
|
QueryWrapper<BusinessRiskData> wq = new QueryWrapper<>(); |
||||
|
if (StringUtils.isNotNull(params.getBusinessName())){ |
||||
|
// wq.eq("",params.getBusinessName());
|
||||
|
} |
||||
|
IPage<BusinessRiskData> page = PagerUtil.queryToPage(pq); |
||||
|
IPage<BusinessRiskDataVo> iPage = baseMapper.selectPageVo(page, wq); |
||||
|
PagerVo<BusinessRiskDataVo> vo = PagerUtil.pageToVo(iPage, null); |
||||
|
return vo; |
||||
|
} |
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
package com.supervise.rms.biz.businessriskdate; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.supervise.rms.api.businessriskdate.BusinessRiskDate; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-06-06-15:48 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface BusinessRiskDateMapper extends BaseMapper<BusinessRiskDate> { |
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
package com.supervise.rms.biz.businessriskdate; |
||||
|
|
||||
|
import io.swagger.annotations.Api; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-06-06-15:44 |
||||
|
*/ |
||||
|
@Api(tags = "任务执行数据表") |
||||
|
@RestController("com.supervise.rmc.biz.businessriskdate.BusinessRiskDateRest") |
||||
|
@RequestMapping("v1/businessDate") |
||||
|
public class BusinessRiskDateRest { |
||||
|
|
||||
|
} |
@ -0,0 +1,36 @@ |
|||||
|
package com.supervise.rms.biz.businessriskdate; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.supervise.rms.api.businessriskdata.BusinessRiskData; |
||||
|
import com.supervise.rms.api.businessriskdata.BusinessRiskDataDto; |
||||
|
import com.supervise.rms.api.businessriskdate.BusinessRiskDate; |
||||
|
import com.supervise.rms.api.businessriskdate.BusinessRiskDateDto; |
||||
|
import com.supervise.rms.biz.businessriskdata.BusinessRiskDataService; |
||||
|
import com.yxt.common.base.service.MybatisBaseService; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-06-06-15:48 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class BusinessRiskDateService extends MybatisBaseService<BusinessRiskDateMapper, BusinessRiskDate> { |
||||
|
|
||||
|
@Autowired |
||||
|
private BusinessRiskDataService businessRiskDataService; |
||||
|
|
||||
|
public void save(BusinessRiskDateDto dto){ |
||||
|
BusinessRiskDate date = new BusinessRiskDate(); |
||||
|
BeanUtil.copyProperties(dto,date,"id","sid"); |
||||
|
baseMapper.insert(date); |
||||
|
List<BusinessRiskDataDto> dataList = dto.getDataList(); |
||||
|
for (BusinessRiskDataDto businessRiskDataDto : dataList) { |
||||
|
businessRiskDataDto.setBuSid(date.getSid()); |
||||
|
businessRiskDataService.save(businessRiskDataDto); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -1,5 +1,5 @@ |
|||||
<?xml version="1.0" encoding="UTF-8" ?> |
<?xml version="1.0" encoding="UTF-8" ?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.supervise.rms.biz.risk.RiskMapper"> |
<mapper namespace="com.supervise.rms.biz.datareport.DataReportMapper"> |
||||
|
|
||||
</mapper> |
</mapper> |
@ -1,11 +1,12 @@ |
|||||
package com.supervise.rms.biz.datareport; |
package com.supervise.rms.biz.datareport; |
||||
|
|
||||
|
import com.supervise.rms.api.datareport.DataReport; |
||||
import com.supervise.rms.api.risk.Risk; |
import com.supervise.rms.api.risk.Risk; |
||||
import com.yxt.common.base.service.MybatisBaseService; |
import com.yxt.common.base.service.MybatisBaseService; |
||||
import org.springframework.stereotype.Service; |
import org.springframework.stereotype.Service; |
||||
|
|
||||
@Service |
@Service |
||||
public class DataReportService extends MybatisBaseService<DataReportMapper, Risk> { |
public class DataReportService extends MybatisBaseService<DataReportMapper, DataReport> { |
||||
|
|
||||
|
|
||||
} |
} |
||||
|
@ -0,0 +1,19 @@ |
|||||
|
package com.supervise.rms.biz.enterpriseinformation; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.supervise.rms.api.enterpriseinformation.EnterpriseInformation; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Select; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-06-07-9:28 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface EnterpriseInformationMapper extends BaseMapper<EnterpriseInformation> { |
||||
|
|
||||
|
@Select("select * from enterprise_information") |
||||
|
List<EnterpriseInformation> enterpriseInformationList(); |
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
package com.supervise.rms.biz.enterpriseinformation; |
||||
|
|
||||
|
import io.swagger.annotations.Api; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-06-07-9:24 |
||||
|
*/ |
||||
|
@Api(tags = "任务执行数据表") |
||||
|
@RestController("com.supervise.rmc.biz.enterpriseinformation.EnterpriseInformationRest") |
||||
|
@RequestMapping("v1/enterprise") |
||||
|
public class EnterpriseInformationRest { |
||||
|
|
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.supervise.rms.biz.enterpriseinformation; |
||||
|
|
||||
|
import com.supervise.rms.api.enterpriseinformation.EnterpriseInformation; |
||||
|
import com.yxt.common.base.service.MybatisBaseService; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-06-07-9:27 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class EnterpriseInformationService extends MybatisBaseService<EnterpriseInformationMapper, EnterpriseInformation> { |
||||
|
|
||||
|
public List<EnterpriseInformation> enterpriseInformationList(){ |
||||
|
List<EnterpriseInformation> informationList = baseMapper.enterpriseInformationList(); |
||||
|
return informationList; |
||||
|
} |
||||
|
} |
@ -1,13 +1,13 @@ |
|||||
<?xml version="1.0" encoding="UTF-8" ?> |
<?xml version="1.0" encoding="UTF-8" ?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.yxt.supervise.portal.biz.restrictedbrand.RestrictedBrandMapper"> |
<mapper namespace="com.supervise.rms.biz.restrictedbrand.RestrictedBrandMapper"> |
||||
<!-- <where> ${ew.sqlSegment} </where>--> |
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
<!-- ${ew.customSqlSegment} --> |
<!-- ${ew.customSqlSegment} --> |
||||
<select id="selectPageVo" resultType="com.yxt.supervise.portal.api.restrictedbrand.RestrictedBrandVo"> |
<select id="selectPageVo" resultType="com.supervise.rms.api.restrictedbrand.RestrictedBrandVo"> |
||||
SELECT * FROM restricted_brand <where> ${ew.sqlSegment} </where> |
SELECT * FROM restricted_brand <where> ${ew.sqlSegment} </where> |
||||
</select> |
</select> |
||||
|
|
||||
<select id="selectListAllVo" resultType="com.yxt.supervise.portal.api.restrictedbrand.RestrictedBrandVo"> |
<select id="selectListAllVo" resultType="com.supervise.rms.api.restrictedbrand.RestrictedBrandVo"> |
||||
SELECT * FROM restricted_brand <where> ${ew.sqlSegment} </where> |
SELECT * FROM restricted_brand <where> ${ew.sqlSegment} </where> |
||||
</select> |
</select> |
||||
</mapper> |
</mapper> |
@ -1,13 +1,13 @@ |
|||||
<?xml version="1.0" encoding="UTF-8" ?> |
<?xml version="1.0" encoding="UTF-8" ?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.yxt.supervise.portal.biz.restrictedcategory.RestrictedCategoryMapper"> |
<mapper namespace="com.supervise.rms.biz.restrictedcategory.RestrictedCategoryMapper"> |
||||
<!-- <where> ${ew.sqlSegment} </where>--> |
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
<!-- ${ew.customSqlSegment} --> |
<!-- ${ew.customSqlSegment} --> |
||||
<select id="selectPageVo" resultType="com.yxt.supervise.portal.api.restrictedcategory.RestrictedCategoryVo"> |
<select id="selectPageVo" resultType="com.supervise.rms.api.restrictedcategory.RestrictedCategoryVo"> |
||||
SELECT * FROM restricted_category <where> ${ew.sqlSegment} </where> |
SELECT * FROM restricted_category <where> ${ew.sqlSegment} </where> |
||||
</select> |
</select> |
||||
|
|
||||
<select id="selectListAllVo" resultType="com.yxt.supervise.portal.api.restrictedcategory.RestrictedCategoryVo"> |
<select id="selectListAllVo" resultType="com.supervise.rms.api.restrictedcategory.RestrictedCategoryVo"> |
||||
SELECT * FROM restricted_category <where> ${ew.sqlSegment} </where> |
SELECT * FROM restricted_category <where> ${ew.sqlSegment} </where> |
||||
</select> |
</select> |
||||
</mapper> |
</mapper> |
@ -0,0 +1,234 @@ |
|||||
|
package com.supervise.rms.config; |
||||
|
|
||||
|
import cn.hutool.core.date.DateUtil; |
||||
|
import cn.hutool.json.JSONArray; |
||||
|
import cn.hutool.json.JSONException; |
||||
|
import cn.hutool.json.JSONObject; |
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.google.gson.Gson; |
||||
|
import com.supervise.rms.api.businessriskdata.BusinessRiskDataDto; |
||||
|
import com.supervise.rms.api.businessriskdate.BusinessRiskDateDto; |
||||
|
import com.supervise.rms.api.enterpriseinformation.EnterpriseInformation; |
||||
|
import com.supervise.rms.biz.businessriskdate.BusinessRiskDateService; |
||||
|
import com.supervise.rms.biz.enterpriseinformation.EnterpriseInformationService; |
||||
|
import org.apache.commons.codec.digest.DigestUtils; |
||||
|
import org.apache.http.Header; |
||||
|
import org.apache.http.HttpEntity; |
||||
|
import org.apache.http.client.ClientProtocolException; |
||||
|
import org.apache.http.client.methods.CloseableHttpResponse; |
||||
|
import org.apache.http.client.methods.HttpGet; |
||||
|
import org.apache.http.client.methods.HttpHead; |
||||
|
import org.apache.http.client.methods.HttpUriRequest; |
||||
|
import org.apache.http.conn.ssl.SSLConnectionSocketFactory; |
||||
|
import org.apache.http.impl.client.CloseableHttpClient; |
||||
|
import org.apache.http.impl.client.HttpClientBuilder; |
||||
|
import org.apache.http.impl.client.HttpClients; |
||||
|
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; |
||||
|
import org.apache.http.util.EntityUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.scheduling.annotation.EnableScheduling; |
||||
|
import org.springframework.scheduling.annotation.Scheduled; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import javax.net.ssl.SSLContext; |
||||
|
import javax.net.ssl.TrustManager; |
||||
|
import javax.net.ssl.X509TrustManager; |
||||
|
import java.io.IOException; |
||||
|
import java.security.KeyManagementException; |
||||
|
import java.security.NoSuchAlgorithmException; |
||||
|
import java.security.cert.X509Certificate; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-06-07-9:37 |
||||
|
*/ |
||||
|
@Component |
||||
|
@EnableScheduling |
||||
|
public class QichachaConfig { |
||||
|
private static PoolingHttpClientConnectionManager httpClientConnectionManager; |
||||
|
@Autowired |
||||
|
private EnterpriseInformationService enterpriseInformationService; |
||||
|
@Autowired |
||||
|
private BusinessRiskDateService businessRiskDateService; |
||||
|
|
||||
|
public static String APPkey = "9214e7ce4a3a483c8c115771a5f018e1"; |
||||
|
private static final String secretKey = "5827FC97C3DBFBC28444ADD3949C6FD4"; |
||||
|
public static String URL = "https://api.qichacha.com/ExceptionCheck/GetList"; |
||||
|
|
||||
|
//设置连接超时时间,单位毫秒。
|
||||
|
public final static int CONNECT_TIMEOUT = 30000; |
||||
|
//设置从connect Manager获取Connection 超时时间,单位毫秒。这个属性是新加的属性,因为目前版本是可以共享连接池的。
|
||||
|
public final static int CONNECT_REQUEST_TIMEOUT = 10000; |
||||
|
//请求获取数据的超时时间,单位毫秒。 如果访问一个接口,多少时间内无法返回数据,就直接放弃此次调用。
|
||||
|
public final static int SOCKET_TIMEOUT = 30000; |
||||
|
|
||||
|
//每周日凌晨1点执行
|
||||
|
@Scheduled(cron = "0 0 1 ? * 1") |
||||
|
public void enterpriseRiskInquiry(){ |
||||
|
String currDay = DateUtil.format(DateUtil.offsetDay(new Date(), -1), "yyyy-MM-dd"); |
||||
|
List<EnterpriseInformation> list = enterpriseInformationService.enterpriseInformationList(); |
||||
|
for (EnterpriseInformation enterpriseInformation : list) { |
||||
|
String paramStr = "searchKey=" + enterpriseInformation.getEnterpriseName(); |
||||
|
String status = ""; |
||||
|
try { |
||||
|
HttpHead reqHeader = new HttpHead(); |
||||
|
String[] autherHeader = RandomAuthentHeader(); |
||||
|
reqHeader.setHeader("Token", autherHeader[0]); |
||||
|
reqHeader.setHeader("Timespan", autherHeader[1]); |
||||
|
final String reqUri = URL.concat("?key=").concat(APPkey).concat("&").concat(paramStr); |
||||
|
String tokenJson = httpGet(reqUri, reqHeader.getAllHeaders()); |
||||
|
System.out.println(String.format("==========================>this is response:{%s}", tokenJson)); |
||||
|
status = FormartJson(tokenJson, "Status"); |
||||
|
System.out.println(String.format("==========================>Status:{%s}", status)); |
||||
|
BusinessRiskDateDto businessRiskDate = new BusinessRiskDateDto(); |
||||
|
businessRiskDate.setExecutionTime(currDay); |
||||
|
businessRiskDate.setBusinessName(enterpriseInformation.getEnterpriseName()); |
||||
|
//// TODO: 2023/6/7
|
||||
|
// businessRiskData.setBuSid(businessRiskDate.getSid());
|
||||
|
// businessRiskDate.setDataList();
|
||||
|
businessRiskDateService.save(businessRiskDate); |
||||
|
}catch (Exception e){ |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static void main(String[] args) throws Exception { |
||||
|
// List<String> arrayList = new ArrayList();
|
||||
|
// arrayList.add("石家庄瀚川商贸有限公司");
|
||||
|
// arrayList.add("石家庄富荣食品有限公司");
|
||||
|
// arrayList.add("河北昌特汽车贸易有限公司");
|
||||
|
// arrayList.add("河北旭东能源科技有限公司");
|
||||
|
|
||||
|
// Map<String, Object> map = new HashMap();
|
||||
|
// map.put("searchKey","searchKey=石家庄瀚川商贸有限公司");
|
||||
|
// String uriBuilder = URL;
|
||||
|
// // 2.设置请求参数
|
||||
|
// if (map != null) {
|
||||
|
// // 遍历请求参数
|
||||
|
// for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||
|
// // 封装请求参数
|
||||
|
// uriBuilder = uriBuilder.concat("?key=").concat(APPKEY).concat("&").concat(entry.getValue().toString());
|
||||
|
// }
|
||||
|
// }
|
||||
|
// System.out.println("输出"+uriBuilder);
|
||||
|
// // 3.创建请求对象httpGet
|
||||
|
// HttpGet httpGet = new HttpGet(uriBuilder);
|
||||
|
// /*
|
||||
|
// * 添加请求头信息
|
||||
|
// */
|
||||
|
// String[] autherHeader = RandomAuthentHeader();
|
||||
|
// httpGet.setHeader("Token", autherHeader[0]);
|
||||
|
// httpGet.setHeader("Timespan", autherHeader[1]);
|
||||
|
//
|
||||
|
// // 3. 使用Httpclient发起请求
|
||||
|
// CloseableHttpClient httpclient = HttpClients.createDefault();
|
||||
|
// RequestConfig requestConfig = RequestConfig.custom()
|
||||
|
// .setConnectTimeout(CONNECT_TIMEOUT)//设置连接超时时间,单位毫秒。
|
||||
|
// .setConnectionRequestTimeout(CONNECT_REQUEST_TIMEOUT)//设置从connect Manager获取Connection 超时时间,单位毫秒。这个属性是新加的属性,因为目前版本是可以共享连接池的。
|
||||
|
// .setSocketTimeout(SOCKET_TIMEOUT)//请求获取数据的超时时间,单位毫秒。 如果访问一个接口,多少时间内无法返回数据,就直接放弃此次调用。
|
||||
|
// .build();
|
||||
|
// httpGet.setConfig(requestConfig);
|
||||
|
// CloseableHttpResponse response = httpclient.execute(httpGet);
|
||||
|
//
|
||||
|
// // 4. 解析返回数据,封装HttpResult
|
||||
|
// // 4.1状态码
|
||||
|
// int code = response.getStatusLine().getStatusCode();
|
||||
|
// // 4.2 响应体内容
|
||||
|
// String body = null;
|
||||
|
// if (response.getEntity() != null) {
|
||||
|
// body = EntityUtils.toString(response.getEntity(), "UTF-8");
|
||||
|
// }
|
||||
|
// System.out.println("************-----------****************");
|
||||
|
// System.out.println(body);
|
||||
|
String paramStr = "searchKey=石家庄瀚川商贸有限公司"; |
||||
|
String status = ""; |
||||
|
try { |
||||
|
HttpHead reqHeader = new HttpHead(); |
||||
|
String[] autherHeader = RandomAuthentHeader(); |
||||
|
reqHeader.setHeader("Token", autherHeader[0]); |
||||
|
reqHeader.setHeader("Timespan", autherHeader[1]); |
||||
|
final String reqUri = URL.concat("?key=").concat(APPkey).concat("&").concat(paramStr); |
||||
|
String tokenJson = httpGet(reqUri, reqHeader.getAllHeaders()); |
||||
|
System.out.println(String.format("==========================>this is response:{%s}", tokenJson)); |
||||
|
|
||||
|
status = FormartJson(tokenJson, "Status"); |
||||
|
System.out.println(String.format("==========================>Status:{%s}", status)); |
||||
|
}catch (Exception e){ |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 获取Auth Code
|
||||
|
protected static final String[] RandomAuthentHeader() { |
||||
|
String timeSpan = String.valueOf(System.currentTimeMillis() / 1000); |
||||
|
String[] authentHeaders = new String[] { DigestUtils.md5Hex(APPkey.concat(timeSpan).concat(secretKey)).toUpperCase(), timeSpan }; |
||||
|
return authentHeaders; |
||||
|
} |
||||
|
|
||||
|
// 解析JSON
|
||||
|
protected static String FormartJson(String jsonString, String key) throws JSONException { |
||||
|
JSONObject jObject = new JSONObject(jsonString); |
||||
|
BusinessRiskDataDto businessRiskDataDto = jObject.toBean(BusinessRiskDataDto.class); |
||||
|
|
||||
|
// Gson gson = new Gson();
|
||||
|
// List<BusinessRiskDataDto> businessRiskDataDto = gson.fromJson(jsonString, List.class);
|
||||
|
// List<BusinessRiskDataDto> riskDataDto = JSON.parseArray(jsonString, BusinessRiskDataDto.class);
|
||||
|
return (String) jObject.get(key); |
||||
|
} |
||||
|
|
||||
|
public static String httpGet(String url, Header[] headers) throws Exception { |
||||
|
HttpUriRequest uriRequest = new HttpGet(url); |
||||
|
if (null != headers) |
||||
|
uriRequest.setHeaders(headers); |
||||
|
CloseableHttpClient httpClient = null; |
||||
|
try { |
||||
|
httpClient = declareHttpClientSSL(url); |
||||
|
CloseableHttpResponse httpresponse = httpClient.execute(uriRequest); |
||||
|
HttpEntity httpEntity = httpresponse.getEntity(); |
||||
|
String result = EntityUtils.toString(httpEntity, "utf-8"); |
||||
|
return result; |
||||
|
} catch (ClientProtocolException e) { |
||||
|
System.out.println(String.format("http请求失败,uri{%s},exception{%s}", new Object[] { url, e })); |
||||
|
} catch (IOException e) { |
||||
|
System.out.println(String.format("IO Exception,uri{%s},exception{%s}", new Object[] { url, e })); |
||||
|
} finally { |
||||
|
if (null != httpClient) |
||||
|
httpClient.close(); |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
private static CloseableHttpClient declareHttpClientSSL(String url) { |
||||
|
if (url.startsWith("https://")) { |
||||
|
return sslClient(); |
||||
|
} else { |
||||
|
return HttpClientBuilder.create().setConnectionManager(httpClientConnectionManager).build(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private static CloseableHttpClient sslClient() { |
||||
|
try { |
||||
|
SSLContext ctx = SSLContext.getInstance("TLS"); |
||||
|
X509TrustManager tm = new X509TrustManager() { |
||||
|
public X509Certificate[] getAcceptedIssuers() { |
||||
|
return null; |
||||
|
} |
||||
|
public void checkClientTrusted(X509Certificate[] xcs, String str) { |
||||
|
} |
||||
|
public void checkServerTrusted(X509Certificate[] xcs, String str) { |
||||
|
} |
||||
|
}; |
||||
|
ctx.init(null, new TrustManager[] { tm }, null); |
||||
|
SSLConnectionSocketFactory sslConnectionSocketFactory = SSLConnectionSocketFactory.getSocketFactory(); |
||||
|
return HttpClients.custom().setSSLSocketFactory(sslConnectionSocketFactory).build(); |
||||
|
} catch (NoSuchAlgorithmException e) { |
||||
|
throw new RuntimeException(e); |
||||
|
} catch (KeyManagementException e) { |
||||
|
throw new RuntimeException(e); |
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue