Commit 34357c63 authored by 李苏's avatar 李苏 💬

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

parents 04759ff6 996191fc
...@@ -902,23 +902,33 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -902,23 +902,33 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
@Override @Override
public GpfkVO queryDailyFkInfo(GpfkCondition condition){ public GpfkVO queryDailyFkInfo(GpfkCondition condition){
SqlMap sqlMap = new SqlMap(); SqlMap sqlMap = new SqlMap();
sqlMap.append("select sum(GPFK_FKSL) as GPFK_FKSL, sum(GPFK_BHGSL) as GPFK_BHGSL "); sqlMap.append("select sum(c.GPFK_FKSL) as GPFK_FKSL, sum(c.GPFK_BHGSL) as GPFK_BHGSL ");
sqlMap.append("from GPFK "); sqlMap.append("from GPFK c ");
sqlMap.append("left join WOGYLX ON WOGYLX_ID = GPFK_FKGX ");
sqlMap.append("left join BZGX ON BZGX_ID = WOGYLX_BZGXID ");
sqlMap.append("where 1 = 1 "); sqlMap.append("where 1 = 1 ");
sqlMap.append(" and EXISTS (select a.fkid FROM (select ISNULL(count(1),0) as sl,GPHY_MID as fkid ");
sqlMap.append(" from GPHY group by GPHY_MID) b left join ( select ISNULL(sum(wobom_dwyl),0) as sl ,GPFK_ID as fkid ");
sqlMap.append(" from GPFK left join WOBOM on WOBOM_FFGX =GPFK_fkgx ");
sqlMap.append(" left join WLXX on WLXX_ID = WOBOM_WLID ");
sqlMap.append(" left join WO on WO_ID = WOBOM_WOID ");
sqlMap.append(" left join WOSN on WOSN_WOID = WO_ID and WOSN_CODE =GPFK_WOSNID ");
sqlMap.append(" GROUP BY GPFK_ID ) a on a.fkid =b.fkid ");
sqlMap.append(" where 1 = 1 and a.sl<b.sl and c.GPFK_ID = a.fkid ) ");
if (StringUtils.isNotEmpty(condition.getGxid())){ if (StringUtils.isNotEmpty(condition.getGxid())){
sqlMap.append(" and GPFK_FKGX = :pFKGX "); sqlMap.append(" and BZGX_ID = :pFKGX ");
sqlMap.setParamValue("pFKGX",condition.getGxid()); sqlMap.setParamValue("pFKGX",condition.getGxid());
} }
if (StringUtils.isNotEmpty(condition.getBxid())){ if (StringUtils.isNotEmpty(condition.getBxid())){
sqlMap.append(" and GPFK_FKBX = :pBXID "); sqlMap.append(" and c.GPFK_FKBX = :pBXID ");
sqlMap.setParamValue("pBXID",condition.getBxid()); sqlMap.setParamValue("pBXID",condition.getBxid());
} }
if (StringUtils.isNotEmpty(condition.getFkrid())){ if (StringUtils.isNotEmpty(condition.getFkrid())){
sqlMap.append(" and GPFK_FKRID = :pFKRID "); sqlMap.append(" and c.GPFK_FKRID = :pFKRID ");
sqlMap.setParamValue("pFKRID",condition.getFkrid()); sqlMap.setParamValue("pFKRID",condition.getFkrid());
} }
if (condition.getYwrq() != null) { if (condition.getYwrq() != null) {
sqlMap.append(" and GPFK_YWRQ = :pYWRQ "); sqlMap.append(" and c.GPFK_YWRQ = :pYWRQ ");
sqlMap.setParamValue("pYWRQ", condition.getYwrq()); sqlMap.setParamValue("pYWRQ", condition.getYwrq());
} }
// if (condition.getStart() != null) { // if (condition.getStart() != null) {
...@@ -1113,7 +1123,7 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -1113,7 +1123,7 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
sqlMap.append(" left join WOSN on WOSN_WOID = WO_ID"); sqlMap.append(" left join WOSN on WOSN_WOID = WO_ID");
sqlMap.append(" left join WOGYLX on WOGYLX_ID = WOBOM_FFGX "); sqlMap.append(" left join WOGYLX on WOGYLX_ID = WOBOM_FFGX ");
sqlMap.append(" left join BZGX on BZGX_ID = WOGYLX_BZGXID "); sqlMap.append(" left join BZGX on BZGX_ID = WOGYLX_BZGXID ");
sqlMap.append(" left join GPFK on GPFK_WOSNID = WOSN_CODE and GPFK_FKGX= WOGYLX_ID and GPFK_WOGYLX =WOGYLX_ID"); sqlMap.append(" left join GPFK on GPFK_WOSNID = WOSN_CODE and GPFK_FKGX= WOGYLX_ID and GPFK_WOGYLX =WOGYLX_ID ");
sqlMap.append(" left join (select sum(GPHY_ZPSL) as ZPSL,GPHY_MID,GPHY_WLID,GPHY_FKGX from GPHY group by GPHY_MID,GPHY_WLID) k on k.GPHY_FKGX=WOBOM_FFGX and k.GPHY_MID = GPFK_ID and k.GPHY_WLID = WLXX_ID"); sqlMap.append(" left join (select sum(GPHY_ZPSL) as ZPSL,GPHY_MID,GPHY_WLID,GPHY_FKGX from GPHY group by GPHY_MID,GPHY_WLID) k on k.GPHY_FKGX=WOBOM_FFGX and k.GPHY_MID = GPFK_ID and k.GPHY_WLID = WLXX_ID");
sqlMap.append("where 1=1"); sqlMap.append("where 1=1");
if (StringUtils.isNotEmpty(woid)){ if (StringUtils.isNotEmpty(woid)){
...@@ -1311,7 +1321,7 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -1311,7 +1321,7 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
sqlMap.append(" left join WOSN on WOSN_WOID = WO_ID"); sqlMap.append(" left join WOSN on WOSN_WOID = WO_ID");
sqlMap.append(" left join WOGYLX on WOGYLX_WOID = WO_ID "); sqlMap.append(" left join WOGYLX on WOGYLX_WOID = WO_ID ");
sqlMap.append(" left join BZGX on WOGYLX_ID = WOBOM_FFGX "); sqlMap.append(" left join BZGX on WOGYLX_ID = WOBOM_FFGX ");
sqlMap.append(" left join GPFK on GPFK_WOSNID = WOSN_CODE and GPFK_FKGX= BZGX_ID and GPFK_WOGYLX =WOGYLX_ID"); sqlMap.append(" left join GPFK on GPFK_WOSNID = WOSN_CODE and GPFK_FKGX= BZGX_ID and GPFK_WOGYLX =WOGYLX_ID ");
sqlMap.append("where 1=1"); sqlMap.append("where 1=1");
if (StringUtils.isNotEmpty(bzlx)){ if (StringUtils.isNotEmpty(bzlx)){
sqlMap.append(" and " + SqlUtil.getWhereSql("BZGX_ID", bzlx)); sqlMap.append(" and " + SqlUtil.getWhereSql("BZGX_ID", bzlx));
...@@ -1369,6 +1379,10 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -1369,6 +1379,10 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
sqlMap.append(" and " + SqlUtil.getWhereSql("WLXX_ID", fkCondition.getWlxxId())); sqlMap.append(" and " + SqlUtil.getWhereSql("WLXX_ID", fkCondition.getWlxxId()));
sqlMap.setParamValue("WLXX_ID", fkCondition.getWlxxId()); sqlMap.setParamValue("WLXX_ID", fkCondition.getWlxxId());
} }
if (StringUtils.isNotEmpty(fkCondition.getWlid())){
sqlMap.append(" and " + SqlUtil.getWhereSql("WLXX_ID", fkCondition.getWlid()));
sqlMap.setParamValue("WLXX_ID", fkCondition.getWlid());
}
System.out.println(sqlMap.getSqlText()); System.out.println(sqlMap.getSqlText());
return sqlMap.queryDouble(); return sqlMap.queryDouble();
} }
......
...@@ -160,6 +160,7 @@ public class GphyDaoImpl extends BaseDaoImpl implements GphyDao { ...@@ -160,6 +160,7 @@ public class GphyDaoImpl extends BaseDaoImpl implements GphyDao {
sqlMap.append(" left join WLXX on WLXX_ID = WOBOM_WLID "); sqlMap.append(" left join WLXX on WLXX_ID = WOBOM_WLID ");
sqlMap.append(" left join WO on WO_ID = WOBOM_WOID "); sqlMap.append(" left join WO on WO_ID = WOBOM_WOID ");
sqlMap.append(" left join WOSN on WOSN_WOID = WO_ID and WOSN_CODE =GPFK_WOSNID "); sqlMap.append(" left join WOSN on WOSN_WOID = WO_ID and WOSN_CODE =GPFK_WOSNID ");
sqlMap.append(" where 1 = 1 ");
sqlMap.append(" GROUP BY GPFK_ID ) a "); sqlMap.append(" GROUP BY GPFK_ID ) a ");
sqlMap.append(" left join (select count(1) as sl,GPHY_MID as fkid "); sqlMap.append(" left join (select count(1) as sl,GPHY_MID as fkid ");
sqlMap.append(" from GPHY "); sqlMap.append(" from GPHY ");
......
...@@ -977,6 +977,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -977,6 +977,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
gpfk.setFkr(UserInfoUtil.getUserName()); gpfk.setFkr(UserInfoUtil.getUserName());
gpfk.setFksj(DateUtils.getDateTime()); gpfk.setFksj(DateUtils.getDateTime());
gpfk.setWlid(wlid); gpfk.setWlid(wlid);
gpfk.setYwrq(DateUtils.getDate());
gpfk.setFklx(GpfkFklxEnum.WO.getId()); gpfk.setFklx(GpfkFklxEnum.WO.getId());
insert(gpfk); insert(gpfk);
gpfkVo = gpfkDao.queryKwellGpfkByWosnAndGxid(fkCondition); gpfkVo = gpfkDao.queryKwellGpfkByWosnAndGxid(fkCondition);
...@@ -1104,6 +1105,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -1104,6 +1105,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
gpfk.setFkr(UserInfoUtil.getUserName()); gpfk.setFkr(UserInfoUtil.getUserName());
gpfk.setFksj(DateUtils.getDateTime()); gpfk.setFksj(DateUtils.getDateTime());
gpfk.setWlid(curFkVo.getWlid()); gpfk.setWlid(curFkVo.getWlid());
gpfk.setYwrq(DateUtils.getDate());
gpfk.setHgbz("Y"); gpfk.setHgbz("Y");
gpfk.setFklx(GpfkFklxEnum.WO.getId()); gpfk.setFklx(GpfkFklxEnum.WO.getId());
gpfk.setHgsl(1.0); gpfk.setHgsl(1.0);
...@@ -1145,6 +1147,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -1145,6 +1147,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
gpfk.setWlid(curFkVo.getWlid()); gpfk.setWlid(curFkVo.getWlid());
gpfk.setHgbz("N"); gpfk.setHgbz("N");
gpfk.setFklx(GpfkFklxEnum.WO.getId()); gpfk.setFklx(GpfkFklxEnum.WO.getId());
gpfk.setYwrq(DateUtils.getDate());
gpfk.setHgsl(0.0); gpfk.setHgsl(0.0);
gpfk.setBhgsl(1.0); gpfk.setBhgsl(1.0);
insert(gpfk); insert(gpfk);
...@@ -1247,6 +1250,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -1247,6 +1250,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
gpfk.setFkr(UserInfoUtil.getUserName()); gpfk.setFkr(UserInfoUtil.getUserName());
gpfk.setFksj(DateUtils.getDateTime()); gpfk.setFksj(DateUtils.getDateTime());
gpfk.setWlid(curFkVo.getWlid()); gpfk.setWlid(curFkVo.getWlid());
gpfk.setYwrq(DateUtils.getDate());
gpfk.setFklx(GpfkFklxEnum.WO.getId()); gpfk.setFklx(GpfkFklxEnum.WO.getId());
gpfk.setHgbz("Y"); gpfk.setHgbz("Y");
gpfk.setHgsl(1.0); gpfk.setHgsl(1.0);
...@@ -1285,6 +1289,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -1285,6 +1289,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
gpfk.setFkrid(UserInfoUtil.getId()); gpfk.setFkrid(UserInfoUtil.getId());
gpfk.setFkr(UserInfoUtil.getUserName()); gpfk.setFkr(UserInfoUtil.getUserName());
gpfk.setFksj(DateUtils.getDateTime()); gpfk.setFksj(DateUtils.getDateTime());
gpfk.setYwrq(DateUtils.getDate());
gpfk.setFklx(GpfkFklxEnum.WO.getId()); gpfk.setFklx(GpfkFklxEnum.WO.getId());
gpfk.setWlid(curFkVo.getWlid()); gpfk.setWlid(curFkVo.getWlid());
gpfk.setHgbz("N"); gpfk.setHgbz("N");
......
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