1. 五统一商户, 商户
This commit is contained in:
parent
317f6852e0
commit
022f3981b3
|
|
@ -65,6 +65,10 @@ public enum BusinessType
|
|||
* 异常日志
|
||||
*/
|
||||
ERROR(11, "异常日志"),
|
||||
/**
|
||||
* 查询日志
|
||||
*/
|
||||
QUERY(12, "查询"),
|
||||
;
|
||||
private final Integer code;
|
||||
private final String desc;
|
||||
|
|
|
|||
|
|
@ -155,4 +155,9 @@ public class Store extends BaseEntity {
|
|||
*/
|
||||
@TableField(value = "is_enter")
|
||||
private Integer isEnter;
|
||||
/**
|
||||
* 商户状态
|
||||
*/
|
||||
@TableField(value = "state")
|
||||
private Integer state;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,13 +122,6 @@ public class Terminal extends BaseEntity {
|
|||
*/
|
||||
@TableField(value = "terminal_status")
|
||||
private Integer terminalStatus;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@TableField(value = "`state`")
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,142 @@
|
|||
package com.chushang.inspection.terminal.query;
|
||||
|
||||
import com.chushang.common.mybatis.annotation.Condition;
|
||||
import com.chushang.common.mybatis.page.CommonParam;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.*;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class StoreQuery extends CommonParam {
|
||||
|
||||
/**
|
||||
* 商户id
|
||||
*/
|
||||
@Condition(name = "store_id")
|
||||
private Long storeId;
|
||||
|
||||
/**
|
||||
* 商户id列表
|
||||
*/
|
||||
@Condition(name = "store_id", type = Condition.ConditionType.in)
|
||||
private List<Long> storeIds;
|
||||
|
||||
/**
|
||||
* 商户编号
|
||||
*/
|
||||
@Condition(name = "store_no")
|
||||
@Size(max = 64, message = "商户编号不能超过64个字符")
|
||||
private String storeNo;
|
||||
|
||||
/**
|
||||
* 终端编号
|
||||
*/
|
||||
@Size(max = 30, message = "终端sn号不能超过30个字符")
|
||||
private String terminalNo;
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
@Condition(name = "task_id")
|
||||
@NotNull(message = "任务id不能为空")
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 下级任务id
|
||||
*/
|
||||
@Condition(name = "lower_task_id", type = Condition.ConditionType.in)
|
||||
private List<Long> lowerTaskIds;
|
||||
|
||||
/**
|
||||
* 商户状态
|
||||
*/
|
||||
@Condition(name = "state")
|
||||
@Range(min = 0, max = 10, message = "商户状态格式错误")
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 是否占用
|
||||
*/
|
||||
@Range(min = 0, max = 1, message = "占用状态格式错误")
|
||||
private Integer occupy;
|
||||
|
||||
/**
|
||||
* 终端sn号
|
||||
*/
|
||||
@Size(max = 100, message = "终端sn号不能超过100个字符")
|
||||
private String terminalSn;
|
||||
|
||||
/**
|
||||
* 商户名称
|
||||
*/
|
||||
@Condition(name = "store_name", type = Condition.ConditionType.like)
|
||||
@Size(max = 128, message = "商户名称不能超过128个字符")
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 商户联系人
|
||||
*/
|
||||
@Condition(name = "store_contact", type = Condition.ConditionType.like)
|
||||
@Size(max = 128, message = "商户联系人不能超过128个字符")
|
||||
private String storeContact;
|
||||
|
||||
/**
|
||||
* 商户联系方式
|
||||
*/
|
||||
@Condition(name = "store_phone", type = Condition.ConditionType.like)
|
||||
@Size(max = 50, message = "商户联系方式不能超过50个字符")
|
||||
private String storePhone;
|
||||
|
||||
/**
|
||||
* 商户地址
|
||||
*/
|
||||
@Condition(name = "store_address", type = Condition.ConditionType.like)
|
||||
@Size(max = 300, message = "商户地址不能超过300个字符")
|
||||
private String storeAddress;
|
||||
|
||||
/**
|
||||
* 特殊商户编号
|
||||
*/
|
||||
@Condition(name = "special_num", type = Condition.ConditionType.like)
|
||||
@Size(max = 30, message = "特殊商户编号不能超过30个字符")
|
||||
private String specialNum;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Condition(name = "create_time", type = Condition.ConditionType.between)
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private List<LocalDateTime> createTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 门店名称
|
||||
*/
|
||||
@Condition(name = "shop_name", type = Condition.ConditionType.like)
|
||||
@Size(max = 128, message = "门店名称不能超过128个字符")
|
||||
private String shopName;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
package com.chushang.inspection.terminal.query;
|
||||
|
||||
import com.chushang.common.mybatis.annotation.Condition;
|
||||
import com.chushang.common.mybatis.page.CommonParam;
|
||||
import lombok.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class TerminalAppQuery extends CommonParam {
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
@Condition(name = "task_id")
|
||||
@NotNull(message = "任务id不能为空")
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 商户编号
|
||||
*/
|
||||
@Condition(name = "no")
|
||||
@Size(max = 64, message = "商户编号不能超过64个字符")
|
||||
private String storeNo;
|
||||
|
||||
/**
|
||||
* 终端编号
|
||||
*/
|
||||
@Condition(name = "terminal_no")
|
||||
@Size(max = 30, message = "终端编号不能超过30个字符")
|
||||
private String terminalNo;
|
||||
|
||||
/**
|
||||
* 终端编号
|
||||
*/
|
||||
@Condition(name = "terminal_sn")
|
||||
@Size(max = 100, message = "终端sn号不能超过100个字符")
|
||||
private String terminalSn;
|
||||
|
||||
/**
|
||||
* 终端地址
|
||||
*/
|
||||
@Condition(name = "terminal_address", type = Condition.ConditionType.like)
|
||||
@Size(max = 300, message = "终端地址号不能超过300个字符")
|
||||
private String terminalAddress;
|
||||
|
||||
/**
|
||||
* 是否占用(内部使用 不需要传)
|
||||
*/
|
||||
@Builder.Default
|
||||
@Condition(name = "occupy")
|
||||
private Integer occupy = 0;
|
||||
|
||||
/**
|
||||
* 状态(内部使用 不需要传)
|
||||
*/
|
||||
@Builder.Default
|
||||
@Condition(name = "state")
|
||||
private Integer storeState = 1;
|
||||
|
||||
/**
|
||||
* 门店名称
|
||||
*/
|
||||
@Size(max = 128, message = "门店名称不能超过128个字符")
|
||||
private String shopName;
|
||||
|
||||
/**
|
||||
* 下级任务名称
|
||||
*/
|
||||
@Size(max = 64, message = "下级任务名称不能超过64个字符")
|
||||
private String lowerTaskName;
|
||||
|
||||
/**
|
||||
* 商户名称
|
||||
*/
|
||||
@Size(max = 128, message = "商户名称不能超过128个字符")
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 商户联系人
|
||||
*/
|
||||
@Size(max = 128, message = "商户联系人不能超过128个字符")
|
||||
private String storeContact;
|
||||
|
||||
/**
|
||||
* 商戶地址
|
||||
*/
|
||||
@Size(max = 300, message = "商戶地址不能超过300个字符")
|
||||
private String storeAddress;
|
||||
}
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
package com.chushang.inspection.terminal.query;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import com.chushang.common.mybatis.annotation.Condition;
|
||||
import com.chushang.common.mybatis.page.CommonParam;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.*;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class TerminalQuery extends CommonParam {
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
@NotNull(message = "任务id不能为空")
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 商户编号
|
||||
*/
|
||||
@Size(max = 64, message = "商户编号不能超过64个字符")
|
||||
private String storeNo;
|
||||
|
||||
/**
|
||||
* 终端编号
|
||||
*/
|
||||
@Size(max = 30, message = "终端编号不能超过30个字符")
|
||||
private String terminalNo;
|
||||
|
||||
/**
|
||||
* 终端sn号
|
||||
*/
|
||||
@Size(max = 100, message = "终端sn号不能超过100个字符")
|
||||
private String terminalSn;
|
||||
|
||||
/**
|
||||
* 终端类型
|
||||
*/
|
||||
@Range(min = 1, max = 10, message = "终端类型输入错误")
|
||||
private Integer terminalType;
|
||||
|
||||
/**
|
||||
* 终端来源
|
||||
*/
|
||||
@Range(min = 1, max = 10, message = "终端来源输入错误")
|
||||
private Integer terminalSource;
|
||||
|
||||
/**
|
||||
* 终端版本号
|
||||
*/
|
||||
@Size(max = 64, message = "终端版本号不能超过64个字符")
|
||||
private String terminalVersion;
|
||||
|
||||
/**
|
||||
* 终端地址
|
||||
*/
|
||||
@Size(max = 300, message = "终端版本号不能超过300个字符")
|
||||
private String terminalAddress;
|
||||
|
||||
/**
|
||||
* 终端型号
|
||||
*/
|
||||
@Size(max = 64, message = "终端型号不能超过64个字符")
|
||||
private String terminalModel;
|
||||
|
||||
/**
|
||||
* 下级任务id
|
||||
*/
|
||||
private List<Long> lowerTaskIds;
|
||||
|
||||
/**
|
||||
* 商户名称
|
||||
*/
|
||||
@Size(max = 128, message = "商户名称不能超过128个字符")
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 商户状态
|
||||
*/
|
||||
@Range(min = 1, max = 3, message = "商户状态输入错误")
|
||||
private Integer storeState;
|
||||
|
||||
/**
|
||||
* 巡检状态 1 以巡检 2未巡检
|
||||
*/
|
||||
@Range(min = 1, max = 2, message = "巡检状态输入错误")
|
||||
private Integer inspectionStatus;
|
||||
|
||||
/**
|
||||
* 巡检时间
|
||||
*/
|
||||
@JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
|
||||
private List<LocalDateTime> inspectionTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
|
||||
private List<LocalDateTime> createTimes;
|
||||
}
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
package com.chushang.inspection.terminal.vo;
|
||||
|
||||
import com.chushang.common.dict.annotation.DictFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class StoreVO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long storeId;
|
||||
|
||||
/**
|
||||
* 商户编号
|
||||
*/
|
||||
private String storeNo;
|
||||
|
||||
/**
|
||||
* 商户名称
|
||||
*/
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 商户联系人
|
||||
*/
|
||||
private String storeContact;
|
||||
|
||||
/**
|
||||
* 门店名称
|
||||
*/
|
||||
private String shopName;
|
||||
|
||||
/**
|
||||
* 特殊商户编号
|
||||
*/
|
||||
private String specialNum;
|
||||
|
||||
/**
|
||||
* 商户联系方式
|
||||
*/
|
||||
private String storePhone;
|
||||
|
||||
/**
|
||||
* 商户地址
|
||||
*/
|
||||
private String storeAddress;
|
||||
|
||||
|
||||
private Long lowerTaskId;
|
||||
|
||||
/**
|
||||
* 当前任务名称
|
||||
* lower_task_id
|
||||
*/
|
||||
private String taskName;
|
||||
|
||||
/**
|
||||
* 商户类型
|
||||
*/
|
||||
@DictFormat(dictType = "store_type")
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 现有其他收单产品
|
||||
*/
|
||||
private String products;
|
||||
|
||||
/**
|
||||
* 商户提示工具
|
||||
*/
|
||||
private String tipTool;
|
||||
|
||||
/**
|
||||
* 建档日期
|
||||
*/
|
||||
private LocalDate registerTime;
|
||||
|
||||
/**
|
||||
* 巡检频次
|
||||
*/
|
||||
@DictFormat(dictType = "ins_fre")
|
||||
private Integer insFre;
|
||||
|
||||
/**
|
||||
* 客户经理
|
||||
*/
|
||||
private String accountManager;
|
||||
|
||||
/**
|
||||
* 经理电话
|
||||
*/
|
||||
private String accountPhone;
|
||||
|
||||
private Long taskId;
|
||||
/**
|
||||
* 总任务名
|
||||
* -- taskId
|
||||
*/
|
||||
private String totalTaskName;
|
||||
|
||||
/**
|
||||
* 注册地址
|
||||
*/
|
||||
private String registerAddress;
|
||||
|
||||
/**
|
||||
* 法人/负责人
|
||||
*/
|
||||
private String legalName;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
* -- 创建人
|
||||
*/
|
||||
protected String createBy;
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
protected LocalDateTime createTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,137 @@
|
|||
package com.chushang.inspection.terminal.vo;
|
||||
|
||||
import com.chushang.common.dict.annotation.DictFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TerminalVO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 终端 主键
|
||||
*/
|
||||
private Long terminalId;
|
||||
|
||||
/**
|
||||
* 商户id
|
||||
*/
|
||||
private Long storeId;
|
||||
|
||||
/**
|
||||
* 下级任务id
|
||||
*/
|
||||
private Long lowerTaskId;
|
||||
|
||||
/**
|
||||
* 商户编号
|
||||
*/
|
||||
private String storeNo;
|
||||
|
||||
/**
|
||||
* 商户名称
|
||||
* 查询商户表
|
||||
*/
|
||||
private String storeName;
|
||||
/**
|
||||
* 商户状态
|
||||
*/
|
||||
@DictFormat(dictType = "mer_status")
|
||||
private Integer storeState;
|
||||
|
||||
/**
|
||||
* 终端sn号
|
||||
*/
|
||||
private String terminalSn;
|
||||
|
||||
/**
|
||||
* 终端编号
|
||||
*/
|
||||
private String terminalNo;
|
||||
|
||||
/**
|
||||
* 终端类型
|
||||
*/
|
||||
@DictFormat(dictType = "terminal_type")
|
||||
private Integer terminalType;
|
||||
|
||||
/**
|
||||
* 终端型号
|
||||
*/
|
||||
private String terminalModel;
|
||||
|
||||
/**
|
||||
* 终端版本号
|
||||
*/
|
||||
private String terminalVersion;
|
||||
|
||||
/**
|
||||
* 终端地址
|
||||
*/
|
||||
private String terminalAddress;
|
||||
|
||||
/**
|
||||
* 终端来源
|
||||
*/
|
||||
@DictFormat(dictType = "terminal_source")
|
||||
private Integer terminalSource;
|
||||
|
||||
/**
|
||||
* 是否占用
|
||||
*/
|
||||
private Integer occupy;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@DictFormat(dictType = "terminal_status")
|
||||
private Integer terminalStatus;
|
||||
|
||||
/**
|
||||
* 终端--状态
|
||||
*/
|
||||
@DictFormat(dictType = "mer_status")
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 偏差(直线距离 米)
|
||||
*/
|
||||
private Long deviation;
|
||||
|
||||
/**
|
||||
* 所属任务
|
||||
* 查询任务表
|
||||
*/
|
||||
private String lowerTaskName;
|
||||
|
||||
/**
|
||||
* 操作人
|
||||
*/
|
||||
private String operatorId;
|
||||
|
||||
/**
|
||||
* 巡检状态 1 以巡检 2未巡检
|
||||
*/
|
||||
private Integer inspectionStatus;
|
||||
|
||||
/**
|
||||
* 巡检时间
|
||||
*/
|
||||
private LocalDateTime inspectionTime;
|
||||
|
||||
/**
|
||||
* 巡检时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
|
|
@ -1,6 +1,22 @@
|
|||
package com.chushang.inspection.terminal.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.chushang.common.core.web.AjaxResult;
|
||||
import com.chushang.common.log.annotation.SysLog;
|
||||
import com.chushang.common.log.enums.BusinessType;
|
||||
import com.chushang.inspection.project.dto.Delete;
|
||||
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.StoreVO;
|
||||
import com.chushang.security.annotation.RequiresPermissions;
|
||||
import lombok.extern.java.Log;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 商户信息表(st_store)表控制层
|
||||
|
|
@ -10,4 +26,66 @@ import org.springframework.web.bind.annotation.*;
|
|||
@RestController
|
||||
@RequestMapping("/store")
|
||||
public class StoreController {
|
||||
|
||||
@Resource
|
||||
StoreService storeService;
|
||||
|
||||
/**
|
||||
* 查询商户
|
||||
*
|
||||
* @param query 条件
|
||||
*/
|
||||
@SysLog(value = "查询商户", businessType = BusinessType.QUERY)
|
||||
@PostMapping("/page")
|
||||
@RequiresPermissions("ins:store:page")
|
||||
public AjaxResult pageList(@RequestBody @Validated StoreQuery query) {
|
||||
return AjaxResult.success(storeService.pageList(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商户(内部使用)
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@RequiresPermissions("ins:store:update")
|
||||
@SysLog(value = "商户", businessType = BusinessType.UPDATE)
|
||||
public AjaxResult update(@RequestBody @Validated Store store) {
|
||||
storeService.updateById(store);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询商户
|
||||
*/
|
||||
@SysLog(value = "查询商户", businessType = BusinessType.QUERY)
|
||||
@PostMapping("/info")
|
||||
@RequiresPermissions("ins:store:info")
|
||||
public AjaxResult update(@RequestBody @NotNull(message = "商户id不能为空") Long id) {
|
||||
Store store = storeService.getById(id);
|
||||
return AjaxResult.success(BeanUtil.copyProperties(store, StoreVO.class));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除商户(内部使用)
|
||||
*/
|
||||
@PostMapping("/delete")
|
||||
@RequiresPermissions("ins:store:delete")
|
||||
@SysLog(value = "商户", businessType = BusinessType.DELETE)
|
||||
public AjaxResult delete(@RequestBody @Validated Delete delete) {
|
||||
storeService.removeByIds(delete.getIds());
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 上传 商户门头信息
|
||||
*/
|
||||
@SysLog(value = "商户门头信息", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/upload")
|
||||
@RequiresPermissions("ins:store:upload")
|
||||
public AjaxResult upload(@RequestParam("file") MultipartFile file , @RequestParam("taskId")Long taskId) throws Exception{
|
||||
storeService.upload(file,taskId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,18 @@
|
|||
package com.chushang.inspection.terminal.controller;
|
||||
|
||||
import com.chushang.common.core.web.AjaxResult;
|
||||
import com.chushang.common.log.annotation.SysLog;
|
||||
import com.chushang.common.log.enums.BusinessType;
|
||||
import com.chushang.inspection.terminal.query.TerminalAppQuery;
|
||||
import com.chushang.inspection.terminal.query.TerminalQuery;
|
||||
import com.chushang.inspection.terminal.service.TerminalService;
|
||||
import com.chushang.security.annotation.RequiresPermissions;
|
||||
import lombok.extern.java.Log;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 终端信息表(st_terminal)表控制层
|
||||
*
|
||||
|
|
@ -10,4 +21,33 @@ import org.springframework.web.bind.annotation.*;
|
|||
@RestController
|
||||
@RequestMapping("/terminal")
|
||||
public class TerminalController {
|
||||
|
||||
@Resource
|
||||
TerminalService terminalService;
|
||||
|
||||
/**
|
||||
* 查询终端
|
||||
*
|
||||
* @param query 条件
|
||||
*/
|
||||
@SysLog(value = "终端", businessType = BusinessType.QUERY)
|
||||
@PostMapping("/page")
|
||||
@RequiresPermissions("ins:terminal:page")
|
||||
public AjaxResult pageList(@RequestBody @Validated TerminalQuery query) {
|
||||
return AjaxResult.success(terminalService.pageList(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询终端app
|
||||
*
|
||||
* @param query 条件
|
||||
*/
|
||||
@SysLog(value = "终端app", businessType = BusinessType.QUERY)
|
||||
@PostMapping("/page/app")
|
||||
@RequiresPermissions("terminal:page:app")
|
||||
public AjaxResult queryPageApp(@RequestBody @Validated TerminalAppQuery query) {
|
||||
return AjaxResult.success(terminalService.queryPageApp(query));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,19 @@
|
|||
package com.chushang.inspection.terminal.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.chushang.inspection.terminal.po.Store;
|
||||
import com.chushang.inspection.terminal.query.StoreQuery;
|
||||
import com.chushang.inspection.terminal.vo.StoreVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @auther: zhao
|
||||
* @date: 2024/6/21 16:39
|
||||
*/
|
||||
public interface StoreMapper extends BaseMapper<Store> {
|
||||
List<StoreVO> pageList(@Param("query") StoreQuery query,
|
||||
Page<Store> page);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,22 @@
|
|||
package com.chushang.inspection.terminal.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.chushang.datascope.annotation.DataScope;
|
||||
import com.chushang.inspection.terminal.po.Store;
|
||||
import com.chushang.inspection.terminal.po.Terminal;
|
||||
import com.chushang.inspection.terminal.query.TerminalQuery;
|
||||
import com.chushang.inspection.terminal.vo.TerminalVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @auther: zhao
|
||||
* @date: 2024/6/21 16:39
|
||||
*/
|
||||
public interface TerminalMapper extends BaseMapper<Terminal> {
|
||||
|
||||
List<TerminalVO> pageList(@Param("query") TerminalQuery query,
|
||||
Page<Store> page);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
package com.chushang.inspection.terminal.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.chushang.common.mybatis.utils.PageResult;
|
||||
import com.chushang.inspection.terminal.po.Store;
|
||||
import com.chushang.inspection.terminal.query.StoreQuery;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* @auther: zhao
|
||||
|
|
@ -10,4 +13,7 @@ import com.chushang.inspection.terminal.po.Store;
|
|||
public interface StoreService extends IService<Store>{
|
||||
|
||||
|
||||
PageResult pageList(StoreQuery query);
|
||||
|
||||
void upload(MultipartFile file, Long taskId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,13 @@
|
|||
package com.chushang.inspection.terminal.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.chushang.common.mybatis.utils.PageResult;
|
||||
import com.chushang.inspection.terminal.po.Terminal;
|
||||
import com.chushang.inspection.terminal.query.TerminalAppQuery;
|
||||
import com.chushang.inspection.terminal.query.TerminalQuery;
|
||||
import com.chushang.inspection.terminal.vo.TerminalVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @auther: zhao
|
||||
|
|
@ -9,5 +15,13 @@ import com.chushang.inspection.terminal.po.Terminal;
|
|||
*/
|
||||
public interface TerminalService extends IService<Terminal>{
|
||||
|
||||
/**
|
||||
* 终端列表
|
||||
*/
|
||||
PageResult pageList(TerminalQuery query);
|
||||
|
||||
/**
|
||||
* 查询终端app
|
||||
*/
|
||||
PageResult queryPageApp(TerminalAppQuery query);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,13 @@
|
|||
package com.chushang.inspection.terminal.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.URLUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.chushang.common.core.constant.SecurityConstants;
|
||||
import com.chushang.common.core.util.FileUtils;
|
||||
import com.chushang.common.core.web.Result;
|
||||
import com.chushang.common.excel.utils.ExcelUtils;
|
||||
import com.chushang.common.mybatis.utils.PageResult;
|
||||
import com.chushang.datascope.annotation.DataScope;
|
||||
import com.chushang.inspection.project.po.PollingTask;
|
||||
import com.chushang.inspection.project.service.PollingTaskService;
|
||||
import com.chushang.inspection.terminal.po.FiveStore;
|
||||
|
|
@ -20,7 +16,6 @@ import com.chushang.inspection.terminal.query.FiveUnifiedStoreDetailsQuery;
|
|||
import com.chushang.inspection.terminal.service.FiveStoreService;
|
||||
import com.chushang.inspection.terminal.service.StoreService;
|
||||
import com.chushang.inspection.terminal.vo.FiveStoreVO;
|
||||
import com.chushang.oss.config.UploadConfig;
|
||||
import com.chushang.oss.entity.vo.FileSourceVo;
|
||||
import com.chushang.oss.feign.RemoteOssService;
|
||||
import com.chushang.security.utils.SecurityUtils;
|
||||
|
|
@ -36,7 +31,6 @@ import com.chushang.inspection.terminal.mapper.FiveStoreMapper;
|
|||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,29 @@
|
|||
package com.chushang.inspection.terminal.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.chushang.common.core.util.StringUtils;
|
||||
import com.chushang.common.mybatis.page.CommonParam;
|
||||
import com.chushang.common.mybatis.utils.PageResult;
|
||||
import com.chushang.common.mybatis.utils.WrapperUtils;
|
||||
import com.chushang.datascope.annotation.DataScope;
|
||||
import com.chushang.inspection.project.po.PollingTask;
|
||||
import com.chushang.inspection.project.service.PollingTaskService;
|
||||
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.StoreVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.chushang.inspection.terminal.mapper.StoreMapper;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @auther: zhao
|
||||
|
|
@ -13,4 +32,61 @@ import com.chushang.inspection.terminal.mapper.StoreMapper;
|
|||
@Service
|
||||
public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements StoreService {
|
||||
|
||||
@Resource
|
||||
PollingTaskService taskService;
|
||||
|
||||
|
||||
@Override
|
||||
@DataScope(deptAlias = "s")
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upload(MultipartFile file, Long taskId) {
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,23 @@
|
|||
package com.chushang.inspection.terminal.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.chushang.common.mybatis.page.CommonParam;
|
||||
import com.chushang.common.mybatis.utils.PageResult;
|
||||
import com.chushang.common.mybatis.utils.WrapperUtils;
|
||||
import com.chushang.datascope.annotation.DataScope;
|
||||
import com.chushang.inspection.terminal.po.Store;
|
||||
import com.chushang.inspection.terminal.po.Terminal;
|
||||
import com.chushang.inspection.terminal.query.TerminalAppQuery;
|
||||
import com.chushang.inspection.terminal.query.TerminalQuery;
|
||||
import com.chushang.inspection.terminal.service.TerminalService;
|
||||
import com.chushang.inspection.terminal.vo.TerminalVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.chushang.inspection.terminal.mapper.TerminalMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @auther: zhao
|
||||
* @date: 2024/6/21 16:39
|
||||
|
|
@ -13,4 +25,17 @@ import com.chushang.inspection.terminal.mapper.TerminalMapper;
|
|||
@Service
|
||||
public class TerminalServiceImpl extends ServiceImpl<TerminalMapper, Terminal> implements TerminalService {
|
||||
|
||||
@Override
|
||||
@DataScope(deptAlias = "t")
|
||||
public PageResult pageList(TerminalQuery query) {
|
||||
CommonParam commonParam = CommonParam.buildPageRequest();
|
||||
Page<Store> page = new Page<>(commonParam.getPage(), commonParam.getLimit());
|
||||
List<TerminalVO> terminalVOS = baseMapper.pageList(query, page);
|
||||
return new PageResult(terminalVOS, page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult queryPageApp(TerminalAppQuery query) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,12 +32,109 @@
|
|||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="state" property="state" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
store_id, task_id, lower_task_id, store_no, store_name, store_contact, store_phone,
|
||||
store_address, special_num, shop_name, register_time, store_type, products, tip_tool,
|
||||
admin_id, ins_fre, account_manager, account_phone, register_address, dept_id, legal_name,
|
||||
is_enter, version, del_state, create_by, create_time, update_by, update_time
|
||||
is_enter, version, del_state, create_by, create_time, update_by, update_time,state
|
||||
</sql>
|
||||
|
||||
<select id="pageList" resultType="com.chushang.inspection.terminal.vo.StoreVO">
|
||||
SELECT s.store_id AS storeId,
|
||||
s.store_no AS storeNo,
|
||||
s.store_name AS storeName,
|
||||
s.shop_name AS shopName,
|
||||
s.special_num AS specialNum,
|
||||
s.store_phone AS storePhone,
|
||||
s.store_address AS storeAddress,
|
||||
s.store_type AS storeType,
|
||||
s.products AS products,
|
||||
s.tip_tool AS tipTool,
|
||||
s.register_time AS registerTime,
|
||||
s.account_phone AS accountPhone,
|
||||
s.account_manager AS accountManager,
|
||||
s.register_address AS registerAddress,
|
||||
s.legal_name AS legalName,
|
||||
s.create_by AS createBy,
|
||||
s.create_time AS createTime,
|
||||
pt1.`name` AS taskName,
|
||||
pt2.`name` AS totalTaskName
|
||||
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>
|
||||
<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>
|
||||
<if test="1==1">
|
||||
${query.sqlParam.dataScpoe}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY #{query.orderBy} #{query.isAsc}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -1,58 +1,169 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.chushang.inspection.terminal.mapper.TerminalMapper">
|
||||
<resultMap id="BaseResultMap" type="com.chushang.inspection.terminal.po.Terminal">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table st_terminal-->
|
||||
<id column="terminal_id" jdbcType="BIGINT" property="terminalId" />
|
||||
<result column="dept_id" jdbcType="BIGINT" property="deptId" />
|
||||
<result column="task_id" jdbcType="BIGINT" property="taskId" />
|
||||
<result column="lower_task_id" jdbcType="BIGINT" property="lowerTaskId" />
|
||||
<result column="store_id" jdbcType="BIGINT" property="storeId" />
|
||||
<result column="store_no" jdbcType="VARCHAR" property="storeNo" />
|
||||
<result column="terminal_sn" jdbcType="VARCHAR" property="terminalSn" />
|
||||
<result column="terminal_no" jdbcType="VARCHAR" property="terminalNo" />
|
||||
<result column="terminal_type" jdbcType="TINYINT" property="terminalType" />
|
||||
<result column="terminal_model" jdbcType="VARCHAR" property="terminalModel" />
|
||||
<result column="terminal_version" jdbcType="VARCHAR" property="terminalVersion" />
|
||||
<result column="terminal_address" jdbcType="VARCHAR" property="terminalAddress" />
|
||||
<result column="terminal_source" jdbcType="TINYINT" property="terminalSource" />
|
||||
<result column="terminal_property" jdbcType="TINYINT" property="terminalProperty" />
|
||||
<result column="occupy" jdbcType="BOOLEAN" property="occupy" />
|
||||
<result column="terminal_status" jdbcType="TINYINT" property="terminalStatus" />
|
||||
<result column="state" jdbcType="TINYINT" property="state" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="management_code" jdbcType="VARCHAR" property="managementCode" />
|
||||
<result column="geographic_location" jdbcType="VARCHAR" property="geographicLocation" />
|
||||
<result column="geographic_address" jdbcType="VARCHAR" property="geographicAddress" />
|
||||
<result column="work_location" jdbcType="VARCHAR" property="workLocation" />
|
||||
<result column="work_adderss" jdbcType="VARCHAR" property="workAdderss" />
|
||||
<result column="deviation" jdbcType="BIGINT" property="deviation" />
|
||||
<result column="storage_time" jdbcType="TIMESTAMP" property="storageTime" />
|
||||
<result column="delivery_time" jdbcType="TIMESTAMP" property="deliveryTime" />
|
||||
<result column="reason_for_shipment" jdbcType="TINYINT" property="reasonForShipment" />
|
||||
<result column="operator_id" jdbcType="VARCHAR" property="operatorId" />
|
||||
<result column="precode_encoding" jdbcType="VARCHAR" property="precodeEncoding" />
|
||||
<result column="is_enter" jdbcType="TINYINT" property="isEnter" />
|
||||
<result column="service_result" jdbcType="TINYINT" property="serviceResult" />
|
||||
<result column="times_pass" jdbcType="INTEGER" property="timesPass" />
|
||||
<result column="inspection_status" jdbcType="TINYINT" property="inspectionStatus" />
|
||||
<result column="inspection_time" jdbcType="TIMESTAMP" property="inspectionTime" />
|
||||
<result column="version" jdbcType="BIGINT" property="version" />
|
||||
<result column="del_state" jdbcType="BOOLEAN" property="delState" />
|
||||
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
terminal_id, dept_id, task_id, lower_task_id, store_id, store_no, terminal_sn, terminal_no,
|
||||
terminal_type, terminal_model, terminal_version, terminal_address, terminal_source,
|
||||
terminal_property, occupy, terminal_status, `state`, remark, management_code, geographic_location,
|
||||
geographic_address, work_location, work_adderss, deviation, storage_time, delivery_time,
|
||||
reason_for_shipment, operator_id, precode_encoding, is_enter, service_result, times_pass,
|
||||
inspection_status, inspection_time, version, del_state, create_by, create_time, update_by,
|
||||
update_time
|
||||
</sql>
|
||||
<resultMap id="BaseResultMap" type="com.chushang.inspection.terminal.po.Terminal">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table st_terminal-->
|
||||
<id column="terminal_id" jdbcType="BIGINT" property="terminalId"/>
|
||||
<result column="dept_id" jdbcType="BIGINT" property="deptId"/>
|
||||
<result column="task_id" jdbcType="BIGINT" property="taskId"/>
|
||||
<result column="lower_task_id" jdbcType="BIGINT" property="lowerTaskId"/>
|
||||
<result column="store_id" jdbcType="BIGINT" property="storeId"/>
|
||||
<result column="store_no" jdbcType="VARCHAR" property="storeNo"/>
|
||||
<result column="terminal_sn" jdbcType="VARCHAR" property="terminalSn"/>
|
||||
<result column="terminal_no" jdbcType="VARCHAR" property="terminalNo"/>
|
||||
<result column="terminal_type" jdbcType="TINYINT" property="terminalType"/>
|
||||
<result column="terminal_model" jdbcType="VARCHAR" property="terminalModel"/>
|
||||
<result column="terminal_version" jdbcType="VARCHAR" property="terminalVersion"/>
|
||||
<result column="terminal_address" jdbcType="VARCHAR" property="terminalAddress"/>
|
||||
<result column="terminal_source" jdbcType="TINYINT" property="terminalSource"/>
|
||||
<result column="terminal_property" jdbcType="TINYINT" property="terminalProperty"/>
|
||||
<result column="occupy" jdbcType="BOOLEAN" property="occupy"/>
|
||||
<result column="terminal_status" jdbcType="TINYINT" property="terminalStatus"/>
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark"/>
|
||||
<result column="management_code" jdbcType="VARCHAR" property="managementCode"/>
|
||||
<result column="geographic_location" jdbcType="VARCHAR" property="geographicLocation"/>
|
||||
<result column="geographic_address" jdbcType="VARCHAR" property="geographicAddress"/>
|
||||
<result column="work_location" jdbcType="VARCHAR" property="workLocation"/>
|
||||
<result column="work_adderss" jdbcType="VARCHAR" property="workAddress"/>
|
||||
<result column="deviation" jdbcType="BIGINT" property="deviation"/>
|
||||
<result column="storage_time" jdbcType="TIMESTAMP" property="storageTime"/>
|
||||
<result column="delivery_time" jdbcType="TIMESTAMP" property="deliveryTime"/>
|
||||
<result column="reason_for_shipment" jdbcType="TINYINT" property="reasonForShipment"/>
|
||||
<result column="operator_id" jdbcType="VARCHAR" property="operatorId"/>
|
||||
<result column="precode_encoding" jdbcType="VARCHAR" property="preCodeEncoding"/>
|
||||
<result column="is_enter" jdbcType="TINYINT" property="isEnter"/>
|
||||
<result column="service_result" jdbcType="TINYINT" property="serviceResult"/>
|
||||
<result column="times_pass" jdbcType="INTEGER" property="timesPass"/>
|
||||
<result column="inspection_status" jdbcType="TINYINT" property="inspectionStatus"/>
|
||||
<result column="inspection_time" jdbcType="TIMESTAMP" property="inspectionTime"/>
|
||||
<result column="version" jdbcType="BIGINT" property="version"/>
|
||||
<result column="del_state" jdbcType="BOOLEAN" property="delState"/>
|
||||
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
terminal_id,
|
||||
dept_id,
|
||||
task_id,
|
||||
lower_task_id,
|
||||
store_id,
|
||||
store_no,
|
||||
terminal_sn,
|
||||
terminal_no,
|
||||
terminal_type,
|
||||
terminal_model,
|
||||
terminal_version,
|
||||
terminal_address,
|
||||
terminal_source,
|
||||
terminal_property,
|
||||
occupy,
|
||||
terminal_status,
|
||||
remark,
|
||||
management_code,
|
||||
geographic_location,
|
||||
geographic_address,
|
||||
work_location,
|
||||
work_adderss,
|
||||
deviation,
|
||||
storage_time,
|
||||
delivery_time,
|
||||
reason_for_shipment,
|
||||
operator_id,
|
||||
precode_encoding,
|
||||
is_enter,
|
||||
service_result,
|
||||
times_pass,
|
||||
inspection_status,
|
||||
inspection_time,
|
||||
version,
|
||||
del_state,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
</sql>
|
||||
|
||||
<select id="pageList" resultType="com.chushang.inspection.terminal.vo.TerminalVO">
|
||||
SELECT t.store_id AS storeId,
|
||||
t.store_no AS storeNo,
|
||||
s.state AS storeState,
|
||||
s.store_name AS storeName,
|
||||
t.inspection_status AS inspectionStatus,
|
||||
t.inspection_time AS inspectionTime,
|
||||
t.terminal_id AS terminalId,
|
||||
t.terminal_no AS terminalNo,
|
||||
t.terminal_sn AS terminalSn,
|
||||
t.terminal_type As terminalType,
|
||||
t.terminal_model AS terminalModel,
|
||||
t.terminal_version AS terminalVersion,
|
||||
t.terminal_address AS terminalAddress,
|
||||
t.occupy,
|
||||
t.create_time AS createTime,
|
||||
t.terminal_status AS terminalStatus,
|
||||
t.deviation AS deviation,
|
||||
-- 操作人
|
||||
t.operator_id AS operatorId,
|
||||
t.lower_task_id AS lowerTaskId,
|
||||
t.dept_id AS deptId
|
||||
FROM st_terminal t
|
||||
LEFT JOIN st_store s ON t.store_id = s.store_id
|
||||
<where>
|
||||
<if test="query.taskId != null">
|
||||
AND t.task_id = #{query.taskId}
|
||||
</if>
|
||||
<if test="query.storeNo != null">
|
||||
AND t.store_no = #{query.storeNo}
|
||||
</if>
|
||||
<if test="query.terminalNo != null">
|
||||
AND t.terminal_no = #{query.terminalNo}
|
||||
</if>
|
||||
<if test="query.terminalSn != null">
|
||||
AND t.terminal_sn = #{query.terminalSn}
|
||||
</if>
|
||||
<if test="query.terminalType != null">
|
||||
AND t.terminal_type = #{query.terminalType}
|
||||
</if>
|
||||
<if test="query.terminalSource != null">
|
||||
AND t.terminal_source = #{query.terminalSource}
|
||||
</if>
|
||||
<if test="query.terminalVersion != null">
|
||||
AND t.terminal_version = #{query.terminalVersion}
|
||||
</if>
|
||||
<if test="query.terminalAddress != null and query.terminalAddress != ''">
|
||||
AND t.terminal_address like concat('%', #{query.terminalAddress}, '%')
|
||||
</if>
|
||||
<if test="query.terminalModel != null and query.terminalModel != ''">
|
||||
AND t.terminal_model like concat('%', #{query.terminalModel}, '%')
|
||||
</if>
|
||||
<if test="query.lowerTaskIds != null and query.lowerTaskIds.size() > 0">
|
||||
AND t.lower_task_id IN
|
||||
<foreach collection="query.lowerTaskIds" item="lowerTaskId" open="(" close=")" separator=",">
|
||||
#{lowerTaskId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="query.storeName != null and query.storeName != ''">
|
||||
AND s.store_name like concat('%', #{query.storeName}, '%')
|
||||
</if>
|
||||
<if test="query.storeState != null ">
|
||||
AND s.state = #{query.storeState}
|
||||
</if>
|
||||
<if test="query.inspectionStatus != null ">
|
||||
AND t.inspection_status = #{query.inspectionStatus}
|
||||
</if>
|
||||
<if test="query.createTimes != null and query.createTimes.size() > 0">
|
||||
AND t.create_time BETWEEN #{query.createTimes[0]} AND #{query.createTimes[1]}
|
||||
</if>
|
||||
<if test="query.inspectionTime != null and query.inspectionTime.size() > 0">
|
||||
AND t.inspection_time BETWEEN #{query.inspectionTime[0]} AND #{query.inspectionTime[1]}
|
||||
</if>
|
||||
<if test="1==1">
|
||||
${query.sqlParam.get('dataScope')}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY #{query.orderBy} #{query.isAsc}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ spring:
|
|||
discovery:
|
||||
server-addr: ${spring.cloud.nacos.server-addr}
|
||||
namespace: ${nacos.namespace}
|
||||
group: ${nacos.group}
|
||||
group: local
|
||||
service: ${spring.application.name}
|
||||
config:
|
||||
server-addr: ${spring.cloud.nacos.server-addr}
|
||||
|
|
|
|||
Loading…
Reference in New Issue