Merge remote-tracking branch 'origin/master'

highway
wws 1 year ago
commit 6dafbca7d1

@ -1,8 +1,10 @@
package com.op.device.controller;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquOrder;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.device.domain.*;
import com.op.device.service.IDevicePDAService;
import com.op.device.service.IEquRepairOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -19,6 +21,9 @@ public class DevicePDAController {
@Autowired
private IDevicePDAService devicePDAService;
@Autowired
private IEquRepairOrderService equRepairOrderService;
/**
* list
* @param userId
@ -58,4 +63,47 @@ public class DevicePDAController {
public AjaxResult updateInspectionRecord(@RequestBody EquOrder equOrder) {
return devicePDAService.updateInspectionRecord(equOrder);
}
//报修
/**
*
* @param equRepairOrder
* @return
*/
@PostMapping("/addRepairRecord")
public AjaxResult addRepairRecord(@RequestBody EquRepairOrder equRepairOrder) {
return devicePDAService.addRepairRecord(equRepairOrder);
}
//维修
/**
*
*
* @param equRepairWorkOrder
* @return
*/
@GetMapping("/getMaintenanceRecords")
public AjaxResult getMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder) {
return devicePDAService.getMaintenanceRecords(equRepairWorkOrder);
}
/**
*
*
* @param equRepairWorkOrder
* @return
*/
@PutMapping("/updateDowntime")
public AjaxResult updateDowntime(@RequestBody EquRepairWorkOrder equRepairWorkOrder) {
return devicePDAService.updateDowntime(equRepairWorkOrder);
}
/**
*
*/
// @GetMapping(value = "/{equipmentId}")
// public AjaxResult queryEquipment(@PathVariable("equipmentId") Long equipmentId) {
// return devicePDAService.selectBaseEquipmentByEquipmentId(equipmentId);
// }
}

@ -3,8 +3,7 @@ package com.op.device.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.device.domain.EquEquipment;
import com.op.device.domain.EquOutsourceWork;
import com.op.device.domain.EquTeamUser;
import com.op.device.service.IEquOutsourceWorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -123,9 +122,9 @@ public class EquRepairWorkOrderController extends BaseController {
//获取维修人员列表
@GetMapping("/getMaintenancePersonList")
public TableDataInfo getMaintenancePersonList(EquEquipment equEquipment) {
public TableDataInfo getMaintenancePersonList(EquTeamUser equTeamUser) {
startPage();
List<EquEquipment> list = equRepairWorkOrderService.getMaintenancePersonList(equEquipment);
List<EquTeamUser> list = equRepairWorkOrderService.getMaintenancePersonList(equTeamUser);
return getDataTable(list);
}
}

@ -2,6 +2,8 @@ package com.op.device.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.device.domain.EquRepairWorkOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -94,4 +96,14 @@ public class EquSpareApplyController extends BaseController {
public AjaxResult remove(@PathVariable String[] applyIds) {
return toAjax(equSpareApplyService.deleteEquSpareApplyByApplyIds(applyIds));
}
/**
*
*/
@GetMapping("/listRepairSparePartsRecord")
public TableDataInfo listRepairSparePartsRecord(EquRepairWorkOrder equRepairWorkOrder) {
startPage();
List<EquSpareApply> list = equSpareApplyService.selectRepairSparePartsRecord(equRepairWorkOrder);
return getDataTable(list);
}
}

@ -2,6 +2,8 @@ package com.op.device.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.device.domain.EquTeamUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -72,7 +74,7 @@ public class EquTeamController extends BaseController {
@Log(title = "设备班组维护", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EquTeam equTeam) {
return toAjax(equTeamService.insertEquTeam(equTeam));
return equTeamService.insertEquTeam(equTeam);
}
/**
@ -82,7 +84,7 @@ public class EquTeamController extends BaseController {
@Log(title = "设备班组维护", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EquTeam equTeam) {
return toAjax(equTeamService.updateEquTeam(equTeam));
return equTeamService.updateEquTeam(equTeam);
}
/**
@ -102,4 +104,14 @@ public class EquTeamController extends BaseController {
List<EquTeam> list = equTeamService.getMaintenanceTeamList(equTeam);
return getDataTable(list);
}
/**
*
*/
@GetMapping("/listTeamMembers")
public TableDataInfo listTeamMembers(EquTeamUser equTeamUser) {
startPage();
List<EquTeamUser> list = equTeamService.selectTeamMembers(equTeamUser);
return getDataTable(list);
}
}

@ -0,0 +1,123 @@
package com.op.device.domain;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* base_file
*
* @author Open Platform
* @date 2023-07-10
*/
public class EquFile extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 附件ID */
private String fileId;
/** 附件名称 */
@Excel(name = "附件名称")
private String fileName;
/** 附件地址 */
@Excel(name = "附件地址")
private String fileAddress;
/** 数据来源 */
@Excel(name = "数据来源")
private String sourceId;
/** 预留字段1 */
@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
@Excel(name = "预留字段3")
private Long attr3;
/** 预留字段4 */
@Excel(name = "预留字段4")
private Long attr4;
public void setFileId(String fileId) {
this.fileId = fileId;
}
public String getFileId() {
return fileId;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFileName() {
return fileName;
}
public void setFileAddress(String fileAddress) {
this.fileAddress = fileAddress;
}
public String getFileAddress() {
return fileAddress;
}
public void setSourceId(String sourceId) {
this.sourceId = sourceId;
}
public String getSourceId() {
return sourceId;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(Long attr3) {
this.attr3 = attr3;
}
public Long getAttr3() {
return attr3;
}
public void setAttr4(Long attr4) {
this.attr4 = attr4;
}
public Long getAttr4() {
return attr4;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("fileId", getFileId())
.append("fileName", getFileName())
.append("fileAddress", getFileAddress())
.append("sourceId", getSourceId())
.append("remark", getRemark())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -1,6 +1,8 @@
package com.op.device.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -164,6 +166,23 @@ public class EquRepairOrder extends BaseEntity {
@Excel(name = "原因")
private String outSourceReason;
//图片文件
private String fileList;
private List<EquFile> files;
//图片文件
public String getFileList() {
return fileList;
}
public void setFileList(String fileList) {
this.fileList = fileList;
}
public List<EquFile> getFiles() {
return files;
}
public void setFiles(List<EquFile> files) {
this.files = files;
}
//委外
public void setWorkId(String workId) {

@ -206,6 +206,10 @@ public class EquRepairWorkOrder extends BaseEntity {
/** 联系方式 */
private String workConnection;
//手持
//用户id
private String userId;
//报修
public void setOrderDesc(String orderDesc) {
@ -563,6 +567,14 @@ public class EquRepairWorkOrder extends BaseEntity {
return workConnection;
}
//手持 用户userId
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserId() {
return userId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -50,8 +50,8 @@ public class EquSpareApply extends BaseEntity {
private String spareUseEquipment;
/** 领用时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "领用时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "领用时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date applyTime;
/** 申领人 */
@ -90,6 +90,14 @@ public class EquSpareApply extends BaseEntity {
// 创建日期结束
private String applyTimeEnd;
//新增字段
/** 工单编码 */
private String workCode ;
/** 关联上级code(保养) */
private String parentCode ;
/** 领用类型 */
private String applyType ;
public List<Date> getApplyTimeArray() {
return applyTimeArray;
}
@ -227,6 +235,32 @@ public class EquSpareApply extends BaseEntity {
return factoryCode;
}
//新增
/** 主工单编码(保养) */
public String getWorkCode(){
return this.workCode;
}
/** 主工单编码(保养) */
public void setWorkCode(String workCode){
this.workCode=workCode;
}
/** 关联上级code(保养) */
public String getParentCode(){
return this.parentCode;
}
/** 关联上级code(保养) */
public void setParentCode(String parentCode){
this.parentCode=parentCode;
}
/** 领用类型 */
public String getApplyType(){
return this.applyType;
}
/** 领用类型 */
public void setApplyType(String applyType){
this.applyType=applyType;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import java.util.List;
/**
* equ_team
*
@ -40,6 +42,23 @@ public class EquTeam extends BaseEntity {
@Excel(name = "工厂号")
private String factoryCode;
//班组右边数据列表
private List<String> rightData;
public void setRightData(List<String> rightData) {
this.rightData = rightData;
}
public List<String> getRightData() {
return rightData;
}
private List<EquTeamUser> selectedData;
public void setSelectedData(List<EquTeamUser> selectedData) {
this.selectedData = selectedData;
}
public List<EquTeamUser> getSelectedData() {
return selectedData;
}
public void setId(String id) {
this.id = id;
}

@ -0,0 +1,107 @@
package com.op.device.domain;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* equ_team_user
*
* @author Open Platform
* @date 2023-08-29
*/
public class EquTeamUser extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
/** 班组id */
@Excel(name = "班组id")
private String teamId;
/** 班组编码 */
@Excel(name = "班组编码")
private String teamCode;
/** 人员id */
@Excel(name = "人员id")
private String userId;
/** 人员名字编号 */
@Excel(name = "人员名字")
private String userName;
/** 人员名字 */
@Excel(name = "人员名字")
private String nickName;
/** 人员拼接名字 */
@Excel(name = "人员拼接名字")
private String teamUserName;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setTeamId(String teamId) {
this.teamId = teamId;
}
public String getTeamId() {
return teamId;
}
public void setTeamCode(String teamCode) {
this.teamCode = teamCode;
}
public String getTeamCode() {
return teamCode;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserId() {
return userId;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserName() {
return userName;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getTeamUserName() {
return teamUserName;
}
public void setTeamUserName(String teamUserName) {
this.teamUserName = teamUserName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("teamId", getTeamId())
.append("teamCode", getTeamCode())
.append("userId", getUserId())
.append("userName", getUserName())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -57,6 +57,11 @@ public class SparePartsLedger extends BaseEntity {
@Excel(name = "冻结数量", readConverterExp = "预=留")
private BigDecimal storageAmount;
//虚拟字段
/** 库存可用数量 */
// @Excel(name = "库存可用数量")
// private BigDecimal availableQuantity;
/** 占用数量 */
@Excel(name = "占用数量")
private BigDecimal occupyAmount;
@ -200,11 +205,9 @@ public class SparePartsLedger extends BaseEntity {
// 领用数量-保养备件领用使用
private BigDecimal applyNum;
public BigDecimal getApplyNum() {
return applyNum;
}
public void setApplyNum(BigDecimal applyNum) {
this.applyNum = applyNum;
}
@ -287,6 +290,15 @@ public class SparePartsLedger extends BaseEntity {
public BigDecimal getStorageAmount() {
return storageAmount;
}
//库存可用数量 虚拟字段
// public void setAvailableQuantity(BigDecimal availableQuantity) {
// this.availableQuantity = availableQuantity;
// }
// public BigDecimal getAvailableQuantity() {
// return availableQuantity;
// }
public void setOccupyAmount(BigDecimal occupyAmount) {
this.occupyAmount = occupyAmount;
}

@ -0,0 +1,77 @@
package com.op.device.mapper;
import com.op.common.core.domain.BaseFileData;
import com.op.device.domain.EquFile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*
* @author Open Platform
* @date 2023-07-10
*/
@Mapper
public interface EquFileMapper {
/**
*
*
* @param fileId
* @return
*/
public EquFile selectEquFileByFileId(String fileId);
/**
*
*
* @param equFile
* @return
*/
public List<EquFile> selectEquFileList(EquFile equFile);
/**
*
*
* @param equFile
* @return
*/
public int insertEquFile(EquFile equFile);
/**
*
*
* @param equFile
* @return
*/
public int updateEquFile(EquFile equFile);
/**
*
*
* @param fileId
* @return
*/
public int deleteEquFileByFileId(String fileId);
/**
*
*
* @param fileIds
* @return
*/
public int deleteEquFileByFileIds(String[] fileIds);
/**
*
* @param equFiles
*/
public Boolean insertEquFileBatch(@Param("baseFiles") List<BaseFileData> equFiles);
//查询图片
public List<EquFile> getEquFileBatch(String orderId);
//删除照图片
public void deleteEquFileBySourceId(String orderId);
}

@ -3,8 +3,10 @@ package com.op.device.mapper;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.domain.BaseFileData;
import com.op.device.domain.EquEquipment;
import com.op.device.domain.EquRepairOrder;
import org.apache.ibatis.annotations.Param;
/**
* Mapper

@ -2,8 +2,9 @@ package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquEquipment;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.device.domain.EquRepairWorkOrder;
import com.op.device.domain.EquTeamUser;
/**
* Mapper
@ -67,5 +68,6 @@ public interface EquRepairWorkOrderMapper {
void updateWorkOutsource(EquRepairWorkOrder equRepairWorkOrder);
//获取维修人员列表
public List<EquEquipment> getMaintenancePersonList(EquEquipment equEquipment);
@DS("master")
public List<EquTeamUser> getMaintenancePersonList(EquTeamUser equTeamUser);
}

@ -2,6 +2,7 @@ package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquRepairWorkOrder;
import com.op.device.domain.EquSpareApply;
/**
@ -58,4 +59,7 @@ public interface EquSpareApplyMapper {
* @return
*/
public int deleteEquSpareApplyByApplyIds(String[] applyIds);
//查询维修工单对应的备件申领记录
public List<EquSpareApply> selectRepairSparePartsRecord(EquRepairWorkOrder equRepairWorkOrder);
}

@ -2,7 +2,9 @@ package com.op.device.mapper;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.device.domain.EquTeam;
import com.op.device.domain.EquTeamUser;
/**
* Mapper
@ -61,4 +63,16 @@ public interface EquTeamMapper {
//查询设备维修组列表
public List<EquTeam> getMaintenanceTeamList(EquTeam equTeam);
//查询设备维修组人员
@DS("master")
public List<EquTeamUser> getMaintenancePerson(EquTeamUser equTeamUser);
//查询所有人员
@DS("master")
public List<EquTeamUser> selectTeamMembers(EquTeamUser equTeamUser);
//查询特定人员
@DS("master")
public EquTeamUser selectTeamMember(EquTeamUser equTeamUser);
}

@ -0,0 +1,79 @@
package com.op.device.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.device.domain.EquTeamUser;
import java.util.List;
/**
* Mapper
*
* @author Open Platform
* @date 2023-08-29
*/
public interface EquTeamUserMapper {
/**
*
*
* @param id
* @return
*/
public EquTeamUser selectEquTeamUserById(String id);
/**
*
*
* @param equTeamUser
* @return
*/
public List<EquTeamUser> selectEquTeamUserList(EquTeamUser equTeamUser);
/**
*
*
* @param equTeamUser
* @return
*/
public int insertEquTeamUser(EquTeamUser equTeamUser);
/**
*
*
* @param equTeamUser
* @return
*/
public int updateEquTeamUser(EquTeamUser equTeamUser);
/**
*
*
* @param id
* @return
*/
public int deleteEquTeamUserById(String id);
/**
*
*
* @param ids
* @return
*/
public int deleteEquTeamUserByIds(String[] ids);
//查询人员
@DS("master")
public List<EquTeamUser> selectTeamMembers(EquTeamUser equTeamUser);
//查询人员对应名字
public List<String> selectTeamMembersIds(EquTeamUser equTeamUser);
//查询人员ID
public String selectId(EquTeamUser equTeamUser);
@DS("master")
public String selectUserName(EquTeamUser equTeamUser);
//批量删除
public void deleteEquTeamUserByTeamId(String teamId);
void deleteEquTeamUserByTeamIds(String[] teamIds);
}

@ -1,7 +1,7 @@
package com.op.device.service;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquOrder;
import com.op.device.domain.*;
/**
* PDAService
@ -37,4 +37,42 @@ public interface IDevicePDAService {
* @return
*/
AjaxResult updateInspectionRecord(EquOrder equOrder);
//报修
/**
*
* @param equRepairOrder
* @return
*/
public AjaxResult addRepairRecord(EquRepairOrder equRepairOrder);
//维修
/**
*
* @param equRepairWorkOrder
* @return
*/
public AjaxResult getMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder);
//班组
/**
*
* @param equTeamUser
* @return
*/
public AjaxResult getMaintenancePerson(EquTeamUser equTeamUser);
/**
*
* @param equRepairWorkOrder
* @return
*/
public AjaxResult updateDowntime(EquRepairWorkOrder equRepairWorkOrder);
/**
*
* @param equRepairWorkOrder
* @return
*/
// AjaxResult selectBaseEquipmentByEquipmentId(Long equipmentId);
}

@ -2,8 +2,8 @@ package com.op.device.service;
import java.util.List;
import com.op.device.domain.EquEquipment;
import com.op.device.domain.EquRepairWorkOrder;
import com.op.device.domain.EquTeamUser;
/**
* Service
@ -61,7 +61,7 @@ public interface IEquRepairWorkOrderService {
public int deleteEquRepairWorkOrderByWorkId(String workId);
//获取维修人员列表
public List<EquEquipment> getMaintenancePersonList(EquEquipment equEquipment);
public List<EquTeamUser> getMaintenancePersonList(EquTeamUser equTeamUser);
//委外申请
public int applyEquOutsourceWork(EquRepairWorkOrder equRepairWorkOrder);

@ -1,6 +1,8 @@
package com.op.device.service;
import java.util.List;
import com.op.device.domain.EquRepairWorkOrder;
import com.op.device.domain.EquSpareApply;
/**
@ -57,4 +59,7 @@ public interface IEquSpareApplyService {
* @return
*/
public int deleteEquSpareApplyByApplyId(String applyId);
//查询维修工单对应备件申领记录
public List<EquSpareApply> selectRepairSparePartsRecord(EquRepairWorkOrder equRepairWorkOrder);
}

@ -1,7 +1,10 @@
package com.op.device.service;
import java.util.List;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquTeam;
import com.op.device.domain.EquTeamUser;
/**
* Service
@ -32,7 +35,7 @@ public interface IEquTeamService {
* @param equTeam
* @return
*/
public int insertEquTeam(EquTeam equTeam);
public AjaxResult insertEquTeam(EquTeam equTeam);
/**
*
@ -40,7 +43,7 @@ public interface IEquTeamService {
* @param equTeam
* @return
*/
public int updateEquTeam(EquTeam equTeam);
public AjaxResult updateEquTeam(EquTeam equTeam);
/**
*
@ -60,4 +63,7 @@ public interface IEquTeamService {
//维修组列表
List<EquTeam> getMaintenanceTeamList(EquTeam equTeam);
//查询所有人员信息
List<EquTeamUser> selectTeamMembers(EquTeamUser equTeamUser);
}

@ -8,17 +8,20 @@ import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils;
import com.op.device.domain.EquOrder;
import com.op.device.domain.EquOrderDetail;
import com.op.device.domain.EquOrderEqu;
import com.op.device.domain.EquOrderStandard;
import com.op.device.domain.*;
import com.op.device.mapper.*;
import com.op.device.service.IDevicePDAService;
import com.op.system.api.domain.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@ -46,6 +49,12 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
private EquOrderPersonMapper equOrderPersonMapper;
@Autowired
private PersonMapper personMapper;
@Autowired
private EquRepairOrderMapper equRepairOrderMapper;
@Autowired
private EquRepairWorkOrderMapper equRepairWorkOrderMapper;
@Autowired
private EquTeamMapper equTeamMapper;
/**
@ -158,11 +167,9 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
}
equOrderStandardMapper.insertBaseFileBatch(files);
}
// 更新标准
standard.setUpdateTime(DateUtils.getNowDate());
equOrderStandardMapper.updateEquOrderStandard(standard);
}
}
@ -171,8 +178,128 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
equOrder.setUpdateTime(DateUtils.getNowDate());
equOrder.setUpdateBy(SecurityContextHolder.getUserName());
equOrder.setPlanPerson(SecurityContextHolder.getUserName());
// 获取故障报修流水号
EquRepairOrder equRepairOrder = new EquRepairOrder();
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
String equipmentCode = equOrder.getEquipmentCode();
//报修单号
equRepairOrder.setOrderCode("BX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
//在主表中存入报修单号信息
equOrder.setRepairCode(equRepairOrder.getOrderCode());
equOrderMapper.updateEquOrder(equOrder);
//新增报修记录
equRepairOrder.setOrderId(IdUtils.fastSimpleUUID());
equRepairOrder.setCreateTime(DateUtils.getNowDate());
equRepairOrder.setCreateBy(SecurityUtils.getUsername());
equRepairOrder.setOrderStatus("待审核");
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
equRepairOrderMapper.insertEquRepairOrder(equRepairOrder);
return success(equOrder);
}
//////////////////////报修
/**
*
*
* @param equRepairOrder
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult addRepairRecord(EquRepairOrder equRepairOrder) {
try {
equRepairOrder.setOrderId(IdUtils.fastSimpleUUID());
// 获取故障报修流水号
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
String equipmentCode = equRepairOrder.getEquipmentCode();
//报修单号
equRepairOrder.setOrderCode("BX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equRepairOrder.setCreateTime(DateUtils.getNowDate());
equRepairOrder.setCreateBy(SecurityUtils.getUsername());
equRepairOrder.setOrderStatus("待审核");
// HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
// String key = "#header.poolName";
// equRepairOrder.setFactory(request.getHeader(key.substring(8)).replace("ds_",""));
return success("新增报修记录成功!");
} catch (Exception e) {
return error();
}
}
/**
*
*
* @param equRepairWorkOrder
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult getMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder) {
try {
if (equRepairWorkOrder.getWorkPlanTimeArray() != null) {
// 设置创建日期开始和结束值
if (equRepairWorkOrder.getWorkPlanTimeArray().size() == 2) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
equRepairWorkOrder.setWorkPlanTimeStart(formatter.format(equRepairWorkOrder.getWorkPlanTimeArray().get(0)));
equRepairWorkOrder.setWorkPlanTimeEnd(formatter.format(equRepairWorkOrder.getWorkPlanTimeArray().get(1)));
}
}
if (equRepairWorkOrder.getWorkPlanDownTimeArray() != null) {
// 设置更新日期开始和结束
if (equRepairWorkOrder.getWorkPlanDownTimeArray().size() == 2) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
equRepairWorkOrder.setWorkPlanDownTimeStart(formatter.format(equRepairWorkOrder.getWorkPlanDownTimeArray().get(0)));
equRepairWorkOrder.setWorkPlanDownTimeEnd(formatter.format(equRepairWorkOrder.getWorkPlanDownTimeArray().get(1)));
}
}
List<EquRepairWorkOrder> list = equRepairWorkOrderMapper.selectEquRepairWorkOrderList(equRepairWorkOrder);
return success(list);
} catch (Exception e) {
return error();
}
}
/**
*
*
* @param equTeamUser
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult getMaintenancePerson(EquTeamUser equTeamUser) {
try {
List<EquTeamUser> list = equRepairWorkOrderMapper.getMaintenancePersonList(equTeamUser);
return success(list);
} catch (Exception e) {
return error();
}
}
/**
*
*
* @param equRepairWorkOrder
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult updateDowntime(EquRepairWorkOrder equRepairWorkOrder) {
try {
if(equRepairWorkOrder.getWorkDownMachine().equals("0")){
equRepairWorkOrder.setWorkPlanDownTime(null);
}
equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername());
equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate());
equRepairWorkOrderMapper.updateEquRepairWorkOrder(equRepairWorkOrder);
return success("提交成功,开始维修!");
} catch (Exception e) {
return error();
}
}
}

@ -1,22 +1,21 @@
package com.op.device.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.domain.BaseFileData;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.device.domain.EquEquipment;
import com.op.device.domain.EquOutsourceWork;
import com.op.device.domain.EquRepairWorkOrder;
import com.op.device.mapper.EquEquipmentMapper;
import com.op.device.mapper.EquOutsourceWorkMapper;
import com.op.device.mapper.EquRepairWorkOrderMapper;
import com.op.device.domain.*;
import com.op.device.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.device.mapper.EquRepairOrderMapper;
import com.op.device.domain.EquRepairOrder;
import com.op.device.service.IEquRepairOrderService;
import org.springframework.util.CollectionUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@ -41,6 +40,9 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
@Autowired
private EquOutsourceWorkMapper equOutsourceWorkMapper;
@Autowired
private EquFileMapper equFileMapper;
/**
*
*
@ -50,7 +52,12 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
@Override
@DS("#header.poolName")
public EquRepairOrder selectEquRepairOrderByOrderId(String orderId) {
return equRepairOrderMapper.selectEquRepairOrderByOrderId(orderId);
EquRepairOrder list = equRepairOrderMapper.selectEquRepairOrderByOrderId(orderId);
List<EquFile> files = equFileMapper.getEquFileBatch(orderId);
if (!CollectionUtils.isEmpty(files)) {
list.setFiles(files);
}
return list;
}
/**
@ -83,9 +90,28 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
equRepairOrder.setCreateTime(DateUtils.getNowDate());
equRepairOrder.setCreateBy(SecurityUtils.getUsername());
equRepairOrder.setOrderStatus("待审核");
// HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
// String key = "#header.poolName";
// equRepairOrder.setFactory(request.getHeader(key.substring(8)).replace("ds_",""));
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
//设备报修上传图片
if (StringUtils.isNotEmpty(equRepairOrder.getFileList())) {
String[] ids = equRepairOrder.getFileList().split(",");
List<BaseFileData> files = new ArrayList<>();
BaseFileData file = null;
for (String id : ids) {
file = new BaseFileData();
file.setFileId(IdUtils.fastSimpleUUID());
file.setFileName(id.split("&fileName=")[1]);
file.setFileAddress(id);
file.setSourceId(equRepairOrder.getOrderId());
file.setCreateBy(SecurityUtils.getUsername());
file.setCreateTime(new Date());
files.add(file);
}
equFileMapper.insertEquFileBatch(files);
}
return equRepairOrderMapper.insertEquRepairOrder(equRepairOrder);
}
@ -173,6 +199,24 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
@Override
@DS("#header.poolName")
public int updateEquRepairOrder(EquRepairOrder equRepairOrder) {
equFileMapper.deleteEquFileBySourceId(equRepairOrder.getOrderId());
//上传附件
if (StringUtils.isNotEmpty(equRepairOrder.getFileList())) {
String[] ids = equRepairOrder.getFileList().split(",");
List<BaseFileData> files = new ArrayList<>();
BaseFileData file = null;
for (String id : ids) {
file = new BaseFileData();
file.setFileId(IdUtils.fastSimpleUUID());
file.setFileAddress(id);
file.setFileName(id.split("&fileName=")[1]);
file.setSourceId(equRepairOrder.getOrderId());
file.setCreateBy(SecurityUtils.getUsername());
file.setCreateTime(new Date());
files.add(file);
}
equFileMapper.insertEquFileBatch(files);
}
equRepairOrder.setUpdateTime(DateUtils.getNowDate());
equRepairOrder.setUpdateBy(SecurityUtils.getUsername());
return equRepairOrderMapper.updateEquRepairOrder(equRepairOrder);

@ -7,8 +7,8 @@ import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.device.domain.EquEquipment;
import com.op.device.domain.EquOutsourceWork;
import com.op.device.domain.EquTeamUser;
import com.op.device.mapper.EquOutsourceWorkMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -90,7 +90,6 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
//维修单号
equRepairWorkOrder.setOrderCode("无");
equRepairWorkOrder.setOutWorkCode("无");
equRepairWorkOrder.setWorkStatus("待维修");
equRepairWorkOrder.setWorkCode("WX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equRepairWorkOrder.setCreateBy(SecurityUtils.getUsername());
equRepairWorkOrder.setCreateTime(DateUtils.getNowDate());
@ -144,8 +143,8 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
//获取维人员列表
@Override
public List<EquEquipment> getMaintenancePersonList(EquEquipment equEquipment) {
return equRepairWorkOrderMapper.getMaintenancePersonList(equEquipment);
public List<EquTeamUser> getMaintenancePersonList(EquTeamUser equTeamUser) {
return equRepairWorkOrderMapper.getMaintenancePersonList(equTeamUser);
}
//委外申请

@ -7,11 +7,16 @@ import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.device.domain.EquRepairWorkOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.device.mapper.EquSpareApplyMapper;
import com.op.device.domain.EquSpareApply;
import com.op.device.service.IEquSpareApplyService;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/**
* Service
@ -66,6 +71,10 @@ public class EquSpareApplyServiceImpl implements IEquSpareApplyService {
@DS("#header.poolName")
public int insertEquSpareApply(EquSpareApply equSpareApply) {
equSpareApply.setApplyId(IdUtils.fastSimpleUUID());
//工厂号
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equSpareApply.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
equSpareApply.setCreateTime(DateUtils.getNowDate());
equSpareApply.setCreateBy(SecurityUtils.getUsername());
return equSpareApplyMapper.insertEquSpareApply(equSpareApply);
@ -108,4 +117,13 @@ public class EquSpareApplyServiceImpl implements IEquSpareApplyService {
public int deleteEquSpareApplyByApplyId(String applyId) {
return equSpareApplyMapper.deleteEquSpareApplyByApplyId(applyId);
}
/**
*
*/
@Override
@DS("#header.poolName")
public List<EquSpareApply> selectRepairSparePartsRecord(EquRepairWorkOrder equRepairWorkOrder) {
return equSpareApplyMapper.selectRepairSparePartsRecord(equRepairWorkOrder);
}
}

@ -1,16 +1,29 @@
package com.op.device.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils;
import com.op.device.domain.EquTeamUser;
import com.op.device.mapper.EquTeamUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.device.mapper.EquTeamMapper;
import com.op.device.domain.EquTeam;
import com.op.device.service.IEquTeamService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import com.op.common.core.web.domain.AjaxResult;
import javax.servlet.http.HttpServletRequest;
import static com.op.common.core.web.domain.AjaxResult.error;
import static com.op.common.core.web.domain.AjaxResult.success;
/**
* Service
@ -22,6 +35,8 @@ import com.op.device.service.IEquTeamService;
public class EquTeamServiceImpl implements IEquTeamService {
@Autowired
private EquTeamMapper equTeamMapper;
@Autowired
private EquTeamUserMapper equTeamUserMapper;
/**
*
@ -32,6 +47,11 @@ public class EquTeamServiceImpl implements IEquTeamService {
@Override
@DS("#header.poolName")
public EquTeam selectEquTeamById(String id) {
EquTeamUser equTeamUser = new EquTeamUser();
equTeamUser.setTeamId(id);
List<EquTeamUser> equTeamUser1 = equTeamUserMapper.selectEquTeamUserList(equTeamUser);
EquTeam equTeam = equTeamMapper.selectEquTeamById(id);
equTeam.setSelectedData(equTeamUser1);
return equTeamMapper.selectEquTeamById(id);
}
@ -54,12 +74,40 @@ public class EquTeamServiceImpl implements IEquTeamService {
* @return
*/
@Override
@Transactional
@DS("#header.poolName")
public int insertEquTeam(EquTeam equTeam) {
equTeam.setId(IdUtils.fastSimpleUUID());
equTeam.setCreateTime(DateUtils.getNowDate());
equTeam.setCreateBy(SecurityUtils.getUsername());
return equTeamMapper.insertEquTeam(equTeam);
public AjaxResult insertEquTeam(EquTeam equTeam) {
try{
equTeam.setId(IdUtils.fastSimpleUUID());
equTeam.setCreateTime(DateUtils.getNowDate());
equTeam.setCreateBy(SecurityUtils.getUsername());
//工厂号
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equTeam.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
equTeamMapper.insertEquTeam(equTeam);
//新增设备班组人员信息
String teamId = equTeam.getId();
for(int i = 0 ; i < equTeam.getRightData().size() ; i++){
EquTeamUser equTeamUser = new EquTeamUser();
equTeamUser.setCreateBy(SecurityUtils.getUsername());
equTeamUser.setCreateTime(DateUtils.getNowDate());
equTeamUser.setTeamId(teamId);
equTeamUser.setTeamCode(equTeam.getTeamCode());
equTeamUser.setId(IdUtils.fastSimpleUUID());
List<String> list = new ArrayList<>();
list = equTeam.getRightData();
String userId = list.get(i);
equTeamUser.setUserId(userId);
EquTeamUser memberList = equTeamMapper.selectTeamMember(equTeamUser);
equTeamUser.setUserName(memberList.getUserName());
equTeamUser.setNickName(memberList.getNickName());
equTeamUserMapper.insertEquTeamUser(equTeamUser);
}
return success("新增设备班组成功!");
}catch (Exception e) {
return error();
}
}
/**
@ -70,10 +118,32 @@ public class EquTeamServiceImpl implements IEquTeamService {
*/
@Override
@DS("#header.poolName")
public int updateEquTeam(EquTeam equTeam) {
equTeam.setUpdateTime(DateUtils.getNowDate());
equTeam.setUpdateBy(SecurityUtils.getUsername());
return equTeamMapper.updateEquTeam(equTeam);
@Transactional
public AjaxResult updateEquTeam(EquTeam equTeam) {
try{
equTeam.setUpdateTime(DateUtils.getNowDate());
equTeam.setUpdateBy(SecurityUtils.getUsername());
equTeamMapper.updateEquTeam(equTeam);
for(int i = 0;i<equTeam.getRightData().size();i++){
EquTeamUser equTeamUser = new EquTeamUser();
equTeamUser.setCreateBy(SecurityUtils.getUsername());
equTeamUser.setCreateTime(DateUtils.getNowDate());
equTeamUser.setTeamId(equTeam.getId());
equTeamUser.setTeamCode(equTeam.getTeamCode());
equTeamUser.setId(IdUtils.fastSimpleUUID());
List<String> list = new ArrayList<>();
list = equTeam.getRightData();
String userId = list.get(i);
equTeamUser.setUserId(userId);
String userName = equTeamUserMapper.selectUserName(equTeamUser);
//判断班组人员有没有变动 挨个遍历
equTeamUser.setUserName(userName);
equTeamUserMapper.insertEquTeamUser(equTeamUser);
}
return success("修改设备班组成功!");
}catch (Exception e) {
return error();
}
}
/**
@ -108,4 +178,16 @@ public class EquTeamServiceImpl implements IEquTeamService {
public List<EquTeam> getMaintenanceTeamList(EquTeam equTeam) {
return equTeamMapper.getMaintenanceTeamList(equTeam);
}
/**
*
*
* @param equTeamUser
* @return
*/
@Override
@DS("#master")
public List<EquTeamUser> selectTeamMembers(EquTeamUser equTeamUser){
return equTeamMapper.selectTeamMembers(equTeamUser);
}
}

@ -0,0 +1,157 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.device.mapper.EquFileMapper">
<resultMap type="EquFile" id="EquFileResult">
<result property="fileId" column="file_id" />
<result property="fileName" column="file_name" />
<result property="fileAddress" column="file_address" />
<result property="sourceId" column="source_id" />
<result property="remark" column="remark" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="attr4" column="attr4" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="imageType" column="image_type" />
</resultMap>
<sql id="selectEquFileVo">
select file_id, file_name, file_address, source_id, remark, attr1,
attr2, attr3, attr4, create_by, create_time, update_by,
update_time,image_type from base_file
</sql>
<select id="selectEquFileList" parameterType="EquFile" resultMap="EquFileResult">
<include refid="selectEquFileVo"/>
<where>
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
<if test="fileAddress != null and fileAddress != ''"> and file_address = #{fileAddress}</if>
<if test="sourceId != null and sourceId != ''"> and source_id = #{sourceId}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null "> and attr3 = #{attr3}</if>
<if test="attr4 != null "> and attr4 = #{attr4}</if>
<if test="imageType != null "> and image_type = #{imageType}</if>
</where>
</select>
<select id="selectEquFileByFileId" parameterType="String" resultMap="EquFileResult">
<include refid="selectEquFileVo"/>
where file_id = #{fileId}
</select>
<select id="getEquFileBatch" resultMap="EquFileResult">
<include refid="selectEquFileVo"/>
where source_id = #{sourceId}
</select>
<select id="getImageFileBatch" resultMap="EquFileResult">
<include refid="selectEquFileVo"/>
where source_id = #{sourceId}
and image_type = #{imageType}
</select>
<select id="getQrFileBatch" resultMap="EquFileResult">
<include refid="selectEquFileVo"/>
where source_id = #{sourceId}
and image_type = #{imageType}
</select>
<select id="getBarcodeFileBatch" resultMap="EquFileResult">
<include refid="selectEquFileVo"/>
where source_id = #{sourceId}
and image_type = #{imageType}
</select>
<insert id="insertEquFile" parameterType="EquFile">
insert into base_file
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fileId != null">file_id,</if>
<if test="fileName != null">file_name,</if>
<if test="fileAddress != null">file_address,</if>
<if test="sourceId != null">source_id,</if>
<if test="remark != null">remark,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="attr4 != null">attr4,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="imageType != null">image_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fileId != null">#{fileId},</if>
<if test="fileName != null">#{fileName},</if>
<if test="fileAddress != null">#{fileAddress},</if>
<if test="sourceId != null">#{sourceId},</if>
<if test="remark != null">#{remark},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="attr4 != null">#{attr4},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="imageType != null">{imageType},</if>
</trim>
</insert>
<insert id="insertEquFileBatch">
INSERT INTO base_file(file_id, file_name, file_address, source_id, remark, create_by, create_time)
VALUES
<foreach collection="baseFiles" index="" item="baseFile" separator=",">
(
#{baseFile.fileId},
#{baseFile.fileName},
#{baseFile.fileAddress},
#{baseFile.sourceId},
#{baseFile.remark},
#{baseFile.createBy},
#{baseFile.createTime}
)
</foreach>
</insert>
<update id="updateEquFile" parameterType="EquFile">
update base_file
<trim prefix="SET" suffixOverrides=",">
<if test="fileName != null">file_name = #{fileName},</if>
<if test="fileAddress != null">file_address = #{fileAddress},</if>
<if test="sourceId != null">source_id = #{sourceId},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="attr4 != null">attr4 = #{attr4},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where file_id = #{fileId}
</update>
<delete id="deleteEquFileByFileId" parameterType="String">
delete from base_file where file_id = #{fileId}
</delete>
<delete id="deleteEquFileByFileIds" parameterType="String">
delete from base_file where file_id in
<foreach item="fileId" collection="array" open="(" separator="," close=")">
#{fileId}
</foreach>
</delete>
<delete id="deleteEquFileBySourceId">
delete from base_file where source_id = #{sourceId}
</delete>
</mapper>

@ -175,11 +175,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteEquOutsourceWorkByWorkId" parameterType="String">
delete from equ_outsource_work where work_id = #{workId}
update equ_outsource_work
set del_flag = '1'
where work_id = #{workId}
</delete>
<delete id="deleteEquOutsourceWorkByWorkIds" parameterType="String">
delete from equ_outsource_work where work_id in
update equ_outsource_work
set del_flag = '1'
where work_id in
<foreach item="workId" collection="array" open="(" separator="," close=")">
#{workId}
</foreach>

@ -203,12 +203,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where order_id = #{orderId}
</update>
<!--物理删除改为逻辑删除-->
<delete id="deleteEquRepairOrderByOrderId" parameterType="String">
delete from equ_repair_order where order_id = #{orderId}
update equ_repair_order
set del_flag = '1'
where order_id = #{orderId}
</delete>
<!--物理删除改为逻辑删除-->
<delete id="deleteEquRepairOrderByOrderIds" parameterType="String">
delete from equ_repair_order where order_id in
update equ_repair_order
set del_flag = '1'
where order_id in
<foreach item="orderId" collection="array" open="(" separator="," close=")">
#{orderId}
</foreach>
@ -221,7 +227,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and del_flag = '0'
</select>
<select id="getRepairPersonList" parameterType="EquPerson" resultType="com.op.device.domain.EquPerson">
<select id="getRepairPersonList" parameterType="EquTeamUser" resultType="com.op.device.domain.EquTeamUser">
select
user_id AS userId,
user_name AS userName,

@ -306,12 +306,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and del_flag = '0'
</update>
<!--物理删除改为逻辑删除-->
<delete id="deleteEquRepairWorkOrderByWorkId" parameterType="String">
delete from equ_repair_work_order where work_id = #{workId}
update equ_repair_work_order
set del_flag = '1'
where work_id = #{workId}
</delete>
<!--物理删除改为逻辑删除-->
<delete id="deleteEquRepairWorkOrderByWorkIds" parameterType="String">
delete from equ_repair_work_order where work_id in
update equ_repair_work_order
set del_flag = '1'
where work_id in
<foreach item="workId" collection="array" open="(" separator="," close=")">
#{workId}
</foreach>
@ -323,7 +329,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where del_flag = '0'
</select>
<select id="getMaintenancePersonList" parameterType="EquPerson" resultType="com.op.device.domain.EquPerson">
<select id="getMaintenancePersonList" parameterType="EquTeamUser" resultType="com.op.device.domain.EquTeamUser">
select
su.user_id AS userId,
su.user_name AS userName,

@ -7,7 +7,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="EquSpareApply" id="EquSpareApplyResult">
<result property="applyId" column="apply_id" />
<result property="applyCode" column="apply_code" />
<result property="workCode" column="work_code" />
<result property="parentCode" column="parent_code" />
<result property="spareCode" column="spare_code" />
<result property="applyType" column="apply_type" />
<result property="spareName" column="spare_name" />
<result property="spareModel" column="spare_model" />
<result property="spareQuantity" column="spare_quantity" />
@ -25,16 +28,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="factoryCode" column="factory_code" />
</resultMap>
<sql id="selectEquSpareApplyVo">
select apply_id, apply_code, spare_code, spare_name, spare_model, spare_quantity, spare_group_line, spare_use_equipment, apply_time, apply_people, apply_approve_people, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time, factory_code from equ_spare_apply
select apply_id, apply_code, work_code,parent_code,apply_type,spare_code, spare_name, spare_model, spare_quantity, spare_group_line, spare_use_equipment, apply_time, apply_people, apply_approve_people, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time, factory_code from equ_spare_apply
</sql>
<select id="selectEquSpareApplyList" parameterType="EquSpareApply" resultMap="EquSpareApplyResult">
<include refid="selectEquSpareApplyVo"/>
<where>
<if test="applyCode != null and applyCode != ''"> and apply_code like concat('%', #{applyCode}, '%')</if>
<if test="workCode != null and workCode != ''"> and work_code like concat('%', #{workCode}, '%')</if>
<if test="parentCode != null and parentCode != ''"> and parent_code like concat('%', #{parentCode}, '%')</if>
<if test="applyType != null and applyType != ''"> and apply_type like concat('%', #{applytype}, '%')</if>
<if test="spareCode != null and spareCode != ''"> and spare_code like concat('%', #{spareCode}, '%')</if>
<if test="spareName != null and spareName != ''"> and spare_name like concat('%', #{spareName}, '%')</if>
<if test="spareModel != null and spareModel != ''"> and spare_model like concat('%', #{spareModel}, '%')</if>
@ -65,6 +72,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="applyId != null">apply_id,</if>
<if test="applyCode != null">apply_code,</if>
<if test="workCode != null">work_code,</if>
<if test="parentCode != null">parent_code,</if>
<if test="applyType != null">apply_type,</if>
<if test="spareCode != null">spare_code,</if>
<if test="spareName != null">spare_name,</if>
<if test="spareModel != null">spare_model,</if>
@ -87,6 +97,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="applyId != null">#{applyId},</if>
<if test="applyCode != null">#{applyCode},</if>
<if test="workCode != null">#{workCode},</if>
<if test="parentCode != null">#{parentCode},</if>
<if test="applyType != null">#{applyType},</if>
<if test="spareCode != null">#{spareCode},</if>
<if test="spareName != null">#{spareName},</if>
<if test="spareModel != null">#{spareModel},</if>
@ -112,6 +125,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update equ_spare_apply
<trim prefix="SET" suffixOverrides=",">
<if test="applyCode != null">apply_code = #{applyCode},</if>
<if test="workCode != null">work_code = #{workCode},</if>
<if test="parentCode != null">parent_code = #{parentCode},</if>
<if test="applyType != null">apply_type = #{applyType},</if>
<if test="spareCode != null">spare_code = #{spareCode},</if>
<if test="spareName != null">spare_name = #{spareName},</if>
<if test="spareModel != null">spare_model = #{spareModel},</if>
@ -134,14 +150,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where apply_id = #{applyId}
</update>
<!--物理删除改为逻辑删除-->
<delete id="deleteEquSpareApplyByApplyId" parameterType="String">
delete from equ_spare_apply where apply_id = #{applyId}
update equ_spare_apply
set del_flag = '1'
where apply_id = #{applyId}
</delete>
<!--物理删除改为逻辑删除-->
<delete id="deleteEquSpareApplyByApplyIds" parameterType="String">
delete from equ_spare_apply where apply_id in
update equ_spare_apply
set del_flag = '1'
where apply_id in
<foreach item="applyId" collection="array" open="(" separator="," close=")">
#{applyId}
</foreach>
</delete>
<select id="selectRepairSparePartsRecord" parameterType="EquRepairWorkOrder" resultMap="EquSpareApplyResult">
<include refid="selectEquSpareApplyVo"/>
where del_flag = '0'
and work_code = #{workCode}
ORDER BY apply_time DESC
</select>
</mapper>

@ -89,11 +89,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteEquTeamById" parameterType="String">
delete from equ_team where id = #{id}
update equ_team
set del_flag = '1'
where id = #{id}
</delete>
<delete id="deleteEquTeamByIds" parameterType="String">
delete from equ_team where id in
update equ_team
set del_flag = '1'
where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
@ -105,4 +109,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and team_type = '维修班组'
</select>
<select id="getMaintenancePerson" parameterType="EquTeam" resultType="com.op.device.domain.EquTeamUser">
select
user_id AS userId,
user_name AS userName,
nick_name AS nickName,
CONCAT(nick_name,user_name) AS teamUserName
from sys_user
where del_flag = '0'
</select>
<select id="selectTeamMembers" parameterType="EquTeamUser" resultType="com.op.device.domain.EquTeamUser">
select
user_id AS userId,
user_name AS userName,
nick_name AS nickName,
CONCAT(nick_name,user_name) AS teamUserName
from sys_user
where del_flag = '0'
</select>
</mapper>

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.device.mapper.EquTeamUserMapper">
<resultMap type="EquTeamUser" id="EquTeamUserResult">
<result property="id" column="id" />
<result property="teamId" column="team_id" />
<result property="teamCode" column="team_code" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectEquTeamUserVo">
select id, team_id, team_code, user_id, user_name, create_by, create_time, update_by, update_time from equ_team_user
</sql>
<select id="selectEquTeamUserList" parameterType="EquTeamUser" resultMap="EquTeamUserResult">
<include refid="selectEquTeamUserVo"/>
<where>
<if test="teamId != null and teamId != ''"> and team_id = #{teamId}</if>
<if test="teamCode != null and teamCode != ''"> and team_code = #{teamCode}</if>
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
</where>
</select>
<select id="selectEquTeamUserById" parameterType="String" resultMap="EquTeamUserResult">
<include refid="selectEquTeamUserVo"/>
where id = #{id}
</select>
<insert id="insertEquTeamUser" parameterType="EquTeamUser">
insert into equ_team_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="teamId != null and teamId != ''">team_id,</if>
<if test="teamCode != null">team_code,</if>
<if test="userId != null">user_id,</if>
<if test="userName != null">user_name,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="teamId != null and teamId != ''">#{teamId},</if>
<if test="teamCode != null">#{teamCode},</if>
<if test="userId != null">#{userId},</if>
<if test="userName != null">#{userName},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateEquTeamUser" parameterType="EquTeamUser">
update equ_team_user
<trim prefix="SET" suffixOverrides=",">
<if test="teamId != null and teamId != ''">team_id = #{teamId},</if>
<if test="teamCode != null">team_code = #{teamCode},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="userName != null">user_name = #{userName},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEquTeamUserById" parameterType="String">
delete from equ_team_user where id = #{id}
</delete>
<delete id="deleteEquTeamUserByTeamId" parameterType="String">
delete from equ_team_user where team_id = #{teamId}
</delete>
<delete id="deleteEquTeamUserByIds" parameterType="String">
delete from equ_team_user where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectTeamMembers" parameterType="EquTeamUser" resultMap="EquTeamUserResult">
select
user_id,
user_name,
nick_name,
CONCAT(nick_name,user_name) AS teamUserName
from sys_user
</select>
<select id="selectTeamMember" parameterType="EquTeamUser" resultMap="EquTeamUserResult">
select
user_id,
user_name,
nick_name,
CONCAT(nick_name,user_name) AS teamUserName
from sys_user
where user_id = #{userId}
</select>
<select id="selectTeamMembersNameById" parameterType="EquTeamUser" resultType="java.lang.String">
select user_name
from sys_user su
where su.id = #{id}
</select>
<select id="selectTeamMembersIds" parameterType="EquTeamUser" resultType="java.lang.String">
select user_id
from equ_team_user
</select>
<select id="selectId" parameterType="EquTeamUser" resultType="java.lang.String">
select id
from equ_team_user
where user_id = #{userId}
and team_id = #{teamId}
</select>
<select id="selectUserName" parameterType="EquTeamUser" resultType="java.lang.String">
select user_name
from sys_user
where user_id = #{userId}
</select>
<delete id="deleteEquTeamUserByTeamIds" parameterType="String">
delete from equ_team_user where team_id in
<foreach item="teamId" collection="array" open="(" separator="," close=")">
#{teamId}
</foreach>
</delete>
</mapper>

@ -5,9 +5,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.op.device.mapper.SparePartsLedgerMapper">
<resultMap type="SparePartsLedger" id="SparePartsLedgerResult">
<result property="storageId" column="storage_id" />
<result property="storageType" column="storage_type" />
<result property="materialCode" column="material_code" />
<result property="materialDesc" column="material_desc" />
<result property="amount" column="amount" />
<result property="storageAmount" column="storage_amount" />
<result property="storageType" column="storage_type" />
<result property="spareUseLife" column="spare_use_life" />
<result property="spareName" column="spare_name" />
@ -32,7 +35,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectSparePartsLedgerVo">
select storage_type, material_code, material_desc, amount,sap_factory_code, wl_name, del_flag, spare_use_life, spare_name, spare_mode, spare_manufacturer, spare_supplier, spare_replacement_cycle, spare_measurement_unit, spare_conversion_unit, spare_conversion_ratio, spare_inventory_floor, spare_inventory_upper,spare_type,create_by, gmt_create, last_modified_by, gmt_modified, active_flag, factory_code from wms_ods_mate_storage_news
select
storage_id,
storage_type,
material_code,
material_desc,
amount,
storage_amount,
sap_factory_code,
wl_name,
del_flag,
spare_use_life,
spare_name,
spare_mode,
spare_manufacturer,
spare_supplier,
spare_replacement_cycle,
spare_measurement_unit,
spare_conversion_unit,
spare_conversion_ratio,
spare_inventory_floor,
spare_inventory_upper,
spare_type,
create_by,
gmt_create,
last_modified_by,
gmt_modified,
active_flag,
factory_code
from wms_ods_mate_storage_news
</sql>
<select id="selectSparePartsLedgerList" parameterType="SparePartsLedger" resultMap="SparePartsLedgerResult">

Loading…
Cancel
Save