Commit 6b0d2630 authored by yff's avatar yff

反馈业务修改,建立反馈结果表

parent 7f1a401f
package com.gavel.kwell.controller; package com.gavel.kwell.controller;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -330,6 +331,16 @@ public class GpfkController extends BaseController { ...@@ -330,6 +331,16 @@ public class GpfkController extends BaseController {
return ThreadContext.getReturnData(); return ThreadContext.getReturnData();
} }
@RequestMapping("/queryKsrqAndJsrq")
public String queryKsrqAndJsrq(HttpServletRequest request) {
String agent = request.getHeader("User-Agent");
if ( agent.contains("iPhone") || agent.contains("Android") ) {
logger.info("移动端访问; User-Agent: " + agent);
}
return "loginscan_view";
}
@RequestMapping("/loginscan_view") @RequestMapping("/loginscan_view")
public String login_view(HttpServletRequest request) { public String login_view(HttpServletRequest request) {
...@@ -339,4 +350,5 @@ public class GpfkController extends BaseController { ...@@ -339,4 +350,5 @@ public class GpfkController extends BaseController {
} }
return "loginscan_view"; return "loginscan_view";
} }
} }
package com.gavel.kwell.controller;
import com.gavel.common.BaseURL;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.SystemOperation;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.utils.ThreadContext;
import com.gavel.kwell.service.GpfkjgService;
import com.gavel.kwell.vo.GpfkjgCondition;
import com.gavel.kwell.vo.GpfkjgVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("kmes/gpfkjg")
public class GpfkjgController extends BaseController {
@Autowired
private GpfkjgService gpfkjgService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "kmes/gpfkjg/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "kmes/gpfkjg/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "kmes/gpfkjg/edit";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
GpfkjgCondition condition = DataConvert.getCondition(param, GpfkjgCondition.class);
RecordSet<GpfkjgVO> records = gpfkjgService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(GpfkjgVO.class, records.getRecords().get(0));
}
return buildReturnData(GpfkjgVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
GpfkjgCondition condition = DataConvert.getCondition(param, GpfkjgCondition.class);
RecordSet<GpfkjgVO> records = gpfkjgService.query(condition);
return buildReturnData(records, GpfkjgVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
gpfkjgService.insert(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
gpfkjgService.update(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
gpfkjgService.delete(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
GpfkjgCondition condition = DataConvert.getCondition(param, GpfkjgCondition.class);
RecordSet<GpfkjgVO> records = gpfkjgService.query(condition);
doExport(request, response, param, records.getRecords());
}
}
...@@ -147,8 +147,12 @@ public interface GpfkDao extends BaseDao { ...@@ -147,8 +147,12 @@ public interface GpfkDao extends BaseDao {
public FkVO queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(String wosnid,String bzgxid); public FkVO queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(String wosnid,String bzgxid);
/**获取该序列号标准工序所有的反馈相关信息 */ /**获取该序列号标准工序所有的反馈相关信息 */
public List<FkVO> queryWowithIfExistGpfkByWosnAndBzgxid(String wosnid,String bzgxid); public List<FkVO> queryWowithIfExistGpfkByWosnAndBzgxid(String wosnid,String bzgxid);
/**获取该序列号维修标准工序最新的反馈相关信息 */
public FkVO queryWxWowithIfExistGpfkByWosnAndBzgxidInNewDate(String wosnid,String bzgxid);
/**获取该序列号标准工序的订单相关信息包含最新反馈记录 */ /**获取该序列号标准工序的订单相关信息包含最新反馈记录 */
public FkVO queryKwellWoBySnidUptoDate(String wosnid, String bzgx); public FkVO queryKwellWoBySnidUptoDate(String wosnid, String bzgx);
/**获取该序列号标准工序的订单相关信息不包含最新反馈记录 */
public FkVO queryKwellWxWoBySnidUptoDate(String wosnid);
/**获取该序列号标准工序的订单相关信息包含最新反馈记录 */ /**获取该序列号标准工序的订单相关信息包含最新反馈记录 */
public List<FkVO> queryKwellAllGpfkByWosnAndGxid(FkCondition condition); public List<FkVO> queryKwellAllGpfkByWosnAndGxid(FkCondition condition);
/**查询当前订单序列号最新反馈记录 */ /**查询当前订单序列号最新反馈记录 */
...@@ -170,6 +174,8 @@ public interface GpfkDao extends BaseDao { ...@@ -170,6 +174,8 @@ public interface GpfkDao extends BaseDao {
/**查询当前订单序列号最新检验反馈记录 */ /**查询当前订单序列号最新检验反馈记录 */
public GpfkVO queryJyGpfkByWosnUptoDate(String wosnid); public GpfkVO queryJyGpfkByWosnUptoDate(String wosnid);
public List<Wogylx> getNextGxContainSelf(Wogylx wogylx) ;
/** ------------END工票反馈升级-----------------***/ /** ------------END工票反馈升级-----------------***/
} }
package com.gavel.kwell.dao;
import com.gavel.common.base.dao.BaseDao;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.kwell.persistent.Gpfkjg;
import com.gavel.kwell.vo.GpfkjgCondition;
import com.gavel.kwell.vo.GpfkjgVO;
public interface GpfkjgDao extends BaseDao {
public RecordSet<GpfkjgVO> query(GpfkjgCondition condition);
public Gpfkjg queryEntityByCondition(GpfkjgCondition condition);
public int queryIfContainsmdfkgx(GpfkjgCondition condition);
public void deleteByCondition(GpfkjgCondition condition);
}
...@@ -1374,14 +1374,16 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -1374,14 +1374,16 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
sqlMap.append("select count(1) "); sqlMap.append("select count(1) ");
sqlMap.append("from GPHY "); sqlMap.append("from GPHY ");
sqlMap.append("LEFT JOIN WLXX ON WLXX_ID = GPHY_WLID "); sqlMap.append("LEFT JOIN WLXX ON WLXX_ID = GPHY_WLID ");
sqlMap.append("LEFT JOIN WOGYLX ON WOGYLX_ID = GPHY_FKGX ");
sqlMap.append("LEFT JOIN BZGX ON BZGX_ID = WOGYLX_BZGXID ");
sqlMap.append("where 1 = 1 "); sqlMap.append("where 1 = 1 ");
if (StringUtils.isNotEmpty(condition.getSnid())){ if (StringUtils.isNotEmpty(condition.getSnid())){
sqlMap.append(" and (GPHY_WLSNID = :pSnid) "); sqlMap.append(" and (GPHY_WLSNID = :pSnid) ");
sqlMap.setParamValue("pSnid", condition.getSnid()); sqlMap.setParamValue("pSnid", condition.getSnid());
} }
if (StringUtils.isNotEmpty(condition.getMid())){ if (StringUtils.isNotEmpty(condition.getBzgxid())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPHY_MID", condition.getMid())); sqlMap.append(" and " + SqlUtil.getWhereSql("BZGX_ID", condition.getBzgxid()));
sqlMap.setParamValue("GPHY_MID", condition.getMid()); sqlMap.setParamValue("BZGX_ID", condition.getBzgxid());
} }
return sqlMap.queryDouble(); return sqlMap.queryDouble();
} }
...@@ -1469,6 +1471,21 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -1469,6 +1471,21 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
return sqlMap.queryEntity(FkVO.class); return sqlMap.queryEntity(FkVO.class);
} }
@Override
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("from WOSN ");
sqlMap.append(" left join WO on WO_ID=WOSN_WOID");
sqlMap.append(" left join WLXX on wlxx_id = wo_wlid");
sqlMap.append("where 1 = 1 ");
sqlMap.append(" and WOSN_CODE = :pSNID ");
sqlMap.setParamValue("pSNID",wosnid);
return sqlMap.queryEntity(FkVO.class);
}
@Override @Override
public List<FkVO> queryKwellAllGpfkByWosnAndGxid(FkCondition condition){ public List<FkVO> queryKwellAllGpfkByWosnAndGxid(FkCondition condition){
SqlMap sqlMap = new SqlMap(); SqlMap sqlMap = new SqlMap();
...@@ -1592,18 +1609,17 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -1592,18 +1609,17 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
@Override @Override
public double queryIfZpwc(String wosnid, String bzgx) { public double queryIfZpwc(String wosnid, String bzgx) {
SqlMap sqlMap = new SqlMap(); SqlMap sqlMap = new SqlMap();
sqlMap.append("select e.sl-a.hysl from ( "); sqlMap.append("select ISNULL(e.sl,0)-ISNULL(a.hysl,0) from ( ");
sqlMap.append(" select sum(ISNULL(dwb.WOBOM_dwyl,0)) as sl,d.GPFK_WOSNID as dwosn,db.BZGX_ID AS dbzgx "); sqlMap.append(" select sum(ISNULL(dwb.WOBOM_dwyl,0)) as sl,dwo.WOSN_CODE as dwosn,db.BZGX_ID AS dbzgx ");
sqlMap.append(" from GPFK d "); sqlMap.append(" from WOSN dwo ");
sqlMap.append(" left join WOSN dwo on dwo.WOSN_CODE =GPFK_WOSNID ");
sqlMap.append(" LEFT JOIN WO dw ON dw.WO_ID = dwo.WOSN_WOID "); sqlMap.append(" LEFT JOIN WO dw ON dw.WO_ID = dwo.WOSN_WOID ");
sqlMap.append(" LEFT JOIN WOBOM dwb ON dwb.WOBOM_woid = dw.WO_ID and dwb.WOBOM_FFGX = d.gpfk_fkgx "); sqlMap.append(" LEFT JOIN WOBOM dwb ON dwb.WOBOM_woid = dw.WO_ID ");
sqlMap.append(" LEFT JOIN WOGYLX dwg ON dwg.WOGYLX_ID = d.GPFK_FKGX "); sqlMap.append(" LEFT JOIN WOGYLX dwg ON dwg.WOGYLX_ID =dwb.WOBOM_FFGX ");
sqlMap.append(" LEFT JOIN BZGX db ON db.BZGX_ID = dwg.WOGYLX_BZGXID "); sqlMap.append(" LEFT JOIN BZGX db ON db.BZGX_ID = dwg.WOGYLX_BZGXID ");
sqlMap.append(" GROUP BY d.GPFK_WOSNID,db.BZGX_ID "); sqlMap.append(" GROUP BY dwo.WOSN_CODE,db.BZGX_ID ");
sqlMap.append(" ) e "); sqlMap.append(" ) e ");
sqlMap.append(" LEFT JOIN ( "); sqlMap.append(" LEFT JOIN ( ");
sqlMap.append(" SELECT c.GPFK_WOSNID as cwosn,cb.BZGX_ID as cbzgx,COUNT(1) as hysl FROM GPHY "); sqlMap.append(" SELECT c.GPFK_WOSNID as cwosn,cb.BZGX_ID as cbzgx,ISNULL(COUNT(1),0) as hysl FROM GPHY ");
sqlMap.append(" LEFT JOIN GPFK c on c.GPFK_ID = GPHY_MID "); sqlMap.append(" LEFT JOIN GPFK c on c.GPFK_ID = GPHY_MID ");
sqlMap.append(" Left JOIN WOGYLX cw ON cw.WOGYLX_ID = c.GPFK_FKGX "); sqlMap.append(" Left JOIN WOGYLX cw ON cw.WOGYLX_ID = c.GPFK_FKGX ");
sqlMap.append(" LEFT JOIN BZGX cb ON cb.BZGX_ID = cw.WOGYLX_BZGXID "); sqlMap.append(" LEFT JOIN BZGX cb ON cb.BZGX_ID = cw.WOGYLX_BZGXID ");
...@@ -1611,12 +1627,13 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -1611,12 +1627,13 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
sqlMap.append(" ) a ON a.cwosn = e.dwosn and a.cbzgx = e.dbzgx "); sqlMap.append(" ) a ON a.cwosn = e.dwosn and a.cbzgx = e.dbzgx ");
sqlMap.append(" where 1=1 "); sqlMap.append(" where 1=1 ");
if (StringUtils.isNotEmpty(wosnid)){ if (StringUtils.isNotEmpty(wosnid)){
sqlMap.append("and a.cwosn = '" + wosnid+"'"); sqlMap.append("and e.dwosn = '" + wosnid+"'");
} }
if (StringUtils.isNotEmpty(bzgx)){ if (StringUtils.isNotEmpty(bzgx)){
sqlMap.append("and a.cbzgx = '" + bzgx+"'"); sqlMap.append("and e.dbzgx = '" + bzgx+"'");
} }
return sqlMap.queryInt(); System.out.println(sqlMap.getSqlText());
return sqlMap.queryDouble();
} }
...@@ -1635,11 +1652,10 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -1635,11 +1652,10 @@ 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 (select sum(GPHY_ZPSL) as ZPSL,GPFK_WOSNID,GPHY_WLID,GPHY_FKGX "); sqlMap.append(" left join (select sum(GPHY_ZPSL) as ZPSL,GPFK_WOSNID,GPHY_WLID,GPHY_FKGX ");
sqlMap.append(" from GPHY "); sqlMap.append(" from GPHY ");
sqlMap.append(" left join GPFK ON GPFK_ID =GPHY_MID "); sqlMap.append(" left join GPFK ON GPFK_ID =GPHY_MID ");
sqlMap.append(" group by GPFK_WOSNID,GPHY_WLID "); sqlMap.append(" group by GPFK_WOSNID,GPHY_WLID,GPHY_FKGX ");
sqlMap.append(" ) k on k.GPHY_FKGX=WOBOM_FFGX and k.GPFK_WOSNID = WOSN_CODE and k.GPHY_WLID = WLXX_ID"); sqlMap.append(" ) k on k.GPHY_FKGX=WOBOM_FFGX and k.GPFK_WOSNID = WOSN_CODE and k.GPHY_WLID = WLXX_ID");
sqlMap.append("where 1=1"); sqlMap.append("where 1=1");
if (StringUtils.isNotEmpty(bzgx)){ if (StringUtils.isNotEmpty(bzgx)){
...@@ -1670,11 +1686,11 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -1670,11 +1686,11 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
} }
if (StringUtils.isNotEmpty(condition.getWosncode())){ if (StringUtils.isNotEmpty(condition.getWosncode())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPFK_WOSNID", condition.getWosncode())); sqlMap.append(" and " + SqlUtil.getWhereSql("GPFK_WOSNID", condition.getWosncode()));
sqlMap.setParamValue("GPFK_WOSNID", condition.getMid()); sqlMap.setParamValue("GPFK_WOSNID", condition.getWosncode());
} }
if (StringUtils.isNotEmpty(condition.getBzgxid())){ if (StringUtils.isNotEmpty(condition.getBzgxid())){
sqlMap.append(" and " + SqlUtil.getWhereSql("BZGX_ID", condition.getWosncode())); sqlMap.append(" and " + SqlUtil.getWhereSql("BZGX_ID", condition.getBzgxid()));
sqlMap.setParamValue("BZGX_ID", condition.getMid()); sqlMap.setParamValue("BZGX_ID", condition.getBzgxid());
} }
sqlMap.append(" GROUP BY GPFK_WOSNID,BZGX_ID "); sqlMap.append(" GROUP BY GPFK_WOSNID,BZGX_ID ");
return sqlMap.queryDouble(); return sqlMap.queryDouble();
...@@ -1693,11 +1709,11 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -1693,11 +1709,11 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
sqlMap.append("where 1 = 1 "); sqlMap.append("where 1 = 1 ");
if (StringUtils.isNotEmpty(condition.getWosncode())){ if (StringUtils.isNotEmpty(condition.getWosncode())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPFK_WOSNID", condition.getWosncode())); sqlMap.append(" and " + SqlUtil.getWhereSql("GPFK_WOSNID", condition.getWosncode()));
sqlMap.setParamValue("GPFK_WOSNID", condition.getMid()); sqlMap.setParamValue("GPFK_WOSNID", condition.getWosncode());
} }
if (StringUtils.isNotEmpty(condition.getBzgxid())){ if (StringUtils.isNotEmpty(condition.getBzgxid())){
sqlMap.append(" and " + SqlUtil.getWhereSql("BZGX_ID", condition.getWosncode())); sqlMap.append(" and " + SqlUtil.getWhereSql("BZGX_ID", condition.getBzgxid()));
sqlMap.setParamValue("BZGX_ID", condition.getMid()); sqlMap.setParamValue("BZGX_ID", condition.getBzgxid());
} }
if (StringUtils.isNotEmpty(condition.getWlid())){ if (StringUtils.isNotEmpty(condition.getWlid())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPHY_WLID", condition.getWlid())); sqlMap.append(" and " + SqlUtil.getWhereSql("GPHY_WLID", condition.getWlid()));
...@@ -1763,5 +1779,64 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -1763,5 +1779,64 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
} }
@Override
public FkVO queryWxWowithIfExistGpfkByWosnAndBzgxidInNewDate(String wosnid, String bzgxid) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select GPFK_ID, GPFK_WOSNID, GPFK_FKLX, GPFK_FKSJ, U_GPFK_BZGXID,GPFK_HGBZ, GPFK_FKSL, ");
sqlMap.append(" GPFK_HGSL, GPFK_BHGSL, GPFK_FKR, GPFK_FKGX, GPFK_BZ, ");
sqlMap.append(" GPFK_WHRID, GPFK_WHR, GPFK_WHSJ, GPFK_CJRID, GPFK_CJR, ");
sqlMap.append(" GPFK_CJSJ, GPFK_SYSVERSION, GPFK_FKRID, GPFK_FKBX, GPFK_FKJSSJ, ");
sqlMap.append(" BX_CODE, BX_NAME, BZGX_CODE, BZGX_NAME,WLXX_ID, ");
sqlMap.append(" WLXX_CODE, WLXX_NAME, WLXX_GG,WOSN_CODE,WO_DJID,WO_ID, ");
sqlMap.append(" GPFK_GFSL, GPFK_LFSL, GPFK_FXSL, GPFK_FGSL, GPFK_YWRQ, GPFK_HGDJ, WOSN_KHCODE ");
sqlMap.append(" from GPFK ");
sqlMap.append(" left join BX on BX_ID = GPFK_FKBX ");
sqlMap.append(" left join WOSN on WOSN_CODE = GPFK_WOSNID ");
sqlMap.append(" left join WO on WO_ID = WOSN_WOID ");
sqlMap.append(" left join WLXX on WLXX_ID = WO_WLID ");
sqlMap.append(" left join BZGX on BZGX_ID = U_GPFK_BZGXID ");
sqlMap.append("where 1 = 1 ");
if (StringUtils.isNotEmpty(bzgxid)){
sqlMap.append(" and BZGX_ID = :pBZGXID ");
sqlMap.setParamValue("pBZGXID",bzgxid);
}
if (StringUtils.isNotEmpty(wosnid)){
sqlMap.append("and GPFK_WOSNID = :pWOSNID ");
sqlMap.setParamValue("pWOSNID", wosnid);
}
sqlMap.append("order by GPFK_FKSJ desc ");
return sqlMap.queryEntity(FkVO.class);
}
@Override
public List<Wogylx> getNextGxContainSelf(Wogylx wogylx) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select WOGYLX_ID, WOGYLX_WOID, WOGYLX_XH, WOGYLX_BZGXID, WOGYLX_GYLXID, ");
sqlMap.append(" WOGYLX_NAME, WOGYLX_GXLX, WOGYLX_GZZXID, WOGYLX_SBSL, WOGYLX_ZYRSL, ");
sqlMap.append(" WOGYLX_PDHS, WOGYLX_ZBHS, WOGYLX_JGHS, WOGYLX_ZYHS, WOGYLX_GJGX, ");
sqlMap.append(" WOGYLX_DWSJCL, WOGYLX_PCBS, WOGYLX_XQSL, WOGYLX_BZ, WOGYLX_CJRID, ");
sqlMap.append(" WOGYLX_CJR, WOGYLX_CJSJ, WOGYLX_WHRID, WOGYLX_WHR, WOGYLX_WHSJ, ");
sqlMap.append(" WOGYLX_SYSVERSION, GZZX_NAME, WOGYLX_GXBZ ");
sqlMap.append("from WOGYLX ");
sqlMap.append(" left join BZGX on BZGX_ID = WOGYLX_BZGXID ");
sqlMap.append(" left join GZZX on GZZX_ID = BZGX_GZZXID ");
sqlMap.append("where 1 = 1 ");
sqlMap.append(" and isnull(WOGYLX_XH,0) <> 0 ");
if(StringUtils.isNotEmpty(wogylx.getGzzxid())){
sqlMap.append(" and BZGX_GZZXID = :pGZZXID ");
sqlMap.setParamValue("pGZZXID",wogylx.getGzzxid());
}
if(StringUtils.isNotEmpty(wogylx.getWoid())){
sqlMap.append(" and WOGYLX_WOID = :pWOID ");
sqlMap.setParamValue("pWOID",wogylx.getWoid());
}
sqlMap.append(" and WOGYLX_XH >= :pXH ");
sqlMap.append("order by WOGYLX_XH desc");
sqlMap.setParamValue("pXH",wogylx.getXh());
return sqlMap.query(Wogylx.class);
}
} }
package com.gavel.kwell.dao.impl;
import com.gavel.common.base.dao.impl.BaseDaoImpl;
import com.gavel.common.utils.StringUtils;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.persistence.sql.SqlMap;
import com.gavel.persistence.sql.SqlUtil;
import org.springframework.stereotype.Repository;
import com.gavel.kwell.dao.GpfkjgDao;
import com.gavel.kwell.persistent.Gpfkjg;
import com.gavel.kwell.vo.GpfkjgCondition;
import com.gavel.kwell.vo.GpfkjgVO;
@Repository("gpfkjgDao")
public class GpfkjgDaoImpl extends BaseDaoImpl implements GpfkjgDao {
public RecordSet<GpfkjgVO> query(GpfkjgCondition condition){
SqlMap sqlMap = new SqlMap();
sqlMap.setPageNo(condition.getPageNo());
sqlMap.setRowCount(condition.getPageSize());
sqlMap.append("select GPFKJG_ID, GPFKJG_WOSNID, GPFKJG_FKSJ, GPFKJG_FKJSSJ, GPFKJG_HGBZ, ");
sqlMap.append(" GPFKJG_FKSL, GPFKJG_HGSL, GPFKJG_BHGSL, GPFKJG_FKRID, GPFKJG_FKR, ");
sqlMap.append(" GPFKJG_FKGX, GPFKJG_FKBX, GPFKJG_BZ, GPFKJG_WHRID, GPFKJG_WHR, ");
sqlMap.append(" GPFKJG_WHSJ, GPFKJG_CJRID, GPFKJG_CJR, GPFKJG_CJSJ, GPFKJG_SYSVERSION, ");
sqlMap.append(" GPFKJG_FKLX, GPFKJG_FXSL, GPFKJG_GFSL, GPFKJG_LFSL, GPFKJG_FGSL, ");
sqlMap.append(" GPFKJG_YKRKSL, GPFKJG_FKPH, GPFKJG_SCHS, GPFKJG_TMHS, GPFKJG_XJHS, ");
sqlMap.append(" GPFKJG_QTHS, GPFKJG_FKSJD, GPFKJG_YWRQ, GPFKJG_HGDJ, GPFKJG_WLID, ");
sqlMap.append(" GPFKJG_BZGXID, GPFKJG_WOGYLX ");
sqlMap.append("from GPFKJG ");
sqlMap.append("where 1 = 1 ");
if (StringUtils.isNotEmpty(condition.getId())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPFKJG_ID", condition.getId()));
sqlMap.setParamValue("GPFKJG_ID", condition.getId());
}
if (StringUtils.isNotEmpty(condition.getWosncode())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPFKJG_WOSNID", condition.getWosncode()));
sqlMap.setParamValue("GPFKJG_WOSNID", condition.getWosncode());
}
if (StringUtils.isNotEmpty(condition.getBzgxid())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPFKJG_BZGXID", condition.getBzgxid()));
sqlMap.setParamValue("GPFKJG_BZGXID", condition.getBzgxid());
}
if (StringUtils.isNotEmpty(condition.getWlid())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPFKJG_WLID", condition.getWlid()));
sqlMap.setParamValue("GPFKJG_WLID", condition.getWlid());
}
sqlMap.query(GpfkjgVO.class);
return sqlMap.getRecordSet();
}
@Override
public Gpfkjg queryEntityByCondition(GpfkjgCondition condition) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select GPFKJG_ID, GPFKJG_WOSNID, GPFKJG_FKSJ, GPFKJG_FKJSSJ, GPFKJG_HGBZ, ");
sqlMap.append(" GPFKJG_FKSL, GPFKJG_HGSL, GPFKJG_BHGSL, GPFKJG_FKRID, GPFKJG_FKR, ");
sqlMap.append(" GPFKJG_FKGX, GPFKJG_FKBX, GPFKJG_BZ, GPFKJG_WHRID, GPFKJG_WHR, ");
sqlMap.append(" GPFKJG_WHSJ, GPFKJG_CJRID, GPFKJG_CJR, GPFKJG_CJSJ, GPFKJG_SYSVERSION, ");
sqlMap.append(" GPFKJG_FKLX, GPFKJG_FXSL, GPFKJG_GFSL, GPFKJG_LFSL, GPFKJG_FGSL, ");
sqlMap.append(" GPFKJG_YKRKSL, GPFKJG_FKPH, GPFKJG_SCHS, GPFKJG_TMHS, GPFKJG_XJHS, ");
sqlMap.append(" GPFKJG_QTHS, GPFKJG_FKSJD, GPFKJG_YWRQ, GPFKJG_HGDJ, GPFKJG_WLID, ");
sqlMap.append(" GPFKJG_BZGXID, GPFKJG_WOGYLX ");
sqlMap.append("from GPFKJG ");
sqlMap.append("where 1 = 1 ");
if (StringUtils.isNotEmpty(condition.getId())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPFKJG_ID", condition.getId()));
sqlMap.setParamValue("GPFKJG_ID", condition.getId());
}
if (StringUtils.isNotEmpty(condition.getWosncode())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPFKJG_WOSNID", condition.getWosncode()));
sqlMap.setParamValue("GPFKJG_WOSNID", condition.getWosncode());
}
if (StringUtils.isNotEmpty(condition.getBzgxid())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPFKJG_BZGXID", condition.getBzgxid()));
sqlMap.setParamValue("GPFKJG_BZGXID", condition.getBzgxid());
}
if (StringUtils.isNotEmpty(condition.getWlid())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPFKJG_WLID", condition.getWlid()));
sqlMap.setParamValue("GPFKJG_WLID", condition.getWlid());
}
return sqlMap.queryEntity(Gpfkjg.class);
}
@Override
public int queryIfContainsmdfkgx(GpfkjgCondition condition) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select count(1) ");
sqlMap.append(" from GPFKJG ");
sqlMap.append(" left join WOGYLX on WOGYLX_ID = GPFKJG_FKGX ");
sqlMap.append(" where IFNULL( WOGYLX_WGSL, 0 ) > 0 and (WOGYLX_GXBZ = 'D' or WOGYLX_GXBZ = 'M' ) ");
if (StringUtils.isNotEmpty(condition.getId())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPFKJG_ID", condition.getId()));
sqlMap.setParamValue("GPFKJG_ID", condition.getId());
}
if (StringUtils.isNotEmpty(condition.getWosncode())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPFKJG_WOSNID", condition.getWosncode()));
sqlMap.setParamValue("GPFKJG_WOSNID", condition.getWosncode());
}
if (StringUtils.isNotEmpty(condition.getBzgxid())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPFKJG_BZGXID", condition.getBzgxid()));
sqlMap.setParamValue("GPFKJG_BZGXID", condition.getBzgxid());
}
if (StringUtils.isNotEmpty(condition.getWlid())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPFKJG_WLID", condition.getWlid()));
sqlMap.setParamValue("GPFKJG_WLID", condition.getWlid());
}
return sqlMap.queryInt();
}
@Override
public void deleteByCondition(GpfkjgCondition condition) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("delete ");
sqlMap.append(" from GPFKJG ");
sqlMap.append(" where 1=1 ");
if (StringUtils.isNotEmpty(condition.getId())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPFKJG_ID", condition.getId()));
sqlMap.setParamValue("GPFKJG_ID", condition.getId());
}
if (StringUtils.isNotEmpty(condition.getWosncode())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPFKJG_WOSNID", condition.getWosncode()));
sqlMap.setParamValue("GPFKJG_WOSNID", condition.getWosncode());
}
if (StringUtils.isNotEmpty(condition.getBzgxid())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPFKJG_BZGXID", condition.getBzgxid()));
sqlMap.setParamValue("GPFKJG_BZGXID", condition.getBzgxid());
}
if (StringUtils.isNotEmpty(condition.getWlid())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPFKJG_WLID", condition.getWlid()));
sqlMap.setParamValue("GPFKJG_WLID", condition.getWlid());
}
sqlMap.execute();
}
}
...@@ -96,6 +96,17 @@ public class Gpfk extends BaseEntity { ...@@ -96,6 +96,17 @@ public class Gpfk extends BaseEntity {
@FieldMeta(fieldName = "GPFK_WLID", caption = "物料编码") @FieldMeta(fieldName = "GPFK_WLID", caption = "物料编码")
private String wlid; private String wlid;
@FieldMeta(fieldName = "U_GPFK_BZGXID", caption = "标准工序ID")
private String bzgxid;
public String getBzgxid() {
return bzgxid;
}
public void setBzgxid(String bzgxid) {
this.bzgxid = bzgxid;
}
public String getWogylx() { public String getWogylx() {
return wogylx; return wogylx;
......
package com.gavel.kwell.persistent;
import java.util.Date;
import com.gavel.common.base.entity.BaseEntity;
import com.gavel.common.utils.CodeStrategy;
import com.gavel.persistence.annotation.FieldMeta;
import com.gavel.persistence.annotation.TableMeta;
@TableMeta(id = "GPFKJG", name = "GPFKJG")
public class Gpfkjg extends BaseEntity {
private static final long serialVersionUID = 1L;
@FieldMeta(fieldName = "GPFKJG_ID", caption = "ID", primaryKey = true,codeStrategy = CodeStrategy.UUID, notEmpty = true)
private String id;
@FieldMeta(fieldName = "GPFKJG_WOSNID", caption = "WOSN编码")
private String wosnid;
@FieldMeta(fieldName = "GPFKJG_FKSJ", caption = "反馈时间")
private Date fksj;
@FieldMeta(fieldName = "GPFKJG_FKJSSJ", caption = "反馈结束时间")
private Date fkjssj;
@FieldMeta(fieldName = "GPFKJG_HGBZ", caption = "合格标志")
private String hgbz;
@FieldMeta(fieldName = "GPFKJG_FKSL", caption = "反馈数量")
private Double fksl;
@FieldMeta(fieldName = "GPFKJG_HGSL", caption = "合格数量")
private Double hgsl;
@FieldMeta(fieldName = "GPFKJG_BHGSL", caption = "不合格数量")
private Double bhgsl;
@FieldMeta(fieldName = "GPFKJG_FKRID", caption = "反馈人编码")
private String fkrid;
@FieldMeta(fieldName = "GPFKJG_FKR", caption = "反馈人")
private String fkr;
@FieldMeta(fieldName = "GPFKJG_FKGX", caption = "反馈工序")
private String fkgx;
@FieldMeta(fieldName = "GPFKJG_FKBX", caption = "反馈班型")
private String fkbx;
@FieldMeta(fieldName = "GPFKJG_BZ", caption = "备注")
private String bz;
@FieldMeta(fieldName = "GPFKJG_WHRID", caption = "维护人编码", autoUserId = true)
private String whrid;
@FieldMeta(fieldName = "GPFKJG_WHR", caption = "维护人", autoUserName = true)
private String whr;
@FieldMeta(fieldName = "GPFKJG_WHSJ", caption = "维护时间", autoDateTime = true)
private Date whsj;
@FieldMeta(fieldName = "GPFKJG_CJRID", caption = "创建人编码", autoUserId = true, initial = true)
private String cjrid;
@FieldMeta(fieldName = "GPFKJG_CJR", caption = "创建人", autoUserName = true, initial = true)
private String cjr;
@FieldMeta(fieldName = "GPFKJG_CJSJ", caption = "创建时间", autoDateTime = true, initial = true)
private Date cjsj;
@FieldMeta(fieldName = "GPFKJG_SYSVERSION", caption = "系统版本")
private Integer sysversion;
@FieldMeta(fieldName = "GPFKJG_FKLX", caption = "反馈类型")
private String fklx;
@FieldMeta(fieldName = "GPFKJG_FXSL", caption = "返修数量")
private Double fxsl;
@FieldMeta(fieldName = "GPFKJG_GFSL", caption = "工废数量")
private Double gfsl;
@FieldMeta(fieldName = "GPFKJG_LFSL", caption = "料废数量")
private Double lfsl;
@FieldMeta(fieldName = "GPFKJG_FGSL", caption = "返工数量")
private Double fgsl;
@FieldMeta(fieldName = "GPFKJG_YKRKSL", caption = "已开入库单数量")
private Double ykrksl;
@FieldMeta(fieldName = "GPFKJG_FKPH", caption = "反馈批号")
private String fkph;
@FieldMeta(fieldName = "GPFKJG_SCHS", caption = "生产耗时")
private Double schs;
@FieldMeta(fieldName = "GPFKJG_TMHS", caption = "调模耗时")
private Double tmhs;
@FieldMeta(fieldName = "GPFKJG_XJHS", caption = "修机耗时")
private Double xjhs;
@FieldMeta(fieldName = "GPFKJG_QTHS", caption = "其他耗时")
private Double qths;
@FieldMeta(fieldName = "GPFKJG_FKSJD", caption = "反馈时间段")
private String fksjd;
@FieldMeta(fieldName = "GPFKJG_YWRQ", caption = "业务日期")
private Date ywrq;
@FieldMeta(fieldName = "GPFKJG_HGDJ", caption = "合格等级")
private String hgdj;
@FieldMeta(fieldName = "GPFKJG_WLID", caption = "物料编码")
private String wlid;
@FieldMeta(fieldName = "GPFKJG_BZGXID", caption = "标准工序编码")
private String bzgxid;
@FieldMeta(fieldName = "GPFKJG_WOGYLX", caption = "生产工艺路线")
private String wogylx;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getWosnid() {
return wosnid;
}
public void setWosnid(String wosnid) {
this.wosnid = wosnid;
}
public Date getFksj() {
return fksj;
}
public void setFksj(Date fksj) {
this.fksj = fksj;
}
public Date getFkjssj() {
return fkjssj;
}
public void setFkjssj(Date fkjssj) {
this.fkjssj = fkjssj;
}
public String getHgbz() {
return hgbz;
}
public void setHgbz(String hgbz) {
this.hgbz = hgbz;
}
public Double getFksl() {
return fksl;
}
public void setFksl(Double fksl) {
this.fksl = fksl;
}
public Double getHgsl() {
return hgsl;
}
public void setHgsl(Double hgsl) {
this.hgsl = hgsl;
}
public Double getBhgsl() {
return bhgsl;
}
public void setBhgsl(Double bhgsl) {
this.bhgsl = bhgsl;
}
public String getFkrid() {
return fkrid;
}
public void setFkrid(String fkrid) {
this.fkrid = fkrid;
}
public String getFkr() {
return fkr;
}
public void setFkr(String fkr) {
this.fkr = fkr;
}
public String getFkgx() {
return fkgx;
}
public void setFkgx(String fkgx) {
this.fkgx = fkgx;
}
public String getFkbx() {
return fkbx;
}
public void setFkbx(String fkbx) {
this.fkbx = fkbx;
}
public String getBz() {
return bz;
}
public void setBz(String bz) {
this.bz = bz;
}
public String getWhrid() {
return whrid;
}
public void setWhrid(String whrid) {
this.whrid = whrid;
}
public String getWhr() {
return whr;
}
public void setWhr(String whr) {
this.whr = whr;
}
public Date getWhsj() {
return whsj;
}
public void setWhsj(Date whsj) {
this.whsj = whsj;
}
public String getCjrid() {
return cjrid;
}
public void setCjrid(String cjrid) {
this.cjrid = cjrid;
}
public String getCjr() {
return cjr;
}
public void setCjr(String cjr) {
this.cjr = cjr;
}
public Date getCjsj() {
return cjsj;
}
public void setCjsj(Date cjsj) {
this.cjsj = cjsj;
}
public Integer getSysversion() {
return sysversion;
}
public void setSysversion(Integer sysversion) {
this.sysversion = sysversion;
}
public String getFklx() {
return fklx;
}
public void setFklx(String fklx) {
this.fklx = fklx;
}
public Double getFxsl() {
return fxsl;
}
public void setFxsl(Double fxsl) {
this.fxsl = fxsl;
}
public Double getGfsl() {
return gfsl;
}
public void setGfsl(Double gfsl) {
this.gfsl = gfsl;
}
public Double getLfsl() {
return lfsl;
}
public void setLfsl(Double lfsl) {
this.lfsl = lfsl;
}
public Double getFgsl() {
return fgsl;
}
public void setFgsl(Double fgsl) {
this.fgsl = fgsl;
}
public Double getYkrksl() {
return ykrksl;
}
public void setYkrksl(Double ykrksl) {
this.ykrksl = ykrksl;
}
public String getFkph() {
return fkph;
}
public void setFkph(String fkph) {
this.fkph = fkph;
}
public Double getSchs() {
return schs;
}
public void setSchs(Double schs) {
this.schs = schs;
}
public Double getTmhs() {
return tmhs;
}
public void setTmhs(Double tmhs) {
this.tmhs = tmhs;
}
public Double getXjhs() {
return xjhs;
}
public void setXjhs(Double xjhs) {
this.xjhs = xjhs;
}
public Double getQths() {
return qths;
}
public void setQths(Double qths) {
this.qths = qths;
}
public String getFksjd() {
return fksjd;
}
public void setFksjd(String fksjd) {
this.fksjd = fksjd;
}
public Date getYwrq() {
return ywrq;
}
public void setYwrq(Date ywrq) {
this.ywrq = ywrq;
}
public String getHgdj() {
return hgdj;
}
public void setHgdj(String hgdj) {
this.hgdj = hgdj;
}
public String getWlid() {
return wlid;
}
public void setWlid(String wlid) {
this.wlid = wlid;
}
public String getBzgxid() {
return bzgxid;
}
public void setBzgxid(String bzgxid) {
this.bzgxid = bzgxid;
}
public String getWogylx() {
return wogylx;
}
public void setWogylx(String wogylx) {
this.wogylx = wogylx;
}
}
package com.gavel.kwell.service;
import com.gavel.common.base.service.BaseEditService;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.kwell.persistent.Gpfkjg;
import com.gavel.kwell.vo.GpfkjgCondition;
import com.gavel.kwell.vo.GpfkjgVO;
public interface GpfkjgService extends BaseEditService {
public RecordSet<GpfkjgVO> query(GpfkjgCondition condition);
public Gpfkjg queryEntityByCondition(GpfkjgCondition condition);
public int queryIfContainsmdfkgx(GpfkjgCondition condition);
public void deleteByCondition(GpfkjgCondition condition);
}
package com.gavel.kwell.service.impl; package com.gavel.kwell.service.impl;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashSet; import java.util.HashSet;
...@@ -43,9 +44,11 @@ import com.gavel.kwell.dao.GpfkDao; ...@@ -43,9 +44,11 @@ import com.gavel.kwell.dao.GpfkDao;
import com.gavel.kwell.dao.GphyDao; import com.gavel.kwell.dao.GphyDao;
import com.gavel.kwell.persistent.Gpbhgmx; import com.gavel.kwell.persistent.Gpbhgmx;
import com.gavel.kwell.persistent.Gpfk; import com.gavel.kwell.persistent.Gpfk;
import com.gavel.kwell.persistent.Gpfkjg;
import com.gavel.kwell.persistent.Gphy; import com.gavel.kwell.persistent.Gphy;
import com.gavel.kwell.persistent.Gpwxmx; import com.gavel.kwell.persistent.Gpwxmx;
import com.gavel.kwell.service.GpfkService; import com.gavel.kwell.service.GpfkService;
import com.gavel.kwell.service.GpfkjgService;
import com.gavel.kwell.service.GphyService; import com.gavel.kwell.service.GphyService;
import com.gavel.kwell.utils.GpfkFklxEnum; import com.gavel.kwell.utils.GpfkFklxEnum;
import com.gavel.kwell.utils.GpfkHgEnum; import com.gavel.kwell.utils.GpfkHgEnum;
...@@ -61,6 +64,7 @@ import com.gavel.kwell.vo.GpbhgfkCondition; ...@@ -61,6 +64,7 @@ import com.gavel.kwell.vo.GpbhgfkCondition;
import com.gavel.kwell.vo.GpbhgmxVO; import com.gavel.kwell.vo.GpbhgmxVO;
import com.gavel.kwell.vo.GpfkCondition; import com.gavel.kwell.vo.GpfkCondition;
import com.gavel.kwell.vo.GpfkVO; import com.gavel.kwell.vo.GpfkVO;
import com.gavel.kwell.vo.GpfkjgCondition;
import com.gavel.kwell.vo.GphyCondition; import com.gavel.kwell.vo.GphyCondition;
import com.gavel.kwell.vo.WlslItem; import com.gavel.kwell.vo.WlslItem;
import com.gavel.kwell.vo.WosngzVO; import com.gavel.kwell.vo.WosngzVO;
...@@ -78,6 +82,7 @@ import com.gavel.wo.persistent.Pcjhmx; ...@@ -78,6 +82,7 @@ import com.gavel.wo.persistent.Pcjhmx;
import com.gavel.wo.persistent.Wogylx; import com.gavel.wo.persistent.Wogylx;
import com.gavel.wo.persistent.Wosn; import com.gavel.wo.persistent.Wosn;
import com.gavel.wo.service.PcjhmxService; import com.gavel.wo.service.PcjhmxService;
import com.gavel.wo.service.WogylxService;
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.WobomVO; import com.gavel.wo.vo.WobomVO;
...@@ -87,21 +92,27 @@ import com.gavel.wo.vo.WobomVO; ...@@ -87,21 +92,27 @@ import com.gavel.wo.vo.WobomVO;
@Transactional @Transactional
public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService { public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService {
private static final String HGBZ ="Y";
private static final String BHGBZ ="N";
@Autowired @Autowired
private GpfkDao gpfkDao; private GpfkDao gpfkDao;
@Autowired @Autowired
private GphyDao gphyDao; private GphyDao gphyDao;
@Autowired
private GphyDao gphydao;
@Autowired @Autowired
private CommonService commonService; private CommonService commonService;
@Autowired
private GpfkjgService gpfkjgService;
@Autowired @Autowired
private BzgxService bzgxService; private BzgxService bzgxService;
@Autowired
private WogylxService wogylxService;
@Autowired @Autowired
private UserRoleService userRoleService; private UserRoleService userRoleService;
...@@ -172,17 +183,39 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -172,17 +183,39 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
gpfkDao.batchDelete(gpbhgmxList); gpfkDao.batchDelete(gpbhgmxList);
} }
if(gphymxList != null && gphymxList.size() > 0){ if(gphymxList != null && gphymxList.size() > 0){
gphydao.batchDelete(gphymxList); gphyDao.batchDelete(gphymxList);
} }
/** 排产计划删除 末道工序 、单道工序**/ /** 排产计划删除 末道工序 、单道工序**/
Wogylx wogylx = (Wogylx) GavelSql.selectEntityByKey(Wogylx.class, gpfk.getWogylx()); Wogylx wogylx = (Wogylx) GavelSql.selectEntityByKey(Wogylx.class, gpfk.getWogylx());
if(wogylx!=null&&StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) { if(wogylx!=null) {
if(StringUtils.isNotEmpty(gpfk.getHgbz())&&gpfk.getHgbz().equals("N")) { List<Wogylx> nextWogylxs =gpfkDao.getNextGxContainSelf(wogylx);
cancelPcjh(wogylx.getWoid(),wogylx.getGxlx(),false); if(nextWogylxs!=null&&nextWogylxs.size()>0) {
for(int i=0;i<nextWogylxs.size();i++) {
Wogylx nextWogylx = nextWogylxs.get(i);
if(StringUtils.isNotEmpty(nextWogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
wogylx.setWgsl(NumberUtils.minus(wogylx.getWgsl(),1.0));
if(StringUtils.isNotEmpty(gpfk.getHgbz())&&gpfk.getHgbz().equals(HGBZ)) {
wogylx.setHgsl(NumberUtils.minus(wogylx.getHgsl(),1.0));
} }
else { else {
cancelPcjh(wogylx.getWoid(),wogylx.getGxlx(),true); wogylx.setBhgsl(NumberUtils.minus(wogylx.getBhgsl(),1.0));
} }
wogylxService.update(wogylx);
}
GpfkjgCondition gpfkjgCondition = new GpfkjgCondition();
gpfkjgCondition.setBzgxid(wogylx.getBzgxid());
gpfkjgCondition.setWlid(gpfk.getWlid());
gpfkjgCondition.setWosncode(gpfk.getWosnid());
gpfkjgService.deleteByCondition(gpfkjgCondition);
}
}
// if(StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M")))
// if(StringUtils.isNotEmpty(gpfk.getHgbz())&&gpfk.getHgbz().equals("N")) {
// cancelPcjh(wogylx.getWoid(),wogylx.getGxlx(),false);
// }
// else {
// cancelPcjh(wogylx.getWoid(),wogylx.getGxlx(),true);
// }
} }
} }
} }
...@@ -1451,6 +1484,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -1451,6 +1484,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
/** 判断该物料是否装配完成*/ /** 判断该物料是否装配完成*/
public void compareIsZpComplete(GphyCondition gphyCondition) { public void compareIsZpComplete(GphyCondition gphyCondition) {
System.out.println("ss");
WlslItem wlslItem =gpfkDao.queryKwellZpslGphy(gphyCondition); WlslItem wlslItem =gpfkDao.queryKwellZpslGphy(gphyCondition);
if(wlslItem!=null) { if(wlslItem!=null) {
double dwyl =gpfkDao.queryWobomZpslByDjidAndWlidUpgrade(gphyCondition.getWosncode(),gphyCondition.getBzgxid(), gphyCondition.getWlid()); double dwyl =gpfkDao.queryWobomZpslByDjidAndWlidUpgrade(gphyCondition.getWosncode(),gphyCondition.getBzgxid(), gphyCondition.getWlid());
...@@ -1466,6 +1500,88 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -1466,6 +1500,88 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
return gpfkDao.queryWobomByWosnAndBzgx(wosn,bzgx); return gpfkDao.queryWobomByWosnAndBzgx(wosn,bzgx);
} }
/** 新增反馈结果集 */
public void addOrUpdateGpfkjg(String wlid,String bzgxid,String wogylxid,String wosncode,String hgbz) {
GpfkjgCondition gpfkjgCondition =new GpfkjgCondition();
gpfkjgCondition.setWlid(wlid);
gpfkjgCondition.setBzgxid(bzgxid);
gpfkjgCondition.setWosncode(wosncode);
Gpfkjg gpfkjg=gpfkjgService.queryEntityByCondition(gpfkjgCondition);
Wogylx wogylx = (Wogylx) GavelSql.selectEntityByKey(Wogylx.class, wogylxid);
if(gpfkjg==null) {
gpfkjg = new Gpfkjg();
gpfkjg.setBzgxid(bzgxid);
gpfkjg.setWosnid(wosncode);
gpfkjg.setWogylx(wogylxid);
gpfkjg.setFkgx(wogylxid);
gpfkjg.setFkrid(UserInfoUtil.getId());
gpfkjg.setFkr(UserInfoUtil.getUserName());
gpfkjg.setFksj(DateUtils.getDateTime());
gpfkjg.setWlid(wlid);
gpfkjg.setYwrq(DateUtils.getDate());
if(hgbz.equals(HGBZ)) {
if(wogylx!=null&&StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
wogylx.setWgsl(NumberUtils.plus(wogylx.getWgsl(),1.0));
wogylx.setHgsl(NumberUtils.plus(wogylx.getHgsl(),1.0));
wogylxService.update(wogylx);
}
gpfkjg.setHgbz(HGBZ);
}
else {
if(wogylx!=null&&StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
wogylx.setWgsl(NumberUtils.plus(wogylx.getWgsl(),1.0));
wogylx.setBhgsl(NumberUtils.plus(wogylx.getBhgsl(),1.0));
wogylxService.update(wogylx);
}
gpfkjg.setHgbz(BHGBZ);
}
gpfkjg.setFklx(GpfkFklxEnum.WO.getId());
if(hgbz.equals(HGBZ)) {
gpfkjg.setHgsl(1.0);
gpfkjg.setBhgsl(0.0);
}
else {
gpfkjg.setHgsl(0.0);
gpfkjg.setBhgsl(1.0);
}
gpfkjgService.insert(gpfkjg);
}
else {
gpfkjg.setFkrid(UserInfoUtil.getId());
gpfkjg.setFkr(UserInfoUtil.getUserName());
gpfkjg.setFksj(DateUtils.getDateTime());
gpfkjg.setWlid(wlid);
gpfkjg.setYwrq(DateUtils.getDate());
if(hgbz.equals(HGBZ)) {
if(gpfkjg.getHgbz().equals(BHGBZ)) {
if(wogylx!=null&&StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
wogylx.setBhgsl(NumberUtils.minus(wogylx.getBhgsl(),1.0));
wogylx.setHgsl(NumberUtils.plus(wogylx.getHgsl(),1.0));
wogylxService.update(wogylx);
}
}
gpfkjg.setHgbz(HGBZ);
}
else {
if(gpfkjg.getHgbz().equals(HGBZ)) {
if(wogylx!=null&&StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
wogylx.setBhgsl(NumberUtils.plus(wogylx.getBhgsl(),1.0));
wogylx.setHgsl(NumberUtils.minus(wogylx.getHgsl(),1.0));
wogylxService.update(wogylx);
}
}
gpfkjg.setHgbz(BHGBZ);
}
gpfkjg.setFklx(GpfkFklxEnum.WO.getId());
gpfkjg.setHgsl(1.0);
gpfkjg.setBhgsl(0.0);
gpfkjg.setFksl(1.0);
update(gpfkjg);
}
}
/** /**
* 装配反馈流程升级 * 装配反馈流程升级
...@@ -1519,21 +1635,16 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -1519,21 +1635,16 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
if(curFkVo==null) { if(curFkVo==null) {
throwReturnMessage("该订单不存在对应工序,请重新确认!"); throwReturnMessage("该订单不存在对应工序,请重新确认!");
} }
FkVO gpfkVo =null; GphyCondition hyCondition =new GphyCondition();
if(checkIsCurrentGx(curFkVo)) { hyCondition.setBzgxid(fkCondition.getBzgxid());
/* 本工序为当前工序*/ hyCondition.setWosncode(fkCondition.getWosncode());
gpfkVo = gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid()); hyCondition.setSnid(fkCondition.getSncode());
Gpfk gpfk = new Gpfk(); hyCondition.setWlid(wlid);
EntityDataFactory.copyEntity(gpfkVo, gpfk); compareIsZpComplete(hyCondition);
gpfk.setFkgx(curFkVo.getWogylxid()); if( gpfkDao.checkIfContainsGphywl(hyCondition)>0) {
gpfk.setFkrid(UserInfoUtil.getId()); throwReturnMessage("该序列号已经被扫描,请重新确认!");
gpfk.setFkr(UserInfoUtil.getUserName());
gpfk.setFksj(DateUtils.getDateTime());
update(gpfk);
gpfkVo = gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
} }
else { /* 新增工票反馈记录,新增耗用记录 */
/* 本工序不为最新工序 存在情况为该订单序列号去维修 */
Gpfk gpfk = new Gpfk(); Gpfk gpfk = new Gpfk();
gpfk.setWosnid(curFkVo.getWosnCode()); gpfk.setWosnid(curFkVo.getWosnCode());
gpfk.setWogylx(curFkVo.getWogylxid()); gpfk.setWogylx(curFkVo.getWogylxid());
...@@ -1541,43 +1652,27 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -1541,43 +1652,27 @@ 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.setWlid(wlid); gpfk.setWlid(curFkVo.getWlid());
gpfk.setFksl(1.0d);
gpfk.setYwrq(DateUtils.getDate()); gpfk.setYwrq(DateUtils.getDate());
gpfk.setFklx(GpfkFklxEnum.WO.getId()); gpfk.setFklx(GpfkFklxEnum.WO.getId());
insert(gpfk); gpfk.setBzgxid(fkCondition.getBzgxid());
gpfkVo = gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid()); Gpfk dbgpfk=(Gpfk) insert(gpfk);
}
GphyCondition hyCondition =new GphyCondition();
hyCondition.setBzgxid(fkCondition.getBzgxid());
hyCondition.setWosncode(fkCondition.getWosncode());
hyCondition.setSnid(fkCondition.getSncode());
hyCondition.setWlid(wlid);
if( gpfkDao.checkIfContainsGphywl(hyCondition)>0) {
throwReturnMessage("该序列号已经被扫描");
}
compareIsZpComplete(hyCondition);
Gphy gphy = new Gphy(); Gphy gphy = new Gphy();
gphy.setFkgx(gpfkVo.getFkgx()); gphy.setFkgx(dbgpfk.getFkgx());
gphy.setWlid(wlid); gphy.setWlid(wlid);
gphy.setMid(gpfkVo.getId()); gphy.setMid(dbgpfk.getId());
gphy.setWlsnid(fkCondition.getSncode()); gphy.setWlsnid(fkCondition.getSncode());
gphy.setFkrid(UserInfoUtil.getId()); gphy.setFkrid(UserInfoUtil.getId());
gphy.setFkr(UserInfoUtil.getUserName()); gphy.setFkr(UserInfoUtil.getUserName());
gphy.setFksj(DateUtils.getDateTime()); gphy.setFksj(DateUtils.getDateTime());
gphy.setZpsl(1.0); gphy.setZpsl(1.0d);
gphy.setHylx("BOM"); gphy.setHylx("BOM");
gphyService.insert(gphy); gphyService.insert(gphy);
if(checkIfZpCompleteByWosnAndBzgx(fkCondition.getSncode(), fkCondition.getBzgxid())) { FkVO gpfkVo = gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
curFkVo.setZpbz(SmCodeEnum.OKBZ.getPrefix()); if(checkIfZpCompleteByWosnAndBzgx(fkCondition.getWosncode(), fkCondition.getBzgxid())) {
Wogylx wogylx = (Wogylx) GavelSql.selectEntityByKey(Wogylx.class, gpfkVo.getWogylx()); gpfkVo.setZpbz(SmCodeEnum.OKBZ.getPrefix());
if(wogylx!=null&&StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) { addOrUpdateGpfkjg(gpfkVo.getWlid(), fkCondition.getBzgxid(), gpfkVo.getFkgx(), fkCondition.getWosncode(), HGBZ);
if(StringUtils.isNotEmpty(gpfkVo.getHgbz())&&gpfkVo.getHgbz().equals("N")) {
updatePcjh(wogylx.getWoid(),wogylx.getGxlx(),false);
}
else {
updatePcjh(wogylx.getWoid(),wogylx.getGxlx(),true);
}
}
} }
gpfkVo.setSntype(SmCodeEnum.WLID.getId()); gpfkVo.setSntype(SmCodeEnum.WLID.getId());
Wlxx cuwlxx = gpfkDao.queryById(Wlxx.class, wlid); Wlxx cuwlxx = gpfkDao.queryById(Wlxx.class, wlid);
...@@ -1628,8 +1723,6 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -1628,8 +1723,6 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
if(StringUtils.isEmpty(fkCondition.getWosncode())) { if(StringUtils.isEmpty(fkCondition.getWosncode())) {
throwReturnMessage("该订单序列号未输入,请重新确认!"); throwReturnMessage("该订单序列号未输入,请重新确认!");
} }
FkVO gpfkVo = gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
if(gpfkVo==null) {
Gpfk gpfk = new Gpfk(); Gpfk gpfk = new Gpfk();
FkVO curFkVo =gpfkDao.queryKwellWoBySnidUptoDate(fkCondition.getWosncode(), fkCondition.getBzgxid()); FkVO curFkVo =gpfkDao.queryKwellWoBySnidUptoDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
gpfk.setWosnid(curFkVo.getWosnCode()); gpfk.setWosnid(curFkVo.getWosnCode());
...@@ -1640,44 +1733,22 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -1640,44 +1733,22 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
gpfk.setFksj(DateUtils.getDateTime()); gpfk.setFksj(DateUtils.getDateTime());
gpfk.setWlid(curFkVo.getWlid()); gpfk.setWlid(curFkVo.getWlid());
gpfk.setYwrq(DateUtils.getDate()); gpfk.setYwrq(DateUtils.getDate());
gpfk.setHgbz("Y"); gpfk.setHgbz(HGBZ);
gpfk.setFklx(GpfkFklxEnum.WO.getId()); gpfk.setFklx(GpfkFklxEnum.WO.getId());
gpfk.setHgsl(1.0); gpfk.setHgsl(1.0d);
gpfk.setBhgsl(0.0); gpfk.setFksl(1.0d);
gpfk.setHgdj(GpfkHgEnum.JYHG.getId()); gpfk.setBhgsl(0.0d);
gpfk.setBzgxid(fkCondition.getBzgxid());
insert(gpfk); insert(gpfk);
}
else {
Gpfk gpfk = new Gpfk();
EntityDataFactory.copyEntity(gpfkVo, gpfk);
gpfk.setHgbz("Y");
gpfk.setHgsl(1.0);
gpfk.setBhgsl(0.0);
gpfk.setFkrid(UserInfoUtil.getId());
gpfk.setFkr(UserInfoUtil.getUserName());
gpfk.setFksj(DateUtils.getDateTime());
gpfk.setHgdj(GpfkHgEnum.JYHG.getId());
update(gpfk);
}
FkVO newFkVo =gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid()); FkVO newFkVo =gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
newFkVo.setSntype(snType); newFkVo.setSntype(snType);
Wogylx wogylx = (Wogylx) GavelSql.selectEntityByKey(Wogylx.class, newFkVo.getWogylxid()); addOrUpdateGpfkjg(newFkVo.getWlid(), fkCondition.getBzgxid(), newFkVo.getFkgx(), fkCondition.getWosncode(), HGBZ);
if(wogylx!=null&&StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
if(StringUtils.isNotEmpty(newFkVo.getHgbz())&&newFkVo.getHgbz().equals("N")) {
updatePcjh(wogylx.getWoid(),wogylx.getGxlx(),false);
}
else {
updatePcjh(wogylx.getWoid(),wogylx.getGxlx(),true);
}
}
return newFkVo; return newFkVo;
} }
else if(snType.equals(SmCodeEnum.NGBZ.getId())) { else if(snType.equals(SmCodeEnum.NGBZ.getId())) {
if(StringUtils.isEmpty(fkCondition.getWosncode())) { if(StringUtils.isEmpty(fkCondition.getWosncode())) {
throwReturnMessage("该订单序列号未输入,请重新确认!"); throwReturnMessage("该订单序列号未输入,请重新确认!");
} }
FkVO gpfkVo = gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
if(gpfkVo==null) {
Gpfk gpfk = new Gpfk(); Gpfk gpfk = new Gpfk();
FkVO curFkVo =gpfkDao.queryKwellWoBySnidUptoDate(fkCondition.getWosncode(), fkCondition.getBzgxid()); FkVO curFkVo =gpfkDao.queryKwellWoBySnidUptoDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
gpfk.setWosnid(curFkVo.getWosnCode()); gpfk.setWosnid(curFkVo.getWosnCode());
...@@ -1687,38 +1758,20 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -1687,38 +1758,20 @@ 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.setHgbz("N"); gpfk.setHgbz(BHGBZ);
gpfk.setFklx(GpfkFklxEnum.WO.getId()); gpfk.setFklx(GpfkFklxEnum.WO.getId());
gpfk.setYwrq(DateUtils.getDate()); gpfk.setYwrq(DateUtils.getDate());
gpfk.setHgsl(0.0); gpfk.setHgsl(0.0);
gpfk.setBhgsl(1.0); gpfk.setBhgsl(1.0);
gpfk.setHgdj(GpfkHgEnum.JYBHG.getId()); gpfk.setBzgxid(fkCondition.getBzgxid());
insert(gpfk); insert(gpfk);
} FkVO newFkVo =gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
else {
Gpfk gpfk = new Gpfk();
EntityDataFactory.copyEntity(gpfkVo, gpfk);
gpfk.setHgbz("N");
gpfk.setHgsl(0.0);
gpfk.setBhgsl(1.0);
gpfk.setFkrid(UserInfoUtil.getId());
gpfk.setFkr(UserInfoUtil.getUserName());
gpfk.setFksj(DateUtils.getDateTime());
gpfk.setHgdj(GpfkHgEnum.JYBHG.getId());
update(gpfk);
}
FkVO newFkVo =gpfkDao.queryKwellGpfkByWosnAndGxid(fkCondition);
newFkVo.setSntype(snType); newFkVo.setSntype(snType);
Wogylx wogylx = (Wogylx) GavelSql.selectEntityByKey(Wogylx.class, newFkVo.getWogylxid()); addOrUpdateGpfkjg(newFkVo.getWlid(), fkCondition.getBzgxid(), newFkVo.getFkgx(), fkCondition.getWosncode(), BHGBZ);
if(wogylx!=null&&StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) { return newFkVo;
if(StringUtils.isNotEmpty(newFkVo.getHgbz())&&newFkVo.getHgbz().equals("N")) {
cancelPcjh(wogylx.getWoid(),wogylx.getGxlx(),false);
} }
else { else {
cancelPcjh(wogylx.getWoid(),wogylx.getGxlx(),true); throwReturnMessage("序列号类型错误,请重新确认!");
}
}
return newFkVo;
} }
return null; return null;
} }
...@@ -1747,11 +1800,11 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -1747,11 +1800,11 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
GpfkCondition gpfkCondition = new GpfkCondition(); GpfkCondition gpfkCondition = new GpfkCondition();
gpfkCondition.setWosnid(fkCondition.getSncode()); gpfkCondition.setWosnid(fkCondition.getSncode());
gpfkCondition.setBzgxid(fkCondition.getBzgxid()); gpfkCondition.setBzgxid(fkCondition.getBzgxid());
FkVO curFkVo = gpfkDao.queryKwellWoBySnidUptoDate(fkCondition.getSncode(), fkCondition.getBzgxid()); FkVO curFkVo = gpfkDao.queryKwellWxWoBySnidUptoDate(fkCondition.getSncode());
checkLastBzgxIfComplete(curFkVo); checkLastBzgxIfComplete(curFkVo);
checkNextBzgxIfExistFk(curFkVo); checkNextBzgxIfExistFk(curFkVo);
if(StringUtils.isNotEmpty(curFkVo.getId())) { if(StringUtils.isNotEmpty(curFkVo.getId())) {
curFkVo = gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getSncode(), fkCondition.getBzgxid()); curFkVo = gpfkDao.queryWxWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getSncode(), fkCondition.getBzgxid());
} }
curFkVo.setSntype(snType); curFkVo.setSntype(snType);
return curFkVo; return curFkVo;
...@@ -1760,103 +1813,452 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService ...@@ -1760,103 +1813,452 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
if(StringUtils.isEmpty(fkCondition.getWosncode())) { if(StringUtils.isEmpty(fkCondition.getWosncode())) {
throwReturnMessage("该订单序列号未输入,请重新确认!"); throwReturnMessage("该订单序列号未输入,请重新确认!");
} }
FkVO gpfkVo = gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getSncode(), fkCondition.getBzgxid());
if(gpfkVo==null) {
Gpfk gpfk = new Gpfk(); Gpfk gpfk = new Gpfk();
FkVO curFkVo =gpfkDao.queryKwellWoBySnidUptoDate(fkCondition.getWosncode(), fkCondition.getBzgxid()); FkVO curFkVo =gpfkDao.queryKwellWxWoBySnidUptoDate(fkCondition.getWosncode());
gpfk.setWosnid(curFkVo.getWosnCode()); gpfk.setWosnid(curFkVo.getWosnCode());
gpfk.setWogylx(curFkVo.getWogylxid());
gpfk.setFkgx(curFkVo.getWogylxid());
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.setWlid(curFkVo.getWlid()); gpfk.setWlid(curFkVo.getWlid());
gpfk.setYwrq(DateUtils.getDate()); gpfk.setYwrq(DateUtils.getDate());
gpfk.setHgbz("Y"); gpfk.setHgbz(HGBZ);
gpfk.setFklx(GpfkFklxEnum.WO.getId()); gpfk.setFklx(GpfkFklxEnum.WO.getId());
gpfk.setHgsl(1.0); gpfk.setHgsl(1.0);
gpfk.setBhgsl(0.0); gpfk.setBhgsl(0.0);
gpfk.setBzgxid(fkCondition.getBzgxid());
insert(gpfk); insert(gpfk);
} FkVO newFkVo =gpfkDao.queryWxWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
else { addOrUpdateGpfkjg(curFkVo.getWlid(), fkCondition.getBzgxid(), null, curFkVo.getWosnCode(), HGBZ);
Gpfk gpfk = new Gpfk();
EntityDataFactory.copyEntity(gpfkVo, gpfk);
gpfk.setHgbz("Y");
gpfk.setHgsl(1.0);
gpfk.setBhgsl(0.0);
gpfk.setFkrid(UserInfoUtil.getId());
gpfk.setFkr(UserInfoUtil.getUserName());
gpfk.setFksj(DateUtils.getDateTime());
update(gpfk);
}
GpfkVO jygpfkVo =gpfkDao.queryJyGpfkByWosnUptoDate(fkCondition.getWosncode());
if(jygpfkVo!=null) {
Gpfk jygpfk = new Gpfk();
EntityDataFactory.copyEntity(jygpfkVo, jygpfk);
jygpfk.setHgdj(GpfkHgEnum.WXHG.getId());
update(jygpfk);
}
FkVO newFkVo =gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getSncode(), fkCondition.getBzgxid());
newFkVo.setSntype(snType); newFkVo.setSntype(snType);
Wogylx wogylx = (Wogylx) GavelSql.selectEntityByKey(Wogylx.class, newFkVo.getWogylxid());
if(wogylx!=null&&StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
if(StringUtils.isNotEmpty(newFkVo.getHgbz())&&newFkVo.getHgbz().equals("N")) {
updatePcjh(wogylx.getWoid(),wogylx.getGxlx(),false);
}
else {
updatePcjh(wogylx.getWoid(),wogylx.getGxlx(),true);
}
}
return newFkVo; return newFkVo;
} }
else if(snType.equals(SmCodeEnum.NGBZ.getId())) { else if(snType.equals(SmCodeEnum.NGBZ.getId())) {
if(StringUtils.isEmpty(fkCondition.getWosncode())) { if(StringUtils.isEmpty(fkCondition.getWosncode())) {
throwReturnMessage("该订单序列号未输入,请重新确认!"); throwReturnMessage("该订单序列号未输入,请重新确认!");
} }
FkVO gpfkVo = gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getSncode(), fkCondition.getBzgxid());
if(gpfkVo==null) {
Gpfk gpfk = new Gpfk(); Gpfk gpfk = new Gpfk();
FkVO curFkVo =gpfkDao.queryKwellWoBySnidUptoDate(fkCondition.getWosncode(), fkCondition.getBzgxid()); FkVO curFkVo =gpfkDao.queryKwellWxWoBySnidUptoDate(fkCondition.getWosncode());
gpfk.setWosnid(curFkVo.getWosnCode()); gpfk.setWosnid(curFkVo.getWosnCode());
gpfk.setWogylx(curFkVo.getWogylxid());
gpfk.setFkgx(curFkVo.getWogylxid());
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.setWlid(curFkVo.getWlid()); gpfk.setWlid(curFkVo.getWlid());
gpfk.setHgbz("N");
gpfk.setFklx(GpfkFklxEnum.WO.getId());
gpfk.setYwrq(DateUtils.getDate()); gpfk.setYwrq(DateUtils.getDate());
gpfk.setHgsl(0.0); gpfk.setHgbz(BHGBZ);
gpfk.setBhgsl(1.0); gpfk.setFklx(GpfkFklxEnum.WO.getId());
gpfk.setHgsl(1.0);
gpfk.setBhgsl(0.0);
gpfk.setBzgxid(fkCondition.getBzgxid());
insert(gpfk); insert(gpfk);
} FkVO newFkVo =gpfkDao.queryWxWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
else { addOrUpdateGpfkjg(curFkVo.getWlid(), fkCondition.getBzgxid(), null, curFkVo.getWosnCode(), BHGBZ);
Gpfk gpfk = new Gpfk();
EntityDataFactory.copyEntity(gpfkVo, gpfk);
gpfk.setHgbz("N");
gpfk.setHgsl(0.0);
gpfk.setBhgsl(1.0);
gpfk.setFkrid(UserInfoUtil.getId());
gpfk.setFkr(UserInfoUtil.getUserName());
gpfk.setFksj(DateUtils.getDateTime());
update(gpfk);
}
FkVO newFkVo =gpfkDao.queryKwellGpfkByWosnAndGxid(fkCondition);
newFkVo.setSntype(snType); newFkVo.setSntype(snType);
Wogylx wogylx = (Wogylx) GavelSql.selectEntityByKey(Wogylx.class, newFkVo.getWogylxid()); return newFkVo;
if(wogylx!=null&&StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
if(StringUtils.isNotEmpty(newFkVo.getHgbz())&&newFkVo.getHgbz().equals("N")) {
cancelPcjh(wogylx.getWoid(),wogylx.getGxlx(),false);
} }
else { else {
cancelPcjh(wogylx.getWoid(),wogylx.getGxlx(),true); throwReturnMessage("序列号类型错误,请重新确认!");
}
}
return newFkVo;
} }
return null; return null;
} }
// @Override
// public FkVO zpfkUpgrade(FkCondition fkCondition) {
// /*
// * 基础判断 1.条码是否为空 2.前端是否传入标准工序 3.条码是否为已知类型条码
// */
// if(StringUtils.isEmpty(fkCondition.getSncode())) {
// throwReturnMessage("未扫描到条码,请重新确认!");
// }
// if(StringUtils.isEmpty(fkCondition.getBzgxid())) {
// throwReturnMessage("扫描工序出错,请重新确认!");
// }
// String snType = checkSnType(fkCondition.getSncode());
// if(StringUtils.isEmpty(snType)) {
// throwReturnMessage("该条码为未知条码,请重新确认!");
// }
// FkVO fkVO = null;
// if(snType.equals(SmCodeEnum.LOGOUT.getId())) {
// fkVO = new FkVO();
// fkVO.setSntype(snType);
// }
// else if(snType.equals(SmCodeEnum.WOSNID.getId())) {
// GpfkCondition gpfkCondition = new GpfkCondition();
// gpfkCondition.setWosnid(fkCondition.getSncode());
// gpfkCondition.setBzgxid(fkCondition.getBzgxid());
// FkVO curFkVo = gpfkDao.queryKwellWoBySnidUptoDate(fkCondition.getSncode(), fkCondition.getBzgxid());
// checkLastBzgxIfComplete(curFkVo);
// checkNextBzgxIfExistFk(curFkVo);
// if(StringUtils.isNotEmpty(curFkVo.getId())) {
// curFkVo = gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getSncode(), fkCondition.getBzgxid());
// if(checkIfZpCompleteByWosnAndBzgx(fkCondition.getSncode(), fkCondition.getBzgxid())) {
// curFkVo.setZpbz(SmCodeEnum.OKBZ.getPrefix());
// }
// }
// curFkVo.setSntype(snType);
// return curFkVo;
// }
// else if(snType.equals(SmCodeEnum.WLID.getId())) {
// String wlid = coderuleService.matchCodeByRule(fkCondition.getSncode());
// fkCondition.setWlid(wlid);
// if(gpfkDao.checkIfContainsWobomWl(fkCondition)<=0) {
// throwReturnMessage("该订单下不存在该发放工序物料,请重新确认!");
// }
// if(StringUtils.isEmpty(fkCondition.getWosncode())) {
// throwReturnMessage("该订单序列号未输入,请重新确认!");
// }
// FkVO curFkVo =gpfkDao.queryKwellWoBySnidUptoDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
// if(curFkVo==null) {
// throwReturnMessage("该订单不存在对应工序,请重新确认!");
// }
// FkVO gpfkVo =null;
// if(checkIsCurrentGx(curFkVo)) {
// /* 本工序为当前工序*/
// gpfkVo = gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
// Gpfk gpfk = new Gpfk();
// EntityDataFactory.copyEntity(gpfkVo, gpfk);
// gpfk.setFkgx(curFkVo.getWogylxid());
// gpfk.setFkrid(UserInfoUtil.getId());
// gpfk.setFkr(UserInfoUtil.getUserName());
// gpfk.setFksj(DateUtils.getDateTime());
// update(gpfk);
// gpfkVo = gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
// }
// else {
// /* 本工序不为最新工序 存在情况为该订单序列号去维修 */
// Gpfk gpfk = new Gpfk();
// gpfk.setWosnid(curFkVo.getWosnCode());
// gpfk.setWogylx(curFkVo.getWogylxid());
// gpfk.setFkgx(curFkVo.getWogylxid());
// gpfk.setFkrid(UserInfoUtil.getId());
// gpfk.setFkr(UserInfoUtil.getUserName());
// gpfk.setFksj(DateUtils.getDateTime());
// gpfk.setWlid(wlid);
// gpfk.setYwrq(DateUtils.getDate());
// gpfk.setFklx(GpfkFklxEnum.WO.getId());
// insert(gpfk);
// gpfkVo = gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
// }
// GphyCondition hyCondition =new GphyCondition();
// hyCondition.setBzgxid(fkCondition.getBzgxid());
// hyCondition.setWosncode(fkCondition.getWosncode());
// hyCondition.setSnid(fkCondition.getSncode());
// hyCondition.setWlid(wlid);
// if( gpfkDao.checkIfContainsGphywl(hyCondition)>0) {
// throwReturnMessage("该序列号已经被扫描");
// }
// compareIsZpComplete(hyCondition);
// Gphy gphy = new Gphy();
// gphy.setFkgx(gpfkVo.getFkgx());
// gphy.setWlid(wlid);
// gphy.setMid(gpfkVo.getId());
// gphy.setWlsnid(fkCondition.getSncode());
// gphy.setFkrid(UserInfoUtil.getId());
// gphy.setFkr(UserInfoUtil.getUserName());
// gphy.setFksj(DateUtils.getDateTime());
// gphy.setZpsl(1.0);
// gphy.setHylx("BOM");
// gphyService.insert(gphy);
// if(checkIfZpCompleteByWosnAndBzgx(fkCondition.getSncode(), fkCondition.getBzgxid())) {
// curFkVo.setZpbz(SmCodeEnum.OKBZ.getPrefix());
// Wogylx wogylx = (Wogylx) GavelSql.selectEntityByKey(Wogylx.class, gpfkVo.getWogylx());
// if(wogylx!=null&&StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
// Gpfk gpfk = new Gpfk();
// EntityDataFactory.copyEntity(gpfkVo, gpfk);
// gpfk.setFksl(1.0);
// update(gpfk);
// if(StringUtils.isNotEmpty(gpfkVo.getHgbz())&&gpfkVo.getHgbz().equals("N")) {
// updatePcjh(wogylx.getWoid(),wogylx.getGxlx(),false);
// }
// else {
// updatePcjh(wogylx.getWoid(),wogylx.getGxlx(),true);
// }
// }
// }
// gpfkVo.setSntype(SmCodeEnum.WLID.getId());
// Wlxx cuwlxx = gpfkDao.queryById(Wlxx.class, wlid);
// gpfkVo.setCurwlsncode(cuwlxx.getCode());
// gpfkVo.setCurwlsnname(cuwlxx.getName());
// return gpfkVo;
// }
// else {
// throwReturnMessage("序列号类型错误,请重新确认!");
// }
// return null;
// }
// @Override
// public FkVO jyfkUpgrade(FkCondition fkCondition) {
// /*
// * 基础判断 1.条码是否为空 2.前端是否传入标准工序 3.条码是否为已知类型条码
// */
// if(StringUtils.isEmpty(fkCondition.getSncode())) {
// throwReturnMessage("未扫描到条码,请重新确认!");
// }
// if(StringUtils.isEmpty(fkCondition.getBzgxid())) {
// throwReturnMessage("扫描工序出错,请重新确认!");
// }
// String snType = checkSnType(fkCondition.getSncode());
// if(StringUtils.isEmpty(snType)) {
// throwReturnMessage("该条码为未知条码,请重新确认!");
// }
// FkVO fkVO = null;
// if(snType.equals(SmCodeEnum.LOGOUT.getId())) {
// fkVO = new FkVO();
// fkVO.setSntype(snType);
// }
// else if(snType.equals(SmCodeEnum.WOSNID.getId())) {
// GpfkCondition gpfkCondition = new GpfkCondition();
// gpfkCondition.setWosnid(fkCondition.getSncode());
// gpfkCondition.setBzgxid(fkCondition.getBzgxid());
// FkVO curFkVo = gpfkDao.queryKwellWoBySnidUptoDate(fkCondition.getSncode(), fkCondition.getBzgxid());
// checkLastBzgxIfComplete(curFkVo);
// checkNextBzgxIfExistFk(curFkVo);
// if(StringUtils.isNotEmpty(curFkVo.getId())) {
// curFkVo = gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getSncode(), fkCondition.getBzgxid());
// }
// curFkVo.setSntype(snType);
// return curFkVo;
// }
// else if(snType.equals(SmCodeEnum.OKBZ.getId())) {
// if(StringUtils.isEmpty(fkCondition.getWosncode())) {
// throwReturnMessage("该订单序列号未输入,请重新确认!");
// }
// FkVO gpfkVo = gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
// if(gpfkVo==null) {
// Gpfk gpfk = new Gpfk();
// FkVO curFkVo =gpfkDao.queryKwellWoBySnidUptoDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
// gpfk.setWosnid(curFkVo.getWosnCode());
// gpfk.setWogylx(curFkVo.getWogylxid());
// gpfk.setFkgx(curFkVo.getWogylxid());
// gpfk.setFkrid(UserInfoUtil.getId());
// gpfk.setFkr(UserInfoUtil.getUserName());
// gpfk.setFksj(DateUtils.getDateTime());
// gpfk.setWlid(curFkVo.getWlid());
// gpfk.setYwrq(DateUtils.getDate());
// gpfk.setHgbz("Y");
// gpfk.setFklx(GpfkFklxEnum.WO.getId());
// gpfk.setHgsl(1.0);
// gpfk.setBhgsl(0.0);
// gpfk.setHgdj(GpfkHgEnum.JYHG.getId());
// insert(gpfk);
// }
// else {
// Gpfk gpfk = new Gpfk();
// EntityDataFactory.copyEntity(gpfkVo, gpfk);
// gpfk.setHgbz("Y");
// gpfk.setHgsl(1.0);
// gpfk.setBhgsl(0.0);
// gpfk.setFkrid(UserInfoUtil.getId());
// gpfk.setFkr(UserInfoUtil.getUserName());
// gpfk.setFksj(DateUtils.getDateTime());
// gpfk.setHgdj(GpfkHgEnum.JYHG.getId());
// update(gpfk);
// }
// FkVO newFkVo =gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
// newFkVo.setSntype(snType);
// Wogylx wogylx = (Wogylx) GavelSql.selectEntityByKey(Wogylx.class, newFkVo.getWogylxid());
// if(wogylx!=null&&StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
// Gpfk gpfk = new Gpfk();
// EntityDataFactory.copyEntity(gpfkVo, gpfk);
// gpfk.setFksl(1.0);
// update(gpfk);
// if(StringUtils.isNotEmpty(newFkVo.getHgbz())&&newFkVo.getHgbz().equals("N")) {
// updatePcjh(wogylx.getWoid(),wogylx.getGxlx(),false);
// }
// else {
// updatePcjh(wogylx.getWoid(),wogylx.getGxlx(),true);
// }
// }
// return newFkVo;
// }
// else if(snType.equals(SmCodeEnum.NGBZ.getId())) {
// if(StringUtils.isEmpty(fkCondition.getWosncode())) {
// throwReturnMessage("该订单序列号未输入,请重新确认!");
// }
// FkVO gpfkVo = gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
// if(gpfkVo==null) {
// Gpfk gpfk = new Gpfk();
// FkVO curFkVo =gpfkDao.queryKwellWoBySnidUptoDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
// gpfk.setWosnid(curFkVo.getWosnCode());
// gpfk.setWogylx(curFkVo.getWogylxid());
// gpfk.setFkgx(curFkVo.getWogylxid());
// gpfk.setFkrid(UserInfoUtil.getId());
// gpfk.setFkr(UserInfoUtil.getUserName());
// gpfk.setFksj(DateUtils.getDateTime());
// gpfk.setWlid(curFkVo.getWlid());
// gpfk.setHgbz("N");
// gpfk.setFklx(GpfkFklxEnum.WO.getId());
// gpfk.setYwrq(DateUtils.getDate());
// gpfk.setHgsl(0.0);
// gpfk.setBhgsl(1.0);
// gpfk.setHgdj(GpfkHgEnum.JYBHG.getId());
// insert(gpfk);
// }
// else {
// Gpfk gpfk = new Gpfk();
// EntityDataFactory.copyEntity(gpfkVo, gpfk);
// gpfk.setHgbz("N");
// gpfk.setHgsl(0.0);
// gpfk.setBhgsl(1.0);
// gpfk.setFkrid(UserInfoUtil.getId());
// gpfk.setFkr(UserInfoUtil.getUserName());
// gpfk.setFksj(DateUtils.getDateTime());
// gpfk.setHgdj(GpfkHgEnum.JYBHG.getId());
// update(gpfk);
// }
// FkVO newFkVo =gpfkDao.queryKwellGpfkByWosnAndGxid(fkCondition);
// newFkVo.setSntype(snType);
// Wogylx wogylx = (Wogylx) GavelSql.selectEntityByKey(Wogylx.class, newFkVo.getWogylxid());
// if(wogylx!=null&&StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
// Gpfk gpfk = new Gpfk();
// EntityDataFactory.copyEntity(gpfkVo, gpfk);
// gpfk.setFksl(1.0);
// update(gpfk);
// if(StringUtils.isNotEmpty(newFkVo.getHgbz())&&newFkVo.getHgbz().equals("N")) {
// cancelPcjh(wogylx.getWoid(),wogylx.getGxlx(),false);
// }
// else {
// cancelPcjh(wogylx.getWoid(),wogylx.getGxlx(),true);
// }
// }
// return newFkVo;
// }
// return null;
// }
// @Override
// public FkVO wxfkUpgrade(FkCondition fkCondition) {
// /*
// * 基础判断 1.条码是否为空 2.前端是否传入标准工序 3.条码是否为已知类型条码
// */
// if(StringUtils.isEmpty(fkCondition.getSncode())) {
// throwReturnMessage("未扫描到条码,请重新确认!");
// }
// if(StringUtils.isEmpty(fkCondition.getBzgxid())) {
// throwReturnMessage("扫描工序出错,请重新确认!");
// }
// String snType = checkSnType(fkCondition.getSncode());
// if(StringUtils.isEmpty(snType)) {
// throwReturnMessage("该条码为未知条码,请重新确认!");
// }
// FkVO fkVO = null;
// if(snType.equals(SmCodeEnum.LOGOUT.getId())) {
// fkVO = new FkVO();
// fkVO.setSntype(snType);
// }
// else if(snType.equals(SmCodeEnum.WOSNID.getId())) {
// 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.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getSncode(), fkCondition.getBzgxid());
// }
// curFkVo.setSntype(snType);
// return curFkVo;
// }
// else if(snType.equals(SmCodeEnum.OKBZ.getId())) {
// if(StringUtils.isEmpty(fkCondition.getWosncode())) {
// throwReturnMessage("该订单序列号未输入,请重新确认!");
// }
// FkVO gpfkVo = gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getSncode(), fkCondition.getBzgxid());
// if(gpfkVo==null) {
// Gpfk gpfk = new Gpfk();
// FkVO curFkVo =gpfkDao.queryKwellWoBySnidUptoDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
// gpfk.setWosnid(curFkVo.getWosnCode());
// gpfk.setWogylx(curFkVo.getWogylxid());
// gpfk.setFkgx(curFkVo.getWogylxid());
// gpfk.setFkrid(UserInfoUtil.getId());
// gpfk.setFkr(UserInfoUtil.getUserName());
// gpfk.setFksj(DateUtils.getDateTime());
// gpfk.setWlid(curFkVo.getWlid());
// gpfk.setYwrq(DateUtils.getDate());
// gpfk.setHgbz("Y");
// gpfk.setFklx(GpfkFklxEnum.WO.getId());
// gpfk.setHgsl(1.0);
// gpfk.setBhgsl(0.0);
// insert(gpfk);
// }
// else {
// Gpfk gpfk = new Gpfk();
// EntityDataFactory.copyEntity(gpfkVo, gpfk);
// gpfk.setHgbz("Y");
// gpfk.setHgsl(1.0);
// gpfk.setBhgsl(0.0);
// gpfk.setFkrid(UserInfoUtil.getId());
// gpfk.setFkr(UserInfoUtil.getUserName());
// gpfk.setFksj(DateUtils.getDateTime());
// update(gpfk);
// }
// GpfkVO jygpfkVo =gpfkDao.queryJyGpfkByWosnUptoDate(fkCondition.getWosncode());
// if(jygpfkVo!=null) {
// Gpfk jygpfk = new Gpfk();
// EntityDataFactory.copyEntity(jygpfkVo, jygpfk);
// jygpfk.setHgdj(GpfkHgEnum.WXHG.getId());
// update(jygpfk);
// }
// FkVO newFkVo =gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getSncode(), fkCondition.getBzgxid());
// newFkVo.setSntype(snType);
// Wogylx wogylx = (Wogylx) GavelSql.selectEntityByKey(Wogylx.class, newFkVo.getWogylxid());
// if(wogylx!=null&&StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
// if(StringUtils.isNotEmpty(newFkVo.getHgbz())&&newFkVo.getHgbz().equals("N")) {
// updatePcjh(wogylx.getWoid(),wogylx.getGxlx(),false);
// }
// else {
// updatePcjh(wogylx.getWoid(),wogylx.getGxlx(),true);
// }
// }
// return newFkVo;
// }
// else if(snType.equals(SmCodeEnum.NGBZ.getId())) {
// if(StringUtils.isEmpty(fkCondition.getWosncode())) {
// throwReturnMessage("该订单序列号未输入,请重新确认!");
// }
// FkVO gpfkVo = gpfkDao.queryWowithIfExistGpfkByWosnAndBzgxidInNewDate(fkCondition.getSncode(), fkCondition.getBzgxid());
// if(gpfkVo==null) {
// Gpfk gpfk = new Gpfk();
// FkVO curFkVo =gpfkDao.queryKwellWoBySnidUptoDate(fkCondition.getWosncode(), fkCondition.getBzgxid());
// gpfk.setWosnid(curFkVo.getWosnCode());
// gpfk.setWogylx(curFkVo.getWogylxid());
// gpfk.setFkgx(curFkVo.getWogylxid());
// gpfk.setFkrid(UserInfoUtil.getId());
// gpfk.setFkr(UserInfoUtil.getUserName());
// gpfk.setFksj(DateUtils.getDateTime());
// gpfk.setWlid(curFkVo.getWlid());
// gpfk.setHgbz("N");
// gpfk.setFklx(GpfkFklxEnum.WO.getId());
// gpfk.setYwrq(DateUtils.getDate());
// gpfk.setHgsl(0.0);
// gpfk.setBhgsl(1.0);
// insert(gpfk);
// }
// else {
// Gpfk gpfk = new Gpfk();
// EntityDataFactory.copyEntity(gpfkVo, gpfk);
// gpfk.setHgbz("N");
// gpfk.setHgsl(0.0);
// gpfk.setBhgsl(1.0);
// gpfk.setFkrid(UserInfoUtil.getId());
// gpfk.setFkr(UserInfoUtil.getUserName());
// gpfk.setFksj(DateUtils.getDateTime());
// update(gpfk);
// }
// FkVO newFkVo =gpfkDao.queryKwellGpfkByWosnAndGxid(fkCondition);
// newFkVo.setSntype(snType);
//// Wogylx wogylx = (Wogylx) GavelSql.selectEntityByKey(Wogylx.class, newFkVo.getWogylxid());
//// if(wogylx!=null&&StringUtils.isNotEmpty(wogylx.getGxbz())&&(wogylx.getGxbz().equals("D")||wogylx.getGxbz().equals("M"))) {
//// if(StringUtils.isNotEmpty(newFkVo.getHgbz())&&newFkVo.getHgbz().equals("N")) {
//// cancelPcjh(wogylx.getWoid(),wogylx.getGxlx(),false);
//// }
//// else {
//// cancelPcjh(wogylx.getWoid(),wogylx.getGxlx(),true);
//// }
//// }
// return newFkVo;
// }
// return null;
// }
/************ -------------------科威尔反馈升级--END--------- ******/ /************ -------------------科威尔反馈升级--END--------- ******/
} }
package com.gavel.kwell.service.impl;
import com.gavel.common.base.service.impl.BaseEditServiceImpl;
import com.gavel.persistence.sql.RecordSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.gavel.kwell.dao.GpfkjgDao;
import com.gavel.kwell.persistent.Gpfkjg;
import com.gavel.kwell.service.GpfkjgService;
import com.gavel.kwell.vo.GpfkjgCondition;
import com.gavel.kwell.vo.GpfkjgVO;
@Service("gpfkjgService")
@Transactional
public class GpfkjgServiceImpl extends BaseEditServiceImpl implements GpfkjgService {
@Autowired
private GpfkjgDao gpfkjgDao;
@Override
public void initService() {
addMaster(Gpfkjg.class);
}
@Override
public RecordSet<GpfkjgVO> query(GpfkjgCondition condition) {
return gpfkjgDao.query(condition);
}
@Override
public Gpfkjg queryEntityByCondition(GpfkjgCondition condition) {
// TODO Auto-generated method stub
return gpfkjgDao.queryEntityByCondition(condition);
}
@Override
public int queryIfContainsmdfkgx(GpfkjgCondition condition) {
// TODO Auto-generated method stub
return gpfkjgDao.queryIfContainsmdfkgx(condition);
}
@Override
public void deleteByCondition(GpfkjgCondition condition) {
// TODO Auto-generated method stub
gpfkjgDao.deleteByCondition(condition);
}
}
...@@ -91,7 +91,8 @@ public class FkVO extends BaseEntity { ...@@ -91,7 +91,8 @@ public class FkVO extends BaseEntity {
@FieldMeta(fieldName = "GPFK_HGDJ", caption = "合格等级") @FieldMeta(fieldName = "GPFK_HGDJ", caption = "合格等级")
private String hgdj; private String hgdj;
@FieldMeta(fieldName = "U_GPFK_BZGXID", caption = "标准工序")
private String wxbzgx;
@FieldMeta(fieldName = "WLXX_ID", caption = "物料编码") @FieldMeta(fieldName = "WLXX_ID", caption = "物料编码")
private String wlid; private String wlid;
@FieldMeta(fieldName = "BX_CODE", caption = "班型编码") @FieldMeta(fieldName = "BX_CODE", caption = "班型编码")
...@@ -616,6 +617,14 @@ public class FkVO extends BaseEntity { ...@@ -616,6 +617,14 @@ public class FkVO extends BaseEntity {
return qths; return qths;
} }
public String getWxbzgx() {
return wxbzgx;
}
public void setWxbzgx(String wxbzgx) {
this.wxbzgx = wxbzgx;
}
public void setQths(Double qths) { public void setQths(Double qths) {
this.qths = qths; this.qths = qths;
} }
......
package com.gavel.kwell.vo;
import com.gavel.common.base.entity.BaseEntity;
public class GpfkjgCondition extends BaseEntity {
private static final long serialVersionUID = 1L;
private String id;
private String wlid;
private String bzgxid;
private String wosncode;
public String getWlid() {
return wlid;
}
public void setWlid(String wlid) {
this.wlid = wlid;
}
public String getBzgxid() {
return bzgxid;
}
public void setBzgxid(String bzgxid) {
this.bzgxid = bzgxid;
}
public String getWosncode() {
return wosncode;
}
public void setWosncode(String wosncode) {
this.wosncode = wosncode;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
package com.gavel.kwell.vo;
import com.gavel.kwell.persistent.Gpfkjg;
public class GpfkjgVO extends Gpfkjg {
private static final long serialVersionUID = 1L;
/*---------AutoBegin-----------*/
/*---------AutoEnd-------------*/
}
...@@ -2,7 +2,9 @@ package com.gavel.kwell.vo; ...@@ -2,7 +2,9 @@ package com.gavel.kwell.vo;
import java.io.Serializable; import java.io.Serializable;
public class WlslItem implements Serializable { import com.gavel.common.base.entity.BaseEntity;
public class WlslItem extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String wlid; private String wlid;
private String wosncode; private String wosncode;
......
# erp测试环境 # erp测试环境
jdbc.driverClassName=com.mysql.cj.jdbc.Driver jdbc.driverClassName=com.mysql.cj.jdbc.Driver
jdbc.url = jdbc:mysql://192.168.30.254:3306/kewll2?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai jdbc.url = jdbc:mysql://192.168.30.254:3306/kwell?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
jdbc.username = root jdbc.username = root
jdbc.password = root jdbc.password = root
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