Commit 1c5fc5b59721b7bad6e4b149e24b0706c258ca45

Authored by 谭毅彬
1 parent 6bbac863

扫码首页添加

Signed-off-by: TanYibin <5491541@qq.com>
ant-design-vue-jeecg/src/components/lang/en-US.js
... ... @@ -66,6 +66,7 @@ export default {
66 66 inputScanCodeText: 'Please input scan code text',
67 67 status: 'Status',
68 68 selectStatus: 'Please select status',
  69 + scanSuccessful: 'Scan successful',
69 70 },
70 71 pallet: {
71 72 id: 'Task ID',
... ...
ant-design-vue-jeecg/src/components/lang/zh-CN.js
... ... @@ -66,6 +66,7 @@ export default {
66 66 inputScanCodeText: '请输入扫码文本',
67 67 status: '状态',
68 68 selectStatus: '请选择扫码文本',
  69 + scanSuccessful: '扫描成功',
69 70 },
70 71 pallet: {
71 72 id: '任务 ID',
... ...
ant-design-vue-jeecg/src/views/dashboard/Analysis.vue
1 1 <template>
2   - <div>
3   - <a-row :gutter="24"> </a-row>
4   -
5   - <a-row :gutter="24">
6   - <a-col :span="12">
7   - <a-card :bordered="false" title="历史每日收发货量" :style="{ marginTop: '24px' }">
8   - <a-row>
9   - <a-col :span="19">
10   - <div id="chart1" class="flot-chart1">
11   - 这里放图表
12   - </div>
13   - </a-col>
14   - </a-row>
15   - </a-card>
16   - </a-col>
17   - <a-col :span="12">
18   - <a-card :bordered="false" title="库位利用率" :style="{ marginTop: '24px' }">
19   - <a-row>
20   - <a-col :span="19">
21   - <div id="chart2" class="flot-chart1">
22   - 这里放图表
23   - </div>
24   - </a-col>
25   - </a-row>
26   - </a-card>
27   - </a-col>
28   - </a-row>
29   -
30   - <a-row :gutter="24">
31   - <a-col :span="12">
32   - <a-card :bordered="false" title="在线库存状态" :style="{ marginTop: '24px' }">
33   - <a-row>
34   - <a-col :span="19">
35   - <div id="chart3" class="flot-chart1">
36   - 这里放图表
37   - </div>
38   - </a-col>
39   - </a-row>
40   - </a-card>
41   - </a-col>
42   - <a-col :span="12">
43   - <a-card :bordered="false" title="库存概况" :style="{ marginTop: '24px' }">
44   - <a-row>
45   - <a-col :span="19">
46   - <div id="chart4" class="flot-chart1">
47   - 这里放图表
48   - </div>
49   - </a-col>
50   - </a-row>
51   - </a-card>
52   - </a-col>
53   - </a-row>
54   - </div>
  2 + <a-card :bordered="false">
  3 + <!-- 查询区域 -->
  4 + <div class="table-page-search-wrapper">
  5 + <a-form layout="inline" @keyup.enter.native="add">
  6 + <a-row :gutter="24">
  7 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  8 + <a-form-item :label="$t('scanin.scanCodeText')">
  9 + <a-input :placeholder="$t('scanin.inputScanCodeText')" v-model="queryParam.context" ref="input" @blur="focus"></a-input>
  10 + </a-form-item>
  11 + </a-col>
  12 + </a-row>
  13 + </a-form>
  14 + </div>
  15 + <!-- 查询区域-END -->
  16 +
  17 + <!-- table区域-begin -->
  18 + <div>
  19 + <a-table
  20 + ref="table"
  21 + size="middle"
  22 + :scroll="{ x: false }"
  23 + rowKey="id"
  24 + :columns="columns"
  25 + :dataSource="dataSource"
  26 + :pagination="false"
  27 + class="j-table-force-nowrap"
  28 + @change="handleTableChange"
  29 + ></a-table>
  30 + </div>
  31 + </a-card>
55 32 </template>
56 33  
57   -<script language="javascript"  type="text/javascript">
58   -import {} from '@/api/api'
  34 +<script>
  35 +import '@/assets/less/TableExpand.less'
  36 +import { mixinDevice } from '@/utils/mixin'
  37 +import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  38 +import { httpGroupRequest } from '@/api/GroupRequest.js'
  39 +import { getAction, postAction } from '@/api/manage'
59 40  
60 41 export default {
61   - name: 'Echartdemo',
  42 + name: 'ScaninRecordList',
  43 + mixins: [JeecgListMixin, mixinDevice],
  44 + props: ['groupId'],
  45 + components: {},
62 46 data() {
63 47 return {
64   - msg: 'EChart demo',
65   - s1: '0',
66   - s2: '0',
67   - s3: '0',
68   - s4: '0',
69   - s5: '0',
70   - s6: '0'
  48 + description: '上线扫码管理页面',
  49 + dataSource: [],
  50 + isorter: {
  51 + column: 'createTime',
  52 + order: 'desc'
  53 + },
  54 + // 表头
  55 + columns: [
  56 + {
  57 + title: 'ID',
  58 + align: 'center',
  59 + dataIndex: 'id'
  60 + },
  61 + {
  62 + title: this.$t('scanin.scanCodeText'),
  63 + align: 'center',
  64 + dataIndex: 'context'
  65 + },
  66 + {
  67 + title: this.$t('scanin.status'),
  68 + align: 'center',
  69 + dataIndex: 'status'
  70 + },
  71 + {
  72 + title: this.$t('system.remark'),
  73 + align: 'center',
  74 + dataIndex: 'remark'
  75 + },
  76 + {
  77 + title: this.$t('system.createTime'),
  78 + align: 'center',
  79 + dataIndex: 'createTime'
  80 + },
  81 + {
  82 + title: this.$t('system.updateTime'),
  83 + align: 'center',
  84 + dataIndex: 'updateTime'
  85 + }
  86 + ],
  87 + url: {
  88 + list: '/scan/scaninRecord/list',
  89 + add: '/scan/scaninRecord/add'
  90 + },
  91 + dictOptions: {},
  92 + superFieldList: []
71 93 }
72 94 },
73 95 mounted() {
74   - this.drawLine()
  96 + // 每隔3秒定时刷新
  97 + this.timer = setInterval(() => {
  98 + this.loadPeriodData()
  99 + }, 30000)
  100 + },
  101 + created() {
  102 + this.$nextTick(() => this.$refs.input.focus())
  103 + this.getSuperFieldList()
  104 + },
  105 + computed: {
  106 + importExcelUrl: function() {
  107 + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
  108 + }
75 109 },
76 110 methods: {
77   - drawLine() {
78   - let chart1 = this.$echarts.init(document.getElementById('chart1'))
79   - let chart2 = this.$echarts.init(document.getElementById('chart2'))
80   - let chart3 = this.$echarts.init(document.getElementById('chart3'))
81   - let chart4 = this.$echarts.init(document.getElementById('chart4'))
82   -
83   - // deliveringAmount().then(res => {
84   - // if (res.success) {
85   - // chart1.setOption(JSON.parse(res.message))
86   - // }
87   - // })
88   - // inventoryUtilization().then(res => {
89   - // if (res.success) {
90   - // chart2.setOption(JSON.parse(res.message))
91   - // }
92   - // })
93   - // inventoryStatus().then(res => {
94   - // if (res.success) {
95   - // chart3.setOption(JSON.parse(res.message))
96   - // }
97   - // })
98   - // inventoryOverview().then(res => {
99   - // if (res.success) {
100   - // chart4.setOption(JSON.parse(res.message))
101   - // }
102   - // })
103   - // getCommonData().then(res => {
104   - // if (res.success) {
105   - // this.s1 = res.result.bllCount
106   - // this.s2 = res.result.receiptTotal
107   - // this.s3 = res.result.shipmentTotal
108   - // this.s4 = res.result.inventoryTotal
109   - // this.s5 = res.result.materialCount
110   - // this.s6 = res.result.taskUncompletedTotal
111   - // }
112   - // })
  111 + focus() {
  112 + this.$nextTick(() => this.$refs.input.focus())
  113 + },
  114 + add() {
  115 + let params = Object.assign({}, this.queryParam, this.isorter)
  116 + let url = `${this.url.add}`
  117 + //缓存key
  118 + let groupIdKey
  119 + if (this.groupId) {
  120 + groupIdKey = this.groupId + url
  121 + }
  122 + httpGroupRequest(() => postAction(url, params), groupIdKey).then(res => {
  123 + if (res.success) {
  124 + if (res.message != '') {
  125 + this.$notification.success({
  126 + message: this.$t('system.systemMessage'),
  127 + description: this.queryParam.context + ' ' + this.$t('scanin.scanSuccessful')
  128 + })
  129 + this.loadPeriodData()
  130 + }
  131 + } else {
  132 + this.$notification.error({
  133 + message: this.$t('system.systemMessage'),
  134 + description: res.message
  135 + })
  136 + }
  137 + this.searchReset()
  138 + })
  139 + },
  140 + initDictConfig() {},
  141 + getSuperFieldList() {
  142 + let fieldList = []
  143 + fieldList.push({ type: 'string', value: 'context', text: 'context', dictCode: '' })
  144 + fieldList.push({ type: 'string', value: 'status', text: 'status', dictCode: '' })
  145 + this.superFieldList = fieldList
  146 + },
  147 + async loadPeriodData() {
  148 + let params = Object.assign({}, null, this.isorter)
  149 + let url = `${this.url.list}`
  150 + //缓存key
  151 + let groupIdKey
  152 + if (this.groupId) {
  153 + groupIdKey = this.groupId + url
  154 + }
  155 + httpGroupRequest(() => getAction(url, params), groupIdKey).then(res => {
  156 + let data = res.result
  157 + console.info(data.records)
  158 + if (data.length > 0) {
  159 + this.dataSource = data
  160 + } else {
  161 + this.dataSource = []
  162 + }
  163 + })
113 164 }
114 165 }
115 166 }
116 167 </script>
117   -
118 168 <style scoped>
119   -@media (min-width: 768px) {
120   - .col-sm-2 {
121   - float: left;
122   - }
123   -
124   - .col-sm-2 {
125   - width: 16.66666667%;
126   - }
127   -}
128   -
129   -.panel-heading h1,
130   -.panel-heading h2 {
131   - margin-bottom: 5px;
132   -}
133   -
134   -.ibox-content h1,
135   -.ibox-content h2,
136   -.ibox-content h3,
137   -.ibox-content h4,
138   -.ibox-content h5,
139   -.ibox-title h1,
140   -.ibox-title h2,
141   -.ibox-title h3,
142   -.ibox-title h4,
143   -.ibox-title h5 {
144   - margin-top: 5px;
145   -}
146   -
147   -h1 {
148   - font-size: 30px;
149   - color: #fff;
150   -}
151   -
152   -.total_box {
153   - text-align: center;
154   - color: #fff;
155   - padding: 8px 0 10px 0;
156   -}
157   -
158   -.total_box:hover {
159   - opacity: 0.8;
160   -}
161   -
162   -.ys01 {
163   - background: #1ab394;
164   -}
165   -
166   -.ys02 {
167   - background: #23c6c8;
168   -}
169   -
170   -.ys03 {
171   - background: #1c84c6;
172   -}
173   -
174   -.ys04 {
175   - background: #8d95c5;
176   -}
177   -
178   -.ys05 {
179   - background: #e59aa6;
180   -}
181   -
182   -.ys06 {
183   - background: #f8ac59;
184   -}
185   -
186   -.flot-chart1 {
187   - height: 290px;
188   -}
  169 +@import '~@assets/less/common.less';
189 170 </style>
190 171 \ No newline at end of file
... ...
ant-design-vue-jeecg/src/views/scanin/ScaninRecordList.vue
... ... @@ -6,7 +6,7 @@
6 6 <a-row :gutter="24">
7 7 <a-col :xl="6" :lg="7" :md="8" :sm="24">
8 8 <a-form-item :label="$t('scanin.scanCodeText')">
9   - <a-input :placeholder="$t('scanin.inputScanCodeText')" v-model="queryParam.context"></a-input>
  9 + <j-input :placeholder="$t('scanin.inputScanCodeText')" v-model="queryParam.context"></j-input>
10 10 </a-form-item>
11 11 </a-col>
12 12 <a-col :xl="6" :lg="7" :md="8" :sm="24">
... ... @@ -31,18 +31,12 @@
31 31 </div>
32 32 <!-- 查询区域-END -->
33 33  
34   - <!-- 操作按钮区域 -->
35   - <div class="table-operator">
36   - <a-button @click="handleAdd" type="primary" icon="plus">{{ $t('button.new') }}</a-button>
37   - </div>
38   -
39 34 <!-- table区域-begin -->
40 35 <div>
41 36 <a-table
42 37 ref="table"
43 38 size="middle"
44   - :scroll="{ x: true }"
45   - bordered
  39 + :scroll="{ x: false }"
46 40 rowKey="id"
47 41 :columns="columns"
48 42 :dataSource="dataSource"
... ... @@ -117,7 +111,7 @@ export default {
117 111 }
118 112 ],
119 113 url: {
120   - list: '/scan/scaninRecord/list',
  114 + list: '/scan/scaninRecord/pagelist',
121 115 delete: '/scan/scaninRecord/delete',
122 116 deleteBatch: '/scan/scaninRecord/deleteBatch',
123 117 exportXlsUrl: '/scan/scaninRecord/exportXls',
... ...
ant-design-vue-jeecg/src/views/scanin/modules/ScaninRecordForm.vue
... ... @@ -13,6 +13,11 @@
13 13 <a-input v-model="model.context" :placeholder="$t('scanin.inputScanCodeText')"></a-input>
14 14 </a-form-model-item>
15 15 </a-col>
  16 + <a-col :span="24">
  17 + <a-form-model-item :label="$t('scanin.status')" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status" >
  18 + <j-dict-select-tag type="list" v-model="model.status" dictCode="scan_record_status" :placeholder="$t('scanin.selectStatus')" />
  19 + </a-form-model-item>
  20 + </a-col>
16 21 </a-row>
17 22 </a-form-model>
18 23 </j-form-container>
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/LoginController.java
... ... @@ -144,7 +144,7 @@ public class LoginController {
144 144 String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt());
145 145 String syspassword = sysUser.getPassword();
146 146 if (!syspassword.equals(userpassword)) {
147   - result.error500("Invalid username or password");
  147 + result.error500("The password is incorrect");
148 148 return result;
149 149 }
150 150 // 激活信息认证
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
... ... @@ -394,8 +394,8 @@ public class SysUserServiceImpl extends ServiceImpl&lt;SysUserMapper, SysUser&gt; impl
394 394 Result<JSONObject> result = new Result<JSONObject>();
395 395 // 情况1:根据用户信息查询,该用户不存在
396 396 if (sysUser == null) {
397   - result.error500("该用户不存在,请注册");
398   - baseCommonService.addLog("用户登录失败,用户不存在!", CommonConstant.LOG_TYPE_1, null);
  397 + result.error500("User account does not exist");
  398 + baseCommonService.addLog("User account does not exist", CommonConstant.LOG_TYPE_1, null);
399 399 return result;
400 400 }
401 401 // 情况2:根据用户信息查询,该用户已注销
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wcs/job/ScaninRecordParseTask.java
... ... @@ -84,6 +84,7 @@ public class ScaninRecordParseTask implements Job {
84 84 String[] contexts = scaninRecord.getContext().split(SCAN_CONTEXTS_REGEX);
85 85 try {
86 86 PalletTaskDto palletTaskDto = new PalletTaskDto();
  87 + palletTaskDto.setScaninRecordId(scaninRecord.getId());
87 88 palletTaskDto.setContainerCode(contexts[0]);
88 89 if (SCAN_CONTEXTS_LENGTH.equals(contexts.length)) {
89 90 palletTaskDto.setBatch(contexts[1]);
... ... @@ -91,9 +92,6 @@ public class ScaninRecordParseTask implements Job {
91 92 palletTaskDto.setWarehouseCode(leCangWarehouseCode);
92 93 palletTaskDto.setStationCode(stationCode);
93 94 palletTaskService.generatePalletTaskInfo(palletTaskDto);
94   - scaninRecordUpdateWrapper.eq(ScaninRecord::getId, scaninRecord.getId()).eq(ScaninRecord::getStatus, QuantityConstant.SCAN_RECORD_STATUS_UNMATCH)
95   - .set(ScaninRecord::getStatus, QuantityConstant.SCAN_RECORD_STATUS_MATCHED);
96   - scaninRecordService.update(new ScaninRecord(), scaninRecordUpdateWrapper);
97 95 } catch (Exception e) {
98 96 log.error("生成托盘任务失败,scaninContext:{},等待下一次重试", e);
99 97 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wcs/scan/controller/ScaninRecordController.java
1 1 package org.jeecg.modules.wcs.scan.controller;
2 2  
3 3 import java.util.Arrays;
  4 +import java.util.List;
4 5  
5 6 import javax.servlet.http.HttpServletRequest;
6 7 import javax.servlet.http.HttpServletResponse;
  8 +import javax.transaction.Transactional;
7 9  
8 10 import org.jeecg.common.api.vo.Result;
9 11 import org.jeecg.common.aspect.annotation.AutoLog;
... ... @@ -23,6 +25,7 @@ import org.springframework.web.bind.annotation.RequestParam;
23 25 import org.springframework.web.bind.annotation.RestController;
24 26 import org.springframework.web.servlet.ModelAndView;
25 27  
  28 +import com.aliyuncs.utils.StringUtils;
26 29 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
27 30 import com.baomidou.mybatisplus.core.metadata.IPage;
28 31 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
... ... @@ -55,7 +58,7 @@ public class ScaninRecordController extends JeecgController&lt;ScaninRecord, IScani
55 58 */
56 59 // @AutoLog(value = "scaninRecord-分页列表查询")
57 60 @ApiOperation(value = "scaninRecord-分页列表查询", notes = "scaninRecord-分页列表查询")
58   - @GetMapping(value = "/list")
  61 + @GetMapping(value = "/pagelist")
59 62 public Result<IPage<ScaninRecord>> queryPageList(ScaninRecord scaninRecord, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
60 63 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
61 64 QueryWrapper<ScaninRecord> queryWrapper = QueryGenerator.initQueryWrapper(scaninRecord, req.getParameterMap());
... ... @@ -64,6 +67,14 @@ public class ScaninRecordController extends JeecgController&lt;ScaninRecord, IScani
64 67 return Result.OK(pageList);
65 68 }
66 69  
  70 + @GetMapping(value = "/list")
  71 + public Result<List<ScaninRecord>> list(HttpServletRequest req) {
  72 + QueryWrapper<ScaninRecord> queryWrapper = QueryGenerator.initQueryWrapper(new ScaninRecord(), req.getParameterMap());
  73 + queryWrapper.last("limit 30");
  74 + List<ScaninRecord> list = scaninRecordService.list(queryWrapper);
  75 + return Result.OK(list);
  76 + }
  77 +
67 78 /**
68 79 * 添加
69 80 * @param scaninRecord
... ... @@ -73,9 +84,12 @@ public class ScaninRecordController extends JeecgController&lt;ScaninRecord, IScani
73 84 @ApiOperation(value = "scaninRecord-添加", notes = "scaninRecord-添加")
74 85 @PostMapping(value = "/add")
75 86 public Result<String> add(@RequestBody ScaninRecord scaninRecord) {
76   - scaninRecord.setStatus(QuantityConstant.SCAN_RECORD_STATUS_UNMATCH);
77   - scaninRecordService.save(scaninRecord);
78   - return Result.OK("添加成功!");
  87 + if (scaninRecord != null && !StringUtils.isEmpty(scaninRecord.getContext())) {
  88 + scaninRecord.setStatus(QuantityConstant.SCAN_RECORD_STATUS_UNMATCH);
  89 + scaninRecordService.save(scaninRecord);
  90 + return Result.OK("添加成功!");
  91 + }
  92 + return Result.OK();
79 93 }
80 94  
81 95 /**
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wcs/task/dto/PalletTaskDto.java
... ... @@ -11,6 +11,8 @@ public class PalletTaskDto implements Serializable {
11 11  
12 12 private static final long serialVersionUID = 6796757353133379454L;
13 13  
  14 + private Integer scaninRecordId;
  15 +
14 16 @NotNull(message = "warehouseCode is empty")
15 17 private String warehouseCode;
16 18  
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wcs/task/service/impl/PalletTaskServiceImpl.java
... ... @@ -31,6 +31,8 @@ import org.springframework.transaction.annotation.Transactional;
31 31  
32 32 import com.alibaba.fastjson.JSON;
33 33 import com.alibaba.fastjson.TypeReference;
  34 +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  35 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
34 36 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
35 37  
36 38 /**
... ... @@ -43,6 +45,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
43 45 public class PalletTaskServiceImpl extends ServiceImpl<PalletTaskMapper, PalletTask> implements IPalletTaskService {
44 46  
45 47 @Autowired
  48 + private IScaninRecordService scaninRecordService;
  49 +
  50 + @Autowired
46 51 private PalletTaskMapper palletTaskMapper;
47 52  
48 53 @Autowired
... ... @@ -125,5 +130,12 @@ public class PalletTaskServiceImpl extends ServiceImpl&lt;PalletTaskMapper, PalletT
125 130 palletBillList.add(palletBill);
126 131 }
127 132 palletBillService.saveBatch(palletBillList);
  133 + LambdaUpdateWrapper<ScaninRecord> scaninRecordUpdateWrapper = Wrappers.lambdaUpdate();
  134 + scaninRecordUpdateWrapper.eq(ScaninRecord::getId, palletTaskDto.getScaninRecordId()).eq(ScaninRecord::getStatus, QuantityConstant.SCAN_RECORD_STATUS_UNMATCH)
  135 + .set(ScaninRecord::getStatus, QuantityConstant.SCAN_RECORD_STATUS_MATCHED);
  136 + Boolean isUpdate = scaninRecordService.update(new ScaninRecord(), scaninRecordUpdateWrapper);
  137 + if (isUpdate == false) {
  138 + throw new JeecgBootException("更新扫码记录状态异常");
  139 + }
128 140 }
129 141 }
... ...