Commit 25e49846 authored by hongguangwu's avatar hongguangwu

MVP1.6.6-预入职相关_项目列表加权限

parent 749be96b
...@@ -45,4 +45,10 @@ public interface TAttaInfoMapper extends BaseMapper<TAttaInfo> { ...@@ -45,4 +45,10 @@ public interface TAttaInfoMapper extends BaseMapper<TAttaInfo> {
List<TAttaInfo> getAttaByApplyId(@Param("applyId")String applyId); List<TAttaInfo> getAttaByApplyId(@Param("applyId")String applyId);
void deleteByDomainId(@Param("domainId") String domainId); void deleteByDomainId(@Param("domainId") String domainId);
void deleteByDomainIdAndType(@Param("domainId") String domainId, @Param("relationType") String relationType);
// 删除学历与职业资格之外的附件
void deleteByDomainIdAndOther(@Param("domainId") String domainId);
} }
...@@ -79,4 +79,8 @@ public interface TAttaInfoService extends IService<TAttaInfo> { ...@@ -79,4 +79,8 @@ public interface TAttaInfoService extends IService<TAttaInfo> {
**/ **/
void deleteByDomainId(String domainId); void deleteByDomainId(String domainId);
void deleteByDomainIdAndOther(String domainId);
void deleteByDomainIdAndType(String domainId, int relationType);
} }
...@@ -133,4 +133,22 @@ public class TAttaInfoServiceImpl extends ServiceImpl<TAttaInfoMapper, TAttaInfo ...@@ -133,4 +133,22 @@ public class TAttaInfoServiceImpl extends ServiceImpl<TAttaInfoMapper, TAttaInfo
public void deleteByDomainId(String domainId) { public void deleteByDomainId(String domainId) {
baseMapper.deleteByDomainId(domainId); baseMapper.deleteByDomainId(domainId);
} }
@Override
public void deleteByDomainIdAndOther(String domainId) {
baseMapper.deleteByDomainIdAndOther(domainId);
}
@Override
public void deleteByDomainIdAndType(String domainId, int relationType) {
// 学历
if (relationType == 0) {
baseMapper.deleteByDomainIdAndType(domainId, "0");
baseMapper.deleteByDomainIdAndType(domainId, "26");
} else if (relationType == 1) {
// 执业资格证书
baseMapper.deleteByDomainIdAndType(domainId, "2");
}
}
} }
...@@ -785,6 +785,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -785,6 +785,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/ **/
@Override @Override
@Transactional
public R<String> saveDraftPreEmpMain(PreEmpMainDetailVo vo) { public R<String> saveDraftPreEmpMain(PreEmpMainDetailVo vo) {
return saveBase(vo, CommonConstants.ZERO_STRING); return saveBase(vo, CommonConstants.ZERO_STRING);
} }
...@@ -797,6 +798,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -797,6 +798,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/ **/
@Override @Override
@Transactional
public R<String> savePreEmpMain(PreEmpMainDetailVo vo) { public R<String> savePreEmpMain(PreEmpMainDetailVo vo) {
return saveBase(vo, CommonConstants.ONE_STRING); return saveBase(vo, CommonConstants.ONE_STRING);
} }
...@@ -808,12 +810,11 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -808,12 +810,11 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
* @Date: 2024/6/17 17:44 * @Date: 2024/6/17 17:44
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/ **/
@Transactional
private R<String> saveBase(PreEmpMainDetailVo vo, String status) { private R<String> saveBase(PreEmpMainDetailVo vo, String status) {
YifuUser user = getNewYifuUser(); YifuUser user = getNewYifuUser();
TPreEmpMain main = vo.getMain(); TPreEmpMain main = vo.getMain();
String idCard = main.getEmpIdcard(); String idCard = main.getEmpIdcard();
if (main != null && Common.isNotNull(idCard)) { if (Common.isNotNull(idCard)) {
TPreEmployeeProject tPreEmployeeProject = vo.getTpreEmployeeProject(); TPreEmployeeProject tPreEmployeeProject = vo.getTpreEmployeeProject();
if (tPreEmployeeProject != null && Common.isNotNull(tPreEmployeeProject.getOldId())) { if (tPreEmployeeProject != null && Common.isNotNull(tPreEmployeeProject.getOldId())) {
// 预入职-人员档案表 // 预入职-人员档案表
...@@ -871,7 +872,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -871,7 +872,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (tPreEmpEducation.getAttaList() != null && !tPreEmpEducation.getAttaList().isEmpty()) { if (tPreEmpEducation.getAttaList() != null && !tPreEmpEducation.getAttaList().isEmpty()) {
List<TAttaInfo> attaList = tPreEmpEducation.getAttaList(); List<TAttaInfo> attaList = tPreEmpEducation.getAttaList();
if (attaList != null) { if (attaList != null) {
tAttaInfoService.deleteByDomainId(tPreEmpEducation.getId()); tAttaInfoService.deleteByDomainIdAndType(tPreEmpEducation.getId(),0);
for (TAttaInfo atta : attaList) { for (TAttaInfo atta : attaList) {
atta.setId(null); atta.setId(null);
atta.setDomainId(tPreEmpEducation.getId()); atta.setDomainId(tPreEmpEducation.getId());
...@@ -949,7 +950,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -949,7 +950,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (info.getAttaList() != null && !info.getAttaList().isEmpty()) { if (info.getAttaList() != null && !info.getAttaList().isEmpty()) {
List<TAttaInfo> attaList = info.getAttaList(); List<TAttaInfo> attaList = info.getAttaList();
if (attaList != null) { if (attaList != null) {
tAttaInfoService.deleteByDomainId(info.getId()); tAttaInfoService.deleteByDomainIdAndType(info.getId(),1);
for (TAttaInfo atta : attaList) { for (TAttaInfo atta : attaList) {
atta.setId(null); atta.setId(null);
atta.setDomainId(info.getId()); atta.setDomainId(info.getId());
...@@ -1167,7 +1168,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -1167,7 +1168,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
List<TAttaInfo> attaList = tPreEmpEducation.getAttaList(); List<TAttaInfo> attaList = tPreEmpEducation.getAttaList();
if (attaList != null) { if (attaList != null) {
String attaId = tPreEmpEducation.getOldId(); String attaId = tPreEmpEducation.getOldId();
tAttaInfoService.deleteByDomainId(attaId); tAttaInfoService.deleteByDomainIdAndType(attaId, 0);
TAttaInfo newEmpAtta; TAttaInfo newEmpAtta;
for (TAttaInfo atta : attaList) { for (TAttaInfo atta : attaList) {
newEmpAtta = new TAttaInfo(); newEmpAtta = new TAttaInfo();
...@@ -1307,7 +1309,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -1307,7 +1309,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
List<TAttaInfo> attaList = preInfo.getAttaList(); List<TAttaInfo> attaList = preInfo.getAttaList();
if (attaList != null) { if (attaList != null) {
String attaId = preInfo.getOldId(); String attaId = preInfo.getOldId();
tAttaInfoService.deleteByDomainId(attaId); tAttaInfoService.deleteByDomainIdAndType(attaId, 1);
TAttaInfo newEmpAtta; TAttaInfo newEmpAtta;
for (TAttaInfo atta : attaList) { for (TAttaInfo atta : attaList) {
newEmpAtta = new TAttaInfo(); newEmpAtta = new TAttaInfo();
...@@ -1355,7 +1357,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -1355,7 +1357,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
List<TAttaInfo> attaList = vo.getAttaInfoList(); List<TAttaInfo> attaList = vo.getAttaInfoList();
if (attaList != null) { if (attaList != null) {
// 先删除其他信息 // 先删除其他信息
tAttaInfoService.deleteByDomainId(empId); tAttaInfoService.deleteByDomainIdAndOther(empId);
TAttaInfo attaEmp; TAttaInfo attaEmp;
List<TAttaInfo> attaEmpList = new ArrayList<>(); List<TAttaInfo> attaEmpList = new ArrayList<>();
for (TAttaInfo atta : attaList) { for (TAttaInfo atta : attaList) {
......
...@@ -127,4 +127,12 @@ ...@@ -127,4 +127,12 @@
delete from t_atta_info where domain_id=#{domainId} delete from t_atta_info where domain_id=#{domainId}
</delete> </delete>
<delete id="deleteByDomainIdAndType">
delete from t_atta_info where domain_id=#{domainId} and relation_type = #{relationType}
</delete>
<delete id="deleteByDomainIdAndOther">
delete from t_atta_info where domain_id=#{domainId} and relation_type not in ('0','2','26')
</delete>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment