Commit c1cf1588 authored by yff's avatar yff

修改业务

parent b06b7914
package com.gavel.kwell.controller; package com.gavel.kwell.controller;
import java.util.List;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -25,6 +27,8 @@ import com.gavel.kwell.vo.PcjhmxkCondition; ...@@ -25,6 +27,8 @@ import com.gavel.kwell.vo.PcjhmxkCondition;
import com.gavel.kwell.vo.PcjhmxkVO; import com.gavel.kwell.vo.PcjhmxkVO;
import com.gavel.persistence.sql.RecordSet; import com.gavel.persistence.sql.RecordSet;
import com.gavel.wo.utils.PcjhDjlyEnum; import com.gavel.wo.utils.PcjhDjlyEnum;
import com.gavel.wo.vo.WoCondition;
import com.gavel.wo.vo.WoVO;
@Controller @Controller
@RequestMapping("kmes/pcjhk") @RequestMapping("kmes/pcjhk")
...@@ -61,6 +65,13 @@ public class PcjhkController extends BaseController { ...@@ -61,6 +65,13 @@ public class PcjhkController extends BaseController {
return "wo/pcjhk/wosearch"; return "wo/pcjhk/wosearch";
} }
@RequestMapping(value = "/queryWo", method = RequestMethod.POST)
@ResponseBody
public Object queryWo(@RequestBody JSONObject param) {
WoCondition condition = DataConvert.getCondition(param, WoCondition.class);
List<WoVO> records = pcjhkService.queryWo(condition);
return buildReturnData(records, WoVO.class);
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST) @RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody @ResponseBody
......
package com.gavel.kwell.dao; package com.gavel.kwell.dao;
import java.util.List;
import com.gavel.common.base.dao.BaseDao; import com.gavel.common.base.dao.BaseDao;
import com.gavel.kwell.vo.PcjhkCondition; import com.gavel.kwell.vo.PcjhkCondition;
import com.gavel.kwell.vo.PcjhkVO; import com.gavel.kwell.vo.PcjhkVO;
import com.gavel.persistence.sql.RecordSet; import com.gavel.persistence.sql.RecordSet;
import com.gavel.wo.vo.WoCondition;
import com.gavel.wo.vo.WoVO;
public interface PcjhkDao extends BaseDao { public interface PcjhkDao extends BaseDao {
public RecordSet<PcjhkVO> query(PcjhkCondition condition); public RecordSet<PcjhkVO> query(PcjhkCondition condition);
public List<WoVO> queryWo(WoCondition condition);
} }
...@@ -152,21 +152,21 @@ public class GpfkcxDaoImpl extends BaseDaoImpl implements GpfkcxDao { ...@@ -152,21 +152,21 @@ public class GpfkcxDaoImpl extends BaseDaoImpl implements GpfkcxDao {
@Override @Override
public List<Gpfkjg> queryGpfkForFirstJY(Date date,String[] gxbzs) { public List<Gpfkjg> queryGpfkForFirstJY(Date date,String[] gxbzs) {
SqlMap sqlMap = new SqlMap(); SqlMap sqlMap = new SqlMap();
sqlMap.append(" select c.WOGYLX_BZGXID, b.GPFKJG_WOSNID, b.GPFKJG_FKLX, b.GPFKJG_FKGX, "); sqlMap.append(" select c.WOGYLX_BZGXID, b.GPFK_WOSNID, b.GPFK_FKLX, b.GPFK_FKGX, ");
sqlMap.append(" b.GPFKJG_FKSJ, b.GPFKJG_FKR, b.GPFKJG_FKRID, b.GPFKJG_FKBX, "); sqlMap.append(" b.GPFK_FKSJ, b.GPFK_FKR, b.GPFK_FKRID, b.GPFK_FKBX, ");
sqlMap.append(" b.GPFKJG_FKJSSJ,b.GPFKJG_HGBZ, b.GPFKJG_FKSL, b.GPFKJG_HGSL, "); sqlMap.append(" b.GPFK_FKJSSJ,b.GPFK_HGBZ, b.GPFK_FKSL, b.GPFK_HGSL, ");
sqlMap.append(" b.GPFKJG_BHGSL, b.GPFKJG_GFSL,b.GPFKJG_LFSL, c.WOGYLX_GXBZ "); sqlMap.append(" b.GPFK_BHGSL, b.GPFK_GFSL,b.GPFK_LFSL, c.WOGYLX_GXBZ ");
sqlMap.append(" from GPFKJG b left join WOGYLX c on c.WOGYLX_ID = b.GPFKJG_FKGX "); sqlMap.append(" from GPFK b left join WOGYLX c on c.WOGYLX_ID = b.GPFK_FKGX ");
sqlMap.append(" inner join ( "); sqlMap.append(" inner join ( ");
sqlMap.append(" select MIN(d.GPFKJG_FKSJ) as fksj,e.WOGYLX_BZGXID,e.WOGYLX_ID,d.GPFKJG_WOSNID "); sqlMap.append(" select MIN(d.GPFK_FKSJ) as fksj,e.WOGYLX_BZGXID,e.WOGYLX_ID,d.GPFK_WOSNID ");
sqlMap.append(" FROM GPFKJG d left join WOGYLX e "); sqlMap.append(" FROM GPFK d left join WOGYLX e ");
sqlMap.append(" on e.WOGYLX_ID = d.GPFKJG_FKGX "); sqlMap.append(" on e.WOGYLX_ID = d.GPFK_FKGX ");
sqlMap.append(" GROUP BY e.WOGYLX_BZGXID,e.WOGYLX_ID,d.GPFKJG_WOSNID "); sqlMap.append(" GROUP BY e.WOGYLX_BZGXID,e.WOGYLX_ID,d.GPFK_WOSNID ");
sqlMap.append(" HAVING 1=1 "); sqlMap.append(" HAVING 1=1 ");
sqlMap.append(" and ").append("e.WOGYLX_BZGXID", gxbzs); sqlMap.append(" and ").append("e.WOGYLX_BZGXID", gxbzs);
sqlMap.append(" and ( fksj >= :pKsrq and fksj < :pJsrq ) "); sqlMap.append(" and ( fksj >= :pKsrq and fksj < :pJsrq ) ");
sqlMap.append(" ) a "); sqlMap.append(" ) a ");
sqlMap.append(" on b.GPFKJG_WOSNID =a.GPFKJG_WOSNID and b.GPFKJG_FKSJ= a.fksj "); sqlMap.append(" on b.GPFK_WOSNID =a.GPFK_WOSNID and b.GPFK_FKSJ= a.fksj ");
sqlMap.append(" where 1=1 "); sqlMap.append(" where 1=1 ");
sqlMap.append(" and c.WOGYLX_BZGXID = a.WOGYLX_BZGXID and c.wogylx_id = a.wogylx_id "); sqlMap.append(" and c.WOGYLX_BZGXID = a.WOGYLX_BZGXID and c.wogylx_id = a.wogylx_id ");
sqlMap.setParamValue("pKsrq", DateUtils.beginOfDay(date)); sqlMap.setParamValue("pKsrq", DateUtils.beginOfDay(date));
......
...@@ -9,6 +9,11 @@ import com.gavel.kwell.vo.PcjhkVO; ...@@ -9,6 +9,11 @@ import com.gavel.kwell.vo.PcjhkVO;
import com.gavel.persistence.sql.RecordSet; import com.gavel.persistence.sql.RecordSet;
import com.gavel.persistence.sql.SqlMap; import com.gavel.persistence.sql.SqlMap;
import com.gavel.persistence.sql.SqlUtil; import com.gavel.persistence.sql.SqlUtil;
import com.gavel.wo.vo.WoCondition;
import com.gavel.wo.vo.WoVO;
import java.util.List;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -52,4 +57,79 @@ public class PcjhkDaoImpl extends BaseDaoImpl implements PcjhkDao { ...@@ -52,4 +57,79 @@ public class PcjhkDaoImpl extends BaseDaoImpl implements PcjhkDao {
return sqlMap.getRecordSet(); return sqlMap.getRecordSet();
} }
@Override
public List<WoVO> queryWo(WoCondition condition) {
SqlMap sqlMap = new SqlMap();
sqlMap.setPageNo(condition.getPageNo());
sqlMap.setRowCount(condition.getPageSize());
sqlMap.append("select WO_ID, WO_DJID, WO_GCID, WO_YWRQ, WO_WLID, ");
sqlMap.append(" WO_JHKGRQ, WO_JHWGRQ, WO_BMID, WO_SCXID, WO_DJLY,(WO_XQSL-WO_WGSL) as WO_XQSL, ");
// if (StringUtils.equals(condition.getAllowPc(),"N")){
// sqlMap.append(" (WO_XQSL- WO_PCSL) as WO_XQSL, ");
// }else {
// sqlMap.append(" WO_XQSL,");
// }
sqlMap.append(" WO_ZT, WO_QRR, WO_QRSJ,WO_GBR, ");
sqlMap.append(" WO_GBSJ, WO_GBYY, WO_BOMID, WO_GYLXID, WO_PCYXJ,WO_SJKGRQ, ");
sqlMap.append(" WO_SJWGRQ, WO_SNNUM, WO_BZ, WO_WHRID, WO_WHR, WO_WHSJ, ");
sqlMap.append(" WO_XDR, WO_XMID, WO_XDSJ,WO_CJRID, WO_CJR, WO_CJSJ, ");
sqlMap.append(" BM_CODE, BM_NAME, GC_CODE, GC_NAME, SCX_CODE, SCX_NAME, ");
sqlMap.append(" WL.WLXX_CODE, WL.WLXX_NAME, WL.WLXX_GG, JLDW_NAME, ");
sqlMap.append(" WO_SYSVERSION,GCXM_CODE, GCXM_NAME,WO_PCSL ");
sqlMap.append("from WO ");
sqlMap.append(" left join GC on GC_ID = WO_GCID ");
sqlMap.append(" left join BM on BM_ID = WO_BMID ");
sqlMap.append(" left join SCX on SCX_ID = WO_SCXID ");
sqlMap.append(" left join WLXX WL on WL.WLXX_ID = WO_WLID ");
sqlMap.append(" left join JLDW on JLDW_ID = WL.WLXX_JLDW ");
sqlMap.append(" left join GCXM on GCXM_ID = WO_XMID ");
sqlMap.append("where 1=1 ");
if (StringUtils.equals(condition.getAllowPc(),"N")){
sqlMap.append(" and abs(WO_XQSL) - abs(WO_PCSL) > 0.0000000005 ");
}
if (StringUtils.isNotEmpty(condition.getDjid())){
sqlMap.append(" and WO_DJID like :pDJID");
sqlMap.setParamValueLike("pDJID", condition.getDjid());
}
if (StringUtils.isNotEmpty(condition.getGcid())){
sqlMap.append(" and WO_GCID = :pGCID");
sqlMap.setParamValue("pGCID", condition.getGcid());
}
if (condition.getKsrq() != null){
sqlMap.append(" and WO_YWRQ >= :KSRQ");
sqlMap.setParamValue("KSRQ", DateUtils.beginOfDay(condition.getKsrq()));
}
if (condition.getJsrq() != null){
sqlMap.append(" and WO_YWRQ <= :JSRQ");
sqlMap.setParamValue("JSRQ", DateUtils.endOfDay(condition.getJsrq()));
}
if (condition.getXdksrq() != null) {
sqlMap.append(" and WO_XDSJ >= :XDKSRQ");
sqlMap.setParamValue("XDKSRQ", DateUtils.beginOfDay(condition.getXdksrq()));
}
if (condition.getXdjsrq() != null) {
sqlMap.append(" and WO_XDSJ <=:XDJSRQ");
sqlMap.setParamValue("XDJSRQ", DateUtils.endOfDay(condition.getXdjsrq()));
}
if (StringUtils.isNotEmpty(condition.getBmid())){
sqlMap.append(" and WO_BMID = :pBMID");
sqlMap.setParamValue("pBMID", condition.getBmid());
}
if (StringUtils.isNotEmpty(condition.getWlid())) {
sqlMap.append(" and (WL.WLXX_CODE like :WLID or WL.WLXX_NAME like :WLID)");
sqlMap.setParamValueLike("WLID", condition.getWlid());
}
if (StringUtils.isNotEmpty(condition.getZt())) {
sqlMap.append(" and WO_ZT = :pZT");
sqlMap.setParamValue("pZT", condition.getZt());
}
if (condition.getZtList() != null && condition.getZtList().length > 0) {
sqlMap.append(" and " + SqlUtil.getWhereEqualSql("WO_ZT", condition.getZtList()));
}
sqlMap.append("order by WO_YWRQ desc ,WO_DJID desc");
return sqlMap.query(WoVO.class);
}
} }
package com.gavel.kwell.service; package com.gavel.kwell.service;
import java.util.List;
import com.gavel.common.base.service.BaseEditService; import com.gavel.common.base.service.BaseEditService;
import com.gavel.kwell.vo.PcjhkCondition; import com.gavel.kwell.vo.PcjhkCondition;
import com.gavel.kwell.vo.PcjhkVO; import com.gavel.kwell.vo.PcjhkVO;
import com.gavel.kwell.vo.PcjhmxkCondition; import com.gavel.kwell.vo.PcjhmxkCondition;
import com.gavel.kwell.vo.PcjhmxkVO; import com.gavel.kwell.vo.PcjhmxkVO;
import com.gavel.persistence.sql.RecordSet; import com.gavel.persistence.sql.RecordSet;
import com.gavel.wo.vo.WoCondition;
import com.gavel.wo.vo.WoVO;
...@@ -14,4 +18,6 @@ public interface PcjhkService extends BaseEditService { ...@@ -14,4 +18,6 @@ public interface PcjhkService extends BaseEditService {
public RecordSet<PcjhkVO> query(PcjhkCondition condition); public RecordSet<PcjhkVO> query(PcjhkCondition condition);
public RecordSet<PcjhmxkVO> queryDetails(PcjhmxkCondition condition); public RecordSet<PcjhmxkVO> queryDetails(PcjhmxkCondition condition);
public List<WoVO> queryWo(WoCondition condition) ;
} }
...@@ -19,6 +19,11 @@ import com.gavel.wo.dao.PcjhmxDao; ...@@ -19,6 +19,11 @@ import com.gavel.wo.dao.PcjhmxDao;
import com.gavel.wo.persistent.Pcjhmx; import com.gavel.wo.persistent.Pcjhmx;
import com.gavel.wo.vo.PcjhmxCondition; import com.gavel.wo.vo.PcjhmxCondition;
import com.gavel.wo.vo.PcjhmxVO; import com.gavel.wo.vo.PcjhmxVO;
import com.gavel.wo.vo.WoCondition;
import com.gavel.wo.vo.WoVO;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -26,6 +31,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -26,6 +31,7 @@ import org.springframework.transaction.annotation.Transactional;
import com.gavel.wo.dao.PcjhDao; import com.gavel.wo.dao.PcjhDao;
import com.gavel.wo.persistent.Pcjh; import com.gavel.wo.persistent.Pcjh;
import com.gavel.wo.service.PcjhService; import com.gavel.wo.service.PcjhService;
import com.gavel.wo.utils.WoStateEnum;
import com.gavel.wo.vo.PcjhCondition; import com.gavel.wo.vo.PcjhCondition;
import com.gavel.wo.vo.PcjhVO; import com.gavel.wo.vo.PcjhVO;
...@@ -69,5 +75,15 @@ public class PcjhkServiceImpl extends BaseEditServiceImpl implements PcjhkServic ...@@ -69,5 +75,15 @@ public class PcjhkServiceImpl extends BaseEditServiceImpl implements PcjhkServic
} }
} }
@Override
public List<WoVO> queryWo(WoCondition condition) {
if (condition.getZtList() == null ||
condition.getZtList().length < 1) {
condition.setZtList(new String[1]);
}
condition.getZtList()[0] = WoStateEnum.Release.getId();
return pcjhkDao.queryWo(condition);
}
} }
...@@ -113,7 +113,8 @@ ...@@ -113,7 +113,8 @@
" </div>" + " </div>" +
" </div>" + " </div>" +
" </div>"); " </div>");
jy(rowData); //jy(rowData);
if(rowData.hgbz=="N"){ if(rowData.hgbz=="N"){
$("#ishgs").text("不合格") $("#ishgs").text("不合格")
} }
......
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
/*查询操作*/ /*查询操作*/
function run(ops){ function run(ops){
$datagrid.datagrid("options").url="wo/wo/queryWo"; $datagrid.datagrid("options").url="kmes/pcjhk/queryWo";
$datagrid.datagrid("load",DataBind.collectData($div)); $datagrid.datagrid("load",DataBind.collectData($div));
} }
......
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