| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.DocType; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.param.OpenOrderPakinParam; |
| | | import com.zy.asrs.service.DocTypeService; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.service.OrderService; |
| | | 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 OrderDetlController extends BaseController { |
| | | |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private OrderService orderService; |
| | | |
| | | @Autowired |
| | | private DocTypeService docTypeService; |
| | | |
| | | @RequestMapping(value = "/orderDetl/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} else { |
| | | wrapper.orderBy("create_time", false); |
| | | } |
| | | return R.ok(orderDetlService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | // wrapper.eq("status", 1); |
| | | Page<OrderDetl> orderDetlPage = orderDetlService.selectPage(new Page<>(curr, limit), wrapper); |
| | | return R.ok(orderDetlPage); |
| | | } |
| | | |
| | | @RequestMapping(value = "/orderDetl/pakout/list/auth") |
| | | @ManagerAuth |
| | | public R pakoutList(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param){ |
| | | return R.ok(orderDetlService.getPakoutPage(toPage(curr, limit, param, OrderDetl.class))); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 订单明细手动上报 |
| | | * @param ids 订单明细id |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/orderDetl/manualReporting/auth") |
| | | @ManagerAuth |
| | | public R manualReporting(@RequestParam(value="ids[]") Long[] ids){ |
| | | R r = R.ok(); |
| | | for (Long id : ids){ |
| | | OrderDetl orderDetl = orderDetlService.selectById(id); |
| | | if(orderDetl.getAnfme().equals(orderDetl.getWorkQty())){ |
| | | return R.error("物料编号={"+orderDetl.getMatnr()+"}完成数量和作业数量不相同无法手动上报"); |
| | | } |
| | | if(!Cools.isEmpty(orderDetl.getUnits())&&orderDetl.getUnits().equals(orderDetl.getAnfme())){ |
| | | r= R.error("上报数量和完成数量一致禁止上报"); |
| | | } |
| | | r = orderDetlService.U8Reporting(id, 1); |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | /** |
| | | * 订单明细关闭 |
| | | * @param ids 订单明细id |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/orderDetl/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | R r = R.ok(); |
| | | for (Long id : ids){ |
| | | orderDetlService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | OrderDetl orderDetl = orderDetlService.selectById(id); |
| | | if(orderDetl.getAnfme().equals(orderDetl.getWorkQty())){ |
| | | return R.error("物料编号={"+orderDetl.getMatnr()+"}完成数量和作业数量不相同无法关闭"); |
| | | } |
| | | r = orderDetlService.U8Reporting(id, 0); |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | /** |
| | | * 订单明细启用 |
| | | * @param ids 订单明细id |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/orderDetl/enable/auth") |
| | | @ManagerAuth |
| | | public R enable(@RequestParam(value="ids[]") Long[] ids){ |
| | | R r = R.ok(); |
| | | for (Long id : ids){ |
| | | // OrderDetl orderDetl = orderDetlService.selectById(id); |
| | | // if(orderDetl.getAnfme().equals(orderDetl.getWorkQty())){ |
| | | // return R.error("物料编号={"+orderDetl.getMatnr()+"}完成数量和作业数量不相同无法启用"); |
| | | // } |
| | | r = orderDetlService.U8Reporting(id, 1); |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/orderDetl/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |