forked from I3-YF/i3plus-mes-yfai
Merge remote-tracking branch 'origin/dev' into dev
commit
f62bd6c249
@ -1,13 +0,0 @@
|
|||||||
package cn.estsh.i3plus.ext.mes.api.base;
|
|
||||||
|
|
||||||
import cn.estsh.i3plus.pojo.mes.bean.MesDefect;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description:
|
|
||||||
* @CreateDate 2024/04/16
|
|
||||||
* @Author mingliang.li
|
|
||||||
*/
|
|
||||||
public interface IMesDefectService extends IBaseMesService<MesDefect> {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -0,0 +1,13 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.api.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesDefectType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @CreateDate 2024/04/16
|
||||||
|
* @Author mingliang.li
|
||||||
|
*/
|
||||||
|
public interface IMesDefectTypeService extends IBaseMesService<MesDefectType> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,15 +1,14 @@
|
|||||||
package cn.estsh.i3plus.ext.mes.apiservice.controller.base;
|
package cn.estsh.i3plus.ext.mes.apiservice.controller.base;
|
||||||
|
|
||||||
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
|
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
|
||||||
import cn.estsh.i3plus.pojo.mes.bean.MesDefectAlarmConfig;
|
import cn.estsh.i3plus.pojo.mes.bean.MesDefectWarnConfig;
|
||||||
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@Api(description = "缺陷告警配置")
|
@Api(description = "缺陷告警配置")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesDefectAlarmConfig")
|
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesDefectWarnConfig")
|
||||||
|
|
||||||
public class MesDefectAlarmConfigController extends BaseMesController<MesDefectAlarmConfig>{
|
public class MesDefectWarnConfigController extends BaseMesController<MesDefectWarnConfig> {
|
||||||
}
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.apiservice.dao;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pojo.model.MesShippingOrderManagementDetailModel;
|
||||||
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesShippingOrderManagementDetail;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : SAP生产计划
|
||||||
|
* @Reference :
|
||||||
|
* @Author : junsheng.li
|
||||||
|
* @CreateDate 2024/5/7 15:13
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public interface IMesShippingOrderManagementDetailDao {
|
||||||
|
|
||||||
|
int queryOrderDetailGroupByPartCount(MesShippingOrderManagementDetail detail);
|
||||||
|
|
||||||
|
List<MesShippingOrderManagementDetailModel> queryOrderDetailGroupByPartInfo(MesShippingOrderManagementDetail detail, Pager pager);
|
||||||
|
}
|
@ -0,0 +1,102 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.apiservice.daoimpl;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.apiservice.dao.IMesShippingOrderManagementDetailDao;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pojo.model.MesShippingOrderManagementDetailModel;
|
||||||
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||||
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesShippingOrderManagementDetail;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import javax.persistence.EntityManager;
|
||||||
|
import javax.persistence.Query;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :SAP生产计划
|
||||||
|
* @Reference :
|
||||||
|
* @Author : junsheng.li
|
||||||
|
* @CreateDate 2024/5/6 15:52
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class MesShippingOrderManagementDetailDaoImpl implements IMesShippingOrderManagementDetailDao {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EntityManager entityManager;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int queryOrderDetailGroupByPartCount(MesShippingOrderManagementDetail detail) {
|
||||||
|
|
||||||
|
StringBuffer hql = new StringBuffer("select count(1) ");
|
||||||
|
hql.append(" from mes_shipping_detail as msd");
|
||||||
|
hql.append(" where msd.organize_code = :organizeCode ");
|
||||||
|
hql.append(" and msd.is_deleted = :isDeleted ");
|
||||||
|
hql.append(" and msd.is_valid = :isValid ");
|
||||||
|
|
||||||
|
hql.append(" and msd.shipping_order_no = :shippingOrderNo ");
|
||||||
|
|
||||||
|
hql.append(" group by msd.part_no ,msd.part_name,msd.cust_part_no,msd.unit ");
|
||||||
|
|
||||||
|
Query query = entityManager.createNativeQuery(hql.toString());
|
||||||
|
query.setParameter("organizeCode", detail.getOrganizeCode());
|
||||||
|
query.setParameter("isValid", CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
|
||||||
|
query.setParameter("isDeleted", CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
|
||||||
|
query.setParameter("shippingOrderNo", detail.getShippingOrderNo());
|
||||||
|
|
||||||
|
List list = query.getResultList();
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return list.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MesShippingOrderManagementDetailModel> queryOrderDetailGroupByPartInfo(MesShippingOrderManagementDetail detail, Pager pager) {
|
||||||
|
|
||||||
|
|
||||||
|
StringBuffer hql = new StringBuffer("select msd.part_no ,msd.part_name, msd.cust_part_no,sum( msd.plan_qty) as planQty , sum( msd.actual_qty) as actualQty, msd.unit ");
|
||||||
|
hql.append(" from mes_shipping_detail as msd");
|
||||||
|
hql.append(" where msd.organize_code = :organizeCode ");
|
||||||
|
hql.append(" and msd.is_deleted = :isDeleted ");
|
||||||
|
hql.append(" and msd.is_valid = :isValid ");
|
||||||
|
|
||||||
|
hql.append(" and msd.shipping_order_no = :shippingOrderNo ");
|
||||||
|
|
||||||
|
hql.append(" group by msd.part_no ,msd.part_name,msd.cust_part_no,msd.unit ");
|
||||||
|
|
||||||
|
Query query = entityManager.createNativeQuery(hql.toString());
|
||||||
|
query.setParameter("organizeCode", detail.getOrganizeCode());
|
||||||
|
query.setParameter("isValid", CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
|
||||||
|
query.setParameter("isDeleted", CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
|
||||||
|
query.setParameter("shippingOrderNo", detail.getShippingOrderNo());
|
||||||
|
|
||||||
|
|
||||||
|
query.setFirstResult(pager.getStartRow()).setMaxResults(pager.getPageSize());
|
||||||
|
|
||||||
|
List list = query.getResultList();
|
||||||
|
List<MesShippingOrderManagementDetailModel> modelList = new ArrayList<>();
|
||||||
|
|
||||||
|
for (Object result : list) {
|
||||||
|
Object[] cells = (Object[]) result;
|
||||||
|
MesShippingOrderManagementDetailModel model = new MesShippingOrderManagementDetailModel();
|
||||||
|
model.setPartNo(StringUtils.isEmpty(cells[0]) ? "" : String.valueOf(cells[0]));
|
||||||
|
model.setPartName(StringUtils.isEmpty(cells[1]) ? "" : String.valueOf(cells[1]));
|
||||||
|
model.setCustPartNo(StringUtils.isEmpty(cells[2]) ? "" : String.valueOf(cells[2]));
|
||||||
|
model.setActualQty(StringUtils.isEmpty(cells[3]) ? 0 : Integer.parseInt(String.valueOf(cells[3])));
|
||||||
|
model.setActualQty(StringUtils.isEmpty(cells[4]) ? 0 : Integer.parseInt(String.valueOf(cells[4])));
|
||||||
|
model.setUnit(StringUtils.isEmpty(cells[5]) ? "" : String.valueOf(cells[5]));
|
||||||
|
modelList.add(model);
|
||||||
|
}
|
||||||
|
|
||||||
|
return modelList;
|
||||||
|
}
|
||||||
|
}
|
@ -1,22 +1,40 @@
|
|||||||
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
|
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
|
||||||
|
|
||||||
import cn.estsh.i3plus.ext.mes.api.base.IMesShippingOrderManagementDetailService;
|
import cn.estsh.i3plus.ext.mes.api.base.IMesShippingOrderManagementDetailService;
|
||||||
import cn.estsh.i3plus.ext.mes.api.base.IMesShippingOrderManagementService;
|
import cn.estsh.i3plus.ext.mes.apiservice.dao.IMesShippingOrderManagementDetailDao;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pojo.model.MesShippingOrderManagementDetailModel;
|
||||||
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||||
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||||
|
import cn.estsh.i3plus.pojo.base.common.PagerHelper;
|
||||||
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
||||||
import cn.estsh.i3plus.pojo.mes.bean.MesLoadingVehiclesOrderDetail;
|
|
||||||
import cn.estsh.i3plus.pojo.mes.bean.MesShippingOrderManagement;
|
|
||||||
import cn.estsh.i3plus.pojo.mes.bean.MesShippingOrderManagementDetail;
|
import cn.estsh.i3plus.pojo.mes.bean.MesShippingOrderManagementDetail;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class MesShippingOrderManagementDetailService extends BaseMesService<MesShippingOrderManagementDetail> implements IMesShippingOrderManagementDetailService {
|
public class MesShippingOrderManagementDetailService extends BaseMesService<MesShippingOrderManagementDetail> implements IMesShippingOrderManagementDetailService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMesShippingOrderManagementDetailDao shippingOrderManagementDetailDao;
|
||||||
|
|
||||||
protected void setPackQueryBean(MesShippingOrderManagementDetail bean, DdlPackBean packBean) {
|
protected void setPackQueryBean(MesShippingOrderManagementDetail bean, DdlPackBean packBean) {
|
||||||
DdlPreparedPack.getStringEqualPack(bean.getShippingOrderNo(), "shippingOrderNo", packBean);
|
DdlPreparedPack.getStringEqualPack(bean.getShippingOrderNo(), "shippingOrderNo", packBean);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ListPager<MesShippingOrderManagementDetailModel> queryDetailGroupByPartNo(MesShippingOrderManagementDetail bean, Pager pager) {
|
||||||
|
|
||||||
|
int count = shippingOrderManagementDetailDao.queryOrderDetailGroupByPartCount(bean);
|
||||||
|
|
||||||
|
pager = PagerHelper.getPager(pager, count);
|
||||||
|
|
||||||
|
List<MesShippingOrderManagementDetailModel> modelList = shippingOrderManagementDetailDao.queryOrderDetailGroupByPartInfo(bean, pager);
|
||||||
|
|
||||||
|
return new ListPager<>(modelList, pager);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pojo.model;
|
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class MesShippingOrderManagementDetailModel {
|
||||||
|
|
||||||
|
@ApiParam("物料号")
|
||||||
|
private String partNo;
|
||||||
|
|
||||||
|
@ApiParam("物料号")
|
||||||
|
private String partName;
|
||||||
|
|
||||||
|
@ApiParam("客户零件号")
|
||||||
|
private String custPartNo;
|
||||||
|
|
||||||
|
@ApiParam("计划发运数量")
|
||||||
|
private Double planQty;
|
||||||
|
|
||||||
|
@ApiParam("实际发运数量")
|
||||||
|
private Integer actualQty;
|
||||||
|
|
||||||
|
@ApiParam("计量单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue