散發異味的程式碼並不會立刻的造成功能上的損壞,但會造成系統的慢性病。
DiningApplyBOImpl - queryOrderSummary
// 寫法一
public String queryBiweeklyBellSetting(String jsonString) throws Exception {
JSONObject bellObj=JSONObject.fromObject(jsonString);
Personal person=settingFeeEBO.queryPersonalByEmpid(bellObj.getString("empid"));
List<SettingFeeSummary> SettingFeeSummaryList =
this.querySettingBellByPeriod(person,
bellObj.getString("startDate"),bellObj.getString("endDate"));
return CommonUtils.getBeansJson(SettingFeeSummaryList, SettingFeeSummaryList.size());
}
SettingFeeBOImpl.java
// 寫法二
public List<SettingFeeSummary> queryBiweeklyBellSetting(String empId,
String startDate, String endDate) throws Exception {
Personal person=settingFeeEBO.queryPersonalByEmpid(empId);
List<SettingFeeSummary> SettingFeeSummaryList =
this.querySettingBellByPeriod(person, startDate, endDate);
return SettingFeeSummaryList;
}SettingFeeBOImpl.java
if (ouLocation == "TW")
$("#source").html(sourceContent);
else
$("#source").html(sourceContentS1);Transfer getTransfer(String empid, String sDate, String eDate) throws Exception;
List<Mealfee> queryMealfeeByStartEnd(String empid, String startDate, String endDate) throws Exception;
Integer queryMealFeeType(String empid, String startDate, String endDate) throws Exception;
List<Transfer> getTransfer_new(String applicant ,String sDate, String eDate) throws Exception;
List<BtripView> getBtripByWorkingDate(String empid, String startDate,
String endDate,String lampStart) throws Exception;String queryShiftType(String empid, String date) throws Exception;
String queryGuardShiftType(String empid, String date) throws Exception;
List<DayOfMealfee> queryDayOfMealfeeByWorkingDate (String empid,String workingDate) throws Exception ;
Double getOvertimeShift(String empid,String workDate) throws Exception;
Double getGuardShift(String empid,String workDate) throws Exception;Primitive Obession
String startDate,String endDate
class Period