|
@@ -7,6 +7,7 @@ import com.abi.qms.platform.dto.req.QueryListBreweryProductionLineReq;
|
|
|
import com.abi.qms.platform.dto.req.SaveBreweryProductionLineReq;
|
|
|
import com.abi.qms.platform.dto.res.QueryListBreweryProductionLineRes;
|
|
|
import com.abi.qms.platform.infrastructure.util.AssertUtil;
|
|
|
+import com.abi.qms.platform.infrastructure.util.UserUtil;
|
|
|
import com.abi.qms.platform.service.BreweryProductionLineService;
|
|
|
import com.abi.task.common.api.exception.BusinessException;
|
|
|
import com.abi.task.common.utils.PojoConverterUtils;
|
|
@@ -26,6 +27,9 @@ public class BreweryProductionLineServiceImpl implements BreweryProductionLineSe
|
|
|
@Autowired
|
|
|
private BreweryProductionLineMapper breweryProductionLineMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private UserUtil userUtil;
|
|
|
+
|
|
|
/**
|
|
|
* 新增接口
|
|
|
* @author lu
|
|
@@ -74,9 +78,15 @@ public class BreweryProductionLineServiceImpl implements BreweryProductionLineSe
|
|
|
*/
|
|
|
@Override
|
|
|
public QueryListBreweryProductionLineRes queryListBreweryProductionLine(QueryListBreweryProductionLineReq req) {
|
|
|
+ // 是小程序用户主账号 1-是 0-不是
|
|
|
+ Integer isMainAccount = userUtil.getWholeUser().getIsMainAccount();
|
|
|
QueryWrapper<BreweryProductionLine> query = new QueryWrapper<>();
|
|
|
- query.eq("user_id",req.getUserId());
|
|
|
query.eq("is_delete",0);
|
|
|
+ if (isMainAccount.equals(0)) {
|
|
|
+ query.eq("user_id",req.getUserId());
|
|
|
+ } else {
|
|
|
+ query.eq("beer_factory_id",req.getBeerFactoryId());
|
|
|
+ }
|
|
|
List<BreweryProductionLine> breweryProductionLines = breweryProductionLineMapper.selectList(query);
|
|
|
//封装出参
|
|
|
QueryListBreweryProductionLineRes res = new QueryListBreweryProductionLineRes();
|