Commit 2c96345b authored by 罗林杰's avatar 罗林杰

修改导出

parent 6f15a6da
...@@ -132,6 +132,6 @@ public class WmsGoodsLogController extends CyPaginationController<WmsGoodsLog> { ...@@ -132,6 +132,6 @@ public class WmsGoodsLogController extends CyPaginationController<WmsGoodsLog> {
case "2": excelName="商品记录表信息.csv";break; case "2": excelName="商品记录表信息.csv";break;
} }
List<WmsGoodsLog> wmsGoodsLogList = wmsGoodsLogServiceImpl.export(wmsGoodsLog); List<WmsGoodsLog> wmsGoodsLogList = wmsGoodsLogServiceImpl.export(wmsGoodsLog);
CyEpExcelUtil.exportExcel(wmsGoodsLogList, "商品记录表信息", "商品记录表信息", WmsGoodsLog.class, excelName, response); CyEpExcelUtil.exportExcel(wmsGoodsLogList, "", "商品记录表信息", WmsGoodsLog.class, excelName, response);
} }
} }
package org.rcisoft.bus.wmsgoodslog.entity; package org.rcisoft.bus.wmsgoodslog.entity;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data; import lombok.Data;
import org.rcisoft.core.entity.CyIdIncreEntity; import org.rcisoft.core.entity.CyIdIncreEntity;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/** /**
* Created with cy on 2024年5月29日 下午1:21:49. * Created with cy on 2024年5月29日 下午1:21:49.
...@@ -14,22 +19,50 @@ import org.rcisoft.core.entity.CyIdIncreEntity; ...@@ -14,22 +19,50 @@ import org.rcisoft.core.entity.CyIdIncreEntity;
public class WmsGoodsLog extends CyIdIncreEntity<WmsGoodsLog> { public class WmsGoodsLog extends CyIdIncreEntity<WmsGoodsLog> {
private String ioType; private String ioType;
@Excel(name = "商品名称", orderNum = "1", width = 20)
private String goodsName; private String goodsName;
@Excel(name = "商品编码", orderNum = "2", width = 20)
private String goodsCode; private String goodsCode;
private Integer applyId; private Integer applyId;
@Excel(name = "数量", orderNum = "8", width = 20)
private Integer goodsCounts; private Integer goodsCounts;
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "发货时间", orderNum = "9", width = 20, format = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date createDate;
private Integer updateCounts; private Integer updateCounts;
private Integer goodsId; private Integer goodsId;
@Excel(name = "货号", orderNum = "3", width = 20)
@TableField(exist = false) @TableField(exist = false)
private String goodsArtNumber; private String goodsArtNumber;
@Excel(name = "款式", orderNum = "5", width = 20)
@TableField(exist = false) @TableField(exist = false)
private String goodsStyle; private String goodsStyle;
@Excel(name = "规格", orderNum = "6", width = 20)
@TableField(exist = false) @TableField(exist = false)
private String goodsNorms; private String goodsNorms;
@Excel(name = "尺码", orderNum = "7", width = 20)
@TableField(exist = false) @TableField(exist = false)
private String goodsSize; private String goodsSize;
@Excel(name = "品牌", orderNum = "4", width = 20)
@TableField(exist = false) @TableField(exist = false)
private String goodsBrand; private String goodsBrand;
@Excel(name = "门店", orderNum = "0", width = 20,replace = {"门店1_5","门店2_6","门店3_7"})
@TableField(exist = false) @TableField(exist = false)
private String outGoods; private String outGoods;
...@@ -40,7 +73,7 @@ public class WmsGoodsLog extends CyIdIncreEntity<WmsGoodsLog> { ...@@ -40,7 +73,7 @@ public class WmsGoodsLog extends CyIdIncreEntity<WmsGoodsLog> {
@JsonIgnore @JsonIgnore
@TableField(exist = false) @TableField(exist = false)
private String endTime; private String endTime;
@JsonIgnore @JsonIgnore
@TableField(exist = false) @TableField(exist = false)
private String maxNum; private String maxNum;
......
...@@ -3,6 +3,7 @@ package org.rcisoft.bus.wmsgoodslog.service.impl; ...@@ -3,6 +3,7 @@ package org.rcisoft.bus.wmsgoodslog.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.rcisoft.bean.AdminProperties;
import org.rcisoft.bus.wmsgoodslog.dao.WmsGoodsLogRepository; import org.rcisoft.bus.wmsgoodslog.dao.WmsGoodsLogRepository;
import org.rcisoft.bus.wmsgoodslog.entity.WmsGoodsLog; import org.rcisoft.bus.wmsgoodslog.entity.WmsGoodsLog;
import org.rcisoft.bus.wmsgoodslog.service.WmsGoodsLogService; import org.rcisoft.bus.wmsgoodslog.service.WmsGoodsLogService;
...@@ -15,7 +16,10 @@ import org.springframework.transaction.annotation.Isolation; ...@@ -15,7 +16,10 @@ import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/** /**
* Created by cy on 2024年5月29日 下午1:21:49. * Created by cy on 2024年5月29日 下午1:21:49.
......
...@@ -28,28 +28,81 @@ ...@@ -28,28 +28,81 @@
</insert> </insert>
<!--<cache type="${corePackag!}.util.RedisCache"/>--> <!--<cache type="${corePackag!}.util.RedisCache"/>-->
<select id="queryWmsGoodsLogs" resultMap="BaseResultMap"> <select id="queryWmsGoodsLogs" resultMap="BaseResultMap">
select * from wms_goods_log select * ,
wga.out_goods as out_goods,
sdd_goods_art_number.dict_label AS goods_art_number,
sdd_goods_brand.dict_label AS goods_brand,
sdd_goods_style.dict_label AS goods_style,
sdd_goods_norms.dict_label AS goods_norms,
sdd_goods_size.dict_label AS goods_size
from wms_goods_log wgl
left join wms_goods wg on wgl.goods_id = wg.business_id
left join wms_goods_apply wga on wgl.apply_id = wga.business_id
LEFT JOIN sys_dict_data sdd_goods_dict_name ON sdd_goods_dict_name.dict_type = 'GOODS_DICT_NAME' AND
sdd_goods_dict_name.dict_value = wg.goods_dict_name AND sdd_goods_dict_name.del_flag = '0'
LEFT JOIN sys_dict_data sdd_goods_art_number ON sdd_goods_art_number.dict_type = 'GOODS_ART_NUMBER' AND
sdd_goods_art_number.dict_value = wg.goods_art_number AND sdd_goods_art_number.del_flag = '0'
LEFT JOIN sys_dict_data sdd_goods_brand ON sdd_goods_brand.dict_type = 'GOODS_BRAND' AND sdd_goods_brand.dict_value =
wg.goods_brand AND sdd_goods_brand.del_flag = '0'
LEFT JOIN sys_dict_data sdd_goods_season ON sdd_goods_season.dict_type = 'GOODS_SEASON' AND sdd_goods_season.dict_value =
wg.goods_season AND sdd_goods_season.del_flag = '0'
LEFT JOIN sys_dict_data sdd_goods_style ON sdd_goods_style.dict_type = 'GOODS_STYLE' AND sdd_goods_style.dict_value =
wg.goods_style AND sdd_goods_style.del_flag = '0'
LEFT JOIN sys_dict_data sdd_goods_colour ON sdd_goods_colour.dict_type = 'GOODS_COLOUR' AND sdd_goods_colour.dict_value =
wg.goods_colour AND sdd_goods_colour.del_flag = '0'
LEFT JOIN sys_dict_data sdd_goods_norms ON sdd_goods_norms.dict_type = 'GOODS_NORMS' AND sdd_goods_norms.dict_value =
wg.goods_norms AND sdd_goods_norms.del_flag = '0'
LEFT JOIN sys_dict_data sdd_goods_size ON sdd_goods_size.dict_type = 'GOODS_SIZE' AND sdd_goods_size.dict_value =
wg.goods_size AND sdd_goods_size.del_flag = '0'
where 1=1 where 1=1
and del_flag = '0' and wgl.del_flag = '0'
and wgl.io_type = '1'
<if test="entity.flag !=null and entity.flag != '' "> <if test="entity.flag !=null and entity.flag != '' ">
and flag = #{entity.flag} and wgl.flag = #{entity.flag}
</if> </if>
<if test="entity.ioType !=null and entity.ioType != '' "> <if test="entity.ioType !=null and entity.ioType != '' ">
and io_type = #{entity.ioType} and wgl.io_type = #{entity.ioType}
</if> </if>
<if test="entity.goodsId !=null and entity.goodsId != '' "> <if test="entity.goodsId !=null and entity.goodsId != '' ">
and goods_id = #{entity.goodsId} and goods_id = #{entity.goodsId}
</if> </if>
<if test="entity.goodsName !=null and entity.goodsName != '' "> <if test="entity.goodsName !=null and entity.goodsName != '' ">
and goods_name like concat('%',#{entity.goodsName},'%') and wgl.goods_name like concat('%',#{entity.goodsName},'%')
</if> </if>
<if test="entity.goodsCode !=null and entity.goodsCode != '' "> <if test="entity.goodsCode !=null and entity.goodsCode != '' ">
and goods_code like concat('%',#{entity.goodsCode},'%') and wgl.goods_code like concat('%',#{entity.goodsCode},'%')
</if>
<if test="entity.outGoods !=null and entity.outGoods != '' ">
and wga.out_goods = #{entity.outGoods}
</if>
<if test="entity.goodsArtNumber !=null and entity.goodsArtNumber != '' ">
and wg.goods_art_number = #{entity.goodsArtNumber}
</if>
<if test="entity.goodsBrand !=null and entity.goodsBrand != '' ">
and wg.goods_brand = #{entity.goodsBrand}
</if> </if>
<if test="entity.applyId !=null and entity.applyId != '' "> <if test="entity.goodsStyle !=null and entity.goodsStyle != '' ">
and apply_id like concat('%',#{entity.applyId},'%') and wg.goods_style = #{entity.goodsStyle}
</if> </if>
ORDER BY business_id DESC <if test="entity.goodsNorms !=null and entity.goodsNorms != '' ">
and wg.goods_norms = #{entity.goodsNorms}
</if>
<if test="entity.goodsSize !=null and entity.goodsSize != '' ">
and wg.goods_size = #{entity.goodsSize}
</if>
<if test="entity.beginTime !=null and entity.beginTime != '' ">
and wgl.create_date &gt;= #{entity.beginTime}
</if>
<if test="entity.endTime !=null and entity.endTime != '' ">
and wgl.create_date &lt;= DATE_ADD(#{entity.endTime}, INTERVAL 1 DAY)
</if>
<if test="entity.maxNum !=null and entity.maxNum != '' ">
and wgl.goods_counts &lt;= #{entity.maxNum}
</if>
<if test="entity.minNum !=null and entity.minNum != '' ">
and wgl.goods_counts &gt;= #{entity.minNum}
</if>
ORDER BY wgl.business_id DESC
</select> </select>
<select id="queryWmsGoodsLogsPaged" resultMap="BaseResultMap"> <select id="queryWmsGoodsLogsPaged" resultMap="BaseResultMap">
......
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