dev:并发问题修改、数字孪生新增接口
This commit is contained in:
@@ -39,4 +39,28 @@ public class LmsToBigScreenController {
|
||||
return new ResponseEntity<>(LmsToBigScreenService.getStructInfo(jo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getMonthFreight")
|
||||
@Log("当月发货运费信息")
|
||||
@ApiOperation("当月发货运费信息")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> getMonthFreight(@RequestBody JSONObject jo) {
|
||||
return new ResponseEntity<>(LmsToBigScreenService.getMonthFreight(jo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getMonthYield")
|
||||
@Log("当月产量信息")
|
||||
@ApiOperation("当月产量信息")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> getMonthYield(@RequestBody JSONObject jo) {
|
||||
return new ResponseEntity<>(LmsToBigScreenService.getMonthYield(jo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getMonthDelivery")
|
||||
@Log("当月发货信息")
|
||||
@ApiOperation("当月发货信息")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> getMonthDelivery(@RequestBody JSONObject jo) {
|
||||
return new ResponseEntity<>(LmsToBigScreenService.getMonthDelivery(jo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,4 +8,7 @@ public interface LmsToBigScreenService {
|
||||
JSONObject getDeviceInfo(JSONObject jo);
|
||||
|
||||
JSONArray getStructInfo(JSONObject jo);
|
||||
JSONArray getMonthFreight(JSONObject jo);
|
||||
JSONArray getMonthYield(JSONObject jo);
|
||||
JSONArray getMonthDelivery(JSONObject jo);
|
||||
}
|
||||
|
||||
@@ -43,6 +43,21 @@ public class LmsToBigScreenServiceImpl implements LmsToBigScreenService {
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getMonthFreight(JSONObject jo) {
|
||||
return WQL.getWO("AUTO_QUERYTASK").addParam("flag","4").process().getResultJSONArray(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getMonthYield(JSONObject jo) {
|
||||
return WQL.getWO("AUTO_QUERYTASK").addParam("flag","5").process().getResultJSONArray(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getMonthDelivery(JSONObject jo) {
|
||||
return WQL.getWO("AUTO_QUERYTASK").addParam("flag","6").process().getResultJSONArray(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getStructInfo(JSONObject jo) {
|
||||
JSONArray rows = WQLObject.getWQLObject("st_ivt_structattr").query("sect_code IN ('ZC01','KTP01','ZZ01','PD01')").getResultJSONArray(0);
|
||||
|
||||
@@ -89,4 +89,78 @@
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "4"
|
||||
QUERY
|
||||
SELECT
|
||||
MAX( a.bill_type ) AS bill_type,
|
||||
SUM( sub.box_weight ) AS total_qty,
|
||||
MAX( a.bill_code ) AS bill_code,
|
||||
MAX( a.estimated_freight ) AS estimated_freight,
|
||||
MAX( a.run_freight ) AS run_freight,
|
||||
MAX( a.unload_freight ) AS unload_freight,
|
||||
MAX( a.other_freight ) AS other_freight,
|
||||
MAX(a.input_time) input_time
|
||||
FROM
|
||||
st_ivt_iostorinv a
|
||||
INNER JOIN (
|
||||
SELECT
|
||||
mst.iostorinv_id,
|
||||
dis.storagevehicle_code
|
||||
FROM
|
||||
st_ivt_iostorinv mst
|
||||
LEFT JOIN st_ivt_iostorinvdis dis ON dis.iostorinv_id = mst.iostorinv_id
|
||||
WHERE
|
||||
( mst.bill_type = '1004' OR mst.bill_type = '1001' )
|
||||
AND mst.bill_status = '99'
|
||||
AND mst.is_delete = '0'
|
||||
AND DATE_FORMAT( mst.input_time, '%Y-%m' ) = DATE_FORMAT( NOW(), '%Y-%m' )
|
||||
GROUP BY
|
||||
dis.storagevehicle_code,
|
||||
mst.iostorinv_id
|
||||
) b ON a.iostorinv_id = b.iostorinv_id
|
||||
LEFT JOIN pdm_bi_subpackagerelationrecord sub ON sub.package_box_sn = b.storagevehicle_code
|
||||
AND sub.bill_id = b.iostorinv_id
|
||||
GROUP BY
|
||||
a.iostorinv_id
|
||||
ORDER BY
|
||||
bill_code
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "5"
|
||||
QUERY
|
||||
SELECT
|
||||
date_of_FG_inbound,
|
||||
sum( net_weight ) AS qty
|
||||
FROM
|
||||
pdm_bi_subpackagerelation sub
|
||||
WHERE
|
||||
DATE_FORMAT( sub.date_of_FG_inbound, '%Y-%m' ) = DATE_FORMAT( NOW(), '%Y-%m' )
|
||||
GROUP BY
|
||||
date_of_FG_inbound
|
||||
ORDER BY
|
||||
date_of_FG_inbound
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "6"
|
||||
QUERY
|
||||
SELECT
|
||||
DATE_FORMAT( mst.input_time, '%Y-%m-%d' ) date,
|
||||
sum( mst.total_qty ) total_qty
|
||||
FROM
|
||||
ST_IVT_IOStorInv mst
|
||||
WHERE mst.bill_type IN ( '1001', '1004' )
|
||||
AND substr( mst.confirm_time, 1, 7 )<> ''
|
||||
AND DATE_FORMAT( mst.input_time, '%Y-%m' ) = DATE_FORMAT( NOW(), '%Y-%m' )
|
||||
GROUP BY
|
||||
DATE_FORMAT( mst.input_time, '%Y-%m-%d' )
|
||||
ORDER BY
|
||||
date
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -133,7 +133,7 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
mst_jo.put("biz_date", DateUtil.now());
|
||||
|
||||
RLock lock = redissonClient.getLock("pda_ioIn");
|
||||
boolean tryLock = lock.tryLock(5, TimeUnit.SECONDS);
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
if (option.equals("1")) {
|
||||
@@ -330,6 +330,8 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
inbillService.confirmDis(dis_form);
|
||||
|
||||
}
|
||||
}else {
|
||||
throw new BadRequestException("其他木箱当前正在分配货位,请等待几秒再进行操作!");
|
||||
}
|
||||
|
||||
} finally {
|
||||
|
||||
@@ -708,25 +708,29 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
}
|
||||
|
||||
RLock lock = redissonClient.getLock("all_div");
|
||||
boolean tryLock = lock.tryLock(5, TimeUnit.SECONDS);
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
|
||||
try {
|
||||
for (String vehicle_code : vehicle_set) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "4");
|
||||
map.put("iostorinv_id", iostorinv_id);
|
||||
map.put("package_box_sn", vehicle_code);
|
||||
JSONArray dtl_rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(map).process().getResultJSONArray(0);
|
||||
List<Map> list = new ArrayList<>();
|
||||
for (int i = 0; i < dtl_rows.size(); i++) {
|
||||
JSONObject jo = dtl_rows.getJSONObject(i);
|
||||
list.add(JSON.parseObject(jo.toString(),Map.class));
|
||||
if (tryLock) {
|
||||
for (String vehicle_code : vehicle_set) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "4");
|
||||
map.put("iostorinv_id", iostorinv_id);
|
||||
map.put("package_box_sn", vehicle_code);
|
||||
JSONArray dtl_rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(map).process().getResultJSONArray(0);
|
||||
List<Map> list = new ArrayList<>();
|
||||
for (int i = 0; i < dtl_rows.size(); i++) {
|
||||
JSONObject jo = dtl_rows.getJSONObject(i);
|
||||
list.add(JSON.parseObject(jo.toString(),Map.class));
|
||||
}
|
||||
Map<String,Object> dis_map = new HashMap<>();
|
||||
dis_map.put("tableMater",list);
|
||||
dis_map.put("sect_id",sect_id);
|
||||
dis_map.put("checked",true);
|
||||
this.divStruct(dis_map);
|
||||
}
|
||||
Map<String,Object> dis_map = new HashMap<>();
|
||||
dis_map.put("tableMater",list);
|
||||
dis_map.put("sect_id",sect_id);
|
||||
dis_map.put("checked",true);
|
||||
this.divStruct(dis_map);
|
||||
}else {
|
||||
throw new BadRequestException("其他入库单当前正在分配货位,请等待几秒再进行操作!");
|
||||
}
|
||||
}finally {
|
||||
if (tryLock) {
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
WHERE
|
||||
b.io_type = '1'
|
||||
OPTION 输入.bill_type <> ""
|
||||
b.bill_type = 输入.bill_type
|
||||
b.bill_type IN 输入.bill_type
|
||||
ENDOPTION
|
||||
OPTION 输入.pcsn <> ""
|
||||
a.pcsn = 输入.pcsn
|
||||
@@ -187,7 +187,7 @@
|
||||
WHERE
|
||||
b.io_type = '1'
|
||||
OPTION 输入.bill_type <> ""
|
||||
b.bill_type = 输入.bill_type
|
||||
b.bill_type IN 输入.bill_type
|
||||
ENDOPTION
|
||||
OPTION 输入.pcsn <> ""
|
||||
a.pcsn = 输入.pcsn
|
||||
|
||||
Reference in New Issue
Block a user