BUG修复
This commit is contained in:
parent
155b47e2c9
commit
60f35138bb
File diff suppressed because it is too large
Load Diff
|
|
@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
|
@ -152,8 +153,14 @@ public class BaseAreaController extends ControllerBase {
|
|||
@ApiMark(moduleName = "区域管理", apiName = "禁用")
|
||||
public ApiResult<Boolean> disable(@RequestBody List<Long> ids){
|
||||
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);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -140,7 +141,14 @@ public class DepartmentController extends ControllerBase {
|
|||
@ApiMark(moduleName = "部门管理", apiName = "禁用")
|
||||
public ApiResult<Boolean> disable(@RequestBody List<Integer> ids ){
|
||||
VUtils.trueThrowBusinessError(CollUtil.isEmpty(ids)).throwMessage("请选择要启用的数据");
|
||||
|
||||
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->{
|
||||
u.setDeptStatus(0);
|
||||
u.setDataModifyUserNo(AdminUserUtil.getUserNo());
|
||||
|
|
|
|||
|
|
@ -71,4 +71,19 @@ public class CustomerDTO {
|
|||
*/
|
||||
@NotNull(message = "状态不能为空")
|
||||
private Integer enableState;
|
||||
|
||||
/**
|
||||
* 代理负责人ID
|
||||
*/
|
||||
private String agencyManagerCode;
|
||||
|
||||
/**
|
||||
* 服务主管ID
|
||||
*/
|
||||
private String serviceSupervisorCode;
|
||||
|
||||
/**
|
||||
* 销售主管ID
|
||||
*/
|
||||
private String salesSupervisorCode;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,6 +106,11 @@ public class DeviceDTO {
|
|||
@NotNull(message = "质保期不能为空")
|
||||
private Integer warrantyMonth;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 行数据是否有效 0-无效 1-有效
|
||||
*/
|
||||
|
|
@ -135,4 +140,6 @@ public class DeviceDTO {
|
|||
* 最后更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -17,17 +17,33 @@ public class CmrAgentResultVO {
|
|||
//代理商负责人
|
||||
private String AgentHead1__c;
|
||||
|
||||
/**
|
||||
* 代理商负责人信息(对象)
|
||||
*/
|
||||
private AgentManagerVO AgentHead1__r;
|
||||
|
||||
//SAP代理商客户号
|
||||
private String Agent_SAP__c;
|
||||
|
||||
//销售授权信息
|
||||
private String SalesMessage__c;
|
||||
private String SalesMessage__c
|
||||
;
|
||||
|
||||
//销售主管
|
||||
private String SalesExecutive2__c;
|
||||
|
||||
/**
|
||||
* 销售主管
|
||||
*/
|
||||
private AgentManagerVO SalesExecutive2__r;
|
||||
|
||||
//服务主管
|
||||
private String ServiceManager__c;
|
||||
|
||||
/**
|
||||
* 服务主管
|
||||
*/
|
||||
private AgentManagerVO ServiceManager__r;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,15 @@ public class AdminBaseAreaService {
|
|||
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) {
|
||||
List<TBaseAreaVO> immediateChildren = findChildDepartmentsByParentId(node.getId());
|
||||
node.setChildren(immediateChildren);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@ import cn.hutool.core.collection.CollUtil;
|
|||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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.CustomerExcelVO;
|
||||
import com.nflg.mobilebroken.common.constant.STATE;
|
||||
|
|
@ -115,11 +117,14 @@ public class AdminCustomerService {
|
|||
ent.setAgencyCompanyCode(u.getId());
|
||||
ent.setAgencyCompanyName(u.getName());
|
||||
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.setSalesAuthorizationInfo(u.getSalesExecutive2__c());
|
||||
ent.setSalesSupervisor(u.getSalesExecutive2__c());
|
||||
ent.setServiceSupervisor(u.getServiceManager__c());
|
||||
ent.setSalesAuthorizationInfo(u.getSalesMessage__c());
|
||||
ent.setSalesSupervisor(u.getSalesExecutive2__r().getName());
|
||||
ent.setSalesSupervisorCode(u.getSalesExecutive2__r().getId());
|
||||
ent.setServiceSupervisor(u.getServiceManager__r().getName());
|
||||
ent.setServiceSupervisorCode(u.getServiceManager__r().getId());
|
||||
result.add(ent);
|
||||
});
|
||||
if(CollUtil.isNotEmpty(result)){
|
||||
|
|
@ -128,4 +133,6 @@ public class AdminCustomerService {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -29,11 +29,11 @@ public class ControllerTest {
|
|||
private IAdminApiService adminApiService;
|
||||
|
||||
@Resource
|
||||
AdminDeviceService customerService;
|
||||
AdminCustomerService customerService;
|
||||
|
||||
@Test
|
||||
public void testToken(){
|
||||
customerService.syncFormCrm("2020-05-21","2020-05-21");
|
||||
customerService.syncFromCrm("2020-04-15","2020-04-15"); //2020-05-21
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.nflg.mobilebroken.gateway;
|
|||
|
||||
import cn.dev33.satoken.stp.StpInterface;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.nflg.mobilebroken.common.util.AdminUserUtil;
|
||||
import com.nflg.mobilebroken.common.util.SaTokenAdminUtil;
|
||||
|
|
@ -44,7 +45,7 @@ public class StpInterfaceImpl implements StpInterface {
|
|||
@Override
|
||||
public List<String> getRoleList(Object loginId, String loginType) {
|
||||
if (StrUtil.equals(loginType, SaTokenAppUtil.getLoginType()) && Objects.equals(true, SaTokenAppUtil.getExtra("isPrimary"))){
|
||||
return List.of("primary");
|
||||
return ListUtil.of("primary");
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,12 @@ public class TBaseCustomer implements Serializable {
|
|||
*/
|
||||
private String agencyManager;
|
||||
|
||||
|
||||
/**
|
||||
* 代理负责人id
|
||||
*/
|
||||
private String agencyManagerCode;
|
||||
|
||||
/**
|
||||
* sap客户号
|
||||
*/
|
||||
|
|
@ -71,11 +77,21 @@ public class TBaseCustomer implements Serializable {
|
|||
*/
|
||||
private String serviceSupervisor;
|
||||
|
||||
/**
|
||||
* 服务主管id
|
||||
*/
|
||||
private String serviceSupervisorCode;
|
||||
|
||||
/**
|
||||
* 销售主管
|
||||
*/
|
||||
private String salesSupervisor;
|
||||
|
||||
/**
|
||||
* 销售主管id
|
||||
*/
|
||||
private String salesSupervisorCode;
|
||||
|
||||
/**
|
||||
* 状态 0-禁用 1-启用
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
and position_code=#{query.positionCode}
|
||||
</if>
|
||||
<if test="query.positionName!=null and query.positionName!=''">
|
||||
and position_name=#{query.positionName}
|
||||
and position_name like concat('%',#{query.positionName},'%')
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue