master
zhouxi 2021-08-02 15:31:32 +08:00
parent f508411a6c
commit 37bd061ef3
10 changed files with 1264 additions and 2 deletions

View File

@ -0,0 +1,406 @@
package com.zzjee.wm.controller;
import com.zzjee.wm.entity.WmPrintModelEntity;
import com.zzjee.wm.service.WmPrintModelServiceI;
import java.util.ArrayList;
import java.util.List;
import java.text.SimpleDateFormat;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import org.jeecgframework.core.common.controller.BaseController;
import org.jeecgframework.core.common.exception.BusinessException;
import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery;
import org.jeecgframework.core.common.model.common.TreeChildCount;
import org.jeecgframework.core.common.model.json.AjaxJson;
import org.jeecgframework.core.common.model.json.DataGrid;
import org.jeecgframework.core.constant.Globals;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.tag.core.easyui.TagUtil;
import org.jeecgframework.web.system.pojo.base.TSDepart;
import org.jeecgframework.web.system.service.SystemService;
import org.jeecgframework.core.util.MyBeanUtils;
import java.io.OutputStream;
import org.jeecgframework.core.util.BrowserUtils;
import org.jeecgframework.poi.excel.ExcelExportUtil;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.entity.TemplateExportParams;
import org.jeecgframework.poi.excel.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.vo.TemplateExcelConstants;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.jeecgframework.core.util.ResourceUtil;
import java.io.IOException;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import java.util.Map;
import java.util.HashMap;
import org.jeecgframework.core.util.ExceptionUtil;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
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 org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.jeecgframework.core.beanvalidator.BeanValidators;
import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
import java.net.URI;
import org.springframework.http.MediaType;
import org.springframework.web.util.UriComponentsBuilder;
/**
* @Title: Controller
* @Description:
* @author onlineGenerator
* @date 2021-08-02 14:51:38
* @version V1.0
*
*/
@Controller
@RequestMapping("/wmPrintModelController")
public class WmPrintModelController extends BaseController {
/**
* Logger for this class
*/
private static final Logger logger = Logger.getLogger(WmPrintModelController.class);
@Autowired
private WmPrintModelServiceI wmPrintModelService;
@Autowired
private SystemService systemService;
@Autowired
private Validator validator;
/**
*
*
* @return
*/
@RequestMapping(params = "list")
public ModelAndView list(HttpServletRequest request) {
return new ModelAndView("com/zzjee/wm/wmPrintModelList");
}
/**
* easyui AJAX
*
* @param request
* @param response
* @param dataGrid
* @param user
*/
@RequestMapping(params = "datagrid")
public void datagrid(WmPrintModelEntity wmPrintModel,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
CriteriaQuery cq = new CriteriaQuery(WmPrintModelEntity.class, dataGrid);
//查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, wmPrintModel, request.getParameterMap());
try{
//自定义追加查询条件
}catch (Exception e) {
throw new BusinessException(e.getMessage());
}
cq.add();
this.wmPrintModelService.getDataGridReturn(cq, true);
TagUtil.datagrid(response, dataGrid);
}
/**
*
*
* @return
*/
@RequestMapping(params = "doDel")
@ResponseBody
public AjaxJson doDel(WmPrintModelEntity wmPrintModel, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
wmPrintModel = systemService.getEntity(WmPrintModelEntity.class, wmPrintModel.getId());
message = "打印模板删除成功";
try{
wmPrintModelService.delete(wmPrintModel);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "打印模板删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @return
*/
@RequestMapping(params = "doBatchDel")
@ResponseBody
public AjaxJson doBatchDel(String ids,HttpServletRequest request){
String message = null;
AjaxJson j = new AjaxJson();
message = "打印模板删除成功";
try{
for(String id:ids.split(",")){
WmPrintModelEntity wmPrintModel = systemService.getEntity(WmPrintModelEntity.class,
id
);
wmPrintModelService.delete(wmPrintModel);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}
}catch(Exception e){
e.printStackTrace();
message = "打印模板删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @param ids
* @return
*/
@RequestMapping(params = "doAdd")
@ResponseBody
public AjaxJson doAdd(WmPrintModelEntity wmPrintModel, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
message = "打印模板添加成功";
try{
wmPrintModelService.save(wmPrintModel);
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "打印模板添加失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @param ids
* @return
*/
@RequestMapping(params = "doUpdate")
@ResponseBody
public AjaxJson doUpdate(WmPrintModelEntity wmPrintModel, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
message = "打印模板更新成功";
WmPrintModelEntity t = wmPrintModelService.get(WmPrintModelEntity.class, wmPrintModel.getId());
try {
MyBeanUtils.copyBeanNotNull2Bean(wmPrintModel, t);
wmPrintModelService.saveOrUpdate(t);
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
} catch (Exception e) {
e.printStackTrace();
message = "打印模板更新失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @return
*/
@RequestMapping(params = "goAdd")
public ModelAndView goAdd(WmPrintModelEntity wmPrintModel, HttpServletRequest req) {
if (StringUtil.isNotEmpty(wmPrintModel.getId())) {
wmPrintModel = wmPrintModelService.getEntity(WmPrintModelEntity.class, wmPrintModel.getId());
req.setAttribute("wmPrintModelPage", wmPrintModel);
}
return new ModelAndView("com/zzjee/wm/wmPrintModel-add");
}
/**
*
*
* @return
*/
@RequestMapping(params = "goUpdate")
public ModelAndView goUpdate(WmPrintModelEntity wmPrintModel, HttpServletRequest req) {
if (StringUtil.isNotEmpty(wmPrintModel.getId())) {
wmPrintModel = wmPrintModelService.getEntity(WmPrintModelEntity.class, wmPrintModel.getId());
req.setAttribute("wmPrintModelPage", wmPrintModel);
}
return new ModelAndView("com/zzjee/wm/wmPrintModel-update");
}
/**
*
*
* @return
*/
@RequestMapping(params = "upload")
public ModelAndView upload(HttpServletRequest req) {
req.setAttribute("controller_name","wmPrintModelController");
return new ModelAndView("common/upload/pub_excel_upload");
}
/**
* excel
*
* @param request
* @param response
*/
@RequestMapping(params = "exportXls")
public String exportXls(WmPrintModelEntity wmPrintModel,HttpServletRequest request,HttpServletResponse response
, DataGrid dataGrid,ModelMap modelMap) {
CriteriaQuery cq = new CriteriaQuery(WmPrintModelEntity.class, dataGrid);
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, wmPrintModel, request.getParameterMap());
List<WmPrintModelEntity> wmPrintModels = this.wmPrintModelService.getListByCriteriaQuery(cq,false);
modelMap.put(NormalExcelConstants.FILE_NAME,"打印模板");
modelMap.put(NormalExcelConstants.CLASS,WmPrintModelEntity.class);
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("打印模板列表", "导出人:"+ResourceUtil.getSessionUserName().getRealName(),
"导出信息"));
modelMap.put(NormalExcelConstants.DATA_LIST,wmPrintModels);
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
/**
* excel 使
*
* @param request
* @param response
*/
@RequestMapping(params = "exportXlsByT")
public String exportXlsByT(WmPrintModelEntity wmPrintModel,HttpServletRequest request,HttpServletResponse response
, DataGrid dataGrid,ModelMap modelMap) {
modelMap.put(NormalExcelConstants.FILE_NAME,"打印模板");
modelMap.put(NormalExcelConstants.CLASS,WmPrintModelEntity.class);
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("打印模板列表", "导出人:"+ResourceUtil.getSessionUserName().getRealName(),
"导出信息"));
modelMap.put(NormalExcelConstants.DATA_LIST,new ArrayList());
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
@SuppressWarnings("unchecked")
@RequestMapping(params = "importExcel", method = RequestMethod.POST)
@ResponseBody
public AjaxJson importExcel(HttpServletRequest request, HttpServletResponse response) {
AjaxJson j = new AjaxJson();
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<WmPrintModelEntity> listWmPrintModelEntitys = ExcelImportUtil.importExcel(file.getInputStream(),WmPrintModelEntity.class,params);
for (WmPrintModelEntity wmPrintModel : listWmPrintModelEntitys) {
wmPrintModelService.save(wmPrintModel);
}
j.setMsg("文件导入成功!");
} catch (Exception e) {
j.setMsg("文件导入失败!");
logger.error(ExceptionUtil.getExceptionMessage(e));
}finally{
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return j;
}
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
public List<WmPrintModelEntity> list() {
List<WmPrintModelEntity> listWmPrintModels=wmPrintModelService.getList(WmPrintModelEntity.class);
return listWmPrintModels;
}
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<?> get(@PathVariable("id") String id) {
WmPrintModelEntity task = wmPrintModelService.get(WmPrintModelEntity.class, id);
if (task == null) {
return new ResponseEntity(HttpStatus.NOT_FOUND);
}
return new ResponseEntity(task, HttpStatus.OK);
}
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public ResponseEntity<?> create(@RequestBody WmPrintModelEntity wmPrintModel, UriComponentsBuilder uriBuilder) {
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
Set<ConstraintViolation<WmPrintModelEntity>> failures = validator.validate(wmPrintModel);
if (!failures.isEmpty()) {
return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST);
}
//保存
try{
wmPrintModelService.save(wmPrintModel);
} catch (Exception e) {
e.printStackTrace();
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
//按照Restful风格约定创建指向新任务的url, 也可以直接返回id或对象.
String id = wmPrintModel.getId();
URI uri = uriBuilder.path("/rest/wmPrintModelController/" + id).build().toUri();
HttpHeaders headers = new HttpHeaders();
headers.setLocation(uri);
return new ResponseEntity(headers, HttpStatus.CREATED);
}
@RequestMapping(value = "/{id}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> update(@RequestBody WmPrintModelEntity wmPrintModel) {
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
Set<ConstraintViolation<WmPrintModelEntity>> failures = validator.validate(wmPrintModel);
if (!failures.isEmpty()) {
return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST);
}
//保存
try{
wmPrintModelService.saveOrUpdate(wmPrintModel);
} catch (Exception e) {
e.printStackTrace();
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
//按Restful约定返回204状态码, 无内容. 也可以返回200状态码.
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
public void delete(@PathVariable("id") String id) {
wmPrintModelService.deleteEntityById(WmPrintModelEntity.class, id);
}
}

View File

@ -0,0 +1,384 @@
package com.zzjee.wm.entity;
import java.math.BigDecimal;
import java.util.Date;
import java.lang.String;
import java.lang.Double;
import java.lang.Integer;
import java.math.BigDecimal;
import javax.xml.soap.Text;
import java.sql.Blob;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.SequenceGenerator;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @Title: Entity
* @Description:
* @author onlineGenerator
* @date 2021-08-02 14:51:38
* @version V1.0
*
*/
@Entity
@Table(name = "wm_print_model", schema = "")
@SuppressWarnings("serial")
public class WmPrintModelEntity implements java.io.Serializable {
/**主键*/
private String id;
/**创建人名称*/
private String createName;
/**创建人登录名称*/
private String createBy;
/**创建日期*/
private Date createDate;
/**更新人名称*/
private String updateName;
/**更新人登录名称*/
private String updateBy;
/**更新日期*/
private Date updateDate;
/**所属部门*/
private String sysOrgCode;
/**所属公司*/
private String sysCompanyCode;
/**用户名*/
@Excel(name="用户名")
private String userName;
/**打印类型*/
@Excel(name="打印类型")
private String printType;
/**打印模板*/
@Excel(name="打印模板")
private String printModel;
/**打印服务器地址*/
@Excel(name="打印服务器地址")
private String printServerAddress;
/**打印文件类型*/
@Excel(name="打印文件类型")
private String printFileType;
/**备用1*/
private String query1;
/**备用2*/
private String query2;
/**备用3*/
private String query3;
/**备用4*/
private String query4;
/**备用5*/
private String query5;
/**
*: java.lang.String
*@return: java.lang.String
*/
@Id
@GeneratedValue(generator = "paymentableGenerator")
@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
@Column(name ="ID",nullable=false,length=36)
public String getId(){
return this.id;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setId(String id){
this.id = id;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="CREATE_NAME",nullable=true,length=50)
public String getCreateName(){
return this.createName;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setCreateName(String createName){
this.createName = createName;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="CREATE_BY",nullable=true,length=50)
public String getCreateBy(){
return this.createBy;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setCreateBy(String createBy){
this.createBy = createBy;
}
/**
*: java.util.Date
*@return: java.util.Date
*/
@Column(name ="CREATE_DATE",nullable=true,length=20)
public Date getCreateDate(){
return this.createDate;
}
/**
*: java.util.Date
*@param: java.util.Date
*/
public void setCreateDate(Date createDate){
this.createDate = createDate;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="UPDATE_NAME",nullable=true,length=50)
public String getUpdateName(){
return this.updateName;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setUpdateName(String updateName){
this.updateName = updateName;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="UPDATE_BY",nullable=true,length=50)
public String getUpdateBy(){
return this.updateBy;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setUpdateBy(String updateBy){
this.updateBy = updateBy;
}
/**
*: java.util.Date
*@return: java.util.Date
*/
@Column(name ="UPDATE_DATE",nullable=true,length=20)
public Date getUpdateDate(){
return this.updateDate;
}
/**
*: java.util.Date
*@param: java.util.Date
*/
public void setUpdateDate(Date updateDate){
this.updateDate = updateDate;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="SYS_ORG_CODE",nullable=true,length=50)
public String getSysOrgCode(){
return this.sysOrgCode;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setSysOrgCode(String sysOrgCode){
this.sysOrgCode = sysOrgCode;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="SYS_COMPANY_CODE",nullable=true,length=50)
public String getSysCompanyCode(){
return this.sysCompanyCode;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setSysCompanyCode(String sysCompanyCode){
this.sysCompanyCode = sysCompanyCode;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="USER_NAME",nullable=true,length=50)
public String getUserName(){
return this.userName;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setUserName(String userName){
this.userName = userName;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="PRINT_TYPE",nullable=true,length=50)
public String getPrintType(){
return this.printType;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setPrintType(String printType){
this.printType = printType;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="PRINT_MODEL",nullable=true,length=50)
public String getPrintModel(){
return this.printModel;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setPrintModel(String printModel){
this.printModel = printModel;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="PRINT_SERVER_ADDRESS",nullable=true,length=50)
public String getPrintServerAddress(){
return this.printServerAddress;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setPrintServerAddress(String printServerAddress){
this.printServerAddress = printServerAddress;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="PRINT_FILE_TYPE",nullable=true,length=50)
public String getPrintFileType(){
return this.printFileType;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setPrintFileType(String printFileType){
this.printFileType = printFileType;
}
/**
*: java.lang.String
*@return: java.lang.String 1
*/
@Column(name ="QUERY1",nullable=true,length=50)
public String getQuery1(){
return this.query1;
}
/**
*: java.lang.String
*@param: java.lang.String 1
*/
public void setQuery1(String query1){
this.query1 = query1;
}
/**
*: java.lang.String
*@return: java.lang.String 2
*/
@Column(name ="QUERY2",nullable=true,length=50)
public String getQuery2(){
return this.query2;
}
/**
*: java.lang.String
*@param: java.lang.String 2
*/
public void setQuery2(String query2){
this.query2 = query2;
}
/**
*: java.lang.String
*@return: java.lang.String 3
*/
@Column(name ="QUERY3",nullable=true,length=50)
public String getQuery3(){
return this.query3;
}
/**
*: java.lang.String
*@param: java.lang.String 3
*/
public void setQuery3(String query3){
this.query3 = query3;
}
/**
*: java.lang.String
*@return: java.lang.String 4
*/
@Column(name ="QUERY4",nullable=true,length=50)
public String getQuery4(){
return this.query4;
}
/**
*: java.lang.String
*@param: java.lang.String 4
*/
public void setQuery4(String query4){
this.query4 = query4;
}
/**
*: java.lang.String
*@return: java.lang.String 5
*/
@Column(name ="QUERY5",nullable=true,length=50)
public String getQuery5(){
return this.query5;
}
/**
*: java.lang.String
*@param: java.lang.String 5
*/
public void setQuery5(String query5){
this.query5 = query5;
}
}

View File

@ -0,0 +1,15 @@
package com.zzjee.wm.service;
import com.zzjee.wm.entity.WmPrintModelEntity;
import org.jeecgframework.core.common.service.CommonService;
import java.io.Serializable;
public interface WmPrintModelServiceI extends CommonService{
public void delete(WmPrintModelEntity entity) throws Exception;
public Serializable save(WmPrintModelEntity entity) throws Exception;
public void saveOrUpdate(WmPrintModelEntity entity) throws Exception;
}

View File

@ -0,0 +1,157 @@
package com.zzjee.wm.service.impl;
import com.zzjee.wm.service.WmPrintModelServiceI;
import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
import com.zzjee.wm.entity.WmPrintModelEntity;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.io.Serializable;
import org.jeecgframework.core.util.ApplicationContextUtil;
import org.jeecgframework.core.util.MyClassLoader;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.web.cgform.enhance.CgformEnhanceJavaInter;
@Service("wmPrintModelService")
@Transactional
public class WmPrintModelServiceImpl extends CommonServiceImpl implements WmPrintModelServiceI {
@Override
public void delete(WmPrintModelEntity entity) throws Exception{
super.delete(entity);
//执行删除操作增强业务
this.doDelBus(entity);
}
@Override
public Serializable save(WmPrintModelEntity entity) throws Exception{
Serializable t = super.save(entity);
//执行新增操作增强业务
this.doAddBus(entity);
return t;
}
@Override
public void saveOrUpdate(WmPrintModelEntity entity) throws Exception{
super.saveOrUpdate(entity);
//执行更新操作增强业务
this.doUpdateBus(entity);
}
/**
*
* @param t
* @return
*/
private void doAddBus(WmPrintModelEntity t) throws Exception{
//-----------------sql增强 start----------------------------
//-----------------sql增强 end------------------------------
//-----------------java增强 start---------------------------
//-----------------java增强 end-----------------------------
}
/**
*
* @param t
* @return
*/
private void doUpdateBus(WmPrintModelEntity t) throws Exception{
//-----------------sql增强 start----------------------------
//-----------------sql增强 end------------------------------
//-----------------java增强 start---------------------------
//-----------------java增强 end-----------------------------
}
/**
*
* @param id
* @return
*/
private void doDelBus(WmPrintModelEntity t) throws Exception{
//-----------------sql增强 start----------------------------
//-----------------sql增强 end------------------------------
//-----------------java增强 start---------------------------
//-----------------java增强 end-----------------------------
}
private Map<String,Object> populationMap(WmPrintModelEntity t){
Map<String,Object> map = new HashMap<String,Object>();
map.put("id", t.getId());
map.put("create_name", t.getCreateName());
map.put("create_by", t.getCreateBy());
map.put("create_date", t.getCreateDate());
map.put("update_name", t.getUpdateName());
map.put("update_by", t.getUpdateBy());
map.put("update_date", t.getUpdateDate());
map.put("sys_org_code", t.getSysOrgCode());
map.put("sys_company_code", t.getSysCompanyCode());
map.put("user_name", t.getUserName());
map.put("print_type", t.getPrintType());
map.put("print_model", t.getPrintModel());
map.put("print_server_address", t.getPrintServerAddress());
map.put("print_file_type", t.getPrintFileType());
map.put("query1", t.getQuery1());
map.put("query2", t.getQuery2());
map.put("query3", t.getQuery3());
map.put("query4", t.getQuery4());
map.put("query5", t.getQuery5());
return map;
}
/**
* sql
* @param sql
* @param t
* @return
*/
public String replaceVal(String sql,WmPrintModelEntity t){
sql = sql.replace("#{id}",String.valueOf(t.getId()));
sql = sql.replace("#{create_name}",String.valueOf(t.getCreateName()));
sql = sql.replace("#{create_by}",String.valueOf(t.getCreateBy()));
sql = sql.replace("#{create_date}",String.valueOf(t.getCreateDate()));
sql = sql.replace("#{update_name}",String.valueOf(t.getUpdateName()));
sql = sql.replace("#{update_by}",String.valueOf(t.getUpdateBy()));
sql = sql.replace("#{update_date}",String.valueOf(t.getUpdateDate()));
sql = sql.replace("#{sys_org_code}",String.valueOf(t.getSysOrgCode()));
sql = sql.replace("#{sys_company_code}",String.valueOf(t.getSysCompanyCode()));
sql = sql.replace("#{user_name}",String.valueOf(t.getUserName()));
sql = sql.replace("#{print_type}",String.valueOf(t.getPrintType()));
sql = sql.replace("#{print_model}",String.valueOf(t.getPrintModel()));
sql = sql.replace("#{print_server_address}",String.valueOf(t.getPrintServerAddress()));
sql = sql.replace("#{print_file_type}",String.valueOf(t.getPrintFileType()));
sql = sql.replace("#{query1}",String.valueOf(t.getQuery1()));
sql = sql.replace("#{query2}",String.valueOf(t.getQuery2()));
sql = sql.replace("#{query3}",String.valueOf(t.getQuery3()));
sql = sql.replace("#{query4}",String.valueOf(t.getQuery4()));
sql = sql.replace("#{query5}",String.valueOf(t.getQuery5()));
sql = sql.replace("#{UUID}",UUID.randomUUID().toString());
return sql;
}
/**
* JAVA
*/
private void executeJavaExtend(String cgJavaType,String cgJavaValue,Map<String,Object> data) throws Exception {
if(StringUtil.isNotEmpty(cgJavaValue)){
Object obj = null;
try {
if("class".equals(cgJavaType)){
//因新增时已经校验了实例化是否可以成功,所以这块就不需要再做一次判断
obj = MyClassLoader.getClassByScn(cgJavaValue).newInstance();
}else if("spring".equals(cgJavaType)){
obj = ApplicationContextUtil.getContext().getBean(cgJavaValue);
}
if(obj instanceof CgformEnhanceJavaInter){
CgformEnhanceJavaInter javaInter = (CgformEnhanceJavaInter) obj;
javaInter.execute("wm_print_model",data);
}
} catch (Exception e) {
e.printStackTrace();
throw new Exception("执行JAVA增强出现异常");
}
}
}
}

View File

@ -23,11 +23,11 @@
</span> </span>
<span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 90px;text-align:right;" <span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 90px;text-align:right;"
title="行数">行数: </span> title="行数">行数: </span>
<input type="text" name="hangshu" value="42" style="width: 100px; height: 30px;"> <input type="text" name="hangshu" value="60" style="width: 100px; height: 30px;">
</span> </span>
<span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 90px;text-align:right;" <span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 90px;text-align:right;"
title="列数">列数: </span> title="列数">列数: </span>
<input type="text" name="lieshu" value="34" style="width: 100px; height: 30px;"> <input type="text" name="lieshu" value="60" style="width: 100px; height: 30px;">
</span> </span>
<span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 90px;text-align:right;"> <span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 90px;text-align:right;">
<button onclick="chaxun('zhengxiang')">正向排列查询</button> </span> <button onclick="chaxun('zhengxiang')">正向排列查询</button> </span>

View File

@ -0,0 +1,106 @@
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>打印模板</title>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<script type="text/javascript">
//编写自定义JS代码
</script>
</head>
<body>
<t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="wmPrintModelController.do?doAdd" >
<input id="id" name="id" type="hidden" value="${wmPrintModelPage.id }"/>
<input id="createName" name="createName" type="hidden" value="${wmPrintModelPage.createName }"/>
<input id="createBy" name="createBy" type="hidden" value="${wmPrintModelPage.createBy }"/>
<input id="createDate" name="createDate" type="hidden" value="${wmPrintModelPage.createDate }"/>
<input id="updateName" name="updateName" type="hidden" value="${wmPrintModelPage.updateName }"/>
<input id="updateBy" name="updateBy" type="hidden" value="${wmPrintModelPage.updateBy }"/>
<input id="updateDate" name="updateDate" type="hidden" value="${wmPrintModelPage.updateDate }"/>
<input id="sysOrgCode" name="sysOrgCode" type="hidden" value="${wmPrintModelPage.sysOrgCode }"/>
<input id="sysCompanyCode" name="sysCompanyCode" type="hidden" value="${wmPrintModelPage.sysCompanyCode }"/>
<input id="query1" name="query1" type="hidden" value="${wmPrintModelPage.query1 }"/>
<input id="query2" name="query2" type="hidden" value="${wmPrintModelPage.query2 }"/>
<input id="query3" name="query3" type="hidden" value="${wmPrintModelPage.query3 }"/>
<input id="query4" name="query4" type="hidden" value="${wmPrintModelPage.query4 }"/>
<input id="query5" name="query5" type="hidden" value="${wmPrintModelPage.query5 }"/>
<table style="width: 600px;" cellpadding="0" cellspacing="1" class="formtable">
<tr>
<td align="right">
<label class="Validform_label">
用户名:
</label>
</td>
<td class="value">
<input id="userName" name="userName" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
/>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">用户名</label>
</td>
</tr>
<tr>
<td align="right">
<label class="Validform_label">
打印类型:
</label>
</td>
<td class="value">
<t:dictSelect field="printType" type="list"
typeGroupCode="print_type" defaultVal="${wmPrintModelPage.printType}" hasLabel="false" title="打印类型"
></t:dictSelect>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">打印类型</label>
</td>
</tr>
<tr>
<td align="right">
<label class="Validform_label">
打印模板:
</label>
</td>
<td class="value">
<input id="printModel" name="printModel" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
/>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">打印模板</label>
</td>
</tr>
<tr>
<td align="right">
<label class="Validform_label">
打印服务器地址:
</label>
</td>
<td class="value">
<input id="printServerAddress" name="printServerAddress" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
/>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">打印服务器地址</label>
</td>
</tr>
<tr>
<td align="right">
<label class="Validform_label">
打印文件类型:
</label>
</td>
<td class="value">
<input id="printFileType" name="printFileType" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
/>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">打印文件类型</label>
</td>
</tr>
</table>
</t:formvalid>
</body>
<script src = "webpage/com/zzjee/wm/wmPrintModel.js"></script>

View File

@ -0,0 +1,102 @@
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>打印模板</title>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<script type="text/javascript">
//编写自定义JS代码
</script>
</head>
<body>
<t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="wmPrintModelController.do?doUpdate" >
<input id="id" name="id" type="hidden" value="${wmPrintModelPage.id }">
<input id="createName" name="createName" type="hidden" value="${wmPrintModelPage.createName }">
<input id="createBy" name="createBy" type="hidden" value="${wmPrintModelPage.createBy }">
<input id="createDate" name="createDate" type="hidden" value="${wmPrintModelPage.createDate }">
<input id="updateName" name="updateName" type="hidden" value="${wmPrintModelPage.updateName }">
<input id="updateBy" name="updateBy" type="hidden" value="${wmPrintModelPage.updateBy }">
<input id="updateDate" name="updateDate" type="hidden" value="${wmPrintModelPage.updateDate }">
<input id="sysOrgCode" name="sysOrgCode" type="hidden" value="${wmPrintModelPage.sysOrgCode }">
<input id="sysCompanyCode" name="sysCompanyCode" type="hidden" value="${wmPrintModelPage.sysCompanyCode }">
<input id="query1" name="query1" type="hidden" value="${wmPrintModelPage.query1 }">
<input id="query2" name="query2" type="hidden" value="${wmPrintModelPage.query2 }">
<input id="query3" name="query3" type="hidden" value="${wmPrintModelPage.query3 }">
<input id="query4" name="query4" type="hidden" value="${wmPrintModelPage.query4 }">
<input id="query5" name="query5" type="hidden" value="${wmPrintModelPage.query5 }">
<table style="width: 600px;" cellpadding="0" cellspacing="1" class="formtable">
<tr>
<td align="right">
<label class="Validform_label">
用户名:
</label>
</td>
<td class="value">
<input id="userName" name="userName" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
value='${wmPrintModelPage.userName}'>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">用户名</label>
</td>
</tr>
<tr>
<td align="right">
<label class="Validform_label">
打印类型:
</label>
</td>
<td class="value">
<t:dictSelect field="printType" type="list"
typeGroupCode="print_type" defaultVal="${wmPrintModelPage.printType}" hasLabel="false" title="打印类型"
></t:dictSelect>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">打印类型</label>
</td>
</tr>
<tr>
<td align="right">
<label class="Validform_label">
打印模板:
</label>
</td>
<td class="value">
<input id="printModel" name="printModel" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
value='${wmPrintModelPage.printModel}'>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">打印模板</label>
</td>
</tr>
<tr>
<td align="right">
<label class="Validform_label">
打印服务器地址:
</label>
</td>
<td class="value">
<input id="printServerAddress" name="printServerAddress" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
value='${wmPrintModelPage.printServerAddress}'>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">打印服务器地址</label>
</td>
</tr>
<tr>
<td align="right">
<label class="Validform_label">
打印文件类型:
</label>
</td>
<td class="value">
<input id="printFileType" name="printFileType" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
value='${wmPrintModelPage.printFileType}'>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">打印文件类型</label>
</td>
</tr>
</table>
</t:formvalid>
</body>
<script src = "webpage/com/zzjee/wm/wmPrintModel.js"></script>

View File

@ -0,0 +1,32 @@
//通用弹出式文件上传
function commonUpload(callback){
$.dialog({
content: "url:systemController.do?commonUpload",
lock : true,
title:"文件上传",
zIndex:2100,
width:700,
height: 200,
parent:windowapi,
cache:false,
ok: function(){
var iframe = this.iframe.contentWindow;
iframe.uploadCallback(callback);
return true;
},
cancelVal: '关闭',
cancel: function(){
}
});
}
function browseImages(inputId, Img) {// 图片管理器,可多个上传共用
}
function browseFiles(inputId, file) {// 文件管理器,可多个上传共用
}
function decode(value, id) {//value传入值,id接受值
var last = value.lastIndexOf("/");
var filename = value.substring(last + 1, value.length);
$("#" + id).text(decodeURIComponent(filename));
}

View File

@ -0,0 +1,60 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
<div region="center" style="padding:0px;border:0px">
<t:datagrid name="wmPrintModelList" checkbox="false" pagination="true" fitColumns="false" title="打印模板" actionUrl="wmPrintModelController.do?datagrid" idField="id" fit="true" queryMode="group">
<t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="创建人名称" field="createName" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="创建人登录名称" field="createBy" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="创建日期" field="createDate" formatter="yyyy-MM-dd" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="更新人名称" field="updateName" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="更新人登录名称" field="updateBy" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="更新日期" field="updateDate" formatter="yyyy-MM-dd" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="所属部门" field="sysOrgCode" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="所属公司" field="sysCompanyCode" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="用户名" field="userName" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="打印类型" field="printType" query="true" queryMode="single" dictionary="print_type" width="120"></t:dgCol>
<t:dgCol title="打印模板" field="printModel" query="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="打印服务器地址" field="printServerAddress" query="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="打印文件类型" field="printFileType" query="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="备用1" field="query1" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="备用2" field="query2" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="备用3" field="query3" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="备用4" field="query4" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="备用5" field="query5" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="操作" field="opt" width="100"></t:dgCol>
<t:dgDelOpt title="删除" url="wmPrintModelController.do?doDel&id={id}" urlclass="ace_button" urlfont="fa-trash-o"/>
<t:dgToolBar title="录入" icon="icon-add" url="wmPrintModelController.do?goAdd" funname="add"></t:dgToolBar>
<t:dgToolBar title="编辑" icon="icon-edit" url="wmPrintModelController.do?goUpdate" funname="update"></t:dgToolBar>
<t:dgToolBar title="批量删除" icon="icon-remove" url="wmPrintModelController.do?doBatchDel" funname="deleteALLSelect"></t:dgToolBar>
<t:dgToolBar title="查看" icon="icon-search" url="wmPrintModelController.do?goUpdate" funname="detail"></t:dgToolBar>
<t:dgToolBar title="导入" icon="icon-put" funname="ImportXls"></t:dgToolBar>
<t:dgToolBar title="导出" icon="icon-putout" funname="ExportXls"></t:dgToolBar>
<t:dgToolBar title="模板下载" icon="icon-putout" funname="ExportXlsByT"></t:dgToolBar>
</t:datagrid>
</div>
</div>
<script src = "webpage/com/zzjee/wm/wmPrintModelList.js"></script>
<script type="text/javascript">
$(document).ready(function(){
});
//导入
function ImportXls() {
openwindow('Excel导入', 'wmPrintModelController.do?upload', "wmPrintModelList");
}
//导出
function ExportXls() {
JeecgExcelExport("wmPrintModelController.do?exportXls","wmPrintModelList");
}
//模板下载
function ExportXlsByT() {
JeecgExcelExport("wmPrintModelController.do?exportXlsByT","wmPrintModelList");
}
</script>