|
|
@@ -0,0 +1,40 @@
|
|
|
+package com.lc.ibps.org.provider;
|
|
|
+
|
|
|
+import com.lc.ibps.api.form.sql.util.BeanUtils;
|
|
|
+import com.lc.ibps.cloud.entity.APIResult;
|
|
|
+import com.lc.ibps.cloud.provider.GenericProvider;
|
|
|
+import com.lc.ibps.org.api.IPartyPositionUserService;
|
|
|
+import com.lc.ibps.org.party.persistence.entity.PartyPositionUserPo;
|
|
|
+import com.lc.ibps.org.party.repository.PartyPositionUserRepository;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+@Api(tags = "参与者关系", value = "岗位职责关系关系")
|
|
|
+@Service
|
|
|
+public class PartyPositionUserProvider extends GenericProvider implements IPartyPositionUserService {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private PartyPositionUserRepository partyPositionUserRepository;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public APIResult<Void> save(Map<String,String> data) {
|
|
|
+ APIResult<Void> result = new APIResult<>();
|
|
|
+ if(BeanUtils.isNotEmpty(data.get("oldId"))){
|
|
|
+ //先查询旧的id
|
|
|
+ PartyPositionUserPo poOld = partyPositionUserRepository.get(data.get("oldId"));
|
|
|
+ logger.warn("更新主岗位关联表,数据id:()--->oldId: {}",data.get("oldId"));
|
|
|
+ if(BeanUtils.isNotEmpty(poOld)){
|
|
|
+ //有对应的数据将状态改为普通数据
|
|
|
+ partyPositionUserRepository.upByIdGeneral(data.get("oldId"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ partyPositionUserRepository.upByIdSpecial(data.get("newId"));
|
|
|
+ logger.warn("更新主岗位关联表,数据id:()--->newId: {}",data.get("newId"));
|
|
|
+ result.setMessage("切换主岗位成功");
|
|
|
+ result.setState(200);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+}
|