郭峥三阶段答辩
需求分析
- 商品管理(增删改查)
- 商品品牌管理(增删改查)
- 商品类型管理(增删改查)
- 赠品管理(增删改查)
- 添加赠品
- 详情(查询)
- 修改数量
- 商品转赠品(需要审核)
- 赠品转商品(需要审核)
- 审核
- 促销活动申请与审批
- 价格调整申请与审批
这是一开始想的
产品查询
- 产品查询是集大成查询,里面有分类、品牌、型号,先完成以上三个在写产品查询!
改版解决商品表字段过多
这是最后完成的
商品品牌管理
商品分类管理
将数据库的分类根据父级id转为树状结构
// 将传来的品牌表转成树状结构
private List<GgCategoryVo> buildCategoryTree(List<GgCategory> categories, Integer parentId) {
ArrayList<GgCategoryVo> tree = new ArrayList<>();
for (GgCategory category : categories) {
if (category.getParentId() == parentId) {
GgCategoryVo ggCategoryVo = new GgCategoryVo();
ggCategoryVo.setCategoryName(category.getCategoryName());
ggCategoryVo.setCategoryId(category.getCategoryId());
ggCategoryVo.setParentId(category.getParentId());
List<GgCategoryVo> children = buildCategoryTree(categories, category.getCategoryId());
ggCategoryVo.setGgCategoryVoChildren(children);
tree.add(ggCategoryVo);
}
}
return tree;
}
多级选项
产品查询
excel操作
@GetMapping("/download/sample")
public ResponseEntity<byte[]> downloadSample() throws UnsupportedEncodingException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
//写出
EasyExcel.write(out, GgProductVoExcel.class).sheet("产品表").doWrite(null);
//写出
byte[] bytes = out.toByteArray();
//固定三写法
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.setContentDispositionFormData("attachement", URLEncoder.encode("模板.xlsx", "utf-8"));
return new ResponseEntity<>(bytes, httpHeaders, HttpStatus.OK);
}
赠品管理
赠品就是商品,商品就是赠品,赠品拿一个表来维护与商品的关系即可
赠品管理
添加赠品
通过展现商品表,获取商品id维护赠品申请
商品转赠品提交后,发送到审核
审核通过后才真正的转为赠品
NGINX配置
server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /usr/local/nginx/conf/ssl/crm.zinzin.cc.crt;
ssl_certificate_key /usr/local/nginx/conf/ssl/crm.zinzin.cc.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_timeout 10m;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_buffer_size 1400;
add_header Strict-Transport-Security max-age=15768000;
ssl_stapling on;
ssl_stapling_verify on;
server_name crm.zinzin.cc;
access_log /data/wwwlogs/crm.zinzin.cc_nginx.log combined;
index index.html index.htm index.php;
root /data/wwwroot/crm.zinzin.cc;
if ($ssl_protocol = "") { return 301 https://$host$request_uri; }
include /usr/local/nginx/conf/rewrite/other.conf;
#error_page 404 /404.html;
#error_page 502 /502.html;
location /api/
{
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-Proto https;
add_header X-Cache $upstream_cache_status;
rewrite ^/api/(.*)$ /$1 break;
proxy_pass http://42.193.187.76:8088/;
}
location ~ [^/]\.php(/|$) {
#fastcgi_pass remote_php_ip:9000;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
expires 30d;
access_log off;
}
location ~ .*\.(js|css)?$ {
expires 7d;
access_log off;
}
location ~ /(\.user\.ini|\.ht|\.git|\.svn|\.project|LICENSE|README\.md) {
deny all;
}
location /.well-known {
allow all;
}
}
评论区