From 112a4c685a3dfa773d2631a5d5d48a46270cecc5 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期四, 24 七月 2025 17:07:20 +0800 Subject: [PATCH] 调拔单新增导入模板 --- /dev/null | 39 ------- rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/TransferController.java | 21 ++++ rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/excel/TransferTemplate.java | 181 ++++++++++++++++++++++++++++++++++++ 3 files changed, 202 insertions(+), 39 deletions(-) diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/TransferController.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/TransferController.java index 06600e0..cf5f8c2 100644 --- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/TransferController.java +++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/TransferController.java @@ -10,8 +10,11 @@ import com.vincent.rsf.server.common.domain.KeyValVo; import com.vincent.rsf.server.common.domain.PageParam; import com.vincent.rsf.server.manager.entity.Transfer; +import com.vincent.rsf.server.manager.entity.excel.CheckOrderTemplate; import com.vincent.rsf.server.manager.service.TransferService; import com.vincent.rsf.server.system.controller.BaseController; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; @@ -19,6 +22,7 @@ import javax.servlet.http.HttpServletResponse; import java.util.*; +@Api("璋冩嫈鍗�") @RestController public class TransferController extends BaseController { @@ -101,6 +105,23 @@ return R.ok().add(vos); } + /** + * @author Ryan + * @description 涓嬭浇妯℃澘 + * @param + * @return + * @time 2025/4/18 08:17 + */ + @PostMapping("/transfer/template/download") + @ApiOperation("涓嬭浇鐩樼偣鍗曟ā鏉�") + @PreAuthorize("hasAuthority('manager:transfer:update')") + public void downloadTemplate(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { + CheckOrderTemplate template = ExcelUtil.mockData(CheckOrderTemplate.class); + List<CheckOrderTemplate> list = Arrays.asList(template); + ExcelUtil.build(ExcelUtil.create(list, CheckOrderTemplate.class, true), response); + } + + @PreAuthorize("hasAuthority('manager:transfer:list')") @PostMapping("/transfer/export") public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/excel/TransferTemplate.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/excel/TransferTemplate.java new file mode 100644 index 0000000..6b7a013 --- /dev/null +++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/excel/TransferTemplate.java @@ -0,0 +1,181 @@ +package com.vincent.rsf.server.manager.entity.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.vincent.rsf.server.manager.entity.excel.annotation.ExcelComment; +import io.swagger.annotations.ApiModelProperty; + +public class TransferTemplate { + /** + * 缂栧彿 + */ + @Excel(name = "*ASN鍗曞彿") + @ApiModelProperty(value = "*ASN鍗曞彿") + @ExcelComment(value = "code", example = "ASN5945272236") + private String code; + + /** + * PO鍗曞彿 + */ + @Excel(name = "PO鍗曞彿") + @ApiModelProperty(value = "PO鍗曞彿") + @ExcelComment(value = "poCode", example = "PO59755695") + private String poCode; + +// /** +// * PO鍗曟嵁鏍囪瘑 +// */ +// @Excel(name = "PO鍗曟嵁鏍囪瘑") +// @ApiModelProperty(value= "PO鍗曟嵁鏍囪瘑") +// @ExcelComment(value = "poId", example = "123456698") +// private String poId; + + @Excel(name = "琛屽彿") + @ApiModelProperty("琛屽彿") + @ExcelComment(value = "platItemId", example = "1357564255478") + private String platItemId; + + @Excel(name = "瀹㈡埛璁㈠崟鍙�") + @ApiModelProperty("瀹㈡埛璁㈠崟鍙�") + @ExcelComment(value = "platOrderCode", example = "PT202564713301") + private String platOrderCode; + + @Excel(name = "宸ュ崟鍙�") + @ApiModelProperty("宸ュ崟鍙�") + @ExcelComment(value = "platWorkCode", example = "PWC2354894211") + private String platWorkCode; + + @Excel(name = "椤圭洰鍙�") + @ApiModelProperty("椤圭洰鍙�") + @ExcelComment(value = "projectCode", example = "PC2365845636001") + private String projectCode; + + /** + * 鍗曟嵁绫诲瀷 + */ + @Excel(name = "*鍗曟嵁绫诲瀷") + @ApiModelProperty(value = "*鍗曟嵁绫诲瀷") + @ExcelComment(value = "type", example = "鍏ュ簱鍗�") + private String type; + + /** + * 涓氬姟绫诲瀷 + */ + @Excel(name = "*涓氬姟绫诲瀷") + @ApiModelProperty(value = "*涓氬姟绫诲瀷") + @ExcelComment(value = "wkType", example = "閲囪喘鍏ュ簱鍗�") + private String wkType; + + +// @Excel(name = "鎵ц鐘舵��") +// @ApiModelProperty(value= "鎵ц鐘舵��") +// @ExcelComment(value = "exceStatus", example = "0") +// private String exceStatus; + + + @Excel(name = "*鐗╂枡缂栫爜") + @ApiModelProperty("*鐗╂枡缂栫爜") + @ExcelComment(value = "matnrCode", example = "102010101545") + private String matnrCode; + + + @Excel(name = "鐗╂枡鍚嶇О") + @ApiModelProperty("鐗╂枡鍚嶇О") + @ExcelComment(value = "maktx", example = "澶╃憺019-澶鍨嬫敮鏋�-55椋炴満杞粦鑹诧紝涓夎杞洊鍠锋紗閾惰壊 锛堝甫鏀讳笣閽夛級鍙�") + private String maktx; + + + // @Excel(name = "鐗╂枡瑙勬牸") +// @ApiModelProperty("鐗╂枡瑙勬牸") +// @ExcelComment(value = "maktx",example = "2*3*6") +// private String spec; +// +// +// @Excel(name = "鐗╂枡鍨嬪彿") +// @ApiModelProperty("鐗╂枡鍨嬪彿") +// @ExcelComment(value = "maktx",example = "abc") +// private String model; + @Excel(name = "渚涘簲鍟嗙紪鐮�") + @ApiModelProperty("渚涘簲鍟嗙紪鐮�") + @ExcelComment(value = "splrCode", example = "685947") + private String splrCode; + + @Excel(name = "渚涘簲鍟嗗悕绉�") + @ApiModelProperty("渚涘簲鍟嗗悕绉�") + @ExcelComment(value = "splrName", example = "娴欐睙涓壃绔嬪簱鎶�鏈湁闄愬叕鍙�") + private String splrName; + + +// @Excel(name = "搴撳瓨鍗曚綅") +// @ApiModelProperty("搴撳瓨鍗曚綅") +// @ExcelComment(value = "stockUnit", example = "涓�") +// private String stockUnit; + +// @Excel(name = "閲囪喘鏁伴噺") +// @ApiModelProperty("閲囪喘鏁伴噺") +// @ExcelComment(value = "purQty", example = "0") +// private String purQty; +// +// @Excel(name = "閲囪喘鍗曚綅") +// @ApiModelProperty("閲囪喘鍗曚綅") +// @ExcelComment(value = "purUnit", example = "涓�") +// private String purUnit; + +// @Excel(name = "宸插畬鎴愭暟閲�") +// @ApiModelProperty("宸插畬鎴愭暟閲�") +// @ExcelComment(value = "qty", example = "0") +// private String qty; + + + @Excel(name = "渚涘簲鍟嗘壒娆�") + @ApiModelProperty("渚涘簲鍟嗘壒娆�") + @ExcelComment(value = "splrBatch", example = "25251212") + private String splrBatch; + + @Excel(name = "*鏁伴噺") + @ApiModelProperty("*鏁伴噺") + @ExcelComment(value = "anfme", example = "75") + private String anfme; + + +// @Excel(name = "浜岀淮鐮�") +// @ApiModelProperty("浜岀淮鐮�") +// @ExcelComment(value = "qrcode",example = "") +// private String qrcode; + + // @Excel(name = "鏉″舰鐮�") +// @ApiModelProperty("鏉″舰鐮�") +// @ExcelComment(value = "barcode", example = "") +// private String barcode; +// +// @Excel(name = "璺熻釜鐮�") +// @ApiModelProperty("璺熻釜鐮�") +// @ExcelComment(value = "trackCode", example = "") +// private String trackCode; + @Excel(name = "鐗╂祦鍗曞彿") + @ApiModelProperty("鐗╂祦鍗曞彿") + @ExcelComment(value = "logicNo", example = "SF100064851") + private String logicNo; + + + @Excel(name = "璐ㄦ鐘舵��") + @ApiModelProperty("璐ㄦ鐘舵��") + @ExcelComment(value = "isptResult", example = "鍚堟牸") + private String isptResult; + + + @Excel(name = "棰勮閫佽揪鏃堕棿") + @ApiModelProperty("棰勮閫佽揪鏃堕棿") + @ExcelComment(value = "arrTime", example = "2025-05-21") + private String arrTime; + +// @Excel(name = "鍖呰鍚嶇О") +// @ApiModelProperty("鍖呰鍚嶇О") +// @ExcelComment(value = "packName", example = "绠�") +// private String packName; + + @Excel(name = "澶囨敞") + @ApiModelProperty("澶囨敞") + @ExcelComment(value = "memo", example = "娉細鏄撶鍝侊紝杞绘嬁鏀�") + private String memo; + +} diff --git a/rsf-server/src/main/java/transfer.sql b/rsf-server/src/main/java/transfer.sql deleted file mode 100644 index 7c640b1..0000000 --- a/rsf-server/src/main/java/transfer.sql +++ /dev/null @@ -1,33 +0,0 @@ --- save transfer record --- mysql -insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `tenant_id`, `status`) values ( 'menu.transfer', '0', '/manager/transfer', 'transfer', '0' , '0', '1' , '1'); - -insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Query 璋冩嫈鍗�', '', '1', 'manager:transfer:list', '0', '1', '1'); -insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Create 璋冩嫈鍗�', '', '1', 'manager:transfer:save', '1', '1', '1'); -insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Update 璋冩嫈鍗�', '', '1', 'manager:transfer:update', '2', '1', '1'); -insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Delete 璋冩嫈鍗�', '', '1', 'manager:transfer:remove', '3', '1', '1'); - --- locale menu name -transfer: 'Transfer', - --- locale field -transfer: { - code: "code", - type: "type", - source: "source", - exceStatus: "exceStatus", - orgWareId: "orgWareId", - orgWareName: "orgWareName", - tarWareId: "tarWareId", - tarWareName: "tarWareName", - orgAreaId: "orgAreaId", - orgAreaName: "orgAreaName", - tarAreaId: "tarAreaId", - tarAreaName: "tarAreaName", -}, - --- ResourceContent -import transfer from './transfer'; - -case 'transfer': - return transfer; diff --git a/rsf-server/src/main/java/transferItem.sql b/rsf-server/src/main/java/transferItem.sql deleted file mode 100644 index 5749b2e..0000000 --- a/rsf-server/src/main/java/transferItem.sql +++ /dev/null @@ -1,39 +0,0 @@ --- save transferItem record --- mysql -insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `tenant_id`, `status`) values ( 'menu.transferItem', '0', '/manager/transferItem', 'transferItem', '0' , '0', '1' , '1'); - -insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Query 璋冩嫈鍗曟槑缁�', '', '1', 'manager:transferItem:list', '0', '1', '1'); -insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Create 璋冩嫈鍗曟槑缁�', '', '1', 'manager:transferItem:save', '1', '1', '1'); -insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Update 璋冩嫈鍗曟槑缁�', '', '1', 'manager:transferItem:update', '2', '1', '1'); -insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Delete 璋冩嫈鍗曟槑缁�', '', '1', 'manager:transferItem:remove', '3', '1', '1'); - --- locale menu name -transferItem: 'TransferItem', - --- locale field -transferItem: { - transferId: "transferId", - transferCode: "transferCode", - matnrId: "matnrId", - maktx: "maktx", - matnrCode: "matnrCode", - unit: "unit", - anfme: "anfme", - qty: "qty", - workQty: "workQty", - batch: "batch", - splrId: "splrId", - spec: "spec", - model: "model", - fieldsIndex: "fieldsIndex", - platItemId: "platItemId", - platOrderCode: "platOrderCode", - platWorkCode: "platWorkCode", - projectCode: "projectCode", -}, - --- ResourceContent -import transferItem from './transferItem'; - -case 'transferItem': - return transferItem; -- Gitblit v1.9.1