change - 扫描下线报表

master
yinq 9 months ago
parent 07125537e1
commit fda109f122

@ -0,0 +1,59 @@
package com.aucma.report.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.aucma.common.utils.DateUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.aucma.common.annotation.Log;
import com.aucma.common.core.controller.BaseController;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.enums.BusinessType;
import com.aucma.report.domain.ProductOffLine;
import com.aucma.report.service.IProductOffLineService;
import com.aucma.common.utils.poi.ExcelUtil;
import com.aucma.common.core.page.TableDataInfo;
/**
* 线Controller
*
* @author Yinq
* @date 2024-03-05
*/
@RestController
@RequestMapping("/report/productOffLine")
public class ProductOffLineController extends BaseController {
@Autowired
private IProductOffLineService productOffLineService;
/**
* 线
*/
@GetMapping("/list")
public TableDataInfo list(ProductOffLine productOffLine) {
startPage();
List<ProductOffLine> list = productOffLineService.selectProductOffLineList(productOffLine);
return getDataTable(list);
}
/**
* 线
*/
@Log(title = "扫描下线记录报表", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ProductOffLine productOffLine) {
List<ProductOffLine> list = productOffLineService.selectProductOffLineList(productOffLine);
ExcelUtil<ProductOffLine> util = new ExcelUtil<ProductOffLine>(ProductOffLine.class);
util.exportExcel(response, list, "扫描下线记录报表数据");
}
}

@ -0,0 +1,393 @@
package com.aucma.report.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
/**
* 线 product_offline
*
* @author Yinq
* @date 2024-03-05
*/
public class ProductOffLine extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long objId;
/**
*
*/
@Excel(name = "计划工厂")
private String productFactoryCode;
/**
*
*/
@Excel(name = "公司条码")
private String productSncode;
/**
*
*/
@Excel(name = "工单号")
private String productOrderNo;
/**
*
*/
@Excel(name = "销售订单号")
private String productSaleNo;
/**
*
*/
@Excel(name = "销售行号")
private String productSaleLineNo;
/**
*
*/
@Excel(name = "物料编码")
private String productCode;
/**
*
*/
@Excel(name = "产品型号")
private String productModel;
/**
*
*/
@Excel(name = "物料描述")
private String productName;
/**
*
*/
@Excel(name = "产品类型")
private String productType;
/**
*
*/
@Excel(name = "验证组合")
private String productCheckInfo;
/**
*
*/
@Excel(name = "标签特征")
private String productRemark;
/**
*
*/
@Excel(name = "产品条码编码")
private String productBarNo;
/**
*
*/
@Excel(name = "主型号")
private String productMasterModel;
/**
*
*/
@Excel(name = "版本号")
private String productVersion;
/**
*
*/
@Excel(name = "用途位")
private String productUserinfo;
/**
*
*/
@Excel(name = "流通特性")
private String productCirculate;
/**
*
*/
private String productCreatedate;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "扫描时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date productScantime;
/**
*
*/
@Excel(name = "箱体码")
private String boxCode;
/**
* 线
*/
@Excel(name = "产线编号")
private String productLineCode;
/**
* 线
*/
@Excel(name = "产线名称")
private String productLineName;
/**
*
*/
@Excel(name = "工厂名称")
private String factoryName;
/**
*
*/
private String beginBeginTime;
/**
*
*/
private String endBeginTime;
public String getBeginBeginTime() {
return beginBeginTime;
}
public void setBeginBeginTime(String beginBeginTime) {
this.beginBeginTime = beginBeginTime;
}
public String getEndBeginTime() {
return endBeginTime;
}
public void setEndBeginTime(String endBeginTime) {
this.endBeginTime = endBeginTime;
}
public String getProductLineName() {
return productLineName;
}
public void setProductLineName(String productLineName) {
this.productLineName = productLineName;
}
public String getFactoryName() {
return factoryName;
}
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
public void setObjId(Long objId) {
this.objId = objId;
}
public Long getObjId() {
return objId;
}
public void setProductFactoryCode(String productFactoryCode) {
this.productFactoryCode = productFactoryCode;
}
public String getProductFactoryCode() {
return productFactoryCode;
}
public void setProductSncode(String productSncode) {
this.productSncode = productSncode;
}
public String getProductSncode() {
return productSncode;
}
public void setProductOrderNo(String productOrderNo) {
this.productOrderNo = productOrderNo;
}
public String getProductOrderNo() {
return productOrderNo;
}
public void setProductSaleNo(String productSaleNo) {
this.productSaleNo = productSaleNo;
}
public String getProductSaleNo() {
return productSaleNo;
}
public void setProductSaleLineNo(String productSaleLineNo) {
this.productSaleLineNo = productSaleLineNo;
}
public String getProductSaleLineNo() {
return productSaleLineNo;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductCode() {
return productCode;
}
public void setProductModel(String productModel) {
this.productModel = productModel;
}
public String getProductModel() {
return productModel;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductName() {
return productName;
}
public void setProductType(String productType) {
this.productType = productType;
}
public String getProductType() {
return productType;
}
public void setProductCheckInfo(String productCheckInfo) {
this.productCheckInfo = productCheckInfo;
}
public String getProductCheckInfo() {
return productCheckInfo;
}
public void setProductRemark(String productRemark) {
this.productRemark = productRemark;
}
public String getProductRemark() {
return productRemark;
}
public void setProductBarNo(String productBarNo) {
this.productBarNo = productBarNo;
}
public String getProductBarNo() {
return productBarNo;
}
public void setProductMasterModel(String productMasterModel) {
this.productMasterModel = productMasterModel;
}
public String getProductMasterModel() {
return productMasterModel;
}
public void setProductVersion(String productVersion) {
this.productVersion = productVersion;
}
public String getProductVersion() {
return productVersion;
}
public void setProductUserinfo(String productUserinfo) {
this.productUserinfo = productUserinfo;
}
public String getProductUserinfo() {
return productUserinfo;
}
public void setProductCirculate(String productCirculate) {
this.productCirculate = productCirculate;
}
public String getProductCirculate() {
return productCirculate;
}
public void setProductCreatedate(String productCreatedate) {
this.productCreatedate = productCreatedate;
}
public String getProductCreatedate() {
return productCreatedate;
}
public void setProductScantime(Date productScantime) {
this.productScantime = productScantime;
}
public Date getProductScantime() {
return productScantime;
}
public void setBoxCode(String boxCode) {
this.boxCode = boxCode;
}
public String getBoxCode() {
return boxCode;
}
public void setProductLineCode(String productLineCode) {
this.productLineCode = productLineCode;
}
public String getProductLineCode() {
return productLineCode;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("objId", getObjId())
.append("productFactoryCode", getProductFactoryCode())
.append("productSncode", getProductSncode())
.append("productOrderNo", getProductOrderNo())
.append("productSaleNo", getProductSaleNo())
.append("productSaleLineNo", getProductSaleLineNo())
.append("productCode", getProductCode())
.append("productModel", getProductModel())
.append("productName", getProductName())
.append("productType", getProductType())
.append("productCheckInfo", getProductCheckInfo())
.append("productRemark", getProductRemark())
.append("productBarNo", getProductBarNo())
.append("productMasterModel", getProductMasterModel())
.append("productVersion", getProductVersion())
.append("productUserinfo", getProductUserinfo())
.append("productCirculate", getProductCirculate())
.append("productCreatedate", getProductCreatedate())
.append("productScantime", getProductScantime())
.append("boxCode", getBoxCode())
.append("productLineCode", getProductLineCode())
.toString();
}
}

@ -0,0 +1,24 @@
package com.aucma.report.mapper;
import java.util.List;
import com.aucma.report.domain.ProductOffLine;
/**
* 线Mapper
*
* @author Yinq
* @date 2024-03-05
*/
public interface ProductOffLineMapper
{
/**
* 线
*
* @param productOffLine 线
* @return 线
*/
public List<ProductOffLine> selectProductOffLineList(ProductOffLine productOffLine);
}

@ -0,0 +1,25 @@
package com.aucma.report.service;
import java.util.List;
import com.aucma.report.domain.ProductOffLine;
/**
* 线Service
*
* @author Yinq
* @date 2024-03-05
*/
public interface IProductOffLineService
{
/**
* 线
*
* @param productOffLine 线
* @return 线
*/
public List<ProductOffLine> selectProductOffLineList(ProductOffLine productOffLine);
}

@ -0,0 +1,34 @@
package com.aucma.report.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aucma.report.mapper.ProductOffLineMapper;
import com.aucma.report.domain.ProductOffLine;
import com.aucma.report.service.IProductOffLineService;
/**
* 线Service
*
* @author Yinq
* @date 2024-03-05
*/
@Service
public class ProductOffLineServiceImpl implements IProductOffLineService
{
@Autowired
private ProductOffLineMapper productOffLineMapper;
/**
* 线
*
* @param productOffLine 线
* @return 线
*/
@Override
public List<ProductOffLine> selectProductOffLineList(ProductOffLine productOffLine)
{
return productOffLineMapper.selectProductOffLineList(productOffLine);
}
}

@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.aucma.report.mapper.ProductOffLineMapper">
<resultMap type="ProductOffLine" id="ProductOffLineResult">
<result property="objId" column="obj_id"/>
<result property="productFactoryCode" column="product_factory_code"/>
<result property="productSncode" column="product_sncode"/>
<result property="productOrderNo" column="product_order_no"/>
<result property="productSaleNo" column="product_sale_no"/>
<result property="productSaleLineNo" column="product_sale_line_no"/>
<result property="productCode" column="product_code"/>
<result property="productModel" column="product_model"/>
<result property="productName" column="product_name"/>
<result property="productType" column="product_type"/>
<result property="productCheckInfo" column="product_check_info"/>
<result property="productRemark" column="product_remark"/>
<result property="productBarNo" column="product_bar_no"/>
<result property="productMasterModel" column="product_master_model"/>
<result property="productVersion" column="product_version"/>
<result property="productUserinfo" column="product_userinfo"/>
<result property="productCirculate" column="product_circulate"/>
<result property="productCreatedate" column="product_createdate"/>
<result property="productScantime" column="product_scantime"/>
<result property="boxCode" column="box_code"/>
<result property="productLineCode" column="product_line_code"/>
<result property="productLineName" column="product_line_name"/>
<result property="factoryName" column="factory_name"/>
</resultMap>
<sql id="selectProductOffLineVo">
SELECT po.obj_id,
po.product_factory_code,
BF.FACTORY_NAME,
po.product_sncode,
po.product_order_no,
po.product_sale_no,
po.product_sale_line_no,
po.product_code,
po.product_model,
po.product_name,
po.product_type,
po.product_check_info,
po.product_remark,
po.product_bar_no,
po.product_master_model,
po.product_version,
po.product_userinfo,
po.product_circulate,
po.product_createdate,
po.product_scantime,
po.box_code,
po.product_line_code,
PL.PRODUCT_LINE_NAME
FROM VIEW_PRODUCT_OFFLINE po
LEFT JOIN BASE_FACTORY BF ON BF.FACTORY_CODE = po.product_factory_code
LEFT JOIN BASE_PRODUCTLINE PL ON PL.PRODUCT_LINE_CODE = po.product_line_code
</sql>
<select id="selectProductOffLineList" parameterType="ProductOffLine" resultMap="ProductOffLineResult">
<include refid="selectProductOffLineVo"/>
<where>
<if test="productFactoryCode != null and productFactoryCode != ''">and po.product_factory_code =
#{productFactoryCode}
</if>
<if test="productSncode != null and productSncode != ''">and po.product_sncode = #{productSncode}</if>
<if test="productOrderNo != null and productOrderNo != ''">and po.product_order_no = #{productOrderNo}</if>
<if test="productSaleNo != null and productSaleNo != ''">and po.product_sale_no = #{productSaleNo}</if>
<if test="productSaleLineNo != null and productSaleLineNo != ''">and po.product_sale_line_no =
#{productSaleLineNo}
</if>
<if test="productCode != null and productCode != ''">and po.product_code = #{productCode}</if>
<if test="productModel != null and productModel != ''">and po.product_model = #{productModel}</if>
<if test="productName != null and productName != ''">and po.product_name like concat(concat('%',
#{productName}), '%')
</if>
<if test="productType != null and productType != ''">and po.product_type = #{productType}</if>
<if test="productCheckInfo != null and productCheckInfo != ''">and po.product_check_info =
#{productCheckInfo}
</if>
<if test="productRemark != null and productRemark != ''">and po.product_remark = #{productRemark}</if>
<if test="productBarNo != null and productBarNo != ''">and po.product_bar_no = #{productBarNo}</if>
<if test="productMasterModel != null and productMasterModel != ''">and po.product_master_model =
#{productMasterModel}
</if>
<if test="productVersion != null and productVersion != ''">and po.product_version = #{productVersion}</if>
<if test="productUserinfo != null and productUserinfo != ''">and po.product_userinfo = #{productUserinfo}</if>
<if test="productCirculate != null and productCirculate != ''">and po.product_circulate =
#{productCirculate}
</if>
<if test="productCreatedate != null ">and po.product_createdate = #{productCreatedate}</if>
<if test="boxCode != null and boxCode != ''">and po.box_code = #{boxCode}</if>
<if test="productLineCode != null and productLineCode != ''">and po.product_line_code = #{productLineCode}
</if>
<if test="beginBeginTime != null and beginBeginTime != '' and endBeginTime != null and endBeginTime != ''">
AND TO_CHAR(po.product_scantime, 'YYYY-MM-DD HH24:MI:SS') BETWEEN #{beginBeginTime} AND #{endBeginTime}
</if>
</where>
ORDER BY po.product_scantime
</select>
</mapper>
Loading…
Cancel
Save