zhangtao
dongdingding 1 year ago
parent cde8e67c9a
commit b5bd26c78b

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

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

@ -117,7 +117,7 @@ public class BPlanEnterpriseZhifaResponse {
@ApiModelProperty(value = "企业名称") @ApiModelProperty(value = "企业名称")
@Excel(name = "企业名称") @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) { public Object getUserByCode(String code) {
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
// 先请求accessToken // 先请求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(); HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.MULTIPART_FORM_DATA); headers.setContentType(MediaType.MULTIPART_FORM_DATA);
MultiValueMap map = new LinkedMultiValueMap(); MultiValueMap map = new LinkedMultiValueMap();
@ -53,7 +53,7 @@ public class UserServiceImpl extends ServiceImpl<GeoLayerMapper, GeoLayer> imple
// 获取accessToken // 获取accessToken
String accessToken=data.get("accessToken").toString(); 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 = new HttpHeaders();
headers.setContentType(MediaType.MULTIPART_FORM_DATA); headers.setContentType(MediaType.MULTIPART_FORM_DATA);
map = new LinkedMultiValueMap(); map = new LinkedMultiValueMap();

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

Loading…
Cancel
Save