数据平台接口迁移
This commit is contained in:
@ -0,0 +1,32 @@
|
||||
package com.ruoyi.project.common;
|
||||
|
||||
|
||||
public class VueSelectModel<T> {
|
||||
private String label;
|
||||
private T value;
|
||||
|
||||
public VueSelectModel() {
|
||||
|
||||
}
|
||||
|
||||
public VueSelectModel(String label, T data) {
|
||||
this.label = label;
|
||||
this.value = data;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public T getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(T value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
package com.ruoyi.project.data.basis.controller;
|
||||
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
||||
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.ruoyi.framework.web.controller.BaseController;
|
||||
import com.ruoyi.framework.web.domain.AjaxResult;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.framework.web.page.TableSupport;
|
||||
import com.ruoyi.project.data.basis.domain.LianJiaCommunityDict;
|
||||
import com.ruoyi.project.data.basis.service.ILianJiaCommunityDictService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 链家id和联城id对应关系
|
||||
* 小区名称和小区地址标准化对应关系
|
||||
* 楼栋名称和楼栋地址标准化对应关系
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/data/adrdict/lianjia")
|
||||
public class AdrDictController extends BaseController {
|
||||
@Autowired
|
||||
private ILianJiaCommunityDictService lianJiaCommunityDictService;
|
||||
|
||||
/**
|
||||
* @param lianJiaCommunityDict
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(LianJiaCommunityDict lianJiaCommunityDict) {
|
||||
int pageIndex = ServletUtils.getParameterToInt("pageIndex");
|
||||
int pageSize = ServletUtils.getParameterToInt(TableSupport.PAGE_SIZE);
|
||||
lianJiaCommunityDict.setPageIndex(pageIndex <= 1 ? 0 : (pageIndex - 1) * pageSize);
|
||||
lianJiaCommunityDict.setPageSize(pageSize);
|
||||
|
||||
int total = lianJiaCommunityDictService.selectPageOfTotal(lianJiaCommunityDict);
|
||||
List<LianJiaCommunityDict> list =
|
||||
lianJiaCommunityDictService.selectPageOfList(lianJiaCommunityDict);
|
||||
return getDataTable(list, total);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改 住宅租赁基价
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
@Log(title = "链家小区", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody LianJiaCommunityDict lianJiaCommunityDict) {
|
||||
return toAjax(lianJiaCommunityDictService.update(lianJiaCommunityDict));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增角色
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:add')")
|
||||
@Log(title = "链家小区", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody LianJiaCommunityDict lianJiaCommunityDict) {
|
||||
return toAjax(lianJiaCommunityDictService.insert(lianJiaCommunityDict));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:remove')")
|
||||
@Log(title = "链家小区", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult remove(@PathVariable Integer id) {
|
||||
return toAjax(lianJiaCommunityDictService.delete(id));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable(value = "id", required = false) Integer id) {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put(AjaxResult.DATA_TAG, lianJiaCommunityDictService.selectById(id));
|
||||
return ajax;
|
||||
}
|
||||
}
|
@ -0,0 +1,183 @@
|
||||
package com.ruoyi.project.data.basis.domain;
|
||||
|
||||
import com.ruoyi.framework.web.domain.BaseEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 链家id和联城小区、楼栋id对应关系
|
||||
*/
|
||||
public class LianJiaCommunityDict extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer pageIndex;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer pageSize;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 案例id
|
||||
*/
|
||||
private String lianJiaCommunityId;
|
||||
/**
|
||||
* 案例小区名称
|
||||
*/
|
||||
private String lianJiaCommunityName;
|
||||
/**
|
||||
* 案例小区地址
|
||||
*/
|
||||
private String lianJiaCommunityAddress;
|
||||
/**
|
||||
* 链家小区url
|
||||
*/
|
||||
private String lianJiaCommunityUrl;
|
||||
/**
|
||||
* 链家案例url
|
||||
*/
|
||||
private String lianJiaUrl;
|
||||
|
||||
/**
|
||||
* 联城小区id
|
||||
*/
|
||||
private String communityId;
|
||||
/**
|
||||
* 联城楼栋id
|
||||
*/
|
||||
private String buildingId;
|
||||
/**
|
||||
* 小区名称(不带特殊符号的)
|
||||
*/
|
||||
private String cleanCommunityName;
|
||||
/**
|
||||
* 小区地址(不带特殊符号的)
|
||||
*/
|
||||
private String cleanCommunityAddress;
|
||||
/**
|
||||
* 楼栋地址(不带特殊符号的)
|
||||
*/
|
||||
private String cleanBuildingAddress;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
private Boolean enable;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getLianJiaCommunityId() {
|
||||
return lianJiaCommunityId;
|
||||
}
|
||||
|
||||
public void setLianJiaCommunityId(String lianJiaCommunityId) {
|
||||
this.lianJiaCommunityId = lianJiaCommunityId;
|
||||
}
|
||||
|
||||
public String getLianJiaCommunityName() {
|
||||
return lianJiaCommunityName;
|
||||
}
|
||||
|
||||
public void setLianJiaCommunityName(String lianJiaCommunityName) {
|
||||
this.lianJiaCommunityName = lianJiaCommunityName;
|
||||
}
|
||||
|
||||
public String getLianJiaCommunityAddress() {
|
||||
return lianJiaCommunityAddress;
|
||||
}
|
||||
|
||||
public void setLianJiaCommunityAddress(String lianJiaCommunityAddress) {
|
||||
this.lianJiaCommunityAddress = lianJiaCommunityAddress;
|
||||
}
|
||||
|
||||
public String getLianJiaCommunityUrl() {
|
||||
return lianJiaCommunityUrl;
|
||||
}
|
||||
|
||||
public void setLianJiaCommunityUrl(String lianJiaCommunityUrl) {
|
||||
this.lianJiaCommunityUrl = lianJiaCommunityUrl;
|
||||
}
|
||||
|
||||
public String getLianJiaUrl() {
|
||||
return lianJiaUrl;
|
||||
}
|
||||
|
||||
public void setLianJiaUrl(String lianJiaUrl) {
|
||||
this.lianJiaUrl = lianJiaUrl;
|
||||
}
|
||||
|
||||
public String getCommunityId() {
|
||||
return communityId;
|
||||
}
|
||||
|
||||
public void setCommunityId(String communityId) {
|
||||
this.communityId = communityId;
|
||||
}
|
||||
|
||||
public String getBuildingId() {
|
||||
return buildingId;
|
||||
}
|
||||
|
||||
public void setBuildingId(String buildingId) {
|
||||
this.buildingId = buildingId;
|
||||
}
|
||||
|
||||
public String getCleanCommunityName() {
|
||||
return cleanCommunityName;
|
||||
}
|
||||
|
||||
public void setCleanCommunityName(String cleanCommunityName) {
|
||||
this.cleanCommunityName = cleanCommunityName;
|
||||
}
|
||||
|
||||
public String getCleanCommunityAddress() {
|
||||
return cleanCommunityAddress;
|
||||
}
|
||||
|
||||
public void setCleanCommunityAddress(String cleanCommunityAddress) {
|
||||
this.cleanCommunityAddress = cleanCommunityAddress;
|
||||
}
|
||||
|
||||
public String getCleanBuildingAddress() {
|
||||
return cleanBuildingAddress;
|
||||
}
|
||||
|
||||
public void setCleanBuildingAddress(String cleanBuildingAddress) {
|
||||
this.cleanBuildingAddress = cleanBuildingAddress;
|
||||
}
|
||||
|
||||
public Integer getPageIndex() {
|
||||
return pageIndex;
|
||||
}
|
||||
|
||||
public void setPageIndex(Integer pageIndex) {
|
||||
this.pageIndex = pageIndex;
|
||||
}
|
||||
|
||||
public Integer getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public Boolean getEnable() {
|
||||
return enable;
|
||||
}
|
||||
|
||||
public void setEnable(Boolean enable) {
|
||||
this.enable = enable;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.ruoyi.project.data.basis.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.ruoyi.project.data.basis.domain.LianJiaCommunityDict;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@DS("clean")
|
||||
public interface LianJiaCommunityDictMapper {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param dict
|
||||
* @return
|
||||
*/
|
||||
int insert(LianJiaCommunityDict dict);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param dict
|
||||
* @return
|
||||
*/
|
||||
int update(LianJiaCommunityDict dict);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
void delete(Integer id);
|
||||
|
||||
/**
|
||||
* @param dict
|
||||
* @return
|
||||
*/
|
||||
List<LianJiaCommunityDict> selectPageOfList(LianJiaCommunityDict dict);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
LianJiaCommunityDict selectById(Integer id);
|
||||
|
||||
/**
|
||||
* @param dict
|
||||
* @return
|
||||
*/
|
||||
int selectPageOfTotal(LianJiaCommunityDict dict);
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.ruoyi.project.data.basis.service;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.ruoyi.project.data.basis.domain.LianJiaCommunityDict;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ILianJiaCommunityDictService {
|
||||
|
||||
int insert(LianJiaCommunityDict dict);
|
||||
|
||||
int update(LianJiaCommunityDict dict);
|
||||
|
||||
int delete(Integer id);
|
||||
/**
|
||||
* @param dict
|
||||
* @return
|
||||
*/
|
||||
List<LianJiaCommunityDict> selectPageOfList(LianJiaCommunityDict dict);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
LianJiaCommunityDict selectById(Integer id);
|
||||
|
||||
/**
|
||||
* @param dict
|
||||
* @return
|
||||
*/
|
||||
int selectPageOfTotal(LianJiaCommunityDict dict);
|
||||
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.ruoyi.project.data.basis.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.ruoyi.project.data.basis.domain.LianJiaCommunityDict;
|
||||
import com.ruoyi.project.data.basis.mapper.LianJiaCommunityDictMapper;
|
||||
import com.ruoyi.project.data.basis.service.ILianJiaCommunityDictService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class LianJiaCommunityDictServiceImpl implements ILianJiaCommunityDictService {
|
||||
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
@Autowired
|
||||
private LianJiaCommunityDictMapper lianJiaCommunityDictMapper;
|
||||
|
||||
@Override
|
||||
public int insert(LianJiaCommunityDict dict) {
|
||||
return jdbcTemplate.update("insert into [dbo].[lianjia_dictionary]([lianjia_community_id]," +
|
||||
"[lianjia_community_name]," +
|
||||
"[lianjia_community_address],[lianjia_community_url],[lianjia_community_curl],[community_id]," +
|
||||
"[building_id],[clean_community_name],[clean_community_address],[clean_building_address],[enable]," +
|
||||
"[create_time]) value (?,?,?,?,?,?,?,?,?,?,1,getdate());", new Object[]{dict.getLianJiaCommunityId(),
|
||||
dict.getLianJiaCommunityName(), dict.getLianJiaCommunityAddress(), dict.getLianJiaUrl(),
|
||||
dict.getLianJiaCommunityUrl(), dict.getCommunityId(), dict.getBuildingId(), dict.getCleanCommunityName()
|
||||
, dict.getCleanCommunityAddress(), dict.getCleanBuildingAddress()});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(LianJiaCommunityDict dict) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(Integer id) {
|
||||
return jdbcTemplate.update("delete from lianjia_dictionary where id= ? ;", new Object[]{id});
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LianJiaCommunityDict> selectPageOfList(LianJiaCommunityDict dict) {
|
||||
return lianJiaCommunityDictMapper.selectPageOfList(dict);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int selectPageOfTotal(LianJiaCommunityDict dict) {
|
||||
return lianJiaCommunityDictMapper.selectPageOfTotal(dict);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LianJiaCommunityDict selectById(Integer id) {
|
||||
return lianJiaCommunityDictMapper.selectById(id);
|
||||
}
|
||||
}
|
@ -1,26 +1,33 @@
|
||||
package com.ruoyi.project.data.price.controller;
|
||||
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
||||
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.ruoyi.framework.config.RuoYiConfig;
|
||||
import com.ruoyi.framework.security.LoginUser;
|
||||
import com.ruoyi.framework.security.service.TokenService;
|
||||
import com.ruoyi.framework.web.controller.BaseController;
|
||||
import com.ruoyi.framework.web.domain.AjaxResult;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.framework.web.page.TableSupport;
|
||||
import com.ruoyi.project.common.VueSelectModel;
|
||||
import com.ruoyi.project.data.price.domain.ArtificialResidenceRentBasePrice;
|
||||
import com.ruoyi.project.data.price.domain.ComputeResidenceRentBasePrice;
|
||||
import com.ruoyi.project.data.price.domain.UltimateResidenceRentBasePrice;
|
||||
import com.ruoyi.project.data.price.service.IArtificialResidenceRentPriceService;
|
||||
import com.ruoyi.project.data.price.service.IComputeResidenceRentPriceService;
|
||||
import com.ruoyi.project.data.price.service.IUltimateResidenceRentBasePriceService;
|
||||
import com.ruoyi.project.system.domain.UploadFile;
|
||||
import com.ruoyi.project.system.service.IUploadFileService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@ -32,7 +39,8 @@ public class ResidenceRentBasePriceController extends BaseController {
|
||||
private IArtificialResidenceRentPriceService artificialResidenceRentPriceService;
|
||||
@Autowired
|
||||
private IUltimateResidenceRentBasePriceService ultimateResidenceRentBasePriceService;
|
||||
|
||||
@Autowired
|
||||
private IUploadFileService fileService;
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
@ -54,6 +62,16 @@ public class ResidenceRentBasePriceController extends BaseController {
|
||||
return getDataTable(list, total);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询 年月
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
@GetMapping("/compute/yearmonth")
|
||||
public AjaxResult yearMonthList() {
|
||||
List<VueSelectModel> list = computeResidenceRentPriceService.getYearMonth();
|
||||
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 住宅租赁基价详细信息
|
||||
@ -61,6 +79,7 @@ public class ResidenceRentBasePriceController extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||
@GetMapping(value = "/compute/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
|
||||
return AjaxResult.success(computeResidenceRentPriceService.selectById(id));
|
||||
}
|
||||
|
||||
@ -100,15 +119,27 @@ public class ResidenceRentBasePriceController extends BaseController {
|
||||
@Log(title = "办公基价", businessType = BusinessType.IMPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:user:import')")
|
||||
@PostMapping("/compute/importData")
|
||||
public AjaxResult importData(MultipartFile file) throws Exception {
|
||||
public AjaxResult importData(@RequestParam("id") String id, @RequestParam("module") String module,
|
||||
MultipartFile file) throws Exception {
|
||||
ExcelUtil<ComputeResidenceRentBasePrice> util = new ExcelUtil<>(ComputeResidenceRentBasePrice.class);
|
||||
List<ComputeResidenceRentBasePrice> computeResidenceRentBasePrices = util.importExcel(file.getInputStream());
|
||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
||||
String operName = loginUser.getUsername();
|
||||
String message = computeResidenceRentPriceService.batchImport(computeResidenceRentBasePrices, operName);
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
UploadFile uploadFile = new UploadFile();
|
||||
uploadFile.setFk(id);
|
||||
uploadFile.setSaveFileName(fileName);
|
||||
uploadFile.setFileName(file.getOriginalFilename());
|
||||
uploadFile.setModuleName(module);
|
||||
uploadFile.setCreateBy(operName);
|
||||
fileService.insert(uploadFile);
|
||||
|
||||
// List<ComputeResidenceRentBasePrice> computeResidenceRentBasePrices = util.importExcel(file.getInputStream());
|
||||
// String message = computeResidenceRentPriceService.batchImport(computeResidenceRentBasePrices, operName);
|
||||
return AjaxResult.success("not implement");
|
||||
}
|
||||
|
||||
/**
|
||||
* 人工修正住宅租赁
|
||||
@ -132,6 +163,9 @@ public class ResidenceRentBasePriceController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
// 文件保存
|
||||
|
||||
|
||||
/**
|
||||
* 查询 住宅租赁基价列表
|
||||
*/
|
||||
@ -150,6 +184,10 @@ public class ResidenceRentBasePriceController extends BaseController {
|
||||
return getDataTable(list, total);
|
||||
}
|
||||
|
||||
/**
|
||||
* 人工审核住宅租赁基价导入(模板)
|
||||
* 记录变化的值和变化次数
|
||||
*/
|
||||
|
||||
/**
|
||||
* 获取 住宅租赁基价详细信息
|
||||
|
@ -6,6 +6,7 @@ import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.framework.security.LoginUser;
|
||||
import com.ruoyi.framework.security.service.TokenService;
|
||||
import com.ruoyi.framework.web.page.TableSupport;
|
||||
import com.ruoyi.project.common.VueSelectModel;
|
||||
import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
|
||||
import com.ruoyi.project.data.price.service.IUltimateOfficeBasePriceService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@ -26,21 +27,21 @@ import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Controller
|
||||
* 办公基价Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-05-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/data/compute/price/office")
|
||||
public class ComputeOfficeBasePriceController extends BaseController {
|
||||
public class UltimateOfficeBasePriceController extends BaseController {
|
||||
@Autowired
|
||||
private IUltimateOfficeBasePriceService officeBasePriceUltimateService;
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
* 查询办公基价列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
@GetMapping("/list")
|
||||
@ -55,28 +56,38 @@ public class ComputeOfficeBasePriceController extends BaseController {
|
||||
return getDataTable(list, total);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询 年月
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
@GetMapping("/yearmonth")
|
||||
public AjaxResult yearMonthList() {
|
||||
List<VueSelectModel> list = officeBasePriceUltimateService.getYearMonthList();
|
||||
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取【请填写功能名称】详细信息
|
||||
* 获取办公基价详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
return AjaxResult.success(officeBasePriceUltimateService.selectOfficeBasePriceUltimateById(id));
|
||||
@GetMapping(value = "/{yearMonth}/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("yearMonth") Integer yearMonth, @PathVariable("id") Integer id) {
|
||||
return AjaxResult.success(officeBasePriceUltimateService.getById(yearMonth, id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
@Log(title = "办公基价", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody UltimateOfficeBasePrice officeBasePriceUltimate) {
|
||||
return toAjax(officeBasePriceUltimateService.updateOfficeBasePriceUltimate(officeBasePriceUltimate));
|
||||
}
|
||||
// /**
|
||||
// * 修改办公基价
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
// @Log(title = "办公基价", businessType = BusinessType.UPDATE)
|
||||
// @PutMapping
|
||||
// public AjaxResult edit(@RequestBody UltimateOfficeBasePrice officeBasePriceUltimate) {
|
||||
// return toAjax(officeBasePriceUltimateService.updateOfficeBasePriceUltimate(officeBasePriceUltimate));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 导出【请填写功能名称】列表
|
||||
* 导出办公基价列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:export')")
|
||||
@Log(title = "办公基价", businessType = BusinessType.EXPORT)
|
||||
@ -100,13 +111,14 @@ public class ComputeOfficeBasePriceController extends BaseController {
|
||||
*/
|
||||
@Log(title = "办公基价", businessType = BusinessType.IMPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:user:import')")
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file) throws Exception {
|
||||
@PostMapping("/importData/{yearMonth}")
|
||||
public AjaxResult importData(@PathVariable("yearMonth") Integer yearMonth, MultipartFile file) throws Exception {
|
||||
// 修改计价
|
||||
ExcelUtil<UltimateOfficeBasePrice> util = new ExcelUtil<>(UltimateOfficeBasePrice.class);
|
||||
List<UltimateOfficeBasePrice> officeBasePriceUltimates = util.importExcel(file.getInputStream());
|
||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
||||
String operName = loginUser.getUsername();
|
||||
String message = officeBasePriceUltimateService.batchImport(officeBasePriceUltimates, operName);
|
||||
String message = officeBasePriceUltimateService.batchImport(yearMonth, officeBasePriceUltimates, operName);
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
}
|
@ -19,9 +19,11 @@ public class UltimateOfficeBasePrice extends BaseEntity {
|
||||
private Integer pageSize;
|
||||
|
||||
@Excel(name = "ID")
|
||||
private String id;
|
||||
@JSONField(serialize = false)
|
||||
private Integer id;
|
||||
// @JSONField(serialize = false)
|
||||
private Integer yearMonth;
|
||||
@JSONField(serialize = false)
|
||||
private Integer lastYearMonth;
|
||||
@Excel(name = "楼栋ID")
|
||||
private String buildingId;
|
||||
@Excel(name = "小区ID")
|
||||
@ -83,6 +85,14 @@ public class UltimateOfficeBasePrice extends BaseEntity {
|
||||
@Excel(name = "更改价格说明")
|
||||
private String adjustPriceComment;
|
||||
|
||||
public Integer getLastYearMonth() {
|
||||
return lastYearMonth;
|
||||
}
|
||||
|
||||
public void setLastYearMonth(Integer lastYearMonth) {
|
||||
this.lastYearMonth = lastYearMonth;
|
||||
}
|
||||
|
||||
public Integer getPageIndex() {
|
||||
return pageIndex;
|
||||
}
|
||||
@ -99,11 +109,11 @@ public class UltimateOfficeBasePrice extends BaseEntity {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.ruoyi.project.data.price.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.ruoyi.project.common.VueSelectModel;
|
||||
import com.ruoyi.project.data.price.domain.ComputeResidenceRentBasePrice;
|
||||
|
||||
import java.util.List;
|
||||
@ -40,4 +41,9 @@ public interface ComputeResidenceRentPriceMapper {
|
||||
* @return
|
||||
*/
|
||||
int updateComputeResidenceRentBasePrice(ComputeResidenceRentBasePrice ComputeResidenceRentBasePrice);
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
List<VueSelectModel> yearMonthList();
|
||||
}
|
||||
|
@ -1,46 +1,77 @@
|
||||
package com.ruoyi.project.data.price.mapper;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.ruoyi.project.common.VueSelectModel;
|
||||
import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Mapper接口
|
||||
*
|
||||
* 办公基价Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-05-20
|
||||
*/
|
||||
@DS("teemlink")
|
||||
public interface UltimateOfficeBasePriceMapper
|
||||
{
|
||||
@DS("compute")
|
||||
public interface UltimateOfficeBasePriceMapper {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param yearMonth
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
UltimateOfficeBasePrice selectOfficeBasePriceUltimateById(String id);
|
||||
UltimateOfficeBasePrice getById(Integer yearMonth, Integer id);
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param officeBasePriceUltimate 【请填写功能名称】
|
||||
* @return 【请填写功能名称】集合
|
||||
* @param yearMonth
|
||||
* @param buildingId
|
||||
* @return
|
||||
*/
|
||||
List<UltimateOfficeBasePrice> selectOfficeBasePriceUltimateList(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
UltimateOfficeBasePrice getByBuildingId(Integer yearMonth, String buildingId);
|
||||
|
||||
/**
|
||||
* 查询办公基价列表
|
||||
*
|
||||
* @param officeBasePriceUltimate 办公基价
|
||||
* @return 办公基价集合
|
||||
*/
|
||||
List<UltimateOfficeBasePrice> getList(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
|
||||
/**
|
||||
* 求和
|
||||
*
|
||||
* @param officeBasePriceUltimate
|
||||
* @return
|
||||
*/
|
||||
Integer selectOfficeBasePriceUltimateListCount(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
Integer getCount(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
* @param officeBasePriceUltimate
|
||||
*
|
||||
* @param yearMonth
|
||||
* @param id
|
||||
* @param mainPrice
|
||||
* @param mainPriceRent
|
||||
* @return
|
||||
*/
|
||||
int updateOfficeBasePriceUltimate(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
int update(Integer yearMonth, Integer lastYearMonth, int id, BigDecimal mainPrice, BigDecimal mainPriceRent);
|
||||
|
||||
|
||||
/**
|
||||
* 年月
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<VueSelectModel> getYearMonthList();
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param yearMonth
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int copyCreate(Integer yearMonth, Integer id);
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ruoyi.project.data.price.service;
|
||||
|
||||
import com.ruoyi.project.common.VueSelectModel;
|
||||
import com.ruoyi.project.data.price.domain.ComputeResidenceRentBasePrice;
|
||||
import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -47,6 +48,12 @@ public interface IComputeResidenceRentPriceService {
|
||||
*/
|
||||
String batchImport(List<ComputeResidenceRentBasePrice> officeBasePriceUltimates, String operName);
|
||||
|
||||
/**
|
||||
* 获取表名
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<VueSelectModel> getYearMonth();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,11 +1,12 @@
|
||||
package com.ruoyi.project.data.price.service;
|
||||
|
||||
import com.ruoyi.project.common.VueSelectModel;
|
||||
import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service接口
|
||||
* 办公基价Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-05-20
|
||||
@ -13,19 +14,28 @@ import java.util.List;
|
||||
public interface IUltimateOfficeBasePriceService {
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
* 查询办公基价列表
|
||||
*
|
||||
* @param officeBasePriceUltimate 【请填写功能名称】
|
||||
* @return 【请填写功能名称】集合
|
||||
* @param officeBasePriceUltimate 办公基价
|
||||
* @return 办公基价集合
|
||||
*/
|
||||
List<UltimateOfficeBasePrice> selectOfficeBasePriceUltimateList(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
|
||||
int selectOfficeBasePriceUltimateListCount(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
UltimateOfficeBasePrice getById(Integer yearMonth, Integer id);
|
||||
|
||||
UltimateOfficeBasePrice selectOfficeBasePriceUltimateById(String id);
|
||||
|
||||
int updateOfficeBasePriceUltimate(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
// /**
|
||||
// *
|
||||
// * @param officeBasePriceUltimate
|
||||
// * @return
|
||||
// */
|
||||
// int updateOfficeBasePriceUltimate(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
|
||||
/**
|
||||
*
|
||||
@ -33,7 +43,13 @@ public interface IUltimateOfficeBasePriceService {
|
||||
* @param operName
|
||||
* @return
|
||||
*/
|
||||
String batchImport(List<UltimateOfficeBasePrice> officeBasePriceUltimates,String operName);
|
||||
String batchImport(Integer yearMonth, List<UltimateOfficeBasePrice> officeBasePriceUltimates,String operName);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<VueSelectModel> getYearMonthList();
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ruoyi.project.data.price.service.impl;
|
||||
|
||||
import com.ruoyi.project.common.VueSelectModel;
|
||||
import com.ruoyi.project.data.price.domain.ComputeResidenceRentBasePrice;
|
||||
import com.ruoyi.project.data.price.mapper.ComputeResidenceRentPriceMapper;
|
||||
import com.ruoyi.project.data.price.service.IComputeResidenceRentPriceService;
|
||||
@ -48,4 +49,9 @@ public class ComputeResidenceRentPriceServiceImpl implements IComputeResidenceRe
|
||||
public String batchImport(List<ComputeResidenceRentBasePrice> officeBasePriceUltimates, String operName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VueSelectModel> getYearMonth() {
|
||||
return computeResidenceRentPriceMapper.yearMonthList();
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,12 @@
|
||||
package com.ruoyi.project.data.price.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.exception.CustomException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.project.common.VueSelectModel;
|
||||
import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
|
||||
import com.ruoyi.project.data.price.mapper.UltimateOfficeBasePriceMapper;
|
||||
import com.ruoyi.project.data.price.service.IUltimateOfficeBasePriceService;
|
||||
@ -14,7 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service业务层处理
|
||||
* 办公基价Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-05-20
|
||||
@ -27,53 +30,70 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
|
||||
@Autowired
|
||||
private UltimateOfficeBasePriceMapper officeBasePriceUltimateMapper;
|
||||
|
||||
private static Integer getLastYearMonth(Integer yearMonth) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.set(yearMonth / 100, yearMonth % 100, 1);
|
||||
return new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH) - 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
* 查询办公基价列表
|
||||
*
|
||||
* @param officeBasePriceUltimate 【请填写功能名称】
|
||||
* @return 【请填写功能名称】
|
||||
* @param officeBasePriceUltimate 办公基价
|
||||
* @return 办公基价
|
||||
*/
|
||||
@Override
|
||||
public List<UltimateOfficeBasePrice> selectOfficeBasePriceUltimateList(UltimateOfficeBasePrice officeBasePriceUltimate) {
|
||||
return officeBasePriceUltimateMapper.selectOfficeBasePriceUltimateList(officeBasePriceUltimate);
|
||||
officeBasePriceUltimate.setLastYearMonth(getLastYearMonth(officeBasePriceUltimate.getYearMonth()));
|
||||
return officeBasePriceUltimateMapper.getList(officeBasePriceUltimate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int selectOfficeBasePriceUltimateListCount(UltimateOfficeBasePrice officeBasePriceUltimate) {
|
||||
return officeBasePriceUltimateMapper.selectOfficeBasePriceUltimateListCount(officeBasePriceUltimate);
|
||||
officeBasePriceUltimate.setLastYearMonth(getLastYearMonth(officeBasePriceUltimate.getYearMonth()));
|
||||
return officeBasePriceUltimateMapper.getCount(officeBasePriceUltimate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UltimateOfficeBasePrice selectOfficeBasePriceUltimateById(String id) {
|
||||
return officeBasePriceUltimateMapper.selectOfficeBasePriceUltimateById(id);
|
||||
public UltimateOfficeBasePrice getById(Integer yearMonth, Integer id) {
|
||||
return officeBasePriceUltimateMapper.getById(yearMonth, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateOfficeBasePriceUltimate(UltimateOfficeBasePrice officeBasePriceUltimate) {
|
||||
return officeBasePriceUltimateMapper.updateOfficeBasePriceUltimate(officeBasePriceUltimate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String batchImport(List<UltimateOfficeBasePrice> officeBasePriceUltimates, String operName) {
|
||||
public String batchImport(Integer yearMonth, List<UltimateOfficeBasePrice> officeBasePriceUltimates,
|
||||
String operName) {
|
||||
if (StringUtils.isNull(officeBasePriceUltimates) || officeBasePriceUltimates.size() == 0) {
|
||||
throw new CustomException("导入办公数据不能为空!");
|
||||
}
|
||||
int successNum = 0;
|
||||
int failureNum = 0;
|
||||
int insertNum = 0;
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
Integer lastYearMonth = getLastYearMonth(yearMonth);
|
||||
|
||||
for (UltimateOfficeBasePrice officeBasePriceUltimate : officeBasePriceUltimates) {
|
||||
try {
|
||||
// 验证是否存在这个用户
|
||||
UltimateOfficeBasePrice officeBasePriceUltimateInDb =
|
||||
officeBasePriceUltimateMapper.selectOfficeBasePriceUltimateById(officeBasePriceUltimate.getId());
|
||||
if (StringUtils.isNotNull(officeBasePriceUltimateInDb)) {
|
||||
this.updateOfficeBasePriceUltimate(officeBasePriceUltimate);
|
||||
successNum++;
|
||||
successMsg.append("<br/>" + successNum + "、ID= " + officeBasePriceUltimate.getId() + " 更新成功");
|
||||
officeBasePriceUltimateMapper.getById(yearMonth, officeBasePriceUltimate.getId());
|
||||
UltimateOfficeBasePrice lastUltimateOfficeBasePrice =
|
||||
officeBasePriceUltimateMapper.getByBuildingId(lastYearMonth,
|
||||
officeBasePriceUltimate.getBuildingId());
|
||||
if (!StringUtils.isNotNull(officeBasePriceUltimateInDb)) {
|
||||
if (officeBasePriceUltimateInDb.getMainPrice().subtract(officeBasePriceUltimate.getMainPrice()).compareTo(BigDecimal.ZERO) != 0
|
||||
|| officeBasePriceUltimateInDb.getMainPriceRent().subtract(officeBasePriceUltimate.getMainPriceRent()).compareTo(BigDecimal.ZERO) != 0) {
|
||||
int id = officeBasePriceUltimateMapper.copyCreate(yearMonth, officeBasePriceUltimate.getId());
|
||||
|
||||
officeBasePriceUltimateMapper.update(yearMonth, lastYearMonth, id,
|
||||
officeBasePriceUltimate.getMainPrice(),
|
||||
officeBasePriceUltimate.getMainPriceRent());
|
||||
successNum++;
|
||||
successMsg.append("<br/>" + successNum + "、ID= " + officeBasePriceUltimate.getId() + " 更新成功");
|
||||
}
|
||||
} else {
|
||||
failureNum++;
|
||||
failureMsg.append("<br/>" + failureNum + "、ID= " + officeBasePriceUltimate.getId() + " 已存在");
|
||||
failureMsg.append("<br/>" + failureNum + "、ID= " + officeBasePriceUltimate.getId() + " 失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
failureNum++;
|
||||
@ -90,4 +110,9 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
|
||||
}
|
||||
return successMsg.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VueSelectModel> getYearMonthList() {
|
||||
return officeBasePriceUltimateMapper.getYearMonthList();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,54 @@
|
||||
package com.ruoyi.project.system.domain;
|
||||
|
||||
import com.ruoyi.framework.web.domain.BaseEntity;
|
||||
import io.swagger.models.auth.In;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class UploadFile extends BaseEntity {
|
||||
private Long id;
|
||||
private String fk;
|
||||
private String moduleName;
|
||||
private String saveFileName;
|
||||
private String fileName;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getFk() {
|
||||
return fk;
|
||||
}
|
||||
|
||||
public void setFk(String fk) {
|
||||
this.fk = fk;
|
||||
}
|
||||
|
||||
public String getModuleName() {
|
||||
return moduleName;
|
||||
}
|
||||
|
||||
public void setModuleName(String moduleName) {
|
||||
this.moduleName = moduleName;
|
||||
}
|
||||
|
||||
public String getSaveFileName() {
|
||||
return saveFileName;
|
||||
}
|
||||
|
||||
public void setSaveFileName(String saveFileName) {
|
||||
this.saveFileName = saveFileName;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.ruoyi.project.system.mapper;
|
||||
|
||||
import com.ruoyi.project.system.domain.UploadFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UploadFileMapper {
|
||||
/**
|
||||
* 插入文件记录
|
||||
*
|
||||
* @param uploadFile
|
||||
* @return
|
||||
*/
|
||||
int insert(UploadFile uploadFile);
|
||||
|
||||
/**
|
||||
* 获取上传文件
|
||||
*
|
||||
* @param fk
|
||||
* @return
|
||||
*/
|
||||
List<UploadFile> getByFk(String fk);
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.ruoyi.project.system.service;
|
||||
|
||||
import com.ruoyi.project.system.domain.UploadFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 通用文件保存 业务层
|
||||
*
|
||||
* @author purple
|
||||
*/
|
||||
public interface IUploadFileService
|
||||
{
|
||||
/**
|
||||
* 记录上传文件
|
||||
* @param uploadFile
|
||||
*/
|
||||
int insert(UploadFile uploadFile);
|
||||
|
||||
/**
|
||||
* 获取文件上传
|
||||
* @param fk
|
||||
* @return
|
||||
*/
|
||||
List<UploadFile> getByFk(String fk);
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.ruoyi.project.system.service.impl;
|
||||
|
||||
import com.ruoyi.project.system.domain.*;
|
||||
import com.ruoyi.project.system.mapper.*;
|
||||
import com.ruoyi.project.system.service.IUploadFileService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户 业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class UploadFileServiceImpl implements IUploadFileService {
|
||||
private static final Logger log = LoggerFactory.getLogger(UploadFileServiceImpl.class);
|
||||
@Autowired
|
||||
private UploadFileMapper fileMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public int insert(UploadFile uploadFile) {
|
||||
return fileMapper.insert(uploadFile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UploadFile> getByFk(String fk) {
|
||||
return fileMapper.getByFk(fk);
|
||||
}
|
||||
}
|
@ -67,4 +67,9 @@ spring:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_compute
|
||||
username: sa
|
||||
password: Lcdatacenter_888
|
||||
clean:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_clean
|
||||
username: sa
|
||||
password: Lcdatacenter_888
|
128
ruoyi/src/main/resources/application-prod.yml
Normal file
128
ruoyi/src/main/resources/application-prod.yml
Normal file
@ -0,0 +1,128 @@
|
||||
# 项目相关配置
|
||||
ruoyi:
|
||||
# 名称
|
||||
name: RuoYi
|
||||
# 版本
|
||||
version: 2.2.0
|
||||
# 版权年份
|
||||
copyrightYear: 2019
|
||||
# 实例演示开关
|
||||
demoEnabled: true
|
||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
profile: /opt/uv/data/
|
||||
# 获取ip地址开关
|
||||
addressEnabled: false
|
||||
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
port: 8080
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
tomcat:
|
||||
# tomcat的URI编码
|
||||
uri-encoding: UTF-8
|
||||
# tomcat最大线程数,默认为200
|
||||
max-threads: 800
|
||||
# Tomcat启动初始化的线程数,默认值25
|
||||
min-spare-threads: 30
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
com.ruoyi: debug
|
||||
org.springframework: warn
|
||||
|
||||
# Spring配置
|
||||
spring:
|
||||
# 资源信息
|
||||
messages:
|
||||
# 国际化资源文件路径
|
||||
basename: i18n/messages
|
||||
profiles:
|
||||
active: druid
|
||||
# 文件上传
|
||||
servlet:
|
||||
multipart:
|
||||
# 单个文件大小
|
||||
max-file-size: 50MB
|
||||
# 设置总上传的文件大小
|
||||
max-request-size: 50MB
|
||||
# 服务模块
|
||||
devtools:
|
||||
restart:
|
||||
# 热部署开关
|
||||
enabled: true
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: 172.16.30.243
|
||||
# 端口,默认为6379
|
||||
port: 6030
|
||||
# 密码
|
||||
password:
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
pool:
|
||||
# 连接池中的最小空闲连接
|
||||
min-idle: 0
|
||||
# 连接池中的最大空闲连接
|
||||
max-idle: 8
|
||||
# 连接池的最大数据库连接数
|
||||
max-active: 8
|
||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
|
||||
# token配置
|
||||
token:
|
||||
# 令牌自定义标识
|
||||
header: Authorization
|
||||
# 令牌秘钥
|
||||
secret: abcdefghijklmnopqrstuvwxyz
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 30
|
||||
|
||||
# MyBatis配置
|
||||
mybatis:
|
||||
# 搜索指定包别名
|
||||
typeAliasesPackage: com.ruoyi.project.**.domain
|
||||
# 配置mapper的扫描,找到所有的mapper.xml映射文件
|
||||
mapperLocations: classpath*:mybatis/**/*Mapper.xml
|
||||
# 加载全局的配置文件
|
||||
configLocation: classpath:mybatis/mybatis-config.xml
|
||||
|
||||
# PageHelper分页插件
|
||||
pagehelper:
|
||||
helperDialect: mysql
|
||||
reasonable: true
|
||||
supportMethodsArguments: true
|
||||
params: count=countSql
|
||||
|
||||
# Swagger配置
|
||||
swagger:
|
||||
# 是否开启swagger
|
||||
enabled: true
|
||||
# 请求前缀
|
||||
pathMapping: /dev-api
|
||||
|
||||
# 防止XSS攻击
|
||||
xss:
|
||||
# 过滤开关
|
||||
enabled: true
|
||||
# 排除链接(多个用逗号分隔)
|
||||
excludes: /system/notice/*
|
||||
# 匹配链接
|
||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||
|
||||
# 代码生成
|
||||
gen:
|
||||
# 作者
|
||||
author: ruoyi
|
||||
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
|
||||
packageName: com.ruoyi.project.system
|
||||
# 自动去除表前缀,默认是true
|
||||
autoRemovePre: false
|
||||
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
|
||||
tablePrefix: sys_
|
@ -46,9 +46,9 @@ spring:
|
||||
servlet:
|
||||
multipart:
|
||||
# 单个文件大小
|
||||
max-file-size: 10MB
|
||||
max-file-size: 50MB
|
||||
# 设置总上传的文件大小
|
||||
max-request-size: 20MB
|
||||
max-request-size: 50MB
|
||||
# 服务模块
|
||||
devtools:
|
||||
restart:
|
||||
|
@ -153,7 +153,13 @@
|
||||
<include refid="selectOfficeBasePriceUltimateVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- 获取表名 -->
|
||||
<select id="yearMonthList" resultType="com.ruoyi.project.common.VueSelectModel">
|
||||
SELECT right(name,6) as value, right(name,6) as label
|
||||
FROM sys.tables
|
||||
where name like 'DWA_PROJECTBASEPRICE_RENT_IMDT_%'
|
||||
order by cast(right(name,6) as int) desc
|
||||
</select>
|
||||
|
||||
<!-- <update id="updateComputeResidenceRentBasePrice" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice">-->
|
||||
<!-- update TLK_计价办公核准基价 set ITEM_YEARMONTH=ITEM_YEARMONTH-->
|
||||
|
@ -0,0 +1,79 @@
|
||||
<?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.project.data.basis.mapper.LianJiaCommunityDictMapper">
|
||||
|
||||
<select id="selectPageOfList" resultType="com.ruoyi.project.data.basis.domain.LianJiaCommunityDict">
|
||||
SELECT id
|
||||
,lianjia_community_id AS lianJiaCommunityid
|
||||
,lianjia_community_name as lianJiaCommunityName
|
||||
,lianjia_community_address as lianJiaCommunityAddress
|
||||
,lianjia_url as lianJiaUrl
|
||||
,lianjia_community_url as lianJiaCommunityUrl
|
||||
,community_id as communityId
|
||||
,building_id as buildingId
|
||||
,clean_community_name as cleanCommunityName
|
||||
,clean_community_address as cleanCommunityAddress
|
||||
,clean_building_address as cleanBuildingAddress
|
||||
,enable
|
||||
,create_time as createTime
|
||||
FROM lianjia_dictionary
|
||||
<where>
|
||||
<if test="lianJiaCommunityId != null">
|
||||
lianjia_community_id = #{lianJiaCommunityId}
|
||||
</if>
|
||||
<if test="enable != null">
|
||||
AND enable = #{enable}
|
||||
</if>
|
||||
<if test="communityId != null">
|
||||
AND community_id = #{communityId}
|
||||
</if>
|
||||
<if test="buildingId != null">
|
||||
AND building_id = #{buildingId}
|
||||
</if>
|
||||
<if test="lianJiaUrl != null">
|
||||
AND lianjia_url = #{lianJiaUrl}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time DESC OFFSET #{pageIndex} rows fetch next #{pageSize} rows only
|
||||
</select>
|
||||
|
||||
<select id="selectPageOfTotal" resultType="int">
|
||||
select count(1) from lianjia_dictionary
|
||||
<where>
|
||||
<if test="lianJiaCommunityId != null">
|
||||
lianjia_community_id = #{lianJiaCommunityId}
|
||||
</if>
|
||||
<if test="enable != null">
|
||||
AND enable = #{enable}
|
||||
</if>
|
||||
<if test="communityId != null">
|
||||
AND community_id = #{communityId}
|
||||
</if>
|
||||
<if test="buildingId != null">
|
||||
AND building_id = #{buildingId}
|
||||
</if>
|
||||
<if test="lianJiaUrl != null">
|
||||
AND lianjia_url = #{lianJiaUrl}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectById" resultType="com.ruoyi.project.data.basis.domain.LianJiaCommunityDict">
|
||||
SELECT id
|
||||
,lianjia_community_id AS lianJiaCommunityid
|
||||
,lianjia_community_name as lianJiaCommunityName
|
||||
,lianjia_community_address as lianJiaCommunityAddress
|
||||
,lianjia_url as lianJiaUrl
|
||||
,lianjia_community_url as lianJiaCommunityUrl
|
||||
,community_id as communityId
|
||||
,building_id as buildingId
|
||||
,clean_community_name as cleanCommunityName
|
||||
,clean_community_address as cleanCommunityAddress
|
||||
,clean_building_address as cleanBuildingAddress
|
||||
,enable
|
||||
,create_time as createTime
|
||||
FROM lianjia_dictionary
|
||||
where id=#{id}
|
||||
</select>
|
||||
</mapper>
|
@ -7,79 +7,151 @@
|
||||
<resultMap type="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice"
|
||||
id="OfficeBasePriceUltimateResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="yearMonth" column="ITEM_YEARMONTH"/>
|
||||
<result property="buildingId" column="ITEM_BUILDINGID_P"/>
|
||||
<result property="communityId" column="ITEM_PROJECTID_P"/>
|
||||
<result property="mainPrice" column="ITEM_MAINPRICE"/>
|
||||
<result property="mainPriceRent" column="ITEM_MAINPRICERENT"/>
|
||||
<result property="mainPricePst" column="ITEM_MAINPRICEPST"/>
|
||||
<result property="mainPriceRentPst" column="ITEM_MAINPRICERENTPST"/>
|
||||
<result property="mainPriceType" column="ITEM_MAINPRICETYPE"/>
|
||||
<result property="mainPriceRentType" column="ITEM_MAINPRICERENTTYPE"/>
|
||||
<result property="updateDate" column="ITEM_MODIFYDATE"/>
|
||||
<result property="status" column="ITEM_STATUS"/>
|
||||
<result property="isStandardBuilding" column="ITEM_BUILDINGSTD"/>
|
||||
<result property="adjustPriceComment" column="ITEM_ADJEVD"/>
|
||||
<result property="yearMonth" column="yearMonth"/>
|
||||
<result property="buildingId" column="BuildingID_P"/>
|
||||
<result property="communityId" column="ProjectID_P"/>
|
||||
<result property="mainPrice" column="MainPrice"/>
|
||||
<result property="mainPriceRent" column="MainPriceRent"/>
|
||||
<result property="mainPricePst" column="MainPricePst"/>
|
||||
<result property="mainPriceRentPst" column="MainPriceRentPst"/>
|
||||
<result property="mainPriceType" column="MainPriceType"/>
|
||||
<result property="mainPriceRentType" column="MainPriceRentType"/>
|
||||
<result property="updateDate" column="ModifyDate"/>
|
||||
<result property="status" column="Status"/>
|
||||
<result property="isStandardBuilding" column="BuildingStd"/>
|
||||
<result property="adjustPriceComment" column="AdjEvd"/>
|
||||
<result property="areaCoefficient" column="AreaCoff"/>
|
||||
<result property="yearCoefficient" column="YearCoff"/>
|
||||
<result property="buildingCoefficient" column="BuildingCoff"/>
|
||||
|
||||
<result property="communityName" column="ProjectName"/>
|
||||
<result property="communityAddress" column="ProjectAddr"/>
|
||||
<result property="buildingAddress" column="BuildingAddr"/>
|
||||
<result property="countyName" column="County"/>
|
||||
<result property="loopName" column="Loop"/>
|
||||
<result property="blockName" column="Block"/>
|
||||
<result property="streetName" column="Street"/>
|
||||
<result property="year" column="year"/>
|
||||
<result property="avgArea" column="AvgArea"/>
|
||||
<result property="totalFloorSum" column="TotalFloorSum"/>
|
||||
<result property="upperFloorSum" column="UpperFloorSum"/>
|
||||
<result property="officeClass" column="OfficeClass"/>
|
||||
<result property="officeLevel" column="Grade"/>
|
||||
<result property="mainPrice_1" column="mainPrice_1"/>
|
||||
<result property="mainPriceRent_1" column="mainPriceRent_1"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOfficeBasePriceUltimateVo">
|
||||
select ITEM_YEARMONTH,ITEM_BUILDINGID,ITEM_UNIFIEDID,ITEM_PROJECTID,ITEM_BUILDINGID_P,ITEM_PROJECTID_P,ITEM_MAINPRICE,ITEM_MAINPRICERENT,ITEM_MAINPRICEPST,ITEM_MAINPRICERENTPST,ITEM_MAINPRICETYPE,ITEM_MAINPRICERENTTYPE,ITEM_MODIFYDATE,ITEM_STATUS,ITEM_BUILDINGSTD,ITEM_ADJEVD,ID from TLK_计价办公核准基价
|
||||
SELECT a.ID
|
||||
,a.BuildingID_P
|
||||
,a.ProjectID_P
|
||||
,a.MainPrice
|
||||
,a.MainPriceRent
|
||||
,a.MainPricePst
|
||||
,a.MainPriceRentPst
|
||||
,a.MainPriceType
|
||||
,a.MainPriceRentType
|
||||
,a.ModifyDate
|
||||
,a.Status
|
||||
,a.BuildingStd
|
||||
,a.AdjEvd
|
||||
,b.AreaCoff
|
||||
,b.YearCoff
|
||||
,b.BuildingCoff
|
||||
,b.ProjectName
|
||||
,b.ProjectAddr
|
||||
,b.BuildingAddr
|
||||
,b.County
|
||||
,b.Loop
|
||||
,b.Block
|
||||
,b.Street
|
||||
,b.Year
|
||||
,b.AvgArea
|
||||
,b.TotalFloorSum
|
||||
,b.UpperFloorSum
|
||||
,b.OfficeClass
|
||||
,b.Grade
|
||||
,c.MainPrice AS mainPrice_1
|
||||
,c.MainPriceRent as mainPriceRent_1
|
||||
, ${yearMonth} as yearMonth
|
||||
FROM ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} a
|
||||
left join DIM_OFFICE_PROJECT_BUILDING_201909 b on a.BuildingID_P=b.BuildingID_P
|
||||
left join ODS_OFFICE_BUILDING_PRICE_INFO_${lastYearMonth} c on a.BuildingID_P = c.BuildingID_P
|
||||
WHERE b.EffDate <![CDATA[ <= ]]> getdate() AND b.ExpirDate <![CDATA[ > ]]> getdate() AND A.STATUS=1 AND
|
||||
c.Status=1
|
||||
</sql>
|
||||
|
||||
<select id="selectOfficeBasePriceUltimateListCount" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice" resultType="int">
|
||||
select count(1) from TLK_计价办公核准基价
|
||||
<select id="getCount" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice" resultType="int">
|
||||
select count(1) FROM ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} a
|
||||
left join DIM_OFFICE_PROJECT_BUILDING_201909 b on a.BuildingID_P=b.BuildingID_P
|
||||
left join ODS_OFFICE_BUILDING_PRICE_INFO_${lastYearMonth} c on a.BuildingID_P = c.BuildingID_P
|
||||
WHERE b.EffDate <![CDATA[ <= ]]> getdate() AND b.ExpirDate <![CDATA[ > ]]> getdate() AND A.STATUS=1 AND
|
||||
c.Status=1
|
||||
<where>
|
||||
<if test="yearMonth != null">
|
||||
AND ITEM_YEARMONTH = #{yearMonth}
|
||||
</if>
|
||||
<if test="communityId != null">
|
||||
AND ITEM_PROJECTID_P = #{communityId}
|
||||
AND a.PROJECTID_P = #{communityId}
|
||||
</if>
|
||||
<if test="buildingId != null">
|
||||
AND ITEM_BUILDINGID_P = #{buildingId}
|
||||
AND a.BUILDINGID_P = #{buildingId}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND ITEM_STATUS = #{status}
|
||||
AND a.STATUS = #{status}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectOfficeBasePriceUltimateList" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice"
|
||||
<select id="getList" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice"
|
||||
resultMap="OfficeBasePriceUltimateResult">
|
||||
<include refid="selectOfficeBasePriceUltimateVo"/>
|
||||
<where>
|
||||
<if test="yearMonth != null">
|
||||
AND ITEM_YEARMONTH = #{yearMonth}
|
||||
</if>
|
||||
<if test="communityId != null">
|
||||
AND ITEM_PROJECTID_P = #{communityId}
|
||||
AND a.PROJECTID_P = #{communityId}
|
||||
</if>
|
||||
<if test="buildingId != null">
|
||||
AND ITEM_BUILDINGID_P = #{buildingId}
|
||||
AND a.BUILDINGID_P = #{buildingId}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND a.STATUS = #{status}
|
||||
</if>
|
||||
</where>
|
||||
order by ITEM_YEARMONTH DESC,ID DESC OFFSET #{pageIndex} rows fetch next #{pageSize} rows only;
|
||||
order by a.BUILDINGID_P ASC,a.ID DESC OFFSET #{pageIndex} rows fetch next #{pageSize} rows only;
|
||||
</select>
|
||||
|
||||
<select id="selectOfficeBasePriceUltimateById" parameterType="String" resultMap="OfficeBasePriceUltimateResult">
|
||||
<select id="getById" parameterType="String" resultMap="OfficeBasePriceUltimateResult">
|
||||
<include refid="selectOfficeBasePriceUltimateVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- <insert id="insertOfficeBasePriceUltimate" parameterType="OfficeBasePriceUltimate" useGeneratedKeys="true"-->
|
||||
<!-- keyProperty="id">-->
|
||||
<!-- insert into office_base_price_ultimate-->
|
||||
<!-- <trim prefix="(" suffix=")" suffixOverrides=",">-->
|
||||
<!-- </trim>-->
|
||||
<!-- <trim prefix="values (" suffix=")" suffixOverrides=",">-->
|
||||
<!-- </trim>-->
|
||||
<!-- </insert>-->
|
||||
|
||||
<update id="updateOfficeBasePriceUltimate" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice">
|
||||
update TLK_计价办公核准基价 set ITEM_YEARMONTH=ITEM_YEARMONTH
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
</trim>
|
||||
where id = #{id}
|
||||
<insert id="copyCreate">
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into
|
||||
dbo.ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}(BuildingID,UnifiedID,ProjectID,BuildingID_P,ProjectID_P,MainPrice,MainPriceRent,MainPricePst,MainPriceRentPst,MainPriceType,MainPriceRentType,ModifyDate,Status,BuildingStd,AdjEvd)
|
||||
select BuildingID,UnifiedID,ProjectID,BuildingID_P,ProjectID_P,MainPrice,MainPriceRent,MainPricePst,MainPriceRentPst,MainPriceType,MainPriceRentType,ModifyDate,0,BuildingStd,AdjEvd
|
||||
from ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}
|
||||
where id=#{id}
|
||||
</insert>
|
||||
<!-- 更新 -->
|
||||
<update id="update">
|
||||
update a set ModifyDate=getdate(), mainPrice=#{mainPrice}, mainPriceRent=#{mainPriceRent},
|
||||
mainPricePst = #{mainPrice} * 1.0 / b.mainPrice, mainPriceRentPst = #{mainPriceRentPst} * 1.0 / b.mainPriceRentPst
|
||||
from ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} a join ODS_OFFICE_BUILDING_PRICE_INFO_${lastYearMonth} b on
|
||||
a.BuildingID_p=b.BuildingID_P
|
||||
where a.Status=1 and b.Status=1 and a.id=#{id}
|
||||
</update>
|
||||
|
||||
<!-- 获取表名 -->
|
||||
<select id="getYearMonthList" resultType="com.ruoyi.project.common.VueSelectModel">
|
||||
SELECT right(name,6) as value, right(name,6) as label
|
||||
FROM sys.tables
|
||||
where name like 'ODS_OFFICE_BUILDING_PRICE_INFO_%'
|
||||
order by cast(right(name,6) as int) desc
|
||||
</select>
|
||||
<!-- -->
|
||||
<select id="getByBuildingId" resultType="com.ruoyi.project.data.price.controller.UltimateOfficeBasePriceController">
|
||||
select id,MainPrice,MainPriceRent
|
||||
from ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}
|
||||
where BuildingID_P=#{buildingI}
|
||||
</select>
|
||||
</mapper>
|
25
ruoyi/src/main/resources/mybatis/system/UploadFileMapper.xml
Normal file
25
ruoyi/src/main/resources/mybatis/system/UploadFileMapper.xml
Normal file
@ -0,0 +1,25 @@
|
||||
<?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.project.system.mapper.UploadFileMapper">
|
||||
|
||||
<resultMap type="SysUserRole" id="SysUserRoleResult">
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="roleId" column="role_id" />
|
||||
</resultMap>
|
||||
<insert id="insert" parameterType="com.ruoyi.project.system.domain.UploadFile">
|
||||
insert into sys_file(fk, save_file_name, file_name, module_name, create_by, create_time)
|
||||
value (#{fk},#{saveFileName},#{fileName},#{moduleName},#{createBy},now());
|
||||
</insert>
|
||||
|
||||
<delete id="delete" parameterType="Long">
|
||||
delete from sys_file where id=#{id};
|
||||
</delete>
|
||||
|
||||
<select id="getByFk" parameterType="com.ruoyi.project.system.domain.UploadFile">
|
||||
select fk, save_file_name as saveFileName, file_name as fileName, module_name as moduleName, create_by as
|
||||
createBy, create_time as createTime
|
||||
from sys_file where fk=#{fk}
|
||||
</select>
|
||||
</mapper>
|
@ -2,12 +2,11 @@ package com.uvaluation.compute;
|
||||
|
||||
import com.ruoyi.project.data.price.domain.ComputeResidenceRentBasePrice;
|
||||
import com.ruoyi.project.data.price.domain.UltimateResidenceRentBasePrice;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
public class MapperXmlGeneratorTests {
|
||||
|
||||
@ -29,4 +28,13 @@ public class MapperXmlGeneratorTests {
|
||||
}
|
||||
System.out.println(sb.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDate(){
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.set(202006 / 100, 202006 % 100, 1);
|
||||
Integer lastYearMonth = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
|
||||
calendar.get(Calendar.MONTH)-1));
|
||||
Assert.assertTrue(Objects.equals(lastYearMonth,202005));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user