Commit 9d3c4cc2 authored by yff's avatar yff

Merge branch 'master' of gitlab.gavelinfo.com:gavelinfo/kwell-mes

parents f112a390 686144ce
......@@ -54,7 +54,7 @@ public class KmesBoardController extends BaseController {
/**
* 时段产量
* 时段产量(每一天)
*/
@RequestMapping(value = "querySdcl", method = RequestMethod.POST)
@ResponseBody
......@@ -64,7 +64,7 @@ public class KmesBoardController extends BaseController {
}
/**
*近一周排产数据
*近一周日排产数据(每一天)
*/
@RequestMapping(value = "queryWeekPcsl", method = RequestMethod.POST)
@ResponseBody
......
......@@ -3,6 +3,7 @@ package com.gavel.kwell.dao;
import com.gavel.common.base.dao.BaseDao;
import com.gavel.gygl.vo.BzgxVO;
import com.gavel.kwell.persistent.Gpfk;
import com.gavel.kwell.persistent.Gpfkjg;
import com.gavel.kwell.vo.GpfkCondition;
import com.gavel.kwell.vo.GpfkcxVO;
import com.gavel.persistence.sql.RecordSet;
......@@ -19,11 +20,11 @@ public interface GpfkcxDao extends BaseDao {
public List<BzgxVO> listBzgxName();
public List<Gpfk> queryByBetween(Date start, Date end);
public List<Gpfkjg> queryByBetween(Date start, Date end);
public List<Gpfk> queryGpfk(Date date,String[] gxbzs);
public List<Gpfkjg> queryGpfk(Date date,String[] gxbzs);
public Gpfk queryWeekGpfk(Date date,String woid);
public Gpfkjg queryWeekGpfk(Date date,String woid);
public Gpfk queryMonthGpfk(Date date);
public Gpfkjg queryMonthGpfk(Date date);
}
......@@ -1475,7 +1475,7 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
public FkVO queryKwellWxWoBySnidUptoDate(String wosnid) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select top 1 WO_ID,WO_ZT,WLXX_CODE,WLXX_GG,WLXX_ID,WOSN_CODE,WOSN_ID,");
sqlMap.append(" WLXX_GG,WO_DJID,WOSN_CODE ");
sqlMap.append(" WO_DJID ");
sqlMap.append("from WOSN ");
sqlMap.append(" left join WO on WO_ID=WOSN_WOID");
sqlMap.append(" left join WLXX on wlxx_id = wo_wlid");
......
......@@ -7,6 +7,7 @@ import com.gavel.common.utils.StringUtils;
import com.gavel.gygl.vo.BzgxVO;
import com.gavel.kwell.dao.GpfkcxDao;
import com.gavel.kwell.persistent.Gpfk;
import com.gavel.kwell.persistent.Gpfkjg;
import com.gavel.kwell.vo.GpfkCondition;
import com.gavel.kwell.vo.GpfkcxVO;
import com.gavel.persistence.sql.RecordSet;
......@@ -37,7 +38,7 @@ public class GpfkcxDaoImpl extends BaseDaoImpl implements GpfkcxDao {
sqlMap.append(" left join WO on WO_ID = WOSN_WOID ");
sqlMap.append(" left join WLXX on WLXX_ID = WO_WLID ");
sqlMap.append(" left join WOGYLX on WOGYLX_ID = GPFK_FKGX ");
sqlMap.append(" left join BZGX on BZGX_ID = WOGYLX_BZGXID ");
sqlMap.append(" left join BZGX on BZGX_ID = U_GPFK_BZGXID ");
sqlMap.append(" left join GZZX on GZZX_ID = BZGX_GZZXID ");
sqlMap.append(" where 1=1 ");
if ( StringUtils.isNotEmpty(condition.getGzzxid())){
......@@ -115,47 +116,47 @@ public class GpfkcxDaoImpl extends BaseDaoImpl implements GpfkcxDao {
}
@Override
public List<Gpfk> queryByBetween(Date start, Date end) {
public List<Gpfkjg> queryByBetween(Date start, Date end) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select GPFK_ID, GPFK_WOSNID, GPFK_FKLX, GPFK_FKGX, ");
sqlMap.append(" GPFK_FKSJ,GPFK_FKR,GPFK_FKRID, GPFK_FKBX, GPFK_FKJSSJ,");
sqlMap.append(" GPFK_HGBZ,GPFK_FKSL,GPFK_HGSL,GPFK_BHGSL,GPFK_GFSL, ");
sqlMap.append(" GPFK_LFSL,WOGYLX_GXBZ ");
sqlMap.append("from GPFK ");
sqlMap.append(" left join WOGYLX on WOGYLX_ID = GPFK_FKGX ");
sqlMap.append("where (GPFK_FKSJ >= :pStart and GPFK_FKSJ < :pEnd) and (WOGYLX_GXBZ = :pDGxbz or WOGYLX_GXBZ = :pMGxbz) ");//[a,b)
sqlMap.append("select GPFKJG_ID, GPFKJG_WOSNID, GPFKJG_FKLX, GPFKJG_FKGX, ");
sqlMap.append(" GPFKJG_FKSJ,GPFKJG_FKR,GPFKJG_FKRID, GPFKJG_FKBX, GPFKJG_FKJSSJ,");
sqlMap.append(" GPFKJG_HGBZ,GPFKJG_FKSL,GPFKJG_HGSL,GPFKJG_BHGSL,GPFKJG_GFSL, ");
sqlMap.append(" GPFKJG_LFSL,WOGYLX_GXBZ ");
sqlMap.append("from GPFKJG ");
sqlMap.append(" left join WOGYLX on WOGYLX_ID = GPFKJG_FKGX ");
sqlMap.append("where (GPFKJG_FKSJ >= :pStart and GPFKJG_FKSJ < :pEnd) and (WOGYLX_GXBZ = :pDGxbz or WOGYLX_GXBZ = :pMGxbz) ");//[a,b)
sqlMap.setParamValue("pStart", start);
sqlMap.setParamValue("pEnd", end);
sqlMap.setParamValue("pDGxbz", GxlxGxbzEnum.ONLY.getId());
sqlMap.setParamValue("pMGxbz", GxlxGxbzEnum.LAST.getId());
return sqlMap.query(Gpfk.class);
return sqlMap.query(Gpfkjg.class);
}
@Override
public List<Gpfk> queryGpfk(Date date,String[] gxbzs) {
public List<Gpfkjg> queryGpfk(Date date,String[] gxbzs) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select GPFK_ID, GPFK_WOSNID, GPFK_FKLX, GPFK_FKGX, ");
sqlMap.append(" GPFK_FKSJ,GPFK_FKR,GPFK_FKRID, GPFK_FKBX, GPFK_FKJSSJ,");
sqlMap.append(" GPFK_HGBZ,GPFK_FKSL,GPFK_HGSL,GPFK_BHGSL,GPFK_GFSL, ");
sqlMap.append(" GPFK_LFSL,WOGYLX_GXBZ ");
sqlMap.append("from GPFK ");
sqlMap.append(" left join WOGYLX on WOGYLX_ID = GPFK_FKGX ");
sqlMap.append("select GPFKJG_ID, GPFKJG_WOSNID, GPFKJG_FKLX, GPFKJG_FKGX, ");
sqlMap.append(" GPFKJG_FKSJ,GPFKJG_FKR,GPFKJG_FKRID, GPFKJG_FKBX, GPFKJG_FKJSSJ,");
sqlMap.append(" GPFKJG_HGBZ,GPFKJG_FKSL,GPFKJG_HGSL,GPFKJG_BHGSL,GPFKJG_GFSL, ");
sqlMap.append(" GPFKJG_LFSL,WOGYLX_GXBZ ");
sqlMap.append("from GPFKJG ");
sqlMap.append(" left join WOGYLX on WOGYLX_ID = GPFKJG_FKGX ");
sqlMap.append(" left join BZGX on BZGX_ID = WOGYLX_BZGXID ");
sqlMap.append("where ( GPFK_FKSJ >= :pKsrq and GPFK_FKSJ < :pJsrq ) ");
sqlMap.append("where ( GPFKJG_FKSJ >= :pKsrq and GPFKJG_FKSJ < :pJsrq ) ");
sqlMap.append(" and ").append("WOGYLX_BZGXID", gxbzs);
sqlMap.setParamValue("pKsrq", DateUtils.beginOfDay(date));
sqlMap.setParamValue("pJsrq", DateUtils.endOfDay(date));
return sqlMap.query(Gpfk.class);
return sqlMap.query(Gpfkjg.class);
}
@Override
public Gpfk queryWeekGpfk(Date date,String woid) {
public Gpfkjg 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("select sum(GPFKJG_FKSL) as GPFK_FKSL ");
sqlMap.append("from GPFKJG ");
sqlMap.append(" left join WOGYLX on WOGYLX_ID = GPFKJG_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.append("where (GPFKJG_FKSJ >= :pStart and GPFKJG_FKSJ < :pEnd) and (WOGYLX_GXBZ = :pDGxbz or WOGYLX_GXBZ = :pMGxbz) ");
sqlMap.setParamValue("pStart", DateUtils.beginOfDay(DateUtils.getCurrentWeekDateBegin(date)));
sqlMap.setParamValue("pEnd", DateUtils.endOfDay(DateUtils.getCurrentWeekDateEnd(date)));
sqlMap.setParamValue("pDGxbz", GxlxGxbzEnum.ONLY.getId());
......@@ -164,22 +165,22 @@ public class GpfkcxDaoImpl extends BaseDaoImpl implements GpfkcxDao {
sqlMap.append(" and WOGYLX_WOID = :pWoid ");
sqlMap.setParamValue("pWoid", woid);
}
return sqlMap.queryEntity(Gpfk.class);
return sqlMap.queryEntity(Gpfkjg.class);
}
@Override
public Gpfk queryMonthGpfk(Date date) {
public Gpfkjg 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("select sum(GPFKJG_FKSL) as GPFKJG_FKSL ");
sqlMap.append("from GPFKJG ");
sqlMap.append(" left join WOGYLX on WOGYLX_ID = GPFKJG_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.append("where (GPFKJG_FKSJ >= :pStart and GPFKJG_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);
return sqlMap.queryEntity(Gpfkjg.class);
}
}
......@@ -21,9 +21,10 @@ public class KmesBoardDaoImpl extends BaseDaoImpl implements KmesBoardDao {
@Override
public Pcjhmx queryWeekPcsl(Date date) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select sum(PCJHMX_JHSL) as PCJHMX_JHSL,sum(PCJHMX_WGSL) as PCJHMX_WGSL ");
sqlMap.append("select sum(PCJHMX_JHSL) as PCJHMX_JHSL ");
sqlMap.append("from PCJHMX ");
sqlMap.append("where 1=1 and ( :ksrq <= PCJHMX_JHRQ and PCJHMX_JHRQ <= :jsrq ) ");
sqlMap.append(" left join PCJH on PCJH_ID = PCJHMX_MID ");
sqlMap.append("where 1=1 and ( :ksrq <= PCJH_JHRQ and PCJH_JHRQ <= :jsrq ) ");
sqlMap.setParamValue("ksrq", DateUtils.beginOfDay(date));
sqlMap.setParamValue("jsrq", DateUtils.endOfDay(date));
return sqlMap.queryEntity(Pcjhmx.class);
......@@ -32,7 +33,7 @@ public class KmesBoardDaoImpl extends BaseDaoImpl implements KmesBoardDao {
@Override
public PcslVO queryTodayPcsl(Date date) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select sum(PCJHMX_JHSL) as JHSL,0 as WGSL ");
sqlMap.append("select sum(PCJHMX_JHSL) as JHSL ");
sqlMap.append("from PCJHMX ");
sqlMap.append("where 1=1 and ( :pKsrq <= PCJHMX_JHRQ and U_PCJHMX_JSRQ <= :pJsrq ) ");
sqlMap.append(" or ( PCJHMX_JHRQ < :pKsrq and U_PCJHMX_JSRQ > :pKsrq ) ");
......@@ -45,7 +46,7 @@ public class KmesBoardDaoImpl extends BaseDaoImpl implements KmesBoardDao {
@Override
public PcslVO queryMonthPcsl(Date date) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select sum(PCJHMX_JHSL) as JHSL,0 as WGSL ");
sqlMap.append("select sum(PCJHMX_JHSL) as JHSL ");
sqlMap.append("from PCJHMX ");
sqlMap.append("where 1=1 and ( :pKsrq <= PCJHMX_JHRQ and U_PCJHMX_JSRQ <= :pJsrq ) ");
sqlMap.append(" or ( PCJHMX_JHRQ < :pKsrq and U_PCJHMX_JSRQ > :pKsrq ) ");
......@@ -77,13 +78,13 @@ public class KmesBoardDaoImpl extends BaseDaoImpl implements KmesBoardDao {
public UWoVO queryWorkingWO() {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select WO_DJID,WO_GCID,WO_YWRQ,WO_WLID,WO_XQSL,WO_WGSL,WLXX_CODE,WLXX_NAME,WLXX_GG ");
sqlMap.append("from GPFK ");
sqlMap.append(" left join WOGYLX on WOGYLX_ID = GPFK_WOGYLX ");
sqlMap.append("from GPFKJG ");
sqlMap.append(" left join WOGYLX on WOGYLX_ID = GPFKJG_WOGYLX ");
sqlMap.append(" left join WO on WO_ID = WOGYLX_WOID ");
sqlMap.append(" left join WLXX on WLXX_ID = WO_WLID ");
sqlMap.append("where 1=1 and GPFK_CJSJ = (select max(GPFK_CJSJ) ");
sqlMap.append(" from GPFK ");
sqlMap.append(" left join WOGYLX on WOGYLX_ID = GPFK_WOGYLX ");
sqlMap.append("where 1=1 and GPFKJG_CJSJ = (select max(GPFKJG_CJSJ) ");
sqlMap.append(" from GPFKJG ");
sqlMap.append(" left join WOGYLX on WOGYLX_ID = GPFKJG_WOGYLX ");
sqlMap.append(" where WOGYLX_GXBZ = :pGxbz ");
sqlMap.setParamValue("pGxbz", GxlxGxbzEnum.FIRST.getId());
sqlMap.append(" ) ");
......@@ -94,10 +95,10 @@ public class KmesBoardDaoImpl extends BaseDaoImpl implements KmesBoardDao {
public int queryZtsl(String[] fkids) {
SqlMap sqlMap = new SqlMap();
sqlMap.append(" select sum(a.sl) from ");
sqlMap.append(" (select count(1) as sl,bzgx_id as bzgx from gpfk ");
sqlMap.append(" left join wogylx on wogylx_id = gpfk_fkgx ");
sqlMap.append(" left join bzgx on bzgx_id = WOGYLX_BZGXID ");
sqlMap.append(" group by bzgx_id) a ");
sqlMap.append(" (select count(1) as sl,bzgx_id as bzgx from gpfkjg ");
sqlMap.append(" left join wogylx on wogylx_id = gpfkjg_fkgx ");
sqlMap.append(" left join bzgx on bzgx_id = wogylx_bzgxid ");
sqlMap.append(" group by bzgx_id ) a ");
sqlMap.append(" where 1=1 ");
if(fkids!=null&&fkids.length>0) {
sqlMap.append(" and ( ");
......
......@@ -1800,11 +1800,15 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
GpfkCondition gpfkCondition = new GpfkCondition();
gpfkCondition.setWosnid(fkCondition.getSncode());
gpfkCondition.setBzgxid(fkCondition.getBzgxid());
FkVO curFkVo = gpfkDao.queryKwellWxWoBySnidUptoDate(fkCondition.getSncode());
checkLastBzgxIfComplete(curFkVo);
checkNextBzgxIfExistFk(curFkVo);
if(StringUtils.isNotEmpty(curFkVo.getId())) {
curFkVo = gpfkDao.queryWxWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getSncode(), fkCondition.getBzgxid());
//FkVO curFkVo = gpfkDao.queryKwellWxWoBySnidUptoDate(fkCondition.getSncode());
//checkLastBzgxIfComplete(curFkVo);
//checkNextBzgxIfExistFk(curFkVo);
// if(StringUtils.isNotEmpty(curFkVo.getId())) {
// curFkVo = gpfkDao.queryWxWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getSncode(), fkCondition.getBzgxid());
// }
FkVO curFkVo = gpfkDao.queryWxWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getSncode(), fkCondition.getBzgxid());
if (curFkVo == null) {
curFkVo = gpfkDao.queryKwellWxWoBySnidUptoDate(fkCondition.getSncode());
}
curFkVo.setSntype(snType);
return curFkVo;
......@@ -1826,9 +1830,10 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
gpfk.setHgsl(1.0);
gpfk.setBhgsl(0.0);
gpfk.setBzgxid(fkCondition.getBzgxid());
gpfk.setFkgx(fkCondition.getBzgxid());
insert(gpfk);
FkVO newFkVo =gpfkDao.queryWxWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
addOrUpdateGpfkjg(curFkVo.getWlid(), fkCondition.getBzgxid(), null, curFkVo.getWosnCode(), HGBZ);
addOrUpdateGpfkjg(curFkVo.getWlid(), fkCondition.getBzgxid(), fkCondition.getBzgxid(), curFkVo.getWosnCode(), HGBZ);
newFkVo.setSntype(snType);
return newFkVo;
}
......@@ -1849,9 +1854,10 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
gpfk.setHgsl(1.0);
gpfk.setBhgsl(0.0);
gpfk.setBzgxid(fkCondition.getBzgxid());
gpfk.setFkgx(fkCondition.getBzgxid());
insert(gpfk);
FkVO newFkVo =gpfkDao.queryWxWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
addOrUpdateGpfkjg(curFkVo.getWlid(), fkCondition.getBzgxid(), null, curFkVo.getWosnCode(), BHGBZ);
addOrUpdateGpfkjg(curFkVo.getWlid(), fkCondition.getBzgxid(), fkCondition.getBzgxid(), curFkVo.getWosnCode(), BHGBZ);
newFkVo.setSntype(snType);
return newFkVo;
}
......
......@@ -9,6 +9,7 @@ import com.gavel.common.utils.StringUtils;
import com.gavel.kwell.dao.GpfkcxDao;
import com.gavel.kwell.dao.KmesBoardDao;
import com.gavel.kwell.persistent.Gpfk;
import com.gavel.kwell.persistent.Gpfkjg;
import com.gavel.kwell.service.KmesBoardService;
import com.gavel.kwell.utils.DateCalculateUtil;
import com.gavel.kwell.utils.KwellParamEnum;
......@@ -63,12 +64,22 @@ public class KmesBoardServiceImpl extends BaseEditServiceImpl implements KmesBoa
for(int i=0;i<dateList.size()-1;i++){
List<Double> doubleList = sdclVO.getTimeperiodMount();
List<String> xseriesList = sdclVO.getXseriesList();
Date dateStart = dateList.get(i);
Date dateEnd = dateList.get(i+1);
List<Gpfk> gpfks = queryByBetween(dateStart,dateEnd);
Date dateStart =null;
if(i== 0){
dateStart = DateUtils.beginOfDay( dateList.get(0));//8:30置为0点
}else {
dateStart = dateList.get(i);
}
Date dateEnd=null;
if(i == dateList.size()-2){
dateEnd = DateUtils.endOfDay( dateList.get(i+1));//21:30置为23.59点
}else {
dateEnd = dateList.get(i+1);
}
List<Gpfkjg> gpfks = queryByBetween(dateStart,dateEnd);
double sl = 0.0;
if(gpfks != null && gpfks.size()>0){
sl = gpfks.stream().mapToDouble(Gpfk::getFksl).sum();
sl = gpfks.stream().mapToDouble(Gpfkjg::getFksl).sum();//每一天
}
total= NumberUtils.plus(total,sl);
doubleList.add(sl);
......@@ -78,7 +89,7 @@ public class KmesBoardServiceImpl extends BaseEditServiceImpl implements KmesBoa
return sdclVO;
}
private List<Gpfk> queryByBetween(Date start,Date end){
private List<Gpfkjg> queryByBetween(Date start,Date end){
return gpfkcxDao.queryByBetween(start,end);
}
......@@ -91,9 +102,18 @@ public class KmesBoardServiceImpl extends BaseEditServiceImpl implements KmesBoa
for(Date date : dateList){
PcslVO pcslVO = new PcslVO();
Pcjhmx pcjhmx = kmesBoardDao.queryWeekPcsl(date);
pcslVO.setPcrq(date);
List<Gpfkjg> gpfks = queryByBetween(date,date);
double wgsl =0.0;
if(gpfks != null && gpfks.size()>0){
wgsl = gpfks.stream().mapToDouble(Gpfkjg::getFksl).sum();//每一天
}
if(pcjhmx != null){
pcslVO.setJhsl(pcjhmx.getJhsl()==null?0.0:pcjhmx.getJhsl());
pcslVO.setWgsl(pcjhmx.getWgsl()==null?0.0:pcjhmx.getWgsl());
}else {
pcslVO.setJhsl(0.0);
}
pcslVO.setPcrq(date);
pcslVO.setWgsl(wgsl);
pcslVOList.add(pcslVO);
}
return pcslVOList;
......@@ -102,28 +122,32 @@ public class KmesBoardServiceImpl extends BaseEditServiceImpl implements KmesBoa
@Override
public PcslVO 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();
if(pcslVO == null){
pcslVO = new PcslVO();
pcslVO.setJhsl(0.0);
pcslVO.setWgsl(0.0);
}
Gpfkjg gpfkjg = gpfkcxDao.queryWeekGpfk(new Date(),"");
double wgsl =0.0;
if(gpfkjg != null){
wgsl = gpfkjg.getFksl()==null?0.0:gpfkjg.getFksl();
}
pcslVO.setWgsl(wgsl);
return pcslVO;
}
@Override
public PcslVO 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();
if(pcslVO == null){
pcslVO = new PcslVO();
pcslVO.setJhsl(0.0);
pcslVO.setWgsl(0.0);
}
Gpfkjg gpfkjg = gpfkcxDao.queryMonthGpfk(new Date());
double wgsl =0.0;
if(gpfkjg != null){
pcslVO.setWgsl(gpfkjg.getFksl()==null?0.0:gpfkjg.getFksl());
}
pcslVO.setWgsl(wgsl);
return pcslVO;
}
......@@ -132,8 +156,8 @@ public class KmesBoardServiceImpl extends BaseEditServiceImpl implements KmesBoa
public List<UWoVO> 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());
Gpfkjg gpfk = gpfkcxDao.queryWeekGpfk(new Date(),uWoVO.getId());
uWoVO.setWgsl(gpfk.getFksl()==null?0.0:gpfk.getFksl());
}
return uWoVOList;
}
......@@ -155,12 +179,12 @@ public class KmesBoardServiceImpl extends BaseEditServiceImpl implements KmesBoa
String[] gxbzs = gxbz.split(",");
for(Date date : dateList){
GpfkHgVO gpfkHgVO = new GpfkHgVO();
List<Gpfk> gpfks = gpfkcxDao.queryGpfk(date,gxbzs);
Integer fksl =0;
List<Gpfkjg> gpfks = gpfkcxDao.queryGpfk(date,gxbzs);
Double fksl =0.0;
Double hgsl =0.0;
if(CollectionUtils.isNotEmpty(gpfks)){
fksl= gpfks.size();
hgsl = gpfks.stream().mapToDouble(Gpfk::getHgsl).sum();
fksl = gpfks.stream().mapToDouble(Gpfkjg::getFksl).sum();
hgsl = gpfks.stream().mapToDouble(Gpfkjg::getHgsl).sum();
gpfkHgVO.setFksl(fksl);
gpfkHgVO.setHgsl(hgsl);
}else {
......
......@@ -9,7 +9,7 @@ public class GpfkHgVO extends BaseEntity {
private Date fkrq;
private Integer fksl;//反馈数量
private Double fksl;//反馈数量
private Double hgsl;//合格数量
......@@ -21,11 +21,11 @@ public class GpfkHgVO extends BaseEntity {
this.fkrq = fkrq;
}
public Integer getFksl() {
public Double getFksl() {
return fksl;
}
public void setFksl(Integer fksl) {
public void setFksl(Double fksl) {
this.fksl = fksl;
}
......
......@@ -13,7 +13,7 @@
<form class="query-criteria">
<ul>
<li class="gui-form-row" >
<div class="gui-col-sm3">
<div class="gui-col-sm2">
<label class="gui-form-label">产品条码:</label>
<div class="gui-input-block">
<input type="text" name="wosnid" style="width: 100%" ></div>
......@@ -37,9 +37,15 @@
<input type="text" name="wodjid" style="width: 100%" >
</div>
</div>
<div class="gui-col-sm3">
<label class="gui-form-label">工序:</label>
<div class="gui-input-block">
<input type="text" name="bzgxid" style="width: 100%" >
</div>
</div>
<!--<input type="hidden" name="bxid"/>-->
<input type="hidden" name="fkrid"/>
<input type="hidden" name="bzgxid"/>
<input type="hidden" name="bzbzgxid"/>
</li>
</ul>
<span class="toolbar-search-span"><a class="toolbar-search1" style="color:white;" href="javascript:void(0)"></a></span>
......@@ -57,6 +63,7 @@
var $datEnd=$div.find("input[name='end']");
var $txtScgd=$div.find('input[name="wodjid"]');
var $txtWosnid=$div.find('input[name="wosnid"]');
var $bzgxid=$div.find('input[name="bzgxid"]');
var gxName='';var gzzxid="";
var gzzxname="";var fkrName="";
......@@ -185,31 +192,47 @@
}
/*用户操作*/
function run(res){
gas.Dialog({
title:"选择工序",
width:480,
height:280,
minimizable:false,
maximizable:false,
href:"kmes/gphy/gx",
onInit:function (element) {
$bzgxid.iCombobox({valueField: "id", textField: "name", allowNull:false,required:true,allowEdit:false, url: 'gygl/bzgx/queryZpBzgx',onSelect:function (a) {
// $dialog.find("input[name='gxName']").val(a.name);
// $dialog.find("input[name='gzzxid']").val(a.gzzxid||'');
// $dialog.find("input[name='gzzxname']").val(a.gzzxname||'')
gxName=a.name||""
gzzxid=a.gzzxid||""
gzzxname=a.gzzxname||""
},
regResultHandler:function (element) {
if(!element.form("validate")){
return false
}
var data=DataBind.collectData(element);
$div.find("input[name='bxid']").val(data.bxid||"");
$div.find("input[name='bzgxid']").val(data.gxid||"");
$div.find("input[name='fkrid']").val(window.sessionStorage.getItem('userId'));
fkrName=window.sessionStorage.getItem('userName');
gxName=data.gxName||"";
gzzxid=data.gzzxid||'';
gzzxname=data.gzzxname||"";
$datagrid.datagrid("options").url="kmes/gpfk/query";
$datagrid.datagrid("load",DataBind.collectData($div))
loadFilter: function (a) {
var datas=a["data"]["records"];
$.each(datas,function (i,item) {
item["name"]=item["gzzxname"]+"-"+item["name"]
});
return datas
}
})
// gas.Dialog({
// title:"选择工序",
// width:480,
// height:280,
// minimizable:false,
// maximizable:false,
// href:"kmes/gphy/gx",
// onInit:function (element) {
// },
// regResultHandler:function (element) {
// if(!element.form("validate")){
// return false
// }
// var data=DataBind.collectData(element);
// $div.find("input[name='bxid']").val(data.bxid||"");
// $div.find("input[name='bzgxid']").val(data.gxid||"");
// $div.find("input[name='fkrid']").val(window.sessionStorage.getItem('userId'));
// fkrName=window.sessionStorage.getItem('userName');
// gxName=data.gxName||"";
// gzzxid=data.gzzxid||'';
// gzzxname=data.gzzxname||"";
// $datagrid.datagrid("options").url="kmes/gpfk/query";
// $datagrid.datagrid("load",DataBind.collectData($div))
// }
// })
}
gas.load(paramsInit,pageInit,dataInit,run);
......
......@@ -13,7 +13,7 @@
<form class="query-criteria">
<ul>
<li class="gui-form-row" >
<div class="gui-col-sm3">
<div class="gui-col-sm2">
<label class="gui-form-label">产品条码:</label>
<div class="gui-input-block">
<input type="text" name="wosnid" style="width: 100%" ></div>
......@@ -36,9 +36,15 @@
<div class="gui-input-block">
<input type="text" name="wodjid" style="width: 100%" ></div>
</div>
<div class="gui-col-sm3">
<label class="gui-form-label">工序:</label>
<div class="gui-input-block">
<input type="text" name="bzgxid" style="width: 100%" >
</div>
</div>
<!--<input type="hidden" name="bxid"/>-->
<input type="hidden" name="fkrid"/>
<input type="hidden" name="bzgxid"/>
<input type="hidden" name="bzbzgxid"/>
</li>
</ul>
<span class="toolbar-search-span"><a class="toolbar-search1" style="color: white" href="javascript:void(0)"></a></span>
......@@ -56,6 +62,7 @@
var $datEnd=$div.find("input[name='end']");
var $txtScgd=$div.find('input[name="wodjid"]');
var $txtWosnid=$div.find('input[name="wosnid"]');
var $bzgxid=$div.find('input[name="bzgxid"]');
var jzcs=0;
var gxName='';var gzzxid="";
var gzzxname="";var fkrName="";
......@@ -187,31 +194,47 @@
}
/*用户操作*/
function run(res){
gas.Dialog({
title:"选择工序",
width:480,
height:280,
minimizable:false,
maximizable:false,
href:"kmes/gpjy/gx",
onInit:function (element) {
$bzgxid.iCombobox({valueField: "id", textField: "name", allowNull:false, required:true,allowEdit:false, url: 'gygl/bzgx/queryJyBzgx',onSelect:function (a) {
// $dialog.find("input[name='gxName']").val(a.name);
// $dialog.find("input[name='gzzxid']").val(a.gzzxid||'');
// $dialog.find("input[name='gzzxname']").val(a.gzzxname||'')
gxName=a.name
gzzxid=a.gzzxid
gzzxname=a.gzzxname
},
regResultHandler:function (element) {
if(!element.form("validate")){
return false
}
var data=DataBind.collectData(element);
$div.find("input[name='bxid']").val(data.bxid||"");
$div.find("input[name='bzgxid']").val(data.gxid||"");
$div.find("input[name='fkrid']").val(window.sessionStorage.getItem('userId'));
fkrName=window.sessionStorage.getItem('userName');
gxName=data.gxName||"";
gzzxid=data.gzzxid||'';
gzzxname=data.gzzxname||"";
$datagrid.datagrid("options").url="kmes/gpjy/query";
$datagrid.datagrid("load",DataBind.collectData($div));
loadFilter: function (a) {
var datas=a["data"]["records"];
$.each(datas,function (i,item) {
item["name"]=item["gzzxname"]+"-"+item["name"]
});
return datas
}
})
});
// gas.Dialog({
// title:"选择工序",
// width:480,
// height:280,
// minimizable:false,
// maximizable:false,
// href:"kmes/gpjy/gx",
// onInit:function (element) {
// },
// regResultHandler:function (element) {
// if(!element.form("validate")){
// return false
// }
// var data=DataBind.collectData(element);
// $div.find("input[name='bxid']").val(data.bxid||"");
// $div.find("input[name='bzgxid']").val(data.gxid||"");
// $div.find("input[name='fkrid']").val(window.sessionStorage.getItem('userId'));
// fkrName=window.sessionStorage.getItem('userName');
// gxName=data.gxName||"";
// gzzxid=data.gzzxid||'';
// gzzxname=data.gzzxname||"";
// $datagrid.datagrid("options").url="kmes/gpjy/query";
// $datagrid.datagrid("load",DataBind.collectData($div));
// }
// })
}
gas.load(paramsInit,pageInit,dataInit,run);
......
......@@ -13,7 +13,7 @@
<form class="query-criteria">
<ul>
<li class="gui-form-row" >
<div class="gui-col-sm3">
<div class="gui-col-sm2">
<label class="gui-form-label">产品条码:</label>
<div class="gui-input-block">
<input type="text" name="wosnid" style="width: 100%" ></div>
......@@ -36,9 +36,14 @@
<div class="gui-input-block">
<input type="text" name="wodjid" style="width: 100%" ></div>
</div>
<div class="gui-col-sm3">
<label class="gui-form-label">工序:</label>
<div class="gui-input-block">
<input type="text" name="bzgxid" style="width: 100%" ></div>
</div>
<!-- <input type="hidden" name="bxid"/>-->
<input type="hidden" name="fkrid"/>
<input type="hidden" name="bzgxid"/>
<input type="hidden" name="bzbzgxid"/>
</li>
</ul>
<span class="toolbar-search-span"><a class="toolbar-search1" style="color: white" href="javascript:void(0)"></a></span>
......@@ -56,6 +61,7 @@
var $datEnd=$div.find("input[name='end']");
var $txtScgd=$div.find('input[name="wodjid"]');
var $txtWosnid=$div.find('input[name="wosnid"]');
var $bzgxid=$div.find('input[name="bzgxid"]');
var gxName='';var gzzxid="";
var gzzxname="";var fkrName="";
function paramsInit() {
......@@ -184,31 +190,47 @@
}
/*用户操作*/
function run(res){
gas.Dialog({
title:"选择工序",
width:480,
height:280,
minimizable:false,
maximizable:false,
href:"kmes/gpwx/gx",
onInit:function (element) {
$bzgxid.iCombobox({valueField: "id", textField: "name", allowNull:false,required:true, allowEdit:false, url: 'gygl/bzgx/queryWxBzgx',onSelect:function (a) {
// $dialog.find("input[name='gxName']").val(a.name)
// $dialog.find("input[name='gzzxid']").val(a.gzzxid||'')
// $dialog.find("input[name='gzzxname']").val(a.gzzxname||'')
gxName=a.name
gzzxid=a.gzzxid
gzzxname=a.gzzxname
},
regResultHandler:function (element) {
if(!element.form("validate")){
return false
}
var data=DataBind.collectData(element);
$div.find("input[name='bxid']").val(data.bxid||"");
$div.find("input[name='bzgxid']").val(data.gxid||"");
$div.find("input[name='fkrid']").val(window.sessionStorage.getItem('userId'));
fkrName=window.sessionStorage.getItem('userName');
gxName=data.gxName||"";
gzzxid=data.gzzxid||'';
gzzxname=data.gzzxname||"";
$datagrid.datagrid("options").url="kmes/gpfk/query";
$datagrid.datagrid("load",DataBind.collectData($div));
}
})
loadFilter: function (a) {
var datas=a["data"]["records"]
$.each(datas,function (i,item) {
item["name"]=item["gzzxname"]+"-"+item["name"]
});
return datas
}});
// gas.Dialog({
// title:"选择工序",
// width:480,
// height:280,
// minimizable:false,
// maximizable:false,
// href:"kmes/gpwx/gx",
// onInit:function (element) {
// },
// regResultHandler:function (element) {
// if(!element.form("validate")){
// return false
// }
// var data=DataBind.collectData(element);
// $div.find("input[name='bxid']").val(data.bxid||"");
// $div.find("input[name='bzgxid']").val(data.gxid||"");
// $div.find("input[name='fkrid']").val(window.sessionStorage.getItem('userId'));
// fkrName=window.sessionStorage.getItem('userName');
// gxName=data.gxName||"";
// gzzxid=data.gzzxid||'';
// gzzxname=data.gzzxname||"";
// $datagrid.datagrid("options").url="kmes/gpfk/query";
// $datagrid.datagrid("load",DataBind.collectData($div));
// }
// })
}
gas.load(paramsInit,pageInit,dataInit,run);
......
<style type="text/css">
.datebox-button{
display: none!important;
}
</style>
<div id="woPcjhkEdit" class="e-dialog-container" data-options="width: 1120, height: 630">
<div class="e-dialog-body">
<div class="e-dialog-box">
......@@ -154,10 +159,12 @@
$datjsrq.datebox('setValue',new Date(weekEnd))
let nowdata=$datagrid.datagrid('getData').rows
nowdata.forEach(function(e){
e.jhrq=woksrq
e.ksrq=woksrq
e.jsrq=wojsrq
})
$datagrid.datagrid("loadData",nowdata);
console.log(nowdata)
$datagrid.datagrid("loadData",nowdata)
}})
$xzzc.iCombobox({valueField: 'zcv', textField: 'zc',
data:[{zcv:0,zc:""},{zcv:1,zc:"第一周"},{zcv:0,zc:"第二周"},{zcv:0,zc:"第三周"},{zcv:0,zc:"第四周"},{zcv:0,zc:"第五周"},{zcv:0,zc:"第六周"}]
......@@ -313,7 +320,6 @@
let month=date.getMonth()+1
let day=date.getDate()
let weekday=date.getUTCDay()
console.log(weekday)
weekday=get17(weekday)
let nowWeek = getMonthWeek(year,month,day).getWeek
let weekStart=getBeforeDate(-(weekday-1),date)*1000
......
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