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
87dd1100
Commit
87dd1100
authored
Sep 29, 2022
by
zhangyingbin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://39.98.45.134:8090/moa/amos-boot-biz
into developer
parents
3967bd51
cd4db484
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
161 additions
and
14 deletions
+161
-14
ICompanyService.java
...oin/amos/boot/module/ugp/api/service/ICompanyService.java
+5
-0
IWeldService.java
...eejoin/amos/boot/module/ugp/api/service/IWeldService.java
+5
-1
CompanyController.java
...mos/boot/module/ugp/biz/controller/CompanyController.java
+38
-1
WeldController.java
...n/amos/boot/module/ugp/biz/controller/WeldController.java
+37
-7
CompanyServiceImpl.java
.../boot/module/ugp/biz/service/impl/CompanyServiceImpl.java
+39
-2
WeldServiceImpl.java
...mos/boot/module/ugp/biz/service/impl/WeldServiceImpl.java
+37
-3
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/ICompanyService.java
View file @
87dd1100
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
service
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Company
;
/**
* 企业信息表接口类
*
...
...
@@ -9,4 +12,6 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
*/
public
interface
ICompanyService
{
void
modifyCompanyInfo
(
Company
company
)
throws
Exception
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/IWeldService.java
View file @
87dd1100
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
service
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto
;
import
java.util.List
;
/**
* 焊口信息表接口类
*
...
...
@@ -8,5 +12,5 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
* @date 2022-09-22
*/
public
interface
IWeldService
{
void
getCode
(
Long
projectCode
,
int
number
)
throws
Exception
;
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/CompanyController.java
View file @
87dd1100
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Company
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.CompanyServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
...
...
@@ -16,6 +27,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
springfox.documentation.spring.web.json.Json
;
/**
* 企业信息表
...
...
@@ -107,10 +119,35 @@ public class CompanyController extends BaseController {
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"企业信息表列表全部数据查询"
,
notes
=
"企业信息表列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
CompanyDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
companyServiceImpl
.
queryForCompanyList
());
}
/**
* 修改企业信息
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"Post"
,
value
=
"修改企业信息"
,
notes
=
"修改企业信息"
)
@PostMapping
(
value
=
"/modifyCompanyInfo"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
modifyCompanyInfo
(
Company
companyList
)
throws
Exception
{
Map
<
String
,
Object
>
message
=
new
HashMap
<>();
try
{
companyServiceImpl
.
modifyCompanyInfo
(
companyList
);
message
.
put
(
"res"
,
true
);
}
catch
(
Exception
e
){
message
.
put
(
"res"
,
false
);
message
.
put
(
"Exception"
,
e
.
getMessage
());
}
return
ResponseHelper
.
buildResponse
(
message
);
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/WeldController.java
View file @
87dd1100
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.WeldServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto
;
...
...
@@ -53,7 +58,7 @@ public class WeldController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新焊口信息表"
,
notes
=
"根据sequenceNbr更新焊口信息表"
)
public
ResponseModel
<
WeldDto
>
updateBySequenceNbrWeld
(
@RequestBody
WeldDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
public
ResponseModel
<
WeldDto
>
updateBySequenceNbrWeld
(
@RequestBody
WeldDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
weldServiceImpl
.
updateWithModel
(
model
));
}
...
...
@@ -67,7 +72,7 @@ public class WeldController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除焊口信息表"
,
notes
=
"根据sequenceNbr删除焊口信息表"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
weldServiceImpl
.
removeById
(
sequenceNbr
));
}
...
...
@@ -79,7 +84,7 @@ public class WeldController extends BaseController {
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个焊口信息表"
,
notes
=
"根据sequenceNbr查询单个焊口信息表"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个焊口信息表"
,
notes
=
"根据sequenceNbr查询单个焊口信息表"
)
public
ResponseModel
<
WeldDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
weldServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
...
...
@@ -93,8 +98,8 @@ public class WeldController extends BaseController {
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"焊口信息表分页查询"
,
notes
=
"焊口信息表分页查询"
)
public
ResponseModel
<
Page
<
WeldDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"焊口信息表分页查询"
,
notes
=
"焊口信息表分页查询"
)
public
ResponseModel
<
Page
<
WeldDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
WeldDto
>
page
=
new
Page
<
WeldDto
>();
page
.
setCurrent
(
current
);
...
...
@@ -107,10 +112,35 @@ public class WeldController extends BaseController {
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"焊口信息表列表全部数据查询"
,
notes
=
"焊口信息表列表全部数据查询"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"焊口信息表列表全部数据查询"
,
notes
=
"焊口信息表列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
WeldDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
weldServiceImpl
.
queryForWeldList
());
}
/**
* 生成焊口编码
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"生成焊口编码"
,
notes
=
"生成焊口编码"
)
@PostMapping
(
value
=
"/getCode"
)
public
ResponseModel
<
JSONObject
>
getCode
(
Long
projectCode
,
int
number
)
throws
Exception
{
//预返回数据
JSONObject
message
=
new
JSONObject
();
try
{
weldServiceImpl
.
getCode
(
projectCode
,
number
);
message
.
put
(
"res"
,
true
);
}
catch
(
Exception
e
)
{
message
.
put
(
"res"
,
false
);
message
.
put
(
"Exception"
,
e
.
getMessage
());
}
return
ResponseHelper
.
buildResponse
(
message
);
// return ResponseHelper.buildResponse(weldServiceImpl.getCode(projectCode));
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/CompanyServiceImpl.java
View file @
87dd1100
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.AbstractWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Company
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.CompanyMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.ICompanyService
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto
;
import
org.apache.lucene.queryparser.flexible.messages.Message
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Locale
;
/**
* 企业信息表服务实现类
...
...
@@ -16,7 +26,9 @@ import java.util.List;
* @date 2022-09-22
*/
@Service
public
class
CompanyServiceImpl
extends
BaseService
<
CompanyDto
,
Company
,
CompanyMapper
>
implements
ICompanyService
{
public
class
CompanyServiceImpl
extends
BaseService
<
CompanyDto
,
Company
,
CompanyMapper
>
implements
ICompanyService
{
@Autowired
CompanyMapper
companyMapper
;
/**
* 分页查询
*/
...
...
@@ -28,6 +40,30 @@ public class CompanyServiceImpl extends BaseService<CompanyDto,Company,CompanyMa
* 列表查询 示例
*/
public
List
<
CompanyDto
>
queryForCompanyList
()
{
return
this
.
queryForList
(
""
,
false
);
return
this
.
queryForList
(
""
,
false
);
}
@Override
public
void
modifyCompanyInfo
(
Company
companyList
)
throws
Exception
{
try
{
LambdaUpdateWrapper
<
Company
>
wrapper
=
new
LambdaUpdateWrapper
<>();
wrapper
.
eq
(
Company:
:
getSequenceNbr
,
companyList
.
getSequenceNbr
());
//获取数据库所有数据
List
<
Company
>
list
=
companyMapper
.
selectList
(
null
);
for
(
Company
i:
list
){
if
(
i
.
getName
()!=
companyList
.
getName
())
{
companyMapper
.
update
(
companyList
,
wrapper
);
}
else
{
throw
new
Exception
(
"企业名称不能相同"
);
}
}
}
catch
(
Exception
e
)
{
throw
new
Exception
(
e
);
}
}
}
\ No newline at end of file
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/WeldServiceImpl.java
View file @
87dd1100
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Weld
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.WeldMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IWeldService
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto
;
import
org.apache.poi.hpsf.Array
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.List
;
import
java.util.*
;
/**
* 焊口信息表服务实现类
...
...
@@ -16,7 +24,12 @@ import java.util.List;
* @date 2022-09-22
*/
@Service
public
class
WeldServiceImpl
extends
BaseService
<
WeldDto
,
Weld
,
WeldMapper
>
implements
IWeldService
{
public
class
WeldServiceImpl
extends
BaseService
<
WeldDto
,
Weld
,
WeldMapper
>
implements
IWeldService
{
@Autowired
WeldMapper
weldMapper
;
/**
* 分页查询
*/
...
...
@@ -28,6 +41,26 @@ public class WeldServiceImpl extends BaseService<WeldDto,Weld,WeldMapper> implem
* 列表查询 示例
*/
public
List
<
WeldDto
>
queryForWeldList
()
{
return
this
.
queryForList
(
""
,
false
);
return
this
.
queryForList
(
""
,
false
);
}
/**
* 生成焊口编号保存并查询
*/
public
void
getCode
(
Long
projectCode
,
int
number
)
throws
Exception
{
/**
* 获取前端传递的数据
*/
for
(
int
i
=
0
;
i
<=
number
-
1
;
i
++)
{
Weld
weld
=
new
Weld
();
String
code
=
"XM"
+
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
10000000
)
+
"-HK"
+
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
1000
);
weld
.
setRecDate
(
new
Date
());
weld
.
setIsDelete
(
true
);
weld
.
setProjectId
(
projectCode
);
weld
.
setCode
(
code
);
save
(
weld
);
}
}
}
\ 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