java date clone_Java Date.clone方法代碼示例

import ims.framework.utils.Date; //導入方法依賴的package包/類

public PatientAssessmentListVoCollection listPatientAssessments(CareContextRefVo careContextRefVo, UserDefinedAssessmentType assessmentType, Date dteDateFrom, Date dteDateTo)

{

if(careContextRefVo == null || careContextRefVo.getID_CareContext() == null)

throw new RuntimeException("Cannot list PatientAssessments for null CareContextRefVo");

DomainFactory factory = getDomainFactory();

StringBuffer hql = new StringBuffer(" from PatientAssessment pa where pa.careContext.id =:RefId");

ArrayList values = new ArrayList();

ArrayList params = new ArrayList();

values.add(careContextRefVo.getID_CareContext());

params.add("RefId");

if(assessmentType != null)

{

hql.append(" and ");

hql.append("pa.assessmentData.userAssessment.assessmentType =:assType");

values.add(getDomLookup(assessmentType));

params.add("assType");

}

if(dteDateFrom != null)

{

hql.append(" and ");

hql.append(" pa.authoringInformation.authoringDateTime >= :dateFrom ");

params.add("dateFrom");

values.add(dteDateFrom.getDate());

}

if(dteDateTo != null)

{

hql.append(" and ");

hql.append(" pa.authoringInformation.authoringDateTime <= :dateTo ");

params.add("dateTo");

Date d = (Date)dteDateTo.clone();

values.add(d.addDay(1).getDate());

}

hql.append(" order by pa.authoringInformation.authoringDateTime desc");

List list = factory.find(hql.toString(), params, values);

return PatientAssessmentListVoAssembler.createPatientAssessmentListVoCollectionFromPatientAssessment(list).sort();

}

改进以下代码 currentpath = os.path.dirname(os.path.realpath(__file__)) time_date = '{}{}'.format(self.time_date,self.random_char(5)) contents = os.path.join(currentpath, time_date, self.ref.split('/')[-1]) ref = self.ref.split('/')[-1] private_token = self.gl.private_token path = "lib" if ref == "master": if os.path.exists(os.path.join(contents, self.name)): subprocess.call("rm -rf {} ".format(os.path.join(contents, self.name)), shell=True, cwd=contents) time.sleep(3) retcode = start.clone(int(self.project_id), ref, contents, private_token) if retcode == 0: start.clone_frontend(self.get_frontend()[0],self.get_frontend()[1], contents, private_token,self.get_frontend()[2] ) start.clone_abc(self.get_abc()[0], self.get_abc()[1], contents, private_token,"mc_abc") start.clone_model(start.get_clkrst()[0], start.get_clkrst()[1], contents, private_token,"clkrst") start.clone_model(start.get_ara()[0], start.get_ara()[1], contents, private_token,"ara") start.clone_model(start.get_wfl()[0], start.get_wfl()[1], contents, private_token,"wfl") subprocess.call("echo '*.t' >> {}".format(os.path.join(contents, self.name, ".gitignore")),shell=True) code = start.make_lib(os.path.join(contents, self.name)) rel, err = code.communicate() if "make: *** [main] Error 2" in err.decode('utf-8'): print("loading push error log") filename = os.path.join(contents, self.name, "error_make_log") subprocess.call("echo '' > {}".format(filename), shell=True, cwd=contents) start.error_make(filename, rel.decode('utf-8') ) start.error_make(filename, err.decode('utf-8') ) else: print("loading push libs") # start.push_lib(os.path.join(contents, self.name), path, ref)
06-01
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值