|
@@ -23,16 +23,15 @@ import com.jeeplus.test.workClientInfo.mapper.WorkClientBankMapper;
|
|
|
import com.jeeplus.test.workClientInfo.mapper.WorkClientInfoMapper;
|
|
|
import com.jeeplus.test.workClientInfo.mapper.WorkClientJobTypeInfoMapper;
|
|
|
import com.jeeplus.test.workClientInfo.mapper.WorkClientLinkmanMapper;
|
|
|
+import com.jeeplus.test.workContract.service.WorkContractService;
|
|
|
+import com.jeeplus.test.workContract.service.dto.WorkContractInfoDto;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.flowable.editor.language.json.converter.util.CollectionUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.UUID;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Slf4j
|
|
@@ -55,6 +54,9 @@ public class WorkClientService {
|
|
|
private WorkClientJobTypeInfoMapper workClientJobTypeInfoMapper;
|
|
|
|
|
|
@Resource
|
|
|
+ private WorkContractService workContractService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
private OssService ossService;
|
|
|
|
|
|
/**
|
|
@@ -145,7 +147,7 @@ public class WorkClientService {
|
|
|
i.setId(UUID.randomUUID().toString().replace("-", ""));
|
|
|
|
|
|
//文件类型处理
|
|
|
- List<String> strings = Arrays.asList(dto.getName().split("\\."));
|
|
|
+ List<String> strings = Arrays.asList(i.getAttachmentName().split("\\."));
|
|
|
if (CollectionUtils.isNotEmpty(strings)) {
|
|
|
i.setType(strings.get(1));
|
|
|
}
|
|
@@ -169,7 +171,16 @@ public class WorkClientService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public String removeById (String id) {
|
|
|
+ public Map<String,Object> removeById (String id) {
|
|
|
+ Map<String,Object> map = new HashMap();
|
|
|
+ //判断客户是否被合同调用
|
|
|
+ List<WorkContractInfoDto> contractInfoDtoList = workContractService.getInfoByClientId(id);
|
|
|
+ if(null != contractInfoDtoList && contractInfoDtoList.size()>0){
|
|
|
+ map.put("success",false);
|
|
|
+ map.put("message","客户已被引用,无法删除!");
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
//客户信息删除
|
|
|
workClientInfoMapper.deleteById(id);
|
|
|
//客户行业处理
|
|
@@ -188,7 +199,9 @@ public class WorkClientService {
|
|
|
LambdaQueryWrapper<WorkAttachment> wrapper2 = new LambdaQueryWrapper<>();
|
|
|
wrapper2.eq(WorkAttachment::getAttachmentId, id);
|
|
|
ossServiceMapper.delete(wrapper2);
|
|
|
- return "删除完成!";
|
|
|
+ map.put("success",true);
|
|
|
+ map.put("message","删除成功!");
|
|
|
+ return map;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -397,7 +410,7 @@ public class WorkClientService {
|
|
|
*/
|
|
|
public IPage<WorkClientInfo> componentList(Page<WorkClientInfo> page, QueryWrapper<WorkClientInfo> queryWrapper) {
|
|
|
queryWrapper.eq("a.del_flag","0");
|
|
|
- IPage<WorkClientInfo> pageList = workClientInfoMapper.componentList(page, queryWrapper);
|
|
|
+ IPage<WorkClientInfo> pageList = workClientInfoMapper.findPageList(page, queryWrapper);
|
|
|
return pageList;
|
|
|
}
|
|
|
|