Browse Source

修改在职党员报道,包联社区可以修改;

master
luyan 2 years ago
parent
commit
a61e831b64
  1. 14
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/party/controller/ReportPartyController.java
  2. 2
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/party/dao/ReportPartyDao.java
  3. 2
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/party/service/ReportPartyService.java
  4. 10
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/party/service/impl/ReportPartyServiceImpl.java
  5. 14
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/ReportPartyDao.xml

14
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/party/controller/ReportPartyController.java

@ -70,9 +70,17 @@ public class ReportPartyController {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
if (StringUtils.isNotEmpty(dto.getIdCard()) && StringUtils.isNotEmpty(dto.getName())) {
int sum = reportPartyService.findByIdCardAndName(dto.getIdCard(), dto.getName());
if (sum == 1) {
throw new RenException("您已经报到,无需再次报道!");
ReportPartyDTO result = reportPartyService.getByIdCardAndName(dto.getIdCard(), dto.getName());
if (null != result && !dto.getCouplingCommunity().equals(result.getCouplingCommunity())) {
result.setId(dto.getId());
result.setCouplingCommunity(dto.getCouplingCommunity());
result.setCouplingCommunityName(dto.getCouplingCommunityName());
reportPartyService.update(result);
} else {
int sum = reportPartyService.findByIdCardAndName(dto.getIdCard(), dto.getName());
if (sum == 1) {
throw new RenException("您已经报到,无需再次报道!");
}
}
}
reportPartyService.save(dto);

2
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/party/dao/ReportPartyDao.java

@ -32,4 +32,6 @@ import org.apache.ibatis.annotations.Param;
public interface ReportPartyDao extends BaseDao<ReportPartyEntity> {
int findByIdCardAndName(@Param("idCard") String idCard, @Param("name") String name);
ReportPartyEntity getByIdCardAndName(@Param("idCard") String idCard, @Param("name") String name);
}

2
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/party/service/ReportPartyService.java

@ -94,4 +94,6 @@ public interface ReportPartyService extends BaseService<ReportPartyEntity> {
void delete(String[] ids);
int findByIdCardAndName(String idCard, String name);
ReportPartyDTO getByIdCardAndName(String idCard, String name);
}

10
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/party/service/impl/ReportPartyServiceImpl.java

@ -38,7 +38,10 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* 党员报道
@ -185,6 +188,11 @@ public class ReportPartyServiceImpl extends BaseServiceImpl<ReportPartyDao, Repo
return baseDao.findByIdCardAndName(idCard, name);
}
@Override
public ReportPartyDTO getByIdCardAndName(String idCard, String name) {
return ConvertUtils.sourceToTarget(baseDao.getByIdCardAndName(idCard, name), ReportPartyDTO.class);
}
private void setDeptId(ReportPartyDTO dto) {
UserDetail user = SecurityUser.getUser();
String deptId = String.valueOf(user.getDeptId());

14
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/ReportPartyDao.xml

@ -42,4 +42,18 @@
LIMIT 1
</select>
<select id="getByIdCardAndName">
select rp.* from FROM report_party rp
<where>
rp.DEL_FLAG = 0
<if test="null != idCard and idCard != ''">
AND rp.ID_CARD = #{idCard}
</if>
<if test="null != name and name != ''">
AND rp.NAME = #{name}
</if>
LIMIT 1
</where>
</select>
</mapper>

Loading…
Cancel
Save