Commit b50bba41 authored by 李苏's avatar 李苏 💬

Merge branch 'master' of gitlab.gavelinfo.com:gavelinfo/kwell-mes

parents 2728a14a 0be08980
...@@ -130,4 +130,6 @@ public interface GpfkDao extends BaseDao { ...@@ -130,4 +130,6 @@ public interface GpfkDao extends BaseDao {
public double getNowGyFksl(Wogylx wogylx); public double getNowGyFksl(Wogylx wogylx);
public List<WobomVO> queryWobomByFkidAndWlid(String fkid,String wlid,String bzlx);
} }
...@@ -1308,6 +1308,40 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -1308,6 +1308,40 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
return sqlMap.queryDouble(); 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 { ...@@ -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(" group by GPHY_MID) b on b.fkid =a.fkid ");
sqlMap.append("where 1 = 1 "); sqlMap.append("where 1 = 1 ");
if (StringUtils.isNotEmpty(condition.getMid())){ if (StringUtils.isNotEmpty(condition.getMid())){
sqlMap.append(" and b.fkid = " + condition.getMid()); sqlMap.append(" and b.fkid = '" + condition.getMid()+"'");
} }
System.out.println(sqlMap.getSqlText()); System.out.println(sqlMap.getSqlText());
return sqlMap.queryInt(); return sqlMap.queryInt();
......
...@@ -740,7 +740,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -740,7 +740,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
List<SmCodeModel> smCodeModels =SmCodeEnum.toList(); List<SmCodeModel> smCodeModels =SmCodeEnum.toList();
if(smCodeModels!=null&&smCodeModels.size()>0) { if(smCodeModels!=null&&smCodeModels.size()>0) {
for(SmCodeModel smCodeModel:smCodeModels) { for(SmCodeModel smCodeModel:smCodeModels) {
if(snid.toUpperCase().contains(smCodeModel.getPrefix())) { if(snid.toUpperCase().startsWith(smCodeModel.getPrefix())) {
return smCodeModel; return smCodeModel;
} }
} }
...@@ -772,7 +772,6 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -772,7 +772,6 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
gpfkCondition.setWosnid(wosn); gpfkCondition.setWosnid(wosn);
gpfkCondition.setBzgxid(bzlx); gpfkCondition.setBzgxid(bzlx);
GpfkVO gpfkVo = gpfkDao.queryKwellGpfkByWosnAndGxid(gpfkCondition); GpfkVO gpfkVo = gpfkDao.queryKwellGpfkByWosnAndGxid(gpfkCondition);
if(gpfkVo==null) {
WolinkInfoVO wolinkInfoVO =gpfkDao.queryKwellWoBySnid(wosn, bzlx); WolinkInfoVO wolinkInfoVO =gpfkDao.queryKwellWoBySnid(wosn, bzlx);
if(wolinkInfoVO==null) { if(wolinkInfoVO==null) {
throwReturnMessage("不存在对应订单序号标准类型信息"); throwReturnMessage("不存在对应订单序号标准类型信息");
...@@ -782,9 +781,9 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -782,9 +781,9 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
Wogylx existLastWogylx = gpfkDao.getLastGx(wogylx); Wogylx existLastWogylx = gpfkDao.getLastGx(wogylx);
if(existLastWogylx != null){ if(existLastWogylx != null){
GpfkCondition gpfkCondition2 =new GpfkCondition(); GpfkCondition gpfkCondition2 =new GpfkCondition();
gpfkCondition.setWogylx(existLastWogylx.getId()); gpfkCondition2.setWogylx(existLastWogylx.getId());
gpfkCondition.setWosnid(wosn); gpfkCondition2.setWosnid(wosn);
gpfkCondition.setBzgxid(existLastWogylx.getBzgxid()); gpfkCondition2.setBzgxid(existLastWogylx.getBzgxid());
GpfkVO gpfk2 = gpfkDao.queryKwellGpfkByWosnAndGxid(gpfkCondition2); GpfkVO gpfk2 = gpfkDao.queryKwellGpfkByWosnAndGxid(gpfkCondition2);
if(gpfk2!=null) { if(gpfk2!=null) {
if(existLastWogylx.getGylxid().equals(HzGylxEnum.ZP.getId())) { if(existLastWogylx.getGylxid().equals(HzGylxEnum.ZP.getId())) {
...@@ -803,7 +802,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -803,7 +802,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
if(!wolinkInfoVO.getWozt().equals("R")) { if(!wolinkInfoVO.getWozt().equals("R")) {
throwReturnMessage("订单未下达"); throwReturnMessage("订单未下达");
} }
/**判断上一道工序**/ if(gpfkVo==null) {
Gpfk gpfk = new Gpfk(); Gpfk gpfk = new Gpfk();
gpfk.setWosnid(wolinkInfoVO.getWosnCode()); gpfk.setWosnid(wolinkInfoVO.getWosnCode());
gpfk.setWogylx(wolinkInfoVO.getWogylxid()); gpfk.setWogylx(wolinkInfoVO.getWogylxid());
......
...@@ -23,7 +23,9 @@ import com.gavel.kwell.vo.GphyVO; ...@@ -23,7 +23,9 @@ import com.gavel.kwell.vo.GphyVO;
import com.gavel.kwell.vo.GphycxVO; import com.gavel.kwell.vo.GphycxVO;
import com.gavel.kwell.vo.WlslItem; import com.gavel.kwell.vo.WlslItem;
import com.gavel.persistence.sql.RecordSet; import com.gavel.persistence.sql.RecordSet;
import com.gavel.wo.persistent.Wobom;
import com.gavel.wo.persistent.Wogylx; import com.gavel.wo.persistent.Wogylx;
import com.gavel.wo.vo.WobomVO;
@Service("gphyService") @Service("gphyService")
...@@ -74,7 +76,18 @@ public class GphyServiceImpl extends BaseEditServiceImpl implements GphyService ...@@ -74,7 +76,18 @@ public class GphyServiceImpl extends BaseEditServiceImpl implements GphyService
@Override @Override
public Gpfk zpwl(GphyCondition condition) { 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()); 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)) { if(compareIsZpComplete(condition.getFkid(),wlid)) {
Gphy gphy = new Gphy(); Gphy gphy = new Gphy();
gphy.setFkgx(condition.getGxid()); gphy.setFkgx(condition.getGxid());
......
...@@ -7,7 +7,7 @@ public enum SmCodeEnum { ...@@ -7,7 +7,7 @@ public enum SmCodeEnum {
LOGOUT("LOGOUT", "退出","LOGOUT",10), LOGOUT("LOGOUT", "退出","LOGOUT",10),
WOSNID("WOSNID","工单序列号","20",10), WOSNID("WOSNID","工单序列号","2",10),
// WLID("WLID","物料编码","D",10), // WLID("WLID","物料编码","D",10),
OKBZ("OKBZ","OK按钮","OK",10), OKBZ("OKBZ","OK按钮","OK",10),
NGBZ("NGBZ","NG按钮","NG",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