| | |
| | | import org.jeecg.modules.mdc.entity.MdcShiftSub; |
| | | import org.jeecg.modules.mdc.mapper.MdcShiftSubMapper; |
| | | import org.jeecg.modules.mdc.service.IMdcShiftSubService; |
| | | import org.jeecg.modules.mdc.util.DateUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public MdcShiftSub addMdcShiftSub(JSONObject jsonbject) { |
| | | MdcShiftSub mdcShiftSub = jsonbject.toJavaObject(MdcShiftSub.class); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss"); |
| | | String startDate = simpleDateFormat.format(jsonbject.getDate("startDate")); |
| | | mdcShiftSub.setStartDate(startDate); |
| | | String endDate = simpleDateFormat.format(jsonbject.getDate("endDate")); |
| | | mdcShiftSub.setEndDate(endDate); |
| | | if (jsonbject.getDate("sleepStartDate") != null) { |
| | | String sleepStartDate = simpleDateFormat.format(jsonbject.getDate("sleepStartDate")); |
| | | mdcShiftSub.setSleepStartDate(sleepStartDate); |
| | | } |
| | | if (jsonbject.getDate("sleepEndDate") != null) { |
| | | String sleepEndDate = simpleDateFormat.format(jsonbject.getDate("sleepEndDate")); |
| | | mdcShiftSub.setSleepEndDate(sleepEndDate); |
| | | } |
| | | public MdcShiftSub addMdcShiftSub(MdcShiftSub mdcShiftSub) { |
| | | this.save(mdcShiftSub); |
| | | return mdcShiftSub; |
| | | } |