Browse Source

fix:[非实验表单]计划单,导出

master
15881625488@163.com 3 months ago
parent
commit
3d1f2e7ca1
4 changed files with 22 additions and 38 deletions
  1. +1
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormPlanController.java
  2. +0
    -33
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormApplyServiceImpl.java
  3. +2
    -2
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/template/TemplateBaseUtil.java
  4. +19
    -2
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/template/gsp/MBMJYLQSQD.java

+ 1
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormPlanController.java View File

@ -117,7 +117,7 @@ public class StudyFormPlanController extends BaseController
* 保存 * 保存
*/ */
@PostMapping("/bc") @PostMapping("/bc")
@RequiresPermissions(value={"business:studyFormPre:bj","business:nonTrialFormPre:xz"}, logical= Logical.OR)
@RequiresPermissions(value={"business:studyFormPlan:bj","business:studyFormPlan:xz"}, logical= Logical.OR)
public AjaxResult bc(@RequestBody StudyFormPlan studyFormPlan) { public AjaxResult bc(@RequestBody StudyFormPlan studyFormPlan) {
return AjaxResult.success(studyFormPlanService.bc(studyFormPlan)); return AjaxResult.success(studyFormPlanService.bc(studyFormPlan));
} }

+ 0
- 33
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormApplyServiceImpl.java View File

@ -258,24 +258,6 @@ public class StudyFormApplyServiceImpl extends ServiceImpl
public StudyFormApply bc(StudyFormApply studyFormApply) { public StudyFormApply bc(StudyFormApply studyFormApply) {
StudyFormApply result = null; StudyFormApply result = null;
SysUser qmr = SecurityUtils.getLoginUser().getSysUser(); SysUser qmr = SecurityUtils.getLoginUser().getSysUser();
JSONObject bdnr = JSONObject.parseObject(studyFormApply.getBdnr());
if (bdnr != null) {
if (bdnr.getInteger("syId") != null) {
studyFormApply.setSyId(bdnr.getLong("syId"));
} else {
studyFormApply.setSyId(null);
}
if (bdnr.getInteger("bmId") != null) {
studyFormApply.setBmId(bdnr.getLong("bmId"));
} else {
studyFormApply.setBmId(null);
}
if (bdnr.getInteger("sdId") != null) {
studyFormApply.setSdId(bdnr.getLong("sdId"));
} else {
studyFormApply.setSdId(null);
}
}
if (studyFormApply.getId() != null) { if (studyFormApply.getId() != null) {
StudyFormApply studyFormApplyOld = this.queryInfo(studyFormApply.getId()); StudyFormApply studyFormApplyOld = this.queryInfo(studyFormApply.getId());
if (studyFormApplyOld == null) { if (studyFormApplyOld == null) {
@ -284,9 +266,6 @@ public class StudyFormApplyServiceImpl extends ServiceImpl
if (!qmr.getUserId().equals(studyFormApplyOld.getUserId())) { if (!qmr.getUserId().equals(studyFormApplyOld.getUserId())) {
throw new ServiceException("只能操作自己的表单"); throw new ServiceException("只能操作自己的表单");
} }
studyFormApplyOld.setSyId(studyFormApply.getSyId());
studyFormApplyOld.setBmId(studyFormApply.getBmId());
studyFormApplyOld.setSdId(studyFormApply.getSdId());
studyFormApplyOld.setBdmc(studyFormApply.getBdmc()); studyFormApplyOld.setBdmc(studyFormApply.getBdmc());
studyFormApplyOld.setTemplateId(studyFormApply.getTemplateId()); studyFormApplyOld.setTemplateId(studyFormApply.getTemplateId());
studyFormApplyOld.setBdnr(studyFormApply.getBdnr()); studyFormApplyOld.setBdnr(studyFormApply.getBdnr());
@ -337,18 +316,6 @@ public class StudyFormApplyServiceImpl extends ServiceImpl
studyFormApply.setUserMc(SecurityUtils.getNickName()); studyFormApply.setUserMc(SecurityUtils.getNickName());
studyFormApply.setBdbh(getSn(studyFormApply)); studyFormApply.setBdbh(getSn(studyFormApply));
} }
JSONObject bdnr = JSONObject.parseObject(studyFormApply.getBdnr());
if (bdnr != null) {
if (bdnr.getInteger("syId") != null) {
studyFormApply.setSyId(bdnr.getLong("syId"));
}
if (bdnr.getInteger("bmId") != null) {
studyFormApply.setBmId(bdnr.getLong("bmId"));
}
if (bdnr.getInteger("sdId") != null) {
studyFormApply.setSdId(bdnr.getLong("sdId"));
}
}
studyFormApply.setBdzt(StudyFormApplyBdztEnum.ytj.getValue()); studyFormApply.setBdzt(StudyFormApplyBdztEnum.ytj.getValue());
studyFormApply.setTjsj(new Date()); studyFormApply.setTjsj(new Date());
this.saveOrUpdate(studyFormApply); this.saveOrUpdate(studyFormApply);

+ 2
- 2
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/template/TemplateBaseUtil.java View File

@ -457,7 +457,7 @@ public class TemplateBaseUtil {
if (jsonObject.getString(key) != null) { if (jsonObject.getString(key) != null) {
result = true; result = true;
} }
return result?" √":"";
return result?" √ ":"";
} }
/** /**
@ -476,7 +476,7 @@ public class TemplateBaseUtil {
break; break;
} }
} }
return result?" ?":"";
return result?" ? ":"";
} }

+ 19
- 2
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/template/gsp/MBMJYLQSQD.java View File

@ -69,9 +69,26 @@ public class MBMJYLQSQD {
formData2.put(getName("需要量"), (StringUtils.isNoneBlank(bdnr.getString("xyl")) ? bdnr.getString("xyl") : "") + TemplateBaseUtil.getCheck("_xyl", zdgxjl) + TemplateBaseUtil.getFh("_xyl", fhyjjl)); formData2.put(getName("需要量"), (StringUtils.isNoneBlank(bdnr.getString("xyl")) ? bdnr.getString("xyl") : "") + TemplateBaseUtil.getCheck("_xyl", zdgxjl) + TemplateBaseUtil.getFh("_xyl", fhyjjl));
formData2.put(getName("需要时间"), (StringUtils.isNoneBlank(bdnr.getString("xysj")) ? bdnr.getString("xysj") : "") + TemplateBaseUtil.getCheck("_xysj", zdgxjl) + TemplateBaseUtil.getFh("_xysj", fhyjjl)); formData2.put(getName("需要时间"), (StringUtils.isNoneBlank(bdnr.getString("xysj")) ? bdnr.getString("xysj") : "") + TemplateBaseUtil.getCheck("_xysj", zdgxjl) + TemplateBaseUtil.getFh("_xysj", fhyjjl));
formData2.put(getName("预计归还时间"), (StringUtils.isNoneBlank(bdnr.getString("yjghsj")) ? bdnr.getString("yjghsj") : "") + TemplateBaseUtil.getCheck("_yjghsj", zdgxjl) + TemplateBaseUtil.getFh("_yjghsj", fhyjjl)); formData2.put(getName("预计归还时间"), (StringUtils.isNoneBlank(bdnr.getString("yjghsj")) ? bdnr.getString("yjghsj") : "") + TemplateBaseUtil.getCheck("_yjghsj", zdgxjl) + TemplateBaseUtil.getFh("_yjghsj", fhyjjl));
formData2.put(getName("动物种属"), (StringUtils.isNoneBlank(bdnr.getString("dwzs")) ? bdnr.getString("dwzs") : "") + TemplateBaseUtil.getCheck("_dwzs", zdgxjl) + TemplateBaseUtil.getFh("_dwzs", fhyjjl));
if(StringUtils.isNoneBlank(bdnr.getString("dwzsOther"))){
formData2.put(getName("动物种属"),
getName("其他")+ TemplateBaseUtil.getCheck("_dwzs", zdgxjl) + TemplateBaseUtil.getFh("_dwzs", fhyjjl) +
(StringUtils.isNoneBlank(bdnr.getString("dwzsOther")) ? bdnr.getString("dwzsOther") : "") + TemplateBaseUtil.getCheck("_dwzsOther", zdgxjl) + TemplateBaseUtil.getFh("_dwzsOther", fhyjjl));
}else{
formData2.put(getName("动物种属"), (StringUtils.isNoneBlank(bdnr.getString("dwzs")) ? bdnr.getString("dwzs") : "") + TemplateBaseUtil.getCheck("_dwzs", zdgxjl) + TemplateBaseUtil.getFh("_dwzs", fhyjjl));
}
formData2.put(getName("动物平均体重"), (StringUtils.isNoneBlank(bdnr.getString("dwpjtz")) ? bdnr.getString("dwpjtz") : "") + TemplateBaseUtil.getCheck("_dwpjtz", zdgxjl) + TemplateBaseUtil.getFh("_dwpjtz", fhyjjl)); formData2.put(getName("动物平均体重"), (StringUtils.isNoneBlank(bdnr.getString("dwpjtz")) ? bdnr.getString("dwpjtz") : "") + TemplateBaseUtil.getCheck("_dwpjtz", zdgxjl) + TemplateBaseUtil.getFh("_dwpjtz", fhyjjl));
formData2.put(getName("动物数量"), (StringUtils.isNoneBlank(bdnr.getString("dwsl")) ? bdnr.getString("dwsl") : "") + TemplateBaseUtil.getCheck("_dwsl", zdgxjl) + TemplateBaseUtil.getFh("_dwsl", fhyjjl));
if(StringUtils.isNoneBlank(bdnr.getString("dwslOther"))) {
formData2.put(getName("动物数量"),
(StringUtils.isNoneBlank(bdnr.getString("dwsl")) ? bdnr.getString("dwsl") : "") + TemplateBaseUtil.getCheck("_dwsl", zdgxjl) + TemplateBaseUtil.getFh("_dwsl", fhyjjl)+
getName("其他")+ TemplateBaseUtil.getCheck("_dwslUnit", zdgxjl) + TemplateBaseUtil.getFh("_dwslUnit", fhyjjl) +
(StringUtils.isNoneBlank(bdnr.getString("dwslOther")) ? bdnr.getString("dwslOther") : "") + TemplateBaseUtil.getCheck("_dwslOther", zdgxjl) + TemplateBaseUtil.getFh("_dwslOther", fhyjjl)
);
}else{
formData2.put(getName("动物数量"),
(StringUtils.isNoneBlank(bdnr.getString("dwsl")) ? bdnr.getString("dwsl") : "") + TemplateBaseUtil.getCheck("_dwsl", zdgxjl) + TemplateBaseUtil.getFh("_dwsl", fhyjjl)+
(StringUtils.isNoneBlank(bdnr.getString("dwslUnit")) ? bdnr.getString("dwslUnit") : "") + TemplateBaseUtil.getCheck("_dwslUnit", zdgxjl) + TemplateBaseUtil.getFh("_dwslUnit", fhyjjl)
);
}
PdfBaseUtil.addFormTableColumns(document, formData2, 2); PdfBaseUtil.addFormTableColumns(document, formData2, 2);
PdfBaseUtil.addUnderlinedTitle(document, getName("备注") + ":" +(StringUtils.isNoneBlank(bdnr.getString("remark")) ? bdnr.getString("remark") : "")+(TemplateBaseUtil.getCheck("_remark",zdgxjl)+TemplateBaseUtil.getFh("_remark",fhyjjl)), 10, false); PdfBaseUtil.addUnderlinedTitle(document, getName("备注") + ":" +(StringUtils.isNoneBlank(bdnr.getString("remark")) ? bdnr.getString("remark") : "")+(TemplateBaseUtil.getCheck("_remark",zdgxjl)+TemplateBaseUtil.getFh("_remark",fhyjjl)), 10, false);

Loading…
Cancel
Save