|
@@ -1,10 +1,12 @@
|
|
|
package com.jeeplus.modules.sg.web;
|
|
|
|
|
|
import com.jeeplus.common.utils.DateUtils;
|
|
|
+import com.jeeplus.common.utils.StringUtils;
|
|
|
import com.jeeplus.common.utils.excel.ExportExcel;
|
|
|
import com.jeeplus.common.utils.excel.ImportExcel;
|
|
|
import com.jeeplus.core.web.BaseController;
|
|
|
import com.jeeplus.modules.sg.entity.JkxlData;
|
|
|
+import com.jeeplus.modules.sg.entity.TzData;
|
|
|
import com.jeeplus.modules.sg.entity.WbsProject;
|
|
|
import com.jeeplus.modules.sg.service.JkxlService;
|
|
|
import com.jeeplus.modules.sg.util.BashInfo;
|
|
@@ -13,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.Model;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|
|
|
|
@@ -53,6 +56,8 @@ public class JkxlController extends BaseController {
|
|
|
for(JkxlData jkxlData : list){
|
|
|
jkxlService.save(jkxlData);
|
|
|
}
|
|
|
+ double[] tzfee = getTzFee(file);
|
|
|
+ jkxlService.saveTzFee(tzfee,id);
|
|
|
} catch (Exception e){
|
|
|
addMessage(redirectAttributes, "导入失败");
|
|
|
}
|
|
@@ -61,21 +66,49 @@ public class JkxlController extends BaseController {
|
|
|
return "redirect:/a/jkxl/list?id="+id;
|
|
|
}
|
|
|
|
|
|
+ @RequestMapping("/gettz")
|
|
|
+ @ResponseBody
|
|
|
+ public List<JkxlData> getTz(TzData tzData){
|
|
|
+ String id = tzData.getId();
|
|
|
+ List<JkxlData> list = jkxlService.getList(id);
|
|
|
+ List<JkxlData> list1 = new ArrayList<>();
|
|
|
+ for(JkxlData jkxlData: list){
|
|
|
+ if( StringUtils.isNoneBlank(String.valueOf(jkxlData.getOriginalTotalCost()))){
|
|
|
+ list1.add(jkxlData);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return list1;
|
|
|
+ }
|
|
|
+
|
|
|
+// @RequestMapping("/relist")
|
|
|
+// public String reList(){
|
|
|
+//
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@RequestMapping("/list")
|
|
|
public String list(HttpServletRequest request,Model model){
|
|
|
String id = request.getParameter("id");
|
|
|
JkxlData jkxlData = new JkxlData();
|
|
|
+ TzData tzData = new TzData();
|
|
|
jkxlData.setId(id);
|
|
|
+ tzData.setId(id);
|
|
|
List<JkxlData> list1 = new ArrayList<>();
|
|
|
list1.add(jkxlData);
|
|
|
List<JkxlData> list = jkxlService.getList(id);
|
|
|
+ List<TzData> list2 = jkxlService.getTzFee(tzData);
|
|
|
HashMap map = new HashMap();
|
|
|
map.put("list1",list1);
|
|
|
map.put("list",list);
|
|
|
+ map.put("list2",list2);
|
|
|
model.addAttribute("map",map);
|
|
|
return "modules/sg/free/wbslist";
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
@RequestMapping("/export")
|
|
|
public String export(HttpServletRequest request, HttpServletResponse response,Model model,RedirectAttributes redirectAttributes) {
|
|
|
String id = request.getParameter("id");
|
|
@@ -306,6 +339,12 @@ public class JkxlController extends BaseController {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public double[] getTzFee(MultipartFile file) throws IOException, InvalidFormatException {
|
|
|
+ ImportExcel total = new ImportExcel(file,1,BashInfo.SHEET_HZB );
|
|
|
+ double[] wsb = getFees(total);
|
|
|
+ return wsb;
|
|
|
+ }
|
|
|
+
|
|
|
public String getId() {
|
|
|
SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
String newDate=sdf.format(new Date());
|