Commit f5d16e61 authored by lcl's avatar lcl

u

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