终端商户池
This commit is contained in:
parent
e4c6ec92c8
commit
f54159e492
|
|
@ -0,0 +1,60 @@
|
||||||
|
package com.chushang.inspection.terminal.query;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.ListUtil;
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.validator.constraints.Range;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class DispatchQuery implements Serializable {
|
||||||
|
|
||||||
|
/** 终端id */
|
||||||
|
private List<Long> ids;
|
||||||
|
|
||||||
|
/** 任务id */
|
||||||
|
@NotNull(message = "必须指定任务")
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
/** 业务员id */
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/** 工单类型 */
|
||||||
|
@NotNull(message = "必须指定工单类型")
|
||||||
|
@Range(min = 1, max = 50, message = "工单类型非法")
|
||||||
|
private Integer workType;
|
||||||
|
|
||||||
|
/** 截至时间 */
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DatePattern.NORM_DATETIME_PATTERN)
|
||||||
|
private LocalDateTime endTime;
|
||||||
|
|
||||||
|
/** 工单优先级 */
|
||||||
|
private Integer workSort ;
|
||||||
|
|
||||||
|
/** 备注 */
|
||||||
|
@Size(max = 100, message = "备注不能超过100个字符")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/** 工单来源 */
|
||||||
|
@Range(min = 1, max = 4, message = "工单来源非法")
|
||||||
|
private Integer workSource;
|
||||||
|
|
||||||
|
/** 商户号 */
|
||||||
|
private List<String> nos ;
|
||||||
|
|
||||||
|
/** 终端号 */
|
||||||
|
private List<String> terminalNos ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -19,6 +19,8 @@ public class TerminalVO implements Serializable {
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 终端 主键
|
* 终端 主键
|
||||||
*/
|
*/
|
||||||
|
|
@ -34,6 +36,11 @@ public class TerminalVO implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Long lowerTaskId;
|
private Long lowerTaskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务名称
|
||||||
|
*/
|
||||||
|
private String pollingName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商户编号
|
* 商户编号
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
package com.chushang.inspection.terminal.controller;
|
package com.chushang.inspection.terminal.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.chushang.common.core.web.AjaxResult;
|
import com.chushang.common.core.web.AjaxResult;
|
||||||
import com.chushang.common.log.annotation.SysLog;
|
import com.chushang.common.log.annotation.SysLog;
|
||||||
import com.chushang.common.log.enums.BusinessType;
|
import com.chushang.common.log.enums.BusinessType;
|
||||||
|
import com.chushang.inspection.project.po.PollingTaskAutograph;
|
||||||
|
import com.chushang.inspection.terminal.po.Terminal;
|
||||||
import com.chushang.inspection.terminal.query.TerminalAppQuery;
|
import com.chushang.inspection.terminal.query.TerminalAppQuery;
|
||||||
import com.chushang.inspection.terminal.query.TerminalQuery;
|
import com.chushang.inspection.terminal.query.TerminalQuery;
|
||||||
import com.chushang.inspection.terminal.service.TerminalService;
|
import com.chushang.inspection.terminal.service.TerminalService;
|
||||||
|
|
@ -56,7 +59,7 @@ public class TerminalController {
|
||||||
* TODO 需要查询 st_terminal_ins 表
|
* TODO 需要查询 st_terminal_ins 表
|
||||||
*/
|
*/
|
||||||
@SysLog(value = "终端详情", businessType = BusinessType.QUERY)
|
@SysLog(value = "终端详情", businessType = BusinessType.QUERY)
|
||||||
@PostMapping("/info/{terminalId}")
|
@GetMapping("/info/{terminalId}")
|
||||||
@RequiresPermissions("terminal:info")
|
@RequiresPermissions("terminal:info")
|
||||||
public AjaxResult info(@PathVariable Long terminalId) {
|
public AjaxResult info(@PathVariable Long terminalId) {
|
||||||
return AjaxResult.success(terminalService.getById(terminalId));
|
return AjaxResult.success(terminalService.getById(terminalId));
|
||||||
|
|
@ -71,9 +74,34 @@ public class TerminalController {
|
||||||
@RequiresPermissions("terminal:info:app")
|
@RequiresPermissions("terminal:info:app")
|
||||||
public AjaxResult infoApp(@PathVariable Long terminalId,
|
public AjaxResult infoApp(@PathVariable Long terminalId,
|
||||||
@RequestParam("taskId") Long taskId) {
|
@RequestParam("taskId") Long taskId) {
|
||||||
|
|
||||||
return AjaxResult.success(terminalService.getAppById(terminalId, taskId));
|
return AjaxResult.success(terminalService.getAppById(terminalId, taskId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改 -内改终端
|
||||||
|
* @param query 条件
|
||||||
|
*/
|
||||||
|
@SysLog(value = "修改终端", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/update")
|
||||||
|
@RequiresPermissions("ins:terminal:update")
|
||||||
|
public AjaxResult update(@RequestBody @Validated TerminalQuery query) {
|
||||||
|
Terminal terminal = BeanUtil.copyProperties(query, Terminal.class);
|
||||||
|
return AjaxResult.success(terminalService.updateById(terminal));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 派单-批量派单
|
||||||
|
* @param query 条件
|
||||||
|
*/
|
||||||
|
@SysLog(value = "派单-批量派单", businessType = BusinessType.OTHER)
|
||||||
|
@PostMapping("/dispatch/app")
|
||||||
|
@RequiresPermissions("ins:terminal:dispatch")
|
||||||
|
public AjaxResult dispatch(@RequestBody @Validated TerminalQuery query) {
|
||||||
|
Terminal terminal = BeanUtil.copyProperties(query, Terminal.class);
|
||||||
|
// terminalService.dispatch(terminal)
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,4 +23,11 @@ public interface TerminalMapper extends BaseMapper<Terminal> {
|
||||||
Page<TerminalVO> page);
|
Page<TerminalVO> page);
|
||||||
@DataScope(deptAlias = "t")
|
@DataScope(deptAlias = "t")
|
||||||
List<TerminalAppVO> selectPageApp(@Param("query") TerminalAppQuery query, Page<TerminalAppVO> page);
|
List<TerminalAppVO> selectPageApp(@Param("query") TerminalAppQuery query, Page<TerminalAppVO> page);
|
||||||
|
|
||||||
|
|
||||||
|
List<TerminalVO> getStoreByTasKIdOrIds(@Param("taskId")Long taskId,
|
||||||
|
@Param("ids")List<Long> ids,
|
||||||
|
@Param("nos")List<String> nos,
|
||||||
|
@Param("terminalNos")List<String> terminalNos,
|
||||||
|
@Param("i")int i);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.chushang.common.mybatis.utils.PageResult;
|
import com.chushang.common.mybatis.utils.PageResult;
|
||||||
import com.chushang.inspection.project.vo.TerminalApp;
|
import com.chushang.inspection.project.vo.TerminalApp;
|
||||||
import com.chushang.inspection.terminal.po.Terminal;
|
import com.chushang.inspection.terminal.po.Terminal;
|
||||||
|
import com.chushang.inspection.terminal.query.DispatchQuery;
|
||||||
import com.chushang.inspection.terminal.query.TerminalAppQuery;
|
import com.chushang.inspection.terminal.query.TerminalAppQuery;
|
||||||
import com.chushang.inspection.terminal.query.TerminalQuery;
|
import com.chushang.inspection.terminal.query.TerminalQuery;
|
||||||
import com.chushang.inspection.terminal.vo.TerminalVO;
|
import com.chushang.inspection.terminal.vo.TerminalVO;
|
||||||
|
import com.chushang.inspection.work.po.WrkInfo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -33,4 +35,12 @@ public interface TerminalService extends IService<Terminal>{
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
TerminalApp getAppById(Long terminalId, Long taskId);
|
TerminalApp getAppById(Long terminalId, Long taskId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 派单 id
|
||||||
|
* @param query
|
||||||
|
* @param i
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<WrkInfo> dispatch(DispatchQuery query, int i);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,15 @@ import com.chushang.inspection.project.vo.TerminalApp;
|
||||||
import com.chushang.inspection.project.vo.TerminalAppVO;
|
import com.chushang.inspection.project.vo.TerminalAppVO;
|
||||||
import com.chushang.inspection.terminal.po.Store;
|
import com.chushang.inspection.terminal.po.Store;
|
||||||
import com.chushang.inspection.terminal.po.Terminal;
|
import com.chushang.inspection.terminal.po.Terminal;
|
||||||
|
import com.chushang.inspection.terminal.query.DispatchQuery;
|
||||||
import com.chushang.inspection.terminal.query.TerminalAppQuery;
|
import com.chushang.inspection.terminal.query.TerminalAppQuery;
|
||||||
import com.chushang.inspection.terminal.query.TerminalQuery;
|
import com.chushang.inspection.terminal.query.TerminalQuery;
|
||||||
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.service.TerminalService;
|
||||||
import com.chushang.inspection.terminal.vo.TerminalVO;
|
import com.chushang.inspection.terminal.vo.TerminalVO;
|
||||||
import com.chushang.inspection.utils.TaskConfigUtils;
|
import com.chushang.inspection.utils.TaskConfigUtils;
|
||||||
|
import com.chushang.inspection.work.po.WrkInfo;
|
||||||
|
import com.sun.xml.bind.v2.TODO;
|
||||||
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.TerminalMapper;
|
import com.chushang.inspection.terminal.mapper.TerminalMapper;
|
||||||
|
|
@ -73,4 +76,12 @@ public class TerminalServiceImpl extends ServiceImpl<TerminalMapper, Terminal> i
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WrkInfo> dispatch(DispatchQuery query, int i) {
|
||||||
|
// TODO 先关联终端和商户查询出来要派单的终端信息 然后通过派单方式走不同的策略拼接wrk_entity实体
|
||||||
|
// 落入wrk_info表 然后修改终端占用 终端进度表没啥用
|
||||||
|
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
<if test="query.firstLevelBranch != null">
|
<if test="query.firstLevelBranch != null">
|
||||||
AND fs.first_level_branch = #{query.firstLevelBranch}
|
AND fs.first_level_branch = #{query.firstLevelBranch}
|
||||||
</if>
|
</if>
|
||||||
<if test="query.secondaryBranches != null AND query.secondaryBranches.size > 0 ">
|
<if test="query.secondaryBranches != null AND query.secondaryBranches.size() > 0 ">
|
||||||
AND fs.secondary_branches IN
|
AND fs.secondary_branches IN
|
||||||
<foreach collection="query.secondaryBranches" item="item" index="index" open="(" close=")" separator=",">
|
<foreach collection="query.secondaryBranches" item="item" index="index" open="(" close=")" separator=",">
|
||||||
#{item}
|
#{item}
|
||||||
|
|
|
||||||
|
|
@ -88,12 +88,11 @@
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="pageList" resultType="com.chushang.inspection.terminal.vo.TerminalVO">
|
<select id="pageList" resultType="com.chushang.inspection.terminal.vo.TerminalVO">
|
||||||
SELECT t.store_id AS storeId,
|
SELECT
|
||||||
t.store_no AS storeNo,
|
|
||||||
s.state AS storeState,
|
s.state AS storeState,
|
||||||
s.store_name AS storeName,
|
s.store_name AS storeName,
|
||||||
t.inspection_status AS inspectionStatus,
|
t.store_id AS storeId,
|
||||||
t.inspection_time AS inspectionTime,
|
t.store_no AS storeNo,
|
||||||
t.terminal_id AS terminalId,
|
t.terminal_id AS terminalId,
|
||||||
t.terminal_no AS terminalNo,
|
t.terminal_no AS terminalNo,
|
||||||
t.terminal_sn AS terminalSn,
|
t.terminal_sn AS terminalSn,
|
||||||
|
|
@ -104,13 +103,17 @@
|
||||||
t.occupy,
|
t.occupy,
|
||||||
t.create_time AS createTime,
|
t.create_time AS createTime,
|
||||||
t.terminal_status AS terminalStatus,
|
t.terminal_status AS terminalStatus,
|
||||||
t.deviation AS deviation,
|
|
||||||
-- 操作人
|
|
||||||
t.operator_id AS operatorId,
|
|
||||||
t.lower_task_id AS lowerTaskId,
|
t.lower_task_id AS lowerTaskId,
|
||||||
t.dept_id AS deptId
|
t.dept_id AS deptId,
|
||||||
|
ts.inspection_status as inspectionStatus,
|
||||||
|
ts.deviation AS deviation,
|
||||||
|
ts.admin_id AS operatorId,
|
||||||
|
ts.inspection_time AS inspectionTime,
|
||||||
|
t3.name pollingName
|
||||||
FROM st_terminal t
|
FROM st_terminal t
|
||||||
LEFT JOIN st_store s ON t.store_id = s.store_id
|
LEFT JOIN st_store s ON t.store_id = s.store_id
|
||||||
|
LEFT JOIN st_terminal_ins ts on t.terminal_id = ts.terminal_id
|
||||||
|
LEFT JOIN ta_polling_task t3 on t3.id = t.task_id
|
||||||
<where>
|
<where>
|
||||||
<if test="query.taskId != null">
|
<if test="query.taskId != null">
|
||||||
AND t.task_id = #{query.taskId}
|
AND t.task_id = #{query.taskId}
|
||||||
|
|
@ -152,13 +155,13 @@
|
||||||
AND s.state = #{query.storeState}
|
AND s.state = #{query.storeState}
|
||||||
</if>
|
</if>
|
||||||
<if test="query.inspectionStatus != null ">
|
<if test="query.inspectionStatus != null ">
|
||||||
AND t.inspection_status = #{query.inspectionStatus}
|
AND ts.inspection_status = #{query.inspectionStatus}
|
||||||
</if>
|
</if>
|
||||||
<if test="query.createTimes != null and query.createTimes.size() > 0">
|
<if test="query.createTimes != null and query.createTimes.size() > 0">
|
||||||
AND t.create_time BETWEEN #{query.createTimes[0]} AND #{query.createTimes[1]}
|
AND t.create_time BETWEEN #{query.createTimes[0]} AND #{query.createTimes[1]}
|
||||||
</if>
|
</if>
|
||||||
<if test="query.inspectionTime != null and query.inspectionTime.size() > 0">
|
<if test="query.inspectionTime != null and query.inspectionTime.size() > 0">
|
||||||
AND t.inspection_time BETWEEN #{query.inspectionTime[0]} AND #{query.inspectionTime[1]}
|
AND ts.inspection_time BETWEEN #{query.inspectionTime[0]} AND #{query.inspectionTime[1]}
|
||||||
</if>
|
</if>
|
||||||
<if test="1==1">
|
<if test="1==1">
|
||||||
${query.sqlParam.get('dataScope')}
|
${query.sqlParam.get('dataScope')}
|
||||||
|
|
@ -228,4 +231,87 @@
|
||||||
</where>
|
</where>
|
||||||
ORDER BY t.create_time DESC
|
ORDER BY t.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getStoreByTasKIdOrIds" resultType="com.chushang.inspection.terminal.vo.TerminalVO">
|
||||||
|
SELECT
|
||||||
|
s.state AS storeState,
|
||||||
|
s.store_name AS storeName,
|
||||||
|
t.store_id AS storeId,
|
||||||
|
t.store_no AS storeNo,
|
||||||
|
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.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="taskId != null">
|
||||||
|
AND t.task_id = #{taskId}
|
||||||
|
</if>
|
||||||
|
<if test="nos != null AND nos.size() > 0 ">
|
||||||
|
AND t.terminal_no IN
|
||||||
|
<foreach collection="nos" item="item" index="index" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="nos != null AND nos.size() > 0 ">
|
||||||
|
AND t.terminal_no IN
|
||||||
|
<foreach collection="nos" item="item" index="index" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</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.createTimes != null and query.createTimes.size() > 0">
|
||||||
|
AND t.create_time BETWEEN #{query.createTimes[0]} AND #{query.createTimes[1]}
|
||||||
|
</if>
|
||||||
|
<if test="1==1">
|
||||||
|
${query.sqlParam.get('dataScope')}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY #{query.orderBy} #{query.isAsc}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -262,6 +262,7 @@ public class FileSourceService
|
||||||
fileSourceInfo.setName(fName);
|
fileSourceInfo.setName(fName);
|
||||||
fileSourceInfo.setSize(length);
|
fileSourceInfo.setSize(length);
|
||||||
fileSourceInfo.setPath("contract/"+fName);
|
fileSourceInfo.setPath("contract/"+fName);
|
||||||
|
fileSourceInfo.setStorage("contract/"+fName);
|
||||||
fileSourceInfo.setMimeType(mimetype);
|
fileSourceInfo.setMimeType(mimetype);
|
||||||
String upload = ossService.upload(file.getInputStream(), fileSourceInfo);
|
String upload = ossService.upload(file.getInputStream(), fileSourceInfo);
|
||||||
fileSourceInfo.setRealPath(upload);
|
fileSourceInfo.setRealPath(upload);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue