给报表里面增加规格展示

This commit is contained in:
季圣华 2020-12-26 00:20:00 +08:00
parent 56bc53c235
commit 3f2a592efa
30 changed files with 89 additions and 101 deletions

View File

@ -271,8 +271,6 @@
/**
* create by: qiankunpingtai
* create time: 2019/3/21 14:56
* websitehttps://qiankunpingtai.cn
* description:
* 提交时需要对表格内容进行校验校验通过后提交后台处理
*/
var isValid = $("#organizationFM").form('validate');

View File

@ -132,6 +132,7 @@
pageList: [10, 50, 100],
columns: [[
{title: '名称', field: 'MaterialName', width: 160},
{title: '规格', field: 'MaterialStandard', width: 80},
{title: '型号', field: 'MaterialModel', width: 80},
{title: '扩展信息', field: 'MaterialOther', width: 150},
{title: '单位', field: 'MaterialUnit', width: 80,

View File

@ -191,8 +191,9 @@
return '<a class="n-link" onclick="turnBillDetailPage(\'' + row.number + '\''+',\'' + row.newType + '\');">' + row.number + '</a>';
}
},
{title: '商品名称', field: 'mname', width: 120},
{title: '商品型号', field: 'model', width: 100},
{title: '名称', field: 'mname', width: 120},
{title: '规格', field: 'standard', width: 100},
{title: '型号', field: 'model', width: 100},
{title: '单价', field: 'unitPrice', width: 60},
{title: '入库数量', field: 'operNumber', width: 80},
{title: '金额', field: 'allPrice', width: 60},

View File

@ -183,9 +183,10 @@
pageSize: 10,
pageList: [10, 50, 100],
columns: [[
{title: '商品名称', field: 'mName', width: 150},
{title: '商品型号', field: 'model', width: 150},
{title: '商品类型', field: 'categoryName', width: 120},
{title: '名称', field: 'mName', width: 150},
{title: '规格', field: 'standard', width: 100},
{title: '型号', field: 'model', width: 100},
{title: '类型', field: 'categoryName', width: 120},
{title: '入库数量', field: 'numSum', width: 120},
{title: '入库金额', field: 'priceSum', width: 120}
]],

View File

@ -235,6 +235,7 @@
pageList: [10, 50, 100],
columns: [[
{title: '名称', field: 'MaterialName', width: 160},
{title: '规格', field: 'MaterialStandard', width: 80},
{title: '型号', field: 'MaterialModel', width: 80},
{title: '扩展信息', field: 'MaterialOther', width: 120},
{title: '单位', field: 'unitName', width: 80},
@ -370,7 +371,7 @@
if (count.lastIndexOf('.') > -1) {
count = count.substring(0, count.lastIndexOf('.') + 3);
}
$("#tablePanel .total-count").text("本月合计金额:" + count + "");//本月合计金额
$("#tablePanel .total-count").text("本月合计金额" + count + "");//本月合计金额
}
}
},

View File

@ -191,8 +191,9 @@
return '<a class="n-link" onclick="turnBillDetailPage(\'' + row.number + '\''+',\'' + row.newType + '\');">' + row.number + '</a>';
}
},
{title: '商品名称', field: 'mname', width: 120},
{title: '商品型号', field: 'model', width: 100},
{title: '名称', field: 'mname', width: 120},
{title: '规格', field: 'standard', width: 100},
{title: '型号', field: 'model', width: 100},
{title: '单价', field: 'unitPrice', width: 60},
{title: '出库数量', field: 'operNumber', width: 80},
{title: '金额', field: 'allPrice', width: 60},

View File

@ -183,9 +183,10 @@
pageSize: 10,
pageList: [10, 50, 100],
columns: [[
{title: '商品名称', field: 'mName', width: 150},
{title: '商品型号', field: 'model', width: 150},
{title: '商品类型', field: 'categoryName', width: 120},
{title: '名称', field: 'mName', width: 150},
{title: '规格', field: 'standard', width: 100},
{title: '型号', field: 'model', width: 100},
{title: '类型', field: 'categoryName', width: 120},
{title: '出库数量', field: 'numSum', width: 120},
{title: '出库金额', field: 'priceSum', width: 120}
]],

View File

@ -136,6 +136,7 @@
pageList: [10, 50, 100],
columns: [[
{title: '名称', field: 'MaterialName', width: 160},
{title: '规格', field: 'MaterialStandard', width: 80},
{title: '型号', field: 'MaterialModel', width: 80},
{title: '扩展信息', field: 'MaterialOther', width: 150},
{title: '单位', field: 'MaterialUnit', width: 80,

View File

@ -203,6 +203,7 @@
pageList: [10, 50, 100],
columns: [[
{title: '名称', field: 'materialName', width: 160},
{title: '规格', field: 'materialStandard', width: 80},
{title: '型号', field: 'materialModel', width: 80},
{title: '扩展信息', field: 'materialOther', width: 150},
{title: '单位', field: 'materialUnit', width: 80},

View File

@ -265,6 +265,7 @@ public class DepotItemController {
Long mId = diEx.getMId();
item.put("MaterialName", diEx.getMName());
item.put("MaterialModel", diEx.getMModel());
item.put("MaterialStandard", diEx.getMStandard());
//扩展信息
String materialOther = getOtherInfo(mpArr, diEx);
item.put("MaterialOther", materialOther);
@ -326,23 +327,24 @@ public class DepotItemController {
List<DepotItemVo4WithInfoEx> dataList = depotItemService.findByAll(StringUtil.toNull(name), StringUtil.toNull(model),
timeB, (currentPage-1)*pageSize, pageSize);
//存放数据json数组
String[] names = {"名称", "型号", "单位", "单价", "上月结存数量", "入库数量", "出库数量", "本月结存数量", "结存金额"};
String[] names = {"名称", "规格", "型号", "单位", "单价", "上月结存数量", "入库数量", "出库数量", "本月结存数量", "结存金额"};
String title = "库存报表";
List<String[]> objects = new ArrayList<String[]>();
if (null != dataList) {
for (DepotItemVo4WithInfoEx diEx : dataList) {
Long mId = diEx.getMId();
String[] objs = new String[9];
objs[0] = diEx.getMName().toString();
objs[1] = diEx.getMModel().toString();
objs[2] = diEx.getMaterialUnit().toString();
objs[3] = diEx.getPurchaseDecimal().toString();
objs[4] = depotItemService.getStockByParam(depotId,mId,null,timeA,tenantId).toString();
objs[5] = depotItemService.getInNumByParam(depotId,mId,timeA,timeB,tenantId).toString();
objs[6] = depotItemService.getOutNumByParam(depotId,mId,timeA,timeB,tenantId).toString();
String[] objs = new String[10];
objs[0] = diEx.getMName();
objs[1] = diEx.getMStandard();
objs[2] = diEx.getMModel();
objs[3] = diEx.getMaterialUnit();
objs[4] = diEx.getPurchaseDecimal().toString();
objs[5] = depotItemService.getStockByParam(depotId,mId,null,timeA,tenantId).toString();
objs[6] = depotItemService.getInNumByParam(depotId,mId,timeA,timeB,tenantId).toString();
objs[7] = depotItemService.getOutNumByParam(depotId,mId,timeA,timeB,tenantId).toString();
BigDecimal thisSum = depotItemService.getStockByParam(depotId,mId,null,timeB,tenantId);
objs[7] = thisSum.toString();
objs[8] = thisSum.multiply(diEx.getPurchaseDecimal()).toString();
objs[8] = thisSum.toString();
objs[9] = thisSum.multiply(diEx.getPurchaseDecimal()).toString();
objects.add(objs);
}
}
@ -434,6 +436,7 @@ public class DepotItemController {
BigDecimal OutSumPrice = depotItemService.buyOrSale("出库", "采购退货", diEx.getMId(), monthTime, "price");
item.put("MaterialName", diEx.getMName());
item.put("MaterialModel", diEx.getMModel());
item.put("MaterialStandard", diEx.getMStandard());
//扩展信息
String materialOther = getOtherInfo(mpArr, diEx);
item.put("MaterialOther", materialOther);
@ -502,6 +505,7 @@ public class DepotItemController {
BigDecimal OutInSumPrice = (OutSumRetailPrice.add(OutSumPrice)).subtract(InSumRetailPrice.add(InSumPrice));
item.put("MaterialName", diEx.getMName());
item.put("MaterialModel", diEx.getMModel());
item.put("MaterialStandard", diEx.getMStandard());
//扩展信息
String materialOther = getOtherInfo(mpArr, diEx);
item.put("MaterialOther", materialOther);
@ -543,34 +547,8 @@ public class DepotItemController {
return unitName;
}
/**
* 获取单价
* @param presetPriceOne
* @param priceStrategy
* @return
*/
public BigDecimal getUnitPrice(BigDecimal presetPriceOne, String priceStrategy) {
BigDecimal unitPrice = BigDecimal.ZERO;
if(presetPriceOne != null) {
DecimalFormat df = new DecimalFormat("#.00");
unitPrice = new BigDecimal(df.format(presetPriceOne));
} else {
JSONArray priceArr = JSONArray.parseArray(priceStrategy);
if(priceArr!=null && priceArr.get(0)!=null) {
JSONObject priceObj = JSONObject.parseObject(priceArr.get(0).toString());
BigDecimal basicPresetPriceOne = priceObj.getJSONObject("basic").getBigDecimal("PresetPriceOne");
if(basicPresetPriceOne!=null) {
unitPrice = basicPresetPriceOne;
}
}
}
return unitPrice;
}
/**
* create by: qiankunpingtai
* websitehttps://qiankunpingtai.cn
* description:
* 批量删除单据明细信息
* create time: 2019/3/29 11:15
* @Param: ids
@ -600,7 +578,6 @@ public class DepotItemController {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
try {
List<DepotItemStockWarningCount> resList = new ArrayList<DepotItemStockWarningCount>();
List<DepotItemStockWarningCount> list = depotItemService.findStockWarningCount((currentPage-1)*pageSize, pageSize,pid);
int total = depotItemService.findStockWarningCountTotal(pid);
map.put("total", total);
@ -635,21 +612,22 @@ public class DepotItemController {
List<DepotItemStockWarningCount> dataList = depotItemService.findStockWarningCount((currentPage - 1) * pageSize, pageSize, projectId);
//存放数据json数组
Integer pid = projectId;
String[] names = {"名称", "型号", "扩展信息", "单位", "入库数量", "出库数量", "库存数量", "安全库存量", "临界库存量"};
String[] names = {"名称", "规格", "型号", "扩展信息", "单位", "入库数量", "出库数量", "库存数量", "安全库存量", "临界库存量"};
String title = "库存预警报表";
List<String[]> objects = new ArrayList<String[]>();
if (null != dataList) {
for (DepotItemStockWarningCount diEx : dataList) {
String[] objs = new String[9];
objs[0] = diEx.getMaterialName().toString();
objs[1] = diEx.getMaterialModel().toString();
objs[2] = diEx.getMaterialOther().toString();
objs[3] = diEx.getMaterialUnit().toString();
objs[4] = diEx.getBasicInNumber().toString();
objs[5] = diEx.getBasicOutNumber() == null ? "0" : diEx.getBasicOutNumber().toString();
objs[6] = diEx.getBasicNumber() == null ? "0" : diEx.getBasicNumber().toString();
objs[7] = diEx.getSafetystock() == null ? "0" : diEx.getSafetystock().toString();
objs[8] = diEx.getBasicLinjieNumber() == null ? "0" : diEx.getBasicLinjieNumber().toString();
String[] objs = new String[10];
objs[0] = diEx.getMaterialName();
objs[1] = diEx.getMaterialStandard();
objs[2] = diEx.getMaterialModel();
objs[3] = diEx.getMaterialOther();
objs[4] = diEx.getMaterialUnit();
objs[5] = diEx.getBasicInNumber().toString();
objs[6] = diEx.getBasicOutNumber() == null ? "0" : diEx.getBasicOutNumber().toString();
objs[7] = diEx.getBasicNumber() == null ? "0" : diEx.getBasicNumber().toString();
objs[8] = diEx.getSafetystock() == null ? "0" : diEx.getSafetystock().toString();
objs[9] = diEx.getBasicLinjieNumber() == null ? "0" : diEx.getBasicLinjieNumber().toString();
objects.add(objs);
}
}

View File

@ -12,6 +12,8 @@ public class DepotHeadVo4InDetail {
private String Model;
private String standard;
private BigDecimal UnitPrice;
private BigDecimal OperNumber;
@ -52,6 +54,14 @@ public class DepotHeadVo4InDetail {
Model = model;
}
public String getStandard() {
return standard;
}
public void setStandard(String standard) {
this.standard = standard;
}
public BigDecimal getUnitPrice() {
return UnitPrice;
}

View File

@ -11,6 +11,8 @@ public class DepotHeadVo4InOutMCount {
private String Model;
private String standard;
private String categoryName;
private BigDecimal numSum;
@ -43,6 +45,14 @@ public class DepotHeadVo4InOutMCount {
Model = model;
}
public String getStandard() {
return standard;
}
public void setStandard(String standard) {
this.standard = standard;
}
public String getCategoryName() {
return categoryName;
}

View File

@ -5,11 +5,12 @@ import java.math.BigDecimal;
public class DepotItemStockWarningCount {
private String MaterialName;
private String MaterialModel;
private String MaterialStandard;
private String categoryName;
private String MaterialOther;
@ -43,6 +44,14 @@ public class DepotItemStockWarningCount {
MaterialModel = materialModel;
}
public String getMaterialStandard() {
return MaterialStandard;
}
public void setMaterialStandard(String materialStandard) {
MaterialStandard = materialStandard;
}
public String getCategoryName() {
return categoryName;
}

View File

@ -38,8 +38,6 @@ public class GlobalExceptionHandler {
/**
* create by: qiankunpingtai
* create time: 2019/4/18 17:41
* websitehttps://qiankunpingtai.cn
* description:
* 这里输出完整的堆栈信息否则有些异常完全不知道哪里出错了
*/
log.error("Global Exception Occured => url : {}", request.getRequestURL(), e);

View File

@ -475,8 +475,6 @@ public class AccountService {
}
/**
* create by: qiankunpingtai
* websitehttps://qiankunpingtai.cn
* description:
* 正常删除要考虑数据完整性进行完整性校验
* create time: 2019/4/10 10:31
* @Param: ids

View File

@ -331,8 +331,6 @@ public class AccountHeadService {
}
/**
* create by: qiankunpingtai
* websitehttps://qiankunpingtai.cn
* description:
* 正常删除要考虑数据完整性进行完整性校验
* create time: 2019/4/10 15:49
* @Param: ids

View File

@ -229,8 +229,6 @@ public class DepotService {
}
/**
* create by: qiankunpingtai
* websitehttps://qiankunpingtai.cn
* description:
* 正常删除要考虑数据完整性进行完整性校验
* create time: 2019/4/10 16:52
* @Param: ids

View File

@ -441,7 +441,6 @@ public class DepotItemService {
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public List<DepotItemStockWarningCount> findStockWarningCount(int offset, Integer rows, Integer pid) {
List<DepotItemStockWarningCount> list = null;
try{
list =depotItemMapperEx.findStockWarningCount( offset, rows, pid);

View File

@ -205,8 +205,6 @@ public class InOutItemService {
}
/**
* create by: qiankunpingtai
* websitehttps://qiankunpingtai.cn
* description:
* 正常删除要考虑数据完整性进行完整性校验
* create time: 2019/4/10 16:23
* @Param: ids

View File

@ -680,8 +680,6 @@ public class MaterialService {
}
/**
* create by: qiankunpingtai
* websitehttps://qiankunpingtai.cn
* description:
* 正常删除要考虑数据完整性进行完整性校验
* create time: 2019/4/10 18:00
* @Param: ids

View File

@ -350,8 +350,6 @@ public class MaterialCategoryService {
/**
* create by: qiankunpingtai
* websitehttps://qiankunpingtai.cn
* description:
* 正常删除要考虑数据完整性进行完整性校验
* create time: 2019/4/11 9:26
* @Param: ids

View File

@ -182,8 +182,6 @@ public class MsgService {
/**
* create by: qiankunpingtai
* websitehttps://qiankunpingtai.cn
* description:
* 逻辑删除角色信息
* create time: 2019/3/28 15:44
* @Param: ids

View File

@ -224,8 +224,6 @@ public class PersonService {
}
/**
* create by: qiankunpingtai
* websitehttps://qiankunpingtai.cn
* description:
* 正常删除要考虑数据完整性进行完整性校验
* create time: 2019/4/10 15:14
* @Param: ids

View File

@ -177,8 +177,6 @@ public class RoleService {
}
/**
* create by: qiankunpingtai
* websitehttps://qiankunpingtai.cn
* description:
* 逻辑删除角色信息
* create time: 2019/3/28 15:44
* @Param: ids

View File

@ -515,8 +515,6 @@ public class SerialNumberService {
}
/**
* create by: qiankunpingtai
* websitehttps://qiankunpingtai.cn
* description:
* 逻辑删除序列号信息
* create time: 2019/3/27 17:43
* @Param: ids

View File

@ -379,8 +379,6 @@ public class SupplierService {
}
/**
* create by: qiankunpingtai
* websitehttps://qiankunpingtai.cn
* description:
*正常删除要考虑数据完整性进行完整性校验
* create time: 2019/4/10 14:48
* @Param: ids

View File

@ -188,8 +188,6 @@ public class UnitService {
/**
* create by: qiankunpingtai
* websitehttps://qiankunpingtai.cn
* description:
* 正常删除要考虑数据完整性进行完整性校验
* create time: 2019/4/11 10:20
* @Param: ids

View File

@ -450,8 +450,6 @@ public class UserService {
/**
* create by: qiankunpingtai
* create time: 2019/4/9 18:00
* websitehttps://qiankunpingtai.cn
* description:
* 多次创建事务事物之间无法协同应该在入口处创建一个事务以做协调
*/
if(BusinessConstants.DEFAULT_MANAGER.equals(ue.getLoginName())) {

View File

@ -12,6 +12,7 @@
<result column="Number" jdbcType="VARCHAR" property="Number" />
<result column="MName" jdbcType="VARCHAR" property="MName" />
<result column="Model" jdbcType="VARCHAR" property="Model" />
<result column="standard" jdbcType="VARCHAR" property="standard" />
<result column="unit_price" jdbcType="DECIMAL" property="UnitPrice" />
<result column="oper_number" jdbcType="DECIMAL" property="OperNumber" />
<result column="all_price" jdbcType="DECIMAL" property="AllPrice" />
@ -25,6 +26,7 @@
<result column="MaterialId" jdbcType="BIGINT" property="MaterialId" />
<result column="mName" jdbcType="VARCHAR" property="mName" />
<result column="Model" jdbcType="VARCHAR" property="Model" />
<result column="standard" jdbcType="VARCHAR" property="standard" />
<result column="categoryName" jdbcType="VARCHAR" property="categoryName" />
<result column="numSum" jdbcType="DECIMAL" property="numSum" />
<result column="priceSum" jdbcType="DECIMAL" property="priceSum" />
@ -136,7 +138,7 @@
</select>
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap">
select dh.number,m.`name` MName,m.model,di.unit_price,di.oper_number,di.all_price,s.supplier SName,d.dName DName,
select dh.number,m.`name` MName,m.model,m.standard,di.unit_price,di.oper_number,di.all_price,s.supplier SName,d.dName DName,
date_format(dh.oper_time, '%Y-%m-%d') OperTime, concat(dh.sub_type,dh.type) as NewType
from jsh_depot_head dh
inner join jsh_depot_item di on di.header_id=dh.id and ifnull(di.delete_flag,'0') !='1'
@ -188,8 +190,7 @@
</select>
<select id="findInOutMaterialCount" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultInOutMaterialCount">
select di.material_id, m.mName,m.Model,m.categoryName,
select di.material_id, m.mName,m.Model,m.standard,m.categoryName,
(select sum(jdi.basic_number) numSum from jsh_depot_head jdh
INNER JOIN jsh_depot_item jdi on jdh.id=jdi.header_id and ifnull(jdi.delete_flag,'0') !='1'
where jdi.material_id=di.material_id
@ -223,7 +224,7 @@
) priceSum
from jsh_depot_head dh
INNER JOIN jsh_depot_item di on dh.id=di.header_id and ifnull(di.delete_flag,'0') !='1'
INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,jsh_material_category.`Name` categoryName
INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model, standard, jsh_material_category.`Name` categoryName
from jsh_material
LEFT JOIN jsh_material_category on jsh_material.category_id=jsh_material_category.Id and ifnull(jsh_material_category.status,'0') !='2'
where ifnull(jsh_material.delete_Flag,'0') !='1'
@ -239,7 +240,7 @@
and di.depot_id in (${dids})
</if>
and ifnull(dh.delete_flag,'0') !='1'
GROUP BY di.material_id,m.mName,m.Model,m.categoryName
GROUP BY di.material_id,m.mName,m.Model,m.standard,m.categoryName
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
@ -247,9 +248,9 @@
<select id="findInOutMaterialCountTotal" resultType="java.lang.Integer">
select count(1) from
(select di.material_id, m.mName,m.Model,m.categoryName from jsh_depot_head dh
(select di.material_id, m.mName,m.Model,m.standard,m.categoryName from jsh_depot_head dh
INNER JOIN jsh_depot_item di on dh.id=di.header_id and ifnull(di.delete_flag,'0') !='1'
INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,jsh_material_category.`Name` categoryName
INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,standard,jsh_material_category.`Name` categoryName
from jsh_material
LEFT JOIN jsh_material_category on jsh_material.category_id=jsh_material_category.Id and ifnull(jsh_material_category.status,'0') !='2'
where ifnull(jsh_material.delete_Flag,'0') !='1'
@ -264,7 +265,7 @@
and di.depot_id in (${dids})
</if>
and ifnull(dh.delete_flag,'0') !='1'
GROUP BY di.material_id,m.mName,m.Model,m.categoryName) a
GROUP BY di.material_id,m.mName,m.Model,m.standard,m.categoryName) a
</select>
<select id="findStatementAccount" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultStatementAccount">

View File

@ -39,6 +39,7 @@
<result column="MName" jdbcType="VARCHAR" property="MName" />
<result column="MMfrs" jdbcType="VARCHAR" property="MMfrs" />
<result column="MModel" jdbcType="VARCHAR" property="MModel" />
<result column="MStandard" jdbcType="VARCHAR" property="MStandard" />
<result column="MaterialUnit" jdbcType="VARCHAR" property="MaterialUnit" />
<result column="unit_name" jdbcType="VARCHAR" property="unitName" />
<result column="MColor" jdbcType="VARCHAR" property="MColor" />
@ -48,6 +49,7 @@
<resultMap id="ResultStockWarningCount" type="com.jsh.erp.datasource.vo.DepotItemStockWarningCount">
<result column="MaterialName" jdbcType="VARCHAR" property="MaterialName" />
<result column="MaterialModel" jdbcType="VARCHAR" property="MaterialModel" />
<result column="MaterialStandard" jdbcType="VARCHAR" property="MaterialStandard" />
<result column="categoryName" jdbcType="VARCHAR" property="categoryName" />
<result column="MaterialOther" jdbcType="VARCHAR" property="MaterialOther" />
<result column="MaterialUnit" jdbcType="VARCHAR" property="MaterialUnit" />
@ -155,7 +157,7 @@
</select>
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultByMaterial">
select m.id MId, m.name MName, m.mfrs MMfrs, m.model MModel,
select m.id MId, m.name MName, m.mfrs MMfrs, m.model MModel, m.standard MStandard,
m.unit MaterialUnit, m.color MColor, u.name unit_name,
(select purchase_decimal from jsh_material_extend me
where me.material_id=m.id and me.default_flag=1 and ifnull(me.delete_Flag,'0') !='1' limit 0,1)
@ -366,6 +368,7 @@
SELECT
m.name MaterialName,
m.model MaterialModel,
m.standard MaterialStandard,
mc.`Name` categoryName,
CONCAT(
'(',