Commit 9acf4fc4 authored by yff's avatar yff

#增加反馈业务模块

parent 00928b60
......@@ -10,6 +10,7 @@ import com.gavel.gygl.vo.BzgxVO;
import com.gavel.gygl.vo.GylxVO;
import com.gavel.kwell.persistent.Gpbhgmx;
import com.gavel.kwell.persistent.Gpfk;
import com.gavel.kwell.persistent.Gphy;
import com.gavel.kwell.persistent.Gpwxmx;
import com.gavel.kwell.vo.GpWoCondition;
import com.gavel.kwell.vo.GpbhgmxVO;
......@@ -123,4 +124,10 @@ public interface GpfkDao extends BaseDao {
public double queryWobomZpslByDjidAndWlid(String djid,String wlid);
public List<Gphy> queryGphyByGpfkid(String mid);
public Wogylx getLastGx(Wogylx wogylx);
public Double getNowGyFksl(Wogylx wogylx);
}
......@@ -18,6 +18,7 @@ import com.gavel.gygl.vo.GylxVO;
import com.gavel.kwell.dao.GpfkDao;
import com.gavel.kwell.persistent.Gpbhgmx;
import com.gavel.kwell.persistent.Gpfk;
import com.gavel.kwell.persistent.Gphy;
import com.gavel.kwell.persistent.Gpwxmx;
import com.gavel.kwell.utils.GpfkFklxEnum;
import com.gavel.kwell.vo.GpWoCondition;
......@@ -684,6 +685,8 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
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())){
......@@ -1239,5 +1242,62 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
}
@Override
public List<Gphy> queryGphyByGpfkid(String mid) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select GPHY_ID, GPHY_MID, GPHY_WLSNID, GPHY_FKSJ, GPHY_ZPSL, ");
sqlMap.append(" GPHY_CXSL, GPHY_FKR, GPHY_FKGX, GPHY_BZ, GPHY_WHRID, ");
sqlMap.append(" GPHY_WHR, GPHY_WHSJ, GPHY_CJRID, GPHY_CJR, GPHY_CJSJ, ");
sqlMap.append(" GPHY_SYSVERSION, GPHY_WLID, GPHY_HYLX, GPHY_FKRID ");
sqlMap.append("from GPHY ");
sqlMap.append("where 1 = 1 ");
if (StringUtils.isNotEmpty(mid)){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPHY_MID", mid));
sqlMap.setParamValue("GPHY_MID", mid);
}
return sqlMap.query(Gphy.class);
}
@Override
public Wogylx getLastGx(Wogylx wogylx) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select top 1 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());
}
sqlMap.append(" and BZGX_XH < :pXH ");
sqlMap.append("order by BZGX_XH desc");
sqlMap.setParamValue("pXH",wogylx.getXh());
return sqlMap.queryEntity(Wogylx.class);
}
@Override
public Double getNowGyFksl(Wogylx wogylx) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select count(1) ");
sqlMap.append("from GPFK ");
sqlMap.append(" left join WOGYLX on WOGYLX_ID = GPFK_WOGYLX ");
sqlMap.append("where 1 = 1 ");
if(StringUtils.isNotEmpty(wogylx.getId())){
sqlMap.append(" and WOGYLX_ID = :pWOGTLXID ");
sqlMap.setParamValue("pWOGTLXID",wogylx.getId());
}
return sqlMap.queryEntity(Double.class);
}
}
......@@ -33,6 +33,10 @@ public class GphyDaoImpl extends BaseDaoImpl implements GphyDao {
sqlMap.append(" and " + SqlUtil.getWhereSql("GPHY_ID", condition.getId()));
sqlMap.setParamValue("GPHY_ID", condition.getId());
}
if (StringUtils.isNotEmpty(condition.getMid())){
sqlMap.append(" and " + SqlUtil.getWhereSql("GPHY_MID", condition.getMid()));
sqlMap.setParamValue("GPHY_MID", condition.getMid());
}
sqlMap.query(GphyVO.class);
return sqlMap.getRecordSet();
}
......
......@@ -106,5 +106,7 @@ public interface GpfkService extends BaseEditService {
public BzgxVO login(String usersn,String bzgxid);
public boolean updatePcjh();
/** 科威尔mes工票反馈重写--end */
}
package com.gavel.kwell.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.gavel.common.Constants;
import com.gavel.common.attachment.persistent.Attachment;
import com.gavel.common.attachment.service.AttachmentService;
......@@ -7,7 +21,15 @@ import com.gavel.common.base.entity.BaseEntity;
import com.gavel.common.base.service.impl.BaseEditServiceImpl;
import com.gavel.common.business.service.CommonService;
import com.gavel.common.sql.GavelSql;
import com.gavel.common.utils.*;
import com.gavel.common.utils.BooleanEnum;
import com.gavel.common.utils.CodeStrategy;
import com.gavel.common.utils.CollectionUtils;
import com.gavel.common.utils.DateUtils;
import com.gavel.common.utils.MapList;
import com.gavel.common.utils.NumberUtils;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.common.utils.UserInfoUtil;
import com.gavel.framework.utils.JwtUtil;
import com.gavel.gygl.persistent.Bzgx;
import com.gavel.gygl.service.BzgxService;
......@@ -16,12 +38,26 @@ import com.gavel.gygl.vo.BzgxCondition;
import com.gavel.gygl.vo.BzgxVO;
import com.gavel.gygl.vo.GylxVO;
import com.gavel.kwell.dao.GpfkDao;
import com.gavel.kwell.dao.GphyDao;
import com.gavel.kwell.persistent.Gpbhgmx;
import com.gavel.kwell.persistent.Gpfk;
import com.gavel.kwell.persistent.Gphy;
import com.gavel.kwell.persistent.Gpwxmx;
import com.gavel.kwell.service.GpfkService;
import com.gavel.kwell.utils.*;
import com.gavel.kwell.vo.*;
import com.gavel.kwell.service.GphyService;
import com.gavel.kwell.utils.GpfkFklxEnum;
import com.gavel.kwell.utils.HzGylxEnum;
import com.gavel.kwell.utils.SmCodeEnum;
import com.gavel.kwell.utils.SmCodeModel;
import com.gavel.kwell.utils.YymkFKEnum;
import com.gavel.kwell.vo.GpResVO;
import com.gavel.kwell.vo.GpWoCondition;
import com.gavel.kwell.vo.GpbhgfkCondition;
import com.gavel.kwell.vo.GpbhgmxVO;
import com.gavel.kwell.vo.GpfkCondition;
import com.gavel.kwell.vo.GpfkVO;
import com.gavel.kwell.vo.WolinkInfoVO;
import com.gavel.kwell.vo.WosngzVO;
import com.gavel.kzzx.dao.UserDao;
import com.gavel.kzzx.persistent.User;
import com.gavel.kzzx.service.UserRoleService;
......@@ -35,14 +71,6 @@ import com.gavel.persistence.sql.RecordSet;
import com.gavel.wo.persistent.Wogylx;
import com.gavel.wo.persistent.Wosn;
import com.gavel.wo.vo.WobomVO;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
@Service("gpfkService")
......@@ -53,6 +81,9 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
@Autowired
private GpfkDao gpfkDao;
@Autowired
private GphyDao gphydao;
@Autowired
private CommonService commonService;
......@@ -114,9 +145,15 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
if ( entity !=null && entity instanceof Gpfk) {
Gpfk gpfk = (Gpfk) entity;
List<Gpbhgmx> gpbhgmxList = gpfkDao.queryGpbhgmxByGpid(gpfk.getId());
List<Gphy> gphymxList = gpfkDao.queryGphyByGpfkid(gpfk.getId());
if(gpbhgmxList != null && gpbhgmxList.size() > 0){
gpfkDao.batchDelete(gpbhgmxList);
}
if(gphymxList != null && gphymxList.size() > 0){
gphydao.batchDelete(gphymxList);
}
/** 排产计划删除 末道工序 、单道工序**/
// Wogylx bzgx = (Bzgx) GavelSql.selectEntityByKey(Bzgx.class, gpfk.getFkgx());
}
}
......@@ -719,6 +756,16 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
if(wolinkInfoVO==null) {
throwReturnMessage("不存在对应订单序号标准类型信息");
}
Wogylx wogylx = gpfkDao.queryById(Wogylx.class, wolinkInfoVO.getWogylxid());
if(!NumberUtils.equals(wogylx.getXh(),0)){
Wogylx existLastWogylx = gpfkDao.getLastGx(wogylx);
if(existLastWogylx != null){
Double gpfksl = gpfkDao.getNowGyFksl(existLastWogylx);
if(gpfksl<existLastWogylx.getXqsl()) {
throwReturnMessage("上道工序未完成不能装配此道工序");
}
}
}
if(!wolinkInfoVO.getWozt().equals("R")) {
throwReturnMessage("订单未下达");
}
......@@ -745,10 +792,10 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
Gpfk gpfk = new Gpfk();
EntityDataFactory.copyEntity(gpfkVo, gpfk);
if(SmCodeEnum.OKBZ.getId().equals(hgsn)) {
gpfk.setHgsl(gpfk.getHgsl()+1.0);
gpfk.setHgsl(1.0);
}
else if(SmCodeEnum.NGBZ.getId().equals(hgsn)) {
gpfk.setBhgsl(gpfk.getBhgsl()+1.0);
gpfk.setBhgsl(1.0);
}
else {
throwReturnMessage(SmCodeEnum.ERROR_CODE);
......@@ -845,4 +892,11 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
return bzgxVO;
}
@Override
public boolean updatePcjh() {
// TODO Auto-generated method stub
return false;
}
}
......@@ -25,8 +25,11 @@ import com.gavel.persistence.sql.RecordSet;
@Transactional
public class GphyServiceImpl extends BaseEditServiceImpl implements GphyService {
/**装配完成**/
private static final Integer COMPLETE_CODE =230;
/**装配成功**/
private static final Integer ZP_CODE =200;
/**相同序列号**/
private static final Integer SAME_CODE =100;
@Autowired
......
......@@ -10,9 +10,9 @@ import com.gavel.kzzx.model.GavelEnumModel;
public enum YymkFKEnum {
ZP("ZP", "901000200"),
JY("JY","901000400"),
WX("WX","901000600");
ZP("ZP", "1901000200"),
JY("JY","1901000400"),
WX("WX","1901000600");
private String id;
private String name;
......
......@@ -4,6 +4,7 @@
<name>合肥科威尔产线MES</name>
<zjm>KMES</zjm>>
<version>1.0</version>
<menu mkid="901000000" mkmc = "科威尔MES">
<menu mkid="901000200" mkmc="装配反馈" url="kmes/gphy/zpindex">
......@@ -36,7 +37,14 @@
</menu>
</menu>
<menu mkid="1901000000" mkmc = "装配大屏" gnlx="M">
<menu mkid="1901000200" mkmc="装配反馈" url="kmes/gphy/index" gnlx="M">
</menu>
<menu mkid="1901000400" mkmc="检验反馈" url="kmes/gpjy/index" gnlx="M">
</menu>
<menu mkid="1901000600" mkmc="维修反馈" url="kmes/gpwx/index" gnlx="M">
</menu>
</menu>
<disableMenus>
<menu mkid="510050000" mkmc="生产入库"/>
<menu mkid="290040100" mkmc="生产入库登记"/>
......
<div id="kmesGphyindex" class="gui-div">
<table class="toolbar-table" data-options="id: 'kmesGphyindexTable',herf:'kzzx/gridset/query'"></table>
<div id="kmesGpfkindex" class="gui-div">
<table class="toolbar-table" data-options="id: 'kmesGpfkindexTable',herf:'kzzx/gridset/query'"></table>
<!-- 表格工具栏开始 -->
<div id="kmesGphyindexTable-toolbar" class="gui-toolbar" data-options="grid:{type:'datagrid',id:'kmesGphyindexTable'}">
<div id="kmesGpfkindexTable-toolbar" class="gui-toolbar" data-options="grid:{type:'datagrid',id:'kmesGpfkindexTable'}">
<div class="navbar-toolbar">
<a class="toolbar-print toolbar" href="javascript:void(0)"></a>
<a class="toolbar-export toolbar" href="javascript:void(0)"></a>
......@@ -51,7 +51,7 @@
<script>
$(function () {
/*js初始化*/
var $div=$('#kmesGphyindex');
var $div=$('#kmesGpfkindex');
var $datagrid=$div.find(".toolbar-table");
var $datStart=$div.find("input[name='start']");
var $datEnd=$div.find("input[name='end']");
......@@ -70,7 +70,7 @@
$txtScgd.iTextbox();
$txtWosnid.iTextbox();
var options = {
url: 'kmes/gphy',
url: 'kmes/gpfk',
noRequest: true,
columns: [[
{title: "产品条码", field: "wosnid", fieldType: "ftString",width:160},
......@@ -102,7 +102,7 @@
]],
dialog: {
footerIn: true,
href: 'kmes/gphy/edit',
href: 'kmes/gpfk/edit',
maximized:true,
width:1080,
height:640,
......@@ -139,7 +139,7 @@
};
$div.Holder(options);
$("#kmesGphyindexTable-toolbar").find(".toolbar-cancelzp").iMenubutton({
$("#kmesGpfkindexTable-toolbar").find(".toolbar-cancelzp").iMenubutton({
event:'doAjax',
text:'取消装配',
onClick:function () {
......@@ -163,7 +163,7 @@
}
});
$("#kmesGphyindexTable-toolbar").find(".toolbar-search1").iMenubutton({
$("#kmesGpfkindexTable-toolbar").find(".toolbar-search1").iMenubutton({
text:'搜索',
iconCls:"fa fa-search",
btnCls:"",
......@@ -206,7 +206,7 @@
gxName=data.gxName||"";
gzzxid=data.gzzxid||'';
gzzxname=data.gzzxname||"";
$datagrid.datagrid("options").url="kmes/gphy/query";
$datagrid.datagrid("options").url="kmes/gpfk/query";
$datagrid.datagrid("load",DataBind.collectData($div))
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment