Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
529473f1
由
张雷
编写于
2024-12-04 14:11:39 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
Merge remote-tracking branch 'origin/master' into master
2 个父辈
f88cdbf7
c57a406b
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
46 行增加
和
8 行删除
sk-base-common/src/main/java/com/skua/tool/util/DateUtils.java
sk-module-biz/src/main/java/com/skua/modules/safe/controller/EnvironmentTargetController.java
sk-module-biz/src/main/java/com/skua/modules/safe/entity/EnvironmentTarget.java
sk-module-biz/src/main/java/com/skua/modules/safe/service/IEnvironmentTargetService.java
sk-module-biz/src/main/java/com/skua/modules/safe/service/impl/EnvironmentTargetServiceImpl.java
sk-module-equipment/src/main/java/com/skua/modules/equipment/vo/DrugConsumptionDisplayVO.java
sk-base-common/src/main/java/com/skua/tool/util/DateUtils.java
查看文件 @
529473f
...
...
@@ -2,7 +2,6 @@ package com.skua.tool.util;
import
com.skua.constant.BaseConstant
;
import
java.math.BigDecimal
;
import
java.text.ParseException
;
import
java.text.ParsePosition
;
import
java.text.SimpleDateFormat
;
import
java.time.DayOfWeek
;
...
...
sk-module-biz/src/main/java/com/skua/modules/safe/controller/EnvironmentTargetController.java
查看文件 @
529473f
...
...
@@ -99,8 +99,15 @@ public class EnvironmentTargetController {
public
Result
<
EnvironmentTarget
>
add
(
@RequestBody
EnvironmentTarget
environmentTarget
)
{
Result
<
EnvironmentTarget
>
result
=
new
Result
<
EnvironmentTarget
>();
try
{
environmentTargetService
.
save
(
environmentTarget
);
result
.
success
(
"添加成功!"
);
boolean
flag
=
environmentTargetService
.
checkData
(
environmentTarget
.
getDepartId
(),
environmentTarget
.
getTargetYear
());
if
(
flag
){
environmentTargetService
.
save
(
environmentTarget
);
result
.
success
(
"添加成功!"
);
}
else
{
result
.
error500
(
"该水厂已经提交过["
+
environmentTarget
.
getTargetYear
()+
"]年份数据,不能在提交!"
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
result
.
error500
(
"操作失败"
);
...
...
sk-module-biz/src/main/java/com/skua/modules/safe/entity/EnvironmentTarget.java
查看文件 @
529473f
...
...
@@ -25,7 +25,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"safety_environment_target对象"
,
description
=
"安环环保目标"
)
public
class
EnvironmentTarget
{
/**主键id*/
@TableId
(
type
=
IdType
.
ID_WORKER_STR
)
@ApiModelProperty
(
value
=
"主键id"
)
...
...
@@ -57,8 +57,16 @@ public class EnvironmentTarget {
private
String
newCaseNum
;
/**考核分数*/
@Excel
(
name
=
"考核分数"
,
width
=
15
)
@ApiModelProperty
(
value
=
"考核分数"
)
@ApiModelProperty
(
value
=
"考核分数
:作废
"
)
private
String
examScore
;
@Excel
(
name
=
"约束指标评分"
,
width
=
15
)
@ApiModelProperty
(
value
=
"约束指标评分"
)
private
String
constraintScore
;
@Excel
(
name
=
"责任指标评分"
,
width
=
15
)
@ApiModelProperty
(
value
=
"责任指标评分"
)
private
String
liabilityScore
;
/**创建人Id*/
@Excel
(
name
=
"创建人Id"
,
width
=
15
)
@ApiModelProperty
(
value
=
"创建人Id"
)
...
...
sk-module-biz/src/main/java/com/skua/modules/safe/service/IEnvironmentTargetService.java
查看文件 @
529473f
...
...
@@ -8,4 +8,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public
interface
IEnvironmentTargetService
extends
IService
<
EnvironmentTarget
>
{
boolean
checkData
(
String
departId
,
String
targetYear
);
}
...
...
sk-module-biz/src/main/java/com/skua/modules/safe/service/impl/EnvironmentTargetServiceImpl.java
查看文件 @
529473f
package
com
.
skua
.
modules
.
safe
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.skua.modules.safe.entity.EnvironmentTarget
;
import
com.skua.modules.safe.mapper.EnvironmentTargetMapper
;
import
com.skua.modules.safe.service.IEnvironmentTargetService
;
...
...
@@ -7,10 +8,29 @@ import org.springframework.stereotype.Service;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
java.util.List
;
/**
* 安环环保目标
*/
@Service
public
class
EnvironmentTargetServiceImpl
extends
ServiceImpl
<
EnvironmentTargetMapper
,
EnvironmentTarget
>
implements
IEnvironmentTargetService
{
/***
* 校验一个水厂一年只能提交一次数据
* @param departId
* @param targetYear
* @return
*/
public
boolean
checkData
(
String
departId
,
String
targetYear
){
QueryWrapper
<
EnvironmentTarget
>
queryWrapper
=
new
QueryWrapper
();
queryWrapper
.
eq
(
"depart_id"
,
departId
)
;
queryWrapper
.
eq
(
"target_year"
,
targetYear
)
;
List
<
EnvironmentTarget
>
environmentTargetList
=
this
.
baseMapper
.
selectList
(
queryWrapper
);
if
(
environmentTargetList
!=
null
&&
!
environmentTargetList
.
isEmpty
())
{
return
false
;
}
return
true
;
}
}
...
...
sk-module-equipment/src/main/java/com/skua/modules/equipment/vo/DrugConsumptionDisplayVO.java
查看文件 @
529473f
...
...
@@ -79,6 +79,7 @@ public class DrugConsumptionDisplayVO {
this
.
drugName
=
drugName
;
}
public
DrugConsumptionDisplayVO
(
Double
CSL
,
Double
tbqnCsl
,
Double
hbsyCsl
,
Double
zyh
,
Double
hbsyzyh
,
Double
tbqnzyh
)
{
this
.
CSL
=
CSL
;
this
.
tbqnCsl
=
tbqnCsl
;
...
...
@@ -90,14 +91,16 @@ public class DrugConsumptionDisplayVO {
if
(
this
.
zyh
!=
null
){
//计算吨水药耗
//药耗量[kg] / 处理水量[吨]
if
(
this
.
CSL
!=
null
&&
Double
.
compare
(
this
.
CSL
,
0.0
)
!=
0
)
this
.
dsyh
=
this
.
getValue
(
this
.
zyh
/
this
.
CSL
);
if
(
this
.
CSL
!=
null
&&
Double
.
compare
(
this
.
CSL
,
0.0
)
!=
0
)
{
this
.
dsyh
=
this
.
getValue
(
this
.
zyh
/
this
.
CSL
);
}
//同比总药耗
if
(
this
.
tbqnzyh
!=
null
){
this
.
tbqnzyhsl
=
this
.
getValue
(
this
.
zyh
-
this
.
tbqnzyh
);
this
.
tbqnzyhbl
=
this
.
getValue
(((
this
.
zyh
-
this
.
tbqnzyh
)/
this
.
tbqnzyh
)*
100
)
;
//计算吨水药耗 //同比吨水药耗
if
(
this
.
tbqnCsl
!=
null
&&
Double
.
compare
(
this
.
tbqnCsl
,
0.0
)
!=
0
)
this
.
tbqndsyh
=
this
.
getValue
(
this
.
tbqnzyh
/
this
.
tbqnCsl
);
if
(
this
.
tbqndsyh
!=
null
){
if
(
this
.
tbqndsyh
!=
null
&&
this
.
dsyh
!=
null
){
this
.
tbqndsyhsl
=
this
.
getValue
(
dsyh
-
tbqndsyh
);
this
.
tbqndsyhbl
=
this
.
getValue
((
dsyh
-
tbqndsyh
)/
tbqndsyh
*
100
);
}
...
...
@@ -108,7 +111,7 @@ public class DrugConsumptionDisplayVO {
this
.
hbsyzyhbl
=
this
.
getValue
(((
this
.
zyh
-
this
.
hbsyzyh
)/
this
.
hbsyzyh
)*
100
)
;
//环比-吨水药耗
if
(
this
.
hbsyCsl
!=
null
&&
Double
.
compare
(
this
.
hbsyCsl
,
0.0
)
!=
0
)
this
.
hbsydsyh
=
this
.
getValue
(
this
.
hbsyzyh
/
this
.
hbsyCsl
);
if
(
this
.
hbsydsyh
!=
null
){
if
(
this
.
hbsydsyh
!=
null
&&
this
.
dsyh
!=
null
){
this
.
hbsydsyhsl
=
this
.
getValue
(
this
.
dsyh
-
this
.
hbsydsyh
);
this
.
hbsydsyhbl
=
this
.
getValue
((
this
.
dsyh
-
this
.
hbsydsyh
)
/
this
.
hbsydsyh
*
100
);
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论