mitao
3 天以前 dfe379f10f5d16a3b34b33f260d3a7ca97c7fdc6
Merge remote-tracking branch 'origin/master'

# Conflicts:
# ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DrDisplacementController.java
# ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DrResettlementController.java
# ruoyi-system/src/main/java/com/ruoyi/system/mapper/DrDisplacementHouseMapper.java
# ruoyi-system/src/main/java/com/ruoyi/system/mapper/DrDisplacementMapper.java
# ruoyi-system/src/main/java/com/ruoyi/system/mapper/DrDisplacementReturnHouseMapper.java
# ruoyi-system/src/main/java/com/ruoyi/system/mapper/DrResettlementMapper.java
# ruoyi-system/src/main/java/com/ruoyi/system/mapper/LandAcquiringMapper.java
# ruoyi-system/src/main/java/com/ruoyi/system/mapper/LandCertifiedMapper.java
# ruoyi-system/src/main/java/com/ruoyi/system/mapper/LandReportedMapper.java
# ruoyi-system/src/main/java/com/ruoyi/system/mapper/LandReservedMapper.java
# ruoyi-system/src/main/java/com/ruoyi/system/model/DrDisplacement.java
# ruoyi-system/src/main/java/com/ruoyi/system/model/DrDisplacementHouse.java
# ruoyi-system/src/main/java/com/ruoyi/system/model/DrDisplacementReturnHouse.java
# ruoyi-system/src/main/java/com/ruoyi/system/model/DrResettlement.java
# ruoyi-system/src/main/java/com/ruoyi/system/model/LandAcquiring.java
# ruoyi-system/src/main/java/com/ruoyi/system/model/LandCertified.java
# ruoyi-system/src/main/java/com/ruoyi/system/model/LandReported.java
# ruoyi-system/src/main/java/com/ruoyi/system/model/LandReserved.java
# ruoyi-system/src/main/java/com/ruoyi/system/service/DrDisplacementHouseService.java
# ruoyi-system/src/main/java/com/ruoyi/system/service/DrDisplacementReturnHouseService.java
# ruoyi-system/src/main/java/com/ruoyi/system/service/DrDisplacementService.java
# ruoyi-system/src/main/java/com/ruoyi/system/service/DrResettlementService.java
# ruoyi-system/src/main/java/com/ruoyi/system/service/LandAcquiringService.java
# ruoyi-system/src/main/java/com/ruoyi/system/service/LandCertifiedService.java
# ruoyi-system/src/main/java/com/ruoyi/system/service/LandReportedService.java
# ruoyi-system/src/main/java/com/ruoyi/system/service/LandReservedService.java
# ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DrDisplacementHouseServiceImpl.java
# ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DrDisplacementReturnHouseServiceImpl.java
# ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DrDisplacementServiceImpl.java
# ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DrResettlementServiceImpl.java
# ruoyi-system/src/main/java/com/ruoyi/system/service/impl/LandAcquiringServiceImpl.java
# ruoyi-system/src/main/java/com/ruoyi/system/service/impl/LandCertifiedServiceImpl.java
# ruoyi-system/src/main/java/com/ruoyi/system/service/impl/LandReportedServiceImpl.java
# ruoyi-system/src/main/java/com/ruoyi/system/service/impl/LandReservedServiceImpl.java
# ruoyi-system/src/main/resources/mapper/system/DrDisplacementHouseMapper.xml
# ruoyi-system/src/main/resources/mapper/system/DrDisplacementMapper.xml
# ruoyi-system/src/main/resources/mapper/system/DrDisplacementReturnHouseMapper.xml
# ruoyi-system/src/main/resources/mapper/system/DrResettlementMapper.xml
# ruoyi-system/src/main/resources/mapper/system/LandAcquiringMapper.xml
# ruoyi-system/src/main/resources/mapper/system/LandCertifiedMapper.xml
# ruoyi-system/src/main/resources/mapper/system/LandReportedMapper.xml
# ruoyi-system/src/main/resources/mapper/system/LandReservedMapper.xml
22个文件已修改
14个文件已添加
897 ■■■■■ 已修改文件
generator/src/test/java/com/xizang/CodeGeneratorTests.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/CaseMainController.java 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/CaseTypeController.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DrDisplacementController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DrDisplacementHouseController.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DrDisplacementReturnHouseController.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/LandAcquiringController.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/LandCertifiedController.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/LandReportedController.java 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/LandReservedController.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/ProjectInventoryController.java 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/CaseMainMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/CaseTypeMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/ProjectInventoryMapper.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/model/CaseMain.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/model/CaseMainFile.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/model/ContractTemplate.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/model/ContractTemplateType.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/model/ProjectStorageItem.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/query/CaseMainListQuery.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/query/CaseTypeListQuery.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/query/InventoryStorageListQuery.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/query/LandReportedListQuery.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/CaseMainService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/CaseTypeService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/ProjectInventoryService.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CaseMainServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CaseTypeServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ProjectInventoryServiceImpl.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/vo/InStorageListVO.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/vo/InventoryStorageListVO.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/vo/MonthStorageListVO.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/vo/OutStorageListVO.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/CaseMainMapper.xml 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/CaseTypeMapper.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/ProjectInventoryMapper.xml 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
generator/src/test/java/com/xizang/CodeGeneratorTests.java
@@ -25,7 +25,7 @@
    private static final String DRIVER_NAME = "com.mysql.cj.jdbc.Driver";
    private static final String JDBC_URL = "jdbc:mysql://192.168.110.188:3307/shehong_intelligent_platform?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai";
    private static final String JDBC_URL = "jdbc:mysql://192.168.110.188:3307/shehong_intelligent_platform_p2?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai";
    private static final String USER_NAME = "root_remote";
    private static final String PASSWORD = "123456";
@@ -149,7 +149,7 @@
//         strategy.setTablePrefix(pc.getModuleName() + "");
//        strategy.setLikeTable(new LikeTable("room"));
        //strategy.setLikeTable(new LikeTable("member"));
        strategy.setLikeTable(new LikeTable("asset_"));// 生成表名
        strategy.setLikeTable(new LikeTable("year_"));// 生成表名
//        strategy.setLikeTable(new LikeTable("oa_"));// 生成表名
//        strategy.setLikeTable(new LikeTable("t_hotel"));// 生成表名
//        strategy.setLikeTable(new LikeTable("t_scan_message"));// 生成表名
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/CaseMainController.java
@@ -1,8 +1,31 @@
package com.ruoyi.web.controller.api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.model.CaseMain;
import com.ruoyi.system.model.CaseMainFile;
import com.ruoyi.system.model.CaseType;
import com.ruoyi.system.query.CaseMainListQuery;
import com.ruoyi.system.query.CaseTypeListQuery;
import com.ruoyi.system.service.CaseMainFileService;
import com.ruoyi.system.service.CaseMainService;
import com.ruoyi.system.service.CaseTypeService;
import com.ruoyi.system.service.ISysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;
/**
 * <p>
@@ -13,8 +36,70 @@
 * @since 2025-10-16
 */
@RestController
@Api(tags = "案件管理")
@RequestMapping("/case-main")
public class CaseMainController {
    @Resource
    private CaseTypeService caseTypeService;
    @Resource
    private CaseMainService caseMainService;
    @Resource
    private CaseMainFileService caseMainFileService;
    @Resource
    private TokenService tokenService;
    @Resource
    private ISysUserService sysUserService;
    @ApiOperation(value = "案件分类不分页列表")
    @PostMapping(value = "/listType")
    public R<List<CaseType>> listType() {
        return R.ok(caseTypeService.list());
    }
    @ApiOperation(value = "案件分页列表")
    @PostMapping(value = "/pageList")
    public R<PageInfo<CaseMain>> pageList(@RequestBody CaseMainListQuery query) {
        return R.ok(caseMainService.pageList(query));
    }
    @ApiOperation(value = "添加")
    @Transactional
    @Log(title = "案件-添加", businessType = BusinessType.INSERT)
    @PostMapping(value = "/add")
    public R<Boolean> save(@RequestBody CaseMain entity) {
        entity.setUpdateTime(LocalDateTime.now());
        Long userId = tokenService.getLoginUser().getUserId();
        SysUser sysUser = sysUserService.selectUserById(userId);
        entity.setUpdateBy(sysUser.getNickName());
        caseMainService.save(entity);
        List<CaseMainFile> list = entity.getList();
        for (CaseMainFile caseMainFile : list) {
            caseMainFile.setCaseId(entity.getId());
        }
        caseMainFileService.saveBatch(list);
        return R.ok();
    }
    @ApiOperation(value = "修改")
    @Transactional
    @Log(title = "案件-修改", businessType = BusinessType.UPDATE)
    @PostMapping(value = "/edit")
    public R<Boolean> edit(@RequestBody CaseMain entity) {
        caseMainService.updateById(entity);
        caseMainFileService.remove(new LambdaQueryWrapper<CaseMainFile>()
                .eq(CaseMainFile::getCaseId, entity.getId()));
        List<CaseMainFile> list = entity.getList();
        for (CaseMainFile caseMainFile : list) {
            caseMainFile.setCaseId(entity.getId());
        }
        caseMainFileService.saveBatch(list);
        return R.ok();
    }
    @Log(title = "案件-删除", businessType = BusinessType.DELETE)
    @Transactional
    @ApiOperation(value = "案件-删除")
    @DeleteMapping(value = "/delete")
    public R delete(@RequestParam String ids) {
        caseMainService.removeBatchByIds(Arrays.asList(ids.split(",")));
        caseMainFileService.remove(new LambdaQueryWrapper<CaseMainFile>()
                .in(CaseMainFile::getCaseId, Arrays.asList(ids.split(","))));
        return R.ok();
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/CaseTypeController.java
@@ -1,8 +1,22 @@
package com.ruoyi.web.controller.api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.model.CaseType;
import com.ruoyi.system.model.ContractTemplateType;
import com.ruoyi.system.query.CaseTypeListQuery;
import com.ruoyi.system.query.ContractTemplateTypeListQuery;
import com.ruoyi.system.service.CaseTypeService;
import com.ruoyi.system.service.ContractTemplateTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Arrays;
/**
 * <p>
@@ -14,7 +28,34 @@
 */
@RestController
@RequestMapping("/case-type")
@Api(tags = "案件分类")
public class CaseTypeController {
    @Resource
    private CaseTypeService caseTypeService;
    @ApiOperation(value = "案件分类分页列表")
    @PostMapping(value = "/pageList")
    public R<PageInfo<CaseType>> pageList(@RequestBody CaseTypeListQuery query) {
        return R.ok(caseTypeService.pageList(query));
    }
    @ApiOperation(value = "添加")
    @Log(title = "案件分类-添加", businessType = BusinessType.INSERT)
    @PostMapping(value = "/add")
    public R<Boolean> save(@RequestBody CaseType entity) {
        return R.ok(caseTypeService.save(entity));
    }
    @ApiOperation(value = "修改")
    @Log(title = "案件分类-修改", businessType = BusinessType.UPDATE)
    @PostMapping(value = "/edit")
    public R<Boolean> edit(@RequestBody CaseType entity) {
        return R.ok(caseTypeService.updateById(entity));
    }
    @Log(title = "案件分类-删除", businessType = BusinessType.DELETE)
    @ApiOperation(value = "案件分类-删除")
    @DeleteMapping(value = "/delete")
    public R delete(@RequestParam String ids) {
        caseTypeService.removeBatchByIds(Arrays.asList(ids.split(",")));
        return R.ok();
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DrDisplacementController.java
@@ -2,7 +2,10 @@
import org.springframework.web.bind.annotation.RequestMapping;
<<<<<<< HEAD
=======
>>>>>>> origin/master
import org.springframework.web.bind.annotation.RestController;
/**
@@ -10,7 +13,11 @@
 * 拆迁情况 前端控制器
 * </p>
 *
<<<<<<< HEAD
 * @author mitao
=======
 * @author WuGuanFengYue
>>>>>>> origin/master
 * @since 2025-10-17
 */
@RestController
@@ -18,3 +25,7 @@
public class DrDisplacementController {
}
<<<<<<< HEAD
=======
>>>>>>> origin/master
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DrDisplacementHouseController.java
New file
@@ -0,0 +1,20 @@
package com.ruoyi.web.controller.api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * <p>
 * 拆迁情况房屋面积明细 前端控制器
 * </p>
 *
 * @author WuGuanFengYue
 * @since 2025-10-17
 */
@RestController
@RequestMapping("/dr-displacement-house")
public class DrDisplacementHouseController {
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DrDisplacementReturnHouseController.java
New file
@@ -0,0 +1,20 @@
package com.ruoyi.web.controller.api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * <p>
 * 拆迁情况房屋还房种类 前端控制器
 * </p>
 *
 * @author WuGuanFengYue
 * @since 2025-10-17
 */
@RestController
@RequestMapping("/dr-displacement-return-house")
public class DrDisplacementReturnHouseController {
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/LandAcquiringController.java
New file
@@ -0,0 +1,20 @@
package com.ruoyi.web.controller.api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * <p>
 * 下征土地 前端控制器
 * </p>
 *
 * @author WuGuanFengYue
 * @since 2025-10-17
 */
@RestController
@RequestMapping("/land-acquiring")
public class LandAcquiringController {
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/LandCertifiedController.java
New file
@@ -0,0 +1,20 @@
package com.ruoyi.web.controller.api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * <p>
 * 已办证土地 前端控制器
 * </p>
 *
 * @author WuGuanFengYue
 * @since 2025-10-17
 */
@RestController
@RequestMapping("/land-certified")
public class LandCertifiedController {
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/LandReportedController.java
New file
@@ -0,0 +1,69 @@
package com.ruoyi.web.controller.api;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.model.LandReported;
import com.ruoyi.system.model.LandReported;
import com.ruoyi.system.query.LandReportedListQuery;
import com.ruoyi.system.service.*;
import io.swagger.annotations.ApiOperation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;
/**
 * <p>
 * 已办证土地 前端控制器
 * </p>
 *
 * @author WuGuanFengYue
 * @since 2025-10-17
 */
@RestController
@RequestMapping("/land-reported")
public class LandReportedController {
    @Resource
    private LandReportedService landReportedService;
    @ApiOperation(value = "已办证土地分页列表")
    @PostMapping(value = "/pageList")
    public R<PageInfo<LandReported>> pageList(@RequestBody LandReportedListQuery query) {
//        landReportedService.pageList(query)
        return R.ok();
    }
    @ApiOperation(value = "添加")
    @Transactional
    @Log(title = "已办证土地-添加", businessType = BusinessType.INSERT)
    @PostMapping(value = "/add")
    public R<Boolean> save(@RequestBody LandReported entity) {
        landReportedService.save( entity);
        return R.ok();
    }
    @ApiOperation(value = "修改")
    @Transactional
    @Log(title = "已办证土地-修改", businessType = BusinessType.UPDATE)
    @PostMapping(value = "/edit")
    public R<Boolean> edit(@RequestBody LandReported entity) {
        landReportedService.updateById(entity);
        return R.ok();
    }
    @Log(title = "已办证土地-删除", businessType = BusinessType.DELETE)
    @Transactional
    @ApiOperation(value = "已办证土地-删除")
    @DeleteMapping(value = "/delete")
    public R delete(@RequestParam String ids) {
        landReportedService.removeBatchByIds(Arrays.asList(ids.split(",")));
        return R.ok();
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/LandReservedController.java
New file
@@ -0,0 +1,20 @@
package com.ruoyi.web.controller.api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * <p>
 * 收储土地 前端控制器
 * </p>
 *
 * @author WuGuanFengYue
 * @since 2025-10-17
 */
@RestController
@RequestMapping("/land-reserved")
public class LandReservedController {
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/ProjectInventoryController.java
@@ -1,8 +1,28 @@
package com.ruoyi.web.controller.api;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.model.*;
import com.ruoyi.system.query.InventoryStorageListQuery;
import com.ruoyi.system.query.ProjectMainListQuery;
import com.ruoyi.system.service.*;
import com.ruoyi.system.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.util.List;
/**
 * <p>
@@ -13,8 +33,72 @@
 * @since 2025-10-16
 */
@RestController
@Api(tags = "存量项目情况")
@RequestMapping("/project-inventory")
public class ProjectInventoryController {
    @Resource
    private ProjectInventoryService projectInventoryService;
    @Resource
    private ProjectStorageItemService projectStorageItemService;
    @Resource
    private ProjectStorageService projectStorageService;
    @ApiOperation(value = "获取存量项目顶部数据")
    @PostMapping(value = "/topData")
    public R<ProjectInventory> topData() {
        int year = LocalDate.now().getYear();
        List<ProjectStorageItem> projectStorageItemList = projectStorageItemService.lambdaQuery()
                .like(ProjectStorageItem::getMonth, year).list();
        List<ProjectStorage> projectStorageList = projectStorageService.lambdaQuery()
                .like(ProjectStorage::getInTime, year).list();
        BigDecimal investmentTaskFinish  = projectStorageItemList.stream().map(ProjectStorageItem::getAmount).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
        BigDecimal storageTaskFinish  = projectStorageList.stream().map(ProjectStorage::getTotalAmount).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
        List<ProjectInventory> projectInventories = projectInventoryService.list();
        if (projectInventories.isEmpty()){
            ProjectInventory projectInventory = new ProjectInventory();
            projectInventory.setInvestmentTask(BigDecimal.ZERO);
            projectInventory.setInvestmentTaskFinish(investmentTaskFinish);
            projectInventory.setInvestmentTaskRating(new BigDecimal("100"));
            projectInventory.setStorageTask(BigDecimal.ZERO);
            projectInventory.setStorageTaskFinish(storageTaskFinish);
            projectInventory.setStorageTaskRating(new BigDecimal("100"));
            projectInventoryService.save(projectInventory);
            return R.ok(projectInventory);
        }else{
            ProjectInventory projectInventory = projectInventories.get(0);
            projectInventory.setInvestmentTaskFinish(investmentTaskFinish);
            projectInventory.setInvestmentTaskRating(investmentTaskFinish.divide(projectInventory.getInvestmentTask(),2, RoundingMode.HALF_UP));
            projectInventory.setStorageTaskFinish(storageTaskFinish);
            projectInventory.setStorageTaskRating(storageTaskFinish.divide(projectInventory.getStorageTask(),2, RoundingMode.HALF_UP));
            return R.ok(projectInventory);
        }
    }
    @ApiOperation(value = "修改存量项目顶部数据")
    @Log(title = "修改存量项目顶部数据", businessType = BusinessType.UPDATE)
    @PostMapping(value = "/saveOrUpdate")
    public R<Boolean> saveOrUpdate(@RequestBody ProjectInventory entity) {
        projectInventoryService.updateById( entity);
        return R.ok();
    }
    @ApiOperation(value = "存量项目情况分页列表")
    @PostMapping(value = "/storagePageList")
    public R<PageInfo<InventoryStorageListVO>> storagePageList(@RequestBody InventoryStorageListQuery inventoryStorageListQuery) {
        return R.ok(projectInventoryService.storagePageList(inventoryStorageListQuery));
    }
    @ApiOperation(value = "月新增入库项目情况分页列表")
    @PostMapping(value = "/inStoragePageList")
    public R<PageInfo<InStorageListVO>> inStoragePageList(@RequestBody InventoryStorageListQuery inventoryStorageListQuery) {
        return R.ok(projectInventoryService.inStoragePageList(inventoryStorageListQuery));
    }
    @ApiOperation(value = "月新增出库项目情况分页列表")
    @PostMapping(value = "/outStoragePageList")
    public R<PageInfo<OutStorageListVO>> outStoragePageList(@RequestBody InventoryStorageListQuery inventoryStorageListQuery) {
        return R.ok(projectInventoryService.outStoragePageList(inventoryStorageListQuery));
    }
    @ApiOperation(value = "月新增出库项目情况分页列表")
    @PostMapping(value = "/outStoragePageList")
    public R<PageInfo<MonthStorageListVO>> monthStoragePageList(@RequestBody InventoryStorageListQuery inventoryStorageListQuery) {
        return R.ok(projectInventoryService.monthStoragePageList(inventoryStorageListQuery));
    }
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/CaseMainMapper.java
@@ -1,7 +1,12 @@
package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.system.model.CaseMain;
import com.ruoyi.system.query.CaseMainListQuery;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * <p>
@@ -13,4 +18,5 @@
 */
public interface CaseMainMapper extends BaseMapper<CaseMain> {
    List<CaseMain> pageList(@Param("query")CaseMainListQuery query, @Param("pageInfo")PageInfo<CaseMain> pageInfo);
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/CaseTypeMapper.java
@@ -1,7 +1,12 @@
package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.system.model.CaseType;
import com.ruoyi.system.query.CaseTypeListQuery;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * <p>
@@ -13,4 +18,5 @@
 */
public interface CaseTypeMapper extends BaseMapper<CaseType> {
    List<CaseType> pageList(@Param("query")CaseTypeListQuery query, @Param("pageInfo")PageInfo<CaseType> pageInfo);
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/ProjectInventoryMapper.java
@@ -1,7 +1,15 @@
package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.system.model.ProjectInventory;
import com.ruoyi.system.vo.InStorageListVO;
import com.ruoyi.system.vo.InventoryStorageListVO;
import com.ruoyi.system.vo.MonthStorageListVO;
import com.ruoyi.system.vo.OutStorageListVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * <p>
@@ -13,4 +21,15 @@
 */
public interface ProjectInventoryMapper extends BaseMapper<ProjectInventory> {
    /**
     * 查询存量项目情况分页列表(按年度分组)
     * @return 年度统计列表
     */
    List<InventoryStorageListVO> selectStoragePageList(@Param("pageInfo")PageInfo<InventoryStorageListVO> pageInfo);
    List<InStorageListVO> inStoragePageList(@Param("pageInfo")PageInfo<InStorageListVO> pageInfo);
    List<OutStorageListVO> outStoragePageList(@Param("pageInfo")PageInfo<OutStorageListVO> pageInfo);
    List<MonthStorageListVO> monthStoragePageList(@Param("pageInfo")PageInfo<MonthStorageListVO> pageInfo);
}
ruoyi-system/src/main/java/com/ruoyi/system/model/CaseMain.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -11,6 +12,7 @@
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
 * <p>
@@ -38,6 +40,8 @@
    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
    @ApiModelProperty(value = "创建人")
@@ -45,6 +49,7 @@
    private String createBy;
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField("update_time")
    private LocalDateTime updateTime;
@@ -68,5 +73,13 @@
    @TableField("dept_id")
    private Integer deptId;
    @ApiModelProperty(value = "附件资料")
    @TableField(exist = false)
    private List<CaseMainFile> list;
    @ApiModelProperty(value = "案件分类名称")
    @TableField(exist = false)
    private String typeName;
    @ApiModelProperty(value = "所属部门名称")
    @TableField(exist = false)
    private String deptName;
}
ruoyi-system/src/main/java/com/ruoyi/system/model/CaseMainFile.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -38,6 +39,8 @@
    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
    @ApiModelProperty(value = "创建人")
@@ -46,6 +49,8 @@
    @ApiModelProperty(value = "更新时间")
    @TableField("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;
    @ApiModelProperty(value = "更新人")
ruoyi-system/src/main/java/com/ruoyi/system/model/ContractTemplate.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -46,6 +47,8 @@
    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
    @ApiModelProperty(value = "创建人")
@@ -54,6 +57,8 @@
    @ApiModelProperty(value = "更新时间")
    @TableField("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;
    @ApiModelProperty(value = "更新人")
ruoyi-system/src/main/java/com/ruoyi/system/model/ContractTemplateType.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -38,6 +39,8 @@
    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
    @ApiModelProperty(value = "创建人")
@@ -46,6 +49,8 @@
    @ApiModelProperty(value = "更新时间")
    @TableField("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;
    @ApiModelProperty(value = "更新人")
ruoyi-system/src/main/java/com/ruoyi/system/model/ProjectStorageItem.java
@@ -71,4 +71,5 @@
    private Integer projectStorageId;
}
ruoyi-system/src/main/java/com/ruoyi/system/query/CaseMainListQuery.java
New file
@@ -0,0 +1,23 @@
package com.ruoyi.system.query;
import com.ruoyi.common.core.domain.BasePage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "案件分类分页列表query")
public class CaseMainListQuery extends BasePage {
    @ApiModelProperty(value = "分类名称")
    private Integer typeId;
    @ApiModelProperty(value = "案件名称")
    private String caseName;
    @ApiModelProperty(value = "年份")
    private String caseYear;
    @ApiModelProperty(value = "更新时间开始 yyyy-MM-dd HH:mm:ss")
    private String startTime;
    @ApiModelProperty(value = "更新时间结束 yyyy-MM-dd HH:mm:ss")
    private String endTime;
}
ruoyi-system/src/main/java/com/ruoyi/system/query/CaseTypeListQuery.java
New file
@@ -0,0 +1,16 @@
package com.ruoyi.system.query;
import com.ruoyi.common.core.domain.BasePage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "案件分类类型分页列表query")
public class CaseTypeListQuery extends BasePage {
    @ApiModelProperty(value = "分类名称")
    private String typeName;
}
ruoyi-system/src/main/java/com/ruoyi/system/query/InventoryStorageListQuery.java
New file
@@ -0,0 +1,13 @@
package com.ruoyi.system.query;
import com.ruoyi.common.core.domain.BasePage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "存量项目情况分页列表query")
public class InventoryStorageListQuery extends BasePage {
}
ruoyi-system/src/main/java/com/ruoyi/system/query/LandReportedListQuery.java
New file
@@ -0,0 +1,24 @@
package com.ruoyi.system.query;
import com.ruoyi.common.core.domain.BasePage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "已办证土地分页列表query")
public class LandReportedListQuery extends BasePage {
    @ApiModelProperty(value = "地块名称")
    private String landName;
    @ApiModelProperty(value = "辖区")
    private String streetName;
    @ApiModelProperty(value = "权属人")
    private String userName;
    @ApiModelProperty(value = "证号")
    private String certificateNumber;
    @ApiModelProperty(value = "现状 0:闲置;1:出租;2:置换;3:抵押;")
    private Integer status;
}
ruoyi-system/src/main/java/com/ruoyi/system/service/CaseMainService.java
@@ -1,7 +1,10 @@
package com.ruoyi.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.system.model.CaseMain;
import com.ruoyi.system.model.CaseType;
import com.ruoyi.system.query.CaseMainListQuery;
/**
 * <p>
@@ -13,4 +16,5 @@
 */
public interface CaseMainService extends IService<CaseMain> {
    PageInfo<CaseMain> pageList(CaseMainListQuery query);
}
ruoyi-system/src/main/java/com/ruoyi/system/service/CaseTypeService.java
@@ -1,7 +1,9 @@
package com.ruoyi.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.system.model.CaseType;
import com.ruoyi.system.query.CaseTypeListQuery;
/**
 * <p>
@@ -13,4 +15,5 @@
 */
public interface CaseTypeService extends IService<CaseType> {
    PageInfo<CaseType> pageList(CaseTypeListQuery query);
}
ruoyi-system/src/main/java/com/ruoyi/system/service/ProjectInventoryService.java
@@ -1,7 +1,13 @@
package com.ruoyi.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.system.model.ProjectInventory;
import com.ruoyi.system.query.InventoryStorageListQuery;
import com.ruoyi.system.vo.InStorageListVO;
import com.ruoyi.system.vo.InventoryStorageListVO;
import com.ruoyi.system.vo.MonthStorageListVO;
import com.ruoyi.system.vo.OutStorageListVO;
/**
 * <p>
@@ -13,4 +19,16 @@
 */
public interface ProjectInventoryService extends IService<ProjectInventory> {
    /**
     * 存量项目情况分页列表(按年度分组)
     * @return 分页结果
     */
    PageInfo<InventoryStorageListVO> storagePageList(InventoryStorageListQuery inventoryStorageListQuery);
    PageInfo<InStorageListVO> inStoragePageList(InventoryStorageListQuery inventoryStorageListQuery);
    PageInfo<OutStorageListVO> outStoragePageList(InventoryStorageListQuery inventoryStorageListQuery);
    PageInfo<MonthStorageListVO> monthStoragePageList(InventoryStorageListQuery inventoryStorageListQuery);
}
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CaseMainServiceImpl.java
@@ -1,10 +1,15 @@
package com.ruoyi.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.system.mapper.CaseMainMapper;
import com.ruoyi.system.model.CaseMain;
import com.ruoyi.system.model.CaseType;
import com.ruoyi.system.query.CaseMainListQuery;
import com.ruoyi.system.service.CaseMainService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * <p>
@@ -17,4 +22,12 @@
@Service
public class CaseMainServiceImpl extends ServiceImpl<CaseMainMapper, CaseMain> implements CaseMainService {
    @Override
    public PageInfo<CaseMain> pageList(CaseMainListQuery query) {
        PageInfo<CaseMain> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize());
        List<CaseMain> list = this.baseMapper.pageList(query,pageInfo);
        pageInfo.setRecords(list);
        return pageInfo;
    }
}
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CaseTypeServiceImpl.java
@@ -1,10 +1,15 @@
package com.ruoyi.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.system.mapper.CaseTypeMapper;
import com.ruoyi.system.model.CaseType;
import com.ruoyi.system.model.ContractTemplateType;
import com.ruoyi.system.query.CaseTypeListQuery;
import com.ruoyi.system.service.CaseTypeService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * <p>
@@ -17,4 +22,12 @@
@Service
public class CaseTypeServiceImpl extends ServiceImpl<CaseTypeMapper, CaseType> implements CaseTypeService {
    @Override
    public PageInfo<CaseType> pageList(CaseTypeListQuery query) {
        PageInfo<CaseType> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize());
        List<CaseType> list = this.baseMapper.pageList(query,pageInfo);
        pageInfo.setRecords(list);
        return pageInfo;
    }
}
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ProjectInventoryServiceImpl.java
@@ -1,10 +1,15 @@
package com.ruoyi.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.system.mapper.ProjectInventoryMapper;
import com.ruoyi.system.model.ProjectInventory;
import com.ruoyi.system.query.InventoryStorageListQuery;
import com.ruoyi.system.service.ProjectInventoryService;
import com.ruoyi.system.vo.*;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * <p>
@@ -17,4 +22,35 @@
@Service
public class ProjectInventoryServiceImpl extends ServiceImpl<ProjectInventoryMapper, ProjectInventory> implements ProjectInventoryService {
    @Override
    public PageInfo<InventoryStorageListVO> storagePageList(InventoryStorageListQuery inventoryStorageListQuery) {
        PageInfo<InventoryStorageListVO> pageInfo = new PageInfo<>(inventoryStorageListQuery.getPageNum(), inventoryStorageListQuery.getPageSize());
        List<InventoryStorageListVO> list = this.baseMapper.selectStoragePageList(pageInfo);
        pageInfo.setRecords( list);
        return pageInfo;
    }
    @Override
    public PageInfo<InStorageListVO> inStoragePageList(InventoryStorageListQuery inventoryStorageListQuery) {
        PageInfo<InStorageListVO> pageInfo = new PageInfo<>(inventoryStorageListQuery.getPageNum(), inventoryStorageListQuery.getPageSize());
        List<InStorageListVO> list = this.baseMapper.inStoragePageList(pageInfo);
        pageInfo.setRecords( list);
        return pageInfo;
    }
    @Override
    public PageInfo<OutStorageListVO> outStoragePageList(InventoryStorageListQuery inventoryStorageListQuery) {
        PageInfo<OutStorageListVO> pageInfo = new PageInfo<>(inventoryStorageListQuery.getPageNum(), inventoryStorageListQuery.getPageSize());
        List<OutStorageListVO> list = this.baseMapper.outStoragePageList(pageInfo);
        pageInfo.setRecords( list);
        return pageInfo;
    }
    @Override
    public PageInfo<MonthStorageListVO> monthStoragePageList(InventoryStorageListQuery inventoryStorageListQuery) {
        PageInfo<MonthStorageListVO> pageInfo = new PageInfo<>(inventoryStorageListQuery.getPageNum(), inventoryStorageListQuery.getPageSize());
        List<MonthStorageListVO> list = this.baseMapper.monthStoragePageList(pageInfo);
        pageInfo.setRecords( list);
        return pageInfo;
    }
}
ruoyi-system/src/main/java/com/ruoyi/system/vo/InStorageListVO.java
New file
@@ -0,0 +1,20 @@
package com.ruoyi.system.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
@ApiModel(value = "存量项目情况列表返回VO")
public class InStorageListVO implements Serializable {
    @ApiModelProperty(value = "年月")
    private String year;
    @ApiModelProperty(value = "在库项目数量")
    private Integer storageCount;
    @ApiModelProperty(value = "项目总投资")
    private BigDecimal totalAmount;
}
ruoyi-system/src/main/java/com/ruoyi/system/vo/InventoryStorageListVO.java
New file
@@ -0,0 +1,27 @@
package com.ruoyi.system.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.ruoyi.system.model.ProjectMain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
@ApiModel(value = "存量项目情况列表返回VO")
public class InventoryStorageListVO implements Serializable {
    @ApiModelProperty(value = "年度")
    private String year;
    @ApiModelProperty(value = "在库项目数量")
    private Integer storageCount;
    @ApiModelProperty(value = "项目总投资")
    private BigDecimal totalAmount;
    @ApiModelProperty(value = "存量投资")
    private BigDecimal remainingAmount;
    @ApiModelProperty(value = "本年度已上报投资")
    private BigDecimal yearAmount;
    @ApiModelProperty(value = "已上报投资")
    private BigDecimal allAmount;
}
ruoyi-system/src/main/java/com/ruoyi/system/vo/MonthStorageListVO.java
New file
@@ -0,0 +1,27 @@
package com.ruoyi.system.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
@ApiModel(value = "月新增入库投资情况列表返回VO")
public class MonthStorageListVO implements Serializable {
    @ApiModelProperty(value = "年月")
    private String year;
    @ApiModelProperty(value = "在库项目数量")
    private Integer storageCount;
    @ApiModelProperty(value = "项目总投资")
    private BigDecimal totalAmount;
    @ApiModelProperty(value = "存量投资")
    private BigDecimal remainingAmount;
    @ApiModelProperty(value = "本年度已上报投资")
    private BigDecimal yearAmount;
    @ApiModelProperty(value = "本月已上报投资")
    private BigDecimal monthAmount;
    @ApiModelProperty(value = "已上报投资")
    private BigDecimal allAmount;
}
ruoyi-system/src/main/java/com/ruoyi/system/vo/OutStorageListVO.java
New file
@@ -0,0 +1,20 @@
package com.ruoyi.system.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
@ApiModel(value = "存量项目情况列表返回VO")
public class OutStorageListVO implements Serializable {
    @ApiModelProperty(value = "年月")
    private String year;
    @ApiModelProperty(value = "出库项目数量")
    private Integer storageCount;
    @ApiModelProperty(value = "项目总投资")
    private BigDecimal totalAmount;
}
ruoyi-system/src/main/resources/mapper/system/CaseMainMapper.xml
@@ -20,5 +20,31 @@
    <sql id="Base_Column_List">
        id, case_name, create_time, create_by, update_time, update_by, disabled, case_year, type_id, dept_id
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.model.CaseMain">
        select t1.*,t2.type_name as typeName,t3.dept_name as deptName from case_main t1
        left join case_type t2 on t1.type_id = t2.id
        left join sys_dept t3 on t1.dept_id = t3.dept_id
        where 1=1
        <if test="query.caseName != null and query.caseName != ''">
            and t1.case_name like concat('%',#{query.caseName},'%')
        </if>
        <if test="query.caseYear != null and query.caseYear != ''">
            and t1.case_year like concat('%',#{query.caseYear},'%')
        </if>
        <if test="query.typeId != null">
            and t1.type_id = #{query.typeId}
        </if>
        <if test="query.startTime != null and query.startTime != ''">
            and t1.update_time >= #{query.startTime}
        </if>
        <if test="query.endTime != null and query.endTime != ''">
            and t1.update_time &lt;= #{query.endTime}
        </if>
        and t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        order by t1.update_time desc
    </select>
</mapper>
ruoyi-system/src/main/resources/mapper/system/CaseTypeMapper.xml
@@ -17,5 +17,14 @@
    <sql id="Base_Column_List">
        id, type_name, create_time, create_by, update_time, update_by, disabled
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.model.CaseType">
        select * from case_type
        where 1=1
        <if test="query.typeName != null and query.typeName != ''">
            and type_name like concat('%',#{query.typeName},'%')
        </if>
        and disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        order by create_time desc
    </select>
</mapper>
ruoyi-system/src/main/resources/mapper/system/ProjectInventoryMapper.xml
@@ -23,4 +23,143 @@
        id, investment_task, investment_task_finish, investment_task_rating, create_time, create_by, update_time, update_by, disabled, storage_task, storage_task_finish, storage_task_rating
    </sql>
    <!-- 存量项目情况分页列表(按年度分组) -->
<!--    <select id="selectStoragePageList" resultType="com.ruoyi.system.vo.InventoryStorageListVO">-->
<!--        SELECT -->
<!--            YEAR(ps.in_time) AS year,-->
<!--            COUNT(ps.id) AS storageCount,-->
<!--            COALESCE(SUM(ps.total_amount), 0) AS totalAmount,-->
<!--            COALESCE(SUM(ps.total_amount) - COALESCE(SUM(all_items.amount), 0), SUM(ps.total_amount)) AS remainingAmount,-->
<!--            COALESCE(SUM(year_items.amount), 0) AS yearAmount,-->
<!--            COALESCE(SUM(all_items.amount), 0) AS allAmount-->
<!--        FROM project_storage ps-->
<!--        LEFT JOIN (-->
<!--            SELECT -->
<!--                project_storage_id,-->
<!--                SUM(amount) AS amount-->
<!--            FROM project_storage_item -->
<!--            WHERE disabled = 0-->
<!--            GROUP BY project_storage_id-->
<!--        ) all_items ON ps.id = all_items.project_storage_id-->
<!--        LEFT JOIN (-->
<!--            SELECT -->
<!--                project_storage_id,-->
<!--                SUM(amount) AS amount-->
<!--            FROM project_storage_item -->
<!--            WHERE disabled = 0 -->
<!--                AND YEAR(STR_TO_DATE(CONCAT(month, '-01'), '%Y-%m-%d')) = YEAR(CURDATE())-->
<!--            GROUP BY project_storage_id-->
<!--        ) year_items ON ps.id = year_items.project_storage_id-->
<!--        WHERE ps.disabled = 0 -->
<!--            AND ps.status = 1-->
<!--            AND ps.in_time IS NOT NULL-->
<!--        GROUP BY YEAR(ps.in_time)-->
<!--        ORDER BY YEAR(ps.in_time) DESC-->
<!--    </select>-->
    <select id="selectStoragePageList" resultType="com.ruoyi.system.vo.InventoryStorageListVO">
        SELECT
            ps_year.year,
            COUNT(ps_year.id) AS storageCount,
            COALESCE(SUM(ps_year.total_amount), 0) AS totalAmount,
            COALESCE(SUM(ps_year.total_amount) - COALESCE(SUM(all_items.amount), 0), SUM(ps_year.total_amount)) AS remainingAmount,
            COALESCE(SUM(year_items.year_amount), 0) AS yearAmount,
            COALESCE(SUM(all_items.amount), 0) AS allAmount
        FROM (
                 SELECT
                     id,
                     total_amount,
                     YEAR(in_time) as year
                 FROM project_storage
                 WHERE disabled = 0
                   AND status = 1
                   AND in_time IS NOT NULL
             ) ps_year
                 LEFT JOIN (
            SELECT
                project_storage_id,
                SUM(amount) AS amount
            FROM project_storage_item
            WHERE disabled = 0
            GROUP BY project_storage_id
        ) all_items ON ps_year.id = all_items.project_storage_id
                 LEFT JOIN (
            SELECT
                psi.project_storage_id,
                YEAR(STR_TO_DATE(CONCAT(psi.month, '-01'), '%Y-%m-%d')) as item_year,
                SUM(psi.amount) AS year_amount
            FROM project_storage_item psi
            WHERE psi.disabled = 0
            GROUP BY psi.project_storage_id, YEAR(STR_TO_DATE(CONCAT(psi.month, '-01'), '%Y-%m-%d'))
        ) year_items ON ps_year.id = year_items.project_storage_id AND ps_year.year = year_items.item_year
        GROUP BY ps_year.year
        ORDER BY ps_year.year DESC
    </select>
    <select id="inStoragePageList" resultType="com.ruoyi.system.vo.InStorageListVO">
        SELECT
            DATE_FORMAT(ps.in_time, '%Y-%m') AS year,
        COUNT(ps.id) AS storageCount,
        COALESCE(SUM(ps.total_amount), 0) AS totalAmount
        FROM project_storage ps
        WHERE ps.disabled = 0
          AND ps.status = 1
          AND ps.in_time IS NOT NULL
        GROUP BY DATE_FORMAT(ps.in_time, '%Y-%m')
        ORDER BY DATE_FORMAT(ps.in_time, '%Y-%m') DESC
    </select>
    <select id="outStoragePageList" resultType="com.ruoyi.system.vo.OutStorageListVO">
        SELECT
            DATE_FORMAT(ps.in_time, '%Y-%m') AS year,
        COUNT(ps.id) AS storageCount,
        COALESCE(SUM(ps.total_amount), 0) AS totalAmount
        FROM project_storage ps
        WHERE ps.disabled = 0
          AND ps.status = 2
          AND ps.in_time IS NOT NULL
        GROUP BY DATE_FORMAT(ps.in_time, '%Y-%m')
        ORDER BY DATE_FORMAT(ps.in_time, '%Y-%m') DESC
    </select>
    <select id="monthStoragePageList" resultType="com.ruoyi.system.vo.MonthStorageListVO">
        SELECT
            DATE_FORMAT(ps.in_time, '%Y-%m') AS year,
        COUNT(ps.id) AS storageCount,
        COALESCE(SUM(ps.total_amount), 0) AS totalAmount,
        COALESCE(SUM(ps.total_amount) - COALESCE(SUM(all_items.amount), 0), SUM(ps.total_amount)) AS remainingAmount,
        COALESCE(SUM(year_items.year_amount), 0) AS yearAmount,
        COALESCE(SUM(month_items.month_amount), 0) AS monthAmount,
        COALESCE(SUM(all_items.amount), 0) AS allAmount
        FROM project_storage ps
            LEFT JOIN (
            SELECT
            project_storage_id,
            SUM(amount) AS amount
            FROM project_storage_item
            WHERE disabled = 0
            GROUP BY project_storage_id
            ) all_items ON ps.id = all_items.project_storage_id
            LEFT JOIN (
            SELECT
            psi.project_storage_id,
            YEAR(STR_TO_DATE(CONCAT(psi.month, '-01'), '%Y-%m-%d')) as item_year,
            SUM(psi.amount) AS year_amount
            FROM project_storage_item psi
            WHERE psi.disabled = 0
            GROUP BY psi.project_storage_id, YEAR(STR_TO_DATE(CONCAT(psi.month, '-01'), '%Y-%m-%d'))
            ) year_items ON ps.id = year_items.project_storage_id
            AND YEAR(ps.in_time) = year_items.item_year
            LEFT JOIN (
            SELECT
            psi.project_storage_id,
            psi.month,
            SUM(psi.amount) AS month_amount
            FROM project_storage_item psi
            WHERE psi.disabled = 0
            GROUP BY psi.project_storage_id, psi.month
            ) month_items ON ps.id = month_items.project_storage_id
            AND DATE_FORMAT(ps.in_time, '%Y-%m') = month_items.month
        WHERE ps.disabled = 0
          AND ps.status = 1
          AND ps.in_time IS NOT NULL
        GROUP BY DATE_FORMAT(ps.in_time, '%Y-%m')
        ORDER BY DATE_FORMAT(ps.in_time, '%Y-%m') DESC
    </select>
</mapper>