Browse Source

11.21更新

dev
wangzhenglan 2 years ago
parent
commit
00970379fd
  1. 61
      textja/src/main/java/com/lan/textja/controller/dealer/DealerController.java
  2. 56
      textja/src/main/java/com/lan/textja/controller/order/DeliveryController.java
  3. 46
      textja/src/main/java/com/lan/textja/controller/product/ProductController.java
  4. 30
      textja/src/main/java/com/lan/textja/controller/product/ProuductBasicsController.java
  5. 4
      textja/src/main/java/com/lan/textja/controller/supplier/SupplierController.java
  6. 9
      textja/src/main/java/com/lan/textja/controller/supplier/SupplyController.java
  7. 14
      textja/src/main/java/com/lan/textja/entity/Dealer.java
  8. 12
      textja/src/main/java/com/lan/textja/entity/Inventory.java
  9. 25
      textja/src/main/java/com/lan/textja/entity/Product.java
  10. 25
      textja/src/main/java/com/lan/textja/entity/Prouduct.java
  11. 25
      textja/src/main/java/com/lan/textja/entity/ProuductBasics.java
  12. 16
      textja/src/main/java/com/lan/textja/mapper/DealerMapper.java
  13. 24
      textja/src/main/java/com/lan/textja/mapper/DeliveryMapper.java
  14. 5
      textja/src/main/java/com/lan/textja/mapper/InventoryMapper.java
  15. 9
      textja/src/main/java/com/lan/textja/mapper/OrderMapper.java
  16. 32
      textja/src/main/java/com/lan/textja/mapper/ProductMapper.java
  17. 13
      textja/src/main/java/com/lan/textja/mapper/ProuductBasicsMapper.java
  18. 27
      textja/src/main/java/com/lan/textja/mapper/ProuductMapper.java
  19. 18
      textja/src/main/java/com/lan/textja/service/Order/DeliveryService.java
  20. 78
      textja/src/main/java/com/lan/textja/service/Order/DeliveryServiceImp.java
  21. 18
      textja/src/main/java/com/lan/textja/service/dealer/DealerService.java
  22. 74
      textja/src/main/java/com/lan/textja/service/dealer/DealerServiceImp.java
  23. 12
      textja/src/main/java/com/lan/textja/service/product/InventoryServiceImp.java
  24. 34
      textja/src/main/java/com/lan/textja/service/product/ProductService.java
  25. 75
      textja/src/main/java/com/lan/textja/service/product/ProductServiceImp.java
  26. 9
      textja/src/main/java/com/lan/textja/service/product/ProuductBasicsService.java
  27. 23
      textja/src/main/java/com/lan/textja/service/product/ProuductBasicsServiceImp.java
  28. 34
      textja/src/main/java/com/lan/textja/service/product/ProuductService.java
  29. 2
      textja/src/main/java/com/lan/textja/service/supplier/SupplierService.java
  30. 2
      textja/src/main/java/com/lan/textja/service/supplier/SupplierServiceImp.java
  31. 3
      textja/src/main/java/com/lan/textja/service/supplier/SupplyService.java
  32. 36
      textja/src/main/java/com/lan/textja/service/supplier/SupplyServiceImp.java
  33. 1
      textja/src/main/java/com/lan/textja/util/MenuResult.java
  34. 19
      textja/src/main/java/com/lan/textja/util/TreeResult.java
  35. 70
      textja/src/main/resources/com/lan/textja/mapper/DealerMapper.xml
  36. 13
      textja/src/main/resources/com/lan/textja/mapper/DeliveryMapper.xml
  37. 65
      textja/src/main/resources/com/lan/textja/mapper/InventoryMapper.xml
  38. 62
      textja/src/main/resources/com/lan/textja/mapper/ProductMapper.xml
  39. 53
      textja/src/main/resources/com/lan/textja/mapper/ProuductMapper.xml

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

@ -1,15 +1,15 @@
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.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;
@ -26,4 +26,57 @@ public class DealerController {
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);
}

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

@ -55,8 +55,13 @@ public class SupplyController {
@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);
supplyService.SureOrder(params);
return JsonResult.ok(JsonResult.SUCCESS);
Integer SUCCESS=supplyService.SureOrder(params);
if(SUCCESS==200){
return JsonResult.ok().code(200);
}
return JsonResult.err().code(201);
}

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

@ -1,10 +1,13 @@
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)
@ -14,5 +17,16 @@ public class Dealer implements Serializable {
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;
}

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

@ -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("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;
}

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;
}

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

@ -2,6 +2,7 @@ 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;
@ -10,4 +11,19 @@ public interface DealerMapper extends BaseMapper<Dealer> {
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);
}

9
textja/src/main/java/com/lan/textja/mapper/OrderMapper.java

@ -1,9 +0,0 @@
package com.lan.textja.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lan.textja.entity.Order;
public interface OrderMapper extends BaseMapper<Order> {
void SureOrder(Order order);
}

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

@ -0,0 +1,32 @@
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;
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<Integer> selectSupplierNo();
// @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);
}

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;
}
}

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

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

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

@ -1,11 +1,16 @@
package com.lan.textja.service.dealer;
import com.lan.textja.entity.Dealer;
import com.lan.textja.entity.Supplier;
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
@ -14,9 +19,76 @@ 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);

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

@ -3,6 +3,7 @@ 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;
@ -19,7 +20,7 @@ public interface SupplyService {
List<Supply> Onorder(Supply supply);
void SureOrder(Map<String,Object> params);
Integer SureOrder(Map<String,Object> params);
Integer goodsNum();

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

@ -1,16 +1,9 @@
package com.lan.textja.service.supplier;
import com.lan.textja.entity.Dealer;
import com.lan.textja.entity.Order;
import com.lan.textja.entity.Supplier;
import com.lan.textja.entity.Supply;
import com.lan.textja.mapper.DealerMapper;
import com.lan.textja.mapper.OrderMapper;
import com.lan.textja.mapper.SupplierMapper;
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.apache.ibatis.javassist.expr.NewArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -26,11 +19,14 @@ public class SupplyServiceImp implements SupplyService {
private DealerMapper dealerMapper;
@Autowired
private OrderMapper orderMapper;
private DeliveryMapper deliveryMapper;
@Autowired
private SupplierMapper supplierMapper;
@Autowired
private InventoryMapper inventoryMapper;
@Override
public PageResult supplyList(PageResult pageResult) {
//起始位置
@ -71,8 +67,14 @@ public class SupplyServiceImp implements SupplyService {
}
@Override
public void SureOrder(Map<String, Object> params) {
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;
@ -89,7 +91,7 @@ public class SupplyServiceImp implements SupplyService {
order.setOrderType(String.valueOf(Optional.ofNullable(params.get("goodsType")).orElse("")));
//获取dealer信息
String dealerName = String.valueOf(Optional.ofNullable(params.get("dealerName")).orElse(""));
String dealerName = "紫艺化妆品(总店)";
Dealer dealerList = dealerMapper.select(dealerName);
order.setOrderDealerContact(dealerList.getDealerContact());
order.setOrderDealerAddress(dealerList.getDealerAddress());
@ -107,7 +109,11 @@ public class SupplyServiceImp implements SupplyService {
//订单进行中
order.setOrderState(true);
orderMapper.SureOrder(order);
deliveryMapper.SureOrder(order);
return SUCCESS;
}
}
@Override

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;//二级子菜单列表
}

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

@ -9,6 +9,11 @@
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">
@ -19,4 +24,69 @@
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>

13
textja/src/main/resources/com/lan/textja/mapper/OrderMapper.xml → textja/src/main/resources/com/lan/textja/mapper/DeliveryMapper.xml

@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lan.textja.mapper.OrderMapper">
<mapper namespace="com.lan.textja.mapper.DeliveryMapper">
<sql id="OrderColumns">
order_No AS "orderNo",
order_Name AS "orderName",
@ -62,4 +62,15 @@
)
</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=#{inventoryRemainingQty}
where inventory_Product_Num=#{inventoryProductNum};
</update>
</mapper>

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

@ -0,0 +1,62 @@
<?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"
</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="selectSupplierNo" resultType="Integer">
select distinct product_Supplier_No from product
</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>
Loading…
Cancel
Save