springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/sanshuo/ComEventDetailVO.java
@@ -130,4 +130,6 @@ @ApiModelProperty("时间类型名称") private String categoryName; @ApiModelProperty("当前调解部门") private String currentOrgName; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java
@@ -46,7 +46,7 @@ @PostMapping public R add(@RequestBody ComSanshuoExpertDTO comSanshuoExpertDTO){ comSanshuoExpertDTO.setCreateBy(this.getLoginUserInfo().getName()); return comSanShuoExpertService.addExpert(comSanshuoExpertDTO); return comSanShuoExpertService.addOrUpdateExpert(comSanshuoExpertDTO); } @GetMapping("/detail") @@ -67,10 +67,7 @@ * */ @PutMapping public R update(@RequestBody ComSanshuoExpertDTO comSanshuoExpertDTO){ ComSanshuoExpert expert=new ComSanshuoExpert(); BeanUtil.copyProperties(comSanshuoExpertDTO,expert); expert.setUpdateTime(new Date()); return R.ok(comSanShuoExpertService.updateById(expert)); return R.ok(comSanShuoExpertService.addOrUpdateExpert(comSanshuoExpertDTO)); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComSanShuoExpertService.java
@@ -14,7 +14,7 @@ * @param comSanshuoExpertDTO * @return 处理结果 * */ R addExpert(ComSanshuoExpertDTO comSanshuoExpertDTO); R addOrUpdateExpert(ComSanshuoExpertDTO comSanshuoExpertDTO); /** * 后台获取专家列表 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java
@@ -28,6 +28,7 @@ import com.panzhihua.service_community.service.ComStreetService; import com.panzhihua.service_community.util.MyAESUtil; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.math.BigDecimal; @@ -35,6 +36,7 @@ import java.util.Date; import java.util.List; import static java.util.Objects.isNull; import static java.util.Objects.nonNull; @Service @@ -60,7 +62,9 @@ * @return 处理结果 * */ @Override public R addExpert(ComSanshuoExpertDTO comSanshuoExpertDTO) { @Transactional(rollbackFor = Exception.class) public R addOrUpdateExpert(ComSanshuoExpertDTO comSanshuoExpertDTO) { if (isNull(comSanshuoExpertDTO.getId())){ //是否重名 List<ComSanshuoExpert> checkExpert=comSanshuoExpertDao.selectExpertByNameOrPhoneOrAccount(comSanshuoExpertDTO); if (checkExpert.size() != 0){ @@ -102,9 +106,31 @@ user.setName(comSanshuoExpertDTO.getName()); user.setType(11); user.setImageUrl(comSanshuoExpertDTO.getAvatar()); return userService.sanShuoAddUser(user); return R.ok(userService.sanShuoAddUser(user)); } return R.fail("添加失败"); }else { ComSanshuoExpert expert=new ComSanshuoExpert(); BeanUtil.copyProperties(comSanshuoExpertDTO,expert); if (nonNull(comSanshuoExpertDTO.getUnit())){ String id = comSanshuoExpertDTO.getUnit(); String[] split = id.split(","); expert.setUnitId(split[split.length-1]); } expert.setUpdateTime(new Date()); if (expert.getLevel()==2){ expert.setIndustryCenterId(Long.parseLong(expert.getUnitId())); expert.setUnit(comSanshuoIndustryCenterDao.selectById(expert.getUnitId()).getName()+"调解站"); }else if(expert.getLevel()==3){ expert.setStreetId(Long.parseLong(expert.getUnitId())); expert.setUnit(comStreetDAO.selectById(expert.getUnitId()).getName()+"调解站"); }else if(expert.getLevel()==4){ expert.setCommunityId(Long.parseLong(expert.getUnitId())); expert.setUnit(comActDAO.selectById(expert.getUnitId()).getName()+"调解站"); } return R.ok(comSanshuoExpertDao.updateById(expert)); } return R.fail("操作失败"); } /** springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComEventMapper.xml
@@ -388,6 +388,7 @@ left join com_sanshuo_expert t1 on t.specialist_id=t1.id where t.event_process_status not in(7.8) group by t1.level having type is not null </select> <select id="mediateTypeRate" resultType="com.panzhihua.common.model.vos.sanshuo.EventRateVO"> select count(t.id) as count,t1.name from com_sanshuo_event_info t