zhangtao
dongdingding 1 year ago
parent cde8e67c9a
commit b5bd26c78b

@ -149,8 +149,10 @@ public class BPlanEnterpriseController extends BaseController {
bPlanEnterprise.setCreateId(getUserId());
String enterPriseId = String.valueOf(bPlanEnterprise.getEnterpriseId());
String district = bPlanEnterprise.getDistrict();
String enterpriseName = bPlanEnterprise.getEnterpriseName();
String[] idArray = enterPriseId.split(",");
String[] districtArray = district.split(",");
String[] enterpriseNameArray = enterpriseName.split(",");
int i = 0;
for (String entId : idArray) {
//根据企业id查询重点企业表是 1:重点企业 2非重点企业
@ -164,6 +166,7 @@ public class BPlanEnterpriseController extends BaseController {
bPlanEnterprise.setCreateId(getUserId());
bPlanEnterprise.setDeptId(getDeptId());
bPlanEnterprise.setDistrict(districtArray[i]);
bPlanEnterprise.setEnterpriseName(enterpriseNameArray[i]);
bPlanEnterpriseService.save(bPlanEnterprise);
i += 1;

@ -135,11 +135,19 @@ public class BPlanEnterprise implements Serializable {
private Integer isPoint;
/**
*
*
*/
@TableField(exist = false)
@ApiModelProperty(value = "企业名称")
@ApiModelProperty(value = "企业主表名称")
private String entprName;
/**
*
*/
@Excel(name = "企业名称")
@ApiModelProperty(value = "企业名称")
private String enterpriseName;
}

@ -117,7 +117,7 @@ public class BPlanEnterpriseZhifaResponse {
@ApiModelProperty(value = "企业名称")
@Excel(name = "企业名称")
private String entprName;
private String enterpriseName;
/**

@ -36,7 +36,7 @@ public class UserServiceImpl extends ServiceImpl<GeoLayerMapper, GeoLayer> imple
public Object getUserByCode(String code) {
RestTemplate restTemplate = new RestTemplate();
// 先请求accessToken
String accessTokenUrl = "http://180.108.205.123:8090/sso-server/oauth2/accessToken";
String accessTokenUrl = "http://2.46.4.197:8090/sso-server/oauth2/accessToken";
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
MultiValueMap map = new LinkedMultiValueMap();
@ -53,7 +53,7 @@ public class UserServiceImpl extends ServiceImpl<GeoLayerMapper, GeoLayer> imple
// 获取accessToken
String accessToken=data.get("accessToken").toString();
// 获取用户
String userUrl = "http://180.108.205.123:8090/sso-server/oauth2/getUser";
String userUrl = "http://2.46.4.197:8090/sso-server/oauth2/getUser";
headers = new HttpHeaders();
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
map = new LinkedMultiValueMap();

@ -80,43 +80,77 @@
</select>
<select id="getZhifa" resultType="com.ruoyi.programManagement.entity.response.BPlanEnterpriseZhifaResponse">
-- SELECT
-- s.*
-- FROM
-- (
-- SELECT
-- a.*,
-- a.planned_year AS plannedYear,
-- b.id AS longId,
-- b.EXAMINE_START_TIME,
-- b.EXAMINE_END_TIME,
-- b.ENTPR_NAME as entprName,
-- CASE
-- WHEN b.USC_CODE IS NOT NULL
-- AND SUBSTRING( a.planned_year, 1, 7 ) = SUBSTRING( b.EXAMINE_START_TIME, 1, 7 )
-- THEN 1
-- ELSE 2
-- END AS checkStatus
-- FROM
-- b_plan_enterprise a
-- LEFT JOIN sz_enfor_examine b ON a.enterprise_id = b.USC_CODE
-- WHERE
-- b.USC_CODE IS NOT NULL
-- ) s
SELECT p.*
FROM (
SELECT
s.*
a.*,
a.planned_year AS plannedYear,
NULL AS longId,
NULL AS EXAMINE_START_TIME,
NULL AS EXAMINE_END_TIME,
2 AS checkStatus
FROM
(
b_plan_enterprise a
WHERE
a.enterprise_id NOT IN (SELECT USC_CODE FROM sz_enfor_examine WHERE USC_CODE IS NOT NULL)
UNION
SELECT
a.*,
a.planned_year AS plannedYear,
b.id AS longId,
b.EXAMINE_START_TIME,
b.EXAMINE_END_TIME,
b.ENTPR_NAME as entprName,
CASE
WHEN b.USC_CODE IS NOT NULL
AND SUBSTRING( a.planned_year, 1, 7 ) = SUBSTRING( b.EXAMINE_START_TIME, 1, 7 )
THEN 1
WHEN b.USC_CODE IS NOT NULL AND SUBSTRING(a.planned_year, 1, 7) = SUBSTRING(b.EXAMINE_START_TIME, 1, 7) THEN 1
ELSE 2
END AS checkStatus
FROM
b_plan_enterprise a
LEFT JOIN sz_enfor_examine b ON a.enterprise_id = b.USC_CODE
WHERE
b.USC_CODE IS NOT NULL
) s
FROM (
SELECT *,
ROW_NUMBER() OVER (PARTITION BY USC_CODE ORDER BY EXAMINE_START_TIME DESC) AS rn
FROM sz_enfor_examine
WHERE USC_CODE IS NOT NULL
) b
INNER JOIN b_plan_enterprise a ON a.enterprise_id = b.USC_CODE AND b.rn = 1
) p
<where>
<if test="req.plannedYear !=null and req.plannedYear !=''">
and s.plannedYear =#{req.plannedYear}
and p.plannedYear =#{req.plannedYear}
</if>
<if test="req.district !=null and req.district !=''">
and s.district like concat('%', #{req.district}, '%')
and p.district like concat('%', #{req.district}, '%')
</if>
<if test="req.checkStatus !=null and req.checkStatus !=''">
and s.checkStatus =#{req.checkStatus}
and p.checkStatus =#{req.checkStatus}
</if>
</where>
</select>
<select id="page" resultType="com.ruoyi.programManagement.entity.BPlanEnterprise">
select * from b_plan_enterprise

Loading…
Cancel
Save