Merge remote-tracking branch '惠信/develop' into develop

This commit is contained in:
曹鹏飞 2025-02-15 15:13:12 +08:00
commit 15850ea094
14 changed files with 890 additions and 329 deletions

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid; import javax.validation.Valid;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@ -152,8 +153,14 @@ public class BaseAreaController extends ControllerBase {
@ApiMark(moduleName = "区域管理", apiName = "禁用") @ApiMark(moduleName = "区域管理", apiName = "禁用")
public ApiResult<Boolean> disable(@RequestBody List<Long> ids){ public ApiResult<Boolean> disable(@RequestBody List<Long> ids){
VUtils.trueThrow(CollUtil.isEmpty(ids)).throwMessage(STATE.ParamErr,"请选择要禁用的行"); VUtils.trueThrow(CollUtil.isEmpty(ids)).throwMessage(STATE.ParamErr,"请选择要禁用的行");
List<TBaseArea> tBaseAreas = baseAreaService.getBaseMapper().selectByIds(ids);
List<Long> allIds=new ArrayList<>();
allIds.addAll(ids);
for (TBaseArea baseArea :tBaseAreas) {
adminBaseAreaService.getAllChildIds(Convert.convert(TBaseAreaVO.class,baseArea) , allIds);
}
baseAreaService.upState(0, ids, AdminUserUtil.getUserNo(), AdminUserUtil.getUserName()); baseAreaService.upState(0, allIds, AdminUserUtil.getUserNo(), AdminUserUtil.getUserName());
return ApiResult.success(true); return ApiResult.success(true);
} }

View File

@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid; import javax.validation.Valid;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -140,7 +141,14 @@ public class DepartmentController extends ControllerBase {
@ApiMark(moduleName = "部门管理", apiName = "禁用") @ApiMark(moduleName = "部门管理", apiName = "禁用")
public ApiResult<Boolean> disable(@RequestBody List<Integer> ids ){ public ApiResult<Boolean> disable(@RequestBody List<Integer> ids ){
VUtils.trueThrowBusinessError(CollUtil.isEmpty(ids)).throwMessage("请选择要启用的数据"); VUtils.trueThrowBusinessError(CollUtil.isEmpty(ids)).throwMessage("请选择要启用的数据");
List<TBaseDepartment> tBaseDepartments = departmentService.getBaseMapper().selectByIds(ids); List<TBaseDepartment> tBaseDepartments = departmentService.getBaseMapper().selectByIds(ids);
List<Integer> childIds=new ArrayList<>();
childIds.addAll(ids);
for (TBaseDepartment tBaseDepartment : tBaseDepartments) {
adminDepartmentService.getAllChildIds(tBaseDepartment, childIds);
}
tBaseDepartments = departmentService.getBaseMapper().selectByIds(childIds);
tBaseDepartments.forEach(u->{ tBaseDepartments.forEach(u->{
u.setDeptStatus(0); u.setDeptStatus(0);
u.setDataModifyUserNo(AdminUserUtil.getUserNo()); u.setDataModifyUserNo(AdminUserUtil.getUserNo());

View File

@ -71,4 +71,19 @@ public class CustomerDTO {
*/ */
@NotNull(message = "状态不能为空") @NotNull(message = "状态不能为空")
private Integer enableState; private Integer enableState;
/**
* 代理负责人ID
*/
private String agencyManagerCode;
/**
* 服务主管ID
*/
private String serviceSupervisorCode;
/**
* 销售主管ID
*/
private String salesSupervisorCode;
} }

View File

@ -106,6 +106,11 @@ public class DeviceDTO {
@NotNull(message = "质保期不能为空") @NotNull(message = "质保期不能为空")
private Integer warrantyMonth; private Integer warrantyMonth;
/**
* 备注
*/
private String remark;
/** /**
* 行数据是否有效 0-无效 1-有效 * 行数据是否有效 0-无效 1-有效
*/ */
@ -135,4 +140,6 @@ public class DeviceDTO {
* 最后更新时间 * 最后更新时间
*/ */
private LocalDateTime updateTime; private LocalDateTime updateTime;
} }

View File

@ -0,0 +1,21 @@
package com.nflg.mobilebroken.admin.pojo.vo;
import lombok.Data;
/**
* 代理商负责人
*/
@Data
public class AgentManagerVO {
/**
* 负责人ID
*/
private String Id;
/**
* 负责人姓名
*/
private String Name;
}

View File

@ -17,17 +17,33 @@ public class CmrAgentResultVO {
//代理商负责人 //代理商负责人
private String AgentHead1__c; private String AgentHead1__c;
/**
* 代理商负责人信息对象
*/
private AgentManagerVO AgentHead1__r;
//SAP代理商客户号 //SAP代理商客户号
private String Agent_SAP__c; private String Agent_SAP__c;
//销售授权信息 //销售授权信息
private String SalesMessage__c; private String SalesMessage__c
;
//销售主管 //销售主管
private String SalesExecutive2__c; private String SalesExecutive2__c;
/**
* 销售主管
*/
private AgentManagerVO SalesExecutive2__r;
//服务主管 //服务主管
private String ServiceManager__c; private String ServiceManager__c;
/**
* 服务主管
*/
private AgentManagerVO ServiceManager__r;
} }

View File

@ -50,6 +50,15 @@ public class AdminBaseAreaService {
return ApiResult.success(dataResult,query,result.getTotal()); return ApiResult.success(dataResult,query,result.getTotal());
} }
public List<Long> getAllChildIds(TBaseAreaVO node, List<Long> ids) {
List<TBaseAreaVO> immediateChildren = findChildDepartmentsByParentId(node.getId());
ids.addAll(immediateChildren.stream().map(u->u.getId()).collect(Collectors.toSet()));
for (TBaseAreaVO child : immediateChildren) {
getAllChildIds(child,ids);
}
return ids;
}
private void initNodeChildren(TBaseAreaVO node) { private void initNodeChildren(TBaseAreaVO node) {
List<TBaseAreaVO> immediateChildren = findChildDepartmentsByParentId(node.getId()); List<TBaseAreaVO> immediateChildren = findChildDepartmentsByParentId(node.getId());
node.setChildren(immediateChildren); node.setChildren(immediateChildren);

View File

@ -5,7 +5,9 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.LocalDateTimeUtil; import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.nflg.mobilebroken.admin.constant.Constant; import com.nflg.mobilebroken.admin.constant.Constant;
import com.nflg.mobilebroken.admin.pojo.vo.AgentManagerVO;
import com.nflg.mobilebroken.admin.pojo.vo.CmrAgentResultVO; import com.nflg.mobilebroken.admin.pojo.vo.CmrAgentResultVO;
import com.nflg.mobilebroken.admin.pojo.vo.CustomerExcelVO; import com.nflg.mobilebroken.admin.pojo.vo.CustomerExcelVO;
import com.nflg.mobilebroken.common.constant.STATE; import com.nflg.mobilebroken.common.constant.STATE;
@ -115,11 +117,14 @@ public class AdminCustomerService {
ent.setAgencyCompanyCode(u.getId()); ent.setAgencyCompanyCode(u.getId());
ent.setAgencyCompanyName(u.getName()); ent.setAgencyCompanyName(u.getName());
ent.setEnableState(u.getEnabled__c()?1:0); ent.setEnableState(u.getEnabled__c()?1:0);
ent.setAgencyManager(u.getAgentHead1__c()); ent.setAgencyManager(u.getAgentHead1__r().getName());
ent.setAgencyManagerCode(u.getAgentHead1__r().getId());
ent.setSapCustomerNo(u.getAgent_SAP__c()); ent.setSapCustomerNo(u.getAgent_SAP__c());
ent.setSalesAuthorizationInfo(u.getSalesExecutive2__c()); ent.setSalesAuthorizationInfo(u.getSalesMessage__c());
ent.setSalesSupervisor(u.getSalesExecutive2__c()); ent.setSalesSupervisor(u.getSalesExecutive2__r().getName());
ent.setServiceSupervisor(u.getServiceManager__c()); ent.setSalesSupervisorCode(u.getSalesExecutive2__r().getId());
ent.setServiceSupervisor(u.getServiceManager__r().getName());
ent.setServiceSupervisorCode(u.getServiceManager__r().getId());
result.add(ent); result.add(ent);
}); });
if(CollUtil.isNotEmpty(result)){ if(CollUtil.isNotEmpty(result)){
@ -128,4 +133,6 @@ public class AdminCustomerService {
} }
} }
} }

View File

@ -48,6 +48,15 @@ public class AdminDepartmentService {
} }
public List<Integer> getAllChildIds(TBaseDepartment vo ,List<Integer> ids){
List<BaseDepartmentVO> immediateChildren = findChildDepartmentsByParentId(vo.getId());
ids.addAll(immediateChildren.stream().map(u->u.getId()).collect(Collectors.toSet()));
for (BaseDepartmentVO child : immediateChildren) {
getAllChildIds(child,ids);
}
return ids;
}

View File

@ -29,11 +29,11 @@ public class ControllerTest {
private IAdminApiService adminApiService; private IAdminApiService adminApiService;
@Resource @Resource
AdminDeviceService customerService; AdminCustomerService customerService;
@Test @Test
public void testToken(){ public void testToken(){
customerService.syncFormCrm("2020-05-21","2020-05-21"); customerService.syncFromCrm("2020-04-15","2020-04-15"); //2020-05-21
} }
@Test @Test

View File

@ -2,6 +2,7 @@ package com.nflg.mobilebroken.gateway;
import cn.dev33.satoken.stp.StpInterface; import cn.dev33.satoken.stp.StpInterface;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.nflg.mobilebroken.common.util.AdminUserUtil; import com.nflg.mobilebroken.common.util.AdminUserUtil;
import com.nflg.mobilebroken.common.util.SaTokenAdminUtil; import com.nflg.mobilebroken.common.util.SaTokenAdminUtil;
@ -44,7 +45,7 @@ public class StpInterfaceImpl implements StpInterface {
@Override @Override
public List<String> getRoleList(Object loginId, String loginType) { public List<String> getRoleList(Object loginId, String loginType) {
if (StrUtil.equals(loginType, SaTokenAppUtil.getLoginType()) && Objects.equals(true, SaTokenAppUtil.getExtra("isPrimary"))){ if (StrUtil.equals(loginType, SaTokenAppUtil.getLoginType()) && Objects.equals(true, SaTokenAppUtil.getExtra("isPrimary"))){
return List.of("primary"); return ListUtil.of("primary");
} }
return Collections.emptyList(); return Collections.emptyList();
} }

View File

@ -46,6 +46,12 @@ public class TBaseCustomer implements Serializable {
*/ */
private String agencyManager; private String agencyManager;
/**
* 代理负责人id
*/
private String agencyManagerCode;
/** /**
* sap客户号 * sap客户号
*/ */
@ -71,11 +77,21 @@ public class TBaseCustomer implements Serializable {
*/ */
private String serviceSupervisor; private String serviceSupervisor;
/**
* 服务主管id
*/
private String serviceSupervisorCode;
/** /**
* 销售主管 * 销售主管
*/ */
private String salesSupervisor; private String salesSupervisor;
/**
* 销售主管id
*/
private String salesSupervisorCode;
/** /**
* 状态 0-禁用 1-启用 * 状态 0-禁用 1-启用
*/ */

View File

@ -7,7 +7,7 @@
and position_code=#{query.positionCode} and position_code=#{query.positionCode}
</if> </if>
<if test="query.positionName!=null and query.positionName!=''"> <if test="query.positionName!=null and query.positionName!=''">
and position_name=#{query.positionName} and position_name like concat('%',#{query.positionName},'%')
</if> </if>
</sql> </sql>