Merge remote-tracking branch 'origin/master'
commit
8ef77313cf
@ -0,0 +1,48 @@
|
|||||||
|
package com.op.device.schedul;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
||||||
|
import com.op.device.domain.EquRepairOrder;
|
||||||
|
import com.op.device.domain.Equipment;
|
||||||
|
import com.op.device.mapper.EquRepairOrderMapper;
|
||||||
|
import com.op.device.service.IEquRepairOrderService;
|
||||||
|
import com.op.device.websocket.WebSocketUsers;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.socket.handler.TextWebSocketHandler;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@EnableScheduling
|
||||||
|
public class MyWebSocketHandler extends TextWebSocketHandler {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EquRepairOrderMapper equRepairOrderMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Scheduled(fixedRate = 10000) // 每60秒执行一次
|
||||||
|
@DS("ds_1000")
|
||||||
|
public void sendPeriodicMessages() {
|
||||||
|
EquRepairOrder equRepairOrder=new EquRepairOrder();
|
||||||
|
equRepairOrder.setOrderStatus("2");
|
||||||
|
List<EquRepairOrder> equRepairOrderList=equRepairOrderMapper.selectEquRepairOrderList(equRepairOrder);
|
||||||
|
Equipment equipment=new Equipment();
|
||||||
|
List<EquRepairOrder> equRepairOrders=new ArrayList<>();
|
||||||
|
for (EquRepairOrder repairOrder : equRepairOrderList) {
|
||||||
|
equipment.setEquipmentCode(repairOrder.getEquipmentCode());
|
||||||
|
equipment=equRepairOrderMapper.selectEquInfoByequCode(equipment);
|
||||||
|
repairOrder.setEquipment(equipment);
|
||||||
|
equRepairOrders.add(repairOrder);
|
||||||
|
}
|
||||||
|
String jsonResult = JSON.toJSONString(equRepairOrders);
|
||||||
|
WebSocketUsers.sendMessageToUsersByText(jsonResult);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
package com.op.device.websocket;
|
||||||
|
|
||||||
|
import java.util.concurrent.Semaphore;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 信号量相关处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class SemaphoreUtils
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* SemaphoreUtils 日志控制器
|
||||||
|
*/
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(SemaphoreUtils.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取信号量
|
||||||
|
*
|
||||||
|
* @param semaphore
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean tryAcquire(Semaphore semaphore)
|
||||||
|
{
|
||||||
|
boolean flag = false;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
flag = semaphore.tryAcquire();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.error("获取信号量异常", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 释放信号量
|
||||||
|
*
|
||||||
|
* @param semaphore
|
||||||
|
*/
|
||||||
|
public static void release(Semaphore semaphore)
|
||||||
|
{
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
semaphore.release();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.error("释放信号量异常", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.op.device.websocket;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* websocket 配置
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class WebSocketConfig
|
||||||
|
{
|
||||||
|
@Bean
|
||||||
|
public ServerEndpointExporter serverEndpointExporter()
|
||||||
|
{
|
||||||
|
return new ServerEndpointExporter();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,106 @@
|
|||||||
|
package com.op.device.websocket;
|
||||||
|
|
||||||
|
import java.util.concurrent.Semaphore;
|
||||||
|
import javax.websocket.OnClose;
|
||||||
|
import javax.websocket.OnError;
|
||||||
|
import javax.websocket.OnMessage;
|
||||||
|
import javax.websocket.OnOpen;
|
||||||
|
import javax.websocket.Session;
|
||||||
|
import javax.websocket.server.ServerEndpoint;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* websocket 消息处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@ServerEndpoint("/websocket/message")
|
||||||
|
public class WebSocketServer
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* WebSocketServer 日志控制器
|
||||||
|
*/
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(WebSocketServer.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认最多允许同时在线人数100
|
||||||
|
*/
|
||||||
|
public static int socketMaxOnlineCount = 100;
|
||||||
|
|
||||||
|
private static Semaphore socketSemaphore = new Semaphore(socketMaxOnlineCount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 连接建立成功调用的方法
|
||||||
|
*/
|
||||||
|
@OnOpen
|
||||||
|
public void onOpen(Session session) throws Exception
|
||||||
|
{
|
||||||
|
boolean semaphoreFlag = false;
|
||||||
|
// 尝试获取信号量
|
||||||
|
semaphoreFlag = SemaphoreUtils.tryAcquire(socketSemaphore);
|
||||||
|
if (!semaphoreFlag)
|
||||||
|
{
|
||||||
|
// 未获取到信号量
|
||||||
|
LOGGER.error("\n 当前在线人数超过限制数- {}", socketMaxOnlineCount);
|
||||||
|
WebSocketUsers.sendMessageToUserByText(session, "当前在线人数超过限制数:" + socketMaxOnlineCount);
|
||||||
|
session.close();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 添加用户
|
||||||
|
WebSocketUsers.put(session.getId(), session);
|
||||||
|
LOGGER.info("\n 建立连接 - {}", session);
|
||||||
|
LOGGER.info("\n 当前人数 - {}", WebSocketUsers.getUsers().size());
|
||||||
|
WebSocketUsers.sendMessageToUserByText(session, "连接成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 连接关闭时处理
|
||||||
|
*/
|
||||||
|
@OnClose
|
||||||
|
public void onClose(Session session)
|
||||||
|
{
|
||||||
|
LOGGER.info("\n 关闭连接 - {}", session);
|
||||||
|
// 移除用户
|
||||||
|
boolean removeFlag = WebSocketUsers.remove(session.getId());
|
||||||
|
if (!removeFlag)
|
||||||
|
{
|
||||||
|
// 获取到信号量则需释放
|
||||||
|
SemaphoreUtils.release(socketSemaphore);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 抛出异常时处理
|
||||||
|
*/
|
||||||
|
@OnError
|
||||||
|
public void onError(Session session, Throwable exception) throws Exception
|
||||||
|
{
|
||||||
|
if (session.isOpen())
|
||||||
|
{
|
||||||
|
// 关闭连接
|
||||||
|
session.close();
|
||||||
|
}
|
||||||
|
String sessionId = session.getId();
|
||||||
|
LOGGER.info("\n 连接异常 - {}", sessionId);
|
||||||
|
LOGGER.info("\n 异常信息 - {}", exception);
|
||||||
|
// 移出用户
|
||||||
|
WebSocketUsers.remove(sessionId);
|
||||||
|
// 获取到信号量则需释放
|
||||||
|
SemaphoreUtils.release(socketSemaphore);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务器接收到客户端消息时调用的方法
|
||||||
|
*/
|
||||||
|
@OnMessage
|
||||||
|
public void onMessage(String message, Session session)
|
||||||
|
{
|
||||||
|
String msg = message.replace("你", "我").replace("吗", "");
|
||||||
|
WebSocketUsers.sendMessageToUserByText(session, msg);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,140 @@
|
|||||||
|
package com.op.device.websocket;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import javax.websocket.Session;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* websocket 客户端用户集
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class WebSocketUsers
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* WebSocketUsers 日志控制器
|
||||||
|
*/
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(WebSocketUsers.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户集
|
||||||
|
*/
|
||||||
|
private static Map<String, Session> USERS = new ConcurrentHashMap<String, Session>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 存储用户
|
||||||
|
*
|
||||||
|
* @param key 唯一键
|
||||||
|
* @param session 用户信息
|
||||||
|
*/
|
||||||
|
public static void put(String key, Session session)
|
||||||
|
{
|
||||||
|
USERS.put(key, session);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移除用户
|
||||||
|
*
|
||||||
|
* @param session 用户信息
|
||||||
|
*
|
||||||
|
* @return 移除结果
|
||||||
|
*/
|
||||||
|
public static boolean remove(Session session)
|
||||||
|
{
|
||||||
|
String key = null;
|
||||||
|
boolean flag = USERS.containsValue(session);
|
||||||
|
if (flag)
|
||||||
|
{
|
||||||
|
Set<Map.Entry<String, Session>> entries = USERS.entrySet();
|
||||||
|
for (Map.Entry<String, Session> entry : entries)
|
||||||
|
{
|
||||||
|
Session value = entry.getValue();
|
||||||
|
if (value.equals(session))
|
||||||
|
{
|
||||||
|
key = entry.getKey();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return remove(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移出用户
|
||||||
|
*
|
||||||
|
* @param key 键
|
||||||
|
*/
|
||||||
|
public static boolean remove(String key)
|
||||||
|
{
|
||||||
|
LOGGER.info("\n 正在移出用户 - {}", key);
|
||||||
|
Session remove = USERS.remove(key);
|
||||||
|
if (remove != null)
|
||||||
|
{
|
||||||
|
boolean containsValue = USERS.containsValue(remove);
|
||||||
|
LOGGER.info("\n 移出结果 - {}", containsValue ? "失败" : "成功");
|
||||||
|
return containsValue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取在线用户列表
|
||||||
|
*
|
||||||
|
* @return 返回用户集合
|
||||||
|
*/
|
||||||
|
public static Map<String, Session> getUsers()
|
||||||
|
{
|
||||||
|
return USERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 群发消息文本消息
|
||||||
|
*
|
||||||
|
* @param message 消息内容
|
||||||
|
*/
|
||||||
|
public static void sendMessageToUsersByText(String message)
|
||||||
|
{
|
||||||
|
Collection<Session> values = USERS.values();
|
||||||
|
for (Session value : values)
|
||||||
|
{
|
||||||
|
sendMessageToUserByText(value, message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送文本消息
|
||||||
|
*
|
||||||
|
* @param userName 自己的用户名
|
||||||
|
* @param message 消息内容
|
||||||
|
*/
|
||||||
|
public static void sendMessageToUserByText(Session session, String message)
|
||||||
|
{
|
||||||
|
if (session != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
session.getBasicRemote().sendText(message);
|
||||||
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
LOGGER.error("\n[发送消息异常]", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOGGER.info("\n[你已离线]");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,278 @@
|
|||||||
|
package com.op.mes.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
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;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 辅助工时摊分对象 mes_line_assistant_qty
|
||||||
|
*
|
||||||
|
* @author Open Platform
|
||||||
|
* @date 2025-03-21
|
||||||
|
*/
|
||||||
|
public class MesLineAssistant extends BaseEntity {
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/** 工厂 */
|
||||||
|
@Excel(name = "工厂")
|
||||||
|
private String factoryCode;
|
||||||
|
|
||||||
|
@Excel(name = "车间")
|
||||||
|
private String carCode;
|
||||||
|
|
||||||
|
@Excel(name = "线体")
|
||||||
|
private String lineCode;
|
||||||
|
|
||||||
|
@Excel(name = "产品编码")
|
||||||
|
private String productCode;
|
||||||
|
|
||||||
|
@Excel(name = "产品名称")
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
@Excel(name = "产品工时")
|
||||||
|
private String productHour;
|
||||||
|
|
||||||
|
@Excel(name = "工时占比")
|
||||||
|
private String hourRatio;
|
||||||
|
|
||||||
|
@Excel(name = "辅助工时合计")
|
||||||
|
private String assistHourSum;
|
||||||
|
|
||||||
|
@Excel(name = "班长工时")
|
||||||
|
private String monitorHour;
|
||||||
|
|
||||||
|
@Excel(name = "组长工时")
|
||||||
|
private String groupLeaderHour;
|
||||||
|
|
||||||
|
@Excel(name = "物料员工时")
|
||||||
|
private String materialHour;
|
||||||
|
|
||||||
|
@Excel(name = "药管员工时")
|
||||||
|
private String pillMgrHour;
|
||||||
|
|
||||||
|
@Excel(name = "配药员工时")
|
||||||
|
private String pillDisHour;
|
||||||
|
|
||||||
|
|
||||||
|
/** 生产日期 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date productDate;
|
||||||
|
private String productDateStr;
|
||||||
|
|
||||||
|
/** 班长人数 */
|
||||||
|
@Excel(name = "班长人数")
|
||||||
|
private Long monitorQty;
|
||||||
|
|
||||||
|
/** 组长人数 */
|
||||||
|
@Excel(name = "组长人数")
|
||||||
|
private Long groupleaderQty;
|
||||||
|
|
||||||
|
/** 物料员人数 */
|
||||||
|
@Excel(name = "物料员人数")
|
||||||
|
private Long materialQty;
|
||||||
|
|
||||||
|
/** 药管员人数 */
|
||||||
|
@Excel(name = "药管员人数")
|
||||||
|
private Long pillMgrQty;
|
||||||
|
|
||||||
|
/** 配药员人数 */
|
||||||
|
@Excel(name = "配药员人数")
|
||||||
|
private Long pillDisQty;
|
||||||
|
//班长10000150 车间组长10000168 物料员10000478 药管员10000271 配药员10000155
|
||||||
|
private String postId;
|
||||||
|
|
||||||
|
public String getPostId() {
|
||||||
|
return postId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPostId(String postId) {
|
||||||
|
this.postId = postId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id){
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId(){
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setFactoryCode(String factoryCode){
|
||||||
|
this.factoryCode = factoryCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFactoryCode(){
|
||||||
|
return factoryCode;
|
||||||
|
}
|
||||||
|
public void setProductDate(Date productDate){
|
||||||
|
this.productDate = productDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getProductDate(){
|
||||||
|
return productDate;
|
||||||
|
}
|
||||||
|
public void setMonitorQty(Long monitorQty){
|
||||||
|
this.monitorQty = monitorQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMonitorQty(){
|
||||||
|
return monitorQty;
|
||||||
|
}
|
||||||
|
public void setGroupleaderQty(Long groupleaderQty){
|
||||||
|
this.groupleaderQty = groupleaderQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getGroupleaderQty(){
|
||||||
|
return groupleaderQty;
|
||||||
|
}
|
||||||
|
public void setMaterialQty(Long materialQty){
|
||||||
|
this.materialQty = materialQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMaterialQty(){
|
||||||
|
return materialQty;
|
||||||
|
}
|
||||||
|
public void setPillMgrQty(Long pillMgrQty){
|
||||||
|
this.pillMgrQty = pillMgrQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getPillMgrQty(){
|
||||||
|
return pillMgrQty;
|
||||||
|
}
|
||||||
|
public void setPillDisQty(Long pillDisQty){
|
||||||
|
this.pillDisQty = pillDisQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getPillDisQty(){
|
||||||
|
return pillDisQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCarCode() {
|
||||||
|
return carCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCarCode(String carCode) {
|
||||||
|
this.carCode = carCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLineCode() {
|
||||||
|
return lineCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLineCode(String lineCode) {
|
||||||
|
this.lineCode = lineCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProductCode() {
|
||||||
|
return productCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductCode(String productCode) {
|
||||||
|
this.productCode = productCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProductName() {
|
||||||
|
return productName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductName(String productName) {
|
||||||
|
this.productName = productName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProductHour() {
|
||||||
|
return productHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductHour(String productHour) {
|
||||||
|
this.productHour = productHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHourRatio() {
|
||||||
|
return hourRatio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHourRatio(String hourRatio) {
|
||||||
|
this.hourRatio = hourRatio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAssistHourSum() {
|
||||||
|
return assistHourSum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAssistHourSum(String assistHourSum) {
|
||||||
|
this.assistHourSum = assistHourSum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMonitorHour() {
|
||||||
|
return monitorHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMonitorHour(String monitorHour) {
|
||||||
|
this.monitorHour = monitorHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGroupLeaderHour() {
|
||||||
|
return groupLeaderHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGroupLeaderHour(String groupLeaderHour) {
|
||||||
|
this.groupLeaderHour = groupLeaderHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMaterialHour() {
|
||||||
|
return materialHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaterialHour(String materialHour) {
|
||||||
|
this.materialHour = materialHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPillMgrHour() {
|
||||||
|
return pillMgrHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPillMgrHour(String pillMgrHour) {
|
||||||
|
this.pillMgrHour = pillMgrHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPillDisHour() {
|
||||||
|
return pillDisHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPillDisHour(String pillDisHour) {
|
||||||
|
this.pillDisHour = pillDisHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProductDateStr() {
|
||||||
|
return productDateStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductDateStr(String productDateStr) {
|
||||||
|
this.productDateStr = productDateStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(){
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id",getId())
|
||||||
|
.append("factoryCode",getFactoryCode())
|
||||||
|
.append("productDate",getProductDate())
|
||||||
|
.append("monitorQty",getMonitorQty())
|
||||||
|
.append("groupleaderQty",getGroupleaderQty())
|
||||||
|
.append("materialQty",getMaterialQty())
|
||||||
|
.append("pillMgrQty",getPillMgrQty())
|
||||||
|
.append("pillDisQty",getPillDisQty())
|
||||||
|
.append("createBy",getCreateBy())
|
||||||
|
.append("createTime",getCreateTime())
|
||||||
|
.append("updateBy",getUpdateBy())
|
||||||
|
.append("updateTime",getUpdateTime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,181 @@
|
|||||||
|
package com.op.mes.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.op.common.core.annotation.Excel;
|
||||||
|
import com.op.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 辅助工时摊分对象 mes_line_assistant_qty
|
||||||
|
*
|
||||||
|
* @author Open Platform
|
||||||
|
* @date 2025-03-21
|
||||||
|
*/
|
||||||
|
public class MesLineAssistantQty extends BaseEntity {
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/** 工厂 */
|
||||||
|
@Excel(name = "工厂")
|
||||||
|
private String factoryCode;
|
||||||
|
|
||||||
|
/** 生产日期 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date productDate;
|
||||||
|
private String productDateStr;
|
||||||
|
/** 班长人数 */
|
||||||
|
@Excel(name = "班长人数")
|
||||||
|
private Long monitorQty;
|
||||||
|
|
||||||
|
/** 组长人数 */
|
||||||
|
@Excel(name = "组长人数")
|
||||||
|
private Long groupleaderQty;
|
||||||
|
|
||||||
|
/** 物料员人数 */
|
||||||
|
@Excel(name = "物料员人数")
|
||||||
|
private Long materialQty;
|
||||||
|
|
||||||
|
/** 药管员人数 */
|
||||||
|
@Excel(name = "药管员人数")
|
||||||
|
private Long pillMgrQty;
|
||||||
|
|
||||||
|
/** 配药员人数 */
|
||||||
|
@Excel(name = "配药员人数")
|
||||||
|
private Long pillDisQty;
|
||||||
|
|
||||||
|
/** 预留字段1 */
|
||||||
|
@Excel(name = "预留字段1")
|
||||||
|
private String attr1;
|
||||||
|
|
||||||
|
/** 预留字段2 */
|
||||||
|
@Excel(name = "预留字段2")
|
||||||
|
private String attr2;
|
||||||
|
|
||||||
|
/** 预留字段3 */
|
||||||
|
@Excel(name = "预留字段3")
|
||||||
|
private String attr3;
|
||||||
|
|
||||||
|
/** 预留字段4 */
|
||||||
|
@Excel(name = "预留字段4")
|
||||||
|
private String attr4;
|
||||||
|
|
||||||
|
public String getProductDateStr() {
|
||||||
|
return productDateStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductDateStr(String productDateStr) {
|
||||||
|
this.productDateStr = productDateStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id){
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId(){
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setFactoryCode(String factoryCode){
|
||||||
|
this.factoryCode = factoryCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFactoryCode(){
|
||||||
|
return factoryCode;
|
||||||
|
}
|
||||||
|
public void setProductDate(Date productDate){
|
||||||
|
this.productDate = productDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getProductDate(){
|
||||||
|
return productDate;
|
||||||
|
}
|
||||||
|
public void setMonitorQty(Long monitorQty){
|
||||||
|
this.monitorQty = monitorQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMonitorQty(){
|
||||||
|
return monitorQty;
|
||||||
|
}
|
||||||
|
public void setGroupleaderQty(Long groupleaderQty){
|
||||||
|
this.groupleaderQty = groupleaderQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getGroupleaderQty(){
|
||||||
|
return groupleaderQty;
|
||||||
|
}
|
||||||
|
public void setMaterialQty(Long materialQty){
|
||||||
|
this.materialQty = materialQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMaterialQty(){
|
||||||
|
return materialQty;
|
||||||
|
}
|
||||||
|
public void setPillMgrQty(Long pillMgrQty){
|
||||||
|
this.pillMgrQty = pillMgrQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getPillMgrQty(){
|
||||||
|
return pillMgrQty;
|
||||||
|
}
|
||||||
|
public void setPillDisQty(Long pillDisQty){
|
||||||
|
this.pillDisQty = pillDisQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getPillDisQty(){
|
||||||
|
return pillDisQty;
|
||||||
|
}
|
||||||
|
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(String attr3){
|
||||||
|
this.attr3 = attr3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAttr3(){
|
||||||
|
return attr3;
|
||||||
|
}
|
||||||
|
public void setAttr4(String attr4){
|
||||||
|
this.attr4 = attr4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAttr4(){
|
||||||
|
return attr4;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(){
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id",getId())
|
||||||
|
.append("factoryCode",getFactoryCode())
|
||||||
|
.append("productDate",getProductDate())
|
||||||
|
.append("monitorQty",getMonitorQty())
|
||||||
|
.append("groupleaderQty",getGroupleaderQty())
|
||||||
|
.append("materialQty",getMaterialQty())
|
||||||
|
.append("pillMgrQty",getPillMgrQty())
|
||||||
|
.append("pillDisQty",getPillDisQty())
|
||||||
|
.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,278 @@
|
|||||||
|
package com.op.mes.domain.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
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;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 辅助工时摊分对象 mes_line_assistant_qty
|
||||||
|
*
|
||||||
|
* @author Open Platform
|
||||||
|
* @date 2025-03-21
|
||||||
|
*/
|
||||||
|
public class MesLineAssistantQtyVo extends BaseEntity {
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/** 生产日期 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date productDate;
|
||||||
|
|
||||||
|
/** 工厂 */
|
||||||
|
@Excel(name = "工厂")
|
||||||
|
private String factoryCode;
|
||||||
|
|
||||||
|
@Excel(name = "车间")
|
||||||
|
private String carCode;
|
||||||
|
|
||||||
|
@Excel(name = "SAP线体编码")
|
||||||
|
private String lineCode;
|
||||||
|
|
||||||
|
private String productCode;
|
||||||
|
|
||||||
|
@Excel(name = "产品名称")
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
@Excel(name = "产品工时")
|
||||||
|
private String productHour;
|
||||||
|
|
||||||
|
@Excel(name = "工时占比")
|
||||||
|
private String hourRatio;
|
||||||
|
|
||||||
|
@Excel(name = "辅助工时合计")
|
||||||
|
private String assistHourSum;
|
||||||
|
|
||||||
|
@Excel(name = "班长人数")
|
||||||
|
private String monitorQty;
|
||||||
|
|
||||||
|
@Excel(name = "班长工时")
|
||||||
|
private String monitorHour;
|
||||||
|
|
||||||
|
@Excel(name = "组长人数")
|
||||||
|
private String groupleaderQty;
|
||||||
|
|
||||||
|
@Excel(name = "组长工时")
|
||||||
|
private String groupLeaderHour;
|
||||||
|
|
||||||
|
@Excel(name = "物料员人数")
|
||||||
|
private String materialQty;
|
||||||
|
|
||||||
|
@Excel(name = "物料员工时")
|
||||||
|
private String materialHour;
|
||||||
|
|
||||||
|
@Excel(name = "药管员人数")
|
||||||
|
private String pillMgrQty;
|
||||||
|
|
||||||
|
@Excel(name = "药管员工时")
|
||||||
|
private String pillMgrHour;
|
||||||
|
|
||||||
|
@Excel(name = "配药员人数")
|
||||||
|
private String pillDisQty;
|
||||||
|
|
||||||
|
@Excel(name = "配药员工时")
|
||||||
|
private String pillDisHour;
|
||||||
|
|
||||||
|
private String workorderCode;
|
||||||
|
|
||||||
|
//班长10000150 车间组长10000168 物料员10000478 药管员10000271 配药员10000155
|
||||||
|
private String postId;
|
||||||
|
|
||||||
|
public String getPostId() {
|
||||||
|
return postId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPostId(String postId) {
|
||||||
|
this.postId = postId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id){
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId(){
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setFactoryCode(String factoryCode){
|
||||||
|
this.factoryCode = factoryCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFactoryCode(){
|
||||||
|
return factoryCode;
|
||||||
|
}
|
||||||
|
public void setProductDate(Date productDate){
|
||||||
|
this.productDate = productDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getProductDate(){
|
||||||
|
return productDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMonitorQty() {
|
||||||
|
return monitorQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMonitorQty(String monitorQty) {
|
||||||
|
this.monitorQty = monitorQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGroupleaderQty() {
|
||||||
|
return groupleaderQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGroupleaderQty(String groupleaderQty) {
|
||||||
|
this.groupleaderQty = groupleaderQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMaterialQty() {
|
||||||
|
return materialQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaterialQty(String materialQty) {
|
||||||
|
this.materialQty = materialQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPillMgrQty() {
|
||||||
|
return pillMgrQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPillMgrQty(String pillMgrQty) {
|
||||||
|
this.pillMgrQty = pillMgrQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPillDisQty() {
|
||||||
|
return pillDisQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPillDisQty(String pillDisQty) {
|
||||||
|
this.pillDisQty = pillDisQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCarCode() {
|
||||||
|
return carCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCarCode(String carCode) {
|
||||||
|
this.carCode = carCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLineCode() {
|
||||||
|
return lineCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLineCode(String lineCode) {
|
||||||
|
this.lineCode = lineCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProductCode() {
|
||||||
|
return productCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductCode(String productCode) {
|
||||||
|
this.productCode = productCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProductName() {
|
||||||
|
return productName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductName(String productName) {
|
||||||
|
this.productName = productName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProductHour() {
|
||||||
|
return productHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductHour(String productHour) {
|
||||||
|
this.productHour = productHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHourRatio() {
|
||||||
|
return hourRatio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHourRatio(String hourRatio) {
|
||||||
|
this.hourRatio = hourRatio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAssistHourSum() {
|
||||||
|
return assistHourSum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAssistHourSum(String assistHourSum) {
|
||||||
|
this.assistHourSum = assistHourSum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMonitorHour() {
|
||||||
|
return monitorHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMonitorHour(String monitorHour) {
|
||||||
|
this.monitorHour = monitorHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGroupLeaderHour() {
|
||||||
|
return groupLeaderHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGroupLeaderHour(String groupLeaderHour) {
|
||||||
|
this.groupLeaderHour = groupLeaderHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMaterialHour() {
|
||||||
|
return materialHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaterialHour(String materialHour) {
|
||||||
|
this.materialHour = materialHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPillMgrHour() {
|
||||||
|
return pillMgrHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPillMgrHour(String pillMgrHour) {
|
||||||
|
this.pillMgrHour = pillMgrHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPillDisHour() {
|
||||||
|
return pillDisHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPillDisHour(String pillDisHour) {
|
||||||
|
this.pillDisHour = pillDisHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWorkorderCode() {
|
||||||
|
return workorderCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorkorderCode(String workorderCode) {
|
||||||
|
this.workorderCode = workorderCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(){
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id",getId())
|
||||||
|
.append("factoryCode",getFactoryCode())
|
||||||
|
.append("productDate",getProductDate())
|
||||||
|
.append("monitorQty",getMonitorQty())
|
||||||
|
.append("groupleaderQty",getGroupleaderQty())
|
||||||
|
.append("materialQty",getMaterialQty())
|
||||||
|
.append("pillMgrQty",getPillMgrQty())
|
||||||
|
.append("pillDisQty",getPillDisQty())
|
||||||
|
.append("createBy",getCreateBy())
|
||||||
|
.append("createTime",getCreateTime())
|
||||||
|
.append("updateBy",getUpdateBy())
|
||||||
|
.append("updateTime",getUpdateTime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,87 @@
|
|||||||
|
package com.op.mes.mapper;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.op.mes.domain.MesLineAssistant;
|
||||||
|
import com.op.mes.domain.MesLineAssistantQty;
|
||||||
|
import com.op.mes.domain.MesLineProduct;
|
||||||
|
import com.op.mes.domain.MesReportWork;
|
||||||
|
import com.op.mes.domain.vo.MesDailyEfficiencyVo;
|
||||||
|
import com.op.mes.domain.vo.MesLineAssistantQtyVo;
|
||||||
|
import org.apache.ibatis.annotations.MapKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 辅助工时摊分Mapper接口
|
||||||
|
*
|
||||||
|
* @author Open Platform
|
||||||
|
* @date 2025-03-21
|
||||||
|
*/
|
||||||
|
public interface MesLineAssistantQtyMapper {
|
||||||
|
/**
|
||||||
|
* 查询辅助工时摊分
|
||||||
|
*
|
||||||
|
* @param id 辅助工时摊分主键
|
||||||
|
* @return 辅助工时摊分
|
||||||
|
*/
|
||||||
|
public MesLineAssistantQty selectMesLineAssistantQtyById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询辅助工时摊分列表
|
||||||
|
*
|
||||||
|
* @param mesLineAssistantQty 辅助工时摊分
|
||||||
|
* @return 辅助工时摊分集合
|
||||||
|
*/
|
||||||
|
public List<MesLineAssistantQty> selectMesLineAssistantQtyList(MesLineAssistantQty mesLineAssistantQty);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增辅助工时摊分
|
||||||
|
*
|
||||||
|
* @param mesLineAssistantQty 辅助工时摊分
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertMesLineAssistantQty(MesLineAssistantQty mesLineAssistantQty);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改辅助工时摊分
|
||||||
|
*
|
||||||
|
* @param mesLineAssistantQty 辅助工时摊分
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateMesLineAssistantQty(MesLineAssistantQty mesLineAssistantQty);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除辅助工时摊分
|
||||||
|
*
|
||||||
|
* @param id 辅助工时摊分主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMesLineAssistantQtyById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除辅助工时摊分
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMesLineAssistantQtyByIds(String[] ids);
|
||||||
|
|
||||||
|
String getHasdate(MesLineAssistantQty mesLineAssistantQty);
|
||||||
|
|
||||||
|
public List<MesLineAssistantQtyVo> selectEfficiencyHourList(MesLineAssistant mesLineAssistant);
|
||||||
|
BigDecimal getHoursByOrderCode(String workorderCode);
|
||||||
|
@MapKey("productDateStr")
|
||||||
|
Map<String, MesLineAssistantQty> getAssistMaps(MesLineAssistant mesLineAssistant);
|
||||||
|
BigDecimal getKqHourMaps(MesLineAssistant mesLineAssistant);
|
||||||
|
|
||||||
|
public List<MesDailyEfficiencyVo> selectEfficiencyDayList(MesLineAssistant mesLineAssistant);
|
||||||
|
|
||||||
|
BigDecimal getPlanQtyByOrderCode(String workorderCode);
|
||||||
|
|
||||||
|
BigDecimal getActQtyByOrderCode(String workorderCode);
|
||||||
|
|
||||||
|
MesLineProduct getStandarInfo(MesDailyEfficiencyVo effdto);
|
||||||
|
|
||||||
|
MesReportWork getSonActManByOrderCode(String workorderCode);
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
package com.op.mes.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.op.mes.domain.MesLineAssistant;
|
||||||
|
import com.op.mes.domain.MesLineAssistantQty;
|
||||||
|
import com.op.mes.domain.vo.MesDailyEfficiencyVo;
|
||||||
|
import com.op.mes.domain.vo.MesLineAssistantQtyVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 辅助工时摊分Service接口
|
||||||
|
*
|
||||||
|
* @author Open Platform
|
||||||
|
* @date 2025-03-21
|
||||||
|
*/
|
||||||
|
public interface IMesLineAssistantQtyService {
|
||||||
|
/**
|
||||||
|
* 查询辅助工时摊分
|
||||||
|
*
|
||||||
|
* @param id 辅助工时摊分主键
|
||||||
|
* @return 辅助工时摊分
|
||||||
|
*/
|
||||||
|
public MesLineAssistantQty selectMesLineAssistantQtyById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询辅助工时摊分列表
|
||||||
|
*
|
||||||
|
* @param mesLineAssistantQty 辅助工时摊分
|
||||||
|
* @return 辅助工时摊分集合
|
||||||
|
*/
|
||||||
|
public List<MesLineAssistantQty> selectMesLineAssistantQtyList(MesLineAssistantQty mesLineAssistantQty);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增辅助工时摊分
|
||||||
|
*
|
||||||
|
* @param mesLineAssistantQty 辅助工时摊分
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertMesLineAssistantQty(MesLineAssistantQty mesLineAssistantQty);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改辅助工时摊分
|
||||||
|
*
|
||||||
|
* @param mesLineAssistantQty 辅助工时摊分
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateMesLineAssistantQty(MesLineAssistantQty mesLineAssistantQty);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除辅助工时摊分
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的辅助工时摊分主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMesLineAssistantQtyByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除辅助工时摊分信息
|
||||||
|
*
|
||||||
|
* @param id 辅助工时摊分主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMesLineAssistantQtyById(String id);
|
||||||
|
|
||||||
|
public List<MesLineAssistantQtyVo> selectEfficiencyHourList(MesLineAssistant mesLineAssistant);
|
||||||
|
|
||||||
|
|
||||||
|
public List<MesDailyEfficiencyVo> selectEfficiencyDayList(MesLineAssistant mesLineAssistant);
|
||||||
|
}
|
@ -0,0 +1,337 @@
|
|||||||
|
<?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.mes.mapper.MesLineAssistantQtyMapper">
|
||||||
|
|
||||||
|
<resultMap type="MesLineAssistantQty" id="MesLineAssistantQtyResult">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="factoryCode" column="factory_code"/>
|
||||||
|
<result property="productDate" column="product_date"/>
|
||||||
|
<result property="monitorQty" column="monitor_qty"/>
|
||||||
|
<result property="groupleaderQty" column="groupLeader_qty"/>
|
||||||
|
<result property="materialQty" column="material_qty"/>
|
||||||
|
<result property="pillMgrQty" column="pill_mgr_qty"/>
|
||||||
|
<result property="pillDisQty" column="pill_dis_qty"/>
|
||||||
|
<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="selectMesLineAssistantQtyVo">
|
||||||
|
select id, factory_code, product_date, monitor_qty, groupLeader_qty,
|
||||||
|
material_qty, pill_mgr_qty, pill_dis_qty, attr1, attr2, attr3, attr4, create_by,
|
||||||
|
create_time, update_by, update_time
|
||||||
|
from mes_line_assistant_qty
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectMesLineAssistantQtyList" parameterType="MesLineAssistantQty" resultMap="MesLineAssistantQtyResult">
|
||||||
|
<include refid="selectMesLineAssistantQtyVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="factoryCode != null ">
|
||||||
|
and factory_code = #{factoryCode}
|
||||||
|
</if>
|
||||||
|
<if test="productDate != null ">
|
||||||
|
and product_date = #{productDate}
|
||||||
|
</if>
|
||||||
|
<if test="monitorQty != null ">
|
||||||
|
and monitor_qty = #{monitorQty}
|
||||||
|
</if>
|
||||||
|
<if test="groupleaderQty != null ">
|
||||||
|
and groupLeader_qty = #{groupleaderQty}
|
||||||
|
</if>
|
||||||
|
<if test="materialQty != null ">
|
||||||
|
and material_qty = #{materialQty}
|
||||||
|
</if>
|
||||||
|
<if test="pillMgrQty != null ">
|
||||||
|
and pill_mgr_qty = #{pillMgrQty}
|
||||||
|
</if>
|
||||||
|
<if test="pillDisQty != null ">
|
||||||
|
and pill_dis_qty = #{pillDisQty}
|
||||||
|
</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 != ''">
|
||||||
|
and attr3 = #{attr3}
|
||||||
|
</if>
|
||||||
|
<if test="attr4 != null and attr4 != ''">
|
||||||
|
and attr4 = #{attr4}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by create_time
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMesLineAssistantQtyById" parameterType="String"
|
||||||
|
resultMap="MesLineAssistantQtyResult">
|
||||||
|
<include refid="selectMesLineAssistantQtyVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
<select id="getHasdate" resultType="java.lang.String">
|
||||||
|
select product_date
|
||||||
|
from mes_line_assistant_qty
|
||||||
|
where product_date = #{productDate}
|
||||||
|
</select>
|
||||||
|
<select id="selectEfficiencyHourList" resultType="com.op.mes.domain.vo.MesLineAssistantQtyVo">
|
||||||
|
select pow.product_date productDate,
|
||||||
|
'小榄' factoryCode,
|
||||||
|
be.department carCode,
|
||||||
|
be.sap_code lineCode,
|
||||||
|
pow.product_name productName,
|
||||||
|
pow.workorder_code workorderCode
|
||||||
|
from pro_order_workorder pow
|
||||||
|
left join base_equipment be on be.equipment_code = pow.workorder_name
|
||||||
|
where pow.parent_order = '0'
|
||||||
|
and pow.del_flag = '0'
|
||||||
|
<if test="productDateStr != null">
|
||||||
|
and pow.product_date = #{productDateStr}
|
||||||
|
</if>
|
||||||
|
<if test="carCode != null">
|
||||||
|
and be.department like concat('%',#{carCode},'%')
|
||||||
|
</if>
|
||||||
|
<if test="lineCode != null">
|
||||||
|
and be.sap_code like concat('%',#{lineCode},'%')
|
||||||
|
</if>
|
||||||
|
<if test="productName != null">
|
||||||
|
and pow.product_name like concat('%',#{productName},'%')
|
||||||
|
</if>
|
||||||
|
and pow.workorder_name is not null and pow.status in('w3','w4')
|
||||||
|
</select>
|
||||||
|
<select id="getHoursByOrderCode" resultType="java.math.BigDecimal">
|
||||||
|
select sum(work_time) from mes_report_work
|
||||||
|
where workorder_code = #{workorderCode}
|
||||||
|
and del_flag ='0' and parent_order = '0'
|
||||||
|
</select>
|
||||||
|
<select id="getAssistMaps" resultType="com.op.mes.domain.MesLineAssistantQty">
|
||||||
|
select
|
||||||
|
product_date productDateStr,
|
||||||
|
monitor_qty monitorQty,
|
||||||
|
groupLeader_qty groupLeaderQty,
|
||||||
|
material_qty materialQty,
|
||||||
|
pill_mgr_qty pillMgrQty,
|
||||||
|
pill_dis_qty pillDisQty
|
||||||
|
from mes_line_assistant_qty
|
||||||
|
where product_date = #{productDateStr}
|
||||||
|
</select>
|
||||||
|
<select id="getKqHourMaps" resultType="java.math.BigDecimal">
|
||||||
|
select sum(
|
||||||
|
case when DATEDIFF ( hour , stime.time0 , etime.time0 ) is null then '0'
|
||||||
|
else DATEDIFF ( hour , stime.time0 , etime.time0 ) end) productHour
|
||||||
|
from lanju_op_cloud.dbo.sys_user su
|
||||||
|
left join lanju_op_cloud.dbo.sys_user_post sup on su.user_id = sup.user_id
|
||||||
|
left join (
|
||||||
|
select min(clock_time) time0,workno from mes_clock_record where convert(char(10),clock_time,120) = #{productDateStr} GROUP BY workno
|
||||||
|
) stime on stime.workno = su.user_name
|
||||||
|
left join (
|
||||||
|
select max(clock_time) time0,workno from mes_clock_record where convert(char(10),clock_time,120) = #{productDateStr} GROUP BY workno
|
||||||
|
) etime on etime.workno = su.user_name
|
||||||
|
where su.del_flag = '0' and sup.post_id = #{postId}
|
||||||
|
</select>
|
||||||
|
<select id="selectEfficiencyDayList" resultType="com.op.mes.domain.vo.MesDailyEfficiencyVo">
|
||||||
|
select pow.product_date productDate,
|
||||||
|
'小榄' factoryCode,
|
||||||
|
be.department carCode,
|
||||||
|
be.sap_code lineCode,
|
||||||
|
bpa.category,
|
||||||
|
pow.product_code productCode,
|
||||||
|
pow.product_name productName,
|
||||||
|
bp.umrez spec,
|
||||||
|
'件' unit,
|
||||||
|
pow.workorder_code workorderCode,
|
||||||
|
sdd.remark effUpBase,
|
||||||
|
sdd2.dict_value upGoal
|
||||||
|
from pro_order_workorder pow
|
||||||
|
left join base_equipment be on be.equipment_code = pow.workorder_name
|
||||||
|
left join base_product bp on bp.product_code = pow.product_code
|
||||||
|
left join base_product_attached bpa on concat('0000000',bpa.product_code) = pow.product_code
|
||||||
|
left join lanju_op_cloud.dbo.sys_dict_data sdd on sdd.dict_label = bpa.category and sdd.dict_type = 'sys_category'
|
||||||
|
left join base_dict_data sdd2 on sdd2.dict_label = convert(char(4),pow.product_date,120) and sdd2.dict_type = 'year_goal'
|
||||||
|
where pow.parent_order = '0'
|
||||||
|
and pow.del_flag = '0'
|
||||||
|
<if test="productDateStr != null">
|
||||||
|
and pow.product_date = #{productDateStr}
|
||||||
|
</if>
|
||||||
|
<if test="carCode != null">
|
||||||
|
and be.department like concat('%',#{carCode},'%')
|
||||||
|
</if>
|
||||||
|
<if test="lineCode != null">
|
||||||
|
and be.sap_code like concat('%',#{lineCode},'%')
|
||||||
|
</if>
|
||||||
|
<if test="productName != null">
|
||||||
|
and pow.product_name like concat('%',#{productName},'%')
|
||||||
|
</if>
|
||||||
|
and pow.workorder_name is not null and pow.status in('w3','w4')
|
||||||
|
</select>
|
||||||
|
<select id="getPlanQtyByOrderCode" resultType="java.math.BigDecimal">
|
||||||
|
select sum(quantity_split) from pro_order_workorder
|
||||||
|
where workorder_code = #{workorderCode}
|
||||||
|
and del_flag ='0' and parent_order = '0'
|
||||||
|
</select>
|
||||||
|
<select id="getActQtyByOrderCode" resultType="java.math.BigDecimal">
|
||||||
|
select sum(quantity_feedback) from mes_report_work
|
||||||
|
where workorder_code = #{workorderCode}
|
||||||
|
and del_flag ='0' and parent_order = '0'
|
||||||
|
</select>
|
||||||
|
<select id="getStandarInfo" resultType="com.op.mes.domain.MesLineProduct">
|
||||||
|
SELECT
|
||||||
|
mlp.hour_efficiency hourEfficiency,
|
||||||
|
mlp.use_man useMan
|
||||||
|
FROM
|
||||||
|
mes_line_product mlp
|
||||||
|
left join base_equipment be on mlp.line_code = be.equipment_code
|
||||||
|
WHERE
|
||||||
|
mlp.product_code = #{productCode}
|
||||||
|
AND be.sap_code = #{lineCode}
|
||||||
|
AND mlp.del_flag = '0'
|
||||||
|
</select>
|
||||||
|
<select id="getSonActManByOrderCode" resultType="com.op.mes.domain.MesReportWork">
|
||||||
|
select use_man useMan,
|
||||||
|
sum(work_time) workTime
|
||||||
|
from mes_report_work
|
||||||
|
where del_flag ='0' and parent_order = #{workorderCode}
|
||||||
|
group by use_man
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertMesLineAssistantQty" parameterType="MesLineAssistantQty">
|
||||||
|
insert into mes_line_assistant_qty
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">id,
|
||||||
|
</if>
|
||||||
|
<if test="factoryCode != null">factory_code,
|
||||||
|
</if>
|
||||||
|
<if test="productDate != null">product_date,
|
||||||
|
</if>
|
||||||
|
<if test="monitorQty != null">monitor_qty,
|
||||||
|
</if>
|
||||||
|
<if test="groupleaderQty != null">groupLeader_qty,
|
||||||
|
</if>
|
||||||
|
<if test="materialQty != null">material_qty,
|
||||||
|
</if>
|
||||||
|
<if test="pillMgrQty != null">pill_mgr_qty,
|
||||||
|
</if>
|
||||||
|
<if test="pillDisQty != null">pill_dis_qty,
|
||||||
|
</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="id != null">#{id},
|
||||||
|
</if>
|
||||||
|
<if test="factoryCode != null">#{factoryCode},
|
||||||
|
</if>
|
||||||
|
<if test="productDate != null">#{productDate},
|
||||||
|
</if>
|
||||||
|
<if test="monitorQty != null">#{monitorQty},
|
||||||
|
</if>
|
||||||
|
<if test="groupleaderQty != null">#{groupleaderQty},
|
||||||
|
</if>
|
||||||
|
<if test="materialQty != null">#{materialQty},
|
||||||
|
</if>
|
||||||
|
<if test="pillMgrQty != null">#{pillMgrQty},
|
||||||
|
</if>
|
||||||
|
<if test="pillDisQty != null">#{pillDisQty},
|
||||||
|
</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="updateMesLineAssistantQty" parameterType="MesLineAssistantQty">
|
||||||
|
update mes_line_assistant_qty
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="factoryCode != null">factory_code =
|
||||||
|
#{factoryCode},
|
||||||
|
</if>
|
||||||
|
<if test="productDate != null">product_date =
|
||||||
|
#{productDate},
|
||||||
|
</if>
|
||||||
|
<if test="monitorQty != null">monitor_qty =
|
||||||
|
#{monitorQty},
|
||||||
|
</if>
|
||||||
|
<if test="groupleaderQty != null">groupLeader_qty =
|
||||||
|
#{groupleaderQty},
|
||||||
|
</if>
|
||||||
|
<if test="materialQty != null">material_qty =
|
||||||
|
#{materialQty},
|
||||||
|
</if>
|
||||||
|
<if test="pillMgrQty != null">pill_mgr_qty =
|
||||||
|
#{pillMgrQty},
|
||||||
|
</if>
|
||||||
|
<if test="pillDisQty != null">pill_dis_qty =
|
||||||
|
#{pillDisQty},
|
||||||
|
</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 id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteMesLineAssistantQtyById" parameterType="String">
|
||||||
|
delete from mes_line_assistant_qty where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteMesLineAssistantQtyByIds" parameterType="String">
|
||||||
|
delete from mes_line_assistant_qty where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -0,0 +1,94 @@
|
|||||||
|
package com.op.system.domain;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
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;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工考勤记录对象 mes_clock_record
|
||||||
|
*
|
||||||
|
* @author yangwl
|
||||||
|
* @date 2025-03-21
|
||||||
|
*/
|
||||||
|
public class MesClockRecord extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private String day;
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
/** 打卡时间 */
|
||||||
|
@Excel(name = "打卡时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date clockTime;
|
||||||
|
|
||||||
|
/** 工号 */
|
||||||
|
@Excel(name = "工号")
|
||||||
|
private String workNo;
|
||||||
|
|
||||||
|
/** 姓名 */
|
||||||
|
@Excel(name = "姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void setClockTime(Date clockTime)
|
||||||
|
{
|
||||||
|
this.clockTime = clockTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getClockTime()
|
||||||
|
{
|
||||||
|
return clockTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDay() {
|
||||||
|
return day;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDay(String day) {
|
||||||
|
this.day = day;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTime() {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTime(String time) {
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWorkNo() {
|
||||||
|
return workNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorkNo(String workNo) {
|
||||||
|
this.workNo = workNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name)
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "MesClockRecord{" +
|
||||||
|
"day='" + day + '\'' +
|
||||||
|
", time='" + time + '\'' +
|
||||||
|
", clockTime=" + clockTime +
|
||||||
|
", workNo='" + workNo + '\'' +
|
||||||
|
", name='" + name + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package com.op.system.mapper;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import com.op.system.domain.MesClockRecord;
|
||||||
|
import feign.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工考勤记录Mapper接口
|
||||||
|
*
|
||||||
|
* @author yangwl
|
||||||
|
* @date 2025-03-21
|
||||||
|
*/
|
||||||
|
public interface MesClockRecordMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询员工考勤记录
|
||||||
|
*
|
||||||
|
* @param clockTime 员工考勤记录ID
|
||||||
|
* @return 员工考勤记录
|
||||||
|
*/
|
||||||
|
public MesClockRecord selectMesClockRecordById(Date clockTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询员工考勤记录列表
|
||||||
|
*
|
||||||
|
* @param mesClockRecord 员工考勤记录
|
||||||
|
* @return 员工考勤记录集合
|
||||||
|
*/
|
||||||
|
public List<MesClockRecord> selectMesClockRecordList(MesClockRecord mesClockRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增员工考勤记录
|
||||||
|
*
|
||||||
|
* @param mesClockRecord 员工考勤记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertMesClockRecord(MesClockRecord mesClockRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改员工考勤记录
|
||||||
|
*
|
||||||
|
* @param mesClockRecord 员工考勤记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateMesClockRecord(MesClockRecord mesClockRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除员工考勤记录
|
||||||
|
*
|
||||||
|
* @param clockTime 员工考勤记录ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMesClockRecordById(Date clockTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除员工考勤记录
|
||||||
|
*
|
||||||
|
* @param clockTimes 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMesClockRecordByIds(String[] clockTimes);
|
||||||
|
|
||||||
|
|
||||||
|
void insertMesClockRecordList(List<MesClockRecord> list);
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
package com.op.system.service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import com.op.system.domain.MesClockRecord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工考勤记录Service接口
|
||||||
|
*
|
||||||
|
* @author yangwl
|
||||||
|
* @date 2025-03-21
|
||||||
|
*/
|
||||||
|
public interface IMesClockRecordService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询员工考勤记录
|
||||||
|
*
|
||||||
|
* @param clockTime 员工考勤记录ID
|
||||||
|
* @return 员工考勤记录
|
||||||
|
*/
|
||||||
|
public MesClockRecord selectMesClockRecordById(Date clockTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询员工考勤记录列表
|
||||||
|
*
|
||||||
|
* @param mesClockRecord 员工考勤记录
|
||||||
|
* @return 员工考勤记录集合
|
||||||
|
*/
|
||||||
|
public List<MesClockRecord> selectMesClockRecordList(MesClockRecord mesClockRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增员工考勤记录
|
||||||
|
*
|
||||||
|
* @param mesClockRecord 员工考勤记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertMesClockRecord(MesClockRecord mesClockRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改员工考勤记录
|
||||||
|
*
|
||||||
|
* @param mesClockRecord 员工考勤记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateMesClockRecord(MesClockRecord mesClockRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除员工考勤记录
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMesClockRecordByIds(String ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除员工考勤记录信息
|
||||||
|
*
|
||||||
|
* @param clockTime 员工考勤记录ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMesClockRecordById(Date clockTime);
|
||||||
|
}
|
@ -0,0 +1,101 @@
|
|||||||
|
package com.op.system.service.impl;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.op.common.core.text.Convert;
|
||||||
|
import com.op.common.core.utils.DateUtils;
|
||||||
|
import com.op.system.mapper.MesClockRecordMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.op.system.domain.MesClockRecord;
|
||||||
|
import com.op.system.service.IMesClockRecordService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工考勤记录Service业务层处理
|
||||||
|
*
|
||||||
|
* @author yangwl
|
||||||
|
* @date 2025-03-21
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MesClockRecordServiceImpl implements IMesClockRecordService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private MesClockRecordMapper mesClockRecordMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询员工考勤记录
|
||||||
|
*
|
||||||
|
* @param clockTime 员工考勤记录ID
|
||||||
|
* @return 员工考勤记录
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public MesClockRecord selectMesClockRecordById(Date clockTime)
|
||||||
|
{
|
||||||
|
return mesClockRecordMapper.selectMesClockRecordById(clockTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询员工考勤记录列表
|
||||||
|
*
|
||||||
|
* @param mesClockRecord 员工考勤记录
|
||||||
|
* @return 员工考勤记录
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<MesClockRecord> selectMesClockRecordList(MesClockRecord mesClockRecord)
|
||||||
|
{
|
||||||
|
return mesClockRecordMapper.selectMesClockRecordList(mesClockRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增员工考勤记录
|
||||||
|
*
|
||||||
|
* @param mesClockRecord 员工考勤记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertMesClockRecord(MesClockRecord mesClockRecord)
|
||||||
|
{
|
||||||
|
mesClockRecord.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return mesClockRecordMapper.insertMesClockRecord(mesClockRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改员工考勤记录
|
||||||
|
*
|
||||||
|
* @param mesClockRecord 员工考勤记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateMesClockRecord(MesClockRecord mesClockRecord)
|
||||||
|
{
|
||||||
|
mesClockRecord.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return mesClockRecordMapper.updateMesClockRecord(mesClockRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除员工考勤记录对象
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteMesClockRecordByIds(String ids)
|
||||||
|
{
|
||||||
|
return mesClockRecordMapper.deleteMesClockRecordByIds(Convert.toStrArray(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除员工考勤记录信息
|
||||||
|
*
|
||||||
|
* @param clockTime 员工考勤记录ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteMesClockRecordById(Date clockTime)
|
||||||
|
{
|
||||||
|
return mesClockRecordMapper.deleteMesClockRecordById(clockTime);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,87 @@
|
|||||||
|
<?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.system.mapper.MesClockRecordMapper">
|
||||||
|
|
||||||
|
<resultMap type="MesClockRecord" id="MesClockRecordResult">
|
||||||
|
<result property="clockTime" column="clock_time" />
|
||||||
|
<result property="workno" column="workno" />
|
||||||
|
<result property="name" column="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="selectMesClockRecordVo">
|
||||||
|
select clock_time, workno, name, create_by, create_time, update_by, update_time from mes_clock_record
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectMesClockRecordList" parameterType="MesClockRecord" resultMap="MesClockRecordResult">
|
||||||
|
<include refid="selectMesClockRecordVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="clockTime != null "> and clock_time = #{clockTime}</if>
|
||||||
|
<if test="workno != null and workno != ''"> and workno = #{workno}</if>
|
||||||
|
<if test="name != null and name != ''"> and name like ('%' + #{name} + '%')</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMesClockRecordById" parameterType="Date" resultMap="MesClockRecordResult">
|
||||||
|
<include refid="selectMesClockRecordVo"/>
|
||||||
|
where clock_time = #{clockTime}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertMesClockRecord" parameterType="MesClockRecord">
|
||||||
|
insert into mes_clock_record
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="clockTime != null">clock_time,</if>
|
||||||
|
<if test="workNo != null">workno,</if>
|
||||||
|
<if test="name != null">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="clockTime != null">#{clockTime},</if>
|
||||||
|
<if test="workNo != null">#{workNo},</if>
|
||||||
|
<if test="name != null">#{name},</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>
|
||||||
|
<insert id="insertMesClockRecordList">
|
||||||
|
INSERT INTO mes_clock_record (clock_time,workno, name) VALUES
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.clockTime}, #{item.workNo}, #{item.name})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateMesClockRecord" parameterType="MesClockRecord">
|
||||||
|
update mes_clock_record
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="workno != null">workno = #{workno},</if>
|
||||||
|
<if test="name != null">name = #{name},</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 clock_time = #{clockTime}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteMesClockRecordById" parameterType="Date">
|
||||||
|
delete from mes_clock_record where clock_time = #{clockTime}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteMesClockRecordByIds" parameterType="String">
|
||||||
|
delete from mes_clock_record where clock_time in
|
||||||
|
<foreach item="clockTime" collection="array" open="(" separator="," close=")">
|
||||||
|
#{clockTime}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue