Commit 20d674b5 by zhanglt

货品模块修bug修复

台账导出增加盘盈入库数据
parent ddf2d509
......@@ -16,11 +16,15 @@ import com.jeeplus.modules.sys.utils.UserUtils;
import com.jeeplus.modules.warehouse.ledger.Utils.ExcelStyleUtils;
import com.jeeplus.modules.warehouse.ledger.dto.CountLedgerInfo;
import com.jeeplus.modules.warehouse.ledger.dto.ExcelExportInfo;
import com.jeeplus.modules.warehouse.materialloss.entity.MaterialLossInfo;
import com.jeeplus.modules.warehouse.materialloss.mapper.MaterialLossInfoMapper;
import com.jeeplus.modules.warehouse.materialtype.entity.MaterialType;
import com.jeeplus.modules.warehouse.materialtype.mapper.MaterialTypeMapper;
import com.jeeplus.modules.warehouse.materialtype.service.MaterialTypeService;
import com.jeeplus.modules.warehouse.outbound.entity.OutboundInfo;
import com.jeeplus.modules.warehouse.outbound.mapper.OutboundInfoMapper;
import com.jeeplus.modules.warehouse.profitwarehousing.entity.ProfitWarehousingInfo;
import com.jeeplus.modules.warehouse.profitwarehousing.mapper.ProfitWarehousingInfoMapper;
import com.jeeplus.modules.warehouse.qrcode.entity.QrCode;
import com.jeeplus.modules.warehouse.qrcode.mapper.QrCodeMapper;
import com.jeeplus.modules.warehouse.shelves.entity.Shelves;
......@@ -67,7 +71,10 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> {
private StorageInfoMapper storageInfoMapper;
@Autowired
private OutboundInfoMapper outboundInfoMapper;
@Autowired
private ProfitWarehousingInfoMapper profitWarehousingInfoMapper;
@Autowired
private MaterialLossInfoMapper materialLossInfoMapper;
......@@ -194,20 +201,24 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> {
public void ledgerStreamWater(String typeId, String beginTime, String endTime, HttpServletResponse respons) {
Date bTime = DateUtil.parseStrToDate(beginTime, "yyyy-MM-dd HH:mm:ss");
Date eTime = DateUtil.parseStrToDate(endTime, "yyyy-MM-dd HH:mm:ss");
//入库
MaterialType materialType = materialTypeMapper.get(typeId);
StorageInfo temSi = new StorageInfo();
temSi.setType(materialType);
temSi.setBeginTime(bTime);
temSi.setEndTime(eTime);
List<StorageInfo> storageInfoList = storageInfoMapper.findList(temSi);
//盘盈入库
ProfitWarehousingInfo profitWarehousingInfo = new ProfitWarehousingInfo();
profitWarehousingInfo.setType(materialType);
profitWarehousingInfo.setBeginTime(bTime);
profitWarehousingInfo.setEndTime(eTime);
List<ProfitWarehousingInfo> profitWarehousingInfoList = profitWarehousingInfoMapper.findList(profitWarehousingInfo);
LedgerInfo temLi = new LedgerInfo();
temLi.setType(materialType);
//出库
OutboundInfo outboundInfo = new OutboundInfo();
outboundInfo.setLedgerInfo(temLi);
outboundInfo.setBeginTime(bTime);
......@@ -238,7 +249,27 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> {
eei.setUserName(user.getLoginName());
excelExportInfoList.add(eei);
}
for (ProfitWarehousingInfo si : profitWarehousingInfoList) {
ExcelExportInfo eei = new ExcelExportInfo();
eei.setMonth(DateUtil.getMonth(si.getCreateDate()) + "");
eei.setDay(DateUtil.getDay(si.getCreateDate()) + "");
eei.setBatch(si.getProfitWarehousing().getNumber()+"[盘盈]");
eei.setRemarks(si.getRemarks());
eei.setTaskOrSend(0);
eei.setTask(si.getAmount().multiply(new BigDecimal(si.getNum())).toString());
eei.setSend("");
eei.setNum(si.getNum() + "");
eei.setModel(si.getMarking());
Integer n = modelMap.get(si.getMarking());
if (null == n) {
modelMap.put(si.getMarking(), modelMap.size());
}
User user = UserUtils.get(si.getCreateBy().getId());
eei.setUserName(user.getLoginName());
excelExportInfoList.add(eei);
}
for (OutboundInfo oi : outboundInfoList) {
ExcelExportInfo eei = new ExcelExportInfo();
eei.setMonth(DateUtil.getMonth(oi.getCreateDate()) + "");
......@@ -269,7 +300,7 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> {
intModelMap.put(entry.getValue(), entry.getKey());
}
int sunRowNum = 5 + storageInfoList.size() + outboundInfoList.size();
int sunRowNum = 5 + storageInfoList.size() + outboundInfoList.size() + profitWarehousingInfoList.size();
// 创建工作薄
XSSFWorkbook workbook = new XSSFWorkbook();
// 创建工作表
......
......@@ -8,6 +8,8 @@ import com.jeeplus.core.persistence.DataEntity;
import com.jeeplus.common.utils.excel.annotation.ExcelField;
import com.jeeplus.modules.warehouse.ledger.entity.LedgerInfo;
import java.util.Date;
/**
* 盘亏明细表Entity
* @author zhanglt
......@@ -19,7 +21,11 @@ public class MaterialLossInfo extends DataEntity<MaterialLossInfo> {
private MaterialLoss materialLoss; // 盘亏表主表ID
private LedgerInfo ledgerInfo; // 物资台账明细ID
private String remarks; // 物资台账明细ID
/**
* 查询使用的属性-------
*/
private Date beginTime;
private Date endTime;
public MaterialLossInfo() {
super();
}
......@@ -34,6 +40,22 @@ public class MaterialLossInfo extends DataEntity<MaterialLossInfo> {
this.remarks = remarks;
}
public Date getBeginTime() {
return beginTime;
}
public void setBeginTime(Date beginTime) {
this.beginTime = beginTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public MaterialLossInfo(String id){
super(id);
}
......
......@@ -14,6 +14,7 @@ import com.jeeplus.modules.warehouse.storage.entity.Storage;
import com.jeeplus.modules.warehouse.warehouse.entity.Warehouse;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
......@@ -38,6 +39,27 @@ public class ProfitWarehousingInfo extends DataEntity<ProfitWarehousingInfo> {
private List<Shelves> shelvesList;
private List<Warehouse> warehouseList;
/**
* 查询使用的属性-------
*/
private Date beginTime;
private Date endTime;
public Date getBeginTime() {
return beginTime;
}
public void setBeginTime(Date beginTime) {
this.beginTime = beginTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public ProfitWarehousingInfo(String id, ProfitWarehousing profitWarehousing) {
super(id);
......
......@@ -55,6 +55,12 @@
<if test="profitWarehousing != null and profitWarehousing.id != null and profitWarehousing.id != ''">
AND a.profit_warehousing_id = #{profitWarehousing.id}
</if>
<if test="type != null and type.id != null and type.id != ''">
AND a.type = #{type.id}
</if>
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
AND profitWarehousing.time &gt;= #{beginTime} AND profitWarehousing.time &lt;= #{endTime} AND (qrCode.state = '2')
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
......
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