解决机构信息接口返回的出生日期、有效日期等不正确问题

This commit is contained in:
1378012178@qq.com 2025-07-01 15:32:40 +08:00
parent dd8bb92da9
commit 704448f43b
3 changed files with 58 additions and 25 deletions

View File

@ -60,7 +60,7 @@ public class OrgApplyInfoApiEntity implements Serializable {
/**民族*/ /**民族*/
private String national; private String national;
/**出生日期*/ /**出生日期*/
@JsonFormat(pattern = "yyyy年MM月dd日") @JsonFormat(timezone = "GMT+8",pattern = "yyyy年MM月dd日")
@DateTimeFormat(pattern = "yyyy年MM月dd日") @DateTimeFormat(pattern = "yyyy年MM月dd日")
private Date birthDate; private Date birthDate;
/**住址(身份证上)*/ /**住址(身份证上)*/
@ -70,11 +70,11 @@ public class OrgApplyInfoApiEntity implements Serializable {
/**签发机关*/ /**签发机关*/
private String issuingAuthority; private String issuingAuthority;
/**有效开始日期*/ /**有效开始日期*/
@JsonFormat(pattern = "yyyy.MM.dd") @JsonFormat(timezone = "GMT+8",pattern = "yyyy.MM.dd")
@DateTimeFormat(pattern = "yyyy.MM.dd") @DateTimeFormat(pattern = "yyyy.MM.dd")
private Date startTime; private Date startTime;
/**有效结束日期*/ /**有效结束日期*/
@JsonFormat(pattern = "yyyy.MM.dd") @JsonFormat(timezone = "GMT+8",pattern = "yyyy.MM.dd")
@DateTimeFormat(pattern = "yyyy.MM.dd") @DateTimeFormat(pattern = "yyyy.MM.dd")
private Date endTime; private Date endTime;
/**身份证正面*/ /**身份证正面*/
@ -116,6 +116,8 @@ public class OrgApplyInfoApiEntity implements Serializable {
/**机构区域 sys_category.id*/ /**机构区域 sys_category.id*/
private java.lang.String orgDistrict; private java.lang.String orgDistrict;
private java.lang.String orgDistrict_dictText; private java.lang.String orgDistrict_dictText;
private java.util.Date commitTime;//提交时间
private java.util.Date auditTime;//审核时间
private java.util.Date franchiseTime;//加盟时间
} }

View File

@ -54,10 +54,10 @@ public class OrgApplyInfo implements Serializable {
@Excel(name = "审批状态", width = 15) @Excel(name = "审批状态", width = 15)
@ApiModelProperty(value = "审批状态") @ApiModelProperty(value = "审批状态")
private java.lang.String status; private java.lang.String status;
/**变更状态 2变更完成 4变更申请中 5变更驳回 */ /**变更状态 0可修改 1不可修改 */
@Dict(dicCode = "org_apply_status") @Dict(dicCode = "org_apply_status")
@Excel(name = "变更状态 2变更完成 4变更申请中 5变更驳回", width = 15) @Excel(name = "变更状态 0可修改 1不可修改", width = 15)
@ApiModelProperty(value = "变更状态 2变更完成 4变更申请中 5变更驳回") @ApiModelProperty(value = "变更状态 0可修改 1不可修改")
private java.lang.String modifyStatus; private java.lang.String modifyStatus;
/**审核备注*/ /**审核备注*/
@Excel(name = "审核备注", width = 15) @Excel(name = "审核备注", width = 15)
@ -208,4 +208,22 @@ public class OrgApplyInfo implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private java.lang.String orgDistrict_dictText; private java.lang.String orgDistrict_dictText;
/**提交时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "提交时间")
private java.util.Date commitTime;
/**审核时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "审核时间")
private java.util.Date auditTime;
/**加盟时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "加盟时间")
private java.util.Date franchiseTime;
} }

View File

@ -1,5 +1,6 @@
package com.nu.modules.orgapplyinfo.service.impl; package com.nu.modules.orgapplyinfo.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.ListUtil; import cn.hutool.core.collection.ListUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
@ -11,6 +12,7 @@ import com.nu.modules.orgapplyinfo.entity.OrgApplyInfoApiEntity;
import com.nu.modules.orgapplyinfo.mapper.OrgApplyInfoMapper; import com.nu.modules.orgapplyinfo.mapper.OrgApplyInfoMapper;
import com.nu.modules.orgapplyinfo.service.IOrgApplyInfoService; import com.nu.modules.orgapplyinfo.service.IOrgApplyInfoService;
import com.nu.utils.DictUtils; import com.nu.utils.DictUtils;
import org.apache.commons.collections.ListUtils;
import org.apache.commons.compress.utils.Lists; import org.apache.commons.compress.utils.Lists;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
@ -38,6 +40,9 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl<OrgApplyInfoMapper, Org
OrgApplyInfo orgApplyInfo = new OrgApplyInfo(); OrgApplyInfo orgApplyInfo = new OrgApplyInfo();
BeanUtils.copyProperties(orgApplyInfoApiEntity, orgApplyInfo); BeanUtils.copyProperties(orgApplyInfoApiEntity, orgApplyInfo);
orgApplyInfo.setCreateTime(new Date()); orgApplyInfo.setCreateTime(new Date());
orgApplyInfo.setCommitTime(new Date());
orgApplyInfo.setAuditTime(null);
orgApplyInfo.setContent(null);
baseMapper.insert(orgApplyInfo); baseMapper.insert(orgApplyInfo);
orgApplyInfoApiEntity.setId(orgApplyInfo.getId()); orgApplyInfoApiEntity.setId(orgApplyInfo.getId());
@ -46,15 +51,12 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl<OrgApplyInfoMapper, Org
baseMapper.updateById(orgApplyInfo); baseMapper.updateById(orgApplyInfo);
} }
if ("4".equals(orgApplyInfo.getStatus())) { if ("4".equals(orgApplyInfo.getStatus())) {
//先将历史审核不通过的数据删除掉 //如果是提交机构变更 需要将对应pkid都改为 modify_status=1 不可提交修改信息
baseMapper.realDelete(orgApplyInfo.getPkId());
//如果是提交机构变更 需要将正在使用的数据(status =2 ) modify_status改为4
QueryWrapper<OrgApplyInfo> qw = new QueryWrapper<>(); QueryWrapper<OrgApplyInfo> qw = new QueryWrapper<>();
qw.eq("pk_id", orgApplyInfo.getPkId()); qw.eq("pk_id", orgApplyInfo.getPkId());
qw.eq("status", "2"); // qw.eq("status", "2");
OrgApplyInfo updateData = new OrgApplyInfo(); OrgApplyInfo updateData = new OrgApplyInfo();
updateData.setModifyStatus("4"); updateData.setModifyStatus("1");
baseMapper.update(updateData, qw); baseMapper.update(updateData, qw);
} }
return orgApplyInfoApiEntity; return orgApplyInfoApiEntity;
@ -86,8 +88,7 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl<OrgApplyInfoMapper, Org
par.setOrgDistrict_dictText(dictUtils.translateDictValue("id", "name", "sys_category", par.getOrgDistrict())); par.setOrgDistrict_dictText(dictUtils.translateDictValue("id", "name", "sys_category", par.getOrgDistrict()));
} }
String jsonStr = JSON.toJSONString(list); List<OrgApplyInfoApiEntity> result = BeanUtil.copyToList(list, OrgApplyInfoApiEntity.class);
List<OrgApplyInfoApiEntity> result = JSON.parseArray(jsonStr, OrgApplyInfoApiEntity.class);
return result; return result;
} }
@ -160,12 +161,13 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl<OrgApplyInfoMapper, Org
@Override @Override
public void audit(OrgApplyInfo orgApplyInfo) { public void audit(OrgApplyInfo orgApplyInfo) {
orgApplyInfo.setAuditTime(new Date());
OrgApplyInfo usedData = new OrgApplyInfo(); OrgApplyInfo usedData = new OrgApplyInfo();
//机构信息变更审核通过 //机构信息变更审核通过
if ("modifyPass".equals(orgApplyInfo.getStatus())) { if ("modifyPass".equals(orgApplyInfo.getStatus())) {
QueryWrapper<OrgApplyInfo> qw = new QueryWrapper<>(); QueryWrapper<OrgApplyInfo> qw = new QueryWrapper<>();
qw.eq("pk_id",orgApplyInfo.getPkId()); qw.eq("pk_id", orgApplyInfo.getPkId());
qw.eq("status","2"); qw.eq("status", "2");
OrgApplyInfo o_ = baseMapper.selectOne(qw); OrgApplyInfo o_ = baseMapper.selectOne(qw);
//把上一条数据设置为历史数据 同时变更信息变更状态 //把上一条数据设置为历史数据 同时变更信息变更状态
o_.setModifyStatus("2"); o_.setModifyStatus("2");
@ -174,21 +176,32 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl<OrgApplyInfoMapper, Org
//将变更后数据设置为正在使用的数据 //将变更后数据设置为正在使用的数据
orgApplyInfo.setStatus("2"); orgApplyInfo.setStatus("2");
orgApplyInfo.setModifyStatus("2"); orgApplyInfo.setFranchiseTime(o_.getFranchiseTime());
baseMapper.updateById(orgApplyInfo); baseMapper.updateById(orgApplyInfo);
//将同pkid的可修改状态改为可修改
qw = new QueryWrapper<>();
qw.eq("pk_id", orgApplyInfo.getPkId());
OrgApplyInfo upData_ = new OrgApplyInfo();
upData_.setModifyStatus("0");
baseMapper.update(upData_, qw);
} else if ("modifyFail".equals(orgApplyInfo.getStatus())) { } else if ("modifyFail".equals(orgApplyInfo.getStatus())) {
//将同pkid的可修改状态改为可修改
QueryWrapper<OrgApplyInfo> qw = new QueryWrapper<>(); QueryWrapper<OrgApplyInfo> qw = new QueryWrapper<>();
qw.eq("pk_id",orgApplyInfo.getPkId()); qw = new QueryWrapper<>();
qw.eq("status","2"); qw.eq("pk_id", orgApplyInfo.getPkId());
OrgApplyInfo o_ = baseMapper.selectOne(qw); OrgApplyInfo upData_ = new OrgApplyInfo();
//机构信息变更审核被驳回 upData_.setModifyStatus("0");
o_.setModifyStatus("5"); baseMapper.update(upData_, qw);
baseMapper.updateById(o_);
//将变更后数据设置为被驳回状态 //将变更后数据设置为被驳回状态
orgApplyInfo.setStatus("5"); orgApplyInfo.setStatus("5");
baseMapper.updateById(orgApplyInfo); baseMapper.updateById(orgApplyInfo);
}else{
} else {
if ("2".equals(orgApplyInfo.getStatus())) {
orgApplyInfo.setFranchiseTime(new Date());
}
//机构加盟审批流程 //机构加盟审批流程
baseMapper.updateById(orgApplyInfo); baseMapper.updateById(orgApplyInfo);
} }