diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/hainanOrder/HaiNanOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/hainanOrder/HaiNanOrderController.java new file mode 100644 index 0000000..1907bd0 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/hainanOrder/HaiNanOrderController.java @@ -0,0 +1,59 @@ +package com.ruoyi.web.controller.hainanOrder; + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.hainanOrder.domain.HNCustomer; +import com.ruoyi.hainanOrder.domain.HNParams; +import com.ruoyi.hainanOrder.service.HaiNanOrderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.ruoyi.common.core.page.TableDataInfo; + + +import java.util.List; + +import static com.ruoyi.common.utils.PageUtils.startPage; + +/** + * @ClassName OrderController + * @Description TODO + * @Author JIAL + * @Date 2024/5/21 11:13 + * @Version 1.0 + */ +@RestController +@RequestMapping("/orderManage_Hn/order") +public class HaiNanOrderController extends BaseController { + + @Autowired + private HaiNanOrderService haiNanOrderService; + + @PostMapping("list") + public AjaxResult orderList(@RequestBody HNParams HNParams) { + AjaxResult ajax = AjaxResult.success(); + if (HNParams.getDateRange().size() != 0) { + HNParams.setBeginDate(HNParams.getDateRange().get(0)); + HNParams.setEndDate(HNParams.getDateRange().get(1)); + } + ajax.put("orderList", haiNanOrderService.orderList(HNParams)); + return ajax; + } + + @PostMapping("materialList") + public AjaxResult materialList(@RequestBody HNParams HNParams) { + + return null; + } + + @PostMapping("customList") + public TableDataInfo customList(@RequestParam("kunnr") String kunnr, + @RequestParam("name1") String name1) { + System.out.println(kunnr + name1); + startPage(); + List customList = haiNanOrderService.customList(kunnr, name1); + System.out.println(customList); + return getDataTable(customList); +// return null; + } + +} diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index 7603bb3..6e4964b 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -53,6 +53,14 @@ spring: url: jdbc:sqlserver://192.168.9.99:1433;DatabaseName=jn_storage username: sa password: Itcenter110- + order: + # 从数据源开关/默认关闭 + enabled: true + driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver + # 正式数据库 + url: jdbc:sqlserver://192.168.9.2:1433;DatabaseName=jn_web + username: sa + password: it12345 # 初始连接数 initialSize: 10 # 最小连接池数量 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java index 8354d08..3ed2044 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java @@ -35,6 +35,14 @@ public enum DataSourceType /** * 车间库位管理数据库 */ - STORAGE + STORAGE, + + /** + * @title ORDER + * @description 订单管理 + * @author JIAL + * @updateTime 2024/5/24 15:50 + */ + ORDER } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java index 0f54371..a8b9b66 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java @@ -85,6 +85,15 @@ public class DruidConfig return druidProperties.dataSource(dataSource); } + @Bean + @ConfigurationProperties("spring.datasource.druid.order") + @ConditionalOnProperty(prefix = "spring.datasource.druid.order", name = "enabled", havingValue = "true") + public DataSource orderDataSource(DruidProperties druidProperties) + { + DruidDataSource dataSource = DruidDataSourceBuilder.create().build(); + return druidProperties.dataSource(dataSource); + } + @Bean(name = "dynamicDataSource") @Primary public DynamicDataSource dataSource(DataSource masterDataSource) @@ -96,6 +105,7 @@ public class DruidConfig setDataSource(targetDataSources, DataSourceType.QUOT.name(), "quotDataSource"); setDataSource(targetDataSources, DataSourceType.JNERP.name(), "jnerpDataSource"); setDataSource(targetDataSources, DataSourceType.STORAGE.name(), "storageDataSource"); + setDataSource(targetDataSources, DataSourceType.ORDER.name(), "orderDataSource"); return new DynamicDataSource(masterDataSource, targetDataSources); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/hainanOrder/domain/HNCustomer.java b/ruoyi-system/src/main/java/com/ruoyi/hainanOrder/domain/HNCustomer.java new file mode 100644 index 0000000..44880ac --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/hainanOrder/domain/HNCustomer.java @@ -0,0 +1,32 @@ +package com.ruoyi.hainanOrder.domain; + +public class HNCustomer { + private String kunnr; + private String name1; + + public String getKunnr() { + return kunnr; + } + + public void setKunnr(String kunnr) { + this.kunnr = kunnr; + } + + public String getName1() { + return name1; + } + + public void setName1(String name1) { + this.name1 = name1; + } + + @Override + public String toString() { + return "Customer{" + + "kunnr='" + kunnr + '\'' + + ", name1='" + name1 + '\'' + + '}'; + } + + // getters and setters +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/hainanOrder/domain/HNParams.java b/ruoyi-system/src/main/java/com/ruoyi/hainanOrder/domain/HNParams.java new file mode 100644 index 0000000..3f85f11 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/hainanOrder/domain/HNParams.java @@ -0,0 +1,134 @@ +package com.ruoyi.hainanOrder.domain; + +import java.util.List; + +public class HNParams { + private int pageNum; // 页码 + private int pageSize; // 每页大小 + private String kna1; // 客户名称 + private String bstkd; // 合同编号 + private String zsdshdz; // 地址 + private String orderid; // 订单编号 + private String pzh; // SAP凭证号 + private String state; // 提交状态 + private List dateRange; // 日期范围 + private String remarks; // 订单备注 + + private String beginDate; //开始时间 + + private String endDate; //结束时间 + + public int getPageNum() { + return pageNum; + } + + public void setPageNum(int pageNum) { + this.pageNum = pageNum; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public String getKna1() { + return kna1; + } + + public void setKna1(String kna1) { + this.kna1 = kna1; + } + + public String getBstkd() { + return bstkd; + } + + public void setBstkd(String bstkd) { + this.bstkd = bstkd; + } + + public String getZsdshdz() { + return zsdshdz; + } + + public void setZsdshdz(String zsdshdz) { + this.zsdshdz = zsdshdz; + } + + public String getOrderid() { + return orderid; + } + + public void setOrderid(String orderid) { + this.orderid = orderid; + } + + public String getPzh() { + return pzh; + } + + public void setPzh(String pzh) { + this.pzh = pzh; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public List getDateRange() { + return dateRange; + } + + public void setDateRange(List dateRange) { + this.dateRange = dateRange; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public String getBeginDate() { + return beginDate; + } + + public void setBeginDate(String beginDate) { + this.beginDate = beginDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + @Override + public String toString() { + return "QueryParams{" + + "pageNum=" + pageNum + + ", pageSize=" + pageSize + + ", kna1='" + kna1 + '\'' + + ", bstkd='" + bstkd + '\'' + + ", zsdshdz='" + zsdshdz + '\'' + + ", orderid='" + orderid + '\'' + + ", pzh='" + pzh + '\'' + + ", state='" + state + '\'' + + ", dateRange=" + dateRange + + ", remarks='" + remarks + '\'' + + ", beginDate='" + beginDate + '\'' + + ", endDate='" + endDate + '\'' + + '}'; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/hainanOrder/domain/HaiNanOrder.java b/ruoyi-system/src/main/java/com/ruoyi/hainanOrder/domain/HaiNanOrder.java new file mode 100644 index 0000000..2424ed0 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/hainanOrder/domain/HaiNanOrder.java @@ -0,0 +1,153 @@ +package com.ruoyi.hainanOrder.domain; + +/** + * @ClassName Order + * @Description TODO + * @Author JIAL + * @Date 2024/5/21 13:41 + * @Version 1.0 + */ +public class HaiNanOrder { + + private int index; // 序号 + private String kna1; // 客户名称 + private String vdatu; // 交货日期 + private String orderid; // 订单编号 + private String zsdywlxmb; // 业务类型 + private String zsdshdz; // 收货地址 + private String bstkd; // 合同编号 + private String pzh; // SAP凭证号 + private double totalPrice3; // 总价 + private String remarks; // 备注信息 + private String state; // 状态 + private String tabindex; // 功能 + private String creationDate; // 创建日期 + private String ywytjsj; // 提交日期 + + // Getters and Setters + + + public String getKna1() { + return kna1; + } + + public void setKna1(String kna1) { + this.kna1 = kna1; + } + + public String getVdatu() { + return vdatu; + } + + public void setVdatu(String vdatu) { + this.vdatu = vdatu; + } + + public String getOrderid() { + return orderid; + } + + public void setOrderid(String orderid) { + this.orderid = orderid; + } + + public String getZsdywlxmb() { + return zsdywlxmb; + } + + public void setZsdywlxmb(String zsdywlxmb) { + this.zsdywlxmb = zsdywlxmb; + } + + public String getZsdshdz() { + return zsdshdz; + } + + public void setZsdshdz(String zsdshdz) { + this.zsdshdz = zsdshdz; + } + + public String getBstkd() { + return bstkd; + } + + public void setBstkd(String bstkd) { + this.bstkd = bstkd; + } + + public String getPzh() { + return pzh; + } + + public void setPzh(String pzh) { + this.pzh = pzh; + } + + public double getTotalPrice3() { + return totalPrice3; + } + + public void setTotalPrice3(double totalPrice3) { + this.totalPrice3 = totalPrice3; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getTabindex() { + return tabindex; + } + + public void setTabindex(String tabindex) { + this.tabindex = tabindex; + } + + public String getCreationDate() { + return creationDate; + } + + public void setCreationDate(String creationDate) { + this.creationDate = creationDate; + } + + public String getYwytjsj() { + return ywytjsj; + } + + public void setYwytjsj(String ywytjsj) { + this.ywytjsj = ywytjsj; + } + + @Override + public String toString() { + return "Order{" + + "index=" + index + + ", kna1='" + kna1 + '\'' + + ", vdatu='" + vdatu + '\'' + + ", orderid='" + orderid + '\'' + + ", zsdywlxmb='" + zsdywlxmb + '\'' + + ", zsdshdz='" + zsdshdz + '\'' + + ", bstkd='" + bstkd + '\'' + + ", pzh='" + pzh + '\'' + + ", totalPrice3=" + totalPrice3 + + ", remarks='" + remarks + '\'' + + ", state='" + state + '\'' + + ", tabindex='" + tabindex + '\'' + + ", creationDate='" + creationDate + '\'' + + ", ywytjsj='" + ywytjsj + '\'' + + '}'; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/hainanOrder/mapper/HaiNanOrderMapper.java b/ruoyi-system/src/main/java/com/ruoyi/hainanOrder/mapper/HaiNanOrderMapper.java new file mode 100644 index 0000000..6f94a50 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/hainanOrder/mapper/HaiNanOrderMapper.java @@ -0,0 +1,22 @@ +package com.ruoyi.hainanOrder.mapper; + +import com.ruoyi.hainanOrder.domain.HNCustomer; +import com.ruoyi.hainanOrder.domain.HNParams; +import com.ruoyi.hainanOrder.domain.HaiNanOrder; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @ClassName OrderManageMapper + * @Description TODO + * @Author JIAL + * @Date 2024/5/21 11:19 + * @Version 1.0 + */ +public interface HaiNanOrderMapper { + List orderList(HNParams HNParams); + + List customList(@Param("kunnr") String kunnr, + @Param("name1")String name1); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/hainanOrder/service/HaiNanOrderService.java b/ruoyi-system/src/main/java/com/ruoyi/hainanOrder/service/HaiNanOrderService.java new file mode 100644 index 0000000..977bd30 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/hainanOrder/service/HaiNanOrderService.java @@ -0,0 +1,39 @@ +package com.ruoyi.hainanOrder.service; + +import com.ruoyi.hainanOrder.domain.HNCustomer; +import com.ruoyi.hainanOrder.domain.HNParams; +import com.ruoyi.hainanOrder.domain.HaiNanOrder; + +import java.util.List; + +/** + * @ClassName IOrderManageService + * @Description TODO + * @Author JIAL + * @Date 2024/5/21 11:17 + * @Version 1.0 + */ +public interface HaiNanOrderService { + + /** + * @title orderList + * @description 获取订单列表 + * @author JIAL + * @param: queryParams + * @updateTime 2024/5/21 15:49 + * @return: java.util.List + */ + List orderList(HNParams HNParams); + + /** + * @title customList + * @description 获取客户列表 + * @author JIAL + * @param: kunnr + * @param: name1 + * @updateTime 2024/6/3 15:33 + * @return: java.util.List> + */ + List customList(String kunnr, String name1); + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/hainanOrder/service/impl/HaiNanOrderServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/hainanOrder/service/impl/HaiNanOrderServiceImpl.java new file mode 100644 index 0000000..bc5c2fa --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/hainanOrder/service/impl/HaiNanOrderServiceImpl.java @@ -0,0 +1,38 @@ +package com.ruoyi.hainanOrder.service.impl; + +import com.ruoyi.common.annotation.DataSource; +import com.ruoyi.common.enums.DataSourceType; +import com.ruoyi.hainanOrder.domain.HNCustomer; +import com.ruoyi.hainanOrder.domain.HaiNanOrder; +import com.ruoyi.hainanOrder.domain.HNParams; +import com.ruoyi.hainanOrder.mapper.HaiNanOrderMapper; +import com.ruoyi.hainanOrder.service.HaiNanOrderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @ClassName OrderManageServiceImpl + * @Description TODO + * @Author JIAL + * @Date 2024/5/21 11:18 + * @Version 1.0 + */ +@Service +public class HaiNanOrderServiceImpl implements HaiNanOrderService { + @Autowired + HaiNanOrderMapper haiNanOrderMapper; + + @Override + @DataSource(DataSourceType.ORDER) + public List orderList(HNParams HNParams) { + return haiNanOrderMapper.orderList(HNParams); + } + + @Override + @DataSource(DataSourceType.ORDER) + public List customList(String kunnr, String name1) { + return haiNanOrderMapper.customList(kunnr, name1); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/hainanOrder/HaiNanOrderMapper.xml b/ruoyi-system/src/main/resources/mapper/hainanOrder/HaiNanOrderMapper.xml new file mode 100644 index 0000000..fd97257 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/hainanOrder/HaiNanOrderMapper.xml @@ -0,0 +1,172 @@ + + + + + + a.id AS "id", + a.create_by AS "createBy.id", + a.create_date AS "createDate", + a.update_by AS "updateBy.id", + a.update_date AS "updateDate", + a.remarks AS "remarks", + a.del_flag AS "delFlag", + a.delivery_date AS "deliveryDate", + a.receiving_address AS "receivingAddress", + a.order_type AS "orderType", + a.total_price AS "totalPrice", + a.state AS "state", + a.customer_name AS "customerName", + a.contract_number AS "contractNumber", + a.zvbeln as "zvbeln", + a.kunnr as "kunnr", + a.kna1 as "kna1", + a.auart as "auart", + a.bezei as "bezei", + a.vkorg as "vkorg", + a.vkorgt as "vkorgt", + a.vtweg as "vtweg", + a.vtwegt as "vtwegt", + a.spart as "spart", + a.spartt as "spartt", + a.vdatu as "vdatu", + a.prsdt as "prsdt", + a.bstkd as "bstkd", + a.bstdk as "bstdk", + a.kunnr1 as "kunnr1", + a.kunnrgwds as "kunnrgwds", + a.zsdshdz as "zsdshdz", + a.zsdjdbz as "zsdjdbz", + a.zsdycjz as "zsdycjz", + a.kh_order_0 as "khOrder", + a.xm_name_0 as "xmName", + a.xm_id_0 as "xmId", + a.zsdsfdz as "zsdsfdz", + + a.pzh as "pzh", + a.zsdywlxmb as "zsdywlxmb", + tuser2.name as "tjrname", + totalPrice2 as "totalPrice2", + totalPrice3 as "totalPrice3", + totalPrice4 as "totalPrice4", + a.ywydd as "ywydd", + a.ywytjsj as "ywytjsj", + a.orderid as "orderid", + a.randomOrderid as "randomOrderid", + a.sfdz as "sfdz", + s.sapname as "sapname", + + sb.sapname as "sapnamegwds", + shr as "shr", + shrscb as "shrscb", + shrgdz as "shrgdz", + shrdcz as "shrdcz", + shrbjyx as "shrbjyx", + a.isprint as "isprint", + a.isypkdd as "isypkdd", + a.erpId as "erpId", + a.returnreason as "returnreason", + a.hasHt as "hasHt", + a.istp as "istp", + + + a.isMobileCreate as "isMobileCreate", + a.isCreateByHt as "isCreateByHt", + s.pianqu as "pianqu" , + + + a.xsdq AS "xsdq", + a.province AS "province", + a.city AS "city", + a.village AS "village", + a.lxr AS "lxr", + a.lxrdh AS "lxrdh", + a.sfdcj AS "sfdcj", + a.sfxsywy AS "sfxsywy" + + + + + + LEFT JOIN sapuser s on s.sapid=a.kunnr1 + + LEFT JOIN sapuser sb on sb.sapid=a.kunnrgwds + LEFT JOIN sys_user tuser2 ON tuser2.id =a.create_by + + + + + + LEFT JOIN sapusertp s on s.sapid=a.kunnr1 + LEFT JOIN sapusertp sb on sb.sapid=a.kunnrgwds + LEFT JOIN sys_user tuser2 ON tuser2.id =a.create_by + + + + + + diff --git a/ruoyi-ui/src/api/hainanOrder/order.js b/ruoyi-ui/src/api/hainanOrder/order.js new file mode 100644 index 0000000..2bee4d1 --- /dev/null +++ b/ruoyi-ui/src/api/hainanOrder/order.js @@ -0,0 +1,28 @@ +import request from '@/utils/request' + +// 查询车间管理列表 +export function getOrderList(query) { + return request({ + url: '/orderManage_Hn/order/list', + method: 'post', + data: query + }) +} + +export function getMaterialList(query) { + return request({ + url: '/orderManage_Hn/order/materialList', + method: 'post', + data: query + }) +} + +export function getCustomList(query) { + return request({ + url: '/orderManage_Hn/order/customList', + method: 'post', + params: query + }) +} + + diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index 9962b8b..382d157 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -94,6 +94,20 @@ export const constantRoutes = [ meta: { title: '个人中心', icon: 'user' } } ] + }, + { + path: '/hainanOrder/index', + component: Layout, + hidden: true, + permissions: ['hainanOrder:operation:list'], + children: [ + { + path: '', + component: () => import('@/views/hainanOrder/operation/addOrder'), + name: 'HaiNaiOrder', + meta: { title: '海南订单新建', activeMenu: '/hainanOrder/operation' } + } + ] } ] diff --git a/ruoyi-ui/src/views/components/Tools/MaterialDialog/index.vue b/ruoyi-ui/src/views/components/Tools/MaterialDialog/index.vue new file mode 100644 index 0000000..ac88bd9 --- /dev/null +++ b/ruoyi-ui/src/views/components/Tools/MaterialDialog/index.vue @@ -0,0 +1,230 @@ + + + + + diff --git a/ruoyi-ui/src/views/hainanOrder/index.vue b/ruoyi-ui/src/views/hainanOrder/index.vue new file mode 100644 index 0000000..eda6b1d --- /dev/null +++ b/ruoyi-ui/src/views/hainanOrder/index.vue @@ -0,0 +1,280 @@ + + + diff --git a/ruoyi-ui/src/views/hainanOrder/operation/addOrder.vue b/ruoyi-ui/src/views/hainanOrder/operation/addOrder.vue new file mode 100644 index 0000000..450b3bc --- /dev/null +++ b/ruoyi-ui/src/views/hainanOrder/operation/addOrder.vue @@ -0,0 +1,531 @@ + + + + +