|
@@ -55,12 +55,27 @@ public class ProductController {
|
|
@Resource
|
|
@Resource
|
|
private SysDictService sysDictService;
|
|
private SysDictService sysDictService;
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @Description:获取产品列表数据
|
|
|
|
+ * @Param: [userId, productName, productCode, pageIndex,productType,status, pageSize]
|
|
|
|
+ * @return: com.management.platform.util.HttpRespMsg
|
|
|
|
+ * @Author: yurk
|
|
|
|
+ * @Date: 2024/5/21
|
|
|
|
+ */
|
|
@RequestMapping("/list")
|
|
@RequestMapping("/list")
|
|
- public HttpRespMsg list(String userId,String productName,String productCode,Integer pageIndex,Integer pageSize){
|
|
|
|
|
|
+ public HttpRespMsg list(String userId,String productName,String productCode,Integer productType,Integer status,Integer pageIndex,Integer pageSize){
|
|
Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
|
|
Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
|
|
- return productService.getList(companyId,userId,productName,productCode,pageIndex,pageSize);
|
|
|
|
|
|
+ return productService.getList(companyId,userId,productName,productCode,productType,status,pageIndex,pageSize);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @Description:新增修改产品信息
|
|
|
|
+ * @Param: [product]
|
|
|
|
+ * @return: com.management.platform.util.HttpRespMsg
|
|
|
|
+ * @Author: yurk
|
|
|
|
+ * @Date: 2024/5/21
|
|
|
|
+ */
|
|
@RequestMapping("/addOrUpdate")
|
|
@RequestMapping("/addOrUpdate")
|
|
public HttpRespMsg addOrUpdate(Product product){
|
|
public HttpRespMsg addOrUpdate(Product product){
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
@@ -112,6 +127,13 @@ public class ProductController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @Description:批量删除
|
|
|
|
+ * @Param: [ids]
|
|
|
|
+ * @return: com.management.platform.util.HttpRespMsg
|
|
|
|
+ * @Author: yurk
|
|
|
|
+ * @Date: 2024/5/21
|
|
|
|
+ */
|
|
@RequestMapping("/delete")
|
|
@RequestMapping("/delete")
|
|
public HttpRespMsg delete(String ids){
|
|
public HttpRespMsg delete(String ids){
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
@@ -155,21 +177,50 @@ public class ProductController {
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @Description:导入产品数据
|
|
|
|
+ * @Param: [multipartFile]
|
|
|
|
+ * @return: com.management.platform.util.HttpRespMsg
|
|
|
|
+ * @Author: yurk
|
|
|
|
+ * @Date: 2024/5/21
|
|
|
|
+ */
|
|
@RequestMapping("/importData")
|
|
@RequestMapping("/importData")
|
|
public HttpRespMsg importData(MultipartFile multipartFile){
|
|
public HttpRespMsg importData(MultipartFile multipartFile){
|
|
return productService.importData(multipartFile);
|
|
return productService.importData(multipartFile);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @Description:导出产品数据
|
|
|
|
+ * @Param: [userId, productName, productCode]
|
|
|
|
+ * @return: com.management.platform.util.HttpRespMsg
|
|
|
|
+ * @Author: yurk
|
|
|
|
+ * @Date: 2024/5/21
|
|
|
|
+ */
|
|
@RequestMapping("/exportData")
|
|
@RequestMapping("/exportData")
|
|
- public HttpRespMsg exportData(String userId,String productName,String productCode) throws Exception {
|
|
|
|
- return productService.exportData(userId,productName,productCode);
|
|
|
|
|
|
+ public HttpRespMsg exportData(String userId,String productName,String productCode,Integer productType,Integer status) throws Exception {
|
|
|
|
+ return productService.exportData(userId,productName,productCode,productType,status);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @Description:详情数据
|
|
|
|
+ * @Param: [id]
|
|
|
|
+ * @return: com.management.platform.util.HttpRespMsg
|
|
|
|
+ * @Author: yurk
|
|
|
|
+ * @Date: 2024/5/21
|
|
|
|
+ */
|
|
@RequestMapping("/detail")
|
|
@RequestMapping("/detail")
|
|
public HttpRespMsg detail(Integer id){
|
|
public HttpRespMsg detail(Integer id){
|
|
return productService.getDetail(id);
|
|
return productService.getDetail(id);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @Description:转移产品数据
|
|
|
|
+ * @Param: [id, userId]
|
|
|
|
+ * @return: com.management.platform.util.HttpRespMsg
|
|
|
|
+ * @Author: yurk
|
|
|
|
+ * @Date: 2024/5/21
|
|
|
|
+ */
|
|
@RequestMapping("/transferIncharger")
|
|
@RequestMapping("/transferIncharger")
|
|
public HttpRespMsg transferIncharger(Integer id,String userId){
|
|
public HttpRespMsg transferIncharger(Integer id,String userId){
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
@@ -196,6 +247,13 @@ public class ProductController {
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @Description:产品相关商机数据
|
|
|
|
+ * @Param: [id]
|
|
|
|
+ * @return: com.management.platform.util.HttpRespMsg
|
|
|
|
+ * @Author: yurk
|
|
|
|
+ * @Date: 2024/5/21
|
|
|
|
+ */
|
|
@RequestMapping("/businessListWithProduct")
|
|
@RequestMapping("/businessListWithProduct")
|
|
public HttpRespMsg businessListWithProduct(Integer id){
|
|
public HttpRespMsg businessListWithProduct(Integer id){
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
@@ -229,6 +287,13 @@ public class ProductController {
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @Description:产品相关订单数据
|
|
|
|
+ * @Param: [id]
|
|
|
|
+ * @return: com.management.platform.util.HttpRespMsg
|
|
|
|
+ * @Author: yurk
|
|
|
|
+ * @Date: 2024/5/21
|
|
|
|
+ */
|
|
@RequestMapping("/orderWithProduct")
|
|
@RequestMapping("/orderWithProduct")
|
|
public HttpRespMsg orderWithProduct(Integer id){
|
|
public HttpRespMsg orderWithProduct(Integer id){
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
@@ -262,14 +327,30 @@ public class ProductController {
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @Description:回收站数据
|
|
|
|
+ * @Param: [pageIndex, pageSize]
|
|
|
|
+ * @return: com.management.platform.util.HttpRespMsg
|
|
|
|
+ * @Author: yurk
|
|
|
|
+ * @Date: 2024/5/21
|
|
|
|
+ */
|
|
@RequestMapping("/recycleList")
|
|
@RequestMapping("/recycleList")
|
|
public HttpRespMsg recycleList(Integer pageIndex,Integer pageSize){
|
|
public HttpRespMsg recycleList(Integer pageIndex,Integer pageSize){
|
|
return productService.recycleList(pageIndex,pageSize);
|
|
return productService.recycleList(pageIndex,pageSize);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @Description:批量恢复产品数据
|
|
|
|
+ * @Param: [ids]
|
|
|
|
+ * @return: com.management.platform.util.HttpRespMsg
|
|
|
|
+ * @Author: yurk
|
|
|
|
+ * @Date: 2024/5/21
|
|
|
|
+ */
|
|
@RequestMapping("/batchRecoveryProduct")
|
|
@RequestMapping("/batchRecoveryProduct")
|
|
public HttpRespMsg recovery(String ids){
|
|
public HttpRespMsg recovery(String ids){
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
|
|
+ User user = userMapper.selectById(request.getHeader("token"));
|
|
if(!StringUtils.isEmpty(ids)){
|
|
if(!StringUtils.isEmpty(ids)){
|
|
String[] idsSplit = ids.split(",");
|
|
String[] idsSplit = ids.split(",");
|
|
List<String> splitList = Arrays.asList(idsSplit);
|
|
List<String> splitList = Arrays.asList(idsSplit);
|
|
@@ -282,10 +363,33 @@ public class ProductController {
|
|
});
|
|
});
|
|
productService.updateBatchById(productList);
|
|
productService.updateBatchById(productList);
|
|
}
|
|
}
|
|
|
|
+ List<AuditLogCenter> auditLogCenters =new ArrayList<>();
|
|
|
|
+ if(idList.size()>0){
|
|
|
|
+ idList.forEach(i->{
|
|
|
|
+ //todo: 生成操作记录
|
|
|
|
+ AuditLogCenter auditLogCenter =new AuditLogCenter();
|
|
|
|
+ auditLogCenter.setAuditorContent("恢复了产品");
|
|
|
|
+ auditLogCenter.setAuditorId(user.getId());
|
|
|
|
+ auditLogCenter.setAuditorName(user.getName());
|
|
|
|
+ auditLogCenter.setModuleId(Integer.valueOf(i));
|
|
|
|
+ auditLogCenter.setModuleCode("Product");
|
|
|
|
+ auditLogCenters.add(auditLogCenter);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ if(auditLogCenters.size()>0){
|
|
|
|
+ auditLogCenterService.saveBatch(auditLogCenters);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @Description:批量删除产品数据
|
|
|
|
+ * @Param: [ids]
|
|
|
|
+ * @return: com.management.platform.util.HttpRespMsg
|
|
|
|
+ * @Author: yurk
|
|
|
|
+ * @Date: 2024/5/21
|
|
|
|
+ */
|
|
@RequestMapping("/batchDeleteProduct")
|
|
@RequestMapping("/batchDeleteProduct")
|
|
public HttpRespMsg batchDeleteProduct(String ids){
|
|
public HttpRespMsg batchDeleteProduct(String ids){
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
@@ -298,5 +402,38 @@ public class ProductController {
|
|
}
|
|
}
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @Description:认领产品数据
|
|
|
|
+ * @Param: [productId]
|
|
|
|
+ * @return: com.management.platform.util.HttpRespMsg
|
|
|
|
+ * @Author: yurk
|
|
|
|
+ * @Date: 2024/5/21
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping("/claimProduct")
|
|
|
|
+ public HttpRespMsg claimProduct(Integer productId){
|
|
|
|
+ HttpRespMsg msg=new HttpRespMsg();
|
|
|
|
+ User user = userMapper.selectById(request.getHeader("token"));
|
|
|
|
+ Product product = productService.getById(productId);
|
|
|
|
+ if(product==null){
|
|
|
|
+ msg.setError("产品不存在");
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+ product.setInchargerId(user.getId());
|
|
|
|
+ if(!productService.updateById(product)){
|
|
|
|
+ msg.setError("验证失败");
|
|
|
|
+ }
|
|
|
|
+ //todo: 生成操作记录
|
|
|
|
+ AuditLogCenter auditLogCenter =new AuditLogCenter();
|
|
|
|
+ auditLogCenter.setAuditorContent("认领了产品");
|
|
|
|
+ auditLogCenter.setAuditorId(user.getId());
|
|
|
|
+ auditLogCenter.setAuditorName(user.getName());
|
|
|
|
+ auditLogCenter.setModuleId(productId);
|
|
|
|
+ auditLogCenter.setModuleCode("Product");
|
|
|
|
+ auditLogCenterService.save(auditLogCenter);
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|