提交zh修改问题

yun-zuoyi
wynne1005 5 years ago
parent 6f375edf9a
commit 878acb869f

@ -243,6 +243,9 @@ public interface BaseRepository <T, ID extends Serializable> extends JpaReposito
T getByProperty(String[] propertyNames, Object[] values);
@Deprecated
T getByPropertyPager(String[] propertyNames, Object[] values,Pager pager);
int listCount();
int findByPropertyCount(String propertyName, Object value);

@ -46,6 +46,8 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
private Class<T> persistentClass;
private SnowflakeIdMaker snowflakeIdMaker;
/* 默认查询数据条数 */
private static final Pager DEFAULT_PAGER = new Pager(10,10);
public BaseRepositoryImpl(Class<T> clz, EntityManager em, SnowflakeIdMaker snowflakeIdMaker) {
super(clz, em);
@ -506,10 +508,9 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
@Override
public T getByProperty(DdlPackBean packBean) {
try {
List<T> list = findByHqlWhere(packBean);
return list.size() != 0 ? list.get(0) : null;
List<T> list = findByHqlWherePage(packBean,DEFAULT_PAGER);
return list != null && list.size() != 0 ? list.get(0) : null;
}catch(NoResultException ne){
LOGGER.error("数据不存在DdlPackBean{}",packBean);
return null;
@ -521,21 +522,18 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
@Override
public T getByProperty(String propertyName, Object value) {
String queryString = "from " + persistentClass.getSimpleName() + " as model where model." + propertyName + "= :" + propertyName;
try {
List<T> list = entityManager.createQuery(queryString).setParameter(propertyName, value).getResultList();
return list.size() != 0 ? list.get(0) : null;
}catch(NoResultException ne){
LOGGER.error("数据不存在prop{},value{}",propertyName,value,ne);
return null;
}catch(NonUniqueResultException ex){
LOGGER.error("查询单条记录但出现多条。prop{},value{}",propertyName,value,ex);
throw new RuntimeException("存在多条记录:" + ex.getMessage());
}
return getByPropertyPager(new String[]{propertyName}, new Object[]{value}, DEFAULT_PAGER);
}
@Override
public T getByProperty(String[] propertyNames, Object[] values) {
return getByPropertyPager(propertyNames, values, DEFAULT_PAGER);
}
@Override
public T getByPropertyPager(String[] propertyNames, Object[] values, Pager pager) {
pager = pager == null ? DEFAULT_PAGER: pager;
if(propertyNames.length != values.length){
throw new IllegalArgumentException("参数名的数量和参数值不匹配!propertyNames:" + propertyNames.length + ",values:" + values.length);
}
@ -561,7 +559,10 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
}
try{
List<T> list = queryObject.getResultList();
List<T> list = queryObject
.setFirstResult(pager.getStartRow())
.setMaxResults(pager.getPageSize())
.getResultList();
return list.size() != 0 ? list.get(0) : null;
}catch(NoResultException ne){
LOGGER.error("数据不存在",ne);
@ -602,7 +603,7 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
try {
if(!StringUtil.isEmpty(vendorNoStr)){
String queryString = "from " + persistentClass.getSimpleName() + " as model where model.vendorNo= :vendorNo";
list=entityManager.createQuery(queryString)
list=entityManager.createQuery(queryString)
.setParameter("vendorNo", vendorNoStr)
.getResultList();
}

@ -100,9 +100,9 @@ public class IfPackageDetail extends BaseBean implements Serializable {
@ApiParam("容器编号")
private String ctNo;
@Column(name = "SN_TYPE")
@Column(name = "SAMPLE_TYPE")
@ApiParam("条码类型")
private String snType;
private String sampleType;
@Column(name = "CUST_DELIVERY_LOCATION")
@ApiParam("客户发往地")

@ -112,7 +112,7 @@ public class MesPackage extends BaseBean implements Serializable {
@Column(name = "SAMPLE_TYPE")
@ApiParam("条码类型")
private String sampleType;
private String sampleType = "10";
@Transient
@ApiParam("客户发往地")

@ -0,0 +1,44 @@
package cn.estsh.i3plus.pojo.mes.bean;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
* @Author: Wynne.Lu
* @CreateDate: 2019/7/30 9:30 AM
* @Description:
**/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_PART_SAMPLE")
@Api("产品样本配置")
public class MesPartSample extends BaseBean implements Serializable {
private static final long serialVersionUID = -9190123981329081945L;
@Column(name = "WORK_CENTER_CODE")
@ApiParam("工作中心代码")
private String workCenterCode;
@Column(name = "PART_NO")
@ApiParam("物料号")
private String partNo;
@Column(name = "QTY")
@ApiParam("数量")
private Double qty;
}

@ -24,7 +24,7 @@ import java.io.Serializable;
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_SUB_PART")
@Api("数据同步死信")
@Api("替代料")
public class MesSubPart extends BaseBean implements Serializable {
private static final long serialVersionUID = 4636507477301700549L;

@ -37,20 +37,27 @@ public class ButtonDynamicModel {
private String paramValue;
public ButtonDynamicModel(Long id, String buttonCode, String buttonName){
public ButtonDynamicModel(Long id, String buttonCode, String buttonName) {
this.id = id;
this.buttonCode = buttonCode;
this.buttonName = buttonName;
}
public ButtonDynamicModel(String buttonCode, String buttonName, String paramCode){
public ButtonDynamicModel(String buttonCode, String buttonName, String paramCode) {
this.buttonCode = buttonCode;
this.buttonName = buttonName;
this.paramCode = paramCode;
}
public ButtonDynamicModel(Long id, String buttonCode, String windowNo, String windowModuleBack, String paramCode, String paramValue){
public ButtonDynamicModel(String buttonCode, String buttonName, String paramCode, String paramValue) {
this.buttonCode = buttonCode;
this.buttonName = buttonName;
this.paramCode = paramCode;
this.paramValue = paramValue;
}
public ButtonDynamicModel(Long id, String buttonCode, String windowNo, String windowModuleBack, String paramCode, String paramValue) {
this.id = id;
this.buttonCode = buttonCode;
this.windowNo = windowNo;

@ -0,0 +1,49 @@
package cn.estsh.i3plus.pojo.mes.model;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Map;
/**
* @author Wynne.Lu
* @date 2020/6/16 14:21
* @desc
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Api("打包样本")
public class PackageSampleModel {
@ApiParam(name = "已打包数量")
private Double alreadyPackageCount;
@ApiParam(name = "标准打包数量")
private Double standardPackageCount;
@ApiParam(name = "样本类型")
private Map<String, String> sampleTypeMap;
@ApiParam(name = "样本类型代码")
private String lastSampleTypeCode;
@ApiParam(name = "选择的样本类型")
private String chooseSampleTypeCode;
@ApiParam(name = "强制执行工步")
private String forceStepCode;
@ApiParam(name = "强制打包密码")
private String password;
@ApiParam(name = "工厂")
private String organizeCode;
@ApiParam(name = "工单号")
private String workOrderNo;
}

@ -0,0 +1,17 @@
package cn.estsh.i3plus.pojo.mes.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.mes.bean.MesPartSample;
import org.springframework.stereotype.Repository;
/**
* @Description :
* @Reference :
* @Author : jack.jia
* @CreateDate : 2019-04-02
* @Modify:
**/
@Repository
public interface MesPartSampleRepository extends BaseRepository<MesPartSample, Long> {
}
Loading…
Cancel
Save