Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions july_api/src/main/java/com/jk/seller/service/SellerServiceApi.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,45 @@
package com.jk.seller.service;

import com.jk.model.zll.tree.Tree;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.jk.model.zll.Tree;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

@RequestMapping("seller")
public interface SellerServiceApi {

@GetMapping("queryList")
String queryList(@RequestParam("userId") String userId);


/**
* 初始化树
* @return
*/
@GetMapping("getTreeList")
List<Tree> getTreeList();

/**
* 查询定制比价管理(服务商)列表
* @return
*/
@GetMapping("getComparisonList")
Map<String,Object> getComparisonList(@RequestParam(value = "customProduct") String customProduct);

/**
* 查询材料单
*/
@GetMapping("getMaterialList")
Map<String, Object> getMaterialList(@RequestParam(value = "material") String material);

/**
* 待接单状态修改为待出图
*/
@PutMapping("updateNoSingleStatus")
void updateNoSingleStatus(@RequestParam("productID") String productID);

@PostMapping("uploadFile")
String Upload(@RequestParam(value = "file") MultipartFile file);
}
32 changes: 32 additions & 0 deletions july_common/src/main/java/com/jk/model/zll/Material.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.jk.model.zll;

import com.jk.util.PageUtil;
import lombok.Data;

import java.io.Serializable;

//材料单
@Data
@lombok.ToString
public class Material extends PageUtil implements Serializable {
private static final long serialVersionUID = 3203370458453267006L;

//材料编号
private String materialID;

//材料名称
private String materialName;

//材料数量
private String datumcount;

//保存时间
private String materialDate;

//渠道业务字段
private String channel;




}
23 changes: 23 additions & 0 deletions july_common/src/main/java/com/jk/util/FileUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.jk.util;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

public class FileUtil {
//静态方法:三个参数:文件的二进制,文件路径,文件名
//通过该方法将在指定目录下添加指定文件
public static void fileupload(byte[] file,String filePath,String fileName) throws IOException {
//目标目录
File targetfile = new File(filePath);
if(targetfile.exists()) {
targetfile.mkdirs();
}

//二进制流写入
FileOutputStream out = new FileOutputStream(filePath+fileName);
out.write(file);
out.flush();
out.close();
}
}
28 changes: 28 additions & 0 deletions july_common/src/main/java/com/jk/util/PageUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.jk.util;


public class PageUtil {

//当前页
private int page = 1;

//每页条数
private int rows = 3;

public int getPage() {
return page;
}

public void setPage(int page) {
this.page = page;
}

public int getRows() {
return rows;
}

public void setRows(int rows) {
this.rows = rows;
}

}
12 changes: 12 additions & 0 deletions july_common/src/main/java/com/jk/util/UUIDUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.jk.util;

import java.util.UUID;



public class UUIDUtil {

public static String getUUID() {
return UUID.randomUUID().toString().replaceAll("-", "");
}
}
Original file line number Diff line number Diff line change
@@ -1,30 +1,108 @@
package com.jk.seller.controller;

import com.jk.model.zll.tree.Tree;
import com.jk.model.whn.CustomProduct;
import com.jk.model.zll.Tree;
import com.jk.seller.service.SellerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("app/seller")
public class SellerController{
public class SellerController {

@Autowired
private SellerService sellerService;
@Autowired
private SellerService sellerService;

/**
* 测试
*
* @param userId
* @return
*/
@GetMapping("queryList")
public String queryList(@RequestParam("userId") String userId) {
String s = sellerService.queryList(userId);
return s;
}

@GetMapping("queryList")
public String queryList(@RequestParam("userId") String userId){
String s = sellerService.queryList(userId);
return s;
}
/**
* 查询树
*/
@GetMapping("getTreeList")
public List<Tree> getTreeList(){
public List<Tree> getTreeList() {
return sellerService.getTreeList();
}

}
/**
* 查询定制比价管理(服务商)列表
*/
@GetMapping("getComparisonList")
public Map<String, Object> getComparisonList(@RequestParam(value = "customProduct") String customProduct) {
return sellerService.getComparisonList(customProduct);
}

/**
* 查询材料单
*/
@GetMapping("getMaterialList")
public Map<String, Object> getMaterialList(@RequestParam(value = "material") String material) {
return sellerService.getMaterialList(material);
}

/**
* 待接单状态修改为待出图
*/
@PutMapping("updateNoSingleStatus")
public Boolean updateNoSingleStatus(@RequestParam(value = "productID") String productID) {
try {
sellerService.updateNoSingleStatus(productID);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}

/**
* 实现文件上传
*/
@PostMapping("fileUpload")
public String fileUpload(@RequestParam("fileName") MultipartFile file) {
if (file.isEmpty()) {
return "false";
}
String fileName = file.getOriginalFilename();
int size = (int) file.getSize();
System.out.println(fileName + "-->" + size);

String path = "E:/test";
File dest = new File(path + "/" + fileName);
if (!dest.getParentFile().exists()) { //判断文件父目录是否存在
dest.getParentFile().mkdir();
}
try {
file.transferTo(dest); //保存文件
return "true";
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return "false";
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return "false";
}
}

// 传入的参数file是我们指定的文件
@PostMapping("uploadFile")
public String upload(@RequestParam(value = "file") MultipartFile file) {
return sellerService.Upload(file);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package com.jk.seller.controller.sellerCustom;

import com.alibaba.fastjson.JSON;
import com.jk.model.whn.CustomProduct;
import com.jk.model.zll.Material;
import com.jk.model.zll.Tree;
import com.jk.seller.service.SellerServiceApi;
import com.jk.seller.service.sellerCustom.SellerCustomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

@RestController
public class SellerCustomController implements SellerServiceApi {

@Autowired
private SellerCustomService sellerCustomService;



@Override
public String queryList(String userId) {
System.out.println("userId = [" + userId + "]");
String ss ="2222";
return ss;
}

/**
* 查询树
* @return
*/
@Override
public List<Tree> getTreeList() {
return sellerCustomService.getTreeList();
}

/**
* 查询定制比价管理(服务商)列表
* @return
*/
@Override
public Map<String, Object> getComparisonList(@RequestParam(value = "customProduct") String customProduct) {

CustomProduct customProduct1 = JSON.parseObject(customProduct, CustomProduct.class);

return sellerCustomService.getComparisonList(customProduct1);
}

/**
* 查询材料单
*/
@Override
public Map<String, Object> getMaterialList(@RequestParam(value = "material") String material) {
Material material1 = JSON.parseObject(material, Material.class);
return sellerCustomService.getMaterialList(material1);
}

/**
* 待接单状态修改为待出图
*/
@Override
public void updateNoSingleStatus(@RequestParam("productID") String productID) {
sellerCustomService.updateNoSingleStatus(productID);
}

@Override
public String Upload(@RequestParam(value = "file") MultipartFile file) {
return sellerCustomService.Upload(file);
}
}

This file was deleted.

Loading