| | |
| | | package zy.cloud.wms.manager.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import zy.cloud.wms.manager.entity.*; |
| | | import zy.cloud.wms.manager.mapper.ItemMapper; |
| | | import zy.cloud.wms.manager.entity.Item; |
| | | import zy.cloud.wms.manager.service.FlowStatusService; |
| | | import zy.cloud.wms.manager.service.ItemService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import zy.cloud.wms.manager.service.ProjectPlanService; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service("itemService") |
| | | public class ItemServiceImpl extends ServiceImpl<ItemMapper, Item> implements ItemService { |
| | | @Autowired |
| | | private ProjectPlanService planService; |
| | | @Autowired |
| | | private FlowStatusService flowStatusService; |
| | | @Autowired |
| | | private ItemService itemService; |
| | | |
| | | @Override |
| | | public Item selectByName(String name) { |
| | |
| | | item.setName(name); |
| | | return this.selectOne(new EntityWrapper<>(item)); |
| | | } |
| | | |
| | | @Override |
| | | public Page<Item> chaoPirce(Page<Item> page,String uuid){ |
| | | page.setRecords(baseMapper.chaoPrice(page.getCondition(),uuid)); |
| | | return page; |
| | | } |
| | | @Override |
| | | public Page<Item> chaoTime(Page<Item> page,String uuid){ |
| | | page.setRecords(baseMapper.chaoTime(page.getCondition(),uuid)); |
| | | return page; |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void insertAll(Item item) { |
| | | this.insert(item); |
| | | Integer isAsrs = item.getType().equals("10")? 1: 0; |
| | | List<FlowStatus> allTypes = flowStatusService.selectList(new EntityWrapper<FlowStatus>() |
| | | .eq("is_asrs", isAsrs) |
| | | .orderBy("weight_num",true)); |
| | | for (FlowStatus oneType : allTypes) { |
| | | ProjectPlan projectPlan = new ProjectPlan(); |
| | | projectPlan.setItemId(item.getId()); |
| | | projectPlan.setWeightNum(oneType.getWeightNum()); |
| | | projectPlan.setFlowId(oneType.getId()); |
| | | projectPlan.setCreateId(item.getCreateBy()); |
| | | projectPlan.setCreateTime(item.getCreateTime()); |
| | | projectPlan.setModifyId(item.getUpdateBy()); |
| | | projectPlan.setModifyTime(item.getUpdateTime()); |
| | | planService.insert(projectPlan); |
| | | } |
| | | |
| | | } |
| | | @Override |
| | | public List<Item> inspected(){ |
| | | return baseMapper.inspected(); |
| | | } |
| | | @Override |
| | | public List<Item> finished(){ |
| | | return baseMapper.finished(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |