移动端交互代码
This commit is contained in:
parent
c74b73cefe
commit
b6ec8ceeff
@ -0,0 +1,35 @@
|
||||
package com.ktg.mes.md.controller;
|
||||
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
import com.ktg.mes.md.domain.MdProductSop;
|
||||
import com.ktg.mes.md.service.IMdProductSopService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/mobile/md/sop")
|
||||
public class MdProductSOPMobController extends BaseController {
|
||||
@Autowired
|
||||
private IMdProductSopService mdProductSopService;
|
||||
|
||||
/**
|
||||
* 查询产品SOP列表
|
||||
*/
|
||||
@ApiOperation("查询产品SOP信息")
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:sop:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(MdProductSop mdProdutSop)
|
||||
{
|
||||
startPage();
|
||||
List<MdProductSop> list = mdProductSopService.selectMdProductSopList(mdProdutSop);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,122 @@
|
||||
package com.ktg.mes.pro.controller;
|
||||
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import com.ktg.mes.md.domain.MdWorkstation;
|
||||
import com.ktg.mes.md.service.IMdWorkstationService;
|
||||
import com.ktg.mes.pro.domain.ProFeedback;
|
||||
import com.ktg.mes.pro.service.IProFeedbackService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Api("生产报工")
|
||||
@RestController
|
||||
@RequestMapping("/mobile/pro/feedback")
|
||||
public class ProFeedBackMobController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IProFeedbackService proFeedbackService;
|
||||
|
||||
@Autowired
|
||||
private IMdWorkstationService mdWorkstationService;
|
||||
|
||||
|
||||
/**
|
||||
* 新增生产报工记录
|
||||
*/
|
||||
@ApiOperation("新增报工单接口")
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:add')")
|
||||
@Log(title = "生产报工记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ProFeedback proFeedback)
|
||||
{
|
||||
MdWorkstation workstation = mdWorkstationService.selectMdWorkstationByWorkstationId(proFeedback.getWorkstationId());
|
||||
if(StringUtils.isNotNull(workstation)){
|
||||
proFeedback.setProcessId(workstation.getProcessId());
|
||||
proFeedback.setProcessCode(workstation.getProcessCode());
|
||||
proFeedback.setProcessName(workstation.getProcessName());
|
||||
}else {
|
||||
return AjaxResult.error("当前生产任务对应的工作站不存在!");
|
||||
}
|
||||
proFeedbackService.insertProFeedback(proFeedback);
|
||||
return AjaxResult.success(proFeedback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产报工记录列表
|
||||
*/
|
||||
@ApiOperation("查询报工单清单-全部")
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProFeedback proFeedback)
|
||||
{
|
||||
List<ProFeedback> list = proFeedbackService.selectProFeedbackList(proFeedback);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产报工记录列表
|
||||
*/
|
||||
@ApiOperation("查询报工单清单-未审批通过的")
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:list')")
|
||||
@GetMapping("/listUnApproved")
|
||||
public TableDataInfo listUnApproved(ProFeedback proFeedback)
|
||||
{
|
||||
List<ProFeedback> all = new ArrayList<ProFeedback>();
|
||||
proFeedback.setStatus(UserConstants.ORDER_STATUS_PREPARE);
|
||||
List<ProFeedback> list1 = proFeedbackService.selectProFeedbackList(proFeedback);
|
||||
all.addAll(list1);
|
||||
proFeedback.setStatus(UserConstants.ORDER_STATUS_APPROVING);
|
||||
List<ProFeedback> list2 = proFeedbackService.selectProFeedbackList(proFeedback);
|
||||
all.addAll(list2);
|
||||
return getDataTable(all);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询生产报工记录列表
|
||||
*/
|
||||
@ApiOperation("查询报工单清单-已审批通过的")
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:list')")
|
||||
@GetMapping("/listApproved")
|
||||
public TableDataInfo listApproved(ProFeedback proFeedback)
|
||||
{
|
||||
proFeedback.setStatus(UserConstants.ORDER_STATUS_FINISHED);
|
||||
List<ProFeedback> list = proFeedbackService.selectProFeedbackList(proFeedback);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产报工记录
|
||||
*/
|
||||
@ApiOperation("报工修改接口")
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:edit')")
|
||||
@Log(title = "生产报工记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ProFeedback proFeedback)
|
||||
{
|
||||
return toAjax(proFeedbackService.updateProFeedback(proFeedback));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产报工记录
|
||||
*/
|
||||
@ApiOperation("删除报工单")
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:remove')")
|
||||
@Log(title = "生产报工记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] recordIds)
|
||||
{
|
||||
return toAjax(proFeedbackService.deleteProFeedbackByRecordIds(recordIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,199 @@
|
||||
package com.ktg.mes.pro.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 用户工作站绑定关系对象 pro_user_workstation
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2023-02-20
|
||||
*/
|
||||
public class ProUserWorkstation extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录ID */
|
||||
private Long recordId;
|
||||
|
||||
/** 用户ID */
|
||||
@Excel(name = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/** 用户名 */
|
||||
@Excel(name = "用户名")
|
||||
private String userName;
|
||||
|
||||
/** 名称 */
|
||||
@Excel(name = "名称")
|
||||
private Long nickName;
|
||||
|
||||
/** 工作站ID */
|
||||
@Excel(name = "工作站ID")
|
||||
private Long workstationId;
|
||||
|
||||
/** 工作站编号 */
|
||||
@Excel(name = "工作站编号")
|
||||
private String workstationCode;
|
||||
|
||||
/** 工作站名称 */
|
||||
@Excel(name = "工作站名称")
|
||||
private String workstationName;
|
||||
|
||||
/** 操作时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date operationTime;
|
||||
|
||||
/** 预留字段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 setRecordId(Long recordId)
|
||||
{
|
||||
this.recordId = recordId;
|
||||
}
|
||||
|
||||
public Long getRecordId()
|
||||
{
|
||||
return recordId;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setUserName(String userName)
|
||||
{
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
public void setNickName(Long nickName)
|
||||
{
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
public Long getNickName()
|
||||
{
|
||||
return nickName;
|
||||
}
|
||||
public void setWorkstationId(Long workstationId)
|
||||
{
|
||||
this.workstationId = workstationId;
|
||||
}
|
||||
|
||||
public Long getWorkstationId()
|
||||
{
|
||||
return workstationId;
|
||||
}
|
||||
public void setWorkstationCode(String workstationCode)
|
||||
{
|
||||
this.workstationCode = workstationCode;
|
||||
}
|
||||
|
||||
public String getWorkstationCode()
|
||||
{
|
||||
return workstationCode;
|
||||
}
|
||||
public void setWorkstationName(String workstationName)
|
||||
{
|
||||
this.workstationName = workstationName;
|
||||
}
|
||||
|
||||
public String getWorkstationName()
|
||||
{
|
||||
return workstationName;
|
||||
}
|
||||
public void setOperationTime(Date operationTime)
|
||||
{
|
||||
this.operationTime = operationTime;
|
||||
}
|
||||
|
||||
public Date getOperationTime()
|
||||
{
|
||||
return operationTime;
|
||||
}
|
||||
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("recordId", getRecordId())
|
||||
.append("userId", getUserId())
|
||||
.append("userName", getUserName())
|
||||
.append("nickName", getNickName())
|
||||
.append("workstationId", getWorkstationId())
|
||||
.append("workstationCode", getWorkstationCode())
|
||||
.append("workstationName", getWorkstationName())
|
||||
.append("operationTime", getOperationTime())
|
||||
.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();
|
||||
}
|
||||
}
|
209
ktg-mes/src/main/java/com/ktg/mes/pro/domain/ProWorkrecord.java
Normal file
209
ktg-mes/src/main/java/com/ktg/mes/pro/domain/ProWorkrecord.java
Normal file
@ -0,0 +1,209 @@
|
||||
package com.ktg.mes.pro.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 上下工记录对象 pro_workrecord
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2023-02-20
|
||||
*/
|
||||
public class ProWorkrecord extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录ID */
|
||||
private Long recordId;
|
||||
|
||||
/** 用户ID */
|
||||
@Excel(name = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/** 用户名 */
|
||||
@Excel(name = "用户名")
|
||||
private String userName;
|
||||
|
||||
/** 名称 */
|
||||
@Excel(name = "名称")
|
||||
private Long nickName;
|
||||
|
||||
/** 工作站ID */
|
||||
@Excel(name = "工作站ID")
|
||||
private Long workstationId;
|
||||
|
||||
/** 工作站编号 */
|
||||
@Excel(name = "工作站编号")
|
||||
private String workstationCode;
|
||||
|
||||
/** 工作站名称 */
|
||||
@Excel(name = "工作站名称")
|
||||
private String workstationName;
|
||||
|
||||
/** 操作类型 */
|
||||
@Excel(name = "操作类型")
|
||||
private String operationFlag;
|
||||
|
||||
/** 操作时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date operationTime;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setRecordId(Long recordId)
|
||||
{
|
||||
this.recordId = recordId;
|
||||
}
|
||||
|
||||
public Long getRecordId()
|
||||
{
|
||||
return recordId;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setUserName(String userName)
|
||||
{
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
public void setNickName(Long nickName)
|
||||
{
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
public Long getNickName()
|
||||
{
|
||||
return nickName;
|
||||
}
|
||||
public void setWorkstationId(Long workstationId)
|
||||
{
|
||||
this.workstationId = workstationId;
|
||||
}
|
||||
|
||||
public Long getWorkstationId()
|
||||
{
|
||||
return workstationId;
|
||||
}
|
||||
public void setWorkstationCode(String workstationCode)
|
||||
{
|
||||
this.workstationCode = workstationCode;
|
||||
}
|
||||
|
||||
public String getWorkstationCode()
|
||||
{
|
||||
return workstationCode;
|
||||
}
|
||||
public void setWorkstationName(String workstationName)
|
||||
{
|
||||
this.workstationName = workstationName;
|
||||
}
|
||||
|
||||
public String getWorkstationName()
|
||||
{
|
||||
return workstationName;
|
||||
}
|
||||
public void setOperationFlag(String operationFlag)
|
||||
{
|
||||
this.operationFlag = operationFlag;
|
||||
}
|
||||
|
||||
public String getOperationFlag()
|
||||
{
|
||||
return operationFlag;
|
||||
}
|
||||
public void setOperationTime(Date operationTime)
|
||||
{
|
||||
this.operationTime = operationTime;
|
||||
}
|
||||
|
||||
public Date getOperationTime()
|
||||
{
|
||||
return operationTime;
|
||||
}
|
||||
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("recordId", getRecordId())
|
||||
.append("userId", getUserId())
|
||||
.append("userName", getUserName())
|
||||
.append("nickName", getNickName())
|
||||
.append("workstationId", getWorkstationId())
|
||||
.append("workstationCode", getWorkstationCode())
|
||||
.append("workstationName", getWorkstationName())
|
||||
.append("operationFlag", getOperationFlag())
|
||||
.append("operationTime", getOperationTime())
|
||||
.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();
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.ktg.mes.pro.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.pro.domain.ProUserWorkstation;
|
||||
|
||||
/**
|
||||
* 用户工作站绑定关系Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2023-02-20
|
||||
*/
|
||||
public interface ProUserWorkstationMapper
|
||||
{
|
||||
/**
|
||||
* 查询用户工作站绑定关系
|
||||
*
|
||||
* @param recordId 用户工作站绑定关系主键
|
||||
* @return 用户工作站绑定关系
|
||||
*/
|
||||
public ProUserWorkstation selectProUserWorkstationByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询用户工作站绑定关系列表
|
||||
*
|
||||
* @param proUserWorkstation 用户工作站绑定关系
|
||||
* @return 用户工作站绑定关系集合
|
||||
*/
|
||||
public List<ProUserWorkstation> selectProUserWorkstationList(ProUserWorkstation proUserWorkstation);
|
||||
|
||||
/**
|
||||
* 新增用户工作站绑定关系
|
||||
*
|
||||
* @param proUserWorkstation 用户工作站绑定关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProUserWorkstation(ProUserWorkstation proUserWorkstation);
|
||||
|
||||
/**
|
||||
* 修改用户工作站绑定关系
|
||||
*
|
||||
* @param proUserWorkstation 用户工作站绑定关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProUserWorkstation(ProUserWorkstation proUserWorkstation);
|
||||
|
||||
/**
|
||||
* 删除用户工作站绑定关系
|
||||
*
|
||||
* @param recordId 用户工作站绑定关系主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProUserWorkstationByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 批量删除用户工作站绑定关系
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProUserWorkstationByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 根据用户名删除所有对应关系
|
||||
* @param userName
|
||||
* @return
|
||||
*/
|
||||
public int deleteByUserName(String userName);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.pro.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.pro.domain.ProWorkrecord;
|
||||
|
||||
/**
|
||||
* 上下工记录Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2023-02-20
|
||||
*/
|
||||
public interface ProWorkrecordMapper
|
||||
{
|
||||
/**
|
||||
* 查询上下工记录
|
||||
*
|
||||
* @param recordId 上下工记录主键
|
||||
* @return 上下工记录
|
||||
*/
|
||||
public ProWorkrecord selectProWorkrecordByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询上下工记录列表
|
||||
*
|
||||
* @param proWorkrecord 上下工记录
|
||||
* @return 上下工记录集合
|
||||
*/
|
||||
public List<ProWorkrecord> selectProWorkrecordList(ProWorkrecord proWorkrecord);
|
||||
|
||||
/**
|
||||
* 新增上下工记录
|
||||
*
|
||||
* @param proWorkrecord 上下工记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProWorkrecord(ProWorkrecord proWorkrecord);
|
||||
|
||||
/**
|
||||
* 修改上下工记录
|
||||
*
|
||||
* @param proWorkrecord 上下工记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProWorkrecord(ProWorkrecord proWorkrecord);
|
||||
|
||||
/**
|
||||
* 删除上下工记录
|
||||
*
|
||||
* @param recordId 上下工记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProWorkrecordByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 批量删除上下工记录
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProWorkrecordByRecordIds(Long[] recordIds);
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.ktg.mes.pro.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.pro.domain.ProUserWorkstation;
|
||||
|
||||
/**
|
||||
* 用户工作站绑定关系Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2023-02-20
|
||||
*/
|
||||
public interface IProUserWorkstationService
|
||||
{
|
||||
/**
|
||||
* 查询用户工作站绑定关系
|
||||
*
|
||||
* @param recordId 用户工作站绑定关系主键
|
||||
* @return 用户工作站绑定关系
|
||||
*/
|
||||
public ProUserWorkstation selectProUserWorkstationByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询用户工作站绑定关系列表
|
||||
*
|
||||
* @param proUserWorkstation 用户工作站绑定关系
|
||||
* @return 用户工作站绑定关系集合
|
||||
*/
|
||||
public List<ProUserWorkstation> selectProUserWorkstationList(ProUserWorkstation proUserWorkstation);
|
||||
|
||||
/**
|
||||
* 新增用户工作站绑定关系
|
||||
*
|
||||
* @param proUserWorkstation 用户工作站绑定关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProUserWorkstation(ProUserWorkstation proUserWorkstation);
|
||||
|
||||
/**
|
||||
* 修改用户工作站绑定关系
|
||||
*
|
||||
* @param proUserWorkstation 用户工作站绑定关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProUserWorkstation(ProUserWorkstation proUserWorkstation);
|
||||
|
||||
/**
|
||||
* 批量删除用户工作站绑定关系
|
||||
*
|
||||
* @param recordIds 需要删除的用户工作站绑定关系主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProUserWorkstationByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除用户工作站绑定关系信息
|
||||
*
|
||||
* @param recordId 用户工作站绑定关系主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProUserWorkstationByRecordId(Long recordId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户名删除所有对应关系
|
||||
* @param userName
|
||||
* @return
|
||||
*/
|
||||
public int deleteByUserName(String userName);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.pro.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.pro.domain.ProWorkrecord;
|
||||
|
||||
/**
|
||||
* 上下工记录Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2023-02-20
|
||||
*/
|
||||
public interface IProWorkrecordService
|
||||
{
|
||||
/**
|
||||
* 查询上下工记录
|
||||
*
|
||||
* @param recordId 上下工记录主键
|
||||
* @return 上下工记录
|
||||
*/
|
||||
public ProWorkrecord selectProWorkrecordByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询上下工记录列表
|
||||
*
|
||||
* @param proWorkrecord 上下工记录
|
||||
* @return 上下工记录集合
|
||||
*/
|
||||
public List<ProWorkrecord> selectProWorkrecordList(ProWorkrecord proWorkrecord);
|
||||
|
||||
/**
|
||||
* 新增上下工记录
|
||||
*
|
||||
* @param proWorkrecord 上下工记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProWorkrecord(ProWorkrecord proWorkrecord);
|
||||
|
||||
/**
|
||||
* 修改上下工记录
|
||||
*
|
||||
* @param proWorkrecord 上下工记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProWorkrecord(ProWorkrecord proWorkrecord);
|
||||
|
||||
/**
|
||||
* 批量删除上下工记录
|
||||
*
|
||||
* @param recordIds 需要删除的上下工记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProWorkrecordByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除上下工记录信息
|
||||
*
|
||||
* @param recordId 上下工记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProWorkrecordByRecordId(Long recordId);
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
package com.ktg.mes.pro.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.pro.mapper.ProUserWorkstationMapper;
|
||||
import com.ktg.mes.pro.domain.ProUserWorkstation;
|
||||
import com.ktg.mes.pro.service.IProUserWorkstationService;
|
||||
|
||||
/**
|
||||
* 用户工作站绑定关系Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2023-02-20
|
||||
*/
|
||||
@Service
|
||||
public class ProUserWorkstationServiceImpl implements IProUserWorkstationService
|
||||
{
|
||||
@Autowired
|
||||
private ProUserWorkstationMapper proUserWorkstationMapper;
|
||||
|
||||
/**
|
||||
* 查询用户工作站绑定关系
|
||||
*
|
||||
* @param recordId 用户工作站绑定关系主键
|
||||
* @return 用户工作站绑定关系
|
||||
*/
|
||||
@Override
|
||||
public ProUserWorkstation selectProUserWorkstationByRecordId(Long recordId)
|
||||
{
|
||||
return proUserWorkstationMapper.selectProUserWorkstationByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户工作站绑定关系列表
|
||||
*
|
||||
* @param proUserWorkstation 用户工作站绑定关系
|
||||
* @return 用户工作站绑定关系
|
||||
*/
|
||||
@Override
|
||||
public List<ProUserWorkstation> selectProUserWorkstationList(ProUserWorkstation proUserWorkstation)
|
||||
{
|
||||
return proUserWorkstationMapper.selectProUserWorkstationList(proUserWorkstation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户工作站绑定关系
|
||||
*
|
||||
* @param proUserWorkstation 用户工作站绑定关系
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertProUserWorkstation(ProUserWorkstation proUserWorkstation)
|
||||
{
|
||||
proUserWorkstation.setCreateTime(DateUtils.getNowDate());
|
||||
return proUserWorkstationMapper.insertProUserWorkstation(proUserWorkstation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户工作站绑定关系
|
||||
*
|
||||
* @param proUserWorkstation 用户工作站绑定关系
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateProUserWorkstation(ProUserWorkstation proUserWorkstation)
|
||||
{
|
||||
proUserWorkstation.setUpdateTime(DateUtils.getNowDate());
|
||||
return proUserWorkstationMapper.updateProUserWorkstation(proUserWorkstation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户工作站绑定关系
|
||||
*
|
||||
* @param recordIds 需要删除的用户工作站绑定关系主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProUserWorkstationByRecordIds(Long[] recordIds)
|
||||
{
|
||||
return proUserWorkstationMapper.deleteProUserWorkstationByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户工作站绑定关系信息
|
||||
*
|
||||
* @param recordId 用户工作站绑定关系主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProUserWorkstationByRecordId(Long recordId)
|
||||
{
|
||||
return proUserWorkstationMapper.deleteProUserWorkstationByRecordId(recordId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户名删除所有对应关系
|
||||
* @param userName
|
||||
* @return
|
||||
*/
|
||||
public int deleteByUserName(String userName){
|
||||
return proUserWorkstationMapper.deleteByUserName(userName);
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.ktg.mes.pro.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.pro.mapper.ProWorkrecordMapper;
|
||||
import com.ktg.mes.pro.domain.ProWorkrecord;
|
||||
import com.ktg.mes.pro.service.IProWorkrecordService;
|
||||
|
||||
/**
|
||||
* 上下工记录Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2023-02-20
|
||||
*/
|
||||
@Service
|
||||
public class ProWorkrecordServiceImpl implements IProWorkrecordService
|
||||
{
|
||||
@Autowired
|
||||
private ProWorkrecordMapper proWorkrecordMapper;
|
||||
|
||||
/**
|
||||
* 查询上下工记录
|
||||
*
|
||||
* @param recordId 上下工记录主键
|
||||
* @return 上下工记录
|
||||
*/
|
||||
@Override
|
||||
public ProWorkrecord selectProWorkrecordByRecordId(Long recordId)
|
||||
{
|
||||
return proWorkrecordMapper.selectProWorkrecordByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询上下工记录列表
|
||||
*
|
||||
* @param proWorkrecord 上下工记录
|
||||
* @return 上下工记录
|
||||
*/
|
||||
@Override
|
||||
public List<ProWorkrecord> selectProWorkrecordList(ProWorkrecord proWorkrecord)
|
||||
{
|
||||
return proWorkrecordMapper.selectProWorkrecordList(proWorkrecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增上下工记录
|
||||
*
|
||||
* @param proWorkrecord 上下工记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertProWorkrecord(ProWorkrecord proWorkrecord)
|
||||
{
|
||||
proWorkrecord.setCreateTime(DateUtils.getNowDate());
|
||||
return proWorkrecordMapper.insertProWorkrecord(proWorkrecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改上下工记录
|
||||
*
|
||||
* @param proWorkrecord 上下工记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateProWorkrecord(ProWorkrecord proWorkrecord)
|
||||
{
|
||||
proWorkrecord.setUpdateTime(DateUtils.getNowDate());
|
||||
return proWorkrecordMapper.updateProWorkrecord(proWorkrecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除上下工记录
|
||||
*
|
||||
* @param recordIds 需要删除的上下工记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProWorkrecordByRecordIds(Long[] recordIds)
|
||||
{
|
||||
return proWorkrecordMapper.deleteProWorkrecordByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除上下工记录信息
|
||||
*
|
||||
* @param recordId 上下工记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProWorkrecordByRecordId(Long recordId)
|
||||
{
|
||||
return proWorkrecordMapper.deleteProWorkrecordByRecordId(recordId);
|
||||
}
|
||||
}
|
@ -0,0 +1,130 @@
|
||||
<?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.ktg.mes.pro.mapper.ProUserWorkstationMapper">
|
||||
|
||||
<resultMap type="ProUserWorkstation" id="ProUserWorkstationResult">
|
||||
<result property="recordId" column="record_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="workstationId" column="workstation_id" />
|
||||
<result property="workstationCode" column="workstation_code" />
|
||||
<result property="workstationName" column="workstation_name" />
|
||||
<result property="operationTime" column="operation_time" />
|
||||
<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" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProUserWorkstationVo">
|
||||
select record_id, user_id, user_name, nick_name, workstation_id, workstation_code, workstation_name, operation_time, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_user_workstation
|
||||
</sql>
|
||||
|
||||
<select id="selectProUserWorkstationList" parameterType="ProUserWorkstation" resultMap="ProUserWorkstationResult">
|
||||
<include refid="selectProUserWorkstationVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="nickName != null "> and nick_name like concat('%', #{nickName}, '%')</if>
|
||||
<if test="workstationId != null "> and workstation_id = #{workstationId}</if>
|
||||
<if test="workstationCode != null and workstationCode != ''"> and workstation_code = #{workstationCode}</if>
|
||||
<if test="workstationName != null and workstationName != ''"> and workstation_name like concat('%', #{workstationName}, '%')</if>
|
||||
<if test="operationTime != null "> and operation_time = #{operationTime}</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>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProUserWorkstationByRecordId" parameterType="Long" resultMap="ProUserWorkstationResult">
|
||||
<include refid="selectProUserWorkstationVo"/>
|
||||
where record_id = #{recordId}
|
||||
</select>
|
||||
|
||||
<insert id="insertProUserWorkstation" parameterType="ProUserWorkstation" useGeneratedKeys="true" keyProperty="recordId">
|
||||
insert into pro_user_workstation
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="nickName != null">nick_name,</if>
|
||||
<if test="workstationId != null">workstation_id,</if>
|
||||
<if test="workstationCode != null">workstation_code,</if>
|
||||
<if test="workstationName != null">workstation_name,</if>
|
||||
<if test="operationTime != null">operation_time,</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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="nickName != null">#{nickName},</if>
|
||||
<if test="workstationId != null">#{workstationId},</if>
|
||||
<if test="workstationCode != null">#{workstationCode},</if>
|
||||
<if test="workstationName != null">#{workstationName},</if>
|
||||
<if test="operationTime != null">#{operationTime},</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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProUserWorkstation" parameterType="ProUserWorkstation">
|
||||
update pro_user_workstation
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="nickName != null">nick_name = #{nickName},</if>
|
||||
<if test="workstationId != null">workstation_id = #{workstationId},</if>
|
||||
<if test="workstationCode != null">workstation_code = #{workstationCode},</if>
|
||||
<if test="workstationName != null">workstation_name = #{workstationName},</if>
|
||||
<if test="operationTime != null">operation_time = #{operationTime},</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 record_id = #{recordId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProUserWorkstationByRecordId" parameterType="Long">
|
||||
delete from pro_user_workstation where record_id = #{recordId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProUserWorkstationByRecordIds" parameterType="String">
|
||||
delete from pro_user_workstation where record_id in
|
||||
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
||||
#{recordId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByUserName" parameterType="String">
|
||||
delete from pro_user_workstation where user_name = #{userName}
|
||||
</delete>
|
||||
</mapper>
|
127
ktg-mes/src/main/resources/mapper/pro/ProWorkrecordMapper.xml
Normal file
127
ktg-mes/src/main/resources/mapper/pro/ProWorkrecordMapper.xml
Normal file
@ -0,0 +1,127 @@
|
||||
<?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.ktg.mes.pro.mapper.ProWorkrecordMapper">
|
||||
|
||||
<resultMap type="ProWorkrecord" id="ProWorkrecordResult">
|
||||
<result property="recordId" column="record_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="workstationId" column="workstation_id" />
|
||||
<result property="workstationCode" column="workstation_code" />
|
||||
<result property="workstationName" column="workstation_name" />
|
||||
<result property="operationFlag" column="operation_flag" />
|
||||
<result property="operationTime" column="operation_time" />
|
||||
<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" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProWorkrecordVo">
|
||||
select record_id, user_id, user_name, nick_name, workstation_id, workstation_code, workstation_name, operation_flag, operation_time, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_workrecord
|
||||
</sql>
|
||||
|
||||
<select id="selectProWorkrecordList" parameterType="ProWorkrecord" resultMap="ProWorkrecordResult">
|
||||
<include refid="selectProWorkrecordVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="nickName != null "> and nick_name like concat('%', #{nickName}, '%')</if>
|
||||
<if test="workstationId != null "> and workstation_id = #{workstationId}</if>
|
||||
<if test="workstationCode != null and workstationCode != ''"> and workstation_code = #{workstationCode}</if>
|
||||
<if test="workstationName != null and workstationName != ''"> and workstation_name like concat('%', #{workstationName}, '%')</if>
|
||||
<if test="operationFlag != null and operationFlag != ''"> and operation_flag = #{operationFlag}</if>
|
||||
<if test="operationTime != null "> and operation_time = #{operationTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProWorkrecordByRecordId" parameterType="Long" resultMap="ProWorkrecordResult">
|
||||
<include refid="selectProWorkrecordVo"/>
|
||||
where record_id = #{recordId}
|
||||
</select>
|
||||
|
||||
<insert id="insertProWorkrecord" parameterType="ProWorkrecord" useGeneratedKeys="true" keyProperty="recordId">
|
||||
insert into pro_workrecord
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="nickName != null">nick_name,</if>
|
||||
<if test="workstationId != null">workstation_id,</if>
|
||||
<if test="workstationCode != null">workstation_code,</if>
|
||||
<if test="workstationName != null">workstation_name,</if>
|
||||
<if test="operationFlag != null and operationFlag != ''">operation_flag,</if>
|
||||
<if test="operationTime != null">operation_time,</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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="nickName != null">#{nickName},</if>
|
||||
<if test="workstationId != null">#{workstationId},</if>
|
||||
<if test="workstationCode != null">#{workstationCode},</if>
|
||||
<if test="workstationName != null">#{workstationName},</if>
|
||||
<if test="operationFlag != null and operationFlag != ''">#{operationFlag},</if>
|
||||
<if test="operationTime != null">#{operationTime},</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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProWorkrecord" parameterType="ProWorkrecord">
|
||||
update pro_workrecord
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="nickName != null">nick_name = #{nickName},</if>
|
||||
<if test="workstationId != null">workstation_id = #{workstationId},</if>
|
||||
<if test="workstationCode != null">workstation_code = #{workstationCode},</if>
|
||||
<if test="workstationName != null">workstation_name = #{workstationName},</if>
|
||||
<if test="operationFlag != null and operationFlag != ''">operation_flag = #{operationFlag},</if>
|
||||
<if test="operationTime != null">operation_time = #{operationTime},</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 record_id = #{recordId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProWorkrecordByRecordId" parameterType="Long">
|
||||
delete from pro_workrecord where record_id = #{recordId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProWorkrecordByRecordIds" parameterType="String">
|
||||
delete from pro_workrecord where record_id in
|
||||
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
||||
#{recordId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,47 @@
|
||||
package com.ktg.system.strategy;
|
||||
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class PhoneUtils {
|
||||
|
||||
private static final String REGEX_MOBILE = "((\\+86|0086)?\\s*)((134[0-8]\\d{7})|(((13([0-3]|[5-9]))|(14[5-9])|15([0-3]|[5-9])|(16(2|[5-7]))|17([0-3]|[5-8])|18[0-9]|19([0-9]))\\d{8})|(14(0|1|4)0\\d{7})|(1740([0-5]|[6-9]|[10-12])\\d{7}))";
|
||||
|
||||
/**
|
||||
* 正则:固定电话号码,可带区号,然后至少6,8位数字
|
||||
*/
|
||||
private static final String REGEX_TEL = "^(\\d{3,4}-)?\\d{6,8}$";
|
||||
private static final Pattern PATTERN_REGEX_TEL = Pattern.compile(REGEX_TEL);
|
||||
|
||||
/**
|
||||
* 判断是否是手机号
|
||||
*
|
||||
* @param tel 手机号
|
||||
* @return boolean true:是 false:否
|
||||
*/
|
||||
public static boolean isMobile(String tel) {
|
||||
if (StringUtils.isEmpty(tel)) {
|
||||
return false;
|
||||
}
|
||||
return Pattern.matches(REGEX_MOBILE, tel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证固定电话号码
|
||||
*/
|
||||
public static boolean isTel(String str) {
|
||||
return isMatch(PATTERN_REGEX_TEL, str);
|
||||
}
|
||||
|
||||
public static boolean isMatch(Pattern pattern, String str) {
|
||||
return StringUtils.isNotEmpty(str) && pattern.matcher(str).matches();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(isTel("2887438"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user