增加报表模块
parent
d781311066
commit
6e61402388
|
@ -0,0 +1,176 @@
|
||||||
|
package com.zzjee.bireport.controller;
|
||||||
|
import com.zzjee.bireport.entity.RpPeriodInOutEntity;
|
||||||
|
import com.zzjee.bireport.service.RpPeriodInOutServiceI;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.zzjee.wmutil.wmUtil;
|
||||||
|
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 2019-01-17 12:55:46
|
||||||
|
* @version V1.0
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/rpPeriodInOutController")
|
||||||
|
public class RpPeriodInOutController extends BaseController {
|
||||||
|
/**
|
||||||
|
* Logger for this class
|
||||||
|
*/
|
||||||
|
private static final Logger logger = Logger.getLogger(RpPeriodInOutController.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RpPeriodInOutServiceI rpPeriodInOutService;
|
||||||
|
@Autowired
|
||||||
|
private SystemService systemService;
|
||||||
|
@Autowired
|
||||||
|
private Validator validator;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 期间出货统计列表 页面跳转
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping(params = "list")
|
||||||
|
public ModelAndView list(HttpServletRequest request) {
|
||||||
|
return new ModelAndView("com/zzjee/bireport/rpPeriodInOutList");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* easyui AJAX请求数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @param dataGrid
|
||||||
|
* @param user
|
||||||
|
*/
|
||||||
|
|
||||||
|
@RequestMapping(params = "datagrid")
|
||||||
|
public void datagrid(RpPeriodInOutEntity rpPeriodInOut,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
|
||||||
|
CriteriaQuery cq = new CriteriaQuery(RpPeriodInOutEntity.class, dataGrid);
|
||||||
|
//查询条件组装器
|
||||||
|
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, rpPeriodInOut, request.getParameterMap());
|
||||||
|
try{
|
||||||
|
//自定义追加查询条件
|
||||||
|
String query_datePeriod_begin = request.getParameter("datePeriod_begin");
|
||||||
|
String query_datePeriod_end = request.getParameter("datePeriod_end");
|
||||||
|
try{
|
||||||
|
wmUtil.genrp(query_datePeriod_begin,query_datePeriod_end,ResourceUtil.getSessionUserName().getUserName());
|
||||||
|
}catch (Exception e){
|
||||||
|
}
|
||||||
|
if(StringUtil.isNotEmpty(query_datePeriod_begin)){
|
||||||
|
cq.ge("datePeriod", Integer.parseInt(query_datePeriod_begin));
|
||||||
|
}
|
||||||
|
if(StringUtil.isNotEmpty(query_datePeriod_end)){
|
||||||
|
cq.le("datePeriod", Integer.parseInt(query_datePeriod_end));
|
||||||
|
}
|
||||||
|
}catch (Exception e) {
|
||||||
|
throw new BusinessException(e.getMessage());
|
||||||
|
}
|
||||||
|
cq.add();
|
||||||
|
this.rpPeriodInOutService.getDataGridReturn(cq, true);
|
||||||
|
TagUtil.datagrid(response, dataGrid);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
*/
|
||||||
|
@RequestMapping(params = "exportXls")
|
||||||
|
public String exportXls(RpPeriodInOutEntity rpPeriodInOut,HttpServletRequest request,HttpServletResponse response
|
||||||
|
, DataGrid dataGrid,ModelMap modelMap) {
|
||||||
|
//自定义追加查询条件
|
||||||
|
String query_datePeriod_begin = request.getParameter("datePeriod_begin");
|
||||||
|
String query_datePeriod_end = request.getParameter("datePeriod_end");
|
||||||
|
try{
|
||||||
|
wmUtil.genrp(query_datePeriod_begin,query_datePeriod_end,ResourceUtil.getSessionUserName().getUserName());
|
||||||
|
}catch (Exception e){
|
||||||
|
}
|
||||||
|
|
||||||
|
CriteriaQuery cq = new CriteriaQuery(RpPeriodInOutEntity.class, dataGrid);
|
||||||
|
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, rpPeriodInOut, request.getParameterMap());
|
||||||
|
List<RpPeriodInOutEntity> rpPeriodInOuts = this.rpPeriodInOutService.getListByCriteriaQuery(cq,false);
|
||||||
|
modelMap.put(NormalExcelConstants.FILE_NAME,"期间出货统计");
|
||||||
|
modelMap.put(NormalExcelConstants.CLASS,RpPeriodInOutEntity.class);
|
||||||
|
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("期间出货统计列表", "导出人:"+ResourceUtil.getSessionUserName().getRealName(),
|
||||||
|
"导出信息"));
|
||||||
|
modelMap.put(NormalExcelConstants.DATA_LIST,rpPeriodInOuts);
|
||||||
|
return NormalExcelConstants.JEECG_EXCEL_VIEW;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,387 @@
|
||||||
|
package com.zzjee.bireport.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 2019-01-17 12:55:46
|
||||||
|
* @version V1.0
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name = "rp_period_in_out", schema = "")
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public class RpPeriodInOutEntity implements java.io.Serializable {
|
||||||
|
/**主键*/
|
||||||
|
private Integer 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;
|
||||||
|
/**流程状态*/
|
||||||
|
private String bpmStatus;
|
||||||
|
/**期间*/
|
||||||
|
@Excel(name="期间")
|
||||||
|
private String datePeriod;
|
||||||
|
/**用户名*/
|
||||||
|
@Excel(name="用户名")
|
||||||
|
private String username;
|
||||||
|
/**商品编码*/
|
||||||
|
@Excel(name="商品编码")
|
||||||
|
private String goodsId;
|
||||||
|
/**商品名称*/
|
||||||
|
@Excel(name="商品名称")
|
||||||
|
private String goodsName;
|
||||||
|
/**单位*/
|
||||||
|
@Excel(name="单位")
|
||||||
|
private String goodsUnit;
|
||||||
|
/**规格*/
|
||||||
|
@Excel(name="规格")
|
||||||
|
private String goodsGuige;
|
||||||
|
/**入库数量*/
|
||||||
|
@Excel(name="入库数量")
|
||||||
|
private String goodsIn;
|
||||||
|
/**出库数量*/
|
||||||
|
@Excel(name="出库数量")
|
||||||
|
private String goodsOut;
|
||||||
|
/**现库存*/
|
||||||
|
@Excel(name="现库存")
|
||||||
|
private String goodsNow;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*方法: 取得java.lang.Integer
|
||||||
|
*@return: java.lang.Integer 主键
|
||||||
|
*/
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
@Column(name ="ID",nullable=false,length=20)
|
||||||
|
public Integer getId(){
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*方法: 设置java.lang.Integer
|
||||||
|
*@param: java.lang.Integer 主键
|
||||||
|
*/
|
||||||
|
public void setId(Integer 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 ="BPM_STATUS",nullable=true,length=32)
|
||||||
|
public String getBpmStatus(){
|
||||||
|
return this.bpmStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*方法: 设置java.lang.String
|
||||||
|
*@param: java.lang.String 流程状态
|
||||||
|
*/
|
||||||
|
public void setBpmStatus(String bpmStatus){
|
||||||
|
this.bpmStatus = bpmStatus;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*方法: 取得java.lang.String
|
||||||
|
*@return: java.lang.String 期间
|
||||||
|
*/
|
||||||
|
@Column(name ="DATE_PERIOD",nullable=true,length=32)
|
||||||
|
public String getDatePeriod(){
|
||||||
|
return this.datePeriod;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*方法: 设置java.lang.String
|
||||||
|
*@param: java.lang.String 期间
|
||||||
|
*/
|
||||||
|
public void setDatePeriod(String datePeriod){
|
||||||
|
this.datePeriod = datePeriod;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*方法: 取得java.lang.String
|
||||||
|
*@return: java.lang.String 用户名
|
||||||
|
*/
|
||||||
|
@Column(name ="USERNAME",nullable=true,length=32)
|
||||||
|
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 ="GOODS_ID",nullable=true,length=32)
|
||||||
|
public String getGoodsId(){
|
||||||
|
return this.goodsId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*方法: 设置java.lang.String
|
||||||
|
*@param: java.lang.String 商品编码
|
||||||
|
*/
|
||||||
|
public void setGoodsId(String goodsId){
|
||||||
|
this.goodsId = goodsId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*方法: 取得java.lang.String
|
||||||
|
*@return: java.lang.String 商品名称
|
||||||
|
*/
|
||||||
|
@Column(name ="GOODS_NAME",nullable=true,length=32)
|
||||||
|
public String getGoodsName(){
|
||||||
|
return this.goodsName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*方法: 设置java.lang.String
|
||||||
|
*@param: java.lang.String 商品名称
|
||||||
|
*/
|
||||||
|
public void setGoodsName(String goodsName){
|
||||||
|
this.goodsName = goodsName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*方法: 取得java.lang.String
|
||||||
|
*@return: java.lang.String 单位
|
||||||
|
*/
|
||||||
|
@Column(name ="GOODS_UNIT",nullable=true,length=32)
|
||||||
|
public String getGoodsUnit(){
|
||||||
|
return this.goodsUnit;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*方法: 设置java.lang.String
|
||||||
|
*@param: java.lang.String 单位
|
||||||
|
*/
|
||||||
|
public void setGoodsUnit(String goodsUnit){
|
||||||
|
this.goodsUnit = goodsUnit;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*方法: 取得java.lang.String
|
||||||
|
*@return: java.lang.String 规格
|
||||||
|
*/
|
||||||
|
@Column(name ="GOODS_GUIGE",nullable=true,length=32)
|
||||||
|
public String getGoodsGuige(){
|
||||||
|
return this.goodsGuige;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*方法: 设置java.lang.String
|
||||||
|
*@param: java.lang.String 规格
|
||||||
|
*/
|
||||||
|
public void setGoodsGuige(String goodsGuige){
|
||||||
|
this.goodsGuige = goodsGuige;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*方法: 取得java.lang.String
|
||||||
|
*@return: java.lang.String 入库数量
|
||||||
|
*/
|
||||||
|
@Column(name ="GOODS_IN",nullable=true,length=32)
|
||||||
|
public String getGoodsIn(){
|
||||||
|
return this.goodsIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*方法: 设置java.lang.String
|
||||||
|
*@param: java.lang.String 入库数量
|
||||||
|
*/
|
||||||
|
public void setGoodsIn(String goodsIn){
|
||||||
|
this.goodsIn = goodsIn;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*方法: 取得java.lang.String
|
||||||
|
*@return: java.lang.String 出库数量
|
||||||
|
*/
|
||||||
|
@Column(name ="GOODS_OUT",nullable=true,length=32)
|
||||||
|
public String getGoodsOut(){
|
||||||
|
return this.goodsOut;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*方法: 设置java.lang.String
|
||||||
|
*@param: java.lang.String 出库数量
|
||||||
|
*/
|
||||||
|
public void setGoodsOut(String goodsOut){
|
||||||
|
this.goodsOut = goodsOut;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*方法: 取得java.lang.String
|
||||||
|
*@return: java.lang.String 现库存
|
||||||
|
*/
|
||||||
|
@Column(name ="GOODS_NOW",nullable=true,length=32)
|
||||||
|
public String getGoodsNow(){
|
||||||
|
return this.goodsNow;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*方法: 设置java.lang.String
|
||||||
|
*@param: java.lang.String 现库存
|
||||||
|
*/
|
||||||
|
public void setGoodsNow(String goodsNow){
|
||||||
|
this.goodsNow = goodsNow;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.zzjee.bireport.service;
|
||||||
|
import com.zzjee.bireport.entity.RpPeriodInOutEntity;
|
||||||
|
import org.jeecgframework.core.common.service.CommonService;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public interface RpPeriodInOutServiceI extends CommonService{
|
||||||
|
|
||||||
|
public void delete(RpPeriodInOutEntity entity) throws Exception;
|
||||||
|
|
||||||
|
public Serializable save(RpPeriodInOutEntity entity) throws Exception;
|
||||||
|
|
||||||
|
public void saveOrUpdate(RpPeriodInOutEntity entity) throws Exception;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,154 @@
|
||||||
|
package com.zzjee.bireport.service.impl;
|
||||||
|
import com.zzjee.bireport.service.RpPeriodInOutServiceI;
|
||||||
|
import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
|
||||||
|
import com.zzjee.bireport.entity.RpPeriodInOutEntity;
|
||||||
|
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("rpPeriodInOutService")
|
||||||
|
@Transactional
|
||||||
|
public class RpPeriodInOutServiceImpl extends CommonServiceImpl implements RpPeriodInOutServiceI {
|
||||||
|
|
||||||
|
|
||||||
|
public void delete(RpPeriodInOutEntity entity) throws Exception{
|
||||||
|
super.delete(entity);
|
||||||
|
//执行删除操作增强业务
|
||||||
|
this.doDelBus(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Serializable save(RpPeriodInOutEntity entity) throws Exception{
|
||||||
|
Serializable t = super.save(entity);
|
||||||
|
//执行新增操作增强业务
|
||||||
|
this.doAddBus(entity);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void saveOrUpdate(RpPeriodInOutEntity entity) throws Exception{
|
||||||
|
super.saveOrUpdate(entity);
|
||||||
|
//执行更新操作增强业务
|
||||||
|
this.doUpdateBus(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增操作增强业务
|
||||||
|
* @param t
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private void doAddBus(RpPeriodInOutEntity t) throws Exception{
|
||||||
|
//-----------------sql增强 start----------------------------
|
||||||
|
//-----------------sql增强 end------------------------------
|
||||||
|
|
||||||
|
//-----------------java增强 start---------------------------
|
||||||
|
//-----------------java增强 end-----------------------------
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 更新操作增强业务
|
||||||
|
* @param t
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private void doUpdateBus(RpPeriodInOutEntity t) throws Exception{
|
||||||
|
//-----------------sql增强 start----------------------------
|
||||||
|
//-----------------sql增强 end------------------------------
|
||||||
|
|
||||||
|
//-----------------java增强 start---------------------------
|
||||||
|
//-----------------java增强 end-----------------------------
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 删除操作增强业务
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private void doDelBus(RpPeriodInOutEntity t) throws Exception{
|
||||||
|
//-----------------sql增强 start----------------------------
|
||||||
|
//-----------------sql增强 end------------------------------
|
||||||
|
|
||||||
|
//-----------------java增强 start---------------------------
|
||||||
|
//-----------------java增强 end-----------------------------
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<String,Object> populationMap(RpPeriodInOutEntity 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("bpm_status", t.getBpmStatus());
|
||||||
|
map.put("date_period", t.getDatePeriod());
|
||||||
|
map.put("username", t.getUsername());
|
||||||
|
map.put("goods_id", t.getGoodsId());
|
||||||
|
map.put("goods_name", t.getGoodsName());
|
||||||
|
map.put("goods_unit", t.getGoodsUnit());
|
||||||
|
map.put("goods_guige", t.getGoodsGuige());
|
||||||
|
map.put("goods_in", t.getGoodsIn());
|
||||||
|
map.put("goods_out", t.getGoodsOut());
|
||||||
|
map.put("goods_now", t.getGoodsNow());
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 替换sql中的变量
|
||||||
|
* @param sql
|
||||||
|
* @param t
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String replaceVal(String sql,RpPeriodInOutEntity 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("#{bpm_status}",String.valueOf(t.getBpmStatus()));
|
||||||
|
sql = sql.replace("#{date_period}",String.valueOf(t.getDatePeriod()));
|
||||||
|
sql = sql.replace("#{username}",String.valueOf(t.getUsername()));
|
||||||
|
sql = sql.replace("#{goods_id}",String.valueOf(t.getGoodsId()));
|
||||||
|
sql = sql.replace("#{goods_name}",String.valueOf(t.getGoodsName()));
|
||||||
|
sql = sql.replace("#{goods_unit}",String.valueOf(t.getGoodsUnit()));
|
||||||
|
sql = sql.replace("#{goods_guige}",String.valueOf(t.getGoodsGuige()));
|
||||||
|
sql = sql.replace("#{goods_in}",String.valueOf(t.getGoodsIn()));
|
||||||
|
sql = sql.replace("#{goods_out}",String.valueOf(t.getGoodsOut()));
|
||||||
|
sql = sql.replace("#{goods_now}",String.valueOf(t.getGoodsNow()));
|
||||||
|
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("rp_period_in_out",data);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new Exception("执行JAVA增强出现异常!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -209,6 +209,16 @@ public class WmInQmIController extends BaseController {
|
||||||
List<WmInQmIEntity> WmInQmIEntityList = systemService.findHql(hql0,
|
List<WmInQmIEntity> WmInQmIEntityList = systemService.findHql(hql0,
|
||||||
id);// 获取行项目
|
id);// 获取行项目
|
||||||
for (WmInQmIEntity wmInQmIEntity : WmInQmIEntityList) {
|
for (WmInQmIEntity wmInQmIEntity : WmInQmIEntityList) {
|
||||||
|
|
||||||
|
try{
|
||||||
|
WmToUpGoodsEntity wmToUpGoodsEntityold = systemService.findUniqueByProperty(WmToUpGoodsEntity.class,"orderIdI",wmInQmIEntity.getId());
|
||||||
|
if (wmToUpGoodsEntityold!=null){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
WmToUpGoodsEntity wmToUpGoodsEntity = new WmToUpGoodsEntity();
|
WmToUpGoodsEntity wmToUpGoodsEntity = new WmToUpGoodsEntity();
|
||||||
wmToUpGoodsEntity.setGoodsId(wmInQmIEntity.getGoodsId());
|
wmToUpGoodsEntity.setGoodsId(wmInQmIEntity.getGoodsId());
|
||||||
wmToUpGoodsEntity.setGoodsProData(wmInQmIEntity.getProData());
|
wmToUpGoodsEntity.setGoodsProData(wmInQmIEntity.getProData());
|
||||||
|
|
|
@ -40,6 +40,17 @@ public class wmUtil {
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void genrp(String datafrom,String datato,String username){
|
||||||
|
SystemService systemService =ApplicationContextUtil.getContext().getBean(SystemService.class);
|
||||||
|
|
||||||
|
String tsql = "call update_rp_period_in_out("+"'"+datafrom+"',"+"'"+datato+"',"+"'"+username+"'"+")";
|
||||||
|
try {
|
||||||
|
systemService.executeSql(tsql);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO: handle exception
|
||||||
|
}
|
||||||
|
}
|
||||||
public static String getNextNoticeid(String orderType){
|
public static String getNextNoticeid(String orderType){
|
||||||
String noticeid=null;
|
String noticeid=null;
|
||||||
SystemService systemService =ApplicationContextUtil.getContext().getBean(SystemService.class);
|
SystemService systemService =ApplicationContextUtil.getContext().getBean(SystemService.class);
|
||||||
|
|
|
@ -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="rpPeriodInOutList" checkbox="false" pagination="true" fitColumns="false" title="期间出货统计" actionUrl="rpPeriodInOutController.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="bpmStatus" hidden="true" queryMode="single" dictionary="bpm_status" width="120"></t:dgCol>
|
||||||
|
<t:dgCol title="期间" field="datePeriod" formatter="yyyy-MM-dd" query="true" queryMode="group" width="120"></t:dgCol>
|
||||||
|
<t:dgCol title="用户名" field="username" queryMode="single" width="120"></t:dgCol>
|
||||||
|
<t:dgCol title="商品编码" field="goodsId" query="true" queryMode="single" width="120"></t:dgCol>
|
||||||
|
<t:dgCol title="商品名称" field="goodsName" query="true" queryMode="single" width="220"></t:dgCol>
|
||||||
|
<t:dgCol title="单位" field="goodsUnit" queryMode="single" width="120"></t:dgCol>
|
||||||
|
<t:dgCol title="规格" field="goodsGuige" queryMode="single" width="120"></t:dgCol>
|
||||||
|
<t:dgCol title="入库数量" field="goodsIn" queryMode="single" width="120"></t:dgCol>
|
||||||
|
<t:dgCol title="出库数量" field="goodsOut" queryMode="single" width="120"></t:dgCol>
|
||||||
|
<t:dgCol title="现库存" field="goodsNow" queryMode="single" width="120"></t:dgCol>
|
||||||
|
<%--<t:dgCol title="操作" field="opt" width="100"></t:dgCol>--%>
|
||||||
|
<%--<t:dgDelOpt title="删除" url="rpPeriodInOutController.do?doDel&id={id}" urlclass="ace_button" urlfont="fa-trash-o"/>--%>
|
||||||
|
<%--<t:dgToolBar title="录入" icon="icon-add" url="rpPeriodInOutController.do?goAdd" funname="add"></t:dgToolBar>--%>
|
||||||
|
<%--<t:dgToolBar title="编辑" icon="icon-edit" url="rpPeriodInOutController.do?goUpdate" funname="update"></t:dgToolBar>--%>
|
||||||
|
<%--<t:dgToolBar title="批量删除" icon="icon-remove" url="rpPeriodInOutController.do?doBatchDel" funname="deleteALLSelect"></t:dgToolBar>--%>
|
||||||
|
<%--<t:dgToolBar title="查看" icon="icon-search" url="rpPeriodInOutController.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/bireport/rpPeriodInOutList.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//导入
|
||||||
|
function ImportXls() {
|
||||||
|
openuploadwin('Excel导入', 'rpPeriodInOutController.do?upload', "rpPeriodInOutList");
|
||||||
|
}
|
||||||
|
|
||||||
|
//导出
|
||||||
|
function ExportXls() {
|
||||||
|
JeecgExcelExport("rpPeriodInOutController.do?exportXls","rpPeriodInOutList");
|
||||||
|
}
|
||||||
|
|
||||||
|
//模板下载
|
||||||
|
function ExportXlsByT() {
|
||||||
|
JeecgExcelExport("rpPeriodInOutController.do?exportXlsByT","rpPeriodInOutList");
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
Loading…
Reference in New Issue