对接运维模块
This commit is contained in:
parent
62bc906011
commit
715c4a777c
17
sql/v2.1.sql
17
sql/v2.1.sql
@ -269,6 +269,7 @@ CREATE TABLE `xhpc_station_device`
|
|||||||
`brand_model` varchar(100) DEFAULT NULL COMMENT '品牌型号',
|
`brand_model` varchar(100) DEFAULT NULL COMMENT '品牌型号',
|
||||||
`parent_device_id` bigint(20) DEFAULT NULL COMMENT '上级设备ID',
|
`parent_device_id` bigint(20) DEFAULT NULL COMMENT '上级设备ID',
|
||||||
`serial_number` varchar(50) DEFAULT NULL COMMENT '设备编码',
|
`serial_number` varchar(50) DEFAULT NULL COMMENT '设备编码',
|
||||||
|
`sorted` smallint(4) DEFAULT 0 COMMENT '排序',
|
||||||
`status` smallint(4) DEFAULT NULL COMMENT '设备状态(0-未启用,1-正常,2-异常,3-维修中,4-待检测)',
|
`status` smallint(4) DEFAULT NULL COMMENT '设备状态(0-未启用,1-正常,2-异常,3-维修中,4-待检测)',
|
||||||
`del_flag` smallint(2) DEFAULT NULL COMMENT '是否删除(0-正常,2-删除)',
|
`del_flag` smallint(2) DEFAULT NULL COMMENT '是否删除(0-正常,2-删除)',
|
||||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||||
@ -314,8 +315,6 @@ CREATE TABLE `xhpc_work_order`
|
|||||||
`fault_time` datetime DEFAULT NULL COMMENT '故障时间',
|
`fault_time` datetime DEFAULT NULL COMMENT '故障时间',
|
||||||
`device_type` varchar(32) DEFAULT NULL COMMENT '设备类型',
|
`device_type` varchar(32) DEFAULT NULL COMMENT '设备类型',
|
||||||
`serial_number` varchar(100) DEFAULT NULL COMMENT '设备编码',
|
`serial_number` varchar(100) DEFAULT NULL COMMENT '设备编码',
|
||||||
`dept_id` bigint(20) DEFAULT NULL COMMENT '指派处理部门',
|
|
||||||
`user_id` bigint(20) DEFAULT NULL COMMENT '指派处理人',
|
|
||||||
`reason` varchar(200) DEFAULT NULL COMMENT '故障原因',
|
`reason` varchar(200) DEFAULT NULL COMMENT '故障原因',
|
||||||
`disposal_method` varchar(500) DEFAULT NULL COMMENT '详细处理描述',
|
`disposal_method` varchar(500) DEFAULT NULL COMMENT '详细处理描述',
|
||||||
`status` smallint(4) DEFAULT NULL COMMENT '状态, 0-编辑,1-派发处理,2-处理完成',
|
`status` smallint(4) DEFAULT NULL COMMENT '状态, 0-编辑,1-派发处理,2-处理完成',
|
||||||
@ -325,6 +324,7 @@ CREATE TABLE `xhpc_work_order`
|
|||||||
`create_by` varchar(100) DEFAULT NULL COMMENT '创建人',
|
`create_by` varchar(100) DEFAULT NULL COMMENT '创建人',
|
||||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||||
`update_by` varchar(100) DEFAULT NULL COMMENT '更新人',
|
`update_by` varchar(100) DEFAULT NULL COMMENT '更新人',
|
||||||
|
`remark` text COMMENT '备注',
|
||||||
PRIMARY KEY (`work_order_id`)
|
PRIMARY KEY (`work_order_id`)
|
||||||
) ENGINE=InnoDB
|
) ENGINE=InnoDB
|
||||||
COMMENT = '工单详情表'
|
COMMENT = '工单详情表'
|
||||||
@ -333,6 +333,19 @@ CREATE TABLE `xhpc_work_order`
|
|||||||
COLLATE='utf8mb4_general_ci'
|
COLLATE='utf8mb4_general_ci'
|
||||||
ROW_FORMAT=DYNAMIC;
|
ROW_FORMAT=DYNAMIC;
|
||||||
|
|
||||||
|
CREATE TABLE `xhpc_work_order_user` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '分派ID',
|
||||||
|
`order_id` bigint(20) NOT NULL COMMENT '工单ID',
|
||||||
|
`user_id` bigint(20) NOT NULL COMMENT '分配人ID',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB
|
||||||
|
COMMENT = '工单派单表'
|
||||||
|
AUTO_INCREMENT=1
|
||||||
|
DEFAULT CHARSET=utf8mb4
|
||||||
|
COLLATE='utf8mb4_general_ci'
|
||||||
|
ROW_FORMAT=DYNAMIC;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE `xhpc_work_order_image`
|
CREATE TABLE `xhpc_work_order_image`
|
||||||
(
|
(
|
||||||
`order_image_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '图片ID',
|
`order_image_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '图片ID',
|
||||||
|
|||||||
@ -6,37 +6,45 @@ import com.xhpc.common.core.web.controller.BaseController;
|
|||||||
import com.xhpc.common.core.web.page.TableDataInfo;
|
import com.xhpc.common.core.web.page.TableDataInfo;
|
||||||
import com.xhpc.common.log.annotation.Log;
|
import com.xhpc.common.log.annotation.Log;
|
||||||
import com.xhpc.common.log.enums.BusinessType;
|
import com.xhpc.common.log.enums.BusinessType;
|
||||||
|
import com.xhpc.common.util.LogUserUtils;
|
||||||
|
import com.xhpc.system.api.model.LoginUser;
|
||||||
import com.xhpc.workorder.domain.XhpcWorkOrderDomain;
|
import com.xhpc.workorder.domain.XhpcWorkOrderDomain;
|
||||||
import com.xhpc.workorder.service.WorkOrderService;
|
import com.xhpc.workorder.service.WorkOrderService;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/workorder/order")
|
@RequestMapping("/order")
|
||||||
public class WorkOrderController extends BaseController {
|
public class WorkOrderController extends BaseController {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
WorkOrderService workOrderService;
|
WorkOrderService workOrderService;
|
||||||
|
@Resource
|
||||||
|
LogUserUtils logUserUtils;
|
||||||
|
|
||||||
@GetMapping("/getPage")
|
@GetMapping("/getPage")
|
||||||
public TableDataInfo getOrderPage(Integer orderType,
|
public TableDataInfo getOrderPage(HttpServletRequest request, Integer orderType,
|
||||||
String userName){
|
String userName){
|
||||||
startPage();
|
startPage();
|
||||||
|
LoginUser logUser = logUserUtils.getLogUser(request);
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("orderType", orderType);
|
params.put("orderType", orderType);
|
||||||
params.put("userName", userName);
|
params.put("userName", userName);
|
||||||
|
params.put("tenantId", logUser.getTenantId());
|
||||||
|
|
||||||
return getDataTable(workOrderService.getOrderPage(params));
|
return getDataTable(workOrderService.getOrderPage(params));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "工单-新增工单", businessType = BusinessType.INSERT)
|
@Log(title = "工单-新增工单", businessType = BusinessType.INSERT)
|
||||||
@PostMapping("/")
|
@PostMapping("/")
|
||||||
public R insertNewOrder(@RequestBody XhpcWorkOrderDomain domain){
|
public R insertNewOrder(HttpServletRequest request, @RequestBody XhpcWorkOrderDomain domain){
|
||||||
|
LoginUser logUser = logUserUtils.getLogUser(request);
|
||||||
|
domain.setTenantId(logUser.getTenantId());
|
||||||
return R.ok(workOrderService.insertOrder(domain));
|
return R.ok(workOrderService.insertOrder(domain));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,37 +7,69 @@ import com.xhpc.common.core.web.controller.BaseController;
|
|||||||
import com.xhpc.common.core.web.page.TableDataInfo;
|
import com.xhpc.common.core.web.page.TableDataInfo;
|
||||||
import com.xhpc.common.log.annotation.Log;
|
import com.xhpc.common.log.annotation.Log;
|
||||||
import com.xhpc.common.log.enums.BusinessType;
|
import com.xhpc.common.log.enums.BusinessType;
|
||||||
|
import com.xhpc.common.util.LogUserUtils;
|
||||||
|
import com.xhpc.system.api.model.LoginUser;
|
||||||
import com.xhpc.workorder.domain.XhpcStationDeviceDomain;
|
import com.xhpc.workorder.domain.XhpcStationDeviceDomain;
|
||||||
import com.xhpc.workorder.service.WorkStationService;
|
import com.xhpc.workorder.service.WorkStationService;
|
||||||
|
import com.xhpc.workorder.service.WorkUserService;
|
||||||
|
import com.xhpc.workorder.vo.XhpcStationDeviceVo;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/workorder/station")
|
@RequestMapping("/station")
|
||||||
public class WorkStationController extends BaseController {
|
public class WorkStationController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
WorkStationService stationService;
|
WorkStationService stationService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
WorkUserService userService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
LogUserUtils logUserUtils;
|
||||||
|
|
||||||
@GetMapping("/getPage")
|
@GetMapping("/getPage")
|
||||||
public TableDataInfo getPage(String stationName,
|
public TableDataInfo getPage(HttpServletRequest request, String stationName,
|
||||||
String terminalName){
|
String terminalName){
|
||||||
startPage();
|
startPage();
|
||||||
|
LoginUser logUser = logUserUtils.getLogUser(request);
|
||||||
|
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("stationName", stationName);
|
params.put("stationName", stationName);
|
||||||
params.put("terminalName", terminalName);
|
params.put("terminalName", terminalName);
|
||||||
|
params.put("tenantId", logUser.getTenantId());
|
||||||
|
|
||||||
return getDataTable(stationService.getStationDevice(params));
|
return getDataTable(stationService.getStationDevice(params));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/getPageByParent")
|
||||||
|
public TableDataInfo getPageByParent(HttpServletRequest request,
|
||||||
|
String stationId,
|
||||||
|
String deviceType,
|
||||||
|
String parentId){
|
||||||
|
startPage();
|
||||||
|
LoginUser logUser = logUserUtils.getLogUser(request);
|
||||||
|
|
||||||
|
Map<String, Object> params = new HashMap<>();
|
||||||
|
params.put("stationId", stationId);
|
||||||
|
params.put("deviceType", deviceType);
|
||||||
|
params.put("parentId", parentId);
|
||||||
|
params.put("tenantId", logUser.getTenantId());
|
||||||
|
|
||||||
|
return getDataTable(stationService.getStationDeviceByParent(params));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/getStationPage")
|
@GetMapping("/getStationPage")
|
||||||
public TableDataInfo getStationList(String tenantId){
|
public TableDataInfo getStationList(String tenantId){
|
||||||
startPage();
|
startPage();
|
||||||
@ -50,12 +82,18 @@ public class WorkStationController extends BaseController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/getTree")
|
@GetMapping("/getTree")
|
||||||
public TableDataInfo getTree(String stationName,
|
public TableDataInfo getTree(
|
||||||
String terminalName){
|
HttpServletRequest request,
|
||||||
|
String deviceName,
|
||||||
|
String stationName,
|
||||||
|
String terminalName){
|
||||||
startPage();
|
startPage();
|
||||||
|
LoginUser logUser = logUserUtils.getLogUser(request);
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("stationName", stationName);
|
params.put("stationName", stationName);
|
||||||
params.put("terminalName", terminalName);
|
params.put("terminalName", terminalName);
|
||||||
|
params.put("deviceName", deviceName);
|
||||||
|
params.put("tenantId", logUser.getTenantId());
|
||||||
|
|
||||||
return getDataTable(stationService.getStationDeviceTree(params));
|
return getDataTable(stationService.getStationDeviceTree(params));
|
||||||
}
|
}
|
||||||
@ -84,11 +122,24 @@ public class WorkStationController extends BaseController {
|
|||||||
|
|
||||||
@Log(title = "场站设备-新增设备", businessType = BusinessType.INSERT)
|
@Log(title = "场站设备-新增设备", businessType = BusinessType.INSERT)
|
||||||
@PostMapping("/")
|
@PostMapping("/")
|
||||||
public R insertNewDevice(@RequestBody XhpcStationDeviceDomain domain) throws Exception{
|
public R insertNewDevice(HttpServletRequest request, @RequestBody XhpcStationDeviceDomain domain) throws Exception{
|
||||||
|
LoginUser logUser = logUserUtils.getLogUser(request);
|
||||||
|
domain.setCreateBy(logUser.getUserid().toString());
|
||||||
|
domain.setUpdateBy(logUser.getUserid().toString());
|
||||||
return R.ok(stationService.insertDevice(domain));
|
return R.ok(stationService.insertDevice(domain));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Log(title = "场站设备-新增设备(简易)", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/simple")
|
||||||
|
public R insertNewSimpleDevice(HttpServletRequest request, @RequestBody XhpcStationDeviceVo vo) throws Exception{
|
||||||
|
LoginUser logUser = logUserUtils.getLogUser(request);
|
||||||
|
vo.setTenantId(logUser.getTenantId());
|
||||||
|
vo.setUserId(logUser.getUserid().toString());
|
||||||
|
return R.ok(stationService.insertSimpleDevice(vo));
|
||||||
|
}
|
||||||
|
|
||||||
@Log(title = "场站设备-维护设备信息", businessType = BusinessType.UPDATE)
|
@Log(title = "场站设备-维护设备信息", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/detail")
|
@PutMapping("/detail")
|
||||||
public R updateDeviceInfo(@RequestBody XhpcStationDeviceDomain domain){
|
public R updateDeviceInfo(@RequestBody XhpcStationDeviceDomain domain){
|
||||||
@ -102,4 +153,15 @@ public class WorkStationController extends BaseController {
|
|||||||
public R deleteDeviceInfo(@RequestParam("deviceId") Long deviceId) throws Exception {
|
public R deleteDeviceInfo(@RequestParam("deviceId") Long deviceId) throws Exception {
|
||||||
return R.ok(stationService.deleteDevice(deviceId));
|
return R.ok(stationService.deleteDevice(deviceId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/user")
|
||||||
|
public R getDeptAndUser(HttpServletRequest request){
|
||||||
|
LoginUser logUser = logUserUtils.getLogUser(request);
|
||||||
|
|
||||||
|
Map<String, Object> params = new HashMap<>();
|
||||||
|
params.put("tenantId", logUser.getTenantId());
|
||||||
|
return R.ok(userService.getDeptAndUserByMap(params));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -69,6 +69,8 @@ public class XhpcStationDeviceDomain implements Serializable {
|
|||||||
@Excel(name = "设备编码")
|
@Excel(name = "设备编码")
|
||||||
private String serialNumber;
|
private String serialNumber;
|
||||||
|
|
||||||
|
private Integer sorted;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备状态(0-未启用,1-正常,2-异常,3-维修中,4-待检测)
|
* 设备状态(0-未启用,1-正常,2-异常,3-维修中,4-待检测)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -47,16 +47,6 @@ public class XhpcWorkOrderDomain implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String serialNumber;
|
private String serialNumber;
|
||||||
|
|
||||||
/**
|
|
||||||
* 指派处理部门
|
|
||||||
*/
|
|
||||||
private Long deptId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 指派处理人
|
|
||||||
*/
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 故障原因
|
* 故障原因
|
||||||
*/
|
*/
|
||||||
@ -102,12 +92,14 @@ public class XhpcWorkOrderDomain implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String updateBy;
|
private String updateBy;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
private String userName;
|
private String stationName;
|
||||||
|
|
||||||
private String userPhone;
|
private String deviceName;
|
||||||
|
|
||||||
|
private List<XhpcWorkUserDomain> userList;
|
||||||
|
|
||||||
private List<XhpcWorkOrderImageDomain> questionImgList;
|
private List<XhpcWorkOrderImageDomain> questionImgList;
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.xhpc.workorder.domain;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class XhpcWorkOrderUserDomain {
|
||||||
|
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
}
|
||||||
@ -13,6 +13,9 @@ public interface XhpcStationDeviceMapper {
|
|||||||
|
|
||||||
List<Map<String, Object>> selectStationGunDeviceTreeByParams(@Param("params") Map params);
|
List<Map<String, Object>> selectStationGunDeviceTreeByParams(@Param("params") Map params);
|
||||||
|
|
||||||
|
|
||||||
|
List<Map<String, Object>> selectListByParent(@Param("params")Map params);
|
||||||
|
|
||||||
Map<String, Object> selectByDeviceId(@Param("deviceId") Long deviceId);
|
Map<String, Object> selectByDeviceId(@Param("deviceId") Long deviceId);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,18 @@
|
|||||||
package com.xhpc.workorder.mapper;
|
package com.xhpc.workorder.mapper;
|
||||||
|
|
||||||
import com.xhpc.workorder.domain.XhpcWorkDeptDomain;
|
import com.xhpc.workorder.domain.XhpcWorkDeptDomain;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public interface XhpcWorkDeptMapper {
|
public interface XhpcWorkDeptMapper {
|
||||||
|
|
||||||
|
List<XhpcWorkDeptDomain> selectListByParams(@Param("params") Map params);
|
||||||
|
|
||||||
|
List<Map<String, Object>> selectMapListByParams(@Param("params") Map params);
|
||||||
|
|
||||||
|
|
||||||
int deleteByPrimaryKey(Long workDeptId);
|
int deleteByPrimaryKey(Long workDeptId);
|
||||||
|
|
||||||
int insert(XhpcWorkDeptDomain record);
|
int insert(XhpcWorkDeptDomain record);
|
||||||
|
|||||||
@ -1,14 +1,15 @@
|
|||||||
package com.xhpc.workorder.mapper;
|
package com.xhpc.workorder.mapper;
|
||||||
|
|
||||||
import com.xhpc.workorder.domain.XhpcWorkOrderImageDomain;
|
import com.xhpc.workorder.domain.XhpcWorkOrderImageDomain;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface XhpcWorkOrderImageMapper {
|
public interface XhpcWorkOrderImageMapper {
|
||||||
|
|
||||||
List<XhpcWorkOrderImageDomain> selectByOrderIdAndType(Long orderId, Integer type);
|
List<XhpcWorkOrderImageDomain> selectByOrderIdAndType(@Param("orderId") Long orderId, @Param("type") Integer type);
|
||||||
|
|
||||||
List<Long> selectImageIdByOrderIdAndType(Long orderId, Integer type);
|
List<Long> selectImageIdByOrderIdAndType(@Param("orderId") Long orderId, @Param("type") Integer type);
|
||||||
|
|
||||||
int deleteByImageIds(List<Long> imageIds);
|
int deleteByImageIds(List<Long> imageIds);
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.xhpc.workorder.mapper;
|
package com.xhpc.workorder.mapper;
|
||||||
|
|
||||||
import com.xhpc.workorder.domain.XhpcWorkOrderDomain;
|
import com.xhpc.workorder.domain.XhpcWorkOrderDomain;
|
||||||
|
import com.xhpc.workorder.domain.XhpcWorkOrderUserDomain;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -11,8 +12,9 @@ public interface XhpcWorkOrderMapper {
|
|||||||
List<Map<String, Object>> findOrderListByParams(@Param("params") Map params);
|
List<Map<String, Object>> findOrderListByParams(@Param("params") Map params);
|
||||||
|
|
||||||
XhpcWorkOrderDomain selectByTypeAndTitle(@Param("type")Integer type,
|
XhpcWorkOrderDomain selectByTypeAndTitle(@Param("type")Integer type,
|
||||||
@Param("title")String title,
|
@Param("title")String title);
|
||||||
@Param("userId")Long userId);
|
|
||||||
|
int insertOrderUser(@Param("domainList") List<XhpcWorkOrderUserDomain> domainList);
|
||||||
|
|
||||||
int deleteByPrimaryKey(Long workOrderId);
|
int deleteByPrimaryKey(Long workOrderId);
|
||||||
|
|
||||||
@ -25,4 +27,7 @@ public interface XhpcWorkOrderMapper {
|
|||||||
int updateByPrimaryKeySelective(XhpcWorkOrderDomain record);
|
int updateByPrimaryKeySelective(XhpcWorkOrderDomain record);
|
||||||
|
|
||||||
int updateByPrimaryKey(XhpcWorkOrderDomain record);
|
int updateByPrimaryKey(XhpcWorkOrderDomain record);
|
||||||
|
|
||||||
|
|
||||||
|
int deleteOrderUserByOrderId(Long orderId);
|
||||||
}
|
}
|
||||||
@ -10,6 +10,8 @@ public interface XhpcWorkStationMapper {
|
|||||||
|
|
||||||
List<XhpcWorkStationDomain> selectListByParams(@Param("params") Map params);
|
List<XhpcWorkStationDomain> selectListByParams(@Param("params") Map params);
|
||||||
|
|
||||||
|
List<Map<String, Object>> selectMapListByParams(@Param("params") Map params);
|
||||||
|
|
||||||
XhpcWorkStationDomain selectByName(@Param("stationName") String stationName);
|
XhpcWorkStationDomain selectByName(@Param("stationName") String stationName);
|
||||||
|
|
||||||
int deleteByPrimaryKey(Long workStationId);
|
int deleteByPrimaryKey(Long workStationId);
|
||||||
|
|||||||
@ -3,10 +3,18 @@ package com.xhpc.workorder.mapper;
|
|||||||
import com.xhpc.workorder.domain.XhpcWorkUserDomain;
|
import com.xhpc.workorder.domain.XhpcWorkUserDomain;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public interface XhpcWorkUserMapper {
|
public interface XhpcWorkUserMapper {
|
||||||
|
|
||||||
XhpcWorkUserDomain selectByUserNameAndPhone(@Param("userName")String userName, @Param("phone") String phone);
|
XhpcWorkUserDomain selectByUserNameAndPhone(@Param("userName")String userName, @Param("phone") String phone);
|
||||||
|
|
||||||
|
List<Map<String, Object>> selectMapListByDeptId(@Param("deptId")String deptId);
|
||||||
|
|
||||||
|
|
||||||
|
List<XhpcWorkUserDomain> selectByOrderId(Long orderId);
|
||||||
|
|
||||||
int deleteByPrimaryKey(Long workUserId);
|
int deleteByPrimaryKey(Long workUserId);
|
||||||
|
|
||||||
int insert(XhpcWorkUserDomain record);
|
int insert(XhpcWorkUserDomain record);
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.xhpc.workorder.service;
|
|||||||
|
|
||||||
import com.xhpc.workorder.domain.XhpcStationDeviceDomain;
|
import com.xhpc.workorder.domain.XhpcStationDeviceDomain;
|
||||||
import com.xhpc.workorder.domain.XhpcWorkStationDomain;
|
import com.xhpc.workorder.domain.XhpcWorkStationDomain;
|
||||||
|
import com.xhpc.workorder.vo.XhpcStationDeviceVo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -12,6 +13,9 @@ public interface WorkStationService {
|
|||||||
List<Map<String, Object>> getStationDevice(Map<String, Object> params);
|
List<Map<String, Object>> getStationDevice(Map<String, Object> params);
|
||||||
|
|
||||||
|
|
||||||
|
List<Map<String, Object>> getStationDeviceByParent(Map<String, Object> params);
|
||||||
|
|
||||||
|
|
||||||
List<XhpcWorkStationDomain> getStationList(Map<String, Object> params);
|
List<XhpcWorkStationDomain> getStationList(Map<String, Object> params);
|
||||||
|
|
||||||
|
|
||||||
@ -23,6 +27,8 @@ public interface WorkStationService {
|
|||||||
|
|
||||||
Boolean insertDevice(XhpcStationDeviceDomain domain) throws Exception;
|
Boolean insertDevice(XhpcStationDeviceDomain domain) throws Exception;
|
||||||
|
|
||||||
|
Boolean insertSimpleDevice(XhpcStationDeviceVo vo) throws Exception;
|
||||||
|
|
||||||
Boolean updateDevice(XhpcStationDeviceDomain domain);
|
Boolean updateDevice(XhpcStationDeviceDomain domain);
|
||||||
|
|
||||||
Boolean deleteDevice(Long deviceId) throws Exception;
|
Boolean deleteDevice(Long deviceId) throws Exception;
|
||||||
|
|||||||
@ -2,9 +2,18 @@ package com.xhpc.workorder.service;
|
|||||||
|
|
||||||
import com.xhpc.workorder.domain.XhpcWorkUserDomain;
|
import com.xhpc.workorder.domain.XhpcWorkUserDomain;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public interface WorkUserService {
|
public interface WorkUserService {
|
||||||
|
|
||||||
Boolean insertUser(String userName, String phone);
|
Boolean insertUser(String userName, String phone);
|
||||||
|
|
||||||
XhpcWorkUserDomain insertUserReturnDomain(String userName, String phone);
|
XhpcWorkUserDomain insertUserReturnDomain(String userName, String phone);
|
||||||
|
|
||||||
|
List<Map<String, Object>> getDeptAndUserByMap(Map<String, Object> params);
|
||||||
|
|
||||||
|
XhpcWorkUserDomain findByPk(Long pk);
|
||||||
|
|
||||||
|
List<XhpcWorkUserDomain> findByOrderId(Long orderId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
package com.xhpc.workorder.service.impl;
|
package com.xhpc.workorder.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.xhpc.common.api.SmsService;
|
import com.xhpc.common.api.SmsService;
|
||||||
import com.xhpc.common.core.domain.R;
|
import com.xhpc.common.core.domain.R;
|
||||||
import com.xhpc.common.core.utils.StringUtils;
|
import com.xhpc.common.core.utils.StringUtils;
|
||||||
@ -12,6 +11,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -50,6 +50,7 @@ public class WorkOrderServiceImpl implements WorkOrderService {
|
|||||||
public XhpcWorkOrderDomain selectOrderById(Long orderId){
|
public XhpcWorkOrderDomain selectOrderById(Long orderId){
|
||||||
|
|
||||||
XhpcWorkOrderDomain orderDomain = orderMapper.selectByPrimaryKey(orderId);
|
XhpcWorkOrderDomain orderDomain = orderMapper.selectByPrimaryKey(orderId);
|
||||||
|
orderDomain.setUserList(workUserService.findByOrderId(orderId));
|
||||||
orderDomain.setQuestionImgList(imageMapper.selectByOrderIdAndType(orderId, 1));
|
orderDomain.setQuestionImgList(imageMapper.selectByOrderIdAndType(orderId, 1));
|
||||||
orderDomain.setReplyImgList(imageMapper.selectByOrderIdAndType(orderId, 2));
|
orderDomain.setReplyImgList(imageMapper.selectByOrderIdAndType(orderId, 2));
|
||||||
|
|
||||||
@ -63,7 +64,7 @@ public class WorkOrderServiceImpl implements WorkOrderService {
|
|||||||
List<Long> imageIds = imageMapper.selectImageIdByOrderIdAndType(domain.getWorkOrderId(), 1);
|
List<Long> imageIds = imageMapper.selectImageIdByOrderIdAndType(domain.getWorkOrderId(), 1);
|
||||||
|
|
||||||
for (XhpcWorkOrderImageDomain imageDomain: domain.getQuestionImgList()){
|
for (XhpcWorkOrderImageDomain imageDomain: domain.getQuestionImgList()){
|
||||||
if(StringUtils.isBlank(imageDomain.getOrderImageId().toString())){
|
if(StringUtils.isEmpty(imageDomain.getOrderImageId().toString())){
|
||||||
imageDomain.setOrderId(domain.getWorkOrderId());
|
imageDomain.setOrderId(domain.getWorkOrderId());
|
||||||
imageDomain.setType(Short.valueOf("1"));
|
imageDomain.setType(Short.valueOf("1"));
|
||||||
imageDomain.setDelFlag(Short.valueOf("0"));
|
imageDomain.setDelFlag(Short.valueOf("0"));
|
||||||
@ -78,6 +79,19 @@ public class WorkOrderServiceImpl implements WorkOrderService {
|
|||||||
imageMapper.deleteByImageIds(imageIds);
|
imageMapper.deleteByImageIds(imageIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 更新处理人
|
||||||
|
orderMapper.deleteOrderUserByOrderId(domain.getWorkOrderId());
|
||||||
|
List<XhpcWorkOrderUserDomain> orderUserDomainList = new ArrayList<>();
|
||||||
|
for(XhpcWorkUserDomain userDomain: domain.getUserList()){
|
||||||
|
XhpcWorkOrderUserDomain orderUserDomain = new XhpcWorkOrderUserDomain();
|
||||||
|
orderUserDomain.setOrderId(domain.getWorkOrderId());
|
||||||
|
orderUserDomain.setUserId(userDomain.getWorkUserId());
|
||||||
|
|
||||||
|
orderUserDomainList.add(orderUserDomain);
|
||||||
|
}
|
||||||
|
orderMapper.insertOrderUser(orderUserDomainList);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,19 +119,16 @@ public class WorkOrderServiceImpl implements WorkOrderService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean insertOrder(XhpcWorkOrderDomain domain){
|
public Boolean insertOrder(XhpcWorkOrderDomain domain){
|
||||||
if (StrUtil.hasBlank(domain.getUserName()) || StrUtil.hasBlank(domain.getUserPhone())){
|
|
||||||
throw new RuntimeException("派发人姓名或手机号不能为空");
|
if(domain.getUserList() != null){
|
||||||
|
List<XhpcWorkUserDomain> userDomains = new ArrayList<>();
|
||||||
|
for(XhpcWorkUserDomain userDomain: domain.getUserList()){
|
||||||
|
userDomain = workUserService.findByPk(userDomain.getWorkUserId());
|
||||||
|
userDomains.add(userDomain);
|
||||||
|
}
|
||||||
|
domain.setUserList(userDomains);
|
||||||
}
|
}
|
||||||
|
|
||||||
XhpcWorkUserDomain userDomain = userMapper.selectByUserNameAndPhone(domain.getUserName(), domain.getUserPhone());
|
|
||||||
if(userDomain != null){
|
|
||||||
domain.setUserId(userDomain.getWorkUserId());
|
|
||||||
domain.setDeptId(userDomain.getDeptId());
|
|
||||||
} else {
|
|
||||||
userDomain = workUserService.insertUserReturnDomain(domain.getUserName(), domain.getUserPhone());
|
|
||||||
}
|
|
||||||
domain.setUserId(userDomain.getWorkUserId());
|
|
||||||
domain.setDeptId(userDomain.getDeptId());
|
|
||||||
|
|
||||||
if(StringUtils.isNotEmpty(domain.getSerialNumber())){
|
if(StringUtils.isNotEmpty(domain.getSerialNumber())){
|
||||||
XhpcStationDeviceDomain deviceDomain = deviceMapper.selectStationGunDeviceBySerialNumber(domain.getSerialNumber());
|
XhpcStationDeviceDomain deviceDomain = deviceMapper.selectStationGunDeviceBySerialNumber(domain.getSerialNumber());
|
||||||
@ -129,8 +140,8 @@ public class WorkOrderServiceImpl implements WorkOrderService {
|
|||||||
orderMapper.insertSelective(domain);
|
orderMapper.insertSelective(domain);
|
||||||
|
|
||||||
XhpcWorkOrderDomain resDomain = orderMapper.selectByTypeAndTitle(domain.getType().intValue(),
|
XhpcWorkOrderDomain resDomain = orderMapper.selectByTypeAndTitle(domain.getType().intValue(),
|
||||||
domain.getTitle(),
|
domain.getTitle());
|
||||||
domain.getUserId());
|
|
||||||
|
|
||||||
// 上传文件
|
// 上传文件
|
||||||
for(XhpcWorkOrderImageDomain imageDomain : domain.getQuestionImgList()){
|
for(XhpcWorkOrderImageDomain imageDomain : domain.getQuestionImgList()){
|
||||||
@ -140,16 +151,30 @@ public class WorkOrderServiceImpl implements WorkOrderService {
|
|||||||
imageMapper.insertSelective(imageDomain);
|
imageMapper.insertSelective(imageDomain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 绑定人员
|
||||||
|
List<XhpcWorkOrderUserDomain> orderUserDomainList = new ArrayList<>();
|
||||||
|
String phoneList = "";
|
||||||
|
for (XhpcWorkUserDomain userDomain: domain.getUserList()){
|
||||||
|
XhpcWorkOrderUserDomain orderUserDomain = new XhpcWorkOrderUserDomain();
|
||||||
|
orderUserDomain.setOrderId(resDomain.getWorkOrderId());
|
||||||
|
orderUserDomain.setUserId(userDomain.getWorkUserId());
|
||||||
|
orderUserDomainList.add(orderUserDomain);
|
||||||
|
phoneList = userDomain.getPhone() + "," + phoneList;
|
||||||
|
}
|
||||||
|
|
||||||
|
orderMapper.insertOrderUser(orderUserDomainList);
|
||||||
|
|
||||||
|
|
||||||
|
// todo 发送多人短信
|
||||||
HashMap<String, String> paramMap = new HashMap<>();
|
HashMap<String, String> paramMap = new HashMap<>();
|
||||||
paramMap.put("orderNo", resDomain.getWorkOrderId().toString());
|
paramMap.put("orderNo", resDomain.getWorkOrderId().toString());
|
||||||
paramMap.put("phone", domain.getUserPhone());
|
paramMap.put("phone", phoneList);
|
||||||
paramMap.put("content", "【小华充电】您好,您有新的工单(工单号:"+ resDomain.getWorkOrderId() +")待处理,请及时登陆后台查看并处理,谢谢。");
|
paramMap.put("content", "【小华充电】您好,您有新的工单(工单号:"+ resDomain.getWorkOrderId() +")待处理,请及时登陆后台查看并处理,谢谢。");
|
||||||
R r = smsService.sendNotice(paramMap);
|
R r = smsService.sendNotice(paramMap);
|
||||||
|
|
||||||
XhpcWorkOrderPushMessageDomain messageDomain = new XhpcWorkOrderPushMessageDomain();
|
XhpcWorkOrderPushMessageDomain messageDomain = new XhpcWorkOrderPushMessageDomain();
|
||||||
messageDomain.setContent(paramMap.get("content"));
|
messageDomain.setContent(paramMap.get("content"));
|
||||||
messageDomain.setTarget(domain.getUserPhone());
|
messageDomain.setTarget(phoneList);
|
||||||
messageDomain.setType(Short.valueOf("1"));
|
messageDomain.setType(Short.valueOf("1"));
|
||||||
if (r!= null && r.getCode() != 200){
|
if (r!= null && r.getCode() != 200){
|
||||||
messageDomain.setFailMsg("发送失败");
|
messageDomain.setFailMsg("发送失败");
|
||||||
@ -170,6 +195,7 @@ public class WorkOrderServiceImpl implements WorkOrderService {
|
|||||||
throw new Exception("工单不存在");
|
throw new Exception("工单不存在");
|
||||||
}
|
}
|
||||||
orderMapper.deleteByPrimaryKey(orderId);
|
orderMapper.deleteByPrimaryKey(orderId);
|
||||||
|
orderMapper.deleteOrderUserByOrderId(orderId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,9 +8,11 @@ import com.xhpc.workorder.domain.XhpcWorkStationDomain;
|
|||||||
import com.xhpc.workorder.mapper.XhpcStationDeviceMapper;
|
import com.xhpc.workorder.mapper.XhpcStationDeviceMapper;
|
||||||
import com.xhpc.workorder.mapper.XhpcWorkStationMapper;
|
import com.xhpc.workorder.mapper.XhpcWorkStationMapper;
|
||||||
import com.xhpc.workorder.service.WorkStationService;
|
import com.xhpc.workorder.service.WorkStationService;
|
||||||
|
import com.xhpc.workorder.vo.XhpcStationDeviceVo;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -30,6 +32,11 @@ public class WorkStationServiceImpl implements WorkStationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> getStationDeviceByParent(Map<String, Object> params){
|
||||||
|
return deviceMapper.selectListByParent(params);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<XhpcWorkStationDomain> getStationList(Map<String, Object> params){
|
public List<XhpcWorkStationDomain> getStationList(Map<String, Object> params){
|
||||||
return stationMapper.selectListByParams(params);
|
return stationMapper.selectListByParams(params);
|
||||||
@ -38,16 +45,30 @@ public class WorkStationServiceImpl implements WorkStationService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Map<String, Object>> getStationDeviceTree(Map<String, Object> params){
|
public List<Map<String, Object>> getStationDeviceTree(Map<String, Object> params){
|
||||||
|
Map<String, Object> stationParams = new HashMap<>();
|
||||||
|
stationParams.put("name", params.get("stationName"));
|
||||||
|
stationParams.put("tenantId", params.get("tenantId"));
|
||||||
|
stationParams.put("status", 1);
|
||||||
|
stationParams.put("delFlag", 0);
|
||||||
|
|
||||||
List<Map<String, Object>> resultData = deviceMapper.selectStationGunDeviceTreeByParams(params);
|
List<Map<String, Object>> stationDomainList = stationMapper.selectMapListByParams(stationParams);
|
||||||
for (Map<String, Object> resultMap: resultData){
|
for (Map<String, Object> stationMap: stationDomainList){
|
||||||
List<Map<String, Object>> childData = deviceMapper.selectStationGunDeviceTreeByParent(resultMap.get("deviceId").toString());
|
if(StringUtils.isEmpty(params.get("stationName").toString())){
|
||||||
if(childData != null){
|
params.put("stationName", stationMap.get("name"));
|
||||||
resultMap.put("children", childData);
|
}
|
||||||
|
List<Map<String, Object>> resultData = deviceMapper.selectStationGunDeviceTreeByParams(params);
|
||||||
|
for (Map<String, Object> resultMap: resultData){
|
||||||
|
List<Map<String, Object>> childData = deviceMapper.selectStationGunDeviceTreeByParent(resultMap.get("deviceId").toString());
|
||||||
|
if(childData != null){
|
||||||
|
resultMap.put("children", childData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return resultData;
|
|
||||||
|
|
||||||
|
|
||||||
|
return stationDomainList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -121,6 +142,31 @@ public class WorkStationServiceImpl implements WorkStationService {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean insertSimpleDevice(XhpcStationDeviceVo vo) throws Exception{
|
||||||
|
|
||||||
|
if(StringUtils.isEmpty(vo.getParentDeviceId())){
|
||||||
|
// 增加的场站
|
||||||
|
XhpcWorkStationDomain stationDomain = new XhpcWorkStationDomain();
|
||||||
|
stationDomain.setName(vo.getDeviceName());
|
||||||
|
stationDomain.setTenantId(vo.getTenantId());
|
||||||
|
stationDomain.setCreateBy(vo.getUserId());
|
||||||
|
stationDomain.setUpdateBy(vo.getUserId());
|
||||||
|
|
||||||
|
stationMapper.insertSelective(stationDomain);
|
||||||
|
} else {
|
||||||
|
XhpcStationDeviceDomain deviceDomain = new XhpcStationDeviceDomain();
|
||||||
|
deviceDomain.setDeviceName(vo.getDeviceName());
|
||||||
|
deviceDomain.setCreateBy(vo.getUserId());
|
||||||
|
deviceDomain.setUpdateBy(vo.getUserId());
|
||||||
|
|
||||||
|
deviceMapper.insertSelective(deviceDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateDevice(XhpcStationDeviceDomain domain){
|
public Boolean updateDevice(XhpcStationDeviceDomain domain){
|
||||||
deviceMapper.updateByPrimaryKeySelective(domain);
|
deviceMapper.updateByPrimaryKeySelective(domain);
|
||||||
|
|||||||
@ -1,11 +1,15 @@
|
|||||||
package com.xhpc.workorder.service.impl;
|
package com.xhpc.workorder.service.impl;
|
||||||
|
|
||||||
|
import com.xhpc.workorder.domain.XhpcWorkDeptDomain;
|
||||||
import com.xhpc.workorder.domain.XhpcWorkUserDomain;
|
import com.xhpc.workorder.domain.XhpcWorkUserDomain;
|
||||||
|
import com.xhpc.workorder.mapper.XhpcWorkDeptMapper;
|
||||||
import com.xhpc.workorder.mapper.XhpcWorkUserMapper;
|
import com.xhpc.workorder.mapper.XhpcWorkUserMapper;
|
||||||
import com.xhpc.workorder.service.WorkUserService;
|
import com.xhpc.workorder.service.WorkUserService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@ -14,6 +18,9 @@ public class WorkUserServiceImpl implements WorkUserService {
|
|||||||
@Resource
|
@Resource
|
||||||
XhpcWorkUserMapper workUserMapper;
|
XhpcWorkUserMapper workUserMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
XhpcWorkDeptMapper deptMapper;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean insertUser(String userName, String phone){
|
public Boolean insertUser(String userName, String phone){
|
||||||
@ -29,4 +36,27 @@ public class WorkUserServiceImpl implements WorkUserService {
|
|||||||
|
|
||||||
return workUserMapper.selectByUserNameAndPhone(userName, phone);
|
return workUserMapper.selectByUserNameAndPhone(userName, phone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> getDeptAndUserByMap(Map<String, Object> params){
|
||||||
|
List<Map<String, Object>> deptDomains = deptMapper.selectMapListByParams(params);
|
||||||
|
for(Map<String, Object> deptMap: deptDomains){
|
||||||
|
List<Map<String, Object>> useres = workUserMapper.selectMapListByDeptId(deptMap.get("id").toString());
|
||||||
|
deptMap.put("users", useres);
|
||||||
|
}
|
||||||
|
return deptDomains;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public XhpcWorkUserDomain findByPk(Long pk){
|
||||||
|
return workUserMapper.selectByPrimaryKey(pk);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<XhpcWorkUserDomain> findByOrderId(Long orderId){
|
||||||
|
return workUserMapper.selectByOrderId(orderId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,20 @@
|
|||||||
|
package com.xhpc.workorder.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class XhpcStationDeviceVo {
|
||||||
|
|
||||||
|
private String deviceName;
|
||||||
|
|
||||||
|
private String parentDeviceId;
|
||||||
|
|
||||||
|
private String deviceType;
|
||||||
|
|
||||||
|
private String stationName;
|
||||||
|
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
|
private String userId;
|
||||||
|
}
|
||||||
@ -29,9 +29,6 @@ logging:
|
|||||||
root: info
|
root: info
|
||||||
com.xhpc.workorder.mapper: debug
|
com.xhpc.workorder.mapper: debug
|
||||||
|
|
||||||
file:
|
|
||||||
path: "d:\\logs"
|
|
||||||
|
|
||||||
pattern:
|
pattern:
|
||||||
console: '%d{yyyy/MM/dd-HH:mm:ss} [%thread] %-5level %logger- %msg%n'
|
console: '%d{yyyy/MM/dd-HH:mm:ss} [%thread] %-5level %logger- %msg%n'
|
||||||
file: '%d{yyyy/MM/dd-HH:mm:ss} [%thread] %-5level %logger- %msg%n'
|
file: '%d{yyyy/MM/dd-HH:mm:ss} [%thread] %-5level %logger- %msg%n'
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
device_id, device_name, device_type, current_type, station_id, brand_model, parent_device_id, serial_number,
|
device_id, device_name, device_type, current_type, station_id, brand_model, parent_device_id, serial_number, sorted,
|
||||||
`status`, del_flag, create_time, create_by, update_time, update_by
|
`status`, del_flag, create_time, create_by, update_time, update_by
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
@ -34,27 +34,35 @@
|
|||||||
s.`name` as 'stationName',
|
s.`name` as 'stationName',
|
||||||
d1.device_id as 'pileId',
|
d1.device_id as 'pileId',
|
||||||
d1.device_name as 'pileName',
|
d1.device_name as 'pileName',
|
||||||
|
d1.device_type as 'pileDeviceType',
|
||||||
d1.serial_number as 'pileSerialNumber',
|
d1.serial_number as 'pileSerialNumber',
|
||||||
d1.brand_model as 'pileBrandModel',
|
d1.brand_model as 'pileBrandModel',
|
||||||
d1.current_type as 'pileCurrentType',
|
d1.current_type as 'pileCurrentType',
|
||||||
|
d1.sorted as 'pileSorted',
|
||||||
d2.device_id as 'gunId',
|
d2.device_id as 'gunId',
|
||||||
d2.device_name as 'gunName',
|
d2.device_name as 'gunName',
|
||||||
|
d2.device_type as 'gunDeviceType',
|
||||||
d2.serial_number as 'gunSerialNumber',
|
d2.serial_number as 'gunSerialNumber',
|
||||||
d2.brand_model as 'gunBrandModel',
|
d2.brand_model as 'gunBrandModel',
|
||||||
d2.current_type as 'gunCurrentType'
|
d2.current_type as 'gunCurrentType',
|
||||||
|
d2.sorted as 'gunSorted'
|
||||||
from xhpc_station_device d1
|
from xhpc_station_device d1
|
||||||
LEFT JOIN xhpc_work_station s on s.work_station_id=d1.station_id
|
LEFT JOIN xhpc_work_station s on s.work_station_id=d1.station_id
|
||||||
LEFT JOIN xhpc_station_device d2 on d2.parent_device_id=d1.device_id
|
LEFT JOIN xhpc_station_device d2 on d2.parent_device_id=d1.device_id
|
||||||
WHERE s.del_flag=0 and d1.del_flag=0 and d1.device_type='PILE'
|
WHERE s.del_flag=0 and d1.del_flag=0 and d1.device_type='PILE'
|
||||||
<if test="params.stationName!=null and params.stationName !+ ''">
|
<if test="params.stationName!=null and params.stationName != ''">
|
||||||
and s.name like concat('%', #{params.stationName}, '%')
|
and s.name like concat('%', #{params.stationName}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="params.stationId!=null and params.stationId != ''">
|
||||||
|
and s.work_station_id = #{params.stationId}
|
||||||
|
</if>
|
||||||
<if test="params.terminalName!=null and params.terminalName!=''">
|
<if test="params.terminalName!=null and params.terminalName!=''">
|
||||||
and d1.device_name like concat('%', #{params.terminalName},'%')
|
and d2.device_name like concat('%', #{params.terminalName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="params.tenantId!=null and params.tenantId!=''">
|
<if test="params.tenantId!=null and params.tenantId!=''">
|
||||||
and s.tenant_id=#{params.tenantId}
|
and s.tenant_id=#{params.tenantId}
|
||||||
</if>
|
</if>
|
||||||
|
order by d1.device_type, d1.sorted, d2.device_type, d2.sorted
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
@ -68,6 +76,7 @@
|
|||||||
d.brand_model as 'brandModel',
|
d.brand_model as 'brandModel',
|
||||||
d.parent_device_id as 'parengDeviceId',
|
d.parent_device_id as 'parengDeviceId',
|
||||||
d.serial_number as 'serialNumber',
|
d.serial_number as 'serialNumber',
|
||||||
|
d.sorted as 'sorted',
|
||||||
d.`status` as 'status',
|
d.`status` as 'status',
|
||||||
d.del_flag as 'delFlag',
|
d.del_flag as 'delFlag',
|
||||||
d.create_time as 'createTime',
|
d.create_time as 'createTime',
|
||||||
@ -86,13 +95,18 @@
|
|||||||
s.`name` as 'stationName',
|
s.`name` as 'stationName',
|
||||||
d1.device_id as 'deviceId',
|
d1.device_id as 'deviceId',
|
||||||
d1.device_name as 'deviceName',
|
d1.device_name as 'deviceName',
|
||||||
|
d1.device_type as 'deviceType',
|
||||||
d1.serial_number as 'deviceSerialNumber',
|
d1.serial_number as 'deviceSerialNumber',
|
||||||
d1.brand_model as 'deviceBrandModel',
|
d1.brand_model as 'deviceBrandModel',
|
||||||
d1.current_type as 'deviceCurrentType',
|
d1.current_type as 'deviceCurrentType',
|
||||||
|
d1.sorted as 'deviceSorted'
|
||||||
from xhpc_station_device d1
|
from xhpc_station_device d1
|
||||||
LEFT JOIN xhpc_work_station s on s.work_station_id=d1.station_id
|
LEFT JOIN xhpc_work_station s on s.work_station_id=d1.station_id
|
||||||
WHERE s.del_flag=0 and d1.del_flag=0
|
WHERE s.del_flag=0 and d1.del_flag=0
|
||||||
<if test="params.stationName!=null and params.stationName !+ ''">
|
<if test="params.deviceName != null and params.deviceName != ''">
|
||||||
|
and d1.device_name like concat('%', #{params.deviceName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="params.stationName!=null and params.stationName != ''">
|
||||||
and s.name like concat('%', #{params.stationName}, '%')
|
and s.name like concat('%', #{params.stationName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="params.terminalName!=null and params.terminalName!=''">
|
<if test="params.terminalName!=null and params.terminalName!=''">
|
||||||
@ -101,6 +115,45 @@
|
|||||||
<if test="params.tenantId!=null and params.tenantId!=''">
|
<if test="params.tenantId!=null and params.tenantId!=''">
|
||||||
and s.tenant_id=#{params.tenantId}
|
and s.tenant_id=#{params.tenantId}
|
||||||
</if>
|
</if>
|
||||||
|
order by d1.station_id, d1.device_type, d1.sorted
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectListByParent" resultType="map">
|
||||||
|
SELECT
|
||||||
|
s.`name` as 'stationName',
|
||||||
|
d1.device_id as 'deviceId',
|
||||||
|
d1.device_name as 'deviceName',
|
||||||
|
d1.device_type as 'deviceType',
|
||||||
|
d1.serial_number as 'deviceSerialNumber',
|
||||||
|
d1.brand_model as 'deviceBrandModel',
|
||||||
|
d1.current_type as 'deviceCurrentType',
|
||||||
|
d1.sorted as 'deviceSorted'
|
||||||
|
from xhpc_station_device d1
|
||||||
|
LEFT JOIN xhpc_work_station s on s.work_station_id=d1.station_id
|
||||||
|
WHERE s.del_flag=0 and d1.del_flag=0
|
||||||
|
<if test="params.deviceName != null and params.deviceName != ''">
|
||||||
|
and d1.device_name like concat('%', #{params.deviceName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="params.stationName!=null and params.stationName != ''">
|
||||||
|
and s.name like concat('%', #{params.stationName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="params.terminalName!=null and params.terminalName!=''">
|
||||||
|
and d1.device_name like concat('%', #{params.terminalName},'%')
|
||||||
|
</if>
|
||||||
|
<if test="params.tenantId!=null and params.tenantId!=''">
|
||||||
|
and s.tenant_id=#{params.tenantId}
|
||||||
|
</if>
|
||||||
|
<if test="params.stationId != null and params.stationId !=''">
|
||||||
|
and s.work_station_id = #{params.stationId}
|
||||||
|
</if>
|
||||||
|
<if test="params.deviceType != null and params.deviceType !=''">
|
||||||
|
and d1.device_type = #{params.deviceType}
|
||||||
|
</if>
|
||||||
|
<if test="params.parentId != null and params.parentId !=''">
|
||||||
|
and d1.parent_device_id = #{params.parentId}
|
||||||
|
</if>
|
||||||
|
order by d1.device_type, d1.sorted
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
@ -109,13 +162,16 @@
|
|||||||
s.`name` as 'stationName',
|
s.`name` as 'stationName',
|
||||||
d1.device_id as 'deviceId',
|
d1.device_id as 'deviceId',
|
||||||
d1.device_name as 'deviceName',
|
d1.device_name as 'deviceName',
|
||||||
|
d1.device_type as 'deviceType',
|
||||||
d1.serial_number as 'deviceSerialNumber',
|
d1.serial_number as 'deviceSerialNumber',
|
||||||
d1.brand_model as 'deviceBrandModel',
|
d1.brand_model as 'deviceBrandModel',
|
||||||
d1.current_type as 'deviceCurrentType',
|
d1.current_type as 'deviceCurrentType',
|
||||||
|
d1.sorted as 'deviceSorted'
|
||||||
from xhpc_station_device d1
|
from xhpc_station_device d1
|
||||||
LEFT JOIN xhpc_work_station s on s.work_station_id=d1.station_id
|
LEFT JOIN xhpc_work_station s on s.work_station_id=d1.station_id
|
||||||
WHERE s.del_flag=0 and d1.del_flag=0
|
WHERE s.del_flag=0 and d1.del_flag=0
|
||||||
and d1.parent_device_id=#{parentDeviceId}
|
and d1.parent_device_id=#{parentDeviceId}
|
||||||
|
order by d1.device_type, d1.sorted
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
@ -131,11 +187,11 @@
|
|||||||
</update>
|
</update>
|
||||||
<insert id="insert" keyColumn="device_id" keyProperty="deviceId" parameterType="com.xhpc.workorder.domain.XhpcStationDeviceDomain" useGeneratedKeys="true">
|
<insert id="insert" keyColumn="device_id" keyProperty="deviceId" parameterType="com.xhpc.workorder.domain.XhpcStationDeviceDomain" useGeneratedKeys="true">
|
||||||
insert into xhpc_station_device (device_name, device_type, current_type, station_id,
|
insert into xhpc_station_device (device_name, device_type, current_type, station_id,
|
||||||
parent_device_id, serial_number, brand_model, `status`,
|
parent_device_id, serial_number, brand_model,sorted, `status`,
|
||||||
del_flag, create_time, create_by,
|
del_flag, create_time, create_by,
|
||||||
update_time, update_by)
|
update_time, update_by)
|
||||||
values (#{deviceName,jdbcType=VARCHAR}, #{deviceType,jdbcType=VARCHAR}, #{currentType,jdbcType=VARCHAR}, #{stationId,jdbcType=BIGINT},
|
values (#{deviceName,jdbcType=VARCHAR}, #{deviceType,jdbcType=VARCHAR}, #{currentType,jdbcType=VARCHAR}, #{stationId,jdbcType=BIGINT},
|
||||||
#{parentDeviceId,jdbcType=BIGINT}, #{serialNumber,jdbcType=VARCHAR}, #{brandModel,jdbcType=VARCHAR}, #{status,jdbcType=SMALLINT},
|
#{parentDeviceId,jdbcType=BIGINT}, #{serialNumber,jdbcType=VARCHAR}, #{brandModel,jdbcType=VARCHAR},#{sorted, jdbcType=SMALLINT}, #{status,jdbcType=SMALLINT},
|
||||||
0, SYSDATE(), #{createBy,jdbcType=VARCHAR}, SYSDATE(), #{updateBy,jdbcType=VARCHAR})
|
0, SYSDATE(), #{createBy,jdbcType=VARCHAR}, SYSDATE(), #{updateBy,jdbcType=VARCHAR})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" keyColumn="device_id" keyProperty="deviceId" parameterType="com.xhpc.workorder.domain.XhpcStationDeviceDomain" useGeneratedKeys="true">
|
<insert id="insertSelective" keyColumn="device_id" keyProperty="deviceId" parameterType="com.xhpc.workorder.domain.XhpcStationDeviceDomain" useGeneratedKeys="true">
|
||||||
@ -162,6 +218,9 @@
|
|||||||
<if test="brandModel != null">
|
<if test="brandModel != null">
|
||||||
brand_model,
|
brand_model,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="sorted != null">
|
||||||
|
`sorted`,
|
||||||
|
</if>
|
||||||
<if test="status != null">
|
<if test="status != null">
|
||||||
`status`,
|
`status`,
|
||||||
</if>
|
</if>
|
||||||
@ -197,6 +256,9 @@
|
|||||||
<if test="brandModel != null">
|
<if test="brandModel != null">
|
||||||
#{brandModel,jdbcType=VARCHAR},
|
#{brandModel,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="sorted != null">
|
||||||
|
#{sorted,jdbcType=SMALLINT},
|
||||||
|
</if>
|
||||||
<if test="status != null">
|
<if test="status != null">
|
||||||
#{status,jdbcType=SMALLINT},
|
#{status,jdbcType=SMALLINT},
|
||||||
</if>
|
</if>
|
||||||
@ -235,6 +297,9 @@
|
|||||||
<if test="brandModel != null">
|
<if test="brandModel != null">
|
||||||
brand_model = #{brandModel,jdbcType=VARCHAR},
|
brand_model = #{brandModel,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="sorted != null">
|
||||||
|
`sorted` = #{sorted,jdbcType=SMALLINT},
|
||||||
|
</if>
|
||||||
<if test="status != null">
|
<if test="status != null">
|
||||||
`status` = #{status,jdbcType=SMALLINT},
|
`status` = #{status,jdbcType=SMALLINT},
|
||||||
</if>
|
</if>
|
||||||
@ -254,6 +319,7 @@
|
|||||||
parent_device_id = #{parentDeviceId,jdbcType=BIGINT},
|
parent_device_id = #{parentDeviceId,jdbcType=BIGINT},
|
||||||
serial_number = #{serialNumber,jdbcType=VARCHAR},
|
serial_number = #{serialNumber,jdbcType=VARCHAR},
|
||||||
brand_model = #{brandModel,jdbcType=VARCHAR},
|
brand_model = #{brandModel,jdbcType=VARCHAR},
|
||||||
|
sorted = #{sorted,jdbcType=SMALLINT},
|
||||||
`status` = #{status,jdbcType=SMALLINT},
|
`status` = #{status,jdbcType=SMALLINT},
|
||||||
update_time = sysdate(),
|
update_time = sysdate(),
|
||||||
update_by = #{updateBy,jdbcType=VARCHAR}
|
update_by = #{updateBy,jdbcType=VARCHAR}
|
||||||
|
|||||||
@ -19,6 +19,28 @@
|
|||||||
work_dept_id, dept_name, code, sort, parent_dept_id, `status`, del_flag, tenant_id,
|
work_dept_id, dept_name, code, sort, parent_dept_id, `status`, del_flag, tenant_id,
|
||||||
create_time, create_by, update_time, update_by
|
create_time, create_by, update_time, update_by
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectListByParams" resultType="com.xhpc.workorder.domain.XhpcWorkDeptDomain">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from xhpc_work_dept
|
||||||
|
where del_flag = 0 and status = 1
|
||||||
|
<if test="params.tenantId !=null and params.tenantId!=''">
|
||||||
|
and tenant_id=#{params.tenantId}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMapListByParams" resultType="map">
|
||||||
|
select
|
||||||
|
work_dept_id as 'id',
|
||||||
|
dept_name as 'name'
|
||||||
|
from xhpc_work_dept
|
||||||
|
where del_flag = 0 and status = 1
|
||||||
|
<if test="params.tenantId !=null and params.tenantId!=''">
|
||||||
|
and tenant_id=#{params.tenantId}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List" />
|
<include refid="Base_Column_List" />
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
select
|
select
|
||||||
<include refid="Base_Column_List" />
|
<include refid="Base_Column_List" />
|
||||||
from xhpc_work_order_image
|
from xhpc_work_order_image
|
||||||
where order_id = #{orderId,jdbcType=BIGINT} and type = #{type}
|
where order_id = #{orderId} and type = #{type}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||||
@ -58,6 +58,9 @@
|
|||||||
<insert id="insertSelective" keyColumn="order_image_id" keyProperty="orderImageId" parameterType="com.xhpc.workorder.domain.XhpcWorkOrderImageDomain" useGeneratedKeys="true">
|
<insert id="insertSelective" keyColumn="order_image_id" keyProperty="orderImageId" parameterType="com.xhpc.workorder.domain.XhpcWorkOrderImageDomain" useGeneratedKeys="true">
|
||||||
insert into xhpc_work_order_image
|
insert into xhpc_work_order_image
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="orderId != null">
|
||||||
|
order_id,
|
||||||
|
</if>
|
||||||
<if test="fileName != null">
|
<if test="fileName != null">
|
||||||
file_name,
|
file_name,
|
||||||
</if>
|
</if>
|
||||||
@ -74,6 +77,9 @@
|
|||||||
</if>
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="orderId != null">
|
||||||
|
#{orderId},
|
||||||
|
</if>
|
||||||
<if test="fileName != null">
|
<if test="fileName != null">
|
||||||
#{fileName,jdbcType=VARCHAR},
|
#{fileName,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
@ -93,6 +99,9 @@
|
|||||||
<update id="updateByPrimaryKeySelective" parameterType="com.xhpc.workorder.domain.XhpcWorkOrderImageDomain">
|
<update id="updateByPrimaryKeySelective" parameterType="com.xhpc.workorder.domain.XhpcWorkOrderImageDomain">
|
||||||
update xhpc_work_order_image
|
update xhpc_work_order_image
|
||||||
<set>
|
<set>
|
||||||
|
<if test="orderId !=null">
|
||||||
|
order_id=#{orderId},
|
||||||
|
</if>
|
||||||
<if test="fileName != null">
|
<if test="fileName != null">
|
||||||
file_name = #{fileName,jdbcType=VARCHAR},
|
file_name = #{fileName,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
@ -111,7 +120,8 @@
|
|||||||
</update>
|
</update>
|
||||||
<update id="updateByPrimaryKey" parameterType="com.xhpc.workorder.domain.XhpcWorkOrderImageDomain">
|
<update id="updateByPrimaryKey" parameterType="com.xhpc.workorder.domain.XhpcWorkOrderImageDomain">
|
||||||
update xhpc_work_order_image
|
update xhpc_work_order_image
|
||||||
set file_name = #{fileName,jdbcType=VARCHAR},
|
set order_id=#{orderId},
|
||||||
|
file_name = #{fileName,jdbcType=VARCHAR},
|
||||||
url = #{url,jdbcType=VARCHAR},
|
url = #{url,jdbcType=VARCHAR},
|
||||||
`type` = #{type,jdbcType=SMALLINT},
|
`type` = #{type,jdbcType=SMALLINT},
|
||||||
where order_image_id = #{orderImageId,jdbcType=BIGINT}
|
where order_image_id = #{orderImageId,jdbcType=BIGINT}
|
||||||
|
|||||||
@ -9,8 +9,6 @@
|
|||||||
<result column="fault_time" jdbcType="TIMESTAMP" property="faultTime" />
|
<result column="fault_time" jdbcType="TIMESTAMP" property="faultTime" />
|
||||||
<result column="device_type" jdbcType="VARCHAR" property="deviceType" />
|
<result column="device_type" jdbcType="VARCHAR" property="deviceType" />
|
||||||
<result column="serial_number" jdbcType="VARCHAR" property="serialNumber" />
|
<result column="serial_number" jdbcType="VARCHAR" property="serialNumber" />
|
||||||
<result column="dept_id" jdbcType="BIGINT" property="deptId" />
|
|
||||||
<result column="user_id" jdbcType="BIGINT" property="userId" />
|
|
||||||
<result column="reason" jdbcType="VARCHAR" property="reason" />
|
<result column="reason" jdbcType="VARCHAR" property="reason" />
|
||||||
<result column="disposal_method" jdbcType="VARCHAR" property="disposalMethod" />
|
<result column="disposal_method" jdbcType="VARCHAR" property="disposalMethod" />
|
||||||
<result column="status" jdbcType="SMALLINT" property="status" />
|
<result column="status" jdbcType="SMALLINT" property="status" />
|
||||||
@ -20,38 +18,51 @@
|
|||||||
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||||
|
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||||
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
work_order_id, `type`, title, content, fault_time, device_type, serial_number, dept_id, user_id,
|
o.work_order_id, o.`type`, o.title, o.content, o.fault_time, o.device_type, o.serial_number,
|
||||||
reason, disposal_method, `status`, del_flag, tenant_id, create_time, create_by, update_time,
|
o.reason, o.disposal_method, o.`status`, o.del_flag, o.tenant_id, o.create_time, o.create_by, o.update_time,
|
||||||
update_by
|
o.update_by, o.remark
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="insertOrderUser">
|
||||||
|
insert into xhpc_work_order_user (order_id, user_id)
|
||||||
|
values
|
||||||
|
<foreach collection="domainList" item="domain" separator=",">
|
||||||
|
(#{domain.orderId}, #{domain.userId})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
<select id="selectByTypeAndTitle" resultType="com.xhpc.workorder.domain.XhpcWorkOrderDomain">
|
<select id="selectByTypeAndTitle" resultType="com.xhpc.workorder.domain.XhpcWorkOrderDomain">
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List" />
|
<include refid="Base_Column_List" />
|
||||||
from xhpc_work_order
|
from xhpc_work_order o
|
||||||
where del_flag=0
|
where o.del_flag=0
|
||||||
and type =#{type}
|
and o.type =#{type}
|
||||||
and title=#{title}
|
and o.title=#{title}
|
||||||
and user_id=#{userId}
|
and o.status=1
|
||||||
and status=0 and del_flag=0
|
|
||||||
order by create_time desc limit 1
|
order by create_time desc limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="findOrderListByParams" resultType="java.util.Map">
|
<select id="findOrderListByParams" resultType="java.util.Map">
|
||||||
SELECT
|
SELECT
|
||||||
o.work_order_id as 'workOrderId',
|
o.work_order_id as 'workOrderId',
|
||||||
o.title as 'title',
|
o.title as 'title',
|
||||||
o.type as 'type',
|
o.type as 'type',
|
||||||
o.dept_id as 'deptId',
|
u.dept_id as 'deptId',
|
||||||
d.dept_name as 'deptName',
|
d.dept_name as 'deptName',
|
||||||
o.user_id as 'userId',
|
u.work_user_id as 'userId',
|
||||||
u.user_name as 'userName',
|
u.user_name as 'userName',
|
||||||
o.`status` as 'status'
|
o.`status` as 'status'
|
||||||
from xhpc_work_order o
|
from xhpc_work_order o
|
||||||
LEFT JOIN xhpc_work_dept d on d.work_dept_id=o.dept_id
|
LEFT JOIN xhpc_work_order_user ou on o.work_order_id=ou.order_id
|
||||||
LEFT JOIN xhpc_work_user u on o.user_id=u.work_user_id
|
LEFT JOIN xhpc_work_user u on ou.user_id=u.work_user_id
|
||||||
|
LEFT JOIN xhpc_work_dept d on d.work_dept_id=u.dept_id
|
||||||
where o.del_flag=0
|
where o.del_flag=0
|
||||||
<if test="params.orderType != null and params.orderType != ''">
|
<if test="params.orderType != null and params.orderType != ''">
|
||||||
and o.type=#{params.orderType}
|
and o.type=#{params.orderType}
|
||||||
@ -62,14 +73,18 @@
|
|||||||
<if test="params.tenantId!=null and params.tenantId!=''">
|
<if test="params.tenantId!=null and params.tenantId!=''">
|
||||||
and o.tenant_id = #{params.tenantId}
|
and o.tenant_id = #{params.tenantId}
|
||||||
</if>
|
</if>
|
||||||
|
GROUP BY o.work_order_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
<select id="selectByPrimaryKey" resultType="com.xhpc.workorder.domain.XhpcWorkOrderDomain">
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List" />
|
<include refid="Base_Column_List" />,
|
||||||
from xhpc_work_order
|
d.device_name, s.name
|
||||||
where work_order_id = #{workOrderId,jdbcType=BIGINT}
|
from xhpc_work_order o
|
||||||
|
LEFT JOIN xhpc_station_device d on o.serial_number=d.serial_number
|
||||||
|
LEFT JOIN xhpc_work_station s on d.station_id=s.work_station_id
|
||||||
|
where o.work_order_id = #{workOrderId,jdbcType=BIGINT}
|
||||||
</select>
|
</select>
|
||||||
<update id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
<update id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||||
update xhpc_work_order set del_flag=2
|
update xhpc_work_order set del_flag=2
|
||||||
@ -77,17 +92,16 @@
|
|||||||
</update>
|
</update>
|
||||||
<insert id="insert" keyColumn="work_order_id" keyProperty="workOrderId" parameterType="com.xhpc.workorder.domain.XhpcWorkOrderDomain" useGeneratedKeys="true">
|
<insert id="insert" keyColumn="work_order_id" keyProperty="workOrderId" parameterType="com.xhpc.workorder.domain.XhpcWorkOrderDomain" useGeneratedKeys="true">
|
||||||
insert into xhpc_work_order (`type`, title, content, fault_time
|
insert into xhpc_work_order (`type`, title, content, fault_time
|
||||||
device_type, serial_number, dept_id,
|
device_type, serial_number, reason, disposal_method,
|
||||||
user_id, reason, disposal_method,
|
|
||||||
`status`, del_flag, tenant_id,
|
`status`, del_flag, tenant_id,
|
||||||
create_time, create_by, update_time,
|
create_time, create_by, update_time,
|
||||||
update_by)
|
update_by, remark)
|
||||||
values (#{type,jdbcType=SMALLINT}, #{title,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, #{faultTime, jdbcType=TIMESTAMP}
|
values (#{type,jdbcType=SMALLINT}, #{title,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, #{faultTime, jdbcType=TIMESTAMP}
|
||||||
#{deviceType,jdbcType=VARCHAR}, #{serialNumber,jdbcType=VARCHAR}, #{deptId,jdbcType=BIGINT},
|
#{deviceType,jdbcType=VARCHAR}, #{serialNumber,jdbcType=VARCHAR},
|
||||||
#{userId,jdbcType=BIGINT}, #{reason,jdbcType=VARCHAR}, #{disposalMethod,jdbcType=VARCHAR},
|
#{reason,jdbcType=VARCHAR}, #{disposalMethod,jdbcType=VARCHAR},
|
||||||
#{status,jdbcType=SMALLINT}, 0, #{tenantId,jdbcType=VARCHAR},
|
1, 0, #{tenantId,jdbcType=VARCHAR},
|
||||||
sysdate(), #{createBy,jdbcType=VARCHAR},sysdate(),
|
sysdate(), #{createBy,jdbcType=VARCHAR},sysdate(),
|
||||||
#{updateBy,jdbcType=VARCHAR})
|
#{updateBy,jdbcType=VARCHAR}, #{remark})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" keyColumn="work_order_id" keyProperty="workOrderId" parameterType="com.xhpc.workorder.domain.XhpcWorkOrderDomain" useGeneratedKeys="true">
|
<insert id="insertSelective" keyColumn="work_order_id" keyProperty="workOrderId" parameterType="com.xhpc.workorder.domain.XhpcWorkOrderDomain" useGeneratedKeys="true">
|
||||||
insert into xhpc_work_order
|
insert into xhpc_work_order
|
||||||
@ -110,12 +124,6 @@
|
|||||||
<if test="serialNumber != null">
|
<if test="serialNumber != null">
|
||||||
serial_number,
|
serial_number,
|
||||||
</if>
|
</if>
|
||||||
<if test="deptId != null">
|
|
||||||
dept_id,
|
|
||||||
</if>
|
|
||||||
<if test="userId != null">
|
|
||||||
user_id,
|
|
||||||
</if>
|
|
||||||
<if test="reason != null">
|
<if test="reason != null">
|
||||||
reason,
|
reason,
|
||||||
</if>
|
</if>
|
||||||
@ -135,6 +143,9 @@
|
|||||||
<if test="updateBy != null">
|
<if test="updateBy != null">
|
||||||
update_by,
|
update_by,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="remark != null">
|
||||||
|
remark,
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="type != null">
|
<if test="type != null">
|
||||||
@ -155,19 +166,13 @@
|
|||||||
<if test="serialNumber != null">
|
<if test="serialNumber != null">
|
||||||
#{serialNumber,jdbcType=VARCHAR},
|
#{serialNumber,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="deptId != null">
|
|
||||||
#{deptId,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="userId != null">
|
|
||||||
#{userId,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="reason != null">
|
<if test="reason != null">
|
||||||
#{reason,jdbcType=VARCHAR},
|
#{reason,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="disposalMethod != null">
|
<if test="disposalMethod != null">
|
||||||
#{disposalMethod,jdbcType=VARCHAR},
|
#{disposalMethod,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
0,
|
1,
|
||||||
0,
|
0,
|
||||||
<if test="tenantId != null">
|
<if test="tenantId != null">
|
||||||
#{tenantId,jdbcType=VARCHAR},
|
#{tenantId,jdbcType=VARCHAR},
|
||||||
@ -180,6 +185,9 @@
|
|||||||
<if test="updateBy != null">
|
<if test="updateBy != null">
|
||||||
#{updateBy,jdbcType=VARCHAR},
|
#{updateBy,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="remark != null">
|
||||||
|
#{remark},
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
<update id="updateByPrimaryKeySelective" parameterType="com.xhpc.workorder.domain.XhpcWorkOrderDomain">
|
<update id="updateByPrimaryKeySelective" parameterType="com.xhpc.workorder.domain.XhpcWorkOrderDomain">
|
||||||
@ -203,12 +211,6 @@
|
|||||||
<if test="serialNumber != null">
|
<if test="serialNumber != null">
|
||||||
serial_number = #{serialNumber,jdbcType=VARCHAR},
|
serial_number = #{serialNumber,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="deptId != null">
|
|
||||||
dept_id = #{deptId,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="userId != null">
|
|
||||||
user_id = #{userId,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="reason != null">
|
<if test="reason != null">
|
||||||
reason = #{reason,jdbcType=VARCHAR},
|
reason = #{reason,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
@ -225,6 +227,9 @@
|
|||||||
<if test="updateBy != null">
|
<if test="updateBy != null">
|
||||||
update_by = #{updateBy,jdbcType=VARCHAR},
|
update_by = #{updateBy,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="remark != null">
|
||||||
|
remark=#{remark},
|
||||||
|
</if>
|
||||||
</set>
|
</set>
|
||||||
where work_order_id = #{workOrderId,jdbcType=BIGINT}
|
where work_order_id = #{workOrderId,jdbcType=BIGINT}
|
||||||
</update>
|
</update>
|
||||||
@ -236,14 +241,19 @@
|
|||||||
fault_time = #{faultTime, jdbcType=TIMESTAMP},
|
fault_time = #{faultTime, jdbcType=TIMESTAMP},
|
||||||
device_type = #{deviceType,jdbcType=VARCHAR},
|
device_type = #{deviceType,jdbcType=VARCHAR},
|
||||||
serial_number = #{serialNumber,jdbcType=VARCHAR},
|
serial_number = #{serialNumber,jdbcType=VARCHAR},
|
||||||
dept_id = #{deptId,jdbcType=BIGINT},
|
|
||||||
user_id = #{userId,jdbcType=BIGINT},
|
|
||||||
reason = #{reason,jdbcType=VARCHAR},
|
reason = #{reason,jdbcType=VARCHAR},
|
||||||
disposal_method = #{disposalMethod,jdbcType=VARCHAR},
|
disposal_method = #{disposalMethod,jdbcType=VARCHAR},
|
||||||
`status` = #{status,jdbcType=SMALLINT},
|
`status` = #{status,jdbcType=SMALLINT},
|
||||||
tenant_id = #{tenantId,jdbcType=VARCHAR},
|
tenant_id = #{tenantId,jdbcType=VARCHAR},
|
||||||
update_time = sysdate(),
|
update_time = sysdate(),
|
||||||
update_by = #{updateBy,jdbcType=VARCHAR}
|
update_by = #{updateBy,jdbcType=VARCHAR},
|
||||||
|
remark=#{remark}
|
||||||
where work_order_id = #{workOrderId,jdbcType=BIGINT}
|
where work_order_id = #{workOrderId,jdbcType=BIGINT}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<delete id="deleteOrderUserByOrderId">
|
||||||
|
delete from xhpc_work_order_user where order_id=#{orderId}
|
||||||
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -38,7 +38,7 @@
|
|||||||
park_nums, tenant_id
|
park_nums, tenant_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectListByParams">
|
<select id="selectListByParams" resultType="com.xhpc.workorder.domain.XhpcWorkStationDomain">
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List" />
|
<include refid="Base_Column_List" />
|
||||||
from xhpc_work_station
|
from xhpc_work_station
|
||||||
@ -60,6 +60,31 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectMapListByParams" resultType="map">
|
||||||
|
select
|
||||||
|
work_station_id as 'workStationId',
|
||||||
|
name as 'name',
|
||||||
|
type as 'type',
|
||||||
|
address as 'address',
|
||||||
|
serial_number as 'serialNumber'
|
||||||
|
from xhpc_work_station
|
||||||
|
<where>
|
||||||
|
<if test="params.name != null and params.name !=''">
|
||||||
|
and name like concat('%', #{params.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="params.tenantId!=null and params.tenantId!=''">
|
||||||
|
and tenant_id = #{params.tenantId}
|
||||||
|
</if>
|
||||||
|
<if test="params.status != null">
|
||||||
|
and status=#{params.status}
|
||||||
|
</if>
|
||||||
|
<if test="params.delFlag!=null">
|
||||||
|
and del_flag=#{params.delFlag}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="selectByName" resultType="com.xhpc.workorder.domain.XhpcWorkStationDomain">
|
<select id="selectByName" resultType="com.xhpc.workorder.domain.XhpcWorkStationDomain">
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List" />
|
<include refid="Base_Column_List" />
|
||||||
|
|||||||
@ -29,6 +29,25 @@
|
|||||||
where user_name = #{userName} and phone=#{phone}
|
where user_name = #{userName} and phone=#{phone}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMapListByDeptId" resultType="map">
|
||||||
|
select
|
||||||
|
work_user_id as 'id',
|
||||||
|
user_name as 'name',
|
||||||
|
phone,
|
||||||
|
email
|
||||||
|
from xhpc_work_user
|
||||||
|
where del_flag=0 and status=1 and dept_id = #{deptId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectByOrderId" resultType="com.xhpc.workorder.domain.XhpcWorkUserDomain">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
FROM xhpc_work_user u
|
||||||
|
LEFT JOIN xhpc_work_order_user ou on ou.user_id=u.work_user_id
|
||||||
|
WHERE ou.order_id=#{orderId} and u.del_flag=0 and u.status=1
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List" />
|
<include refid="Base_Column_List" />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user