Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
李苗
/
Vion-DevOps
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 419cf3a8
authored
Oct 23, 2024
by
HlQ
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[add]
1.添加 inet 类型处理器 2.合同付款方式添加新类型 [chg] 修改合同更新时,合同金额计算的顺序
1 parent
d11e61c6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
2 deletions
src/main/java/vion/config/mp/InetTypeHandler.java
src/main/java/vion/config/mp/JsonbTypeHandler.java
src/main/java/vion/cron/ContractRunner.java
src/main/java/vion/service/impl/ContractServiceImpl.java
src/main/java/vion/config/mp/InetTypeHandler.java
0 → 100644
View file @
419cf3a
package
vion
.
config
.
mp
;
import
com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
;
import
org.apache.ibatis.type.JdbcType
;
import
org.apache.ibatis.type.MappedTypes
;
import
org.postgresql.util.PGobject
;
import
java.lang.reflect.Field
;
import
java.sql.PreparedStatement
;
import
java.sql.SQLException
;
/**
* @author vion
* @date 2024/10/23
*/
@MappedTypes
({
Object
.
class
})
public
class
InetTypeHandler
extends
JacksonTypeHandler
{
public
InetTypeHandler
(
Class
<?>
type
)
{
super
(
type
);
}
public
InetTypeHandler
(
Class
<?>
type
,
Field
field
)
{
super
(
type
,
field
);
}
@Override
public
void
setNonNullParameter
(
PreparedStatement
ps
,
int
i
,
Object
parameter
,
JdbcType
jdbcType
)
throws
SQLException
{
if
(
ps
!=
null
)
{
PGobject
jsonObject
=
new
PGobject
();
jsonObject
.
setType
(
"inet"
);
jsonObject
.
setValue
(
parameter
.
toString
());
ps
.
setObject
(
i
,
jsonObject
);
}
}
}
src/main/java/vion/config/mp/JsonbTypeHandler.java
View file @
419cf3a
...
@@ -5,20 +5,25 @@ import org.apache.ibatis.type.JdbcType;
...
@@ -5,20 +5,25 @@ import org.apache.ibatis.type.JdbcType;
import
org.apache.ibatis.type.MappedTypes
;
import
org.apache.ibatis.type.MappedTypes
;
import
org.postgresql.util.PGobject
;
import
org.postgresql.util.PGobject
;
import
java.lang.reflect.Field
;
import
java.sql.PreparedStatement
;
import
java.sql.PreparedStatement
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
@MappedTypes
({
Object
.
class
})
@MappedTypes
({
Object
.
class
})
public
class
JsonbTypeHandler
extends
JacksonTypeHandler
{
public
class
JsonbTypeHandler
extends
JacksonTypeHandler
{
private
static
final
PGobject
jsonObject
=
new
PGobject
();
public
JsonbTypeHandler
(
Class
<?>
type
)
{
public
JsonbTypeHandler
(
Class
<?>
type
)
{
super
(
type
);
super
(
type
);
}
}
public
JsonbTypeHandler
(
Class
<?>
type
,
Field
field
)
{
super
(
type
,
field
);
}
@Override
@Override
public
void
setNonNullParameter
(
PreparedStatement
ps
,
int
i
,
Object
parameter
,
JdbcType
jdbcType
)
throws
SQLException
{
public
void
setNonNullParameter
(
PreparedStatement
ps
,
int
i
,
Object
parameter
,
JdbcType
jdbcType
)
throws
SQLException
{
if
(
ps
!=
null
)
{
if
(
ps
!=
null
)
{
PGobject
jsonObject
=
new
PGobject
();
jsonObject
.
setType
(
"jsonb"
);
jsonObject
.
setType
(
"jsonb"
);
jsonObject
.
setValue
(
toJson
(
parameter
));
jsonObject
.
setValue
(
toJson
(
parameter
));
ps
.
setObject
(
i
,
jsonObject
);
ps
.
setObject
(
i
,
jsonObject
);
...
...
src/main/java/vion/cron/ContractRunner.java
View file @
419cf3a
...
@@ -399,6 +399,24 @@ public class ContractRunner {
...
@@ -399,6 +399,24 @@ public class ContractRunner {
contractMaintainPayment3
.
setPaymentRatio
(
Opt
.
ofNullable
(
contract
.
getMaintainRatio3
()).
orElse
(
BigDecimal
.
ZERO
));
contractMaintainPayment3
.
setPaymentRatio
(
Opt
.
ofNullable
(
contract
.
getMaintainRatio3
()).
orElse
(
BigDecimal
.
ZERO
));
contractMaintainPayment3
.
setPaymentDate
(
contract
.
getMaintainDate3
());
contractMaintainPayment3
.
setPaymentDate
(
contract
.
getMaintainDate3
());
contractPaymentList
.
add
(
contractMaintainPayment3
);
contractPaymentList
.
add
(
contractMaintainPayment3
);
// 维保进度款
ContractPayment
maintainProgressPayment
=
new
ContractPayment
();
maintainProgressPayment
.
setId
(
contractId2PaymentMap
.
getOrDefault
(
contract
.
getId
(),
new
HashMap
<>()).
get
(
7
));
maintainProgressPayment
.
setContractId
(
contract
.
getId
());
maintainProgressPayment
.
setPaymentType
(
9
);
maintainProgressPayment
.
setPaymentRatio
(
Opt
.
ofNullable
(
contract
.
getMaintainProgressRatio
()).
orElse
(
BigDecimal
.
ZERO
));
maintainProgressPayment
.
setPaymentDate
(
contract
.
getMaintainDate2
());
contractPaymentList
.
add
(
maintainProgressPayment
);
// 维保验收款
ContractPayment
maintainAcceptancePayment
=
new
ContractPayment
();
maintainAcceptancePayment
.
setId
(
contractId2PaymentMap
.
getOrDefault
(
contract
.
getId
(),
new
HashMap
<>()).
get
(
8
));
maintainAcceptancePayment
.
setContractId
(
contract
.
getId
());
maintainAcceptancePayment
.
setPaymentType
(
10
);
maintainAcceptancePayment
.
setPaymentRatio
(
Opt
.
ofNullable
(
contract
.
getMaintainAcceptanceRatio
()).
orElse
(
BigDecimal
.
ZERO
));
maintainAcceptancePayment
.
setPaymentDate
(
contract
.
getMaintainDate3
());
contractPaymentList
.
add
(
maintainAcceptancePayment
);
}
}
contractPaymentService
.
saveOrUpdateBatch
(
contractPaymentList
);
contractPaymentService
.
saveOrUpdateBatch
(
contractPaymentList
);
}
}
...
...
src/main/java/vion/service/impl/ContractServiceImpl.java
View file @
419cf3a
...
@@ -303,8 +303,8 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
...
@@ -303,8 +303,8 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
Long
contractId
=
existContract
.
getId
();
Long
contractId
=
existContract
.
getId
();
String
existContractNo
=
existContract
.
getContractNo
();
String
existContractNo
=
existContract
.
getContractNo
();
contract
.
setId
(
contractId
);
contract
.
setId
(
contractId
);
if
(
this
.
updateById
(
contract
))
{
contractPaymentService
.
calMoney
(
existContract
,
contract
);
contractPaymentService
.
calMoney
(
existContract
,
contract
);
if
(
this
.
updateById
(
contract
))
{
Opt
.
ofNullable
(
dto
.
getNodeDate
())
Opt
.
ofNullable
(
dto
.
getNodeDate
())
.
ifPresent
(
date
->
contractPaymentService
.
lambdaUpdate
()
.
ifPresent
(
date
->
contractPaymentService
.
lambdaUpdate
()
.
set
(
ContractPayment:
:
getNodeDate
,
date
)
.
set
(
ContractPayment:
:
getNodeDate
,
date
)
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment