|
@@ -4,19 +4,23 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.hssx.cloudmodel.constant.Constant;
|
|
|
+import com.hssx.cloudmodel.entity.Mould;
|
|
|
import com.hssx.cloudmodel.entity.MouldEquipment;
|
|
|
import com.hssx.cloudmodel.entity.User;
|
|
|
import com.hssx.cloudmodel.entity.vo.MouldEquipmentVO;
|
|
|
import com.hssx.cloudmodel.mapper.MouldEquipmentMapper;
|
|
|
+import com.hssx.cloudmodel.mapper.MouldMapper;
|
|
|
import com.hssx.cloudmodel.service.MouldEquipmentService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.hssx.cloudmodel.util.HttpRespMsg;
|
|
|
import com.hssx.cloudmodel.util.PageUtil;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.LocalTime;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -31,6 +35,8 @@ import java.util.List;
|
|
|
public class MouldEquipmentServiceImpl extends ServiceImpl<MouldEquipmentMapper, MouldEquipment> implements MouldEquipmentService {
|
|
|
@Resource
|
|
|
MouldEquipmentMapper mouldEquipmentMapper;
|
|
|
+ @Resource
|
|
|
+ MouldMapper mouldMapper;
|
|
|
|
|
|
@Override
|
|
|
public HttpRespMsg addAndUpdateMouldEquipment(MouldEquipment mouldEquipment, User user) {
|
|
@@ -86,7 +92,15 @@ public class MouldEquipmentServiceImpl extends ServiceImpl<MouldEquipmentMapper,
|
|
|
@Override
|
|
|
public HttpRespMsg getListByCompanyId(MouldEquipmentVO mouldEquipmentVO) {
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
- List<MouldEquipmentVO> list = mouldEquipmentMapper.getListByCompanyId(mouldEquipmentVO.getBelongCompanyId());
|
|
|
+ List<Integer> ides = new ArrayList<>();
|
|
|
+ List<Mould> moulds = mouldMapper.selectList(new QueryWrapper<Mould>().eq("company_id", mouldEquipmentVO.getBelongCompanyId()));
|
|
|
+ for (Mould mould : moulds) {
|
|
|
+ ides.add(mould.getEquipmentId());
|
|
|
+ }
|
|
|
+ if(ides.size()==0){
|
|
|
+ ides.add(-1);
|
|
|
+ }
|
|
|
+ List<MouldEquipmentVO> list = mouldEquipmentMapper.getListByCompanyId(mouldEquipmentVO.getBelongCompanyId(),ides);
|
|
|
msg.data = list;
|
|
|
return msg;
|
|
|
}
|