Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yichengstreet-be
Project
Project
Details
Activity
Releases
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
yichengstreet
yichengstreet-be
Commits
b7f83f11
You need to sign in or sign up before continuing.
Commit
b7f83f11
authored
Jul 17, 2025
by
lixuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 房源
parent
96a9217d
Pipeline
#145427
failed with stages
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
145 additions
and
0 deletions
+145
-0
ContrastIncomeController.java
.../ruoyi/web/controller/house/ContrastIncomeController.java
+75
-0
BusinessEntitySell.java
...ava/com/ruoyi/system/domain/house/BusinessEntitySell.java
+12
-0
ContrastIncome.java
...in/java/com/ruoyi/system/domain/house/ContrastIncome.java
+19
-0
BusinessEntityInfoMapper.java
...m/ruoyi/system/mapper/house/BusinessEntityInfoMapper.java
+2
-0
ContrastIncomeMapper.java
...a/com/ruoyi/system/mapper/house/ContrastIncomeMapper.java
+12
-0
BusinessEntityInfoMapper.xml
.../main/resources/mapper/house/BusinessEntityInfoMapper.xml
+3
-0
ContrastIncomeMapper.xml
.../src/main/resources/mapper/house/ContrastIncomeMapper.xml
+22
-0
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/house/ContrastIncomeController.java
0 → 100644
View file @
b7f83f11
package
com
.
ruoyi
.
web
.
controller
.
house
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.system.domain.house.BusinessEntityInfo
;
import
com.ruoyi.system.domain.house.BusinessEntitySell
;
import
com.ruoyi.system.domain.house.ContrastIncome
;
import
com.ruoyi.system.mapper.house.BusinessEntityInfoMapper
;
import
com.ruoyi.system.mapper.house.BusinessEntitySellMapper
;
import
com.ruoyi.system.mapper.house.ContrastIncomeMapper
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.UUID
;
@RestController
@RequestMapping
(
"/api/contrastIncome"
)
public
class
ContrastIncomeController
extends
BaseController
{
private
final
ContrastIncomeMapper
contrastIncomeMapper
;
private
final
BusinessEntityInfoMapper
businessEntityInfoMapper
;
private
final
BusinessEntitySellMapper
businessEntitySellMapper
;
public
ContrastIncomeController
(
ContrastIncomeMapper
contrastIncomeMapper
,
BusinessEntityInfoMapper
businessEntityInfoMapper
,
BusinessEntitySellMapper
businessEntitySellMapper
)
{
this
.
contrastIncomeMapper
=
contrastIncomeMapper
;
this
.
businessEntityInfoMapper
=
businessEntityInfoMapper
;
this
.
businessEntitySellMapper
=
businessEntitySellMapper
;
}
@PutMapping
(
"/start"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
AjaxResult
start
()
{
List
<
ContrastIncome
>
contrastIncomes
=
contrastIncomeMapper
.
selectAll
();
for
(
ContrastIncome
contrastIncome
:
contrastIncomes
)
{
contrastIncome
.
setWgName
(
contrastIncome
.
getWgName
().
replaceAll
(
" "
,
""
));
contrastIncome
.
setName
(
contrastIncome
.
getName
().
replaceAll
(
" "
,
""
));
contrastIncome
.
setPrincipal
(
contrastIncome
.
getPrincipal
().
replaceAll
(
" "
,
""
));
}
for
(
ContrastIncome
contrastIncome
:
contrastIncomes
)
{
System
.
out
.
println
(
"当前处理id: "
+
contrastIncome
.
getId
());
List
<
BusinessEntityInfo
>
businessEntityInfos
=
businessEntityInfoMapper
.
selectByName
(
contrastIncome
.
getName
());
if
(
CollectionUtils
.
isEmpty
(
businessEntityInfos
))
{
System
.
out
.
println
(
"当前名字: "
+
contrastIncome
.
getName
()
+
" 下没有找到对应的经营主体"
);
}
else
if
(
businessEntityInfos
.
size
()
!=
1
)
{
System
.
out
.
println
(
"当前名字: "
+
contrastIncome
.
getName
()
+
" 有多个对应的经营主体"
);
}
else
{
BusinessEntityInfo
businessEntityInfo
=
businessEntityInfos
.
get
(
0
);
BusinessEntitySell
businessEntitySell
=
businessEntitySellMapper
.
selectBusinessEntitySellByBusinessEntityInfoId
(
businessEntityInfo
.
getId
(),
2024
);
if
(
Objects
.
nonNull
(
businessEntitySell
))
{
businessEntitySell
.
setYearTax
(
new
BigDecimal
(
contrastIncome
.
getIncome
()));
System
.
out
.
println
(
"为businessEntityInfo.getName() = "
+
businessEntityInfo
.
getName
()
+
"更新了税收"
);
businessEntitySellMapper
.
updateBusinessEntitySell
(
businessEntitySell
);
}
else
{
BusinessEntitySell
entitySell
=
new
BusinessEntitySell
();
entitySell
.
setId
(
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
));
entitySell
.
setBusinessEntityInfoId
(
businessEntityInfo
.
getId
());
entitySell
.
setYear
(
2024
);
entitySell
.
setYearTax
(
new
BigDecimal
(
contrastIncome
.
getIncome
()));
System
.
out
.
println
(
"为businessEntityInfo.getName() = "
+
businessEntityInfo
.
getName
()
+
" 创建了新的BusinessEntitySell: "
+
entitySell
);
businessEntitySellMapper
.
insertBusinessEntitySell
(
entitySell
);
}
}
}
System
.
out
.
println
(
"处理完成"
);
return
AjaxResult
.
success
();
}
}
ruoyi-system/src/main/java/com/ruoyi/system/domain/house/BusinessEntitySell.java
View file @
b7f83f11
...
...
@@ -18,4 +18,16 @@ public class BusinessEntitySell {
private
BigDecimal
yearTax
;
private
String
compare
;
@Override
public
String
toString
()
{
return
"BusinessEntitySell{"
+
"id='"
+
id
+
'\''
+
", businessEntityInfoId='"
+
businessEntityInfoId
+
'\''
+
", year="
+
year
+
", yearSell="
+
yearSell
+
", yearTax="
+
yearTax
+
", compare='"
+
compare
+
'\''
+
'}'
;
}
}
ruoyi-system/src/main/java/com/ruoyi/system/domain/house/ContrastIncome.java
0 → 100644
View file @
b7f83f11
package
com
.
ruoyi
.
system
.
domain
.
house
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
ContrastIncome
implements
Serializable
{
private
Long
id
;
private
String
wgName
;
private
String
name
;
private
String
principal
;
private
String
income
;
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/house/BusinessEntityInfoMapper.java
View file @
b7f83f11
...
...
@@ -30,4 +30,6 @@ public interface BusinessEntityInfoMapper {
List
<
BusinessEntityInfo
>
selectAllBusinessEntityInfosByHouseResourceIds
(
@Param
(
"houseResourceIds"
)
List
<
String
>
houseResourceIds
);
BigDecimal
selectYearSellByHouseResourceId
(
@Param
(
"houseResourceId"
)
String
houseResourceId
);
List
<
BusinessEntityInfo
>
selectByName
(
@Param
(
"name"
)
String
name
);
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/house/ContrastIncomeMapper.java
0 → 100644
View file @
b7f83f11
package
com
.
ruoyi
.
system
.
mapper
.
house
;
import
com.ruoyi.system.domain.house.ContrastIncome
;
import
java.util.List
;
public
interface
ContrastIncomeMapper
{
List
<
ContrastIncome
>
selectAll
();
void
updateById
(
ContrastIncome
contrastIncome
);
}
ruoyi-system/src/main/resources/mapper/house/BusinessEntityInfoMapper.xml
View file @
b7f83f11
...
...
@@ -79,4 +79,7 @@
WHERE
t1.house_resource_id = #{houseResourceId}
</select>
<select
id=
"selectByName"
resultType=
"com.ruoyi.system.domain.house.BusinessEntityInfo"
>
SELECT * FROM business_entity_info WHERE name = #{name}
</select>
</mapper>
ruoyi-system/src/main/resources/mapper/house/ContrastIncomeMapper.xml
0 → 100644
View file @
b7f83f11
<?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=
"com.ruoyi.system.mapper.house.ContrastIncomeMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.ruoyi.system.domain.house.ContrastIncome"
>
<id
property=
"id"
column=
"id"
jdbcType=
"NUMERIC"
/>
<result
property=
"wgName"
column=
"wg_name"
jdbcType=
"VARCHAR"
/>
<result
property=
"name"
column=
"name"
jdbcType=
"VARCHAR"
/>
<result
property=
"principal"
column=
"principal"
jdbcType=
"VARCHAR"
/>
<result
property=
"income"
column=
"flag"
jdbcType=
"VARCHAR"
/>
</resultMap>
<select
id=
"selectAll"
resultType=
"com.ruoyi.system.domain.house.ContrastIncome"
>
SELECT * FROM contrast_income
</select>
<update
id=
"updateById"
>
UPDATE contrast_income
SET wg_name = #{wgName,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
principal = #{principal,jdbcType=VARCHAR},
income = #{income,jdbcType=VARCHAR}
WHERE id = #{id,jdbcType=NUMERIC}
</update>
</mapper>
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