| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import com.zy.asrs.service.WrkDetlService; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class WrkDetlController extends BaseController { |
| | |
| | | } else { |
| | | wrapper.orderBy("appe_time", false); |
| | | } |
| | | return R.ok(wrkDetlService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | Page<WrkDetl> page = wrkDetlService.selectPage(new Page<>(curr, limit), wrapper); |
| | | List<WrkDetl> resultRecords = new ArrayList<>(); |
| | | for (WrkDetl record : page.getRecords()) { |
| | | if (isJSON(record.getOrderNo())) { |
| | | JSON.parseArray(record.getOrderNo(), DetlDto.class).forEach( detlDto -> { |
| | | WrkDetl clone = record.clone(); |
| | | clone.setOrderNo(detlDto.getOrderNo()); |
| | | clone.setAnfme(detlDto.getAnfme()); |
| | | resultRecords.add(clone); |
| | | }); |
| | | } else { |
| | | resultRecords.add(record); |
| | | } |
| | | } |
| | | |
| | | return R.ok(page.setRecords(resultRecords)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |