1. 入库历史订单明细数据丢失
2. 库存信息响应问题
3. 出库明细新加客户信息
4. 库存明细增加查询条件
5. 出库修改物料来源
| | |
| | | optionLabelProp="label">
|
| | | </a-select>
|
| | | </a-form-item>
|
| | | <!-- <a-form-item :label="formatMessage('db.man_order.order_no', '物流公司')" name="orderNo" >
|
| | | <a-input v-model:value="formData.orderNo" />
|
| | | </a-form-item>
|
| | | <a-form-item :label="formatMessage('db.man_order.order_no', '快递单号')" name="orderNo">
|
| | | <a-input v-model:value="formData.orderNo"/>
|
| | | </a-form-item>
|
| | | <a-form-item :label="formatMessage('db.man_order.order_no', '物流公司')" name="orderNo" >
|
| | | <a-input v-model:value="formData.orderNo"/>
|
| | | </a-form-item>
|
| | | <a-form-item :label="formatMessage('db.man_order.order_no', '快递单号')" name="orderNo">
|
| | | <a-input v-model:value="formData.orderNo"/>
|
| | | </a-form-item> -->
|
| | | <a-form-item :label="formatMessage('db.man_order.update_time', '订单明细')" name="orderDetl">
|
| | | <OrderDetlComponent ref="orderDetlChild" v-if="open" />
|
| | | <OrderDetlComponent ref="orderDetlChild" v-if="open" :ioModel="props.ioModel"/>
|
| | | </a-form-item>
|
| | | <a-form-item>
|
| | | <a-button type="primary" html-type="submit" ref="submitButton"
|
| | |
| | | style="width: 140px;margin-right: 10px;" show-search allowClear :options="orderTypeQueryList"
|
| | | optionFilterProp="label" optionLabelProp="label">
|
| | | </a-select>
|
| | |
|
| | | <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '请输入')"
|
| | | style="width: 200px;" @search="onSearch" />
|
| | | </div>
|
| | |
| | | </template>
|
| | | </template>
|
| | | </a-table>
|
| | |
|
| | | <ShowOrderDetlComponent ref="showOrderDetlChild" />
|
| | |
|
| | | </div>
|
| | | <OrderPrint ref="printChild" />
|
| | | </template>
|
| | |
| | |
|
| | | const TABLE_KEY = 'table-locDetl';
|
| | |
|
| | | const props = defineProps({
|
| | | ioModel: null
|
| | | })
|
| | |
|
| | | let tableData = ref([]);
|
| | | let deleteDetlId = ref([]);
|
| | | let orderId = ref(null);
|
| | |
| | |
|
| | | function matQuery(condition) {
|
| | | matFetching.value = true;
|
| | | post('/api/mat/page', {
|
| | | let url = '/api/mat/page'
|
| | | if (props.ioModel == 2) {
|
| | | url = '/api/locs/mats/page'
|
| | | } |
| | | post(url, {
|
| | | current: 1,
|
| | | pageSize: 10,
|
| | | condition: condition
|
| | |
| | |
|
| | | const showDetl = (item) => {
|
| | | showOrderDetlChild.value.openDetl = true;
|
| | | showOrderDetlChild.value.orderId = item.id;
|
| | | showOrderDetlChild.value.orderId = item.orderNo;
|
| | | |
| | | }
|
| | |
|
| | | const handleExport = async (intl) => {
|
| | |
| | | <script setup> |
| | | import {toRefs, ref, defineProps, watch} from 'vue'; |
| | | import { toRefs, ref, defineProps, watch } from 'vue'; |
| | | import { globalState } from '@/config.js' |
| | | import { formatMessage } from '@/utils/localeUtils'; |
| | | |
| | | const props = defineProps({ |
| | | orderNo: { |
| | | type: String, |
| | | default: '' |
| | | }, |
| | | orderNo: { |
| | | type: String, |
| | | default: '' |
| | | }, |
| | | list: { |
| | | type: Array, |
| | | default: [] |
| | |
| | | default: 1 |
| | | } |
| | | }); |
| | | const { orderNo,list, repeatNum } = toRefs(props) |
| | | const { orderNo, list, repeatNum } = toRefs(props) |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div id="printOrder"> |
| | | <div> |
| | | <table class="contain" width="1200" |
| | | style="overflow: hidden;font-size: xx-small;table-layout: fixed;"> |
| | | <tr style="height: 100px"> |
| | | <td colspan="1" align="center" scope="col">订单号</td> |
| | | <td colspan="2" align="center" scope="col">{{orderNo}}</td> |
| | | <td class="barcode" colspan="9" align="center" scope="col"> |
| | | <img :src="globalState.url + '/api/code/auth?type=1¶m=' + orderNo" width="70%;" /> |
| | | <div style="letter-spacing: 2px;margin-top: 1px; text-align: center;"> |
| | | <span>{{ orderNo }} </span> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | <tr style="height: 40px"> |
| | | <td align="center" colspan="1">序号</td> |
| | | <td align="center" colspan="2">商品编号</td> |
| | | <td align="center" colspan="3">商品名称</td> |
| | | <td align="center" colspan="2">批次</td> |
| | | <td align="center" colspan="2">规格</td> |
| | | <td align="center" colspan="1">数量 </td> |
| | | </tr> |
| | | <template v-for="(item, index) in list" :key="index"> |
| | | <tr style="height: 40px"> |
| | | <td align="center" colspan="1">{{index + 1}}</td> |
| | | <td align="center" colspan="2">{{ item.matnr }}</td> |
| | | <td align="center" colspan="3">{{ item.maktx }}</td> |
| | | <td align="center" colspan="2">{{ item.batch }}</td> |
| | | <td align="center" colspan="2">{{ item.specs }}</td> |
| | | <td align="center" colspan="1">{{ item.anfme }}</td> |
| | | </tr> |
| | | </template> |
| | | </table> |
| | | </div> |
| | | <div> |
| | | <table class="contain" width="1200" style="overflow: hidden;font-size: xx-small;table-layout: fixed;"> |
| | | |
| | | <tr style="height: 40px"> |
| | | <td align="center" colspan="2">客户名称</td> |
| | | <td align="center" colspan="2">联系电话</td> |
| | | <td align="center" colspan="3">快递单号</td> |
| | | <td align="center" colspan="4">收货地址</td> |
| | | </tr> |
| | | <template v-for="(item, index) in list" :key="index"> |
| | | <tr style="height: 40px"> |
| | | <td align="center" colspan="2">{{ item.customer }}</td> |
| | | <td align="center" colspan="2">{{ item.phone }}</td> |
| | | <td align="center" colspan="3">{{ item.logistics }}</td> |
| | | <td align="center" colspan="4">{{ item.address }}</td> |
| | | </tr> |
| | | </template> |
| | | <tr style="height: 100px"> |
| | | <td colspan="1" align="center" scope="col">订单号</td> |
| | | <td colspan="2" align="center" scope="col">{{ orderNo }}</td> |
| | | <td class="barcode" colspan="8" align="center" scope="col" > |
| | | <img :src="globalState.url + '/api/code/auth?type=1¶m=' + orderNo" width="70%;" /> |
| | | <div style="letter-spacing: 2px;margin-top: 1px; text-align: center;"> |
| | | <span>{{ orderNo }} </span> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | <tr style="height: 40px"> |
| | | <td align="center" colspan="1">序号</td> |
| | | <td align="center" colspan="2">商品编号</td> |
| | | <td align="center" colspan="3">商品名称</td> |
| | | <td align="center" colspan="2">批次</td> |
| | | <td align="center" colspan="2">规格</td> |
| | | <td align="center" colspan="1">数量 </td> |
| | | </tr> |
| | | <template v-for="(item, index) in list" :key="index"> |
| | | <tr style="height: 40px"> |
| | | <td align="center" colspan="1">{{ index + 1 }}</td> |
| | | <td align="center" colspan="2">{{ item.matnr }}</td> |
| | | <td align="center" colspan="3">{{ item.maktx }}</td> |
| | | <td align="center" colspan="2">{{ item.batch }}</td> |
| | | <td align="center" colspan="2">{{ item.specs }}</td> |
| | | <td align="center" colspan="1">{{ item.anfme }}</td> |
| | | </tr> |
| | | </template> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | <a-form-item :label="formatMessage('db.man_container.type', '托盘类型')" name="type" >
|
| | | <a-select v-model:value="pakinType" :options="[
|
| | | { label: '平库托盘', value: 1 },
|
| | | { label: '立库托盘', value: 2 },
|
| | | { label: '立库托盘', value: 2 }, |
| | | ]">
|
| | | </a-select>
|
| | | </a-form-item>
|
| | |
| | | matnr: null,
|
| | | orderNo: null,
|
| | | batch: null,
|
| | | tagId: null,
|
| | | })
|
| | | const editChild = ref(null)
|
| | |
|
| | |
| | | ...getColumnSearchProps('matnr'),
|
| | | },
|
| | | {
|
| | | title: formatMessage('db.man_loc_detl.maktx', '商品名称'),
|
| | | dataIndex: 'maktx',
|
| | | width: 140,
|
| | | ellipsis: true,
|
| | | ...getColumnSearchProps('maktx'),
|
| | | },
|
| | | {
|
| | | title: formatMessage('db.man_loc_detl.specs', '规格'),
|
| | | dataIndex: 'specs',
|
| | | width: 140,
|
| | | ellipsis: true,
|
| | | ...getColumnSearchProps('specs'),
|
| | | },
|
| | | {
|
| | | title: formatMessage('db.man_loc_detl.model', '型号'),
|
| | | dataIndex: 'model',
|
| | | width: 140,
|
| | | ellipsis: true,
|
| | | ...getColumnSearchProps('model'),
|
| | | title: formatMessage('db.man_loc_detl.maktx', '商品名称'),
|
| | | dataIndex: 'maktx',
|
| | | width: 140,
|
| | | ellipsis: true,
|
| | | ...getColumnSearchProps('maktx'),
|
| | | },
|
| | | {
|
| | | title: formatMessage('db.man_loc_detl.dewell', '入库时间'),
|
| | | dataIndex: 'dewell$',
|
| | | width: 140,
|
| | | ellipsis: true,
|
| | | ...getColumnSearchProps('dewell$'),
|
| | | title: formatMessage('db.man_loc_detl.specs', '规格'),
|
| | | dataIndex: 'specs',
|
| | | width: 140,
|
| | | ellipsis: true,
|
| | | ...getColumnSearchProps('specs'),
|
| | | },
|
| | | {
|
| | | title: formatMessage('db.man_loc_detl.model', '型号'),
|
| | | dataIndex: 'model',
|
| | | width: 140,
|
| | | ellipsis: true,
|
| | | ...getColumnSearchProps('model'),
|
| | | },
|
| | | {
|
| | | title: formatMessage('db.man_loc_detl.model', '品类'),
|
| | | dataIndex: 'tagId$',
|
| | | width: 140,
|
| | | ellipsis: true,
|
| | | ...getColumnSearchProps('tagId$'),
|
| | | },
|
| | | {
|
| | | title: formatMessage('db.man_loc_detl.dewell', '入库时间'),
|
| | | dataIndex: 'dewell$',
|
| | | width: 140,
|
| | | ellipsis: true,
|
| | | ...getColumnSearchProps('dewell$'),
|
| | | },
|
| | | {
|
| | | title: formatMessage('db.man_loc_detl.order_no', '订单号'),
|
| | |
| | | width: 140,
|
| | | })
|
| | | })
|
| | |
|
| | | // tmp.push({
|
| | | // title: formatMessage('common.operation', '操作'),
|
| | | // name: 'oper',
|
| | | // dataIndex: 'oper',
|
| | | // key: 'oper',
|
| | | // width: 140,
|
| | | // })
|
| | |
|
| | | state.columns = tmp;
|
| | | } else if (result.code === 401) {
|
| | | message.error(result.msg);
|
| | |
| | | style="width: 140px;margin-right: 10px;" />
|
| | | <a-input v-model:value="searchParam.matnr" :placeholder="formatMessage('page.locDetl.matnr.input', '请输入商品编号')"
|
| | | style="width: 140px;margin-right: 10px;" />
|
| | | <a-input v-model:value="searchParam.maktx" :placeholder="formatMessage('page.locDetl.maktx.input', '请输入商品名称')"
|
| | | style="width: 140px;margin-right: 10px;" />
|
| | | <a-input v-model:value="searchParam.orderNo"
|
| | | :placeholder="formatMessage('page.locDetl.orderNo.input', '请输入订单号')"
|
| | | style="width: 140px;margin-right: 10px;" />
|
| | | <a-input v-model:value="searchParam.batch" :placeholder="formatMessage('page.locDetl.batch.input', '请输入批号')"
|
| | | style="width: 140px;margin-right: 10px;" />
|
| | |
|
| | | <a-select v-model:value="searchParam.tagId" :placeholder="formatMessage('page.locDetl.orderNo.input', '请选择品类')" :options="[
|
| | | { label: '默认分类', value: 10 },{ label: '机油', value: 11 }, { label: '变速箱油', value: 17 }, { label: '火花塞', value: 18 },
|
| | | { label: '养护品', value: 25 },{ label: '油漆耗材', value: 26 }, { label: '球头摆臂', value: 27 }, { label: '砂纸类', value: 31 },
|
| | | { label: '菜瓜布', value: 32 }, { label: '遮蔽类', value: 33 }, { label: '抛光类', value: 34 }, { label: '除尘类', value: 35 },
|
| | | { label: '漏斗类', value: 36 }, { label: '防护类', value: 37 }, { label: '烤房保养类', value: 38 }, { label: '调漆罐', value: 39 },
|
| | | { label: '喷枪', value: 40 }, { label: '费斯托系列', value: 41 },]" style="width: 140px;margin-right: 10px;">
|
| | | </a-select>
|
| | | <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '请输入')"
|
| | | style="width: 200px;" @search="onSearch" />
|
| | | </div>
|
| | |
| | | <div style="display: flex;justify-content: space-evenly;">
|
| | | <a-button type="link" primary @click="handleEdit(record)">{{ formatMessage('page.edit', '编辑') }}</a-button>
|
| | | <a-button type="link" danger @click="handleDel([record])">{{ formatMessage('page.delete', '删除')
|
| | | }}</a-button>
|
| | | }}</a-button>
|
| | | </div>
|
| | | </template>
|
| | | </template>
|
| | |
| | | import com.zy.asrs.framework.common.Cools;
|
| | | import com.zy.asrs.framework.common.R;
|
| | | import com.zy.asrs.framework.exception.CoolException;
|
| | | import com.zy.asrs.wms.asrs.entity.MatField;
|
| | | import com.zy.asrs.wms.asrs.entity.MatFieldValue;
|
| | | import com.zy.asrs.wms.asrs.entity.Tag;
|
| | | import com.zy.asrs.wms.asrs.entity.*;
|
| | | import com.zy.asrs.wms.asrs.entity.template.MatTemplate;
|
| | | import com.zy.asrs.wms.asrs.service.MatFieldService;
|
| | | import com.zy.asrs.wms.asrs.service.MatFieldValueService;
|
| | | import com.zy.asrs.wms.asrs.service.TagService;
|
| | | import com.zy.asrs.wms.asrs.service.impl.LocDetlServiceImpl;
|
| | | import com.zy.asrs.wms.common.annotation.CacheData;
|
| | | import com.zy.asrs.wms.common.annotation.OperationLog;
|
| | | import com.zy.asrs.wms.common.domain.BaseParam;
|
| | | import com.zy.asrs.wms.common.domain.KeyValVo;
|
| | | import com.zy.asrs.wms.common.domain.PageParam;
|
| | | import com.zy.asrs.wms.asrs.entity.Mat;
|
| | | import com.zy.asrs.wms.asrs.service.MatService;
|
| | | import com.zy.asrs.wms.system.controller.BaseController;
|
| | | import com.zy.asrs.wms.utils.ExcelUtil;
|
| | |
| | |
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | | import java.util.*;
|
| | | import java.util.stream.Collectors;
|
| | |
|
| | | @RestController
|
| | | @RequestMapping("/api")
|
| | |
| | | private MatFieldValueService matFieldValueService;
|
| | | @Autowired
|
| | | private TagService tagService;
|
| | | @Autowired
|
| | | private LocDetlServiceImpl locDetlService;
|
| | |
|
| | | @PreAuthorize("hasAuthority('asrs:mat:list')")
|
| | | @PostMapping("/mat/page")
|
| | |
| | | return R.ok().add(data);
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * @author Ryan
|
| | | * @date 2025/7/3
|
| | | * @description: 获取可出库物料信息
|
| | | * @version 1.0
|
| | | */
|
| | | @PreAuthorize("hasAuthority('asrs:mat:list')")
|
| | | @PostMapping("/locs/mats/page")
|
| | | public R getOutPage(@RequestBody Map<String, Object> param) {
|
| | | List<LocDetl> locDetls = locDetlService.list(new LambdaQueryWrapper<LocDetl>().select(LocDetl::getMatId));
|
| | | if (locDetls.isEmpty()) {
|
| | | return R.ok();
|
| | | }
|
| | | /**获取存物料信息*/
|
| | | Set<Long> ids = locDetls.stream().map(LocDetl::getMatId).collect(Collectors.toSet());
|
| | |
|
| | | BaseParam baseParam = buildParam(param, BaseParam.class);
|
| | | PageParam<Mat, BaseParam> pageParam = new PageParam<>(baseParam, Mat.class);
|
| | | QueryWrapper<Mat> queryWrapper = pageParam.buildWrapper(true);
|
| | | queryWrapper.orderByDesc("utiliz");
|
| | | queryWrapper.in("id", ids);
|
| | |
|
| | | PageParam<Mat, BaseParam> page = matService.page(pageParam, queryWrapper);
|
| | |
|
| | | JSONObject data = JSON.parseObject(JSON.toJSONString(page));
|
| | |
|
| | | List<Mat> records = page.getRecords();
|
| | | data.put("records", records);
|
| | | for (Mat mat : records) {
|
| | | List<MatFieldValue> list = matFieldValueService.list(new LambdaQueryWrapper<MatFieldValue>()
|
| | | .eq(MatFieldValue::getMatId, mat.getId()));
|
| | | mat.syncField(list);
|
| | | }
|
| | | return R.ok(data);
|
| | | }
|
| | |
|
| | |
|
| | | @PreAuthorize("hasAuthority('asrs:mat:list')")
|
| | | @PostMapping("/mat/list")
|
| | | @CacheData(tableName = {"man_mat"})
|
| | |
| | | @PreAuthorize("hasAuthority('asrs:orderDetl:list')")
|
| | | @GetMapping("/orderDetlLog/orderId/{orderId}")
|
| | | @CacheData(tableName = {"man_order_detl_log"})
|
| | | public R list(@PathVariable("orderId") Long orderId) {
|
| | | public R list(@PathVariable("orderId") String orderId) {
|
| | | return R.ok().add(orderDetlLogService.getOrderDetlByOrderId(orderId));
|
| | | }
|
| | |
|
| | |
| | | @ApiModelProperty(value= "单据状态")
|
| | | private Long orderSettle;
|
| | |
|
| | | @ApiModelProperty("客户名称")
|
| | | private String customer;
|
| | |
|
| | | @ApiModelProperty("物流名称")
|
| | | private String logisticsName;
|
| | |
|
| | |
| | | @TableId(value = "id", type = IdType.INPUT)
|
| | | private Long id;
|
| | |
|
| | |
|
| | | @ApiModelProperty("原单ID")
|
| | | private Long orderId;
|
| | |
|
| | | /**
|
| | | * 订单编号
|
| | | */
|
| | |
| | | import com.zy.asrs.framework.common.SpringUtils;
|
| | | import com.zy.asrs.wms.asrs.service.LocService;
|
| | | import com.zy.asrs.wms.asrs.service.MatService;
|
| | | import com.zy.asrs.wms.asrs.service.TagService;
|
| | | import com.zy.asrs.wms.system.entity.Host;
|
| | | import com.zy.asrs.wms.system.entity.User;
|
| | | import com.zy.asrs.wms.system.service.HostService;
|
| | |
| | | @ApiModelProperty(value= "所属机构")
|
| | | private Long hostId;
|
| | |
|
| | | @ApiModelProperty("物料名称")
|
| | | private String maktx;
|
| | |
|
| | | @ApiModelProperty("规格")
|
| | | private String specs;
|
| | |
|
| | | @ApiModelProperty("型号")
|
| | | private String model;
|
| | |
|
| | | /**
|
| | | * 状态 1: 正常 0: 禁用
|
| | | */
|
| | | @ApiModelProperty(value= "状态 1: 正常 0: 禁用 ")
|
| | | private Integer status;
|
| | |
|
| | | @ApiModelProperty("分类标识")
|
| | | private Long tagId;
|
| | |
|
| | | /**
|
| | | * 是否删除 1: 是 0: 否
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | @Delegate(types = Mat.class)
|
| | | public Mat getMatId$(){
|
| | | MatService service = SpringUtils.getBean(MatService.class);
|
| | | Mat mat = service.getById(this.matId);
|
| | | return mat;
|
| | | public String getTagId$() {
|
| | | TagService tagService = SpringUtils.getBean(TagService.class);
|
| | | Tag byId = tagService.getById(this.tagId);
|
| | | if (!Cools.isEmpty(byId)){
|
| | | return byId.getName();
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | |
|
| | | // @Delegate(types = Mat.class)
|
| | | // public Mat getMatId$(){
|
| | | // MatService service = SpringUtils.getBean(MatService.class);
|
| | | // Mat mat = service.getById(this.matId);
|
| | | // return mat;
|
| | | // }
|
| | |
|
| | | public String getDewell$() {
|
| | | return DateUtils.diff(new Date(), createTime) + "天";
|
| | |
| | | }
|
| | |
|
| | | //动态扩展字段
|
| | | public transient Map<String, Object> dynamicFields = new HashMap<>();
|
| | | // public transient Map<String, Object> dynamicFields = new HashMap<>();
|
| | |
|
| | | @JsonAnyGetter
|
| | | public Map<String,Object> getDynamicFields() {
|
| | | return dynamicFields;
|
| | | }
|
| | |
|
| | | public void syncField(List<LocDetlField> list) {
|
| | | ArrayList<String> keys = new ArrayList<>();
|
| | | Field[] fields = this.getClass().getFields();
|
| | | for (Field field : fields) {
|
| | | keys.add(field.getName());
|
| | | }
|
| | |
|
| | | Map<String, Object> dynamicFields = new HashMap<>();
|
| | | for (LocDetlField locDetlField : list) {
|
| | | if (keys.contains(locDetlField.getName())) {
|
| | | continue;
|
| | | }
|
| | | dynamicFields.put(locDetlField.getName(), locDetlField.getValue());
|
| | | }
|
| | |
|
| | | this.dynamicFields = dynamicFields;
|
| | | }
|
| | |
|
| | | public void syncFieldMap(Map<String, Object> map) {
|
| | | ArrayList<String> keys = new ArrayList<>();
|
| | | Field[] fields = this.getClass().getDeclaredFields();
|
| | | for (Field field : fields) {
|
| | | keys.add(field.getName());
|
| | | }
|
| | | keys.add("detlId");
|
| | |
|
| | | Map<String, Object> dynamicFields = new HashMap<>();
|
| | | for (Map.Entry<String, Object> entry : map.entrySet()) {
|
| | | if (keys.contains(entry.getKey())) {
|
| | | continue;
|
| | | }
|
| | | dynamicFields.put(entry.getKey(), entry.getValue());
|
| | | }
|
| | |
|
| | | this.dynamicFields = dynamicFields;
|
| | | }
|
| | |
|
| | | public String getFieldString(String key) {
|
| | | return dynamicFields.get(key).toString();
|
| | | }
|
| | |
|
| | | public void setField(String key, Object value) {
|
| | | dynamicFields.put(key, value);
|
| | | }
|
| | | // @JsonAnyGetter
|
| | | // public Map<String,Object> getDynamicFields() {
|
| | | // return dynamicFields;
|
| | | // }
|
| | | //
|
| | | // public void syncField(List<LocDetlField> list) {
|
| | | // ArrayList<String> keys = new ArrayList<>();
|
| | | // Field[] fields = this.getClass().getFields();
|
| | | // for (Field field : fields) {
|
| | | // keys.add(field.getName());
|
| | | // }
|
| | | //
|
| | | // Map<String, Object> dynamicFields = new HashMap<>();
|
| | | // for (LocDetlField locDetlField : list) {
|
| | | // if (keys.contains(locDetlField.getName())) {
|
| | | // continue;
|
| | | // }
|
| | | // dynamicFields.put(locDetlField.getName(), locDetlField.getValue());
|
| | | // }
|
| | | //
|
| | | // this.dynamicFields = dynamicFields;
|
| | | // }
|
| | | //
|
| | | // public void syncFieldMap(Map<String, Object> map) {
|
| | | // ArrayList<String> keys = new ArrayList<>();
|
| | | // Field[] fields = this.getClass().getDeclaredFields();
|
| | | // for (Field field : fields) {
|
| | | // keys.add(field.getName());
|
| | | // }
|
| | | // keys.add("detlId");
|
| | | //
|
| | | // Map<String, Object> dynamicFields = new HashMap<>();
|
| | | // for (Map.Entry<String, Object> entry : map.entrySet()) {
|
| | | // if (keys.contains(entry.getKey())) {
|
| | | // continue;
|
| | | // }
|
| | | // dynamicFields.put(entry.getKey(), entry.getValue());
|
| | | // }
|
| | | //
|
| | | // this.dynamicFields = dynamicFields;
|
| | | // }
|
| | | //
|
| | | // public String getFieldString(String key) {
|
| | | // return dynamicFields.get(key).toString();
|
| | | // }
|
| | | //
|
| | | // public void setField(String key, Object value) {
|
| | | // dynamicFields.put(key, value);
|
| | | // }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | public interface OrderDetlLogService extends IService<OrderDetlLog> {
|
| | |
|
| | | List<OrderDetlLog> getOrderDetlByOrderId(Long orderId);
|
| | | List<OrderDetlLog> getOrderDetlByOrderId(String orderId);
|
| | |
|
| | | }
|
| | |
| | | PageParam<ViewLocDetl, BaseParam> result = viewLocDetlMapper.selectPage(pageParam, buildWrapper);
|
| | |
|
| | | //解析动态字段
|
| | | JSONObject data = JSON.parseObject(JSON.toJSONString(result));
|
| | | List<ViewLocDetl> records = result.getRecords();
|
| | | data.put("records", records);
|
| | | for (ViewLocDetl locDetl : records) {
|
| | | Map<String, Object> resultMap = viewLocDetlMapper.getById(locDetl.getId());
|
| | | locDetl.syncFieldMap(resultMap);
|
| | | }
|
| | | // JSONObject data = JSON.parseObject(JSON.toJSONString(result));
|
| | | // List<ViewLocDetl> records = result.getRecords();
|
| | | // data.put("records", records);
|
| | | // for (ViewLocDetl locDetl : records) {
|
| | | // Map<String, Object> resultMap = viewLocDetlMapper.getById(locDetl.getId());
|
| | | // locDetl.syncFieldMap(resultMap);
|
| | | // }
|
| | | return result;
|
| | | }
|
| | |
|
| | |
| | | private OrderDetlFieldLogService orderDetlFieldLogService;
|
| | |
|
| | | @Override
|
| | | public List<OrderDetlLog> getOrderDetlByOrderId(Long orderId) {
|
| | | List<OrderDetlLog> orderDetlLogs = this.list(new LambdaQueryWrapper<OrderDetlLog>().eq(OrderDetlLog::getOrderId, orderId));
|
| | | public List<OrderDetlLog> getOrderDetlByOrderId(String orderId) {
|
| | | List<OrderDetlLog> orderDetlLogs = this.list(new LambdaQueryWrapper<OrderDetlLog>().eq(OrderDetlLog::getOrderNo, orderId));
|
| | | for (OrderDetlLog orderDetlLog : orderDetlLogs) {
|
| | | List<OrderDetlFieldLog> list = orderDetlFieldLogService.list(new LambdaQueryWrapper<OrderDetlFieldLog>().eq(OrderDetlFieldLog::getDetlId, orderDetlLog.getId()));
|
| | | orderDetlLog.syncField(list);
|
| | |
| | | @Autowired
|
| | | private OrderDetlFieldLogService orderDetlFieldLogService;
|
| | |
|
| | | @Scheduled(cron = "0/3 * * * * ? ")
|
| | | @Scheduled(cron = "0/13 * * * * ? ")
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void orderToHistory() {
|
| | | InterceptorIgnoreHelper.handle(IgnoreStrategy.builder().tenantLine(true).build());
|
| | | try {
|
| | | List<Order> list = orderService.list(new LambdaQueryWrapper<Order>().eq(Order::getOrderSettle, OrderSettleType.COMPLETE.val()));
|
| | | if (list.isEmpty()) {
|
| | | return;
|
| | | List<Order> list = orderService.list(new LambdaQueryWrapper<Order>().eq(Order::getOrderSettle, OrderSettleType.COMPLETE.val()));
|
| | | if (list.isEmpty()) {
|
| | | return;
|
| | | }
|
| | | for (Order order : list) {
|
| | | //转历史档
|
| | | OrderLog orderLog = new OrderLog();
|
| | | orderLog.sync(order);
|
| | | orderLog.setOrderId(order.getId());
|
| | | orderLog.setId(null);
|
| | | if (!orderLogService.save(orderLog)) {
|
| | | throw new CoolException("订单转历史档失败");
|
| | | }
|
| | |
|
| | | for (Order order : list) {
|
| | | //转历史档
|
| | | OrderLog orderLog = new OrderLog();
|
| | | orderLog.sync(order);
|
| | | orderLog.setId(null);
|
| | | if (!orderLogService.save(orderLog)) {
|
| | | throw new CoolException("订单转历史档失败");
|
| | | //订单明细转历史档
|
| | | List<OrderDetl> orderDetls = orderDetlService.list(new LambdaQueryWrapper<OrderDetl>()
|
| | | .eq(OrderDetl::getOrderId, order.getId()));
|
| | | for (OrderDetl orderDetl : orderDetls) {
|
| | | OrderDetlLog orderDetlLog = new OrderDetlLog();
|
| | | orderDetlLog.sync(orderDetl);
|
| | | orderDetlLog.setId(null);
|
| | | if(!orderDetlLogService.save(orderDetlLog)) {
|
| | | throw new CoolException("订单明细转历史档失败");
|
| | | }
|
| | |
|
| | | //订单明细转历史档
|
| | | List<OrderDetl> orderDetls = orderDetlService.list(new LambdaQueryWrapper<OrderDetl>().eq(OrderDetl::getOrderId, order.getId()));
|
| | | for (OrderDetl orderDetl : orderDetls) {
|
| | | OrderDetlLog orderDetlLog = new OrderDetlLog();
|
| | | orderDetlLog.sync(orderDetl);
|
| | | orderDetlLog.setId(null);
|
| | | if(!orderDetlLogService.save(orderDetlLog)) {
|
| | | throw new CoolException("订单明细转历史档失败");
|
| | | //明细扩展字段转历史档
|
| | | List<OrderDetlField> orderDetlFields = orderDetlFieldService.list(new LambdaQueryWrapper<OrderDetlField>().eq(OrderDetlField::getDetlId, orderDetl.getId()));
|
| | | for (OrderDetlField orderDetlField : orderDetlFields) {
|
| | | OrderDetlFieldLog orderDetlFieldLog = new OrderDetlFieldLog();
|
| | | orderDetlFieldLog.sync(orderDetlField);
|
| | | if(!orderDetlFieldLogService.save(orderDetlFieldLog)) {
|
| | | throw new CoolException("明细扩展字段转历史档失败");
|
| | | }
|
| | |
|
| | | //明细扩展字段转历史档
|
| | | List<OrderDetlField> orderDetlFields = orderDetlFieldService.list(new LambdaQueryWrapper<OrderDetlField>().eq(OrderDetlField::getDetlId, orderDetl.getId()));
|
| | | for (OrderDetlField orderDetlField : orderDetlFields) {
|
| | | OrderDetlFieldLog orderDetlFieldLog = new OrderDetlFieldLog();
|
| | | orderDetlFieldLog.sync(orderDetlField);
|
| | | if(!orderDetlFieldLogService.save(orderDetlFieldLog)) {
|
| | | throw new CoolException("明细扩展字段转历史档失败");
|
| | | }
|
| | |
|
| | | //删除明细扩展字段
|
| | | if (!orderDetlFieldService.removeById(orderDetlField.getId())) {
|
| | | throw new CoolException("删除明细扩展字段失败");
|
| | | }
|
| | | }
|
| | |
|
| | | //删除订单明细
|
| | | if (!orderDetlService.removeById(orderDetl)) {
|
| | | throw new CoolException("删除订单明细失败");
|
| | | //删除明细扩展字段
|
| | | if (!orderDetlFieldService.removeById(orderDetlField.getId())) {
|
| | | throw new CoolException("删除明细扩展字段失败");
|
| | | }
|
| | | }
|
| | |
|
| | | //删除订单
|
| | | if (!orderService.removeById(order.getId())) {
|
| | | throw new CoolException("删除订单失败");
|
| | | //删除订单明细
|
| | | if (!orderDetlService.removeById(orderDetl)) {
|
| | | throw new CoolException("删除订单明细失败");
|
| | | }
|
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
| | | }finally {
|
| | | InterceptorIgnoreHelper.clearIgnoreStrategy();
|
| | | //删除订单
|
| | | if (!orderService.removeById(order.getId())) {
|
| | | throw new CoolException("删除订单失败");
|
| | | }
|
| | | }
|
| | | }
|
| | |
|