完善报表接口返回字段,增加品牌和制造商

This commit is contained in:
jishenghua 2024-10-09 00:48:34 +08:00
parent da693deebd
commit 8795c9358c
9 changed files with 114 additions and 26 deletions

View File

@ -512,10 +512,12 @@ public class DepotItemController {
item.put("materialName", diEx.getMName());
item.put("materialModel", diEx.getMModel());
item.put("materialStandard", diEx.getMStandard());
item.put("materialColor", diEx.getMColor());
item.put("materialMfrs", diEx.getMMfrs());
item.put("materialBrand", diEx.getBrand());
//扩展信息
String materialOther = depotItemService.getOtherInfo(mpArr, diEx);
item.put("materialOther", materialOther);
item.put("materialColor", diEx.getMColor());
item.put("unitId", diEx.getUnitId());
item.put("unitName", null!=diEx.getUnitId() ? diEx.getMaterialUnit()+"[多单位]" : diEx.getMaterialUnit());
BigDecimal prevSum = depotItemService.getStockByParamWithDepotList(depotList,mId,null,beginTime);
@ -672,10 +674,10 @@ public class DepotItemController {
String [] organArray = null;
List<Long> depotList = depotService.parseDepotList(depotId);
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
List<DepotItemVo4WithInfoEx> dataList = depotItemService.getListWithBugOrSale(StringUtil.toNull(materialParam),
List<DepotItemVo4WithInfoEx> dataList = depotItemService.getListWithBuyOrSale(StringUtil.toNull(materialParam),
"buy", beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, (currentPage-1)*pageSize, pageSize);
String[] mpArr = mpList.split(",");
int total = depotItemService.getListWithBugOrSaleCount(StringUtil.toNull(materialParam),
int total = depotItemService.getListWithBuyOrSaleCount(StringUtil.toNull(materialParam),
"buy", beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
map.put("total", total);
//存放数据json数组
@ -696,6 +698,8 @@ public class DepotItemController {
String materialOther = depotItemService.getOtherInfo(mpArr, diEx);
item.put("materialOther", materialOther);
item.put("materialColor", diEx.getMColor());
item.put("materialBrand", diEx.getBrand());
item.put("materialMfrs", diEx.getMMfrs());
item.put("materialUnit", diEx.getMaterialUnit());
item.put("unitName", diEx.getUnitName());
item.put("inSum", InSum);
@ -756,10 +760,10 @@ public class DepotItemController {
String [] organArray = null;
List<Long> depotList = depotService.parseDepotList(depotId);
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
List<DepotItemVo4WithInfoEx> dataList = depotItemService.getListWithBugOrSale(StringUtil.toNull(materialParam),
List<DepotItemVo4WithInfoEx> dataList = depotItemService.getListWithBuyOrSale(StringUtil.toNull(materialParam),
"retail", beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, (currentPage-1)*pageSize, pageSize);
String[] mpArr = mpList.split(",");
int total = depotItemService.getListWithBugOrSaleCount(StringUtil.toNull(materialParam),
int total = depotItemService.getListWithBuyOrSaleCount(StringUtil.toNull(materialParam),
"retail", beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
map.put("total", total);
//存放数据json数组
@ -780,6 +784,8 @@ public class DepotItemController {
String materialOther = depotItemService.getOtherInfo(mpArr, diEx);
item.put("materialOther", materialOther);
item.put("materialColor", diEx.getMColor());
item.put("materialBrand", diEx.getBrand());
item.put("materialMfrs", diEx.getMMfrs());
item.put("materialUnit", diEx.getMaterialUnit());
item.put("unitName", diEx.getUnitName());
item.put("outSum", OutSumRetail);
@ -841,10 +847,10 @@ public class DepotItemController {
String [] organArray = depotHeadService.getOrganArray("销售", "");
List<Long> depotList = depotService.parseDepotList(depotId);
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
List<DepotItemVo4WithInfoEx> dataList = depotItemService.getListWithBugOrSale(StringUtil.toNull(materialParam),
List<DepotItemVo4WithInfoEx> dataList = depotItemService.getListWithBuyOrSale(StringUtil.toNull(materialParam),
"sale", beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, (currentPage-1)*pageSize, pageSize);
String[] mpArr = mpList.split(",");
int total = depotItemService.getListWithBugOrSaleCount(StringUtil.toNull(materialParam),
int total = depotItemService.getListWithBuyOrSaleCount(StringUtil.toNull(materialParam),
"sale", beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
map.put("total", total);
//存放数据json数组
@ -865,6 +871,8 @@ public class DepotItemController {
String materialOther = depotItemService.getOtherInfo(mpArr, diEx);
item.put("materialOther", materialOther);
item.put("materialColor", diEx.getMColor());
item.put("materialBrand", diEx.getBrand());
item.put("materialMfrs", diEx.getMMfrs());
item.put("materialUnit", diEx.getMaterialUnit());
item.put("unitName", diEx.getUnitName());
item.put("outSum", OutSum);
@ -939,7 +947,6 @@ public class DepotItemController {
if (null != list) {
for (DepotItemStockWarningCount disw : list) {
DepotItemVo4WithInfoEx diEx = new DepotItemVo4WithInfoEx();
diEx.setMMfrs(disw.getMMfrs());
diEx.setMOtherField1(disw.getMOtherField1());
diEx.setMOtherField2(disw.getMOtherField2());
diEx.setMOtherField3(disw.getMOtherField3());

View File

@ -228,10 +228,11 @@ public class MaterialController {
if(StringUtil.isNotEmpty(mpList)){
mpArr= mpList.split(",");
}
List<MaterialVo4Unit> dataList = materialService.findBySelectWithBarCode(categoryId, q, standardOrModel,
color, brand, mfrs, enableSerialNumber, enableBatchNumber, (currentPage-1)*pageSize, pageSize);
int total = materialService.findBySelectWithBarCodeCount(categoryId, q, standardOrModel,
color, brand, mfrs, enableSerialNumber, enableBatchNumber);
List<MaterialVo4Unit> dataList = materialService.findBySelectWithBarCode(categoryId, q, StringUtil.toNull(standardOrModel),
StringUtil.toNull(color), StringUtil.toNull(brand), StringUtil.toNull(mfrs), enableSerialNumber, enableBatchNumber,
(currentPage-1)*pageSize, pageSize);
int total = materialService.findBySelectWithBarCodeCount(categoryId, q, StringUtil.toNull(standardOrModel),
StringUtil.toNull(color), StringUtil.toNull(brand), StringUtil.toNull(mfrs), enableSerialNumber, enableBatchNumber);
object.put("total", total);
JSONArray dataArray = new JSONArray();
//存放数据json数组

View File

@ -72,7 +72,7 @@ public interface DepotItemMapperEx {
@Param("categoryIdList") List<Long> categoryIdList,
@Param("endTime") String endTime);
List<DepotItemVo4WithInfoEx> getListWithBugOrSale(
List<DepotItemVo4WithInfoEx> getListWithBuyOrSale(
@Param("materialParam") String materialParam,
@Param("billType") String billType,
@Param("beginTime") String beginTime,
@ -85,7 +85,7 @@ public interface DepotItemMapperEx {
@Param("offset") Integer offset,
@Param("rows") Integer rows);
int getListWithBugOrSaleCount(
int getListWithBuyOrSaleCount(
@Param("materialParam") String materialParam,
@Param("billType") String billType,
@Param("beginTime") String beginTime,

View File

@ -16,6 +16,12 @@ public class DepotHeadVo4InDetail {
private String standard;
private String color;
private String brand;
private String mfrs;
private BigDecimal unitPrice;
private String sku;
@ -84,6 +90,30 @@ public class DepotHeadVo4InDetail {
this.standard = standard;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public String getMfrs() {
return mfrs;
}
public void setMfrs(String mfrs) {
this.mfrs = mfrs;
}
public BigDecimal getUnitPrice() {
return unitPrice;
}

View File

@ -14,6 +14,12 @@ public class DepotHeadVo4InOutMCount {
private String standard;
private String color;
private String brand;
private String mfrs;
private String categoryName;
private String materialUnit;
@ -64,6 +70,30 @@ public class DepotHeadVo4InOutMCount {
this.standard = standard;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public String getMfrs() {
return mfrs;
}
public void setMfrs(String mfrs) {
this.mfrs = mfrs;
}
public String getCategoryName() {
return categoryName;
}

View File

@ -21,6 +21,8 @@ public class DepotItemStockWarningCount {
private String MMfrs;
private String brand;
private String unitName;
private String MaterialOther;
@ -107,6 +109,14 @@ public class DepotItemStockWarningCount {
this.MMfrs = MMfrs;
}
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public String getUnitName() {
return unitName;
}

View File

@ -321,22 +321,22 @@ public class DepotItemService {
return result;
}
public List<DepotItemVo4WithInfoEx> getListWithBugOrSale(String materialParam, String billType,
public List<DepotItemVo4WithInfoEx> getListWithBuyOrSale(String materialParam, String billType,
String beginTime, String endTime, String[] creatorArray, Long organId, String [] organArray, List<Long> depotList, Boolean forceFlag, Integer offset, Integer rows)throws Exception {
List<DepotItemVo4WithInfoEx> list =null;
try{
list = depotItemMapperEx.getListWithBugOrSale(materialParam, billType, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, offset, rows);
list = depotItemMapperEx.getListWithBuyOrSale(materialParam, billType, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, offset, rows);
}catch(Exception e){
JshException.readFail(logger, e);
}
return list;
}
public int getListWithBugOrSaleCount(String materialParam, String billType,
public int getListWithBuyOrSaleCount(String materialParam, String billType,
String beginTime, String endTime, String[] creatorArray, Long organId, String [] organArray, List<Long> depotList, Boolean forceFlag)throws Exception {
int result=0;
try{
result = depotItemMapperEx.getListWithBugOrSaleCount(materialParam, billType, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
result = depotItemMapperEx.getListWithBuyOrSaleCount(materialParam, billType, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
}catch(Exception e){
JshException.readFail(logger, e);
}

View File

@ -18,6 +18,9 @@
<result column="mname" jdbcType="VARCHAR" property="mname" />
<result column="model" jdbcType="VARCHAR" property="model" />
<result column="standard" jdbcType="VARCHAR" property="standard" />
<result column="color" jdbcType="VARCHAR" property="color" />
<result column="brand" jdbcType="VARCHAR" property="brand" />
<result column="mfrs" jdbcType="VARCHAR" property="mfrs" />
<result column="unitPrice" jdbcType="DECIMAL" property="unitPrice" />
<result column="sku" jdbcType="VARCHAR" property="sku" />
<result column="operNumber" jdbcType="DECIMAL" property="operNumber" />
@ -37,6 +40,9 @@
<result column="mName" jdbcType="VARCHAR" property="mName" />
<result column="model" jdbcType="VARCHAR" property="model" />
<result column="standard" jdbcType="VARCHAR" property="standard" />
<result column="color" jdbcType="VARCHAR" property="color" />
<result column="brand" jdbcType="VARCHAR" property="brand" />
<result column="mfrs" jdbcType="VARCHAR" property="mfrs" />
<result column="categoryName" jdbcType="VARCHAR" property="categoryName" />
<result column="materialUnit" jdbcType="VARCHAR" property="materialUnit" />
<result column="numSum" jdbcType="DECIMAL" property="numSum" />
@ -293,7 +299,7 @@
</select>
<select id="findInOutDetail" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap">
select dh.number,me.bar_code barCode, m.name mname,m.model,m.standard,di.unit_price unitPrice,di.material_unit as mUnit, di.sku,
select dh.number,me.bar_code barCode, m.name mname,m.model,m.standard,m.color,m.brand,m.mfrs,di.unit_price unitPrice,di.material_unit as mUnit, di.sku,
di.oper_number operNumber,di.all_price allPrice, ifnull(di.tax_rate,0) taxRate, ifnull(di.tax_money,0) taxMoney, ifnull(di.tax_last_money,0) taxLastMoney,
s.supplier sname,d.dname dname, date_format(dh.oper_time, '%Y-%m-%d') operTime, concat(dh.sub_type,dh.type) as newType,
concat_ws(' ',dh.remark,di.remark) as newRemark
@ -489,7 +495,8 @@
</select>
<select id="findInOutMaterialCount" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultInOutMaterialCount">
select di.material_id materialId, me.bar_code barCode, m.name mName,m.model,m.standard,mc.name categoryName,concat_ws('', m.unit, u.basic_unit) materialUnit,
select di.material_id materialId, me.bar_code barCode, m.name mName,m.model,m.standard,m.color,m.brand,m.mfrs,
mc.name categoryName,concat_ws('', m.unit, u.basic_unit) materialUnit,
sum(di.basic_number) numSum,
sum(di.all_price) priceSum
from jsh_depot_head dh
@ -687,7 +694,7 @@
</select>
<select id="findAllocationDetail" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap">
select dh.number,me.bar_code barCode, m.name mname,m.model,m.standard,di.unit_price unitPrice,di.material_unit as mUnit,
select dh.number,me.bar_code barCode, m.name mname,m.model,m.standard,m.color,m.brand,m.mfrs,di.unit_price unitPrice,di.material_unit as mUnit,
di.oper_number operNumber,di.all_price allPrice,sname, d.dName dname,date_format(dh.oper_time, '%Y-%m-%d') operTime,
concat(dh.sub_type,dh.type) as newType, concat_ws(' ',dh.remark,di.remark) as newRemark
from jsh_depot_head dh

View File

@ -57,6 +57,7 @@
<result column="unit_id" jdbcType="BIGINT" property="unitId" />
<result column="unit_name" jdbcType="VARCHAR" property="unitName" />
<result column="MColor" jdbcType="VARCHAR" property="MColor" />
<result column="brand" jdbcType="VARCHAR" property="brand" />
<result column="purchase_decimal" jdbcType="DECIMAL" property="purchaseDecimal" />
<result column="currentUnitPrice" jdbcType="DECIMAL" property="currentUnitPrice" />
</resultMap>
@ -68,6 +69,8 @@
<result column="MMfrs" jdbcType="VARCHAR" property="MMfrs" />
<result column="MModel" jdbcType="VARCHAR" property="MModel" />
<result column="MStandard" jdbcType="VARCHAR" property="MStandard" />
<result column="MColor" jdbcType="VARCHAR" property="MColor" />
<result column="brand" jdbcType="VARCHAR" property="brand" />
<result column="MaterialUnit" jdbcType="VARCHAR" property="MaterialUnit" />
<result column="MOtherField1" jdbcType="VARCHAR" property="MOtherField1" />
<result column="MOtherField2" jdbcType="VARCHAR" property="MOtherField2" />
@ -346,7 +349,7 @@
</select>
<select id="getInOutStock" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultByMaterial">
select m.id MId, me.bar_code, m.name MName, m.mfrs MMfrs, m.model MModel, m.standard MStandard,
select m.id MId, me.bar_code, m.name MName, m.mfrs MMfrs, m.model MModel, m.standard MStandard, m.brand,
m.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3,
concat_ws('', m.unit, u.basic_unit) MaterialUnit, m.color MColor, m.unit_id, u.name unit_name,
ifnull(me.purchase_decimal,0) purchase_decimal, ifnull(mcs.current_unit_price,0) currentUnitPrice
@ -406,10 +409,10 @@
group by m.id) cc
</select>
<select id="getListWithBugOrSale" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultByMaterial">
<select id="getListWithBuyOrSale" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultByMaterial">
select m.id MId, me.bar_code, m.name MName, m.mfrs MMfrs, m.model MModel, m.standard MStandard,
m.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3,
concat_ws('', m.unit, u.basic_unit) MaterialUnit, m.color MColor, u.name unit_name
concat_ws('', m.unit, u.basic_unit) MaterialUnit, m.color MColor, m.brand, u.name unit_name
from jsh_material m
left join jsh_depot_item di on di.material_id=m.id and ifnull(di.delete_Flag,'0') !='1'
left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1'
@ -471,7 +474,7 @@
</if>
</select>
<select id="getListWithBugOrSaleCount" resultType="java.lang.Integer">
<select id="getListWithBuyOrSaleCount" resultType="java.lang.Integer">
select count(1) from (select m.id
from jsh_material m
left join jsh_depot_item di on di.material_id=m.id and ifnull(m.delete_Flag,'0') !='1'
@ -864,7 +867,7 @@
</select>
<select id="findStockWarningCount" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultStockWarningCount">
select m.id MId, m.name MName, me.bar_code, m.mfrs MMfrs, m.model MModel, m.standard MStandard,m.color MColor,
select m.id MId, m.name MName, me.bar_code, m.mfrs MMfrs, m.model MModel, m.standard MStandard,m.color MColor, m.brand,
m.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3,d.name depotName,
m.unit MaterialUnit, u.basic_unit unit_name,mcs.current_number,
mis.low_safe_stock, mis.high_safe_stock