fix:对接CRM

dev_1.0.2
UNISINSIGHT\rdpnr_jiangpeng 2026-04-01 17:28:28 +08:00
parent 980a8147ce
commit 4d8e4fa01d
17 changed files with 365 additions and 21 deletions

View File

@ -85,6 +85,13 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="建设类型" prop="constructionType">
<el-input v-model="form.constructionType" readonly />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="最终客户" prop="customerName">

View File

@ -175,6 +175,11 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="建设类型" prop="constructionType">
<el-input v-model="form.constructionType" placeholder="请输入建设类型" :disabled="isFormDisabled" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
@ -670,6 +675,7 @@ export default {
agentName: null,
agentCode: null,
projectStage: null,
constructionType: null,
projectGraspDegree: null,
hzSupportUserName: null,
hzSupportUser: null,

View File

@ -70,6 +70,14 @@
/>
</el-select>
</el-form-item>
<el-form-item label="建设类型" prop="constructionType">
<el-input
v-model="queryParams.constructionType"
placeholder="请输入建设类型"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="汇智负责人" prop="hzSupportUserName">
<el-input
v-model="queryParams.hzSupportUserName"
@ -193,6 +201,7 @@
<dict-tag :options="dict.type.project_stage" :value="scope.row.projectStage"/>
</template>
</el-table-column>
<el-table-column label="建设类型" align="center" prop="constructionType" width="120" />
<el-table-column label="汇智负责人" align="center" prop="hzSupportUserName" width="100" />
<el-table-column label="POC" align="center" prop="poc" width="60">
<template slot-scope="scope">
@ -346,6 +355,7 @@ export default {
collect: null,
projectGraspDegree: null,
projectStage: [],
constructionType: null,
hzSupportUserName: null,
poc: null,
timeType: '0', // Default to

View File

@ -1,14 +1,29 @@
package com.ruoyi.sip.controller;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.sip.domain.ProjectInfo;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.sip.dto.ApiDataQueryDto;
import com.ruoyi.sip.dto.ApiProjectAddDto;
import com.ruoyi.sip.dto.ApiUserAddDto;
import com.ruoyi.sip.dto.ApiUserInfo;
import com.ruoyi.sip.service.*;
import com.ruoyi.framework.shiro.service.SysPasswordService;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.BeanUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/**
@ -37,6 +52,12 @@ public class ExternalController {
private IInventoryDeliveryService deliveryService;
@Autowired
private IProjectOrderInfoRecallService projectOrderInfoRecallService;
@Autowired
private IProjectInfoService projectInfoService;
@Autowired
private ISysUserService userService;
@Autowired
private SysPasswordService passwordService;
private final static String API_KEY = "c7f858d0-30b8-4b7f-9ea1-0ccf5ceb1c54";
@ -77,4 +98,102 @@ public class ExternalController {
return AjaxResult.success(projectOrderInfoRecallService.getOrderRecallInfo(dto));
}
@GetMapping("/v1/user/info")
@Anonymous
public AjaxResult getUserInfo(@RequestParam(value = "userCode", required = false) String userCode,
@RequestParam(value = "roleName", required = false) String roleName,
@RequestHeader(value = "apiKey", required = false) String apiKey) {
if (StringUtils.isEmpty(apiKey)) {
return AjaxResult.error("apiKey不能为空");
}
if (!API_KEY.equals(apiKey)) {
return AjaxResult.error("鉴权失败");
}
if (StringUtils.isEmpty(userCode) && StringUtils.isEmpty(roleName)) {
return AjaxResult.error("用户code或角色名称不能为空");
}
if (StringUtils.isNotEmpty(userCode)) {
SysUser user = userService.selectUserByLoginName(userCode);
List<ApiUserInfo> userList = new ArrayList<>();
if (user != null) {
userList.add(convertToApiUserInfo(user));
}
return AjaxResult.success(userList);
}
return AjaxResult.success(convertToApiUserInfoList(userService.listByRoleName(roleName)));
}
private List<ApiUserInfo> convertToApiUserInfoList(List<SysUser> userList) {
List<ApiUserInfo> result = new ArrayList<>();
if (userList == null || userList.isEmpty()) {
return result;
}
for (SysUser user : userList) {
result.add(convertToApiUserInfo(user));
}
return result;
}
private ApiUserInfo convertToApiUserInfo(SysUser user) {
ApiUserInfo apiUserInfo = new ApiUserInfo();
BeanUtils.copyProperties(user, apiUserInfo);
return apiUserInfo;
}
@PostMapping("/v1/user/add")
@Anonymous
public AjaxResult addUserInfo(@RequestBody ApiUserAddDto dto,
@RequestHeader(value = "apiKey", required = false) String apiKey) {
if (StringUtils.isEmpty(apiKey)) {
return AjaxResult.error("apiKey不能为空");
}
if (!API_KEY.equals(apiKey)) {
return AjaxResult.error("鉴权失败");
}
if (StringUtils.isEmpty(dto.getUserName())) {
return AjaxResult.error("userName不能为空");
}
if (StringUtils.isEmpty(dto.getLoginName())) {
return AjaxResult.error("loginName不能为空");
}
SysUser sysUser = new SysUser();
sysUser.setUserName(dto.getUserName());
sysUser.setLoginName(dto.getLoginName());
if (dto.getRoleIds() != null && dto.getRoleIds().length > 0) {
sysUser.setRoleIds(dto.getRoleIds());
}
if (!userService.checkLoginNameUnique(sysUser)) {
return AjaxResult.error("新增用户'" + dto.getLoginName() + "'失败,登录账号已存在");
}
String rawPassword = StringUtils.isEmpty(dto.getPassword()) ? "123456" : dto.getPassword();
sysUser.setSalt(ShiroUtils.randomSalt());
sysUser.setPassword(passwordService.encryptPassword(dto.getLoginName(), rawPassword, sysUser.getSalt()));
sysUser.setUserType(UserConstants.SYSTEM_USER_TYPE);
sysUser.setStatus(UserConstants.NORMAL);
sysUser.setPwdUpdateDate(DateUtils.getNowDate());
sysUser.setCreateBy("external-api");
userService.insertUser(sysUser);
return AjaxResult.success(convertToApiUserInfo(sysUser));
}
@PostMapping("/v1/project/add")
@Anonymous
public AjaxResult addProjectInfo(@RequestBody ApiProjectAddDto dto,
@RequestHeader(value = "apiKey", required = false) String apiKey) {
if (StringUtils.isEmpty(apiKey)) {
return AjaxResult.error("apiKey不能为空");
}
if (!API_KEY.equals(apiKey)) {
return AjaxResult.error("鉴权失败");
}
if (dto == null) {
return AjaxResult.error("请求参数不能为空");
}
if (StringUtils.isEmpty(dto.getProjectName())) {
return AjaxResult.error("projectName不能为空");
}
ProjectInfo projectInfo = projectInfoService.insertProjectInfoForApi(dto);
return ObjectUtils.isEmpty(projectInfo) ? AjaxResult.error("新增项目失败") : AjaxResult.success(projectInfo);
}
}

View File

@ -120,7 +120,7 @@ public class ProjectInfoController extends BaseController
@ResponseBody
public AjaxResult addSave(ProjectInfo projectInfo)
{
return toAjax(projectInfoService.insertProjectInfo(projectInfo));
return toAjax(projectInfoService.insertProjectInfo(projectInfo, false));
}
/**
@ -168,7 +168,7 @@ public class ProjectInfoController extends BaseController
@ResponseBody
public AjaxResult editSave(ProjectInfo projectInfo)
{
return toAjax(projectInfoService.updateProjectInfo(projectInfo));
return toAjax(projectInfoService.updateProjectInfo(projectInfo, false));
}
/**

View File

@ -92,7 +92,7 @@ public class VueProjectInfoController extends BaseController {
@Log(title = "项目管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ProjectInfo projectInfo) {
return toAjax(projectInfoService.insertProjectInfo(projectInfo));
return toAjax(projectInfoService.insertProjectInfo(projectInfo, false));
}
/**
@ -102,7 +102,7 @@ public class VueProjectInfoController extends BaseController {
@Log(title = "项目管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProjectInfo projectInfo) {
return toAjax(projectInfoService.updateProjectInfo(projectInfo));
return toAjax(projectInfoService.updateProjectInfo(projectInfo, false));
}
@RequiresPermissions("sip:project:edit")
@Log(title = "会审", businessType = BusinessType.UPDATE)

View File

@ -56,6 +56,7 @@ public class ProjectInfo extends BaseEntity
*/
@Excel(name = "项目阶段", dictType = "project_stage")
private String projectStage;
private String constructionType;
/** 项目把握度 */
@Excel(name = "项目把握度")
private String projectGraspDegree;

View File

@ -0,0 +1,65 @@
package com.ruoyi.sip.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
public class ApiProjectAddDto {
/** 项目编号 */
private String projectCode;
/** 项目名称 */
private String projectName;
/** 客户名称 */
private String customerName;
/** 运作机构 */
private String operateInstitution;
/** 新华三联系人 */
private String h3cPerson;
/** 新华三TEL */
private String h3cPhone;
/** 预计金额 */
private BigDecimal estimatedAmount;
/** 预计下单时间 */
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date estimatedOrderTime;
/** 项目把握度 */
private String projectGraspDegree;
/** 项目阶段 */
private String projectStage;
/** 竞争对手 */
private List<String> competitorList;
/** 汇智负责人 */
private String hzSupportUser;
/** 创建人 */
private String createBy;
/** 建设类型 */
private String constructionType;
/** 代理商 */
private Partner partner;
@Data
public static class Partner {
/** 代理商编码 */
private String partnerCode;
/** 代理商名称 */
private String partnerName;
/** 省 */
private String province;
/** 市 */
private String city;
/** 地址 */
private String address;
/** 联系人姓名 */
private String contactPerson;
/** 联系人电话 */
private String contactPhone;
/** 认证级别 */
private String level;
}
}

View File

@ -0,0 +1,13 @@
package com.ruoyi.sip.dto;
import lombok.Data;
@Data
public class ApiUserAddDto {
private String userName;
private String loginName;
private String password;
private Long[] roleIds;
}

View File

@ -0,0 +1,12 @@
package com.ruoyi.sip.dto;
import lombok.Data;
@Data
public class ApiUserInfo {
private Long userId;
private String loginName;
private String userName;
}

View File

@ -181,7 +181,7 @@ public class ProjectOrderInfoToolProvider extends AbstractMcpToolProvider {
item.put("customerName", orderInfo.getCustomerName());
item.put("bgName", DictUtils.getDictLabel("bg_type", orderInfo.getBgProperty()));
item.put("industryType", getIndustryTypeName(orderInfo));
item.put("constructionType", "");
item.put("constructionType", projectInfo == null ? "" : projectInfo.getConstructionType());
item.put("projectPartnerName", orderInfo.getProjectPartnerName());
item.put("businessContactName", orderInfo.getBusinessPerson());
item.put("businessContactPhone", orderInfo.getBusinessPhone());
@ -725,7 +725,7 @@ public class ProjectOrderInfoToolProvider extends AbstractMcpToolProvider {
metadata.put("customerName", "最终客户");
metadata.put("bgName", "BG");
metadata.put("industryType", "行业");
metadata.put("constructionType", "建设类型(预留)");
metadata.put("constructionType", "建设类型");
metadata.put("projectPartnerName", "运作方");
metadata.put("businessContactName", "进货商接口人");
metadata.put("businessContactPhone", "联系方式");

View File

@ -3,6 +3,7 @@ package com.ruoyi.sip.service;
import java.math.BigDecimal;
import java.util.List;
import com.ruoyi.sip.domain.ProjectInfo;
import com.ruoyi.sip.dto.ApiProjectAddDto;
import com.ruoyi.sip.dto.HomepageQueryDto;
import com.ruoyi.sip.dto.StatisticsDto;
@ -36,7 +37,7 @@ public interface IProjectInfoService
* @param projectInfo
* @return
*/
public int insertProjectInfo(ProjectInfo projectInfo);
public int insertProjectInfo(ProjectInfo projectInfo, boolean isApi);
/**
*
@ -44,7 +45,7 @@ public interface IProjectInfoService
* @param projectInfo
* @return
*/
public int updateProjectInfo(ProjectInfo projectInfo);
public int updateProjectInfo(ProjectInfo projectInfo, boolean isApi);
/**
*
@ -74,4 +75,7 @@ public interface IProjectInfoService
byte[] exportSingleJoinTrial(ProjectInfo projectInfo);
String exportJoinTrial(ProjectInfo projectInfo);
ProjectInfo insertProjectInfoForApi(ApiProjectAddDto dto);
}

View File

@ -84,7 +84,9 @@ public class PartnerInfoServiceImpl implements IPartnerInfoService
@Override
public int insertPartnerInfo(PartnerInfo partnerInfo)
{
if (StringUtils.isEmpty(partnerInfo.getCreateBy())) {
partnerInfo.setCreateBy(ShiroUtils.getUserId().toString());
}
// 生成编码时加锁,确保线程安全
lock.lock();
try {

View File

@ -22,6 +22,7 @@ import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.sip.domain.*;
import com.ruoyi.sip.dto.ApiProjectAddDto;
import com.ruoyi.sip.dto.HomepageQueryDto;
import com.ruoyi.sip.dto.StatisticsDetailDto;
import com.ruoyi.sip.dto.StatisticsDto;
@ -29,6 +30,8 @@ import com.ruoyi.sip.mapper.ProjectInfoMapper;
import com.ruoyi.sip.service.*;
import liquibase.hub.model.Project;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xwpf.usermodel.*;
@ -77,8 +80,8 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
private IProjectPocInfoService pocInfoService;
@Autowired
private ICustomerInfoService customerInfoService;
@Autowired
private IPartnerInfoService partnerInfoService;
@Autowired
private IOmsFileLogService omsFileLogService;
@Autowired
@ -123,7 +126,7 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
//查询操作日志信息
List<ProjectOperateLog> projectOperateLogs = operateLogService.selectProjectOperateLogListByProjectId(projectInfo.getId());
projectOperateLogs = projectOperateLogs.stream().filter(item -> {
if (ShiroUtils.getSysUser().isAdmin()) {
if (ObjectUtils.isNotEmpty(ShiroUtils.getSysUser()) && ShiroUtils.getSysUser().isAdmin()) {
return ProjectOperateLog.LogTypeEnum.DETAIL.getValue().equals(item.getLogType());
}
return ProjectOperateLog.LogTypeEnum.BRIEF.getValue().equals(item.getLogType());
@ -195,15 +198,20 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
*
*
* @param projectInfo
* @param isApi api
* @return
*/
@Override
public int insertProjectInfo(ProjectInfo projectInfo) {
public int insertProjectInfo(ProjectInfo projectInfo, boolean isApi) {
//生成项目编码
setProjectCode(projectInfo);
projectInfo.setCreateTime(DateUtils.getNowDate());
projectInfo.setUpdateTime(DateUtils.getNowDate());
if (isApi) {
projectInfo.setCreateBy(projectInfo.getCreateBy());
} else {
projectInfo.setCreateBy(ShiroUtils.getUserId().toString());
}
if (CollUtil.isNotEmpty(projectInfo.getCompetitorList())) {
projectInfo.setCompetitor(projectInfo.getCompetitorList().stream().filter(StringUtils::isNotEmpty).collect(Collectors.joining(",")));
}
@ -265,7 +273,7 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
* @return
*/
@Override
public int updateProjectInfo(ProjectInfo projectInfo) {
public int updateProjectInfo(ProjectInfo projectInfo, boolean isApi) {
// 获取更新前的项目信息
ProjectInfo oldProjectInfo = this.selectProjectInfoById(projectInfo.getId());
if (CollUtil.isNotEmpty(projectInfo.getCompetitorList())) {
@ -273,7 +281,7 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
}
//变更属地校验
List<ProjectOrderInfo> projectOrderInfos = orderInfoService.selectProjectOrderInfoByProjectId(Collections.singletonList(projectInfo.getId()));
if (!oldProjectInfo.getAgentCode().equals(projectInfo.getAgentCode())) {
if (!isApi && !oldProjectInfo.getAgentCode().equals(projectInfo.getAgentCode())) {
//查询订单信息 如果有抛出异常
if (CollUtil.isNotEmpty(projectOrderInfos)) {
throw new ServiceException("该项目存在订单流转,无法更改代表处");
@ -283,7 +291,9 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
}
// 更新项目信息
projectInfo.setUpdateTime(DateUtils.getNowDate());
if (!isApi) {
projectInfo.setUpdateBy(ShiroUtils.getUserId().toString());
}
int result = projectInfoMapper.updateProjectInfo(projectInfo);
//变更其它信息
saveOtherInfo(projectInfo);
@ -324,6 +334,7 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
logIndex = compareField(logContent, logIndex, "代表处", oldProjectInfo.getAgentName(), projectInfo.getAgentName());
logIndex = compareField(logContent, logIndex, "项目阶段", DictUtils.getDictLabel(PROJECT_STAGE_DICT_TYPE, oldProjectInfo.getProjectStage())
, DictUtils.getDictLabel(PROJECT_STAGE_DICT_TYPE, projectInfo.getProjectStage()));
logIndex = compareField(logContent, logIndex, "建设类型", oldProjectInfo.getConstructionType(), projectInfo.getConstructionType());
logIndex = compareField(logContent, logIndex, "项目把握度", oldProjectInfo.getProjectGraspDegree(), projectInfo.getProjectGraspDegree());
if (oldProjectInfo.getHzSupportUser() != null || projectInfo.getHzSupportUser() != null) {
List<SysUser> sysUsers = projectInfoMapper.selectUserById(Stream.of(oldProjectInfo.getHzSupportUser(), projectInfo.getHzSupportUser()).filter(Objects::nonNull).collect(Collectors.toList()));
@ -390,7 +401,7 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
operateLog.setProjectId(projectInfo.getId());
operateLog.setOperateLog(logContent.toString());
operateLog.setOperateTime(DateUtils.getNowDate());
operateLog.setOperateUser(ShiroUtils.getUserId().toString());
operateLog.setOperateUser(StringUtils.isNotEmpty(projectInfo.getUpdateBy()) ? projectInfo.getUpdateBy() : ShiroUtils.getUserId().toString());
operateLog.setLogType(ProjectOperateLog.LogTypeEnum.DETAIL.getValue());
operateLogService.insertProjectOperateLog(operateLog);
//记录type
@ -400,7 +411,7 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
operateLog.setProjectId(projectInfo.getId());
operateLog.setOperateLog(logSimpleContent.toString());
operateLog.setOperateTime(DateUtils.getNowDate());
operateLog.setOperateUser(ShiroUtils.getUserId().toString());
operateLog.setOperateUser(StringUtils.isNotEmpty(projectInfo.getUpdateBy()) ? projectInfo.getUpdateBy() : ShiroUtils.getUserId().toString());
operateLog.setLogType(ProjectOperateLog.LogTypeEnum.BRIEF.getValue());
operateLogService.insertProjectOperateLog(operateLog);
}
@ -933,6 +944,7 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
headerList.add(Collections.singletonList("行业"));
headerList.add(Collections.singletonList("代表处"));
headerList.add(Collections.singletonList("项目阶段"));
headerList.add(Collections.singletonList("建设类型"));
headerList.add(Collections.singletonList("项目把握度"));
headerList.add(Collections.singletonList("汇智负责人"));
headerList.add(Collections.singletonList("最终客户"));
@ -1003,6 +1015,7 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
row.add(info.getIndustryType());
row.add(info.getAgentName());
row.add(DictUtils.getDictLabel("project_stage", info.getProjectStage()));
row.add(info.getConstructionType());
row.add(info.getProjectGraspDegree());
row.add(info.getHzSupportUserName());
row.add(info.getCustomerName());
@ -1100,4 +1113,82 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
}
return totalPrice;
}
@Override
public ProjectInfo insertProjectInfoForApi(ApiProjectAddDto dto) {
ProjectInfo projectInfo = new ProjectInfo();
projectInfo.setProjectCode(dto.getProjectCode());
projectInfo.setProjectName(dto.getProjectName());
projectInfo.setCustomerName(dto.getCustomerName());
projectInfo.setOperateInstitution(dto.getOperateInstitution());
projectInfo.setH3cPerson(dto.getH3cPerson());
projectInfo.setH3cPhone(dto.getH3cPhone());
projectInfo.setEstimatedAmount(dto.getEstimatedAmount());
projectInfo.setEstimatedOrderTime(dto.getEstimatedOrderTime());
projectInfo.setProjectGraspDegree(dto.getProjectGraspDegree());
projectInfo.setProjectStage(dto.getProjectStage());
projectInfo.setConstructionType(dto.getConstructionType());
projectInfo.setCompetitorList(dto.getCompetitorList());
projectInfo.setHzSupportUser(dto.getHzSupportUser());
projectInfo.setCreateBy(dto.getCreateBy());
projectInfo.setConstructionType(dto.getConstructionType());
projectInfo.setUpdateBy(dto.getCreateBy());
//处理代理商信息,不存在的代理商做新增操作
if ("h3c".equals(dto.getOperateInstitution())) {
projectInfo.setPartnerCode("");
projectInfo.setPartnerName("新华三");
projectInfo.setPartnerUserName("");
projectInfo.setContactWay("");
} else {
PartnerInfo queryPartnerInfo = new PartnerInfo();
queryPartnerInfo.setPartnerName(dto.getPartner().getPartnerName());
List<PartnerInfo> partnerInfoList = partnerInfoService.selectPartnerInfoList(queryPartnerInfo);
PartnerInfo partnerInfo = new PartnerInfo();
if (CollectionUtils.isEmpty(partnerInfoList)) {
partnerInfo.setPartnerName(dto.getPartner().getPartnerName());
partnerInfo.setProvince(dto.getPartner().getProvince());
partnerInfo.setCity(dto.getPartner().getCity());
partnerInfo.setAddress(dto.getPartner().getAddress());
partnerInfo.setContactPerson(dto.getPartner().getContactPerson());
partnerInfo.setContactPhone(dto.getPartner().getContactPhone());
partnerInfo.setLevel(dto.getPartner().getLevel());
partnerInfo.setCreateBy(dto.getCreateBy());
int rows = partnerInfoService.insertPartnerInfo(partnerInfo);
if (rows == 0) {
return null;
}
partnerInfoList = partnerInfoService.selectPartnerInfoList(queryPartnerInfo);
partnerInfo = partnerInfoList.get(0);
} else {
partnerInfo = partnerInfoList.get(0);
}
projectInfo.setPartnerCode(partnerInfo.getPartnerCode());
projectInfo.setPartnerName(partnerInfo.getPartnerName());
projectInfo.setPartnerUserName(partnerInfo.getContactPerson());
projectInfo.setContactWay(partnerInfo.getContactPhone());
}
//处理项目信息
ProjectInfo oldProjectInfo = null;
if (StringUtils.isNotEmpty(projectInfo.getProjectCode())) {
ProjectInfo queryProjectInfo = new ProjectInfo();
queryProjectInfo.setProjectCode(projectInfo.getProjectCode());
List<ProjectInfo> projectInfoList = projectInfoMapper.selectProjectInfoList(queryProjectInfo);
if (CollectionUtils.isNotEmpty(projectInfoList)) {
oldProjectInfo = projectInfoList.get(0);
}
}
int rows = 0;
//不存在的项目走新增流程,已存在的项目走修改流程
if (null == oldProjectInfo) {
rows = this.insertProjectInfo(projectInfo, true);
} else {
projectInfo.setId(oldProjectInfo.getId());
rows = this.updateProjectInfo(projectInfo, true);
}
if (rows > 0) {
return projectInfo;
}
return null;
}
}

View File

@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="industryType" column="industry_type" />
<result property="projectStage" column="project_stage" />
<result property="constructionType" column="construction_type" />
<result property="projectGraspDegree" column="project_grasp_degree" />
<result property="hzSupportUser" column="hz_support_user" />
<result property="operateInstitution" column="operate_institution" />
@ -43,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectProjectInfoVo">
select id, project_code, project_name,bg_property, customer_code, customer_name, industry_type, agent_code, project_stage, project_grasp_degree, hz_support_user, operate_institution
select id, project_code, project_name,bg_property, customer_code, customer_name, industry_type, agent_code, project_stage, construction_type, project_grasp_degree, hz_support_user, operate_institution
, partner_code, partner_name, contact_way, estimated_amount, currency_type, estimated_order_time, estimated_deliver_time, competitor, country_product, server_configuration,file_id
, key_problem, project_desc, create_by, create_time, update_by, update_time,customer_user_name,customer_phone,partner_email,partner_user_name,h3c_person,h3c_phone,poc,joint_trial,software_info,hardware_info,terminal_peripheral,management_version,desktop_vm_os_version,vm_spec_quantity,joint_trial_result,quotation_id from project_info t1
</sql>
@ -57,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t1.industry_type,
t1.agent_code,
t1.project_stage,
t1.construction_type,
t1.project_grasp_degree,
t1.hz_support_user,
t1.operate_institution,
@ -141,6 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
<if test="projectStage != null and projectStage != ''"> and find_in_set(t1.project_stage , #{projectStage})</if>
<if test="constructionType != null and constructionType != ''"> and t1.construction_type = #{constructionType}</if>
<if test="projectGraspDegree != null and projectGraspDegree != ''"> and t1.project_grasp_degree = #{projectGraspDegree}</if>
<if test="hzSupportUser != null and hzSupportUser != ''"> and t1.hz_support_user = #{hzSupportUser}</if>
<if test="hzSupportUserName != null and hzSupportUserName != ''"> and t3.user_name like concat('%', #{hzSupportUserName}, '%')</if>
@ -261,6 +264,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t1.industry_type,
t1.agent_code,
t1.project_stage,
t1.construction_type,
t1.project_grasp_degree,
t1.hz_support_user,
t1.operate_institution,
@ -333,6 +337,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="bgProperty != null">bg_property,</if>
<if test="agentCode != null">agent_code,</if>
<if test="projectStage != null">project_stage,</if>
<if test="constructionType != null">construction_type,</if>
<if test="projectGraspDegree != null">project_grasp_degree,</if>
<if test="hzSupportUser != null">hz_support_user,</if>
<if test="operateInstitution != null">operate_institution,</if>
@ -378,6 +383,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="bgProperty != null">#{bgProperty},</if>
<if test="agentCode != null">#{agentCode},</if>
<if test="projectStage != null">#{projectStage},</if>
<if test="constructionType != null">#{constructionType},</if>
<if test="projectGraspDegree != null">#{projectGraspDegree},</if>
<if test="hzSupportUser != null">#{hzSupportUser},</if>
<if test="operateInstitution != null">#{operateInstitution},</if>
@ -429,6 +435,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="industryType != null">industry_type = #{industryType},</if>
<if test="agentCode != null">agent_code = #{agentCode},</if>
<if test="projectStage != null">project_stage = #{projectStage},</if>
<if test="constructionType != null">construction_type = #{constructionType},</if>
<if test="projectGraspDegree != null">project_grasp_degree = #{projectGraspDegree},</if>
<if test="hzSupportUser != null">hz_support_user = #{hzSupportUser},</if>
<if test="operateInstitution != null">operate_institution = #{operateInstitution},</if>

View File

@ -213,4 +213,6 @@ public interface ISysUserService
public int changeStatus(SysUser user);
List<SysUser> listByRoleId(String l);
List<SysUser> listByRoleName(String roleName);
}

View File

@ -571,4 +571,9 @@ public class SysUserServiceImpl implements ISysUserService
public List<SysUser> listByRoleId(String roleId) {
return userMapper.listUserByRoleId(roleId);
}
@Override
public List<SysUser> listByRoleName(String roleName) {
return userMapper.listUserByRoleName(roleName);
}
}