Commit f3a790dc authored by yff's avatar yff

修改BUG

parent 5e6e7019
...@@ -128,6 +128,6 @@ public interface GpfkDao extends BaseDao { ...@@ -128,6 +128,6 @@ public interface GpfkDao extends BaseDao {
public Wogylx getLastGx(Wogylx wogylx); public Wogylx getLastGx(Wogylx wogylx);
public Double getNowGyFksl(Wogylx wogylx); public double getNowGyFksl(Wogylx wogylx);
} }
...@@ -1277,15 +1277,19 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -1277,15 +1277,19 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
sqlMap.append(" and BZGX_GZZXID = :pGZZXID "); sqlMap.append(" and BZGX_GZZXID = :pGZZXID ");
sqlMap.setParamValue("pGZZXID",wogylx.getGzzxid()); sqlMap.setParamValue("pGZZXID",wogylx.getGzzxid());
} }
sqlMap.append(" and BZGX_XH < :pXH "); if(StringUtils.isNotEmpty(wogylx.getWoid())){
sqlMap.append("order by BZGX_XH desc"); sqlMap.append(" and WOGYLX_WOID = :pWOID ");
sqlMap.setParamValue("pWOID",wogylx.getWoid());
}
sqlMap.append(" and WOGYLX_XH < :pXH ");
sqlMap.append("order by WOGYLX_XH desc");
sqlMap.setParamValue("pXH",wogylx.getXh()); sqlMap.setParamValue("pXH",wogylx.getXh());
return sqlMap.queryEntity(Wogylx.class); return sqlMap.queryEntity(Wogylx.class);
} }
@Override @Override
public Double getNowGyFksl(Wogylx wogylx) { public double getNowGyFksl(Wogylx wogylx) {
SqlMap sqlMap = new SqlMap(); SqlMap sqlMap = new SqlMap();
sqlMap.append("select count(1) "); sqlMap.append("select count(1) ");
sqlMap.append("from GPFK "); sqlMap.append("from GPFK ");
...@@ -1295,7 +1299,7 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -1295,7 +1299,7 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
sqlMap.append(" and WOGYLX_ID = :pWOGTLXID "); sqlMap.append(" and WOGYLX_ID = :pWOGTLXID ");
sqlMap.setParamValue("pWOGTLXID",wogylx.getId()); sqlMap.setParamValue("pWOGTLXID",wogylx.getId());
} }
return sqlMap.queryEntity(Double.class); return sqlMap.queryDouble();
} }
......
...@@ -106,7 +106,9 @@ public interface GpfkService extends BaseEditService { ...@@ -106,7 +106,9 @@ public interface GpfkService extends BaseEditService {
public BzgxVO login(String usersn,String bzgxid); public BzgxVO login(String usersn,String bzgxid);
public boolean updatePcjh(); public void updatePcjh(String woid,String fklx,boolean hgbz);
public void cancelPcjh(String woid,String fklx,boolean hgbz);
/** 科威尔mes工票反馈重写--end */ /** 科威尔mes工票反馈重写--end */
} }
...@@ -68,8 +68,13 @@ import com.gavel.kzzx.vo.YymkCondition; ...@@ -68,8 +68,13 @@ import com.gavel.kzzx.vo.YymkCondition;
import com.gavel.kzzx.vo.YymkVO; import com.gavel.kzzx.vo.YymkVO;
import com.gavel.persistence.entity.EntityDataFactory; import com.gavel.persistence.entity.EntityDataFactory;
import com.gavel.persistence.sql.RecordSet; import com.gavel.persistence.sql.RecordSet;
import com.gavel.wo.persistent.Pcjhmx;
import com.gavel.wo.persistent.Wogylx; import com.gavel.wo.persistent.Wogylx;
import com.gavel.wo.persistent.Wosn; import com.gavel.wo.persistent.Wosn;
import com.gavel.wo.service.PcjhmxService;
import com.gavel.wo.vo.PcjhCondition;
import com.gavel.wo.vo.PcjhmxCondition;
import com.gavel.wo.vo.PcjhmxVO;
import com.gavel.wo.vo.WobomVO; import com.gavel.wo.vo.WobomVO;
...@@ -96,6 +101,9 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -96,6 +101,9 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
@Autowired @Autowired
private YymkService yymkService; private YymkService yymkService;
@Autowired
private PcjhmxService pcjhmxService;
@Autowired @Autowired
private AttachmentService attachmentService; private AttachmentService attachmentService;
...@@ -760,7 +768,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -760,7 +768,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
if(!NumberUtils.equals(wogylx.getXh(),0)){ if(!NumberUtils.equals(wogylx.getXh(),0)){
Wogylx existLastWogylx = gpfkDao.getLastGx(wogylx); Wogylx existLastWogylx = gpfkDao.getLastGx(wogylx);
if(existLastWogylx != null){ if(existLastWogylx != null){
Double gpfksl = gpfkDao.getNowGyFksl(existLastWogylx); double gpfksl = gpfkDao.getNowGyFksl(existLastWogylx);
if(gpfksl<existLastWogylx.getXqsl()) { if(gpfksl<existLastWogylx.getXqsl()) {
throwReturnMessage("上道工序未完成不能装配此道工序"); throwReturnMessage("上道工序未完成不能装配此道工序");
} }
...@@ -793,8 +801,10 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -793,8 +801,10 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
EntityDataFactory.copyEntity(gpfkVo, gpfk); EntityDataFactory.copyEntity(gpfkVo, gpfk);
if(SmCodeEnum.OKBZ.getId().equals(hgsn)) { if(SmCodeEnum.OKBZ.getId().equals(hgsn)) {
gpfk.setHgsl(1.0); gpfk.setHgsl(1.0);
gpfk.setBhgsl(0.0);
} }
else if(SmCodeEnum.NGBZ.getId().equals(hgsn)) { else if(SmCodeEnum.NGBZ.getId().equals(hgsn)) {
gpfk.setHgsl(0.0);
gpfk.setBhgsl(1.0); gpfk.setBhgsl(1.0);
} }
else { else {
...@@ -892,10 +902,49 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -892,10 +902,49 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
return bzgxVO; return bzgxVO;
} }
@Override @Override
public boolean updatePcjh() { public void updatePcjh(String woid,String fklx,boolean hgbz) {
// TODO Auto-generated method stub PcjhmxCondition pcjhmxCondition = new PcjhmxCondition();
return false; pcjhmxCondition.setWoid(woid);
List<PcjhmxVO> pcjhmxVOs = pcjhmxService.query(pcjhmxCondition).getRecords();
if(pcjhmxVOs!=null&&pcjhmxVOs.size()>0) {
for(PcjhmxVO pcjhmxVO:pcjhmxVOs) {
Pcjhmx pcjhmx = new Pcjhmx();
EntityDataFactory.copyEntity(pcjhmxVO, pcjhmx);
pcjhmx.setWgsl(pcjhmx.getWgsl()+1.0);
if(!fklx.equals(YymkFKEnum.ZP.getId())) {
if(hgbz) {
pcjhmx.setHgsl(pcjhmx.getHgsl()+1.0);
}
else {
pcjhmx.setBhgsl(pcjhmx.getBhgsl()+1.0);
}
}
}
}
}
@Override
public void cancelPcjh(String woid, String fklx, boolean hgbz) {
PcjhmxCondition pcjhmxCondition = new PcjhmxCondition();
pcjhmxCondition.setWoid(woid);
List<PcjhmxVO> pcjhmxVOs = pcjhmxService.query(pcjhmxCondition).getRecords();
if(pcjhmxVOs!=null&&pcjhmxVOs.size()>0) {
for(PcjhmxVO pcjhmxVO:pcjhmxVOs) {
Pcjhmx pcjhmx = new Pcjhmx();
EntityDataFactory.copyEntity(pcjhmxVO, pcjhmx);
pcjhmx.setWgsl(pcjhmx.getWgsl()-1.0);
if(!fklx.equals(YymkFKEnum.ZP.getId())) {
if(hgbz) {
pcjhmx.setHgsl(pcjhmx.getHgsl()-1.0);
}
else {
pcjhmx.setBhgsl(pcjhmx.getBhgsl()-1.0);
}
}
}
}
} }
......
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