优化商品导出功能

This commit is contained in:
季圣华
2020-06-06 00:35:46 +08:00
parent 761721ec91
commit 0dde92a035
2 changed files with 11 additions and 7 deletions

View File

@@ -288,7 +288,7 @@ public class MaterialController {
try {
List<MaterialVo4Unit> dataList = materialService.findByAll(StringUtil.toNull(name), StringUtil.toNull(model),
StringUtil.toNull(categoryIds));
String[] names = {"名称", "类型", "型号", "安全存量", "单位", "零售价", "最低售价", "预计采购价", "批发", "备注", "状态"};
String[] names = {"名称", "类型", "型号", "安全存量", "单位", "零售价", "最低售价", "采购价", "销售", "备注", "状态"};
String title = "商品信息";
List<String[]> objects = new ArrayList<String[]>();
if (null != dataList) {
@@ -298,11 +298,11 @@ public class MaterialController {
objs[1] = m.getCategoryName();
objs[2] = m.getModel();
objs[3] = m.getSafetystock() == null? "" : m.getSafetystock().toString();
objs[4] = m.getUnit();
objs[5] = "";
objs[6] = "";
objs[7] = "";
objs[8] = "";
objs[4] = m.getCommodityUnit();
objs[5] = m.getCommodityDecimal() == null? "" : m.getCommodityDecimal().toString();
objs[6] = m.getLowDecimal() == null? "" : m.getLowDecimal().toString();
objs[7] = m.getPurchaseDecimal() == null? "" : m.getPurchaseDecimal().toString();
objs[8] = m.getWholesaleDecimal() == null? "" : m.getWholesaleDecimal().toString();
objs[9] = m.getRemark();
objs[10] = m.getEnabled() ? "启用" : "禁用";
objects.add(objs);

View File

@@ -5,6 +5,7 @@
<result column="unitName" jdbcType="VARCHAR" property="unitName" />
<result column="categoryName" jdbcType="VARCHAR" property="categoryName" />
<result column="bar_code" jdbcType="VARCHAR" property="mBarCode" />
<result column="commodity_unit" jdbcType="VARCHAR" property="commodityUnit" />
<result column="purchase_decimal" jdbcType="VARCHAR" property="purchaseDecimal" />
<result column="commodity_decimal" jdbcType="VARCHAR" property="commodityDecimal" />
<result column="wholesale_decimal" jdbcType="VARCHAR" property="wholesaleDecimal" />
@@ -124,11 +125,14 @@
</select>
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultMapList">
select m.*,u.uname unitName, mc.name categoryName
select m.*,u.uname unitName, mc.name categoryName,me.commodity_unit,me.purchase_decimal, me.commodity_decimal,
me.wholesale_decimal, me.low_decimal
FROM jsh_material m
left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
left JOIN jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1'
left JOIN jsh_materialcategory mc on m.CategoryId = mc.id and ifnull(mc.status,'0') !='2'
where 1=1
and me.default_flag=1
<if test="name != null">
and m.name like '%${name}%'
</if>