Commit 32d39f22 authored by yff's avatar yff

修改装配BUG

parent 1280849b
......@@ -130,4 +130,6 @@ public interface GpfkDao extends BaseDao {
public double getNowGyFksl(Wogylx wogylx);
public List<WobomVO> queryWobomByFkidAndWlid(String fkid,String wlid,String bzlx);
}
......@@ -1307,6 +1307,40 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
}
return sqlMap.queryDouble();
}
@Override
public List<WobomVO> queryWobomByFkidAndWlid(String fkid,String wlid,String bzlx) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select WOBOM_ID, WOBOM_XH, WOBOM_WOID, WOBOM_WLID, WOBOM_FFGX,");
sqlMap.append(" WOBOM_DWYL, WOBOM_XQSL, WOBOM_XQRQ, WOBOM_SHL, WOBOM_SHZ, WOBOM_FFYZ,");
sqlMap.append(" WOBOM_LLSL, WOBOM_CKSL, WOBOM_BZ, WOBOM_WHRID, WOBOM_WHR,");
sqlMap.append(" WOBOM_WHSJ, WOBOM_CJRID, WOBOM_CJR, WOBOM_CJSJ, WOBOM_SYSVERSION,");
sqlMap.append(" WLXX_CODE, WLXX_NAME, WLXX_GG, WOBOM_GJWL, WOBOM_ZT, WOBOM_DJLY,");
sqlMap.append(" WOGYLX_XH, WOGYLX_NAME, WOBOM_WLPH ");
sqlMap.append("from WOBOM");
sqlMap.append(" left join WLXX on WLXX_ID = WOBOM_WLID");
sqlMap.append(" left join WO on WO_ID = WOBOM_WOID");
sqlMap.append(" left join WOSN on WOSN_WOID = WO_ID");
sqlMap.append(" left join WOGYLX on WOGYLX_WOID = WO_ID ");
sqlMap.append(" left join BZGX on BZGX_ID = WOGYLX_BZGXID and BZGX_ID = WOBOM_FFGX");
sqlMap.append(" left join GPFK on GPFK_WOSNID = WOSN_CODE and GPFK_FKGX= BZGX_ID and GPFK_WOGYLX =WOGYLX_ID");
sqlMap.append("where 1=1");
if (StringUtils.isNotEmpty(bzlx)){
sqlMap.append(" and " + SqlUtil.getWhereSql("BZGX_ID", bzlx));
sqlMap.setParamValue("BZGX_ID", bzlx);
}
if (StringUtils.isNotEmpty(wlid)){
sqlMap.append(" and " + SqlUtil.getWhereSql("WLXX_ID", wlid));
sqlMap.setParamValue("WLXX_ID", wlid);
}
if (StringUtils.isNotEmpty(fkid)){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPFK_ID", fkid));
sqlMap.setParamValue("GPFK_ID", fkid);
}
sqlMap.append("order by WOBOM_XH, WLXX_CODE");
System.out.println(sqlMap.getSqlText());
return sqlMap.query(WobomVO.class);
}
}
......
......@@ -165,7 +165,7 @@ public class GphyDaoImpl extends BaseDaoImpl implements GphyDao {
sqlMap.append(" group by GPHY_MID) b on b.fkid =a.fkid ");
sqlMap.append("where 1 = 1 ");
if (StringUtils.isNotEmpty(condition.getMid())){
sqlMap.append(" and b.fkid = " + condition.getMid());
sqlMap.append(" and b.fkid = '" + condition.getMid()+"'");
}
System.out.println(sqlMap.getSqlText());
return sqlMap.queryInt();
......
......@@ -740,7 +740,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
List<SmCodeModel> smCodeModels =SmCodeEnum.toList();
if(smCodeModels!=null&&smCodeModels.size()>0) {
for(SmCodeModel smCodeModel:smCodeModels) {
if(snid.toUpperCase().contains(smCodeModel.getPrefix())) {
if(snid.toUpperCase().startsWith(smCodeModel.getPrefix())) {
return smCodeModel;
}
}
......@@ -772,38 +772,37 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
gpfkCondition.setWosnid(wosn);
gpfkCondition.setBzgxid(bzlx);
GpfkVO gpfkVo = gpfkDao.queryKwellGpfkByWosnAndGxid(gpfkCondition);
WolinkInfoVO wolinkInfoVO =gpfkDao.queryKwellWoBySnid(wosn, bzlx);
if(wolinkInfoVO==null) {
throwReturnMessage("不存在对应订单序号标准类型信息");
}
Wogylx wogylx = gpfkDao.queryById(Wogylx.class, wolinkInfoVO.getWogylxid());
if(!NumberUtils.equals(wogylx.getXh(),0)){
Wogylx existLastWogylx = gpfkDao.getLastGx(wogylx);
if(existLastWogylx != null){
GpfkCondition gpfkCondition2 =new GpfkCondition();
gpfkCondition2.setWogylx(existLastWogylx.getId());
gpfkCondition2.setWosnid(wosn);
gpfkCondition2.setBzgxid(existLastWogylx.getBzgxid());
GpfkVO gpfk2 = gpfkDao.queryKwellGpfkByWosnAndGxid(gpfkCondition2);
if(gpfk2!=null) {
if(existLastWogylx.getGylxid().equals(HzGylxEnum.ZP.getId())) {
GphyCondition gphyCondition =new GphyCondition();
gphyCondition.setMid(gpfk2.getId());
if(gphyDao.queryIfZpwc(gphyCondition)!=0) {
throwReturnMessage("上道工序未完成不能装配此道工序");
}
}
}
else {
throwReturnMessage("上道工序未完成不能装配此道工序");
}
}
}
if(!wolinkInfoVO.getWozt().equals("R")) {
throwReturnMessage("订单未下达");
}
if(gpfkVo==null) {
WolinkInfoVO wolinkInfoVO =gpfkDao.queryKwellWoBySnid(wosn, bzlx);
if(wolinkInfoVO==null) {
throwReturnMessage("不存在对应订单序号标准类型信息");
}
Wogylx wogylx = gpfkDao.queryById(Wogylx.class, wolinkInfoVO.getWogylxid());
if(!NumberUtils.equals(wogylx.getXh(),0)){
Wogylx existLastWogylx = gpfkDao.getLastGx(wogylx);
if(existLastWogylx != null){
GpfkCondition gpfkCondition2 =new GpfkCondition();
gpfkCondition.setWogylx(existLastWogylx.getId());
gpfkCondition.setWosnid(wosn);
gpfkCondition.setBzgxid(existLastWogylx.getBzgxid());
GpfkVO gpfk2 = gpfkDao.queryKwellGpfkByWosnAndGxid(gpfkCondition2);
if(gpfk2!=null) {
if(existLastWogylx.getGylxid().equals(HzGylxEnum.ZP.getId())) {
GphyCondition gphyCondition =new GphyCondition();
gphyCondition.setMid(gpfk2.getId());
if(gphyDao.queryIfZpwc(gphyCondition)!=0) {
throwReturnMessage("上道工序未完成不能装配此道工序");
}
}
}
else {
throwReturnMessage("上道工序未完成不能装配此道工序");
}
}
}
if(!wolinkInfoVO.getWozt().equals("R")) {
throwReturnMessage("订单未下达");
}
/**判断上一道工序**/
Gpfk gpfk = new Gpfk();
gpfk.setWosnid(wolinkInfoVO.getWosnCode());
gpfk.setWogylx(wolinkInfoVO.getWogylxid());
......
......@@ -23,7 +23,9 @@ import com.gavel.kwell.vo.GphyVO;
import com.gavel.kwell.vo.GphycxVO;
import com.gavel.kwell.vo.WlslItem;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.wo.persistent.Wobom;
import com.gavel.wo.persistent.Wogylx;
import com.gavel.wo.vo.WobomVO;
@Service("gphyService")
......@@ -74,7 +76,18 @@ public class GphyServiceImpl extends BaseEditServiceImpl implements GphyService
@Override
public Gpfk zpwl(GphyCondition condition) {
List<GphyVO> dbGphy = gphyDao.queryKwellZpGphy(condition).getRecords();
if(dbGphy!=null&&dbGphy.size()>0) {
throwReturnMessage("该序列号已经被扫描");
}
String wlid = coderuleService.matchCodeByRule(condition.getSnid());
if(StringUtils.isEmpty(wlid)) {
throwReturnMessage("不存在该物料");
}
List<WobomVO> woboms = gpfkDao.queryWobomByFkidAndWlid(condition.getMid(), wlid, condition.getGxid());
if(woboms==null||woboms.size()<=0) {
throwReturnMessage("该订单不存在该物料");
}
if(compareIsZpComplete(condition.getFkid(),wlid)) {
Gphy gphy = new Gphy();
gphy.setFkgx(condition.getGxid());
......
......@@ -7,7 +7,7 @@ public enum SmCodeEnum {
LOGOUT("LOGOUT", "退出","LOGOUT",10),
WOSNID("WOSNID","工单序列号","20",10),
WOSNID("WOSNID","工单序列号","2",10),
// WLID("WLID","物料编码","D",10),
OKBZ("OKBZ","OK按钮","OK",10),
NGBZ("NGBZ","NG按钮","NG",10);
......
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