Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-service-hmhj
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangweidong
patzn-cloud-service-hmhj
Commits
eba5d3bc
Commit
eba5d3bc
authored
Sep 27, 2022
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对进场物资逻辑调整;
parent
51f15bbb
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
68 deletions
+35
-68
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+2
-2
EntrustSampleMapper.xml
src/main/resources/mapper/hmhj/EntrustSampleMapper.xml
+3
-3
StatisticsMapper.xml
src/main/resources/mapper/hmhj/StatisticsMapper.xml
+24
-63
20220822新增表字段.sql
src/test/java/resources/db_sql/hmhj/v182/20220822新增表字段.sql
+0
-0
20220927新增表字段.sql
src/test/java/resources/db_sql/hmhj/v185/20220927新增表字段.sql
+6
-0
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
eba5d3bc
...
@@ -1454,8 +1454,8 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -1454,8 +1454,8 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
handleSampleBrand
(
ids
,
finalSampleBrandMap
,
true
);
handleSampleBrand
(
ids
,
finalSampleBrandMap
,
true
);
// 针对铝成品和原铝进行发送ERP数据处理
// 针对铝成品和原铝进行发送ERP数据处理
//
logger.error("{}开始执行发送ERP请求:---->ERP---", DateUtils.toYearMonthDayTime(new Date()));
logger
.
error
(
"{}开始执行发送ERP请求:---->ERP---"
,
DateUtils
.
toYearMonthDayTime
(
new
Date
()));
//
sendTestDataToErp(Arrays.asList(ids), finalSampleBrandMap);
sendTestDataToErp
(
Arrays
.
asList
(
ids
),
finalSampleBrandMap
);
});
});
logger
.
error
(
"======================质量判定结束========================"
);
logger
.
error
(
"======================质量判定结束========================"
);
...
...
src/main/resources/mapper/hmhj/EntrustSampleMapper.xml
View file @
eba5d3bc
...
@@ -255,7 +255,7 @@
...
@@ -255,7 +255,7 @@
<if
test=
"null != vo.timeS and null != vo.timeE"
>
<if
test=
"null != vo.timeS and null != vo.timeE"
>
AND EXISTS (
AND EXISTS (
select 1 from entrust_sample_item si where si.deleted = 0 and si.entrust_sample_id = s.id
select 1 from entrust_sample_item si where si.deleted = 0 and si.entrust_sample_id = s.id
and
to_char(si.test_time, 'YYYY-MM-dd HH24:MI:SS')
BETWEEN #{vo.timeS} AND #{vo.timeE}
and
si.test_time
BETWEEN #{vo.timeS} AND #{vo.timeE}
)
)
</if>
</if>
GROUP BY e.model, e.plant
GROUP BY e.model, e.plant
...
@@ -386,9 +386,9 @@
...
@@ -386,9 +386,9 @@
WHERE i.deleted = 0
WHERE i.deleted = 0
AND s.name like '%磷生铁%'
AND s.name like '%磷生铁%'
AND i.period is not null
AND i.period is not null
AND ii.test_value is not null
and is_numeric(ii.test_value)
AND ii.test_value is not null
<if
test=
"null != vo.timeS and null != vo.timeE"
>
<if
test=
"null != vo.timeS and null != vo.timeE"
>
and
date(i.test_time)
>
= date(#{vo.timeS}) AND date(i.test_time)
<
= date(#{vo.timeE})
and
i.test_time
>
= #{vo.timeS} AND i.test_time
<
= #{vo.timeE}
</if>
</if>
GROUP BY i.company_id,i.period,i.entrust_sample_id
GROUP BY i.company_id,i.period,i.entrust_sample_id
) PI
) PI
...
...
src/main/resources/mapper/hmhj/StatisticsMapper.xml
View file @
eba5d3bc
...
@@ -653,7 +653,7 @@
...
@@ -653,7 +653,7 @@
FROM
FROM
entrust_sample_item i
entrust_sample_item i
WHERE
WHERE
i.deleted = 0
i.deleted = 0 and to_char(i.test_time, 'yyyy-mm') = #{vo.yearMonth}
GROUP BY
GROUP BY
i.entrust_sample_id
i.entrust_sample_id
) i ON i.entrust_sample_id = s.ID
) i ON i.entrust_sample_id = s.ID
...
@@ -661,7 +661,6 @@
...
@@ -661,7 +661,6 @@
s.deleted = 0
s.deleted = 0
AND s.NAME = '原铝'
AND s.NAME = '原铝'
AND s.sample_grading IS NOT NULL
AND s.sample_grading IS NOT NULL
AND i.test_time LIKE '${vo.yearMonth}%'
<include
refid=
"ledger_where"
/>
<include
refid=
"ledger_where"
/>
ORDER BY
ORDER BY
s.slot_no, i.test_time
s.slot_no, i.test_time
...
@@ -682,7 +681,7 @@
...
@@ -682,7 +681,7 @@
FROM
FROM
entrust_sample_item i
entrust_sample_item i
WHERE
WHERE
i.deleted = 0
i.deleted = 0 AND to_char(i.test_time,'yyyy-mm') = #{vo.yearMonth}
GROUP BY
GROUP BY
i.entrust_sample_id
i.entrust_sample_id
) i ON i.entrust_sample_id = s.ID
) i ON i.entrust_sample_id = s.ID
...
@@ -690,54 +689,30 @@
...
@@ -690,54 +689,30 @@
s.deleted = 0 and e.deleted = 0
s.deleted = 0 and e.deleted = 0
AND s.NAME = '原铝'
AND s.NAME = '原铝'
AND s.sample_grading IS NOT NULL
AND s.sample_grading IS NOT NULL
AND i.test_time LIKE '${vo.yearMonth}%'
<include
refid=
"ledger_where"
/>
<include
refid=
"ledger_where"
/>
GROUP BY s.sample_grading,i.test_time
GROUP BY s.sample_grading,i.test_time
ORDER BY
ORDER BY s.sample_grading desc, i.test_time
s.sample_grading desc, i.test_time
</select>
</select>
<!-- 原铝杂质含量台账 -->
<!-- 原铝杂质含量台账 -->
<select
id=
"selectAlImpurityLedger"
resultType=
"com.patzn.cloud.service.hmhj.vo.DailyStatsLedgerVO"
>
<select
id=
"selectAlImpurityLedger"
resultType=
"com.patzn.cloud.service.hmhj.vo.DailyStatsLedgerVO"
>
SELECT
SELECT
s.slot_no "label",
s.slot_no "label",
i.test_time
"day",
to_char( MAX ( i.test_time ), 'yyyy-mm-dd' )
"day",
i.value
SUM ( ii.test_value::NUMERIC ) "value"
FROM
FROM
entrust_sample s
entrust_sample s
JOIN electrolyzer e on e.id = s.electrolyzer_id
JOIN entrust_sample_item i on i.entrust_sample_id = s.id and i.deleted = 0
JOIN (
JOIN entrust_sample_item_index ii on ii.entrust_sample_item_id = i.id and ii.deleted = 0
SELECT
JOIN electrolyzer e ON e.ID = s.electrolyzer_id and e.deleted = 0
i.entrust_sample_id,
to_char( MAX ( i.test_time ), 'yyyy-mm-dd' ) "test_time",
sum(ii.zz_value) "value"
FROM
entrust_sample_item i
join (
select
ii.entrust_sample_item_id,
sum(cast(ii.test_value as numeric)) "zz_value"
from entrust_sample_item_index ii
where ii.deleted = 0 and is_numeric(ii.test_value)
<if
test=
"null != vo.impurity"
>
and ii.name like concat('%',#{vo.impurity},'%')
</if>
group by ii.entrust_sample_item_id
) ii on ii.entrust_sample_item_id = i.id
WHERE
i.deleted = 0
GROUP BY
i.entrust_sample_id
) i ON i.entrust_sample_id = s.ID
WHERE
WHERE
s.deleted = 0 and e
.deleted = 0
s
.deleted = 0
AND s.NAME = '原铝'
AND s.NAME = '原铝'
AND s.sample_grading IS NOT NULL
AND s.sample_grading IS NOT NULL
AND i.test_time LIKE '${vo.yearMonth}%'
AND to_char(i.test_time,'yyyy-mm') = #{vo.yearMonth}
AND TRIM(ii.test_value) ~ '^([-]?[0-9]+[.]?[0-9]*|[.][0-9]+)$'
<include
refid=
"ledger_where"
/>
<include
refid=
"ledger_where"
/>
ORDER BY
GROUP BY s.id
s.slot_no, i.test_time
ORDER BY s.slot_no, "day"
</select>
</select>
<!--原铝含铁量台账统计 -->
<!--原铝含铁量台账统计 -->
<select
id=
"selectAlFeLedgerStats"
resultType=
"com.patzn.cloud.service.hmhj.vo.DailyStatsLedgerVO"
>
<select
id=
"selectAlFeLedgerStats"
resultType=
"com.patzn.cloud.service.hmhj.vo.DailyStatsLedgerVO"
>
...
@@ -783,9 +758,8 @@
...
@@ -783,9 +758,8 @@
WHERE
WHERE
i.deleted = 0
i.deleted = 0
AND i.NAME IN ( '原铝Fe', '原铝Ni')
AND i.NAME IN ( '原铝Fe', '原铝Ni')
AND to_char(i.test_time,'yyyy-mm-dd') LIKE '${vo.yearMonth}%'
AND to_char(i.test_time,'yyyy-mm') = #{vo.yearMonth}
AND ii.test_value is not null
AND (TRIM(ii.test_value) ~ '^([-]?[0-9]+[.]?[0-9]*|[.][0-9]+)$')
AND is_numeric ( ii.test_value )
GROUP BY
GROUP BY
i.entrust_sample_id
i.entrust_sample_id
) i ON i.entrust_sample_id = s.ID
) i ON i.entrust_sample_id = s.ID
...
@@ -793,7 +767,6 @@
...
@@ -793,7 +767,6 @@
s.deleted = 0
s.deleted = 0
AND s.NAME = '原铝'
AND s.NAME = '原铝'
AND s.sample_grading IS NOT NULL
AND s.sample_grading IS NOT NULL
AND i.test_time LIKE '${vo.yearMonth}%'
<include
refid=
"ledger_where"
/>
<include
refid=
"ledger_where"
/>
GROUP BY
GROUP BY
I.test_time
I.test_time
...
@@ -815,35 +788,23 @@
...
@@ -815,35 +788,23 @@
to_char( i.test_time, 'yyyy-mm-dd' ) "test_time",
to_char( i.test_time, 'yyyy-mm-dd' ) "test_time",
MAX ( CAST ( ii.test_value AS NUMERIC ) ) "max_val",
MAX ( CAST ( ii.test_value AS NUMERIC ) ) "max_val",
MIN ( CAST ( ii.test_value AS NUMERIC ) ) "min_val",
MIN ( CAST ( ii.test_value AS NUMERIC ) ) "min_val",
round
( AVG ( CAST ( ii.test_value AS NUMERIC ) ), 5 ) "avg_val",
ROUND
( AVG ( CAST ( ii.test_value AS NUMERIC ) ), 5 ) "avg_val",
MAX ( CAST ( ii.test_value AS NUMERIC ) ) - MIN ( CAST ( ii.test_value AS NUMERIC ) ) "dif_val"
MAX ( CAST ( ii.test_value AS NUMERIC ) ) - MIN ( CAST ( ii.test_value AS NUMERIC ) ) "dif_val"
FROM
FROM
entrust_sample_item i
entrust_sample_item i
JOIN entrust_sample_item_index ii ON ii.entrust_sample_item_id = i.ID
JOIN entrust_sample s on s.id = i.entrust_sample_id and s.deleted = 0
AND ii.NAME = i.NAME
JOIN entrust_sample_item_index ii ON ii.entrust_sample_item_id = i.ID AND ii.NAME = i.NAME AND ii.deleted = 0
JOIN electrolyzer e ON e.ID = s.electrolyzer_id and e.deleted = 0
WHERE
WHERE
i.deleted = 0
i.deleted = 0
AND ii.deleted = 0
AND s.NAME in ('原铝','原铝散样','原铝重取')
AND i.NAME = ii.NAME
AND to_char( i.test_time, 'yyyy-mm') = #{vo.yearMonth}
AND I.NAME LIKE'%原铝%'
AND (TRIM(ii.test_value) ~ '^([-]?[0-9]+[.]?[0-9]+)$')
AND to_char( i.test_time, 'yyyy-mm-dd' ) like '${vo.yearMonth}%'
AND is_numeric ( ii.test_value )
<if
test=
"null != vo.branch or null != vo.partition or null != vo.plant"
>
AND EXISTS (
SELECT
1
FROM entrust_sample s
join electrolyzer e ON e.ID = s.electrolyzer_id
WHERE s.deleted = 0 and e.deleted = 0 and s.id = i.entrust_sample_id
<include
refid=
"ledger_where"
/>
<include
refid=
"ledger_where"
/>
)
</if>
GROUP BY
GROUP BY
i.NAME,
i.NAME, "test_time"
to_char( i.test_time, 'yyyy-mm-dd' )
ORDER BY
ORDER BY
i.NAME,
i.NAME,"test_time"
to_char( i.test_time, 'yyyy-mm-dd' )
) T order by t.name, sn, label, day
) T order by t.name, sn, label, day
</select>
</select>
<!--获取检测项目委托量统计数据: 获取LIMS平台某段时间的检测项目委托总数量-->
<!--获取检测项目委托量统计数据: 获取LIMS平台某段时间的检测项目委托总数量-->
...
...
src/test/java/resources/db_sql/hmhj/v182/202
0
0822新增表字段.sql
→
src/test/java/resources/db_sql/hmhj/v182/202
2
0822新增表字段.sql
View file @
eba5d3bc
File moved
src/test/java/resources/db_sql/hmhj/v185/20220927新增表字段.sql
0 → 100644
View file @
eba5d3bc
ALTER
TABLE
"public"
.
"material"
ALTER
TABLE
"public"
.
"material"
ADD
COLUMN
"type"
int2
default
0
;
COMMENT
ON
COLUMN
"public"
.
"material"
.
"type"
IS
'物资类型(0:自产,1:进场)'
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment