Commit dacf27e4 authored by zhoumaotao's avatar zhoumaotao

代码调整

parent 4435478c
......@@ -22,4 +22,8 @@ public interface GpfkcxDao extends BaseDao {
public List<Gpfk> queryByBetween(Date start, Date end);
public List<Gpfk> queryGpfk(Date date,String[] gxbzs);
public Gpfk queryWeekGpfk(Date date,String woid);
public Gpfk queryMonthGpfk(Date date);
}
......@@ -13,11 +13,11 @@ public interface KmesBoardDao extends BaseDao {
public Pcjhmx queryWeekPcsl(Date date);
public PcslVO queryTodayPcsl();
public PcslVO queryTodayPcsl(Date date);
public PcslVO queryMonthPcsl();
public PcslVO queryMonthPcsl(Date date);
public List<UWoVO> queryWo();
public List<UWoVO> queryWo(Date date);
public UWoVO queryWorkingWO();
......
......@@ -147,5 +147,39 @@ public class GpfkcxDaoImpl extends BaseDaoImpl implements GpfkcxDao {
sqlMap.setParamValue("pJsrq", DateUtils.endOfDay(date));
return sqlMap.query(Gpfk.class);
}
@Override
public Gpfk queryWeekGpfk(Date date,String woid) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select sum(GPFK_FKSL) as GPFK_FKSL ");
sqlMap.append("from GPFK ");
sqlMap.append(" left join WOGYLX on WOGYLX_ID = GPFK_FKGX ");
sqlMap.append(" left join BZGX on BZGX_ID = WOGYLX_BZGXID ");
sqlMap.append("where (GPFK_FKSJ >= :pStart and GPFK_FKSJ < :pEnd) and (WOGYLX_GXBZ = :pDGxbz or WOGYLX_GXBZ = :pMGxbz) ");
sqlMap.setParamValue("pStart", DateUtils.beginOfDay(DateUtils.getCurrentWeekDateBegin(date)));
sqlMap.setParamValue("pEnd", DateUtils.endOfDay(DateUtils.getCurrentQuarterDateEnd(date)));
sqlMap.setParamValue("pDGxbz", GxlxGxbzEnum.ONLY.getId());
sqlMap.setParamValue("pMGxbz", GxlxGxbzEnum.LAST.getId());
if(StringUtils.isNotEmpty(woid)){
sqlMap.append(" and WOGYLX_WOID = :pWoid ");
sqlMap.setParamValue("pWoid", woid);
}
return sqlMap.queryEntity(Gpfk.class);
}
@Override
public Gpfk queryMonthGpfk(Date date) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select sum(GPFK_FKSL) as GPFK_FKSL ");
sqlMap.append("from GPFK ");
sqlMap.append(" left join WOGYLX on WOGYLX_ID = GPFK_FKGX ");
sqlMap.append(" left join BZGX on BZGX_ID = WOGYLX_BZGXID ");
sqlMap.append("where (GPFK_FKSJ >= :pStart and GPFK_FKSJ < :pEnd) and (WOGYLX_GXBZ = :pDGxbz or WOGYLX_GXBZ = :pMGxbz) ");
sqlMap.setParamValue("pStart", DateUtils.beginOfMonth(date));
sqlMap.setParamValue("pEnd", DateUtils.endOfMonth(date));
sqlMap.setParamValue("pDGxbz", GxlxGxbzEnum.ONLY.getId());
sqlMap.setParamValue("pMGxbz", GxlxGxbzEnum.LAST.getId());
return sqlMap.queryEntity(Gpfk.class);
}
}
......@@ -30,39 +30,46 @@ public class KmesBoardDaoImpl extends BaseDaoImpl implements KmesBoardDao {
}
@Override
public PcslVO queryTodayPcsl() {
public PcslVO queryTodayPcsl(Date date) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select sum(PCJHMX_JHSL) as JHSL,sum(PCJHMX_WGSL) as WGSL ");
sqlMap.append("select sum(PCJHMX_JHSL) as JHSL ");
sqlMap.append("from PCJHMX ");
sqlMap.append("where 1=1 and ( :ksrq <= PCJHMX_JHRQ and PCJHMX_JHRQ <= :jsrq ) ");
sqlMap.setParamValue("ksrq", DateUtils.beginOfDay(DateUtils.getDateTime()));
sqlMap.setParamValue("jsrq", DateUtils.endOfDay(DateUtils.getDateTime()));
sqlMap.append("where 1=1 and ( :pKsrq <= PCJHMX_JHRQ and U_PCJHMX_JSRQ <= :pJsrq ) ");
sqlMap.append(" or ( :pKsrq < PCJHMX_JHRQ and PCJHMX_JHRQ < :pJsrq ) ");
sqlMap.append(" or ( :pKsrq < U_PCJHMX_JSRQ and U_PCJHMX_JSRQ < :pJsrq ) ");
sqlMap.setParamValue("pKsrq", DateUtils.beginOfDay(DateUtils.getCurrentWeekDateBegin(date)));
sqlMap.setParamValue("pJsrq", DateUtils.endOfDay(DateUtils.getCurrentQuarterDateEnd(date)));
return sqlMap.queryEntity(PcslVO.class);
}
@Override
public PcslVO queryMonthPcsl() {
public PcslVO queryMonthPcsl(Date date) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select sum(PCJHMX_JHSL) as JHSL,sum(PCJHMX_WGSL) as WGSL ");
sqlMap.append("select sum(PCJHMX_JHSL) as JHSL ");
sqlMap.append("from PCJHMX ");
sqlMap.append("where 1=1 and ( :ksrq <= PCJHMX_JHRQ and PCJHMX_JHRQ <= :jsrq ) ");
sqlMap.setParamValue("ksrq", DateUtils.beginOfMonth(DateUtils.getDateTime()));
sqlMap.setParamValue("jsrq", DateUtils.endOfMonth(DateUtils.getDateTime()));
sqlMap.append("where 1=1 and ( :pKsrq <= PCJHMX_JHRQ and U_PCJHMX_JSRQ <= :pJsrq ) ");
sqlMap.append(" or ( :pKsrq < PCJHMX_JHRQ and PCJHMX_JHRQ < :pJsrq ) ");
sqlMap.append(" or ( :pKsrq < U_PCJHMX_JSRQ and U_PCJHMX_JSRQ < :pJsrq ) ");
sqlMap.setParamValue("pKsrq", DateUtils.beginOfMonth(DateUtils.getCurrentQuarterDateBegin(date)));
sqlMap.setParamValue("pJsrq", DateUtils.endOfMonth(DateUtils.getCurrentQuarterDateEnd(date)));
return sqlMap.queryEntity(PcslVO.class);
}
@Override
public List<UWoVO> queryWo() {
public List<UWoVO> queryWo(Date date) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select PCJHMX_WOID as WO_ID,PCJHMX_JHSL as WO_PCSL,WO_DJID, ");
sqlMap.append(" PCJHMX_WGSL as WO_WGSL,WO_WLID,WLXX_CODE,WLXX_NAME,WLXX_GG,WO_YWRQ ");
sqlMap.append("select PCJHMX_WOID as WO_ID,WO_DJID, WO_WLID,WLXX_CODE,WLXX_NAME,WLXX_GG,WO_YWRQ, ");
sqlMap.append(" sum(PCJHMX_JHSL) as WO_PCSL,0 as WO_WGSL ");
sqlMap.append("from PCJHMX ");
sqlMap.append(" left join WO on WO_ID = PCJHMX_WOID ");
sqlMap.append(" left join WLXX on WLXX_ID = PCJHMX_WLID ");
sqlMap.append("where 1=1 and ( :ksrq <= PCJHMX_JHRQ and PCJHMX_JHRQ <= :jsrq ) ");
sqlMap.setParamValue("ksrq", DateUtils.beginOfDay(DateUtils.getDateTime()));
sqlMap.setParamValue("jsrq", DateUtils.endOfDay(DateUtils.getDateTime()));
sqlMap.append("order by PCJHMX_JHRQ desc ");
sqlMap.append("where 1=1 and ( :pKsrq <= PCJHMX_JHRQ and U_PCJHMX_JSRQ <= :pJsrq ) ");
sqlMap.append(" or ( :pKsrq < PCJHMX_JHRQ and PCJHMX_JHRQ < :pJsrq ) ");
sqlMap.append(" or ( :pKsrq < U_PCJHMX_JSRQ and U_PCJHMX_JSRQ < :pJsrq ) ");
sqlMap.setParamValue("pKsrq", DateUtils.beginOfDay(DateUtils.getCurrentWeekDateBegin(date)));
sqlMap.setParamValue("pJsrq", DateUtils.endOfDay(DateUtils.getCurrentWeekDateBegin(date)));
sqlMap.append("group by PCJHMX_WOID,WO_DJID,WO_WLID,WLXX_CODE,WLXX_NAME,WLXX_GG,WO_YWRQ ");
sqlMap.append("order by WLXX_CODE ");
return sqlMap.query(UWoVO.class);
}
......
......@@ -101,18 +101,41 @@ public class KmesBoardServiceImpl extends BaseEditServiceImpl implements KmesBoa
@Override
public PcslVO queryTodayPcsl() {
return kmesBoardDao.queryTodayPcsl();
PcslVO pcslVO = kmesBoardDao.queryTodayPcsl(new Date());
if(pcslVO != null){
Gpfk gpfk = gpfkcxDao.queryWeekGpfk(new Date(),"");
pcslVO.setWgsl(gpfk.getFgsl()==null?0.0:gpfk.getFgsl());
}else {
pcslVO =new PcslVO();
pcslVO.setJhsl(0.0);
pcslVO.setWgsl(0.0);
}
return pcslVO;
}
@Override
public PcslVO queryMonthPcsl() {
return kmesBoardDao.queryMonthPcsl();
PcslVO pcslVO = kmesBoardDao.queryMonthPcsl(new Date());
if(pcslVO != null){
Gpfk gpfk = gpfkcxDao.queryMonthGpfk(new Date());
pcslVO.setWgsl(gpfk.getFgsl()==null?0.0:gpfk.getFgsl());
}else {
pcslVO =new PcslVO();
pcslVO.setJhsl(0.0);
pcslVO.setWgsl(0.0);
}
return pcslVO;
}
@Override
public List<UWoVO> queryWo() {
return kmesBoardDao.queryWo();
List<UWoVO> uWoVOList = kmesBoardDao.queryWo(new Date());
for(UWoVO uWoVO : uWoVOList ){
Gpfk gpfk = gpfkcxDao.queryWeekGpfk(new Date(),uWoVO.getId());
uWoVO.setWgsl(gpfk.getFgsl()==null?0.0:gpfk.getFgsl());
}
return uWoVOList;
}
@Override
......
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