Commit f5d16e61 authored by lcl's avatar lcl

u

parent db7f9b02
...@@ -157,6 +157,14 @@ tenant: ...@@ -157,6 +157,14 @@ tenant:
- sys_user_post - sys_user_post
- sys_user_role - sys_user_role
- sys_client - sys_client
- contact_info
- customer_user
- customer_follow_record
- business_user
- business_backlog
- business_follow_record
- business_label
- business_relate_company
# MyBatisPlus配置 # MyBatisPlus配置
......
...@@ -44,7 +44,7 @@ public class CustomerController extends BaseController { ...@@ -44,7 +44,7 @@ public class CustomerController extends BaseController {
/** /**
* 查询客户列表 * 查询客户列表
*/ */
@SaCheckPermission("'customer:list')") // @SaCheckPermission("'customer:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo<CustomerListVo> selectPageList(CustomerSearchDto dto , PageQuery pageQuery) { public TableDataInfo<CustomerListVo> selectPageList(CustomerSearchDto dto , PageQuery pageQuery) {
return baseService.selectList(dto,pageQuery); return baseService.selectList(dto,pageQuery);
...@@ -53,7 +53,7 @@ public class CustomerController extends BaseController { ...@@ -53,7 +53,7 @@ public class CustomerController extends BaseController {
/** /**
* 客户详情 * 客户详情
*/ */
@SaCheckPermission("'customer:info')") // @SaCheckPermission("'customer:info')")
@GetMapping("/{customerId}") @GetMapping("/{customerId}")
public R<CustomerVo> info(@PathVariable("customerId") String customerId) { public R<CustomerVo> info(@PathVariable("customerId") String customerId) {
return R.ok(baseService.info(customerId)); return R.ok(baseService.info(customerId));
...@@ -62,7 +62,7 @@ public class CustomerController extends BaseController { ...@@ -62,7 +62,7 @@ public class CustomerController extends BaseController {
/** /**
* 添加客户 * 添加客户
*/ */
@SaCheckPermission("'customer:add')") // @SaCheckPermission("'customer:add')")
@PostMapping() @PostMapping()
@RepeatSubmit @RepeatSubmit
public R<Void> add(@RequestBody Customer customer) { public R<Void> add(@RequestBody Customer customer) {
...@@ -89,7 +89,7 @@ public class CustomerController extends BaseController { ...@@ -89,7 +89,7 @@ public class CustomerController extends BaseController {
/** /**
* 编辑客户 * 编辑客户
*/ */
@SaCheckPermission("'customer:edit'") // @SaCheckPermission("'customer:edit'")
@PutMapping() @PutMapping()
@RepeatSubmit @RepeatSubmit
public R<Void> edit(@RequestBody Customer customer) { public R<Void> edit(@RequestBody Customer customer) {
......
...@@ -123,6 +123,10 @@ public class Customer implements Serializable { ...@@ -123,6 +123,10 @@ public class Customer implements Serializable {
* 其它管理体系特点 * 其它管理体系特点
*/ */
private String otherMsCharacteistic; private String otherMsCharacteistic;
/**
* 租户编号
*/
private String tenantId;
private Long createId; private Long createId;
......
...@@ -56,7 +56,7 @@ public interface BusinessInfoMapper extends BaseMapper<BusinessInfo> { ...@@ -56,7 +56,7 @@ public interface BusinessInfoMapper extends BaseMapper<BusinessInfo> {
@DataColumn(key = "deptName", value = "d.dept_id"), @DataColumn(key = "deptName", value = "d.dept_id"),
@DataColumn(key = "userName", value = "u.user_id") @DataColumn(key = "userName", value = "u.user_id")
}) })
public Page<BusinessListVo> selectBusinessInfoList(@Param("page") Page<BusinessListVo> page,@Param("dto") BusinessListDto dto); Page<BusinessListVo> selectBusinessInfoList(@Param("page") IPage<BusinessListDto> page, @Param("dto") BusinessListDto dto);
/** /**
* 新增项目详情 * 新增项目详情
...@@ -114,12 +114,28 @@ public interface BusinessInfoMapper extends BaseMapper<BusinessInfo> { ...@@ -114,12 +114,28 @@ public interface BusinessInfoMapper extends BaseMapper<BusinessInfo> {
Page<CustomerBusinessListVo> selectCustomerBusinessList(IPage<CustomerBusinessSearchDto> page,@Param("dto") CustomerBusinessSearchDto dto); Page<CustomerBusinessListVo> selectCustomerBusinessList(IPage<CustomerBusinessSearchDto> page,@Param("dto") CustomerBusinessSearchDto dto);
@DataPermission({
@DataColumn(key = "deptName", value = "d.dept_id"),
@DataColumn(key = "userName", value = "u.user_id")
})
int selectCountByStatus(BusinessSearchDto dto); int selectCountByStatus(BusinessSearchDto dto);
@DataPermission({
@DataColumn(key = "deptName", value = "d.dept_id"),
@DataColumn(key = "userName", value = "u.user_id")
})
List<BusinessAnalyzeVo> selectAmountAnalyze(BusinessSearchDto dto); List<BusinessAnalyzeVo> selectAmountAnalyze(BusinessSearchDto dto);
@DataPermission({
@DataColumn(key = "deptName", value = "d.dept_id"),
@DataColumn(key = "userName", value = "u.user_id")
})
List<BusinessAnalyzeVo> selectTypeAnalyze(BusinessSearchDto dto); List<BusinessAnalyzeVo> selectTypeAnalyze(BusinessSearchDto dto);
@DataPermission({
@DataColumn(key = "deptName", value = "d.dept_id"),
@DataColumn(key = "userName", value = "u.user_id")
})
List<BusinessAnalyzeVo> selectCategoryAnalyze(BusinessSearchDto dto); List<BusinessAnalyzeVo> selectCategoryAnalyze(BusinessSearchDto dto);
} }
...@@ -11,6 +11,8 @@ import com.dsk.biz.domain.bo.BusinessExcelDto; ...@@ -11,6 +11,8 @@ import com.dsk.biz.domain.bo.BusinessExcelDto;
import com.dsk.biz.domain.bo.BusinessListDto; import com.dsk.biz.domain.bo.BusinessListDto;
import com.dsk.biz.domain.bo.CustomerBusinessSearchDto; import com.dsk.biz.domain.bo.CustomerBusinessSearchDto;
import com.dsk.biz.domain.vo.*; import com.dsk.biz.domain.vo.*;
import com.dsk.common.annotation.DataColumn;
import com.dsk.common.annotation.DataPermission;
import com.dsk.jsk.service.EnterpriseService; import com.dsk.jsk.service.EnterpriseService;
import com.dsk.biz.mapper.BusinessInfoMapper; import com.dsk.biz.mapper.BusinessInfoMapper;
import com.dsk.biz.mapper.BusinessLabelMapper; import com.dsk.biz.mapper.BusinessLabelMapper;
...@@ -92,15 +94,14 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService { ...@@ -92,15 +94,14 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
@Override @Override
public TableDataInfo<BusinessListVo> selectBusinessInfoList(BusinessListDto dto, PageQuery pageQuery) { public TableDataInfo<BusinessListVo> selectBusinessInfoList(BusinessListDto dto, PageQuery pageQuery) {
dto.setUserId(LoginHelper.getUserId()); dto.setUserId(LoginHelper.getUserId());
Page<BusinessListVo> page = businessInfoMapper.selectBusinessInfoList(pageQuery.build(), dto); TableDataInfo<BusinessListVo> result = TableDataInfo.build(businessInfoMapper.selectBusinessInfoList(pageQuery.build(), dto));
List<BusinessListVo> businessListVos = page.getRecords(); if (!CollectionUtils.isEmpty(result.getRows()) && ObjectUtil.isNotEmpty(dto.getProjectName())) {
if (!CollectionUtils.isEmpty(businessListVos) && ObjectUtil.isNotEmpty(dto.getProjectName())) { for (BusinessListVo vo : result.getRows()) {
for (BusinessListVo vo : businessListVos) {
vo.setProjectName(StringUtils.markInRed(vo.getProjectName(), dto.getProjectName())); vo.setProjectName(StringUtils.markInRed(vo.getProjectName(), dto.getProjectName()));
vo.setOwnerCompany(StringUtils.markInRed(vo.getOwnerCompany(), dto.getProjectName())); vo.setOwnerCompany(StringUtils.markInRed(vo.getOwnerCompany(), dto.getProjectName()));
} }
} }
return TableDataInfo.build(page); return result;
} }
...@@ -255,7 +256,7 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService { ...@@ -255,7 +256,7 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
businessInfo.setConstructionUnitUipId(vo.getUipId()); businessInfo.setConstructionUnitUipId(vo.getUipId());
businessInfo.setConstructionUnitCid(vo.getCompanyId()); businessInfo.setConstructionUnitCid(vo.getCompanyId());
businessInfo.setConstructionPrincipal(vo.getLegalPerson()); businessInfo.setConstructionPrincipal(vo.getLegalPerson());
businessInfo.setTenantId(LoginHelper.getTenantId());
int addBusiness = businessInfoMapper.insertBusinessInfo(businessInfo); int addBusiness = businessInfoMapper.insertBusinessInfo(businessInfo);
if (addBusiness > 0) { if (addBusiness > 0) {
//获取登陆用户的部门id //获取登陆用户的部门id
......
...@@ -31,10 +31,6 @@ public class BusinessOverviewServiceImpl implements IBusinessOverviewService { ...@@ -31,10 +31,6 @@ public class BusinessOverviewServiceImpl implements IBusinessOverviewService {
private DskOpenApiUtil dskOpenApiUtil; private DskOpenApiUtil dskOpenApiUtil;
@Override @Override
@DataPermission({
@DataColumn(key = "deptName", value = "d.dept_id"),
@DataColumn(key = "userName", value = "u.user_id")
})
public Map<String, Object> statusStatistics(BusinessSearchDto dto) { public Map<String, Object> statusStatistics(BusinessSearchDto dto) {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
//总 //总
...@@ -52,28 +48,16 @@ public class BusinessOverviewServiceImpl implements IBusinessOverviewService { ...@@ -52,28 +48,16 @@ public class BusinessOverviewServiceImpl implements IBusinessOverviewService {
} }
@Override @Override
@DataPermission({
@DataColumn(key = "deptName", value = "d.dept_id"),
@DataColumn(key = "userName", value = "u.user_id")
})
public List<BusinessAnalyzeVo> amountAnalyze(BusinessSearchDto dto) { public List<BusinessAnalyzeVo> amountAnalyze(BusinessSearchDto dto) {
return businessInfoMapper.selectAmountAnalyze(dto); return businessInfoMapper.selectAmountAnalyze(dto);
} }
@Override @Override
@DataPermission({
@DataColumn(key = "deptName", value = "d.dept_id"),
@DataColumn(key = "userName", value = "u.user_id")
})
public List<BusinessAnalyzeVo> typeAnalyze(BusinessSearchDto dto) { public List<BusinessAnalyzeVo> typeAnalyze(BusinessSearchDto dto) {
return businessInfoMapper.selectTypeAnalyze(dto); return businessInfoMapper.selectTypeAnalyze(dto);
} }
@Override @Override
@DataPermission({
@DataColumn(key = "deptName", value = "d.dept_id"),
@DataColumn(key = "userName", value = "u.user_id")
})
public List<BusinessAnalyzeVo> categoryAnalyze(BusinessSearchDto dto) { public List<BusinessAnalyzeVo> categoryAnalyze(BusinessSearchDto dto) {
return businessInfoMapper.selectCategoryAnalyze(dto); return businessInfoMapper.selectCategoryAnalyze(dto);
} }
......
...@@ -61,7 +61,7 @@ public class CustomerServiceImpl implements ICustomerService { ...@@ -61,7 +61,7 @@ public class CustomerServiceImpl implements ICustomerService {
dto.setUserId(LoginHelper.getUserId()); dto.setUserId(LoginHelper.getUserId());
dto.setStatus(ObjectUtils.isEmpty(dto.getStatus()) ? 0 : dto.getStatus()); dto.setStatus(ObjectUtils.isEmpty(dto.getStatus()) ? 0 : dto.getStatus());
final TableDataInfo<CustomerListVo> result = TableDataInfo.build(baseMapper.selectList(pageQuery.build(), dto)); final TableDataInfo<CustomerListVo> result = TableDataInfo.build(baseMapper.selectList(pageQuery.build(), dto));
if(!ObjectUtils.isEmpty(result.getRows())){ if(!ObjectUtils.isEmpty(result.getRows()) && !ObjectUtils.isEmpty(dto.getCompanyName())){
for (CustomerListVo vo : result.getRows()) { for (CustomerListVo vo : result.getRows()) {
vo.setCompanyName(StringUtils.markInRed(vo.getCompanyName(), dto.getCompanyName())); vo.setCompanyName(StringUtils.markInRed(vo.getCompanyName(), dto.getCompanyName()));
} }
...@@ -87,6 +87,7 @@ public class CustomerServiceImpl implements ICustomerService { ...@@ -87,6 +87,7 @@ public class CustomerServiceImpl implements ICustomerService {
Long userId = LoginHelper.getUserId(); Long userId = LoginHelper.getUserId();
customer.setCreateId(userId); customer.setCreateId(userId);
customer.setUpdateId(userId); customer.setUpdateId(userId);
customer.setTenantId(LoginHelper.getTenantId());
//查重 //查重
Customer verifyCustomer = baseMapper.selectByCompanyNameAndUserId(customer.getCompanyName(), userId); Customer verifyCustomer = baseMapper.selectByCompanyNameAndUserId(customer.getCompanyName(), userId);
if (!ObjectUtils.isEmpty(verifyCustomer)) { if (!ObjectUtils.isEmpty(verifyCustomer)) {
......
...@@ -96,13 +96,13 @@ ...@@ -96,13 +96,13 @@
i.construction_unit ownerCompany, i.construction_unit ownerCompany,
i.construction_unit_uip_id ownerCompanyUipId, i.construction_unit_uip_id ownerCompanyUipId,
i.construction_unit_cid ownerCompanyCid, i.construction_unit_cid ownerCompanyCid,
<!-- MAX(f.creat_time) followTime,--> MAX(f.creat_time) followTime,
u.nick_name nickName u.nick_name nickName,
<!-- GROUP_CONCAT(DISTINCT l.label) label--> GROUP_CONCAT(DISTINCT l.label) label
FROM business_info i FROM business_info i
LEFT JOIN business_user bu on bu.business_id = i.id LEFT JOIN business_user bu on bu.business_id = i.id
<!-- LEFT JOIN business_follow_record f on f.business_id = i.id--> LEFT JOIN business_follow_record f on f.business_id = i.id
<!-- LEFT JOIN business_label l on l.business_id = i.id--> LEFT JOIN business_label l on l.business_id = i.id
LEFT JOIN sys_user u on u.user_id = bu.user_id LEFT JOIN sys_user u on u.user_id = bu.user_id
LEFT JOIN sys_dept d on d.dept_id = u.dept_id LEFT JOIN sys_dept d on d.dept_id = u.dept_id
<where> <where>
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
<choose> <choose>
<when test="dto.isPrivate == 1"> and bu.user_id = #{dto.userId} </when> <when test="dto.isPrivate == 1"> and bu.user_id = #{dto.userId} </when>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
<otherwise> and (bu.user_id = #{dto.userId} or i.is_private = 1) ${params.dataScope} </otherwise> <otherwise> and (bu.user_id = #{dto.userId} or i.is_private = 1) ${dto.params.dataScope} </otherwise>
</choose> </choose>
</where> </where>
GROUP BY i.id GROUP BY i.id
...@@ -223,6 +223,7 @@ ...@@ -223,6 +223,7 @@
<if test="supervisorPhone != null">supervisor_phone,</if> <if test="supervisorPhone != null">supervisor_phone,</if>
<if test="constructionUnitUipId != null">construction_unit_uip_id,</if> <if test="constructionUnitUipId != null">construction_unit_uip_id,</if>
<if test="constructionUnitCid != null">construction_unit_cid,</if> <if test="constructionUnitCid != null">construction_unit_cid,</if>
tenant_id
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="projectName != null">#{projectName},</if> <if test="projectName != null">#{projectName},</if>
...@@ -262,6 +263,7 @@ ...@@ -262,6 +263,7 @@
<if test="supervisorPhone != null">#{supervisorPhone},</if> <if test="supervisorPhone != null">#{supervisorPhone},</if>
<if test="constructionUnitUipId != null">#{constructionUnitUipId},</if> <if test="constructionUnitUipId != null">#{constructionUnitUipId},</if>
<if test="constructionUnitCid != null">#{constructionUnitCid},</if> <if test="constructionUnitCid != null">#{constructionUnitCid},</if>
#{tenantId}
</trim> </trim>
</insert> </insert>
......
...@@ -21,8 +21,7 @@ ...@@ -21,8 +21,7 @@
<if test="dto.startTime != null and dto.startTime != '' "> and cfr.visit_time &gt;= #{dto.startTime} </if> <if test="dto.startTime != null and dto.startTime != '' "> and cfr.visit_time &gt;= #{dto.startTime} </if>
<if test="dto.endTime != null and dto.endTime != '' "> and cfr.visit_time &lt;= #{dto.endTime} </if> <if test="dto.endTime != null and dto.endTime != '' "> and cfr.visit_time &lt;= #{dto.endTime} </if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
<if test="ew.getCustomSqlSegment != null and ew.getCustomSqlSegment != '' "> ${ew.getCustomSqlSegment}</if> <if test="dto.params.dataScope != null and dto.params.dataScope != '' "> ${dto.params.dataScope}</if>
<if test="dto.params.dataScope != null and params.dataScope != '' "> ${dto.params.dataScope}</if>
</where> </where>
order by cfr.visit_time desc order by cfr.visit_time desc
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment