Compare commits
2 Commits
5bb85f603e
...
8494d2451a
Author | SHA1 | Date |
---|---|---|
|
8494d2451a | |
|
7cfe5a375c |
|
@ -29,6 +29,8 @@ public class OrgApplyInfoApiEntity implements Serializable {
|
|||
|
||||
/**id*/
|
||||
private String id;
|
||||
/**pkId 同表id*/
|
||||
private String pkId;
|
||||
/**微信id*/
|
||||
private String openId;
|
||||
/**微信名称*/
|
||||
|
@ -37,6 +39,8 @@ public class OrgApplyInfoApiEntity implements Serializable {
|
|||
private String tel;
|
||||
/**状态 1审核中 2审核完成 3驳回 */
|
||||
private String status;
|
||||
/**变更状态 2变更完成 4变更申请中 5变更驳回 */
|
||||
private java.lang.String modifyStatus;
|
||||
/**审核备注*/
|
||||
private String content;
|
||||
/**创建人*/
|
||||
|
|
|
@ -10,6 +10,7 @@ import java.io.UnsupportedEncodingException;
|
|||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
|
@ -39,13 +40,13 @@ import io.swagger.annotations.ApiOperation;
|
|||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @Description: 机构加盟申请信息表
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-06-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="机构加盟申请信息表")
|
||||
@Api(tags = "机构加盟申请信息表")
|
||||
@RestController
|
||||
@RequestMapping("/orgapplyinfo/orgApplyInfo")
|
||||
@Slf4j
|
||||
|
@ -63,18 +64,46 @@ public class OrgApplyInfoController extends JeecgController<OrgApplyInfo, IOrgAp
|
|||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "机构加盟申请信息表-分页列表查询")
|
||||
@ApiOperation(value="机构加盟申请信息表-分页列表查询", notes="机构加盟申请信息表-分页列表查询")
|
||||
@ApiOperation(value = "机构加盟申请信息表-分页列表查询", notes = "机构加盟申请信息表-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<OrgApplyInfo>> queryPageList(OrgApplyInfo orgApplyInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
// 自定义查询规则
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
// 自定义多选的查询规则为:LIKE_WITH_OR
|
||||
customeRuleMap.put("status", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("izEntry", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<OrgApplyInfo> queryWrapper = QueryGenerator.initQueryWrapper(orgApplyInfo, req.getParameterMap(),customeRuleMap);
|
||||
QueryWrapper<OrgApplyInfo> queryWrapper = QueryGenerator.initQueryWrapper(orgApplyInfo, req.getParameterMap(), customeRuleMap);
|
||||
queryWrapper.in("status", new String[]{"1", "2", "3"});
|
||||
Page<OrgApplyInfo> page = new Page<OrgApplyInfo>(pageNo, pageSize);
|
||||
IPage<OrgApplyInfo> pageList = orgApplyInfoService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param orgApplyInfo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "机构信息变更申请-分页列表查询", notes = "机构信息变更申请-分页列表查询")
|
||||
@GetMapping(value = "/modifyLlist")
|
||||
public Result<IPage<OrgApplyInfo>> modifyLlist(OrgApplyInfo orgApplyInfo,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
// 自定义查询规则
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
// 自定义多选的查询规则为:LIKE_WITH_OR
|
||||
customeRuleMap.put("status", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("izEntry", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<OrgApplyInfo> queryWrapper = QueryGenerator.initQueryWrapper(orgApplyInfo, req.getParameterMap(), customeRuleMap);
|
||||
queryWrapper.in("status", new String[]{"4", "5"});
|
||||
Page<OrgApplyInfo> page = new Page<OrgApplyInfo>(pageNo, pageSize);
|
||||
IPage<OrgApplyInfo> pageList = orgApplyInfoService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
|
@ -87,7 +116,7 @@ public class OrgApplyInfoController extends JeecgController<OrgApplyInfo, IOrgAp
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "机构加盟申请信息表-添加")
|
||||
@ApiOperation(value="机构加盟申请信息表-添加", notes="机构加盟申请信息表-添加")
|
||||
@ApiOperation(value = "机构加盟申请信息表-添加", notes = "机构加盟申请信息表-添加")
|
||||
@RequiresPermissions("orgapplyinfo:nu_org_apply_info:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody OrgApplyInfo orgApplyInfo) {
|
||||
|
@ -102,11 +131,11 @@ public class OrgApplyInfoController extends JeecgController<OrgApplyInfo, IOrgAp
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "机构加盟申请信息表-编辑")
|
||||
@ApiOperation(value="机构加盟申请信息表-编辑", notes="机构加盟申请信息表-编辑")
|
||||
@ApiOperation(value = "机构加盟申请信息表-编辑", notes = "机构加盟申请信息表-编辑")
|
||||
@RequiresPermissions("orgapplyinfo:nu_org_apply_info:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody OrgApplyInfo orgApplyInfo) {
|
||||
orgApplyInfoService.updateById(orgApplyInfo);
|
||||
orgApplyInfoService.audit(orgApplyInfo);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
|
@ -117,10 +146,10 @@ public class OrgApplyInfoController extends JeecgController<OrgApplyInfo, IOrgAp
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "机构加盟申请信息表-通过id删除")
|
||||
@ApiOperation(value="机构加盟申请信息表-通过id删除", notes="机构加盟申请信息表-通过id删除")
|
||||
@ApiOperation(value = "机构加盟申请信息表-通过id删除", notes = "机构加盟申请信息表-通过id删除")
|
||||
@RequiresPermissions("orgapplyinfo:nu_org_apply_info:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
orgApplyInfoService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
@ -132,10 +161,10 @@ public class OrgApplyInfoController extends JeecgController<OrgApplyInfo, IOrgAp
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "机构加盟申请信息表-批量删除")
|
||||
@ApiOperation(value="机构加盟申请信息表-批量删除", notes="机构加盟申请信息表-批量删除")
|
||||
@ApiOperation(value = "机构加盟申请信息表-批量删除", notes = "机构加盟申请信息表-批量删除")
|
||||
@RequiresPermissions("orgapplyinfo:nu_org_apply_info:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.orgApplyInfoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
@ -147,11 +176,11 @@ public class OrgApplyInfoController extends JeecgController<OrgApplyInfo, IOrgAp
|
|||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "机构加盟申请信息表-通过id查询")
|
||||
@ApiOperation(value="机构加盟申请信息表-通过id查询", notes="机构加盟申请信息表-通过id查询")
|
||||
@ApiOperation(value = "机构加盟申请信息表-通过id查询", notes = "机构加盟申请信息表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<OrgApplyInfo> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
public Result<OrgApplyInfo> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
OrgApplyInfo orgApplyInfo = orgApplyInfoService.getById(id);
|
||||
if(orgApplyInfo==null) {
|
||||
if (orgApplyInfo == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(orgApplyInfo);
|
||||
|
@ -182,4 +211,16 @@ public class OrgApplyInfoController extends JeecgController<OrgApplyInfo, IOrgAp
|
|||
return super.importExcel(request, response, OrgApplyInfo.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取变更信息
|
||||
* 查询同一信息(pkid相同) 的申请变更(status=4)和 当前使用的机构信息(status=2) 转换成对应的数据格式
|
||||
* @param orgApplyInfo
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "机构信息变更申请-获取变更信息", notes = "机构信息变更申请-获取变更信息")
|
||||
@PostMapping(value = "/getModifyInfo")
|
||||
public Result<List<Map<String,Object>>> getModifyInfo(@RequestBody OrgApplyInfo orgApplyInfo) {
|
||||
return Result.OK(orgApplyInfoService.getModifyInfo(orgApplyInfo));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +1,20 @@
|
|||
package com.nu.modules.orgapplyinfo.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 机构加盟申请信息表
|
||||
|
@ -36,6 +34,9 @@ public class OrgApplyInfo implements Serializable {
|
|||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**pkId 同表id*/
|
||||
@ApiModelProperty(value = "pkId")
|
||||
private java.lang.String pkId;
|
||||
/**微信id*/
|
||||
@Excel(name = "微信id", width = 15)
|
||||
@ApiModelProperty(value = "微信id")
|
||||
|
@ -53,6 +54,11 @@ public class OrgApplyInfo implements Serializable {
|
|||
@Excel(name = "审批状态", width = 15)
|
||||
@ApiModelProperty(value = "审批状态")
|
||||
private java.lang.String status;
|
||||
/**变更状态 2变更完成 4变更申请中 5变更驳回 */
|
||||
@Dict(dicCode = "org_apply_status")
|
||||
@Excel(name = "变更状态 2变更完成 4变更申请中 5变更驳回", width = 15)
|
||||
@ApiModelProperty(value = "变更状态 2变更完成 4变更申请中 5变更驳回")
|
||||
private java.lang.String modifyStatus;
|
||||
/**审核备注*/
|
||||
@Excel(name = "审核备注", width = 15)
|
||||
@ApiModelProperty(value = "审核备注")
|
||||
|
@ -61,16 +67,16 @@ public class OrgApplyInfo implements Serializable {
|
|||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
/**机构是否入驻0否 1是(是否入驻过)*/
|
||||
|
@ -90,9 +96,9 @@ public class OrgApplyInfo implements Serializable {
|
|||
@ApiModelProperty(value = "民族")
|
||||
private java.lang.String national;
|
||||
/**出生日期*/
|
||||
@Excel(name = "出生日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "出生日期", width = 20, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "出生日期")
|
||||
private java.util.Date birthDate;
|
||||
/**住址(身份证上)*/
|
||||
|
@ -108,15 +114,15 @@ public class OrgApplyInfo implements Serializable {
|
|||
@ApiModelProperty(value = "签发机关")
|
||||
private java.lang.String issuingAuthority;
|
||||
/**有效开始日期*/
|
||||
@Excel(name = "有效开始日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "有效开始日期", width = 20, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "有效开始日期")
|
||||
private java.util.Date startTime;
|
||||
/**有效结束日期*/
|
||||
@Excel(name = "有效结束日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "有效结束日期", width = 20, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "有效结束日期")
|
||||
private java.util.Date endTime;
|
||||
/**身份证正面*/
|
||||
|
|
|
@ -14,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
*/
|
||||
public interface OrgApplyInfoMapper extends BaseMapper<OrgApplyInfo> {
|
||||
|
||||
void realDelete(@Param("pkId") String pkId);
|
||||
}
|
||||
|
|
|
@ -2,4 +2,7 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.orgapplyinfo.mapper.OrgApplyInfoMapper">
|
||||
|
||||
<delete id="realDelete">
|
||||
delete from nu_org_apply_info where pk_id = #{pkId} and status = '5'
|
||||
</delete>
|
||||
</mapper>
|
|
@ -3,6 +3,9 @@ package com.nu.modules.orgapplyinfo.service;
|
|||
import com.nu.modules.orgapplyinfo.entity.OrgApplyInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 机构加盟申请信息表
|
||||
* @Author: 张明远
|
||||
|
@ -11,4 +14,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface IOrgApplyInfoService extends IService<OrgApplyInfo> {
|
||||
|
||||
List<Map<String,Object>> getModifyInfo(OrgApplyInfo orgApplyInfo);
|
||||
|
||||
void audit(OrgApplyInfo orgApplyInfo);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.nu.modules.orgapplyinfo.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.orgapplyinfo.api.IOrgApplyInfoApi;
|
||||
|
@ -9,12 +11,15 @@ import com.nu.modules.orgapplyinfo.entity.OrgApplyInfoApiEntity;
|
|||
import com.nu.modules.orgapplyinfo.mapper.OrgApplyInfoMapper;
|
||||
import com.nu.modules.orgapplyinfo.service.IOrgApplyInfoService;
|
||||
import com.nu.utils.DictUtils;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.lang.reflect.Field;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Description: 机构加盟申请信息表
|
||||
|
@ -34,6 +39,23 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl<OrgApplyInfoMapper, Org
|
|||
BeanUtils.copyProperties(orgApplyInfoApiEntity, orgApplyInfo);
|
||||
baseMapper.insert(orgApplyInfo);
|
||||
orgApplyInfoApiEntity.setId(orgApplyInfo.getId());
|
||||
|
||||
if (StringUtils.isBlank(orgApplyInfo.getPkId())) {
|
||||
orgApplyInfo.setPkId(orgApplyInfo.getId());
|
||||
baseMapper.updateById(orgApplyInfo);
|
||||
}
|
||||
if ("4".equals(orgApplyInfo.getStatus())) {
|
||||
//先将历史审核不通过的数据删除掉
|
||||
baseMapper.realDelete(orgApplyInfo.getPkId());
|
||||
|
||||
//如果是提交机构变更 需要将正在使用的数据(status =2 ) 的 modify_status改为4
|
||||
QueryWrapper<OrgApplyInfo> qw = new QueryWrapper<>();
|
||||
qw.eq("pk_id", orgApplyInfo.getPkId());
|
||||
qw.eq("status", "2");
|
||||
OrgApplyInfo updateData = new OrgApplyInfo();
|
||||
updateData.setModifyStatus("4");
|
||||
baseMapper.update(updateData, qw);
|
||||
}
|
||||
return orgApplyInfoApiEntity;
|
||||
}
|
||||
|
||||
|
@ -45,14 +67,14 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl<OrgApplyInfoMapper, Org
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<OrgApplyInfoApiEntity> queryAuditInfo(String openId,String id, String status) {
|
||||
public List<OrgApplyInfoApiEntity> queryAuditInfo(String openId, String id, String status) {
|
||||
QueryWrapper<OrgApplyInfo> qw = new QueryWrapper<>();
|
||||
qw.eq("open_id", openId);
|
||||
if (StringUtils.isNotBlank(id)) {
|
||||
qw.eq("id", id);
|
||||
}
|
||||
if (StringUtils.isNotBlank(status)) {
|
||||
qw.eq("status", status);
|
||||
qw.in("status", status.split(","));
|
||||
}
|
||||
qw.orderByDesc("create_time");
|
||||
List<OrgApplyInfo> list = baseMapper.selectList(qw);
|
||||
|
@ -68,4 +90,107 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl<OrgApplyInfoMapper, Org
|
|||
return result;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getModifyInfo(OrgApplyInfo orgApplyInfo) {
|
||||
// 1. 查询数据库获取两条记录
|
||||
QueryWrapper<OrgApplyInfo> qw = new QueryWrapper<>();
|
||||
qw.eq("pk_id", orgApplyInfo.getPkId());
|
||||
qw.orderByDesc("create_time");
|
||||
qw.in("status", new String[]{"2", "4"});
|
||||
List<OrgApplyInfo> list = baseMapper.selectList(qw);
|
||||
|
||||
if (list == null || list.size() < 2) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
OrgApplyInfo modifyData = list.get(0); // 修改后的数据
|
||||
OrgApplyInfo usingData = list.get(1); // 原始数据
|
||||
|
||||
// 2. 准备结果列表
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
|
||||
// 3. 获取所有字段
|
||||
Field[] fields = OrgApplyInfo.class.getDeclaredFields();
|
||||
|
||||
// 4. 遍历每个字段进行比较
|
||||
for (Field field : fields) {
|
||||
try {
|
||||
// 跳过序列化ID和不需要的字段
|
||||
if (field.getName().equals("serialVersionUID") ||
|
||||
field.isAnnotationPresent(TableField.class) &&
|
||||
field.getAnnotation(TableField.class).exist() == false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 设置可访问以获取私有字段值
|
||||
field.setAccessible(true);
|
||||
|
||||
// 创建结果map
|
||||
Map<String, Object> fieldMap = new HashMap<>();
|
||||
|
||||
// 获取字段名和值
|
||||
String fieldName = field.getName();
|
||||
Object modifyValue = field.get(modifyData);
|
||||
Object usingValue = field.get(usingData);
|
||||
|
||||
// 处理特殊类型的值
|
||||
if (field.getType() == Date.class) {
|
||||
modifyValue = modifyValue != null ? new SimpleDateFormat("yyyy-MM-dd").format((Date) modifyValue) : null;
|
||||
usingValue = usingValue != null ? new SimpleDateFormat("yyyy-MM-dd").format((Date) usingValue) : null;
|
||||
}
|
||||
|
||||
// 填充结果map
|
||||
fieldMap.put("d1", fieldName); // 字段名
|
||||
fieldMap.put("d2", usingValue); // 原始值
|
||||
fieldMap.put("d3", modifyValue); // 修改后的值
|
||||
fieldMap.put("d4", Objects.equals(usingValue, modifyValue) ? "相同" : "不同"); // 比较结果
|
||||
|
||||
result.add(fieldMap);
|
||||
|
||||
} catch (IllegalAccessException e) {
|
||||
// 忽略无法访问的字段
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void audit(OrgApplyInfo orgApplyInfo) {
|
||||
OrgApplyInfo usedData = new OrgApplyInfo();
|
||||
//机构信息变更审核通过
|
||||
if ("modifyPass".equals(orgApplyInfo.getStatus())) {
|
||||
QueryWrapper<OrgApplyInfo> qw = new QueryWrapper<>();
|
||||
qw.eq("pk_id",orgApplyInfo.getPkId());
|
||||
qw.eq("status","2");
|
||||
OrgApplyInfo o_ = baseMapper.selectOne(qw);
|
||||
//把上一条数据设置为历史数据 同时变更“信息变更状态”
|
||||
o_.setModifyStatus("2");
|
||||
o_.setStatus("0");
|
||||
baseMapper.updateById(o_);
|
||||
|
||||
//将变更后数据设置为正在使用的数据
|
||||
orgApplyInfo.setStatus("2");
|
||||
orgApplyInfo.setModifyStatus("2");
|
||||
baseMapper.updateById(orgApplyInfo);
|
||||
} else if ("modifyFail".equals(orgApplyInfo.getStatus())) {
|
||||
QueryWrapper<OrgApplyInfo> qw = new QueryWrapper<>();
|
||||
qw.eq("pk_id",orgApplyInfo.getPkId());
|
||||
qw.eq("status","2");
|
||||
OrgApplyInfo o_ = baseMapper.selectOne(qw);
|
||||
//机构信息变更审核被驳回
|
||||
o_.setModifyStatus("5");
|
||||
baseMapper.updateById(o_);
|
||||
|
||||
//将变更后数据设置为被驳回状态
|
||||
orgApplyInfo.setStatus("5");
|
||||
baseMapper.updateById(orgApplyInfo);
|
||||
}else{
|
||||
//机构加盟审批流程
|
||||
baseMapper.updateById(orgApplyInfo);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,4 +65,5 @@ public class OrgApplyInfoApi {
|
|||
}
|
||||
return Result.ok(orgApplyInfoApi.queryAuditInfo(openId, id,status));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue