generated from root/miduo_server
扶持功能,订单库信息
parent
4085b1ef82
commit
07c2e870cf
7
pom.xml
7
pom.xml
|
@ -113,6 +113,13 @@
|
|||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>3.14</version>
|
||||
</dependency>
|
||||
|
||||
<!-- lombok -->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
package com.jmfy.dao;
|
||||
|
||||
import com.jmfy.model.SupportOrder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hj
|
||||
* 扶持订单
|
||||
*/
|
||||
public interface SupportDao {
|
||||
|
||||
/**
|
||||
* 获取全部扶持订单信息
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
List<SupportOrder> getSupportOrderList() throws Exception;
|
||||
|
||||
/**
|
||||
* 插入扶持订单信息
|
||||
* @param order
|
||||
*/
|
||||
void insertSupportOrder(SupportOrder order) throws Exception;
|
||||
|
||||
/**
|
||||
* 修改扶持订单状态
|
||||
* @param id
|
||||
* @param status
|
||||
* @throws Exception
|
||||
*/
|
||||
void updateSupportOrderStatus(int id,int status) throws Exception;
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package com.jmfy.dao.impl;
|
||||
|
||||
import com.jmfy.dao.SupportDao;
|
||||
import com.jmfy.model.Constant;
|
||||
import com.jmfy.model.SupportOrder;
|
||||
import com.jmfy.utils.Connect;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.data.mongodb.core.query.Update;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hj
|
||||
*/
|
||||
@Component
|
||||
public class SupportDaoImpl implements SupportDao {
|
||||
|
||||
@Resource
|
||||
private Connect connect;
|
||||
|
||||
@Override
|
||||
public List<SupportOrder> getSupportOrderList() throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Constant.dbName);
|
||||
Query query = new Query();
|
||||
return mongoTemplate.find(query, SupportOrder.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertSupportOrder(SupportOrder order) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Constant.dbName);
|
||||
mongoTemplate.insert(order);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSupportOrderStatus(int id, int status) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Constant.dbName);
|
||||
Query query = new Query(Criteria.where("_id").is(id));
|
||||
Update update = new Update();
|
||||
update.set("status",status);
|
||||
mongoTemplate.updateMulti(query, update, SupportOrder.class);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package com.jmfy.model;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Document(collection = "support_order")
|
||||
public class SupportOrder {
|
||||
@Id
|
||||
private int id;
|
||||
/**
|
||||
* 服务器id
|
||||
*/
|
||||
@Field(value = "serverId")
|
||||
private int serverId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Field(value = "userId")
|
||||
private int userId;
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
@Field(value = "userName")
|
||||
private int userName;
|
||||
/**
|
||||
* 物品id,list
|
||||
*/
|
||||
@Field(value = "itemIds")
|
||||
private List<Integer> itemIds;
|
||||
/**
|
||||
* 物品数量,list
|
||||
*/
|
||||
@Field(value = "ItemNums")
|
||||
private List<Integer> ItemNums;
|
||||
/**
|
||||
* 状态,0:已申请,1:已通过,2:已驳回
|
||||
*/
|
||||
@Field(value = "status")
|
||||
private int status;
|
||||
/**
|
||||
* 申请人
|
||||
*/
|
||||
@Field(value = "proposer")
|
||||
private String proposer;
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
@Field(value = "auditor")
|
||||
private String auditor;
|
||||
}
|
Loading…
Reference in New Issue