Index: ssts-web/src/main/webapp/jasperRtp/stocktakereport_includesupplier.jrxml
===================================================================
diff -u
--- ssts-web/src/main/webapp/jasperRtp/stocktakereport_includesupplier.jrxml (revision 0)
+++ ssts-web/src/main/webapp/jasperRtp/stocktakereport_includesupplier.jrxml (revision 27669)
@@ -0,0 +1,416 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: ssts-diposablegoods/src/main/java/com/forgon/disinfectsystem/diposablegoods/service/GodownEntryItemManagerImpl.java
===================================================================
diff -u -r27608 -r27669
--- ssts-diposablegoods/src/main/java/com/forgon/disinfectsystem/diposablegoods/service/GodownEntryItemManagerImpl.java (.../GodownEntryItemManagerImpl.java) (revision 27608)
+++ ssts-diposablegoods/src/main/java/com/forgon/disinfectsystem/diposablegoods/service/GodownEntryItemManagerImpl.java (.../GodownEntryItemManagerImpl.java) (revision 27669)
@@ -1,29 +1,41 @@
package com.forgon.disinfectsystem.diposablegoods.service;
+import java.sql.ResultSet;
import java.text.ParseException;
import java.util.Date;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import net.sf.json.JSONObject;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+import org.springframework.jdbc.core.JdbcTemplate;
import com.forgon.databaseadapter.service.DateQueryAdapter;
import com.forgon.directory.model.BarcodeDevice;
import com.forgon.directory.model.OrgUnit;
import com.forgon.disinfectsystem.basedatamanager.warehouse.service.WareHouseManager;
+import com.forgon.disinfectsystem.diposablegoods.util.DisposableGoodsUtils;
import com.forgon.disinfectsystem.diposablegoods.util.GodownEntryUtil;
import com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoods;
import com.forgon.disinfectsystem.entity.assestmanagement.ExpensiveDisposablegoods;
import com.forgon.disinfectsystem.entity.assestmanagement.GodownEntry;
import com.forgon.disinfectsystem.entity.assestmanagement.GodownEntryItem;
import com.forgon.disinfectsystem.entity.basedatamanager.warehouse.WareHouse;
+import com.forgon.tools.db.DatabaseUtil;
import com.forgon.tools.hibernate.ObjectDao;
import com.forgon.tools.json.JSONUtil;
import com.forgon.tools.string.StringTools;
public class GodownEntryItemManagerImpl implements GodownEntryItemManager {
+
+ private Logger logger = Logger.getLogger(getClass());
+
+ private JdbcTemplate jdbcTemplate;
+
private ObjectDao objectDao;
private DateQueryAdapter dateQueryAdapter;
private WareHouseManager wareHouseManager;
@@ -40,6 +52,10 @@
this.wareHouseManager = wareHouseManager;
}
+ public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
+ this.jdbcTemplate = jdbcTemplate;
+ }
+
@SuppressWarnings("unchecked")
@Override
public List getGodownEntryItemList(String startDateTime,
@@ -250,4 +266,65 @@
godownEntryItem = CollectionUtils.isNotEmpty(list) ? list.get(0) : null;
return godownEntryItem;
}
+
+ @Override
+ public Map getDisposableGoodsLastEntrySupplierMap(
+ String startDate, String endDate) {
+ Map result = new HashMap();
+ /*String dateCondition = String.format("and ge.time %s ",
+ StringUtils.isBlank(startDate) ? (" < " + endDate) : (" between "+ startDate +" and "+ endDate));*/
+ //查询一次性物品的入库时间由开始与结束时间范围内到小于结束时间
+ String dateCondition = String.format("and ge.time < %s ", endDate);
+ String querySql = String.format("select dg.name,dg.specification,gei.supplierName "
+ + "from %s dg "
+ + "join %s gei on gei.disposableGoodsID=dg.id "
+ + "join %s ge on gei.godownEntry_id=ge.id "
+ + "where gei.supplierName is not null %s "
+ + "group by dg.name,dg.specification,gei.supplierName "
+ + "order by max(ge.time) desc", DisposableGoods.class.getSimpleName(),
+ GodownEntryItem.class.getSimpleName(),GodownEntry.class.getSimpleName(),
+ dateCondition);
+ ResultSet rs = null;
+ try {
+ logger.debug("getDisposableGoodsLastEntrySupplierMap querySql = " + querySql);
+ /*List