|
@@ -10,6 +10,8 @@ import com.ruixuan.common.utils.DateUtils;
|
|
|
import com.ruixuan.data.utils.ExportExcelUtils;
|
|
|
import com.ruixuan.isc.service.IKuaishouPromoterService;
|
|
|
import com.ruixuan.isc.service.ISupplyChainService;
|
|
|
+import com.ruixuan.system.service.ISysDeptService;
|
|
|
+import com.ruixuan.system.service.ISysUserService;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import lombok.SneakyThrows;
|
|
@@ -2317,6 +2319,11 @@ public class SupplyChainController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ISysUserService sysUserService;
|
|
|
+ @Autowired
|
|
|
+ private ISysDeptService deptService;
|
|
|
+
|
|
|
@GetMapping("/shopList")
|
|
|
@ApiOperation(value = "商品列表")
|
|
|
public TableDataInfo shopList(
|
|
@@ -2324,6 +2331,7 @@ public class SupplyChainController extends BaseController {
|
|
|
@ApiParam("开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
|
|
|
@ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate,
|
|
|
@ApiParam("结束时间") @RequestParam(value = "sellerId", required = false) Long sellerId,
|
|
|
+ @ApiParam("结束时间") @RequestParam(value = "userId", required = false) Long userId,
|
|
|
@ApiParam("排序字段") @RequestParam(value = "fieId", required = false) String fieId,
|
|
|
@ApiParam("排序方式") @RequestParam(value = "sort", required = false) String sort) {
|
|
|
TableDataInfo dataInfo = new TableDataInfo();
|
|
@@ -2332,8 +2340,24 @@ public class SupplyChainController extends BaseController {
|
|
|
throw new Exception("请输入开始时间和结束时间");
|
|
|
}
|
|
|
|
|
|
+ if (Check.isNull(userId)) {
|
|
|
+ throw new Exception("请输入用户id");
|
|
|
+ }
|
|
|
Map<String, Object> requestMap = new HashMap<>();
|
|
|
|
|
|
+ String roleKey = sysUserService.getRoleKeyByUserId(userId);
|
|
|
+ if (roleKey.equals("courtship")) {
|
|
|
+ List<Long> itemIds = supplyChainService.getItemIdsByUserId(userId);
|
|
|
+ requestMap.put("itemIds", itemIds);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (roleKey.equals("courtshipManager")) {
|
|
|
+ Long deptId = deptService.getDeptIdByUserId(userId);
|
|
|
+ List<Long> itemIds = supplyChainService.getItemIdsByDeptId(deptId);
|
|
|
+ requestMap.put("itemIds", itemIds);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
requestMap.put("start", orderStartDate);
|
|
|
requestMap.put("end", orderEndDate);
|
|
|
if (!Check.isNull(sellerId)) {
|
|
@@ -2368,6 +2392,7 @@ public class SupplyChainController extends BaseController {
|
|
|
@ApiParam("开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
|
|
|
@ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate,
|
|
|
@ApiParam("结束时间") @RequestParam(value = "sellerId", required = false) Long sellerId,
|
|
|
+ @ApiParam("结束时间") @RequestParam(value = "userId", required = false) Long userId,
|
|
|
@ApiParam("结束时间") @RequestParam(value = "itemId", required = false) Long itemId,
|
|
|
@ApiParam("结束时间") @RequestParam(value = "itemTitle", required = false) String itemTitle
|
|
|
|
|
@@ -2382,6 +2407,19 @@ public class SupplyChainController extends BaseController {
|
|
|
}
|
|
|
|
|
|
Map<String, Object> requestMap = new HashMap<>();
|
|
|
+ String roleKey = sysUserService.getRoleKeyByUserId(userId);
|
|
|
+ if (roleKey.equals("courtship")) {
|
|
|
+ List<Long> itemIds = supplyChainService.getItemIdsByUserId(userId);
|
|
|
+ requestMap.put("itemIds", itemIds);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (roleKey.equals("courtshipManager")) {
|
|
|
+ Long deptId = deptService.getDeptIdByUserId(userId);
|
|
|
+ List<Long> itemIds = supplyChainService.getItemIdsByDeptId(deptId);
|
|
|
+ requestMap.put("itemIds", itemIds);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
requestMap.put("start", orderStartDate);
|
|
|
requestMap.put("end", orderEndDate);
|
|
|
requestMap.put("sellerId", sellerId);
|
|
@@ -2411,7 +2449,6 @@ public class SupplyChainController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@PostMapping("/exportShopDetail")
|
|
|
- @ApiOperation(value = "认领商品列表")
|
|
|
@ResponseBody
|
|
|
public void exportShopDetail(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject requestJson) throws IOException {
|
|
|
|
|
@@ -2422,13 +2459,26 @@ public class SupplyChainController extends BaseController {
|
|
|
if (Check.isNull(requestJson.getLong("sellerId"))) {
|
|
|
throw new Exception("请输入店铺Id");
|
|
|
}
|
|
|
-
|
|
|
+ Long userId = requestJson.getLong("userId");
|
|
|
+ if (Check.isNull(userId)) {
|
|
|
+ throw new Exception("请输入用户ID");
|
|
|
+ }
|
|
|
Map<String, Object> requestMap = new HashMap<>();
|
|
|
requestMap.put("start", requestJson.getString("orderStartDate"));
|
|
|
requestMap.put("end", requestJson.getString("orderEndDate"));
|
|
|
requestMap.put("sellerId", requestJson.getLong("sellerId"));
|
|
|
|
|
|
+ String roleKey = sysUserService.getRoleKeyByUserId(userId);
|
|
|
+ if (roleKey.equals("courtship")) {
|
|
|
+ List<Long> itemIds = supplyChainService.getItemIdsByUserId(userId);
|
|
|
+ requestMap.put("itemIds", itemIds);
|
|
|
+ }
|
|
|
|
|
|
+ if (roleKey.equals("courtshipManager")) {
|
|
|
+ Long deptId = deptService.getDeptIdByUserId(userId);
|
|
|
+ List<Long> itemIds = supplyChainService.getItemIdsByDeptId(deptId);
|
|
|
+ requestMap.put("itemIds", itemIds);
|
|
|
+ }
|
|
|
List<JSONObject> list = supplyChainService.shopDetail(requestMap);
|
|
|
List<List<Object>> exportList = new ArrayList<>();
|
|
|
if (!Check.isNull(list)) {
|
|
@@ -2470,7 +2520,6 @@ public class SupplyChainController extends BaseController {
|
|
|
|
|
|
|
|
|
@PostMapping("/exportShopList")
|
|
|
- @ApiOperation(value = "认领商品列表")
|
|
|
@ResponseBody
|
|
|
public void exportShopList(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject requestJson) throws IOException {
|
|
|
|
|
@@ -2479,6 +2528,11 @@ public class SupplyChainController extends BaseController {
|
|
|
throw new Exception("请输入开始时间和结束时间");
|
|
|
}
|
|
|
|
|
|
+ Long userId = requestJson.getLong("userId");
|
|
|
+ if (Check.isNull(userId)) {
|
|
|
+ throw new Exception("请输入用户ID");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
Map<String, Object> requestMap = new HashMap<>();
|
|
|
requestMap.put("start", requestJson.getString("orderStartDate"));
|
|
@@ -2486,6 +2540,17 @@ public class SupplyChainController extends BaseController {
|
|
|
requestMap.put("fieId", "orderNum");
|
|
|
requestMap.put("sort", "desc");
|
|
|
|
|
|
+ String roleKey = sysUserService.getRoleKeyByUserId(userId);
|
|
|
+ if (roleKey.equals("courtship")) {
|
|
|
+ List<Long> itemIds = supplyChainService.getItemIdsByUserId(userId);
|
|
|
+ requestMap.put("itemIds", itemIds);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (roleKey.equals("courtshipManager")) {
|
|
|
+ Long deptId = deptService.getDeptIdByUserId(userId);
|
|
|
+ List<Long> itemIds = supplyChainService.getItemIdsByDeptId(deptId);
|
|
|
+ requestMap.put("itemIds", itemIds);
|
|
|
+ }
|
|
|
List<JSONObject> list = supplyChainService.shopList(requestMap);
|
|
|
List<List<Object>> exportList = new ArrayList<>();
|
|
|
if (!Check.isNull(list)) {
|