Commit 5f595f13 authored by zhoumaotao's avatar zhoumaotao

代码调整

parent 15d40a16
......@@ -19,6 +19,7 @@ import com.gavel.kwell.vo.GpwxmxVO;
import com.gavel.kwell.vo.WolinkInfoVO;
import com.gavel.kwell.vo.WosngzVO;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.wo.persistent.Wogylx;
import com.gavel.wo.vo.WobomVO;
import com.gavel.wo.vo.WogylxVO;
......@@ -61,7 +62,7 @@ public interface GpfkDao extends BaseDao {
public Bzgx getLastGx(Bzgx bzgx);
public Bzgx getNextGx(Bzgx bzgx);
public Wogylx getNextGx(Wogylx wogylx);
public GpfkVO queryGxidHasGpfk(String snid, String[] jygxs);
......@@ -85,8 +86,6 @@ public interface GpfkDao extends BaseDao {
public int queryGxTimes(String gxid,String wosnid);
public int queryZxNum(String wosnid);
public RecordSet<GpfkVO> queryLh(GpfkCondition condition);
public List<GpfkVO> queryCanZxsnList(String[] snids, String[] zxpdgxs);
......
......@@ -4,6 +4,7 @@ package com.gavel.kwell.dao.impl;
import java.util.Date;
import java.util.List;
import com.gavel.wo.persistent.Wogylx;
import org.springframework.stereotype.Repository;
import com.gavel.common.Constants;
......@@ -674,29 +675,25 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
}
@Override
public Bzgx getNextGx(Bzgx bzgx){
public Wogylx getNextGx(Wogylx wogylx){
SqlMap sqlMap = new SqlMap();
sqlMap.append("select top 1 BZGX_ID, BZGX_CODE, BZGX_NAME, BZGX_GCID, BZGX_GZZXID, ");
sqlMap.append(" BZGX_SBSL, BZGX_ZYRSL, BZGX_PDHS, BZGX_ZBHS, BZGX_JGHS, ");
sqlMap.append(" BZGX_ZYHS, BZGX_GJGX, BZGX_GXLX, BZGX_TYBZ, BZGX_TYRQ, ");
sqlMap.append(" BZGX_BZ, BZGX_CJRID, BZGX_CJR, BZGX_CJSJ, BZGX_WHRID, ");
sqlMap.append(" BZGX_WHR, BZGX_WHSJ, BZGX_SYSVERSION, BZGX_XH ");
sqlMap.append("from BZGX ");
sqlMap.append("select top 1 WOGYLX_ID, WOGYLX_WOID, WOGYLX_XH, WOGYLX_BZGXID, WOGYLX_GYLXID, ");
sqlMap.append(" WOGYLX_NAME, WOGYLX_GXLX, WOGYLX_GZZXID, WOGYLX_SBSL, WOGYLX_ZYRSL, ");
sqlMap.append(" WOGYLX_PDHS, WOGYLX_ZBHS, WOGYLX_JGHS, WOGYLX_ZYHS, WOGYLX_GJGX, ");
sqlMap.append(" WOGYLX_DWSJCL, WOGYLX_PCBS, WOGYLX_XQSL, WOGYLX_BZ, WOGYLX_CJRID, ");
sqlMap.append(" WOGYLX_CJR, WOGYLX_CJSJ, WOGYLX_WHRID, WOGYLX_WHR, WOGYLX_WHSJ, ");
sqlMap.append(" WOGYLX_SYSVERSION, GZZX_NAME, WOGYLX_GXBZ ");
sqlMap.append("from WOGYLX ");
sqlMap.append("where 1 = 1 ");
sqlMap.append(" and isnull(BZGX_XH,0) <> 0 ");
sqlMap.append(" and BZGX_TYBZ = 'N' ");
if(StringUtils.isNotEmpty(bzgx.getGzzxid())){
sqlMap.append(" and isnull(WOGYLX_XH,0) <> 0 ");
if(StringUtils.isNotEmpty(wogylx.getGzzxid())){
sqlMap.append(" and BZGX_GZZXID = :pGZZXID ");
sqlMap.setParamValue("pGZZXID",bzgx.getGzzxid());
}
if(StringUtils.isNotEmpty(bzgx.getGcid())){
sqlMap.append(" and BZGX_GCID = :pGCID ");
sqlMap.setParamValue("pGCID",bzgx.getGcid());
sqlMap.setParamValue("pGZZXID",wogylx.getGzzxid());
}
sqlMap.append(" and BZGX_XH > :pXH ");
sqlMap.append("order by BZGX_XH asc ");
sqlMap.setParamValue("pXH",bzgx.getXh());
return sqlMap.queryEntity(Bzgx.class);
sqlMap.append("order by BZGX_XH ");
sqlMap.setParamValue("pXH",wogylx.getXh());
return sqlMap.queryEntity(Wogylx.class);
}
@Override
......@@ -1005,17 +1002,6 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
}
}
@Override
public int queryZxNum(String wosnid){
try {
SqlMap sqlMap = new SqlMap();
sqlMap.setParamValue("pWOSNID", wosnid);
return sqlMap.queryInt();
} catch (Exception e) {
return 0;
}
}
@Override
public List<GpfkVO> queryCanZxsnList(String[] snids, String[] zxpdgxs){
SqlMap sqlMap = new SqlMap();
......
......@@ -32,6 +32,7 @@ import com.gavel.kzzx.vo.YymkCondition;
import com.gavel.kzzx.vo.YymkVO;
import com.gavel.persistence.entity.EntityDataFactory;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.wo.persistent.Wogylx;
import com.gavel.wo.persistent.Wosn;
import com.gavel.wo.vo.WobomVO;
import org.apache.shiro.SecurityUtils;
......@@ -563,25 +564,22 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
public void delGpfkById(String gpfkid){
Gpfk gpfk = gpfkDao.queryById(Gpfk.class,gpfkid);
if (gpfk == null) {
throw new RuntimeException("数据发生变化,请重新操作!");
throw new RuntimeException("装配反馈记录不存在,请检查!");
}
if(!UserInfoUtil.isSuperuser() && !StringUtils.equalsIgnoreCase(gpfk.getFkrid(),UserInfoUtil.getUserId())){
throw new RuntimeException("当前工单由其他人反馈,不允许取消!");
}
if(NumberUtils.Greater(gpfkDao.queryZxNum(gpfk.getWosnid()),0)){
throw new RuntimeException("当前条码已装箱,不允许取消!");
}
Bzgx bzgx = gpfkDao.queryById(Bzgx.class, gpfk.getFkgx());
if(!NumberUtils.equals(bzgx.getXh(),0)){
Bzgx existNextGx = gpfkDao.getNextGx(bzgx);
if(existNextGx != null){
List<Gpfk> gpfkList = gpfkDao.queryExistGpfk(gpfk.getWosnid(),existNextGx.getId());
if(gpfkList != null && gpfkList.size() > 0){
throw new RuntimeException(String.format("下道工序【%s】已完成,不允许取消反馈!", existNextGx.getName()));
Wogylx wogylx = gpfkDao.queryById(Wogylx.class, gpfk.getWogylx());
if(!NumberUtils.equals(wogylx.getXh(),0)){
Wogylx existNextWogylx = gpfkDao.getNextGx(wogylx);
if(existNextWogylx != null){
List<Gpfk> gpfkList = gpfkDao.queryExistGpfk(gpfk.getWosnid(),existNextWogylx.getId());
if(CollectionUtils.isNotEmpty(gpfkList)){
throw new RuntimeException(String.format("下道工艺路线【%s】已完成,不允许取消反馈!", existNextWogylx.getName()));
}
}
}
gpfk.setId(gpfkid);
delete(gpfk);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment