1. 商户数据, 商户终端, 商户巡检单
This commit is contained in:
parent
88ca3fad78
commit
3f1ed12b6a
|
|
@ -128,6 +128,6 @@ public class TerminalQuery extends CommonParam {
|
||||||
|
|
||||||
|
|
||||||
private Long terminalId;
|
private Long terminalId;
|
||||||
|
@Condition(name = "store_id", type = Condition.ConditionType.eq, tableName = "s")
|
||||||
private Long storeId;
|
private Long storeId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -127,4 +127,10 @@ public class ReviewedQuery extends CommonParam {
|
||||||
@Condition(name = "lower_task_id", type = Condition.ConditionType.in, tableName = "i")
|
@Condition(name = "lower_task_id", type = Condition.ConditionType.in, tableName = "i")
|
||||||
private List<Long> lowerTaskIds;
|
private List<Long> lowerTaskIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户id
|
||||||
|
*/
|
||||||
|
@Condition(name = "store_id", type = Condition.ConditionType.eq, tableName = "isr")
|
||||||
|
private Long storeId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import com.chushang.inspection.project.service.TbTemplateService;
|
||||||
import com.chushang.inspection.terminal.po.Store;
|
import com.chushang.inspection.terminal.po.Store;
|
||||||
import com.chushang.inspection.terminal.query.StoreQuery;
|
import com.chushang.inspection.terminal.query.StoreQuery;
|
||||||
import com.chushang.inspection.terminal.service.StoreService;
|
import com.chushang.inspection.terminal.service.StoreService;
|
||||||
|
import com.chushang.inspection.terminal.service.TerminalService;
|
||||||
import com.chushang.inspection.terminal.vo.StoreVO;
|
import com.chushang.inspection.terminal.vo.StoreVO;
|
||||||
import com.chushang.security.annotation.RequiresPermissions;
|
import com.chushang.security.annotation.RequiresPermissions;
|
||||||
import lombok.extern.java.Log;
|
import lombok.extern.java.Log;
|
||||||
|
|
@ -30,6 +31,8 @@ public class StoreController {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
StoreService storeService;
|
StoreService storeService;
|
||||||
|
@Resource
|
||||||
|
TerminalService terminalService;
|
||||||
/**
|
/**
|
||||||
* 1. 终端商户池
|
* 1. 终端商户池
|
||||||
* 2. 我的终端池
|
* 2. 我的终端池
|
||||||
|
|
@ -44,7 +47,7 @@ public class StoreController {
|
||||||
*/
|
*/
|
||||||
@SysLog(value = "查询商户", businessType = BusinessType.QUERY)
|
@SysLog(value = "查询商户", businessType = BusinessType.QUERY)
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
// @RequiresPermissions("ins:store:page")
|
@RequiresPermissions("ins:store:page")
|
||||||
public AjaxResult pageList(@Validated StoreQuery query) {
|
public AjaxResult pageList(@Validated StoreQuery query) {
|
||||||
return AjaxResult.success(storeService.pageList(query));
|
return AjaxResult.success(storeService.pageList(query));
|
||||||
}
|
}
|
||||||
|
|
@ -61,16 +64,6 @@ public class StoreController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商户详情 --> 查询商户详情
|
|
||||||
*/
|
|
||||||
@SysLog(value = "查询商户", businessType = BusinessType.QUERY)
|
|
||||||
@GetMapping("/info")
|
|
||||||
@RequiresPermissions("ins:store:info")
|
|
||||||
public AjaxResult update(@NotNull(message = "商户id不能为空") Long id) {
|
|
||||||
Store store = storeService.getById(id);
|
|
||||||
return AjaxResult.success(BeanUtil.copyProperties(store, StoreVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -96,4 +89,16 @@ public class StoreController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户详情 --> 查询商户详情
|
||||||
|
*/
|
||||||
|
@SysLog(value = "查询商户", businessType = BusinessType.QUERY)
|
||||||
|
@GetMapping("/info/{storeId}")
|
||||||
|
@RequiresPermissions("ins:store:info")
|
||||||
|
public AjaxResult info(@PathVariable Long storeId) {
|
||||||
|
Store store = storeService.getById(storeId);
|
||||||
|
return AjaxResult.success(BeanUtil.copyProperties(store, StoreVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import cn.hutool.core.lang.Assert;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.chushang.common.core.constant.SecurityConstants;
|
||||||
import com.chushang.common.core.util.StringUtils;
|
import com.chushang.common.core.util.StringUtils;
|
||||||
import com.chushang.common.mybatis.page.CommonParam;
|
import com.chushang.common.mybatis.page.CommonParam;
|
||||||
import com.chushang.common.mybatis.utils.PageResult;
|
import com.chushang.common.mybatis.utils.PageResult;
|
||||||
|
|
@ -21,6 +22,7 @@ import com.chushang.inspection.terminal.service.StoreService;
|
||||||
import com.chushang.inspection.terminal.vo.StoreTerminalVO;
|
import com.chushang.inspection.terminal.vo.StoreTerminalVO;
|
||||||
import com.chushang.inspection.terminal.vo.StoreVO;
|
import com.chushang.inspection.terminal.vo.StoreVO;
|
||||||
import com.chushang.inspection.work.dto.WrkIcbcJsReceive;
|
import com.chushang.inspection.work.dto.WrkIcbcJsReceive;
|
||||||
|
import com.chushang.system.feign.RemoteDeptService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.chushang.inspection.terminal.mapper.StoreMapper;
|
import com.chushang.inspection.terminal.mapper.StoreMapper;
|
||||||
|
|
@ -38,7 +40,7 @@ import java.util.stream.Collectors;
|
||||||
public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements StoreService {
|
public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements StoreService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
PollingTaskService taskService;
|
RemoteDeptService remoteDeptService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult pageList(StoreQuery query) {
|
public PageResult pageList(StoreQuery query) {
|
||||||
|
|
@ -46,6 +48,15 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
|
||||||
Page<Store> page = new Page<>(commonParam.getPage(), commonParam.getLimit());
|
Page<Store> page = new Page<>(commonParam.getPage(), commonParam.getLimit());
|
||||||
WrapperUtils.buildSql(query);
|
WrapperUtils.buildSql(query);
|
||||||
List<StoreVO> storeVOS = baseMapper.pageList(query, page);
|
List<StoreVO> storeVOS = baseMapper.pageList(query, page);
|
||||||
|
if (CollectionUtil.isNotEmpty(storeVOS)){
|
||||||
|
Set<Long> deptIds = storeVOS.stream().map(StoreVO::getDeptId).collect(Collectors.toSet());
|
||||||
|
Map<Long, String> deptNameByIds = remoteDeptService.getDeptNameByIds(deptIds, SecurityConstants.INNER);
|
||||||
|
storeVOS = storeVOS.stream().peek(s->{
|
||||||
|
Long deptId = s.getDeptId();
|
||||||
|
String deptName = deptNameByIds.get(deptId);
|
||||||
|
s.setDeptName(deptName);
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
}
|
||||||
return new PageResult(storeVOS, page);
|
return new PageResult(storeVOS, page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue