|
|
|
@ -94,7 +94,7 @@ public class HygieneRecordServiceImpl extends ServiceImpl<HygieneRecordMapper, H
|
|
|
|
|
hygieneRecordEntity.setWeekNum(weekNum); |
|
|
|
|
// 综合评分判断
|
|
|
|
|
HygienePlanEntity hygienePlanEntity = hygienePlanMapper.selectById(hygieneRecordEntity.getHygienePlanId()); |
|
|
|
|
String[] scores = hygieneRecordEntity.getComprehensiveScore().split(",|,"); |
|
|
|
|
String[] scores = hygieneRecordEntity.getComprehensiveScore().split(","); |
|
|
|
|
for (String score : scores) { |
|
|
|
|
int sc = Integer.parseInt(score); |
|
|
|
|
if (sc > hygienePlanEntity.getStandardScore()) { |
|
|
|
@ -122,7 +122,7 @@ public class HygieneRecordServiceImpl extends ServiceImpl<HygieneRecordMapper, H
|
|
|
|
|
hygieneRecordEntity.setWeekNum(weekNum); |
|
|
|
|
// 综合评分判断
|
|
|
|
|
HygienePlanEntity hygienePlanEntity = hygienePlanMapper.selectById(hygieneRecordEntity.getHygienePlanId()); |
|
|
|
|
String[] scores = hygieneRecordEntity.getComprehensiveScore().split(",|,"); |
|
|
|
|
String[] scores = hygieneRecordEntity.getComprehensiveScore().split(","); |
|
|
|
|
for (String score : scores) { |
|
|
|
|
int sc = Integer.parseInt(score); |
|
|
|
|
if (sc > hygienePlanEntity.getStandardScore()) { |
|
|
|
@ -138,9 +138,9 @@ public class HygieneRecordServiceImpl extends ServiceImpl<HygieneRecordMapper, H
|
|
|
|
|
@Override |
|
|
|
|
public HygieneRecordDetailVO getRecordDetail(Long id) { |
|
|
|
|
HygieneRecordDetailVO recordDetailVO = baseMapper.getRecordDetail(id); |
|
|
|
|
String[] zoneIds = recordDetailVO.getHygieneZoneIds().split(",|,"); |
|
|
|
|
String[] results = recordDetailVO.getCheckResult().split(",|,"); |
|
|
|
|
String[] scores = recordDetailVO.getComprehensiveScore().split(",|,"); |
|
|
|
|
String[] zoneIds = recordDetailVO.getHygieneZoneIds().split(","); |
|
|
|
|
String[] results = recordDetailVO.getCheckResult().split(","); |
|
|
|
|
String[] scores = recordDetailVO.getComprehensiveScore().split(","); |
|
|
|
|
List<HygieneZoneDetailVO> checkDetailVOList = new ArrayList<>(); |
|
|
|
|
for (int i = 0; i < zoneIds.length; i++) { |
|
|
|
|
HygieneZoneDetailVO zoneDetailVO = new HygieneZoneDetailVO(); |
|
|
|
@ -169,6 +169,29 @@ public class HygieneRecordServiceImpl extends ServiceImpl<HygieneRecordMapper, H
|
|
|
|
|
@Override |
|
|
|
|
public void exportHygieneRecordData(Long id, HttpServletResponse response) { |
|
|
|
|
HygieneRecordDetailVO hygieneRecordDetailVO = this.getRecordDetail(id); |
|
|
|
|
// 数据处理
|
|
|
|
|
// 检查项
|
|
|
|
|
List<HygieneZoneDetailVO> checkList = hygieneRecordDetailVO.getCheckList(); |
|
|
|
|
List<HygieneZoneDetailVO> res = new ArrayList<>(); |
|
|
|
|
checkList.forEach(item -> { |
|
|
|
|
String[] checkItem = item.getCheckItem().split(","); |
|
|
|
|
String[] checkItemScore = item.getCheckItemScore().split(","); |
|
|
|
|
for (int i = 0; i < checkItem.length; i++) { |
|
|
|
|
HygieneZoneDetailVO hygieneZoneDetailVO = new HygieneZoneDetailVO(); |
|
|
|
|
hygieneZoneDetailVO.setZone(item.getZone()); |
|
|
|
|
hygieneZoneDetailVO.setPrincipal(item.getPrincipal()); |
|
|
|
|
hygieneZoneDetailVO.setResult(item.getResult()); |
|
|
|
|
hygieneZoneDetailVO.setScore(item.getScore()); |
|
|
|
|
hygieneZoneDetailVO.setCheckItem(checkItem[i]); |
|
|
|
|
hygieneZoneDetailVO.setCheckItemScore(checkItemScore[i]); |
|
|
|
|
res.add(hygieneZoneDetailVO); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
// 表头
|
|
|
|
|
String code = hygieneRecordDetailVO.getCode(); |
|
|
|
|
hygieneRecordDetailVO.setYear(code.substring(4, 8)); |
|
|
|
|
hygieneRecordDetailVO.setMonth(code.substring(8, 10)); |
|
|
|
|
hygieneRecordDetailVO.setCheckList(res); |
|
|
|
|
Map<String, Object> params = BaseUtil.obj2Map(hygieneRecordDetailVO); |
|
|
|
|
String templateFile = "template/卫生自查表" + SafeProductConstant.DOCX_SUFFIX; |
|
|
|
|
String wordPath = savePath + "/卫生自查表" + SafeProductConstant.DOCX_SUFFIX; |
|
|
|
|