ffixed: 입력 단위와 미리보기 단위 불일치 수정

main
thkim 2024-08-13 14:23:06 +09:00
parent 78f7626e51
commit 8bdc50fefc
2 changed files with 35 additions and 2 deletions

View File

@ -15,6 +15,8 @@ import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.json.JSONObject;
import com.clipsoft.clipreport.oof.OOFDocument;
import com.clipsoft.clipreport.oof.OOFFile;
import com.clipsoft.clipreport.server.service.ReportUtil;
@ -30,7 +32,7 @@ import ictway.comm.web.WebUtil;
@Controller
public class CommonController {
@Resource(name ="commonService")
private CommonService masterService;
@ -305,6 +307,36 @@ public class CommonController {
file6.addField("project_code", projectCode);
file6.addField("hole_code", downholeHolecode[i]);
file6.addField("image1", imagePath);
params.put("TEST_INFO_CODE", "DOWNHOLE");
params.put("HOLE_CODE", downholeHolecode[i]);
// 전단탄성계수의 단위를 구한다.
params.put("INI_UNIT", "N/㎡");
params.put("ITEM_INFO_CODE", "DH_SHEAR_MODULUS");
String dhShearmodulus = masterService.getInfoUnit(params);
// 영률의 단위를 구한다.
params.replace("INI_UNIT", "N/㎡");
params.replace("ITEM_INFO_CODE", "DH_YOUNGS_MODULUS");
String dhYoungsModulus = masterService.getInfoUnit(params);
// 밀도의 단위를 구한다.
params.replace("INI_UNIT", "g/㎥");
params.replace("ITEM_INFO_CODE", "DH_DENSITY");
String dhDensity = masterService.getInfoUnit(params);
// 구한 단위를 JSON에 넣는다.
JSONObject jsonObject = new JSONObject();
jsonObject.put(downholeHolecode[i] + "_DH_SHEAR_MODULUS", dhShearmodulus );
jsonObject.put(downholeHolecode[i] + "_DH_YOUNGS_MODULUS", dhYoungsModulus );
jsonObject.put(downholeHolecode[i] + "_DH_DENSITY", dhDensity );
String referenceMap = jsonObject.toString();
file6.addField("reference_map", referenceMap);
}
}

View File

@ -269,7 +269,8 @@ public class CommonServiceImpl implements CommonService {
@Override
public String getInfoUnit(Map<String, Object> params) throws Exception {
if(commonMapper.getInfoUnit(params) == null) {
EgovMap res = commonMapper.getInfoUnit(params);
if( res == null) {
return (String)params.get("INI_UNIT");
}else {
return (String)((commonMapper.getInfoUnit(params)).get("referenceDese"));