Browse Source

年计划导出用水性质

luobo 3 năm trước cách đây
mục cha
commit
ece14b5a36

+ 1 - 0
src/java/com/bus/model/BusOrg.hbm.xml

@@ -77,5 +77,6 @@
 		<property name="phone" column="phone" />
 		<property name="importStatus" column="import_status" />
 		<property name="linkman" column="linkman" />
+		<property name="propertiesId" column="properties_id" />
 	</class>
 </hibernate-mapping>

+ 22 - 1
src/java/com/bus/model/BusOrg.java

@@ -7,6 +7,7 @@ import java.util.Set;
 
 import com.base.model.BaseOrgType;
 
+import com.base.model.BaseWaterProperties;
 import flexjson.JSON;
 
 /**
@@ -67,6 +68,8 @@ public class BusOrg {
 	/** 已做完年初始化后,单位新增的水表 **/
 	private String newMeter;
 
+	private Long propertiesId;
+
 	// ----------不持久化到数据库----------------------------------------
 	/** 客户号 **/
 	private String busOrgCustomerNumber;
@@ -80,7 +83,10 @@ public class BusOrg {
 	private String planUser;
 	/** 获取用户类型 **/
 	private String userType;
-
+	/**
+	 * 用水性质
+	 */
+	private BaseWaterProperties propertiesInfo;
 	// 获取计划户
 	public String getPlanUser() {
 		String str = "";
@@ -416,4 +422,19 @@ public class BusOrg {
 		}
 	}
 
+	public Long getPropertiesId() {
+		return propertiesId;
+	}
+
+	public void setPropertiesId(Long propertiesId) {
+		this.propertiesId = propertiesId;
+	}
+
+	public BaseWaterProperties getPropertiesInfo() {
+		return propertiesInfo;
+	}
+
+	public void setPropertiesInfo(BaseWaterProperties propertiesInfo) {
+		this.propertiesInfo = propertiesInfo;
+	}
 }

+ 40 - 26
src/java/com/bus/web/BusInitController.java

@@ -24,7 +24,9 @@ import javax.persistence.criteria.CriteriaBuilder;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.base.model.BaseWaterProperties;
 import com.base.service.IBaseOrgTypeService;
+import com.base.service.IBaseWaterPropertiesService;
 import com.bus.model.*;
 import com.bus.model.temp.*;
 import com.bus.service.*;
@@ -113,6 +115,8 @@ public class BusInitController extends BaseController {
 
     @Autowired
     private IBusWaterAdjRecService busWaterAdjRecService;
+    @Autowired
+    private IBaseWaterPropertiesService baseWaterPropertiesService;
 
     private static String path;
 
@@ -1434,19 +1438,20 @@ public class BusInitController extends BaseController {
 //            sheet.addCell(new Label(10, 0, "四季度计划"));
             sheet.addCell(new Label(7, 0, "全年计划"));
             sheet.addCell(new Label(8, 0, "全年批复"));
-            sheet.addCell(new Label(9, 0, "是否居民用水"));
-            sheet.addCell(new Label(10, 0, "一月份计划"));
-            sheet.addCell(new Label(11, 0, "二月份计划"));
-            sheet.addCell(new Label(12, 0, "三月份计划"));
-            sheet.addCell(new Label(13, 0, "四月份计划"));
-            sheet.addCell(new Label(14, 0, "五月份计划"));
-            sheet.addCell(new Label(15, 0, "六月份计划"));
-            sheet.addCell(new Label(16, 0, "七月份计划"));
-            sheet.addCell(new Label(17, 0, "八月份计划"));
-            sheet.addCell(new Label(18, 0, "九月份计划"));
-            sheet.addCell(new Label(19, 0, "十月份计划"));
-            sheet.addCell(new Label(20, 0, "十一月份计划"));
-            sheet.addCell(new Label(21, 0, "十二月份计划"));
+            sheet.addCell(new Label(9, 0, "用水性质"));
+            sheet.addCell(new Label(10, 0, "水价"));
+            sheet.addCell(new Label(11, 0, "一月份计划"));
+            sheet.addCell(new Label(12, 0, "二月份计划"));
+            sheet.addCell(new Label(13, 0, "三月份计划"));
+            sheet.addCell(new Label(14, 0, "四月份计划"));
+            sheet.addCell(new Label(15, 0, "五月份计划"));
+            sheet.addCell(new Label(16, 0, "六月份计划"));
+            sheet.addCell(new Label(17, 0, "七月份计划"));
+            sheet.addCell(new Label(18, 0, "八月份计划"));
+            sheet.addCell(new Label(19, 0, "九月份计划"));
+            sheet.addCell(new Label(20, 0, "十月份计划"));
+            sheet.addCell(new Label(21, 0, "十一月份计划"));
+            sheet.addCell(new Label(22, 0, "十二月份计划"));
         } catch (Exception e) {
             // TODO: handle exception
         }
@@ -1459,6 +1464,14 @@ public class BusInitController extends BaseController {
 
             //记录信息
             List<BusAnnualPlanForWater> list = (List<BusAnnualPlanForWater>) this.page.getResult();
+            //关联用水性质
+            for (BusAnnualPlanForWater item0:list){
+                BusOrg org = item0.getOrg();
+                if (org!=null){
+                    BaseWaterProperties properties = baseWaterPropertiesService.get(org.getPropertiesId());
+                    org.setPropertiesInfo(properties);
+                }
+            }
             for (int i = 0; i < list.size(); i++) {
                 BusAnnualPlanForWater plan = list.get(i);
                 sheet.addCell(new Label(0, row, plan.getOrgName()));//单位名称
@@ -1474,19 +1487,20 @@ public class BusInitController extends BaseController {
 //                sheet.addCell(new Label(10, row, Math.round(plan.getFourthQuarterReply()) + ""));//四季度
                 sheet.addCell(new Label(7, row, (plan.getPlanOfWater() != null ? Math.round(plan.getPlanOfWater()) : 0) + ""));//全年计划
                 sheet.addCell(new Label(8, row, (plan.getReplyOfWater() != null ? Math.round(plan.getReplyOfWater()) : 0) + ""));//全年批复
-                sheet.addCell(new Label(9, row, plan.getOrgType()));//用户类型
-                sheet.addCell(new Label(10, row, (plan.getJanPlan() != null ? Math.round(plan.getJanPlan()) : 0) + ""));//一月份计划
-                sheet.addCell(new Label(11, row, (plan.getFebPlan() != null ? Math.round(plan.getFebPlan()) : 0) + ""));//二月份计划
-                sheet.addCell(new Label(12, row, (plan.getMarPlan() != null ? Math.round(plan.getMarPlan()) : 0) + ""));//三月份计划
-                sheet.addCell(new Label(13, row, (plan.getAprPlan() != null ? Math.round(plan.getAprPlan()) : 0) + ""));//四月份计划
-                sheet.addCell(new Label(14, row, (plan.getMayPlan() != null ? Math.round(plan.getMayPlan()) : 0) + ""));//五月份计划
-                sheet.addCell(new Label(15, row, (plan.getJunPlan() != null ? Math.round(plan.getJunPlan()) : 0) + ""));//六月份计划
-                sheet.addCell(new Label(16, row, (plan.getJulPlan() != null ? Math.round(plan.getJulPlan()) : 0) + ""));//七月份计划
-                sheet.addCell(new Label(17, row, (plan.getAugPlan() != null ? Math.round(plan.getAugPlan()) : 0) + ""));//八月份计划
-                sheet.addCell(new Label(18, row, (plan.getSeptPlan() != null ? Math.round(plan.getSeptPlan()) : 0) + ""));//九月份计划
-                sheet.addCell(new Label(19, row, (plan.getOctPlan() != null ? Math.round(plan.getOctPlan()) : 0) + ""));//十月份计划
-                sheet.addCell(new Label(20, row, (plan.getNovPlan() != null ? Math.round(plan.getNovPlan()) : 0) + ""));//十一月份计划
-                sheet.addCell(new Label(21, row, (plan.getDecPlan() != null ? Math.round(plan.getDecPlan()) : 0) + ""));//十二月份计划
+                sheet.addCell(new Label(9, row, plan.getOrg().getPropertiesInfo().getPropertiesName()));//用水性质
+                sheet.addCell(new Label(10, row, plan.getOrg().getPropertiesInfo().getWaterPrices(1)+""));//水价
+                sheet.addCell(new Label(11, row, (plan.getJanPlan() != null ? Math.round(plan.getJanPlan()) : 0) + ""));//一月份计划
+                sheet.addCell(new Label(12, row, (plan.getFebPlan() != null ? Math.round(plan.getFebPlan()) : 0) + ""));//二月份计划
+                sheet.addCell(new Label(13, row, (plan.getMarPlan() != null ? Math.round(plan.getMarPlan()) : 0) + ""));//三月份计划
+                sheet.addCell(new Label(14, row, (plan.getAprPlan() != null ? Math.round(plan.getAprPlan()) : 0) + ""));//四月份计划
+                sheet.addCell(new Label(15, row, (plan.getMayPlan() != null ? Math.round(plan.getMayPlan()) : 0) + ""));//五月份计划
+                sheet.addCell(new Label(16, row, (plan.getJunPlan() != null ? Math.round(plan.getJunPlan()) : 0) + ""));//六月份计划
+                sheet.addCell(new Label(17, row, (plan.getJulPlan() != null ? Math.round(plan.getJulPlan()) : 0) + ""));//七月份计划
+                sheet.addCell(new Label(18, row, (plan.getAugPlan() != null ? Math.round(plan.getAugPlan()) : 0) + ""));//八月份计划
+                sheet.addCell(new Label(19, row, (plan.getSeptPlan() != null ? Math.round(plan.getSeptPlan()) : 0) + ""));//九月份计划
+                sheet.addCell(new Label(20, row, (plan.getOctPlan() != null ? Math.round(plan.getOctPlan()) : 0) + ""));//十月份计划
+                sheet.addCell(new Label(21, row, (plan.getNovPlan() != null ? Math.round(plan.getNovPlan()) : 0) + ""));//十一月份计划
+                sheet.addCell(new Label(22, row, (plan.getDecPlan() != null ? Math.round(plan.getDecPlan()) : 0) + ""));//十二月份计划
                 row += 1;
             }
             if (this.page.hasNextPage()) {