Althars123 1 year ago
parent
commit
f5de8c8652

+ 121 - 0
xxgl-admin/src/main/java/com/miaxis/pc/controller/OrderInfoController.java

@@ -0,0 +1,121 @@
+package com.miaxis.pc.controller;
+
+import com.miaxis.common.constant.Constants;
+import java.util.List;
+import java.util.Arrays;
+
+import com.miaxis.common.utils.SecurityUtils;
+import com.miaxis.order.domain.OrderItems;
+import io.swagger.annotations.*;
+import com.miaxis.common.core.domain.Response;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import com.miaxis.common.annotation.Log;
+import com.miaxis.common.core.controller.BaseController;
+import com.miaxis.common.enums.BusinessTypeEnum;
+import com.miaxis.order.domain.OrderInfo;
+import com.miaxis.order.service.IOrderInfoService;
+import com.miaxis.common.utils.poi.ExcelUtil;
+import com.miaxis.common.core.page.ResponsePageInfo;
+
+/**
+ * 【订单】Controller
+ *
+ * @author miaxis
+ * @date 2023-11-17
+ */
+@RestController
+@RequestMapping("/order/info")
+@Api(tags={"【pc-订单】"})
+public class OrderInfoController extends BaseController{
+    @Autowired
+    private IOrderInfoService orderInfoService;
+
+    /**
+     * 查询订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('order:info:list')")
+    @GetMapping("/list")
+    @ApiOperation("查询订单列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
+            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
+    })
+    public ResponsePageInfo<OrderInfo> list(@ModelAttribute OrderInfo orderInfo){
+        startPage();
+        List<OrderInfo> list = orderInfoService.selectOrderInfoList(orderInfo);
+        return toResponsePageInfo(list);
+    }
+
+    /**
+     * 导出订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('order:info:export')")
+    @Log(title = "订单", businessType = BusinessTypeEnum.EXPORT)
+    @GetMapping("/export")
+    @ApiOperation("导出订单列表Excel")
+    public Response<String> export(@ModelAttribute OrderInfo orderInfo){
+        List<OrderInfo> list = orderInfoService.selectOrderInfoList(orderInfo);
+        ExcelUtil<OrderInfo> util = new ExcelUtil<OrderInfo>(OrderInfo.class);
+        return util.exportExcel(list, "info");
+    }
+
+    /**
+     * 获取订单详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('order:info:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation("获取订单详细信息")
+    public Response<OrderInfo> getInfo(
+            @ApiParam(name = "id", value = "订单参数", required = true)
+            @PathVariable("id") Long id
+    ){
+        return Response.success(orderInfoService.getById(id));
+    }
+
+    /**
+     * 新增订单
+     */
+    @PreAuthorize("@ss.hasPermi('order:info:add')")
+    @Log(title = "订单", businessType = BusinessTypeEnum.INSERT)
+    @PostMapping
+    @ApiOperation("新增订单")
+    public Response add(@RequestBody List<OrderItems> orderItemsList){
+        orderInfoService.addOrder(orderItemsList);
+        return Response.success();
+}
+
+    /**
+     * 修改订单
+     */
+    @PreAuthorize("@ss.hasPermi('order:info:edit')")
+    @Log(title = "订单", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping
+    @ApiOperation("修改订单")
+    public Response<Integer> edit(@RequestBody OrderInfo orderInfo){
+        return toResponse(orderInfoService.updateById(orderInfo) ? 1 : 0);
+    }
+
+    /**
+     * 删除订单
+     */
+    @PreAuthorize("@ss.hasPermi('order:info:remove')")
+    @Log(title = "订单", businessType = BusinessTypeEnum.DELETE)
+	@DeleteMapping("/{ids}")
+    @ApiOperation("删除订单")
+    public  Response<Integer> remove(
+            @ApiParam(name = "ids", value = "订单ids参数", required = true)
+            @PathVariable Long[] ids
+    ){
+        return toResponse(orderInfoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+    }
+}

+ 117 - 0
xxgl-admin/src/main/java/com/miaxis/pc/controller/OrderItemsController.java

@@ -0,0 +1,117 @@
+package com.miaxis.pc.controller;
+
+import com.miaxis.common.constant.Constants;
+import java.util.List;
+import java.util.Arrays;
+import io.swagger.annotations.*;
+import com.miaxis.common.core.domain.Response;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import com.miaxis.common.annotation.Log;
+import com.miaxis.common.core.controller.BaseController;
+import com.miaxis.common.enums.BusinessTypeEnum;
+import com.miaxis.order.domain.OrderItems;
+import com.miaxis.order.service.IOrderItemsService;
+import com.miaxis.common.utils.poi.ExcelUtil;
+import com.miaxis.common.core.page.ResponsePageInfo;
+
+/**
+ * 【订单详情】Controller
+ *
+ * @author miaxis
+ * @date 2023-11-17
+ */
+@RestController
+@RequestMapping("/order/items")
+@Api(tags={"【pc-订单详情】"})
+public class OrderItemsController extends BaseController{
+    @Autowired
+    private IOrderItemsService orderItemsService;
+
+    /**
+     * 查询订单详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('order:items:list')")
+    @GetMapping("/list")
+    @ApiOperation("查询订单详情列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
+            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
+    })
+    public ResponsePageInfo<OrderItems> list(@ModelAttribute OrderItems orderItems){
+        startPage();
+        List<OrderItems> list = orderItemsService.selectOrderItemsList(orderItems);
+        return toResponsePageInfo(list);
+    }
+
+    /**
+     * 导出订单详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('order:items:export')")
+    @Log(title = "订单详情", businessType = BusinessTypeEnum.EXPORT)
+    @GetMapping("/export")
+    @ApiOperation("导出订单详情列表Excel")
+    public Response<String> export(@ModelAttribute OrderItems orderItems){
+        List<OrderItems> list = orderItemsService.selectOrderItemsList(orderItems);
+        ExcelUtil<OrderItems> util = new ExcelUtil<OrderItems>(OrderItems.class);
+        return util.exportExcel(list, "items");
+    }
+
+    /**
+     * 获取订单详情详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('order:items:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation("获取订单详情详细信息")
+    public Response<OrderItems> getInfo(
+            @ApiParam(name = "id", value = "订单详情参数", required = true)
+            @PathVariable("id") Long id
+    ){
+        return Response.success(orderItemsService.getById(id));
+    }
+
+    /**
+     * 新增订单详情
+     */
+    @PreAuthorize("@ss.hasPermi('order:items:add')")
+    @Log(title = "订单详情", businessType = BusinessTypeEnum.INSERT)
+    @PostMapping
+    @ApiOperation("新增订单详情")
+    public Response<Integer> add(@RequestBody OrderItems orderItems){
+        return toResponse(orderItemsService.save(orderItems) ? 1 : 0);
+    }
+
+    /**
+     * 修改订单详情
+     */
+    @PreAuthorize("@ss.hasPermi('order:items:edit')")
+    @Log(title = "订单详情", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping
+    @ApiOperation("修改订单详情")
+    public Response<Integer> edit(@RequestBody OrderItems orderItems){
+        return toResponse(orderItemsService.updateById(orderItems) ? 1 : 0);
+    }
+
+    /**
+     * 删除订单详情
+     */
+    @PreAuthorize("@ss.hasPermi('order:items:remove')")
+    @Log(title = "订单详情", businessType = BusinessTypeEnum.DELETE)
+	@DeleteMapping("/{ids}")
+    @ApiOperation("删除订单详情")
+    public  Response<Integer> remove(
+            @ApiParam(name = "ids", value = "订单详情ids参数", required = true)
+            @PathVariable Long[] ids
+    ){
+        return toResponse(orderItemsService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+    }
+}

+ 1 - 1
xxgl-admin/src/main/resources/application.yml

@@ -18,7 +18,7 @@ miaxis:
 # 开发环境配置
 server:
   # 服务器的HTTP端口,默认为8080
-  port: 8080
+  port: 8082
   servlet:
     # 应用的访问路径
     context-path: /

+ 7 - 4
xxgl-admin/src/test/java/com/miaxis/test/NormalTest.java

@@ -1,15 +1,14 @@
 package com.miaxis.test;
 
 import com.miaxis.XxglApplication;
-import facebook4j.Facebook;
-import facebook4j.FacebookException;
-import facebook4j.FacebookFactory;
-import facebook4j.auth.AccessToken;
+
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
 
+import java.util.Optional;
+
 //@ActiveProfiles("prod")
 @SpringBootTest(classes = XxglApplication.class)
 @RunWith(SpringRunner.class)
@@ -23,6 +22,10 @@ public class NormalTest {
 
     }
 
+    public static void main(String[] args) {
+        Optional<Object> optional = Optional.empty();
+    }
+
 
 
 

+ 1 - 1
xxgl-framework/src/main/java/com/miaxis/framework/aspectj/LogFileAspect.java

@@ -44,7 +44,7 @@ public class LogFileAspect {
 
     @AfterReturning(returning = "ret", pointcut = "logPoint()")// returning的值和doAfterReturning的参数名一致
     public void doAfterReturning(Object ret) throws Throwable {
-        // 处理完请求,返回内容
+        // 处理完请求,返回内容m
 //        log.info("返回值 : " + JSON.toJSONString(ret));
     }
 

+ 302 - 0
xxgl-service/src/main/java/com/miaxis/order/domain/OrderInfo.java

@@ -0,0 +1,302 @@
+package com.miaxis.order.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.miaxis.common.annotation.Excel;
+import com.miaxis.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import lombok.Data;
+/**
+ * 订单对象 order_info
+ *
+ * @author miaxis
+ * @date 2023-11-17
+ */
+@Data
+@TableName("order_info")
+@ApiModel(value = "OrderInfo", description = "订单对象 order_info")
+public class OrderInfo extends BaseBusinessEntity{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    @TableId(value = "id")
+    @ApiModelProperty(value = "")
+    private Long id;
+
+    /** 生产单号 */
+    @Excel(name = "生产单号")
+    @TableField("order_no")
+    @ApiModelProperty(value = "生产单号")
+    private String orderNo;
+
+    /** 业务员 */
+    @Excel(name = "业务员")
+    @TableField("business_name")
+    @ApiModelProperty(value = "业务员")
+    private String businessName;
+
+    /** 图纸 */
+    @Excel(name = "图纸")
+    @TableField("picture")
+    @ApiModelProperty(value = "图纸")
+    private String picture;
+
+    /** 动力 */
+    @Excel(name = "动力")
+    @TableField("power")
+    @ApiModelProperty(value = "动力")
+    private String power;
+
+    /** 发电机 */
+    @Excel(name = "发电机")
+    @TableField("fdj")
+    @ApiModelProperty(value = "发电机")
+    private String fdj;
+
+    /** 割板 */
+    @Excel(name = "割板")
+    @TableField("cutting_board")
+    @ApiModelProperty(value = "割板")
+    private String cuttingBoard;
+
+    /** 压型 */
+    @Excel(name = "压型")
+    @TableField("yaxing")
+    @ApiModelProperty(value = "压型")
+    private String yaxing;
+
+    /** 壳体冷作 */
+    @Excel(name = "壳体冷作")
+    @TableField("ketilengzuo")
+    @ApiModelProperty(value = "壳体冷作")
+    private String ketilengzuo;
+
+    /** 地盘冷作 */
+    @Excel(name = "地盘冷作")
+    @TableField("dipanlengzuo")
+    @ApiModelProperty(value = "地盘冷作")
+    private String dipanlengzuo;
+
+    /** 喷塑 */
+    @Excel(name = "喷塑")
+    @TableField("pen_su")
+    @ApiModelProperty(value = "喷塑")
+    private String penSu;
+
+    /** 组装 */
+    @Excel(name = "组装")
+    @TableField("zuzhuang")
+    @ApiModelProperty(value = "组装")
+    private String zuzhuang;
+
+    /** 接线 */
+    @Excel(name = "接线")
+    @TableField("jiexian")
+    @ApiModelProperty(value = "接线")
+    private String jiexian;
+
+    /** 试机 */
+    @Excel(name = "试机")
+    @TableField("shiji")
+    @ApiModelProperty(value = "试机")
+    private String shiji;
+
+    /** 包装 */
+    @Excel(name = "包装")
+    @TableField("baozhuang")
+    @ApiModelProperty(value = "包装")
+    private String baozhuang;
+
+    /** 订单备注 */
+    @Excel(name = "订单备注")
+    @TableField("remark_order")
+    @ApiModelProperty(value = "订单备注")
+    private String remarkOrder;
+
+    /** 订单状态 */
+    @Excel(name = "订单状态")
+    @TableField("status")
+    @ApiModelProperty(value = "订单状态")
+    private Integer status;
+
+    /** 完成日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "完成日期", width = 30, dateFormat = "yyyy-MM-dd")
+    @TableField("finish_time")
+    @ApiModelProperty(value = "完成日期")
+    private Date finishTime;
+
+    /** 生产计划备注 */
+    @Excel(name = "生产计划备注")
+    @TableField("remark_items")
+    @ApiModelProperty(value = "生产计划备注")
+    private String remarkItems;
+
+    public void setId(Long id){
+        this.id = id;
+    }
+
+    public Long getId(){
+        return id;
+    }
+    public void setOrderNo(String orderNo){
+        this.orderNo = orderNo;
+    }
+
+    public String getOrderNo(){
+        return orderNo;
+    }
+    public void setBusinessName(String businessName){
+        this.businessName = businessName;
+    }
+
+    public String getBusinessName(){
+        return businessName;
+    }
+    public void setPicture(String picture){
+        this.picture = picture;
+    }
+
+    public String getPicture(){
+        return picture;
+    }
+    public void setPower(String power){
+        this.power = power;
+    }
+
+    public String getPower(){
+        return power;
+    }
+    public void setFdj(String fdj){
+        this.fdj = fdj;
+    }
+
+    public String getFdj(){
+        return fdj;
+    }
+    public void setCuttingBoard(String cuttingBoard){
+        this.cuttingBoard = cuttingBoard;
+    }
+
+    public String getCuttingBoard(){
+        return cuttingBoard;
+    }
+    public void setYaxing(String yaxing){
+        this.yaxing = yaxing;
+    }
+
+    public String getYaxing(){
+        return yaxing;
+    }
+    public void setKetilengzuo(String ketilengzuo){
+        this.ketilengzuo = ketilengzuo;
+    }
+
+    public String getKetilengzuo(){
+        return ketilengzuo;
+    }
+    public void setDipanlengzuo(String dipanlengzuo){
+        this.dipanlengzuo = dipanlengzuo;
+    }
+
+    public String getDipanlengzuo(){
+        return dipanlengzuo;
+    }
+    public void setPenSu(String penSu){
+        this.penSu = penSu;
+    }
+
+    public String getPenSu(){
+        return penSu;
+    }
+    public void setZuzhuang(String zuzhuang){
+        this.zuzhuang = zuzhuang;
+    }
+
+    public String getZuzhuang(){
+        return zuzhuang;
+    }
+    public void setJiexian(String jiexian){
+        this.jiexian = jiexian;
+    }
+
+    public String getJiexian(){
+        return jiexian;
+    }
+    public void setShiji(String shiji){
+        this.shiji = shiji;
+    }
+
+    public String getShiji(){
+        return shiji;
+    }
+    public void setBaozhuang(String baozhuang){
+        this.baozhuang = baozhuang;
+    }
+
+    public String getBaozhuang(){
+        return baozhuang;
+    }
+    public void setRemarkOrder(String remarkOrder){
+        this.remarkOrder = remarkOrder;
+    }
+
+    public String getRemarkOrder(){
+        return remarkOrder;
+    }
+    public void setStatus(Integer status){
+        this.status = status;
+    }
+
+    public Integer getStatus(){
+        return status;
+    }
+    public void setFinishTime(Date finishTime){
+        this.finishTime = finishTime;
+    }
+
+    public Date getFinishTime(){
+        return finishTime;
+    }
+    public void setRemarkItems(String remarkItems){
+        this.remarkItems = remarkItems;
+    }
+
+    public String getRemarkItems(){
+        return remarkItems;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("orderNo", getOrderNo())
+            .append("businessName", getBusinessName())
+            .append("createTime", getCreateTime())
+            .append("picture", getPicture())
+            .append("power", getPower())
+            .append("fdj", getFdj())
+            .append("cuttingBoard", getCuttingBoard())
+            .append("yaxing", getYaxing())
+            .append("ketilengzuo", getKetilengzuo())
+            .append("dipanlengzuo", getDipanlengzuo())
+            .append("penSu", getPenSu())
+            .append("zuzhuang", getZuzhuang())
+            .append("jiexian", getJiexian())
+            .append("shiji", getShiji())
+            .append("baozhuang", getBaozhuang())
+            .append("remarkOrder", getRemarkOrder())
+            .append("status", getStatus())
+            .append("finishTime", getFinishTime())
+            .append("remarkItems", getRemarkItems())
+            .toString();
+    }
+}

+ 318 - 0
xxgl-service/src/main/java/com/miaxis/order/domain/OrderItems.java

@@ -0,0 +1,318 @@
+package com.miaxis.order.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.miaxis.common.annotation.Excel;
+import com.miaxis.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import lombok.Data;
+/**
+ * 订单详情对象 order_items
+ *
+ * @author miaxis
+ * @date 2023-11-17
+ */
+@Data
+@TableName("order_items")
+@ApiModel(value = "OrderItems", description = "订单详情对象 order_items")
+public class OrderItems extends BaseBusinessEntity{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    @TableId(value = "id")
+    @ApiModelProperty(value = "$column.columnComment")
+    private Long id;
+
+    /** 生产单号 */
+    @Excel(name = "生产单号")
+    @TableField("order_no")
+    @ApiModelProperty(value = "生产单号")
+    private String orderNo;
+
+    /** 机组型号 */
+    @Excel(name = "机组型号")
+    @TableField("unit_model")
+    @ApiModelProperty(value = "机组型号")
+    private String unitModel;
+
+    /** 频率(Hz) */
+    @Excel(name = "频率(Hz)")
+    @TableField("rate")
+    @ApiModelProperty(value = "频率(Hz)")
+    private String rate;
+
+    /** 电压(V) */
+    @Excel(name = "电压(V)")
+    @TableField("voltage")
+    @ApiModelProperty(value = "电压(V)")
+    private String voltage;
+
+    /** 机组功率(kw) */
+    @Excel(name = "机组功率(kw)")
+    @TableField("unit_power_kw")
+    @ApiModelProperty(value = "机组功率(kw)")
+    private String unitPowerKw;
+
+    /** 机组功率(kva) */
+    @Excel(name = "机组功率(kva)")
+    @TableField("unit_power_kva")
+    @ApiModelProperty(value = "机组功率(kva)")
+    private String unitPowerKva;
+
+    /** 机组备用功率(kw) */
+    @Excel(name = "机组备用功率(kw)")
+    @TableField("unit_power_kw_spare")
+    @ApiModelProperty(value = "机组备用功率(kw)")
+    private String unitPowerKwSpare;
+
+    /** 机组备用功率(kva) */
+    @Excel(name = "机组备用功率(kva)")
+    @TableField("unit_power_kva_spare")
+    @ApiModelProperty(value = "机组备用功率(kva)")
+    private String unitPowerKvaSpare;
+
+    /** 柴油机型号 */
+    @Excel(name = "柴油机型号")
+    @TableField("diesel_engine_model")
+    @ApiModelProperty(value = "柴油机型号")
+    private String dieselEngineModel;
+
+    /** 发电机型号 */
+    @Excel(name = "发电机型号")
+    @TableField("fjd")
+    @ApiModelProperty(value = "发电机型号")
+    private String fjd;
+
+    /** 发电机型号 */
+    @Excel(name = "静音开架")
+    @TableField("mute_or_open")
+    @ApiModelProperty(value = "静音开架")
+    private String muteOrOpen;
+
+    /** 控制器型号 */
+    @Excel(name = "控制器型号")
+    @TableField("controller_model")
+    @ApiModelProperty(value = "控制器型号")
+    private String controllerModel;
+
+    /** 水套加热器 */
+    @Excel(name = "水套加热器")
+    @TableField("heater")
+    @ApiModelProperty(value = "水套加热器")
+    private String heater;
+
+    /** ats */
+    @Excel(name = "ats")
+    @TableField("ats")
+    @ApiModelProperty(value = "ats")
+    private String ats;
+
+    /** 断路器 */
+    @Excel(name = "断路器")
+    @TableField("breaker")
+    @ApiModelProperty(value = "断路器")
+    private String breaker;
+
+    /** 电瓶 */
+    @Excel(name = "电瓶")
+    @TableField("battery")
+    @ApiModelProperty(value = "电瓶")
+    private String battery;
+
+    /** 机壳颜色 */
+    @Excel(name = "机壳颜色")
+    @TableField("color")
+    @ApiModelProperty(value = "机壳颜色")
+    private String color;
+
+    /** 数量 */
+    @Excel(name = "数量")
+    @TableField("number")
+    @ApiModelProperty(value = "数量")
+    private String number;
+
+    /** 零售价 */
+    @Excel(name = "零售价")
+    @TableField("price_retail")
+    @ApiModelProperty(value = "零售价")
+    private String priceRetail;
+
+    /** 采购价 */
+    @Excel(name = "采购价")
+    @TableField("price_purchase")
+    @ApiModelProperty(value = "采购价")
+    private String pricePurchase;
+
+    public void setId(Long id){
+        this.id = id;
+    }
+
+    public Long getId(){
+        return id;
+    }
+    public void setOrderNo(String orderNo){
+        this.orderNo = orderNo;
+    }
+
+    public String getOrderNo(){
+        return orderNo;
+    }
+    public void setUnitModel(String unitModel){
+        this.unitModel = unitModel;
+    }
+
+    public String getUnitModel(){
+        return unitModel;
+    }
+    public void setRate(String rate){
+        this.rate = rate;
+    }
+
+    public String getRate(){
+        return rate;
+    }
+    public void setVoltage(String voltage){
+        this.voltage = voltage;
+    }
+
+    public String getVoltage(){
+        return voltage;
+    }
+    public void setUnitPowerKw(String unitPowerKw){
+        this.unitPowerKw = unitPowerKw;
+    }
+
+    public String getUnitPowerKw(){
+        return unitPowerKw;
+    }
+    public void setUnitPowerKva(String unitPowerKva){
+        this.unitPowerKva = unitPowerKva;
+    }
+
+    public String getUnitPowerKva(){
+        return unitPowerKva;
+    }
+    public void setUnitPowerKwSpare(String unitPowerKwSpare){
+        this.unitPowerKwSpare = unitPowerKwSpare;
+    }
+
+    public String getUnitPowerKwSpare(){
+        return unitPowerKwSpare;
+    }
+    public void setUnitPowerKvaSpare(String unitPowerKvaSpare){
+        this.unitPowerKvaSpare = unitPowerKvaSpare;
+    }
+
+    public String getUnitPowerKvaSpare(){
+        return unitPowerKvaSpare;
+    }
+    public void setDieselEngineModel(String dieselEngineModel){
+        this.dieselEngineModel = dieselEngineModel;
+    }
+
+    public String getDieselEngineModel(){
+        return dieselEngineModel;
+    }
+    public void setFjd(String fjd){
+        this.fjd = fjd;
+    }
+
+    public String getFjd(){
+        return fjd;
+    }
+    public void setControllerModel(String controllerModel){
+        this.controllerModel = controllerModel;
+    }
+
+    public String getControllerModel(){
+        return controllerModel;
+    }
+    public void setHeater(String heater){
+        this.heater = heater;
+    }
+
+    public String getHeater(){
+        return heater;
+    }
+    public void setAts(String ats){
+        this.ats = ats;
+    }
+
+    public String getAts(){
+        return ats;
+    }
+    public void setBreaker(String breaker){
+        this.breaker = breaker;
+    }
+
+    public String getBreaker(){
+        return breaker;
+    }
+    public void setBattery(String battery){
+        this.battery = battery;
+    }
+
+    public String getBattery(){
+        return battery;
+    }
+    public void setColor(String color){
+        this.color = color;
+    }
+
+    public String getColor(){
+        return color;
+    }
+    public void setNumber(String number){
+        this.number = number;
+    }
+
+    public String getNumber(){
+        return number;
+    }
+    public void setPriceRetail(String priceRetail){
+        this.priceRetail = priceRetail;
+    }
+
+    public String getPriceRetail(){
+        return priceRetail;
+    }
+    public void setPricePurchase(String pricePurchase){
+        this.pricePurchase = pricePurchase;
+    }
+
+    public String getPricePurchase(){
+        return pricePurchase;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("orderNo", getOrderNo())
+            .append("unitModel", getUnitModel())
+            .append("rate", getRate())
+            .append("voltage", getVoltage())
+            .append("unitPowerKw", getUnitPowerKw())
+            .append("unitPowerKva", getUnitPowerKva())
+            .append("unitPowerKwSpare", getUnitPowerKwSpare())
+            .append("unitPowerKvaSpare", getUnitPowerKvaSpare())
+            .append("dieselEngineModel", getDieselEngineModel())
+            .append("fjd", getFjd())
+            .append("controllerModel", getControllerModel())
+            .append("heater", getHeater())
+            .append("ats", getAts())
+            .append("breaker", getBreaker())
+            .append("battery", getBattery())
+            .append("color", getColor())
+            .append("number", getNumber())
+            .append("priceRetail", getPriceRetail())
+            .append("pricePurchase", getPricePurchase())
+            .toString();
+    }
+}

+ 22 - 0
xxgl-service/src/main/java/com/miaxis/order/mapper/OrderInfoMapper.java

@@ -0,0 +1,22 @@
+package com.miaxis.order.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.miaxis.order.domain.OrderInfo;
+
+/**
+ * 订单Mapper接口
+ *
+ * @author miaxis
+ * @date 2023-11-17
+ */
+public interface OrderInfoMapper extends BaseMapper<OrderInfo> {
+    /**
+     * 查询订单列表
+     *
+     * @param orderInfo 订单
+     * @return 订单集合
+     */
+    public List<OrderInfo> selectOrderInfoList(OrderInfo orderInfo);
+
+}

+ 22 - 0
xxgl-service/src/main/java/com/miaxis/order/mapper/OrderItemsMapper.java

@@ -0,0 +1,22 @@
+package com.miaxis.order.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.miaxis.order.domain.OrderItems;
+
+/**
+ * 订单详情Mapper接口
+ *
+ * @author miaxis
+ * @date 2023-11-17
+ */
+public interface OrderItemsMapper extends BaseMapper<OrderItems> {
+    /**
+     * 查询订单详情列表
+     *
+     * @param orderItems 订单详情
+     * @return 订单详情集合
+     */
+    public List<OrderItems> selectOrderItemsList(OrderItems orderItems);
+
+}

+ 24 - 0
xxgl-service/src/main/java/com/miaxis/order/service/IOrderInfoService.java

@@ -0,0 +1,24 @@
+package com.miaxis.order.service;
+
+import java.util.List;
+import com.miaxis.order.domain.OrderInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.miaxis.order.domain.OrderItems;
+
+/**
+ * 订单Service接口
+ *
+ * @author miaxis
+ * @date 2023-11-17
+ */
+public interface IOrderInfoService extends IService<OrderInfo>{
+    /**
+     * 查询订单列表
+     *
+     * @param orderInfo 订单
+     * @return 订单集合
+     */
+    public List<OrderInfo> selectOrderInfoList(OrderInfo orderInfo);
+
+    void addOrder(List<OrderItems> orderItemsList);
+}

+ 21 - 0
xxgl-service/src/main/java/com/miaxis/order/service/IOrderItemsService.java

@@ -0,0 +1,21 @@
+package com.miaxis.order.service;
+
+import java.util.List;
+import com.miaxis.order.domain.OrderItems;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 订单详情Service接口
+ *
+ * @author miaxis
+ * @date 2023-11-17
+ */
+public interface IOrderItemsService extends IService<OrderItems>{
+    /**
+     * 查询订单详情列表
+     *
+     * @param orderItems 订单详情
+     * @return 订单详情集合
+     */
+    public List<OrderItems> selectOrderItemsList(OrderItems orderItems);
+}

+ 74 - 0
xxgl-service/src/main/java/com/miaxis/order/service/impl/OrderInfoServiceImpl.java

@@ -0,0 +1,74 @@
+package com.miaxis.order.service.impl;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.miaxis.common.utils.DateUtils;
+import com.miaxis.common.utils.SecurityUtils;
+import com.miaxis.order.domain.OrderItems;
+import com.miaxis.order.service.IOrderItemsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.apache.commons.lang3.StringUtils;
+import com.miaxis.order.mapper.OrderInfoMapper;
+import com.miaxis.order.domain.OrderInfo;
+import com.miaxis.order.service.IOrderInfoService;
+
+/**
+ * 订单Service业务层处理
+ *
+ * @author miaxis
+ * @date 2023-11-17
+ */
+@Service
+public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo> implements IOrderInfoService {
+    @Autowired
+    private OrderInfoMapper orderInfoMapper;
+
+    @Autowired
+    private IOrderItemsService orderItemsService;
+
+    /**
+     * 查询订单列表
+     *
+     * @param orderInfo 订单
+     * @return 订单
+     */
+    @Override
+    public List<OrderInfo> selectOrderInfoList(OrderInfo orderInfo){
+        return orderInfoMapper.selectOrderInfoList(orderInfo);
+    }
+
+    @Override
+    public void addOrder(List<OrderItems> orderItemsList) {
+        OrderInfo orderInfo = new OrderInfo();
+        orderInfo.setBusinessName(SecurityUtils.getUsername());
+        orderInfo.setStatus(0);
+        orderInfo.setOrderNo(createOrderNo());
+        this.save(orderInfo);
+        orderItemsList.stream().forEach(o->o.setOrderNo(orderInfo.getOrderNo()));
+        orderItemsService.saveBatch(orderItemsList);
+    }
+
+    private String createOrderNo() {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+        String orderNoPrefix ="KM-JZ"+ sdf.format(new Date());
+        List<OrderInfo> list = this.list(new QueryWrapper<OrderInfo>().like("order_no", orderNoPrefix).orderByDesc("create_time"));
+        if(CollectionUtils.isNotEmpty(list)){
+            OrderInfo orderInfo = list.get(0);
+            String count = orderInfo.getOrderNo().replace(orderNoPrefix, "");
+            String newOrderNo = orderNoPrefix+ (Integer.valueOf(count)+1);
+            return newOrderNo;
+        }else{
+            return orderNoPrefix+1;
+        }
+
+
+    }
+}

+ 35 - 0
xxgl-service/src/main/java/com/miaxis/order/service/impl/OrderItemsServiceImpl.java

@@ -0,0 +1,35 @@
+package com.miaxis.order.service.impl;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.apache.commons.lang3.StringUtils;
+import com.miaxis.order.mapper.OrderItemsMapper;
+import com.miaxis.order.domain.OrderItems;
+import com.miaxis.order.service.IOrderItemsService;
+
+/**
+ * 订单详情Service业务层处理
+ *
+ * @author miaxis
+ * @date 2023-11-17
+ */
+@Service
+public class OrderItemsServiceImpl extends ServiceImpl<OrderItemsMapper, OrderItems> implements IOrderItemsService {
+    @Autowired
+    private OrderItemsMapper orderItemsMapper;
+
+    /**
+     * 查询订单详情列表
+     *
+     * @param orderItems 订单详情
+     * @return 订单详情
+     */
+    @Override
+    public List<OrderItems> selectOrderItemsList(OrderItems orderItems){
+        return orderItemsMapper.selectOrderItemsList(orderItems);
+    }
+}

+ 58 - 0
xxgl-service/src/main/resources/mapper/order/OrderInfoMapper.xml

@@ -0,0 +1,58 @@
+<?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.miaxis.order.mapper.OrderInfoMapper">
+
+    <resultMap type="OrderInfo" id="OrderInfoResult">
+        <result property="id"    column="id"    />
+        <result property="orderNo"    column="order_no"    />
+        <result property="businessName"    column="business_name"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="picture"    column="picture"    />
+        <result property="power"    column="power"    />
+        <result property="fdj"    column="fdj"    />
+        <result property="cuttingBoard"    column="cutting_board"    />
+        <result property="yaxing"    column="yaxing"    />
+        <result property="ketilengzuo"    column="ketilengzuo"    />
+        <result property="dipanlengzuo"    column="dipanlengzuo"    />
+        <result property="penSu"    column="pen_su"    />
+        <result property="zuzhuang"    column="zuzhuang"    />
+        <result property="jiexian"    column="jiexian"    />
+        <result property="shiji"    column="shiji"    />
+        <result property="baozhuang"    column="baozhuang"    />
+        <result property="remarkOrder"    column="remark_order"    />
+        <result property="status"    column="status"    />
+        <result property="finishTime"    column="finish_time"    />
+        <result property="remarkItems"    column="remark_items"    />
+    </resultMap>
+
+    <sql id="selectOrderInfoVo">
+        select * from order_info
+    </sql>
+
+    <select id="selectOrderInfoList" parameterType="OrderInfo" resultMap="OrderInfoResult">
+        <include refid="selectOrderInfoVo"/>
+        <where>
+            <if test="orderNo != null  and orderNo != ''"> and order_no = #{orderNo}</if>
+            <if test="businessName != null  and businessName != ''"> and business_name like concat('%', #{businessName}, '%')</if>
+            <if test="picture != null  and picture != ''"> and picture = #{picture}</if>
+            <if test="power != null  and power != ''"> and power = #{power}</if>
+            <if test="fdj != null  and fdj != ''"> and fdj = #{fdj}</if>
+            <if test="cuttingBoard != null  and cuttingBoard != ''"> and cutting_board = #{cuttingBoard}</if>
+            <if test="yaxing != null  and yaxing != ''"> and yaxing = #{yaxing}</if>
+            <if test="ketilengzuo != null  and ketilengzuo != ''"> and ketilengzuo = #{ketilengzuo}</if>
+            <if test="dipanlengzuo != null  and dipanlengzuo != ''"> and dipanlengzuo = #{dipanlengzuo}</if>
+            <if test="penSu != null  and penSu != ''"> and pen_su = #{penSu}</if>
+            <if test="zuzhuang != null  and zuzhuang != ''"> and zuzhuang = #{zuzhuang}</if>
+            <if test="jiexian != null  and jiexian != ''"> and jiexian = #{jiexian}</if>
+            <if test="shiji != null  and shiji != ''"> and shiji = #{shiji}</if>
+            <if test="baozhuang != null  and baozhuang != ''"> and baozhuang = #{baozhuang}</if>
+            <if test="remarkOrder != null  and remarkOrder != ''"> and remark_order = #{remarkOrder}</if>
+            <if test="status != null "> and status = #{status}</if>
+            <if test="finishTime != null "> and finish_time = #{finishTime}</if>
+            <if test="remarkItems != null  and remarkItems != ''"> and remark_items = #{remarkItems}</if>
+        </where>
+    </select>
+
+</mapper>

+ 59 - 0
xxgl-service/src/main/resources/mapper/order/OrderItemsMapper.xml

@@ -0,0 +1,59 @@
+<?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.miaxis.order.mapper.OrderItemsMapper">
+
+    <resultMap type="OrderItems" id="OrderItemsResult">
+        <result property="id"    column="id"    />
+        <result property="orderNo"    column="order_no"    />
+        <result property="unitModel"    column="unit_model"    />
+        <result property="rate"    column="rate"    />
+        <result property="voltage"    column="voltage"    />
+        <result property="unitPowerKw"    column="unit_power_kw"    />
+        <result property="unitPowerKva"    column="unit_power_kva"    />
+        <result property="unitPowerKwSpare"    column="unit_power_kw_spare"    />
+        <result property="unitPowerKvaSpare"    column="unit_power_kva_spare"    />
+        <result property="dieselEngineModel"    column="diesel_engine_model"    />
+        <result property="fjd"    column="fjd"    />
+        <result property="controllerModel"    column="controller_model"    />
+        <result property="heater"    column="heater"    />
+        <result property="ats"    column="ats"    />
+        <result property="breaker"    column="breaker"    />
+        <result property="battery"    column="battery"    />
+        <result property="color"    column="color"    />
+        <result property="number"    column="number"    />
+        <result property="priceRetail"    column="price_retail"    />
+        <result property="pricePurchase"    column="price_purchase"    />
+    </resultMap>
+
+    <sql id="selectOrderItemsVo">
+        select * from order_items
+    </sql>
+
+    <select id="selectOrderItemsList" parameterType="OrderItems" resultMap="OrderItemsResult">
+        <include refid="selectOrderItemsVo"/>
+        <where>
+            <if test="orderNo != null  and orderNo != ''"> and order_no = #{orderNo}</if>
+            <if test="unitModel != null  and unitModel != ''"> and unit_model = #{unitModel}</if>
+            <if test="rate != null  and rate != ''"> and rate = #{rate}</if>
+            <if test="voltage != null  and voltage != ''"> and voltage = #{voltage}</if>
+            <if test="unitPowerKw != null  and unitPowerKw != ''"> and unit_power_kw = #{unitPowerKw}</if>
+            <if test="unitPowerKva != null  and unitPowerKva != ''"> and unit_power_kva = #{unitPowerKva}</if>
+            <if test="unitPowerKwSpare != null  and unitPowerKwSpare != ''"> and unit_power_kw_spare = #{unitPowerKwSpare}</if>
+            <if test="unitPowerKvaSpare != null  and unitPowerKvaSpare != ''"> and unit_power_kva_spare = #{unitPowerKvaSpare}</if>
+            <if test="dieselEngineModel != null  and dieselEngineModel != ''"> and diesel_engine_model = #{dieselEngineModel}</if>
+            <if test="fjd != null  and fjd != ''"> and fjd = #{fjd}</if>
+            <if test="controllerModel != null  and controllerModel != ''"> and controller_model = #{controllerModel}</if>
+            <if test="heater != null  and heater != ''"> and heater = #{heater}</if>
+            <if test="ats != null  and ats != ''"> and ats = #{ats}</if>
+            <if test="breaker != null  and breaker != ''"> and breaker = #{breaker}</if>
+            <if test="battery != null  and battery != ''"> and battery = #{battery}</if>
+            <if test="color != null  and color != ''"> and color = #{color}</if>
+            <if test="number != null  and number != ''"> and number = #{number}</if>
+            <if test="priceRetail != null  and priceRetail != ''"> and price_retail = #{priceRetail}</if>
+            <if test="pricePurchase != null  and pricePurchase != ''"> and price_purchase = #{pricePurchase}</if>
+        </where>
+    </select>
+
+</mapper>