Commit e07c7bc4 authored by yff's avatar yff

整合代码修改BUG

parent b50bba41
...@@ -28,9 +28,10 @@ import com.gavel.common.utils.DateUtils; ...@@ -28,9 +28,10 @@ import com.gavel.common.utils.DateUtils;
import com.gavel.common.utils.StringUtils; import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext; import com.gavel.common.utils.ThreadContext;
import com.gavel.gygl.vo.BzgxVO; import com.gavel.gygl.vo.BzgxVO;
import com.gavel.kwell.persistent.Gpfk;
import com.gavel.kwell.service.GpfkService; import com.gavel.kwell.service.GpfkService;
import com.gavel.kwell.utils.SmCodeModel; import com.gavel.kwell.utils.SmCodeModel;
import com.gavel.kwell.vo.FkCondition;
import com.gavel.kwell.vo.FkVO;
import com.gavel.kwell.vo.GpResVO; import com.gavel.kwell.vo.GpResVO;
import com.gavel.kwell.vo.GpbhgfkCondition; import com.gavel.kwell.vo.GpbhgfkCondition;
import com.gavel.kwell.vo.GpbhgmxVO; import com.gavel.kwell.vo.GpbhgmxVO;
...@@ -266,24 +267,6 @@ public class GpfkController extends BaseController { ...@@ -266,24 +267,6 @@ public class GpfkController extends BaseController {
} }
} }
@ApiOperation(value = "扫描生产主产品条码,{\"wosnid\":111}传入条码,返回任务单信息")
@RequestMapping(value = "/queryKwellWoinfo", method = RequestMethod.POST)
@ResponseBody
public Object getKwellSninfo(@RequestBody JSONObject param) {
String wosnid = param.getString("wosnid");
String bzlx = param.getString("bzlx");
if(StringUtils.isEmpty(wosnid)){
setReturnMessage("条码不允许为空!");
return returnData();
}
GpfkVO gpfk = gpfkService.queryKwellWosnWithAddGpfk(wosnid, bzlx);
if(gpfk != null){
return buildReturnData(gpfk);
}else{
return ThreadContext.getReturnData();
}
}
@ApiOperation(value = "扫码得到wobom,{\"woid\":111}传入条码,返回任务单信息") @ApiOperation(value = "扫码得到wobom,{\"woid\":111}传入条码,返回任务单信息")
@RequestMapping(value = "/queryWoBomByWoid", method = RequestMethod.POST) @RequestMapping(value = "/queryWoBomByWoid", method = RequestMethod.POST)
@ResponseBody @ResponseBody
...@@ -313,18 +296,22 @@ public class GpfkController extends BaseController { ...@@ -313,18 +296,22 @@ public class GpfkController extends BaseController {
} }
} }
@RequestMapping(value = "/zpwl", method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
FkCondition condition = JSONObject.toJavaObject(param, FkCondition.class);
FkVO gpfk = gpfkService.zpfk(condition);
if(gpfk!=null) {
return buildReturnData(gpfk);
}
return ThreadContext.getReturnData();
}
@RequestMapping(value = "/jyfk", method = RequestMethod.POST) @RequestMapping(value = "/jyfk", method = RequestMethod.POST)
@ResponseBody @ResponseBody
public Object jyfk(@RequestBody JSONObject param) { public Object jyfk(@RequestBody JSONObject param) {
String fkid = param.getString("fkid"); FkCondition condition = JSONObject.toJavaObject(param, FkCondition.class);
String hgsn = param.getString("hgsn"); FkVO gpfk =gpfkService.jyfk(condition);
if(StringUtils.isEmpty(fkid)||StringUtils.isEmpty(hgsn)){
setReturnMessage("参数错误");
return returnData();
}
Gpfk gpfk =gpfkService.jyfk(fkid, hgsn);
if(gpfk != null){ if(gpfk != null){
return buildReturnData(gpfk); return buildReturnData(gpfk);
}else{ }else{
...@@ -335,13 +322,8 @@ public class GpfkController extends BaseController { ...@@ -335,13 +322,8 @@ public class GpfkController extends BaseController {
@RequestMapping(value = "/wxfk", method = RequestMethod.POST) @RequestMapping(value = "/wxfk", method = RequestMethod.POST)
@ResponseBody @ResponseBody
public Object wxfk(@RequestBody JSONObject param) { public Object wxfk(@RequestBody JSONObject param) {
String fkid = param.getString("fkid"); FkCondition condition = JSONObject.toJavaObject(param, FkCondition.class);
String hgsn = param.getString("hgsn"); FkVO gpfk =gpfkService.wxfk(condition);
if(StringUtils.isEmpty(fkid)||StringUtils.isEmpty(hgsn)){
setReturnMessage("参数错误");
return returnData();
}
Gpfk gpfk =gpfkService.wxfk(fkid, hgsn);
if(gpfk != null){ if(gpfk != null){
return buildReturnData(gpfk); return buildReturnData(gpfk);
}else{ }else{
......
package com.gavel.kwell.controller; package com.gavel.kwell.controller;
import com.gavel.common.BaseURL; import javax.servlet.http.HttpServletRequest;
import com.gavel.common.base.BaseEditJSON; import javax.servlet.http.HttpServletResponse;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.kwell.persistent.Gpfk;
import com.gavel.kwell.service.GpfkService;
import com.gavel.kwell.vo.GpfkCondition;
import com.gavel.kwell.vo.GpfkVO;
import com.gavel.persistence.sql.RecordSet;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -18,15 +11,19 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -18,15 +11,19 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation; import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions; import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController; import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext; import com.gavel.common.utils.ThreadContext;
import com.gavel.kwell.service.GpfkService;
import com.gavel.kwell.service.GphyService; import com.gavel.kwell.service.GphyService;
import com.gavel.kwell.vo.GphyCondition; import com.gavel.kwell.vo.GpfkCondition;
import com.gavel.kwell.vo.GpfkVO;
import javax.servlet.http.HttpServletRequest; import com.gavel.persistence.sql.RecordSet;
import javax.servlet.http.HttpServletResponse;
@Controller @Controller
...@@ -69,18 +66,6 @@ public class GphyController extends BaseController { ...@@ -69,18 +66,6 @@ public class GphyController extends BaseController {
return "kmes/gphy/gx"; return "kmes/gphy/gx";
} }
@RequestMapping(value = "/zpwl", method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
GphyCondition condition = JSONObject.toJavaObject(param, GphyCondition.class);
Gpfk gpfk = gphyService.zpwl(condition);
if(gpfk!=null) {
return buildReturnData(gpfk);
}
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST) @RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody @ResponseBody
......
...@@ -12,10 +12,13 @@ import com.gavel.kwell.persistent.Gpbhgmx; ...@@ -12,10 +12,13 @@ import com.gavel.kwell.persistent.Gpbhgmx;
import com.gavel.kwell.persistent.Gpfk; import com.gavel.kwell.persistent.Gpfk;
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.vo.FkCondition;
import com.gavel.kwell.vo.FkVO;
import com.gavel.kwell.vo.GpWoCondition; import com.gavel.kwell.vo.GpWoCondition;
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.GphyCondition;
import com.gavel.kwell.vo.GpwxmxVO; import com.gavel.kwell.vo.GpwxmxVO;
import com.gavel.kwell.vo.WolinkInfoVO; import com.gavel.kwell.vo.WolinkInfoVO;
import com.gavel.kwell.vo.WosngzVO; import com.gavel.kwell.vo.WosngzVO;
...@@ -114,13 +117,13 @@ public interface GpfkDao extends BaseDao { ...@@ -114,13 +117,13 @@ public interface GpfkDao extends BaseDao {
/**科威尔工票反馈sql */ /**科威尔工票反馈sql */
public WosngzVO queryKwellWoBySnid(String snid); public WosngzVO queryKwellWoBySnid(String snid);
public WolinkInfoVO queryKwellWoBySnid(String snid,String bzgx); public FkVO queryKwellWoBySnid(String snid,String bzgx);
public List<WobomVO> queryWobomByWo(String woid,String bzgx,String wosn); public List<WobomVO> queryWobomByWo(String woid,String bzgx,String wosn);
public GylxVO queryKwellWoStandGylx(String djid,String bzgx); public GylxVO queryKwellWoStandGylx(String djid,String bzgx);
public GpfkVO queryKwellGpfkByWosnAndGxid(GpfkCondition condition); public GpfkVO queryKwellGpfkByWosnAndGxid(FkCondition condition);
public double queryWobomZpslByDjidAndWlid(String fkid,String wlid); public double queryWobomZpslByDjidAndWlid(String fkid,String wlid);
...@@ -132,4 +135,9 @@ public interface GpfkDao extends BaseDao { ...@@ -132,4 +135,9 @@ public interface GpfkDao extends BaseDao {
public List<WobomVO> queryWobomByFkidAndWlid(String fkid,String wlid,String bzlx); public List<WobomVO> queryWobomByFkidAndWlid(String fkid,String wlid,String bzlx);
public double checkIfContainsWosn(String sn);
public double checkIfContainsWobomWl(FkCondition fkCondition);
public double checkIfContainsGphywl(GphyCondition condition);
} }
...@@ -4,7 +4,6 @@ package com.gavel.kwell.dao.impl; ...@@ -4,7 +4,6 @@ package com.gavel.kwell.dao.impl;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.gavel.wo.persistent.Wogylx;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.gavel.common.Constants; import com.gavel.common.Constants;
...@@ -21,16 +20,19 @@ import com.gavel.kwell.persistent.Gpfk; ...@@ -21,16 +20,19 @@ import com.gavel.kwell.persistent.Gpfk;
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.utils.GpfkFklxEnum; import com.gavel.kwell.utils.GpfkFklxEnum;
import com.gavel.kwell.vo.FkCondition;
import com.gavel.kwell.vo.FkVO;
import com.gavel.kwell.vo.GpWoCondition; import com.gavel.kwell.vo.GpWoCondition;
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.GphyCondition;
import com.gavel.kwell.vo.GpwxmxVO; import com.gavel.kwell.vo.GpwxmxVO;
import com.gavel.kwell.vo.WolinkInfoVO;
import com.gavel.kwell.vo.WosngzVO; import com.gavel.kwell.vo.WosngzVO;
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.persistent.Wogylx;
import com.gavel.wo.vo.WobomVO; import com.gavel.wo.vo.WobomVO;
import com.gavel.wo.vo.WogylxVO; import com.gavel.wo.vo.WogylxVO;
...@@ -1149,7 +1151,7 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -1149,7 +1151,7 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
} }
@Override @Override
public GpfkVO queryKwellGpfkByWosnAndGxid(GpfkCondition condition){ public GpfkVO queryKwellGpfkByWosnAndGxid(FkCondition condition){
SqlMap sqlMap = new SqlMap(); SqlMap sqlMap = new SqlMap();
sqlMap.append("select GPFK_ID, GPFK_WOSNID, GPFK_FKLX, GPFK_FKSJ, GPFK_HGBZ, GPFK_FKSL, "); sqlMap.append("select GPFK_ID, GPFK_WOSNID, GPFK_FKLX, GPFK_FKSJ, GPFK_HGBZ, GPFK_FKSL, ");
sqlMap.append(" GPFK_HGSL, GPFK_BHGSL, GPFK_FKR, GPFK_FKGX, GPFK_BZ, "); sqlMap.append(" GPFK_HGSL, GPFK_BHGSL, GPFK_FKR, GPFK_FKGX, GPFK_BZ, ");
...@@ -1166,41 +1168,17 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -1166,41 +1168,17 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
sqlMap.append(" left join WOGYLX on WOGYLX_ID = GPFK_WOGYLX "); sqlMap.append(" left join WOGYLX on WOGYLX_ID = GPFK_WOGYLX ");
sqlMap.append(" left join BZGX on BZGX_ID = GPFK_FKGX "); sqlMap.append(" left join BZGX on BZGX_ID = GPFK_FKGX ");
sqlMap.append("where 1 = 1 "); sqlMap.append("where 1 = 1 ");
if (StringUtils.isNotEmpty(condition.getId())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPFK_ID", condition.getId()));
sqlMap.setParamValue("GPFK_ID", condition.getId());
}
if (StringUtils.isNotEmpty(condition.getGxid())){
sqlMap.append(" and GPFK_FKGX = :pFKGX ");
sqlMap.setParamValue("pFKGX",condition.getGxid());
}
if (StringUtils.isNotEmpty(condition.getBzgxid())){ if (StringUtils.isNotEmpty(condition.getBzgxid())){
sqlMap.append(" and BZGX_ID = :pBZGX "); sqlMap.append(" and GPFK_FKGX = :pFKGX ");
sqlMap.setParamValue("pBZGX",condition.getBzgxid()); sqlMap.setParamValue("pFKGX",condition.getBzgxid());
} }
if (StringUtils.isNotEmpty(condition.getWogylx())){ if (StringUtils.isNotEmpty(condition.getWogylx())){
sqlMap.append(" and WOGYLX_ID = :pWOGYLX "); sqlMap.append(" and WOGYLX_ID = :pWOGYLX ");
sqlMap.setParamValue("pWOGYLX",condition.getWogylx()); sqlMap.setParamValue("pWOGYLX",condition.getWogylx());
} }
if (StringUtils.isNotEmpty(condition.getFkrid())){ if (StringUtils.isNotEmpty(condition.getWosncode())){
sqlMap.append(" and GPFK_FKRID = :pFKRID ");
sqlMap.setParamValue("pFKRID",condition.getFkrid());
}
if (StringUtils.isNotEmpty(condition.getWosnid())){
sqlMap.append("and GPFK_WOSNID like :pWOSNID "); sqlMap.append("and GPFK_WOSNID like :pWOSNID ");
sqlMap.setParamValueLike("pWOSNID", condition.getWosnid()); sqlMap.setParamValueLike("pWOSNID", condition.getWosncode());
}
if (StringUtils.isNotEmpty(condition.getWodjid())){
sqlMap.append("and WO_DJID like :pDJID ");
sqlMap.setParamValueLike("pDJID", condition.getWodjid());
}
if (condition.getStart() != null) {
sqlMap.append(" and GPFK_FKSJ >= :pFKSJS ");
sqlMap.setParamValue("pFKSJS", condition.getStart());
}
if (condition.getEnd() != null) {
sqlMap.append(" and GPFK_FKSJ <= :pFKSJE ");
sqlMap.setParamValue("pFKSJE", condition.getEnd());
} }
sqlMap.append("order by GPFK_FKSJ desc, GPFK_FKGX "); sqlMap.append("order by GPFK_FKSJ desc, GPFK_FKGX ");
return sqlMap.queryEntity(GpfkVO.class); return sqlMap.queryEntity(GpfkVO.class);
...@@ -1230,9 +1208,10 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -1230,9 +1208,10 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
@Override @Override
public WolinkInfoVO queryKwellWoBySnid(String snid, String bzgx) { public FkVO queryKwellWoBySnid(String snid, String bzgx) {
SqlMap sqlMap = new SqlMap(); SqlMap sqlMap = new SqlMap();
sqlMap.append("select WO_ID,WO_ZT, WLXX_ID,WOSN_CODE,WOSN_ID,BZGX_ID,WOGYLX_ID "); sqlMap.append("select WO_ID,BZGX_CODE,WO_ZT,WLXX_CODE,WLXX_GG,WLXX_ID,WOSN_CODE,WOSN_ID,BZGX_ID,WOGYLX_ID,");
sqlMap.append(" BZGX_NAME,WLXX_GG,WO_DJID,BZGX_GXLX,WOSN_CODE ");
sqlMap.append("from WOSN "); sqlMap.append("from WOSN ");
sqlMap.append(" left join WO on WO_ID=WOSN_WOID"); sqlMap.append(" left join WO on WO_ID=WOSN_WOID");
sqlMap.append(" left join WOGYLX on WOGYLX_WOID =WO_ID"); sqlMap.append(" left join WOGYLX on WOGYLX_WOID =WO_ID");
...@@ -1244,7 +1223,7 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -1244,7 +1223,7 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
sqlMap.setParamValue("pSNID",snid); sqlMap.setParamValue("pSNID",snid);
sqlMap.append(" and BZGX_ID = :pBZGXID "); sqlMap.append(" and BZGX_ID = :pBZGXID ");
sqlMap.setParamValue("pBZGXID",bzgx); sqlMap.setParamValue("pBZGXID",bzgx);
return sqlMap.queryEntity(WolinkInfoVO.class); return sqlMap.queryEntity(FkVO.class);
} }
...@@ -1343,5 +1322,61 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -1343,5 +1322,61 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
} }
@Override
public double checkIfContainsWosn(String sn) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select count(1) ");
sqlMap.append("from WOSN");
sqlMap.append("where 1=1");
if (StringUtils.isNotEmpty(sn)){
sqlMap.append("and WOSN_CODE like :pWOSNID ");
sqlMap.setParamValueLike("pWOSNID", sn);
}
System.out.println(sqlMap.getSqlText());
return sqlMap.queryDouble();
}
@Override
public double checkIfContainsWobomWl(FkCondition fkCondition) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select count(1) ");
sqlMap.append(" from WOBOM");
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");
sqlMap.append("where 1=1");
if (StringUtils.isNotEmpty(fkCondition.getBzgxid())){
sqlMap.append(" and " + SqlUtil.getWhereSql("WOBOM_FFGX", fkCondition.getBzgxid()));
sqlMap.setParamValue("WOBOM_FFGX", fkCondition.getBzgxid());
}
if (StringUtils.isNotEmpty(fkCondition.getWosncode())){
sqlMap.append(" and " + SqlUtil.getWhereSql("WOSN_CODE", fkCondition.getWosncode()));
sqlMap.setParamValue("WOSN_CODE", fkCondition.getWosncode());
}
if (StringUtils.isNotEmpty(fkCondition.getWlxxId())){
sqlMap.append(" and " + SqlUtil.getWhereSql("WLXX_ID", fkCondition.getWlxxId()));
sqlMap.setParamValue("WLXX_ID", fkCondition.getWlxxId());
}
return sqlMap.queryDouble();
}
public double checkIfContainsGphywl(GphyCondition condition) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select count(1) ");
sqlMap.append("from GPHY ");
sqlMap.append("LEFT JOIN WLXX ON WLXX_ID = GPHY_WLID ");
sqlMap.append("where 1 = 1 ");
if (StringUtils.isNotEmpty(condition.getSnid())){
sqlMap.append(" and (GPHY_WLSNID like :pSnid or WLXX_CODE like :pSnid or WLXX_NAME like :pSnid) ");
sqlMap.setParamValueLike("pSnid", condition.getSnid());
}
if (StringUtils.isNotEmpty(condition.getMid())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPHY_MID", condition.getMid()));
sqlMap.setParamValue("GPHY_MID", condition.getMid());
}
return sqlMap.queryDouble();
}
} }
...@@ -10,6 +10,8 @@ import com.gavel.gygl.vo.BzgxVO; ...@@ -10,6 +10,8 @@ import com.gavel.gygl.vo.BzgxVO;
import com.gavel.gygl.vo.GylxVO; import com.gavel.gygl.vo.GylxVO;
import com.gavel.kwell.persistent.Gpfk; import com.gavel.kwell.persistent.Gpfk;
import com.gavel.kwell.utils.SmCodeModel; import com.gavel.kwell.utils.SmCodeModel;
import com.gavel.kwell.vo.FkCondition;
import com.gavel.kwell.vo.FkVO;
import com.gavel.kwell.vo.GpResVO; import com.gavel.kwell.vo.GpResVO;
import com.gavel.kwell.vo.GpWoCondition; import com.gavel.kwell.vo.GpWoCondition;
import com.gavel.kwell.vo.GpbhgfkCondition; import com.gavel.kwell.vo.GpbhgfkCondition;
...@@ -98,17 +100,23 @@ public interface GpfkService extends BaseEditService { ...@@ -98,17 +100,23 @@ public interface GpfkService extends BaseEditService {
public Attachment queryWoGylxFj(String djid,String bzlx); public Attachment queryWoGylxFj(String djid,String bzlx);
public GpfkVO queryKwellWosnWithAddGpfk(String wosn,String bzlx);
public Gpfk jyfk(String fkid,String hgsn);
public Gpfk wxfk(String fkid,String hgsn);
public BzgxVO login(String usersn,String bzgxid); public BzgxVO login(String usersn,String bzgxid);
public void updatePcjh(String woid,String fklx,boolean hgbz); public void updatePcjh(String woid,String fklx,boolean hgbz);
public void cancelPcjh(String woid,String fklx,boolean hgbz); public void cancelPcjh(String woid,String fklx,boolean hgbz);
/**
* 判断序列号类型
*/
public String checkSnType(String snid);
public FkVO zpfk(FkCondition fkCondition);
public FkVO jyfk(FkCondition fkCondition);
public FkVO wxfk(FkCondition fkCondition);
/** 科威尔mes工票反馈重写--end */ /** 科威尔mes工票反馈重写--end */
} }
...@@ -24,8 +24,6 @@ public interface GphyService extends BaseEditService { ...@@ -24,8 +24,6 @@ public interface GphyService extends BaseEditService {
public void queryGphyWithOrGphy(GphyCondition condition); public void queryGphyWithOrGphy(GphyCondition condition);
public Gpfk zpwl(GphyCondition condition);
public boolean compareIsZpComplete(String fkid,String wlid); public boolean compareIsZpComplete(String fkid,String wlid);
public WlslItem querywlzpsl(GphyCondition condition); public WlslItem querywlzpsl(GphyCondition condition);
......
package com.gavel.kwell.service.impl; package com.gavel.kwell.service.impl;
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;
import com.gavel.common.base.service.impl.BaseEditServiceImpl; import com.gavel.common.base.service.impl.BaseEditServiceImpl;
import com.gavel.common.sql.GavelSql;
import com.gavel.common.utils.DateUtils;
import com.gavel.common.utils.StringUtils;
import com.gavel.jcsj.service.CoderuleService;
import com.gavel.kwell.dao.GpfkDao; import com.gavel.kwell.dao.GpfkDao;
import com.gavel.kwell.dao.GphyDao; import com.gavel.kwell.dao.GphyDao;
import com.gavel.kwell.persistent.Gpfk;
import com.gavel.kwell.persistent.Gphy; import com.gavel.kwell.persistent.Gphy;
import com.gavel.kwell.service.GpfkService;
import com.gavel.kwell.service.GphyService; import com.gavel.kwell.service.GphyService;
import com.gavel.kwell.utils.HzGylxEnum;
import com.gavel.kwell.vo.GphyCondition; import com.gavel.kwell.vo.GphyCondition;
import com.gavel.kwell.vo.GphyVO; import com.gavel.kwell.vo.GphyVO;
import com.gavel.kwell.vo.GphycxVO; import com.gavel.kwell.vo.GphycxVO;
import com.gavel.kwell.vo.WlslItem; import com.gavel.kwell.vo.WlslItem;
import com.gavel.persistence.sql.RecordSet; import com.gavel.persistence.sql.RecordSet;
import com.gavel.wo.persistent.Wobom;
import com.gavel.wo.persistent.Wogylx;
import com.gavel.wo.vo.WobomVO;
@Service("gphyService") @Service("gphyService")
...@@ -38,12 +26,6 @@ public class GphyServiceImpl extends BaseEditServiceImpl implements GphyService ...@@ -38,12 +26,6 @@ public class GphyServiceImpl extends BaseEditServiceImpl implements GphyService
@Autowired @Autowired
private GpfkDao gpfkDao; private GpfkDao gpfkDao;
@Autowired
private GpfkService gpfkService;
@Autowired
private CoderuleService coderuleService;
@Override @Override
public void initService() { public void initService() {
addMaster( Gphy.class); addMaster( Gphy.class);
...@@ -74,45 +56,6 @@ public class GphyServiceImpl extends BaseEditServiceImpl implements GphyService ...@@ -74,45 +56,6 @@ public class GphyServiceImpl extends BaseEditServiceImpl implements GphyService
} }
@Override
public Gpfk zpwl(GphyCondition condition) {
List<GphyVO> dbGphy = gphyDao.queryKwellZpGphy(condition).getRecords();
if(dbGphy!=null&&dbGphy.size()>0) {
throwReturnMessage("该序列号已经被扫描");
}
String wlid = coderuleService.matchCodeByRule(condition.getSnid());
if(StringUtils.isEmpty(wlid)) {
throwReturnMessage("不存在该物料");
}
List<WobomVO> woboms = gpfkDao.queryWobomByFkidAndWlid(condition.getMid(), wlid, condition.getGxid());
if(woboms==null||woboms.size()<=0) {
throwReturnMessage("该订单不存在该物料");
}
if(compareIsZpComplete(condition.getFkid(),wlid)) {
Gphy gphy = new Gphy();
gphy.setFkgx(condition.getGxid());
gphy.setWlid(wlid);
gphy.setMid(condition.getFkid());
gphy.setWlsnid(condition.getSnid());
gphy.setFksj(DateUtils.getDate());
gphy.setZpsl(1.0);
gphy.setHylx(HzGylxEnum.ZP.getId());
insert(gphy);
}
Gpfk gpfk = gpfkDao.queryById(Gpfk.class, condition.getFkid());
if(gphyDao.queryIfZpwc(condition)!=0) {
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(StringUtils.isNotEmpty(gpfk.getHgbz())&&gpfk.getHgbz().equals("N")) {
gpfkService.updatePcjh(wogylx.getWoid(),wogylx.getGxlx(),false);
}
else {
gpfkService.updatePcjh(wogylx.getWoid(),wogylx.getGxlx(),true);
}
}
}
return gpfk;
}
@Override @Override
public boolean compareIsZpComplete(String fkid,String wlid) { public boolean compareIsZpComplete(String fkid,String wlid) {
......
...@@ -8,7 +8,7 @@ public enum SmCodeEnum { ...@@ -8,7 +8,7 @@ public enum SmCodeEnum {
LOGOUT("LOGOUT", "退出","LOGOUT",10), LOGOUT("LOGOUT", "退出","LOGOUT",10),
WOSNID("WOSNID","工单序列号","2",10), WOSNID("WOSNID","工单序列号","2",10),
// WLID("WLID","物料编码","D",10), WLID("WLID","物料编码","D",10),
OKBZ("OKBZ","OK按钮","OK",10), OKBZ("OKBZ","OK按钮","OK",10),
NGBZ("NGBZ","NG按钮","NG",10); NGBZ("NGBZ","NG按钮","NG",10);
...@@ -70,4 +70,20 @@ public enum SmCodeEnum { ...@@ -70,4 +70,20 @@ public enum SmCodeEnum {
} }
return list; return list;
} }
public static List<SmCodeModel> queryCommonBz(){
List<SmCodeModel> list = new ArrayList<>();
for (SmCodeEnum e : SmCodeEnum.values()) {
if(!e.getId().equals(WOSNID.id)&&!e.getId().equals(WLID.id)) {
SmCodeModel moduleParams = new SmCodeModel();
moduleParams.setId(e.getId());
moduleParams.setLen(e.getLen());
moduleParams.setName(e.getName());
moduleParams.setPrefix(e.getPrefix());
list.add(moduleParams);
}
}
return list;
}
} }
package com.gavel.kwell.vo;
import com.gavel.common.base.entity.BaseEntity;
public class FkCondition extends BaseEntity {
private static final long serialVersionUID = 1L;
private String sncode;
private String bzgxid;
private String woid;
private String wlxxId;
private String wosncode;
private String wogylx;
private String wlid;
public String getWlid() {
return wlid;
}
public void setWlid(String wlid) {
this.wlid = wlid;
}
public String getWogylx() {
return wogylx;
}
public void setWogylx(String wogylx) {
this.wogylx = wogylx;
}
public String getWosncode() {
return wosncode;
}
public void setWosncode(String wosncode) {
this.wosncode = wosncode;
}
public String getWoid() {
return woid;
}
public void setWoid(String woid) {
this.woid = woid;
}
public String getSncode() {
return sncode;
}
public void setSncode(String sncode) {
this.sncode = sncode;
}
public String getBzgxid() {
return bzgxid;
}
public void setBzgxid(String bzgxid) {
this.bzgxid = bzgxid;
}
public String getWlxxId() {
return wlxxId;
}
public void setWlxxId(String wlxxId) {
this.wlxxId = wlxxId;
}
}
This diff is collapsed.
package com.gavel.kwell.vo; package com.gavel.kwell.vo;
import java.util.Date;
import com.gavel.common.base.entity.BaseEntity; import com.gavel.common.base.entity.BaseEntity;
import com.gavel.persistence.annotation.FieldMeta; import com.gavel.persistence.annotation.FieldMeta;
public class WolinkInfoVO extends BaseEntity { public class WolinkInfoVO extends BaseEntity {
@FieldMeta(fieldName = "WOSN_ID", caption = "WOSN编码")
private String wosnid;
@FieldMeta(fieldName = "BZGX_CODE", caption = "工序编码")
private String bzgxCode;
@FieldMeta(fieldName = "BZGX_NAME", caption = "工序名称")
private String bzgxName;
@FieldMeta(fieldName = "WLXX_ID", caption = "物料编码")
private String wlxxId;
@FieldMeta(fieldName = "WLXX_CODE", caption = "物料编码")
private String wlxxCode;
@FieldMeta(fieldName = "WLXX_NAME", caption = "物料名称")
private String wlxxName;
@FieldMeta(fieldName = "WLXX_GG", caption = "规格")
private String wlxxGg;
@FieldMeta(fieldName = "WO_DJID", caption = "任务单号")
private String woDjid;
@FieldMeta(fieldName = "BZGX_GXLX", caption = "工序类型")
private String bzgxGxlx;
@FieldMeta(fieldName = "WLXX_ID", caption = "物料编码") @FieldMeta(fieldName = "WLXX_ID", caption = "物料编码")
private String wlid; private String wlid;
@FieldMeta(fieldName = "WOSN_CODE", caption = "序列号") @FieldMeta(fieldName = "WOSN_CODE", caption = "序列号")
......
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