| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import zy.cloud.wms.manager.entity.ReceiveDetl; |
| | | import zy.cloud.wms.manager.service.ReceiveDetlService; |
| | | 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 zy.cloud.wms.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import zy.cloud.wms.common.web.BaseController; |
| | | import zy.cloud.wms.manager.entity.ReceiveDetl; |
| | | import zy.cloud.wms.manager.service.ReceiveDetlService; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class ReceiveDetlController extends BaseController { |
| | |
| | | EntityWrapper<ReceiveDetl> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | hostEq(wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(receiveDetlService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | wrapper.eq(entry.getKey(), val); |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | @RequestMapping(value = "/receiveDetl/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam String param){ |
| | | List<ReceiveDetl> list = JSONArray.parseArray(param, ReceiveDetl.class); |
| | | if (Cools.isEmpty(list)){ |
| | | return R.error(); |
| | | } |
| | | for (ReceiveDetl entity : list){ |
| | | receiveDetlService.delete(new EntityWrapper<>(entity)); |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | receiveDetlService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<ReceiveDetl> wrapper = new EntityWrapper<>(); |
| | | hostEq(wrapper); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("orderDetl")); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("receiveDetl")); |
| | | convert(map, wrapper); |
| | | List<ReceiveDetl> list = receiveDetlService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | |
| | | public R query(String condition) { |
| | | EntityWrapper<ReceiveDetl> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | hostEq(wrapper); |
| | | Page<ReceiveDetl> page = receiveDetlService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (ReceiveDetl receiveDetl : page.getRecords()){ |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping("/receiveDetl/addIn") |
| | | public R addIn(@RequestBody ReceiveDetl receiveDetl){ |
| | | System.out.println("receiveDetl = " + receiveDetl); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |