Browse Source

Merge remote-tracking branch 'origin/prod-5.1.3' into prod-5.1.3

zhongwei
yang_shj 3 months ago
parent
commit
6c77922e8d
  1. 3
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java
  2. 8
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java

3
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java

@ -20,7 +20,6 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
@ -41,7 +40,7 @@ import java.util.Map;
@RequestMapping("/hygiene")
@Business(module = Constants.APP_NAME, value = "卫生自查")
@Api(value = "卫生自查", tags = "卫生自查接口")
public class HygieneController extends BladeController {
public class HygieneController {
private final IHygienePlanService hygienePlanService;

8
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java

@ -235,6 +235,9 @@ public class HygieneRecordServiceImpl extends ServiceImpl<HygieneRecordMapper, H
// 周结束日
LocalDate lastWeekDay = firstWeekDay.with(TemporalAdjusters.next(DayOfWeek.SATURDAY));
Date weekEnd = DateUtil.toDate(lastWeekDay);
if (lastDate.before(weekEnd)) {
weekEnd = lastDate;
}
// 存储周数据
HygieneWeekVO weekVO = new HygieneWeekVO();
weekVO.setWeekNum(weekNum++);
@ -394,13 +397,14 @@ public class HygieneRecordServiceImpl extends ServiceImpl<HygieneRecordMapper, H
exportVO.setEvaluationList(evaluationExportList);
Map<String, Object> params = BaseUtil.obj2Map(exportVO);
String templateFile;
// 根据周数匹配不同模板文件
if (weekList.size() == 4) {
templateFile = "template/卫生考核表(四周)" + SafeProductConstant.DOCX_SUFFIX;
} else {
templateFile = "template/卫生考核表(五周)" + SafeProductConstant.DOCX_SUFFIX;
}
String wordPath = "D:/" + "/卫生考核表" + SafeProductConstant.DOCX_SUFFIX;
String pdfPath = "D:/" + "/卫生考核表" + SafeProductConstant.PDF_SUFFIX;
String wordPath = savePath + "/卫生考核表" + SafeProductConstant.DOCX_SUFFIX;
String pdfPath = savePath + "/卫生考核表" + SafeProductConstant.PDF_SUFFIX;
BaseUtil.exportDocument(templateFile, params, wordPath, pdfPath, "",response);
}

Loading…
Cancel
Save