Commit 97c3ca15 authored by zhoumaotao's avatar zhoumaotao

班型移到车间作业模块

parent 1f2f6904
package com.gavel.kwell.controller;
import com.alibaba.fastjson.JSONObject;
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 com.gavel.common.utils.ThreadContext;
import com.gavel.kwell.service.BxService;
import com.gavel.kwell.vo.BxCondition;
import com.gavel.kwell.vo.BxVO;
import com.gavel.persistence.sql.RecordSet;
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 javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("kmes/bx")
public class BxController extends BaseController {
@Autowired
private BxService bxService;
@RequestMapping("/index")
public String index() {
return "kmes/bx/index";
}
@RequestMapping("/add")
public String add() {
return "kmes/bx/edit";
}
@RequestMapping("/edit")
public String edit() {
return "kmes/bx/edit";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
BxCondition condition = DataConvert.getCondition(param, BxCondition.class);
RecordSet<BxVO> records = bxService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(BxVO.class, records.getRecords().get(0));
}
return buildReturnData(BxVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
BxCondition condition = DataConvert.getCondition(param, BxCondition.class);
RecordSet<BxVO> records = bxService.query(condition);
return buildReturnData(records, BxVO.class);
}
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
bxService.insert(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
bxService.update(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
bxService.delete(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
BxCondition condition = DataConvert.getCondition(param, BxCondition.class);
RecordSet<BxVO> records = bxService.query(condition);
doExport(request, response, param, records.getRecords());
}
@RequestMapping(value = "/count", method = RequestMethod.POST)
@ResponseBody
public Object count(@RequestBody JSONObject param) {
return buildReturnData(bxService.queryCount());
}
}
package com.gavel.kwell.dao;
import com.gavel.common.base.dao.BaseDao;
import com.gavel.kwell.vo.BxCondition;
import com.gavel.kwell.vo.BxVO;
import com.gavel.persistence.sql.RecordSet;
import java.util.List;
public interface BxDao extends BaseDao {
public RecordSet<BxVO> query(BxCondition condition);
public int queryCount();
public List<BxVO> queryBxList();
}
package com.gavel.kwell.dao.impl;
import com.gavel.common.base.dao.impl.BaseDaoImpl;
import com.gavel.common.utils.StringUtils;
import com.gavel.kwell.dao.BxDao;
import com.gavel.kwell.vo.BxCondition;
import com.gavel.kwell.vo.BxVO;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.persistence.sql.SqlMap;
import com.gavel.persistence.sql.SqlUtil;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository("bxDao")
public class BxDaoImpl extends BaseDaoImpl implements BxDao {
public RecordSet<BxVO> query(BxCondition condition) {
SqlMap sqlMap = new SqlMap();
sqlMap.setPageNo(condition.getPageNo());
sqlMap.setRowCount(condition.getPageSize());
sqlMap.append("select BX_ID, BX_CODE, BX_NAME, BX_BZ, BX_WHRID, ");
sqlMap.append(" BX_WHR, BX_KSSJ, BX_JSSJ, BX_SYSVERSION, BX_CJRID, ");
sqlMap.append(" BX_CJR, BX_WHSJ, BX_CJSJ ");
sqlMap.append("from BX");
sqlMap.append("where 1=1 ");
if (StringUtils.isNotEmpty(condition.getId())) {
sqlMap.append(" and " + SqlUtil.getWhereSql("BX_ID", condition.getId()));
sqlMap.setParamValue("BX_ID", condition.getId());
}
if (StringUtils.isNotEmpty(condition.getInfo())) {
sqlMap.append("and ( BX_CODE like :bxinfo or BX_NAME like :bxinfo )");
sqlMap.setParamValueLike("bxinfo", condition.getInfo());
}
sqlMap.append("order by BX_KSSJ, BX_JSSJ ");
sqlMap.query(BxVO.class);
return sqlMap.getRecordSet();
}
@Override
public int queryCount() {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select count(1) from BX where 1=1");
return sqlMap.queryInt();
}
@Override
public List<BxVO> queryBxList() {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select BX_ID, BX_CODE, BX_NAME, BX_BZ, BX_WHRID, ");
sqlMap.append(" BX_WHR, BX_KSSJ, BX_JSSJ, BX_SYSVERSION, BX_CJRID, ");
sqlMap.append(" BX_CJR, BX_WHSJ, BX_CJSJ");
sqlMap.append("from BX");
sqlMap.append("where 1=1");
sqlMap.append("order by BX_KSSJ");
return sqlMap.query(BxVO.class);
}
}
package com.gavel.kwell.persistent;
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;
import java.util.Date;
@TableMeta(id = "BX", name = "BX")
public class Bx extends BaseEntity {
/**
*
*/
private static final long serialVersionUID = -255471538964196173L;
@FieldMeta(fieldName = "BX_ID", caption = "ID", primaryKey = true,notEmpty = true,codeStrategy = CodeStrategy.UUID )
private String id;
@FieldMeta(fieldName = "BX_CODE", caption = "班型编码",notEmpty = true)
private String code;
@FieldMeta(fieldName = "BX_NAME", caption = "班型名称",notEmpty = true)
private String name;
@FieldMeta(fieldName = "BX_KSSJ", caption = "开始时间")
private String kssj;
@FieldMeta(fieldName = "BX_JSSJ", caption = "结束时间")
private String jssj;
@FieldMeta(fieldName = "BX_BZ", caption = "备注")
private String bz;
@FieldMeta(fieldName = "BX_WHRID", caption = "维护人编码", autoUserId = true)
private String whrid;
@FieldMeta(fieldName = "BX_WHR", caption = "维护人", autoUserName = true)
private String whr;
@FieldMeta(fieldName = "BX_WHSJ", caption = "维护时间", autoDateTime = true)
private Date whsj;
@FieldMeta(fieldName = "BX_CJRID", caption = "创建人编码", autoUserId = true, initial = true)
private String cjrid;
@FieldMeta(fieldName = "BX_CJR", caption = "创建人", autoUserName = true, initial = true)
private String cjr;
@FieldMeta(fieldName = "BX_CJSJ", caption = "创建时间", autoDateTime = true, initial = true)
private Date cjsj;
@FieldMeta(fieldName = "BX_SYSVERSION", caption = "系统版本")
private Integer sysversion;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getKssj() {
return kssj;
}
public void setKssj(String kssj) {
this.kssj = kssj;
}
public String getJssj() {
return jssj;
}
public void setJssj(String jssj) {
this.jssj = jssj;
}
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;
}
}
package com.gavel.kwell.service;
import com.gavel.common.base.service.BaseEditService;
import com.gavel.kwell.vo.BxCondition;
import com.gavel.kwell.vo.BxVO;
import com.gavel.persistence.sql.RecordSet;
public interface BxService extends BaseEditService {
RecordSet<BxVO> query(BxCondition condition);
int queryCount();
}
package com.gavel.kwell.service.impl;
import com.gavel.common.base.service.impl.BaseEditServiceImpl;
import com.gavel.kwell.dao.BxDao;
import com.gavel.kwell.persistent.Bx;
import com.gavel.kwell.service.BxService;
import com.gavel.kwell.vo.BxCondition;
import com.gavel.kwell.vo.BxVO;
import com.gavel.persistence.sql.RecordSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service("bxService")
@Transactional
public class BxServiceImpl extends BaseEditServiceImpl implements BxService {
@Autowired
private BxDao bxDao;
@Override
public void initService() {
addMaster(new Bx());
}
@Override
public RecordSet<BxVO> query(BxCondition condition) {
return bxDao.query(condition);
}
@Override
public int queryCount() {
return bxDao.queryCount();
}
}
package com.gavel.kwell.vo;
import com.gavel.common.base.entity.BaseEntity;
public class BxCondition extends BaseEntity {
/**
*
*/
private static final long serialVersionUID = 4004566395720580749L;
private String id;
private String info;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getInfo() {
return info;
}
public void setInfo(String info) {
this.info = info;
}
}
package com.gavel.kwell.vo;
import com.gavel.kwell.persistent.Bx;
public class BxVO extends Bx {
/**
*
*/
private static final long serialVersionUID = -7450583560305510101L;
/*---------AutoBegin-----------*/
/*---------AutoEnd-------------*/
}
......@@ -21,13 +21,9 @@
<print entity="com.gavel.hzgd.vo.HzWoVO"/>
</menu>
<menu mkid="901001000" mkmc="班型维护" url="kmes/bx/index" >
</menu>
<menu mkid="901001100" mkmc="产品工艺路线" url="kmes/wlgylx/index" >
</menu>
<menu mkid="901007000" mkmc="供应商条码设置" url="kmes/gyssnsz/index">
<print entity="com.gavel.hzgd.vo.HzWlxxVO"/>
</menu>
......
<div id="cjzyBxEdit" class="e-dialog-container" data-options="width:600,height:280">
<div class="e-dialog-body">
<input type="hidden" name="flag">
<input type="hidden" name="id" >
<div class="gui-row" >
<div class="gui-col-sm12">
<label class="gui-form-label">班型编码:</label>
<div class="gui-input-block">
<input type="text" name="code" data-toggle="gui-textbox" data-options="required:true,fieldType:'upper'" >
</div>
</div>
</div>
<div class="gui-row" >
<div class="gui-col-sm12">
<label class="gui-form-label">班型名称:</label>
<div class="gui-input-block">
<input type="text" name="name" data-toggle="gui-textbox" data-options="required:true" >
</div>
</div>
</div>
<div class="gui-row" >
<div class="gui-col-sm6">
<label class="gui-form-label">开始时间:</label>
<div class="gui-input-block">
<input type="text" name="kssj" data-toggle="gui-timespinner" data-options="required:true,showSeconds:false" style="width: 100%" >
</div>
</div>
<div class="gui-col-sm6">
<label class="gui-form-label">结束时间:</label>
<div class="gui-input-block">
<input type="text" name="jssj" data-toggle="gui-timespinner" data-options="required:true,showSeconds:false" style="width: 100%" >
</div>
</div>
</div>
<div class="gui-row" >
<div class="gui-col-sm12">
<label class="gui-form-label">备注:</label>
<div class="gui-input-block">
<input type="text" name="bz" data-toggle="gui-textbox" data-options="" >
</div>
</div>
</div>
</div>
<div class="e-dialog-footer">
<a href="javascript:void(0);" class="e-dialog-ok"></a>
<a href="javascript:void(0);" class="e-dialog-cancel"></a>
</div>
</div>
<script>
$(function () {
var $dialog=$('#cjzyBxEdit');
})
</script>
\ No newline at end of file
<div id="cjzyBx" class="gui-div">
<table class="toolbar-table" data-options="id: 'cjzyBxTable',herf:'kzzx/gridset/query'"></table>
<!-- 表格工具栏开始 -->
<div id="cjzyBxTable-toolbar" class="gui-toolbar" data-options="grid:{type:'datagrid',id:'cjzyBxTable'}">
<div class="navbar-toolbar">
<a class="toolbar-print toolbar" href="javascript:void(0)"></a>
<a class="toolbar-export toolbar" href="javascript:void(0)"></a>
<a class="toolbar-review toolbar" href="javascript:void(0)"></a>
<a class="toolbar-add toolbar" href="javascript:void(0)"></a>
<a class="toolbar-copy toolbar" href="javascript:void(0)"></a>
<a class="toolbar-edit toolbar" href="javascript:void(0)"></a>
<a class="toolbar-delete toolbar" href="javascript:void(0)"></a>
</div>
<div class="form-sub">
<form class="query-criteria">
<ul>
<li class="gui-form-row" >
<div class="gui-col-sm3">
<label class="gui-form-label">班型信息:</label>
<div class="gui-input-block">
<input type="text" name="info" class="gui-textbox" style="width: 100%">
</div>
</div>
</li>
</ul>
<span class="toolbar-search-span"><a class="toolbar-search" href="javascript:void(0)"></a></span>
</form>
</div>
</div>
</div>
<!-- 表格工具栏结束 -->
<script>
/*js初始化*/
var $div=$('#cjzyBx');
var $datagrid=$div.find(".toolbar-table");
function paramInit(ops){
}
function pageInit() {
var options = {
url: 'kmes/bx',
noRequest: true,
columns: [[
{title: "班型编码", field: "code", fieldType: "ftString",width:120},
{title: "班型名称", field: "name", fieldType: "ftString",width:140},
{title: "开始时间", field: "kssj", fieldType: "ftString",width:140},
{title: "结束时间", field: "jssj", fieldType: "ftString",width:140},
{title: "备注", field: "bz", fieldType: "ftString",width:250},
{title: "维护人", field: "whr", fieldType: "ftString"},
{title: "维护时间", field: "whsj", fieldType: "ftDateTime"}
]],
dialog: {
footerIn: true,
href: 'kmes/bx/edit'
}
};
$div.Holder(options);
}
/*数据初始化*/
function dataInit(ops){
}
/*用户操作*/
function run(ops){
$datagrid.datagrid("options").url="kmes/bx/query";
$datagrid.datagrid("load",DataBind.collectData($div))
}
$(function () {
gas.load(paramInit,pageInit,dataInit,run);
})
</script>
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