Commit 6df6e67b by 刘宇峰

特约店、围栏

1 parent 4cb46f93
......@@ -113,7 +113,7 @@ public class TrialDriveShopController {
@GetMapping(value = "/shopusers")
@ApiOperation(value = "获取特约店层级")
public R getShopWithUser() {
List<SimpleTreeModel> treeModelList = trialDriveShopService.getShopWithUser();
List<SimpleTreeModel> treeModelList = trialDriveShopService.getShopWithUserTree();
return R.ok().data(treeModelList);
}
......
......@@ -21,6 +21,6 @@ public class ElectricFenceDTO {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createdDate;
@JsonIgnore
private Long departmentId;
private Long creatorId;
}
......@@ -42,6 +42,6 @@ public class ElectricFenceExport {
private Date createdDate;
@ExcelIgnore
private Long departmentId;
private Long creatorId;
}
......@@ -23,10 +23,7 @@ public class ElectricFenceBO {
*/
@NotBlank(message = "围栏名称不能为空")
private String fenceName;
/**
* 围栏编号
*/
private String fenceNo;
/**
* 业务围栏类型 0警情围栏,1试驾围栏
*/
......
......@@ -19,7 +19,6 @@ import cn.com.glsx.usercenter.api.dto.response.Organization;
import cn.com.glsx.usercenter.api.dto.response.User;
import cn.com.glsx.usercenter.api.feign.OrganizationService;
import cn.com.glsx.usercenter.api.feign.UserService;
import cn.hutool.core.lang.UUID;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
......@@ -35,6 +34,7 @@ import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@Slf4j
@Service
......@@ -83,7 +83,6 @@ public class TrialDriveShopService {
public ElectricFence syncAddFence(TrialDriveShopBO shopBO) throws Exception {
ElectricFenceBO fenceBO = new ElectricFenceBO();
fenceBO.setFenceName(shopBO.getFenceName());
fenceBO.setFenceNo(UUID.randomUUID().toString());
fenceBO.setBizFenceType(13);
fenceBO.setShapeType(1);
fenceBO.setRadius(shopBO.getRadius());
......@@ -130,7 +129,6 @@ public class TrialDriveShopService {
ElectricFenceBO fenceBO = new ElectricFenceBO();
fenceBO.setId(shop.getFenceId());
fenceBO.setFenceName(shopBO.getFenceName());
fenceBO.setFenceNo(UUID.randomUUID().toString());
fenceBO.setBizFenceType(13);
fenceBO.setShapeType(1);
fenceBO.setRadius(shopBO.getRadius());
......@@ -199,10 +197,22 @@ public class TrialDriveShopService {
electricFenceService.deleteById(shop.getFenceId());
}
public List<SimpleTreeModel> getShopWithUser() {
public List<Organization> getShopOrgs() {
R<List<Organization>> orgListR = organizationService.getSpecialLevelOrganizations(4);
List<Organization> orgList = orgListR.getDataList(new TypeToken<List<Organization>>() {
}.getType());
return orgList;
}
public List<Long> getShopOrgIds() {
List<Organization> orgList = getShopOrgs();
List<Long> orgIds = orgList.stream().map(Organization::getId).collect(Collectors.toList());
return orgIds;
}
public List<SimpleTreeModel> getShopWithUserTree() {
List<Organization> orgList = getShopOrgs();
List<SimpleTreeModel> treeModelList = Lists.newArrayList();
......
......@@ -57,7 +57,7 @@
select
<include refid="Base_Column_List"/>,
<include refid="Blob_Column_List"/>
from t_electric_fence
from t_electric_fence_copy
where del_flag = 0
and fence_id = #{fenceId}
</select>
......
......@@ -67,7 +67,7 @@
ttds.shop_code shopCode,
ttds.shop_level shopLevel,
tef.created_date createdDate,
tu.department_id departmentId
tef.created_by creatorId
from t_electric_fence tef
left join t_user tu on tu.id = tef.created_by
left join t_trial_drive_shop ttds on ttds.shop_code = tu.account
......@@ -81,7 +81,7 @@
ttds.shop_code shopCode,
ttds.shop_level shopLevel,
tef.created_date createdDate,
tu.department_id departmentId
tef.created_by creatorId
from t_electric_fence tef
left join t_user tu on tu.id = tef.created_by
left join t_trial_drive_shop ttds on ttds.shop_code = tu.account
......
......@@ -26,7 +26,7 @@
</sql>
<update id="logicDeleteByFenceId">
update t_electric_fence
update t_electric_fence_sns
set del_flag = -1
where fence_id = #{fenceId}
</update>
......
......@@ -4,12 +4,11 @@ import cn.com.glsx.Application;
import cn.com.glsx.admin.modules.model.ElectricFenceSnsModel;
import cn.com.glsx.admin.modules.model.param.ElectricFenceBO;
import cn.com.glsx.admin.modules.service.ElectricFenceService;
import cn.com.glsx.auth.model.Department;
import cn.com.glsx.auth.model.SyntheticUser;
import cn.com.glsx.auth.utils.ShieldContextHolder;
import cn.com.glsx.usercenter.api.dto.request.FindUserRequest;
import cn.com.glsx.usercenter.api.dto.response.User;
import cn.com.glsx.usercenter.api.feign.UserService;
import cn.hutool.core.lang.UUID;
import com.alibaba.fastjson.JSON;
import com.glsx.plat.core.web.R;
import com.google.common.collect.Lists;
......@@ -43,10 +42,14 @@ public class AdminApplicationTests {
System.out.println("@Before - runBeforeTestMethod");
SyntheticUser user = new SyntheticUser();
user.setUserId(2L);
user.setAdmin(false);
user.setUserId(6427L);
user.setIsAdmin(false);
user.setAccount("payxz");
ShieldContextHolder.setUser(user);
Department department = new Department();
department.setDeptId(182L);
user.setDepartment(department);
}
// Should rename to @AfterTestMethod
......@@ -58,8 +61,7 @@ public class AdminApplicationTests {
@Test
public void testAddFence() throws Exception {
ElectricFenceBO fenceBO = new ElectricFenceBO();
fenceBO.setFenceName("测试围栏3");
fenceBO.setFenceNo(UUID.randomUUID().toString());
fenceBO.setFenceName("特约店围栏1");
fenceBO.setBizFenceType(1);
fenceBO.setShapeType(1);
fenceBO.setRadius(3000);
......@@ -90,9 +92,8 @@ public class AdminApplicationTests {
@Test
public void testUpdateFence() throws Exception {
ElectricFenceBO fenceBO = new ElectricFenceBO();
fenceBO.setId(1L);
fenceBO.setFenceName("测试围栏-1");
fenceBO.setFenceNo(UUID.randomUUID().toString());
fenceBO.setId(1024L);
fenceBO.setFenceName("特约店围栏1-修改测试");
fenceBO.setBizFenceType(1);
fenceBO.setShapeType(1);
fenceBO.setRadius(1000);
......
......@@ -31,7 +31,7 @@ public class VehicleTest {
System.out.println("@Before - runBeforeTestMethod");
SyntheticUser user = new SyntheticUser();
user.setUserId(2L);
user.setAdmin(false);
user.setIsAdmin(false);
user.setAccount("huangxc");
ShieldContextHolder.setUser(user);
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!