Commit b7a050c0 authored by zhoumaotao's avatar zhoumaotao

日计划/月计划 排产数量

parent 997e4e70
...@@ -3,6 +3,7 @@ package com.gavel.kwell.controller; ...@@ -3,6 +3,7 @@ package com.gavel.kwell.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gavel.common.base.controller.BaseController; import com.gavel.common.base.controller.BaseController;
import com.gavel.kwell.service.KmesBoardService; import com.gavel.kwell.service.KmesBoardService;
import com.gavel.kwell.vo.PsclVO;
import com.gavel.kwell.vo.SdclVO; import com.gavel.kwell.vo.SdclVO;
import com.gavel.wo.persistent.Pcjhmx; import com.gavel.wo.persistent.Pcjhmx;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -60,13 +61,34 @@ public class KmesBoardController extends BaseController { ...@@ -60,13 +61,34 @@ public class KmesBoardController extends BaseController {
} }
/** /**
*日排产达成数据 *近一周排产数据
*/ */
@RequestMapping(value = "queryPcsl", method = RequestMethod.POST) @RequestMapping(value = "queryWeekPcsl", method = RequestMethod.POST)
@ResponseBody @ResponseBody
public Object queryPcsl(@RequestBody JSONObject param) { public Object queryPcsl(@RequestBody JSONObject param) {
List<Pcjhmx> sdclVO = kmesBoardService.queryPcsl(); List<Pcjhmx> pcjhmxList = kmesBoardService.queryPcsl();
return buildReturnData(sdclVO); return buildReturnData(pcjhmxList);
}
/**
*日排产达成数据
*/
@RequestMapping(value = "queryTodayPcsl", method = RequestMethod.POST)
@ResponseBody
public Object queryTodayPcsl(@RequestBody JSONObject param) {
PsclVO psclVO = kmesBoardService.queryTodayPcsl();
return buildReturnData(psclVO);
} }
/**
*月排产达成数据
*/
@RequestMapping(value = "queryMonthPcsl", method = RequestMethod.POST)
@ResponseBody
public Object queryMonthPcsl(@RequestBody JSONObject param) {
PsclVO psclVO = kmesBoardService.queryMonthPcsl();
return buildReturnData(psclVO);
}
} }
...@@ -2,6 +2,7 @@ package com.gavel.kwell.dao; ...@@ -2,6 +2,7 @@ package com.gavel.kwell.dao;
import com.gavel.common.base.dao.BaseDao; import com.gavel.common.base.dao.BaseDao;
import com.gavel.kwell.persistent.Wlsn; import com.gavel.kwell.persistent.Wlsn;
import com.gavel.kwell.vo.PsclVO;
import com.gavel.kwell.vo.WlsnCondition; import com.gavel.kwell.vo.WlsnCondition;
import com.gavel.kwell.vo.WlsnVO; import com.gavel.kwell.vo.WlsnVO;
import com.gavel.persistence.sql.RecordSet; import com.gavel.persistence.sql.RecordSet;
...@@ -13,4 +14,8 @@ import java.util.List; ...@@ -13,4 +14,8 @@ import java.util.List;
public interface KmesBoardDao extends BaseDao { public interface KmesBoardDao extends BaseDao {
public List<Pcjhmx> queryPcsl(); public List<Pcjhmx> queryPcsl();
public PsclVO queryTodayPcsl();
public PsclVO queryMonthPcsl();
} }
...@@ -3,6 +3,7 @@ package com.gavel.kwell.dao.impl; ...@@ -3,6 +3,7 @@ package com.gavel.kwell.dao.impl;
import com.gavel.common.base.dao.impl.BaseDaoImpl; import com.gavel.common.base.dao.impl.BaseDaoImpl;
import com.gavel.common.utils.DateUtils; import com.gavel.common.utils.DateUtils;
import com.gavel.kwell.dao.KmesBoardDao; import com.gavel.kwell.dao.KmesBoardDao;
import com.gavel.kwell.vo.PsclVO;
import com.gavel.persistence.sql.SqlMap; import com.gavel.persistence.sql.SqlMap;
import com.gavel.wo.persistent.Pcjhmx; import com.gavel.wo.persistent.Pcjhmx;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -26,4 +27,25 @@ public class KmesBoardDaoImpl extends BaseDaoImpl implements KmesBoardDao { ...@@ -26,4 +27,25 @@ public class KmesBoardDaoImpl extends BaseDaoImpl implements KmesBoardDao {
return sqlMap.query(Pcjhmx.class); return sqlMap.query(Pcjhmx.class);
} }
@Override
public PsclVO queryTodayPcsl() {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select sum(PCJHMX_JHSL) as JHSL,sum(PCJHMX_WGSL) as WGSL ");
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()));
return sqlMap.queryEntity(PsclVO.class);
}
@Override
public PsclVO queryMonthPcsl() {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select sum(PCJHMX_JHSL) as JHSL,sum(PCJHMX_WGSL) as WGSL ");
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()));
return sqlMap.queryEntity(PsclVO.class);
}
} }
package com.gavel.kwell.service; package com.gavel.kwell.service;
import com.gavel.common.base.service.BaseEditService; import com.gavel.common.base.service.BaseEditService;
import com.gavel.kwell.vo.PsclVO;
import com.gavel.kwell.vo.SdclVO; import com.gavel.kwell.vo.SdclVO;
import com.gavel.wo.persistent.Pcjhmx; import com.gavel.wo.persistent.Pcjhmx;
...@@ -12,4 +13,8 @@ public interface KmesBoardService extends BaseEditService { ...@@ -12,4 +13,8 @@ public interface KmesBoardService extends BaseEditService {
public SdclVO querySdcl(); public SdclVO querySdcl();
public List<Pcjhmx> queryPcsl(); public List<Pcjhmx> queryPcsl();
public PsclVO queryTodayPcsl();
public PsclVO queryMonthPcsl();
} }
...@@ -13,6 +13,7 @@ import com.gavel.kwell.service.KmesBoardService; ...@@ -13,6 +13,7 @@ import com.gavel.kwell.service.KmesBoardService;
import com.gavel.kwell.service.WlsnService; import com.gavel.kwell.service.WlsnService;
import com.gavel.kwell.utils.DateCalculateUtil; import com.gavel.kwell.utils.DateCalculateUtil;
import com.gavel.kwell.utils.WlsnLxEnum; import com.gavel.kwell.utils.WlsnLxEnum;
import com.gavel.kwell.vo.PsclVO;
import com.gavel.kwell.vo.SdclVO; import com.gavel.kwell.vo.SdclVO;
import com.gavel.kwell.vo.WlsnCondition; import com.gavel.kwell.vo.WlsnCondition;
import com.gavel.kwell.vo.WlsnVO; import com.gavel.kwell.vo.WlsnVO;
...@@ -78,4 +79,14 @@ public class KmesBoardServiceImpl extends BaseEditServiceImpl implements KmesBoa ...@@ -78,4 +79,14 @@ public class KmesBoardServiceImpl extends BaseEditServiceImpl implements KmesBoa
public List<Pcjhmx> queryPcsl() { public List<Pcjhmx> queryPcsl() {
return kmesBoardDao.queryPcsl(); return kmesBoardDao.queryPcsl();
} }
@Override
public PsclVO queryTodayPcsl() {
return kmesBoardDao.queryTodayPcsl();
}
@Override
public PsclVO queryMonthPcsl() {
return kmesBoardDao.queryMonthPcsl();
}
} }
package com.gavel.kwell.vo;
import com.gavel.common.base.entity.BaseEntity;
import java.util.ArrayList;
import java.util.List;
public class PsclVO extends BaseEntity {
private Double jhsl;//计划总量
private Double wgsl;//完工总量
public Double getJhsl() {
return jhsl;
}
public void setJhsl(Double jhsl) {
this.jhsl = jhsl;
}
public Double getWgsl() {
return wgsl;
}
public void setWgsl(Double wgsl) {
this.wgsl = wgsl;
}
}
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