Commit b06b7914 authored by yff's avatar yff

修改合格率计算

parent 18a34247
......@@ -24,6 +24,8 @@ public interface GpfkcxDao extends BaseDao {
public List<Gpfkjg> queryGpfk(Date date,String[] gxbzs);
public List<Gpfkjg> queryGpfkForFirstJY(Date date,String[] gxbzs);
public Gpfkjg queryWeekGpfk(Date date,String woid);
public Gpfkjg queryMonthGpfk(Date date);
......
......@@ -149,6 +149,31 @@ public class GpfkcxDaoImpl extends BaseDaoImpl implements GpfkcxDao {
return sqlMap.query(Gpfkjg.class);
}
@Override
public List<Gpfkjg> queryGpfkForFirstJY(Date date,String[] gxbzs) {
SqlMap sqlMap = new SqlMap();
sqlMap.append(" select c.WOGYLX_BZGXID, b.GPFKJG_WOSNID, b.GPFKJG_FKLX, b.GPFKJG_FKGX, ");
sqlMap.append(" b.GPFKJG_FKSJ, b.GPFKJG_FKR, b.GPFKJG_FKRID, b.GPFKJG_FKBX, ");
sqlMap.append(" b.GPFKJG_FKJSSJ,b.GPFKJG_HGBZ, b.GPFKJG_FKSL, b.GPFKJG_HGSL, ");
sqlMap.append(" b.GPFKJG_BHGSL, b.GPFKJG_GFSL,b.GPFKJG_LFSL, c.WOGYLX_GXBZ ");
sqlMap.append(" from GPFKJG b left join WOGYLX c on c.WOGYLX_ID = b.GPFKJG_FKGX ");
sqlMap.append(" inner join ( ");
sqlMap.append(" select MIN(d.GPFKJG_FKSJ) as fksj,e.WOGYLX_BZGXID,e.WOGYLX_ID,d.GPFKJG_WOSNID ");
sqlMap.append(" FROM GPFKJG d left join WOGYLX e ");
sqlMap.append(" on e.WOGYLX_ID = d.GPFKJG_FKGX ");
sqlMap.append(" GROUP BY e.WOGYLX_BZGXID,e.WOGYLX_ID,d.GPFKJG_WOSNID ");
sqlMap.append(" HAVING 1=1 ");
sqlMap.append(" and ").append("e.WOGYLX_BZGXID", gxbzs);
sqlMap.append(" and ( fksj >= :pKsrq and fksj < :pJsrq ) ");
sqlMap.append(" ) a ");
sqlMap.append(" on b.GPFKJG_WOSNID =a.GPFKJG_WOSNID and b.GPFKJG_FKSJ= a.fksj ");
sqlMap.append(" where 1=1 ");
sqlMap.append(" and c.WOGYLX_BZGXID = a.WOGYLX_BZGXID and c.wogylx_id = a.wogylx_id ");
sqlMap.setParamValue("pKsrq", DateUtils.beginOfDay(date));
sqlMap.setParamValue("pJsrq", DateUtils.endOfDay(date));
return sqlMap.query(Gpfkjg.class);
}
@Override
public Gpfkjg queryWeekGpfk(Date date,String woid) {
SqlMap sqlMap = new SqlMap();
......
......@@ -164,7 +164,6 @@ public class KmesBoardServiceImpl extends BaseEditServiceImpl implements KmesBoa
@Override
public List<GpfkHgVO> queryGpfkHgl() {
//首到工序的工票反馈最近7天合格率
Date beginDate = DateUtils.calcDate(DateUtils.getDate(),0,0,-6,0,0,0);
Date endDate = DateUtils.calcDate(DateUtils.getDate(),0,0,0,0,0,0);
List<Date> dateList = DateCalculateUtil.findDates("D", beginDate, endDate);
......@@ -173,7 +172,7 @@ public class KmesBoardServiceImpl extends BaseEditServiceImpl implements KmesBoa
String[] gxbzs = gxbz.split(",");
for(Date date : dateList){
GpfkHgVO gpfkHgVO = new GpfkHgVO();
List<Gpfkjg> gpfks = gpfkcxDao.queryGpfk(date,gxbzs);
List<Gpfkjg> gpfks = gpfkcxDao.queryGpfkForFirstJY(date,gxbzs);
Double fksl =0.0;
Double hgsl =0.0;
if(CollectionUtils.isNotEmpty(gpfks)){
......
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