Compare commits
No commits in common. 'dev' and 'master' have entirely different histories.
46 changed files with 363 additions and 1174 deletions
@ -1,82 +0,0 @@
|
||||
package com.lan.textja.controller.dealer; |
||||
|
||||
import com.lan.textja.entity.Dealer; |
||||
import com.lan.textja.entity.Product; |
||||
import com.lan.textja.entity.Supplier; |
||||
import com.lan.textja.entity.Supply; |
||||
import com.lan.textja.service.dealer.DealerService; |
||||
import com.lan.textja.util.JsonResult; |
||||
import com.lan.textja.util.PageResult; |
||||
import com.lan.textja.util.TreeResult; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.List; |
||||
|
||||
@RestController |
||||
@CrossOrigin |
||||
@RequestMapping("/Dealer") |
||||
public class DealerController { |
||||
|
||||
@Autowired |
||||
private DealerService dealerService; |
||||
|
||||
@RequestMapping(value = "/dealerNames",method = RequestMethod.GET) |
||||
public JsonResult dealerNames(){ |
||||
List<Dealer> dealerNames= dealerService.dealerNames(); |
||||
return JsonResult.ok(dealerNames); |
||||
} |
||||
|
||||
//分页查询
|
||||
|
||||
@GetMapping("/selectDealerList") |
||||
public JsonResult selectProuductList(PageResult pageResult){ |
||||
pageResult = dealerService.selectDealerList(pageResult); |
||||
return JsonResult.ok(pageResult); |
||||
} |
||||
|
||||
@RequestMapping(value = "/onSubmit",method = RequestMethod.GET) |
||||
public JsonResult onSubmit(Dealer dealer){ |
||||
List<Dealer> dealerSelect= dealerService.dealerSelect(dealer); |
||||
return JsonResult.ok(dealerSelect); |
||||
} |
||||
|
||||
@RequestMapping(value = "/updateDealer",method = RequestMethod.GET) |
||||
public JsonResult updateDealer(Dealer dealer){ |
||||
List<Dealer> updateDealer= dealerService.updateDealer(dealer); |
||||
return JsonResult.ok(updateDealer); |
||||
} |
||||
|
||||
@RequestMapping(value = "/addupdateDealer",method = RequestMethod.POST) |
||||
public JsonResult addupdateDealer(Dealer dealer){ |
||||
dealerService.addupdateDealer(dealer); |
||||
return JsonResult.ok(JsonResult.SUCCESS); |
||||
} |
||||
|
||||
@RequestMapping(value = "/deleteDealer",method = RequestMethod.POST) |
||||
public JsonResult deleteDealer(Dealer dealer){ |
||||
dealerService.deleteDealer(dealer); |
||||
return JsonResult.ok(JsonResult.SUCCESS); |
||||
} |
||||
|
||||
|
||||
@RequestMapping(value = "/dealerNum",method = RequestMethod.GET) |
||||
public JsonResult dealerNum(){ |
||||
Integer maxValue=dealerService.dealerNum(); |
||||
return JsonResult.ok(maxValue); |
||||
} |
||||
|
||||
|
||||
@RequestMapping(value = "/onAddDealer",method = RequestMethod.POST) |
||||
public JsonResult onAddDealer(Dealer dealer){ |
||||
dealerService.onAddDealer(dealer); |
||||
return JsonResult.ok(JsonResult.SUCCESS); |
||||
} |
||||
|
||||
@RequestMapping(value = "/tree",method = RequestMethod.GET) |
||||
public JsonResult tree(){ |
||||
List<TreeResult> treeResult =dealerService.treeResult(); |
||||
return JsonResult.ok(treeResult); |
||||
} |
||||
|
||||
} |
@ -1,56 +0,0 @@
|
||||
package com.lan.textja.controller.order; |
||||
|
||||
import com.lan.textja.entity.Order; |
||||
import com.lan.textja.service.Order.DeliveryService; |
||||
import com.lan.textja.util.JsonResult; |
||||
import com.lan.textja.util.JsonUtil; |
||||
import com.lan.textja.util.PageResult; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.CrossOrigin; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RequestMethod; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
import java.util.List; |
||||
|
||||
@RestController |
||||
@CrossOrigin |
||||
@RequestMapping("/Delivery") |
||||
public class DeliveryController { |
||||
|
||||
@Autowired |
||||
private DeliveryService deliveryService; |
||||
|
||||
@RequestMapping(value = "/selectUnfinshedOrder",method = RequestMethod.GET) |
||||
public JsonResult selectUnfinshedOrder(PageResult pageResult){ |
||||
pageResult= deliveryService.selectUnfinsherdOrder(pageResult); |
||||
return JsonResult.ok(pageResult); |
||||
} |
||||
|
||||
@RequestMapping(value = "/orderDetail",method = RequestMethod.GET) |
||||
public JsonResult orderDetail(Order order){ |
||||
List<Order> orderDetailList= deliveryService.orderDetail(order); |
||||
return JsonResult.ok(orderDetailList); |
||||
} |
||||
|
||||
|
||||
@RequestMapping(value = "/onorder",method = RequestMethod.GET) |
||||
public JsonResult onorder(Order order){ |
||||
List<Order> onorder= deliveryService.onorder(order); |
||||
return JsonResult.ok(onorder); |
||||
} |
||||
|
||||
@RequestMapping(value = "/Signorder",method = RequestMethod.GET) |
||||
public JsonResult Signorder(Order order){ |
||||
deliveryService.Signorder(order); |
||||
return JsonResult.ok(JsonResult.SUCCESS); |
||||
} |
||||
|
||||
|
||||
@RequestMapping(value = "/selectDoneOrder",method = RequestMethod.GET) |
||||
public JsonResult selectDoneOrder(PageResult pageResult){ |
||||
pageResult= deliveryService.selectDoneOrder(pageResult); |
||||
return JsonResult.ok(pageResult); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,30 @@
|
||||
package com.lan.textja.controller.product; |
||||
|
||||
|
||||
import com.lan.textja.entity.ProuductBasics; |
||||
import com.lan.textja.service.product.ProuductBasicsService; |
||||
import com.lan.textja.util.JsonResult; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.CrossOrigin; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
import java.util.List; |
||||
|
||||
@CrossOrigin |
||||
@RestController |
||||
@RequestMapping("/proudcutbasics") |
||||
public class ProuductBasicsController { |
||||
@Autowired |
||||
private ProuductBasicsService prouductBasicsService; |
||||
|
||||
|
||||
|
||||
@GetMapping("/onbrandslist") |
||||
public JsonResult selectbrandslist(){ |
||||
List<ProuductBasics>brandslist= prouductBasicsService.selectbrandslist(); |
||||
return JsonResult.ok(brandslist); |
||||
|
||||
} |
||||
} |
@ -1,32 +0,0 @@
|
||||
package com.lan.textja.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import lombok.Data; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.io.Serializable; |
||||
import java.sql.Date; |
||||
|
||||
@Data |
||||
@TableName("dealer") |
||||
@Accessors(chain = true) |
||||
public class Dealer implements Serializable { |
||||
private Integer dealerNum; |
||||
private String dealerName; |
||||
private String dealerContact; |
||||
private String dealerAddress; |
||||
private String dealerNumber; |
||||
private String dealerReceiver; |
||||
private String dealerEmail; |
||||
private Boolean dealerState; |
||||
@JsonFormat(pattern="yyyy-MM-dd") |
||||
private Date dealerStartDate; |
||||
@JsonFormat(pattern="yyyy-MM-dd") |
||||
private Date dealerTerminationDate; |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} |
@ -1,30 +0,0 @@
|
||||
package com.lan.textja.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
@Data |
||||
@Accessors(chain = true) |
||||
@TableName("orders") |
||||
public class Order implements Serializable { |
||||
private Integer orderNo; |
||||
private String orderName; |
||||
private Integer orderPrice; |
||||
private Integer orderQty; |
||||
private Integer orderTotalPrice; |
||||
private String orderType; |
||||
private String orderSupplierContact; |
||||
private String orderSupplierAddress; |
||||
private String orderSupplierNumber; |
||||
private String orderDealerContact; |
||||
private String orderDealerAddress; |
||||
private String orderDealerNumber; |
||||
private Integer orderGoodsNo; |
||||
private Integer orderSupplierNo; |
||||
private Integer orderDealerNo; |
||||
private Boolean orderState; |
||||
|
||||
} |
@ -1,26 +0,0 @@
|
||||
package com.lan.textja.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
@Data |
||||
@Accessors(chain = true) |
||||
@TableName("product") |
||||
public class Product implements Serializable { |
||||
private String productName; |
||||
private String productType; |
||||
private Boolean productState; |
||||
private String productSize; |
||||
private String productBenefits; |
||||
private String productBrands; |
||||
private Integer productNum; |
||||
private String productChannel; |
||||
private Integer productSellingPrice; |
||||
private Integer productTypeNo; |
||||
private Integer productSupplierNo; |
||||
} |
@ -0,0 +1,25 @@
|
||||
package com.lan.textja.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
@Data |
||||
@Accessors(chain = true) |
||||
@TableName("prouduct") |
||||
public class Prouduct implements Serializable { |
||||
@TableId(type = IdType.AUTO) |
||||
private Integer id; |
||||
private String name; |
||||
private String type; |
||||
private Boolean state; |
||||
private String size; |
||||
private String benefits; |
||||
private String brands; |
||||
private Integer num; |
||||
private String channel; |
||||
} |
@ -0,0 +1,25 @@
|
||||
package com.lan.textja.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Data; |
||||
import lombok.NoArgsConstructor; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
@Data |
||||
@AllArgsConstructor |
||||
@NoArgsConstructor |
||||
@TableName("prouductbasics") |
||||
@Accessors(chain = true) |
||||
public class ProuductBasics implements Serializable { |
||||
|
||||
@TableId(type = IdType.AUTO) |
||||
private Integer id; |
||||
private String type; |
||||
private String brands; |
||||
private String channel; |
||||
} |
@ -1,29 +0,0 @@
|
||||
package com.lan.textja.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.lan.textja.entity.Dealer; |
||||
import org.apache.ibatis.annotations.Select; |
||||
|
||||
import java.util.List; |
||||
|
||||
public interface DealerMapper extends BaseMapper<Dealer> { |
||||
List<Dealer> dealerNames(); |
||||
|
||||
|
||||
Dealer select(String dealerName); |
||||
|
||||
@Select("select * from dealer where dealer_State=1 limit #{start},#{size} ") |
||||
List<Dealer> findDealerListByPage(int start, int size); |
||||
|
||||
List<Dealer> dealerSelect(Dealer dealer); |
||||
|
||||
List<Dealer> updateDealer(Dealer dealer); |
||||
|
||||
void addupdateDealer(Dealer dealer); |
||||
|
||||
void deleteDealer(Dealer dealer); |
||||
|
||||
List<Integer> dealerNum(); |
||||
|
||||
void onAddDealer(Dealer dealer); |
||||
} |
@ -1,24 +0,0 @@
|
||||
package com.lan.textja.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.lan.textja.entity.Order; |
||||
import org.apache.ibatis.annotations.Select; |
||||
|
||||
import java.util.List; |
||||
|
||||
public interface DeliveryMapper extends BaseMapper<Order> { |
||||
|
||||
@Select("select * from orders where order_State=1 limit #{start},#{size} ") |
||||
List<Order> findDeliveryListByPage(int start, int size); |
||||
|
||||
List<Order> orderDetail(Order order); |
||||
|
||||
void SureOrder(Order order); |
||||
|
||||
List<Order> onorder(Order order); |
||||
|
||||
void Signorder(Order order); |
||||
|
||||
@Select("select * from orders where order_State=0 limit #{start},#{size} ") |
||||
List<Order> selectDoneOrder(int start, int size); |
||||
} |
@ -1,39 +0,0 @@
|
||||
package com.lan.textja.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.lan.textja.entity.Product; |
||||
import com.lan.textja.util.TreeResult; |
||||
import org.apache.ibatis.annotations.Select; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
public interface ProductMapper extends BaseMapper<Product> { |
||||
|
||||
@Select("select * from product limit #{start},#{size}") |
||||
List<Product> findProuductListByPage(Integer start, Integer size); |
||||
|
||||
List<Product> onSubmit(Product product); |
||||
|
||||
@Select("select distinct product_Brands from product") |
||||
List<Product> onbrandslist(Product product); |
||||
|
||||
// @Select("select distinct channel from prouduct")
|
||||
List<Product> onchannellist(Product product); |
||||
|
||||
List<Product> ontypelist(Product product); |
||||
|
||||
Product updateProuduct(Integer productNum); |
||||
|
||||
List<Product> selectTree(); |
||||
|
||||
List<Product> selectTreePtn(Integer productSupplierNo); |
||||
|
||||
List<Product> selectTreePn(Integer productTypeNo); |
||||
|
||||
|
||||
|
||||
|
||||
// @Update("pudate prouduct set name=#{name},type=#{type},state=#{state},size=#{size},alias=#{alias},brands=#{brands},num=#{num} where id=#{id}")
|
||||
// void addupdateProuduct(Prouduct prouduct);
|
||||
} |
@ -0,0 +1,13 @@
|
||||
package com.lan.textja.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.lan.textja.entity.ProuductBasics; |
||||
import org.apache.ibatis.annotations.Select; |
||||
|
||||
import java.util.List; |
||||
|
||||
public interface ProuductBasicsMapper extends BaseMapper<ProuductBasics> { |
||||
|
||||
@Select("select brands from prouductbasics") |
||||
List<ProuductBasics> selectbrandslist(Object o); |
||||
} |
@ -0,0 +1,27 @@
|
||||
package com.lan.textja.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.lan.textja.entity.Prouduct; |
||||
import org.apache.ibatis.annotations.Select; |
||||
|
||||
import java.util.List; |
||||
|
||||
public interface ProuductMapper extends BaseMapper<Prouduct> { |
||||
|
||||
@Select("select * from prouduct limit #{start},#{size}") |
||||
List<Prouduct> findProuductListByPage(Integer start, Integer size); |
||||
|
||||
List<Prouduct> onSubmit(Prouduct prouduct); |
||||
|
||||
@Select("select distinct brands from prouduct") |
||||
List<Prouduct> onbrandslist(Prouduct prouduct); |
||||
|
||||
// @Select("select distinct channel from prouduct")
|
||||
List<Prouduct> onchannellist(Prouduct prouduct); |
||||
|
||||
List<Prouduct> ontypelist(Prouduct prouduct); |
||||
|
||||
|
||||
// @Update("pudate prouduct set name=#{name},type=#{type},state=#{state},size=#{size},alias=#{alias},brands=#{brands},num=#{num} where id=#{id}")
|
||||
// void addupdateProuduct(Prouduct prouduct);
|
||||
} |
@ -1,18 +0,0 @@
|
||||
package com.lan.textja.service.Order; |
||||
|
||||
import com.lan.textja.entity.Order; |
||||
import com.lan.textja.util.PageResult; |
||||
|
||||
import java.util.List; |
||||
|
||||
public interface DeliveryService { |
||||
PageResult selectUnfinsherdOrder(PageResult pageResult); |
||||
|
||||
List<Order> orderDetail(Order order); |
||||
|
||||
List<Order> onorder(Order order); |
||||
|
||||
void Signorder(Order order); |
||||
|
||||
PageResult selectDoneOrder(PageResult pageResult); |
||||
} |
@ -1,78 +0,0 @@
|
||||
package com.lan.textja.service.Order; |
||||
|
||||
import com.lan.textja.entity.Dealer; |
||||
import com.lan.textja.entity.Order; |
||||
import com.lan.textja.mapper.DeliveryMapper; |
||||
import com.lan.textja.mapper.InventoryMapper; |
||||
import com.lan.textja.util.PageResult; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Service |
||||
public class DeliveryServiceImp implements DeliveryService{ |
||||
@Autowired |
||||
private DeliveryMapper deliveryMapper; |
||||
|
||||
@Autowired |
||||
private InventoryMapper inventoryMapper; |
||||
|
||||
@Override |
||||
public PageResult selectUnfinsherdOrder(PageResult pageResult) { |
||||
//起始位置
|
||||
int start = (pageResult.getPageNum()-1) * pageResult.getPageSize(); |
||||
//每页条数
|
||||
int size = pageResult.getPageSize(); |
||||
//分页结果
|
||||
List<Order> DeliveryList = deliveryMapper.findDeliveryListByPage(start,size); |
||||
//是user表的总数信息 暂时不需要where条件.
|
||||
long total = deliveryMapper.selectCount(null); |
||||
//封装数据实现返回
|
||||
pageResult.setTotal(total).setRows(DeliveryList); |
||||
return pageResult; |
||||
} |
||||
|
||||
@Override |
||||
public List<Order> orderDetail(Order order) { |
||||
List<Order>orderDetailList= deliveryMapper.orderDetail(order); |
||||
return orderDetailList; |
||||
} |
||||
|
||||
@Override |
||||
public List<Order> onorder(Order order) { |
||||
List<Order>onorder= deliveryMapper.onorder(order); |
||||
return onorder; |
||||
} |
||||
|
||||
@Override |
||||
public void Signorder(Order order) { |
||||
|
||||
//state 1订单进行中 0订单完成
|
||||
order.setOrderState(false); |
||||
|
||||
//产品库存增加(入库增加)
|
||||
Integer Qty=order.getOrderQty(); |
||||
Integer productNum=order.getOrderGoodsNo(); |
||||
Integer remainingQty1=inventoryMapper.selectRemainingQty(productNum); |
||||
Integer remainingQty= remainingQty1+Qty; |
||||
inventoryMapper.addQty(remainingQty,productNum); |
||||
|
||||
deliveryMapper.Signorder(order); |
||||
} |
||||
|
||||
@Override |
||||
public PageResult selectDoneOrder(PageResult pageResult) { |
||||
//起始位置
|
||||
int start = (pageResult.getPageNum()-1) * pageResult.getPageSize(); |
||||
//每页条数
|
||||
int size = pageResult.getPageSize(); |
||||
//分页结果
|
||||
List<Order> DeliveryList = deliveryMapper.selectDoneOrder(start,size); |
||||
//是user表的总数信息 暂时不需要where条件.
|
||||
long total = deliveryMapper.selectCount(null); |
||||
//封装数据实现返回
|
||||
pageResult.setTotal(total).setRows(DeliveryList); |
||||
return pageResult; |
||||
} |
||||
} |
@ -1,27 +0,0 @@
|
||||
package com.lan.textja.service.dealer; |
||||
|
||||
import com.lan.textja.entity.Dealer; |
||||
import com.lan.textja.util.PageResult; |
||||
import com.lan.textja.util.TreeResult; |
||||
|
||||
import java.util.List; |
||||
|
||||
public interface DealerService{ |
||||
List<Dealer> dealerNames(); |
||||
|
||||
PageResult selectDealerList(PageResult pageResult); |
||||
|
||||
List<Dealer> dealerSelect(Dealer dealer); |
||||
|
||||
List<Dealer> updateDealer(Dealer dealer); |
||||
|
||||
void addupdateDealer(Dealer dealer); |
||||
|
||||
void deleteDealer(Dealer dealer); |
||||
|
||||
Integer dealerNum(); |
||||
|
||||
void onAddDealer(Dealer dealer); |
||||
|
||||
List<TreeResult> treeResult(); |
||||
} |
@ -1,94 +0,0 @@
|
||||
package com.lan.textja.service.dealer; |
||||
|
||||
import com.lan.textja.entity.Dealer; |
||||
import com.lan.textja.entity.Product; |
||||
import com.lan.textja.mapper.DealerMapper; |
||||
import com.lan.textja.mapper.ProductMapper; |
||||
import com.lan.textja.util.PageResult; |
||||
import com.lan.textja.util.TreeResult; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Collections; |
||||
import java.util.List; |
||||
|
||||
@Service |
||||
public class DealerServiceImp implements DealerService{ |
||||
|
||||
@Autowired |
||||
private DealerMapper dealerMapper; |
||||
|
||||
@Autowired |
||||
private ProductMapper productMapper; |
||||
|
||||
@Override |
||||
public List<Dealer> dealerNames() { |
||||
List<Dealer> dealerNames =dealerMapper.dealerNames(); |
||||
return dealerNames; |
||||
} |
||||
|
||||
@Override |
||||
public PageResult selectDealerList(PageResult pageResult) { |
||||
//起始位置
|
||||
int start = (pageResult.getPageNum()-1) * pageResult.getPageSize(); |
||||
//每页条数
|
||||
int size = pageResult.getPageSize(); |
||||
//分页结果
|
||||
List<Dealer> DealerList = dealerMapper.findDealerListByPage(start,size); |
||||
//是user表的总数信息 暂时不需要where条件.
|
||||
long total = dealerMapper.selectCount(null); |
||||
//封装数据实现返回
|
||||
pageResult.setTotal(total).setRows(DealerList); |
||||
return pageResult; |
||||
|
||||
|
||||
} |
||||
|
||||
@Override |
||||
public List<Dealer> dealerSelect(Dealer dealer) { |
||||
List<Dealer> dealerSelect= dealerMapper.dealerSelect(dealer); |
||||
return dealerSelect; |
||||
} |
||||
|
||||
@Override |
||||
public List<Dealer> updateDealer(Dealer dealer) { |
||||
List<Dealer> updateDealer= dealerMapper.updateDealer(dealer); |
||||
return updateDealer; |
||||
} |
||||
|
||||
@Override |
||||
public void addupdateDealer(Dealer dealer) { |
||||
dealerMapper.addupdateDealer(dealer); |
||||
} |
||||
|
||||
@Override |
||||
public void deleteDealer(Dealer dealer) { |
||||
dealer.setDealerState(false); |
||||
dealerMapper.deleteDealer(dealer); |
||||
} |
||||
|
||||
@Override |
||||
public Integer dealerNum() { |
||||
List<Integer> Nums=dealerMapper.dealerNum(); |
||||
System.out.println(Nums); |
||||
Integer maxValue = Collections.max(Nums); |
||||
System.out.println(maxValue); |
||||
maxValue++; |
||||
return maxValue; |
||||
} |
||||
|
||||
@Override |
||||
public void onAddDealer(Dealer dealer) { |
||||
dealer.setDealerState(true); |
||||
dealerMapper.onAddDealer(dealer); |
||||
} |
||||
|
||||
@Override |
||||
public List<TreeResult> treeResult() { |
||||
List<TreeResult> OneTree=new ArrayList<>(); |
||||
List<Integer> SupplierNo=productMapper.selectSupplierNo(); |
||||
System.out.println(OneTree); |
||||
return null; |
||||
} |
||||
} |
@ -1,34 +0,0 @@
|
||||
package com.lan.textja.service.product; |
||||
|
||||
import com.lan.textja.entity.Product; |
||||
import com.lan.textja.util.PageResult; |
||||
|
||||
import javax.servlet.http.HttpServletResponse; |
||||
import java.io.IOException; |
||||
import java.util.List; |
||||
|
||||
public interface ProductService { |
||||
//全查询
|
||||
// List<Prouduct> selectProuductList();
|
||||
|
||||
PageResult selectProuductList(PageResult pageResult); |
||||
|
||||
void deleteProuduct(Integer productNum); |
||||
|
||||
void addProuduct(Product product); |
||||
|
||||
Product updateProuduct(Integer productNum); |
||||
|
||||
void addupdateProuduct(Product product); |
||||
|
||||
void exportDataToEx(HttpServletResponse response) throws IOException; |
||||
|
||||
|
||||
List<Product> onSubmit(Product product); |
||||
|
||||
List<Product> onbrandslist(Product product); |
||||
|
||||
List<Product> onchannellist(Product product); |
||||
|
||||
List<Product> ontypelist(Product product); |
||||
} |
@ -0,0 +1,9 @@
|
||||
package com.lan.textja.service.product; |
||||
|
||||
import com.lan.textja.entity.ProuductBasics; |
||||
|
||||
import java.util.List; |
||||
|
||||
public interface ProuductBasicsService { |
||||
List<ProuductBasics> selectbrandslist(); |
||||
} |
@ -0,0 +1,23 @@
|
||||
package com.lan.textja.service.product; |
||||
|
||||
|
||||
import com.lan.textja.entity.ProuductBasics; |
||||
import com.lan.textja.mapper.ProuductBasicsMapper; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Service |
||||
public class ProuductBasicsServiceImp implements ProuductBasicsService { |
||||
@Autowired |
||||
private ProuductBasicsMapper prouductBasicsMapper; |
||||
|
||||
|
||||
@Override |
||||
public List<ProuductBasics> selectbrandslist() { |
||||
List<ProuductBasics> brandslist= |
||||
prouductBasicsMapper.selectbrandslist(null); |
||||
return brandslist; |
||||
} |
||||
} |
@ -0,0 +1,34 @@
|
||||
package com.lan.textja.service.product; |
||||
|
||||
import com.lan.textja.entity.Prouduct; |
||||
import com.lan.textja.util.PageResult; |
||||
|
||||
import javax.servlet.http.HttpServletResponse; |
||||
import java.io.IOException; |
||||
import java.util.List; |
||||
|
||||
public interface ProuductService { |
||||
//全查询
|
||||
// List<Prouduct> selectProuductList();
|
||||
|
||||
PageResult selectProuductList(PageResult pageResult); |
||||
|
||||
void deleteProuduct(Integer id); |
||||
|
||||
void addProuduct(Prouduct prouduct); |
||||
|
||||
Prouduct updateProuduct(Integer id); |
||||
|
||||
void addupdateProuduct(Prouduct prouduct); |
||||
|
||||
void exportDataToEx(HttpServletResponse response) throws IOException; |
||||
|
||||
|
||||
List<Prouduct> onSubmit(Prouduct prouduct); |
||||
|
||||
List<Prouduct> onbrandslist(Prouduct prouduct); |
||||
|
||||
List<Prouduct> onchannellist(Prouduct prouduct); |
||||
|
||||
List<Prouduct> ontypelist(Prouduct prouduct); |
||||
} |
@ -1,19 +0,0 @@
|
||||
package com.lan.textja.util; |
||||
|
||||
import lombok.Data; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.List; |
||||
|
||||
@Data |
||||
@Accessors(chain = true) |
||||
public class TreeResult implements Serializable { |
||||
private Integer productSupplierNo;//父id
|
||||
private Integer productTypeNo;//一级子id
|
||||
private String productType;//父名称
|
||||
private String productBrands;//一子名称
|
||||
private String productName;//二级子名称
|
||||
private List<TreeResult> children; //一级子菜单列表
|
||||
private List<TreeResult> children2;//二级子菜单列表
|
||||
} |
@ -1,92 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
<!DOCTYPE mapper |
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.lan.textja.mapper.DealerMapper"> |
||||
<sql id="dealerColumns"> |
||||
dealer_Num AS "dealerNum", |
||||
dealer_Name AS "dealerName", |
||||
dealer_Contact AS "dealerContact", |
||||
dealer_Address AS "dealerAddress", |
||||
dealer_Number AS "dealerNumber", |
||||
dealer_Receiver AS "dealerReceiver", |
||||
dealer_Email AS "dealerEmail", |
||||
dealer_Start_Date AS "dealerStartDate", |
||||
dealer_Termination_Date AS "dealerTerminationDate", |
||||
dealer_State AS "dealerState" |
||||
</sql> |
||||
|
||||
<select id="dealerNames" resultType="com.lan.textja.entity.Dealer"> |
||||
select distinct dealer_Name,dealer_Num from dealer |
||||
</select> |
||||
|
||||
<select id="select" resultType="com.lan.textja.entity.Dealer"> |
||||
select dealer_Contact,dealer_Address,dealer_Number,dealer_Num from dealer |
||||
where dealer_Name=#{dealerName} |
||||
</select> |
||||
|
||||
<select id="dealerSelect" resultType="com.lan.textja.entity.Dealer"> |
||||
select <include refid="dealerColumns"></include> |
||||
from dealer |
||||
where |
||||
<if test="dealerName !=null and dealerName !=''"> |
||||
dealer_Name=#{dealerName} |
||||
</if> |
||||
</select> |
||||
|
||||
<select id="updateDealer" resultType="com.lan.textja.entity.Dealer"> |
||||
select <include refid="dealerColumns"></include> |
||||
from dealer |
||||
where dealer_Num=#{dealerNum} |
||||
</select> |
||||
|
||||
<update id="addupdateDealer" parameterType="com.lan.textja.entity.Dealer"> |
||||
update dealer set |
||||
dealer_Name =#{dealerName}, |
||||
dealer_Contact=#{dealerContact} , |
||||
dealer_Address=#{dealerAddress} , |
||||
dealer_Number=#{dealerNumber}, |
||||
dealer_Receiver=#{dealerReceiver} , |
||||
dealer_Email=#{dealerEmail}, |
||||
dealer_Start_Date=#{dealerStartDate}, |
||||
dealer_Termination_Date=#{dealerTerminationDate} |
||||
where dealer_Num =#{dealerNum} |
||||
</update> |
||||
|
||||
<update id="deleteDealer" parameterType="com.lan.textja.entity.Dealer"> |
||||
update dealer set dealer_State=#{dealerState} |
||||
where dealer_Num=#{dealerNum} |
||||
</update> |
||||
|
||||
<select id="dealerNum" resultType="Integer"> |
||||
select distinct dealer_Num from dealer |
||||
</select> |
||||
|
||||
<insert id="onAddDealer" parameterType="com.lan.textja.entity.Dealer"> |
||||
insert into |
||||
Dealer ( |
||||
dealer_Num , |
||||
dealer_Name, |
||||
dealer_Contact, |
||||
dealer_Address, |
||||
dealer_Number, |
||||
dealer_Receiver, |
||||
dealer_Email, |
||||
dealer_Start_Date, |
||||
dealer_Termination_Date, |
||||
dealer_State |
||||
) |
||||
values ( |
||||
#{dealerNum}, |
||||
#{dealerName}, |
||||
#{dealerContact}, |
||||
#{dealerAddress}, |
||||
#{dealerNumber}, |
||||
#{dealerReceiver}, |
||||
#{dealerEmail}, |
||||
#{dealerStartDate}, |
||||
#{dealerTerminationDate}, |
||||
#{dealerState} |
||||
) |
||||
</insert> |
||||
</mapper> |
@ -1,76 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
<!DOCTYPE mapper |
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.lan.textja.mapper.DeliveryMapper"> |
||||
<sql id="OrderColumns"> |
||||
order_No AS "orderNo", |
||||
order_Name AS "orderName", |
||||
order_Price AS "orderPrice", |
||||
order_Qty AS "orderQty", |
||||
order_Total_Price AS "orderTotalPrice", |
||||
order_Type AS "orderType", |
||||
order_Supplier_Contact AS "orderSupplierContact", |
||||
order_Supplier_Address AS "orderSupplierAddress", |
||||
order_Supplier_Number AS "orderSupplierNumber", |
||||
order_Dealer_Contact AS "orderDealerContact", |
||||
order_Dealer_Address AS "orderDealerAddress", |
||||
order_Dealer_Number AS "orderDealerNumber", |
||||
order_Goods_No AS "orderGoodsNo", |
||||
order_Supplier_No AS "orderSupplierNo", |
||||
order_Dealer_No AS "orderDealerNo", |
||||
order_State AS "orderState" |
||||
</sql> |
||||
|
||||
<insert id="SureOrder" parameterType="com.lan.textja.entity.Order"> |
||||
insert into |
||||
orders ( |
||||
order_No, |
||||
order_Name, |
||||
order_Price, |
||||
order_Qty, |
||||
order_Total_Price, |
||||
order_Type, |
||||
order_Supplier_Contact, |
||||
order_Supplier_Address, |
||||
order_Supplier_Number, |
||||
order_Dealer_Contact, |
||||
order_Dealer_Address, |
||||
order_Dealer_Number, |
||||
order_Goods_No, |
||||
order_Supplier_No, |
||||
order_Dealer_No, |
||||
order_State |
||||
) |
||||
values ( |
||||
#{orderNo}, |
||||
#{orderName}, |
||||
#{orderPrice}, |
||||
#{orderQty}, |
||||
#{orderTotalPrice}, |
||||
#{orderType}, |
||||
#{orderSupplierContact}, |
||||
#{orderSupplierAddress}, |
||||
#{orderSupplierNumber}, |
||||
#{orderDealerContact}, |
||||
#{orderDealerAddress}, |
||||
#{orderDealerNumber}, |
||||
#{orderGoodsNo}, |
||||
#{orderSupplierNo}, |
||||
#{orderDealerNo}, |
||||
#{orderState} |
||||
) |
||||
</insert> |
||||
|
||||
<select id="orderDetail" resultType="com.lan.textja.entity.Order"> |
||||
select <include refid="OrderColumns"></include> from orders where order_No=#{orderNo} |
||||
</select> |
||||
|
||||
<select id="onorder" resultType="com.lan.textja.entity.Order"> |
||||
select <include refid="OrderColumns"></include> from orders where order_No=#{orderNo} |
||||
</select> |
||||
|
||||
<update id="Signorder" parameterType="com.lan.textja.entity.Order"> |
||||
update orders set order_State=#{orderState} where order_No=#{orderNo} |
||||
</update> |
||||
</mapper> |
@ -1,71 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
<!DOCTYPE mapper |
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.lan.textja.mapper.ProductMapper"> |
||||
<sql id="productColumns"> |
||||
product_Name AS "productName", |
||||
product_Type AS "productType", |
||||
product_State AS "productState", |
||||
product_Size AS "productSize", |
||||
product_Benefits AS "productBenefits", |
||||
product_Brands AS "productBrands", |
||||
product_Num AS "productNum", |
||||
product_Channel AS "productChannel", |
||||
product_Selling_Price AS "productSellingPrice", |
||||
product_Type_No AS "productTypeNo", |
||||
product_Supplier_No AS "productSupplierNo" |
||||
</sql> |
||||
|
||||
<select id="onSubmit" resultType="com.lan.textja.entity.Product"> |
||||
select |
||||
<include refid="productColumns"></include> |
||||
from product |
||||
where 1=1 |
||||
<if test="productNum !=null and productNum !=''"> |
||||
and product_Num=#{productNum} |
||||
</if> |
||||
<if test="productName !=null and productName !=''"> |
||||
and product_Name=#{productName} |
||||
</if> |
||||
<if test="productType !=null and productType !=''"> |
||||
and prouduct_Type=#{productType} |
||||
</if> |
||||
<if test="productState !=null and productState !=''"> |
||||
and product_State=#{productState} |
||||
</if> |
||||
<if test="productBenefits !=null and productBenefits !=''"> |
||||
and product_Benefits=#{productBenefits} |
||||
</if> |
||||
<if test="productBrands !=null and productBrands !=''"> |
||||
and product_Brands=#{productBrands} |
||||
</if> |
||||
<if test="productChannel !=null and productChannel !=''"> |
||||
and product_Channel=#{productChannel} |
||||
</if> |
||||
</select> |
||||
|
||||
<select id="onchannellist" resultType="com.lan.textja.entity.Product"> |
||||
select distinct product_Channel from product |
||||
</select> |
||||
|
||||
<select id="ontypelist" resultType="com.lan.textja.entity.Product"> |
||||
select distinct product_Type from product |
||||
</select> |
||||
|
||||
<select id="updateProuduct" resultType="com.lan.textja.entity.Product"> |
||||
select <include refid="productColumns"></include> from product where product_Num=#{productNum} |
||||
</select> |
||||
|
||||
<select id="selectTree" resultType="com.lan.textja.entity.Product"> |
||||
select product_Name, product_Type, product_Type_No, product_Num, product_Supplier_No, product_Brands FROM product |
||||
</select> |
||||
|
||||
<select id="selectTreePtn" resultType="com.lan.textja.entity.Product"> |
||||
select product_Type, product_Type_No FROM product where product_Supplier_No =#{productSupplierNo} |
||||
</select> |
||||
|
||||
<select id="selectTreePn" resultType="com.lan.textja.entity.Product"> |
||||
select product_Name, product_Num FROM product where product_Type_No =#{productTypeNo} |
||||
</select> |
||||
</mapper> |
@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
<!DOCTYPE mapper |
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.lan.textja.mapper.ProuductMapper"> |
||||
<sql id="prouductColumns"> |
||||
id AS "id", |
||||
name AS "name", |
||||
type AS "type", |
||||
state AS "state", |
||||
size AS "size", |
||||
benefits AS "benefits", |
||||
brands AS "brands", |
||||
num AS "num", |
||||
channel AS "channel" |
||||
</sql> |
||||
|
||||
<select id="onSubmit" resultType="com.lan.textja.entity.Prouduct"> |
||||
select |
||||
<include refid="prouductColumns"></include> |
||||
from prouduct |
||||
where 1=1 |
||||
<if test="num !=null and num !=''"> |
||||
and num=#{num} |
||||
</if> |
||||
<if test="name !=null and name !=''"> |
||||
and name=#{name} |
||||
</if> |
||||
<if test="type !=null and type !=''"> |
||||
and type=#{type} |
||||
</if> |
||||
<if test="state !=null and state !=''"> |
||||
and state=#{state} |
||||
</if> |
||||
<if test="size !=null and size !=''"> |
||||
and benefits=#{benefits} |
||||
</if> |
||||
<if test="brands !=null and brands !=''"> |
||||
and brands=#{brands} |
||||
</if> |
||||
<if test="channel !=null and channel !=''"> |
||||
and channel=#{channel} |
||||
</if> |
||||
</select> |
||||
|
||||
<select id="onchannellist" resultType="com.lan.textja.entity.Prouduct"> |
||||
select distinct channel from prouduct |
||||
</select> |
||||
|
||||
<select id="ontypelist" resultType="com.lan.textja.entity.Prouduct"> |
||||
select distinct type from prouduct |
||||
</select> |
||||
</mapper> |
Loading…
Reference in new issue