Commit 43526442 authored by luben's avatar luben

Merge branch 'refs/heads/dev' into dev-lb

parents 78cf6847 b5075374
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();
}
}
package com.ruoyi.web.controller.house;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.mapper.house.BusinessEntityInfoMapper;
import com.ruoyi.system.mapper.house.HouseResourceBusinessEntityInfoMappingMapper;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/api/houseResourceBusinessEntityInfoMapping")
public class HouseResourceBusinessEntityInfoMappingController {
private final HouseResourceBusinessEntityInfoMappingMapper houseResourceBusinessEntityInfoMappingMapper;
private final BusinessEntityInfoMapper businessEntityInfoMapper;
public HouseResourceBusinessEntityInfoMappingController(HouseResourceBusinessEntityInfoMappingMapper houseResourceBusinessEntityInfoMappingMapper, BusinessEntityInfoMapper businessEntityInfoMapper) {
this.houseResourceBusinessEntityInfoMappingMapper = houseResourceBusinessEntityInfoMappingMapper;
this.businessEntityInfoMapper = businessEntityInfoMapper;
}
@PostMapping("/start")
@Transactional(rollbackFor = Exception.class)
public AjaxResult start() {
// List<BusinessEntityInfo> businessEntityInfos = businessEntityInfoMapper.selectAllBusinessEntityInfos();
// Map<String, List<BusinessEntityInfo>> group = businessEntityInfos.stream().collect(Collectors.groupingBy(BusinessEntityInfo::getHouseResourceId));
// group.forEach((houseResourceId, businessEntityInfoList) -> {
// System.out.println("当前处理houseId = " + houseResourceId);
// if (!CollectionUtils.isEmpty(businessEntityInfoList)) {
// for (BusinessEntityInfo businessEntityInfo : businessEntityInfoList) {
// HouseResourceBusinessEntityInfoMapping houseResourceBusinessEntityInfoMapping = new HouseResourceBusinessEntityInfoMapping();
// houseResourceBusinessEntityInfoMapping.setId(UUID.randomUUID().toString().replaceAll("-", ""));
// houseResourceBusinessEntityInfoMapping.setHouseResourceId(houseResourceId);
// houseResourceBusinessEntityInfoMapping.setBusinessEntityInfoId(businessEntityInfo.getId());
// houseResourceBusinessEntityInfoMappingMapper.insert(houseResourceBusinessEntityInfoMapping);
// }
// }
// });
System.out.println("数据处理完成");
return AjaxResult.success();
}
}
......@@ -31,8 +31,8 @@ public class HouseResourceController {
}
@GetMapping
public AjaxResult queryHouseResourceById(@RequestParam String id) {
return AjaxResult.success(houseResourceService.queryHouseResourceById(id));
public AjaxResult getHouseResourceById(@RequestParam String id) {
return AjaxResult.success(houseResourceService.detail(id));
}
// @PreAuthorize("@ss.hasPermi('system:house:edit')")
......@@ -63,8 +63,8 @@ public class HouseResourceController {
return AjaxResult.success(houseResourceService.pageHouseResources(query));
}
@GetMapping("/profileGraph")
public AjaxResult getProfileGraphHouseResources(HouseResourcePageQuery query) {
@PostMapping("/profileGraph")
public AjaxResult getProfileGraphHouseResources(@RequestBody HouseResourcePageQuery query) {
return AjaxResult.success(houseResourceService.profileGraphHouseResources(query));
}
......@@ -78,8 +78,8 @@ public class HouseResourceController {
return AjaxResult.success(houseResourceService.listHouseResources(query));
}
@GetMapping("/businessEntityStatistics")
public AjaxResult getBusinessEntityStatistics(HouseResourcePageQuery query) {
@PostMapping("/businessEntityStatistics")
public AjaxResult getBusinessEntityStatistics(@RequestBody HouseResourcePageQuery query) {
return AjaxResult.success(houseResourceService.businessEntityStatistics(query));
}
......@@ -106,4 +106,9 @@ public class HouseResourceController {
ExcelUtil<HouseResourceExport> util = new ExcelUtil<>(HouseResourceExport.class);
util.exportExcel(response, exportList, "房源数据");
}
@GetMapping("/businessEntityInfo")
public AjaxResult getBusinessEntityInfo(@RequestParam("name") String name) {
return AjaxResult.success(houseResourceService.listByBusinessEntityInfoName(name));
}
}
......@@ -9,8 +9,6 @@ public class BusinessEntityInfo implements Serializable {
private String id;
private String houseResourceId;
private String name;
private String nature;
......@@ -32,4 +30,6 @@ public class BusinessEntityInfo implements Serializable {
private Boolean gs;
private Boolean registrationPlaceFlag;
private boolean associationBusinessEntityFlag;
}
......@@ -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 + '\'' +
'}';
}
}
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;
}
package com.ruoyi.system.domain.house;
import lombok.Data;
@Data
public class HouseResourceBusinessEntityInfoMapping {
private String id;
private String houseResourceId;
private String businessEntityInfoId;
}
......@@ -32,7 +32,11 @@ public class BusinessEntityDto {
private Boolean gs;
private List<BusinessEntitySell> businessEntitySells;
private Boolean registrationPlaceFlag;
private boolean associationBusinessEntityFlag;
private List<HouseResourcePage> houseResources;
private List<BusinessEntitySell> businessEntitySells;
}
......@@ -83,4 +83,10 @@ public class HouseResourceExport {
@Excel(name = "2025营收")
private BigDecimal YearSell2025;
@Excel(name = "经营(办公)场所图片")
private String houseResourceUrl;
@Excel(name = "营业执照图片")
private String businessLicenseUrl;
}
......@@ -114,6 +114,8 @@ public class HouseResourcePage {
private String businessEntityInfoName;
private String name;
private String principal;
private String principalTel;
......
......@@ -24,13 +24,15 @@ public class HouseResourcePageQuery extends PageDomain {
private Integer wgType;
private List<Integer> wgTypes;
private Integer hireStatus;
private String houseNumber;
private BigDecimal houseAreaMin = BigDecimal.ZERO;
private BigDecimal houseAreaMin;
private BigDecimal houseAreaMax = new BigDecimal(9999999);
private BigDecimal houseAreaMax;
private Integer houseResourceType;
......@@ -56,6 +58,8 @@ public class HouseResourcePageQuery extends PageDomain {
private boolean zyzyFlag;
private boolean sbFlag;
private String fourOrHouseNumber;
private BigDecimal dayPriceMin;
......@@ -70,7 +74,7 @@ public class HouseResourcePageQuery extends PageDomain {
private BigDecimal unitPriceMax;
private Boolean gsFlag;
private Integer gsFlag;
private String industryClassification;
......@@ -80,6 +84,26 @@ public class HouseResourcePageQuery extends PageDomain {
private Integer registrationPlaceFlag;
private String address;
private String ownership;
private String houseResourceEquityTel;
private String principal;
private String principalTel;
private String business;
private Integer workerNumberMin;
private Integer workerNumberMax;
private String registeredAddress;
private String nature;
private List<AiQuery> aiQueries;
@Data
......
......@@ -23,11 +23,7 @@ public interface BusinessEntityInfoMapper {
// 查询所有业务实体信息
List<BusinessEntityInfo> selectAllBusinessEntityInfos();
void deleteByHouseResourceId(@Param("houseResourceId") String houseResourceId);
List<BusinessEntityInfo> selectByName(@Param("name") String name);
List<BusinessEntityInfo> selectAllBusinessEntityInfosByHouseResourceId(@Param("houseResourceId") String houseResourceId);
List<BusinessEntityInfo> selectAllBusinessEntityInfosByHouseResourceIds(@Param("houseResourceIds") List<String> houseResourceIds);
BigDecimal selectYearSellByHouseResourceId(@Param("houseResourceId") String houseResourceId);
List<BusinessEntityInfo> selectByIdList(@Param("idList") List<String> idList);
}
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);
}
package com.ruoyi.system.mapper.house;
import com.ruoyi.system.domain.house.HouseResourceBusinessEntityInfoMapping;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface HouseResourceBusinessEntityInfoMappingMapper {
void insert(HouseResourceBusinessEntityInfoMapping houseResourceBusinessEntityInfoMapping);
void deleteByHouseResourceIdBusinessEntityInfoId(String houseResourceId, String businessEntityInfoId);
void deleteByHouseResourceId(String houseResourceId);
List<HouseResourceBusinessEntityInfoMapping> selectByBusinessEntityInfoId(String businessEntityInfoId);
List<HouseResourceBusinessEntityInfoMapping> selectByHouseResourceId(String houseResourceId);
List<HouseResourceBusinessEntityInfoMapping> selectByHouseResourceIds(@Param("houseResourceIds") List<String> houseResourceIds);
}
......@@ -33,4 +33,6 @@ public interface HouseResourceMapper {
List<HouseResource> selectPageBusinessEntityStatistics();
List<HouseResourcePage> selectForContrast(@Param("two") String two, @Param("name") String name);
List<HouseResourcePage> selectByIdList(@Param("idList") List<String> idList);
}
......@@ -10,7 +10,7 @@ public interface HouseResourceService {
void saveHouseResource(HouseResourceSaveUpdateDto dto);
HouseResourceDetail queryHouseResourceById(String id);
HouseResourceDetail detail(String id);
void updateHouseResource(HouseResourceSaveUpdateDto dto);
......@@ -33,4 +33,6 @@ public interface HouseResourceService {
PageBusinessEntityStatisticsDetail pageBusinessEntityStatistics(PageBusinessEntityStatisticsQuery query);
void saveYearTax(YearTaxSaveUpdateDto dto);
List<BusinessEntityDto> listByBusinessEntityInfoName(String name);
}
......@@ -3,7 +3,6 @@
<mapper namespace="com.ruoyi.system.mapper.house.BusinessEntityInfoMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.system.domain.house.BusinessEntityInfo">
<id column="id" property="id" jdbcType="VARCHAR"/>
<result column="house_resource_id" property="houseResourceId" jdbcType="VARCHAR"/>
<result column="name" property="name" jdbcType="VARCHAR"/>
<result column="nature" property="nature" jdbcType="VARCHAR"/>
<result column="social_credit_code" property="socialCreditCode" jdbcType="VARCHAR"/>
......@@ -15,15 +14,16 @@
<result column="industry_classification" property="industryClassification" jdbcType="VARCHAR"/>
<result property="gs" column="gs" jdbcType="BIT"/>
<result property="registrationPlaceFlag" column="registration_place_flag" jdbcType="INTEGER"/>
<result property="associationBusinessEntityFlag" column="association_business_entity_flag" jdbcType="INTEGER"/>
</resultMap>
<insert id="insertBusinessEntityInfo" parameterType="com.ruoyi.system.domain.house.BusinessEntityInfo">
INSERT INTO business_entity_info (
id, house_resource_id, name, nature, social_credit_code,
principal, principal_tel, business, worker_number, registered_address, industry_classification, gs, registration_place_flag
id, name, nature, social_credit_code,
principal, principal_tel, business, worker_number, registered_address, industry_classification, gs, registration_place_flag, association_business_entity_flag
) VALUES (
#{id}, #{houseResourceId}, #{name}, #{nature}, #{socialCreditCode},
#{principal}, #{principalTel}, #{business}, #{workerNumber}, #{registeredAddress}, #{industryClassification}, #{gs}, #{registrationPlaceFlag}
#{id}, #{name}, #{nature}, #{socialCreditCode},
#{principal}, #{principalTel}, #{business}, #{workerNumber}, #{registeredAddress}, #{industryClassification}, #{gs}, #{registrationPlaceFlag}, #{associationBusinessEntityFlag}
)
</insert>
......@@ -34,7 +34,6 @@
<update id="updateBusinessEntityInfo" parameterType="com.ruoyi.system.domain.house.BusinessEntityInfo">
UPDATE business_entity_info
<set>
<if test="houseResourceId != null">house_resource_id=#{houseResourceId},</if>
<if test="name != null">name=#{name},</if>
<if test="nature != null">nature=#{nature},</if>
<if test="socialCreditCode != null">social_credit_code=#{socialCreditCode},</if>
......@@ -46,6 +45,7 @@
<if test="industryClassification != null">industry_classification=#{industryClassification},</if>
<if test="gs != null">gs=#{gs},</if>
<if test="registrationPlaceFlag != null">registration_place_flag=#{registrationPlaceFlag},</if>
<if test="associationBusinessEntityFlag != null">association_business_entity_flag=#{associationBusinessEntityFlag},</if>
</set>
WHERE id=#{id}
</update>
......@@ -57,26 +57,19 @@
<select id="selectAllBusinessEntityInfos" resultMap="BaseResultMap">
SELECT * FROM business_entity_info
</select>
<delete id="deleteByHouseResourceId">
DELETE FROM business_entity_info WHERE house_resource_id = #{houseResourceId}
</delete>
<select id="selectAllBusinessEntityInfosByHouseResourceId"
resultType="com.ruoyi.system.domain.house.BusinessEntityInfo">
SELECT * FROM business_entity_info WHERE house_resource_id = #{houseResourceId}
</select>
<select id="selectAllBusinessEntityInfosByHouseResourceIds"
resultType="com.ruoyi.system.domain.house.BusinessEntityInfo">
SELECT * FROM business_entity_info WHERE house_resource_id in <foreach collection="houseResourceIds" item="houseResourceId" open="(" close=")" separator=",">#{houseResourceId}</foreach>
</select>
<select id="selectYearSellByHouseResourceId" resultType="java.math.BigDecimal">
<select id="selectByName" resultType="com.ruoyi.system.domain.house.BusinessEntityInfo">
SELECT
IFNULL(SUM(t2.year_sell), 0)
t3.*
FROM
business_entity_info t1
LEFT JOIN business_entity_sell t2 ON t1.id = t2.business_entity_info_id
WHERE
t1.house_resource_id = #{houseResourceId}
house_resource t1
LEFT JOIN house_resource_business_entity_info_mapping t2 ON t1.id = t2.house_resource_id
LEFT JOIN business_entity_info t3 ON t2.business_entity_info_id = t3.id
WHERE t3.name like concat('%', #{name}, '%')
</select>
<select id="selectByIdList" resultType="com.ruoyi.system.domain.house.BusinessEntityInfo">
SELECT * FROM business_entity_info WHERE id IN
<foreach item="item" index="index" collection="idList" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>
<?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>
<?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.HouseResourceBusinessEntityInfoMappingMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.system.domain.house.HouseResourceBusinessEntityInfoMapping">
<id property="houseResourceId" column="house_resource_id" jdbcType="VARCHAR"/>
<id property="businessEntityInfoId" column="business_entity_info_id" jdbcType="VARCHAR"/>
</resultMap>
<insert id="insert">
INSERT INTO house_resource_business_entity_info_mapping
(id, house_resource_id, business_entity_info_id)
VALUES
(#{id,jdbcType=VARCHAR}, #{houseResourceId,jdbcType=VARCHAR}, #{businessEntityInfoId,jdbcType=VARCHAR})
</insert>
<delete id="deleteByHouseResourceIdBusinessEntityInfoId">
DELETE FROM house_resource_business_entity_info_mapping
WHERE house_resource_id = #{houseResourceId,jdbcType=VARCHAR}
AND business_entity_info_id = #{businessEntityInfoId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByHouseResourceId">
DELETE FROM house_resource_business_entity_info_mapping
WHERE house_resource_id = #{houseResourceId,jdbcType=VARCHAR}
</delete>
<select id="selectByBusinessEntityInfoId"
resultType="com.ruoyi.system.domain.house.HouseResourceBusinessEntityInfoMapping">
SELECT * FROM house_resource_business_entity_info_mapping WHERE business_entity_info_id = #{businessEntityInfoId,jdbcType=VARCHAR}
</select>
<select id="selectByHouseResourceId"
resultType="com.ruoyi.system.domain.house.HouseResourceBusinessEntityInfoMapping">
SELECT * FROM house_resource_business_entity_info_mapping WHERE house_resource_id = #{houseResourceId,jdbcType=VARCHAR}
</select>
<select id="selectByHouseResourceIds"
resultType="com.ruoyi.system.domain.house.HouseResourceBusinessEntityInfoMapping">
SELECT * FROM house_resource_business_entity_info_mapping WHERE house_resource_id IN
<foreach item="item" index="index" collection="houseResourceIds" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment