Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
b9bcee2a
提交
b9bcee2a
authored
11月 18, 2020
作者:
邓砥奕
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复bug
上级
eaa52237
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
184 行增加
和
45 行删除
+184
-45
DeviceLibraryServiceImpl.java
...device/library/service/impl/DeviceLibraryServiceImpl.java
+25
-0
DeviceStatisticsVo.java
...ykj/dev/device/library/subject/vo/DeviceStatisticsVo.java
+22
-0
RepairController.java
...m/tykj/dev/device/repair/controller/RepairController.java
+20
-2
RfidController.java
...ain/java/com/tykj/dev/rfid/controller/RfidController.java
+3
-3
RfidPrintVo.java
...rc/main/java/com/tykj/dev/rfid/entity/vo/RfidPrintVo.java
+22
-0
RfidService.java
.../src/main/java/com/tykj/dev/rfid/service/RfidService.java
+5
-2
RfidServiceImpl.java
.../java/com/tykj/dev/rfid/service/impl/RfidServiceImpl.java
+37
-15
StatisticalServiceImpl.java
.../dev/statistical/service/impl/StatisticalServiceImpl.java
+46
-19
PerQuarter.java
...src/main/java/com/tykj/dev/statistical/vo/PerQuarter.java
+2
-2
SelfInspection.java
...main/java/com/tykj/dev/statistical/vo/SelfInspection.java
+2
-2
没有找到文件。
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
浏览文件 @
b9bcee2a
...
@@ -13,6 +13,7 @@ import com.tykj.dev.misc.exception.ApiException;
...
@@ -13,6 +13,7 @@ import com.tykj.dev.misc.exception.ApiException;
import
com.tykj.dev.misc.utils.GetTreeUtils
;
import
com.tykj.dev.misc.utils.GetTreeUtils
;
import
com.tykj.dev.misc.utils.PageUtil
;
import
com.tykj.dev.misc.utils.PageUtil
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
io.swagger.annotations.ApiModelProperty
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
...
@@ -149,6 +150,13 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
...
@@ -149,6 +150,13 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
int
allotNum
=
0
;
int
allotNum
=
0
;
int
retiredNum
=
0
;
int
retiredNum
=
0
;
int
useNum
=
0
;
int
useNum
=
0
;
List
<
Integer
>
inLibraryIds
=
new
ArrayList
<>();
List
<
Integer
>
repairIds
=
new
ArrayList
<>();
List
<
Integer
>
destoryIds
=
new
ArrayList
<>();
List
<
Integer
>
retiredIds
=
new
ArrayList
<>();
List
<
Integer
>
scrappedIds
=
new
ArrayList
<>();
List
<
Integer
>
allotIds
=
new
ArrayList
<>();
List
<
Integer
>
useIds
=
new
ArrayList
<>();
//遍历核心装备,按照相同型号的装备生命状态统计
//遍历核心装备,按照相同型号的装备生命状态统计
for
(
DeviceLibrary
d2
:
libraryEntities
)
{
for
(
DeviceLibrary
d2
:
libraryEntities
)
{
if
(
d2
.
getModel
().
equals
(
model
))
{
if
(
d2
.
getModel
().
equals
(
model
))
{
...
@@ -158,33 +166,43 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
...
@@ -158,33 +166,43 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
switch
(
d2
.
getLifeStatus
())
{
switch
(
d2
.
getLifeStatus
())
{
case
2
:
case
2
:
inLibraryNum
++;
inLibraryNum
++;
inLibraryIds
.
add
(
d2
.
getId
());
break
;
break
;
case
3
:
case
3
:
allotNum
++;
allotNum
++;
allotIds
.
add
(
d2
.
getId
());
break
;
break
;
case
4
:
case
4
:
repairNum
++;
repairNum
++;
repairIds
.
add
(
d2
.
getId
());
break
;
break
;
case
5
:
case
5
:
scrappedNum
++;
scrappedNum
++;
scrappedIds
.
add
(
d2
.
getId
());
break
;
break
;
case
6
:
case
6
:
allotNum
++;
allotNum
++;
allotIds
.
add
(
d2
.
getId
());
break
;
break
;
case
12
:
case
12
:
retiredNum
++;
retiredNum
++;
retiredIds
.
add
(
d2
.
getId
());
break
;
break
;
case
9
:
case
9
:
destoryNum
++;
destoryNum
++;
allotIds
.
add
(
d2
.
getId
());
break
;
break
;
case
10
:
case
10
:
destoryNum
++;
destoryNum
++;
destoryIds
.
add
(
d2
.
getId
());
break
;
break
;
case
13
:
case
13
:
scrappedNum
++;
scrappedNum
++;
scrappedIds
.
add
(
d2
.
getId
());
break
;
break
;
case
14
:
case
14
:
useNum
++;
useNum
++;
useIds
.
add
(
d2
.
getId
());
break
;
break
;
default
:
default
:
break
;
break
;
...
@@ -194,6 +212,13 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
...
@@ -194,6 +212,13 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
//添加统计vo
//添加统计vo
if
(
num
>
0
)
{
if
(
num
>
0
)
{
deviceStatisticsVo
.
setDeviceIds
(
deviceIds
);
deviceStatisticsVo
.
setDeviceIds
(
deviceIds
);
deviceStatisticsVo
.
setAllotIds
(
allotIds
);
deviceStatisticsVo
.
setDestoryIds
(
destoryIds
);
deviceStatisticsVo
.
setInLibraryIds
(
inLibraryIds
);
deviceStatisticsVo
.
setRepairIds
(
repairIds
);
deviceStatisticsVo
.
setRetiredIds
(
retiredIds
);
deviceStatisticsVo
.
setScrappedIds
(
scrappedIds
);
deviceStatisticsVo
.
setUseIds
(
useIds
);
deviceStatisticsVo
.
setDeviceNumber
(
num
);
deviceStatisticsVo
.
setDeviceNumber
(
num
);
deviceStatisticsVo
.
setAllotNum
(
allotNum
);
deviceStatisticsVo
.
setAllotNum
(
allotNum
);
deviceStatisticsVo
.
setInLibraryNum
(
inLibraryNum
);
deviceStatisticsVo
.
setInLibraryNum
(
inLibraryNum
);
...
...
dev-library/src/main/java/com/tykj/dev/device/library/subject/vo/DeviceStatisticsVo.java
浏览文件 @
b9bcee2a
...
@@ -49,4 +49,26 @@ public class DeviceStatisticsVo {
...
@@ -49,4 +49,26 @@ public class DeviceStatisticsVo {
@ApiModelProperty
(
value
=
"该型号所有装备Id列表"
)
@ApiModelProperty
(
value
=
"该型号所有装备Id列表"
)
private
List
<
Integer
>
deviceIds
=
new
ArrayList
<>();
private
List
<
Integer
>
deviceIds
=
new
ArrayList
<>();
@ApiModelProperty
(
value
=
"该型号在库装备Id列表"
)
private
List
<
Integer
>
inLibraryIds
=
new
ArrayList
<>();
@ApiModelProperty
(
value
=
"该型号维修装备Id列表"
)
private
List
<
Integer
>
repairIds
=
new
ArrayList
<>();
@ApiModelProperty
(
value
=
"该型号销毁装备Id列表"
)
private
List
<
Integer
>
destoryIds
=
new
ArrayList
<>();
@ApiModelProperty
(
value
=
"该型号退役装备Id列表"
)
private
List
<
Integer
>
retiredIds
=
new
ArrayList
<>();
@ApiModelProperty
(
value
=
"该型号报废装备Id列表"
)
private
List
<
Integer
>
scrappedIds
=
new
ArrayList
<>();
@ApiModelProperty
(
value
=
"该型号运输中装备Id列表"
)
private
List
<
Integer
>
allotIds
=
new
ArrayList
<>();
@ApiModelProperty
(
value
=
"该型号使用中装备Id列表"
)
private
List
<
Integer
>
useIds
=
new
ArrayList
<>();
}
}
dev-repair/src/main/java/com/tykj/dev/device/repair/controller/RepairController.java
浏览文件 @
b9bcee2a
...
@@ -642,8 +642,26 @@ public class RepairController {
...
@@ -642,8 +642,26 @@ public class RepairController {
if
(
level
==
2
||
level
==
3
)
{
if
(
level
==
2
||
level
==
3
)
{
repairBackBill
=
deviceRepairBackBillService
.
getOne
(
taskBto
.
getBillId
());
repairBackBill
=
deviceRepairBackBillService
.
getOne
(
taskBto
.
getBillId
());
}
else
{
}
else
{
//结束父任务
//判断是否修完
taskService
.
moveToEnd
(
taskBto
);
List
<
RepairDetail
>
deviceRepairDetailEntities
=
deviceRepairDetailService
.
findByBillId
(
taskBto
.
getBillId
());
//获取所有装备的维修状态
Set
<
Integer
>
statusSet
=
deviceRepairDetailEntities
.
stream
()
.
map
(
RepairDetail:
:
getRepairStatus
)
.
collect
(
Collectors
.
toSet
());
//存放所有维修完成的状态
Set
<
Integer
>
integerSet
=
new
HashSet
<>();
integerSet
.
add
(
2
);
integerSet
.
add
(
3
);
integerSet
.
add
(
4
);
integerSet
.
add
(
5
);
integerSet
.
add
(
6
);
//取交集
integerSet
.
retainAll
(
statusSet
);
//如果取交集后size不变,则说明全部都是维修完成的状态
if
(
integerSet
.
size
()
==
statusSet
.
size
())
{
//结束父任务
taskService
.
moveToEnd
(
taskBto
);
}
RepairSendBill
repairSendBill
=
deviceRepairSendBillDao
.
findByDeviceRepairBillId
(
taskBto
.
getBillId
());
RepairSendBill
repairSendBill
=
deviceRepairSendBillDao
.
findByDeviceRepairBillId
(
taskBto
.
getBillId
());
repairBackBill
=
new
RepairBackBill
();
repairBackBill
=
new
RepairBackBill
();
repairBackBill
.
setSendUnit
(
"中办"
);
repairBackBill
.
setSendUnit
(
"中办"
);
...
...
dev-rfid/src/main/java/com/tykj/dev/rfid/controller/RfidController.java
浏览文件 @
b9bcee2a
...
@@ -103,10 +103,10 @@ public class RfidController {
...
@@ -103,10 +103,10 @@ public class RfidController {
@ApiOperation
(
value
=
"打印标签"
,
notes
=
"可以通过这个接口打印RFID"
)
@ApiOperation
(
value
=
"打印标签"
,
notes
=
"可以通过这个接口打印RFID"
)
@PostMapping
(
value
=
"/print"
)
@PostMapping
(
value
=
"/print"
)
public
ResponseEntity
printRfid
(
@RequestBody
List
<
String
>
rfid
)
{
public
ResponseEntity
printRfid
(
@RequestBody
List
<
RfidPrintVo
>
rfid
)
{
//调用打印服务 批量打印
//调用打印服务 批量打印
for
(
String
rfidContent
:
rfid
)
{
for
(
RfidPrintVo
printVo
:
rfid
)
{
rfidService
.
printString
(
rfidContent
);
rfidService
.
printString
(
printVo
.
getMakeNumber
(),
printVo
.
getMakeNumber
(),
printVo
.
getDeviceNumber
()
);
}
}
return
ResultUtil
.
success
(
"打印成功"
);
return
ResultUtil
.
success
(
"打印成功"
);
}
}
...
...
dev-rfid/src/main/java/com/tykj/dev/rfid/entity/vo/RfidPrintVo.java
0 → 100644
浏览文件 @
b9bcee2a
package
com
.
tykj
.
dev
.
rfid
.
entity
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author dengdiyi
*/
@Data
@ApiModel
(
"RFID打印VO"
)
public
class
RfidPrintVo
{
@ApiModelProperty
(
name
=
"生产号"
)
String
makeNumber
;
@ApiModelProperty
(
name
=
"装备号"
)
String
deviceNumber
;
@ApiModelProperty
(
name
=
"表面号"
)
String
content
;
}
dev-rfid/src/main/java/com/tykj/dev/rfid/service/RfidService.java
浏览文件 @
b9bcee2a
package
com
.
tykj
.
dev
.
rfid
.
service
;
package
com
.
tykj
.
dev
.
rfid
.
service
;
import
com.tykj.dev.rfid.entity.vo.RfidCreateVo
;
import
com.tykj.dev.rfid.entity.vo.RfidCreateVo
;
import
com.tykj.dev.rfid.entity.vo.RfidPrintVo
;
import
java.util.List
;
import
java.util.List
;
...
@@ -32,9 +33,11 @@ public interface RfidService {
...
@@ -32,9 +33,11 @@ public interface RfidService {
* 描述:调用打印机打印内容(如出现打印不对齐的情况请联系管理员)
* 描述:调用打印机打印内容(如出现打印不对齐的情况请联系管理员)
*
*
* @param content 打印内容
* @param content 打印内容
* @param makeNumber 生产号
* @param deviceNumber 装备号
* @return
* @return
*/
*/
boolean
printString
(
String
content
);
boolean
printString
(
String
makeNumber
,
String
deviceNumber
,
String
content
);
/**
/**
* 描述:生成装备的RFID表面号
* 描述:生成装备的RFID表面号
...
@@ -42,6 +45,6 @@ public interface RfidService {
...
@@ -42,6 +45,6 @@ public interface RfidService {
* @param list RFID表面号生成类
* @param list RFID表面号生成类
* @return
* @return
*/
*/
List
<
String
>
getRfidNumber
(
List
<
RfidCreateVo
>
list
);
List
<
RfidPrintVo
>
getRfidNumber
(
List
<
RfidCreateVo
>
list
);
}
}
dev-rfid/src/main/java/com/tykj/dev/rfid/service/impl/RfidServiceImpl.java
浏览文件 @
b9bcee2a
...
@@ -5,6 +5,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
...
@@ -5,6 +5,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
com.tykj.dev.rfid.entity.vo.RfidCreateVo
;
import
com.tykj.dev.rfid.entity.vo.RfidCreateVo
;
import
com.tykj.dev.rfid.entity.vo.RfidPrintVo
;
import
com.tykj.dev.rfid.service.RfidService
;
import
com.tykj.dev.rfid.service.RfidService
;
import
com.zebra.sdk.comm.Connection
;
import
com.zebra.sdk.comm.Connection
;
import
com.zebra.sdk.comm.ConnectionException
;
import
com.zebra.sdk.comm.ConnectionException
;
...
@@ -75,14 +76,21 @@ public class RfidServiceImpl implements RfidService {
...
@@ -75,14 +76,21 @@ public class RfidServiceImpl implements RfidService {
}
}
}
}
/**
* 描述:调用打印机打印内容(如出现打印不对齐的情况请联系管理员)
*
* @param content 打印内容
* @param makeNumber 生产号
* @param deviceNumber 装备号
* @return
*/
@Override
@Override
public
boolean
printString
(
String
content
)
{
public
boolean
printString
(
String
makeNumber
,
String
deviceNumber
,
String
content
)
{
try
{
try
{
Connection
connection
=
new
TcpConnection
(
"192.168.0.222"
,
6101
);
Connection
connection
=
new
TcpConnection
(
"192.168.0.222"
,
6101
);
connection
.
open
();
connection
.
open
();
printer
=
ZebraPrinterFactory
.
getInstance
(
connection
);
printer
=
ZebraPrinterFactory
.
getInstance
(
connection
);
String
demoFile
=
createDemoFile
(
printer
.
getPrinterControlLanguage
(),
content
,
53
,
80
);
String
demoFile
=
createDemoFile
(
printer
.
getPrinterControlLanguage
(),
makeNumber
,
deviceNumber
,
content
,
53
,
80
);
printer
.
sendFileContents
(
demoFile
);
printer
.
sendFileContents
(
demoFile
);
}
catch
(
ConnectionException
e
)
{
}
catch
(
ConnectionException
e
)
{
throw
new
ApiException
(
ResultUtil
.
failed
(
"未找到对应的打印机"
));
throw
new
ApiException
(
ResultUtil
.
failed
(
"未找到对应的打印机"
));
...
@@ -104,7 +112,7 @@ public class RfidServiceImpl implements RfidService {
...
@@ -104,7 +112,7 @@ public class RfidServiceImpl implements RfidService {
* @return 拼接成功的打印机ZPL
* @return 拼接成功的打印机ZPL
* @throws IOException IO错误
* @throws IOException IO错误
*/
*/
private
String
createDemoFile
(
PrinterLanguage
pl
,
String
content
,
int
marginLeft
,
int
marginTop
)
throws
IOException
{
private
String
createDemoFile
(
PrinterLanguage
pl
,
String
makeNumber
,
String
deviceNumber
,
String
content
,
int
marginLeft
,
int
marginTop
)
throws
IOException
{
File
tmpFile
=
File
.
createTempFile
(
"TEST_ZEBRA"
,
"LBL"
);
File
tmpFile
=
File
.
createTempFile
(
"TEST_ZEBRA"
,
"LBL"
);
FileOutputStream
os
=
new
FileOutputStream
(
tmpFile
);
FileOutputStream
os
=
new
FileOutputStream
(
tmpFile
);
...
@@ -113,7 +121,7 @@ public class RfidServiceImpl implements RfidService {
...
@@ -113,7 +121,7 @@ public class RfidServiceImpl implements RfidService {
if
(
pl
==
PrinterLanguage
.
ZPL
)
{
if
(
pl
==
PrinterLanguage
.
ZPL
)
{
configLabel
=
(
"^XA\n"
+
configLabel
=
(
"^XA\n"
+
"^CW1,E:SIMSUN.FNT
\n
"
+
"^CW1,E:SIMSUN.FNT"
+
"~TA000\n"
+
"~TA000\n"
+
"~JSN\n"
+
"~JSN\n"
+
"^LT0\n"
+
"^LT0\n"
+
...
@@ -128,7 +136,7 @@ public class RfidServiceImpl implements RfidService {
...
@@ -128,7 +136,7 @@ public class RfidServiceImpl implements RfidService {
"~SD15\n"
+
"~SD15\n"
+
"^JUS\n"
+
"^JUS\n"
+
"^LRN\n"
+
"^LRN\n"
+
"^CI2
7
\n"
+
"^CI2
8
\n"
+
"^PA0,1,1,0\n"
+
"^PA0,1,1,0\n"
+
"^XZ\n"
+
"^XZ\n"
+
"^XA\n"
+
"^XA\n"
+
...
@@ -138,10 +146,17 @@ public class RfidServiceImpl implements RfidService {
...
@@ -138,10 +146,17 @@ public class RfidServiceImpl implements RfidService {
"^LS0\n"
+
"^LS0\n"
+
"\n"
+
"\n"
+
"^LH"
+
marginLeft
+
","
+
marginTop
+
"\n"
+
"^LH"
+
marginLeft
+
","
+
marginTop
+
"\n"
+
"^A0N,60,25\n"
+
"^A1N,30,,E:SIM000.FNT^FR^FD\n"
+
"^FD"
+
"^LH"
+
marginLeft
+
",+"
+
marginTop
+
content
+
"^FDxx测试^FS\n"
+
"^FS\n"
+
"^A1N,30,,E:SIM000.FNT^FR^FD\n"
+
"^FO0,50^FD生产号:"
+
makeNumber
+
"^FS\n"
+
"^A1N,30,,E:SIM000.FNT^FR^FD\n"
+
"^FO0,90^FD装备号:"
+
deviceNumber
+
"^FS\n"
+
"^A1N,32,,E:SIM000.FNT^FR^FD\n"
+
"^FO0,130^FD表面号:^FS"
+
"^A1N,32,,E:SIM000.FNT^FR^FD\n"
+
"^FO0,170^FD"
+
content
+
"^FS"
+
"^PQ1,0,1,Y\n"
+
"^PQ1,0,1,Y\n"
+
"^XZ\n"
+
"^XZ\n"
+
"^XZ"
).
getBytes
();
"^XZ"
).
getBytes
();
...
@@ -159,20 +174,27 @@ public class RfidServiceImpl implements RfidService {
...
@@ -159,20 +174,27 @@ public class RfidServiceImpl implements RfidService {
* @return
* @return
*/
*/
@Override
@Override
public
List
<
String
>
getRfidNumber
(
List
<
RfidCreateVo
>
list
)
{
public
List
<
RfidPrintVo
>
getRfidNumber
(
List
<
RfidCreateVo
>
list
)
{
List
<
String
>
string
s
=
new
ArrayList
<>();
List
<
RfidPrintVo
>
rfidPrintVo
s
=
new
ArrayList
<>();
//遍历List为每一个创建元素生成对应的RFID表面号
//遍历List为每一个创建元素生成对应的RFID表面号
for
(
RfidCreateVo
r
:
list
)
{
for
(
RfidCreateVo
r
:
list
)
{
//如果传入的创建元素中不包含装备ID的话,则生成新的表面号
//如果传入的创建元素中不包含装备ID的话,则生成新的表面号
//否则根据将已经装备的表面号插入LIST
//否则根据将已经装备的表面号插入LIST
RfidPrintVo
rfidPrintVo
=
new
RfidPrintVo
();
if
(
r
.
getDeviceTId
()
==
null
)
{
if
(
r
.
getDeviceTId
()
==
null
)
{
strings
.
add
(
makeRfidNumber
(
r
.
getPartType
(),
r
.
getDeviceNumber
(),
r
.
getProduceNumber
(),
r
.
getDeviceType
()));
rfidPrintVo
.
setMakeNumber
(
r
.
getProduceNumber
());
rfidPrintVo
.
setDeviceNumber
(
r
.
getDeviceNumber
());
rfidPrintVo
.
setContent
(
makeRfidNumber
(
r
.
getPartType
(),
r
.
getDeviceNumber
(),
r
.
getProduceNumber
(),
r
.
getDeviceType
()));
rfidPrintVos
.
add
(
rfidPrintVo
);
}
else
{
}
else
{
DeviceLibrary
device
=
deviceLibraryService
.
getOne
(
r
.
getDeviceTId
());
DeviceLibrary
device
=
deviceLibraryService
.
getOne
(
r
.
getDeviceTId
());
strings
.
add
(
device
.
getRfidSurfaceId
());
rfidPrintVo
.
setDeviceNumber
(
device
.
getSeqNumber
());
rfidPrintVo
.
setMakeNumber
(
device
.
getProdNumber
());
rfidPrintVo
.
setContent
(
device
.
getRfidSurfaceId
());
rfidPrintVos
.
add
(
rfidPrintVo
);
}
}
}
}
return
string
s
;
return
rfidPrintVo
s
;
}
}
/**
/**
...
...
dev-statistical/src/main/java/com/tykj/dev/statistical/service/impl/StatisticalServiceImpl.java
浏览文件 @
b9bcee2a
...
@@ -178,24 +178,30 @@ public class StatisticalServiceImpl implements StatisticalService {
...
@@ -178,24 +178,30 @@ public class StatisticalServiceImpl implements StatisticalService {
List
<
SelfInspection
>
nums
=
new
ArrayList
<>();
List
<
SelfInspection
>
nums
=
new
ArrayList
<>();
//获取所有自查单
//获取所有自查单
List
<
SelfCheckBill
>
selfCheckBills
=
selfCheckBillDao
.
findAll
();
List
<
SelfCheckBill
>
selfCheckBills
=
selfCheckBillDao
.
findAll
();
//计算当前季度
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
new
Date
());
String
quarter
=
calendar
.
get
(
Calendar
.
YEAR
)+
"年"
+
SelfCheckSchedulerTask
.
getQuarter
(
calendar
.
get
(
Calendar
.
MONTH
)+
1
);
//筛选出标题包含当前年份季度的
List
<
SelfCheckBill
>
selfCheckBillList
=
selfCheckBills
.
stream
()
.
filter
(
selfCheckBill
->
selfCheckBill
.
getTitle
().
contains
(
quarter
))
.
collect
(
Collectors
.
toList
());
//获取所有市
//获取所有市
List
<
Area
>
areas
=
areaDao
.
findAreasByType
(
2
);
List
<
Area
>
areas
=
areaDao
.
findAreasByType
(
2
);
//遍历每个市
//遍历每个市
for
(
Area
area
:
areas
)
{
for
(
Area
area
:
areas
)
{
//获取当前区域所有区县
//获取当前区域所有区县
List
<
Area
>
sonAreas
=
areaDao
.
findAllByFatherId
(
area
.
getId
());
List
<
Area
>
sonAreas
=
areaDao
.
findAllByFatherId
(
area
.
getId
());
SelfInspection
selfInspection
=
new
SelfInspection
();
SelfInspection
selfInspection
=
new
SelfInspection
();
selfInspection
.
setAreaName
(
area
.
getName
());
selfInspection
.
setAreaName
(
area
.
getName
());
//计算当前季度
if
(
selfCheckBillList
.
size
()>
0
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
//获取未完成区县
calendar
.
setTime
(
new
Date
());
List
<
Area
>
areas1
=
getSelfCheckUndoAreas
(
area
.
getId
(),
quarter
,
selfCheckBills
);
String
quarter
=
calendar
.
get
(
Calendar
.
YEAR
)+
"年"
+
SelfCheckSchedulerTask
.
getQuarter
(
calendar
.
get
(
Calendar
.
MONTH
)+
1
);
//set未完成数量
//获取未完成区县
selfInspection
.
setNoCompleteCount
(
areas1
.
size
());
List
<
Area
>
areas1
=
getSelfCheckUndoAreas
(
area
.
getId
(),
quarter
,
selfCheckBills
);
//set已完成数量
//set未完成数量
selfInspection
.
setCompleteCount
(
sonAreas
.
size
()
-
areas1
.
size
());
selfInspection
.
setNoCompleteCount
(
areas1
.
size
());
}
//set已完成数量
selfInspection
.
setCompleteCount
(
sonAreas
.
size
()-
areas1
.
size
());
nums
.
add
(
selfInspection
);
nums
.
add
(
selfInspection
);
}
}
return
nums
;
return
nums
;
...
@@ -218,6 +224,19 @@ public class StatisticalServiceImpl implements StatisticalService {
...
@@ -218,6 +224,19 @@ public class StatisticalServiceImpl implements StatisticalService {
String
quarter2
=
calendar
.
get
(
Calendar
.
YEAR
)+
"年第二季度"
;
String
quarter2
=
calendar
.
get
(
Calendar
.
YEAR
)+
"年第二季度"
;
String
quarter3
=
calendar
.
get
(
Calendar
.
YEAR
)+
"年第三季度"
;
String
quarter3
=
calendar
.
get
(
Calendar
.
YEAR
)+
"年第三季度"
;
String
quarter4
=
calendar
.
get
(
Calendar
.
YEAR
)+
"年第四季度"
;
String
quarter4
=
calendar
.
get
(
Calendar
.
YEAR
)+
"年第四季度"
;
//筛选出标题包含当前年份季度的
List
<
SelfCheckBill
>
selfCheckBillList1
=
selfCheckBills
.
stream
()
.
filter
(
selfCheckBill
->
selfCheckBill
.
getTitle
().
contains
(
quarter1
))
.
collect
(
Collectors
.
toList
());
List
<
SelfCheckBill
>
selfCheckBillList2
=
selfCheckBills
.
stream
()
.
filter
(
selfCheckBill
->
selfCheckBill
.
getTitle
().
contains
(
quarter2
))
.
collect
(
Collectors
.
toList
());
List
<
SelfCheckBill
>
selfCheckBillList3
=
selfCheckBills
.
stream
()
.
filter
(
selfCheckBill
->
selfCheckBill
.
getTitle
().
contains
(
quarter3
))
.
collect
(
Collectors
.
toList
());
List
<
SelfCheckBill
>
selfCheckBillList4
=
selfCheckBills
.
stream
()
.
filter
(
selfCheckBill
->
selfCheckBill
.
getTitle
().
contains
(
quarter4
))
.
collect
(
Collectors
.
toList
());
//遍历所有市
//遍历所有市
areas
.
forEach
(
area
->
{
areas
.
forEach
(
area
->
{
YearSelfInspection
yearSelfInspection
=
new
YearSelfInspection
();
YearSelfInspection
yearSelfInspection
=
new
YearSelfInspection
();
...
@@ -226,16 +245,24 @@ public class StatisticalServiceImpl implements StatisticalService {
...
@@ -226,16 +245,24 @@ public class StatisticalServiceImpl implements StatisticalService {
PerQuarter
thirdQuarter
=
new
PerQuarter
();
PerQuarter
thirdQuarter
=
new
PerQuarter
();
PerQuarter
fourthQuarter
=
new
PerQuarter
();
PerQuarter
fourthQuarter
=
new
PerQuarter
();
yearSelfInspection
.
setAreaName
(
area
.
getName
());
yearSelfInspection
.
setAreaName
(
area
.
getName
());
List
<
Area
>
undoAreas
=
getSelfCheckUndoAreas
(
area
.
getId
(),
quarter1
,
selfCheckBills
);
List
<
Area
>
undoAreas2
=
getSelfCheckUndoAreas
(
area
.
getId
(),
quarter2
,
selfCheckBills
);
List
<
Area
>
undoAreas3
=
getSelfCheckUndoAreas
(
area
.
getId
(),
quarter3
,
selfCheckBills
);
List
<
Area
>
undoAreas4
=
getSelfCheckUndoAreas
(
area
.
getId
(),
quarter4
,
selfCheckBills
);
//获取当前区域所有区县
//获取当前区域所有区县
List
<
Area
>
sonAreas
=
areaDao
.
findAllByFatherId
(
area
.
getId
());
List
<
Area
>
sonAreas
=
areaDao
.
findAllByFatherId
(
area
.
getId
());
setPerQuarter
(
firstQuarter
,
sonAreas
,
undoAreas
);
if
(
selfCheckBillList1
.
size
()>
0
){
setPerQuarter
(
secondQuarter
,
sonAreas
,
undoAreas2
);
List
<
Area
>
undoAreas
=
getSelfCheckUndoAreas
(
area
.
getId
(),
quarter1
,
selfCheckBills
);
setPerQuarter
(
thirdQuarter
,
sonAreas
,
undoAreas3
);
setPerQuarter
(
firstQuarter
,
sonAreas
,
undoAreas
);
setPerQuarter
(
fourthQuarter
,
sonAreas
,
undoAreas4
);
}
if
(
selfCheckBillList2
.
size
()>
0
){
List
<
Area
>
undoAreas
=
getSelfCheckUndoAreas
(
area
.
getId
(),
quarter2
,
selfCheckBills
);
setPerQuarter
(
secondQuarter
,
sonAreas
,
undoAreas
);
}
if
(
selfCheckBillList3
.
size
()>
0
){
List
<
Area
>
undoAreas
=
getSelfCheckUndoAreas
(
area
.
getId
(),
quarter3
,
selfCheckBills
);
setPerQuarter
(
thirdQuarter
,
sonAreas
,
undoAreas
);
}
if
(
selfCheckBillList4
.
size
()>
0
){
List
<
Area
>
undoAreas
=
getSelfCheckUndoAreas
(
area
.
getId
(),
quarter4
,
selfCheckBills
);
setPerQuarter
(
fourthQuarter
,
sonAreas
,
undoAreas
);
}
yearSelfInspection
.
setFirstQuarter
(
firstQuarter
);
yearSelfInspection
.
setFirstQuarter
(
firstQuarter
);
yearSelfInspection
.
setSecondQuarter
(
secondQuarter
);
yearSelfInspection
.
setSecondQuarter
(
secondQuarter
);
yearSelfInspection
.
setThirdQuarter
(
thirdQuarter
);
yearSelfInspection
.
setThirdQuarter
(
thirdQuarter
);
...
...
dev-statistical/src/main/java/com/tykj/dev/statistical/vo/PerQuarter.java
浏览文件 @
b9bcee2a
...
@@ -14,12 +14,12 @@ public class PerQuarter {
...
@@ -14,12 +14,12 @@ public class PerQuarter {
/**
/**
* 完成数量
* 完成数量
*/
*/
private
Integer
completeCount
;
private
Integer
completeCount
=
0
;
/**
/**
* 未完成数量
* 未完成数量
*/
*/
private
Integer
noCompleteCount
;
private
Integer
noCompleteCount
=
0
;
/**
/**
* 未完成单位
* 未完成单位
...
...
dev-statistical/src/main/java/com/tykj/dev/statistical/vo/SelfInspection.java
浏览文件 @
b9bcee2a
...
@@ -19,10 +19,10 @@ public class SelfInspection {
...
@@ -19,10 +19,10 @@ public class SelfInspection {
/**
/**
* 完成数量
* 完成数量
*/
*/
private
Integer
completeCount
;
private
Integer
completeCount
=
0
;
/**
/**
* 未完成数量
* 未完成数量
*/
*/
private
Integer
noCompleteCount
;
private
Integer
noCompleteCount
=
0
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论