|
@ -33,6 +33,10 @@ import com.yxt.anrui.oa.feign.file.OaFileEnum; |
|
|
import com.yxt.anrui.oa.feign.flowable.flow.ProcDefEnum; |
|
|
import com.yxt.anrui.oa.feign.flowable.flow.ProcDefEnum; |
|
|
import com.yxt.anrui.oa.feign.portal.sysorganization.SysOrganizationFeign; |
|
|
import com.yxt.anrui.oa.feign.portal.sysorganization.SysOrganizationFeign; |
|
|
import com.yxt.anrui.oa.feign.portal.sysorganization.SysOrganizationVo; |
|
|
import com.yxt.anrui.oa.feign.portal.sysorganization.SysOrganizationVo; |
|
|
|
|
|
import com.yxt.anrui.oa.feign.portal.sysstaffpost.SysStaffPostFeign; |
|
|
|
|
|
import com.yxt.anrui.oa.feign.portal.sysstaffpost.SysStaffPostVos; |
|
|
|
|
|
import com.yxt.anrui.oa.feign.sysuser.SysUserFeign; |
|
|
|
|
|
import com.yxt.anrui.oa.feign.sysuser.SysUserVo; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
import com.yxt.common.core.result.ResultBean; |
|
@ -54,11 +58,22 @@ public class AdExpatriatesHomeApplyService extends MybatisBaseService<AdExpatria |
|
|
private OaFormService oaFormService; |
|
|
private OaFormService oaFormService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private SysOrganizationFeign sysOrganizationFeign; |
|
|
private SysOrganizationFeign sysOrganizationFeign; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private SysUserFeign sysUserFeign; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private SysStaffPostFeign sysStaffPostFeign; |
|
|
|
|
|
|
|
|
public ResultBean<AdExpatriatesHomeApplyVo> getSaveInit(String userSid, String orgPath) { |
|
|
public ResultBean<AdExpatriatesHomeApplyVo> getSaveInit(String userSid, String orgPath) { |
|
|
ResultBean<AdExpatriatesHomeApplyVo> rb = ResultBean.fireFail(); |
|
|
ResultBean<AdExpatriatesHomeApplyVo> rb = ResultBean.fireFail(); |
|
|
AdExpatriatesHomeApplyVo adExpatriatesHomeApplyVo = new AdExpatriatesHomeApplyVo(); |
|
|
AdExpatriatesHomeApplyVo adExpatriatesHomeApplyVo = new AdExpatriatesHomeApplyVo(); |
|
|
|
|
|
SysUserVo sysUserVo = sysUserFeign.fetchBySid(userSid).getData(); |
|
|
adExpatriatesHomeApplyVo.setCreateBySid(userSid); |
|
|
adExpatriatesHomeApplyVo.setCreateBySid(userSid); |
|
|
|
|
|
adExpatriatesHomeApplyVo.setCreateByName(sysUserVo.getName()); |
|
|
|
|
|
List<SysStaffPostVos> staffPostVos = sysStaffPostFeign.selPostByStaffSid(sysUserVo.getStaffSid()).getData(); |
|
|
|
|
|
if (staffPostVos.size() > 0){ |
|
|
|
|
|
adExpatriatesHomeApplyVo.setJobKey(staffPostVos.get(0).getSid()); |
|
|
|
|
|
adExpatriatesHomeApplyVo.setJobValue(staffPostVos.get(0).getName()); |
|
|
|
|
|
} |
|
|
adExpatriatesHomeApplyVo.setOrgSidPath(orgPath); |
|
|
adExpatriatesHomeApplyVo.setOrgSidPath(orgPath); |
|
|
return rb.success().setData(adExpatriatesHomeApplyVo); |
|
|
return rb.success().setData(adExpatriatesHomeApplyVo); |
|
|
} |
|
|
} |
|
@ -82,10 +97,10 @@ public class AdExpatriatesHomeApplyService extends MybatisBaseService<AdExpatria |
|
|
BeanUtil.copyProperties(adExpatriatesHomeApply, adExpatriatesHomeApplyVo); |
|
|
BeanUtil.copyProperties(adExpatriatesHomeApply, adExpatriatesHomeApplyVo); |
|
|
adExpatriatesHomeApplyVo.setJobKey(adExpatriatesHomeApply.getPostSid()); |
|
|
adExpatriatesHomeApplyVo.setJobKey(adExpatriatesHomeApply.getPostSid()); |
|
|
adExpatriatesHomeApplyVo.setJobValue(adExpatriatesHomeApply.getPostName()); |
|
|
adExpatriatesHomeApplyVo.setJobValue(adExpatriatesHomeApply.getPostName()); |
|
|
FormCommon jobObj = FormCommon.of(adExpatriatesHomeApplyVo.getJobKey(), adExpatriatesHomeApplyVo.getJobValue()); |
|
|
|
|
|
adExpatriatesHomeApplyVo.setJobObj(jobObj); |
|
|
|
|
|
FormCommon relationObj = FormCommon.of(adExpatriatesHomeApplyVo.getRelationKey(), adExpatriatesHomeApplyVo.getRelationValue()); |
|
|
FormCommon relationObj = FormCommon.of(adExpatriatesHomeApplyVo.getRelationKey(), adExpatriatesHomeApplyVo.getRelationValue()); |
|
|
adExpatriatesHomeApplyVo.setRelationObj(relationObj); |
|
|
adExpatriatesHomeApplyVo.setRelationObj(relationObj); |
|
|
|
|
|
FormCommon homeTypeObj = FormCommon.of(adExpatriatesHomeApplyVo.getHomeTypeKey(), adExpatriatesHomeApplyVo.getHomeTypeValue()); |
|
|
|
|
|
adExpatriatesHomeApplyVo.setHomeTypeObj(homeTypeObj); |
|
|
List<String> files = oaAppendixService.selectByLinkSid(sid, "图片"); |
|
|
List<String> files = oaAppendixService.selectByLinkSid(sid, "图片"); |
|
|
adExpatriatesHomeApplyVo.setFiles(files); |
|
|
adExpatriatesHomeApplyVo.setFiles(files); |
|
|
List<String> appes = oaAppendixService.selectByLinkSid(sid, "文件"); |
|
|
List<String> appes = oaAppendixService.selectByLinkSid(sid, "文件"); |
|
@ -97,7 +112,7 @@ public class AdExpatriatesHomeApplyService extends MybatisBaseService<AdExpatria |
|
|
public ResultBean<String> saveOrUpdateDto(AdExpatriatesHomeApplyDto dto) { |
|
|
public ResultBean<String> saveOrUpdateDto(AdExpatriatesHomeApplyDto dto) { |
|
|
ResultBean<String> rb = ResultBean.fireFail(); |
|
|
ResultBean<String> rb = ResultBean.fireFail(); |
|
|
String sid = dto.getSid(); |
|
|
String sid = dto.getSid(); |
|
|
String homeType = dto.getHomeType(); |
|
|
String homeTypeKey = dto.getHomeTypeKey(); |
|
|
List<String> files = dto.getFiles(); |
|
|
List<String> files = dto.getFiles(); |
|
|
List<String> appes = dto.getAppes(); |
|
|
List<String> appes = dto.getAppes(); |
|
|
if (StringUtils.isBlank(sid)) { |
|
|
if (StringUtils.isBlank(sid)) { |
|
@ -105,9 +120,9 @@ public class AdExpatriatesHomeApplyService extends MybatisBaseService<AdExpatria |
|
|
AdExpatriatesHomeApply entity = new AdExpatriatesHomeApply(); |
|
|
AdExpatriatesHomeApply entity = new AdExpatriatesHomeApply(); |
|
|
BeanUtil.copyProperties(dto, entity, "sid"); |
|
|
BeanUtil.copyProperties(dto, entity, "sid"); |
|
|
|
|
|
|
|
|
if ("1".equals(homeType)){ |
|
|
if ("0".equals(homeTypeKey)){ |
|
|
dto.setBillNo("ZWRYTQXJSQ"); |
|
|
dto.setBillNo("ZWRYTQXJSQ"); |
|
|
}else if ("2".equals(homeType)){ |
|
|
}else if ("1".equals(homeTypeKey)){ |
|
|
dto.setBillNo("ZWRYJSTQSQ"); |
|
|
dto.setBillNo("ZWRYJSTQSQ"); |
|
|
} |
|
|
} |
|
|
dto.setSid(entity.getSid()); |
|
|
dto.setSid(entity.getSid()); |
|
@ -118,12 +133,16 @@ public class AdExpatriatesHomeApplyService extends MybatisBaseService<AdExpatria |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
entity.setFormSid(resultBean.getData()); |
|
|
entity.setFormSid(resultBean.getData()); |
|
|
|
|
|
entity.setPostSid(dto.getJobKey()); |
|
|
|
|
|
entity.setPostName(dto.getJobValue()); |
|
|
baseMapper.insert(entity); |
|
|
baseMapper.insert(entity); |
|
|
sid = entity.getSid(); |
|
|
sid = entity.getSid(); |
|
|
} else { |
|
|
} else { |
|
|
// 更新操作
|
|
|
// 更新操作
|
|
|
AdExpatriatesHomeApply entity = fetchBySid(sid); |
|
|
AdExpatriatesHomeApply entity = fetchBySid(sid); |
|
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
|
|
|
|
entity.setPostSid(dto.getJobKey()); |
|
|
|
|
|
entity.setPostName(dto.getJobValue()); |
|
|
baseMapper.updateById(entity); |
|
|
baseMapper.updateById(entity); |
|
|
} |
|
|
} |
|
|
// 处理附件
|
|
|
// 处理附件
|
|
|