Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
ry-crm
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
田光明
ry-crm
Commits
1a228d87
Commit
1a228d87
authored
Feb 25, 2025
by
EDY
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
c41ff68c
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
130 additions
and
28 deletions
+130
-28
BaseContractInfoController.java
...i/web/controller/business/BaseContractInfoController.java
+4
-4
BaseContractAuditRecord.java
...ruoyi/system/domain/business/BaseContractAuditRecord.java
+6
-6
BaseContractInfo.java
...va/com/ruoyi/system/domain/business/BaseContractInfo.java
+59
-3
BaseContractInfoMapper.java
.../ruoyi/system/mapper/business/BaseContractInfoMapper.java
+1
-2
BaseInvoiceInfoMapper.java
...m/ruoyi/system/mapper/business/BaseInvoiceInfoMapper.java
+1
-1
IBaseContractInfoService.java
...oyi/system/service/business/IBaseContractInfoService.java
+4
-2
BaseContractInfoServiceImpl.java
...em/service/business/impl/BaseContractInfoServiceImpl.java
+25
-4
BaseContractInfoMapper.xml
...main/resources/mapper/business/BaseContractInfoMapper.xml
+21
-5
BaseInvoiceInfoMapper.xml
.../main/resources/mapper/business/BaseInvoiceInfoMapper.xml
+9
-1
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/business/BaseContractInfoController.java
View file @
1a228d87
...
...
@@ -101,7 +101,7 @@ public class BaseContractInfoController extends BaseController {
@Log
(
title
=
"合同信息"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
BaseContractInfo
baseContractInfo
)
{
baseContractInfo
.
setCreateBy
(
get
Usern
ame
());
baseContractInfo
.
setCreateBy
(
get
LoginUser
().
getUser
().
getNickN
ame
());
return
toAjax
(
baseContractInfoService
.
insertBaseContractInfo
(
baseContractInfo
));
}
...
...
@@ -112,7 +112,7 @@ public class BaseContractInfoController extends BaseController {
@Log
(
title
=
"合同信息"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
BaseContractInfo
baseContractInfo
)
{
return
toAjax
(
baseContractInfoService
.
updateBaseContractInfo
(
baseContractInfo
));
return
toAjax
(
baseContractInfoService
.
updateBaseContractInfo
(
baseContractInfo
,
getLoginUser
().
getUser
()
));
}
/**
...
...
@@ -134,8 +134,8 @@ public class BaseContractInfoController extends BaseController {
@GetMapping
(
value
=
"/collect"
)
public
AjaxResult
collect
()
{
ContractCollectVo
contractCollectVo
=
baseContractInfoService
.
getCollect
();
public
AjaxResult
collect
(
Long
contractId
)
{
ContractCollectVo
contractCollectVo
=
baseContractInfoService
.
getCollect
(
contractId
);
return
success
(
contractCollectVo
);
}
...
...
ruoyi-system/src/main/java/com/ruoyi/system/domain/business/BaseContractAuditRecord.java
View file @
1a228d87
...
...
@@ -24,11 +24,11 @@ public class BaseContractAuditRecord extends BaseEntity
/** 节点 */
@Excel
(
name
=
"节点"
)
private
Long
jd
;
private
Integer
jd
;
/** 操作 */
@Excel
(
name
=
"操作"
)
private
Long
cz
;
private
Integer
cz
;
/** 处理意见 */
@Excel
(
name
=
"处理意见"
)
...
...
@@ -43,21 +43,21 @@ public class BaseContractAuditRecord extends BaseEntity
{
return
id
;
}
public
void
setJd
(
Long
jd
)
public
void
setJd
(
Integer
jd
)
{
this
.
jd
=
jd
;
}
public
Long
getJd
()
public
Integer
getJd
()
{
return
jd
;
}
public
void
setCz
(
Long
cz
)
public
void
setCz
(
Integer
cz
)
{
this
.
cz
=
cz
;
}
public
Long
getCz
()
public
Integer
getCz
()
{
return
cz
;
}
...
...
ruoyi-system/src/main/java/com/ruoyi/system/domain/business/BaseContractInfo.java
View file @
1a228d87
...
...
@@ -155,7 +155,11 @@ public class BaseContractInfo extends BaseEntity
/** 合同当前节点 */
@Excel
(
name
=
"合同当前节点"
)
private
Long
dqjd
;
private
Integer
dqjd
;
/** 审核状态 */
@Excel
(
name
=
"审核状态"
)
private
Integer
shzt
;
/** 主体地位 */
@Excel
(
name
=
"主体地位"
)
...
...
@@ -181,12 +185,24 @@ public class BaseContractInfo extends BaseEntity
@Excel
(
name
=
"是否删除 1 是 0 正常"
)
private
Long
deleteFlag
;
/** 最小金额 */
private
BigDecimal
htMinAmount
;
/** 最大金额 */
private
BigDecimal
htMaxAmount
;
/** 期数集合 */
private
List
<
BaseContractPeriodsInfo
>
baseContractPeriodsInfos
;
/** 审批记录 */
private
List
<
BaseContractAuditRecord
>
baseContractAuditRecords
;
// 生效时间查询类型
private
Integer
htsxsjType
;
// 终止时间查询类型
private
Integer
htzzsjType
;
public
BaseContractInfo
()
{
}
...
...
@@ -469,12 +485,12 @@ public class BaseContractInfo extends BaseEntity
{
return
fdje
;
}
public
void
setDqjd
(
Long
dqjd
)
public
void
setDqjd
(
Integer
dqjd
)
{
this
.
dqjd
=
dqjd
;
}
public
Long
getDqjd
()
public
Integer
getDqjd
()
{
return
dqjd
;
}
...
...
@@ -609,4 +625,44 @@ public class BaseContractInfo extends BaseEntity
public
void
setShrName
(
String
shrName
)
{
this
.
shrName
=
shrName
;
}
public
Integer
getShzt
()
{
return
shzt
;
}
public
void
setShzt
(
Integer
shzt
)
{
this
.
shzt
=
shzt
;
}
public
BigDecimal
getHtMinAmount
()
{
return
htMinAmount
;
}
public
void
setHtMinAmount
(
BigDecimal
htMinAmount
)
{
this
.
htMinAmount
=
htMinAmount
;
}
public
BigDecimal
getHtMaxAmount
()
{
return
htMaxAmount
;
}
public
void
setHtMaxAmount
(
BigDecimal
htMaxAmount
)
{
this
.
htMaxAmount
=
htMaxAmount
;
}
public
Integer
getHtsxsjType
()
{
return
htsxsjType
;
}
public
void
setHtsxsjType
(
Integer
htsxsjType
)
{
this
.
htsxsjType
=
htsxsjType
;
}
public
Integer
getHtzzsjType
()
{
return
htzzsjType
;
}
public
void
setHtzzsjType
(
Integer
htzzsjType
)
{
this
.
htzzsjType
=
htzzsjType
;
}
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/business/BaseContractInfoMapper.java
View file @
1a228d87
...
...
@@ -3,7 +3,6 @@ package com.ruoyi.system.mapper.business;
import
com.ruoyi.system.domain.business.BaseContractInfo
;
import
com.ruoyi.system.domain.business.vo.ContractCollectVo
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
...
...
@@ -64,5 +63,5 @@ public interface BaseContractInfoMapper
String
selectMaxContractNo
(
String
orderNoPrefix
);
ContractCollectVo
queryContractAmount
();
ContractCollectVo
queryContractAmount
(
Long
contractId
);
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/business/BaseInvoiceInfoMapper.java
View file @
1a228d87
...
...
@@ -61,6 +61,6 @@ public interface BaseInvoiceInfoMapper
*/
public
int
deleteBaseInvoiceInfoByIds
(
Long
[]
ids
);
BigDecimal
queryInvoiceAmount
();
BigDecimal
queryInvoiceAmount
(
Long
contractId
);
}
ruoyi-system/src/main/java/com/ruoyi/system/service/business/IBaseContractInfoService.java
View file @
1a228d87
package
com
.
ruoyi
.
system
.
service
.
business
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.core.domain.model.LoginUser
;
import
com.ruoyi.system.domain.business.BaseContractInfo
;
import
com.ruoyi.system.domain.business.BaseContractPeriodsInfo
;
...
...
@@ -43,9 +44,10 @@ public interface IBaseContractInfoService
* 修改合同信息
*
* @param baseContractInfo 合同信息
* @param user
* @return 结果
*/
public
int
updateBaseContractInfo
(
BaseContractInfo
baseContractInfo
);
public
int
updateBaseContractInfo
(
BaseContractInfo
baseContractInfo
,
SysUser
user
);
/**
* 批量删除合同信息
...
...
@@ -65,7 +67,7 @@ public interface IBaseContractInfoService
List
<
BaseContractInfo
>
selectBaseContractAuditList
(
BaseContractInfo
baseContractInfo
,
LoginUser
loginUser
);
ContractCollectVo
getCollect
();
ContractCollectVo
getCollect
(
Long
contractId
);
List
<
BaseContractPeriodsInfo
>
getPeriodInfo
(
BaseContractInfo
baseContractInfo
);
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/business/impl/BaseContractInfoServiceImpl.java
View file @
1a228d87
...
...
@@ -3,10 +3,12 @@ package com.ruoyi.system.service.business.impl;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.ruoyi.common.core.domain.entity.SysRole
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.core.domain.model.LoginUser
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.MoneyConverter
;
...
...
@@ -95,6 +97,14 @@ public class BaseContractInfoServiceImpl implements IBaseContractInfoService {
baseContractPeriodsInfoMapper
.
insertBaseContractPeriodsInfo
(
baseContractPeriodsInfo
);
}
}
BaseContractAuditRecord
baseContractAuditRecord
=
new
BaseContractAuditRecord
();
baseContractAuditRecord
.
setContractId
(
baseContractInfo
.
getId
());
baseContractAuditRecord
.
setJd
(
1
);
baseContractAuditRecord
.
setCz
(
1
);
baseContractAuditRecord
.
setClyj
(
"/"
);
baseContractAuditRecord
.
setCreateTime
(
new
Date
());
baseContractAuditRecord
.
setCreateBy
(
baseContractInfo
.
getCreateBy
());
baseContractAuditRecordMapper
.
insertBaseContractAuditRecord
(
baseContractAuditRecord
);
return
result
;
}
...
...
@@ -102,11 +112,22 @@ public class BaseContractInfoServiceImpl implements IBaseContractInfoService {
* 修改合同信息
*
* @param baseContractInfo 合同信息
* @param user
* @return 结果
*/
@Override
public
int
updateBaseContractInfo
(
BaseContractInfo
baseContractInfo
)
{
public
int
updateBaseContractInfo
(
BaseContractInfo
baseContractInfo
,
SysUser
user
)
{
baseContractInfo
.
setUpdateTime
(
DateUtils
.
getNowDate
());
if
(
baseContractInfo
.
getShzt
()
!=
null
)
{
baseContractInfo
.
setShrId
(
user
.
getUserId
());
baseContractInfo
.
setShrName
(
user
.
getNickName
());
BaseContractAuditRecord
baseContractAuditRecord
=
new
BaseContractAuditRecord
();
baseContractAuditRecord
.
setContractId
(
baseContractInfo
.
getId
());
baseContractAuditRecord
.
setJd
(
2
);
baseContractAuditRecord
.
setCz
(
1
);
baseContractAuditRecord
.
setClyj
(
baseContractInfo
.
getBz
());
baseContractAuditRecordMapper
.
insertBaseContractAuditRecord
(
baseContractAuditRecord
);
}
return
baseContractInfoMapper
.
updateBaseContractInfo
(
baseContractInfo
);
}
...
...
@@ -150,11 +171,11 @@ public class BaseContractInfoServiceImpl implements IBaseContractInfoService {
}
@Override
public
ContractCollectVo
getCollect
()
{
ContractCollectVo
contractCollectVo
=
baseContractInfoMapper
.
queryContractAmount
();
public
ContractCollectVo
getCollect
(
Long
contractId
)
{
ContractCollectVo
contractCollectVo
=
baseContractInfoMapper
.
queryContractAmount
(
contractId
);
if
(
contractCollectVo
!=
null
&&
contractCollectVo
.
getContractAmount
()
!=
null
&&
contractCollectVo
.
getToTheAmount
()
!=
null
)
{
contractCollectVo
.
setPayeeAmount
(
contractCollectVo
.
getContractAmount
().
subtract
(
contractCollectVo
.
getToTheAmount
()));
BigDecimal
invoiceAmount
=
baseInvoiceInfoMapper
.
queryInvoiceAmount
();
BigDecimal
invoiceAmount
=
baseInvoiceInfoMapper
.
queryInvoiceAmount
(
contractId
);
contractCollectVo
.
setMakeInvoiceAmount
(
invoiceAmount
);
}
else
{
contractCollectVo
=
new
ContractCollectVo
();
...
...
ruoyi-system/src/main/resources/mapper/business/BaseContractInfoMapper.xml
View file @
1a228d87
...
...
@@ -43,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"htfj"
column=
"htfj"
/>
<result
property=
"shrId"
column=
"shr_id"
/>
<result
property=
"shrName"
column=
"shr"
/>
<result
property=
"shzt"
column=
"shzt"
/>
<result
property=
"bz"
column=
"bz"
/>
<result
property=
"deleteFlag"
column=
"delete_flag"
/>
<result
property=
"createTime"
column=
"create_time"
/>
...
...
@@ -52,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql
id=
"selectBaseContractInfoVo"
>
select id,subject_id,htbh, bm_id, ssbm, ywy_id, ywy, kh_id, khmc, htmc, cplb, j_gsmc, j_txdz, j_yb, j_dzyj, j_hkr, j_khyh, j_yhzh, j_swdjh, j_lxr, j_lxdh, htnr, qysj, htzt, fkfs, htsxsj, htzzsj, qs, htze,hkje, fkbl, fd_flag, fdje, dqjd, ztdw, htfj,shr_id,shr, bz, delete_flag, create_time, create_by, update_time, update_by from base_contract_info
select id,subject_id,htbh, bm_id, ssbm, ywy_id, ywy, kh_id, khmc, htmc, cplb, j_gsmc, j_txdz, j_yb, j_dzyj, j_hkr, j_khyh, j_yhzh, j_swdjh, j_lxr, j_lxdh, htnr, qysj, htzt, fkfs, htsxsj, htzzsj, qs, htze,hkje, fkbl, fd_flag, fdje, dqjd, ztdw, htfj,shr_id,shr,
shzt,
bz, delete_flag, create_time, create_by, update_time, update_by from base_contract_info
</sql>
<select
id=
"selectBaseContractInfoList"
parameterType=
"BaseContractInfo"
resultMap=
"BaseContractInfoResult"
>
...
...
@@ -65,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"ywyId != null "
>
and ywy_id = #{ywyId}
</if>
<if
test=
"ywy != null and ywy != ''"
>
and ywy = #{ywy}
</if>
<if
test=
"khId != null "
>
and kh_id = #{khId}
</if>
<if
test=
"khmc != null and khmc != ''"
>
and khmc
= #{khmc}
</if>
<if
test=
"khmc != null and khmc != ''"
>
and khmc
like concat('%', #{khmc}, '%')
</if>
<if
test=
"htmc != null and htmc != ''"
>
and htmc = #{htmc}
</if>
<if
test=
"cplb != null "
>
and cplb = #{cplb}
</if>
<if
test=
"jGsmc != null and jGsmc != ''"
>
and j_gsmc = #{jGsmc}
</if>
...
...
@@ -82,8 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"qysj != null "
>
and qysj = #{qysj}
</if>
<if
test=
"htzt != null "
>
and htzt = #{htzt}
</if>
<if
test=
"fkfs != null "
>
and fkfs = #{fkfs}
</if>
<if
test=
"htsxsj != null "
>
and htsxsj = #{htsxsj}
</if>
<if
test=
"htzzsj != null "
>
and htzzsj = #{htzzsj}
</if>
<if
test=
"htsxsj != null "
>
and htsxsj = #{fkfs}
</if>
<if
test=
"qs != null "
>
and qs = #{qs}
</if>
<if
test=
"htze != null "
>
and htze = #{htze}
</if>
<if
test=
"fkbl != null and fkbl != ''"
>
and fkbl = #{fkbl}
</if>
...
...
@@ -94,9 +94,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"htfj != null and htfj != ''"
>
and htfj = #{htfj}
</if>
<if
test=
"shrId != null and shrId != ''"
>
and shr_id = #{shrId}
</if>
<if
test=
"shrName != null and shrName != ''"
>
and shr = #{shrName}
</if>
<if
test=
"shzt != null "
>
and shzt = #{shzt}
</if>
<if
test=
"bz != null and bz != ''"
>
and bz = #{bz}
</if>
<if
test=
"deleteFlag != null "
>
and delete_flag = #{deleteFlag}
</if>
<if
test=
"htMinAmount != null and htMaxAmount != null "
>
and htze between #{htMinAmount} and #{htMaxAmount}
</if>
<if
test=
"htsxsjType != null and htsxsjType == 1 "
>
and htsxsj >= DATE_SUB(CURDATE(), INTERVAL 7 DAY)
</if>
<if
test=
"htsxsjType != null and htsxsjType == 2 "
>
and htsxsj >= DATE_SUB(CURDATE(), INTERVAL 30 DAY)
</if>
<if
test=
"htsxsjType != null and htsxsjType == 3 "
>
and htsxsj >= DATE_SUB(CURDATE(), INTERVAL 90 DAY)
</if>
<if
test=
"htsxsjType != null and htsxsjType == 4 "
>
and htsxsj >= DATE_SUB(CURDATE(), INTERVAL 180 DAY)
</if>
<if
test=
"htzzsjType != null and htzzsjType == 1 "
>
and htzzsj >= DATE_SUB(CURDATE(), INTERVAL -7 DAY)
</if>
<if
test=
"htzzsjType != null and htzzsjType == 2 "
>
and htzzsj >= DATE_SUB(CURDATE(), INTERVAL -30 DAY)
</if>
<if
test=
"htzzsjType != null and htzzsjType == 3 "
>
and htzzsj >= DATE_SUB(CURDATE(), INTERVAL -90 DAY)
</if>
<if
test=
"htzzsjType != null and htzzsjType == 4 "
>
and htzzsj >= DATE_SUB(CURDATE(), INTERVAL -180 DAY)
</if>
</where>
order by id desc
</select>
<select
id=
"selectBaseContractInfoById"
parameterType=
"Long"
resultMap=
"BaseContractInfoResult"
>
...
...
@@ -111,9 +122,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sum(htze) contractAmount,
sum(hkje) toTheAmount
from base_contract_info where htzt != 5
<if
test=
"contractId != null"
>
and contract_id = #{contractId}
</if>
</select>
<insert
id=
"insertBaseContractInfo"
parameterType=
"BaseContractInfo"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into base_contract_info
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
@@ -153,6 +166,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"htfj != null"
>
htfj,
</if>
<if
test=
"shrId != null"
>
shr_id,
</if>
<if
test=
"shrName != null"
>
shr,
</if>
<if
test=
"shzt != null"
>
shzt,
</if>
<if
test=
"bz != null"
>
bz,
</if>
<if
test=
"deleteFlag != null"
>
delete_flag,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
...
...
@@ -197,6 +211,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"htfj != null"
>
#{htfj},
</if>
<if
test=
"shrId != null"
>
#{shrId},
</if>
<if
test=
"shrName != null"
>
#{shr},
</if>
<if
test=
"shzt != null"
>
#{shzt},
</if>
<if
test=
"bz != null"
>
#{bz},
</if>
<if
test=
"deleteFlag != null"
>
#{deleteFlag},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
...
...
@@ -246,6 +261,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"htfj != null"
>
htfj = #{htfj},
</if>
<if
test=
"shrId != null"
>
shr_id = #{shrId},
</if>
<if
test=
"shrName != null and shrName != ''"
>
shr = #{shrName},
</if>
<if
test=
"shzt != null "
>
shzt = #{shzt},
</if>
<if
test=
"bz != null"
>
bz = #{bz},
</if>
<if
test=
"deleteFlag != null"
>
delete_flag = #{deleteFlag},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
...
...
ruoyi-system/src/main/resources/mapper/business/BaseInvoiceInfoMapper.xml
View file @
1a228d87
...
...
@@ -85,7 +85,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</select>
<select
id=
"queryInvoiceAmount"
resultType=
"java.math.BigDecimal"
>
select sum(kpje) invoiceAmount from base_invoice_info where fpzt = 3
select
sum(kpje) invoiceAmount
from
base_invoice_info
where
fpzt = 3
<if
test=
"contractId != null"
>
and contract_id = #{contractId}
</if>
</select>
<insert
id=
"insertBaseInvoiceInfo"
parameterType=
"BaseInvoiceInfo"
>
...
...
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