| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.WrkMastDetlLog; |
| | | import com.zy.asrs.service.WrkMastDetlLogService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.WrkMastDetlLog; |
| | | import com.zy.asrs.service.WrkMastDetlLogService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | public class WrkMastDetlLogController extends BaseController { |
| | |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(WrkMastDetlLog.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | if (!Cools.isEmpty(orderByField)) { |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | } |
| | | wrapper.orderBy("io_time", false); |
| | | return R.ok(wrkMastDetlLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | Page<WrkMastDetlLog> wrkMastDetlLogPage = wrkMastDetlLogService.selectPage(new Page<>(curr, limit), wrapper); |
| | | List<WrkMastDetlLog> records = wrkMastDetlLogPage.getRecords(); |
| | | HashMap<String, Double> count = new HashMap<>(); |
| | | for (WrkMastDetlLog record : records) { |
| | | String ioType = record.getIoType$(); |
| | | if (!Cools.isEmpty(ioType) && !"null".equalsIgnoreCase(ioType)) { |
| | | if (!"53.拣料再入库".equalsIgnoreCase(ioType)) { |
| | | if ("103.拣料出库".equalsIgnoreCase(ioType)) { |
| | | ioType = "101.出库"; |
| | | } |
| | | String[] split = ioType.split("\\."); |
| | | Double l = count.get(ioType); |
| | | if (l == null) { |
| | | count.put(split[1], record.getAnfme()); |
| | | } else { |
| | | count.put(split[1], l + record.getAnfme()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | R ok = R.ok(wrkMastDetlLogPage); |
| | | ok.put("count", count); |
| | | return ok; |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |