1
This commit is contained in:
parent
3b000bfdd8
commit
33e4379a66
@ -14,13 +14,18 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.cus.domain.CusMainSeas;
|
||||
import com.ruoyi.cus.domain.CusTimeAxis;
|
||||
import com.ruoyi.cus.service.ICusImportService;
|
||||
import com.ruoyi.cus.service.ICusMainSeasService;
|
||||
import com.ruoyi.cus.service.ICusTimeAxisService;
|
||||
import com.ruoyi.cus.vo.CusMainVO;
|
||||
import com.ruoyi.cus.vo.MainVO;
|
||||
import com.ruoyi.utils.CodeGenerator;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -59,6 +64,8 @@ public class CusMainController extends BaseController {
|
||||
private ICusImportService cusImportService;
|
||||
@Autowired
|
||||
private ICusTimeAxisService cusTimeAxisService;
|
||||
@Autowired
|
||||
private ICusMainSeasService cusMainSeasService;
|
||||
|
||||
/**
|
||||
* 生成客户编码
|
||||
@ -233,4 +240,27 @@ public class CusMainController extends BaseController {
|
||||
return success(cusMainService.getOtherInfo(cusId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 转入公海
|
||||
*/
|
||||
@PostMapping("/moveToSeas")
|
||||
public AjaxResult moveToSeas(@RequestBody CusMain cusMain){
|
||||
SysUser sysUser = SecurityUtils.getLoginUser().getUser();
|
||||
cusMain = cusMainService.getById(cusMain.getId());
|
||||
//转到公海表
|
||||
CusMainSeas cusMainSeas = new CusMainSeas();
|
||||
BeanUtils.copyProperties(cusMain, cusMainSeas);
|
||||
cusMainSeasService.save(cusMainSeas);
|
||||
//时间轴信息
|
||||
CusTimeAxis cusTimeAxis = new CusTimeAxis();
|
||||
cusTimeAxis.setBusiMaxCatg("客户迁移");
|
||||
cusTimeAxis.setBusiCatg("迁移");
|
||||
cusTimeAxis.setContent("转入公海,操作人:"+sysUser.getNickName());
|
||||
cusTimeAxis.setCusId(cusMain.getId());
|
||||
cusTimeAxisService.saveNewTimeAxis(cusTimeAxis);
|
||||
//真删除客户主表信息
|
||||
cusMainService.deleteCusMain(cusMain.getId());
|
||||
return success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.cus.vo.MainVO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -49,7 +50,7 @@ public class CusMainSeasController extends BaseController
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize)
|
||||
{
|
||||
Page<CusMainSeas> page = new Page<>(pageNum, pageSize);
|
||||
IPage<CusMainSeas> list = cusMainSeasService.queryListPage(cusMainSeas,page);
|
||||
IPage<MainVO> list = cusMainSeasService.queryListPage(cusMainSeas,page);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
|
||||
@ -19,4 +19,11 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
public interface CusMainMapper extends BaseMapper<CusMain>
|
||||
{
|
||||
IPage<MainVO> queryListPage(@Param("entity") MainVO entity, Page<CusMain> page);
|
||||
|
||||
/**
|
||||
* 真删除客户-配合移入公海客户使用
|
||||
* @author vinjor-M
|
||||
* @date 14:47 2025/11/24
|
||||
**/
|
||||
int deleteCusById(@Param("id")String id);
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.cus.domain.CusMainSeas;
|
||||
import com.ruoyi.cus.vo.MainVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@ -17,5 +18,5 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface CusMainSeasMapper extends BaseMapper<CusMainSeas>
|
||||
{
|
||||
IPage<CusMainSeas> queryListPage(@Param("entity") CusMainSeas entity, Page<CusMainSeas> page);
|
||||
IPage<MainVO> queryListPage(@Param("entity") CusMainSeas entity, Page<CusMainSeas> page);
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.cus.domain.CusMainSeas;
|
||||
import com.ruoyi.cus.vo.MainVO;
|
||||
|
||||
/**
|
||||
* 公海客户信息Service接口
|
||||
@ -13,5 +14,5 @@ import com.ruoyi.cus.domain.CusMainSeas;
|
||||
* @date 2025-11-24
|
||||
*/
|
||||
public interface ICusMainSeasService extends IService<CusMainSeas> {
|
||||
IPage<CusMainSeas> queryListPage(CusMainSeas pageReqVO, Page<CusMainSeas> page);
|
||||
IPage<MainVO> queryListPage(CusMainSeas pageReqVO, Page<CusMainSeas> page);
|
||||
}
|
||||
|
||||
@ -72,5 +72,11 @@ public interface ICusMainService extends IService<CusMain> {
|
||||
**/
|
||||
void saveOrUpdateByCusName(List<CusMain> cusMainList);
|
||||
|
||||
/**
|
||||
* 删除客户信息真删除--配合移入公海使用
|
||||
* @author vinjor-M
|
||||
* @date 14:45 2025/11/24
|
||||
**/
|
||||
void deleteCusMain(String id);
|
||||
|
||||
}
|
||||
|
||||
@ -1,9 +1,13 @@
|
||||
package com.ruoyi.cus.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.cus.vo.MainVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -24,7 +28,13 @@ public class CusMainSeasServiceImpl extends ServiceImpl<CusMainSeasMapper,CusMai
|
||||
private CusMainSeasMapper cusMainSeasMapper;
|
||||
|
||||
@Override
|
||||
public IPage<CusMainSeas> queryListPage(CusMainSeas pageReqVO, Page<CusMainSeas> page) {
|
||||
return cusMainSeasMapper.queryListPage(pageReqVO, page);
|
||||
public IPage<MainVO> queryListPage(CusMainSeas pageReqVO, Page<CusMainSeas> page) {
|
||||
IPage<MainVO> list = cusMainSeasMapper.queryListPage(pageReqVO, page);
|
||||
list.getRecords().forEach(item->{
|
||||
if(StringUtils.isNotEmpty(item.getCusLabels())){
|
||||
item.setCusLabelList(JSON.parseArray(item.getCusLabels()));
|
||||
}
|
||||
});
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@ -333,4 +333,16 @@ public class CusMainServiceImpl extends ServiceImpl<CusMainMapper,CusMain> impl
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户信息真删除--配合移入公海使用
|
||||
*
|
||||
* @param id
|
||||
* @author vinjor-M
|
||||
* @date 14:45 2025/11/24
|
||||
*/
|
||||
@Override
|
||||
public void deleteCusMain(String id) {
|
||||
cusMainMapper.deleteCusById(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -84,4 +84,8 @@
|
||||
cm.if_star DESC,
|
||||
cm.create_time DESC
|
||||
</select>
|
||||
|
||||
<delete id="deleteCusById">
|
||||
DELETE FROM cus_main WHERE id = #{id}
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -29,20 +29,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select id, if_star, cus_labels, cus_code, full_name, short_name, cus_type, country, zone_name, main_prods, site_url, remark, files, del_flag, creator, create_time, updater, update_time from cus_main_seas
|
||||
</sql>
|
||||
|
||||
<select id="queryListPage" parameterType="CusMainSeas" resultMap="CusMainSeasResult">
|
||||
<include refid="selectCusMainSeasVo"/>
|
||||
<where>
|
||||
<if test="entity.cusLabels != null and entity.cusLabels != ''"> and cus_labels = #{entity.cusLabels}</if>
|
||||
<if test="entity.cusCode != null and entity.cusCode != ''"> and cus_code = #{entity.cusCode}</if>
|
||||
<if test="entity.fullName != null and entity.fullName != ''"> and full_name like concat('%', #{entity.fullName}, '%')</if>
|
||||
<if test="entity.shortName != null and entity.shortName != ''"> and short_name like concat('%', #{entity.shortName}, '%')</if>
|
||||
<if test="entity.cusType != null and entity.cusType != ''"> and cus_type = #{entity.cusType}</if>
|
||||
<if test="entity.country != null and entity.country != ''"> and country = #{entity.country}</if>
|
||||
<if test="entity.zoneName != null and entity.zoneName != ''"> and zone_name like concat('%', #{entity.zoneName}, '%')</if>
|
||||
<if test="entity.mainProds != null and entity.mainProds != ''"> and main_prods = #{entity.mainProds}</if>
|
||||
<if test="entity.siteUrl != null and entity.siteUrl != ''"> and site_url = #{entity.siteUrl}</if>
|
||||
<if test="entity.remark != null and entity.remark != ''"> and remark = #{entity.remark}</if>
|
||||
<if test="entity.files != null and entity.files != ''"> and files = #{entity.files}</if>
|
||||
</where>
|
||||
<select id="queryListPage" parameterType="CusMainSeas" resultType="com.ruoyi.cus.vo.MainVO">
|
||||
SELECT
|
||||
cms.*,
|
||||
cc.cus_from AS cusFrom,
|
||||
cc.cus_level AS cusLevel,
|
||||
cc.busi_type AS busiType,
|
||||
cc.contact_address AS contactAddress,
|
||||
cct.`name` AS contactName,
|
||||
cmg.user_name AS userName ,
|
||||
cmg.follow_step AS followStep
|
||||
FROM
|
||||
cus_main_seas cms
|
||||
LEFT JOIN cus_company cc ON cms.id = cc.cus_id
|
||||
AND cc.del_flag = '0'
|
||||
LEFT JOIN cus_manager cmg ON cms.id = cmg.cus_id
|
||||
AND cmg.del_flag = '0'
|
||||
LEFT JOIN cus_contacts cct ON cms.id = cct.cus_id
|
||||
AND cct.if_default = 1
|
||||
AND cct.del_flag = '0'
|
||||
WHERE
|
||||
cms.del_flag = '0'
|
||||
<if test="entity.cusCode!=null and entity.cusCode!=''">
|
||||
AND cms.cus_code = #{entity.cusCode}
|
||||
</if>
|
||||
<if test="entity.fullName!=null and entity.cusCode!=''">
|
||||
AND cms.full_name LIKE CONCAT('%',#{entity.fullName},'%')
|
||||
</if>
|
||||
<if test="entity.shortName!=null and entity.shortName!=''">
|
||||
AND cms.short_name LIKE CONCAT('%',#{entity.shortName},'%')
|
||||
</if>
|
||||
<if test="entity.cusType!=null and entity.cusType!=''">
|
||||
AND cms.cus_type = #{entity.cusType}
|
||||
</if>
|
||||
GROUP BY
|
||||
cms.id
|
||||
ORDER BY
|
||||
cms.if_star DESC,
|
||||
cms.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@ -66,6 +66,14 @@ export function setIfStar(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 移入公海
|
||||
export function moveToSeas(data) {
|
||||
return request({
|
||||
url: '/cus/main/moveToSeas',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除客户信息
|
||||
export function delMain(id) {
|
||||
|
||||
@ -285,7 +285,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listMain, getMain, delMain, addMain, updateMain ,setIfStar} from '@/api/cus/main'
|
||||
import { listMain, getMain, delMain, addMain, updateMain ,setIfStar,moveToSeas} from '@/api/cus/main'
|
||||
import { updateUser} from '@/api/cus/manager'
|
||||
import DrawForm from './drawForm'
|
||||
import { getToken } from '@/utils/auth'
|
||||
@ -443,6 +443,7 @@ export default {
|
||||
break
|
||||
case 'goSea':
|
||||
//转公海
|
||||
this.moveToSeasFun(dataObj.row)
|
||||
break
|
||||
default:
|
||||
break
|
||||
@ -488,6 +489,22 @@ export default {
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 客户移入公海
|
||||
*/
|
||||
moveToSeasFun(row){
|
||||
let that = this
|
||||
this.$modal.confirm('是否确认将编号为"' + row.cusCode + '"的客户移入公海?').then(function() {
|
||||
moveToSeas({ id:row.id}).then((resp) => {
|
||||
if(resp.code==200){
|
||||
that.getList()
|
||||
that.$modal.msgSuccess('操作成功')
|
||||
}else{
|
||||
that.$message.error(resp.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('cus/main/export', {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user