Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
a612be28
Commit
a612be28
authored
Jul 06, 2023
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加监管码导出
parent
7065f92c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
134 additions
and
15 deletions
+134
-15
ImageSizeEnums.java
...eejoin/amos/boot/module/tzs/api/enums/ImageSizeEnums.java
+45
-0
IdxFeignService.java
...n/amos/boot/module/tzs/flc/api/feign/IdxFeignService.java
+1
-0
EquipmentCategoryMapper.xml
...api/src/main/resources/mapper/EquipmentCategoryMapper.xml
+1
-0
EquipmentCategoryController.java
...odule/tzs/biz/controller/EquipmentCategoryController.java
+75
-4
ImageUtils.java
...om/yeejoin/amos/boot/module/tzs/biz/utils/ImageUtils.java
+0
-0
RegUnitInfoServiceImpl.java
...dule/tzs/flc/biz/service/impl/RegUnitInfoServiceImpl.java
+12
-11
bigBg.png
...mos-boot-module-tzs-biz/src/main/resources/temp/bigBg.png
+0
-0
centreBg.png
...-boot-module-tzs-biz/src/main/resources/temp/centreBg.png
+0
-0
dt.png
...s/amos-boot-module-tzs-biz/src/main/resources/temp/dt.png
+0
-0
smallBg.png
...s-boot-module-tzs-biz/src/main/resources/temp/smallBg.png
+0
-0
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/enums/ImageSizeEnums.java
0 → 100644
View file @
a612be28
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
@AllArgsConstructor
@Getter
public
enum
ImageSizeEnums
{
/**
* 导出监管码、96333码尺寸
*/
// 监管码-大
JG_BIG
(
"JG_BIG"
,
"bigBg.png"
,
350
,
350
,
60
,
720
,
190
,
0
,
0
,
780
,
680
),
// 监管码-中
JG_MID
(
"JG_MID"
,
"centreBg.png"
,
230
,
230
,
40
,
480
,
170
,
0
,
0
,
520
,
525
),
// 监管码-小
JG_MIN
(
"JG_MIN"
,
"smallBg.png"
,
170
,
170
,
30
,
360
,
110
,
0
,
0
,
380
,
355
),
// 96333电梯码
DT
(
"DT"
,
"dt.png"
,
170
,
170
,
30
,
30
,
110
,
0
,
0
,
330
,
355
);
String
code
;
String
bgPath
;
Integer
with
;
Integer
height
;
Integer
size
;
Integer
imagesX
;
Integer
imagesY
;
Integer
text1X
;
Integer
text1Y
;
Integer
text2X
;
Integer
text2Y
;
public
static
ImageSizeEnums
getEnumByCode
(
String
code
)
{
for
(
ImageSizeEnums
value
:
ImageSizeEnums
.
values
())
{
if
(
value
.
getCode
().
equals
(
code
))
{
return
value
;
}
}
return
null
;
}
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/feign/IdxFeignService.java
View file @
a612be28
...
@@ -84,6 +84,7 @@ public interface IdxFeignService {
...
@@ -84,6 +84,7 @@ public interface IdxFeignService {
FeignClientResult
<
String
>
submit
(
@RequestParam
(
value
=
"pageId"
)
long
pageId
,
FeignClientResult
<
String
>
submit
(
@RequestParam
(
value
=
"pageId"
)
long
pageId
,
@RequestParam
(
value
=
"taskId"
,
required
=
false
)
String
taskId
,
@RequestParam
(
value
=
"taskId"
,
required
=
false
)
String
taskId
,
@RequestParam
(
value
=
"planInstanceId"
,
required
=
false
)
String
planInstanceId
,
@RequestParam
(
value
=
"planInstanceId"
,
required
=
false
)
String
planInstanceId
,
@RequestParam
(
value
=
"bizField"
,
required
=
false
)
String
bizField
,
@RequestParam
(
value
=
"topic"
,
required
=
false
)
String
topic
,
@RequestParam
(
value
=
"topic"
,
required
=
false
)
String
topic
,
@RequestParam
(
value
=
"tableName"
,
required
=
false
)
String
tableName
,
@RequestParam
(
value
=
"tableName"
,
required
=
false
)
String
tableName
,
@RequestBody
Map
<
String
,
Object
>
kv
)
throws
Exception
;
@RequestBody
Map
<
String
,
Object
>
kv
)
throws
Exception
;
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/resources/mapper/EquipmentCategoryMapper.xml
View file @
a612be28
...
@@ -345,6 +345,7 @@
...
@@ -345,6 +345,7 @@
<if
test=
"dto.ORG_BRANCH_NAME != '' and dto.ORG_BRANCH_NAME != null"
>
and ORG_BRANCH_NAME = #{dto.ORG_BRANCH_NAME}
</if>
<if
test=
"dto.ORG_BRANCH_NAME != '' and dto.ORG_BRANCH_NAME != null"
>
and ORG_BRANCH_NAME = #{dto.ORG_BRANCH_NAME}
</if>
<if
test=
"dto.USE_PLACE != '' and dto.USE_PLACE != null"
>
and USE_PLACE = #{dto.USE_PLACE}
</if>
<if
test=
"dto.USE_PLACE != '' and dto.USE_PLACE != null"
>
and USE_PLACE = #{dto.USE_PLACE}
</if>
<if
test=
"dto.STATUS != '' and dto.STATUS != null"
>
and STATUS = #{dto.STATUS}
</if>
<if
test=
"dto.STATUS != '' and dto.STATUS != null"
>
and STATUS = #{dto.STATUS}
</if>
<if
test=
"dto.EQU_CATEGORY != '' and dto.EQU_CATEGORY != null"
>
and EQU_CATEGORY = #{dto.EQU_CATEGORY}
</if>
<if
test=
"dto.USE_UNIT_CREDIT_CODE != '' and dto.USE_UNIT_CREDIT_CODE != null"
>
and USE_UNIT_CREDIT_CODE like concat('%', #{dto.USE_UNIT_CREDIT_CODE},'%')
</if>
<if
test=
"dto.USE_UNIT_CREDIT_CODE != '' and dto.USE_UNIT_CREDIT_CODE != null"
>
and USE_UNIT_CREDIT_CODE like concat('%', #{dto.USE_UNIT_CREDIT_CODE},'%')
</if>
<if
test=
"dto.ORG_BRANCH_CODE != '' and dto.ORG_BRANCH_CODE != null"
>
and ORG_BRANCH_CODE like concat('%', #{dto.ORG_BRANCH_CODE},'%')
</if>
<if
test=
"dto.ORG_BRANCH_CODE != '' and dto.ORG_BRANCH_CODE != null"
>
and ORG_BRANCH_CODE like concat('%', #{dto.ORG_BRANCH_CODE},'%')
</if>
<if
test=
'dto.ids != null'
>
and SEQUENCE_NBR in
<if
test=
'dto.ids != null'
>
and SEQUENCE_NBR in
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/EquipmentCategoryController.java
View file @
a612be28
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
@@ -13,13 +14,16 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.EquipExportDto;
...
@@ -13,13 +14,16 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.EquipExportDto;
import
com.yeejoin.amos.boot.module.tzs.api.dto.EquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.EquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.CategoryOtherInfo
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.CategoryOtherInfo
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.EquipmentCategory
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.EquipmentCategory
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.ImageSizeEnums
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.EquipmentCategoryMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.EquipmentCategoryMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IEquipmentCategoryService
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IEquipmentCategoryService
;
import
com.yeejoin.amos.boot.module.tzs.api.vo.EquipExportVo
;
import
com.yeejoin.amos.boot.module.tzs.api.vo.EquipExportVo
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.EquipmentCategoryServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.EquipmentCategoryServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.ImageUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -30,10 +34,12 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
...
@@ -30,10 +34,12 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.io.*
;
import
java.util.Collection
;
import
java.net.URL
;
import
java.util.List
;
import
java.util.*
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipOutputStream
;
/**
/**
* 装备分类
* 装备分类
...
@@ -55,6 +61,13 @@ public class EquipmentCategoryController extends BaseController {
...
@@ -55,6 +61,13 @@ public class EquipmentCategoryController extends BaseController {
EquipmentCategoryMapper
equipmentCategoryMapper
;
EquipmentCategoryMapper
equipmentCategoryMapper
;
@Value
(
"${regulatory_code_prefix}"
)
String
REGULATORY_CODE_PREFIX
;
/**
* 监管码背景图路径
*/
private
static
final
String
BASE_PATH
=
"amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/resources/temp/"
;
/**
/**
* 新增装备分类
* 新增装备分类
...
@@ -374,6 +387,64 @@ public class EquipmentCategoryController extends BaseController {
...
@@ -374,6 +387,64 @@ public class EquipmentCategoryController extends BaseController {
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/exportImage"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备监管码下载"
,
notes
=
"设备监管码下载"
)
public
void
exportImage
(
HttpServletResponse
response
,
@RequestParam
(
"code"
)
String
code
,
@RequestParam
(
"type"
)
String
type
)
throws
IOException
{
FileInputStream
bgImgFile
=
null
;
ImageSizeEnums
imageSizeEnums
=
ImageSizeEnums
.
getEnumByCode
(
type
);
try
{
bgImgFile
=
new
FileInputStream
(
BASE_PATH
+
imageSizeEnums
.
getBgPath
());
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
();
}
File
QrCodeFile
=
new
File
(
BASE_PATH
+
code
+
".png"
);
ImageUtils
.
creatQRCode
(
QrCodeFile
,
bgImgFile
,
imageSizeEnums
.
getWith
(),
imageSizeEnums
.
getHeight
(),
REGULATORY_CODE_PREFIX
+
code
,
""
,
code
,
imageSizeEnums
.
getSize
(),
imageSizeEnums
.
getImagesX
(),
imageSizeEnums
.
getImagesY
(),
imageSizeEnums
.
getText1X
(),
imageSizeEnums
.
getText1Y
(),
imageSizeEnums
.
getText2X
(),
imageSizeEnums
.
getText2Y
());
ImageUtils
.
downloadResource
(
code
+
".png"
,
BASE_PATH
+
code
+
".png"
,
response
);
QrCodeFile
.
delete
();
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/exportImageZip"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备信息导出"
,
notes
=
"设备信息导出"
)
public
void
exportImageZip
(
HttpServletResponse
response
,
EquipExportDto
dto
,
@RequestParam
(
"type"
)
String
type
)
throws
IOException
{
File
delete
=
new
File
(
BASE_PATH
+
"images"
);
if
(!
delete
.
exists
())
{
delete
.
mkdir
();
}
ImageSizeEnums
imageSizeEnums
=
ImageSizeEnums
.
getEnumByCode
(
type
);
//创建list 存放图片
List
<
File
>
fileList
=
new
ArrayList
<>();
List
<
EquipExportVo
>
equipExportData
=
equipmentCategoryServiceImpl
.
getEquipExportData
(
dto
);
List
<
EquipExportVo
>
unique
=
equipExportData
.
stream
().
collect
(
Collectors
.
collectingAndThen
(
Collectors
.
toCollection
(()
->
new
TreeSet
<>(
Comparator
.
comparing
(
o
->
o
.
getSupervisoryCode
()
+
";"
+
o
.
getCode96333
()))),
ArrayList:
:
new
)
);
for
(
EquipExportVo
equipExportDatum
:
unique
)
{
FileInputStream
bgImgFile
=
new
FileInputStream
(
BASE_PATH
+
imageSizeEnums
.
getBgPath
());
if
(
"DT"
.
equals
(
type
)
&&
!
ObjectUtils
.
isEmpty
(
equipExportDatum
.
getCode96333
()))
{
File
QrCodeFile
=
new
File
(
BASE_PATH
+
"images/"
+
equipExportDatum
.
getCode96333
()
+
".png"
);
ImageUtils
.
creatQRCode
(
QrCodeFile
,
bgImgFile
,
imageSizeEnums
.
getWith
(),
imageSizeEnums
.
getHeight
(),
REGULATORY_CODE_PREFIX
+
equipExportDatum
.
getCode96333
(),
""
,
equipExportDatum
.
getCode96333
(),
imageSizeEnums
.
getSize
(),
imageSizeEnums
.
getImagesX
(),
imageSizeEnums
.
getImagesY
(),
imageSizeEnums
.
getText1X
(),
imageSizeEnums
.
getText1Y
(),
imageSizeEnums
.
getText2X
(),
imageSizeEnums
.
getText2Y
());
fileList
.
add
(
new
File
(
BASE_PATH
+
"images/"
+
equipExportDatum
.
getCode96333
()
+
".png"
));
}
else
if
(!
ObjectUtils
.
isEmpty
(
equipExportDatum
.
getSupervisoryCode
()))
{
File
QrCodeFile
=
new
File
(
BASE_PATH
+
"images/"
+
equipExportDatum
.
getSupervisoryCode
()
+
".png"
);
ImageUtils
.
creatQRCode
(
QrCodeFile
,
bgImgFile
,
imageSizeEnums
.
getWith
(),
imageSizeEnums
.
getHeight
(),
REGULATORY_CODE_PREFIX
+
equipExportDatum
.
getSupervisoryCode
(),
""
,
equipExportDatum
.
getSupervisoryCode
(),
imageSizeEnums
.
getSize
(),
imageSizeEnums
.
getImagesX
(),
imageSizeEnums
.
getImagesY
(),
imageSizeEnums
.
getText1X
(),
imageSizeEnums
.
getText1Y
(),
imageSizeEnums
.
getText2X
(),
imageSizeEnums
.
getText2Y
());
fileList
.
add
(
new
File
(
BASE_PATH
+
"images/"
+
equipExportDatum
.
getSupervisoryCode
()
+
".png"
));
}
bgImgFile
.
close
();
}
File
zipFile
=
new
File
(
BASE_PATH
+
"images/imageZip.zip"
);
zipFile
.
createTempFile
(
"imageZip"
,
".zip"
);
// 调用压缩方法
ImageUtils
.
zipFiles
(
fileList
,
zipFile
);
ImageUtils
.
downloadResourceZip
(
"imageZip.zip"
,
BASE_PATH
+
"images/imageZip.zip"
,
response
);
zipFile
.
delete
();
ImageUtils
.
deleteAllFilesOfDir
(
delete
);
if
(
delete
.
exists
())
{
ImageUtils
.
deleteAllFilesOfDir
(
delete
);
}
}
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/utils/ImageUtils.java
0 → 100644
View file @
a612be28
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/service/impl/RegUnitInfoServiceImpl.java
View file @
a612be28
...
@@ -780,18 +780,19 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
...
@@ -780,18 +780,19 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
String
userIdsTask
=
String
.
join
(
","
,
task
);
String
userIdsTask
=
String
.
join
(
","
,
task
);
// 添加被检查企业下的人员id
// 添加被检查企业下的人员id
objectMap
.
put
(
"CHECKED_COMPANY_USERS"
,
userIds
);
objectMap
.
put
(
"CHECKED_COMPANY_USERS"
,
userIds
);
objectMap
.
put
(
"CHECKED_COMPANY_USER_ids"
,
userIdsTask
);
// 表单信息提交
// 表单信息提交
FeignClientResult
<
String
>
submit
=
idxFeignService
.
submit
(
pageId
,
taskId
,
planInstanceId
,
topic
,
tableName
,
objectMap
);
FeignClientResult
<
String
>
submit
=
idxFeignService
.
submit
(
pageId
,
taskId
,
planInstanceId
,
"CHECKED_COMPANY_USER_ids"
,
topic
,
tableName
,
objectMap
);
if
(
"200"
.
equals
(
String
.
valueOf
(
submit
.
getStatus
())))
{
//
if ("200".equals(String.valueOf(submit.getStatus()))) {
JSONObject
jsonObject
=
new
JSONObject
();
//
JSONObject jsonObject = new JSONObject();
jsonObject
.
put
(
"title"
,
"企业整改"
);
//
jsonObject.put("title", "企业整改");
jsonObject
.
put
(
"userIds"
,
userIdsTask
);
//
jsonObject.put("userIds", userIdsTask);
logger
.
info
(
"idx执行任务更新参数,{}"
,
JSONObject
.
toJSONString
(
jsonObject
));
//
logger.info("idx执行任务更新参数,{}", JSONObject.toJSONString(jsonObject));
//FeignClientResult<JSONObject> jsonObjectFeignClientResult = idxFeignService.updateAmosTask(taskId, jsonObject);
//
//FeignClientResult<JSONObject> jsonObjectFeignClientResult = idxFeignService.updateAmosTask(taskId, jsonObject);
updateAmosTask
(
taskId
,
jsonObject
);
//
updateAmosTask(taskId, jsonObject);
//logger.info("idx执行任务更新任务返回参数,{}", JSONObject.toJSONString(jsonObjectFeignClientResult));
//
//logger.info("idx执行任务更新任务返回参数,{}", JSONObject.toJSONString(jsonObjectFeignClientResult));
//
}
//
}
return
"ok"
;
return
"ok"
;
}
}
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/resources/temp/bigBg.png
0 → 100644
View file @
a612be28
76.4 KB
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/resources/temp/centreBg.png
0 → 100644
View file @
a612be28
43 KB
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/resources/temp/dt.png
0 → 100644
View file @
a612be28
23.4 KB
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/resources/temp/smallBg.png
0 → 100644
View file @
a612be28
29.4 KB
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