mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-20 02:08:15 +08:00
优化工作流
This commit is contained in:
parent
09f0241141
commit
0f5061d549
12
pom.xml
12
pom.xml
@ -361,6 +361,17 @@
|
|||||||
<version>${ruoyi-vue-plus.version}</version>
|
<version>${ruoyi-vue-plus.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-rabbitmq</artifactId>
|
||||||
|
<version>${ruoyi-vue-plus.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-amqp</artifactId>
|
||||||
|
<version>2.7.9</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Sa-Token 插件:整合SSO -->
|
<!-- Sa-Token 插件:整合SSO -->
|
||||||
<!--<dependency>
|
<!--<dependency>
|
||||||
<groupId>cn.dev33</groupId>
|
<groupId>cn.dev33</groupId>
|
||||||
@ -409,6 +420,7 @@
|
|||||||
<module>ruoyi-work</module>
|
<module>ruoyi-work</module>
|
||||||
<module>ruoyi-file</module>
|
<module>ruoyi-file</module>
|
||||||
<module>ruoyi-rsaencrypt</module>
|
<module>ruoyi-rsaencrypt</module>
|
||||||
|
<module>ruoyi-rabbitmq</module>
|
||||||
|
|
||||||
|
|
||||||
</modules>
|
</modules>
|
||||||
|
|||||||
@ -98,6 +98,10 @@
|
|||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-rsaencrypt</artifactId>
|
<artifactId>ruoyi-rsaencrypt</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-rabbitmq</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- skywalking 整合 logback -->
|
<!-- skywalking 整合 logback -->
|
||||||
<!-- <dependency>-->
|
<!-- <dependency>-->
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import java.util.Arrays;
|
|||||||
|
|
||||||
import com.ruoyi.common.constant.Constants;
|
import com.ruoyi.common.constant.Constants;
|
||||||
import com.ruoyi.rsaencrypt.annotation.RsaSecurityParameter;
|
import com.ruoyi.rsaencrypt.annotation.RsaSecurityParameter;
|
||||||
|
import com.ruoyi.system.domain.BuyHouses;
|
||||||
import com.ruoyi.system.domain.dto.BuyHousesEvent;
|
import com.ruoyi.system.domain.dto.BuyHousesEvent;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@ -45,7 +46,6 @@ public class BuyHousesController extends BaseController {
|
|||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@RsaSecurityParameter
|
@RsaSecurityParameter
|
||||||
public TableDataInfo<BuyHousesVo> list(BuyHousesBo bo, PageQuery pageQuery) {
|
public TableDataInfo<BuyHousesVo> list(BuyHousesBo bo, PageQuery pageQuery) {
|
||||||
bo.setProcessStatus(Constants.SUCCEED);
|
|
||||||
return iBuyHousesService.queryPageList(bo, pageQuery);
|
return iBuyHousesService.queryPageList(bo, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,10 +89,9 @@ public class BuyHousesController extends BaseController {
|
|||||||
* @param id 主键
|
* @param id 主键
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:houses:query")
|
@SaCheckPermission("system:houses:query")
|
||||||
@GetMapping("/{id}")
|
@GetMapping
|
||||||
@RsaSecurityParameter
|
@RsaSecurityParameter
|
||||||
public R<BuyHousesVo> getInfo(@NotNull(message = "主键不能为空")
|
public R<BuyHousesVo> getInfo(Long id) {
|
||||||
@PathVariable Long id) {
|
|
||||||
return R.ok(iBuyHousesService.queryById(id));
|
return R.ok(iBuyHousesService.queryById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,10 +103,9 @@ public class BuyHousesController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:houses:remove")
|
@SaCheckPermission("system:houses:remove")
|
||||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
|
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping
|
||||||
@RsaSecurityParameter
|
@RsaSecurityParameter
|
||||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")Long[] ids) {
|
||||||
@PathVariable Long[] ids) {
|
|
||||||
return toAjax(iBuyHousesService.deleteWithValidByIds(Arrays.asList(ids), true));
|
return toAjax(iBuyHousesService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,5 +120,54 @@ public class BuyHousesController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消资格
|
||||||
|
* @param buyHouses
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:houses:edit")
|
||||||
|
@PutMapping
|
||||||
|
@RsaSecurityParameter(inDecode = true)
|
||||||
|
public R<?>updateBuyHouses(@RequestBody BuyHouses buyHouses){
|
||||||
|
return iBuyHousesService.updateBuyHouses(buyHouses);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页购房申请表展示
|
||||||
|
*/
|
||||||
|
@GetMapping("/indexType")
|
||||||
|
public R<?>getIndexType(){
|
||||||
|
return iBuyHousesService.getIndexType();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页企业所在地展示
|
||||||
|
*/
|
||||||
|
@GetMapping("/companyDistrict")
|
||||||
|
public R<?>getCompanyDistrict(){
|
||||||
|
return iBuyHousesService.getCompanyDistrict();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 首页国籍和婚姻状态展示
|
||||||
|
*/
|
||||||
|
@GetMapping("/nationalityAndMarital")
|
||||||
|
public R<?>getNationalityAndMarital(){
|
||||||
|
return iBuyHousesService.getNationalityAndMarital();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页第一排基础数据
|
||||||
|
*/
|
||||||
|
@GetMapping("/basicData")
|
||||||
|
public R getBasicData(){
|
||||||
|
return iBuyHousesService.getBasicData();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复审柱状图
|
||||||
|
*/
|
||||||
|
@GetMapping("/histogram")
|
||||||
|
public R getHistogram(String date){
|
||||||
|
return iBuyHousesService.getHistogram(date);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -78,8 +78,7 @@ public class HousesReviewController extends BaseController {
|
|||||||
@GetMapping("/manager/list")
|
@GetMapping("/manager/list")
|
||||||
@RsaSecurityParameter
|
@RsaSecurityParameter
|
||||||
public TableDataInfo<HousesReview> managerReviewList(HousesReviewBo bo, PageQuery pageQuery) {
|
public TableDataInfo<HousesReview> managerReviewList(HousesReviewBo bo, PageQuery pageQuery) {
|
||||||
bo.setProcessStatus(Constants.SUCCEED);
|
return iHousesReviewService.managerQueryPageList(bo, pageQuery);
|
||||||
return iHousesReviewService.queryPageList(bo, pageQuery);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -90,8 +89,7 @@ public class HousesReviewController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:houses:subscribeExport")
|
@SaCheckPermission("system:houses:subscribeExport")
|
||||||
@PostMapping("/subscribeExport")
|
@PostMapping("/subscribeExport")
|
||||||
@RsaSecurityParameter(inDecode = true)
|
public R subscribeExport(@RequestBody HousesReviewEvent bo) throws IOException {
|
||||||
public R subscribeExport(HousesReviewEvent bo) throws IOException {
|
|
||||||
return iHousesReviewService.subscribeExport(bo);
|
return iHousesReviewService.subscribeExport(bo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,10 +135,9 @@ public class HousesReviewController extends BaseController {
|
|||||||
* @param id 主键
|
* @param id 主键
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:review:edit")
|
@SaCheckPermission("system:review:edit")
|
||||||
@GetMapping("/registrationManagement/{id}")
|
@GetMapping("/registrationManagement")
|
||||||
@RsaSecurityParameter
|
@RsaSecurityParameter
|
||||||
public R<HousesReviewVo> getInfo(@NotNull(message = "主键不能为空")
|
public R<HousesReviewVo> getInfo(Long id) {
|
||||||
@PathVariable Long id) {
|
|
||||||
return R.ok(iHousesReviewService.queryById(id));
|
return R.ok(iHousesReviewService.queryById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,7 +160,6 @@ public class HousesReviewController extends BaseController {
|
|||||||
@Log(title = "购房复审登记", businessType = BusinessType.UPDATE)
|
@Log(title = "购房复审登记", businessType = BusinessType.UPDATE)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PutMapping("/registrationManagement")
|
@PutMapping("/registrationManagement")
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody HousesReviewBo bo) {
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody HousesReviewBo bo) {
|
||||||
return toAjax(iHousesReviewService.updateByBo(bo));
|
return toAjax(iHousesReviewService.updateByBo(bo));
|
||||||
}
|
}
|
||||||
@ -174,10 +170,9 @@ public class HousesReviewController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:review:remove")
|
@SaCheckPermission("system:review:remove")
|
||||||
@Log(title = "购房复审登记", businessType = BusinessType.DELETE)
|
@Log(title = "购房复审登记", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/review/{ids}")
|
@DeleteMapping("/review")
|
||||||
@RsaSecurityParameter
|
@RsaSecurityParameter
|
||||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
public R<Void> remove(Long[] ids) {
|
||||||
@PathVariable Long[] ids) {
|
|
||||||
return toAjax(iHousesReviewService.deleteWithValidByIds(Arrays.asList(ids), true));
|
return toAjax(iHousesReviewService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,9 +234,9 @@ public class HousesReviewController extends BaseController {
|
|||||||
* 获取审核材料
|
* 获取审核材料
|
||||||
*/
|
*/
|
||||||
@Log(title = "审核时返回当前人材料",businessType = BusinessType.OTHER)
|
@Log(title = "审核时返回当前人材料",businessType = BusinessType.OTHER)
|
||||||
@GetMapping("/getMaterial/{id}")
|
@GetMapping("/getMaterial")
|
||||||
@RsaSecurityParameter
|
@RsaSecurityParameter
|
||||||
public R<?> getMaterialByBusinessId(@PathVariable(value = "id") Long id){
|
public R<?> getMaterialByBusinessId(Long id){
|
||||||
return iHousesReviewService.getMaterialByBusinessId(id);
|
return iHousesReviewService.getMaterialByBusinessId(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,10 +73,9 @@ public class MaterialModuleController extends BaseController {
|
|||||||
* @param id 主键
|
* @param id 主键
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("material:module:query")
|
@SaCheckPermission("material:module:query")
|
||||||
@GetMapping("/{id}")
|
@GetMapping
|
||||||
@RsaSecurityParameter
|
@RsaSecurityParameter
|
||||||
public R<MaterialModuleVo> getInfo(@NotNull(message = "主键不能为空")
|
public R<MaterialModuleVo> getInfo(Long id) {
|
||||||
@PathVariable Long id) {
|
|
||||||
return R.ok(iMaterialModuleService.queryById(id));
|
return R.ok(iMaterialModuleService.queryById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,10 +110,9 @@ public class MaterialModuleController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("material:module:remove")
|
@SaCheckPermission("material:module:remove")
|
||||||
@Log(title = "材料模块", businessType = BusinessType.DELETE)
|
@Log(title = "材料模块", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping
|
||||||
@RsaSecurityParameter
|
@RsaSecurityParameter
|
||||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
public R<Void> remove(Long[] ids) {
|
||||||
@PathVariable Long[] ids) {
|
|
||||||
return toAjax(iMaterialModuleService.deleteWithValidByIds(Arrays.asList(ids), true));
|
return toAjax(iMaterialModuleService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,10 +65,9 @@ public class MaterialTalentsController extends BaseController {
|
|||||||
* @param id 主键
|
* @param id 主键
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("material:talents:query")
|
@SaCheckPermission("material:talents:query")
|
||||||
@GetMapping("/{id}")
|
@GetMapping
|
||||||
@RsaSecurityParameter
|
@RsaSecurityParameter
|
||||||
public R<MaterialTalentsVo> getInfo(@NotNull(message = "主键不能为空")
|
public R<MaterialTalentsVo> getInfo(Long id) {
|
||||||
@PathVariable Long id) {
|
|
||||||
return R.ok(iMaterialTalentsService.queryById(id));
|
return R.ok(iMaterialTalentsService.queryById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,10 +102,9 @@ public class MaterialTalentsController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("material:talents:remove")
|
@SaCheckPermission("material:talents:remove")
|
||||||
@Log(title = "材料关系", businessType = BusinessType.DELETE)
|
@Log(title = "材料关系", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping
|
||||||
@RsaSecurityParameter
|
@RsaSecurityParameter
|
||||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
public R<Void> remove(Long[] ids) {
|
||||||
@PathVariable Long[] ids) {
|
|
||||||
return toAjax(iMaterialTalentsService.deleteWithValidByIds(Arrays.asList(ids), true));
|
return toAjax(iMaterialTalentsService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,109 @@
|
|||||||
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import com.ruoyi.rsaencrypt.annotation.RsaSecurityParameter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import com.ruoyi.common.core.validate.QueryGroup;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.system.domain.vo.RsaSecurityVo;
|
||||||
|
import com.ruoyi.system.domain.bo.RsaSecurityBo;
|
||||||
|
import com.ruoyi.system.service.IRsaSecurityService;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求RSA数据加解密
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-05-17
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/security")
|
||||||
|
public class RsaSecurityController extends BaseController {
|
||||||
|
|
||||||
|
private final IRsaSecurityService iRsaSecurityService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询请求RSA数据加解密列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:security:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<RsaSecurityVo> list(RsaSecurityBo bo, PageQuery pageQuery) {
|
||||||
|
return iRsaSecurityService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出请求RSA数据加解密列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:security:export")
|
||||||
|
@Log(title = "请求RSA数据加解密", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(RsaSecurityBo bo, HttpServletResponse response) {
|
||||||
|
List<RsaSecurityVo> list = iRsaSecurityService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "请求RSA数据加解密", RsaSecurityVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取请求RSA数据加解密详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:security:query")
|
||||||
|
@GetMapping
|
||||||
|
public R<RsaSecurityVo> getInfo(Long id) {
|
||||||
|
return R.ok(iRsaSecurityService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增请求RSA数据加解密
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:security:add")
|
||||||
|
@Log(title = "请求RSA数据加解密", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody RsaSecurityBo bo) {
|
||||||
|
iRsaSecurityService.insertByBo(bo);
|
||||||
|
return toAjax(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改请求RSA数据加解密
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:security:edit")
|
||||||
|
@Log(title = "请求RSA数据加解密", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody RsaSecurityBo bo) {
|
||||||
|
iRsaSecurityService.updateByBo(bo);
|
||||||
|
return toAjax(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除请求RSA数据加解密
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:security:remove")
|
||||||
|
@Log(title = "请求RSA数据加解密", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping
|
||||||
|
public R<Void> remove(Long[] ids) {
|
||||||
|
return toAjax(iRsaSecurityService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -67,9 +67,8 @@ public class SubscribeExportController extends BaseController {
|
|||||||
* @param id 主键
|
* @param id 主键
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:export:query")
|
@SaCheckPermission("system:export:query")
|
||||||
@GetMapping("/{id}")
|
@GetMapping
|
||||||
public R<SubscribeExportVo> getInfo(@NotNull(message = "主键不能为空")
|
public R<SubscribeExportVo> getInfo(Long id) {
|
||||||
@PathVariable Long id) {
|
|
||||||
return R.ok(iSubscribeExportService.queryById(id));
|
return R.ok(iSubscribeExportService.queryById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,9 +103,8 @@ public class SubscribeExportController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:export:remove")
|
@SaCheckPermission("system:export:remove")
|
||||||
@Log(title = "预约导出", businessType = BusinessType.DELETE)
|
@Log(title = "预约导出", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping
|
||||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
public R<Void> remove(Long[] ids) {
|
||||||
@PathVariable Long[] ids) {
|
|
||||||
return toAjax(iSubscribeExportService.deleteWithValidByIds(Arrays.asList(ids), true));
|
return toAjax(iSubscribeExportService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,9 +57,9 @@ public class SysConfigController extends BaseController {
|
|||||||
* @param configId 参数ID
|
* @param configId 参数ID
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:config:query")
|
@SaCheckPermission("system:config:query")
|
||||||
@GetMapping(value = "/{configId}")
|
@GetMapping
|
||||||
@RsaSecurityParameter
|
@RsaSecurityParameter
|
||||||
public R<SysConfig> getInfo(@PathVariable Long configId) {
|
public R<SysConfig> getInfo(Long configId) {
|
||||||
return R.ok(configService.selectConfigById(configId));
|
return R.ok(configService.selectConfigById(configId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,9 +68,9 @@ public class SysConfigController extends BaseController {
|
|||||||
*
|
*
|
||||||
* @param configKey 参数Key
|
* @param configKey 参数Key
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/configKey/{configKey}")
|
@GetMapping(value = "/configKey")
|
||||||
@RsaSecurityParameter
|
@RsaSecurityParameter
|
||||||
public R<Void> getConfigKey(@PathVariable String configKey) {
|
public R<Void> getConfigKey(String configKey) {
|
||||||
return R.ok(configService.selectConfigByKey(configKey));
|
return R.ok(configService.selectConfigByKey(configKey));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,9 +123,9 @@ public class SysConfigController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:config:remove")
|
@SaCheckPermission("system:config:remove")
|
||||||
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{configIds}")
|
@DeleteMapping
|
||||||
@RsaSecurityParameter
|
@RsaSecurityParameter
|
||||||
public R<Void> remove(@PathVariable Long[] configIds) {
|
public R<Void> remove(Long[] configIds) {
|
||||||
configService.deleteConfigByIds(configIds);
|
configService.deleteConfigByIds(configIds);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,7 +35,6 @@ public class SysDeptController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:dept:list")
|
@SaCheckPermission("system:dept:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@RsaSecurityParameter
|
|
||||||
public R<List<SysDept>> list(SysDept dept) {
|
public R<List<SysDept>> list(SysDept dept) {
|
||||||
List<SysDept> depts = deptService.selectDeptList(dept);
|
List<SysDept> depts = deptService.selectDeptList(dept);
|
||||||
return R.ok(depts);
|
return R.ok(depts);
|
||||||
@ -47,9 +46,9 @@ public class SysDeptController extends BaseController {
|
|||||||
* @param deptId 部门ID
|
* @param deptId 部门ID
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:dept:list")
|
@SaCheckPermission("system:dept:list")
|
||||||
@GetMapping("/list/exclude/{deptId}")
|
@GetMapping("/list/exclude")
|
||||||
@RsaSecurityParameter
|
@RsaSecurityParameter
|
||||||
public R<List<SysDept>> excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) {
|
public R<List<SysDept>> excludeChild(Long deptId) {
|
||||||
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
||||||
depts.removeIf(d -> d.getDeptId().equals(deptId)
|
depts.removeIf(d -> d.getDeptId().equals(deptId)
|
||||||
|| StringUtils.splitList(d.getAncestors()).contains(Convert.toStr(deptId)));
|
|| StringUtils.splitList(d.getAncestors()).contains(Convert.toStr(deptId)));
|
||||||
@ -62,9 +61,9 @@ public class SysDeptController extends BaseController {
|
|||||||
* @param deptId 部门ID
|
* @param deptId 部门ID
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:dept:query")
|
@SaCheckPermission("system:dept:query")
|
||||||
@GetMapping(value = "/{deptId}")
|
@GetMapping
|
||||||
@RsaSecurityParameter
|
@RsaSecurityParameter
|
||||||
public R<SysDept> getInfo(@PathVariable Long deptId) {
|
public R<SysDept> getInfo(Long deptId) {
|
||||||
deptService.checkDeptDataScope(deptId);
|
deptService.checkDeptDataScope(deptId);
|
||||||
return R.ok(deptService.selectDeptById(deptId));
|
return R.ok(deptService.selectDeptById(deptId));
|
||||||
}
|
}
|
||||||
@ -111,8 +110,8 @@ public class SysDeptController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:dept:remove")
|
@SaCheckPermission("system:dept:remove")
|
||||||
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{deptId}")
|
@DeleteMapping
|
||||||
public R<Void> remove(@PathVariable Long deptId) {
|
public R<Void> remove(Long deptId) {
|
||||||
if (deptService.hasChildByDeptId(deptId)) {
|
if (deptService.hasChildByDeptId(deptId)) {
|
||||||
return R.warn("存在下级部门,不允许删除");
|
return R.warn("存在下级部门,不允许删除");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,9 +62,9 @@ public class SysDictDataController extends BaseController {
|
|||||||
* @param dictCode 字典code
|
* @param dictCode 字典code
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:dict:query")
|
@SaCheckPermission("system:dict:query")
|
||||||
@GetMapping(value = "/{dictCode}")
|
@GetMapping
|
||||||
@RsaSecurityParameter
|
@RsaSecurityParameter
|
||||||
public R<SysDictData> getInfo(@PathVariable Long dictCode) {
|
public R<SysDictData> getInfo(Long dictCode) {
|
||||||
return R.ok(dictDataService.selectDictDataById(dictCode));
|
return R.ok(dictDataService.selectDictDataById(dictCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,9 +73,9 @@ public class SysDictDataController extends BaseController {
|
|||||||
*
|
*
|
||||||
* @param dictType 字典类型
|
* @param dictType 字典类型
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/type/{dictType}")
|
@GetMapping(value = "/type")
|
||||||
@RsaSecurityParameter
|
// @RsaSecurityParameter
|
||||||
public R<List<SysDictData>> dictType(@PathVariable String dictType) {
|
public R<List<SysDictData>> dictType(String dictType) {
|
||||||
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
|
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
|
||||||
if (ObjectUtil.isNull(data)) {
|
if (ObjectUtil.isNull(data)) {
|
||||||
data = new ArrayList<>();
|
data = new ArrayList<>();
|
||||||
@ -114,9 +114,9 @@ public class SysDictDataController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:dict:remove")
|
@SaCheckPermission("system:dict:remove")
|
||||||
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{dictCodes}")
|
@DeleteMapping
|
||||||
@RsaSecurityParameter
|
@RsaSecurityParameter
|
||||||
public R<Void> remove(@PathVariable Long[] dictCodes) {
|
public R<Void> remove(Long[] dictCodes) {
|
||||||
dictDataService.deleteDictDataByIds(dictCodes);
|
dictDataService.deleteDictDataByIds(dictCodes);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,7 +35,6 @@ public class SysDictTypeController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:dict:list")
|
@SaCheckPermission("system:dict:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@RsaSecurityParameter
|
|
||||||
public TableDataInfo<SysDictType> list(SysDictType dictType, PageQuery pageQuery) {
|
public TableDataInfo<SysDictType> list(SysDictType dictType, PageQuery pageQuery) {
|
||||||
return dictTypeService.selectPageDictTypeList(dictType, pageQuery);
|
return dictTypeService.selectPageDictTypeList(dictType, pageQuery);
|
||||||
}
|
}
|
||||||
@ -58,9 +57,9 @@ public class SysDictTypeController extends BaseController {
|
|||||||
* @param dictId 字典ID
|
* @param dictId 字典ID
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:dict:query")
|
@SaCheckPermission("system:dict:query")
|
||||||
@GetMapping(value = "/{dictId}")
|
@GetMapping
|
||||||
@RsaSecurityParameter
|
@RsaSecurityParameter
|
||||||
public R<SysDictType> getInfo(@PathVariable Long dictId) {
|
public R<SysDictType> getInfo(Long dictId) {
|
||||||
return R.ok(dictTypeService.selectDictTypeById(dictId));
|
return R.ok(dictTypeService.selectDictTypeById(dictId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,9 +100,9 @@ public class SysDictTypeController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:dict:remove")
|
@SaCheckPermission("system:dict:remove")
|
||||||
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{dictIds}")
|
@DeleteMapping
|
||||||
@RsaSecurityParameter
|
@RsaSecurityParameter
|
||||||
public R<Void> remove(@PathVariable Long[] dictIds) {
|
public R<Void> remove(Long[] dictIds) {
|
||||||
dictTypeService.deleteDictTypeByIds(dictIds);
|
dictTypeService.deleteDictTypeByIds(dictIds);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -150,7 +150,7 @@ public class SysLoginController {
|
|||||||
@RsaSecurityParameter(inDecode = true)
|
@RsaSecurityParameter(inDecode = true)
|
||||||
@PostMapping("/userLogin")
|
@PostMapping("/userLogin")
|
||||||
public R userLogin(
|
public R userLogin(
|
||||||
@Validated({LoginBody.passwordLogin.class})
|
// @Validated({LoginBody.passwordLogin.class})
|
||||||
@RequestBody LoginBody loginBody) {
|
@RequestBody LoginBody loginBody) {
|
||||||
// 生成令牌
|
// 生成令牌
|
||||||
return R.ok("登录成功",loginService.userLogin(loginBody.getUsername(), loginBody.getPassword()));
|
return R.ok("登录成功",loginService.userLogin(loginBody.getUsername(), loginBody.getPassword()));
|
||||||
@ -271,5 +271,13 @@ public class SysLoginController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SaIgnore
|
||||||
|
@RateLimiter(count = 2, time = 10)
|
||||||
|
@PostMapping("/userOpenLogin")
|
||||||
|
public R userOpenLogin(
|
||||||
|
@Validated({LoginBody.userOpenLogin.class})
|
||||||
|
@RequestBody LoginBody loginBody) {
|
||||||
|
// 生成令牌
|
||||||
|
return R.ok("登录成功",loginService.userOpenLogin(loginBody.getUsername(), loginBody.getApiKey()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,7 +36,6 @@ public class SysMenuController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:menu:list")
|
@SaCheckPermission("system:menu:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@RsaSecurityParameter
|
|
||||||
public R<List<SysMenu>> list(SysMenu menu) {
|
public R<List<SysMenu>> list(SysMenu menu) {
|
||||||
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
|
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
|
||||||
return R.ok(menus);
|
return R.ok(menus);
|
||||||
@ -48,9 +47,8 @@ public class SysMenuController extends BaseController {
|
|||||||
* @param menuId 菜单ID
|
* @param menuId 菜单ID
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:menu:query")
|
@SaCheckPermission("system:menu:query")
|
||||||
@GetMapping(value = "/{menuId}")
|
@GetMapping
|
||||||
@RsaSecurityParameter
|
public R<SysMenu> getInfo(Long menuId) {
|
||||||
public R<SysMenu> getInfo(@PathVariable Long menuId) {
|
|
||||||
return R.ok(menuService.selectMenuById(menuId));
|
return R.ok(menuService.selectMenuById(menuId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,7 +56,6 @@ public class SysMenuController extends BaseController {
|
|||||||
* 获取菜单下拉树列表
|
* 获取菜单下拉树列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/treeselect")
|
@GetMapping("/treeselect")
|
||||||
@RsaSecurityParameter
|
|
||||||
public R<List<Tree<Long>>> treeselect(SysMenu menu) {
|
public R<List<Tree<Long>>> treeselect(SysMenu menu) {
|
||||||
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
|
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
|
||||||
return R.ok(menuService.buildMenuTreeSelect(menus));
|
return R.ok(menuService.buildMenuTreeSelect(menus));
|
||||||
@ -69,9 +66,8 @@ public class SysMenuController extends BaseController {
|
|||||||
*
|
*
|
||||||
* @param roleId 角色ID
|
* @param roleId 角色ID
|
||||||
*/
|
*/
|
||||||
@RsaSecurityParameter
|
@GetMapping(value = "/roleMenuTreeselect")
|
||||||
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
|
public R<Map<String, Object>> roleMenuTreeselect(Long roleId) {
|
||||||
public R<Map<String, Object>> roleMenuTreeselect(@PathVariable("roleId") Long roleId) {
|
|
||||||
List<SysMenu> menus = menuService.selectMenuList(getUserId());
|
List<SysMenu> menus = menuService.selectMenuList(getUserId());
|
||||||
Map<String, Object> ajax = new HashMap<>();
|
Map<String, Object> ajax = new HashMap<>();
|
||||||
ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
|
ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
|
||||||
@ -85,7 +81,6 @@ public class SysMenuController extends BaseController {
|
|||||||
@SaCheckPermission("system:menu:add")
|
@SaCheckPermission("system:menu:add")
|
||||||
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
|
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> add(@Validated @RequestBody SysMenu menu) {
|
public R<Void> add(@Validated @RequestBody SysMenu menu) {
|
||||||
if (!menuService.checkMenuNameUnique(menu)) {
|
if (!menuService.checkMenuNameUnique(menu)) {
|
||||||
return R.fail("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
return R.fail("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||||
@ -101,7 +96,6 @@ public class SysMenuController extends BaseController {
|
|||||||
@SaCheckPermission("system:menu:edit")
|
@SaCheckPermission("system:menu:edit")
|
||||||
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
|
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> edit(@Validated @RequestBody SysMenu menu) {
|
public R<Void> edit(@Validated @RequestBody SysMenu menu) {
|
||||||
if (!menuService.checkMenuNameUnique(menu)) {
|
if (!menuService.checkMenuNameUnique(menu)) {
|
||||||
return R.fail("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
return R.fail("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||||
@ -120,9 +114,8 @@ public class SysMenuController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:menu:remove")
|
@SaCheckPermission("system:menu:remove")
|
||||||
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
|
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{menuId}")
|
@DeleteMapping
|
||||||
@RsaSecurityParameter
|
public R<Void> remove(Long menuId) {
|
||||||
public R<Void> remove(@PathVariable("menuId") Long menuId) {
|
|
||||||
if (menuService.hasChildByMenuId(menuId)) {
|
if (menuService.hasChildByMenuId(menuId)) {
|
||||||
return R.warn("存在子菜单,不允许删除");
|
return R.warn("存在子菜单,不允许删除");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,7 +32,6 @@ public class SysNoticeController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:notice:list")
|
@SaCheckPermission("system:notice:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@RsaSecurityParameter
|
|
||||||
public TableDataInfo<SysNotice> list(SysNotice notice, PageQuery pageQuery) {
|
public TableDataInfo<SysNotice> list(SysNotice notice, PageQuery pageQuery) {
|
||||||
return noticeService.selectPageNoticeList(notice, pageQuery);
|
return noticeService.selectPageNoticeList(notice, pageQuery);
|
||||||
}
|
}
|
||||||
@ -43,9 +42,8 @@ public class SysNoticeController extends BaseController {
|
|||||||
* @param noticeId 公告ID
|
* @param noticeId 公告ID
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:notice:query")
|
@SaCheckPermission("system:notice:query")
|
||||||
@GetMapping(value = "/{noticeId}")
|
@GetMapping
|
||||||
@RsaSecurityParameter
|
public R<SysNotice> getInfo(Long noticeId) {
|
||||||
public R<SysNotice> getInfo(@PathVariable Long noticeId) {
|
|
||||||
return R.ok(noticeService.selectNoticeById(noticeId));
|
return R.ok(noticeService.selectNoticeById(noticeId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,7 +53,6 @@ public class SysNoticeController extends BaseController {
|
|||||||
@SaCheckPermission("system:notice:add")
|
@SaCheckPermission("system:notice:add")
|
||||||
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> add(@Validated @RequestBody SysNotice notice) {
|
public R<Void> add(@Validated @RequestBody SysNotice notice) {
|
||||||
return toAjax(noticeService.insertNotice(notice));
|
return toAjax(noticeService.insertNotice(notice));
|
||||||
}
|
}
|
||||||
@ -66,7 +63,6 @@ public class SysNoticeController extends BaseController {
|
|||||||
@SaCheckPermission("system:notice:edit")
|
@SaCheckPermission("system:notice:edit")
|
||||||
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> edit(@Validated @RequestBody SysNotice notice) {
|
public R<Void> edit(@Validated @RequestBody SysNotice notice) {
|
||||||
return toAjax(noticeService.updateNotice(notice));
|
return toAjax(noticeService.updateNotice(notice));
|
||||||
}
|
}
|
||||||
@ -78,9 +74,8 @@ public class SysNoticeController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:notice:remove")
|
@SaCheckPermission("system:notice:remove")
|
||||||
@Log(title = "通知公告", businessType = BusinessType.DELETE)
|
@Log(title = "通知公告", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{noticeIds}")
|
@DeleteMapping
|
||||||
@RsaSecurityParameter
|
public R<Void> remove(Long[] noticeIds) {
|
||||||
public R<Void> remove(@PathVariable Long[] noticeIds) {
|
|
||||||
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
|
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,6 @@ public class SysOssConfigController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:oss:list")
|
@SaCheckPermission("system:oss:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@RsaSecurityParameter
|
|
||||||
public TableDataInfo<SysOssConfigVo> list(@Validated(QueryGroup.class) SysOssConfigBo bo, PageQuery pageQuery) {
|
public TableDataInfo<SysOssConfigVo> list(@Validated(QueryGroup.class) SysOssConfigBo bo, PageQuery pageQuery) {
|
||||||
return iSysOssConfigService.queryPageList(bo, pageQuery);
|
return iSysOssConfigService.queryPageList(bo, pageQuery);
|
||||||
}
|
}
|
||||||
@ -54,10 +53,8 @@ public class SysOssConfigController extends BaseController {
|
|||||||
* @param ossConfigId OSS配置ID
|
* @param ossConfigId OSS配置ID
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:oss:query")
|
@SaCheckPermission("system:oss:query")
|
||||||
@GetMapping("/{ossConfigId}")
|
@GetMapping
|
||||||
@RsaSecurityParameter
|
public R<SysOssConfigVo> getInfo(Long ossConfigId) {
|
||||||
public R<SysOssConfigVo> getInfo(@NotNull(message = "主键不能为空")
|
|
||||||
@PathVariable Long ossConfigId) {
|
|
||||||
return R.ok(iSysOssConfigService.queryById(ossConfigId));
|
return R.ok(iSysOssConfigService.queryById(ossConfigId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,7 +65,6 @@ public class SysOssConfigController extends BaseController {
|
|||||||
@Log(title = "对象存储配置", businessType = BusinessType.INSERT)
|
@Log(title = "对象存储配置", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysOssConfigBo bo) {
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysOssConfigBo bo) {
|
||||||
return toAjax(iSysOssConfigService.insertByBo(bo));
|
return toAjax(iSysOssConfigService.insertByBo(bo));
|
||||||
}
|
}
|
||||||
@ -80,7 +76,6 @@ public class SysOssConfigController extends BaseController {
|
|||||||
@Log(title = "对象存储配置", businessType = BusinessType.UPDATE)
|
@Log(title = "对象存储配置", businessType = BusinessType.UPDATE)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysOssConfigBo bo) {
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysOssConfigBo bo) {
|
||||||
return toAjax(iSysOssConfigService.updateByBo(bo));
|
return toAjax(iSysOssConfigService.updateByBo(bo));
|
||||||
}
|
}
|
||||||
@ -92,10 +87,8 @@ public class SysOssConfigController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:oss:remove")
|
@SaCheckPermission("system:oss:remove")
|
||||||
@Log(title = "对象存储配置", businessType = BusinessType.DELETE)
|
@Log(title = "对象存储配置", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ossConfigIds}")
|
@DeleteMapping
|
||||||
@RsaSecurityParameter
|
public R<Void> remove(Long[] ossConfigIds) {
|
||||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
||||||
@PathVariable Long[] ossConfigIds) {
|
|
||||||
return toAjax(iSysOssConfigService.deleteWithValidByIds(Arrays.asList(ossConfigIds), true));
|
return toAjax(iSysOssConfigService.deleteWithValidByIds(Arrays.asList(ossConfigIds), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,7 +98,6 @@ public class SysOssConfigController extends BaseController {
|
|||||||
@SaCheckPermission("system:oss:edit")
|
@SaCheckPermission("system:oss:edit")
|
||||||
@Log(title = "对象存储状态修改", businessType = BusinessType.UPDATE)
|
@Log(title = "对象存储状态修改", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/changeStatus")
|
@PutMapping("/changeStatus")
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> changeStatus(@RequestBody SysOssConfigBo bo) {
|
public R<Void> changeStatus(@RequestBody SysOssConfigBo bo) {
|
||||||
return toAjax(iSysOssConfigService.updateOssConfigStatus(bo));
|
return toAjax(iSysOssConfigService.updateOssConfigStatus(bo));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,7 +35,6 @@ public class SysPostController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:post:list")
|
@SaCheckPermission("system:post:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@RsaSecurityParameter
|
|
||||||
public TableDataInfo<SysPost> list(SysPost post, PageQuery pageQuery) {
|
public TableDataInfo<SysPost> list(SysPost post, PageQuery pageQuery) {
|
||||||
return postService.selectPagePostList(post, pageQuery);
|
return postService.selectPagePostList(post, pageQuery);
|
||||||
}
|
}
|
||||||
@ -57,9 +56,8 @@ public class SysPostController extends BaseController {
|
|||||||
* @param postId 岗位ID
|
* @param postId 岗位ID
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:post:query")
|
@SaCheckPermission("system:post:query")
|
||||||
@GetMapping(value = "/{postId}")
|
@GetMapping
|
||||||
@RsaSecurityParameter
|
public R<SysPost> getInfo(Long postId) {
|
||||||
public R<SysPost> getInfo(@PathVariable Long postId) {
|
|
||||||
return R.ok(postService.selectPostById(postId));
|
return R.ok(postService.selectPostById(postId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +67,6 @@ public class SysPostController extends BaseController {
|
|||||||
@SaCheckPermission("system:post:add")
|
@SaCheckPermission("system:post:add")
|
||||||
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
|
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> add(@Validated @RequestBody SysPost post) {
|
public R<Void> add(@Validated @RequestBody SysPost post) {
|
||||||
if (!postService.checkPostNameUnique(post)) {
|
if (!postService.checkPostNameUnique(post)) {
|
||||||
return R.fail("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
return R.fail("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
||||||
@ -85,7 +82,6 @@ public class SysPostController extends BaseController {
|
|||||||
@SaCheckPermission("system:post:edit")
|
@SaCheckPermission("system:post:edit")
|
||||||
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
|
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> edit(@Validated @RequestBody SysPost post) {
|
public R<Void> edit(@Validated @RequestBody SysPost post) {
|
||||||
if (!postService.checkPostNameUnique(post)) {
|
if (!postService.checkPostNameUnique(post)) {
|
||||||
return R.fail("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
return R.fail("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
||||||
@ -102,8 +98,7 @@ public class SysPostController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:post:remove")
|
@SaCheckPermission("system:post:remove")
|
||||||
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
|
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{postIds}")
|
@DeleteMapping
|
||||||
@RsaSecurityParameter
|
|
||||||
public R<Void> remove(@PathVariable Long[] postIds) {
|
public R<Void> remove(@PathVariable Long[] postIds) {
|
||||||
return toAjax(postService.deletePostByIds(postIds));
|
return toAjax(postService.deletePostByIds(postIds));
|
||||||
}
|
}
|
||||||
@ -112,7 +107,6 @@ public class SysPostController extends BaseController {
|
|||||||
* 获取岗位选择框列表
|
* 获取岗位选择框列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/optionselect")
|
@GetMapping("/optionselect")
|
||||||
@RsaSecurityParameter
|
|
||||||
public R<List<SysPost>> optionselect() {
|
public R<List<SysPost>> optionselect() {
|
||||||
List<SysPost> posts = postService.selectPostAll();
|
List<SysPost> posts = postService.selectPostAll();
|
||||||
return R.ok(posts);
|
return R.ok(posts);
|
||||||
|
|||||||
@ -41,7 +41,6 @@ public class SysProfileController extends BaseController {
|
|||||||
* 个人信息
|
* 个人信息
|
||||||
*/
|
*/
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@RsaSecurityParameter
|
|
||||||
public R<Map<String, Object>> profile() {
|
public R<Map<String, Object>> profile() {
|
||||||
SysUser user = userService.selectUserById(getUserId());
|
SysUser user = userService.selectUserById(getUserId());
|
||||||
Map<String, Object> ajax = new HashMap<>();
|
Map<String, Object> ajax = new HashMap<>();
|
||||||
@ -56,7 +55,6 @@ public class SysProfileController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> updateProfile(@RequestBody SysUser user) {
|
public R<Void> updateProfile(@RequestBody SysUser user) {
|
||||||
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
|
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
|
||||||
return R.fail("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
return R.fail("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||||
@ -83,7 +81,6 @@ public class SysProfileController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/updatePwd")
|
@PutMapping("/updatePwd")
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> updatePwd(String oldPassword, String newPassword) {
|
public R<Void> updatePwd(String oldPassword, String newPassword) {
|
||||||
SysUser user = userService.selectUserById(LoginHelper.getUserId());
|
SysUser user = userService.selectUserById(LoginHelper.getUserId());
|
||||||
String userName = user.getUserName();
|
String userName = user.getUserName();
|
||||||
@ -107,7 +104,6 @@ public class SysProfileController extends BaseController {
|
|||||||
* @param avatarfile 用户头像
|
* @param avatarfile 用户头像
|
||||||
*/
|
*/
|
||||||
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
|
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
|
||||||
@RsaSecurityParameter
|
|
||||||
@PostMapping(value = "/avatar", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
@PostMapping(value = "/avatar", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||||
public R<Map<String, Object>> avatar(@RequestPart("avatarfile") MultipartFile avatarfile) {
|
public R<Map<String, Object>> avatar(@RequestPart("avatarfile") MultipartFile avatarfile) {
|
||||||
Map<String, Object> ajax = new HashMap<>();
|
Map<String, Object> ajax = new HashMap<>();
|
||||||
|
|||||||
@ -31,7 +31,6 @@ public class SysRegisterController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
@PostMapping("/register")
|
@PostMapping("/register")
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> register(@Validated @RequestBody RegisterBody user) {
|
public R<Void> register(@Validated @RequestBody RegisterBody user) {
|
||||||
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) {
|
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) {
|
||||||
return R.fail("当前系统没有开启注册功能!");
|
return R.fail("当前系统没有开启注册功能!");
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
|||||||
import cn.dev33.satoken.exception.NotLoginException;
|
import cn.dev33.satoken.exception.NotLoginException;
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.constant.CacheConstants;
|
import com.ruoyi.common.constant.CacheConstants;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
@ -50,7 +51,6 @@ public class SysRoleController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:role:list")
|
@SaCheckPermission("system:role:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@RsaSecurityParameter
|
|
||||||
public TableDataInfo<SysRole> list(SysRole role, PageQuery pageQuery) {
|
public TableDataInfo<SysRole> list(SysRole role, PageQuery pageQuery) {
|
||||||
return roleService.selectPageRoleList(role, pageQuery);
|
return roleService.selectPageRoleList(role, pageQuery);
|
||||||
}
|
}
|
||||||
@ -72,9 +72,8 @@ public class SysRoleController extends BaseController {
|
|||||||
* @param roleId 角色ID
|
* @param roleId 角色ID
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:role:query")
|
@SaCheckPermission("system:role:query")
|
||||||
@GetMapping(value = "/{roleId}")
|
@GetMapping
|
||||||
@RsaSecurityParameter
|
public R<SysRole> getInfo(Long roleId) {
|
||||||
public R<SysRole> getInfo(@PathVariable Long roleId) {
|
|
||||||
roleService.checkRoleDataScope(roleId);
|
roleService.checkRoleDataScope(roleId);
|
||||||
return R.ok(roleService.selectRoleById(roleId));
|
return R.ok(roleService.selectRoleById(roleId));
|
||||||
}
|
}
|
||||||
@ -85,7 +84,6 @@ public class SysRoleController extends BaseController {
|
|||||||
@SaCheckPermission("system:role:add")
|
@SaCheckPermission("system:role:add")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> add(@Validated @RequestBody SysRole role) {
|
public R<Void> add(@Validated @RequestBody SysRole role) {
|
||||||
if (!roleService.checkRoleNameUnique(role)) {
|
if (!roleService.checkRoleNameUnique(role)) {
|
||||||
return R.fail("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
return R.fail("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||||
@ -102,7 +100,6 @@ public class SysRoleController extends BaseController {
|
|||||||
@SaCheckPermission("system:role:edit")
|
@SaCheckPermission("system:role:edit")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> edit(@Validated @RequestBody SysRole role) {
|
public R<Void> edit(@Validated @RequestBody SysRole role) {
|
||||||
roleService.checkRoleAllowed(role);
|
roleService.checkRoleAllowed(role);
|
||||||
roleService.checkRoleDataScope(role.getRoleId());
|
roleService.checkRoleDataScope(role.getRoleId());
|
||||||
@ -125,7 +122,8 @@ public class SysRoleController extends BaseController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LoginUser loginUser = LoginHelper.getLoginUser(token);
|
LoginUser loginUser = LoginHelper.getLoginUser(token);
|
||||||
if (loginUser.getRoles().stream().anyMatch(r -> r.getRoleId().equals(role.getRoleId()))) {
|
if (ObjectUtil.isNotNull(loginUser.getRoles()) && loginUser.getRoles().size()>0 &&
|
||||||
|
loginUser.getRoles().stream().anyMatch(r -> r.getRoleId().equals(role.getRoleId()))) {
|
||||||
try {
|
try {
|
||||||
StpUtil.logoutByTokenValue(token);
|
StpUtil.logoutByTokenValue(token);
|
||||||
} catch (NotLoginException ignored) {
|
} catch (NotLoginException ignored) {
|
||||||
@ -143,7 +141,6 @@ public class SysRoleController extends BaseController {
|
|||||||
@SaCheckPermission("system:role:edit")
|
@SaCheckPermission("system:role:edit")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/dataScope")
|
@PutMapping("/dataScope")
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> dataScope(@RequestBody SysRole role) {
|
public R<Void> dataScope(@RequestBody SysRole role) {
|
||||||
roleService.checkRoleAllowed(role);
|
roleService.checkRoleAllowed(role);
|
||||||
roleService.checkRoleDataScope(role.getRoleId());
|
roleService.checkRoleDataScope(role.getRoleId());
|
||||||
@ -156,7 +153,6 @@ public class SysRoleController extends BaseController {
|
|||||||
@SaCheckPermission("system:role:edit")
|
@SaCheckPermission("system:role:edit")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/changeStatus")
|
@PutMapping("/changeStatus")
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> changeStatus(@RequestBody SysRole role) {
|
public R<Void> changeStatus(@RequestBody SysRole role) {
|
||||||
roleService.checkRoleAllowed(role);
|
roleService.checkRoleAllowed(role);
|
||||||
roleService.checkRoleDataScope(role.getRoleId());
|
roleService.checkRoleDataScope(role.getRoleId());
|
||||||
@ -170,9 +166,8 @@ public class SysRoleController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:role:remove")
|
@SaCheckPermission("system:role:remove")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.DELETE)
|
@Log(title = "角色管理", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{roleIds}")
|
@DeleteMapping
|
||||||
@RsaSecurityParameter
|
public R<Void> remove(Long[] roleIds) {
|
||||||
public R<Void> remove(@PathVariable Long[] roleIds) {
|
|
||||||
return toAjax(roleService.deleteRoleByIds(roleIds));
|
return toAjax(roleService.deleteRoleByIds(roleIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,7 +176,6 @@ public class SysRoleController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:role:query")
|
@SaCheckPermission("system:role:query")
|
||||||
@GetMapping("/optionselect")
|
@GetMapping("/optionselect")
|
||||||
@RsaSecurityParameter
|
|
||||||
public R<List<SysRole>> optionselect() {
|
public R<List<SysRole>> optionselect() {
|
||||||
return R.ok(roleService.selectRoleAll());
|
return R.ok(roleService.selectRoleAll());
|
||||||
}
|
}
|
||||||
@ -191,7 +185,6 @@ public class SysRoleController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:role:list")
|
@SaCheckPermission("system:role:list")
|
||||||
@GetMapping("/authUser/allocatedList")
|
@GetMapping("/authUser/allocatedList")
|
||||||
@RsaSecurityParameter
|
|
||||||
public TableDataInfo<SysUser> allocatedList(SysUser user, PageQuery pageQuery) {
|
public TableDataInfo<SysUser> allocatedList(SysUser user, PageQuery pageQuery) {
|
||||||
return userService.selectAllocatedList(user, pageQuery);
|
return userService.selectAllocatedList(user, pageQuery);
|
||||||
}
|
}
|
||||||
@ -201,7 +194,6 @@ public class SysRoleController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:role:list")
|
@SaCheckPermission("system:role:list")
|
||||||
@GetMapping("/authUser/unallocatedList")
|
@GetMapping("/authUser/unallocatedList")
|
||||||
@RsaSecurityParameter
|
|
||||||
public TableDataInfo<SysUser> unallocatedList(SysUser user, PageQuery pageQuery) {
|
public TableDataInfo<SysUser> unallocatedList(SysUser user, PageQuery pageQuery) {
|
||||||
return userService.selectUnallocatedList(user, pageQuery);
|
return userService.selectUnallocatedList(user, pageQuery);
|
||||||
}
|
}
|
||||||
@ -212,7 +204,6 @@ public class SysRoleController extends BaseController {
|
|||||||
@SaCheckPermission("system:role:edit")
|
@SaCheckPermission("system:role:edit")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||||
@PutMapping("/authUser/cancel")
|
@PutMapping("/authUser/cancel")
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> cancelAuthUser(@RequestBody SysUserRole userRole) {
|
public R<Void> cancelAuthUser(@RequestBody SysUserRole userRole) {
|
||||||
return toAjax(roleService.deleteAuthUser(userRole));
|
return toAjax(roleService.deleteAuthUser(userRole));
|
||||||
}
|
}
|
||||||
@ -226,7 +217,6 @@ public class SysRoleController extends BaseController {
|
|||||||
@SaCheckPermission("system:role:edit")
|
@SaCheckPermission("system:role:edit")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||||
@PutMapping("/authUser/cancelAll")
|
@PutMapping("/authUser/cancelAll")
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> cancelAuthUserAll(Long roleId, Long[] userIds) {
|
public R<Void> cancelAuthUserAll(Long roleId, Long[] userIds) {
|
||||||
return toAjax(roleService.deleteAuthUsers(roleId, userIds));
|
return toAjax(roleService.deleteAuthUsers(roleId, userIds));
|
||||||
}
|
}
|
||||||
@ -240,7 +230,6 @@ public class SysRoleController extends BaseController {
|
|||||||
@SaCheckPermission("system:role:edit")
|
@SaCheckPermission("system:role:edit")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||||
@PutMapping("/authUser/selectAll")
|
@PutMapping("/authUser/selectAll")
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> selectAuthUserAll(Long roleId, Long[] userIds) {
|
public R<Void> selectAuthUserAll(Long roleId, Long[] userIds) {
|
||||||
roleService.checkRoleDataScope(roleId);
|
roleService.checkRoleDataScope(roleId);
|
||||||
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
||||||
@ -252,9 +241,8 @@ public class SysRoleController extends BaseController {
|
|||||||
* @param roleId 角色ID
|
* @param roleId 角色ID
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:role:list")
|
@SaCheckPermission("system:role:list")
|
||||||
@GetMapping(value = "/deptTree/{roleId}")
|
@GetMapping(value = "/deptTree")
|
||||||
@RsaSecurityParameter
|
public R<Map<String, Object>> roleDeptTreeselect(Long roleId) {
|
||||||
public R<Map<String, Object>> roleDeptTreeselect(@PathVariable("roleId") Long roleId) {
|
|
||||||
Map<String, Object> ajax = new HashMap<>();
|
Map<String, Object> ajax = new HashMap<>();
|
||||||
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
|
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
|
||||||
ajax.put("depts", deptService.selectDeptTreeList(new SysDept()));
|
ajax.put("depts", deptService.selectDeptTreeList(new SysDept()));
|
||||||
|
|||||||
@ -60,7 +60,6 @@ public class SysUserController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:user:list")
|
@SaCheckPermission("system:user:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@RsaSecurityParameter
|
|
||||||
public TableDataInfo<SysUser> list(SysUser user, PageQuery pageQuery) {
|
public TableDataInfo<SysUser> list(SysUser user, PageQuery pageQuery) {
|
||||||
return userService.selectPageUserList(user, pageQuery);
|
return userService.selectPageUserList(user, pageQuery);
|
||||||
}
|
}
|
||||||
@ -70,7 +69,6 @@ public class SysUserController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||||
@SaCheckPermission("system:user:export")
|
@SaCheckPermission("system:user:export")
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(SysUser user, HttpServletResponse response) {
|
public void export(SysUser user, HttpServletResponse response) {
|
||||||
List<SysUser> list = userService.selectUserList(user);
|
List<SysUser> list = userService.selectUserList(user);
|
||||||
@ -94,7 +92,6 @@ public class SysUserController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
||||||
@SaCheckPermission("system:user:import")
|
@SaCheckPermission("system:user:import")
|
||||||
@RsaSecurityParameter
|
|
||||||
@PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
@PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||||
public R<Void> importData(@RequestPart("file") MultipartFile file, boolean updateSupport) throws Exception {
|
public R<Void> importData(@RequestPart("file") MultipartFile file, boolean updateSupport) throws Exception {
|
||||||
ExcelResult<SysUserImportVo> result = ExcelUtil.importExcel(file.getInputStream(), SysUserImportVo.class, new SysUserImportListener(updateSupport));
|
ExcelResult<SysUserImportVo> result = ExcelUtil.importExcel(file.getInputStream(), SysUserImportVo.class, new SysUserImportListener(updateSupport));
|
||||||
@ -115,9 +112,8 @@ public class SysUserController extends BaseController {
|
|||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:user:query")
|
@SaCheckPermission("system:user:query")
|
||||||
@GetMapping(value = {"/", "/{userId}"})
|
@GetMapping
|
||||||
@RsaSecurityParameter
|
public R<Map<String, Object>> getInfo(Long userId) {
|
||||||
public R<Map<String, Object>> getInfo(@PathVariable(value = "userId", required = false) Long userId) {
|
|
||||||
userService.checkUserDataScope(userId);
|
userService.checkUserDataScope(userId);
|
||||||
Map<String, Object> ajax = new HashMap<>();
|
Map<String, Object> ajax = new HashMap<>();
|
||||||
List<SysRole> roles = roleService.selectRoleAll();
|
List<SysRole> roles = roleService.selectRoleAll();
|
||||||
@ -138,7 +134,6 @@ public class SysUserController extends BaseController {
|
|||||||
@SaCheckPermission("system:user:add")
|
@SaCheckPermission("system:user:add")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> add(@Validated @RequestBody SysUser user) {
|
public R<Void> add(@Validated @RequestBody SysUser user) {
|
||||||
if (!userService.checkUserNameUnique(user)) {
|
if (!userService.checkUserNameUnique(user)) {
|
||||||
return R.fail("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
return R.fail("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
||||||
@ -157,7 +152,6 @@ public class SysUserController extends BaseController {
|
|||||||
@SaCheckPermission("system:user:edit")
|
@SaCheckPermission("system:user:edit")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> edit(@Validated @RequestBody SysUser user) {
|
public R<Void> edit(@Validated @RequestBody SysUser user) {
|
||||||
userService.checkUserAllowed(user);
|
userService.checkUserAllowed(user);
|
||||||
userService.checkUserDataScope(user.getUserId());
|
userService.checkUserDataScope(user.getUserId());
|
||||||
@ -178,8 +172,7 @@ public class SysUserController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:user:remove")
|
@SaCheckPermission("system:user:remove")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{userIds}")
|
@DeleteMapping
|
||||||
@RsaSecurityParameter
|
|
||||||
public R<Void> remove(@PathVariable Long[] userIds) {
|
public R<Void> remove(@PathVariable Long[] userIds) {
|
||||||
if (ArrayUtil.contains(userIds, getUserId())) {
|
if (ArrayUtil.contains(userIds, getUserId())) {
|
||||||
return R.fail("当前用户不能删除");
|
return R.fail("当前用户不能删除");
|
||||||
@ -193,7 +186,6 @@ public class SysUserController extends BaseController {
|
|||||||
@SaCheckPermission("system:user:resetPwd")
|
@SaCheckPermission("system:user:resetPwd")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/resetPwd")
|
@PutMapping("/resetPwd")
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> resetPwd(@RequestBody SysUser user) {
|
public R<Void> resetPwd(@RequestBody SysUser user) {
|
||||||
userService.checkUserAllowed(user);
|
userService.checkUserAllowed(user);
|
||||||
userService.checkUserDataScope(user.getUserId());
|
userService.checkUserDataScope(user.getUserId());
|
||||||
@ -207,7 +199,6 @@ public class SysUserController extends BaseController {
|
|||||||
@SaCheckPermission("system:user:edit")
|
@SaCheckPermission("system:user:edit")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/changeStatus")
|
@PutMapping("/changeStatus")
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> changeStatus(@RequestBody SysUser user) {
|
public R<Void> changeStatus(@RequestBody SysUser user) {
|
||||||
userService.checkUserAllowed(user);
|
userService.checkUserAllowed(user);
|
||||||
userService.checkUserDataScope(user.getUserId());
|
userService.checkUserDataScope(user.getUserId());
|
||||||
@ -220,9 +211,8 @@ public class SysUserController extends BaseController {
|
|||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:user:query")
|
@SaCheckPermission("system:user:query")
|
||||||
@GetMapping("/authRole/{userId}")
|
@GetMapping("/authRole")
|
||||||
@RsaSecurityParameter
|
public R<Map<String, Object>> authRole( Long userId) {
|
||||||
public R<Map<String, Object>> authRole(@PathVariable Long userId) {
|
|
||||||
SysUser user = userService.selectUserById(userId);
|
SysUser user = userService.selectUserById(userId);
|
||||||
List<SysRole> roles = roleService.selectRolesByUserId(userId);
|
List<SysRole> roles = roleService.selectRolesByUserId(userId);
|
||||||
Map<String, Object> ajax = new HashMap<>();
|
Map<String, Object> ajax = new HashMap<>();
|
||||||
@ -240,7 +230,6 @@ public class SysUserController extends BaseController {
|
|||||||
@SaCheckPermission("system:user:edit")
|
@SaCheckPermission("system:user:edit")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.GRANT)
|
@Log(title = "用户管理", businessType = BusinessType.GRANT)
|
||||||
@PutMapping("/authRole")
|
@PutMapping("/authRole")
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> insertAuthRole(Long userId, Long[] roleIds) {
|
public R<Void> insertAuthRole(Long userId, Long[] roleIds) {
|
||||||
userService.checkUserDataScope(userId);
|
userService.checkUserDataScope(userId);
|
||||||
userService.insertUserAuth(userId, roleIds);
|
userService.insertUserAuth(userId, roleIds);
|
||||||
@ -252,7 +241,6 @@ public class SysUserController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:user:list")
|
@SaCheckPermission("system:user:list")
|
||||||
@GetMapping("/deptTree")
|
@GetMapping("/deptTree")
|
||||||
@RsaSecurityParameter
|
|
||||||
public R<List<Tree<Long>>> deptTree(SysDept dept) {
|
public R<List<Tree<Long>>> deptTree(SysDept dept) {
|
||||||
return R.ok(deptService.selectDeptTreeList(dept));
|
return R.ok(deptService.selectDeptTreeList(dept));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import cn.hutool.http.HttpUtil;
|
|||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.annotation.RateLimiter;
|
||||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
@ -18,12 +19,9 @@ import com.ruoyi.system.domain.BuyHouses;
|
|||||||
import com.ruoyi.system.domain.bo.BuyHousesBo;
|
import com.ruoyi.system.domain.bo.BuyHousesBo;
|
||||||
import com.ruoyi.system.service.IBuyHousesService;
|
import com.ruoyi.system.service.IBuyHousesService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import oracle.jdbc.proxy.annotation.GetProxy;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户端购房申请相关接口
|
* 客户端购房申请相关接口
|
||||||
*/
|
*/
|
||||||
@ -51,7 +49,6 @@ public class HouseController extends BaseController {
|
|||||||
@Log(title = "【购房申请修改】", businessType = BusinessType.UPDATE)
|
@Log(title = "【购房申请修改】", businessType = BusinessType.UPDATE)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BuyHousesBo bo) {
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BuyHousesBo bo) {
|
||||||
return toAjax(iBuyHousesService.updateByBo(bo));
|
return toAjax(iBuyHousesService.updateByBo(bo));
|
||||||
}
|
}
|
||||||
@ -62,7 +59,6 @@ public class HouseController extends BaseController {
|
|||||||
@Log(title = "【购房获取详情】", businessType = BusinessType.OTHER)
|
@Log(title = "【购房获取详情】", businessType = BusinessType.OTHER)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping("/info")
|
@PostMapping("/info")
|
||||||
@RsaSecurityParameter(inDecode = true)
|
|
||||||
public R<?> getInfo(@RequestBody BuyHouses buyHouses) {
|
public R<?> getInfo(@RequestBody BuyHouses buyHouses) {
|
||||||
return iBuyHousesService.getInfo(buyHouses);
|
return iBuyHousesService.getInfo(buyHouses);
|
||||||
}
|
}
|
||||||
@ -72,7 +68,7 @@ public class HouseController extends BaseController {
|
|||||||
* 下载人才认定申请表
|
* 下载人才认定申请表
|
||||||
*/
|
*/
|
||||||
@PostMapping("/download")
|
@PostMapping("/download")
|
||||||
@RsaSecurityParameter(inDecode = true)
|
@RateLimiter(count = 1, time = 10)
|
||||||
public R downloadWord(@Validated(DownloadGroup.class) @RequestBody BuyHousesBo buyHousesBo){
|
public R downloadWord(@Validated(DownloadGroup.class) @RequestBody BuyHousesBo buyHousesBo){
|
||||||
return iBuyHousesService.downloadWord(buyHousesBo);
|
return iBuyHousesService.downloadWord(buyHousesBo);
|
||||||
}
|
}
|
||||||
@ -81,7 +77,6 @@ public class HouseController extends BaseController {
|
|||||||
* 下载认定通知单
|
* 下载认定通知单
|
||||||
*/
|
*/
|
||||||
@GetMapping("/downloadInform")
|
@GetMapping("/downloadInform")
|
||||||
@RsaSecurityParameter
|
|
||||||
public R downloadInform(){
|
public R downloadInform(){
|
||||||
return iBuyHousesService.downloadInform();
|
return iBuyHousesService.downloadInform();
|
||||||
}
|
}
|
||||||
@ -91,7 +86,6 @@ public class HouseController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/declareList")
|
@GetMapping("/declareList")
|
||||||
@RsaSecurityParameter
|
|
||||||
public R getDeclareList(){
|
public R getDeclareList(){
|
||||||
return R.ok(iBuyHousesService.getDeclareList());
|
return R.ok(iBuyHousesService.getDeclareList());
|
||||||
}
|
}
|
||||||
@ -124,4 +118,26 @@ public class HouseController extends BaseController {
|
|||||||
public R getBuyHouseLog(){
|
public R getBuyHouseLog(){
|
||||||
return iBuyHousesService.getBuyHousesLogsByUserId();
|
return iBuyHousesService.getBuyHousesLogsByUserId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部推送接口
|
||||||
|
* @param buyHouse
|
||||||
|
* @return
|
||||||
|
* @throws InterruptedException
|
||||||
|
*/
|
||||||
|
@Log(title = "【外部推送接口】", businessType = BusinessType.OTHER)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping("/insertOpenBuyHouses")
|
||||||
|
public R<?> insertOpenBuyHouses(@RequestBody BuyHouses buyHouse){
|
||||||
|
/*CCSMessageDigest wxDigest = CCSMessageDigest.getInstance();
|
||||||
|
R r = wxDigest.checkSign(httpRequestBody);
|
||||||
|
if (r.getCode()==200){
|
||||||
|
BuyHouses buyHouses = (BuyHouses)r.getData();
|
||||||
|
buyHouses.setApiKey(httpRequestBody.getApiKey());
|
||||||
|
return iBuyHousesService.insertOpenBuyHouses(buyHouses);
|
||||||
|
}
|
||||||
|
return R.fail(r.getMsg());*/
|
||||||
|
buyHouse.setApiKey("gxgycsj");
|
||||||
|
return iBuyHousesService.insertOpenBuyHouses(buyHouse);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import java.util.Arrays;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.ruoyi.common.constant.Constants;
|
import com.ruoyi.common.constant.Constants;
|
||||||
@ -127,9 +128,10 @@ public class UserController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 获取当前业务进行步骤
|
* 获取当前业务进行步骤
|
||||||
*/
|
*/
|
||||||
|
@SaIgnore
|
||||||
@Log(title = "获取当前业务运行到那一步",businessType = BusinessType.OTHER)
|
@Log(title = "获取当前业务运行到那一步",businessType = BusinessType.OTHER)
|
||||||
@PostMapping("/processPlan")
|
@PostMapping("/processPlan")
|
||||||
@RsaSecurityParameter(inDecode = true)
|
@RsaSecurityParameter(inDecode = true,outEncode = false)
|
||||||
public R<?> processPlan(@RequestBody ActProcess actProcess){
|
public R<?> processPlan(@RequestBody ActProcess actProcess){
|
||||||
List<TProcess> tProcesses = processMapper.selectList(new LambdaQueryWrapper<TProcess>()
|
List<TProcess> tProcesses = processMapper.selectList(new LambdaQueryWrapper<TProcess>()
|
||||||
.eq(TProcess::getProcessKey, actProcess.getProcessKey()));
|
.eq(TProcess::getProcessKey, actProcess.getProcessKey()));
|
||||||
@ -146,4 +148,41 @@ public class UserController extends BaseController {
|
|||||||
hashMap.put("list",processPlan);
|
hashMap.put("list",processPlan);
|
||||||
return R.ok(hashMap);
|
return R.ok(hashMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Log(title = "对外提供步骤接口",businessType = BusinessType.OTHER)
|
||||||
|
@PostMapping("/stepProcessPlan")
|
||||||
|
@RsaSecurityParameter(inDecode = true,outEncode = false)
|
||||||
|
public R<?> stepProcessPlan(@RequestBody ActProcess actProcess){
|
||||||
|
if (ObjectUtil.isNull(actProcess.getBusinessId())){
|
||||||
|
return R.fail("必要参数不可为空");
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNull(actProcess.getProcessKey())){
|
||||||
|
return R.fail("必要参数不可为空");
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNull(actProcess.getApiKey())){
|
||||||
|
return R.fail("必要参数不可为空");
|
||||||
|
}
|
||||||
|
List<TProcess> tProcesses = processMapper.selectList(new LambdaQueryWrapper<TProcess>()
|
||||||
|
.eq(TProcess::getProcessKey, actProcess.getProcessKey()));
|
||||||
|
if (tProcesses.size()==0){
|
||||||
|
throw new ServiceException("当前流程不存在");
|
||||||
|
}
|
||||||
|
LinkedHashMap<String, Object> hashMap = new LinkedHashMap<>();
|
||||||
|
Map<String, Object> map = WorkUtils.getInfoToMap(tProcesses.get(0).getBean(), actProcess.getBusinessId());
|
||||||
|
if (ObjectUtil.isNotNull(map)){
|
||||||
|
Object apiKey = map.get("apiKey");
|
||||||
|
if (ObjectUtil.isNull(apiKey) || !actProcess.getApiKey().equals(apiKey.toString())){
|
||||||
|
return R.fail("无查看权限");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
return R.fail("数据查询失败:无此业务id");
|
||||||
|
}
|
||||||
|
ProcessVo processVo = new ProcessVo();
|
||||||
|
processVo.setBusinessId(actProcess.getBusinessId());
|
||||||
|
processVo.setParams(map);
|
||||||
|
hashMap.put("status",map.get("processStatus"));
|
||||||
|
List<ProcessVoResultDto> processPlan= WorkComplyUtils.getProcessPlan(processVo);
|
||||||
|
hashMap.put("list",processPlan);
|
||||||
|
return R.ok(hashMap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,7 +49,7 @@ spring:
|
|||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
||||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||||
url: jdbc:mysql://182.150.40.133:3309/ry-vue-house?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
url: jdbc:mysql://182.150.40.133:3309/ry-vue-house?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&useAffectedRows=true
|
||||||
username: root
|
username: root
|
||||||
password: 1234Qwer@
|
password: 1234Qwer@
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
@ -102,18 +102,40 @@ spring:
|
|||||||
spring:
|
spring:
|
||||||
redis:
|
redis:
|
||||||
# 地址
|
# 地址
|
||||||
host: 119.96.86.131
|
# host: 182.42.81.18
|
||||||
# host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
# 端口,默认为6379
|
# 端口,默认为6379
|
||||||
port: 6379
|
port: 6379
|
||||||
# 数据库索引
|
# 数据库索3
|
||||||
database: 1
|
database: 5
|
||||||
# 密码(如没有密码请注释掉)
|
# 密码(如没有密码请注释掉)
|
||||||
password: 123456
|
password: 123456
|
||||||
# 连接超时时间
|
# 连接超时时间
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
# 是否开启ssl
|
# 是否开启ssl
|
||||||
ssl: false
|
ssl: false
|
||||||
|
#mq
|
||||||
|
rabbitmq:
|
||||||
|
host: 127.0.0.1
|
||||||
|
port: 5672
|
||||||
|
username: guest
|
||||||
|
password: guest
|
||||||
|
virtual-host: /
|
||||||
|
#确认消息已发送到队列
|
||||||
|
publisher-returns: true
|
||||||
|
#确认消息已发送到交换机
|
||||||
|
publisher-confirm-type: correlated
|
||||||
|
template:
|
||||||
|
#交换机处理消息到路由失败,则会返回给生产者
|
||||||
|
mandatory: true
|
||||||
|
#指定消费端消息确认方式,手动确认
|
||||||
|
listener:
|
||||||
|
direct:
|
||||||
|
acknowledge-mode: manual
|
||||||
|
simple:
|
||||||
|
acknowledge-mode: manual
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
redisson:
|
redisson:
|
||||||
# redis key前缀
|
# redis key前缀
|
||||||
@ -136,7 +158,6 @@ redisson:
|
|||||||
timeout: 3000
|
timeout: 3000
|
||||||
# 发布和订阅连接池大小
|
# 发布和订阅连接池大小
|
||||||
subscriptionConnectionPoolSize: 50
|
subscriptionConnectionPoolSize: 50
|
||||||
|
|
||||||
--- # mail 邮件发送
|
--- # mail 邮件发送
|
||||||
mail:
|
mail:
|
||||||
enabled: false
|
enabled: false
|
||||||
@ -173,7 +194,7 @@ sms:
|
|||||||
|
|
||||||
# 本地文件存储
|
# 本地文件存储
|
||||||
file:
|
file:
|
||||||
domain: http://192.168.0.54:8080
|
domain: http://192.168.0.54:8084
|
||||||
path: D:\\gaoxin\\images
|
path: D:\\gaoxin\\images
|
||||||
prefix: /images
|
prefix: /images
|
||||||
size: 10
|
size: 10
|
||||||
|
|||||||
@ -106,12 +106,12 @@ spring:
|
|||||||
spring:
|
spring:
|
||||||
redis:
|
redis:
|
||||||
# 地址
|
# 地址
|
||||||
host: 119.96.86.131
|
host: 182.42.81.18
|
||||||
# host: 127.0.0.1
|
# host: 127.0.0.1
|
||||||
# 端口,默认为6379
|
# 端口,默认为6379
|
||||||
port: 6379
|
port: 6379
|
||||||
# 数据库索引
|
# 数据库索引
|
||||||
database: 2
|
database: 7
|
||||||
# 密码(如没有密码请注释掉)
|
# 密码(如没有密码请注释掉)
|
||||||
password: 123456
|
password: 123456
|
||||||
# 连接超时时间
|
# 连接超时时间
|
||||||
|
|||||||
@ -138,6 +138,8 @@ security:
|
|||||||
# actuator 监控配置
|
# actuator 监控配置
|
||||||
- /actuator
|
- /actuator
|
||||||
- /actuator/**
|
- /actuator/**
|
||||||
|
- #对外接口排除
|
||||||
|
- /user/house/insertOpenBuyHouses
|
||||||
|
|
||||||
# MyBatisPlus配置
|
# MyBatisPlus配置
|
||||||
# https://baomidou.com/config/
|
# https://baomidou.com/config/
|
||||||
|
|||||||
@ -46,3 +46,4 @@ sms.code.retry.limit.exceed=短信验证码输入错误{0}次,帐户锁定{1}
|
|||||||
xcx.code.not.blank=小程序code不能为空
|
xcx.code.not.blank=小程序code不能为空
|
||||||
user.password.expired=对不起,您的账号:{0},密码已过期,请修改密码
|
user.password.expired=对不起,您的账号:{0},密码已过期,请修改密码
|
||||||
the.password.is.not.within.the.specified.range=密码不在指定范围(必须包含大小写字母和数字的组合,可以使用特殊字符,长度8-20位)
|
the.password.is.not.within.the.specified.range=密码不在指定范围(必须包含大小写字母和数字的组合,可以使用特殊字符,长度8-20位)
|
||||||
|
user.id.cannot.be.empty=用户标识不可为空
|
||||||
|
|||||||
@ -45,5 +45,6 @@ sms.code.retry.limit.exceed=Sms code input error {0} times, account locked for {
|
|||||||
xcx.code.not.blank=Mini program code cannot be blank
|
xcx.code.not.blank=Mini program code cannot be blank
|
||||||
user.password.expired=Password has expired
|
user.password.expired=Password has expired
|
||||||
user.jcaptcha.not.blank=user jcaptcha not blank
|
user.jcaptcha.not.blank=user jcaptcha not blank
|
||||||
|
user.id.cannot.be.empty=User ID cannot be empty
|
||||||
the.password.is.not.within.the.specified.range=The password is not within the specified range (it must contain a combination of uppercase and lowercase letters and numbers, special characters can be used, with a length of 8-18 digits)
|
the.password.is.not.within.the.specified.range=The password is not within the specified range (it must contain a combination of uppercase and lowercase letters and numbers, special characters can be used, with a length of 8-18 digits)
|
||||||
|
|
||||||
|
|||||||
@ -46,3 +46,4 @@ sms.code.retry.limit.exceed=短信验证码输入错误{0}次,帐户锁定{1}
|
|||||||
xcx.code.not.blank=小程序code不能为空
|
xcx.code.not.blank=小程序code不能为空
|
||||||
user.password.expired=对不起,您的账号:{0},密码已过期,请修改密码
|
user.password.expired=对不起,您的账号:{0},密码已过期,请修改密码
|
||||||
the.password.is.not.within.the.specified.range=密码不在指定范围(必须包含大小写字母和数字的组合,可以使用特殊字符,长度8-20位)
|
the.password.is.not.within.the.specified.range=密码不在指定范围(必须包含大小写字母和数字的组合,可以使用特殊字符,长度8-20位)
|
||||||
|
user.id.cannot.be.empty=用户标识不可为空
|
||||||
|
|||||||
@ -2,21 +2,21 @@ package com.ruoyi.test;
|
|||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.codec.Base64;
|
import cn.hutool.core.codec.Base64;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.io.resource.ClassPathResource;
|
import cn.hutool.core.io.resource.ClassPathResource;
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import cn.hutool.crypto.CipherMode;
|
|
||||||
import cn.hutool.crypto.SecureUtil;
|
import cn.hutool.crypto.SecureUtil;
|
||||||
import cn.hutool.crypto.SmUtil;
|
import cn.hutool.crypto.SmUtil;
|
||||||
import cn.hutool.crypto.asymmetric.ECIES;
|
|
||||||
import cn.hutool.crypto.asymmetric.KeyType;
|
import cn.hutool.crypto.asymmetric.KeyType;
|
||||||
import cn.hutool.crypto.asymmetric.RSA;
|
|
||||||
import cn.hutool.crypto.asymmetric.SM2;
|
import cn.hutool.crypto.asymmetric.SM2;
|
||||||
import cn.hutool.crypto.symmetric.SM4;
|
import cn.hutool.crypto.symmetric.SM4;
|
||||||
import cn.hutool.http.HttpRequest;
|
import cn.hutool.http.HttpRequest;
|
||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.alibaba.excel.EasyExcel;
|
||||||
|
import com.alibaba.excel.util.ListUtils;
|
||||||
import com.antherd.smcrypto.sm2.Keypair;
|
import com.antherd.smcrypto.sm2.Keypair;
|
||||||
import com.antherd.smcrypto.sm2.Sm2;
|
import com.antherd.smcrypto.sm2.Sm2;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
@ -28,7 +28,9 @@ import com.ruoyi.common.helper.DataBaseHelper;
|
|||||||
import com.ruoyi.common.utils.AesUtil;
|
import com.ruoyi.common.utils.AesUtil;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||||
import com.ruoyi.rsaencrypt.utls.RSAUtil;
|
import com.ruoyi.demo.domain.ImageDemoData;
|
||||||
|
import com.ruoyi.mq.service.OrderService;
|
||||||
|
import com.ruoyi.mq.service.Produceras;
|
||||||
import com.ruoyi.system.domain.*;
|
import com.ruoyi.system.domain.*;
|
||||||
import com.ruoyi.system.domain.vo.HousesReviewVo;
|
import com.ruoyi.system.domain.vo.HousesReviewVo;
|
||||||
import com.ruoyi.system.domain.vo.MaterialTalentsVo;
|
import com.ruoyi.system.domain.vo.MaterialTalentsVo;
|
||||||
@ -42,6 +44,7 @@ import com.ruoyi.work.domain.TProcess;
|
|||||||
import com.ruoyi.work.domain.vo.ActProcessVo;
|
import com.ruoyi.work.domain.vo.ActProcessVo;
|
||||||
import com.ruoyi.work.domain.vo.ProcessVo;
|
import com.ruoyi.work.domain.vo.ProcessVo;
|
||||||
import com.ruoyi.work.dto.BusinessDTO;
|
import com.ruoyi.work.dto.BusinessDTO;
|
||||||
|
import com.ruoyi.work.dto.HousingConstructionBureauPushDto;
|
||||||
import com.ruoyi.work.mapper.ActProcessMapper;
|
import com.ruoyi.work.mapper.ActProcessMapper;
|
||||||
import com.ruoyi.work.mapper.HisProcessMapper;
|
import com.ruoyi.work.mapper.HisProcessMapper;
|
||||||
import com.ruoyi.work.mapper.ProcessMapper;
|
import com.ruoyi.work.mapper.ProcessMapper;
|
||||||
@ -50,20 +53,20 @@ import com.ruoyi.work.utils.WorkComplyUtils;
|
|||||||
import org.apache.commons.text.CaseUtils;
|
import org.apache.commons.text.CaseUtils;
|
||||||
import org.bouncycastle.crypto.engines.SM2Engine;
|
import org.bouncycastle.crypto.engines.SM2Engine;
|
||||||
import org.junit.jupiter.api.*;
|
import org.junit.jupiter.api.*;
|
||||||
|
import org.springframework.amqp.core.Message;
|
||||||
|
import org.springframework.amqp.core.MessageProperties;
|
||||||
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.util.ReflectionUtils;
|
import org.springframework.util.ReflectionUtils;
|
||||||
|
|
||||||
import javax.crypto.SecretKey;
|
import javax.crypto.SecretKey;
|
||||||
import java.io.FileOutputStream;
|
import java.io.*;
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.security.KeyPair;
|
import java.security.KeyPair;
|
||||||
import java.security.PrivateKey;
|
import java.text.SimpleDateFormat;
|
||||||
import java.security.PublicKey;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -119,6 +122,18 @@ public class DemoUnitTest {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private BuyHousesMemberMapper buyHousesMemberMapper;
|
private BuyHousesMemberMapper buyHousesMemberMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private HousingConstructionBureauPushDto housingConstructionBureauPushDto;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Produceras providerCustomer;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OrderService orderService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RabbitTemplate amqpTemplate;
|
||||||
|
|
||||||
|
|
||||||
@DisplayName("测试 @SpringBootTest @Test @DisplayName 注解")
|
@DisplayName("测试 @SpringBootTest @Test @DisplayName 注解")
|
||||||
@Test
|
@Test
|
||||||
@ -213,7 +228,7 @@ public class DemoUnitTest {
|
|||||||
hisProcess.setParams(map);
|
hisProcess.setParams(map);
|
||||||
hisProcess.setProcessKey(buyHouses.getProcessKey());
|
hisProcess.setProcessKey(buyHouses.getProcessKey());
|
||||||
hisProcess.setStartUser(buyHouses.getUserName());
|
hisProcess.setStartUser(buyHouses.getUserName());
|
||||||
String s = WorkComplyUtils.batchDeleted(hisProcess);
|
String s = WorkComplyUtils.batchDeleted(hisProcess,null);
|
||||||
System.out.println("s = " + s);
|
System.out.println("s = " + s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -299,6 +314,8 @@ public class DemoUnitTest {
|
|||||||
.eq(TProcess::getProcessKey, actProcess.getProcessKey());
|
.eq(TProcess::getProcessKey, actProcess.getProcessKey());
|
||||||
List<TProcess> tProcesses = processMapper.selectList(wrapper);
|
List<TProcess> tProcesses = processMapper.selectList(wrapper);
|
||||||
System.out.println("tProcesses = " + tProcesses);
|
System.out.println("tProcesses = " + tProcesses);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -453,7 +470,7 @@ public class DemoUnitTest {
|
|||||||
System.out.println("publicKey = " + publicKey);
|
System.out.println("publicKey = " + publicKey);
|
||||||
final String VUE_PUBLIC_KEY = "048af4184056315a9ecfcc14280b32504ba194ec8dd0e06b298c4a1aa557e7e9a5d15e1293392f741f7fb31a82e55785b7f1880d61b57def1e38e3f06435fb0502";
|
final String VUE_PUBLIC_KEY = "048af4184056315a9ecfcc14280b32504ba194ec8dd0e06b298c4a1aa557e7e9a5d15e1293392f741f7fb31a82e55785b7f1880d61b57def1e38e3f06435fb0502";
|
||||||
String s2 = Sm2.doEncrypt("12312312", VUE_PUBLIC_KEY);
|
String s2 = Sm2.doEncrypt("12312312", VUE_PUBLIC_KEY);
|
||||||
String s3 = Sm2.doDecrypt("5c63a8de6826da7d293935766a0c13048e3aff31f9830160e0ec05b977d5153b3951f5c35207e9b7b7114e70991a4f199075ecb38b6fa33f1dab0aa2d25d2b94a989cb6f0da0e55f005b631973f18e64b65861774367502288448b8b12c9054a0baedd3d957474fcea8dcc7915826ca7d51bcb120c36184eb928e13d67042e408afa6258b68eb5c9cc609f594b2d9c047f634e9ff319f221ffbebf7253a95833224c1978", privateKey);
|
String s3 = Sm2.doDecrypt("c368df0c094044c0648b412078c2067f84984531afebe3fd494fbce4f5e9b7bc42465855964def4f3bbdd1f61b8780f62656f63c25f8cc6c7e5caff9b0757909848577302a0a1a708d226ecc6a2b3e5c3ac6056cc74884cf5dbe80482f7edb7af59778528a12986bf671d9619c5d60ba00f44e4369aa48f5cf91ac60b9af8e144c730dd0e60330a3fc9473a80ce88fa2", privateKey);
|
||||||
System.out.println("s3 = " + s3);
|
System.out.println("s3 = " + s3);
|
||||||
System.out.println("s2 = " + s2);
|
System.out.println("s2 = " + s2);
|
||||||
|
|
||||||
@ -531,5 +548,228 @@ public class DemoUnitTest {
|
|||||||
// System.out.println("decryptStr = " + decryptStr);
|
// System.out.println("decryptStr = " + decryptStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
@Test
|
||||||
|
public void test021231(){
|
||||||
|
String publicKey="0435661bb2d13bba88f47af0bbe243fcded8f27ac298932661787f88ea283c2b31fe427e1aa8410826a963e9114fe5ffab4ad278aeeb7f1f161e735d1f50570e78";
|
||||||
|
String privateKey="9cefdfcb925a32e10206d3a693ba204632c59e5f9a171faebb814885191dd35e";
|
||||||
|
|
||||||
|
BuyHouses buyHouses = buyHousesMapper.selectById("41");
|
||||||
|
Map<String, Object> map = BeanUtil.beanToMap(buyHouses);
|
||||||
|
String virtualcode = String.valueOf(map.get("virtualcode"));
|
||||||
|
map.put("virtualcode", virtualcode == "3" ? "010" : "009");
|
||||||
|
String cardType = String.valueOf(map.get("cardType"));
|
||||||
|
map.put("cardType", "中国籍".equals(cardType) ? 1 : 4);
|
||||||
|
map.put("qyStatus", "4");
|
||||||
|
map.put("gyStatus", "4");
|
||||||
|
map.put("shStatus", "4");
|
||||||
|
map.put("buyHousesMemberList", "null");
|
||||||
|
map.put("buyHousesLogList", "null");
|
||||||
|
map.put("buyHousesLogList", "null");
|
||||||
|
String prettyStr = JSONUtil.toJsonPrettyStr(map);
|
||||||
|
System.out.println("prettyStr = " + prettyStr);
|
||||||
|
List<BuyHousesMember> buyHousesMembers = buyHousesMemberMapper.selectList(new LambdaQueryWrapper<>(BuyHousesMember.class).eq(BuyHousesMember::getBuyHousesId, buyHouses.getId()));
|
||||||
|
buyHouses.setBuyHousesMemberList(buyHousesMembers);
|
||||||
|
String s = JSONUtil.toJsonPrettyStr(buyHouses);
|
||||||
|
|
||||||
|
String doEncrypt = Sm2.doEncrypt(s, publicKey);
|
||||||
|
// System.out.println("doEncrypt = " + doEncrypt);
|
||||||
|
String doDecrypt = Sm2.doDecrypt(doEncrypt, privateKey);
|
||||||
|
// System.out.println("doDecrypt = " + doDecrypt);
|
||||||
|
String result2 = HttpRequest.post("http://192.168.0.54:8084/user/house/insertOpenBuyHouses")
|
||||||
|
.header("Referer","http://192.168.0.54:8084")
|
||||||
|
.header("path","/user/house/insertOpenBuyHouses")
|
||||||
|
.header("method","POST")
|
||||||
|
.body(doDecrypt,"application/json")
|
||||||
|
.execute().body();
|
||||||
|
System.out.println("result2 = " + result2);
|
||||||
|
}
|
||||||
|
|
||||||
|
//String privateKey="9cefdfcb925a32e10206d3a693ba204632c59e5f9a171faebb814885191dd35e";
|
||||||
|
@Test
|
||||||
|
public void test0212311123123(){
|
||||||
|
String publicKey="0435661bb2d13bba88f47af0bbe243fcded8f27ac298932661787f88ea283c2b31fe427e1aa8410826a963e9114fe5ffab4ad278aeeb7f1f161e735d1f50570e78";
|
||||||
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
map.put("username","15808234569");
|
||||||
|
map.put("apiKey","gaoxingongyuanchengshiju");
|
||||||
|
String s = JSONUtil.toJsonPrettyStr(map);
|
||||||
|
String doEncrypt = Sm2.doEncrypt(s, publicKey);
|
||||||
|
String result2 = HttpRequest.post("http://192.168.0.54:8084/userOpenLogin")
|
||||||
|
.header("Referer","http://192.168.0.54:8084")
|
||||||
|
.header("path","/userOpenLogin")
|
||||||
|
.header("targe","weixin")
|
||||||
|
.header("Authorization","Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiJhcHBfdXNlcjo0Mzc4OSIsInJuU3RyIjoiV05XZFFnaHpHYlRRRU5ObVpwbmhaaFp6MmtKaWtSR0MiLCJ1c2VySWQiOjQzNzg5fQ.QCsN3iIFk38dzTvXITGx2wV5c9kdPdvWZs7gjf6dFzc")
|
||||||
|
.header("method","POST")
|
||||||
|
.body(doEncrypt,"application/json")
|
||||||
|
.execute().body();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录接口
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void test0002(){
|
||||||
|
String publicKey="0435661bb2d13bba88f47af0bbe243fcded8f27ac298932661787f88ea283c2b31fe427e1aa8410826a963e9114fe5ffab4ad278aeeb7f1f161e735d1f50570e78";
|
||||||
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
map.put("businessId","15808234569");//用户标识符
|
||||||
|
map.put("processKey","apply_house");//使用方唯一key
|
||||||
|
map.put("apiKey","gaoxingongyuanchengshiju");//使用方唯一key
|
||||||
|
String s = JSONUtil.toJsonPrettyStr(map);
|
||||||
|
String doEncrypt = Sm2.doEncrypt(s, publicKey);
|
||||||
|
String result2 = HttpRequest.post("http://192.168.0.54:8084/user/house/stepProcessPlan")
|
||||||
|
.header("Referer","http://192.168.0.54:8084")
|
||||||
|
.header("path","/user/house/stepProcessPlan")
|
||||||
|
.header("targe","weixin")
|
||||||
|
.header("Authorization","Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiJhcHBfdXNlcjo0Mzc4OSIsInJuU3RyIjoiV05XZFFnaHpHYlRRRU5ObVpwbmhaaFp6MmtKaWtSR0MiLCJ1c2VySWQiOjQzNzg5fQ.QCsN3iIFk38dzTvXITGx2wV5c9kdPdvWZs7gjf6dFzc")
|
||||||
|
.header("method","POST")
|
||||||
|
.body(doEncrypt,"application/json")
|
||||||
|
.execute().body();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增或者修改接口
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void test0003(){
|
||||||
|
String publicKey="0435661bb2d13bba88f47af0bbe243fcded8f27ac298932661787f88ea283c2b31fe427e1aa8410826a963e9114fe5ffab4ad278aeeb7f1f161e735d1f50570e78";
|
||||||
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
map.put("username","15808234569");
|
||||||
|
map.put("apiKey","gaoxingongyuanchengshiju");
|
||||||
|
BuyHouses buyHouses = buyHousesMapper.selectById("3");
|
||||||
|
String s = JSONUtil.toJsonPrettyStr(map);
|
||||||
|
String doEncrypt = Sm2.doEncrypt(s, publicKey);
|
||||||
|
String result2 = HttpRequest.post("http://192.168.0.54:8084/userOpenLogin")
|
||||||
|
.header("Referer","http://192.168.0.54:8084")
|
||||||
|
.header("path","/userOpenLogin")
|
||||||
|
.header("targe","weixin")
|
||||||
|
.header("Authorization","Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiJhcHBfdXNlcjo0Mzc4OSIsInJuU3RyIjoiV05XZFFnaHpHYlRRRU5ObVpwbmhaaFp6MmtKaWtSR0MiLCJ1c2VySWQiOjQzNzg5fQ.QCsN3iIFk38dzTvXITGx2wV5c9kdPdvWZs7gjf6dFzc")
|
||||||
|
.header("method","POST")
|
||||||
|
.body(doEncrypt,"application/json")
|
||||||
|
.execute().body();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片导出
|
||||||
|
* <p>
|
||||||
|
* 1. 创建excel对应的实体对象 参照{@link ImageDemoData}
|
||||||
|
* <p>
|
||||||
|
* 2. 直接写即可
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void imageWrite() throws Exception {
|
||||||
|
String fileName = "E:\\"+ System.currentTimeMillis() + ".xlsx";
|
||||||
|
|
||||||
|
// 这里注意下 所有的图片都会放到内存 暂时没有很好的解法,大量图片的情况下建议 2选1:
|
||||||
|
// 1. 将图片上传到oss 或者其他存储网站: https://www.aliyun.com/product/oss ,然后直接放链接
|
||||||
|
// 2. 使用: https://github.com/coobird/thumbnailator 或者其他工具压缩图片
|
||||||
|
String imagePath = "https://gx.chengdutalent.cn:8010/upload/GXTalents/images/f264ec41dcfb47b9b6ef231441d3123b.png";
|
||||||
|
try {
|
||||||
|
List<ImageDemoData> list = ListUtils.newArrayList();
|
||||||
|
ImageDemoData imageDemoData = new ImageDemoData();
|
||||||
|
list.add(imageDemoData);
|
||||||
|
// 放入五种类型的图片 实际使用只要选一种即可
|
||||||
|
// imageDemoData.setByteArray(FileUtils.readFileToByteArray(new File(imagePath)));
|
||||||
|
// imageDemoData.setFile(new File(imagePath));
|
||||||
|
// imageDemoData.setString(imagePath);
|
||||||
|
// imageDemoData.setInputStream(inputStream);
|
||||||
|
imageDemoData.setUrl(new URL(
|
||||||
|
"https://gx.chengdutalent.cn:8010/upload/GXTalents/images/f264ec41dcfb47b9b6ef231441d3123b.png"));
|
||||||
|
|
||||||
|
// 这里演示
|
||||||
|
// 需要额外放入文字
|
||||||
|
// 而且需要放入2个图片
|
||||||
|
// 第一个图片靠左
|
||||||
|
// 第二个靠右 而且要额外的占用他后面的单元格
|
||||||
|
/*WriteCellData<Void> writeCellData = new WriteCellData<>();
|
||||||
|
imageDemoData.setWriteCellDataFile(writeCellData);
|
||||||
|
// 这里可以设置为 EMPTY 则代表不需要其他数据了
|
||||||
|
writeCellData.setType(CellDataTypeEnum.STRING);
|
||||||
|
writeCellData.setStringValue("额外的放一些文字");*/
|
||||||
|
|
||||||
|
/*// 可以放入多个图片
|
||||||
|
List<ImageData> imageDataList = new ArrayList<>();
|
||||||
|
ImageData imageData = new ImageData();
|
||||||
|
imageDataList.add(imageData);
|
||||||
|
writeCellData.setImageDataList(imageDataList);
|
||||||
|
// 放入2进制图片
|
||||||
|
imageData.setImage(FileUtils.readFileToByteArray(new File(imagePath)));
|
||||||
|
// 图片类型
|
||||||
|
imageData.setImageType(ImageData.ImageType.PICTURE_TYPE_PNG);
|
||||||
|
// 上 右 下 左 需要留空
|
||||||
|
// 这个类似于 css 的 margin
|
||||||
|
// 这里实测 不能设置太大 超过单元格原始大小后 打开会提示修复。暂时未找到很好的解法。
|
||||||
|
imageData.setTop(5);
|
||||||
|
imageData.setRight(40);
|
||||||
|
imageData.setBottom(5);
|
||||||
|
imageData.setLeft(5);
|
||||||
|
|
||||||
|
// 放入第二个图片
|
||||||
|
imageData = new ImageData();
|
||||||
|
imageDataList.add(imageData);
|
||||||
|
writeCellData.setImageDataList(imageDataList);
|
||||||
|
imageData.setImage(FileUtils.readFileToByteArray(new File(imagePath)));
|
||||||
|
imageData.setImageType(ImageData.ImageType.PICTURE_TYPE_PNG);
|
||||||
|
imageData.setTop(5);
|
||||||
|
imageData.setRight(5);
|
||||||
|
imageData.setBottom(5);
|
||||||
|
imageData.setLeft(50);
|
||||||
|
// 设置图片的位置 假设 现在目标 是 覆盖 当前单元格 和当前单元格右边的单元格
|
||||||
|
// 起点相对于当前单元格为0 当然可以不写
|
||||||
|
imageData.setRelativeFirstRowIndex(0);
|
||||||
|
imageData.setRelativeFirstColumnIndex(0);
|
||||||
|
imageData.setRelativeLastRowIndex(0);
|
||||||
|
// 前面3个可以不写 下面这个需要写 也就是 结尾 需要相对当前单元格 往右移动一格
|
||||||
|
// 也就是说 这个图片会覆盖当前单元格和 后面的那一格
|
||||||
|
imageData.setRelativeLastColumnIndex(1);*/
|
||||||
|
|
||||||
|
// 写入数据
|
||||||
|
EasyExcel.write(fileName, ImageDemoData.class).sheet().doWrite(list);
|
||||||
|
}catch (Exception e){
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test0121123(){
|
||||||
|
HashMap<String, Object> hashMap = new HashMap<>();
|
||||||
|
hashMap.put("id","1");
|
||||||
|
hashMap.put("status","00T");
|
||||||
|
hashMap.put("description","测试");
|
||||||
|
housingConstructionBureauPushDto.send3(hashMap,"http://218.89.220.30:9200/rctopen/api/anju/openBuyHousesCallback");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test15234523(){
|
||||||
|
// providerCustomer.sendDelayMsg("延迟队列测试",3);
|
||||||
|
String msg ="我来了";
|
||||||
|
MessageProperties messageProperties = new MessageProperties();
|
||||||
|
messageProperties.setHeader("x-delay",5000);//延迟5秒被删除
|
||||||
|
Message message = new Message(msg.getBytes(), messageProperties);
|
||||||
|
amqpTemplate.convertAndSend("PLUGIN_DELAY_EXCHANGE","delay","123132");//交换机和路由键必须和配置文件类中保持一致
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
System.out.println("消息发送成功【" + sdf.format(new Date()) + "】");
|
||||||
|
// orderService.makeOrder();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testt12333(){
|
||||||
|
double div = NumberUtil.div(28, 3000);
|
||||||
|
System.out.println("div = " + div);
|
||||||
|
String s = NumberUtil.decimalFormat("#.##%", div);
|
||||||
|
System.out.println("s = " + s);
|
||||||
|
//获取二期认定通过人才数
|
||||||
|
/*List<HousesReview> housesReviewList = housesReviewMapper.selectList(new LambdaQueryWrapper<>(HousesReview.class)
|
||||||
|
.eq(HousesReview::getProcessStatus, Constants.SUCCEED));
|
||||||
|
//获取本月复审通过数
|
||||||
|
Date date = DateUtil.date();
|
||||||
|
//获得月份,从0开始计数
|
||||||
|
int month = DateUtil.month(date);
|
||||||
|
housesReviewList.forEach(h ->{
|
||||||
|
int month1 = h.getPassTime().getMonth();
|
||||||
|
System.out.println("month1 = " + month1);
|
||||||
|
String s = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, h.getPassTime());
|
||||||
|
System.out.println("s = " + s);
|
||||||
|
});*/
|
||||||
|
// List<HousesReview> collect = housesReviewList.stream().filter(h -> h.getPassTime().getMonth() == month).collect(Collectors.toList());
|
||||||
|
// System.out.println("collect = " + collect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -30,6 +30,9 @@ public interface CacheNames {
|
|||||||
*/
|
*/
|
||||||
String SYS_DICT = "sys_dict";
|
String SYS_DICT = "sys_dict";
|
||||||
|
|
||||||
|
|
||||||
|
String RSA_SECURITY = "rsa_security";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户账户
|
* 用户账户
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -0,0 +1,61 @@
|
|||||||
|
package com.ruoyi.common.core.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求RSA数据加解密对象 rsa_security
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-05-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("rsa_security")
|
||||||
|
public class RsaSecurity extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 需要加密的接口
|
||||||
|
*/
|
||||||
|
private String path;
|
||||||
|
/**
|
||||||
|
* 入参是否解密,默认不解密
|
||||||
|
*/
|
||||||
|
private String inDecode;
|
||||||
|
/**
|
||||||
|
* 出参是否加密,默认加密
|
||||||
|
*/
|
||||||
|
private String outEncode;
|
||||||
|
/**
|
||||||
|
* 公钥
|
||||||
|
*/
|
||||||
|
private String publicKey;
|
||||||
|
/**
|
||||||
|
* 私钥
|
||||||
|
*/
|
||||||
|
private String privateKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求方式
|
||||||
|
*/
|
||||||
|
private String method;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接口限制请求
|
||||||
|
*/
|
||||||
|
private String restricted;
|
||||||
|
|
||||||
|
}
|
||||||
@ -19,7 +19,7 @@ public class LoginBody {
|
|||||||
/**
|
/**
|
||||||
* 用户名
|
* 用户名
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "{user.username.not.blank}",groups = {passwordLogin.class,smgLogin.class,forgetPasswordLogin.class,registerUser.class})
|
@NotBlank(message = "{user.username.not.blank}",groups = {passwordLogin.class,smgLogin.class,forgetPasswordLogin.class,registerUser.class,userOpenLogin.class})
|
||||||
@Length(min = UserConstants.USERNAME_MIN_LENGTH, max = UserConstants.USERNAME_MAX_LENGTH, message = "{user.username.length.valid}",groups = {passwordLogin.class,smgLogin.class,forgetPasswordLogin.class,registerUser.class})
|
@Length(min = UserConstants.USERNAME_MIN_LENGTH, max = UserConstants.USERNAME_MAX_LENGTH, message = "{user.username.length.valid}",groups = {passwordLogin.class,smgLogin.class,forgetPasswordLogin.class,registerUser.class})
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
@ -43,6 +43,13 @@ public class LoginBody {
|
|||||||
private String uuid;
|
private String uuid;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部用户标识key
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "user.id.cannot.be.empty",groups ={userOpenLogin.class})
|
||||||
|
private String apiKey;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账号登录验证
|
* 账号登录验证
|
||||||
*/
|
*/
|
||||||
@ -63,6 +70,8 @@ public class LoginBody {
|
|||||||
*/
|
*/
|
||||||
public interface registerUser {}
|
public interface registerUser {}
|
||||||
|
|
||||||
|
public interface userOpenLogin {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -90,6 +90,8 @@ public class LoginUser implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
|
private String nickName;
|
||||||
|
|
||||||
private String companyId;
|
private String companyId;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -99,6 +99,11 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
|||||||
return DateFormatUtils.format(now, "yyyyMMdd");
|
return DateFormatUtils.format(now, "yyyyMMdd");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String dateTime(String format) {
|
||||||
|
Date now = new Date();
|
||||||
|
return DateFormatUtils.format(now, format);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日期型字符串转化为日期 格式
|
* 日期型字符串转化为日期 格式
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.common.utils;
|
package com.ruoyi.common.utils;
|
||||||
|
|
||||||
|
import java.security.SecureRandom;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
@ -72,7 +73,7 @@ public class StrUtils {
|
|||||||
|
|
||||||
public static String getComplexRandomString(int length) {
|
public static String getComplexRandomString(int length) {
|
||||||
String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||||
Random random = new Random();
|
SecureRandom random = new SecureRandom();
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
for (int i = 0; i < length; i++) {
|
for (int i = 0; i < length; i++) {
|
||||||
int number = random.nextInt(62);
|
int number = random.nextInt(62);
|
||||||
|
|||||||
@ -99,14 +99,14 @@ public class MyFileUtils extends FileUtils
|
|||||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||||
conn.setRequestMethod("GET");//POST
|
conn.setRequestMethod("GET");//POST
|
||||||
//防止屏蔽程序抓取而返回403错误
|
//防止屏蔽程序抓取而返回403错误
|
||||||
conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
|
conn.setRequestProperty("User-Agent", "Mozilla/5.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
|
||||||
conn.setConnectTimeout(5000);
|
conn.setConnectTimeout(5000);
|
||||||
conn.setReadTimeout(5000);
|
conn.setReadTimeout(5000);
|
||||||
int responseCode = conn.getResponseCode();
|
int responseCode = conn.getResponseCode();
|
||||||
System.out.println("responseCode = " + responseCode);
|
System.out.println("responseCode = " + responseCode);
|
||||||
InputStream inputStream = conn.getInputStream();;
|
InputStream inputStream = conn.getInputStream();
|
||||||
byte[] temp = new byte[inputStream.available()];;
|
byte[] temp = new byte[inputStream.available()];
|
||||||
if (200==responseCode) {
|
if (responseCode==200) {
|
||||||
if (temp.length==0) {
|
if (temp.length==0) {
|
||||||
ClassPathResource classPathResource = new ClassPathResource("/404.jpg");
|
ClassPathResource classPathResource = new ClassPathResource("/404.jpg");
|
||||||
inputStream = classPathResource.getStream();
|
inputStream = classPathResource.getStream();
|
||||||
@ -124,6 +124,90 @@ public class MyFileUtils extends FileUtils
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 对中文字符进行UTF-8编码
|
||||||
|
* @param source 要转义的字符串
|
||||||
|
* @return
|
||||||
|
* @throws UnsupportedEncodingException
|
||||||
|
*/
|
||||||
|
public static String tranformStyle(String source) throws UnsupportedEncodingException
|
||||||
|
{
|
||||||
|
char[] arr = source.toCharArray();
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for(int i = 0; i < arr.length; i++)
|
||||||
|
{
|
||||||
|
char temp = arr[i];
|
||||||
|
if(isChinese(temp))
|
||||||
|
{
|
||||||
|
sb.append(URLEncoder.encode("" + temp, "UTF-8"));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
sb.append(arr[i]);
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取字符的编码值
|
||||||
|
* @param s
|
||||||
|
* @return
|
||||||
|
* @throws UnsupportedEncodingException
|
||||||
|
*/
|
||||||
|
public static int getValue(char s) throws UnsupportedEncodingException
|
||||||
|
{
|
||||||
|
String temp = (URLEncoder.encode("" + s, "GBK")).replace("%", "");
|
||||||
|
if(temp.equals(s + ""))
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
char[] arr = temp.toCharArray();
|
||||||
|
int total = 0;
|
||||||
|
for(int i = 0; i < arr.length; i++)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int t = Integer.parseInt((arr[i] + ""), 16);
|
||||||
|
total = total * 16 + t;
|
||||||
|
}
|
||||||
|
catch(NumberFormatException e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是不是中文字符
|
||||||
|
* @param c
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean isChinese(char c)
|
||||||
|
{
|
||||||
|
|
||||||
|
Character.UnicodeBlock ub = Character.UnicodeBlock.of(c);
|
||||||
|
|
||||||
|
if(ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
|
||||||
|
|
||||||
|
|| ub == Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS
|
||||||
|
|
||||||
|
|| ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A
|
||||||
|
|
||||||
|
|| ub == Character.UnicodeBlock.GENERAL_PUNCTUATION
|
||||||
|
|
||||||
|
|| ub == Character.UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION
|
||||||
|
|
||||||
|
|| ub == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS)
|
||||||
|
{
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除文件
|
* 删除文件
|
||||||
|
|||||||
@ -0,0 +1,43 @@
|
|||||||
|
package com.ruoyi.demo.domain;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||||
|
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
|
||||||
|
import com.alibaba.excel.converters.string.StringImageConverter;
|
||||||
|
import com.alibaba.excel.metadata.data.WriteCellData;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@EqualsAndHashCode
|
||||||
|
@ContentRowHeight(100)
|
||||||
|
@ColumnWidth(100 / 8)
|
||||||
|
public class ImageDemoData {
|
||||||
|
private File file;
|
||||||
|
private InputStream inputStream;
|
||||||
|
/**
|
||||||
|
* 如果string类型 必须指定转换器,string默认转换成string
|
||||||
|
*/
|
||||||
|
@ExcelProperty(converter = StringImageConverter.class)
|
||||||
|
private String string;
|
||||||
|
private byte[] byteArray;
|
||||||
|
/**
|
||||||
|
* 根据url导出
|
||||||
|
*
|
||||||
|
* @since 2.1.1
|
||||||
|
*/
|
||||||
|
private URL url;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据文件导出 并设置导出的位置。
|
||||||
|
*
|
||||||
|
* @since 3.0.0-beta1
|
||||||
|
*/
|
||||||
|
private WriteCellData<Void> writeCellDataFile;
|
||||||
|
}
|
||||||
@ -28,6 +28,10 @@
|
|||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common</artifactId>
|
<artifactId>ruoyi-common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-rsaencrypt</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import com.ruoyi.common.enums.BusinessType;
|
|||||||
import com.ruoyi.generator.domain.GenTable;
|
import com.ruoyi.generator.domain.GenTable;
|
||||||
import com.ruoyi.generator.domain.GenTableColumn;
|
import com.ruoyi.generator.domain.GenTableColumn;
|
||||||
import com.ruoyi.generator.service.IGenTableService;
|
import com.ruoyi.generator.service.IGenTableService;
|
||||||
|
import com.ruoyi.rsaencrypt.annotation.RsaSecurityParameter;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -108,6 +109,7 @@ public class GenController extends BaseController {
|
|||||||
@SaCheckPermission("tool:gen:edit")
|
@SaCheckPermission("tool:gen:edit")
|
||||||
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
|
@RsaSecurityParameter(inDecode = true)
|
||||||
public R<Void> editSave(@Validated @RequestBody GenTable genTable) {
|
public R<Void> editSave(@Validated @RequestBody GenTable genTable) {
|
||||||
genTableService.validateEdit(genTable);
|
genTableService.validateEdit(genTable);
|
||||||
genTableService.updateGenTable(genTable);
|
genTableService.updateGenTable(genTable);
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
package com.ruoyi.job.config;
|
package com.ruoyi.mq.config;
|
||||||
|
|
||||||
import com.ruoyi.job.config.properties.XxlJobProperties;
|
|
||||||
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
|
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.ruoyi.job.config.properties;
|
package com.ruoyi.mq.config;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.ruoyi.job.service;
|
package com.ruoyi.mq.service;
|
||||||
|
|
||||||
import com.xxl.job.core.context.XxlJobHelper;
|
import com.xxl.job.core.context.XxlJobHelper;
|
||||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||||
@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
package com.ruoyi.mq.config;
|
||||||
|
|
||||||
|
import org.springframework.amqp.core.Binding;
|
||||||
|
import org.springframework.amqp.core.BindingBuilder;
|
||||||
|
import org.springframework.amqp.core.CustomExchange;
|
||||||
|
import org.springframework.amqp.core.Queue;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class DelayedRabbitMQConfig {
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* 延迟队列名称
|
||||||
|
*//*
|
||||||
|
|
||||||
|
public static final String DELAYED_QUEUE_NAME = "delay.queue.demo.delay.queue";
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* 延迟队列交换机
|
||||||
|
*//*
|
||||||
|
|
||||||
|
public static final String DELAYED_EXCHANGE_NAME = "delay.queue.demo.delay.exchange";
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* 延迟队列路由键
|
||||||
|
*//*
|
||||||
|
|
||||||
|
public static final String DELAYED_ROUTING_KEY = "delay.queue.demo.delay.routingkey";
|
||||||
|
|
||||||
|
// 声明延迟队列
|
||||||
|
@Bean
|
||||||
|
public Queue delayedSmsQueueInit() {
|
||||||
|
return new Queue("sms_delayed_queue",true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 声明延迟交换机
|
||||||
|
@Bean
|
||||||
|
public CustomExchange delayedExchangeInit() {
|
||||||
|
Map<String, Object> args = new HashMap<>();
|
||||||
|
args.put("x-delayed-type", "direct");
|
||||||
|
return new CustomExchange("delayed_exchange", "x-delayed-message", true, false, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Binding delayedBindingSmsQueue(Queue delayedSmsQueueInit, CustomExchange customExchange) {
|
||||||
|
// 延迟队列绑定延迟交换机并设置RoutingKey为sms
|
||||||
|
return BindingBuilder.bind(delayedSmsQueueInit).to(customExchange).with("sms").noargs();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
package com.ruoyi.mq.config;
|
||||||
|
|
||||||
|
import org.springframework.amqp.core.Binding;
|
||||||
|
import org.springframework.amqp.core.BindingBuilder;
|
||||||
|
import org.springframework.amqp.core.CustomExchange;
|
||||||
|
import org.springframework.amqp.core.Queue;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class PluginDelayRabbitConfig {
|
||||||
|
|
||||||
|
@Bean("pluginDelayExchange")
|
||||||
|
public CustomExchange pluginDelayExchange() {
|
||||||
|
Map<String, Object> argMap = new HashMap<>();
|
||||||
|
argMap.put("x-delayed-type", "direct");//必须要配置这个类型,可以是direct,topic和fanout
|
||||||
|
//第二个参数必须为x-delayed-message
|
||||||
|
return new CustomExchange("PLUGIN_DELAY_EXCHANGE","x-delayed-message",true, false, argMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean("pluginDelayQueue")
|
||||||
|
public Queue pluginDelayQueue(){
|
||||||
|
return new Queue("PLUGIN_DELAY_QUEUE");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Binding pluginDelayBinding(@Qualifier("pluginDelayQueue") Queue queue, @Qualifier("pluginDelayExchange") CustomExchange customExchange){
|
||||||
|
return BindingBuilder.bind(queue).to(customExchange).with("delay").noargs();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
package com.ruoyi.mq.config;
|
||||||
|
|
||||||
|
import org.springframework.amqp.core.Message;
|
||||||
|
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
||||||
|
import org.springframework.amqp.rabbit.connection.CorrelationData;
|
||||||
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author : JCccc
|
||||||
|
* @CreateTime : 2019/9/3
|
||||||
|
* @Description :
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class RabbitConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public RabbitTemplate createRabbitTemplate(ConnectionFactory connectionFactory){
|
||||||
|
RabbitTemplate rabbitTemplate = new RabbitTemplate();
|
||||||
|
rabbitTemplate.setConnectionFactory(connectionFactory);
|
||||||
|
//设置开启Mandatory,才能触发回调函数,无论消息推送结果怎么样都强制调用回调函数
|
||||||
|
rabbitTemplate.setMandatory(true);
|
||||||
|
|
||||||
|
rabbitTemplate.setConfirmCallback(new RabbitTemplate.ConfirmCallback() {
|
||||||
|
@Override
|
||||||
|
public void confirm(CorrelationData correlationData, boolean ack, String cause) {
|
||||||
|
System.out.println("ConfirmCallback: "+"相关数据:"+correlationData);
|
||||||
|
System.out.println("ConfirmCallback: "+"确认情况:"+ack);
|
||||||
|
System.out.println("ConfirmCallback: "+"原因:"+cause);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
rabbitTemplate.setReturnCallback(new RabbitTemplate.ReturnCallback() {
|
||||||
|
@Override
|
||||||
|
public void returnedMessage(Message message, int replyCode, String replyText, String exchange, String routingKey) {
|
||||||
|
System.out.println("ReturnCallback: "+"消息:"+message);
|
||||||
|
System.out.println("ReturnCallback: "+"回应码:"+replyCode);
|
||||||
|
System.out.println("ReturnCallback: "+"回应信息:"+replyText);
|
||||||
|
System.out.println("ReturnCallback: "+"交换机:"+exchange);
|
||||||
|
System.out.println("ReturnCallback: "+"路由键:"+routingKey);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return rabbitTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
package com.ruoyi.mq.config;
|
||||||
|
|
||||||
|
import org.springframework.amqp.core.Binding;
|
||||||
|
import org.springframework.amqp.core.BindingBuilder;
|
||||||
|
import org.springframework.amqp.core.FanoutExchange;
|
||||||
|
import org.springframework.amqp.core.Queue;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author whc
|
||||||
|
* @date 2022/5/23 10:18
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class RabbitMQConfiguration {
|
||||||
|
|
||||||
|
//1.声明注册fanout模式的交换机
|
||||||
|
@Bean
|
||||||
|
public FanoutExchange fanoutExchange() {
|
||||||
|
return new FanoutExchange("fanout_order_exchange", true, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
//2.声明队列,sms.fanout.queue email.fanout.queue msg.fanout.queue
|
||||||
|
@Bean
|
||||||
|
public Queue smsQueue() {
|
||||||
|
return new Queue("sms.fanout.queue", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Queue emailQueue() {
|
||||||
|
return new Queue("email.fanout.queue", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Queue msgQueue() {
|
||||||
|
return new Queue("msg.fanout.queue", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
//3.完成绑定关系(队列与交换机完成绑定关系)
|
||||||
|
@Bean
|
||||||
|
public Binding smsBind() {
|
||||||
|
return BindingBuilder.bind(smsQueue()).to(fanoutExchange());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Binding emailBind() {
|
||||||
|
return BindingBuilder.bind(emailQueue()).to(fanoutExchange());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Binding msgBind() {
|
||||||
|
return BindingBuilder.bind(msgQueue()).to(fanoutExchange());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
package com.ruoyi.mq.service;
|
||||||
|
|
||||||
|
import com.rabbitmq.client.Channel;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.amqp.core.Message;
|
||||||
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class Consumer {
|
||||||
|
|
||||||
|
@RabbitListener(queues = "sms_delayed_queue")
|
||||||
|
public void receiveD(Message message, Channel channel) throws IOException {
|
||||||
|
String msg = new String(message.getBody());
|
||||||
|
log.info("当前时间:{},延时队列收到消息:{}", new Date().toString(), msg);
|
||||||
|
// channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.ruoyi.mq.service;
|
||||||
|
|
||||||
|
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
||||||
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author whc
|
||||||
|
* @date 2022/5/23 18:53
|
||||||
|
*/
|
||||||
|
@RabbitListener(queues = "email.fanout.queue")
|
||||||
|
@Component
|
||||||
|
public class FanoutEmailConsumer {
|
||||||
|
|
||||||
|
@RabbitHandler
|
||||||
|
public void messageService(String message) {
|
||||||
|
System.out.println("fanout email ==>" + message);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package com.ruoyi.mq.service;
|
||||||
|
|
||||||
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author whc
|
||||||
|
* @date 2022/5/23 18:50
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class OrderService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RabbitTemplate rabbitTemplate;
|
||||||
|
|
||||||
|
public void makeOrder() {
|
||||||
|
String orderId = UUID.randomUUID().toString();
|
||||||
|
System.out.println("订单生成成功:" + orderId);
|
||||||
|
String exchange_name = "fanout_order_exchange";
|
||||||
|
String routeingKey = "";
|
||||||
|
rabbitTemplate.convertAndSend(exchange_name, routeingKey, orderId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
package com.ruoyi.mq.service;
|
||||||
|
|
||||||
|
import com.rabbitmq.client.Channel;
|
||||||
|
import org.springframework.amqp.core.Message;
|
||||||
|
import org.springframework.amqp.core.MessageProperties;
|
||||||
|
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
||||||
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class PluginDelayConsumer {
|
||||||
|
|
||||||
|
@RabbitHandler
|
||||||
|
@RabbitListener(queues = "PLUGIN_DELAY_QUEUE")//监听延时队列
|
||||||
|
public void fanoutConsumer(Message msg, Channel channel) throws IOException {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
System.out.println("【插件延迟队列】【" + sdf.format(new Date()) + "】收到消息:" + msg);
|
||||||
|
// channel.basicAck(msg.getMessageProperties().getDeliveryTag(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
package com.ruoyi.mq.service;
|
||||||
|
|
||||||
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class Produceras {
|
||||||
|
@Autowired
|
||||||
|
private RabbitTemplate rabbitTemplate;
|
||||||
|
|
||||||
|
|
||||||
|
public void sendDelayMsg(String msg, Integer delayTime) {
|
||||||
|
rabbitTemplate.convertAndSend("delayed_exchange", "sms", msg, a -> {
|
||||||
|
a.getMessageProperties().setDelay(delayTime*1000);
|
||||||
|
return a;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -1,14 +1,10 @@
|
|||||||
package com.ruoyi.rsaencrypt.advice;
|
package com.ruoyi.rsaencrypt.advice;
|
||||||
import cn.hutool.core.io.FastByteArrayOutputStream;
|
|
||||||
import cn.hutool.core.io.IoUtil;
|
import cn.hutool.core.io.IoUtil;
|
||||||
import cn.hutool.core.stream.StreamUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.json.JSONObject;
|
import com.ruoyi.common.core.domain.RsaSecurity;
|
||||||
import cn.hutool.json.JSONUtil;
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||||
import com.ruoyi.common.utils.StreamUtils;
|
import com.ruoyi.rsaencrypt.service.IRsaSecurityService2;
|
||||||
import com.ruoyi.rsaencrypt.annotation.RsaSecurityParameter;
|
|
||||||
import com.ruoyi.rsaencrypt.utls.RSAUtil;
|
import com.ruoyi.rsaencrypt.utls.RSAUtil;
|
||||||
import org.apache.commons.io.IOUtils;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -30,10 +26,11 @@ import java.util.List;
|
|||||||
* @date 2018/10/29 20:17
|
* @date 2018/10/29 20:17
|
||||||
*/
|
*/
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
@RsaSecurityParameter()
|
//@RsaSecurityParameter()
|
||||||
public class DecodeRequestBodyAdvice implements RequestBodyAdvice {
|
public class DecodeRequestBodyAdvice implements RequestBodyAdvice {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(DecodeRequestBodyAdvice.class);
|
private static final Logger logger = LoggerFactory.getLogger(DecodeRequestBodyAdvice.class);
|
||||||
|
private static final IRsaSecurityService2 rsaSecurityService= SpringUtils.getBean(IRsaSecurityService2.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supports(MethodParameter methodParameter, Type type, Class<? extends HttpMessageConverter<?>> aClass) {
|
public boolean supports(MethodParameter methodParameter, Type type, Class<? extends HttpMessageConverter<?>> aClass) {
|
||||||
@ -48,7 +45,21 @@ public class DecodeRequestBodyAdvice implements RequestBodyAdvice {
|
|||||||
@Override
|
@Override
|
||||||
public HttpInputMessage beforeBodyRead(HttpInputMessage inputMessage, MethodParameter methodParameter, Type type, Class<? extends HttpMessageConverter<?>> aClass) throws IOException {
|
public HttpInputMessage beforeBodyRead(HttpInputMessage inputMessage, MethodParameter methodParameter, Type type, Class<? extends HttpMessageConverter<?>> aClass) throws IOException {
|
||||||
try {
|
try {
|
||||||
if (methodParameter.getMethod().isAnnotationPresent(RsaSecurityParameter.class)) {
|
String path = inputMessage.getHeaders().getFirst("path");
|
||||||
|
String method = inputMessage.getHeaders().getFirst("method");
|
||||||
|
if (ObjectUtil.isNotNull(path)) {
|
||||||
|
RsaSecurity info = rsaSecurityService.getInfo(path, StringUtils.toRootUpperCase(method));
|
||||||
|
if (ObjectUtil.isNotNull(info)) {
|
||||||
|
if ("1".equals(info.getRestricted())){
|
||||||
|
throw new ServerException("接口已限制请求");
|
||||||
|
}
|
||||||
|
if ("1".equals(info.getInDecode())) {
|
||||||
|
return new RsaHttpInputMessage(inputMessage, info.getPrivateKey());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*if (methodParameter.getMethod().isAnnotationPresent(RsaSecurityParameter.class)) {
|
||||||
//获取注解配置的包含和去除字段
|
//获取注解配置的包含和去除字段
|
||||||
RsaSecurityParameter serializedField = methodParameter.getMethodAnnotation(RsaSecurityParameter.class);
|
RsaSecurityParameter serializedField = methodParameter.getMethodAnnotation(RsaSecurityParameter.class);
|
||||||
//入参是否需要解密
|
//入参是否需要解密
|
||||||
@ -56,7 +67,7 @@ public class DecodeRequestBodyAdvice implements RequestBodyAdvice {
|
|||||||
logger.info("注解RsaSecurityParameter,对方法method :【" + methodParameter.getMethod().getName() + "】返回数据进行解密");
|
logger.info("注解RsaSecurityParameter,对方法method :【" + methodParameter.getMethod().getName() + "】返回数据进行解密");
|
||||||
return new RsaHttpInputMessage(inputMessage);
|
return new RsaHttpInputMessage(inputMessage);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
return inputMessage;
|
return inputMessage;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -75,7 +86,7 @@ public class DecodeRequestBodyAdvice implements RequestBodyAdvice {
|
|||||||
|
|
||||||
private InputStream body;
|
private InputStream body;
|
||||||
|
|
||||||
public RsaHttpInputMessage(HttpInputMessage inputMessage) throws Exception {
|
public RsaHttpInputMessage(HttpInputMessage inputMessage,String privateKey ) throws Exception {
|
||||||
this.headers = inputMessage.getHeaders();
|
this.headers = inputMessage.getHeaders();
|
||||||
String targe="pc";
|
String targe="pc";
|
||||||
List<String> list = headers.get("targe");
|
List<String> list = headers.get("targe");
|
||||||
@ -85,7 +96,7 @@ public class DecodeRequestBodyAdvice implements RequestBodyAdvice {
|
|||||||
targe = "weixin";
|
targe = "weixin";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.body = IoUtil.toUtf8Stream(easpString(IoUtil.readUtf8(inputMessage.getBody()),targe));
|
this.body = IoUtil.toUtf8Stream(easpString(IoUtil.readUtf8(inputMessage.getBody()),targe,privateKey));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -98,7 +109,7 @@ public class DecodeRequestBodyAdvice implements RequestBodyAdvice {
|
|||||||
return headers;
|
return headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String easpString(String requestData,String targe) throws IOException {
|
public String easpString(String requestData,String targe,String privateKey) throws IOException {
|
||||||
if (requestData != null && !requestData.equals("")) {
|
if (requestData != null && !requestData.equals("")) {
|
||||||
if (StringUtils.isEmpty(requestData)) {
|
if (StringUtils.isEmpty(requestData)) {
|
||||||
throw new RuntimeException("参数【requestData】缺失异常!");
|
throw new RuntimeException("参数【requestData】缺失异常!");
|
||||||
@ -107,11 +118,11 @@ public class DecodeRequestBodyAdvice implements RequestBodyAdvice {
|
|||||||
try {
|
try {
|
||||||
logger.info("解密密文:"+requestData);
|
logger.info("解密密文:"+requestData);
|
||||||
if ("weixin".equals(targe)){
|
if ("weixin".equals(targe)){
|
||||||
content = RSAUtil.privateKeyDecryptStr(requestData);
|
content = RSAUtil.privateKeyDecryptStr(requestData,privateKey);
|
||||||
}else {
|
}else {
|
||||||
String data1 = requestData.substring(1);
|
String data1 = requestData.substring(1);
|
||||||
String substring = requestData.substring(1, data1.length());
|
String substring = requestData.substring(1, data1.length());
|
||||||
content = RSAUtil.privateKeyDecryptStr(substring);
|
content = RSAUtil.privateKeyDecryptStr(substring,privateKey);
|
||||||
}
|
}
|
||||||
logger.info("解密明文:"+content);
|
logger.info("解密明文:"+content);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@ -1,14 +1,10 @@
|
|||||||
package com.ruoyi.rsaencrypt.advice;
|
package com.ruoyi.rsaencrypt.advice;
|
||||||
import cn.hutool.core.codec.Base64;
|
|
||||||
import cn.hutool.core.text.UnicodeUtil;
|
|
||||||
import cn.hutool.core.util.ByteUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import com.ruoyi.common.core.domain.R;
|
||||||
import cn.hutool.json.JSONObject;
|
import com.ruoyi.common.core.domain.RsaSecurity;
|
||||||
import cn.hutool.json.JSONUtil;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.ruoyi.common.utils.JsonUtils;
|
import com.ruoyi.common.utils.JsonUtils;
|
||||||
import com.ruoyi.rsaencrypt.annotation.RsaSecurityParameter;
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||||
|
import com.ruoyi.rsaencrypt.service.IRsaSecurityService2;
|
||||||
import com.ruoyi.rsaencrypt.utls.RSAUtil;
|
import com.ruoyi.rsaencrypt.utls.RSAUtil;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -19,8 +15,7 @@ import org.springframework.http.server.ServerHttpResponse;
|
|||||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||||
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
|
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
|
||||||
|
|
||||||
import java.net.URLEncoder;
|
import java.rmi.ServerException;
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author monkey
|
* @author monkey
|
||||||
@ -28,9 +23,11 @@ import java.util.HashMap;
|
|||||||
* @date 2018/10/25 20:17
|
* @date 2018/10/25 20:17
|
||||||
*/
|
*/
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
@RsaSecurityParameter()
|
//@RsaSecurityParameter()
|
||||||
public class EncodeResponseBodyAdvice implements ResponseBodyAdvice {
|
public class EncodeResponseBodyAdvice implements ResponseBodyAdvice {
|
||||||
private final static Logger logger = LoggerFactory.getLogger(EncodeResponseBodyAdvice.class);
|
private final static Logger logger = LoggerFactory.getLogger(EncodeResponseBodyAdvice.class);
|
||||||
|
private static final IRsaSecurityService2 rsaSecurityService=SpringUtils.getBean(IRsaSecurityService2.class);
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supports(MethodParameter methodParameter, Class aClass) {
|
public boolean supports(MethodParameter methodParameter, Class aClass) {
|
||||||
@ -40,12 +37,26 @@ public class EncodeResponseBodyAdvice implements ResponseBodyAdvice {
|
|||||||
@Override
|
@Override
|
||||||
public Object beforeBodyWrite(Object body, MethodParameter methodParameter, MediaType mediaType, Class aClass, ServerHttpRequest serverHttpRequest, ServerHttpResponse serverHttpResponse) {
|
public Object beforeBodyWrite(Object body, MethodParameter methodParameter, MediaType mediaType, Class aClass, ServerHttpRequest serverHttpRequest, ServerHttpResponse serverHttpResponse) {
|
||||||
// 此处要用反射将字段中的注解解析出来
|
// 此处要用反射将字段中的注解解析出来
|
||||||
if (methodParameter.getMethod().isAnnotationPresent(RsaSecurityParameter.class)) {
|
String method = serverHttpRequest.getMethod().name();
|
||||||
|
String path = serverHttpRequest.getURI().getPath();
|
||||||
|
RsaSecurity info = rsaSecurityService.getInfo(path,method);
|
||||||
|
if (ObjectUtil.isNotNull(info)) {
|
||||||
|
if ("1".equals(info.getRestricted())){
|
||||||
|
return R.fail("接口已限制请求");
|
||||||
|
}
|
||||||
|
if ("1".equals(info.getOutEncode())) {
|
||||||
|
serverHttpResponse.getHeaders().add("isRsaencrypt","true");
|
||||||
|
return encodeRsa(methodParameter, body, info.getPublicKey());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
serverHttpResponse.getHeaders().add("isRsaencrypt","false");
|
||||||
|
return body;
|
||||||
|
/*if (methodParameter.getMethod().isAnnotationPresent(RsaSecurityParameter.class)) {
|
||||||
//获取注解配置的包含和去除字段
|
//获取注解配置的包含和去除字段
|
||||||
RsaSecurityParameter serializedField = methodParameter.getMethodAnnotation(RsaSecurityParameter.class);
|
RsaSecurityParameter serializedField = methodParameter.getMethodAnnotation(RsaSecurityParameter.class);
|
||||||
//出参是否需要加密
|
//出参是否需要加密
|
||||||
if (serializedField.outEncode()) {
|
if (serializedField.outEncode()) {
|
||||||
return encodeRsa(methodParameter, body);
|
return encodeRsa(methodParameter, body,serializedField.outPublicKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
JSONObject jsonObject = JSONUtil.parseObj(body);
|
JSONObject jsonObject = JSONUtil.parseObj(body);
|
||||||
@ -55,10 +66,10 @@ public class EncodeResponseBodyAdvice implements ResponseBodyAdvice {
|
|||||||
String num3 ="403";
|
String num3 ="403";
|
||||||
if (ObjectUtil.isNotNull(code)){
|
if (ObjectUtil.isNotNull(code)){
|
||||||
if (num.equals(code.toString()) || num2.equals(code.toString()) || num3.equals(code.toString())){
|
if (num.equals(code.toString()) || num2.equals(code.toString()) || num3.equals(code.toString())){
|
||||||
return encodeRsa(methodParameter, body);
|
return encodeRsa(methodParameter, body,"");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return body;
|
return body;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -68,11 +79,11 @@ public class EncodeResponseBodyAdvice implements ResponseBodyAdvice {
|
|||||||
* @param body
|
* @param body
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Object encodeRsa(MethodParameter methodParameter, Object body) {
|
private Object encodeRsa(MethodParameter methodParameter, Object body,String outPublicKey) {
|
||||||
try {
|
try {
|
||||||
String result = JsonUtils.toJsonString(body);
|
String result = JsonUtils.toJsonString(body);
|
||||||
logger.info("对返回数据 :【" + result + "】进行加密");
|
logger.info("对返回数据 :【" + result + "】进行加密");
|
||||||
String s = RSAUtil.publicKeyEncryptBase64(result);
|
String s = RSAUtil.publicKeyEncryptBase64(result,outPublicKey);
|
||||||
logger.info("加密之后密文:"+s);
|
logger.info("加密之后密文:"+s);
|
||||||
return s;
|
return s;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@ -29,5 +29,12 @@ public @interface RsaSecurityParameter {
|
|||||||
boolean outEncode() default true;
|
boolean outEncode() default true;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出参公钥
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String outPublicKey() default "" ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,8 @@
|
|||||||
|
package com.ruoyi.rsaencrypt.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.RsaSecurity;
|
||||||
|
|
||||||
|
public interface IRsaSecurityService2 {
|
||||||
|
RsaSecurity getInfo(String path,String method);
|
||||||
|
}
|
||||||
@ -1,5 +1,7 @@
|
|||||||
package com.ruoyi.rsaencrypt.utls;
|
package com.ruoyi.rsaencrypt.utls;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.antherd.smcrypto.sm2.Sm2;
|
import com.antherd.smcrypto.sm2.Sm2;
|
||||||
|
import com.ruoyi.rsaencrypt.annotation.RsaSecurityParameter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RSA加解密工具类
|
* RSA加解密工具类
|
||||||
@ -10,18 +12,23 @@ public class RSAUtil {
|
|||||||
|
|
||||||
public static final String PRIVATE_KEY = "9cefdfcb925a32e10206d3a693ba204632c59e5f9a171faebb814885191dd35e";
|
public static final String PRIVATE_KEY = "9cefdfcb925a32e10206d3a693ba204632c59e5f9a171faebb814885191dd35e";
|
||||||
public static final String VUE_PUBLIC_KEY = "048af4184056315a9ecfcc14280b32504ba194ec8dd0e06b298c4a1aa557e7e9a5d15e1293392f741f7fb31a82e55785b7f1880d61b57def1e38e3f06435fb0502";
|
public static final String VUE_PUBLIC_KEY = "048af4184056315a9ecfcc14280b32504ba194ec8dd0e06b298c4a1aa557e7e9a5d15e1293392f741f7fb31a82e55785b7f1880d61b57def1e38e3f06435fb0502";
|
||||||
public static final String PUBLIC_KEY1 = "0435661bb2d13bba88f47af0bbe243fcded8f27ac298932661787f88ea283c2b31fe427e1aa8410826a963e9114fe5ffab4ad278aeeb7f1f161e735d1f50570e78";
|
|
||||||
/**
|
/**
|
||||||
* 公钥加密
|
* 公钥加密
|
||||||
*/
|
*/
|
||||||
public static String publicKeyEncryptBase64(String data){
|
public static String publicKeyEncryptBase64(String data,String outPublicKey){
|
||||||
|
if (ObjectUtil.isNotEmpty(outPublicKey)){
|
||||||
|
return Sm2.doEncrypt(data, outPublicKey);
|
||||||
|
}
|
||||||
return Sm2.doEncrypt(data, VUE_PUBLIC_KEY);
|
return Sm2.doEncrypt(data, VUE_PUBLIC_KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 私钥解密
|
* 私钥解密
|
||||||
*/
|
*/
|
||||||
public static String privateKeyDecryptStr(String data){
|
public static String privateKeyDecryptStr(String data,String privateKey){
|
||||||
|
if (ObjectUtil.isNotEmpty(privateKey)){
|
||||||
|
return Sm2.doDecrypt(data, privateKey);
|
||||||
|
}
|
||||||
return Sm2.doDecrypt(data,PRIVATE_KEY);
|
return Sm2.doDecrypt(data,PRIVATE_KEY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -172,5 +172,10 @@ public class BuyHouses extends BaseEntity {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<BuyHousesMember> buyHousesMemberList=new ArrayList<>();
|
private List<BuyHousesMember> buyHousesMemberList=new ArrayList<>();
|
||||||
|
|
||||||
|
private String apiKey;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String reply;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,4 +58,6 @@ public class BuyHousesReviewMember extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
private Integer number;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -114,7 +114,7 @@ public class HousesReview extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String companyAddress;
|
private String companyAddress;
|
||||||
/**
|
/**
|
||||||
* 来源
|
* 来源区级:1,市级:2
|
||||||
*/
|
*/
|
||||||
private String sourceBy;
|
private String sourceBy;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -62,5 +62,6 @@ public class MaterialProof extends BaseEntity {
|
|||||||
|
|
||||||
private String processKey;
|
private String processKey;
|
||||||
|
|
||||||
|
private Integer number;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -96,4 +96,6 @@ public class User extends BaseEntity {
|
|||||||
|
|
||||||
private String companyId;
|
private String companyId;
|
||||||
|
|
||||||
|
private String apiKey;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,7 +64,7 @@ public class BuyHousesBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -88,13 +88,13 @@ public class BuyHousesBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 身份证正面
|
* 身份证正面
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "身份证正面不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "身份证正面不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String frontUrl;
|
private String frontUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公园城市局审核状态 1.待审核 2.退件 3.不通过 4.通过
|
* 公园城市局审核状态 1.待审核 2.退件 3.不通过 4.通过
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "公园城市局审核状态 1.待审核 2.退件 3.不通过 4.通过不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "公园城市局审核状态 1.待审核 2.退件 3.不通过 4.通过不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String gyStatus;
|
private String gyStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -106,7 +106,7 @@ public class BuyHousesBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 户口簿主页
|
* 户口簿主页
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "户口簿主页不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "户口簿主页不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String homepageUrl;
|
private String homepageUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -148,13 +148,13 @@ public class BuyHousesBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 区域部门审核状态 1.待审核 2.退件 3.不通过 4.通过
|
* 区域部门审核状态 1.待审核 2.退件 3.不通过 4.通过
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "区域部门审核状态 1.待审核 2.退件 3.不通过 4.通过不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "区域部门审核状态 1.待审核 2.退件 3.不通过 4.通过不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String qyStatus;
|
private String qyStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 身份证背面
|
* 身份证背面
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "身份证背面不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "身份证背面不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String reverseUrl;
|
private String reverseUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -166,7 +166,7 @@ public class BuyHousesBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 社会事业局审核状态 1.待审核 2.退件 3.不通过 4.通过
|
* 社会事业局审核状态 1.待审核 2.退件 3.不通过 4.通过
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "社会事业局审核状态 1.待审核 2.退件 3.不通过 4.通过不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "社会事业局审核状态 1.待审核 2.退件 3.不通过 4.通过不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String shStatus;
|
private String shStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -184,7 +184,7 @@ public class BuyHousesBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 状态 1.待提交 2.受理中 3.受理退件 4.受理驳回 5.初审中 6初审不通过 7.初审退件 8.审定中 9.审定不通过 10.审定通过
|
* 状态 1.待提交 2.受理中 3.受理退件 4.受理驳回 5.初审中 6初审不通过 7.初审退件 8.审定中 9.审定不通过 10.审定通过
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "状态 1.待提交 2.受理中 3.受理退件 4.受理驳回 5.初审中 6初审不通过 7.初审退件 8.审定中 9.审定不通过 10.审定通过不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "状态 1.待提交 2.受理中 3.受理退件 4.受理驳回 5.初审中 6初审不通过 7.初审退件 8.审定中 9.审定不通过 10.审定通过不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -208,13 +208,13 @@ public class BuyHousesBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Date passTime;
|
private Date passTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*人才影像卡
|
*人才影像卡
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String pictureInformationUrl;
|
private String pictureInformationUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -244,4 +244,6 @@ public class BuyHousesBo extends BaseEntity {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Long[] ids;
|
private Long[] ids;
|
||||||
|
|
||||||
|
private String apiKey;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -74,5 +74,6 @@ public class BuyHousesReviewMemberBo extends BaseEntity {
|
|||||||
@NotBlank(message = "姓名不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotBlank(message = "姓名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
private Integer number;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -109,7 +109,7 @@ public class HousesReviewBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 状态
|
* 状态
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "状态不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "状态不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -133,7 +133,7 @@ public class HousesReviewBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 单位类型
|
* 单位类型
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "单位类型不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "单位类型不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String companyType;
|
private String companyType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -83,4 +83,9 @@ public class MaterialProofBo extends BaseEntity {
|
|||||||
|
|
||||||
private String materialName;
|
private String materialName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 次数
|
||||||
|
*/
|
||||||
|
private Integer number;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,68 @@
|
|||||||
|
package com.ruoyi.system.domain.bo;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求RSA数据加解密业务对象 rsa_security
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-05-17
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class RsaSecurityBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 需要加密的接口
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "需要加密的接口不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入参是否解密,默认不解密
|
||||||
|
*/
|
||||||
|
@NotNull(message = "入参是否解密,默认不解密不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String inDecode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出参是否加密,默认加密
|
||||||
|
*/
|
||||||
|
@NotNull(message = "出参是否加密,默认加密不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String outEncode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公钥
|
||||||
|
*/
|
||||||
|
private String publicKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 私钥
|
||||||
|
*/
|
||||||
|
private String privateKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求方式
|
||||||
|
*/
|
||||||
|
private String method;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接口限制请求
|
||||||
|
*/
|
||||||
|
private String restricted;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -71,5 +71,6 @@ public class BuyHousesReviewMemberVo {
|
|||||||
@ExcelProperty(value = "姓名")
|
@ExcelProperty(value = "姓名")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
private Integer number;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,11 +2,18 @@ package com.ruoyi.system.domain.vo;
|
|||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.alibaba.excel.annotation.format.DateTimeFormat;
|
||||||
|
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||||
|
import com.alibaba.excel.converters.date.DateStringConverter;
|
||||||
|
import com.alibaba.excel.converters.url.UrlImageConverter;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
import com.ruoyi.system.domain.BuyHousesMember;
|
import com.ruoyi.system.domain.BuyHousesMember;
|
||||||
import com.ruoyi.system.domain.MaterialProof;
|
import com.ruoyi.system.domain.MaterialProof;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.net.URL;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -26,25 +33,31 @@ public class BuyHousesVo {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "")
|
// @ExcelProperty(value = "")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 姓名
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "姓名")
|
||||||
|
private String userName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 户口簿内页/护照内页
|
* 户口簿内页/护照内页
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "户口簿内页/护照内页")
|
// @ExcelProperty(value = "户口簿内页/护照内页")
|
||||||
private String insidepageUrl;
|
private String insidepageUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 身份证/护照
|
* 身份证/护照
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "身份证/护照")
|
@ExcelProperty(value = "证件号码")
|
||||||
private String cardId;
|
private String cardId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 承诺书
|
* 承诺书
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "承诺书")
|
// @ExcelProperty(value = "承诺书")
|
||||||
private String commitmentUrl;
|
private String commitmentUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -59,22 +72,19 @@ public class BuyHousesVo {
|
|||||||
@ExcelProperty(value = "工作单位")
|
@ExcelProperty(value = "工作单位")
|
||||||
private String companyName;
|
private String companyName;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 申明书
|
* 申明书
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "申明书")
|
// @ExcelProperty(value = "申明书")
|
||||||
private String declarationUrl;
|
private String declarationUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业所在地 1.新经济活力区 2.交子公园金融商务区 3.高新西区 4.生物城
|
* 企业所在地 1.新经济活力区 2.交子公园金融商务区 3.高新西区 4.生物城
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "企业所在地 1.新经济活力区 2.交子公园金融商务区 3.高新西区 4.生物城")
|
@ExcelProperty(value = "企业所在地",converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(dictType = "company_address_area")
|
||||||
private String district;
|
private String district;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,49 +96,50 @@ public class BuyHousesVo {
|
|||||||
/**
|
/**
|
||||||
* 身份证正面
|
* 身份证正面
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "身份证正面")
|
// @ExcelProperty(value = "身份证正面")
|
||||||
private String frontUrl;
|
private String frontUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公园城市局审核状态 1.待审核 2.退件 3.不通过 4.通过
|
* 公园城市局审核状态 1.待审核 2.退件 3.不通过 4.通过
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "公园城市局审核状态 1.待审核 2.退件 3.不通过 4.通过")
|
// @ExcelProperty(value = "公园城市局审核状态 1.待审核 2.退件 3.不通过 4.通过")
|
||||||
private String gyStatus;
|
private String gyStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 房屋记录
|
* 房屋记录
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "房屋记录")
|
// @ExcelProperty(value = "房屋记录")
|
||||||
private String homeRecordUrl;
|
private String homeRecordUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 户口簿主页
|
* 户口簿主页
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "户口簿主页")
|
// @ExcelProperty(value = "户口簿主页")
|
||||||
private String homepageUrl;
|
private String homepageUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 劳动合同
|
* 劳动合同
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "劳动合同")
|
// @ExcelProperty(value = "劳动合同")
|
||||||
private String laborContractUrl;
|
private String laborContractUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业营业执照
|
* 企业营业执照
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "企业营业执照")
|
// @ExcelProperty(value = "企业营业执照")
|
||||||
private String licenseUrl;
|
private String licenseUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 婚姻状况 1.未婚 2.已婚 3.离异
|
* 婚姻状况 1.未婚 2.已婚 3.离异
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "婚姻状况 1.未婚 2.已婚 3.离异")
|
@ExcelProperty(value = "婚姻状况",converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(dictType = "marital_status")
|
||||||
private String maritalStatus;
|
private String maritalStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 婚姻证明材料
|
* 婚姻证明材料
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "婚姻证明材料")
|
// @ExcelProperty(value = "婚姻证明材料")
|
||||||
private String maritalUrl;
|
private String maritalUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -146,13 +157,13 @@ public class BuyHousesVo {
|
|||||||
/**
|
/**
|
||||||
* 区域部门审核状态 1.待审核 2.退件 3.不通过 4.通过
|
* 区域部门审核状态 1.待审核 2.退件 3.不通过 4.通过
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "区域部门审核状态 1.待审核 2.退件 3.不通过 4.通过")
|
// @ExcelProperty(value = "区域部门审核状态 1.待审核 2.退件 3.不通过 4.通过")
|
||||||
private String qyStatus;
|
private String qyStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 身份证背面
|
* 身份证背面
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "身份证背面")
|
// @ExcelProperty(value = "身份证背面")
|
||||||
private String reverseUrl;
|
private String reverseUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -164,7 +175,7 @@ public class BuyHousesVo {
|
|||||||
/**
|
/**
|
||||||
* 社会事业局审核状态 1.待审核 2.退件 3.不通过 4.通过
|
* 社会事业局审核状态 1.待审核 2.退件 3.不通过 4.通过
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "社会事业局审核状态 1.待审核 2.退件 3.不通过 4.通过")
|
// @ExcelProperty(value = "社会事业局审核状态 1.待审核 2.退件 3.不通过 4.通过")
|
||||||
private String shStatus;
|
private String shStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -176,49 +187,52 @@ public class BuyHousesVo {
|
|||||||
/**
|
/**
|
||||||
* 社保证明
|
* 社保证明
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "社保证明")
|
// @ExcelProperty(value = "社保证明")
|
||||||
private String socialSecurityUrl;
|
private String socialSecurityUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态 1.待提交 2.受理中 3.受理退件 4.受理驳回 5.初审中 6初审不通过 7.初审退件 8.审定中 9.审定不通过 10.审定通过
|
* 状态 1.待提交 2.受理中 3.受理退件 4.受理驳回 5.初审中 6初审不通过 7.初审退件 8.审定中 9.审定不通过 10.审定通过
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "状态 1.待提交 2.受理中 3.受理退件 4.受理驳回 5.初审中 6初审不通过 7.初审退件 8.审定中 9.审定不通过 10.审定通过")
|
// @ExcelProperty(value = "状态 1.待提交 2.受理中 3.受理退件 4.受理驳回 5.初审中 6初审不通过 7.初审退件 8.审定中 9.审定不通过 10.审定通过")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类型 A B C D
|
* 类型 A B C D
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "类型 A B C D")
|
@ExcelProperty(value = "类型")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户id
|
* 用户id
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "用户id")
|
// @ExcelProperty(value = "用户id")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 姓名
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "姓名")
|
|
||||||
private String userName;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "审核通过时间")
|
@ExcelProperty(value = "创建时间",converter = DateStringConverter.class)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "修改时间",converter = DateStringConverter.class)
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "审核通过时间",converter = DateStringConverter.class)
|
||||||
private Date passTime;
|
private Date passTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "人才影像卡")
|
// @ExcelProperty(value = "人才影像卡")
|
||||||
private String pictureInformationUrl;
|
private String pictureInformationUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "")
|
// @ExcelProperty(value = "")
|
||||||
private String workAddress;
|
private String workAddress;
|
||||||
|
|
||||||
private String processKey;
|
private String processKey;
|
||||||
@ -233,8 +247,9 @@ public class BuyHousesVo {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<MaterialProof> materialProofList;
|
private List<MaterialProof> materialProofList;
|
||||||
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
private String companyId;
|
private String companyId;
|
||||||
|
|
||||||
|
private String apiKey;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,10 +2,13 @@ package com.ruoyi.system.domain.vo;
|
|||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import com.alibaba.excel.annotation.format.DateTimeFormat;
|
import com.alibaba.excel.annotation.format.DateTimeFormat;
|
||||||
|
import com.alibaba.excel.converters.date.DateDateConverter;
|
||||||
|
import com.alibaba.excel.converters.date.DateStringConverter;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
import com.ruoyi.common.utils.MySerializerUtils;
|
import com.ruoyi.common.utils.MySerializerUtils;
|
||||||
import com.ruoyi.system.domain.BuyHousesReviewMember;
|
import com.ruoyi.system.domain.BuyHousesReviewMember;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -39,13 +42,12 @@ public class HousesReviewVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "证件类型")
|
@ExcelProperty(value = "证件类型")
|
||||||
@NotNull(message = "证件类型不可为空")
|
@NotNull(message = "证件类型不可为空")
|
||||||
@ExcelDictFormat(dictType = "card_type")
|
|
||||||
private String cardType;
|
private String cardType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 身份证号码
|
* 身份证号码
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "身份证号码")
|
@ExcelProperty(value = "证件号码")
|
||||||
private String card;
|
private String card;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -112,7 +114,7 @@ public class HousesReviewVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 状态
|
* 状态
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "状态")
|
// @ExcelProperty(value = "状态")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -124,19 +126,22 @@ public class HousesReviewVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 国籍
|
* 国籍
|
||||||
*/
|
*/
|
||||||
// @ExcelProperty(value = "国籍")
|
@ExcelProperty(value = "国籍", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(dictType = "nationality_type")
|
||||||
private String nationality;
|
private String nationality;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 婚姻状况
|
* 婚姻状况
|
||||||
*/
|
*/
|
||||||
// @ExcelProperty(value = "婚姻状况")
|
@ExcelProperty(value = "婚姻状况",converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(dictType = "marital_status")
|
||||||
private String maritalStatus;
|
private String maritalStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单位类型
|
* 单位类型
|
||||||
*/
|
*/
|
||||||
// @ExcelProperty(value = "单位类型")
|
@ExcelProperty(value = "单位类型", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(dictType = "company_type")
|
||||||
private String companyType;
|
private String companyType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -148,7 +153,8 @@ public class HousesReviewVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 人才类型
|
* 人才类型
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "人才类型")
|
@ExcelProperty(value = "人才类型", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(dictType = "talents_type")
|
||||||
private String talentsType;
|
private String talentsType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -166,7 +172,8 @@ public class HousesReviewVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 来源
|
* 来源
|
||||||
*/
|
*/
|
||||||
// @ExcelProperty(value = "来源")
|
@ExcelProperty(value = "来源", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(dictType = "source_by")
|
||||||
private String sourceBy;
|
private String sourceBy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -192,7 +199,8 @@ public class HousesReviewVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 审核通过时间
|
* 审核通过时间
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "审核通过时间")
|
@ExcelProperty(value = "审核通过时间",converter = DateStringConverter.class)
|
||||||
|
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
|
||||||
private Date passTime;
|
private Date passTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -81,5 +81,6 @@ public class MaterialProofVo {
|
|||||||
|
|
||||||
private String materialName;
|
private String materialName;
|
||||||
|
|
||||||
|
private Integer number;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,71 @@
|
|||||||
|
package com.ruoyi.system.domain.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求RSA数据加解密视图对象 rsa_security
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-05-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class RsaSecurityVo {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 需要加密的接口
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "需要加密的接口")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入参是否解密,默认不解密
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "入参是否解密,默认不解密", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(dictType = "sys_yes_no")
|
||||||
|
private String inDecode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出参是否加密,默认加密
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "出参是否加密,默认加密")
|
||||||
|
private String outEncode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公钥
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "公钥")
|
||||||
|
private String publicKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 私钥
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "私钥")
|
||||||
|
private String privateKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求方式
|
||||||
|
*/
|
||||||
|
private String method;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接口限制请求
|
||||||
|
*/
|
||||||
|
private String restricted;
|
||||||
|
|
||||||
|
}
|
||||||
@ -4,6 +4,9 @@ import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
|||||||
import com.ruoyi.system.domain.BuyHouses;
|
import com.ruoyi.system.domain.BuyHouses;
|
||||||
import com.ruoyi.system.domain.vo.BuyHousesVo;
|
import com.ruoyi.system.domain.vo.BuyHousesVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 【请填写功能名称】Mapper接口
|
* 【请填写功能名称】Mapper接口
|
||||||
*
|
*
|
||||||
@ -12,4 +15,13 @@ import com.ruoyi.system.domain.vo.BuyHousesVo;
|
|||||||
*/
|
*/
|
||||||
public interface BuyHousesMapper extends BaseMapperPlus<BuyHousesMapper, BuyHouses, BuyHousesVo> {
|
public interface BuyHousesMapper extends BaseMapperPlus<BuyHousesMapper, BuyHouses, BuyHousesVo> {
|
||||||
|
|
||||||
|
List<Map> getIndexType();
|
||||||
|
|
||||||
|
List<Map> getActProcessList();
|
||||||
|
|
||||||
|
List<Map> getCompanyDistrict();
|
||||||
|
|
||||||
|
List<Map> getNationality();
|
||||||
|
|
||||||
|
List<Map> getMaritalStatus();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,15 @@
|
|||||||
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.RsaSecurity;
|
||||||
|
import com.ruoyi.system.domain.vo.RsaSecurityVo;
|
||||||
|
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求RSA数据加解密Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-05-17
|
||||||
|
*/
|
||||||
|
public interface RsaSecurityMapper extends BaseMapperPlus<RsaSecurityMapper, RsaSecurity, RsaSecurityVo> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.system.runner;
|
package com.ruoyi.system.runner;
|
||||||
|
|
||||||
import com.ruoyi.common.config.RuoYiConfig;
|
import com.ruoyi.common.config.RuoYiConfig;
|
||||||
|
import com.ruoyi.system.service.IRsaSecurityService;
|
||||||
import com.ruoyi.system.service.ISysConfigService;
|
import com.ruoyi.system.service.ISysConfigService;
|
||||||
import com.ruoyi.system.service.ISysDictTypeService;
|
import com.ruoyi.system.service.ISysDictTypeService;
|
||||||
import com.ruoyi.system.service.ISysOssConfigService;
|
import com.ruoyi.system.service.ISysOssConfigService;
|
||||||
@ -25,6 +26,8 @@ public class SystemApplicationRunner implements ApplicationRunner {
|
|||||||
private final ISysDictTypeService dictTypeService;
|
private final ISysDictTypeService dictTypeService;
|
||||||
private final ISysOssConfigService ossConfigService;
|
private final ISysOssConfigService ossConfigService;
|
||||||
|
|
||||||
|
private final IRsaSecurityService rsaSecurityService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(ApplicationArguments args) throws Exception {
|
public void run(ApplicationArguments args) throws Exception {
|
||||||
ossConfigService.init();
|
ossConfigService.init();
|
||||||
@ -36,6 +39,11 @@ public class SystemApplicationRunner implements ApplicationRunner {
|
|||||||
log.info("加载参数缓存数据成功");
|
log.info("加载参数缓存数据成功");
|
||||||
dictTypeService.loadingDictCache();
|
dictTypeService.loadingDictCache();
|
||||||
log.info("加载字典缓存数据成功");
|
log.info("加载字典缓存数据成功");
|
||||||
|
rsaSecurityService.loadingRsaSecurityCache();
|
||||||
|
log.info("加载加解密缓存数据成功");
|
||||||
|
|
||||||
|
|
||||||
|
// log.info("通道: {} 监听中......", queueName);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -97,4 +97,30 @@ public interface IBuyHousesService {
|
|||||||
*/
|
*/
|
||||||
R downloadInform();
|
R downloadInform();
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 修改数据
|
||||||
|
* @param buyHouses
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
R<?> updateBuyHouses(BuyHouses buyHouses);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对外接口提交
|
||||||
|
* @param buyHouses
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
R<?> insertOpenBuyHouses(BuyHouses buyHouses);
|
||||||
|
|
||||||
|
R<?> getIndexType();
|
||||||
|
|
||||||
|
|
||||||
|
R<?> getCompanyDistrict();
|
||||||
|
|
||||||
|
R<?> getNationalityAndMarital();
|
||||||
|
|
||||||
|
|
||||||
|
R getBasicData();
|
||||||
|
|
||||||
|
R getHistogram(String date);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,4 +72,5 @@ public interface IHousesReviewService {
|
|||||||
*/
|
*/
|
||||||
void exportExcel(HousesReviewBo bo, HttpServletResponse response);
|
void exportExcel(HousesReviewBo bo, HttpServletResponse response);
|
||||||
|
|
||||||
|
TableDataInfo<HousesReview> managerQueryPageList(HousesReviewBo bo, PageQuery pageQuery);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,54 @@
|
|||||||
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.RsaSecurity;
|
||||||
|
import com.ruoyi.system.domain.vo.RsaSecurityVo;
|
||||||
|
import com.ruoyi.system.domain.bo.RsaSecurityBo;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求RSA数据加解密Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-05-17
|
||||||
|
*/
|
||||||
|
public interface IRsaSecurityService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询请求RSA数据加解密
|
||||||
|
*/
|
||||||
|
RsaSecurityVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询请求RSA数据加解密列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<RsaSecurityVo> queryPageList(RsaSecurityBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询请求RSA数据加解密列表
|
||||||
|
*/
|
||||||
|
List<RsaSecurityVo> queryList(RsaSecurityBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增请求RSA数据加解密
|
||||||
|
*/
|
||||||
|
RsaSecurity insertByBo(RsaSecurityBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改请求RSA数据加解密
|
||||||
|
*/
|
||||||
|
RsaSecurity updateByBo(RsaSecurityBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除请求RSA数据加解密信息
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化获取加解密的接口
|
||||||
|
*/
|
||||||
|
void loadingRsaSecurityCache();
|
||||||
|
}
|
||||||
@ -255,6 +255,7 @@ public class SysLoginService {
|
|||||||
loginUser.setDeptId(user.getDeptId());
|
loginUser.setDeptId(user.getDeptId());
|
||||||
loginUser.setUsername(user.getUserName());
|
loginUser.setUsername(user.getUserName());
|
||||||
loginUser.setUserType(user.getUserType());
|
loginUser.setUserType(user.getUserType());
|
||||||
|
loginUser.setNickName(user.getNickName());
|
||||||
loginUser.setMenuPermission(permissionService.getMenuPermission(user));
|
loginUser.setMenuPermission(permissionService.getMenuPermission(user));
|
||||||
loginUser.setRolePermission(permissionService.getRolePermission(user));
|
loginUser.setRolePermission(permissionService.getRolePermission(user));
|
||||||
loginUser.setDeptName(ObjectUtil.isNull(user.getDept()) ? "" : user.getDept().getDeptName());
|
loginUser.setDeptName(ObjectUtil.isNull(user.getDept()) ? "" : user.getDept().getDeptName());
|
||||||
@ -336,6 +337,7 @@ public class SysLoginService {
|
|||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户端用户登录
|
* 客户端用户登录
|
||||||
* @param username
|
* @param username
|
||||||
@ -452,4 +454,50 @@ public class SysLoginService {
|
|||||||
return StpUtil.getTokenValue();
|
return StpUtil.getTokenValue();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公开登录接口
|
||||||
|
* @param username
|
||||||
|
* @param apiKey
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String userOpenLogin(String username, String apiKey) {
|
||||||
|
//1.根据用户账号和key获取用户信息
|
||||||
|
User user = userMapper.selectOne(new LambdaQueryWrapper<User>()
|
||||||
|
.eq(User::getLoginName, username)
|
||||||
|
.eq(User::getApiKey,apiKey));
|
||||||
|
//2.如果不存在就新增,反之构造用户信息并返回一个token
|
||||||
|
if (ObjectUtil.isNull(user)){
|
||||||
|
User user1 = new User();
|
||||||
|
user1.setUserType("app_user");
|
||||||
|
user1.setLoginName(username);
|
||||||
|
user1.setApiKey(apiKey);
|
||||||
|
user1.setCreateTime(new Date());
|
||||||
|
user1.setUpdateTime(new Date());
|
||||||
|
user1.setUpdateBy(username);
|
||||||
|
user1.setCreateBy(username);
|
||||||
|
user1.setWxToken(username);
|
||||||
|
user1.setJurisdiction(1L);
|
||||||
|
int insert = userMapper.insert(user1);
|
||||||
|
if (insert==0){
|
||||||
|
throw new ServiceException("用户操作失败");
|
||||||
|
}
|
||||||
|
LoginUser loginUser = buildLoginUser(user1);
|
||||||
|
// 生成token
|
||||||
|
LoginHelper.loginByDevice(loginUser, DeviceType.PC);
|
||||||
|
recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"));
|
||||||
|
String tokenValue = StpUtil.getTokenValue();
|
||||||
|
return tokenValue;
|
||||||
|
}
|
||||||
|
if (user.getJurisdiction().equals(2L)) {
|
||||||
|
log.info("登录用户:{} 已被停用.", username);
|
||||||
|
throw new UserException("user.blocked", username);
|
||||||
|
}
|
||||||
|
LoginUser loginUser = buildLoginUser(user);
|
||||||
|
// 生成token
|
||||||
|
LoginHelper.loginByDevice(loginUser, DeviceType.PC);
|
||||||
|
recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"));
|
||||||
|
String tokenValue = StpUtil.getTokenValue();
|
||||||
|
return tokenValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,19 +1,25 @@
|
|||||||
package com.ruoyi.system.service.impl;
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.date.Month;
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.ruoyi.common.constant.Constants;
|
import com.ruoyi.common.constant.Constants;
|
||||||
import com.ruoyi.common.core.domain.PageQuery;
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
import com.ruoyi.common.helper.LoginHelper;
|
import com.ruoyi.common.helper.LoginHelper;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.utils.file.MyFileUtils;
|
import com.ruoyi.common.utils.file.MyFileUtils;
|
||||||
import com.ruoyi.common.utils.poi.DeleteFileUtil;
|
import com.ruoyi.common.utils.poi.DeleteFileUtil;
|
||||||
@ -27,13 +33,11 @@ import com.ruoyi.system.domain.dto.BuyHousesEvent;
|
|||||||
import com.ruoyi.system.domain.dto.DeclareListDTO;
|
import com.ruoyi.system.domain.dto.DeclareListDTO;
|
||||||
import com.ruoyi.system.domain.vo.BuyHousesVo;
|
import com.ruoyi.system.domain.vo.BuyHousesVo;
|
||||||
import com.ruoyi.system.domain.vo.MaterialModuleVo;
|
import com.ruoyi.system.domain.vo.MaterialModuleVo;
|
||||||
import com.ruoyi.system.mapper.BuyHousesMapper;
|
import com.ruoyi.system.mapper.*;
|
||||||
import com.ruoyi.system.mapper.BuyHousesMemberMapper;
|
|
||||||
import com.ruoyi.system.mapper.MaterialProofMapper;
|
|
||||||
import com.ruoyi.system.mapper.SubscribeExportMapper;
|
|
||||||
import com.ruoyi.system.service.IBuyHousesService;
|
import com.ruoyi.system.service.IBuyHousesService;
|
||||||
import com.ruoyi.work.domain.AuditLog;
|
import com.ruoyi.work.domain.AuditLog;
|
||||||
import com.ruoyi.work.domain.vo.ProcessVo;
|
import com.ruoyi.work.domain.vo.ProcessVo;
|
||||||
|
import com.ruoyi.work.dto.HousingConstructionBureauPushDto;
|
||||||
import com.ruoyi.work.mapper.AuditLogMapper;
|
import com.ruoyi.work.mapper.AuditLogMapper;
|
||||||
import com.ruoyi.work.utils.WorkComplyUtils;
|
import com.ruoyi.work.utils.WorkComplyUtils;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@ -52,10 +56,9 @@ import java.nio.file.Files;
|
|||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.concurrent.ExecutorService;
|
|
||||||
import java.util.concurrent.Executors;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 【请填写功能名称】Service业务层处理
|
* 【请填写功能名称】Service业务层处理
|
||||||
@ -79,7 +82,12 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
|||||||
@Value("${file.prefix}")
|
@Value("${file.prefix}")
|
||||||
private String prefix;
|
private String prefix;
|
||||||
|
|
||||||
private final String URL = "https://gx.chengdutalent.cn:8010/candidates/getCardId";
|
//正式地址
|
||||||
|
// private final String URL = "https://gx.chengdutalent.cn:8010/candidates/getCardId";
|
||||||
|
//测试地址
|
||||||
|
private final String URL = "https://mihuatang.xyz/gaoxin-api/candidates/getCardId";
|
||||||
|
//本地地址
|
||||||
|
// private final String URL = "http://127.0.0.1:8010/candidates/getCardId";
|
||||||
|
|
||||||
private final BuyHousesMapper baseMapper;
|
private final BuyHousesMapper baseMapper;
|
||||||
|
|
||||||
@ -93,6 +101,10 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
|||||||
|
|
||||||
private final AuditLogMapper auditLogMapper;
|
private final AuditLogMapper auditLogMapper;
|
||||||
|
|
||||||
|
private final HousingConstructionBureauPushDto housingConstructionBureauPushDto;
|
||||||
|
|
||||||
|
private final HousesReviewMapper housesReviewMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询【请填写功能名称】
|
* 查询【请填写功能名称】
|
||||||
@ -117,7 +129,7 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<BuyHousesVo> queryPageList(BuyHousesBo bo, PageQuery pageQuery) {
|
public TableDataInfo<BuyHousesVo> queryPageList(BuyHousesBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<BuyHouses> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<BuyHouses> lqw = buildQueryWrapper2(bo);
|
||||||
Page<BuyHousesVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<BuyHousesVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
}
|
}
|
||||||
@ -173,12 +185,60 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
|||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<BuyHouses> buildQueryWrapper2(BuyHousesBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<BuyHouses> lqw = Wrappers.lambdaQuery();
|
||||||
|
if (ObjectUtil.isNotNull(bo.getIds())){
|
||||||
|
lqw.in(BuyHouses::getId,bo.getIds());
|
||||||
|
}
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getInsidepageUrl()), BuyHouses::getInsidepageUrl, bo.getInsidepageUrl());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getCardId()), BuyHouses::getCardId, bo.getCardId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getCommitmentUrl()), BuyHouses::getCommitmentUrl, bo.getCommitmentUrl());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getCompanyAddress()), BuyHouses::getCompanyAddress, bo.getCompanyAddress());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getCompanyName()), BuyHouses::getCompanyName, bo.getCompanyName());
|
||||||
|
lqw.eq(bo.getCreateTime() != null, BuyHouses::getCreateTime, bo.getCreateTime());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getDeclarationUrl()), BuyHouses::getDeclarationUrl, bo.getDeclarationUrl());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getEducation()), BuyHouses::getEducation, bo.getEducation());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getFrontUrl()), BuyHouses::getFrontUrl, bo.getFrontUrl());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getGyStatus()), BuyHouses::getGyStatus, bo.getGyStatus());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getHomeRecordUrl()), BuyHouses::getHomeRecordUrl, bo.getHomeRecordUrl());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getHomepageUrl()), BuyHouses::getHomepageUrl, bo.getHomepageUrl());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getLaborContractUrl()), BuyHouses::getLaborContractUrl, bo.getLaborContractUrl());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getLicenseUrl()), BuyHouses::getLicenseUrl, bo.getLicenseUrl());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getMaritalStatus()), BuyHouses::getMaritalStatus, bo.getMaritalStatus());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getMaritalUrl()), BuyHouses::getMaritalUrl, bo.getMaritalUrl());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getNationality()), BuyHouses::getNationality, bo.getNationality());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getQyStatus()), BuyHouses::getQyStatus, bo.getQyStatus());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getReverseUrl()), BuyHouses::getReverseUrl, bo.getReverseUrl());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSex()), BuyHouses::getSex, bo.getSex());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getShStatus()), BuyHouses::getShStatus, bo.getShStatus());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSocialCode()), BuyHouses::getSocialCode, bo.getSocialCode());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSocialSecurityUrl()), BuyHouses::getSocialSecurityUrl, bo.getSocialSecurityUrl());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), BuyHouses::getStatus, bo.getStatus());
|
||||||
|
lqw.eq(bo.getUserId() != null, BuyHouses::getUserId, bo.getUserId());
|
||||||
|
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getProcessStatus()),BuyHouses::getProcessStatus,bo.getProcessStatus());
|
||||||
|
lqw.ge(StringUtils.isBlank(bo.getProcessStatus()),BuyHouses::getProcessStatus,Constants.SUCCEED);
|
||||||
|
lqw.and(StringUtils.isNotBlank(bo.getUserName()),t ->t.like(BuyHouses::getUserName,bo.getUserName())
|
||||||
|
.or().like(BuyHouses::getPhone,bo.getUserName())
|
||||||
|
.or().like(BuyHouses::getCardId,bo.getUserName()));
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getDistrict()),BuyHouses::getDistrict,bo.getDistrict());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getType()),BuyHouses::getType,bo.getType());
|
||||||
|
|
||||||
|
lqw.eq(bo.getPassTime() != null, BuyHouses::getPassTime, bo.getPassTime());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getPictureInformationUrl()), BuyHouses::getPictureInformationUrl, bo.getPictureInformationUrl());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getWorkAddress()), BuyHouses::getWorkAddress, bo.getWorkAddress());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增【请填写功能名称】
|
* 新增【请填写功能名称】
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean insertByBo(BuyHousesBo bo) {
|
public Boolean insertByBo(BuyHousesBo bo) {
|
||||||
|
Long userId = LoginHelper.getUserId();
|
||||||
|
bo.setUserId(userId);
|
||||||
//验证这个身份证是否提交过
|
//验证这个身份证是否提交过
|
||||||
List<BuyHouses> buyHouses = baseMapper.selectList(new LambdaQueryWrapper<>(BuyHouses.class)
|
List<BuyHouses> buyHouses = baseMapper.selectList(new LambdaQueryWrapper<>(BuyHouses.class)
|
||||||
.eq(BuyHouses::getCardId, bo.getCardId()));
|
.eq(BuyHouses::getCardId, bo.getCardId()));
|
||||||
@ -216,6 +276,8 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean updateByBo(BuyHousesBo bo) {
|
public Boolean updateByBo(BuyHousesBo bo) {
|
||||||
|
Long userId = LoginHelper.getUserId();
|
||||||
|
bo.setUserId(userId);
|
||||||
BuyHouses update = BeanUtil.toBean(bo, BuyHouses.class);
|
BuyHouses update = BeanUtil.toBean(bo, BuyHouses.class);
|
||||||
validEntityBeforeSave(update);
|
validEntityBeforeSave(update);
|
||||||
update.setProcessStatus(Constants.WAIT);
|
update.setProcessStatus(Constants.WAIT);
|
||||||
@ -243,19 +305,24 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
|||||||
//判断数据库中是否存在该人才通过身份证去验证
|
//判断数据库中是否存在该人才通过身份证去验证
|
||||||
Long userId = LoginHelper.getUserId();
|
Long userId = LoginHelper.getUserId();
|
||||||
BuyHouses buyHouses = baseMapper.selectOne(new LambdaQueryWrapper<>(BuyHouses.class).eq(BuyHouses::getUserId, userId));
|
BuyHouses buyHouses = baseMapper.selectOne(new LambdaQueryWrapper<>(BuyHouses.class).eq(BuyHouses::getUserId, userId));
|
||||||
if (!Constants.SUBMIT.equals(buyHouses.getProcessStatus()) && !Constants.FAILD.equals(buyHouses.getProcessStatus())){
|
if (ObjectUtil.isNotNull(buyHouses)) {
|
||||||
|
if (!Constants.SUBMIT.equals(buyHouses.getProcessStatus()) && !Constants.FAILD.equals(buyHouses.getProcessStatus())) {
|
||||||
throw new ServiceException("当前用户不可修改");
|
throw new ServiceException("当前用户不可修改");
|
||||||
}
|
}
|
||||||
//删除家庭情况信息
|
//删除家庭情况信息
|
||||||
buyHousesMemberMapper.delete(new LambdaQueryWrapper<>(BuyHousesMember.class).eq(BuyHousesMember::getBuyHousesId,buyHouses.getId()));
|
// buyHousesMemberMapper.delete(new LambdaQueryWrapper<>(BuyHousesMember.class).eq(BuyHousesMember::getBuyHousesId, buyHouses.getId()));
|
||||||
//先删除家庭信息表
|
//先删除家庭信息表
|
||||||
if (entity.getBuyHousesMemberList().size()>0) {
|
if (entity.getBuyHousesMemberList().size() > 0) {
|
||||||
buyHousesMemberMapper.delete( new LambdaQueryWrapper<>(BuyHousesMember.class).eq(BuyHousesMember::getBuyHousesId, entity.getId()));
|
buyHousesMemberMapper.delete(new LambdaQueryWrapper<>(BuyHousesMember.class).eq(BuyHousesMember::getBuyHousesId, entity.getId()));
|
||||||
//添加家庭信息
|
//添加家庭信息
|
||||||
entity.getBuyHousesMemberList().stream().forEach(e ->e.setBuyHousesId(String.valueOf(entity.getId())));
|
entity.getBuyHousesMemberList().stream().forEach(e -> {
|
||||||
|
e.setBuyHousesId(String.valueOf(entity.getId()));
|
||||||
|
e.setId(null);
|
||||||
|
});
|
||||||
buyHousesMemberMapper.insertBatch(entity.getBuyHousesMemberList());
|
buyHousesMemberMapper.insertBatch(entity.getBuyHousesMemberList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除【请填写功能名称】
|
* 批量删除【请填写功能名称】
|
||||||
@ -298,6 +365,7 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public R downloadWord(BuyHousesBo bo) {
|
public R downloadWord(BuyHousesBo bo) {
|
||||||
|
bo.setUserId(LoginHelper.getUserId());
|
||||||
BuyHouses buyHousesBo = BeanUtil.toBean(bo, BuyHouses.class);
|
BuyHouses buyHousesBo = BeanUtil.toBean(bo, BuyHouses.class);
|
||||||
validEntityBeforeSave(buyHousesBo);
|
validEntityBeforeSave(buyHousesBo);
|
||||||
LinkedHashMap<String, Object> map = new LinkedHashMap<>();
|
LinkedHashMap<String, Object> map = new LinkedHashMap<>();
|
||||||
@ -409,9 +477,11 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
|||||||
buyHousesDto.setPhone(String.valueOf(entries.get("phone")));
|
buyHousesDto.setPhone(String.valueOf(entries.get("phone")));
|
||||||
buyHousesDto.setCompanyName(String.valueOf(entries.get("companyName")));
|
buyHousesDto.setCompanyName(String.valueOf(entries.get("companyName")));
|
||||||
buyHousesDto.setSex(String.valueOf(entries.get("sex")));
|
buyHousesDto.setSex(String.valueOf(entries.get("sex")));
|
||||||
|
buyHousesDto.setEducation(String.valueOf(entries.get("education")));
|
||||||
buyHousesDto.setDistrict("1");
|
buyHousesDto.setDistrict("1");
|
||||||
buyHousesDto.setProcessStatus(Constants.SUBMIT);
|
buyHousesDto.setProcessStatus(Constants.SUBMIT);
|
||||||
buyHousesDto.setType(String.valueOf(entries.get("type")));
|
buyHousesDto.setType(String.valueOf(entries.get("type"))+"类");
|
||||||
|
buyHousesDto.setWorkAddress(String.valueOf(entries.get("district")));
|
||||||
buyHousesDto.setProcessKey("apply_house");
|
buyHousesDto.setProcessKey("apply_house");
|
||||||
return R.ok(buyHousesDto);
|
return R.ok(buyHousesDto);
|
||||||
}
|
}
|
||||||
@ -451,7 +521,7 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出列表
|
* 预约导出列表
|
||||||
* @param bo
|
* @param bo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -472,6 +542,7 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exportExcel(BuyHousesBo bo, HttpServletResponse response) {
|
public void exportExcel(BuyHousesBo bo, HttpServletResponse response) {
|
||||||
|
bo.setProcessStatus(Constants.SUCCEED);
|
||||||
LambdaQueryWrapper<BuyHouses> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<BuyHouses> lqw = buildQueryWrapper(bo);
|
||||||
List<BuyHousesVo> buyHousesVoList = baseMapper.selectVoList(lqw);
|
List<BuyHousesVo> buyHousesVoList = baseMapper.selectVoList(lqw);
|
||||||
ExcelUtil.exportExcel(buyHousesVoList,"人才列表", BuyHousesVo.class,response);
|
ExcelUtil.exportExcel(buyHousesVoList,"人才列表", BuyHousesVo.class,response);
|
||||||
@ -555,6 +626,9 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
|||||||
BuyHouses buyHouses = baseMapper.selectOne(new LambdaQueryWrapper<>(BuyHouses.class)
|
BuyHouses buyHouses = baseMapper.selectOne(new LambdaQueryWrapper<>(BuyHouses.class)
|
||||||
.eq(BuyHouses::getUserId,userId)
|
.eq(BuyHouses::getUserId,userId)
|
||||||
.eq(BuyHouses::getProcessStatus,Constants.SUCCEED));
|
.eq(BuyHouses::getProcessStatus,Constants.SUCCEED));
|
||||||
|
if (ObjectUtil.isNull(buyHouses)){
|
||||||
|
return R.fail("没有查询到该人才,请确保该人才已通过审核");
|
||||||
|
}
|
||||||
LinkedHashMap<String, Object> hashMap = new LinkedHashMap<>();
|
LinkedHashMap<String, Object> hashMap = new LinkedHashMap<>();
|
||||||
hashMap.put("companyName",buyHouses.getCompanyName());
|
hashMap.put("companyName",buyHouses.getCompanyName());
|
||||||
hashMap.put("companyAddress",buyHouses.getCompanyAddress());
|
hashMap.put("companyAddress",buyHouses.getCompanyAddress());
|
||||||
@ -573,6 +647,393 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> updateBuyHouses(BuyHouses buyHouses) {
|
||||||
|
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||||
|
buyHouses.setProcessStatus(Constants.CANCEL);
|
||||||
|
int i = baseMapper.updateById(buyHouses);
|
||||||
|
//添加取消资格日志
|
||||||
|
AuditLog auditLog = new AuditLog();
|
||||||
|
auditLog.setOtherId(String.valueOf(buyHouses.getId()));//业务id
|
||||||
|
auditLog.setProcessKey("apply_house");//流程key
|
||||||
|
auditLog.setAuditId(loginUser.getUserId().toString());//审核人id
|
||||||
|
auditLog.setReply(buyHouses.getReply());
|
||||||
|
auditLog.setAuditType("2");//审核类型
|
||||||
|
auditLog.setStatus("1");//审核状态
|
||||||
|
auditLog.setAudit(loginUser.getUserId().toString());
|
||||||
|
auditLog.setAdminUserName(loginUser.getUsername());
|
||||||
|
auditLog.setCreateTime(new Date());
|
||||||
|
auditLog.setUpdateTime(new Date());
|
||||||
|
auditLog.setStep("3");
|
||||||
|
auditLogMapper.insert(auditLog);
|
||||||
|
if (i>0){
|
||||||
|
//todo 推送
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("id",buyHouses.getId());
|
||||||
|
map.put("reason",buyHouses.getReply());//原因
|
||||||
|
map.put("userName",buyHouses.getUserName());
|
||||||
|
map.put("cardId",buyHouses.getCardId());
|
||||||
|
map.put("cancelTime", DateUtils.dateTime("yyyy-MM-dd HH:mm:ss"));
|
||||||
|
map.put("note","人才信息有误");//备注
|
||||||
|
map.put("status", "00N");
|
||||||
|
System.out.println("JSONUtil.toJsonPrettyStr(map) = " + JSONUtil.toJsonPrettyStr(map));
|
||||||
|
// housingConstructionBureauPushDto.openUrl("https://jcfw.cdzjryb.com//CCSRegistryCenter/rest",map,"254");
|
||||||
|
|
||||||
|
// housingConstructionBureauPushDto.openUrl("https://www.cdhtrct.com/route/open/api/anju/openBuyHousesCallback",map,"001");
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.fail();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对外推送接口
|
||||||
|
* @param buyHouses
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> insertOpenBuyHouses(BuyHouses buyHouses) {
|
||||||
|
BuyHouses buyHouses1 = baseMapper.selectOne(new LambdaQueryWrapper<>(BuyHouses.class).eq(BuyHouses::getCardId, buyHouses.getCardId()));
|
||||||
|
if (ObjectUtil.isNull(buyHouses1)){
|
||||||
|
//新增
|
||||||
|
if (ObjectUtil.isNull(buyHouses.getProcessStatus())){
|
||||||
|
return R.fail("状态不可为空");
|
||||||
|
}
|
||||||
|
buyHouses.setProcessKey("apply_house");
|
||||||
|
buyHouses.setCreateTime(new Date());
|
||||||
|
buyHouses.setUpdateTime(new Date());
|
||||||
|
int insert = baseMapper.insert(buyHouses);
|
||||||
|
if (insert==0){
|
||||||
|
return R.fail("新增失败");
|
||||||
|
}
|
||||||
|
//创建关系材料表
|
||||||
|
List<BuyHousesMember> buyHousesMemberList = buyHouses.getBuyHousesMemberList();
|
||||||
|
if (buyHousesMemberList.size()>0){
|
||||||
|
buyHousesMemberList.stream().forEach(b ->{
|
||||||
|
b.setBuyHousesId(String.valueOf(buyHouses.getId()));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
buyHousesMemberMapper.insertBatch(buyHousesMemberList);
|
||||||
|
|
||||||
|
}else {
|
||||||
|
//判断该人才是否存在
|
||||||
|
if (ObjectUtil.isEmpty(buyHouses1.getApiKey()) || !buyHouses.getUserId().equals(buyHouses1.getUserId())){
|
||||||
|
return R.fail("当前用户已在系统存在");
|
||||||
|
}
|
||||||
|
//判断当前是否可以提交
|
||||||
|
if (Constants.WAIT.equals(buyHouses1.getProcessStatus())
|
||||||
|
||Constants.SUCCEED.equals(buyHouses1.getProcessStatus())){
|
||||||
|
return R.fail("当前状态不允许修改");
|
||||||
|
}
|
||||||
|
buyHouses.setUpdateTime(new Date());
|
||||||
|
//删除关系表中得数据
|
||||||
|
buyHousesMemberMapper.delete(new LambdaQueryWrapper<>(BuyHousesMember.class).eq(BuyHousesMember::getBuyHousesId, buyHouses.getId()));
|
||||||
|
//修改数据
|
||||||
|
int i = baseMapper.updateById(buyHouses);
|
||||||
|
if (Constants.WAIT.equals(buyHouses.getProcessStatus()) && i==0){
|
||||||
|
return R.fail("修改失败");
|
||||||
|
}
|
||||||
|
//修改材料表中得数据
|
||||||
|
List<BuyHousesMember> buyHousesMemberList = buyHouses.getBuyHousesMemberList();
|
||||||
|
if (buyHousesMemberList.size()>0){
|
||||||
|
buyHousesMemberList.stream().forEach(b ->{
|
||||||
|
b.setBuyHousesId(buyHouses.getId().toString());
|
||||||
|
b.setId(null);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
buyHousesMemberMapper.insertBatch(buyHousesMemberList);
|
||||||
|
}
|
||||||
|
if (Constants.WAIT.equals(buyHouses1.getProcessStatus())){
|
||||||
|
//创建流程
|
||||||
|
//将数据添加到流程中
|
||||||
|
ProcessVo processVo = new ProcessVo();
|
||||||
|
processVo.setProcessKey("apply_house");
|
||||||
|
processVo.setStep("1");
|
||||||
|
Map<String, Object> map = BeanUtil.beanToMap(buyHouses);
|
||||||
|
processVo.setParams(map);
|
||||||
|
processVo.setBusinessId(buyHouses.getId().toString());
|
||||||
|
processVo.setStartUser(buyHouses.getUserName());
|
||||||
|
WorkComplyUtils.comply(processVo);
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> getIndexType() {
|
||||||
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
List<Map> mapList = baseMapper.getIndexType();
|
||||||
|
map.put("type",mapList);
|
||||||
|
AtomicReference<Integer> sum = new AtomicReference<>(0);
|
||||||
|
mapList.stream().forEach(m ->{
|
||||||
|
Object num = m.get("value");
|
||||||
|
if (ObjectUtil.isNotNull(num)){
|
||||||
|
sum.updateAndGet(v -> v + Integer.valueOf(String.valueOf(num)));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
map.put("sum",sum);
|
||||||
|
List<Map> actMapList = baseMapper.getActProcessList();
|
||||||
|
map.put("step",actMapList);
|
||||||
|
return R.ok(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页企业所在地展示
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> getCompanyDistrict() {
|
||||||
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
List<Map> list = baseMapper.getCompanyDistrict();
|
||||||
|
AtomicReference<Integer> sum = new AtomicReference<>(0);
|
||||||
|
list.stream().forEach(m ->{
|
||||||
|
Object num = m.get("value");
|
||||||
|
if (ObjectUtil.isNotNull(num)){
|
||||||
|
sum.updateAndGet(v -> v + Integer.valueOf(String.valueOf(num)));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
map.put("sum",sum);
|
||||||
|
map.put("district",list);
|
||||||
|
return R.ok(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> getNationalityAndMarital() {
|
||||||
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
List<Map> mapList= baseMapper.getNationality();
|
||||||
|
AtomicReference<Integer> nationalitySum = new AtomicReference<>(0);
|
||||||
|
mapList.stream().forEach(m ->{
|
||||||
|
Object num = m.get("value");
|
||||||
|
if (ObjectUtil.isNotNull(num)){
|
||||||
|
nationalitySum.updateAndGet(v -> v + Integer.valueOf(String.valueOf(num)));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
map.put("nationalitySum",nationalitySum);
|
||||||
|
map.put("nationality",mapList);
|
||||||
|
List<Map> maritalList = baseMapper.getMaritalStatus();
|
||||||
|
AtomicReference<Integer> maritalSum = new AtomicReference<>(0);
|
||||||
|
maritalList.stream().forEach(m ->{
|
||||||
|
Object num = m.get("value");
|
||||||
|
if (ObjectUtil.isNotNull(num)){
|
||||||
|
maritalSum.updateAndGet(v -> v + Integer.valueOf(String.valueOf(num)));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
map.put("maritalSum",maritalSum);
|
||||||
|
map.put("marital",maritalList);
|
||||||
|
return R.ok(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页第一排基础数据展示
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R getBasicData() {
|
||||||
|
//获取一期认定通过人才数
|
||||||
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
Long aLong = baseMapper.selectCount(new LambdaQueryWrapper<>(BuyHouses.class)
|
||||||
|
.eq(BuyHouses::getProcessStatus, Constants.SUCCEED));
|
||||||
|
map.put("oneSum",aLong);
|
||||||
|
//获取二期认定通过人才数
|
||||||
|
List<HousesReview> housesReviewList = housesReviewMapper.selectList(new LambdaQueryWrapper<>(HousesReview.class)
|
||||||
|
.eq(HousesReview::getProcessStatus, Constants.SUCCEED));
|
||||||
|
map.put("twoSum",housesReviewList.size());
|
||||||
|
//获取二期市级和区级比例
|
||||||
|
//市级
|
||||||
|
int twoMunicipal = housesReviewList.stream().filter(f -> f.getSourceBy().equals("2")).collect(Collectors.toList()).size();
|
||||||
|
double div2 = NumberUtil.div(twoMunicipal,housesReviewList.size());
|
||||||
|
String twoMunicipalDecimalFormat = NumberUtil.decimalFormat("#.##%", div2);
|
||||||
|
map.put("twoMunicipal",twoMunicipalDecimalFormat);
|
||||||
|
//区级
|
||||||
|
int twoDistrict = housesReviewList.stream().filter(f -> f.getSourceBy().equals("1")).collect(Collectors.toList()).size();
|
||||||
|
double div1 = NumberUtil.div(twoDistrict,housesReviewList.size());
|
||||||
|
String twoDistrictDecimalFormat = NumberUtil.decimalFormat("#.##%", div1);
|
||||||
|
map.put("twoDistrict",twoDistrictDecimalFormat);
|
||||||
|
//获取本月复审通过数
|
||||||
|
Date date = DateUtil.date();
|
||||||
|
//获得月份,从0开始计数
|
||||||
|
int month = DateUtil.month(date);
|
||||||
|
List<HousesReview> housesReviewStream = housesReviewList.stream().filter(h -> h.getPassTime().getMonth() == month).collect(Collectors.toList());
|
||||||
|
map.put("monthSum",housesReviewStream.size());
|
||||||
|
//筛选区级人才数
|
||||||
|
int size = housesReviewList.stream().filter(h -> h.getSourceBy().equals("1")).collect(Collectors.toList()).size();
|
||||||
|
double div = NumberUtil.div(size,aLong.intValue());
|
||||||
|
String decimalFormat = NumberUtil.decimalFormat("#.##%", div);
|
||||||
|
//获取复审占比
|
||||||
|
map.put("decimalFormat",decimalFormat);
|
||||||
|
return R.ok(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复审柱状图统计图
|
||||||
|
* @param date
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R getHistogram(String date) {
|
||||||
|
//查询出所有的数据
|
||||||
|
QueryWrapper<HousesReview> queryWrapper = new QueryWrapper<>();
|
||||||
|
if (ObjectUtil.isNull(date)){
|
||||||
|
queryWrapper.eq(ObjectUtil.isNotNull(date),"DATE_FORMAT(create_time,'%Y')", DateUtils.getDate());
|
||||||
|
}else {
|
||||||
|
queryWrapper.eq("DATE_FORMAT(create_time,'%Y')", date);
|
||||||
|
}
|
||||||
|
queryWrapper.eq("process_status",Constants.SUCCEED);
|
||||||
|
List<HousesReview> housesReviewList = housesReviewMapper.selectList(queryWrapper);
|
||||||
|
//区级
|
||||||
|
List<Integer> districtList = new ArrayList<>();
|
||||||
|
//市级
|
||||||
|
List<Integer> municipalList = new ArrayList<>();
|
||||||
|
//获取第一个月的数据
|
||||||
|
List<HousesReview> collect = housesReviewList.stream().filter(h -> h.getPassTime().getMonth() == 0).collect(Collectors.toList());
|
||||||
|
if (collect.size()>0){
|
||||||
|
//区分区级还是市级
|
||||||
|
int size = collect.stream().filter(c -> c.getSourceBy().equals("1")).collect(Collectors.toList()).size();
|
||||||
|
int size1 = collect.stream().filter(c -> c.getSourceBy().equals("2")).collect(Collectors.toList()).size();
|
||||||
|
districtList.add(size);
|
||||||
|
municipalList.add(size1);
|
||||||
|
}else {
|
||||||
|
districtList.add(0);
|
||||||
|
municipalList.add(0);
|
||||||
|
}
|
||||||
|
//获取第一个月的数据
|
||||||
|
List<HousesReview> collect1 = housesReviewList.stream().filter(h -> h.getPassTime().getMonth() == 1).collect(Collectors.toList());
|
||||||
|
if (collect1.size()>0){
|
||||||
|
//区分区级还是市级
|
||||||
|
int size = collect1.stream().filter(c -> c.getSourceBy().equals("1")).collect(Collectors.toList()).size();
|
||||||
|
int size1 = collect1.stream().filter(c -> c.getSourceBy().equals("2")).collect(Collectors.toList()).size();
|
||||||
|
districtList.add(size);
|
||||||
|
municipalList.add(size1);
|
||||||
|
}else {
|
||||||
|
districtList.add(0);
|
||||||
|
municipalList.add(0);
|
||||||
|
}
|
||||||
|
//获取第一个月的数据
|
||||||
|
List<HousesReview> collect2 = housesReviewList.stream().filter(h -> h.getPassTime().getMonth() == 2).collect(Collectors.toList());
|
||||||
|
if (collect2.size()>0){
|
||||||
|
//区分区级还是市级
|
||||||
|
int size = collect2.stream().filter(c -> c.getSourceBy().equals("1")).collect(Collectors.toList()).size();
|
||||||
|
int size1 = collect2.stream().filter(c -> c.getSourceBy().equals("2")).collect(Collectors.toList()).size();
|
||||||
|
districtList.add(size);
|
||||||
|
municipalList.add(size1);
|
||||||
|
}else {
|
||||||
|
districtList.add(0);
|
||||||
|
municipalList.add(0);
|
||||||
|
}
|
||||||
|
//获取第一个月的数据
|
||||||
|
List<HousesReview> collect3 = housesReviewList.stream().filter(h -> h.getPassTime().getMonth() == 3).collect(Collectors.toList());
|
||||||
|
if (collect3.size()>0){
|
||||||
|
//区分区级还是市级
|
||||||
|
int size = collect3.stream().filter(c -> c.getSourceBy().equals("1")).collect(Collectors.toList()).size();
|
||||||
|
int size1 = collect3.stream().filter(c -> c.getSourceBy().equals("2")).collect(Collectors.toList()).size();
|
||||||
|
districtList.add(size);
|
||||||
|
municipalList.add(size1);
|
||||||
|
}else {
|
||||||
|
districtList.add(0);
|
||||||
|
municipalList.add(0);
|
||||||
|
}
|
||||||
|
//获取第一个月的数据
|
||||||
|
List<HousesReview> collect4 = housesReviewList.stream().filter(h -> h.getPassTime().getMonth() == 4).collect(Collectors.toList());
|
||||||
|
if (collect4.size()>0){
|
||||||
|
//区分区级还是市级
|
||||||
|
int size = collect4.stream().filter(c -> c.getSourceBy().equals("1")).collect(Collectors.toList()).size();
|
||||||
|
int size1 = collect4.stream().filter(c -> c.getSourceBy().equals("2")).collect(Collectors.toList()).size();
|
||||||
|
districtList.add(size);
|
||||||
|
municipalList.add(size1);
|
||||||
|
}else {
|
||||||
|
districtList.add(0);
|
||||||
|
municipalList.add(0);
|
||||||
|
}
|
||||||
|
//获取第一个月的数据
|
||||||
|
List<HousesReview> collect5 = housesReviewList.stream().filter(h -> h.getPassTime().getMonth() == 5).collect(Collectors.toList());
|
||||||
|
if (collect5.size()>0){
|
||||||
|
//区分区级还是市级
|
||||||
|
int size = collect5.stream().filter(c -> c.getSourceBy().equals("1")).collect(Collectors.toList()).size();
|
||||||
|
int size1 = collect5.stream().filter(c -> c.getSourceBy().equals("2")).collect(Collectors.toList()).size();
|
||||||
|
districtList.add(size);
|
||||||
|
municipalList.add(size1);
|
||||||
|
}else {
|
||||||
|
districtList.add(0);
|
||||||
|
municipalList.add(0);
|
||||||
|
}
|
||||||
|
//获取第一个月的数据
|
||||||
|
List<HousesReview> collect6 = housesReviewList.stream().filter(h -> h.getPassTime().getMonth() == 6).collect(Collectors.toList());
|
||||||
|
if (collect6.size()>0){
|
||||||
|
//区分区级还是市级
|
||||||
|
int size = collect6.stream().filter(c -> c.getSourceBy().equals("1")).collect(Collectors.toList()).size();
|
||||||
|
int size1 = collect6.stream().filter(c -> c.getSourceBy().equals("2")).collect(Collectors.toList()).size();
|
||||||
|
districtList.add(size);
|
||||||
|
municipalList.add(size1);
|
||||||
|
}else {
|
||||||
|
districtList.add(0);
|
||||||
|
municipalList.add(0);
|
||||||
|
}//获取第一个月的数据
|
||||||
|
List<HousesReview> collect7 = housesReviewList.stream().filter(h -> h.getPassTime().getMonth() == 7).collect(Collectors.toList());
|
||||||
|
if (collect7.size()>0){
|
||||||
|
//区分区级还是市级
|
||||||
|
int size = collect7.stream().filter(c -> c.getSourceBy().equals("1")).collect(Collectors.toList()).size();
|
||||||
|
int size1 = collect7.stream().filter(c -> c.getSourceBy().equals("2")).collect(Collectors.toList()).size();
|
||||||
|
districtList.add(size);
|
||||||
|
municipalList.add(size1);
|
||||||
|
}else {
|
||||||
|
districtList.add(0);
|
||||||
|
municipalList.add(0);
|
||||||
|
}//获取第一个月的数据
|
||||||
|
List<HousesReview> collect8 = housesReviewList.stream().filter(h -> h.getPassTime().getMonth() == 8).collect(Collectors.toList());
|
||||||
|
if (collect8.size()>0){
|
||||||
|
//区分区级还是市级
|
||||||
|
int size = collect8.stream().filter(c -> c.getSourceBy().equals("1")).collect(Collectors.toList()).size();
|
||||||
|
int size1 = collect8.stream().filter(c -> c.getSourceBy().equals("2")).collect(Collectors.toList()).size();
|
||||||
|
districtList.add(size);
|
||||||
|
municipalList.add(size1);
|
||||||
|
}else {
|
||||||
|
districtList.add(0);
|
||||||
|
municipalList.add(0);
|
||||||
|
}
|
||||||
|
//获取第一个月的数据
|
||||||
|
List<HousesReview> collect9 = housesReviewList.stream().filter(h -> h.getPassTime().getMonth() == 9).collect(Collectors.toList());
|
||||||
|
if (collect9.size()>0){
|
||||||
|
//区分区级还是市级
|
||||||
|
int size = collect9.stream().filter(c -> c.getSourceBy().equals("1")).collect(Collectors.toList()).size();
|
||||||
|
int size1 = collect9.stream().filter(c -> c.getSourceBy().equals("2")).collect(Collectors.toList()).size();
|
||||||
|
districtList.add(size);
|
||||||
|
municipalList.add(size1);
|
||||||
|
}else {
|
||||||
|
districtList.add(0);
|
||||||
|
municipalList.add(0);
|
||||||
|
}
|
||||||
|
//获取第一个月的数据
|
||||||
|
List<HousesReview> collect10 = housesReviewList.stream().filter(h -> h.getPassTime().getMonth() == 10).collect(Collectors.toList());
|
||||||
|
if (collect10.size()>0){
|
||||||
|
//区分区级还是市级
|
||||||
|
int size = collect10.stream().filter(c -> c.getSourceBy().equals("1")).collect(Collectors.toList()).size();
|
||||||
|
int size1 = collect10.stream().filter(c -> c.getSourceBy().equals("2")).collect(Collectors.toList()).size();
|
||||||
|
districtList.add(size);
|
||||||
|
municipalList.add(size1);
|
||||||
|
}else {
|
||||||
|
districtList.add(0);
|
||||||
|
municipalList.add(0);
|
||||||
|
}
|
||||||
|
//获取第一个月的数据
|
||||||
|
List<HousesReview> collect11 = housesReviewList.stream().filter(h -> h.getPassTime().getMonth() == 11).collect(Collectors.toList());
|
||||||
|
if (collect11.size()>0){
|
||||||
|
//区分区级还是市级
|
||||||
|
int size = collect11.stream().filter(c -> c.getSourceBy().equals("1")).collect(Collectors.toList()).size();
|
||||||
|
int size1 = collect11.stream().filter(c -> c.getSourceBy().equals("2")).collect(Collectors.toList()).size();
|
||||||
|
districtList.add(size);
|
||||||
|
municipalList.add(size1);
|
||||||
|
}else {
|
||||||
|
districtList.add(0);
|
||||||
|
municipalList.add(0);
|
||||||
|
}
|
||||||
|
HashMap<Object, Object> map = new HashMap<>();
|
||||||
|
map.put("district",districtList);
|
||||||
|
map.put("municipal",municipalList);
|
||||||
|
map.put("sum",housesReviewList.size());
|
||||||
|
return R.ok(map);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 起步执行导出zip
|
* 起步执行导出zip
|
||||||
* @param event
|
* @param event
|
||||||
@ -616,7 +1077,7 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
|||||||
MyFileUtils.downLoadPic(insidepageUrl, fileName);
|
MyFileUtils.downLoadPic(insidepageUrl, fileName);
|
||||||
}
|
}
|
||||||
//申请表
|
//申请表
|
||||||
/*if (ObjectUtil.isNotEmpty(r.getCommitmentUrl())){
|
if (ObjectUtil.isNotEmpty(r.getCommitmentUrl())){
|
||||||
String commitmentUrl = r.getCommitmentUrl();
|
String commitmentUrl = r.getCommitmentUrl();
|
||||||
String fileName= s + "申请表" + commitmentUrl.substring(commitmentUrl.lastIndexOf("."));
|
String fileName= s + "申请表" + commitmentUrl.substring(commitmentUrl.lastIndexOf("."));
|
||||||
MyFileUtils.downLoadPic(commitmentUrl, fileName);
|
MyFileUtils.downLoadPic(commitmentUrl, fileName);
|
||||||
@ -698,9 +1159,9 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
|||||||
String pictureInformationUrl = r.getPictureInformationUrl();
|
String pictureInformationUrl = r.getPictureInformationUrl();
|
||||||
String fileName= s + "人才影像卡" + pictureInformationUrl.substring(pictureInformationUrl.lastIndexOf("."));
|
String fileName= s + "人才影像卡" + pictureInformationUrl.substring(pictureInformationUrl.lastIndexOf("."));
|
||||||
MyFileUtils.downLoadPic(pictureInformationUrl, fileName);
|
MyFileUtils.downLoadPic(pictureInformationUrl, fileName);
|
||||||
}*/
|
}
|
||||||
//家庭信息
|
//家庭信息
|
||||||
/* List<BuyHousesMember> buyHousesMembers = buyHousesMemberMap.get(r.getId().toString());
|
List<BuyHousesMember> buyHousesMembers = buyHousesMemberMap.get(r.getId().toString());
|
||||||
if (ObjectUtil.isNotNull(buyHousesMembers)) {
|
if (ObjectUtil.isNotNull(buyHousesMembers)) {
|
||||||
buyHousesMembers.stream().forEach(m -> {
|
buyHousesMembers.stream().forEach(m -> {
|
||||||
System.out.println("m = " + m);
|
System.out.println("m = " + m);
|
||||||
@ -727,7 +1188,7 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}*/
|
}
|
||||||
});
|
});
|
||||||
String p = path + separator + title + ".xlsx";
|
String p = path + separator + title + ".xlsx";
|
||||||
String fo = filePath + separator + format + ".zip";
|
String fo = filePath + separator + format + ".zip";
|
||||||
|
|||||||
@ -35,7 +35,6 @@ import org.springframework.context.event.EventListener;
|
|||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
@ -53,7 +52,6 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Service
|
@Service
|
||||||
|
|
||||||
public class HousesReviewServiceImpl implements IHousesReviewService {
|
public class HousesReviewServiceImpl implements IHousesReviewService {
|
||||||
|
|
||||||
private final HousesReviewMapper baseMapper;
|
private final HousesReviewMapper baseMapper;
|
||||||
@ -113,12 +111,48 @@ public class HousesReviewServiceImpl implements IHousesReviewService {
|
|||||||
return baseMapper.selectVoList(lqw);
|
return baseMapper.selectVoList(lqw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<HousesReview> buildQueryWrapper3(HousesReviewBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<HousesReview> lqw = Wrappers.lambdaQuery();
|
||||||
|
if (ObjectUtil.isNotNull(bo.getIds())){
|
||||||
|
lqw.in(HousesReview::getId,bo.getIds());
|
||||||
|
}
|
||||||
|
lqw.and(StringUtils.isNotBlank(bo.getName()),t ->
|
||||||
|
t.like(HousesReview::getName,bo.getName())
|
||||||
|
.or().like(HousesReview::getCard,bo.getName())
|
||||||
|
.or().like(HousesReview::getProjectName,bo.getName()));
|
||||||
|
lqw.orderByDesc(HousesReview::getUpdateTime);
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getCardType()), HousesReview::getCardType, bo.getCardType());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getQualification()), HousesReview::getQualification, bo.getQualification());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getAuditTime()), HousesReview::getAuditTime, bo.getAuditTime());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getPresellCard()), HousesReview::getPresellCard, bo.getPresellCard());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getDealType()), HousesReview::getDealType, bo.getDealType());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getProjectArea()), HousesReview::getProjectArea, bo.getProjectArea());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getQualificationConfirmTime()), HousesReview::getQualificationConfirmTime, bo.getQualificationConfirmTime());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getQualificationPreApplyTime()), HousesReview::getQualificationPreApplyTime, bo.getQualificationPreApplyTime());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getFamilyType()), HousesReview::getFamilyType, bo.getFamilyType());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), HousesReview::getStatus, bo.getStatus());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getRegisterFailureTime()), HousesReview::getRegisterFailureTime, bo.getRegisterFailureTime());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getNationality()), HousesReview::getNationality, bo.getNationality());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getMaritalStatus()), HousesReview::getMaritalStatus, bo.getMaritalStatus());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getCompanyType()), HousesReview::getCompanyType, bo.getCompanyType());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getCompanyName()), HousesReview::getCompanyName, bo.getCompanyName());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getTalentsType()), HousesReview::getTalentsType, bo.getTalentsType());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getCreditCode()), HousesReview::getCreditCode, bo.getCreditCode());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getCompanyAddress()), HousesReview::getCompanyAddress, bo.getCompanyAddress());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSourceBy()), HousesReview::getSourceBy, bo.getSourceBy());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getProcessStatus()), HousesReview::getProcessStatus, bo.getProcessStatus());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
private LambdaQueryWrapper<HousesReview> buildQueryWrapper2(HousesReviewBo bo) {
|
private LambdaQueryWrapper<HousesReview> buildQueryWrapper2(HousesReviewBo bo) {
|
||||||
Map<String, Object> params = bo.getParams();
|
Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<HousesReview> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<HousesReview> lqw = Wrappers.lambdaQuery();
|
||||||
if (ObjectUtil.isNotNull(bo.getIds())){
|
if (ObjectUtil.isNotNull(bo.getIds())){
|
||||||
lqw.in(HousesReview::getId,bo.getIds());
|
lqw.in(HousesReview::getId,bo.getIds());
|
||||||
}
|
}
|
||||||
|
lqw.orderByAsc(HousesReview::getProcessStatus);
|
||||||
|
lqw.orderByDesc(HousesReview::getUpdateTime);
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getCardType()), HousesReview::getCardType, bo.getCardType());
|
lqw.eq(StringUtils.isNotBlank(bo.getCardType()), HousesReview::getCardType, bo.getCardType());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getCard()), HousesReview::getCard, bo.getCard());
|
lqw.eq(StringUtils.isNotBlank(bo.getCard()), HousesReview::getCard, bo.getCard());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getName()), HousesReview::getName, bo.getName());
|
lqw.like(StringUtils.isNotBlank(bo.getName()), HousesReview::getName, bo.getName());
|
||||||
@ -216,6 +250,8 @@ public class HousesReviewServiceImpl implements IHousesReviewService {
|
|||||||
throw new ServiceException("当前人才状态不允许提交");
|
throw new ServiceException("当前人才状态不允许提交");
|
||||||
}
|
}
|
||||||
bo.setProcessStatus(Constants.WAIT);
|
bo.setProcessStatus(Constants.WAIT);
|
||||||
|
|
||||||
|
// todo 注释原因:驳回重新提交资料后,以前的资料能否保存历史记录,可以查看
|
||||||
//先删除存在的家庭情况关系表
|
//先删除存在的家庭情况关系表
|
||||||
buyHousesReviewMemberMapper.delete( new LambdaQueryWrapper<BuyHousesReviewMember>()
|
buyHousesReviewMemberMapper.delete( new LambdaQueryWrapper<BuyHousesReviewMember>()
|
||||||
.eq(BuyHousesReviewMember::getBuyHousesId, bo.getId()));
|
.eq(BuyHousesReviewMember::getBuyHousesId, bo.getId()));
|
||||||
@ -223,13 +259,34 @@ public class HousesReviewServiceImpl implements IHousesReviewService {
|
|||||||
materialProofMapper.delete(new LambdaQueryWrapper<MaterialProof>()
|
materialProofMapper.delete(new LambdaQueryWrapper<MaterialProof>()
|
||||||
.eq(MaterialProof::getHouseId, bo.getId())
|
.eq(MaterialProof::getHouseId, bo.getId())
|
||||||
.eq(MaterialProof::getProcessKey,"house_review"));
|
.eq(MaterialProof::getProcessKey,"house_review"));
|
||||||
|
Integer number=1;
|
||||||
|
// 获取当前关系材料的最新一条数据
|
||||||
|
/* Integer number=1;
|
||||||
|
BuyHousesReviewMember buyHousesReviewMember = buyHousesReviewMemberMapper.selectOne(new LambdaQueryWrapper<>(BuyHousesReviewMember.class)
|
||||||
|
.eq(BuyHousesReviewMember::getBuyHousesId, bo.getId())
|
||||||
|
.orderByDesc(BuyHousesReviewMember::getUpdateTime));
|
||||||
|
if (ObjectUtil.isNotNull(buyHousesReviewMember)){
|
||||||
|
number+=buyHousesReviewMember.getNumber();
|
||||||
|
}
|
||||||
|
|
||||||
if (ObjectUtil.isNotNull(bo.getBuyHousesMemberList()) && bo.getBuyHousesMemberList().size()>0){
|
if (ObjectUtil.isNotNull(bo.getBuyHousesMemberList()) && bo.getBuyHousesMemberList().size()>0){
|
||||||
bo.getBuyHousesMemberList().stream().forEach( e ->{
|
Integer finalNumber = number;
|
||||||
|
bo.getBuyHousesMemberList().stream().forEach(e ->{
|
||||||
e.setBuyHousesId(bo.getId().toString());
|
e.setBuyHousesId(bo.getId().toString());
|
||||||
|
e.setNumber(finalNumber);
|
||||||
|
});
|
||||||
|
buyHousesReviewMemberMapper.insertBatch(bo.getBuyHousesMemberList());
|
||||||
|
}*/
|
||||||
|
if (ObjectUtil.isNotNull(bo.getBuyHousesMemberList()) && bo.getBuyHousesMemberList().size()>0) {
|
||||||
|
Integer finalNumber = number;
|
||||||
|
bo.getBuyHousesMemberList().forEach(e -> {
|
||||||
|
e.setBuyHousesId(bo.getId().toString());
|
||||||
|
e.setId(null);
|
||||||
|
e.setNumber(finalNumber);
|
||||||
});
|
});
|
||||||
buyHousesReviewMemberMapper.insertBatch(bo.getBuyHousesMemberList());
|
buyHousesReviewMemberMapper.insertBatch(bo.getBuyHousesMemberList());
|
||||||
}
|
}
|
||||||
|
//获取
|
||||||
if(ObjectUtil.isNotNull(bo.getMaterialsList()) && bo.getMaterialsList().size()>0){
|
if(ObjectUtil.isNotNull(bo.getMaterialsList()) && bo.getMaterialsList().size()>0){
|
||||||
ArrayList<MaterialProof> list = new ArrayList<>();
|
ArrayList<MaterialProof> list = new ArrayList<>();
|
||||||
bo.getMaterialsList().forEach(e ->{
|
bo.getMaterialsList().forEach(e ->{
|
||||||
@ -267,7 +324,13 @@ public class HousesReviewServiceImpl implements IHousesReviewService {
|
|||||||
if (!"D".equals(entity.getTalentsType())){
|
if (!"D".equals(entity.getTalentsType())){
|
||||||
entity.setTypeExtend(null);
|
entity.setTypeExtend(null);
|
||||||
}
|
}
|
||||||
//TODO 做一些数据校验,如唯一约束
|
//如果是区级没有企业类型且D类不区分学历和技能
|
||||||
|
if (entity.getSourceBy().equals("1")){
|
||||||
|
entity.setCompanyType(null);
|
||||||
|
if (entity.getTalentsType().equals("D")){
|
||||||
|
entity.setTypeExtend(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -306,7 +369,20 @@ public class HousesReviewServiceImpl implements IHousesReviewService {
|
|||||||
|| Constants.SUCCEED.equals(housesReview.getProcessStatus())){
|
|| Constants.SUCCEED.equals(housesReview.getProcessStatus())){
|
||||||
}else {
|
}else {
|
||||||
HousesReview update = BeanUtil.toBean(bo, HousesReview.class);
|
HousesReview update = BeanUtil.toBean(bo, HousesReview.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
//家庭信息修改,先删除,再增加
|
||||||
|
/*buyHousesReviewMemberMapper.delete(new LambdaQueryWrapper<>(BuyHousesReviewMember.class).eq(BuyHousesReviewMember::getBuyHousesId,bo.getId()));
|
||||||
|
if (bo.getBuyHousesMemberList().size()>0){
|
||||||
|
bo.getBuyHousesMemberList().forEach(t ->{
|
||||||
|
t.setId(null);
|
||||||
|
t.setBuyHousesId(String.valueOf(bo.getId()));
|
||||||
|
});
|
||||||
|
buyHousesReviewMemberMapper.insertBatch(bo.getBuyHousesMemberList());
|
||||||
|
}*/
|
||||||
baseMapper.updateById(update);
|
baseMapper.updateById(update);
|
||||||
|
Map<String, Object> map = BeanUtil.beanToMap(update);
|
||||||
|
List<MaterialModuleVo> materialInfo = materialModuleService.getMaterialInfo(map);
|
||||||
|
return R.ok(materialInfo);
|
||||||
}
|
}
|
||||||
Map<String, Object> map = BeanUtil.beanToMap(bo);
|
Map<String, Object> map = BeanUtil.beanToMap(bo);
|
||||||
List<MaterialModuleVo> materialInfo = materialModuleService.getMaterialInfo(map);
|
List<MaterialModuleVo> materialInfo = materialModuleService.getMaterialInfo(map);
|
||||||
@ -346,7 +422,7 @@ public class HousesReviewServiceImpl implements IHousesReviewService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public R subscribeExport(HousesReviewEvent bo) throws IOException {
|
public R subscribeExport(HousesReviewEvent bo){
|
||||||
Long userId = LoginHelper.getUserId();
|
Long userId = LoginHelper.getUserId();
|
||||||
bo.setExcelUserId(userId.toString());
|
bo.setExcelUserId(userId.toString());
|
||||||
SpringUtils.context().publishEvent(bo);
|
SpringUtils.context().publishEvent(bo);
|
||||||
@ -360,26 +436,41 @@ public class HousesReviewServiceImpl implements IHousesReviewService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void exportExcel(HousesReviewBo bo, HttpServletResponse response) {
|
public void exportExcel(HousesReviewBo bo, HttpServletResponse response) {
|
||||||
|
bo.setProcessStatus(Constants.SUCCEED);
|
||||||
LambdaQueryWrapper<HousesReview> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<HousesReview> lqw = buildQueryWrapper(bo);
|
||||||
List<HousesReviewVo> housesReviews = baseMapper.selectVoList(lqw);
|
List<HousesReviewVo> housesReviews = baseMapper.selectVoList(lqw);
|
||||||
ExcelUtil.exportExcel(housesReviews,"人才列表", HousesReviewVo.class,response);
|
ExcelUtil.exportExcel(housesReviews,"人才列表", HousesReviewVo.class,response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据库统计
|
||||||
|
* @param bo
|
||||||
|
* @param pageQuery
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<HousesReview> managerQueryPageList(HousesReviewBo bo, PageQuery pageQuery) {
|
||||||
|
bo.setProcessStatus(Constants.SUCCEED);
|
||||||
|
LambdaQueryWrapper<HousesReview> lqw = buildQueryWrapper3(bo);
|
||||||
|
Page<HousesReview> result = baseMapper.selectPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
@Async
|
@Async
|
||||||
@EventListener
|
@EventListener
|
||||||
public void export(HousesReviewEvent event) throws IOException {
|
public void export(HousesReviewEvent event) throws IOException {
|
||||||
HousesReviewBo bo = BeanUtil.toBean(event, HousesReviewBo.class);
|
HousesReviewBo bo = BeanUtil.toBean(event, HousesReviewBo.class);
|
||||||
LambdaQueryWrapper<HousesReview> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<HousesReview> lqw = buildQueryWrapper3(bo);
|
||||||
List<HousesReview> housesReviews = baseMapper.selectList(lqw);
|
List<HousesReviewVo> housesReviews = baseMapper.selectVoList(lqw);
|
||||||
if (housesReviews.size() > 0) {
|
|
||||||
List<Long> collect = housesReviews.stream().map(HousesReview::getId).collect(Collectors.toList());
|
|
||||||
List<MaterialProof> materialProofList = materialProofMapper.selectList(new LambdaQueryWrapper<>(MaterialProof.class).in(MaterialProof::getHouseId, collect));
|
|
||||||
//根据业务id进行分组
|
|
||||||
Map<String, List<MaterialProof>> collectMap = materialProofList.stream().collect(Collectors.groupingBy(MaterialProof::getHouseId));
|
|
||||||
String title = "人才认定申请表";
|
String title = "人才认定申请表";
|
||||||
String separator = File.separator;
|
String separator = File.separator;
|
||||||
String format = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
|
String format = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
|
||||||
String path = filePath + separator + format;
|
String path = filePath + separator + format;
|
||||||
|
if (housesReviews.size() > 0) {
|
||||||
|
List<Long> collect = housesReviews.stream().map(HousesReviewVo::getId).collect(Collectors.toList());
|
||||||
|
List<MaterialProof> materialProofList = materialProofMapper.selectList(new LambdaQueryWrapper<>(MaterialProof.class).in(MaterialProof::getHouseId, collect));
|
||||||
|
//根据业务id进行分组
|
||||||
|
Map<String, List<MaterialProof>> collectMap = materialProofList.stream().collect(Collectors.groupingBy(MaterialProof::getHouseId));
|
||||||
housesReviews.stream().forEach(r -> {
|
housesReviews.stream().forEach(r -> {
|
||||||
List<MaterialProof> materialProofs = collectMap.get(r.getId().toString());
|
List<MaterialProof> materialProofs = collectMap.get(r.getId().toString());
|
||||||
if (materialProofs.size()>0) {
|
if (materialProofs.size()>0) {
|
||||||
@ -391,7 +482,7 @@ public class HousesReviewServiceImpl implements IHousesReviewService {
|
|||||||
}
|
}
|
||||||
String s = userNameFile + separator + r.getName() + "--";
|
String s = userNameFile + separator + r.getName() + "--";
|
||||||
String file = p.getFile();
|
String file = p.getFile();
|
||||||
MyFileUtils.downLoadPic(file, s + p.getDescription() + file.substring(file.lastIndexOf(".")));
|
MyFileUtils.downLoadPic(file, s + p.getMaterialName() + file.substring(file.lastIndexOf(".")));
|
||||||
System.out.println("file = " + file);
|
System.out.println("file = " + file);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -408,7 +499,7 @@ public class HousesReviewServiceImpl implements IHousesReviewService {
|
|||||||
}
|
}
|
||||||
file.createNewFile();
|
file.createNewFile();
|
||||||
OutputStream outXlsx = new FileOutputStream(p);
|
OutputStream outXlsx = new FileOutputStream(p);
|
||||||
ExcelUtil.exportExcel(housesReviews,"111",HousesReview.class,outXlsx);
|
ExcelUtil.exportExcel(housesReviews,"111",HousesReviewVo.class,outXlsx);
|
||||||
outXlsx.close();
|
outXlsx.close();
|
||||||
ZipUtils.toZip(path, fo, true);
|
ZipUtils.toZip(path, fo, true);
|
||||||
System.out.println("path = " + path);
|
System.out.println("path = " + path);
|
||||||
@ -421,7 +512,7 @@ public class HousesReviewServiceImpl implements IHousesReviewService {
|
|||||||
subscribeExport.setPath(url);
|
subscribeExport.setPath(url);
|
||||||
subscribeExport.setDescription(event.getDescription());
|
subscribeExport.setDescription(event.getDescription());
|
||||||
subscribeExport.setProcessKey("house_review");
|
subscribeExport.setProcessKey("house_review");
|
||||||
subscribeExport.setUserId(LoginHelper.getUserId().toString());
|
subscribeExport.setUserId(event.getExcelUserId());
|
||||||
subscribeExportMapper.insert(subscribeExport);
|
subscribeExportMapper.insert(subscribeExport);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,161 @@
|
|||||||
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.ruoyi.common.constant.CacheConstants;
|
||||||
|
import com.ruoyi.common.constant.CacheNames;
|
||||||
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
|
import com.ruoyi.common.utils.JsonUtils;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.ruoyi.common.utils.redis.CacheUtils;
|
||||||
|
import com.ruoyi.rsaencrypt.service.IRsaSecurityService2;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.cache.annotation.CachePut;
|
||||||
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.system.domain.bo.RsaSecurityBo;
|
||||||
|
import com.ruoyi.system.domain.vo.RsaSecurityVo;
|
||||||
|
import com.ruoyi.common.core.domain.RsaSecurity;
|
||||||
|
import com.ruoyi.system.mapper.RsaSecurityMapper;
|
||||||
|
import com.ruoyi.system.service.IRsaSecurityService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求RSA数据加解密Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-05-17
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class RsaSecurityServiceImpl implements IRsaSecurityService, IRsaSecurityService2 {
|
||||||
|
|
||||||
|
private final RsaSecurityMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询请求RSA数据加解密
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public RsaSecurityVo queryById(Long id){
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询请求RSA数据加解密列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<RsaSecurityVo> queryPageList(RsaSecurityBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<RsaSecurity> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<RsaSecurityVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询请求RSA数据加解密列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<RsaSecurityVo> queryList(RsaSecurityBo bo) {
|
||||||
|
LambdaQueryWrapper<RsaSecurity> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<RsaSecurity> buildQueryWrapper(RsaSecurityBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<RsaSecurity> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getPath()), RsaSecurity::getPath, bo.getPath());
|
||||||
|
lqw.eq(bo.getInDecode() != null, RsaSecurity::getInDecode, bo.getInDecode());
|
||||||
|
lqw.eq(bo.getOutEncode() != null, RsaSecurity::getOutEncode, bo.getOutEncode());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getPublicKey()), RsaSecurity::getPublicKey, bo.getPublicKey());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getPrivateKey()), RsaSecurity::getPrivateKey, bo.getPrivateKey());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getMethod()), RsaSecurity::getMethod, bo.getMethod());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getRestricted()), RsaSecurity::getRestricted, bo.getRestricted());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增请求RSA数据加解密
|
||||||
|
*/
|
||||||
|
@CachePut(cacheNames = CacheNames.RSA_SECURITY, key = "#bo.path+':'+#bo.method")
|
||||||
|
@Override
|
||||||
|
public RsaSecurity insertByBo(RsaSecurityBo bo) {
|
||||||
|
RsaSecurity add = BeanUtil.toBean(bo, RsaSecurity.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
return baseMapper.selectById(add.getId());
|
||||||
|
}
|
||||||
|
throw new ServiceException("操作失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改请求RSA数据加解密
|
||||||
|
*/
|
||||||
|
@CachePut(cacheNames = CacheNames.RSA_SECURITY, key = "#bo.path+':'+#bo.method")
|
||||||
|
@Override
|
||||||
|
public RsaSecurity updateByBo(RsaSecurityBo bo) {
|
||||||
|
RsaSecurity update = BeanUtil.toBean(bo, RsaSecurity.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
boolean flag = baseMapper.updateById(update) > 0;
|
||||||
|
if (flag) {
|
||||||
|
return baseMapper.selectById(update.getId());
|
||||||
|
}
|
||||||
|
throw new ServiceException("操作失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(RsaSecurity entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
//判断path是否已经存在
|
||||||
|
boolean exists = baseMapper.exists(
|
||||||
|
new LambdaQueryWrapper<>(RsaSecurity.class)
|
||||||
|
.eq(RsaSecurity::getPath, entity.getPath())
|
||||||
|
.eq(RsaSecurity::getMethod, entity.getMethod())
|
||||||
|
.ne(ObjectUtil.isNotNull(entity.getId()), RsaSecurity::getId, entity.getId()));
|
||||||
|
if (exists){
|
||||||
|
throw new ServiceException("当前路径path已存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 查询缓存中的path
|
||||||
|
*/
|
||||||
|
public RsaSecurity getInfo(String path,String method){
|
||||||
|
Object o = CacheUtils.get(CacheNames.RSA_SECURITY, path+":"+method);
|
||||||
|
if (ObjectUtil.isNotNull(o)){
|
||||||
|
return JsonUtils.parseObject(JsonUtils.toJsonString(o), RsaSecurity.class);
|
||||||
|
}
|
||||||
|
return baseMapper.selectOne(new LambdaQueryWrapper<>(RsaSecurity.class)
|
||||||
|
.eq(RsaSecurity::getPath,path)
|
||||||
|
.eq(RsaSecurity::getMethod,method));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void loadingRsaSecurityCache(){
|
||||||
|
List<RsaSecurity> rsaSecurities = baseMapper.selectList();
|
||||||
|
CacheUtils.clear(CacheNames.RSA_SECURITY);
|
||||||
|
rsaSecurities.forEach(r ->{
|
||||||
|
CacheUtils.put(CacheNames.RSA_SECURITY, r.getPath()+":"+r.getMethod(), r);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 批量删除请求RSA数据加解密
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -59,6 +59,7 @@ public class SubscribeExportServiceImpl implements ISubscribeExportService {
|
|||||||
public TableDataInfo<SubscribeExportVo> queryPageList(SubscribeExportBo bo, PageQuery pageQuery) {
|
public TableDataInfo<SubscribeExportVo> queryPageList(SubscribeExportBo bo, PageQuery pageQuery) {
|
||||||
bo.setUserId(LoginHelper.getUserId().toString());
|
bo.setUserId(LoginHelper.getUserId().toString());
|
||||||
LambdaQueryWrapper<SubscribeExport> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<SubscribeExport> lqw = buildQueryWrapper(bo);
|
||||||
|
lqw.orderByDesc(SubscribeExport::getCreateTime);
|
||||||
Page<SubscribeExportVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<SubscribeExportVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -235,7 +235,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService
|
|||||||
@Override
|
@Override
|
||||||
public String getDictLabel(String dictType, String dictValue, String separator) {
|
public String getDictLabel(String dictType, String dictValue, String separator) {
|
||||||
// 优先从本地缓存获取
|
// 优先从本地缓存获取
|
||||||
List<SysDictData> datas = (List<SysDictData>) SaHolder.getStorage().get(CacheConstants.SYS_DICT_KEY + dictType);
|
List<SysDictData> datas = (List<SysDictData>) CacheUtils.get(CacheNames.SYS_DICT, dictType);
|
||||||
if (ObjectUtil.isNull(datas)) {
|
if (ObjectUtil.isNull(datas)) {
|
||||||
datas = SpringUtils.getAopProxy(this).selectDictDataByType(dictType);
|
datas = SpringUtils.getAopProxy(this).selectDictDataByType(dictType);
|
||||||
SaHolder.getStorage().set(CacheConstants.SYS_DICT_KEY + dictType, datas);
|
SaHolder.getStorage().set(CacheConstants.SYS_DICT_KEY + dictType, datas);
|
||||||
|
|||||||
@ -42,8 +42,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="processKey" column="process_key"/>
|
<result property="processKey" column="process_key"/>
|
||||||
<result property="processStatus" column="process_status"/>
|
<result property="processStatus" column="process_status"/>
|
||||||
<result property="version" column="version"/>
|
<result property="version" column="version"/>
|
||||||
|
<result property="apiKey" column="api_key"/>
|
||||||
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
<select id="getIndexType" resultType="java.util.Map">
|
||||||
|
SELECT type as 'name',COUNT(type) AS 'value' FROM `buy_houses` WHERE process_status = 5 GROUP BY type ORDER BY type
|
||||||
|
</select>
|
||||||
|
<select id="getActProcessList" resultType="java.util.Map">
|
||||||
|
SELECT (
|
||||||
|
CASE WHEN step='1' THEN '受理中'
|
||||||
|
WHEN step ='2' THEN '初审中'
|
||||||
|
WHEN step = '3' THEN '审定中'
|
||||||
|
ELSE '' END) AS `name`, COUNT(step) AS 'value' FROM act_process WHERE process_id IN(SELECT id FROM `process` WHERE process_key = 'apply_house') GROUP BY step;
|
||||||
|
</select>
|
||||||
|
<select id="getCompanyDistrict" resultType="java.util.Map">
|
||||||
|
SELECT (
|
||||||
|
CASE WHEN district='1' THEN '数字经济局'
|
||||||
|
WHEN district = '3' THEN '高新西区'
|
||||||
|
WHEN district = '4' THEN '生物城'
|
||||||
|
WHEN district ='2' THEN '交子公园金融商务区'
|
||||||
|
ELSE '' END) AS `name`,COUNT(DISTINCT company_name,district) AS 'value' FROM buy_houses WHERE process_status = 5 GROUP BY district
|
||||||
|
</select>
|
||||||
|
<select id="getNationality" resultType="java.util.Map">
|
||||||
|
SELECT nationality as 'name',COUNT(nationality) AS 'value' FROM buy_houses WHERE process_status=5 GROUP BY nationality;
|
||||||
|
</select>
|
||||||
|
<select id="getMaritalStatus" resultType="java.util.Map">
|
||||||
|
SELECT (
|
||||||
|
CASE WHEN marital_status='1' THEN '未婚'
|
||||||
|
WHEN marital_status ='2' THEN '已婚'
|
||||||
|
WHEN marital_status = '3' THEN '离异'
|
||||||
|
ELSE '' END) as 'name',COUNT(marital_status) AS 'value' FROM buy_houses WHERE process_status=5 GROUP BY marital_status;
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="createBy" column="create_by"/>
|
<result property="createBy" column="create_by"/>
|
||||||
<result property="updateBy" column="update_by"/>
|
<result property="updateBy" column="update_by"/>
|
||||||
<result property="updateTime" column="update_time"/>
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="number" column="number"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<resultMap type="com.ruoyi.system.domain.MaterialProof" id="MaterialProofResult">
|
<resultMap type="com.ruoyi.system.domain.MaterialProof" id="MaterialProofResult">
|
||||||
<result property="id" column="id"/>
|
<result property="id" column="id"/>
|
||||||
<result property="houseId" column="house_id"/>
|
<result property="houseId" column="house_id"/>
|
||||||
<result property="getCreateTime" column="create_time"/>
|
<result property="createTime" column="create_time"/>
|
||||||
<result property="status" column="status"/>
|
<result property="status" column="status"/>
|
||||||
<result property="modulePathId" column="module_path_id"/>
|
<result property="modulePathId" column="module_path_id"/>
|
||||||
<result property="file" column="file"/>
|
<result property="file" column="file"/>
|
||||||
@ -19,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="updateBy" column="update_by"/>
|
<result property="updateBy" column="update_by"/>
|
||||||
<result property="createBy" column="create_by"/>
|
<result property="createBy" column="create_by"/>
|
||||||
<result property="materialName" column="material_name"/>
|
<result property="materialName" column="material_name"/>
|
||||||
|
<result property="number" column="number"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.system.mapper.RsaSecurityMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.ruoyi.common.core.domain.RsaSecurity" id="RsaSecurityResult">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="path" column="path"/>
|
||||||
|
<result property="inDecode" column="in_decode"/>
|
||||||
|
<result property="outEncode" column="out_encode"/>
|
||||||
|
<result property="publicKey" column="public_key"/>
|
||||||
|
<result property="privateKey" column="private_key"/>
|
||||||
|
<result property="method" column="method"/>
|
||||||
|
<result property="restricted" column="restricted"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -18,16 +18,21 @@ import com.ruoyi.work.domain.TProcess;
|
|||||||
import com.ruoyi.work.domain.vo.ProcessVo;
|
import com.ruoyi.work.domain.vo.ProcessVo;
|
||||||
import com.ruoyi.work.dto.BusinessDTO;
|
import com.ruoyi.work.dto.BusinessDTO;
|
||||||
import com.ruoyi.work.dto.HisProcessVoResultDto;
|
import com.ruoyi.work.dto.HisProcessVoResultDto;
|
||||||
|
import com.ruoyi.work.dto.HousingConstructionBureauPushDto;
|
||||||
import com.ruoyi.work.dto.ProcessVoResultDto;
|
import com.ruoyi.work.dto.ProcessVoResultDto;
|
||||||
import com.ruoyi.work.mapper.ProcessMapper;
|
import com.ruoyi.work.mapper.ProcessMapper;
|
||||||
import com.ruoyi.work.utils.WorkComplyUtils;
|
import com.ruoyi.work.utils.WorkComplyUtils;
|
||||||
import com.ruoyi.work.utils.WorkUtils;
|
import com.ruoyi.work.utils.WorkUtils;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公共流程相关
|
* 公共流程相关
|
||||||
@ -39,6 +44,7 @@ import java.util.Map;
|
|||||||
@Transactional
|
@Transactional
|
||||||
public class WorkController extends BaseController {
|
public class WorkController extends BaseController {
|
||||||
private final ProcessMapper processMapper;
|
private final ProcessMapper processMapper;
|
||||||
|
private final HousingConstructionBureauPushDto housingConstructionBureauPushDto;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取待办
|
* 获取待办
|
||||||
@ -131,10 +137,34 @@ public class WorkController extends BaseController {
|
|||||||
}
|
}
|
||||||
Map<String, Object> map = WorkUtils.getInfoToMap(tProcesses.get(0).getBean(),hisProcess.getBusinessId());
|
Map<String, Object> map = WorkUtils.getInfoToMap(tProcesses.get(0).getBean(),hisProcess.getBusinessId());
|
||||||
hisProcess.setParams(map);
|
hisProcess.setParams(map);
|
||||||
String s = WorkComplyUtils.batchDeleted(hisProcess);
|
String s = WorkComplyUtils.batchDeleted(hisProcess,tProcesses.stream().map(TProcess::getId).collect(Collectors.toList()));
|
||||||
|
HashMap<String, Object> hashMap = new HashMap<>();
|
||||||
|
hashMap.put("id", String.valueOf(map.get("id")));
|
||||||
if (s.equals(Constants.NONENTITY)){
|
if (s.equals(Constants.NONENTITY)){
|
||||||
return R.fail("暂无审核");
|
return R.fail("暂无审核");
|
||||||
}else{
|
}else{
|
||||||
|
/* if (Constants.SUCCEED.equals(s)){//审核成功推送数据
|
||||||
|
//公园城市局推送
|
||||||
|
String virtualcode = String.valueOf(map.get("virtualcode"));
|
||||||
|
map.put("virtualcode", virtualcode == "3" ? "010" : "009");
|
||||||
|
String cardType = String.valueOf(map.get("cardType"));
|
||||||
|
map.put("cardType", "中国籍".equals(cardType) ? 1 : 4);
|
||||||
|
map.put("qyStatus", "4");
|
||||||
|
map.put("gyStatus", "4");
|
||||||
|
map.put("shStatus", "4");
|
||||||
|
map.put("buyHousesMemberList", "null");
|
||||||
|
map.put("buyHousesLogList", "null");
|
||||||
|
map.put("buyHousesLogList", "null");
|
||||||
|
housingConstructionBureauPushDto.openUrl("https://jcfw.cdzjryb.com//CCSRegistryCenter/rest",map,"253");
|
||||||
|
//人才通推送
|
||||||
|
hashMap.put("status", "00T");
|
||||||
|
}else if (Constants.FAILD.equals(s)){
|
||||||
|
hashMap.put("status", "00N");
|
||||||
|
hashMap.put("description",hisProcess.getReply());
|
||||||
|
}else {
|
||||||
|
hashMap.put("status", "00D");
|
||||||
|
}
|
||||||
|
housingConstructionBureauPushDto.openUrl("https://www.cdhtrct.com/route/open/api/anju/openBuyHousesCallback",hashMap,"");*/
|
||||||
processMapper.updateCommonByBusinessId(tProcesses.get(0).getBean(),s, hisProcess.getBusinessId());
|
processMapper.updateCommonByBusinessId(tProcesses.get(0).getBean(),s, hisProcess.getBusinessId());
|
||||||
}
|
}
|
||||||
System.out.println("s = " + s);
|
System.out.println("s = " + s);
|
||||||
|
|||||||
@ -84,4 +84,13 @@ public class ActProcess {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String processKey;
|
private String processKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 证件号码
|
||||||
|
*/
|
||||||
|
private String cardId;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String apiKey;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,7 +44,7 @@ public class HisProcess{
|
|||||||
*/
|
*/
|
||||||
private String checkType;
|
private String checkType;
|
||||||
/**
|
/**
|
||||||
* 1fail(失败),2success(成功)
|
* 1(失败),2(成功)
|
||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
@ -109,6 +109,12 @@ public class HisProcess{
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String companyId;
|
private String companyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 证件号码
|
||||||
|
*/
|
||||||
|
private String cardId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -57,5 +57,10 @@ public class ActProcessBo {
|
|||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 证件号码
|
||||||
|
*/
|
||||||
|
private String cardId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,5 +62,10 @@ public class HisProcessBo extends BaseEntity {
|
|||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 证件号码
|
||||||
|
*/
|
||||||
|
private String cardId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,5 +77,12 @@ public class ActProcessVo {
|
|||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 证件号码
|
||||||
|
*/
|
||||||
|
private String cardId;
|
||||||
|
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,5 +83,10 @@ public class HisProcessVo {
|
|||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 证件号码
|
||||||
|
*/
|
||||||
|
private String cardId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import com.ruoyi.common.convert.ExcelDictConvert;
|
|||||||
import com.ruoyi.work.domain.AuditLog;
|
import com.ruoyi.work.domain.AuditLog;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -123,6 +124,7 @@ public class ProcessVo {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<ActProcessVo> actProcessVoList;
|
private List<ActProcessVo> actProcessVoList;
|
||||||
|
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,193 @@
|
|||||||
|
package com.ruoyi.work.dto;
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.codec.Base64;
|
||||||
|
import cn.hutool.crypto.symmetric.AES;
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.ruoyi.work.utils.CCSMessageDigest;
|
||||||
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.security.SecureRandom;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class HousingConstructionBureauPushDto {
|
||||||
|
|
||||||
|
//默认编码 成都市
|
||||||
|
private static final String DEFAULT_REGIONCODE = "510100";
|
||||||
|
|
||||||
|
/* public String send(String url, Map<String,Object> map, String interfaceId) throws Exception {
|
||||||
|
*//* Map<Object, Object> params = new HashMap<>();
|
||||||
|
params.put("virtualcode", buyHouses.getDistrict().equals("3") ? "010" : "009");//区县统一编码
|
||||||
|
params.put("id", buyHouses.getId());
|
||||||
|
params.put("userId", buyHouses.getUserId());
|
||||||
|
params.put("userName", buyHouses.getUserName());
|
||||||
|
params.put("phone", buyHouses.getPhone());
|
||||||
|
params.put("sex", buyHouses.getSex());
|
||||||
|
params.put("education", buyHouses.getEducation());//学历
|
||||||
|
params.put("type", buyHouses.getType());
|
||||||
|
params.put("status", "10");
|
||||||
|
params.put("district", buyHouses.getDistrict());//企业所在地
|
||||||
|
params.put("socialCode", buyHouses.getSocialCode());//统一社会信用代码
|
||||||
|
params.put("companyName", buyHouses.getCompanyName());//
|
||||||
|
params.put("companyAddress", buyHouses.getCompanyAddress());
|
||||||
|
params.put("licenseUrl", buyHouses.getLicenseUrl());
|
||||||
|
params.put("nationality", buyHouses.getNationality());
|
||||||
|
params.put("cardId", buyHouses.getCardId());
|
||||||
|
params.put("frontUrl", buyHouses.getFrontUrl());
|
||||||
|
params.put("reverseUrl", buyHouses.getReverseUrl());
|
||||||
|
params.put("homepageUrl", buyHouses.getHomepageUrl());
|
||||||
|
params.put("insidepageUrl", buyHouses.getInsidepageUrl());
|
||||||
|
params.put("maritalStatus", buyHouses.getMaritalStatus());
|
||||||
|
params.put("maritalUrl", buyHouses.getMaritalUrl());
|
||||||
|
params.put("laborContractUrl", buyHouses.getLaborContractUrl());
|
||||||
|
params.put("socialSecurityUrl", buyHouses.getSocialSecurityUrl());
|
||||||
|
params.put("homeRecordUrl", buyHouses.getHomeRecordUrl());
|
||||||
|
params.put("declarationUrl", buyHouses.getDeclarationUrl());
|
||||||
|
params.put("commitmentUrl", buyHouses.getCommitmentUrl());
|
||||||
|
params.put("cardType", "中国籍".equals(buyHouses.getNationality()) ? 1 : 4);
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
params.put("creatTime", sdf.format(buyHouses.getAffTime()));
|
||||||
|
params.put("qyStatus", "4");
|
||||||
|
params.put("gyStatus", "4");
|
||||||
|
params.put("shStatus", "4");
|
||||||
|
params.put("buyHousesMemberList", "null");
|
||||||
|
params.put("buyHousesLogList", "null");
|
||||||
|
params.put("buyHousesLogList", "null");*//*
|
||||||
|
// RestTemplate restTemplate = new RestTemplate(generateHttpRequestFactory());
|
||||||
|
//调用接口
|
||||||
|
String result2 = HttpRequest.post(url)
|
||||||
|
// .header("Referer","http://119.96.86.131:8010")
|
||||||
|
.body(JSONObject.toJSONString(httpRequestBody))
|
||||||
|
.execute().body();
|
||||||
|
System.out.println("result2 = " + result2);
|
||||||
|
String result = restTemplate.postForObject(url, createRequestBody(map, interfaceId), String.class);
|
||||||
|
System.out.println(result);
|
||||||
|
return result;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
public String openUrl(String url,Map<String, Object> param, String interfaceId) {
|
||||||
|
final HttpRequestBody httpRequestBody = new HttpRequestBody();
|
||||||
|
httpRequestBody.setRegioncode(DEFAULT_REGIONCODE);
|
||||||
|
httpRequestBody.setData(param);
|
||||||
|
final String nonce = new SecureRandom().nextInt() + "";
|
||||||
|
httpRequestBody.setNonce(nonce);
|
||||||
|
httpRequestBody.setApiKey(interfaceId);
|
||||||
|
httpRequestBody.setPassword("GaoxinTalentHouse123");
|
||||||
|
httpRequestBody.setLoginid("GaoxinTalentHouse");
|
||||||
|
final String timestamp = DateFormatUtils.format(new Date(), "yyyyMMddHHmmss");
|
||||||
|
httpRequestBody.setTimestamp(timestamp);
|
||||||
|
final String authenticationKey = Base64.encode("GaoxinTalentHouse: GaoxinTalentHouse123:" + timestamp);
|
||||||
|
httpRequestBody.setAuthenticationKey(authenticationKey);
|
||||||
|
//签名
|
||||||
|
final CCSMessageDigest digest = CCSMessageDigest.getInstance();
|
||||||
|
String signature = null;
|
||||||
|
try {
|
||||||
|
signature = digest.getSignature(timestamp, nonce, "GaoxinTalentHouse");
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
httpRequestBody.setSignature(signature);
|
||||||
|
//调用接口
|
||||||
|
String result2 = HttpRequest.post(url)
|
||||||
|
.body(JSONUtil.toJsonPrettyStr(httpRequestBody))
|
||||||
|
.execute().body();
|
||||||
|
System.out.println("result2 = " + result2);
|
||||||
|
return result2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String send3(HashMap params,String url){
|
||||||
|
//基本信息数据
|
||||||
|
HttpRequestBody httpRequestBody = new HttpRequestBody();
|
||||||
|
httpRequestBody.setApiKey("001");
|
||||||
|
AES aes = new AES("CBC", "PKCS7Padding",
|
||||||
|
// 密钥,可以自定义
|
||||||
|
"0123456789ABHAEQ".getBytes(),
|
||||||
|
// iv加盐,按照实际需求添加
|
||||||
|
"DYgjCEIMVrj2W9xN".getBytes());
|
||||||
|
String encryptHex = aes.encryptHex(JSONUtil.toJsonPrettyStr(params));
|
||||||
|
httpRequestBody.setData(encryptHex);
|
||||||
|
final String nonce = new SecureRandom().nextInt() + "";
|
||||||
|
httpRequestBody.setNonce(nonce);
|
||||||
|
httpRequestBody.setPassword("GaoxinTalentHouse123");
|
||||||
|
httpRequestBody.setLoginid("GaoxinTalentHouse");
|
||||||
|
final String timestamp = DateFormatUtils.format(new Date(), "yyyyMMddHHmmss");
|
||||||
|
httpRequestBody.setTimestamp(timestamp);
|
||||||
|
final String authenticationKey = Base64.encode("GaoxinTalentHouse: GaoxinTalentHouse123:" + timestamp);
|
||||||
|
httpRequestBody.setAuthenticationKey(authenticationKey);
|
||||||
|
//签名
|
||||||
|
final CCSMessageDigest digest = CCSMessageDigest.getInstance();
|
||||||
|
String signature = null;
|
||||||
|
try {
|
||||||
|
signature = digest.getSignature(timestamp, nonce, "GaoxinTalentHouse");
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
httpRequestBody.setSignature(signature);
|
||||||
|
//调用接口
|
||||||
|
String result2 = HttpRequest.post(url)
|
||||||
|
.body(JSONUtil.toJsonPrettyStr(httpRequestBody))
|
||||||
|
.execute().body();
|
||||||
|
System.out.println("result2 = " + result2);
|
||||||
|
return result2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* public String send1(String url, Map<String,Object> params, String interfaceId) throws Exception {
|
||||||
|
*//*BuyHouses byKey = buyHousesService.getByKey(disqualificationDto.getId());
|
||||||
|
Map<Object, Object> params = new HashMap<>();
|
||||||
|
params.put("virtualcode", byKey.getDistrict() == "3" ? "010" : "009");//区县统一编码
|
||||||
|
params.put("userName", byKey.getUserName());
|
||||||
|
params.put("cardId", byKey.getCardId());
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
params.put("cancelTime", sdf.format(new Date()));
|
||||||
|
params.put("reason", disqualificationDto.getReason());
|
||||||
|
params.put("note", disqualificationDto.getNote());
|
||||||
|
// String s1 = HttpRequest.https(url,createRequestBody(params,interfaceId));
|
||||||
|
RestTemplate restTemplate = new RestTemplate(generateHttpRequestFactory());*//*
|
||||||
|
|
||||||
|
String result = restTemplate.postForObject(url, createRequestBody(params, interfaceId), String.class);
|
||||||
|
return result;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
public String send3(LinkedHashMap params,String url){
|
||||||
|
//基本信息数据
|
||||||
|
HttpRequestBody httpRequestBody = new HttpRequestBody();
|
||||||
|
httpRequestBody.setApiKey("001");
|
||||||
|
AES aes = new AES("CBC", "PKCS7Padding",
|
||||||
|
// 密钥,可以自定义
|
||||||
|
"0123456789ABHAEQ".getBytes(),
|
||||||
|
// iv加盐,按照实际需求添加
|
||||||
|
"DYgjCEIMVrj2W9xN".getBytes());
|
||||||
|
String encryptHex = aes.encryptHex(JSONUtil.toJsonPrettyStr(params));
|
||||||
|
httpRequestBody.setData(encryptHex);
|
||||||
|
final String nonce = new SecureRandom().nextInt() + "";
|
||||||
|
httpRequestBody.setNonce(nonce);
|
||||||
|
httpRequestBody.setPassword("GaoxinTalentHouse123");
|
||||||
|
httpRequestBody.setLoginid("GaoxinTalentHouse");
|
||||||
|
final String timestamp = DateFormatUtils.format(new Date(), "yyyyMMddHHmmss");
|
||||||
|
httpRequestBody.setTimestamp(timestamp);
|
||||||
|
final String authenticationKey = Base64.encode("GaoxinTalentHouse: GaoxinTalentHouse123:" + timestamp);
|
||||||
|
httpRequestBody.setAuthenticationKey(authenticationKey);
|
||||||
|
//签名
|
||||||
|
final CCSMessageDigest digest = CCSMessageDigest.getInstance();
|
||||||
|
String signature = null;
|
||||||
|
try {
|
||||||
|
signature = digest.getSignature(timestamp, nonce, "GaoxinTalentHouse");
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
httpRequestBody.setSignature(signature);
|
||||||
|
//调用接口
|
||||||
|
String result2 = HttpRequest.post(url)
|
||||||
|
// .header("Referer","http://119.96.86.131:8010")
|
||||||
|
.body(JSONUtil.toJsonPrettyStr(httpRequestBody))
|
||||||
|
.execute().body();
|
||||||
|
System.out.println("result2 = " + result2);
|
||||||
|
return result2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
package com.ruoyi.work.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class HttpRequestBody implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -6634653494662614388L;
|
||||||
|
|
||||||
|
// 用户名
|
||||||
|
private String loginid;
|
||||||
|
// 密码
|
||||||
|
private String password;
|
||||||
|
// 请求体
|
||||||
|
private Object data;
|
||||||
|
// 区域编码
|
||||||
|
private String regioncode;
|
||||||
|
// usbKey
|
||||||
|
private String key;
|
||||||
|
// 加密需要验证的签名
|
||||||
|
private String signature;
|
||||||
|
// 时间戳
|
||||||
|
private String timestamp;
|
||||||
|
// 随机数
|
||||||
|
private String nonce;
|
||||||
|
//
|
||||||
|
private String apiKey;
|
||||||
|
// 文件上传
|
||||||
|
// @JSONField(serialize = false)
|
||||||
|
private List<MultipartFile> addFiles;
|
||||||
|
// base64编码后的字符串
|
||||||
|
// loginid:password:timestamp
|
||||||
|
private String authenticationKey;
|
||||||
|
//setter getter 省略
|
||||||
|
}
|
||||||
@ -0,0 +1,168 @@
|
|||||||
|
package com.ruoyi.work.utils;
|
||||||
|
|
||||||
|
import cn.hutool.core.codec.Base64;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.crypto.symmetric.AES;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.work.dto.HttpRequestBody;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
public final class CCSMessageDigest {
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(CCSMessageDigest.class);
|
||||||
|
private final MessageDigest digest;
|
||||||
|
|
||||||
|
private CCSMessageDigest() {
|
||||||
|
try {
|
||||||
|
digest = MessageDigest.getInstance("SHA-1");
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new InternalError("init MessageDigest error:"
|
||||||
|
+ e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取单例
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static CCSMessageDigest getInstance() {
|
||||||
|
return SingletonHolder.INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将字节数组转换成16进制字符串
|
||||||
|
*
|
||||||
|
* @param b
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private static String byte2hex(byte[] b) {
|
||||||
|
StringBuilder sbDes = new StringBuilder();
|
||||||
|
String tmp = null;
|
||||||
|
for (int i = 0; i < b.length; i++) {
|
||||||
|
tmp = (Integer.toHexString(b[i] & 0xFF));
|
||||||
|
if (tmp.length() == 1) {
|
||||||
|
sbDes.append("0");
|
||||||
|
}
|
||||||
|
sbDes.append(tmp);
|
||||||
|
}
|
||||||
|
return sbDes.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
String signature = "f86944503c10e7caefe35d6bc19a67e6e8d0e564";// 加密需要验证的签名
|
||||||
|
String timestamp = "1371608072";// 时间戳
|
||||||
|
String nonce = "1372170854";// 随机数
|
||||||
|
|
||||||
|
CCSMessageDigest wxDigest = CCSMessageDigest.getInstance();
|
||||||
|
boolean bValid = wxDigest.validate(signature, timestamp, nonce,
|
||||||
|
"111111");
|
||||||
|
if (bValid) {
|
||||||
|
System.out.println("token 验证成功!");
|
||||||
|
} else {
|
||||||
|
System.out.println("token 验证失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加密
|
||||||
|
*
|
||||||
|
* @param strSrc
|
||||||
|
* @return
|
||||||
|
* @throws UnsupportedEncodingException
|
||||||
|
*/
|
||||||
|
private String encrypt(String strSrc) throws UnsupportedEncodingException {
|
||||||
|
String strDes = null;
|
||||||
|
byte[] bt = strSrc.getBytes(StandardCharsets.UTF_8);
|
||||||
|
digest.update(bt);
|
||||||
|
strDes = byte2hex(digest.digest());
|
||||||
|
return strDes;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验请求的签名是否合法
|
||||||
|
* <p>
|
||||||
|
* 加密/校验流程: 1. 将token、timestamp、nonce三个参数进行字典序排序 2. 将三个参数字符串拼接成一个字符串进行sha1加密
|
||||||
|
* 3. 开发者获得加密后的字符串可与signature对比,标识该请求来源于
|
||||||
|
*
|
||||||
|
* @param signature
|
||||||
|
* @param timestamp
|
||||||
|
* @param nonce
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean validate(String signature, String timestamp, String nonce,
|
||||||
|
String token) {
|
||||||
|
String expectedSignature = null;
|
||||||
|
try {
|
||||||
|
expectedSignature = getSignature(timestamp, nonce, token);
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
if (logger.isErrorEnabled()) {
|
||||||
|
logger.error(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 3. 开发者获得加密后的字符串可与signature对比,标识该请求来源于
|
||||||
|
return signature.equals(expectedSignature);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* public R<?> checkSign (HttpRequestBody httpRequestBody) {
|
||||||
|
CCSMessageDigest wxDigest = CCSMessageDigest.getInstance();
|
||||||
|
String signature = httpRequestBody.getSignature();
|
||||||
|
String nonce = httpRequestBody.getNonce();
|
||||||
|
String encode = httpRequestBody.getAuthenticationKey();
|
||||||
|
String[] timestamp = Base64.decodeStr(encode).split(":");
|
||||||
|
boolean gaoxinTalentHouse = wxDigest.validate(signature, timestamp[2], nonce, "GaoxinTalentHouse");
|
||||||
|
if (!gaoxinTalentHouse) {
|
||||||
|
System.out.println("验签失败" );
|
||||||
|
return R.fail( "验签失败");
|
||||||
|
}
|
||||||
|
AES aes = new AES("CBC", "PKCS7Padding",
|
||||||
|
// 密钥,可以自定义
|
||||||
|
"0123456789ABHAEQ".getBytes(),
|
||||||
|
// iv加盐,按照实际需求添加
|
||||||
|
"DYgjCEIMVrj2W9xN".getBytes());
|
||||||
|
String data = httpRequestBody.getData().toString();
|
||||||
|
String decryptStr = aes.decryptStr(data);
|
||||||
|
BuyHouses buyHouses = JSONUtil.toBean(decryptStr, BuyHouses.class);
|
||||||
|
if (ObjectUtil.isNull(buyHouses.getCardId())){
|
||||||
|
return R.fail("数据不可为空");
|
||||||
|
}
|
||||||
|
return R.ok("操作成功",buyHouses);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param timestamp
|
||||||
|
* @param nonce
|
||||||
|
* @param token
|
||||||
|
* @return String
|
||||||
|
* @throws
|
||||||
|
* @Title: getSignature
|
||||||
|
* @Description: TODO(获取加密后的签名)
|
||||||
|
*/
|
||||||
|
public String getSignature(String timestamp, String nonce, String token) throws UnsupportedEncodingException {
|
||||||
|
// 1. 将token、timestamp、nonce三个参数进行字典序排序
|
||||||
|
String[] arrTmp = {token, timestamp, nonce};
|
||||||
|
Arrays.sort(arrTmp);
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
// 2.将三个参数字符串拼接成一个字符串进行sha1加密
|
||||||
|
for (int i = 0; i < arrTmp.length; i++) {
|
||||||
|
sb.append(arrTmp[i]);
|
||||||
|
}
|
||||||
|
String expectedSignature = encrypt(sb.toString());
|
||||||
|
return expectedSignature;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单例持有类
|
||||||
|
*/
|
||||||
|
private static class SingletonHolder {
|
||||||
|
static final CCSMessageDigest INSTANCE = new CCSMessageDigest();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -38,6 +38,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.swing.text.AbstractDocument;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -80,7 +81,25 @@ public class WorkComplyUtils {
|
|||||||
if (actProcessVos.size()>0){
|
if (actProcessVos.size()>0){
|
||||||
throw new ServiceException("当前业务正在审核中,请耐心等待");
|
throw new ServiceException("当前业务正在审核中,请耐心等待");
|
||||||
}
|
}
|
||||||
|
Map params = processVo.getParams();
|
||||||
|
if (ObjectUtil.isNull(params)){
|
||||||
|
throw new ServiceException("params不可为空");
|
||||||
|
}
|
||||||
|
|
||||||
ProcessVo tProcessByKey = processMapper.selectVoOne(lqw);
|
ProcessVo tProcessByKey = processMapper.selectVoOne(lqw);
|
||||||
|
Object companyName = params.get("companyName");
|
||||||
|
if (ObjectUtil.isNotNull(companyName)){
|
||||||
|
actProcessVo.setCompanyName(String.valueOf(companyName));
|
||||||
|
}
|
||||||
|
Object cardId = params.get("card");
|
||||||
|
Object card = params.get("cardId");
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotNull(cardId)){
|
||||||
|
actProcessVo.setCardId(String.valueOf(cardId));
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotNull(card)){
|
||||||
|
actProcessVo.setCardId(String.valueOf(card));
|
||||||
|
}
|
||||||
actProcessVo.setUserId(String.valueOf(LoginHelper.getUserId()));
|
actProcessVo.setUserId(String.valueOf(LoginHelper.getUserId()));
|
||||||
actProcessVo.setCreateTime(DateUtils.getNowDate());
|
actProcessVo.setCreateTime(DateUtils.getNowDate());
|
||||||
actProcessVo.setCheckType(tProcessByKey.getCheckType());
|
actProcessVo.setCheckType(tProcessByKey.getCheckType());
|
||||||
@ -157,12 +176,14 @@ public class WorkComplyUtils {
|
|||||||
* 2.根据businessId删除actProcess
|
* 2.根据businessId删除actProcess
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static String batchDeleted(HisProcess hisProcess){
|
public static String batchDeleted(HisProcess hisProcess,List<Long> ids){
|
||||||
hisProcess.setEndTime(DateUtils.getNowDate());
|
hisProcess.setEndTime(DateUtils.getNowDate());
|
||||||
//获取当前购房信息
|
//获取当前购房信息
|
||||||
//1.得到当前这条运行任务
|
//1.得到当前这条运行任务
|
||||||
LambdaQueryWrapper<ActProcess> lqw = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ActProcess> lqw = new LambdaQueryWrapper<>();
|
||||||
lqw.eq(ActProcess::getBusinessId,hisProcess.getBusinessId());
|
lqw.eq(ActProcess::getBusinessId,hisProcess.getBusinessId());
|
||||||
|
lqw.eq(ActProcess::getProcessId,ids);
|
||||||
|
|
||||||
List<ActProcessVo> actProcessVos = actProcessMapper.selectVoList(lqw);
|
List<ActProcessVo> actProcessVos = actProcessMapper.selectVoList(lqw);
|
||||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||||
if (actProcessVos.size()>0){
|
if (actProcessVos.size()>0){
|
||||||
@ -189,6 +210,8 @@ public class WorkComplyUtils {
|
|||||||
hisProcess.setCheckType(actProcessVo.getCheckType());
|
hisProcess.setCheckType(actProcessVo.getCheckType());
|
||||||
//往历史表里面添加当前数据
|
//往历史表里面添加当前数据
|
||||||
hisProcess.setProcessId(actProcessVo.getProcessId());
|
hisProcess.setProcessId(actProcessVo.getProcessId());
|
||||||
|
hisProcess.setCardId(actProcessVo.getCardId());
|
||||||
|
hisProcess.setCompanyName(actProcessVo.getCompanyName());
|
||||||
hisProcess.setUserId(actProcessVo.getUserId());
|
hisProcess.setUserId(actProcessVo.getUserId());
|
||||||
hisProcess.setCreateTime(actProcessVo.getCreateTime());
|
hisProcess.setCreateTime(actProcessVo.getCreateTime());
|
||||||
hisProcess.setStep(actProcessVo.getStep());
|
hisProcess.setStep(actProcessVo.getStep());
|
||||||
@ -227,14 +250,14 @@ public class WorkComplyUtils {
|
|||||||
auditLog.setStatus(hisProcess.getStatus());//审核状态
|
auditLog.setStatus(hisProcess.getStatus());//审核状态
|
||||||
auditLog.setReply(hisProcess.getReply());//原因
|
auditLog.setReply(hisProcess.getReply());//原因
|
||||||
auditLog.setAudit(hisProcess.getAudit());
|
auditLog.setAudit(hisProcess.getAudit());
|
||||||
auditLog.setAdminUserName(loginUser.getUsername());
|
auditLog.setAdminUserName(loginUser.getNickName());
|
||||||
auditLog.setStep(actProcessVo.getStep());
|
auditLog.setStep(actProcessVo.getStep());
|
||||||
auditLogMapper.insert(auditLog);
|
auditLogMapper.insert(auditLog);
|
||||||
//如果成功就删除当前条0
|
//如果成功就删除当前条0
|
||||||
if ("1".equals(hisProcess.getStatus())) {//失败删除全部当前业务相关数据
|
if ("1".equals(hisProcess.getStatus())) {//失败删除全部当前业务相关数据
|
||||||
//新增系统消息
|
//新增系统消息
|
||||||
//获取流程的名称
|
//获取流程的名称
|
||||||
TProcess tProcess = processMapper.selectById(actProcessVo.getProcessId());
|
// TProcess tProcess = processMapper.selectById(actProcessVo.getProcessId());
|
||||||
//删除当前业务的数据
|
//删除当前业务的数据
|
||||||
List<Long> collect1 = actProcessVos.stream().map(ActProcessVo::getId).collect(Collectors.toList());
|
List<Long> collect1 = actProcessVos.stream().map(ActProcessVo::getId).collect(Collectors.toList());
|
||||||
actProcessMapper.deleteBatchIds(collect1);
|
actProcessMapper.deleteBatchIds(collect1);
|
||||||
@ -592,7 +615,9 @@ public class WorkComplyUtils {
|
|||||||
.orderByAsc(TProcess::getStep));
|
.orderByAsc(TProcess::getStep));
|
||||||
|
|
||||||
List<ActProcessVo> actProcessVoList = actProcessMapper.selectVoList(new LambdaQueryWrapper<ActProcess>()
|
List<ActProcessVo> actProcessVoList = actProcessMapper.selectVoList(new LambdaQueryWrapper<ActProcess>()
|
||||||
.eq(ActProcess::getBusinessId, businessId));
|
.eq(ActProcess::getBusinessId, businessId)
|
||||||
|
.in(ActProcess::getProcessId,processVos.stream().map(ProcessVo::getId).collect(Collectors.toList())));
|
||||||
|
|
||||||
List<AuditLog> auditLogs = auditLogMapper.selectList(new LambdaQueryWrapper<AuditLog>()
|
List<AuditLog> auditLogs = auditLogMapper.selectList(new LambdaQueryWrapper<AuditLog>()
|
||||||
.eq(AuditLog::getProcessKey, processKey)
|
.eq(AuditLog::getProcessKey, processKey)
|
||||||
.eq(AuditLog::getOtherId, businessId)
|
.eq(AuditLog::getOtherId, businessId)
|
||||||
@ -655,17 +680,68 @@ public class WorkComplyUtils {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
list1.forEach(e ->{
|
list1.forEach(e ->{
|
||||||
|
switch (e.getCheckType()){
|
||||||
|
case "1":e.setCheckType("人员");
|
||||||
|
break;
|
||||||
|
case "2":e.setCheckType("部门");
|
||||||
|
break;
|
||||||
|
case "3":e.setCheckType("角色");
|
||||||
|
break;
|
||||||
|
case "4":e.setCheckType("公司");
|
||||||
|
break;
|
||||||
|
case "5":e.setCheckType("人员");
|
||||||
|
break;
|
||||||
|
default:e.setCheckType("未知类型");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
e.setAuditLogList1(null);
|
||||||
|
e.setId(null);
|
||||||
|
e.setProcessKey(null);
|
||||||
|
e.setType(null);
|
||||||
|
e.setProcessCheck(null);
|
||||||
|
e.setCc(null);
|
||||||
|
e.setIsNext(null);
|
||||||
|
e.setRuleId(null);
|
||||||
|
e.setBusinessId(null);
|
||||||
e.setParams(null);
|
e.setParams(null);
|
||||||
|
e.setParam(null);
|
||||||
|
e.setParamName(null);
|
||||||
|
e.setTimeout(null);
|
||||||
|
e.setBean(null);
|
||||||
|
e.setAudit1(null);
|
||||||
|
e.setActProcessVoList(null);
|
||||||
});
|
});
|
||||||
Map<String, List<ProcessVo>> collect = list1.stream().collect(Collectors.groupingBy(ProcessVo::getStep));
|
Map<String, List<ProcessVo>> collect = list1.stream().collect(Collectors.groupingBy(ProcessVo::getStep));
|
||||||
List<ProcessVoResultDto> collect1 = collect.entrySet()
|
List<ProcessVoResultDto> collect1 = collect.entrySet()
|
||||||
.stream()
|
.stream()
|
||||||
.map(e -> new ProcessVoResultDto(e.getKey(), e.getValue()))
|
.map(e -> new ProcessVoResultDto(e.getKey(), e.getValue()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
collect1.forEach(e ->{
|
collect1.forEach(e ->{
|
||||||
String s = e.getProcessVoList().stream().map(ProcessVo::getDescription).collect(Collectors.toList()).get(0);
|
String s = e.getProcessVoList().stream().map(ProcessVo::getDescription).collect(Collectors.toList()).get(0);
|
||||||
e.setStep(s);
|
e.setStep(s);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
String processStatus = params.get("processStatus").toString();
|
||||||
|
if (Constants.CANCEL.equals(processStatus)){
|
||||||
|
List<AuditLog> arrayList = new ArrayList<>();
|
||||||
|
AuditLog auditLog1 = auditLogs.get(auditLogs.size() - 1);
|
||||||
|
auditLog1.setStatus("取消认定");
|
||||||
|
arrayList.add(auditLog1);
|
||||||
|
ProcessVo processVo1 = new ProcessVo();
|
||||||
|
processVo1.setAudit(auditLogs.get(auditLogs.size()-1).getAdminUserName());
|
||||||
|
processVo1.setName("安居资格认定");
|
||||||
|
processVo1.setChecked("2");
|
||||||
|
processVo1.setAuditLogList(arrayList);
|
||||||
|
List<ProcessVo> list = new ArrayList<>();
|
||||||
|
list.add(processVo1);
|
||||||
|
|
||||||
|
ProcessVoResultDto processVoResultDto = new ProcessVoResultDto();
|
||||||
|
processVoResultDto.setStep("安居资格取消");
|
||||||
|
processVoResultDto.setProcessVoList(list);
|
||||||
|
collect1.add(processVoResultDto);
|
||||||
|
}
|
||||||
|
|
||||||
System.out.println("collect = " + collect1);
|
System.out.println("collect = " + collect1);
|
||||||
return collect1;
|
return collect1;
|
||||||
}
|
}
|
||||||
@ -737,6 +813,8 @@ public class WorkComplyUtils {
|
|||||||
e.setChecked("2");
|
e.setChecked("2");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else if (Constants.CANCEL.equals(process_status.toString())){
|
||||||
|
e.setChecked("3");//无色
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
e.setChecked("3");
|
e.setChecked("3");
|
||||||
@ -749,24 +827,110 @@ public class WorkComplyUtils {
|
|||||||
if (ObjectUtil.isNull(companyId)){
|
if (ObjectUtil.isNull(companyId)){
|
||||||
throw new ServiceException("companyId不可为空");
|
throw new ServiceException("companyId不可为空");
|
||||||
}
|
}
|
||||||
// e.setAudit1(String.valueOf(e.getParams().get("companyId")));
|
|
||||||
}
|
}
|
||||||
|
//状态 1.待提交 2.受理中 3.受理退件 4.受理驳回 5.初审中 6初审不通过 7.初审退件 8.审定中 9.审定不通过 10.审定通过,11.审定退件 12.资格取消
|
||||||
|
//2,3,4,5--->step1
|
||||||
|
//6,7,8---->step2
|
||||||
|
//9,10---->step3
|
||||||
List<AuditLog> collect = auditLogs.stream().filter(a -> e.getStep().equals(a.getStep()) && e.getAudit1().equals(a.getAudit())).collect(Collectors.toList());
|
List<AuditLog> collect = auditLogs.stream().filter(a -> e.getStep().equals(a.getStep()) && e.getAudit1().equals(a.getAudit())).collect(Collectors.toList());
|
||||||
|
if (e.getProcessKey().equals("apply_house") && collect.size()==0 ) {
|
||||||
|
if ("1".equals(e.getStep())) {
|
||||||
|
collect = auditLogs.stream().filter(a -> e.getAudit1().equals(a.getAuditId()) &&
|
||||||
|
(a.getStatus().equals("1") || a.getStatus().equals("2") || a.getStatus().equals("3")
|
||||||
|
|| a.getStatus().equals("4") || a.getStatus().equals("5")) ).collect(Collectors.toList());
|
||||||
|
}else if ("2".equals(e.getStep())){
|
||||||
|
collect = auditLogs.stream().filter(a -> e.getAudit1().equals(a.getAuditId()) &&
|
||||||
|
(a.getStatus().equals("6") || a.getStatus().equals("7") || a.getStatus().equals("8"))).collect(Collectors.toList());
|
||||||
|
}else if ("3".equals(e.getStep())){
|
||||||
|
collect = auditLogs.stream().filter(a -> e.getAudit1().equals(a.getAuditId()) &&
|
||||||
|
(a.getStatus().equals("9") || a.getStatus().equals("10") || a.getStatus().equals("11") || a.getStatus().equals("12"))).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
collect.stream().forEach(a -> {
|
collect.stream().forEach(a -> {
|
||||||
if (ObjectUtil.isNotNull(a.getStatus())) {
|
if (ObjectUtil.isNotNull(a.getStatus())) {
|
||||||
switch (a.getStatus()) {
|
switch (a.getStatus()) {
|
||||||
case "1":
|
case "1":
|
||||||
a.setStatus("审核失败");
|
a.setStatus("待提交");
|
||||||
break;
|
break;
|
||||||
case "2":
|
case "2":
|
||||||
a.setStatus("审核成功");
|
a.setStatus("受理中");
|
||||||
|
break;
|
||||||
|
case "3":
|
||||||
|
a.setStatus("受理退件");
|
||||||
|
break;
|
||||||
|
case "4":
|
||||||
|
a.setStatus("受理驳回");
|
||||||
|
break;
|
||||||
|
case "5":
|
||||||
|
a.setStatus("受理成功");
|
||||||
|
break;
|
||||||
|
case "6":
|
||||||
|
a.setStatus("初审不通过");
|
||||||
|
break;
|
||||||
|
case "7":
|
||||||
|
a.setStatus("初审退件");
|
||||||
|
break;
|
||||||
|
case "8":
|
||||||
|
a.setStatus("初审成功");
|
||||||
|
break;
|
||||||
|
case "9":
|
||||||
|
a.setStatus("审定不通过");
|
||||||
|
break;
|
||||||
|
case "10":
|
||||||
|
a.setStatus("审定通过");
|
||||||
|
break;
|
||||||
|
case "11":
|
||||||
|
a.setStatus("审定退件");
|
||||||
|
break;
|
||||||
|
case "12":
|
||||||
|
a.setStatus("资格取消");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
a.setStatus("未知状态");
|
a.setStatus("未知状态");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
a.setCreateBy(null);
|
||||||
|
a.setUpdateBy(null);
|
||||||
|
a.setId(null);
|
||||||
|
a.setAuditId(null);
|
||||||
|
a.setOtherId(null);
|
||||||
|
a.setRoleName(null);
|
||||||
|
a.setPushLog(null);
|
||||||
|
a.setProcessKey(null);
|
||||||
|
a.setAudit(null);
|
||||||
|
a.setStep(null);
|
||||||
|
a.setAuditType(null);
|
||||||
});
|
});
|
||||||
|
}else {
|
||||||
|
collect.stream().forEach(a -> {
|
||||||
|
if (ObjectUtil.isNotNull(a.getStatus())) {
|
||||||
|
switch (a.getStatus()) {
|
||||||
|
case "1":
|
||||||
|
a.setStatus(e.getDescription()+"失败");
|
||||||
|
break;
|
||||||
|
case "2":
|
||||||
|
a.setStatus(e.getDescription()+"成功");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
a.setStatus(e.getDescription()+"未知状态");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
a.setCreateBy(null);
|
||||||
|
a.setUpdateBy(null);
|
||||||
|
a.setId(null);
|
||||||
|
a.setAuditId(null);
|
||||||
|
a.setOtherId(null);
|
||||||
|
a.setRoleName(null);
|
||||||
|
a.setPushLog(null);
|
||||||
|
a.setProcessKey(null);
|
||||||
|
a.setAudit(null);
|
||||||
|
a.setStep(null);
|
||||||
|
a.setAuditType(null);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
e.setAuditLogList(collect);
|
e.setAuditLogList(collect);
|
||||||
}else {
|
}else {
|
||||||
e.setAuditLogList(new ArrayList<>());
|
e.setAuditLogList(new ArrayList<>());
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user