| | |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.*; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.DocType; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.param.OrderDomainParam; |
| | | import com.zy.asrs.service.DocTypeService; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.common.model.DetlDto; |
| | |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | @Autowired |
| | | private DocTypeService docTypeService; |
| | | |
| | | @RequestMapping(value = "/order/nav/list/auth") |
| | | @ManagerAuth |
| | |
| | | if (!Cools.isEmpty(orderNo)) { |
| | | wrapper.like("order_no", orderNo); |
| | | } |
| | | wrapper.le("settle", 2).eq("doc_type", 1).eq("status", 1); |
| | | wrapper.le("settle", 2).eq("status", 1); |
| | | wrapper.orderBy("create_time", false); |
| | | List<Order> orders = orderService.selectList(wrapper); |
| | | // 保留出库单 |
| | | if (!Cools.isEmpty(orders)) { |
| | | Iterator<Order> iterator = orders.iterator(); |
| | | while (iterator.hasNext()) { |
| | | Order order = iterator.next(); |
| | | if (order.getDocType() != null) { |
| | | DocType docType = docTypeService.selectById(order.getDocType()); |
| | | if (docType != null) { |
| | | if (docType.getPakout() == 0) { |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return R.ok().add(orders); |
| | | } |
| | | |
| | |
| | | return R.ok(orderDetlService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | @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){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | @Repository |
| | |
| | | |
| | | List<OrderDetl> selectWorkingDetls(Long orderId); |
| | | |
| | | List<OrderDetl> getPakoutPage(Map<String, Object> map); |
| | | |
| | | Integer getPakoutPageCount(Map<String, Object> map); |
| | | |
| | | int increase(@Param("orderId")Long orderId, @Param("matnr")String matnr, @Param("batch")String batch, @Param("qty")Double qty); |
| | | |
| | | int decrease(@Param("orderNo")String orderNo, @Param("matnr")String matnr, @Param("batch")String batch, @Param("qty")Double qty); |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | |
| | |
| | | |
| | | List<OrderDetl> selectByOrderId(Long orderId); |
| | | |
| | | Page<OrderDetl> getPakoutPage(Page<OrderDetl> page); |
| | | |
| | | OrderDetl selectItem(Long orderId, String matnr, String batch); |
| | | |
| | | OrderDetl selectItem(String orderNo, String matnr, String batch); |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.mapper.OrderDetlMapper; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Page<OrderDetl> getPakoutPage(Page<OrderDetl> page) { |
| | | page.setRecords(baseMapper.getPakoutPage(page.getCondition())); |
| | | page.setTotal(baseMapper.getPakoutPageCount(page.getCondition())); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | | public OrderDetl selectItem(Long orderId, String matnr, String batch) { |
| | | return this.baseMapper.selectItem(orderId, matnr, batch); |
| | | } |
| | |
| | | and qty < anfme |
| | | </select> |
| | | |
| | | <sql id="pakOutPageCondition"> |
| | | <if test="order_id!=null and order_id!='' "> |
| | | and mod.order_id like '%' + #{order_id} + '%' |
| | | </if> |
| | | <if test="matnr!=null and matnr!='' "> |
| | | and mod.matnr like '%' + #{matnr} + '%' |
| | | </if> |
| | | <if test="maktx!=null and maktx!='' "> |
| | | and mod.maktx like '%' + #{maktx} + '%' |
| | | </if> |
| | | <if test="batch!=null and batch!='' "> |
| | | and mod.batch like '%' + #{batch} + '%' |
| | | </if> |
| | | </sql> |
| | | |
| | | <select id="getPakoutPage" resultMap="BaseResultMap"> |
| | | select * from |
| | | ( |
| | | select |
| | | ROW_NUMBER() over (order by mo.create_time desc) as row, |
| | | mod.* |
| | | from man_order_detl mod |
| | | inner join man_order mo on mod.order_id = mo.id |
| | | inner join man_doc_type mdt on mo.doc_type = mdt.doc_id |
| | | where 1=1 |
| | | and mo.settle <= 2 |
| | | and mo.status = 1 |
| | | and mdt.pakout = 1 |
| | | <include refid="pakOutPageCondition"></include> |
| | | ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | |
| | | <select id="getPakoutPageCount" parameterType="java.util.Map" resultType="java.lang.Integer"> |
| | | select |
| | | count(1) |
| | | from man_order_detl mod |
| | | inner join man_order mo on mod.order_id = mo.id |
| | | inner join man_doc_type mdt on mo.doc_type = mdt.doc_id |
| | | where 1=1 |
| | | and mo.settle <= 2 |
| | | and mo.status = 1 |
| | | and mdt.pakout = 1 |
| | | <include refid="pakOutPageCondition"></include> |
| | | </select> |
| | | |
| | | <update id="increase"> |
| | | update man_order_detl |
| | | set qty = qty + #{qty} |
| | |
| | | insTb2 = table.render({ |
| | | elem: '#orderDetlTable', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/orderDetl/list/auth', |
| | | url: baseUrl+'/orderDetl/pakout/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |