解决机构信息接口返回的出生日期、有效日期等不正确问题
This commit is contained in:
parent
dd8bb92da9
commit
704448f43b
|
@ -60,7 +60,7 @@ public class OrgApplyInfoApiEntity implements Serializable {
|
|||
/**民族*/
|
||||
private String national;
|
||||
/**出生日期*/
|
||||
@JsonFormat(pattern = "yyyy年MM月dd日")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy年MM月dd日")
|
||||
@DateTimeFormat(pattern = "yyyy年MM月dd日")
|
||||
private Date birthDate;
|
||||
/**住址(身份证上)*/
|
||||
|
@ -70,11 +70,11 @@ public class OrgApplyInfoApiEntity implements Serializable {
|
|||
/**签发机关*/
|
||||
private String issuingAuthority;
|
||||
/**有效开始日期*/
|
||||
@JsonFormat(pattern = "yyyy.MM.dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy.MM.dd")
|
||||
@DateTimeFormat(pattern = "yyyy.MM.dd")
|
||||
private Date startTime;
|
||||
/**有效结束日期*/
|
||||
@JsonFormat(pattern = "yyyy.MM.dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy.MM.dd")
|
||||
@DateTimeFormat(pattern = "yyyy.MM.dd")
|
||||
private Date endTime;
|
||||
/**身份证正面*/
|
||||
|
@ -116,6 +116,8 @@ public class OrgApplyInfoApiEntity implements Serializable {
|
|||
/**机构区域 sys_category.id*/
|
||||
private java.lang.String orgDistrict;
|
||||
private java.lang.String orgDistrict_dictText;
|
||||
|
||||
private java.util.Date commitTime;//提交时间
|
||||
private java.util.Date auditTime;//审核时间
|
||||
private java.util.Date franchiseTime;//加盟时间
|
||||
|
||||
}
|
||||
|
|
|
@ -54,10 +54,10 @@ public class OrgApplyInfo implements Serializable {
|
|||
@Excel(name = "审批状态", width = 15)
|
||||
@ApiModelProperty(value = "审批状态")
|
||||
private java.lang.String status;
|
||||
/**变更状态 2变更完成 4变更申请中 5变更驳回 */
|
||||
/**变更状态 0可修改 1不可修改 */
|
||||
@Dict(dicCode = "org_apply_status")
|
||||
@Excel(name = "变更状态 2变更完成 4变更申请中 5变更驳回", width = 15)
|
||||
@ApiModelProperty(value = "变更状态 2变更完成 4变更申请中 5变更驳回")
|
||||
@Excel(name = "变更状态 0可修改 1不可修改", width = 15)
|
||||
@ApiModelProperty(value = "变更状态 0可修改 1不可修改")
|
||||
private java.lang.String modifyStatus;
|
||||
/**审核备注*/
|
||||
@Excel(name = "审核备注", width = 15)
|
||||
|
@ -208,4 +208,22 @@ public class OrgApplyInfo implements Serializable {
|
|||
@TableField(exist = false)
|
||||
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;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.nu.modules.orgapplyinfo.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
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.service.IOrgApplyInfoService;
|
||||
import com.nu.utils.DictUtils;
|
||||
import org.apache.commons.collections.ListUtils;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
@ -38,6 +40,9 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl<OrgApplyInfoMapper, Org
|
|||
OrgApplyInfo orgApplyInfo = new OrgApplyInfo();
|
||||
BeanUtils.copyProperties(orgApplyInfoApiEntity, orgApplyInfo);
|
||||
orgApplyInfo.setCreateTime(new Date());
|
||||
orgApplyInfo.setCommitTime(new Date());
|
||||
orgApplyInfo.setAuditTime(null);
|
||||
orgApplyInfo.setContent(null);
|
||||
baseMapper.insert(orgApplyInfo);
|
||||
orgApplyInfoApiEntity.setId(orgApplyInfo.getId());
|
||||
|
||||
|
@ -46,15 +51,12 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl<OrgApplyInfoMapper, Org
|
|||
baseMapper.updateById(orgApplyInfo);
|
||||
}
|
||||
if ("4".equals(orgApplyInfo.getStatus())) {
|
||||
//先将历史审核不通过的数据删除掉
|
||||
baseMapper.realDelete(orgApplyInfo.getPkId());
|
||||
|
||||
//如果是提交机构变更 需要将正在使用的数据(status =2 ) 的 modify_status改为4
|
||||
//如果是提交机构变更 需要将对应pkid都改为 modify_status=1 不可提交修改信息
|
||||
QueryWrapper<OrgApplyInfo> qw = new QueryWrapper<>();
|
||||
qw.eq("pk_id", orgApplyInfo.getPkId());
|
||||
qw.eq("status", "2");
|
||||
// qw.eq("status", "2");
|
||||
OrgApplyInfo updateData = new OrgApplyInfo();
|
||||
updateData.setModifyStatus("4");
|
||||
updateData.setModifyStatus("1");
|
||||
baseMapper.update(updateData, qw);
|
||||
}
|
||||
return orgApplyInfoApiEntity;
|
||||
|
@ -86,8 +88,7 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl<OrgApplyInfoMapper, Org
|
|||
par.setOrgDistrict_dictText(dictUtils.translateDictValue("id", "name", "sys_category", par.getOrgDistrict()));
|
||||
}
|
||||
|
||||
String jsonStr = JSON.toJSONString(list);
|
||||
List<OrgApplyInfoApiEntity> result = JSON.parseArray(jsonStr, OrgApplyInfoApiEntity.class);
|
||||
List<OrgApplyInfoApiEntity> result = BeanUtil.copyToList(list, OrgApplyInfoApiEntity.class);
|
||||
return result;
|
||||
|
||||
}
|
||||
|
@ -160,12 +161,13 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl<OrgApplyInfoMapper, Org
|
|||
|
||||
@Override
|
||||
public void audit(OrgApplyInfo orgApplyInfo) {
|
||||
orgApplyInfo.setAuditTime(new Date());
|
||||
OrgApplyInfo usedData = new OrgApplyInfo();
|
||||
//机构信息变更审核通过
|
||||
if ("modifyPass".equals(orgApplyInfo.getStatus())) {
|
||||
QueryWrapper<OrgApplyInfo> qw = new QueryWrapper<>();
|
||||
qw.eq("pk_id",orgApplyInfo.getPkId());
|
||||
qw.eq("status","2");
|
||||
qw.eq("pk_id", orgApplyInfo.getPkId());
|
||||
qw.eq("status", "2");
|
||||
OrgApplyInfo o_ = baseMapper.selectOne(qw);
|
||||
//把上一条数据设置为历史数据 同时变更“信息变更状态”
|
||||
o_.setModifyStatus("2");
|
||||
|
@ -174,21 +176,32 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl<OrgApplyInfoMapper, Org
|
|||
|
||||
//将变更后数据设置为正在使用的数据
|
||||
orgApplyInfo.setStatus("2");
|
||||
orgApplyInfo.setModifyStatus("2");
|
||||
orgApplyInfo.setFranchiseTime(o_.getFranchiseTime());
|
||||
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())) {
|
||||
//将同pkid的可修改状态改为可修改
|
||||
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_);
|
||||
qw = new QueryWrapper<>();
|
||||
qw.eq("pk_id", orgApplyInfo.getPkId());
|
||||
OrgApplyInfo upData_ = new OrgApplyInfo();
|
||||
upData_.setModifyStatus("0");
|
||||
baseMapper.update(upData_, qw);
|
||||
|
||||
//将变更后数据设置为被驳回状态
|
||||
orgApplyInfo.setStatus("5");
|
||||
baseMapper.updateById(orgApplyInfo);
|
||||
}else{
|
||||
|
||||
} else {
|
||||
if ("2".equals(orgApplyInfo.getStatus())) {
|
||||
orgApplyInfo.setFranchiseTime(new Date());
|
||||
}
|
||||
//机构加盟审批流程
|
||||
baseMapper.updateById(orgApplyInfo);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue