Commit f3a790dc authored by yff's avatar yff

修改BUG

parent 5e6e7019
......@@ -128,6 +128,6 @@ public interface GpfkDao extends BaseDao {
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 {
sqlMap.append(" and BZGX_GZZXID = :pGZZXID ");
sqlMap.setParamValue("pGZZXID",wogylx.getGzzxid());
}
sqlMap.append(" and BZGX_XH < :pXH ");
sqlMap.append("order by BZGX_XH desc");
if(StringUtils.isNotEmpty(wogylx.getWoid())){
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());
return sqlMap.queryEntity(Wogylx.class);
}
@Override
public Double getNowGyFksl(Wogylx wogylx) {
public double getNowGyFksl(Wogylx wogylx) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select count(1) ");
sqlMap.append("from GPFK ");
......@@ -1295,7 +1299,7 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
sqlMap.append(" and WOGYLX_ID = :pWOGTLXID ");
sqlMap.setParamValue("pWOGTLXID",wogylx.getId());
}
return sqlMap.queryEntity(Double.class);
return sqlMap.queryDouble();
}
......
......@@ -106,7 +106,9 @@ public interface GpfkService extends BaseEditService {
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 */
}
......@@ -68,8 +68,13 @@ 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.Pcjhmx;
import com.gavel.wo.persistent.Wogylx;
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;
......@@ -96,6 +101,9 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
@Autowired
private YymkService yymkService;
@Autowired
private PcjhmxService pcjhmxService;
@Autowired
private AttachmentService attachmentService;
......@@ -760,7 +768,7 @@ 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);
double gpfksl = gpfkDao.getNowGyFksl(existLastWogylx);
if(gpfksl<existLastWogylx.getXqsl()) {
throwReturnMessage("上道工序未完成不能装配此道工序");
}
......@@ -793,8 +801,10 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
EntityDataFactory.copyEntity(gpfkVo, gpfk);
if(SmCodeEnum.OKBZ.getId().equals(hgsn)) {
gpfk.setHgsl(1.0);
gpfk.setBhgsl(0.0);
}
else if(SmCodeEnum.NGBZ.getId().equals(hgsn)) {
gpfk.setHgsl(0.0);
gpfk.setBhgsl(1.0);
}
else {
......@@ -892,10 +902,49 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
return bzgxVO;
}
@Override
public boolean updatePcjh() {
// TODO Auto-generated method stub
return false;
public void updatePcjh(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);
}
}
}
}
}
@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