|
@@ -6,10 +6,7 @@ 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.FtData;
|
|
|
-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.entity.*;
|
|
|
import com.jeeplus.modules.sg.service.JkxlService;
|
|
|
import com.jeeplus.modules.sg.util.BashInfo;
|
|
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
|
@@ -341,15 +338,33 @@ public class JkxlController extends BaseController {
|
|
|
public String ddtz(TzData tzData, Model model, RedirectAttributes redirectAttributes){
|
|
|
String id = tzData.getId();
|
|
|
String type = tzData.getType();
|
|
|
+ String state = tzData.getState();
|
|
|
double fee = tzData.getFee();
|
|
|
String data1 = tzData.getData1();
|
|
|
- List<TzData> ts = (List<TzData>) JSONArray.parseArray(data1, TzData.class);
|
|
|
- List<JkxlData> lists = jkxlService.getList(id);
|
|
|
-
|
|
|
+ String row = data1.replaceAll(""","\\\"");
|
|
|
+ List<DdtzData> ts = (List<DdtzData>) JSONArray.parseArray(row, DdtzData.class);
|
|
|
try {
|
|
|
-// for (JkxlData jkxlData: list){
|
|
|
-//
|
|
|
-// }
|
|
|
+ for(DdtzData ddtzData: ts){
|
|
|
+ double tzFee = Double.valueOf(ddtzData.getFee());
|
|
|
+ String wbsCode = ddtzData.getWbsCode();
|
|
|
+ double otherFee = jkxlService.getDate(id,wbsCode).getOtherCost();
|
|
|
+ double totalFee = jkxlService.getDate(id,wbsCode).getTotalFee();
|
|
|
+ if(state.equals("1")){
|
|
|
+ otherFee = otherFee+tzFee;
|
|
|
+ totalFee = totalFee+tzFee;
|
|
|
+ }
|
|
|
+ if(state.equals("2")){
|
|
|
+ otherFee = otherFee-tzFee;
|
|
|
+ totalFee = totalFee-tzFee;
|
|
|
+ }
|
|
|
+ JkxlData jkxlData = new JkxlData();
|
|
|
+ jkxlData.setId(id);
|
|
|
+ jkxlData.setWbsCode(wbsCode);
|
|
|
+ jkxlData.setOtherCost(otherFee);
|
|
|
+ jkxlData.setTotalFee(otherFee);
|
|
|
+ jkxlService.updataDate(jkxlData);
|
|
|
+ }
|
|
|
+ jkxlService.updateFee(tzData);
|
|
|
|
|
|
}catch (Exception e){
|
|
|
addMessage(redirectAttributes, "调整失败");
|