feat(project): 添加项目收藏和会审功能
- 在项目信息页面添加是否收藏和是否会审的筛选条件 - 在项目表格中添加收藏和会审状态显示列 - 实现项目收藏状态的修改功能 - 实现项目会审状态的修改功能 - 添加权限控制,无权限用户无法修改会审状态 - 生成订单时增加会审状态判断,只有会审通过的项目才能生成订单 - 添加项目用户收藏信息的数据表和相关服务 - 在项目列表查询时关联用户收藏状态 - 修复代理处变更校验的逻辑错误 - 更新项目导出功能,添加收藏和会审字段的导出dev_1.0.1
parent
4ce68abe84
commit
b1cbbec237
|
|
@ -52,3 +52,22 @@ export function exportProject(query) {
|
|||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 项目收藏
|
||||
export function addCollect(data) {
|
||||
return request({
|
||||
url: '/project/collect/add',
|
||||
method: 'post',
|
||||
data: data,
|
||||
needLoading:true
|
||||
})
|
||||
}
|
||||
export function editJoinTrial(data) {
|
||||
return request({
|
||||
url: '/sip/project/vue/joinTrial',
|
||||
method: 'put',
|
||||
data: data,
|
||||
needLoading:true
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -84,6 +84,18 @@
|
|||
<el-option label="否" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否收藏" prop="collect">
|
||||
<el-select v-model="queryParams.collect" placeholder="请选择" clearable>
|
||||
<el-option label="是" value="1" />
|
||||
<el-option label="否" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否会审" prop="jointTrial">
|
||||
<el-select v-model="queryParams.jointTrial" placeholder="请选择" clearable>
|
||||
<el-option label="是" value="1" />
|
||||
<el-option label="否" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="时间选择" prop="timeType">
|
||||
<el-select v-model="queryParams.timeType" placeholder="请选择时间类型" @change="handleTimeTypeChange">
|
||||
<el-option label="预计下单时间" value="0" />
|
||||
|
|
@ -190,6 +202,17 @@
|
|||
<span>{{ parseTime(scope.row.lastWorkUpdateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收藏" align="center" prop="collect" width="60">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox v-model="scope.row.collect" true-label="1" false-label="0" @change="handleCollectChange(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="会审" align="center" prop="jointTrial" width="60">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox v-if="!canUpdateJoinTrial" :value="scope.row.jointTrial === '1'" @change="()=>{ $modal.msgError('无权限修改');return false;}" />
|
||||
<el-checkbox v-else v-model="scope.row.jointTrial" true-label="1" false-label="0" @change="handleJoinTrialChange(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
|
@ -204,7 +227,7 @@
|
|||
type="text"
|
||||
icon="el-icon-refresh"
|
||||
@click="openOrder(scope.row.id, scope.row.canGenerate)"
|
||||
:disabled="!scope.row.canGenerate"
|
||||
:disabled="!scope.row.canGenerate || scope.row.jointTrial !== '1'"
|
||||
v-hasPermi="['sip:project:add']"
|
||||
>生成订单</el-button>
|
||||
<el-button
|
||||
|
|
@ -242,10 +265,11 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listProject, delProject, exportProject } from "@/api/project/info";
|
||||
import {listProject, delProject, exportProject, addCollect, updateProject, editJoinTrial} from "@/api/project/info";
|
||||
import ProjectDetailDrawer from "./ProjectDetailDrawer.vue";
|
||||
import ProjectForm from "./ProjectForm.vue";
|
||||
import OrderDetail from "../order/OrderDetail.vue";
|
||||
import store from "@/store";
|
||||
|
||||
export default {
|
||||
name: "Project",
|
||||
|
|
@ -259,6 +283,7 @@ export default {
|
|||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
canUpdateJoinTrial: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
|
|
@ -293,6 +318,8 @@ export default {
|
|||
bgProperty: null,
|
||||
industryType: null,
|
||||
agentName: null,
|
||||
jointTrial: null,
|
||||
collect: null,
|
||||
projectGraspDegree: null,
|
||||
projectStage: [],
|
||||
hzSupportUserName: null,
|
||||
|
|
@ -308,6 +335,14 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.getList();
|
||||
const permissions = store.getters && store.getters.permissions
|
||||
console.log(permissions)
|
||||
const all_permission = "*:*:*"
|
||||
debugger
|
||||
this.canUpdateJoinTrial = permissions.some(permission => {
|
||||
return all_permission === permission || "sip:project:jointTrial"===permission
|
||||
})
|
||||
console.log(this.canUpdateJoinTrial)
|
||||
},
|
||||
watch: {
|
||||
dateRange(val) {
|
||||
|
|
@ -461,6 +496,47 @@ export default {
|
|||
this.openOrderDialog = false;
|
||||
this.getList();
|
||||
},
|
||||
/** 项目收藏状态修改 */
|
||||
handleCollectChange(row) {
|
||||
let params={
|
||||
"projectId":row.id,
|
||||
"collect":row.collect
|
||||
}
|
||||
addCollect(params).then(response => {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
})
|
||||
},
|
||||
/** 项目会审状态修改 */
|
||||
handleJoinTrialChange(row) {
|
||||
if (row.jointTrial === '0'){
|
||||
this.$modal.confirm('是否确认取消会审?').then(function() {
|
||||
let params={
|
||||
"id":row.id,
|
||||
"partnerCode":row.partnerCode,
|
||||
"jointTrial":row.jointTrial
|
||||
}
|
||||
editJoinTrial(params).then(response => {
|
||||
this.$modal.msgSuccess("取消成功");
|
||||
|
||||
})
|
||||
}).catch((err)=>{
|
||||
row.jointTrial = row.jointTrial === '1' ? '0' : '1';
|
||||
})
|
||||
}else{
|
||||
let params={
|
||||
"id":row.id,
|
||||
"partnerCode":row.partnerCode,
|
||||
"jointTrial":row.jointTrial
|
||||
}
|
||||
editJoinTrial(params).then(response => {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
|
||||
}).catch(() => {
|
||||
row.jointTrial = row.jointTrial === '1' ? '0' : '1';
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,102 @@
|
|||
package com.ruoyi.sip.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.sip.domain.ProjectUserCollectInfo;
|
||||
import com.ruoyi.sip.service.IProjectUserCollectInfoService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 产品库存Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-01-06
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/project/collect")
|
||||
public class ProjectUserCollectInfoController extends BaseController
|
||||
{
|
||||
|
||||
|
||||
@Autowired
|
||||
private IProjectUserCollectInfoService projectUserCollectInfoService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询产品库存列表
|
||||
*/
|
||||
@RequiresPermissions("sip:projectCollect:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(ProjectUserCollectInfo projectUserCollectInfo)
|
||||
{
|
||||
startPage();
|
||||
List<ProjectUserCollectInfo> list = projectUserCollectInfoService.selectProjectUserCollectInfoList(projectUserCollectInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出产品库存列表
|
||||
*/
|
||||
@RequiresPermissions("sip:projectCollect:export")
|
||||
@Log(title = "产品库存", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(ProjectUserCollectInfo projectUserCollectInfo)
|
||||
{
|
||||
List<ProjectUserCollectInfo> list = projectUserCollectInfoService.selectProjectUserCollectInfoList(projectUserCollectInfo);
|
||||
ExcelUtil<ProjectUserCollectInfo> util = new ExcelUtil<ProjectUserCollectInfo>(ProjectUserCollectInfo.class);
|
||||
return util.exportExcel(list, "产品库存数据");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增保存产品库存
|
||||
*/
|
||||
|
||||
@Log(title = "产品库存", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave( @RequestBody ProjectUserCollectInfo projectUserCollectInfo)
|
||||
{
|
||||
projectUserCollectInfo.setUserId(getUserId());
|
||||
return toAjax(projectUserCollectInfoService.insertProjectUserCollectInfo(projectUserCollectInfo));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 修改保存产品库存
|
||||
*/
|
||||
@RequiresPermissions("sip:projectCollect:edit")
|
||||
@Log(title = "产品库存", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(ProjectUserCollectInfo projectUserCollectInfo)
|
||||
{
|
||||
return toAjax(projectUserCollectInfoService.updateProjectUserCollectInfo(projectUserCollectInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品库存
|
||||
*/
|
||||
@RequiresPermissions("sip:projectCollect:remove")
|
||||
@Log(title = "产品库存", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(projectUserCollectInfoService.deleteProjectUserCollectInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -42,6 +42,7 @@ public class VueProjectInfoController extends BaseController {
|
|||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProjectInfo projectInfo) {
|
||||
startPage();
|
||||
projectInfo.setCurrentUserId(getUserId());
|
||||
List<ProjectInfo> list = projectInfoService.selectProjectInfoList(projectInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
|
@ -91,6 +92,12 @@ public class VueProjectInfoController extends BaseController {
|
|||
public AjaxResult edit(@RequestBody ProjectInfo projectInfo) {
|
||||
return toAjax(projectInfoService.updateProjectInfo(projectInfo));
|
||||
}
|
||||
@RequiresPermissions("sip:project:edit")
|
||||
@Log(title = "项目管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/joinTrial")
|
||||
public AjaxResult editJoinTrial(@RequestBody ProjectInfo projectInfo) {
|
||||
return toAjax(projectInfoService.editJoinTrial(projectInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目管理
|
||||
|
|
|
|||
|
|
@ -140,6 +140,12 @@ public class ProjectInfo extends BaseEntity
|
|||
@Excel(name = "服务器配置")
|
||||
private String serverConfiguration;
|
||||
|
||||
/** 会审 0 否 1是*/
|
||||
@Excel(name = "会审")
|
||||
private String jointTrial;
|
||||
/** 个人收藏 0 否 1是*/
|
||||
private String collect;
|
||||
private Long currentUserId;
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
package com.ruoyi.sip.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 产品库存对象 project_user_collect_info
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-01-06
|
||||
*/
|
||||
@Data
|
||||
public class ProjectUserCollectInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** */
|
||||
private Long id;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Long projectId;
|
||||
private List<Long> projectIdList;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Long userId;
|
||||
|
||||
/** 是否收藏 0:未 1:已收藏 */
|
||||
@Excel(name = "是否收藏 0:未 1:已收藏")
|
||||
private String collect;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.sip.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.sip.domain.ProjectUserCollectInfo;
|
||||
|
||||
/**
|
||||
* 产品库存Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-01-06
|
||||
*/
|
||||
public interface ProjectUserCollectInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询产品库存
|
||||
*
|
||||
* @param id 产品库存主键
|
||||
* @return 产品库存
|
||||
*/
|
||||
public ProjectUserCollectInfo selectProjectUserCollectInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询产品库存列表
|
||||
*
|
||||
* @param projectUserCollectInfo 产品库存
|
||||
* @return 产品库存集合
|
||||
*/
|
||||
public List<ProjectUserCollectInfo> selectProjectUserCollectInfoList(ProjectUserCollectInfo projectUserCollectInfo);
|
||||
|
||||
/**
|
||||
* 新增产品库存
|
||||
*
|
||||
* @param projectUserCollectInfo 产品库存
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProjectUserCollectInfo(ProjectUserCollectInfo projectUserCollectInfo);
|
||||
|
||||
/**
|
||||
* 修改产品库存
|
||||
*
|
||||
* @param projectUserCollectInfo 产品库存
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProjectUserCollectInfo(ProjectUserCollectInfo projectUserCollectInfo);
|
||||
|
||||
/**
|
||||
* 删除产品库存
|
||||
*
|
||||
* @param id 产品库存主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProjectUserCollectInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除产品库存
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProjectUserCollectInfoByIds(String[] ids);
|
||||
}
|
||||
|
|
@ -68,4 +68,6 @@ public interface IProjectInfoService
|
|||
|
||||
|
||||
ProjectInfo selectProjectInfoByOrderCode(String orderCode);
|
||||
|
||||
int editJoinTrial(ProjectInfo projectInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.sip.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.sip.domain.ProjectUserCollectInfo;
|
||||
|
||||
/**
|
||||
* 产品库存Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-01-06
|
||||
*/
|
||||
public interface IProjectUserCollectInfoService
|
||||
{
|
||||
/**
|
||||
* 查询产品库存
|
||||
*
|
||||
* @param id 产品库存主键
|
||||
* @return 产品库存
|
||||
*/
|
||||
public ProjectUserCollectInfo selectProjectUserCollectInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询产品库存列表
|
||||
*
|
||||
* @param projectUserCollectInfo 产品库存
|
||||
* @return 产品库存集合
|
||||
*/
|
||||
public List<ProjectUserCollectInfo> selectProjectUserCollectInfoList(ProjectUserCollectInfo projectUserCollectInfo);
|
||||
|
||||
/**
|
||||
* 新增产品库存
|
||||
*
|
||||
* @param projectUserCollectInfo 产品库存
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProjectUserCollectInfo(ProjectUserCollectInfo projectUserCollectInfo);
|
||||
|
||||
/**
|
||||
* 修改产品库存
|
||||
*
|
||||
* @param projectUserCollectInfo 产品库存
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProjectUserCollectInfo(ProjectUserCollectInfo projectUserCollectInfo);
|
||||
|
||||
/**
|
||||
* 批量删除产品库存
|
||||
*
|
||||
* @param ids 需要删除的产品库存主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProjectUserCollectInfoByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除产品库存信息
|
||||
*
|
||||
* @param id 产品库存主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProjectUserCollectInfoById(Long id);
|
||||
}
|
||||
|
|
@ -67,6 +67,8 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
|
|||
@Autowired
|
||||
private ICustomerInfoService customerInfoService;
|
||||
|
||||
@Autowired
|
||||
private IProjectUserCollectInfoService projectUserCollectInfoService;
|
||||
@Autowired
|
||||
private IProjectOrderInfoService orderInfoService;
|
||||
private static final String PROJECT_CODE_PREFIX = "V";
|
||||
|
|
@ -143,13 +145,20 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
|
|||
List<Long> idList = projectInfos.stream().map(ProjectInfo::getId).collect(Collectors.toList());
|
||||
List<ProjectOrderInfo> projectOrderInfos = orderInfoService.selectProjectOrderInfoByProjectId(idList);
|
||||
Map<Long, ProjectOrderInfo> orderInfoMap = projectOrderInfos.stream().collect(Collectors.toMap(ProjectOrderInfo::getProjectId, Function.identity(), (v1, v2) -> v1));
|
||||
ProjectUserCollectInfo queryInfo = new ProjectUserCollectInfo();
|
||||
queryInfo.setUserId(ShiroUtils.getUserId());
|
||||
queryInfo.setProjectIdList(idList);
|
||||
List<ProjectUserCollectInfo> projectUserCollectInfos = projectUserCollectInfoService.selectProjectUserCollectInfoList(queryInfo);
|
||||
Map<Long, String> projectCollectMap = projectUserCollectInfos.stream().collect(
|
||||
Collectors.toMap(ProjectUserCollectInfo::getProjectId, ProjectUserCollectInfo::getCollect, (v1, v2) -> v1));
|
||||
|
||||
LocalDate now = LocalDate.now();
|
||||
for (ProjectInfo info : projectInfos) {
|
||||
CustomerInfo customerInfo = customerInfoMap.get(info.getCustomerCode());
|
||||
if (customerInfo != null) {
|
||||
info.setCustomerAddress(customerInfo.getAddress());
|
||||
}
|
||||
info.setCanGenerate(orderInfoMap.get(info.getId()) == null);
|
||||
info.setCanGenerate(orderInfoMap.get(info.getId()) == null && "1".equals(info.getJointTrial()));
|
||||
if (info.getLastWorkUpdateTime() != null) {
|
||||
LocalDate localDate = info.getLastWorkUpdateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
Period between = Period.between(localDate, now);
|
||||
|
|
@ -157,8 +166,7 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
|
|||
} else {
|
||||
info.setHighlight(false);
|
||||
}
|
||||
|
||||
|
||||
info.setCollect(projectCollectMap.getOrDefault(info.getId(),"0"));
|
||||
}
|
||||
return projectInfos;
|
||||
}
|
||||
|
|
@ -244,7 +252,7 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
|
|||
}
|
||||
//变更属地校验
|
||||
List<ProjectOrderInfo> projectOrderInfos = orderInfoService.selectProjectOrderInfoByProjectId(Collections.singletonList(projectInfo.getId()));
|
||||
if (!projectInfo.getAgentCode().equals(oldProjectInfo.getAgentCode())) {
|
||||
if (!oldProjectInfo.getAgentCode().equals(projectInfo.getAgentCode())) {
|
||||
//查询订单信息 如果有抛出异常
|
||||
if (CollUtil.isNotEmpty(projectOrderInfos)) {
|
||||
throw new ServiceException("该项目存在订单流转,无法更改代表处");
|
||||
|
|
@ -594,11 +602,26 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
|
|||
return projectInfoMapper.selectProjectInfoByOrderCode(orderCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int editJoinTrial(ProjectInfo projectInfo) {
|
||||
return projectInfoMapper.updateProjectInfo(projectInfo);
|
||||
}
|
||||
|
||||
private List<ProjectInfo> fetchProjectInfos(ProjectInfo projectInfo) {
|
||||
projectInfo.setCurrentUserId(ShiroUtils.getUserId());
|
||||
List<ProjectInfo> projectInfos = projectInfoMapper.selectProjectInfoList(projectInfo);
|
||||
if (CollUtil.isEmpty(projectInfos)) {
|
||||
throw new ServiceException("未找到符合条件的项目信息");
|
||||
}
|
||||
ProjectUserCollectInfo queryInfo = new ProjectUserCollectInfo();
|
||||
queryInfo.setUserId(ShiroUtils.getUserId());
|
||||
queryInfo.setProjectIdList(projectInfos.stream().map(ProjectInfo::getId).collect(Collectors.toList()));
|
||||
List<ProjectUserCollectInfo> projectUserCollectInfos = projectUserCollectInfoService.selectProjectUserCollectInfoList(queryInfo);
|
||||
Map<Long, String> projectCollectMap = projectUserCollectInfos.stream().collect(
|
||||
Collectors.toMap(ProjectUserCollectInfo::getProjectId, ProjectUserCollectInfo::getCollect, (v1, v2) -> v1));
|
||||
projectInfos.forEach(item -> {
|
||||
item.setCollect(projectCollectMap.getOrDefault(item.getId(),"0"));
|
||||
});
|
||||
return projectInfos;
|
||||
}
|
||||
|
||||
|
|
@ -728,6 +751,8 @@ 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("会审"));
|
||||
|
||||
|
||||
// 添加软件产品列
|
||||
|
|
@ -796,6 +821,8 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
|
|||
row.add(info.getProjectDesc());
|
||||
row.add(info.getServerConfiguration());
|
||||
row.add(DateUtil.format(info.getUpdateTime(), "yyyy-MM-dd"));
|
||||
row.add("1".equals(info.getCollect())?"是":"否");
|
||||
row.add("1".equals(info.getJointTrial())?"是":"否");
|
||||
BigDecimal totalPrice = BigDecimal.ZERO;
|
||||
|
||||
// 添加软件产品列
|
||||
|
|
|
|||
|
|
@ -0,0 +1,94 @@
|
|||
package com.ruoyi.sip.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.sip.mapper.ProjectUserCollectInfoMapper;
|
||||
import com.ruoyi.sip.domain.ProjectUserCollectInfo;
|
||||
import com.ruoyi.sip.service.IProjectUserCollectInfoService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 产品库存Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-01-06
|
||||
*/
|
||||
@Service
|
||||
public class ProjectUserCollectInfoServiceImpl implements IProjectUserCollectInfoService
|
||||
{
|
||||
@Autowired
|
||||
private ProjectUserCollectInfoMapper projectUserCollectInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询产品库存
|
||||
*
|
||||
* @param id 产品库存主键
|
||||
* @return 产品库存
|
||||
*/
|
||||
@Override
|
||||
public ProjectUserCollectInfo selectProjectUserCollectInfoById(Long id)
|
||||
{
|
||||
return projectUserCollectInfoMapper.selectProjectUserCollectInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询产品库存列表
|
||||
*
|
||||
* @param projectUserCollectInfo 产品库存
|
||||
* @return 产品库存
|
||||
*/
|
||||
@Override
|
||||
public List<ProjectUserCollectInfo> selectProjectUserCollectInfoList(ProjectUserCollectInfo projectUserCollectInfo)
|
||||
{
|
||||
return projectUserCollectInfoMapper.selectProjectUserCollectInfoList(projectUserCollectInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品库存
|
||||
*
|
||||
* @param projectUserCollectInfo 产品库存
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertProjectUserCollectInfo(ProjectUserCollectInfo projectUserCollectInfo)
|
||||
{
|
||||
return projectUserCollectInfoMapper.insertProjectUserCollectInfo(projectUserCollectInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品库存
|
||||
*
|
||||
* @param projectUserCollectInfo 产品库存
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateProjectUserCollectInfo(ProjectUserCollectInfo projectUserCollectInfo)
|
||||
{
|
||||
return projectUserCollectInfoMapper.updateProjectUserCollectInfo(projectUserCollectInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除产品库存
|
||||
*
|
||||
* @param ids 需要删除的产品库存主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProjectUserCollectInfoByIds(String ids)
|
||||
{
|
||||
return projectUserCollectInfoMapper.deleteProjectUserCollectInfoByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品库存信息
|
||||
*
|
||||
* @param id 产品库存主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProjectUserCollectInfoById(Long id)
|
||||
{
|
||||
return projectUserCollectInfoMapper.deleteProjectUserCollectInfoById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -32,12 +32,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="bgProperty" column="bg_property" />
|
||||
<result property="jointTrial" column="joint_trial" />
|
||||
</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
|
||||
, partner_code, partner_name, contact_way, estimated_amount, currency_type, estimated_order_time, estimated_deliver_time, competitor, country_product, server_configuration
|
||||
, 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 from project_info t1
|
||||
, 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 from project_info t1
|
||||
</sql>
|
||||
<sql id="selectRelationProjectInfoVo">
|
||||
select t1.id,
|
||||
|
|
@ -68,6 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
t1.create_time,
|
||||
t1.update_by,
|
||||
t1.update_time,
|
||||
t1.joint_trial,
|
||||
t1.customer_user_name,t1.customer_phone,t1.partner_user_name,t1.h3c_person,t1.poc,t1.h3c_phone,
|
||||
t2.agent_name,t2.contact_email,t2.contact_phone,t2.contact_person,
|
||||
t3.user_name as hz_support_user_name,
|
||||
|
|
@ -96,6 +98,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="customerName != null and customerName != ''"> and t1.customer_name like concat('%', #{customerName}, '%')</if>
|
||||
<if test="industryType != null and industryType != ''"> and t1.industry_type = #{industryType}</if>
|
||||
<if test="bgProperty != null and bgProperty != ''"> and t1.bg_property = #{bgProperty}</if>
|
||||
<if test="jointTrial != null and jointTrial != ''"> and t1.joint_trial = #{jointTrial}</if>
|
||||
<if test="collect != null and collect != ''">
|
||||
<choose>
|
||||
<when test="'1'.toString()==collect">
|
||||
and t1.id in (select project_id from project_user_collect_info where user_id=#{currentUserId} and collect = '1')
|
||||
</when>
|
||||
<otherwise>
|
||||
and t1.id not in (select project_id from project_user_collect_info where user_id=#{currentUserId} and collect = '1')
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
|
||||
<if test="projectStage != null and projectStage != ''"> and find_in_set(t1.project_stage , #{projectStage})</if>
|
||||
<if test="projectGraspDegree != null and projectGraspDegree != ''"> and t1.project_grasp_degree = #{projectGraspDegree}</if>
|
||||
|
|
@ -244,6 +257,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="jointTrial != null and jointTrial != ''"> joint_trial ,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="projectCode != null">#{projectCode},</if>
|
||||
|
|
@ -280,6 +294,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="jointTrial != null and jointTrial != ''"> #{jointTrial},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateCustomerCodeByCode">
|
||||
|
|
@ -322,6 +337,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="jointTrial != null and jointTrial != ''"> joint_trial = #{jointTrial},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.sip.mapper.ProjectUserCollectInfoMapper">
|
||||
|
||||
<resultMap type="ProjectUserCollectInfo" id="ProjectUserCollectInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="collect" column="collect" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProjectUserCollectInfoVo">
|
||||
select id, project_id, user_id, collect from project_user_collect_info
|
||||
</sql>
|
||||
|
||||
<select id="selectProjectUserCollectInfoList" parameterType="ProjectUserCollectInfo" resultMap="ProjectUserCollectInfoResult">
|
||||
<include refid="selectProjectUserCollectInfoVo"/>
|
||||
<where>
|
||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="collect != null and collect != ''"> and collect = #{collect}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProjectUserCollectInfoById" parameterType="Long" resultMap="ProjectUserCollectInfoResult">
|
||||
<include refid="selectProjectUserCollectInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertProjectUserCollectInfo" parameterType="ProjectUserCollectInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into project_user_collect_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="collect != null">collect,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="collect != null">#{collect},</if>
|
||||
</trim>
|
||||
on duplicate key update collect=values(collect)
|
||||
|
||||
</insert>
|
||||
|
||||
<update id="updateProjectUserCollectInfo" parameterType="ProjectUserCollectInfo">
|
||||
update project_user_collect_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="collect != null">collect = #{collect},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProjectUserCollectInfoById" parameterType="Long">
|
||||
delete from project_user_collect_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProjectUserCollectInfoByIds" parameterType="String">
|
||||
delete from project_user_collect_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue