Commit 9f5ba211 authored by yff's avatar yff

修改bug

parent 1f7b37d6
......@@ -46,7 +46,7 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
sqlMap.append("select GPFK_ID, GPFK_WOSNID, GPFK_FKLX, GPFK_FKSJ, GPFK_HGBZ, ");
sqlMap.append(" GPFK_FKSL,GPFK_HGSL, GPFK_BHGSL, GPFK_FKR, GPFK_FKGX, GPFK_BZ, ");
sqlMap.append(" GPFK_WHRID, GPFK_WHR, GPFK_WHSJ, GPFK_CJRID, GPFK_CJR,GPFK_CJSJ, ");
sqlMap.append(" GPFK_SYSVERSION, GPFK_FKRID, GPFK_FKBX, GPFK_FKJSSJ, GPFK_GFSL, ");
sqlMap.append(" GPFK_SYSVERSION, GPFK_FKRID, GPFK_FKBX,GPFK_WOGYLX, GPFK_FKJSSJ, GPFK_GFSL, ");
sqlMap.append(" GPFK_LFSL,GPFK_FXSL, GPFK_FGSL, GPFK_YWRQ, GPFK_HGDJ,WOSN_KHCODE, ");
sqlMap.append(" BX_CODE, BX_NAME, BZGX_CODE, BZGX_NAME, ");
sqlMap.append(" WLXX_CODE, WLXX_NAME, WLXX_GG,WO_DJID, ");
......@@ -1119,6 +1119,7 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
sqlMap.setParamValue("WOSN_CODE", wosn);
}
sqlMap.append("order by WOBOM_XH, WLXX_CODE");
System.out.println(sqlMap.getSqlText());
return sqlMap.query(WobomVO.class);
}
......@@ -1177,6 +1178,10 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
sqlMap.append(" and BZGX_ID = :pBZGX ");
sqlMap.setParamValue("pBZGX",condition.getBzgxid());
}
if (StringUtils.isNotEmpty(condition.getWogylx())){
sqlMap.append(" and WOGYLX_ID = :pWOGYLX ");
sqlMap.setParamValue("pWOGYLX",condition.getWogylx());
}
if (StringUtils.isNotEmpty(condition.getFkrid())){
sqlMap.append(" and GPFK_FKRID = :pFKRID ");
sqlMap.setParamValue("pFKRID",condition.getFkrid());
......
......@@ -138,7 +138,6 @@ public class GphyDaoImpl extends BaseDaoImpl implements GphyDao {
sqlMap.append("select sum(GPHY_ZPSL) as zpsl, GPHY_WLID as wlid ");
sqlMap.append("from GPHY ");
sqlMap.append("where 1 = 1 ");
sqlMap.append("group by GPHY_WLID");
if (StringUtils.isNotEmpty(condition.getMid())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPHY_MID", condition.getMid()));
sqlMap.setParamValue("GPHY_MID", condition.getMid());
......@@ -147,13 +146,14 @@ public class GphyDaoImpl extends BaseDaoImpl implements GphyDao {
sqlMap.append(" and " + SqlUtil.getWhereSql("GPHY_WLID", condition.getWlid()));
sqlMap.setParamValue("GPHY_WLID", condition.getWlid());
}
sqlMap.append("group by GPHY_WLID");
return sqlMap.queryEntity(WlslItem.class);
}
@Override
public int queryIfZpwc(GphyCondition condition) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select isnull(a.sl,0)-b.sl FROM( select sum(wobom_dwyl) as sl ,GPFK_ID as fkid ");
sqlMap.append("select a.sl-b.sl FROM( select sum(wobom_dwyl) as sl ,GPFK_ID as fkid ");
sqlMap.append(" from GPFK ");
sqlMap.append(" left join WOBOM on WOBOM_FFGX =GPFK_fkgx ");
sqlMap.append(" left join WLXX on WLXX_ID = WOBOM_WLID ");
......@@ -165,9 +165,9 @@ 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 " + SqlUtil.getWhereSql("b.fkid", condition.getMid()));
sqlMap.setParamValue("b.fkid", condition.getMid());
sqlMap.append(" and b.fkid = " + condition.getMid());
}
System.out.println(sqlMap.getSqlText());
return sqlMap.queryInt();
}
......
......@@ -56,6 +56,7 @@ import com.gavel.kwell.vo.GpbhgfkCondition;
import com.gavel.kwell.vo.GpbhgmxVO;
import com.gavel.kwell.vo.GpfkCondition;
import com.gavel.kwell.vo.GpfkVO;
import com.gavel.kwell.vo.GphyCondition;
import com.gavel.kwell.vo.WolinkInfoVO;
import com.gavel.kwell.vo.WosngzVO;
import com.gavel.kzzx.dao.UserDao;
......@@ -87,6 +88,9 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
@Autowired
private GpfkDao gpfkDao;
@Autowired
private GphyDao gphyDao;
@Autowired
private GphyDao gphydao;
......@@ -163,7 +167,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
}
/** 排产计划删除 末道工序 、单道工序**/
Wogylx wogylx = (Wogylx) GavelSql.selectEntityByKey(Wogylx.class, gpfk.getWogylx());
if(StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
if(wogylx!=null&&StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
if(StringUtils.isNotEmpty(gpfk.getHgbz())&&gpfk.getHgbz().equals("N")) {
cancelPcjh(wogylx.getWoid(),wogylx.getGxlx(),false);
}
......@@ -777,8 +781,21 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
if(!NumberUtils.equals(wogylx.getXh(),0)){
Wogylx existLastWogylx = gpfkDao.getLastGx(wogylx);
if(existLastWogylx != null){
double gpfksl = gpfkDao.getNowGyFksl(existLastWogylx);
if(gpfksl<existLastWogylx.getXqsl()) {
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("上道工序未完成不能装配此道工序");
}
}
......@@ -823,7 +840,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
}
Gpfk gpfkR = (Gpfk) update(gpfk);
Wogylx wogylx = (Wogylx) GavelSql.selectEntityByKey(Wogylx.class, gpfk.getWogylx());
if(StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
if(wogylx!=null&&StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
if(StringUtils.isNotEmpty(gpfk.getHgbz())&&gpfk.getHgbz().equals("N")) {
updatePcjh(wogylx.getWoid(),wogylx.getGxlx(),false);
}
......@@ -856,7 +873,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
}
Gpfk gpfkR = (Gpfk) update(gpfk);
Wogylx wogylx = (Wogylx) GavelSql.selectEntityByKey(Wogylx.class, gpfk.getWogylx());
if(StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
if(wogylx!=null&&StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
if(StringUtils.isNotEmpty(gpfk.getHgbz())&&gpfk.getHgbz().equals("N")) {
updatePcjh(wogylx.getWoid(),wogylx.getGxlx(),false);
}
......
......@@ -89,7 +89,7 @@ public class GphyServiceImpl extends BaseEditServiceImpl implements GphyService
Gpfk gpfk = gpfkDao.queryById(Gpfk.class, condition.getFkid());
if(gphyDao.queryIfZpwc(condition)!=0) {
Wogylx wogylx = (Wogylx) GavelSql.selectEntityByKey(Wogylx.class, gpfk.getWogylx());
if(StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
if(wogylx!=null&&StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
if(StringUtils.isNotEmpty(gpfk.getHgbz())&&gpfk.getHgbz().equals("N")) {
gpfkService.updatePcjh(wogylx.getWoid(),wogylx.getGxlx(),false);
}
......
......@@ -54,6 +54,8 @@ public class GpfkCondition extends BaseEntity {
private String[] multiSnids;
private String wlid;
private String wogylx;
private String jzname;
......@@ -71,6 +73,14 @@ public class GpfkCondition extends BaseEntity {
private String skipYjy;
public String getWogylx() {
return wogylx;
}
public void setWogylx(String wogylx) {
this.wogylx = wogylx;
}
public String getId() {
return id;
}
......
......@@ -121,7 +121,7 @@
zpfk_wrz(that,msg,'error')
return false
}
gas.post('kmes/gphy/zpwl',{"snid":that.xlh,"mid":that.fkid,"fkid":that.fkid}, function(res){
gas.post('kmes/gphy/zpwl',{"snid":that.xlh,"mid":that.fkid,"fkid":that.fkid,'gxid':window.bzlx}, function(res){
if(res.data&&res.data.records){
let msg="装配物料:"+that.xlh+"成功"
zpfk_wrz(that,msg)
......
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