Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
data-acquisition
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
竹天卫
data-acquisition
Commits
82d46423
Commit
82d46423
authored
Apr 25, 2021
by
renchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
送验单模块代码编写
parent
67dcf564
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
147 additions
and
12 deletions
+147
-12
TSampleListController.java
...cquisition/business/controller/TSampleListController.java
+18
-8
TSampleList.java
...a/cn/wise/sc/acquisition/business/entity/TSampleList.java
+10
-0
TSampleListQuery.java
...sc/acquisition/business/model/query/TSampleListQuery.java
+11
-0
ITSampleListService.java
.../sc/acquisition/business/service/ITSampleListService.java
+9
-2
TSampleListServiceImpl.java
...isition/business/service/impl/TSampleListServiceImpl.java
+84
-1
TEquipmentAccountMapper.xml
...c/acquisition/business/mapper/TEquipmentAccountMapper.xml
+5
-0
spring.factories
im-common/target/classes/META-INF/spring.factories
+4
-0
application.yml
im-common/target/classes/application.yml
+5
-0
GeneratorApplication.java
.../java/cn/wise/sc/acquisition/mg/GeneratorApplication.java
+1
-1
No files found.
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/controller/TSampleListController.java
View file @
82d46423
package
cn
.
wise
.
sc
.
acquisition
.
business
.
controller
;
package
cn
.
wise
.
sc
.
acquisition
.
business
.
controller
;
import
cn.wise.sc.acquisition.business.entity.TSampleList
;
import
cn.wise.sc.acquisition.business.model.query.TSampleListQuery
;
import
cn.wise.sc.acquisition.business.model.query.TSampleListQuery
;
import
cn.wise.sc.acquisition.business.service.impl.TSampleListServiceImpl
;
import
cn.wise.sc.acquisition.business.service.impl.TSampleListServiceImpl
;
import
cn.wise.sc.acquisition.business.wrapper.WrapMapper
;
import
cn.wise.sc.acquisition.business.wrapper.Wrapper
;
import
cn.wise.sc.acquisition.business.wrapper.page.Query
;
import
cn.wise.sc.acquisition.business.wrapper.page.Query
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.api.R
;
import
com.baomidou.mybatisplus.extension.api.R
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -37,9 +32,24 @@ public class TSampleListController {
...
@@ -37,9 +32,24 @@ public class TSampleListController {
* @param tSampleListQuery
* @param tSampleListQuery
* @return
* @return
*/
*/
@RequestMapping
(
value
=
"/listAllByQuery"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getPage"
,
method
=
RequestMethod
.
GET
)
public
R
listAllByQuery
(
TSampleListQuery
tSampleListQuery
,
Query
query
)
{
public
R
getPage
(
TSampleListQuery
tSampleListQuery
,
Query
query
)
{
return
R
.
ok
(
tSampleListService
.
listAllByQuery
(
tSampleListQuery
,
query
));
return
R
.
ok
(
tSampleListService
.
getPage
(
tSampleListQuery
,
query
));
}
@RequestMapping
(
value
=
"/updateByHolesID"
,
method
=
RequestMethod
.
POST
)
public
R
updateByHolesID
(
TSampleListQuery
tSampleListQuery
)
{
return
R
.
ok
(
tSampleListService
.
updateByHolesID
(
tSampleListQuery
));
}
@RequestMapping
(
value
=
"/insertSampleList"
,
method
=
RequestMethod
.
POST
)
public
R
insertSampleList
(
TSampleListQuery
tSampleListQuery
)
{
return
R
.
ok
(
tSampleListService
.
insertSampleList
(
tSampleListQuery
));
}
@RequestMapping
(
value
=
"/deleteByHolesID"
,
method
=
RequestMethod
.
POST
)
public
R
deleteByHolesID
(
TSampleListQuery
tSampleListQuery
)
{
return
R
.
ok
(
tSampleListService
.
deleteByHolesID
(
tSampleListQuery
));
}
}
}
}
...
...
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/entity/TSampleList.java
View file @
82d46423
...
@@ -92,5 +92,15 @@ public class TSampleList implements Serializable {
...
@@ -92,5 +92,15 @@ public class TSampleList implements Serializable {
@TableField
(
"Bz"
)
@TableField
(
"Bz"
)
private
String
Bz
;
private
String
Bz
;
/**
* 记录对象
*/
@TableField
(
"RecordName"
)
private
String
RecordName
;
/**
* 记录形式
*/
@TableField
(
"RecordCode"
)
private
byte
[]
RecordCode
;
}
}
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/model/query/TSampleListQuery.java
View file @
82d46423
...
@@ -97,4 +97,15 @@ public class TSampleListQuery implements Serializable {
...
@@ -97,4 +97,15 @@ public class TSampleListQuery implements Serializable {
private
String
Bz
;
private
String
Bz
;
/**
* 记录对象
*/
@ApiModelProperty
(
"记录对象"
)
private
String
RecordName
;
/**
* 记录形式
*/
@ApiModelProperty
(
"记录形式"
)
private
byte
[]
RecordCode
;
}
}
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/service/ITSampleListService.java
View file @
82d46423
...
@@ -9,12 +9,19 @@ import com.baomidou.mybatisplus.extension.service.IService;
...
@@ -9,12 +9,19 @@ import com.baomidou.mybatisplus.extension.service.IService;
/**
/**
* <p>
* <p>
*
服务类
* 服务类
* </p>
* </p>
*
*
* @author ztw
* @author ztw
* @since 2021-04-22
* @since 2021-04-22
*/
*/
public
interface
ITSampleListService
extends
IService
<
TSampleList
>
{
public
interface
ITSampleListService
extends
IService
<
TSampleList
>
{
R
listAllByQuery
(
TSampleListQuery
tSampleListQuery
,
Query
query
);
R
getPage
(
TSampleListQuery
tSampleListQuery
,
Query
query
);
R
updateByHolesID
(
TSampleListQuery
tSampleListQuery
);
R
deleteByHolesID
(
TSampleListQuery
tSampleListQuery
);
R
insertSampleList
(
TSampleListQuery
tSampleListQuery
);
}
}
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/service/impl/TSampleListServiceImpl.java
View file @
82d46423
...
@@ -6,14 +6,20 @@ import cn.wise.sc.acquisition.business.mapper.TSampleListMapper;
...
@@ -6,14 +6,20 @@ import cn.wise.sc.acquisition.business.mapper.TSampleListMapper;
import
cn.wise.sc.acquisition.business.model.query.TSampleListQuery
;
import
cn.wise.sc.acquisition.business.model.query.TSampleListQuery
;
import
cn.wise.sc.acquisition.business.service.ITSampleListService
;
import
cn.wise.sc.acquisition.business.service.ITSampleListService
;
import
cn.wise.sc.acquisition.business.wrapper.page.Query
;
import
cn.wise.sc.acquisition.business.wrapper.page.Query
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.api.R
;
import
com.baomidou.mybatisplus.extension.api.R
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
/**
/**
* <p>
* <p>
...
@@ -24,10 +30,12 @@ import java.util.List;
...
@@ -24,10 +30,12 @@ import java.util.List;
* @since 2021-04-22
* @since 2021-04-22
*/
*/
@Service
@Service
@Slf4j
public
class
TSampleListServiceImpl
extends
ServiceImpl
<
TSampleListMapper
,
TSampleList
>
implements
ITSampleListService
{
public
class
TSampleListServiceImpl
extends
ServiceImpl
<
TSampleListMapper
,
TSampleList
>
implements
ITSampleListService
{
@Override
@Override
public
R
listAllByQuery
(
TSampleListQuery
tSampleListQuery
,
Query
query
)
{
public
R
getPage
(
TSampleListQuery
tSampleListQuery
,
Query
query
)
{
log
.
info
(
JSON
.
toJSONString
(
tSampleListQuery
));
//参数校验
//参数校验
//分页
//分页
Page
<
TSampleList
>
page
=
new
Page
<>(
query
.
getPageNum
(),
query
.
getPageSize
());
Page
<
TSampleList
>
page
=
new
Page
<>(
query
.
getPageNum
(),
query
.
getPageSize
());
...
@@ -41,4 +49,79 @@ public class TSampleListServiceImpl extends ServiceImpl<TSampleListMapper, TSamp
...
@@ -41,4 +49,79 @@ public class TSampleListServiceImpl extends ServiceImpl<TSampleListMapper, TSamp
return
R
.
ok
(
tSampleListPage
);
return
R
.
ok
(
tSampleListPage
);
}
}
@Override
@Transactional
public
R
updateByHolesID
(
TSampleListQuery
tSampleListQuery
)
{
log
.
info
(
JSON
.
toJSONString
(
tSampleListQuery
));
//参数校验
Rcode
.
NOT_PARAM
.
assertNotNull
(
tSampleListQuery
.
getHolesID
());
//条件封装
TSampleList
tSampleList
=
new
TSampleList
();
BeanUtils
.
copyProperties
(
tSampleListQuery
,
tSampleList
);
QueryWrapper
<
TSampleList
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"HolesID"
,
tSampleListQuery
.
getHolesID
());
//修改
int
update
=
baseMapper
.
update
(
tSampleList
,
queryWrapper
);
if
(
update
>
0
)
{
return
R
.
ok
(
"修改成功"
);
}
else
{
log
.
info
(
JSON
.
toJSONString
(
tSampleList
));
return
R
.
ok
(
"修改失败"
);
}
}
@Override
@Transactional
public
R
insertSampleList
(
TSampleListQuery
tSampleListQuery
)
{
log
.
info
(
JSON
.
toJSONString
(
tSampleListQuery
));
//参数校验
Rcode
.
NOT_PARAM
.
assertNotNull
(
tSampleListQuery
.
getHolesID
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
tSampleListQuery
.
getYh
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
tSampleListQuery
.
getStart
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
tSampleListQuery
.
getEndTo
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
tSampleListQuery
.
getRecordName
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
tSampleListQuery
.
getRecordCode
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
tSampleListQuery
.
getBz
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
tSampleListQuery
.
getSyr
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
tSampleListQuery
.
getQRCode
());
//条件封装
TSampleList
tSampleList
=
new
TSampleList
();
BeanUtils
.
copyProperties
(
tSampleListQuery
,
tSampleList
);
//若时间送样为空,创建当前时间
Optional
<
LocalDateTime
>
ofNullable
=
Optional
.
ofNullable
(
tSampleList
.
getSyrq
());
if
(!
ofNullable
.
isPresent
())
{
tSampleList
.
setSyrq
(
LocalDateTime
.
now
());
}
//修改
log
.
info
(
JSON
.
toJSONString
(
tSampleList
));
int
insert
=
baseMapper
.
insert
(
tSampleList
);
if
(
insert
>
0
)
{
return
R
.
ok
(
"增加成功"
);
}
else
{
log
.
info
(
JSON
.
toJSONString
(
tSampleList
));
return
R
.
ok
(
"增加失败"
);
}
}
@Override
@Transactional
public
R
deleteByHolesID
(
TSampleListQuery
tSampleListQuery
)
{
log
.
info
(
JSON
.
toJSONString
(
tSampleListQuery
));
//参数校验
Rcode
.
NOT_PARAM
.
assertNotNull
(
tSampleListQuery
.
getHolesID
());
//删除
int
delete
=
baseMapper
.
delete
(
new
QueryWrapper
<
TSampleList
>().
eq
(
"HolesID"
,
tSampleListQuery
.
getHolesID
()));
if
(
delete
>
0
)
{
return
R
.
ok
(
"删除成功"
);
}
else
{
return
R
.
ok
(
"删除失败"
);
}
}
}
}
acquisition-business/target/classes/cn/wise/sc/acquisition/business/mapper/TEquipmentAccountMapper.xml
0 → 100644
View file @
82d46423
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.acquisition.business.mapper.TEquipmentAccountMapper"
>
</mapper>
im-common/target/classes/META-INF/spring.factories
0 → 100644
View file @
82d46423
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
cn.wise.im.common.exception.handler.UnifiedExceptionHandler,\
cn.wise.im.common.currency.i18n.UnifiedMessageSource
im-common/target/classes/application.yml
0 → 100644
View file @
82d46423
spring
:
mvc
:
throw-exception-if-no-handler-found
:
true
resources
:
add-mappings
:
false
\ No newline at end of file
mybatis-generator/src/main/java/cn/wise/sc/acquisition/mg/GeneratorApplication.java
View file @
82d46423
...
@@ -57,7 +57,7 @@ public class GeneratorApplication {
...
@@ -57,7 +57,7 @@ public class GeneratorApplication {
GlobalConfig
gc
=
new
GlobalConfig
();
GlobalConfig
gc
=
new
GlobalConfig
();
String
projectPath
=
System
.
getProperty
(
"user.dir"
);
String
projectPath
=
System
.
getProperty
(
"user.dir"
);
gc
.
setOutputDir
(
projectPath
+
"\\acquisition-business\\src\\main\\java"
);
gc
.
setOutputDir
(
projectPath
+
"\\acquisition-business\\src\\main\\java"
);
gc
.
setAuthor
(
"
ztw
"
);
gc
.
setAuthor
(
"
renchao
"
);
gc
.
setOpen
(
false
);
gc
.
setOpen
(
false
);
// gc.setSwagger2(true); 实体属性 Swagger2 注解
// gc.setSwagger2(true); 实体属性 Swagger2 注解
mpg
.
setGlobalConfig
(
gc
);
mpg
.
setGlobalConfig
(
gc
);
...
...
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