代码更新
This commit is contained in:
@@ -111,4 +111,12 @@ public class PointController {
|
||||
pointService.changeLock(jsonObject);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("仓位同步")
|
||||
@PostMapping("/sync")
|
||||
@ApiOperation("仓位同步")
|
||||
public ResponseEntity<Object> sync() {
|
||||
pointService.sync();
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,4 +96,9 @@ public interface PointService {
|
||||
* @param jsonObject
|
||||
*/
|
||||
void changeLock(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* 仓位同步
|
||||
*/
|
||||
void sync();
|
||||
}
|
||||
|
||||
@@ -301,6 +301,51 @@ public class PointServiceImpl implements PointService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void sync() {
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_base_point");
|
||||
|
||||
// 先删除所有点位类型为仓位的点位
|
||||
WQLObject.getWQLObject("sch_base_point").delete(" point_type = '01'");
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "2");
|
||||
JSONArray arrStruct = WQL.getWO("QSCH_BASE_POINT").addParamMap(map).process().getResultJSONArray(0);
|
||||
|
||||
for (int i = 0; i < arrStruct.size(); i++) {
|
||||
JSONObject json = arrStruct.getJSONObject(i);
|
||||
JSONObject structMap = new JSONObject();
|
||||
structMap.put("point_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
structMap.put("point_code", json.getString("struct_code"));
|
||||
structMap.put("point_name", json.getString("struct_name"));
|
||||
structMap.put("region_id", "");
|
||||
structMap.put("region_code", "");
|
||||
structMap.put("region_name", "");
|
||||
structMap.put("point_type", "01");
|
||||
structMap.put("point_status", "00");
|
||||
structMap.put("lock_type", "1");
|
||||
structMap.put("block_num", json.getIntValue("block_num"));
|
||||
structMap.put("row_num", json.getIntValue("row_num"));
|
||||
structMap.put("col_num", json.getIntValue("col_num"));
|
||||
structMap.put("layer_num", json.getIntValue("layer_num"));
|
||||
structMap.put("source_id", json.getString("struct_id"));
|
||||
structMap.put("create_id", currentUserId);
|
||||
structMap.put("create_name", nickName);
|
||||
structMap.put("create_time", now);
|
||||
structMap.put("update_optid", currentUserId);
|
||||
structMap.put("update_optname", nickName);
|
||||
structMap.put("update_time", now);
|
||||
wo.insert(structMap);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//根据重量返回最大的 级数
|
||||
public String getLoadSeriesByqty(Double qty) {
|
||||
JSONArray dictArr = WQLObject.getWQLObject("sys_dict_detail").query("dict_id ='108'", "label").getResultJSONArray(0);
|
||||
|
||||
@@ -180,6 +180,17 @@
|
||||
>
|
||||
解锁
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-refresh"
|
||||
@click="sync"
|
||||
:loading="sync_flag"
|
||||
>
|
||||
仓位同步
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
@@ -326,7 +337,7 @@
|
||||
|
||||
<script>
|
||||
import crudRegion from '@/views/wms/sch/region'
|
||||
import crudPoint, { changeActive } from '@/views/wms/sch/point'
|
||||
import crudPoint, { changeActive } from '@/views/wms/sch/point/point'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
@@ -357,6 +368,7 @@ export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
sync_flag: false,
|
||||
syncLoading: false,
|
||||
invtypelist: [],
|
||||
pointStatusList: [],
|
||||
@@ -458,6 +470,15 @@ export default {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
sync() {
|
||||
this.sync_flag = true
|
||||
crudPoint.sync().then(res => {
|
||||
this.crud.notify('同步成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.sync_flag = false
|
||||
}).cache(() => {
|
||||
this.sync_flag = false
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -68,4 +68,11 @@ export function changeLock(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, changeActive, findPoints, getPoint, getRegion, changeUsed, changeLock }
|
||||
export function sync() {
|
||||
return request({
|
||||
url: 'api/point/sync',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, changeActive, findPoints, getPoint, getRegion, changeUsed, changeLock, sync }
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudTask from '@/views/wms/sch/task'
|
||||
import crudTask from '@/views/wms/sch/task/task'
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
|
||||
Reference in New Issue
Block a user