144 changed files with 7438 additions and 857 deletions
@ -0,0 +1,21 @@ |
|||||
|
package com.win.module.system.api.dept.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class PostRespDTO { |
||||
|
|
||||
|
/** |
||||
|
* 岗位序号 |
||||
|
*/ |
||||
|
private Long id; |
||||
|
/** |
||||
|
* 岗位名称 |
||||
|
*/ |
||||
|
private String name; |
||||
|
/** |
||||
|
* 岗位编码 |
||||
|
*/ |
||||
|
private String code; |
||||
|
|
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package com.win.module.wms.controller.demandforecasting.vo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class DemandforecastingDetailVersionRespVO { |
||||
|
|
||||
|
/** |
||||
|
* 供应商代码 |
||||
|
*/ |
||||
|
private String supplerCodes; |
||||
|
/** |
||||
|
* 订单号 |
||||
|
*/ |
||||
|
private String poNumber; |
||||
|
/** |
||||
|
* 订单行 |
||||
|
*/ |
||||
|
private String poLine; |
||||
|
|
||||
|
/** |
||||
|
* 物料代码 |
||||
|
*/ |
||||
|
private String itemCode; |
||||
|
|
||||
|
/** |
||||
|
* 子表版本 |
||||
|
*/ |
||||
|
private String detailVersion; |
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
package com.win.module.wms.controller.demandforecasting.vo; |
||||
|
|
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
@Data |
||||
|
public class DemandforecastingExportVo2 { |
||||
|
private String supplierCode; |
||||
|
private String number; |
||||
|
///"物料代码")
|
||||
|
private String itemCode; |
||||
|
//"订单号")
|
||||
|
private String poNumber; |
||||
|
|
||||
|
//"订单行")
|
||||
|
private String poLine; |
||||
|
|
||||
|
//"到货日期"
|
||||
|
private LocalDateTime dueDate; |
||||
|
|
||||
|
//"计划数量")
|
||||
|
private BigDecimal planQty; |
||||
|
//版本号
|
||||
|
private String detailVersion; |
||||
|
|
||||
|
//预测类型()
|
||||
|
private String planType; |
||||
|
|
||||
|
} |
@ -0,0 +1,12 @@ |
|||||
|
package com.win.module.wms.controller.demandforecasting.vo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class DemandforecastingMainUserCodeReqVO { |
||||
|
|
||||
|
/** |
||||
|
* 角色列表 |
||||
|
*/ |
||||
|
private String roleCode; |
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
package com.win.module.wms.controller.demandforecasting.vo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class DemandforecastingPlanerRespVO { |
||||
|
|
||||
|
private Long planerId; |
||||
|
|
||||
|
private String planerUsername; |
||||
|
|
||||
|
private String planerNickname; |
||||
|
|
||||
|
} |
@ -0,0 +1,34 @@ |
|||||
|
package com.win.module.wms.controller.demandforecasting.vo; |
||||
|
|
||||
|
import com.win.framework.common.pojo.PageParam; |
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import lombok.ToString; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@ToString(callSuper = true) |
||||
|
public class DemandforecastingSupplierReqVO extends PageParam { |
||||
|
|
||||
|
/** |
||||
|
* 多条计划员 |
||||
|
*/ |
||||
|
private String planers; |
||||
|
|
||||
|
/** |
||||
|
* 供应商 |
||||
|
*/ |
||||
|
private String supplierCode; |
||||
|
|
||||
|
/** |
||||
|
* 计划员用户名查询 |
||||
|
*/ |
||||
|
private String userName; |
||||
|
|
||||
|
@Schema(description = "可访问的供应商代码") |
||||
|
private List<String> supplierCodeList; |
||||
|
|
||||
|
} |
@ -0,0 +1,29 @@ |
|||||
|
package com.win.module.wms.controller.demandforecasting.vo; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
@Data |
||||
|
public class DemandforecastingSupplierRespVO { |
||||
|
|
||||
|
@Schema(description = "用户ID") |
||||
|
private Long id; |
||||
|
|
||||
|
@Schema(description = "用户账号") |
||||
|
private String userName; |
||||
|
|
||||
|
@Schema(description = "用户昵称") |
||||
|
private String nickName; |
||||
|
|
||||
|
@Schema(description = "供应商代码") |
||||
|
private String supplierCode; |
||||
|
|
||||
|
@Schema(description = "供应商名称") |
||||
|
private String supplierName; |
||||
|
|
||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
||||
|
private LocalDateTime createTime; |
||||
|
|
||||
|
} |
@ -0,0 +1,150 @@ |
|||||
|
package com.win.module.wms.controller.purchasePlan.vo; |
||||
|
|
||||
|
import com.alibaba.excel.annotation.ExcelIgnore; |
||||
|
import com.alibaba.excel.annotation.ExcelProperty; |
||||
|
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
||||
|
import com.win.framework.excel.core.annotations.Colour; |
||||
|
import com.win.framework.excel.core.annotations.DictFormat; |
||||
|
import com.win.framework.excel.core.convert.DictConvert; |
||||
|
import lombok.Data; |
||||
|
import org.apache.poi.ss.usermodel.IndexedColors; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 要货计划导出的为二维表 |
||||
|
* |
||||
|
* @author 超级管理员 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PurchasePlanMainExcelVO2 { |
||||
|
|
||||
|
@ExcelProperty("供应商代码") |
||||
|
@Colour(IndexedColors.LIGHT_YELLOW) |
||||
|
private String supplierCode; |
||||
|
|
||||
|
|
||||
|
@ExcelProperty(value = "送达日期") |
||||
|
@Colour(IndexedColors.LIGHT_YELLOW) |
||||
|
@ColumnWidth(value = 16) |
||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) |
||||
|
private LocalDateTime deliveryDate; |
||||
|
|
||||
|
@ExcelProperty("物料代码") |
||||
|
private String itemCode; |
||||
|
|
||||
|
@ExcelProperty("计划数量") |
||||
|
private BigDecimal planQty; |
||||
|
|
||||
|
@ExcelProperty("已发货数量") |
||||
|
private BigDecimal shippedQty; |
||||
|
|
||||
|
@ExcelProperty("已收货数量") |
||||
|
private BigDecimal receivedQty; |
||||
|
|
||||
|
@ExcelProperty("在途数量") |
||||
|
private BigDecimal notReceiveQty; |
||||
|
|
||||
|
//子表
|
||||
|
@ExcelProperty("采购订单单号") |
||||
|
private String poNumber; |
||||
|
|
||||
|
@ExcelProperty("要货计划单号") |
||||
|
@Colour(IndexedColors.LIGHT_YELLOW) |
||||
|
private String number; |
||||
|
|
||||
|
@ExcelProperty("订单行") |
||||
|
private String poLine; |
||||
|
|
||||
|
@ExcelProperty("订单数量") |
||||
|
private BigDecimal orderQty; |
||||
|
|
||||
|
@ExcelProperty(value = "计量单位", converter = DictConvert.class) |
||||
|
@DictFormat("uom") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
||||
|
private String uom; |
||||
|
|
||||
|
@ExcelProperty(value = "状态", converter = DictConvert.class) |
||||
|
@DictFormat("purchase_plan_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
||||
|
@Colour(IndexedColors.LIGHT_YELLOW) |
||||
|
private String status; |
||||
|
|
||||
|
@ExcelProperty(value = "采购订单类型", converter = DictConvert.class) |
||||
|
@DictFormat("purchase_order_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
||||
|
@Colour(IndexedColors.LIGHT_YELLOW) |
||||
|
private String orderType; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
//("时间窗口")
|
||||
|
//@Colour(IndexedColors.LIGHT_YELLOW)
|
||||
|
private String timeWindow; |
||||
|
|
||||
|
@ExcelIgnore//("仓库代码")
|
||||
|
//@Colour(IndexedColors.LIGHT_YELLOW)
|
||||
|
private String warehouseCode; |
||||
|
|
||||
|
@ExcelIgnore//("月台代码")
|
||||
|
//@Colour(IndexedColors.LIGHT_YELLOW)
|
||||
|
private String dockCode; |
||||
|
|
||||
|
@ExcelIgnore//("业务类型")
|
||||
|
//@Colour(IndexedColors.LIGHT_YELLOW)
|
||||
|
private String businessType; |
||||
|
|
||||
|
|
||||
|
|
||||
|
@ExcelIgnore//("开始时间")
|
||||
|
// @Colour(IndexedColors.LIGHT_YELLOW)
|
||||
|
// @ColumnWidth(value = 16)
|
||||
|
private String beginTime; |
||||
|
|
||||
|
@ExcelIgnore//("结束时间")
|
||||
|
// @Colour(IndexedColors.LIGHT_YELLOW)
|
||||
|
// @ColumnWidth(value = 16)
|
||||
|
private String endTime; |
||||
|
|
||||
|
|
||||
|
|
||||
|
@ExcelIgnore |
||||
|
//(value = "是否可用", converter = DictConvert.class)
|
||||
|
// @DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
||||
|
// @Colour(IndexedColors.LIGHT_YELLOW)
|
||||
|
private String available; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
//("备注")
|
||||
|
//@Colour(IndexedColors.LIGHT_YELLOW)
|
||||
|
private String remark; |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
// @ExcelProperty(value = "是否可用", converter = DictConvert.class)
|
||||
|
// @DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
||||
|
// private String availableDetail;
|
||||
|
|
||||
|
@ExcelProperty("备注") |
||||
|
private String remarkDetail; |
||||
|
|
||||
|
@ExcelProperty("创建时间") |
||||
|
@ColumnWidth(value = 16) |
||||
|
private LocalDateTime createTimeDetail; |
||||
|
|
||||
|
@ExcelProperty("创建者用户名") |
||||
|
private String creatorDetail; |
||||
|
|
||||
|
@ExcelProperty("最后更新时间") |
||||
|
@ColumnWidth(value = 16) |
||||
|
private LocalDateTime updateTimeDetail; |
||||
|
|
||||
|
@ExcelProperty("最后更新者用户名") |
||||
|
private String updaterDetail; |
||||
|
|
||||
|
} |
@ -0,0 +1,25 @@ |
|||||
|
package com.win.module.wms.controller.purchasePlan.vo; |
||||
|
|
||||
|
import com.alibaba.excel.annotation.ExcelProperty; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import lombok.ToString; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 采购索赔申请子 Excel VO |
||||
|
* |
||||
|
* @author 超级管理员 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@ToString(callSuper = true) |
||||
|
public class PurchasePlanMainImportErrorVO2 extends PurchasePlanMainImportVO2 { |
||||
|
|
||||
|
@ExcelProperty(value = "导入状态", index = 0) |
||||
|
private String importStatus; |
||||
|
|
||||
|
@ExcelProperty(value = "导入说明", index = 1) |
||||
|
private String importRemark; |
||||
|
|
||||
|
} |
@ -0,0 +1,58 @@ |
|||||
|
package com.win.module.wms.controller.purchasePlan.vo; |
||||
|
|
||||
|
import cn.hutool.core.date.DateUtil; |
||||
|
import cn.hutool.core.util.StrUtil; |
||||
|
import com.alibaba.excel.annotation.ExcelProperty; |
||||
|
import com.alibaba.excel.util.DateUtils; |
||||
|
import com.win.framework.excel.core.annotations.Colour; |
||||
|
import com.win.framework.excel.core.annotations.DictFormat; |
||||
|
import com.win.framework.excel.core.annotations.ExcelValid; |
||||
|
import com.win.framework.excel.core.annotations.OnlyOne; |
||||
|
import com.win.framework.excel.core.convert.DictConvert; |
||||
|
import com.win.module.wms.enums.DictTypeConstants; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
import lombok.experimental.Accessors; |
||||
|
import org.apache.poi.ss.usermodel.IndexedColors; |
||||
|
|
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 采购索赔申请子 Excel VO |
||||
|
* |
||||
|
* @author 超级管理员 |
||||
|
*/ |
||||
|
@Data |
||||
|
@AllArgsConstructor |
||||
|
@NoArgsConstructor |
||||
|
@Accessors(chain = false) // 设置 chain = false,避免用户导入有问题
|
||||
|
public class PurchasePlanMainImportVO2 { |
||||
|
|
||||
|
//主表数据
|
||||
|
@ExcelProperty("供应商代码") |
||||
|
@Colour(IndexedColors.LIGHT_YELLOW) |
||||
|
@OnlyOne |
||||
|
private String supplierCode; |
||||
|
//主表数据
|
||||
|
@ExcelProperty("采购订单号") |
||||
|
@Colour(IndexedColors.LIGHT_YELLOW) |
||||
|
@OnlyOne |
||||
|
private String purchaseCode; |
||||
|
|
||||
|
@ExcelProperty("订单行") |
||||
|
@ExcelValid(message = "必填") |
||||
|
private String poLine; |
||||
|
|
||||
|
@ExcelProperty("物料") |
||||
|
@ExcelValid(message = "必填") |
||||
|
private String itemCode; |
||||
|
@ExcelProperty("版本") |
||||
|
private String versionCode; |
||||
|
@ExcelProperty(DateUtils.DATE_FORMAT_10) |
||||
|
@ExcelValid(message = "必填") |
||||
|
private String planQty; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,194 @@ |
|||||
|
package com.win.module.wms.controller.suppliercycle; |
||||
|
|
||||
|
import com.win.framework.common.pojo.CommonResult; |
||||
|
import com.win.framework.common.pojo.CustomConditions; |
||||
|
import com.win.framework.common.pojo.PageResult; |
||||
|
import com.win.framework.dict.core.util.DictFrameworkUtils; |
||||
|
import com.win.framework.excel.core.util.ExcelUtils; |
||||
|
import com.win.framework.operatelog.core.annotations.OperateLog; |
||||
|
import com.win.module.wms.controller.supplier.vo.SupplierImportErrorVO; |
||||
|
import com.win.module.wms.controller.suppliercycle.vo.*; |
||||
|
import com.win.module.wms.convert.suppliercycle.SupplierCycleConvert; |
||||
|
import com.win.module.wms.dal.dataobject.suppliercycle.SupplierCycleDO; |
||||
|
import com.win.module.wms.enums.DictTypeConstants; |
||||
|
import com.win.module.wms.service.suppliercycle.SupplierCycleService; |
||||
|
import io.swagger.v3.oas.annotations.Operation; |
||||
|
import io.swagger.v3.oas.annotations.Parameter; |
||||
|
import io.swagger.v3.oas.annotations.Parameters; |
||||
|
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
|
import org.springframework.security.access.prepost.PreAuthorize; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import javax.validation.Valid; |
||||
|
import java.io.IOException; |
||||
|
import java.time.LocalDateTime; |
||||
|
import java.time.ZoneOffset; |
||||
|
import java.util.Arrays; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
import static com.win.framework.common.pojo.CommonResult.success; |
||||
|
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; |
||||
|
|
||||
|
@Tag(name = "管理后台 - 要货预测周期") |
||||
|
@RestController |
||||
|
@RequestMapping("/wms/supplier-cycle") |
||||
|
@Validated |
||||
|
public class SupplierCycleController { |
||||
|
|
||||
|
@Resource |
||||
|
private SupplierCycleService supplierCycleService; |
||||
|
|
||||
|
@PostMapping("/create") |
||||
|
@Operation(summary = "创建要货预测周期") |
||||
|
@PreAuthorize("@ss.hasPermission('wms:supplier-cycle:create')") |
||||
|
public CommonResult<Long> createSupplierCycle(@Valid @RequestBody SupplierCycleCreateReqVO createReqVO) { |
||||
|
return success(supplierCycleService.createSupplierCycle(createReqVO)); |
||||
|
} |
||||
|
|
||||
|
@PutMapping("/update") |
||||
|
@Operation(summary = "更新要货预测周期") |
||||
|
@PreAuthorize("@ss.hasPermission('wms:supplier-cycle:update')") |
||||
|
public CommonResult<Boolean> updateSupplierCycle(@Valid @RequestBody SupplierCycleUpdateReqVO updateReqVO) { |
||||
|
int result = supplierCycleService.updateSupplierCycle(updateReqVO); |
||||
|
return success(result > 0); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping("/delete") |
||||
|
@Operation(summary = "删除要货预测周期") |
||||
|
@Parameter(name = "id", description = "编号", required = true) |
||||
|
@PreAuthorize("@ss.hasPermission('wms:supplier-cycle:delete')") |
||||
|
public CommonResult<Boolean> deleteSupplierCycle(@RequestParam("id") Long id) { |
||||
|
int result = supplierCycleService.deleteSupplierCycle(id); |
||||
|
return success(result > 0); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("/get") |
||||
|
@Operation(summary = "获得要货预测周期") |
||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
||||
|
@PreAuthorize("@ss.hasPermission('wms:supplier-cycle:query')") |
||||
|
public CommonResult<SupplierCycleRespVO> getSupplierCycle(@RequestParam("id") Long id) { |
||||
|
SupplierCycleDO supplierCycle = supplierCycleService.getSupplierCycle(id); |
||||
|
return success(SupplierCycleConvert.INSTANCE.convert(supplierCycle)); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("/page") |
||||
|
@Operation(summary = "获得要货预测周期分页") |
||||
|
@PreAuthorize("@ss.hasPermission('wms:supplier-cycle:query')") |
||||
|
public CommonResult<PageResult<SupplierCycleRespVO>> getSupplierCyclePage(@Valid SupplierCyclePageReqVO pageVO) { |
||||
|
PageResult<SupplierCycleDO> pageResult = supplierCycleService.getSupplierCyclePage(pageVO); |
||||
|
return success(SupplierCycleConvert.INSTANCE.convertPage(pageResult)); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("/senior") |
||||
|
@Operation(summary = "高级搜索获得检验任务主分页") |
||||
|
@PreAuthorize("@ss.hasPermission('wms:supplier-cycle:query')") |
||||
|
public CommonResult<PageResult<SupplierCycleRespVO>> getSupplierCycleSenior(@Valid @RequestBody CustomConditions conditions) { |
||||
|
PageResult<SupplierCycleDO> pageResult = supplierCycleService.getSupplierCycleSenior(conditions); |
||||
|
return success(SupplierCycleConvert.INSTANCE.convertPage(pageResult)); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("/export-excel") |
||||
|
@Operation(summary = "导出要货预测周期 Excel") |
||||
|
@PreAuthorize("@ss.hasPermission('wms:supplier-cycle:export')") |
||||
|
@OperateLog(type = EXPORT) |
||||
|
public void exportSupplierCycleExcel(@Valid SupplierCycleExportReqVO exportReqVO, HttpServletResponse response) throws IOException { |
||||
|
List<SupplierCycleDO> list = supplierCycleService.getSupplierCycleList(exportReqVO); |
||||
|
Map<Integer, String[]> mapDropDown = new HashMap<>(); |
||||
|
String[] true_false = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE); |
||||
|
mapDropDown.put(1, true_false); |
||||
|
mapDropDown.put(2, true_false); |
||||
|
mapDropDown.put(3, true_false); |
||||
|
mapDropDown.put(4, true_false); |
||||
|
mapDropDown.put(5, true_false); |
||||
|
mapDropDown.put(6, true_false); |
||||
|
mapDropDown.put(7, true_false); |
||||
|
mapDropDown.put(8, true_false); |
||||
|
for(SupplierCycleDO supplierCycleDO:list){ |
||||
|
if("1".equals(supplierCycleDO.getMonday())){ |
||||
|
supplierCycleDO.setMonday("TRUE"); |
||||
|
}else { |
||||
|
supplierCycleDO.setMonday("FALSE"); |
||||
|
} |
||||
|
if("1".equals(supplierCycleDO.getTuesday())){ |
||||
|
supplierCycleDO.setTuesday("TRUE"); |
||||
|
}else { |
||||
|
supplierCycleDO.setTuesday("FALSE"); |
||||
|
} |
||||
|
if("1".equals(supplierCycleDO.getWednesday())){ |
||||
|
supplierCycleDO.setWednesday("TRUE"); |
||||
|
}else { |
||||
|
supplierCycleDO.setWednesday("FALSE"); |
||||
|
} |
||||
|
if("1".equals(supplierCycleDO.getThursday())){ |
||||
|
supplierCycleDO.setThursday("TRUE"); |
||||
|
}else { |
||||
|
supplierCycleDO.setThursday("FALSE"); |
||||
|
} |
||||
|
if("1".equals(supplierCycleDO.getFriday())){ |
||||
|
supplierCycleDO.setFriday("TRUE"); |
||||
|
}else { |
||||
|
supplierCycleDO.setFriday("FALSE"); |
||||
|
} |
||||
|
if("1".equals(supplierCycleDO.getSaturday())){ |
||||
|
supplierCycleDO.setSaturday("TRUE"); |
||||
|
}else { |
||||
|
supplierCycleDO.setSaturday("FALSE"); |
||||
|
} |
||||
|
if("1".equals(supplierCycleDO.getSunday())){ |
||||
|
supplierCycleDO.setSunday("TRUE"); |
||||
|
}else { |
||||
|
supplierCycleDO.setSunday("FALSE"); |
||||
|
} |
||||
|
} |
||||
|
// 导出 Excel
|
||||
|
List<SupplierCycleExcelVO> datas = SupplierCycleConvert.INSTANCE.convertList02(list); |
||||
|
ExcelUtils.write(response, "要货预测周期.xls", "数据", SupplierCycleExcelVO.class, datas,mapDropDown); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("/get-import-template") |
||||
|
@Operation(summary = "获得导入要货预测周期模板") |
||||
|
public void importTemplate(HttpServletResponse response) throws IOException { |
||||
|
List<SupplierCycleImportExcelVO> list = Arrays.asList(); |
||||
|
Map<Integer, String[]> mapDropDown = new HashMap<>(); |
||||
|
String[] true_false = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE); |
||||
|
mapDropDown.put(1, true_false); |
||||
|
mapDropDown.put(2, true_false); |
||||
|
mapDropDown.put(3, true_false); |
||||
|
mapDropDown.put(4, true_false); |
||||
|
mapDropDown.put(5, true_false); |
||||
|
mapDropDown.put(6, true_false); |
||||
|
mapDropDown.put(7, true_false); |
||||
|
mapDropDown.put(8, true_false); |
||||
|
// 输出
|
||||
|
ExcelUtils.write(response, "要货预测周期导入模板.xls", "要货预测周期列表", SupplierCycleImportExcelVO.class, list,mapDropDown); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("/import") |
||||
|
@Operation(summary = "导入要货预测周期基本信息") |
||||
|
@Parameters({ |
||||
|
@Parameter(name = "file", description = "Excel 文件", required = true), |
||||
|
@Parameter(name = "mode", description = "导入模式1更新2追加3覆盖", example = "1"), |
||||
|
@Parameter(name = "updatePart", description = "部分更新,默认为 true", example = "true") |
||||
|
}) |
||||
|
@PreAuthorize("@ss.hasPermission('wms:supplier-cycle:import')") |
||||
|
public CommonResult<Map<String, Object>> importExcel(HttpServletResponse response, |
||||
|
@RequestParam("file") MultipartFile file, |
||||
|
@RequestParam(value = "mode") Integer mode, |
||||
|
@RequestParam(value = "updatePart", required = false, defaultValue = "false") Boolean updatePart) throws Exception { |
||||
|
List<SupplierCycleImportExcelVO> list = ExcelUtils.read(file, SupplierCycleImportExcelVO.class); |
||||
|
List<SupplierImportErrorVO> errorList = supplierCycleService.importSupplierCycleList(list, mode, updatePart); |
||||
|
Map<String, Object> returnMap = new HashMap<>(); |
||||
|
returnMap.put("errorCount", errorList.size()); |
||||
|
if(!errorList.isEmpty()) { |
||||
|
String url = ExcelUtils.writeLocalFile("要货预测周期基本信息导入错误数据" + LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")) + ".xlsx", "错误列表", errorList); |
||||
|
returnMap.put("errorFile", url); |
||||
|
} |
||||
|
return success(returnMap); |
||||
|
} |
||||
|
} |
@ -0,0 +1,77 @@ |
|||||
|
package com.win.module.wms.controller.suppliercycle.vo; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Data; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
||||
|
|
||||
|
/** |
||||
|
* 要货预测周期 Base VO,提供给添加、修改、详细的子 VO 使用 |
||||
|
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SupplierCycleBaseVO { |
||||
|
|
||||
|
@Schema(description = "供应商代码") |
||||
|
private String supplierCode; |
||||
|
|
||||
|
@Schema(description = "星期一") |
||||
|
private String monday; |
||||
|
|
||||
|
@Schema(description = "星期二") |
||||
|
private String tuesday; |
||||
|
|
||||
|
@Schema(description = "星期三") |
||||
|
private String wednesday; |
||||
|
|
||||
|
@Schema(description = "星期四") |
||||
|
private String thursday; |
||||
|
|
||||
|
@Schema(description = "星期五") |
||||
|
private String friday; |
||||
|
|
||||
|
@Schema(description = "星期六") |
||||
|
private String saturday; |
||||
|
|
||||
|
@Schema(description = "星期日") |
||||
|
private String sunday; |
||||
|
|
||||
|
@Schema(description = "版本号") |
||||
|
private String version; |
||||
|
|
||||
|
@Schema(description = "备注", example = "随便") |
||||
|
private String remark; |
||||
|
|
||||
|
@Schema(description = "扩展属性") |
||||
|
private String extraProperties; |
||||
|
|
||||
|
@Schema(description = "地点ID", example = "6054") |
||||
|
private String siteId; |
||||
|
|
||||
|
@Schema(description = "开始时间") |
||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
|
private LocalDateTime beginTime; |
||||
|
|
||||
|
@Schema(description = "结束时间") |
||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
|
private LocalDateTime endTime; |
||||
|
|
||||
|
@Schema(description = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) |
||||
|
private String available; |
||||
|
|
||||
|
@Schema(description = "状态", example = "2") |
||||
|
private String status; |
||||
|
|
||||
|
@Schema(description = "并发乐观锁") |
||||
|
private String concurrencyStamp; |
||||
|
|
||||
|
@Schema(description = "权限所属人员id", example = "21859") |
||||
|
private Long ruleUserId; |
||||
|
|
||||
|
@Schema(description = "部门", requiredMode = Schema.RequiredMode.REQUIRED) |
||||
|
private String departmentCode; |
||||
|
|
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
package com.win.module.wms.controller.suppliercycle.vo; |
||||
|
|
||||
|
import lombok.*; |
||||
|
import java.util.*; |
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import javax.validation.constraints.*; |
||||
|
|
||||
|
@Schema(description = "管理后台 - 要货预测周期创建 Request VO") |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@ToString(callSuper = true) |
||||
|
public class SupplierCycleCreateReqVO extends SupplierCycleBaseVO { |
||||
|
|
||||
|
} |
@ -0,0 +1,62 @@ |
|||||
|
package com.win.module.wms.controller.suppliercycle.vo; |
||||
|
|
||||
|
import com.alibaba.excel.annotation.ExcelProperty; |
||||
|
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
||||
|
import com.win.framework.excel.core.annotations.DictFormat; |
||||
|
import com.win.framework.excel.core.convert.DictConvert; |
||||
|
import com.win.module.wms.enums.DictTypeConstants; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* 要货预测周期 Excel VO |
||||
|
* |
||||
|
* @author 超级管理员 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SupplierCycleExcelVO { |
||||
|
|
||||
|
@ExcelProperty("供应商代码") |
||||
|
@ColumnWidth(18) |
||||
|
private String supplierCode; |
||||
|
|
||||
|
@ExcelProperty(value = "星期一", converter = DictConvert.class) |
||||
|
@DictFormat(DictTypeConstants.TRUE_FALSE) |
||||
|
@ColumnWidth(18) |
||||
|
private String monday; |
||||
|
|
||||
|
@ExcelProperty(value = "星期二", converter = DictConvert.class) |
||||
|
@DictFormat(DictTypeConstants.TRUE_FALSE) |
||||
|
@ColumnWidth(18) |
||||
|
private String tuesday; |
||||
|
|
||||
|
@ExcelProperty(value = "星期三", converter = DictConvert.class) |
||||
|
@DictFormat(DictTypeConstants.TRUE_FALSE) |
||||
|
@ColumnWidth(18) |
||||
|
private String wednesday; |
||||
|
|
||||
|
@ExcelProperty(value = "星期四", converter = DictConvert.class) |
||||
|
@DictFormat(DictTypeConstants.TRUE_FALSE) |
||||
|
@ColumnWidth(18) |
||||
|
private String thursday; |
||||
|
|
||||
|
@ExcelProperty(value = "星期五", converter = DictConvert.class) |
||||
|
@DictFormat(DictTypeConstants.TRUE_FALSE) |
||||
|
@ColumnWidth(18) |
||||
|
private String friday; |
||||
|
|
||||
|
@ExcelProperty(value = "星期六", converter = DictConvert.class) |
||||
|
@DictFormat(DictTypeConstants.TRUE_FALSE) |
||||
|
@ColumnWidth(18) |
||||
|
private String saturday; |
||||
|
|
||||
|
@ExcelProperty(value = "星期日", converter = DictConvert.class) |
||||
|
@DictFormat(DictTypeConstants.TRUE_FALSE) |
||||
|
@ColumnWidth(18) |
||||
|
private String sunday; |
||||
|
|
||||
|
@ExcelProperty(value = "是否可用", converter = DictConvert.class) |
||||
|
@DictFormat(DictTypeConstants.TRUE_FALSE) |
||||
|
@ColumnWidth(18) |
||||
|
private String available; |
||||
|
|
||||
|
} |
@ -0,0 +1,79 @@ |
|||||
|
package com.win.module.wms.controller.suppliercycle.vo; |
||||
|
|
||||
|
import lombok.*; |
||||
|
import java.util.*; |
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import com.win.framework.common.pojo.PageParam; |
||||
|
import java.time.LocalDateTime; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
||||
|
|
||||
|
@Schema(description = "管理后台 - 要货预测周期 Excel 导出 Request VO,参数和 SupplierCyclePageReqVO 是一致的") |
||||
|
@Data |
||||
|
public class SupplierCycleExportReqVO { |
||||
|
|
||||
|
@Schema(description = "供应商代码") |
||||
|
private String supplierCode; |
||||
|
|
||||
|
@Schema(description = "星期一") |
||||
|
private String monday; |
||||
|
|
||||
|
@Schema(description = "星期二") |
||||
|
private String tuesday; |
||||
|
|
||||
|
@Schema(description = "星期三") |
||||
|
private String wednesday; |
||||
|
|
||||
|
@Schema(description = "星期四") |
||||
|
private String thursday; |
||||
|
|
||||
|
@Schema(description = "星期五") |
||||
|
private String friday; |
||||
|
|
||||
|
@Schema(description = "星期六") |
||||
|
private String saturday; |
||||
|
|
||||
|
@Schema(description = "星期日") |
||||
|
private String sunday; |
||||
|
|
||||
|
@Schema(description = "版本号") |
||||
|
private String version; |
||||
|
|
||||
|
@Schema(description = "备注", example = "随便") |
||||
|
private String remark; |
||||
|
|
||||
|
@Schema(description = "创建时间") |
||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
|
private LocalDateTime[] createTime; |
||||
|
|
||||
|
@Schema(description = "扩展属性") |
||||
|
private String extraProperties; |
||||
|
|
||||
|
@Schema(description = "地点ID", example = "6054") |
||||
|
private String siteId; |
||||
|
|
||||
|
@Schema(description = "开始时间") |
||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
|
private LocalDateTime[] beginTime; |
||||
|
|
||||
|
@Schema(description = "结束时间") |
||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
|
private LocalDateTime[] endTime; |
||||
|
|
||||
|
@Schema(description = "是否可用") |
||||
|
private String available; |
||||
|
|
||||
|
@Schema(description = "状态", example = "2") |
||||
|
private String status; |
||||
|
|
||||
|
@Schema(description = "并发乐观锁") |
||||
|
private String concurrencyStamp; |
||||
|
|
||||
|
@Schema(description = "权限所属人员id", example = "21859") |
||||
|
private Long ruleUserId; |
||||
|
|
||||
|
@Schema(description = "部门") |
||||
|
private String departmentCode; |
||||
|
|
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.win.module.wms.controller.suppliercycle.vo; |
||||
|
|
||||
|
import com.alibaba.excel.annotation.ExcelProperty; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import lombok.ToString; |
||||
|
|
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@ToString(callSuper = true) |
||||
|
public class SupplierCycleImportExcelErrorVO extends SupplierCycleImportExcelVO{ |
||||
|
|
||||
|
@ExcelProperty(value = "导入状态", index = 0) |
||||
|
private String importStatus; |
||||
|
|
||||
|
@ExcelProperty(value = "导入说明", index = 1) |
||||
|
private String importRemark; |
||||
|
} |
@ -0,0 +1,65 @@ |
|||||
|
package com.win.module.wms.controller.suppliercycle.vo; |
||||
|
|
||||
|
import com.alibaba.excel.annotation.ExcelProperty; |
||||
|
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
||||
|
import com.win.framework.excel.core.annotations.DictFormat; |
||||
|
import com.win.framework.excel.core.annotations.ExcelValid; |
||||
|
import com.win.framework.excel.core.convert.DictConvert; |
||||
|
import com.win.module.wms.enums.DictTypeConstants; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
import lombok.experimental.Accessors; |
||||
|
|
||||
|
@Data |
||||
|
@AllArgsConstructor |
||||
|
@NoArgsConstructor |
||||
|
@Accessors(chain = false) // 设置 chain = false,避免用户导入有问题
|
||||
|
public class SupplierCycleImportExcelVO { |
||||
|
|
||||
|
@ExcelProperty("供应商代码") |
||||
|
@ExcelValid(message = "供应商代码必填") |
||||
|
@ColumnWidth(18) |
||||
|
private String supplierCode; |
||||
|
|
||||
|
@ExcelProperty(value = "星期一", converter = DictConvert.class) |
||||
|
@DictFormat(DictTypeConstants.TRUE_FALSE) |
||||
|
@ColumnWidth(18) |
||||
|
private String monday; |
||||
|
|
||||
|
@ExcelProperty(value = "星期二", converter = DictConvert.class) |
||||
|
@DictFormat(DictTypeConstants.TRUE_FALSE) |
||||
|
@ColumnWidth(18) |
||||
|
private String tuesday; |
||||
|
|
||||
|
@ExcelProperty(value = "星期三", converter = DictConvert.class) |
||||
|
@DictFormat(DictTypeConstants.TRUE_FALSE) |
||||
|
@ColumnWidth(18) |
||||
|
private String wednesday; |
||||
|
|
||||
|
@ExcelProperty(value = "星期四", converter = DictConvert.class) |
||||
|
@DictFormat(DictTypeConstants.TRUE_FALSE) |
||||
|
@ColumnWidth(18) |
||||
|
private String thursday; |
||||
|
|
||||
|
@ExcelProperty(value = "星期五",converter = DictConvert.class) |
||||
|
@DictFormat(DictTypeConstants.TRUE_FALSE) |
||||
|
@ColumnWidth(18) |
||||
|
private String friday; |
||||
|
|
||||
|
@ExcelProperty(value = "星期六",converter = DictConvert.class) |
||||
|
@DictFormat(DictTypeConstants.TRUE_FALSE) |
||||
|
@ColumnWidth(18) |
||||
|
private String saturday; |
||||
|
|
||||
|
@ExcelProperty(value = "星期日",converter = DictConvert.class) |
||||
|
@DictFormat(DictTypeConstants.TRUE_FALSE) |
||||
|
@ColumnWidth(18) |
||||
|
private String sunday; |
||||
|
|
||||
|
@ExcelProperty(value = "是否可用",converter = DictConvert.class) |
||||
|
@DictFormat(DictTypeConstants.TRUE_FALSE) |
||||
|
@ColumnWidth(18) |
||||
|
@ExcelValid(message = "是否可用必填") |
||||
|
private String available; |
||||
|
} |
@ -0,0 +1,81 @@ |
|||||
|
package com.win.module.wms.controller.suppliercycle.vo; |
||||
|
|
||||
|
import lombok.*; |
||||
|
import java.util.*; |
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import com.win.framework.common.pojo.PageParam; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
||||
|
|
||||
|
@Schema(description = "管理后台 - 要货预测周期分页 Request VO") |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@ToString(callSuper = true) |
||||
|
public class SupplierCyclePageReqVO extends PageParam { |
||||
|
|
||||
|
@Schema(description = "供应商代码") |
||||
|
private String supplierCode; |
||||
|
|
||||
|
@Schema(description = "星期一") |
||||
|
private String monday; |
||||
|
|
||||
|
@Schema(description = "星期二") |
||||
|
private String tuesday; |
||||
|
|
||||
|
@Schema(description = "星期三") |
||||
|
private String wednesday; |
||||
|
|
||||
|
@Schema(description = "星期四") |
||||
|
private String thursday; |
||||
|
|
||||
|
@Schema(description = "星期五") |
||||
|
private String friday; |
||||
|
|
||||
|
@Schema(description = "星期六") |
||||
|
private String saturday; |
||||
|
|
||||
|
@Schema(description = "星期日") |
||||
|
private String sunday; |
||||
|
|
||||
|
@Schema(description = "版本号") |
||||
|
private String version; |
||||
|
|
||||
|
@Schema(description = "备注", example = "随便") |
||||
|
private String remark; |
||||
|
|
||||
|
@Schema(description = "创建时间") |
||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
|
private LocalDateTime[] createTime; |
||||
|
|
||||
|
@Schema(description = "扩展属性") |
||||
|
private String extraProperties; |
||||
|
|
||||
|
@Schema(description = "地点ID", example = "6054") |
||||
|
private String siteId; |
||||
|
|
||||
|
@Schema(description = "开始时间") |
||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
|
private LocalDateTime[] beginTime; |
||||
|
|
||||
|
@Schema(description = "结束时间") |
||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
|
private LocalDateTime[] endTime; |
||||
|
|
||||
|
@Schema(description = "是否可用") |
||||
|
private String available; |
||||
|
|
||||
|
@Schema(description = "状态", example = "2") |
||||
|
private String status; |
||||
|
|
||||
|
@Schema(description = "并发乐观锁") |
||||
|
private String concurrencyStamp; |
||||
|
|
||||
|
@Schema(description = "权限所属人员id", example = "21859") |
||||
|
private Long ruleUserId; |
||||
|
|
||||
|
@Schema(description = "部门") |
||||
|
private String departmentCode; |
||||
|
|
||||
|
} |
@ -0,0 +1,19 @@ |
|||||
|
package com.win.module.wms.controller.suppliercycle.vo; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.*; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
@Schema(description = "管理后台 - 要货预测周期 Response VO") |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@ToString(callSuper = true) |
||||
|
public class SupplierCycleRespVO extends SupplierCycleBaseVO { |
||||
|
|
||||
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3607") |
||||
|
private Long id; |
||||
|
|
||||
|
@Schema(description = "创建时间") |
||||
|
private LocalDateTime createTime; |
||||
|
|
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.win.module.wms.controller.suppliercycle.vo; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.*; |
||||
|
import java.util.*; |
||||
|
import javax.validation.constraints.*; |
||||
|
|
||||
|
@Schema(description = "管理后台 - 要货预测周期更新 Request VO") |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@ToString(callSuper = true) |
||||
|
public class SupplierCycleUpdateReqVO extends SupplierCycleBaseVO { |
||||
|
|
||||
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3607") |
||||
|
@NotNull(message = "id不能为空") |
||||
|
private Long id; |
||||
|
|
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
package com.win.module.wms.controller.supplierdeliverRequest.vo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
@Data |
||||
|
public class SupplierdeliverRequestDetailPackageRespVO { |
||||
|
|
||||
|
/** |
||||
|
* 包装规格 |
||||
|
*/ |
||||
|
private String packUnit; |
||||
|
|
||||
|
/** |
||||
|
* 包装数量 |
||||
|
*/ |
||||
|
private BigDecimal packQty; |
||||
|
|
||||
|
/** |
||||
|
* 包装名称 |
||||
|
*/ |
||||
|
private String packName; |
||||
|
} |
@ -0,0 +1,112 @@ |
|||||
|
package com.win.module.wms.controller.supplierdeliverRequest.vo; |
||||
|
|
||||
|
|
||||
|
import cn.hutool.core.date.DatePattern; |
||||
|
import cn.hutool.core.date.LocalDateTimeUtil; |
||||
|
import cn.hutool.core.util.StrUtil; |
||||
|
import com.alibaba.excel.annotation.ExcelIgnore; |
||||
|
import com.alibaba.excel.annotation.ExcelProperty; |
||||
|
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
||||
|
import com.win.framework.excel.core.annotations.Colour; |
||||
|
import com.win.framework.excel.core.annotations.DictFormat; |
||||
|
import com.win.framework.excel.core.annotations.ExcelValid; |
||||
|
import com.win.framework.excel.core.annotations.OnlyOne; |
||||
|
import com.win.framework.excel.core.convert.DictConvert; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
import lombok.experimental.Accessors; |
||||
|
import org.apache.poi.ss.usermodel.IndexedColors; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.time.LocalDate; |
||||
|
import java.time.LocalDateTime; |
||||
|
import java.time.LocalTime; |
||||
|
import java.util.Optional; |
||||
|
|
||||
|
/** |
||||
|
* 采购索赔申请子 Excel VO |
||||
|
* |
||||
|
* @author 超级管理员 |
||||
|
*/ |
||||
|
@Data |
||||
|
@AllArgsConstructor |
||||
|
@NoArgsConstructor |
||||
|
@Accessors(chain = false) // 设置 chain = false,避免用户导入有问题
|
||||
|
public class SupplierdeliverRequestMainImportVO2 { |
||||
|
|
||||
|
|
||||
|
@OnlyOne |
||||
|
@ExcelProperty(value = "要货计划单号") |
||||
|
@Colour(IndexedColors.LIGHT_YELLOW) |
||||
|
@ExcelValid(message = "要货计划单号必填") |
||||
|
private String ppNumber; |
||||
|
|
||||
|
@ExcelProperty("物料代码") |
||||
|
@ExcelValid(message = "必填") |
||||
|
private String itemCode; |
||||
|
|
||||
|
@ExcelProperty("申请发货数量") |
||||
|
@ExcelValid(message = "必填") |
||||
|
private BigDecimal qty; |
||||
|
@ExcelProperty("生产日期") |
||||
|
@ColumnWidth(value = 16) |
||||
|
@ExcelValid(message = "必填") |
||||
|
private LocalDateTime produceDate; |
||||
|
|
||||
|
@ExcelProperty("供应商批次") |
||||
|
@ExcelValid(message = "必填") |
||||
|
private String supplierBatch; |
||||
|
@OnlyOne |
||||
|
@ExcelProperty("计划到货日期") |
||||
|
@Colour(IndexedColors.LIGHT_YELLOW) |
||||
|
@ExcelValid(message = "计划到货日期必填") |
||||
|
@ColumnWidth(value = 16) |
||||
|
private String planArriveDate; |
||||
|
@OnlyOne |
||||
|
@ExcelProperty("计划到货时间") |
||||
|
@Colour(IndexedColors.LIGHT_YELLOW) |
||||
|
@ColumnWidth(value = 16) |
||||
|
private String planArriveTimeUnit; |
||||
|
|
||||
|
@OnlyOne |
||||
|
@ExcelProperty("计划到货时间") |
||||
|
@Colour(IndexedColors.LIGHT_YELLOW) |
||||
|
@ColumnWidth(value = 16) |
||||
|
private LocalDateTime planArriveTime; |
||||
|
|
||||
|
@OnlyOne |
||||
|
@ExcelProperty("联系人姓名") |
||||
|
@Colour(IndexedColors.LIGHT_YELLOW) |
||||
|
private String contactName; |
||||
|
@OnlyOne |
||||
|
@ExcelProperty("联系人电话") |
||||
|
@Colour(IndexedColors.LIGHT_YELLOW) |
||||
|
private String contactPhone; |
||||
|
@OnlyOne |
||||
|
@ExcelProperty("承运商") |
||||
|
@Colour(IndexedColors.LIGHT_YELLOW) |
||||
|
private String carrierCode; |
||||
|
@OnlyOne |
||||
|
@ExcelProperty(value = "运输方式", converter = DictConvert.class) |
||||
|
@DictFormat("transfer_mode") |
||||
|
@Colour(IndexedColors.LIGHT_YELLOW) |
||||
|
private String transferMode; |
||||
|
@OnlyOne |
||||
|
@ExcelProperty("车牌号") |
||||
|
@Colour(IndexedColors.LIGHT_YELLOW) |
||||
|
private String vehiclePlateNumber; |
||||
|
|
||||
|
@OnlyOne |
||||
|
@ExcelProperty("备注") |
||||
|
@Colour(IndexedColors.LIGHT_YELLOW) |
||||
|
private String remark; |
||||
|
@ExcelIgnore |
||||
|
//供应商代码
|
||||
|
private String supplierCode; |
||||
|
public void setPlanArriveTime(){ |
||||
|
String time = Optional.ofNullable(this.getPlanArriveTimeUnit()).orElse("08:00:00"); |
||||
|
if( StrUtil.isEmptyIfStr(time)){time="08:00:00";} |
||||
|
this.planArriveTime= LocalDateTimeUtil.parse(this.getPlanArriveDate()+" "+time, DatePattern.NORM_DATETIME_PATTERN); |
||||
|
} |
||||
|
} |
@ -0,0 +1,36 @@ |
|||||
|
package com.win.module.wms.controller.supplierdeliverRequest.vo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Data |
||||
|
public class SupplierdeliverRequestPackageTReqVO { |
||||
|
|
||||
|
/** |
||||
|
* 托行号 |
||||
|
*/ |
||||
|
private Integer tPoNumber; |
||||
|
|
||||
|
/** |
||||
|
* 箱个数 |
||||
|
*/ |
||||
|
private Integer xNumber; |
||||
|
|
||||
|
/** |
||||
|
* 数量 |
||||
|
*/ |
||||
|
private BigDecimal qtyOne; |
||||
|
|
||||
|
/** |
||||
|
* 是否有托 |
||||
|
*/ |
||||
|
private String isTuo; |
||||
|
|
||||
|
/** |
||||
|
* 箱数量 |
||||
|
*/ |
||||
|
private List<SupplierdeliverRequestPackageXReqVO> children; |
||||
|
|
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.win.module.wms.controller.supplierdeliverRequest.vo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
@Data |
||||
|
public class SupplierdeliverRequestPackageXReqVO { |
||||
|
|
||||
|
/** |
||||
|
* 箱行号 |
||||
|
*/ |
||||
|
private String xPoNumber; |
||||
|
|
||||
|
/** |
||||
|
* 箱数量 |
||||
|
*/ |
||||
|
private BigDecimal qtyTwo; |
||||
|
|
||||
|
} |
@ -0,0 +1,34 @@ |
|||||
|
package com.win.module.wms.convert.suppliercycle; |
||||
|
|
||||
|
import com.win.framework.common.pojo.PageResult; |
||||
|
import com.win.module.wms.controller.suppliercycle.vo.*; |
||||
|
import com.win.module.wms.dal.dataobject.suppliercycle.SupplierCycleDO; |
||||
|
import org.mapstruct.Mapper; |
||||
|
import org.mapstruct.factory.Mappers; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 要货预测周期 Convert |
||||
|
* |
||||
|
* @author 超级管理员 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface SupplierCycleConvert { |
||||
|
|
||||
|
SupplierCycleConvert INSTANCE = Mappers.getMapper(SupplierCycleConvert.class); |
||||
|
|
||||
|
SupplierCycleDO convert(SupplierCycleCreateReqVO bean); |
||||
|
|
||||
|
SupplierCycleDO convert(SupplierCycleUpdateReqVO bean); |
||||
|
|
||||
|
SupplierCycleRespVO convert(SupplierCycleDO bean); |
||||
|
|
||||
|
List<SupplierCycleRespVO> convertList(List<SupplierCycleDO> list); |
||||
|
|
||||
|
PageResult<SupplierCycleRespVO> convertPage(PageResult<SupplierCycleDO> page); |
||||
|
|
||||
|
List<SupplierCycleExcelVO> convertList02(List<SupplierCycleDO> list); |
||||
|
|
||||
|
SupplierCycleDO convertImport(SupplierCycleImportExcelVO item); |
||||
|
} |
@ -0,0 +1,108 @@ |
|||||
|
package com.win.module.wms.dal.dataobject.suppliercycle; |
||||
|
|
||||
|
import lombok.*; |
||||
|
import java.util.*; |
||||
|
import java.time.LocalDateTime; |
||||
|
import java.time.LocalDateTime; |
||||
|
import java.time.LocalDateTime; |
||||
|
import java.time.LocalDateTime; |
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import com.win.framework.mybatis.core.dataobject.BaseDO; |
||||
|
|
||||
|
/** |
||||
|
* 要货预测周期 DO |
||||
|
* |
||||
|
* @author 超级管理员 |
||||
|
*/ |
||||
|
@TableName("basic_supplier_cycle") |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@ToString(callSuper = true) |
||||
|
@Builder |
||||
|
@NoArgsConstructor |
||||
|
@AllArgsConstructor |
||||
|
public class SupplierCycleDO extends BaseDO { |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
@TableId |
||||
|
private Long id; |
||||
|
/** |
||||
|
* 供应商代码 |
||||
|
*/ |
||||
|
private String supplierCode; |
||||
|
/** |
||||
|
* 星期一 |
||||
|
*/ |
||||
|
private String monday; |
||||
|
/** |
||||
|
* 星期二 |
||||
|
*/ |
||||
|
private String tuesday; |
||||
|
/** |
||||
|
* 星期三 |
||||
|
*/ |
||||
|
private String wednesday; |
||||
|
/** |
||||
|
* 星期四 |
||||
|
*/ |
||||
|
private String thursday; |
||||
|
/** |
||||
|
* 星期五 |
||||
|
*/ |
||||
|
private String friday; |
||||
|
/** |
||||
|
* 星期六 |
||||
|
*/ |
||||
|
private String saturday; |
||||
|
/** |
||||
|
* 星期日 |
||||
|
*/ |
||||
|
private String sunday; |
||||
|
/** |
||||
|
* 版本号 |
||||
|
*/ |
||||
|
private String version; |
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String remark; |
||||
|
/** |
||||
|
* 扩展属性 |
||||
|
*/ |
||||
|
private String extraProperties; |
||||
|
/** |
||||
|
* 地点ID |
||||
|
*/ |
||||
|
private String siteId; |
||||
|
/** |
||||
|
* 开始时间 |
||||
|
*/ |
||||
|
private LocalDateTime beginTime; |
||||
|
/** |
||||
|
* 结束时间 |
||||
|
*/ |
||||
|
private LocalDateTime endTime; |
||||
|
/** |
||||
|
* 是否可用 |
||||
|
*/ |
||||
|
private String available; |
||||
|
/** |
||||
|
* 状态 |
||||
|
*/ |
||||
|
private String status; |
||||
|
/** |
||||
|
* 并发乐观锁 |
||||
|
*/ |
||||
|
private String concurrencyStamp; |
||||
|
/** |
||||
|
* 权限所属人员id |
||||
|
*/ |
||||
|
private Long ruleUserId; |
||||
|
/** |
||||
|
* 部门 |
||||
|
*/ |
||||
|
private String departmentCode; |
||||
|
|
||||
|
} |
@ -0,0 +1,80 @@ |
|||||
|
package com.win.module.wms.dal.mysql.suppliercycle; |
||||
|
|
||||
|
import com.win.framework.common.pojo.CustomConditions; |
||||
|
import com.win.framework.common.pojo.PageResult; |
||||
|
import com.win.framework.mybatis.core.mapper.BaseMapperX; |
||||
|
import com.win.framework.mybatis.core.query.LambdaQueryWrapperX; |
||||
|
import com.win.framework.mybatis.core.util.QueryWrapperUtils; |
||||
|
import com.win.module.wms.controller.suppliercycle.vo.SupplierCycleExportReqVO; |
||||
|
import com.win.module.wms.controller.suppliercycle.vo.SupplierCyclePageReqVO; |
||||
|
import com.win.module.wms.dal.dataobject.suppliercycle.SupplierCycleDO; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 要货预测周期 Mapper |
||||
|
* |
||||
|
* @author 超级管理员 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface SupplierCycleMapper extends BaseMapperX<SupplierCycleDO> { |
||||
|
|
||||
|
default PageResult<SupplierCycleDO> selectPage(SupplierCyclePageReqVO reqVO) { |
||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<SupplierCycleDO>() |
||||
|
.eqIfPresent(SupplierCycleDO::getSupplierCode, reqVO.getSupplierCode()) |
||||
|
.eqIfPresent(SupplierCycleDO::getMonday, reqVO.getMonday()) |
||||
|
.eqIfPresent(SupplierCycleDO::getTuesday, reqVO.getTuesday()) |
||||
|
.eqIfPresent(SupplierCycleDO::getWednesday, reqVO.getWednesday()) |
||||
|
.eqIfPresent(SupplierCycleDO::getThursday, reqVO.getThursday()) |
||||
|
.eqIfPresent(SupplierCycleDO::getFriday, reqVO.getFriday()) |
||||
|
.eqIfPresent(SupplierCycleDO::getSaturday, reqVO.getSaturday()) |
||||
|
.eqIfPresent(SupplierCycleDO::getSunday, reqVO.getSunday()) |
||||
|
.eqIfPresent(SupplierCycleDO::getVersion, reqVO.getVersion()) |
||||
|
.eqIfPresent(SupplierCycleDO::getRemark, reqVO.getRemark()) |
||||
|
.betweenIfPresent(SupplierCycleDO::getCreateTime, reqVO.getCreateTime()) |
||||
|
.eqIfPresent(SupplierCycleDO::getExtraProperties, reqVO.getExtraProperties()) |
||||
|
.eqIfPresent(SupplierCycleDO::getSiteId, reqVO.getSiteId()) |
||||
|
.betweenIfPresent(SupplierCycleDO::getBeginTime, reqVO.getBeginTime()) |
||||
|
.betweenIfPresent(SupplierCycleDO::getEndTime, reqVO.getEndTime()) |
||||
|
.eqIfPresent(SupplierCycleDO::getAvailable, reqVO.getAvailable()) |
||||
|
.eqIfPresent(SupplierCycleDO::getStatus, reqVO.getStatus()) |
||||
|
.eqIfPresent(SupplierCycleDO::getConcurrencyStamp, reqVO.getConcurrencyStamp()) |
||||
|
.eqIfPresent(SupplierCycleDO::getRuleUserId, reqVO.getRuleUserId()) |
||||
|
.eqIfPresent(SupplierCycleDO::getDepartmentCode, reqVO.getDepartmentCode()) |
||||
|
.orderByDesc(SupplierCycleDO::getId)); |
||||
|
} |
||||
|
|
||||
|
default PageResult<SupplierCycleDO> selectSenior(CustomConditions conditions) { |
||||
|
return selectPage(conditions, QueryWrapperUtils.structure(conditions)); |
||||
|
} |
||||
|
|
||||
|
default List<SupplierCycleDO> selectList(SupplierCycleExportReqVO reqVO) { |
||||
|
return selectList(new LambdaQueryWrapperX<SupplierCycleDO>() |
||||
|
.eqIfPresent(SupplierCycleDO::getSupplierCode, reqVO.getSupplierCode()) |
||||
|
.eqIfPresent(SupplierCycleDO::getMonday, reqVO.getMonday()) |
||||
|
.eqIfPresent(SupplierCycleDO::getTuesday, reqVO.getTuesday()) |
||||
|
.eqIfPresent(SupplierCycleDO::getWednesday, reqVO.getWednesday()) |
||||
|
.eqIfPresent(SupplierCycleDO::getThursday, reqVO.getThursday()) |
||||
|
.eqIfPresent(SupplierCycleDO::getFriday, reqVO.getFriday()) |
||||
|
.eqIfPresent(SupplierCycleDO::getSaturday, reqVO.getSaturday()) |
||||
|
.eqIfPresent(SupplierCycleDO::getSunday, reqVO.getSunday()) |
||||
|
.eqIfPresent(SupplierCycleDO::getVersion, reqVO.getVersion()) |
||||
|
.eqIfPresent(SupplierCycleDO::getRemark, reqVO.getRemark()) |
||||
|
.betweenIfPresent(SupplierCycleDO::getCreateTime, reqVO.getCreateTime()) |
||||
|
.eqIfPresent(SupplierCycleDO::getExtraProperties, reqVO.getExtraProperties()) |
||||
|
.eqIfPresent(SupplierCycleDO::getSiteId, reqVO.getSiteId()) |
||||
|
.betweenIfPresent(SupplierCycleDO::getBeginTime, reqVO.getBeginTime()) |
||||
|
.betweenIfPresent(SupplierCycleDO::getEndTime, reqVO.getEndTime()) |
||||
|
.eqIfPresent(SupplierCycleDO::getAvailable, reqVO.getAvailable()) |
||||
|
.eqIfPresent(SupplierCycleDO::getStatus, reqVO.getStatus()) |
||||
|
.eqIfPresent(SupplierCycleDO::getConcurrencyStamp, reqVO.getConcurrencyStamp()) |
||||
|
.eqIfPresent(SupplierCycleDO::getRuleUserId, reqVO.getRuleUserId()) |
||||
|
.eqIfPresent(SupplierCycleDO::getDepartmentCode, reqVO.getDepartmentCode()) |
||||
|
.orderByDesc(SupplierCycleDO::getId)); |
||||
|
} |
||||
|
|
||||
|
default SupplierCycleDO selectBySupplierCode(String supplierCode){ |
||||
|
return selectOne(new LambdaQueryWrapperX<SupplierCycleDO>().eq(SupplierCycleDO::getSupplierCode,supplierCode)); |
||||
|
} |
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
package com.win.module.wms.job; |
||||
|
|
||||
|
import com.win.framework.quartz.core.handler.JobHandler; |
||||
|
import com.win.framework.tenant.core.context.TenantContextHolder; |
||||
|
import com.win.module.wms.service.purchasePlan.PurchasePlanMainService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.context.annotation.Lazy; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
|
||||
|
/** |
||||
|
* 租户1 每天凌晨查询所有要货计划两天前未完成的执行关闭 |
||||
|
*/ |
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class PurchasePlanOffOneJob implements JobHandler { |
||||
|
|
||||
|
@Lazy |
||||
|
@Resource |
||||
|
private PurchasePlanMainService purchasePlanMainService; |
||||
|
|
||||
|
@Override |
||||
|
public String execute(String param) throws Exception { |
||||
|
log.info("【要货计划执行关闭】----开始"); |
||||
|
TenantContextHolder.setTenantId(1l); |
||||
|
purchasePlanMainService.autoOffPurchasePlan(); |
||||
|
log.info("【要货计划执行关闭】----结束"); |
||||
|
return "要货计划执行关闭"; |
||||
|
} |
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
package com.win.module.wms.job; |
||||
|
|
||||
|
import com.win.framework.quartz.core.handler.JobHandler; |
||||
|
import com.win.framework.tenant.core.context.TenantContextHolder; |
||||
|
import com.win.module.wms.service.purchasePlan.PurchasePlanMainService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.context.annotation.Lazy; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
|
||||
|
/** |
||||
|
* 租户1 每天凌晨查询所有要货计划两天前未完成的执行关闭 |
||||
|
*/ |
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class PurchasePlanOffTwoJob implements JobHandler { |
||||
|
|
||||
|
@Lazy |
||||
|
@Resource |
||||
|
private PurchasePlanMainService purchasePlanMainService; |
||||
|
|
||||
|
@Override |
||||
|
public String execute(String param) throws Exception { |
||||
|
log.info("【要货计划执行关闭】----开始"); |
||||
|
TenantContextHolder.setTenantId(2l); |
||||
|
purchasePlanMainService.autoOffPurchasePlan(); |
||||
|
log.info("【要货计划执行关闭】----结束"); |
||||
|
return "要货计划执行关闭"; |
||||
|
} |
||||
|
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue