| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import com.example.erp.entity.sd.OrderProcessDetail; |
| | | import com.example.erp.entity.userInfo.Log; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.mapper.pp.FlowCardMapper; |
| | | import com.example.erp.mapper.sd.OrderGlassDetailMapper; |
| | | import com.example.erp.mapper.sd.OrderProcessDetailMapper; |
| | |
| | | |
| | | } |
| | | |
| | | public List<FlowCard> getProcessCard() { |
| | | public List<FlowCard> getProcessCard(Map<String, String> processCards) { |
| | | String processCard = processCards.get("processCard"); |
| | | if(!processCard.contains("/")){ |
| | | throw new ServiceException(Constants.Code_600, "错误的流程卡号,请检查!"); |
| | | } |
| | | |
| | | String[] processCardList = processCard.split("/"); |
| | | |
| | | List<FlowCard> flowCardList = flowCardMapper.selectList( |
| | | new QueryWrapper<FlowCard>().eq("termination_status", 0) |
| | | .orderByDesc("id") |
| | | new QueryWrapper<FlowCard>() |
| | | .eq("process_id", processCardList[0]) |
| | | .eq("technology_number", processCardList[1]) |
| | | ); |
| | | for (FlowCard flowCard : flowCardList) { |
| | | flowCard.setProcessId(flowCard.getProcessId()+'/'+flowCard.getTechnologyNumber()); |
| | | flowCard.setOrderGlassDetail( |
| | | orderGlassDetailMapper.selectOne( |
| | | new QueryWrapper<OrderGlassDetail>() |
| | |
| | | return flowCardList; |
| | | } |
| | | |
| | | public Boolean updateProcessCardState(Integer id) { |
| | | UpdateWrapper<FlowCard> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("id", id) // 根据id更新 |
| | | .set("termination_status", 1); |
| | | return flowCardMapper.update(null, updateWrapper) > 0; |
| | | } |
| | | } |
| | | |
| | | |