rsf-admin/src/page/orders/delivery/DeliveryCreate.jsx
@@ -36,6 +36,8 @@ const translate = useTranslate(); const notify = useNotify(); const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_order_type')) || []; const business = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_business_type')) || []; const handleClose = (event, reason) => { if (reason !== "backdropClick") { @@ -84,36 +86,28 @@ </DialogTitle> <DialogContent sx={{ mt: 2 }}> <Grid container rowSpacing={2} columnSpacing={2}> <Grid item xs={6} display="flex" gap={1}> <TextInput label="table.field.delivery.code" source="code" parse={v => v} autoFocus /> </Grid> <Grid item xs={6} display="flex" gap={1}> <Grid item xs={16} display="flex" gap={1}> <TextInput label="table.field.delivery.platId" source="platId" parse={v => v} /> </Grid> <Grid item xs={6} display="flex" gap={1}> <TextInput label="table.field.delivery.type" <AutocompleteInput choices={dicts} optionText="label" label="table.field.asnOrder.type" source="type" optionValue="value" parse={v => v} /> </Grid> <Grid item xs={6} display="flex" gap={1}> <TextInput label="table.field.delivery.wkType" <AutocompleteInput choices={business} optionText="label" label="table.field.asnOrder.wkType" source="wkType" optionValue="value" parse={v => v} /> </Grid> <Grid item xs={6} display="flex" gap={1}> <TextInput label="table.field.delivery.source" source="source" @@ -121,28 +115,22 @@ validate={required()} /> </Grid> <Grid item xs={6} display="flex" gap={1}> <Grid item xs={16} display="flex" gap={1}> <NumberInput label="table.field.delivery.anfme" source="anfme" validate={required()} /> </Grid> <Grid item xs={6} display="flex" gap={1}> <NumberInput label="table.field.delivery.qty" source="qty" validate={required()} /> </Grid> <Grid item xs={6} display="flex" gap={1}> <NumberInput label="table.field.delivery.workQty" source="workQty" validate={required()} /> </Grid> <Grid item xs={6} display="flex" gap={1}> <TextInput label="table.field.delivery.platCode" source="platCode" rsf-admin/src/page/system/serialRule/SerialRuleItemEdit.jsx
@@ -110,7 +110,7 @@ source="wkType" optionValue="value" parse={v => v} /> /> </Stack> <Stack direction='row' gap={2}> <TextInput @@ -152,7 +152,13 @@ </Grid> </DialogContent> <DialogActions> <Toolbar sx={{ width: '100%', justifyContent: 'end' }} > <SaveButton type="button" mutationOptions={{ onSuccess: () => { setOpen(false) } }} /> </Toolbar> </DialogActions> </Form> rsf-admin/src/page/system/serialRule/SerialRuleItemList.jsx
@@ -118,7 +118,7 @@ empty={false} filters={filters} filter={{ ruleId: ruleId }} sort={{ field: "create_time", order: "desc" }} sort={{ field: "sort", order: "asc" }} actions={ <TopToolbar> <FilterButton /> rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/DeliveryController.java
@@ -11,7 +11,11 @@ import com.vincent.rsf.server.common.domain.PageParam; import com.vincent.rsf.server.manager.entity.Delivery; import com.vincent.rsf.server.manager.service.DeliveryService; import com.vincent.rsf.server.system.constant.SerialRuleCode; import com.vincent.rsf.server.system.controller.BaseController; import com.vincent.rsf.server.system.service.SerialRuleService; import com.vincent.rsf.server.system.utils.SerialRuleUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; @@ -24,6 +28,7 @@ @Autowired private DeliveryService deliveryService; @PreAuthorize("hasAuthority('manager:delivery:list')") @PostMapping("/delivery/page") @@ -56,9 +61,14 @@ @PostMapping("/delivery/save") public R save(@RequestBody Delivery delivery) { delivery.setCreateBy(getLoginUserId()); delivery.setCreateTime(new Date()); delivery.setUpdateBy(getLoginUserId()); delivery.setUpdateTime(new Date()); if (Objects.isNull(delivery.getCode())) { String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_DELIVERY_RULE_CODE, delivery); if (Objects.isNull(ruleCode) || StringUtils.isBlank(ruleCode)) { return R.error("编码规则错误:编码「SYS_DELIVERY_RULE_CODE」是未设置成功!!"); } delivery.setCode(ruleCode); } if (!deliveryService.save(delivery)) { return R.error("Save Fail"); } rsf-server/src/main/java/com/vincent/rsf/server/system/constant/SerialRuleCode.java
@@ -58,4 +58,9 @@ * 综合订单编码规则 */ public final static String SYS_MANAGE_ORDER_CODE = "sys_manage_order_code"; /** * DO单据编码规则 */ public final static String SYS_DELIVERY_RULE_CODE = "sys_delivery_rule_code"; }