Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
88ca3fad78
|
|
@ -50,38 +50,38 @@ public class WrapperUtils {
|
|||
Condition.ConditionType conditionType = condition.type();
|
||||
if (null != conditionType) {
|
||||
switch (conditionType) {
|
||||
case ge:
|
||||
case ge -> {
|
||||
if (StringUtils.isNotEmpty(tableName)) {
|
||||
allSql.append(" AND ").append(tableName).append(".")
|
||||
.append(name).append(" $ge; ").append(value).append(" ");
|
||||
}
|
||||
break;
|
||||
case le:
|
||||
}
|
||||
case le -> {
|
||||
if (StringUtils.isNotEmpty(tableName))
|
||||
allSql.append(" AND ").append(tableName).append(".")
|
||||
.append(name).append(" $le; ").append(value).append(" ");
|
||||
break;
|
||||
case gt:
|
||||
}
|
||||
case gt -> {
|
||||
if (StringUtils.isNotEmpty(tableName)) allSql.append(" AND ").append(tableName).append(".")
|
||||
.append(name).append(" $gt; ").append(value).append(" ");
|
||||
break;
|
||||
case lt:
|
||||
}
|
||||
case lt -> {
|
||||
if (StringUtils.isNotEmpty(tableName)) allSql.append(" AND ").append(tableName).append(".")
|
||||
.append(name).append(" $lt; ").append(value).append(" ");
|
||||
break;
|
||||
case isNull:
|
||||
}
|
||||
case isNull -> {
|
||||
if (StringUtils.isNotEmpty(tableName)) allSql.append(" AND ").append(tableName).append(".")
|
||||
.append(name).append(" is null ").append(" ");
|
||||
break;
|
||||
case eq:
|
||||
}
|
||||
case eq -> {
|
||||
if (StringUtils.isNotEmpty(tableName)) allSql.append(" AND ").append(tableName).append(".")
|
||||
.append(name).append(" = ").append(value).append(" ");
|
||||
break;
|
||||
case like:
|
||||
}
|
||||
case like -> {
|
||||
if (StringUtils.isNotEmpty(tableName)) allSql.append(" AND ").append(tableName).append(".")
|
||||
.append(name).append(" like concat('%', ").append(value).append(", '%'").append(" ");
|
||||
break;
|
||||
case in:
|
||||
}
|
||||
case in -> {
|
||||
if (value instanceof Collection<?> values) {
|
||||
if (StringUtils.isNotEmpty(tableName)) {
|
||||
allSql.append(" AND ").append(tableName).append(".")
|
||||
|
|
@ -98,8 +98,8 @@ public class WrapperUtils {
|
|||
} else {
|
||||
throw new MybatisConditionException("in 条件必须为集合");
|
||||
}
|
||||
break;
|
||||
case between:
|
||||
}
|
||||
case between -> {
|
||||
if (value instanceof Collection<?>) {
|
||||
List<?> list = Convert.toList(value);
|
||||
if (CollUtil.size(list) == 2) {
|
||||
|
|
@ -110,12 +110,12 @@ public class WrapperUtils {
|
|||
} else {
|
||||
throw new MybatisConditionException("between 条件必须为集合");
|
||||
}
|
||||
break;
|
||||
case likeLeft:
|
||||
}
|
||||
case likeLeft -> {
|
||||
if (StringUtils.isNotEmpty(tableName)) allSql.append(" AND ").append(tableName).append(".")
|
||||
.append(name).append(" like concat('%', ").append(value).append(", '')").append(" ");
|
||||
break;
|
||||
case dataScope:
|
||||
}
|
||||
case dataScope -> {
|
||||
// TODO 因为 dataScope 是在父类, 所以没有指定tableName, 此处无法获取对应的dataScopeIds
|
||||
if (value instanceof HashMap sqlParam) {
|
||||
// dataScope 的 拼接部门Ids
|
||||
|
|
@ -124,8 +124,8 @@ public class WrapperUtils {
|
|||
allSql.append(sql).append(" ");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case or_eq:
|
||||
}
|
||||
case or_eq -> {
|
||||
if (StringUtils.isNotEmpty(tableName)) {
|
||||
allSql.append(" OR ");
|
||||
for (String key : split) {
|
||||
|
|
@ -138,9 +138,8 @@ public class WrapperUtils {
|
|||
}
|
||||
allSql.append(") ");
|
||||
}
|
||||
|
||||
break;
|
||||
case or_like:
|
||||
}
|
||||
case or_like -> {
|
||||
if (StringUtils.isNotEmpty(tableName)) {
|
||||
allSql.append(" OR (");
|
||||
for (String key : split) {
|
||||
|
|
@ -152,8 +151,8 @@ public class WrapperUtils {
|
|||
}
|
||||
allSql.append(") ");
|
||||
}
|
||||
break;
|
||||
case or_likeLeft:
|
||||
}
|
||||
case or_likeLeft -> {
|
||||
if (StringUtils.isNotEmpty(tableName)) {
|
||||
allSql.append(" OR (");
|
||||
for (String key : split) {
|
||||
|
|
@ -166,7 +165,7 @@ public class WrapperUtils {
|
|||
}
|
||||
allSql.append(") ");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,4 +133,22 @@ public class StoreVO implements Serializable {
|
|||
* 创建日期
|
||||
*/
|
||||
protected LocalDateTime createTime;
|
||||
/**
|
||||
* 商户状态
|
||||
*/
|
||||
@DictFormat(dictType = "mer_status")
|
||||
private Integer storeStatus;
|
||||
/**
|
||||
* 终端数量
|
||||
*/
|
||||
private Integer countTerminal;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String deptName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,21 +67,18 @@ public class ReviewedQuery extends CommonParam {
|
|||
* 4 归档
|
||||
* null 全部
|
||||
*/
|
||||
@Range(min = 1, max = 6, message = "工单状态非法")
|
||||
private Integer wrkStatus;
|
||||
private int wrkStatus;
|
||||
|
||||
/**
|
||||
* 终端类型
|
||||
*/
|
||||
@Condition(name = "terminal_type", tableName = "itr")
|
||||
@Range(min = 1, max = 9, message = "终端类型非法")
|
||||
private Integer terminalType;
|
||||
|
||||
/**
|
||||
* 巡检频次
|
||||
*/
|
||||
@Condition(name = "ins_fre", tableName = "isr")
|
||||
@Range(min = 1, max = 5, message = "巡检频次非法")
|
||||
private Integer insFre;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public class StoreController {
|
|||
*/
|
||||
@SysLog(value = "查询商户", businessType = BusinessType.QUERY)
|
||||
@GetMapping("/page")
|
||||
@RequiresPermissions("ins:store:page")
|
||||
// @RequiresPermissions("ins:store:page")
|
||||
public AjaxResult pageList(@Validated StoreQuery query) {
|
||||
return AjaxResult.success(storeService.pageList(query));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import java.util.List;
|
|||
* @date: 2024/6/21 16:39
|
||||
*/
|
||||
public interface StoreMapper extends BaseMapper<Store> {
|
||||
|
||||
@DataScope(deptAlias = "s")
|
||||
List<StoreVO> pageList(@Param("query") StoreQuery query,
|
||||
Page<Store> page);
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import com.chushang.inspection.project.service.TbTemplateService;
|
|||
import com.chushang.inspection.terminal.po.Store;
|
||||
import com.chushang.inspection.terminal.query.StoreQuery;
|
||||
import com.chushang.inspection.terminal.service.StoreService;
|
||||
import com.chushang.inspection.terminal.vo.StoreTerminalVO;
|
||||
import com.chushang.inspection.terminal.vo.StoreVO;
|
||||
import com.chushang.inspection.work.dto.WrkIcbcJsReceive;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -42,22 +43,10 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
|
|||
@Override
|
||||
public PageResult pageList(StoreQuery query) {
|
||||
CommonParam commonParam = CommonParam.buildPageRequest();
|
||||
LambdaQueryWrapper<Store> storeSql = WrapperUtils.builder(query, commonParam);
|
||||
Page<Store> page = new Page<>(commonParam.getPage(), commonParam.getLimit());
|
||||
String terminalSn = query.getTerminalSn();
|
||||
String terminalNo = query.getTerminalNo();
|
||||
if (StringUtils.isNotEmpty(terminalNo) || StringUtils.isNotEmpty(terminalSn)){
|
||||
List<StoreVO> storeVOS = baseMapper.pageList(query, page);
|
||||
return new PageResult(storeVOS, page);
|
||||
}else {
|
||||
Page<Store> storePage = page(page, storeSql);
|
||||
List<Store> records = storePage.getRecords();
|
||||
if (CollectionUtil.isNotEmpty(records)){
|
||||
List<StoreVO> convert = convert(records);
|
||||
return new PageResult(convert, page);
|
||||
}
|
||||
}
|
||||
return new PageResult(new ArrayList<>(), page);
|
||||
WrapperUtils.buildSql(query);
|
||||
List<StoreVO> storeVOS = baseMapper.pageList(query, page);
|
||||
return new PageResult(storeVOS, page);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -83,31 +72,4 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
|
|||
return store;
|
||||
}
|
||||
|
||||
|
||||
private List<StoreVO> convert(List<Store> records){
|
||||
List<StoreVO> storeVOS = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(records)){
|
||||
storeVOS = BeanUtil.copyToList(records, StoreVO.class);
|
||||
Set<Long> taskIds = records.stream().map(Store::getTaskId).collect(Collectors.toSet());
|
||||
Set<Long> lowerTaskIds = records.stream().map(Store::getLowerTaskId).collect(Collectors.toSet());
|
||||
Set<Long> ids = new HashSet<>();
|
||||
ids.addAll(taskIds);
|
||||
ids.addAll(lowerTaskIds);
|
||||
Map<Long, PollingTask> taskMap = new HashMap<>();
|
||||
if (CollectionUtil.isNotEmpty(ids)){
|
||||
List<PollingTask> pollingTasks = taskService.listByIds(ids);
|
||||
taskMap = pollingTasks.stream().collect(Collectors.toMap(PollingTask::getId, pollingTask -> pollingTask));
|
||||
}
|
||||
for (StoreVO record : storeVOS) {
|
||||
PollingTask pollingTask = taskMap.get(record.getTaskId());
|
||||
PollingTask lowedPollingTask = taskMap.get(record.getLowerTaskId());
|
||||
if (ObjectUtil.isNotEmpty(lowedPollingTask))
|
||||
record.setTaskName(lowedPollingTask.getName());
|
||||
if (ObjectUtil.isNotEmpty(pollingTask))
|
||||
record.setTotalTaskName(pollingTask.getName());
|
||||
}
|
||||
}
|
||||
return storeVOS;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class WrkInfoController {
|
|||
@RequiresPermissions("wrk:reviewed:page")
|
||||
public AjaxResult queryToDeReviewedPage(@Validated ReviewedQuery query)
|
||||
{
|
||||
Integer wrkStatus = query.getWrkStatus();
|
||||
int wrkStatus = query.getWrkStatus();
|
||||
List<Integer> status = new ArrayList<>();
|
||||
// 待初审
|
||||
if (2 == wrkStatus){
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ spring:
|
|||
servlet:
|
||||
multipart:
|
||||
# 修改上传文件临时路径为 /data1/tmp
|
||||
location: /data1/tmp
|
||||
location: /Users/zhaowenyuan/Downloads/tmp
|
||||
max-file-size: 100MB
|
||||
max-request-size: 100MB
|
||||
application:
|
||||
|
|
@ -31,7 +31,7 @@ spring:
|
|||
url: jdbc:mysql://${config.jdbc.master.inspection.host}:${config.jdbc.master.inspection.port}/${config.jdbc.master.inspection.database}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
|
||||
hikari:
|
||||
# 最大线程池数量
|
||||
maximum-pool-size: 30
|
||||
maximum-pool-size: 50
|
||||
# 最小线程池数量
|
||||
minimum-idle: 5
|
||||
# 检测连接
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ spring:
|
|||
discovery:
|
||||
server-addr: ${spring.cloud.nacos.server-addr}
|
||||
namespace: ${nacos.namespace}
|
||||
group: local
|
||||
group: ${nacos.group}
|
||||
service: ${spring.application.name}
|
||||
config:
|
||||
server-addr: ${spring.cloud.nacos.server-addr}
|
||||
|
|
|
|||
|
|
@ -19,79 +19,21 @@
|
|||
s.legal_name AS legalName,
|
||||
s.create_by AS createBy,
|
||||
s.create_time AS createTime,
|
||||
s.dept_id AS deptId,
|
||||
s.state AS storeStatus,
|
||||
pt1.`name` AS taskName,
|
||||
pt2.`name` AS totalTaskName
|
||||
pt2.`name` AS totalTaskName,
|
||||
(select COUNT(*) from st_terminal where s.del_state = 0 AND s.store_id = store_id) AS countTerminal
|
||||
FROM `st_store` s
|
||||
LEFT JOIN ta_polling_task pt1 ON s.task_id = pt1.id
|
||||
LEFT JOIN ta_polling_task pt2 ON s.lower_task_id = pt2.id
|
||||
LEFT JOIN st_terminal t ON s.store_id = t.store_id
|
||||
WHERE s.del_state = 0
|
||||
<if test="query.storeId != null">
|
||||
AND s.store_id = #{query.storeId}
|
||||
</if>
|
||||
<if test="query.storeIds != null and query.storeIds.size() > 0">
|
||||
AND s.store_id IN
|
||||
<foreach collection="query.storeIds" open="(" close=")" separator="," item="storeId">
|
||||
#{storeId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="query.storeNo != null">
|
||||
AND s.store_no = #{query.storeNo}
|
||||
</if>
|
||||
<if test="query.terminalNo != null">
|
||||
AND t.terminal_no = #{query.terminalNo}
|
||||
</if>
|
||||
|
||||
<if test="query.taskId != null">
|
||||
AND s.task_id = #{query.taskId}
|
||||
</if>
|
||||
<if test="query.lowerTaskIds != null and query.lowerTaskIds.size() > 0">
|
||||
AND s.lower_task_id IN
|
||||
<foreach collection="query.lowerTaskIds" open="(" close=")" separator="," item="lowerTaskId">
|
||||
#{lowerTaskId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="query.state != null">
|
||||
AND s.state = #{query.state}
|
||||
</if>
|
||||
|
||||
<if test="query.occupy != null">
|
||||
AND t.occupy = #{query.occupy}
|
||||
</if>
|
||||
<if test="query.terminalSn != null">
|
||||
AND t.terminal_sn = #{query.terminalSn}
|
||||
</if>
|
||||
<if test="query.storeName != null and query.storeName != ''">
|
||||
AND s.store_name like concat('%', #{query.storeName}, '%')
|
||||
</if>
|
||||
<if test="query.storeContact != null and query.storeContact != ''">
|
||||
AND s.store_contact like concat('%', #{query.storeContact}, '%')
|
||||
</if>
|
||||
<if test="query.storePhone != null and query.storePhone != ''">
|
||||
AND s.store_phone like concat('%', #{query.storePhone}, '%')
|
||||
</if>
|
||||
|
||||
<if test="query.storeAddress != null and query.storeAddress != ''">
|
||||
AND s.store_address like concat('%', #{query.storeAddress}, '%')
|
||||
</if>
|
||||
<if test="query.specialNum != null and query.specialNum != ''">
|
||||
AND s.special_num like concat('%', #{query.specialNum}, '%')
|
||||
</if>
|
||||
<if test="query.shopName != null and query.shopName != ''">
|
||||
AND s.shop_name like concat('%', #{query.shopName}, '%')
|
||||
</if>
|
||||
<if test="query.startTime != null">
|
||||
AND s.create_time >= #{query.startTime}
|
||||
</if>
|
||||
<if test="query.endTime != null">
|
||||
AND s.create_time <= #{query.endTime}
|
||||
</if>
|
||||
<if test="query.createTime != null and query.createTime.size() > 0">
|
||||
AND s.create_time BETWEEN #{query.createTime[0]}
|
||||
AND #{query.createTime[1]}
|
||||
<if test="1 == 1">
|
||||
${query.sqlParam.get('sqlWhere')}
|
||||
</if>
|
||||
<if test="1 == 1">
|
||||
${query.sqlParam.get('dataScpoe')}
|
||||
${query.sqlParam.get('dataScope')}
|
||||
</if>
|
||||
ORDER BY #{query.orderBy} #{query.isAsc}
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -60,6 +60,9 @@
|
|||
<if test="1 == 1">
|
||||
${query.sqlParam.get('sqlWhere')}
|
||||
</if>
|
||||
<if test="1 == 1">
|
||||
${query.sqlParam.get('dataScope')}
|
||||
</if>
|
||||
ORDER BY #{query.orderBy} #{query.isAsc}
|
||||
</select>
|
||||
<sql id="selectStoreTerminalSql">
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@
|
|||
<if test="1 == 1">
|
||||
${query.sqlParam.get('sqlWhere')}
|
||||
</if>
|
||||
<if test="1 == 1">
|
||||
${query.sqlParam.get('dataScope')}
|
||||
</if>
|
||||
ORDER BY i.create_time desc
|
||||
</select>
|
||||
|
||||
|
|
@ -14,6 +17,9 @@
|
|||
<if test="1 == 1">
|
||||
${query.sqlParam.get('sqlWhere')}
|
||||
</if>
|
||||
<if test="1 == 1">
|
||||
${query.sqlParam.get('dataScope')}
|
||||
</if>
|
||||
ORDER BY i.create_time desc
|
||||
</select>
|
||||
<resultMap id="resultWrkInfoExportVO" type="com.chushang.inspection.work.vo.WrkInfoExportVO">
|
||||
|
|
@ -33,6 +39,9 @@
|
|||
<if test="1 == 1">
|
||||
${query.sqlParam.get('sqlWhere')}
|
||||
</if>
|
||||
<if test="1 == 1">
|
||||
${query.sqlParam.get('dataScope')}
|
||||
</if>
|
||||
ORDER BY i.create_time desc
|
||||
</select>
|
||||
|
||||
|
|
@ -75,6 +84,9 @@
|
|||
<if test="1 == 1">
|
||||
${query.sqlParam.get('sqlWhere')}
|
||||
</if>
|
||||
<if test="1 == 1">
|
||||
${query.sqlParam.get('dataScope')}
|
||||
</if>
|
||||
ORDER BY i.create_time desc
|
||||
</select>
|
||||
<resultMap id="wrkInfoDetailsVOResult" type="com.chushang.inspection.work.vo.WrkInfoDetailsVO">
|
||||
|
|
@ -154,6 +166,9 @@
|
|||
<if test="1 == 1">
|
||||
${query.sqlParam.get('sqlWhere')}
|
||||
</if>
|
||||
<if test="1 == 1">
|
||||
${query.sqlParam.get('dataScope')}
|
||||
</if>
|
||||
ORDER BY i.create_time desc
|
||||
</select>
|
||||
<select id="getWrkInfoDetails" resultMap="wrkInfoDetailsVOResult">
|
||||
|
|
|
|||
|
|
@ -65,6 +65,9 @@
|
|||
<if test="1 == 1">
|
||||
${query.sqlParam.get('sqlWhere')}
|
||||
</if>
|
||||
<if test="1 == 1">
|
||||
${query.sqlParam.get('dataScope')}
|
||||
</if>
|
||||
ORDER BY #{query.orderBy} #{query.isAsc}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
import com.chushang.InspectionApplication;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@Slf4j
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = InspectionApplication.class)
|
||||
public class WrkInfoTest {
|
||||
/**
|
||||
* 商户迁移
|
||||
*/
|
||||
@Test
|
||||
public void storeMigrate(){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 终端迁移
|
||||
*/
|
||||
@Test
|
||||
public void terminalMigrate(){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 工单迁移
|
||||
*/
|
||||
@Test
|
||||
public void wrkMigrate(){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 工单图片迁移
|
||||
*/
|
||||
@Test
|
||||
public void imgMigrate(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -25,7 +25,7 @@ spring:
|
|||
discovery:
|
||||
server-addr: ${spring.cloud.nacos.server-addr}
|
||||
namespace: ${nacos.namespace}
|
||||
group: local
|
||||
group: ${nacos.group}
|
||||
service: ${spring.application.name}
|
||||
config:
|
||||
server-addr: ${spring.cloud.nacos.server-addr}
|
||||
|
|
|
|||
Loading…
Reference in New Issue