修改服务注册地址
This commit is contained in:
parent
79034404a7
commit
fa375f67bb
|
|
@ -23,6 +23,7 @@ public class CorsConfig {
|
|||
config.addAllowedOriginPattern("*");
|
||||
// 是什么请求头部
|
||||
config.addAllowedHeader("*");
|
||||
config.setAllowCredentials(false);
|
||||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(new PathPatternParser());
|
||||
source.registerCorsConfiguration("/**", config);
|
||||
return new CorsWebFilter(source);
|
||||
|
|
|
|||
|
|
@ -110,10 +110,10 @@
|
|||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-devtools</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!--<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
|
@ -233,6 +233,7 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.6.2</version>
|
||||
|
||||
<configuration>
|
||||
<includeSystemScope>true</includeSystemScope>
|
||||
</configuration>
|
||||
|
|
|
|||
|
|
@ -93,7 +93,13 @@ public class ProjectGeneralServiceImpl implements ProjectGeneralService {
|
|||
* */
|
||||
@Override
|
||||
public R addProjectGeneral(ProjectGeneralBean bean) {
|
||||
int res = dao.addProjectGeneral(bean);
|
||||
int res=0;
|
||||
if(StringUtils.isEmpty(bean.getProId())){
|
||||
res = dao.addProjectGeneral(bean);
|
||||
}else{
|
||||
res = dao.updateProjectGeneral(bean);
|
||||
}
|
||||
|
||||
return res > 0 ? R.ok(null, "新增成功"):R.fail("新增失败");
|
||||
}
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,13 +2,9 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.bmw.basic.dao.ProjectGeneralDao">
|
||||
<insert id="addProjectGeneral">
|
||||
MERGE INTO "ynrealname"."bm_project_general" target
|
||||
USING (SELECT #{proGeneralName} as "name", #{level} as "level_id") source
|
||||
ON (target."name" = source."name" AND target."level_id" = source."level_id")
|
||||
WHEN MATCHED THEN
|
||||
UPDATE SET target."name" = source."name", target."level_id" = source."level_id"
|
||||
WHEN NOT MATCHED THEN
|
||||
INSERT ("name", "level_id") VALUES (source."name", source."level_id")
|
||||
insert into "ynrealname"."bm_project_general"
|
||||
("name", "level_id","is_active" )
|
||||
values (#{proGeneralName},#{level},1)
|
||||
</insert>
|
||||
<update id="updateProjectGeneral">
|
||||
update "ynrealname"."bm_project_general" set "name" = #{proGeneralName},"level_id" = #{level}
|
||||
|
|
@ -28,7 +24,7 @@
|
|||
COUNT(bp."name") AS proNum,
|
||||
WM_CONCAT(bp."pro_status") AS proStatusId,
|
||||
td."value" AS "level",
|
||||
'' AS proStatusName
|
||||
'' proStatusName
|
||||
FROM "ynrealname"."bm_project_general" bpg
|
||||
LEFT JOIN "ynrealname"."bm_project" bp ON bp."project_general_id" = bpg."id" AND bp."is_active" = '1'
|
||||
LEFT JOIN "ynrealname"."t_dict" td ON td."id" = bpg."level_id" AND td."is_active" = '1'
|
||||
|
|
@ -40,7 +36,7 @@
|
|||
<if test="params.keyword != null and params.keyword != ''">
|
||||
and (bpg."name" like concat('%',#{params.keyword},'%') OR td."value" like concat('%',#{params.keyword},'%'))
|
||||
</if>
|
||||
GROUP BY bpg."id", bpg."name", td."value"
|
||||
GROUP BY bpg."id",bp."id", bpg."name", td."value" ,bp."pro_status"
|
||||
</select>
|
||||
<select id="getProGeneralCount" resultType="java.lang.Integer">
|
||||
select count(1) from
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
<update id="finishProject">
|
||||
update "ynrealname"."bm_project" set "pro_status" = '1'
|
||||
where ID = #{id} and "is_active" = '1'
|
||||
where "id" = #{id} and "is_active" = '1'
|
||||
</update>
|
||||
|
||||
<update id="updWrkerRecord">
|
||||
|
|
@ -43,12 +43,12 @@
|
|||
<select id="getProList" resultType="com.bonus.bmw.basic.entity.ProjectBean">
|
||||
SELECT
|
||||
bpg."name" AS proGeneralName,
|
||||
bp."id",po.NAME AS companyName,bp."NAME" AS name,
|
||||
bp."id",po."name" AS companyName,bp."name" AS name,
|
||||
bp."pro_type" AS proType,bp."level_id" as levelId,
|
||||
bp."pro_status" AS proStatus,bp."project_address" AS projectAddress,td."value" as levelName
|
||||
FROM "ynrealname"."bm_project" bp
|
||||
LEFT JOIN "ynrealname"."bm_project_general" bpg ON bpg."id" = bp."project_general_id" AND bpg."is_active" = '1'
|
||||
LEFT JOIN "ynrealname"."pm_company" pc ON bp."company_id" = pc.ID
|
||||
LEFT JOIN "ynrealname"."pm_company" pc ON bp."company_id" = pc."id"
|
||||
LEFT JOIN "ynrealname"."pm_organization" po ON bp."company_id" = po."id"
|
||||
LEFT JOIN "ynrealname"."t_dict" td ON td."id" = bp."level_id"
|
||||
LEFT JOIN "ynrealname"."bm_sub_contract" bsc on bsc."pro_id" = bp."id" and bsc."is_active" = '1'
|
||||
|
|
@ -63,13 +63,13 @@
|
|||
AND bsc."sub_id" = #{params.subId}
|
||||
</if>
|
||||
<if test="params.proId!=null and params.proId!='' ">
|
||||
and bp.ID= #{params.proId}
|
||||
and bp."id"= #{params.proId}
|
||||
</if>
|
||||
<if test="params.proStatus!=null and params.proStatus!='' ">
|
||||
and bp."pro_status"= #{params.proStatus}
|
||||
</if>
|
||||
GROUP BY
|
||||
bp."id", bpg."name", po.NAME, bp."NAME", bp."pro_type", bp."level_id", bp."pro_status", bp."project_address", td."value"
|
||||
bp."id", bpg."name", po."name", bp."name", bp."pro_type", bp."level_id", bp."pro_status", bp."project_address", td."value"
|
||||
<if test="offset != null and offset >= 0 and limit != null and limit >= 0">
|
||||
OFFSET #{offset} ROWS FETCH NEXT #{limit} ROWS ONLY
|
||||
</if>
|
||||
|
|
@ -99,7 +99,7 @@ select count(1) from
|
|||
SELECT
|
||||
count(1)
|
||||
FROM "ynrealname"."bm_project" bp
|
||||
LEFT JOIN "ynrealname"."pm_company" pc ON bp."company_id" = pc.ID
|
||||
LEFT JOIN "ynrealname"."pm_company" pc ON bp."company_id" = pc."id"
|
||||
LEFT JOIN "ynrealname"."pm_organization" po ON bp."company_id" = po."id"
|
||||
LEFT JOIN "ynrealname"."t_dict" td ON td."id" = bp."level_id"
|
||||
LEFT JOIN "ynrealname"."bm_sub_contract" bsc on bsc."pro_id" = bp."id" and bsc."is_active" = '1'
|
||||
|
|
@ -114,7 +114,7 @@ select count(1) from
|
|||
AND bsc."sub_id" = #{params.subId}
|
||||
</if>
|
||||
<if test="params.proId!=null and params.proId!='' ">
|
||||
and bp.ID= #{params.proId}
|
||||
and bp."id"= #{params.proId}
|
||||
</if>
|
||||
<if test="params.proStatus!=null and params.proStatus!='' ">
|
||||
and bp."pro_status"= #{params.proStatus}
|
||||
|
|
@ -127,19 +127,19 @@ select count(1) from
|
|||
SELECT
|
||||
bpg."id" AS proGeneralId,
|
||||
bpg."name" AS proGeneralName,
|
||||
bm_project."id" AS id,
|
||||
bm_project."name",bm_project."abbreviation" as abbreviation,
|
||||
bm_project."pro_type" as proType,bm_project."company_id" as companyId,
|
||||
bm_project."level_id" as levelId,bm_project."power_grid" as powerGrid,
|
||||
bm_project."project_address" as projectAddress,bm_project."lon",
|
||||
bm_project."lat",bm_project."pro_status" as proStatus,
|
||||
bm_project."two_com_id" as twoComId,
|
||||
bm_project."plan_start_time" as planStartTime,bm_project."plan_stop_time" as planStopTime,
|
||||
bm_project."create_time" as createTime,bm_project."update_time" as updateTime,"owner_id" as ownerId,
|
||||
bm_project."is_active" as isActive
|
||||
FROM "ynrealname"."bm_project"
|
||||
LEFT JOIN "ynrealname"."bm_project_general" bpg ON bpg."id" = bm_project."project_general_id" AND bpg."is_active" = '1'
|
||||
WHERE bm_project."id" = #{id}
|
||||
pro."id" AS id,
|
||||
pro."name",pro."abbreviation" as abbreviation,
|
||||
pro."pro_type" as proType,pro."company_id" as companyId,
|
||||
pro."level_id" as levelId,pro."power_grid" as powerGrid,
|
||||
pro."project_address" as projectAddress,pro."lon",
|
||||
pro."lat",pro."pro_status" as proStatus,
|
||||
pro."two_com_id" as twoComId,
|
||||
pro."plan_start_time" as planStartTime,pro."plan_stop_time" as planStopTime,
|
||||
pro."create_time" as createTime,pro."update_time" as updateTime,"owner_id" as ownerId,
|
||||
pro."is_active" as isActive
|
||||
FROM "ynrealname"."bm_project" pro
|
||||
LEFT JOIN "ynrealname"."bm_project_general" bpg ON bpg."id" = pro."project_general_id" AND bpg."is_active" = '1'
|
||||
WHERE pro."id" = #{id}
|
||||
</select>
|
||||
<select id="getPowerLevel" resultType="com.bonus.bmw.basic.entity.ProjectBean">
|
||||
select "id","value" from "ynrealname"."t_dict"
|
||||
|
|
@ -162,24 +162,24 @@ select count(1) from
|
|||
GROUP BY "id", "name"
|
||||
</select>
|
||||
<select id="getAllWorker" resultType="java.lang.Integer">
|
||||
select count(ID_NUMBER) from "ynrealname"."bm_project" bp
|
||||
left join "ynrealname"."bm_worker_record" bwr on bp.ID = bwr.PROJECT_ID and bwr.IS_ACTIVE = '1'
|
||||
where bp.ID = #{id} and bp."is_active" = '1' group by bp."id", bwr.ID_NUMBER
|
||||
select count("id_number") from "ynrealname"."bm_project" bp
|
||||
left join "ynrealname"."bm_worker_record" bwr on bp.ID = bwr."project_id" and bwr."is_active" = '1'
|
||||
where bp."id" = #{id} and bp."is_active" = '1' group by bp."id", bwr."id_number"
|
||||
</select>
|
||||
<select id="isRepeat" resultType="java.lang.Integer">
|
||||
select count(*) from "ynrealname"."bm_project"
|
||||
where "name" = #{name} and "is_active" = '1'
|
||||
</select>
|
||||
<select id="getIdNumber" resultType="com.bonus.bmw.basic.entity.ProjectBean">
|
||||
select ID_NUMBER from "ynrealname"."bm_project" bp
|
||||
select "id_number" from "ynrealname"."bm_project" bp
|
||||
left join "ynrealname"."bm_worker_record" bwr on bp.ID = bwr."project_id" and bwr."is_active" = '1'
|
||||
where bp.ID = #{id} and bp."is_active" = '1'
|
||||
where bp."id" = #{id} and bp."is_active" = '1'
|
||||
</select>
|
||||
<select id="getEinTime" resultType="java.lang.String">
|
||||
SELECT EIN_TIME as einTime
|
||||
SELECT "ein_time" as einTime
|
||||
FROM "ynrealname"."bm_worker_attend_history"
|
||||
WHERE ID_NUMBER = #{idNumber}
|
||||
ORDER BY EIN_TIME desc
|
||||
WHERE "id_number" = #{idNumber}
|
||||
ORDER BY "ein_time" desc
|
||||
FETCH FIRST 1 ROWS ONLY
|
||||
</select>
|
||||
<select id="getPowerLevelID" resultType="java.lang.String">
|
||||
|
|
@ -214,15 +214,14 @@ select count(1) from
|
|||
GROUP BY bp."id", bp."name"
|
||||
</select>
|
||||
<update id="workerHistory" parameterType="com.bonus.bmw.basic.entity.ProjectBean">
|
||||
update "ynrealname"."bm_worker_attend_history" set EXIT_TIME = #{exitTime}
|
||||
where ID_NUMBER = #{idNumber} AND EIN_TIME = #{einTime}
|
||||
update "ynrealname"."bm_worker_attend_history" set "ein_time" = #{exitTime}
|
||||
where "id_number" = #{idNumber} AND "ein_time" = #{einTime}
|
||||
and "is_active" = '1'
|
||||
</update>
|
||||
<update id="updateProject">
|
||||
update "ynrealname"."bm_project"
|
||||
set
|
||||
"project_general_id" = #{proGeneralId},
|
||||
ID = #{id},
|
||||
"company_id" = #{companyId},
|
||||
"name" = #{name},
|
||||
"two_com_id" = #{twoComId},
|
||||
|
|
@ -238,24 +237,24 @@ select count(1) from
|
|||
"plan_start_time" = #{planStartTime},
|
||||
"plan_stop_time" = #{planStopTime},
|
||||
"update_time" = now()
|
||||
where ID = #{id}
|
||||
where "id" = #{id}
|
||||
</update>
|
||||
<select id="getOrg" parameterType="com.bonus.bmw.basic.entity.OrgBean" resultType="com.bonus.bmw.basic.entity.ProjectBean">
|
||||
SELECT
|
||||
po.ID as companyId,
|
||||
po.NAME as name
|
||||
po."id" as companyId,
|
||||
po."name" as name
|
||||
FROM
|
||||
"ynrealname"."pm_organization" po
|
||||
WHERE
|
||||
po."is_active" = '1'
|
||||
<if test="companyId!=null and companyId!='' ">
|
||||
and po.ID =#{companyId}
|
||||
and po."id" =#{companyId}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getCompanyFactor" resultType="com.bonus.bmw.basic.entity.ProjectBean">
|
||||
select pc.ID as companyId,pc.NAME as companyName
|
||||
select pc."id" as companyId,pc."name" as companyName
|
||||
from "ynrealname"."pm_company" pc
|
||||
where pc.IS_ACTIVE = '1'
|
||||
where pc."is_active" = '1'
|
||||
<!--<if test="params.companyId!=null and params.companyId!='' and params.companyId!= '-1' ">
|
||||
and FIND_IN_SET(pc.ID, getChildList (#{params.companyId}))
|
||||
</if>-->
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -138,7 +138,13 @@
|
|||
<artifactId>jackson-mapper-asl</artifactId>
|
||||
<version>1.9.13</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.dm</groupId>
|
||||
<artifactId>DmJdbcDriver18</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/DmJdbcDriver18.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
|||
|
|
@ -109,6 +109,9 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.6.2</version>
|
||||
<configuration>
|
||||
<includeSystemScope>true</includeSystemScope>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
|
|
|
|||
Loading…
Reference in New Issue