Compare commits

..

4 Commits
master ... dev

  1. 2
      textja/src/main/java/com/lan/textja/TextjaApplication.java
  2. 82
      textja/src/main/java/com/lan/textja/controller/dealer/DealerController.java
  3. 56
      textja/src/main/java/com/lan/textja/controller/order/DeliveryController.java
  4. 46
      textja/src/main/java/com/lan/textja/controller/product/ProductController.java
  5. 30
      textja/src/main/java/com/lan/textja/controller/product/ProuductBasicsController.java
  6. 4
      textja/src/main/java/com/lan/textja/controller/supplier/SupplierController.java
  7. 38
      textja/src/main/java/com/lan/textja/controller/supplier/SupplyController.java
  8. 32
      textja/src/main/java/com/lan/textja/entity/Dealer.java
  9. 12
      textja/src/main/java/com/lan/textja/entity/Inventory.java
  10. 30
      textja/src/main/java/com/lan/textja/entity/Order.java
  11. 26
      textja/src/main/java/com/lan/textja/entity/Product.java
  12. 25
      textja/src/main/java/com/lan/textja/entity/Prouduct.java
  13. 25
      textja/src/main/java/com/lan/textja/entity/ProuductBasics.java
  14. 3
      textja/src/main/java/com/lan/textja/entity/Supply.java
  15. 29
      textja/src/main/java/com/lan/textja/mapper/DealerMapper.java
  16. 24
      textja/src/main/java/com/lan/textja/mapper/DeliveryMapper.java
  17. 5
      textja/src/main/java/com/lan/textja/mapper/InventoryMapper.java
  18. 39
      textja/src/main/java/com/lan/textja/mapper/ProductMapper.java
  19. 13
      textja/src/main/java/com/lan/textja/mapper/ProuductBasicsMapper.java
  20. 27
      textja/src/main/java/com/lan/textja/mapper/ProuductMapper.java
  21. 7
      textja/src/main/java/com/lan/textja/mapper/SupplierMapper.java
  22. 6
      textja/src/main/java/com/lan/textja/mapper/SupplyMapper.java
  23. 1
      textja/src/main/java/com/lan/textja/service/HomeServiceImp.java
  24. 18
      textja/src/main/java/com/lan/textja/service/Order/DeliveryService.java
  25. 78
      textja/src/main/java/com/lan/textja/service/Order/DeliveryServiceImp.java
  26. 27
      textja/src/main/java/com/lan/textja/service/dealer/DealerService.java
  27. 94
      textja/src/main/java/com/lan/textja/service/dealer/DealerServiceImp.java
  28. 12
      textja/src/main/java/com/lan/textja/service/product/InventoryServiceImp.java
  29. 34
      textja/src/main/java/com/lan/textja/service/product/ProductService.java
  30. 75
      textja/src/main/java/com/lan/textja/service/product/ProductServiceImp.java
  31. 9
      textja/src/main/java/com/lan/textja/service/product/ProuductBasicsService.java
  32. 23
      textja/src/main/java/com/lan/textja/service/product/ProuductBasicsServiceImp.java
  33. 34
      textja/src/main/java/com/lan/textja/service/product/ProuductService.java
  34. 2
      textja/src/main/java/com/lan/textja/service/supplier/SupplierService.java
  35. 2
      textja/src/main/java/com/lan/textja/service/supplier/SupplierServiceImp.java
  36. 11
      textja/src/main/java/com/lan/textja/service/supplier/SupplyService.java
  37. 132
      textja/src/main/java/com/lan/textja/service/supplier/SupplyServiceImp.java
  38. 1
      textja/src/main/java/com/lan/textja/util/MenuResult.java
  39. 19
      textja/src/main/java/com/lan/textja/util/TreeResult.java
  40. 92
      textja/src/main/resources/com/lan/textja/mapper/DealerMapper.xml
  41. 76
      textja/src/main/resources/com/lan/textja/mapper/DeliveryMapper.xml
  42. 65
      textja/src/main/resources/com/lan/textja/mapper/InventoryMapper.xml
  43. 71
      textja/src/main/resources/com/lan/textja/mapper/ProductMapper.xml
  44. 53
      textja/src/main/resources/com/lan/textja/mapper/ProuductMapper.xml
  45. 14
      textja/src/main/resources/com/lan/textja/mapper/SupplierMapper.xml
  46. 33
      textja/src/main/resources/com/lan/textja/mapper/SupplyMapper.xml

2
textja/src/main/java/com/lan/textja/TextjaApplication.java

@ -8,7 +8,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@SpringBootApplication
@MapperScan("com.lan.textja.mapper")
public class TextjaApplication {
//这是dev分支
public static void main(String[] args) {
SpringApplication.run(TextjaApplication.class, args);
}

82
textja/src/main/java/com/lan/textja/controller/dealer/DealerController.java

@ -0,0 +1,82 @@
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);
}
}

56
textja/src/main/java/com/lan/textja/controller/order/DeliveryController.java

@ -0,0 +1,56 @@
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);
}
}

46
textja/src/main/java/com/lan/textja/controller/product/ProuductController.java → textja/src/main/java/com/lan/textja/controller/product/ProductController.java

@ -1,7 +1,7 @@
package com.lan.textja.controller.product;
import com.lan.textja.entity.Prouduct;
import com.lan.textja.service.product.ProuductService;
import com.lan.textja.entity.Product;
import com.lan.textja.service.product.ProductService;
import com.lan.textja.util.JsonResult;
import com.lan.textja.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
@ -13,10 +13,10 @@ import java.util.List;
@RestController
@RequestMapping("/prouduct")
@CrossOrigin
public class ProuductController {
public class ProductController {
@Autowired
private ProuductService prouductService;
private ProductService productService;
//全查询
// @GetMapping("/selectList")
@ -29,34 +29,34 @@ public class ProuductController {
@GetMapping("/selectList")
public JsonResult selectProuductList(PageResult pageResult){
pageResult = prouductService.selectProuductList(pageResult);
pageResult = productService.selectProuductList(pageResult);
return JsonResult.ok(pageResult);
}
//删除prouduct
@PostMapping("/deleteProuduct")
public JsonResult deleteProuduct(Integer id){
prouductService.deleteProuduct(id);
public JsonResult deleteProuduct(Integer productNum){
productService.deleteProuduct(productNum);
return JsonResult.ok();
}
//添加产品
@PostMapping("/onAddProuduct")
public JsonResult addProuduct(Prouduct prouduct){
prouductService.addProuduct(prouduct);
public JsonResult addProuduct(Product product){
productService.addProuduct(product);
return JsonResult.build(JsonResult.SUCCESS);
}
//修改产品信息
@GetMapping("/updateProuduct")
public JsonResult updateProuduct(Integer id){
Prouduct prouduct= prouductService.updateProuduct(id);
return JsonResult.ok(prouduct);
public JsonResult updateProuduct(Integer productNum){
Product product= productService.updateProuduct(productNum);
return JsonResult.ok(product);
}
@PostMapping("/addupdateProuduct")
public JsonResult addupdateProuduct(Prouduct prouduct){
prouductService.addupdateProuduct(prouduct);
public JsonResult addupdateProuduct(Product product){
productService.addupdateProuduct(product);
return JsonResult.ok();
}
@ -64,34 +64,34 @@ public class ProuductController {
@ResponseBody
public void downloadExcel(HttpServletResponse response){
try {
prouductService.exportDataToEx(response);
productService.exportDataToEx(response);
} catch (Exception e) {
e.printStackTrace();
}
}
@GetMapping("/onSubmit")
public JsonResult onSubmit(Prouduct prouduct){
List<Prouduct> prouductList= prouductService.onSubmit(prouduct);
public JsonResult onSubmit(Product product){
List<Product> prouductList= productService.onSubmit(product);
return JsonResult.ok(prouductList);
}
@GetMapping("/onbrandslist")
public JsonResult onbrandslist(Prouduct prouduct){
List<Prouduct> brandslist= prouductService.onbrandslist(prouduct);
public JsonResult onbrandslist(Product product){
List<Product> brandslist= productService.onbrandslist(product);
//System.out.println(brandslist);
return JsonResult.ok(brandslist);
}
@GetMapping("/onchannellist")
public JsonResult channellist(Prouduct prouduct){
List<Prouduct> channellist= prouductService.onchannellist(prouduct);
public JsonResult channellist(Product product){
List<Product> channellist= productService.onchannellist(product);
return JsonResult.ok(channellist);
}
@GetMapping("/ontypelist")
public JsonResult typelist(Prouduct prouduct){
List<Prouduct> typelist= prouductService.ontypelist(prouduct);
public JsonResult typelist(Product product){
List<Product> typelist= productService.ontypelist(product);
return JsonResult.ok(typelist);
}

30
textja/src/main/java/com/lan/textja/controller/product/ProuductBasicsController.java

@ -1,30 +0,0 @@
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);
}
}

4
textja/src/main/java/com/lan/textja/controller/supplier/SupplierController.java

@ -70,8 +70,8 @@ public class SupplierController {
@RequestMapping(value = "/SupplierNum",method = RequestMethod.GET)
public JsonResult SupplierNum(Supplier supplier){
Integer maxValue=supplierService.SupplierNum(supplier);
public JsonResult SupplierNum(){
Integer maxValue=supplierService.SupplierNum();
return JsonResult.ok(maxValue);
}

38
textja/src/main/java/com/lan/textja/controller/supplier/SupplyController.java

@ -1,5 +1,6 @@
package com.lan.textja.controller.supplier;
import com.lan.textja.entity.Order;
import com.lan.textja.entity.Supplier;
import com.lan.textja.entity.Supply;
import com.lan.textja.service.supplier.SupplierService;
@ -7,10 +8,7 @@ import com.lan.textja.service.supplier.SupplyService;
import com.lan.textja.util.JsonResult;
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 org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@ -53,4 +51,36 @@ public class SupplyController {
List<Supply> Onorder=supplyService.Onorder(supply);
return JsonResult.ok(Onorder);
}
@RequestMapping(value = "/SureOrder",method = RequestMethod.POST,produces = "application/json;charset=UTF-8")
public JsonResult SureOrder(@RequestParam(required = false) Map<String,Object> params){
System.out.println(params);
Integer SUCCESS=supplyService.SureOrder(params);
if(SUCCESS==200){
return JsonResult.ok().code(200);
}
return JsonResult.err().code(201);
}
@RequestMapping(value = "/goodsNum",method = RequestMethod.GET)
public JsonResult goodsNum(){
Integer goodsNum=supplyService.goodsNum();
return JsonResult.ok(goodsNum);
}
@RequestMapping(value = "/supplierNames",method = RequestMethod.GET)
public JsonResult supplierNames(){
List<Supplier> supplierNames=supplyService.supplierName();
return JsonResult.ok(supplierNames);
}
@RequestMapping(value = "/onAddSupply",method = RequestMethod.POST)
public JsonResult onAddSupply(@RequestParam(required = false) Map<String,Object> params){
supplyService.onAddSupply(params);
return JsonResult.ok(JsonResult.SUCCESS);
}
}

32
textja/src/main/java/com/lan/textja/entity/Dealer.java

@ -0,0 +1,32 @@
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;
}

12
textja/src/main/java/com/lan/textja/entity/Inventory.java

@ -12,12 +12,12 @@ import java.io.Serializable;
public class Inventory implements Serializable {
//@TableField("name")
//如果属性与字段同名(包括驼峰规则)注解可以省略
private Integer productNum;
private String productName;
private String productType;
private String productBrands;
private Integer allStock;
private Integer remainingQty;
private Integer inventoryProductNum;
private String inventoryProductName;
private String inventoryProductType;
private String inventoryProductBrands;
private Integer inventoryAllStock;
private Integer inventoryRemainingQty;
}

30
textja/src/main/java/com/lan/textja/entity/Order.java

@ -0,0 +1,30 @@
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;
}

26
textja/src/main/java/com/lan/textja/entity/Product.java

@ -0,0 +1,26 @@
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;
}

25
textja/src/main/java/com/lan/textja/entity/Prouduct.java

@ -1,25 +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("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;
}

25
textja/src/main/java/com/lan/textja/entity/ProuductBasics.java

@ -1,25 +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.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;
}

3
textja/src/main/java/com/lan/textja/entity/Supply.java

@ -20,5 +20,6 @@ public class Supply {
private String goodsSize;
private String goodsEffect;
private Boolean goodsState;
private List<Supplier> supplierList;
private Supplier supplierList;
// private List<Dealer> dealerList;
}

29
textja/src/main/java/com/lan/textja/mapper/DealerMapper.java

@ -0,0 +1,29 @@
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);
}

24
textja/src/main/java/com/lan/textja/mapper/DeliveryMapper.java

@ -0,0 +1,24 @@
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);
}

5
textja/src/main/java/com/lan/textja/mapper/InventoryMapper.java

@ -23,4 +23,9 @@ public interface InventoryMapper extends BaseMapper<Inventory> {
List<Inventory> handleDetail(Inventory inventory);
void UpdateInventory(Inventory inventory);
Integer selectRemainingQty(Integer productNum);
void addQty(Integer remainingQty, Integer productNum);
}

39
textja/src/main/java/com/lan/textja/mapper/ProductMapper.java

@ -0,0 +1,39 @@
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);
}

13
textja/src/main/java/com/lan/textja/mapper/ProuductBasicsMapper.java

@ -1,13 +0,0 @@
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);
}

27
textja/src/main/java/com/lan/textja/mapper/ProuductMapper.java

@ -1,27 +0,0 @@
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);
}

7
textja/src/main/java/com/lan/textja/mapper/SupplierMapper.java

@ -23,4 +23,11 @@ public interface SupplierMapper extends BaseMapper<Supplier> {
List<Supplier> onSubmit(Supplier supplier);
List<Integer> SupplierNum();
Supplier select(Integer goodsSupplierFirm);
List<Supplier> supplierName();
Supplier goodsSupplierFirm(String supplierName);
}

6
textja/src/main/java/com/lan/textja/mapper/SupplyMapper.java

@ -1,6 +1,7 @@
package com.lan.textja.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lan.textja.entity.Order;
import com.lan.textja.entity.Supplier;
import com.lan.textja.entity.Supply;
import org.apache.ibatis.annotations.Select;
@ -20,4 +21,9 @@ public interface SupplyMapper extends BaseMapper<Supply> {
List<Supply> goodsTypes();
List<Supply> Onorder(Supply supply);
List<Integer> goodsNum();
void onAddSupply(Supply supply);
}

1
textja/src/main/java/com/lan/textja/service/HomeServiceImp.java

@ -24,6 +24,7 @@ public class HomeServiceImp implements HomeService {
List<MenuResult>List2= homeMapper.selectList2(oneRights.getId());
oneRights.setChildren(List2);
}
return oneList;
}

18
textja/src/main/java/com/lan/textja/service/Order/DeliveryService.java

@ -0,0 +1,18 @@
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);
}

78
textja/src/main/java/com/lan/textja/service/Order/DeliveryServiceImp.java

@ -0,0 +1,78 @@
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;
}
}

27
textja/src/main/java/com/lan/textja/service/dealer/DealerService.java

@ -0,0 +1,27 @@
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();
}

94
textja/src/main/java/com/lan/textja/service/dealer/DealerServiceImp.java

@ -0,0 +1,94 @@
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;
}
}

12
textja/src/main/java/com/lan/textja/service/product/InventoryServiceImp.java

@ -115,12 +115,12 @@ public class InventoryServiceImp implements InventoryService {
for (int i =0 ;i<list.size();i++){
row = sheet.createRow(i+2); //重新找到这一行数据的行数,也就是在前端的基础上再另起一行
Inventory inventory =list.get(i); //得到集合遍历的每一行数据
row.createCell(0).setCellValue(inventory.getProductNum()); //将值给到单元格
row.createCell(1).setCellValue(inventory.getProductName()); //user是一个实体类对象,获取get方法进行赋值
row.createCell(2).setCellValue(inventory.getProductType());
row.createCell(3).setCellValue(inventory.getProductBrands());
row.createCell(4).setCellValue(inventory.getAllStock());
row.createCell(5).setCellValue(inventory.getRemainingQty());
row.createCell(0).setCellValue(inventory.getInventoryProductNum()); //将值给到单元格
row.createCell(1).setCellValue(inventory.getInventoryProductName()); //user是一个实体类对象,获取get方法进行赋值
row.createCell(2).setCellValue(inventory.getInventoryProductType());
row.createCell(3).setCellValue(inventory.getInventoryProductBrands());
row.createCell(4).setCellValue(inventory.getInventoryAllStock());
row.createCell(5).setCellValue(inventory.getInventoryRemainingQty());
}
//设置自适应宽度

34
textja/src/main/java/com/lan/textja/service/product/ProductService.java

@ -0,0 +1,34 @@
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);
}

75
textja/src/main/java/com/lan/textja/service/product/ProuductServiceImp.java → textja/src/main/java/com/lan/textja/service/product/ProductServiceImp.java

@ -1,7 +1,8 @@
package com.lan.textja.service.product;
import com.lan.textja.entity.Prouduct;
import com.lan.textja.mapper.ProuductMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lan.textja.entity.Product;
import com.lan.textja.mapper.ProductMapper;
import com.lan.textja.util.PageResult;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.FillPatternType;
@ -18,9 +19,9 @@ import java.io.OutputStream;
import java.util.List;
@Service
public class ProuductServiceImp implements ProuductService {
public class ProductServiceImp implements ProductService {
@Autowired
private ProuductMapper prouductMapper;
private ProductMapper productMapper;
//全查询
// @Override
@ -82,40 +83,42 @@ public class ProuductServiceImp implements ProuductService {
//每页条数
int size = pageResult.getPageSize();
//分页结果
List<Prouduct> prouductList = prouductMapper.findProuductListByPage(start,size);
List<Product> productList = productMapper.findProuductListByPage(start,size);
//是user表的总数信息 暂时不需要where条件.
long total = prouductMapper.selectCount(null);
long total = productMapper.selectCount(null);
//封装数据实现返回
pageResult.setTotal(total).setRows(prouductList);
pageResult.setTotal(total).setRows(productList);
return pageResult;
}
@Override
public void deleteProuduct(Integer id) {
prouductMapper.deleteById(id);
public void deleteProuduct(Integer productNum) {
productMapper.deleteById(productNum);
}
@Override
public void addProuduct(Prouduct prouduct) {
prouductMapper.insert(prouduct);
public void addProuduct(Product product) {
productMapper.insert(product);
}
@Override
public Prouduct updateProuduct(Integer id) {
Prouduct prouduct = prouductMapper.selectById(id);
return prouduct;
public Product updateProuduct(Integer productNum) {
// QueryWrapper<Product> wrapper = new QueryWrapper<Product>();
// wrapper.eq("productNum",productNum);
Product product = productMapper.updateProuduct(productNum);
return product;
}
//根据对象中不为null的属性当做set条件,id当做唯一where条件
@Override
public void addupdateProuduct(Prouduct prouduct) {
prouductMapper.updateById(prouduct);
public void addupdateProuduct(Product product) {
productMapper.updateById(product);
}
@Override
public void exportDataToEx(HttpServletResponse response) throws IOException {
//获得数据库当中的数据,这里是已经写好的一个方法,返回的是一个select * 的list集合。
List<Prouduct> list = prouductMapper.selectList(null);
List<Product> list = productMapper.selectList(null);
HSSFWorkbook workbook = new HSSFWorkbook();
@ -149,16 +152,16 @@ public class ProuductServiceImp implements ProuductService {
//对前面得到的list集合进行遍历
for (int i =0 ;i<list.size();i++){
row = sheet.createRow(i+2); //重新找到这一行数据的行数,也就是在前端的基础上再另起一行
Prouduct prouduct =list.get(i); //得到集合遍历的每一行数据
row.createCell(0).setCellValue(prouduct.getId()); //将值给到单元格
row.createCell(1).setCellValue(prouduct.getName()); //user是一个实体类对象,获取get方法进行赋值
row.createCell(2).setCellValue(prouduct.getType());
row.createCell(3).setCellValue(prouduct.getState());
row.createCell(4).setCellValue(prouduct.getSize());
row.createCell(5).setCellValue(prouduct.getBenefits());
row.createCell(6).setCellValue(prouduct.getBrands());
row.createCell(7).setCellValue(prouduct.getNum());
row.createCell(8).setCellValue(prouduct.getChannel());
Product product =list.get(i); //得到集合遍历的每一行数据
row.createCell(0).setCellValue(product.getProductName()); //user是一个实体类对象,获取get方法进行赋值
row.createCell(1).setCellValue(product.getProductType());
row.createCell(2).setCellValue(product.getProductState());
row.createCell(3).setCellValue(product.getProductSize());
row.createCell(4).setCellValue(product.getProductBenefits());
row.createCell(5).setCellValue(product.getProductBrands());
row.createCell(6).setCellValue(product.getProductNum());
row.createCell(7).setCellValue(product.getProductChannel());
row.createCell(8).setCellValue(product.getProductTypeNo());
}
//设置自适应宽度
@ -184,33 +187,33 @@ public class ProuductServiceImp implements ProuductService {
OutputStream os = response.getOutputStream();
//这里进行设置了一个文件名,其实也可以不要设置了,
//在前端进行下载的时候需要重新给定一个文件名进行下载
response.setHeader("Content-disposition","attachment;filename=Prouduct.xls");
response.setHeader("Content-disposition","attachment;filename=Product.xls");
workbook.write(os);
os.flush();
os.close();
}
@Override
public List<Prouduct> onSubmit(Prouduct prouduct) {
List<Prouduct> prouductList=prouductMapper.onSubmit(prouduct);
public List<Product> onSubmit(Product product) {
List<Product> prouductList=productMapper.onSubmit(product);
return prouductList;
}
@Override
public List<Prouduct> onbrandslist(Prouduct prouduct) {
List<Prouduct> brandslist =prouductMapper.onbrandslist(prouduct);
public List<Product> onbrandslist(Product product) {
List<Product> brandslist =productMapper.onbrandslist(product);
return brandslist;
}
@Override
public List<Prouduct> onchannellist(Prouduct prouduct) {
List<Prouduct> channellist= prouductMapper.onchannellist(prouduct);
public List<Product> onchannellist(Product product) {
List<Product> channellist= productMapper.onchannellist(product);
return channellist;
}
@Override
public List<Prouduct> ontypelist(Prouduct prouduct) {
List<Prouduct> typelist= prouductMapper.ontypelist(prouduct);
public List<Product> ontypelist(Product product) {
List<Product> typelist= productMapper.ontypelist(product);
return typelist;
}
}

9
textja/src/main/java/com/lan/textja/service/product/ProuductBasicsService.java

@ -1,9 +0,0 @@
package com.lan.textja.service.product;
import com.lan.textja.entity.ProuductBasics;
import java.util.List;
public interface ProuductBasicsService {
List<ProuductBasics> selectbrandslist();
}

23
textja/src/main/java/com/lan/textja/service/product/ProuductBasicsServiceImp.java

@ -1,23 +0,0 @@
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;
}
}

34
textja/src/main/java/com/lan/textja/service/product/ProuductService.java

@ -1,34 +0,0 @@
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);
}

2
textja/src/main/java/com/lan/textja/service/supplier/SupplierService.java

@ -20,5 +20,5 @@ public interface SupplierService {
List<Supplier> onSubmit(Supplier supplier);
Integer SupplierNum(Supplier supplier);
Integer SupplierNum();
}

2
textja/src/main/java/com/lan/textja/service/supplier/SupplierServiceImp.java

@ -70,7 +70,7 @@ public class SupplierServiceImp implements SupplierService{
}
@Override
public Integer SupplierNum(Supplier supplier) {
public Integer SupplierNum() {
List<Integer> Nums=supplierMapper.SupplierNum();
System.out.println(Nums);
Integer maxValue = Collections.max(Nums);

11
textja/src/main/java/com/lan/textja/service/supplier/SupplyService.java

@ -1,7 +1,9 @@
package com.lan.textja.service.supplier;
import com.lan.textja.entity.Order;
import com.lan.textja.entity.Supplier;
import com.lan.textja.entity.Supply;
import com.lan.textja.util.JsonResult;
import com.lan.textja.util.PageResult;
import java.util.List;
@ -17,4 +19,13 @@ public interface SupplyService {
List<Supply> goodsTypes();
List<Supply> Onorder(Supply supply);
Integer SureOrder(Map<String,Object> params);
Integer goodsNum();
List<Supplier> supplierName();
void onAddSupply(Map<String, Object> params);
}

132
textja/src/main/java/com/lan/textja/service/supplier/SupplyServiceImp.java

@ -1,30 +1,40 @@
package com.lan.textja.service.supplier;
import com.lan.textja.entity.Supplier;
import com.lan.textja.entity.Supply;
import com.lan.textja.mapper.SupplyMapper;
import com.lan.textja.entity.*;
import com.lan.textja.mapper.*;
import com.lan.textja.util.JsonResult;
import com.lan.textja.util.PageResult;
import com.sun.org.apache.regexp.internal.RE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.*;
@Service
public class SupplyServiceImp implements SupplyService{
public class SupplyServiceImp implements SupplyService {
@Autowired
private SupplyMapper supplyMapper;
@Autowired
private DealerMapper dealerMapper;
@Autowired
private DeliveryMapper deliveryMapper;
@Autowired
private SupplierMapper supplierMapper;
@Autowired
private InventoryMapper inventoryMapper;
@Override
public PageResult supplyList(PageResult pageResult) {
//起始位置
int start = (pageResult.getPageNum()-1) * pageResult.getPageSize();
int start = (pageResult.getPageNum() - 1) * pageResult.getPageSize();
//每页条数
int size = pageResult.getPageSize();
//分页结果
List<Supply> supplyList = supplyMapper.supplyList(start,size);
List<Supply> supplyList = supplyMapper.supplyList(start, size);
//是user表的总数信息 暂时不需要where条件.
long total = supplyMapper.selectCount(null);
//封装数据实现返回
@ -34,25 +44,119 @@ public class SupplyServiceImp implements SupplyService{
@Override
public List<Supplier> supplyDetail(Supply supply) {
List<Supplier> supplierList= supplyMapper.supplyDetail(supply);
return supplierList;
List<Supplier> supplierList = supplyMapper.supplyDetail(supply);
return supplierList;
}
@Override
public List<Supply> supplyselect(Supply supply) {
List<Supply>supplyselect=supplyMapper.supplyselect(supply);
List<Supply> supplyselect = supplyMapper.supplyselect(supply);
return supplyselect;
}
@Override
public List<Supply> goodsTypes() {
List<Supply>goodsTypes=supplyMapper.goodsTypes();
List<Supply> goodsTypes = supplyMapper.goodsTypes();
return goodsTypes;
}
@Override
public List<Supply> Onorder(Supply supply) {
List<Supply> Onorder=supplyMapper.Onorder(supply);
List<Supply> Onorder = supplyMapper.Onorder(supply);
return Onorder;
}
@Override
public Integer SureOrder(Map<String, Object> params) {
Integer remainingQty= inventoryMapper.selectRemainingQty(Integer.parseInt(String.valueOf(params.get("goodsNum"))));
int SUCCESS=200;
if(remainingQty>=2000){
SUCCESS=401;
return SUCCESS;
}else {
Order order = new Order();
//设置订单号
int max = 10000;
int min = 1000;
Random random = new Random();
int fileName = (random.nextInt(max - min) + min + 1);
order.setOrderNo(fileName);
//设置订单相关值
order.setOrderGoodsNo(Integer.parseInt(String.valueOf(params.get("goodsNum"))));
order.setOrderName(String.valueOf(Optional.ofNullable(params.get("goodsName")).orElse("")));
order.setOrderPrice(Integer.parseInt(String.valueOf(params.get("goodsPrice"))));
order.setOrderQty(Integer.parseInt(String.valueOf(params.get("goodsQty"))));
order.setOrderTotalPrice(Integer.parseInt(String.valueOf(params.get("totalPrice"))));
order.setOrderType(String.valueOf(Optional.ofNullable(params.get("goodsType")).orElse("")));
//获取dealer信息
String dealerName = "紫艺化妆品(总店)";
Dealer dealerList = dealerMapper.select(dealerName);
order.setOrderDealerContact(dealerList.getDealerContact());
order.setOrderDealerAddress(dealerList.getDealerAddress());
order.setOrderDealerNumber(dealerList.getDealerNumber());
order.setOrderDealerNo(dealerList.getDealerNum());
Integer goodsSupplierFirm = Integer.parseInt(String.valueOf(params.get("goodsSupplierFirm")));
Supplier supplierList = supplierMapper.select(goodsSupplierFirm);
//获取supplier信息
order.setOrderSupplierContact(supplierList.getSupplierContact());
order.setOrderSupplierAddress(supplierList.getSupplierAddress());
order.setOrderSupplierNumber(supplierList.getSupplierNumber());
order.setOrderSupplierNo(supplierList.getSupplierNum());
//订单进行中
order.setOrderState(true);
deliveryMapper.SureOrder(order);
return SUCCESS;
}
}
@Override
public Integer goodsNum() {
List<Integer> Nums = supplyMapper.goodsNum();
System.out.println(Nums);
Integer maxValue = Collections.max(Nums);
System.out.println(maxValue);
maxValue++;
return maxValue;
}
@Override
public List<Supplier> supplierName() {
List<Supplier> supplierNames = supplierMapper.supplierName();
return supplierNames;
}
@Override
public void onAddSupply(Map<String, Object> params) {
Supply supply =new Supply();
supply.setGoodsNum(Integer.parseInt(String.valueOf(params.get("goodsNum"))));
supply.setGoodsName(String.valueOf(Optional.ofNullable(params.get("goodsName")).orElse("")));
supply.setGoodsType(String.valueOf(Optional.ofNullable(params.get("goodsType")).orElse("")));
supply.setGoodsSupplier(String.valueOf(Optional.ofNullable(params.get("supplierName")).orElse("")));
supply.setGoodsPrice(Integer.parseInt(String.valueOf(params.get("goodsPrice"))));
supply.setGoodsSize(String.valueOf(Optional.ofNullable(params.get("goodsSize")).orElse("")));
supply.setGoodsEffect(String.valueOf(Optional.ofNullable(params.get("goodsEffect")).orElse("")));
//设置goodsState 0无 1有
Integer goodsState=Integer.parseInt(String.valueOf(params.get("goodsState")));
if(goodsState==0){
supply.setGoodsState(false);
}
supply.setGoodsState(true);
//拿到supplierNum 设置goodsSupplierFirm
String supplierName=String.valueOf(Optional.ofNullable(params.get("supplierName")).orElse(""));
Supplier supplierList = supplierMapper.goodsSupplierFirm(supplierName);
supply.setGoodsSupplierFirm(supplierList.getSupplierNum());
supplyMapper.onAddSupply(supply);
}
}

1
textja/src/main/java/com/lan/textja/util/MenuResult.java

@ -17,5 +17,4 @@ public class MenuResult implements Serializable {
private String path; //菜单路径
private Integer level; //菜单排序
private List<MenuResult> children; //子菜单列表
}

19
textja/src/main/java/com/lan/textja/util/TreeResult.java

@ -0,0 +1,19 @@
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;//二级子菜单列表
}

92
textja/src/main/resources/com/lan/textja/mapper/DealerMapper.xml

@ -0,0 +1,92 @@
<?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>

76
textja/src/main/resources/com/lan/textja/mapper/DeliveryMapper.xml

@ -0,0 +1,76 @@
<?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>

65
textja/src/main/resources/com/lan/textja/mapper/InventoryMapper.xml

@ -4,21 +4,21 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lan.textja.mapper.InventoryMapper">
<sql id="inventoryColumns">
product_num AS "productNum",
product_name AS "productName",
product_type AS "productType",
product_brands AS "productBrands",
all_stock AS "allStock",
remaining_qty AS "remainingQty"
inventory_Product_Num AS "inventoryProductNum",
Inventory_Product_Name AS "inventoryProductName",
Inventory_Product_Type AS "inventoryProductType",
Inventory_Product_Brands AS "inventoryProductBrands",
Inventory_All_Stock AS "inventoryAllStock",
Inventory_Remaining_Qty AS "inventoryRemainingQty"
</sql>
<select id="typelist" resultType="com.lan.textja.entity.Inventory">
select distinct product_type
select distinct Inventory_Product_Type
from product_inventory;
</select>
<select id="brandslist" resultType="com.lan.textja.entity.Inventory">
select distinct product_brands
select distinct Inventory_Product_Brands
from product_inventory;
</select>
@ -26,40 +26,51 @@
select <include refid="inventoryColumns"></include> from product_inventory
where
1=1
<if test="productBrands !=null and productBrands !=''">
and product_brands=#{productBrands}
<if test="inventoryProductBrands !=null and inventoryProductBrands !=''">
and Inventory_Product_Brands=#{inventoryProductBrands}
</if>
<if test="productType !=null and productType !=''">
and product_type=#{productType};
<if test="inventoryProductType !=null and inventoryProductType !=''">
and Inventory_Product_Type=#{inventoryProductType};
</if>
</select>
<insert id="addList" parameterType="com.lan.textja.entity.Inventory">
insert into product_inventory (product_num,product_name,product_type,product_brands,all_stock,remaining_qty)
insert into product_inventory (inventory_Product_Num,Inventory_Product_Name,Inventory_Product_Type,Inventory_Product_Brands,Inventory_All_Stock,Inventory_Remaining_Qty)
values (
#{productNum},
#{productName},
#{productType},
#{productBrands},
#{allStock},
#{remainingQty}
#{inventoryProductNum},
#{inventoryProductName},
#{inventoryProductType},
#{inventoryProductBrands},
#{inventoryAllStock},
#{inventoryRemainingQty}
)
</insert>
<select id="handleDetail" resultType="com.lan.textja.entity.Inventory">
select <include refid="inventoryColumns"></include>
from product_inventory
where product_num=#{productNum}
where inventory_Product_Num=#{inventoryProductNum}
</select>
<update id="UpdateInventory" parameterType="com.lan.textja.entity.Inventory">
update product_inventory set
product_num=#{productNum},
product_name=#{productName},
product_type=#{productType},
product_brands=#{productBrands},
all_stock=#{allStock},
remaining_qty=#{remainingQty}
where product_num=#{productNum};
inventory_Product_Num=#{inventoryProductNum},
Inventory_Product_Name=#{inventoryProductName},
Inventory_Product_Type=#{inventoryProductType},
Inventory_Product_Brands=#{inventoryProductBrands},
Inventory_All_Stock=#{inventoryAllStock},
Inventory_Remaining_Qty=#{inventoryRemainingQty}
where inventory_Product_Num=#{inventoryProductNum};
</update>
<select id="selectRemainingQty" resultType="Integer">
select Inventory_Remaining_Qty from product_inventory
where inventory_Product_Num=#{inventoryProductNum}
</select>
<update id="addQty" parameterType="integer">
update product_inventory set
Inventory_Remaining_Qty=#{remainingQty}
where inventory_Product_Num=#{productNum};
</update>
</mapper>

71
textja/src/main/resources/com/lan/textja/mapper/ProductMapper.xml

@ -0,0 +1,71 @@
<?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>

53
textja/src/main/resources/com/lan/textja/mapper/ProuductMapper.xml

@ -1,53 +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.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>

14
textja/src/main/resources/com/lan/textja/mapper/SupplierMapper.xml

@ -87,6 +87,20 @@
<select id="SupplierNum" resultType="Integer">
select distinct supplier_Num from supplier
</select>
<select id="select" resultType="com.lan.textja.entity.Supplier">
select supplier_Contact,supplier_Address,supplier_Number,supplier_Num from supplier
where supplier_Num=#{goodsSupplierFirm}
</select>
<select id="supplierName" resultType="com.lan.textja.entity.Supplier">
select distinct supplier_Name from supplier
</select>
<select id="goodsSupplierFirm" resultType="com.lan.textja.entity.Supplier">
select supplier_Num from supplier
where supplier_Name=#{supplierName}
</select>
</mapper>

33
textja/src/main/resources/com/lan/textja/mapper/SupplyMapper.xml

@ -58,8 +58,39 @@
</select>
<select id="Onorder" resultMap="supply">
select a.goods_Name,a.goods_Price,a.goods_Type,a.goods_Supplier,b.supplier_Address,b.supplier_Receiver,b.supplier_Number
select a.goods_Num,a.goods_Name,a.goods_Price,a.goods_Type,a.goods_Supplier,a.goods_Supplier_Firm,b.supplier_Address,b.supplier_Contact,b.supplier_Number
from supplier_goods a join supplier b on a.goods_Supplier_Firm=b.supplier_Num
where a.goods_Num=#{goodsNum}
</select>
<select id="goodsNum" resultType="Integer">
select distinct goods_Num from supplier_goods
</select>
<insert id="onAddSupply" parameterType="com.lan.textja.entity.Supply">
insert into
supplier_goods(
goods_Num,
goods_Name,
goods_Price,
goods_Supplier_Firm,
goods_Type,
goods_Supplier,
goods_Size,
goods_Effect,
goods_State
)
values (
#{goodsNum},
#{goodsName},
#{goodsPrice},
#{goodsSupplierFirm},
#{goodsType},
#{goodsSupplier},
#{goodsSize},
#{goodsEffect},
#{goodsState}
)
</insert>
</mapper>

Loading…
Cancel
Save