ljx пре 4 година
родитељ
комит
33e78de50b

+ 9 - 0
src/main/java/com/imed/costaccount/service/impl/CostOtherPaymentsDataServiceImpl.java

@@ -117,6 +117,13 @@ public class CostOtherPaymentsDataServiceImpl extends ServiceImpl<CostOtherPayme
     @Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
     public void updateOtherPaymentData(CostOtherPaymentsDataEditDto costOtherPaymentsDataEditDto, Long hospId) {
         String dateTime = costOtherPaymentsDataEditDto.getDateTime();
+        int year = 0;
+        int month = 0;
+        Date date = DateUtils.StringToDate(dateTime, DateStyleEnum.YYYY_MM);
+        if (StrUtil.isNotBlank(dateTime)) {
+            year = DateUtil.year(date);
+            month = DateUtil.month(date) + 1;
+        }
         Long id = costOtherPaymentsDataEditDto.getId();
         CostOtherPaymentsData otherPaymentsData = this.getById(id);
         if (Objects.isNull(otherPaymentsData)){
@@ -130,6 +137,8 @@ public class CostOtherPaymentsDataServiceImpl extends ServiceImpl<CostOtherPayme
         CostOtherPaymentsData costOtherPaymentsData = BeanUtil.convertObj(costOtherPaymentsDataSaveDto, CostOtherPaymentsData.class);
         costOtherPaymentsData.setCreateTime(System.currentTimeMillis());
         costOtherPaymentsData.setHospId(hospId);
+        costOtherPaymentsData.setDateYear(year);
+        costOtherPaymentsData.setDateMonth(month);
         this.save(costOtherPaymentsData);
     }