| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.app.patrolplan.domain.ArdAppPatrolpointRecordImg; |
| | | import com.ruoyi.app.patrolplan.mapper.ArdAppPatrolpointRecordImgMapper; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.utils.result.Results; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.app.patrolplan.mapper.ArdAppPatrolpointRecordMapper; |
| | |
| | | public class ArdAppPatrolpointRecordServiceImpl implements IArdAppPatrolpointRecordService { |
| | | @Resource |
| | | private ArdAppPatrolpointRecordMapper ardAppPatrolpointRecordMapper; |
| | | |
| | | @Resource |
| | | private ArdAppPatrolpointRecordImgMapper recordImgMapper; |
| | | |
| | | /** |
| | | * 查询app巡检计划记录 |
| | |
| | | public int deleteArdAppPatrolpointRecordById(String id) { |
| | | return ardAppPatrolpointRecordMapper.deleteArdAppPatrolpointRecordById(id); |
| | | } |
| | | |
| | | @Override |
| | | public Results record(ArdAppPatrolpointRecord ardAppPatrolpointRecord) { |
| | | String id = IdUtils.simpleUUID(); |
| | | ardAppPatrolpointRecord.setId(id); |
| | | int num = ardAppPatrolpointRecordMapper.insert(ardAppPatrolpointRecord); |
| | | List<String> list = ardAppPatrolpointRecord.getImg(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | ArdAppPatrolpointRecordImg recordImg = new ArdAppPatrolpointRecordImg(); |
| | | String imgId = IdUtils.simpleUUID(); |
| | | recordImg.setId(imgId); |
| | | recordImg.setAppPatrolponitRecordId(id); |
| | | recordImg.setImg(list.get(i)); |
| | | recordImgMapper.insert(recordImg); |
| | | } |
| | | if(num>0){ |
| | | return Results.succeed("打卡成功!"); |
| | | }else { |
| | | return Results.error("打开失败!"); |
| | | } |
| | | } |
| | | } |