rev:1.入库管理新增导出功能2.二期出库堆叠增加接口acs申请强制离开
This commit is contained in:
@@ -231,4 +231,11 @@ public class AcsToWmsController {
|
||||
public ResponseEntity<Object> acsCallShaftFromCache(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(acsToWmsService.acsCallShaftFromCache(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/forceMove")
|
||||
@Log(value = "二期捆扎位ACS请求强制离开", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> forceMove(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(acsToWmsService.forceMove(param), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,4 +225,13 @@ public interface AcsToWmsService {
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject getIsUncap(JSONObject param);
|
||||
|
||||
/**
|
||||
* 二期捆扎位ACS请求强制离开
|
||||
* @param param:{
|
||||
* deviceCode: 捆扎点位
|
||||
* }
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject forceMove(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.b_lms.pda.service.ProductOutTwoService;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.IPdmBiSlittingproductionplanService;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
@@ -155,6 +156,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
private final OutBussManageService outBussManageService;
|
||||
|
||||
@Autowired
|
||||
private ProductOutTwoService productOutTwoService;
|
||||
|
||||
|
||||
/**
|
||||
* task_id:任务标识
|
||||
@@ -2665,4 +2669,25 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
jsonObject.put("status", HttpStatus.OK.value());
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public JSONObject forceMove(JSONObject param) {
|
||||
log.info("forceMove请求参数:---------------------------------------------{}", param.toString());
|
||||
String deviceCode = param.getString("deviceCode");
|
||||
if (ObjectUtil.isEmpty(deviceCode)) {
|
||||
throw new BadRequestException("捆扎点位不能为空!");
|
||||
}
|
||||
|
||||
// 调用强制放行
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("point_code", deviceCode);
|
||||
productOutTwoService.confirmPass(json);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("code", cn.hutool.http.HttpStatus.HTTP_OK);
|
||||
result.put("message", "ACS申请强制放行成功!");
|
||||
log.info("forceMove返回参数:---------------------------------------------{}", result.toString());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@@ -277,4 +279,10 @@ public class RawAssistIStorController {
|
||||
rawAssistIStorService.autoDis(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
public void download(@RequestParam Map map, HttpServletResponse response) throws IOException {
|
||||
rawAssistIStorService.download(map, response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
public interface RawAssistIStorService {
|
||||
@@ -62,4 +64,13 @@ public interface RawAssistIStorService {
|
||||
|
||||
JSONObject autoDisMove(JSONObject whereJson);
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*
|
||||
* @param map 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(Map map, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
||||
@@ -12,9 +12,11 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.modules.common.utils.FileUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
@@ -42,6 +44,8 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -1865,6 +1869,161 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
return struct_jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void download(Map whereJson, HttpServletResponse response) throws IOException {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "1");
|
||||
map.put("buss_type", (String) whereJson.get("buss_type"));
|
||||
map.put("stor_id", (String) whereJson.get("stor_id"));
|
||||
map.put("bill_type", (String) whereJson.get("bill_type"));
|
||||
map.put("create_mode", (String) whereJson.get("create_mode"));
|
||||
map.put("bill_status", (String) whereJson.get("bill_status"));
|
||||
|
||||
String bill_code = MapUtil.getStr(whereJson, "bill_code");
|
||||
String sap_pcsn = MapUtil.getStr(whereJson, "sap_pcsn");
|
||||
String pcsn = MapUtil.getStr(whereJson, "pcsn");
|
||||
String box_no = MapUtil.getStr(whereJson, "box_no");
|
||||
String vbeln = MapUtil.getStr(whereJson, "vbeln");
|
||||
|
||||
|
||||
if (!ObjectUtil.isEmpty(bill_code)) {
|
||||
map.put("bill_code", "%" + bill_code + "%");
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(pcsn)) {
|
||||
// 判断是否有空格
|
||||
boolean matches = pcsn.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = pcsn.split(" ");
|
||||
String pcsn_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("pcsn_in", "('"+pcsn_in+"')");
|
||||
} else {
|
||||
map.put("pcsn", "%" + pcsn + "%");
|
||||
}
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(sap_pcsn)) {
|
||||
// 判断是否有空格
|
||||
boolean matches = sap_pcsn.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = sap_pcsn.split(" ");
|
||||
String sap_pcsn_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("sap_pcsn_in", "('"+sap_pcsn_in+"')");
|
||||
} else {
|
||||
map.put("sap_pcsn", "%" + sap_pcsn + "%");
|
||||
}
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(box_no)) {
|
||||
// 判断是否有空格
|
||||
boolean matches = box_no.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = box_no.split(" ");
|
||||
String box_no_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("box_no_in", "('"+box_no_in+"')");
|
||||
} else {
|
||||
map.put("box_no", "%" + box_no + "%");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(vbeln)) {
|
||||
// 判断是否有空格
|
||||
boolean matches = vbeln.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = vbeln.split(" ");
|
||||
String vbeln_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("vbeln_in", "('"+vbeln_in+"')");
|
||||
} else {
|
||||
map.put("vbeln", "%" + vbeln + "%");
|
||||
}
|
||||
}
|
||||
|
||||
String begin_time = (String) whereJson.get("begin_time");
|
||||
|
||||
if (!StrUtil.isEmpty(begin_time)) {
|
||||
map.put("begin_time", begin_time);
|
||||
}
|
||||
String end_time = (String) whereJson.get("end_time");
|
||||
if (!StrUtil.isEmpty(end_time)) {
|
||||
map.put("end_time", end_time);
|
||||
}
|
||||
|
||||
//获取人员对应的仓库
|
||||
UserStorServiceImpl userStorService = new UserStorServiceImpl();
|
||||
String in_stor_id = userStorService.getInStor();
|
||||
|
||||
if (ObjectUtil.isNotEmpty(in_stor_id)) {
|
||||
map.put("in_stor_id", in_stor_id);
|
||||
}
|
||||
|
||||
JSONArray resultJSONArray = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(map).process().getResultJSONArray(0);
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (int i = 0; i < resultJSONArray.size(); i++) {
|
||||
JSONObject json = resultJSONArray.getJSONObject(i);
|
||||
|
||||
Map<String, Object> mp = new LinkedHashMap<>();
|
||||
mp.put("单据号", json.getString("bill_code"));
|
||||
|
||||
if (json.getString("bill_status").equals(IOSEnum.BILL_STATUS.code("生成"))) {
|
||||
mp.put("单据状态", "生成");
|
||||
} else if (json.getString("bill_status").equals(IOSEnum.BILL_STATUS.code("分配中"))) {
|
||||
mp.put("单据状态", "分配中");
|
||||
} else if (json.getString("bill_status").equals(IOSEnum.BILL_STATUS.code("分配完"))) {
|
||||
mp.put("单据状态", "分配完");
|
||||
} else if (json.getString("bill_status").equals(IOSEnum.BILL_STATUS.code("完成"))) {
|
||||
mp.put("单据状态", "完成");
|
||||
}
|
||||
mp.put("仓库", json.getString("stor_name"));
|
||||
|
||||
if (json.getString("bill_type").equals(IOSEnum.IN_TYPE.code("生产入库"))) {
|
||||
mp.put("业务类型", "生产入库");
|
||||
} else if (json.getString("bill_type").equals(IOSEnum.IN_TYPE.code("退货入库"))) {
|
||||
mp.put("业务类型", "退货入库");
|
||||
} else if (json.getString("bill_type").equals(IOSEnum.IN_TYPE.code("报废入库"))) {
|
||||
mp.put("业务类型", "报废入库");
|
||||
} else if (json.getString("bill_type").equals(IOSEnum.IN_TYPE.code("调拨入库"))) {
|
||||
mp.put("业务类型", "调拨入库");
|
||||
} else if (json.getString("bill_type").equals(IOSEnum.IN_TYPE.code("拆箱入库"))) {
|
||||
mp.put("业务类型", "拆箱入库");
|
||||
} else if (json.getString("bill_type").equals(IOSEnum.IN_TYPE.code("返检入库"))) {
|
||||
mp.put("业务类型", "返检入库");
|
||||
} else if (json.getString("bill_type").equals(IOSEnum.IN_TYPE.code("改切入库"))) {
|
||||
mp.put("业务类型", "改切入库");
|
||||
} else if (json.getString("bill_type").equals(IOSEnum.IN_TYPE.code("手工入库"))) {
|
||||
mp.put("业务类型", "手工入库");
|
||||
}
|
||||
mp.put("业务日期", json.getString("biz_date"));
|
||||
mp.put("明细数", json.getString("detail_count"));
|
||||
mp.put("总重量", NumberUtil.round(json.getDoubleValue("total_qty"), 3));
|
||||
mp.put("交货单", json.getString("vbeln"));
|
||||
mp.put("备注", json.getString("remark"));
|
||||
mp.put("制单人", json.getString("input_optname"));
|
||||
mp.put("制单时间", json.getString("input_time"));
|
||||
mp.put("修改人", json.getString("update_optname"));
|
||||
mp.put("修改时间", json.getString("update_time"));
|
||||
mp.put("分配人", json.getString("dis_optname"));
|
||||
mp.put("分配时间", json.getString("dis_time"));
|
||||
mp.put("确认人", json.getString("confirm_optname"));
|
||||
mp.put("确认时间", json.getString("confirm_time"));
|
||||
list.add(mp);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
public JSONObject autoDisMove2(JSONObject whereJson) {
|
||||
/*
|
||||
* 分配逻辑:
|
||||
|
||||
@@ -188,6 +188,16 @@
|
||||
>
|
||||
强制确认
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
@click="downdtl"
|
||||
>
|
||||
导出Excel
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
@@ -271,6 +281,8 @@ import ViewDialog from '@/views/wms/st/inbill/ViewDialog'
|
||||
import TaskDialog from '@/views/wms/st/inbill/TaskDialog'
|
||||
import { mapGetters } from 'vuex'
|
||||
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
||||
import { download } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
|
||||
export default {
|
||||
name: 'Rawassist',
|
||||
@@ -445,6 +457,19 @@ export default {
|
||||
this.openParam = res
|
||||
this.taskShow = true
|
||||
})
|
||||
},
|
||||
downdtl() {
|
||||
if (this.crud.query.createTime !== undefined) {
|
||||
this.query.begin_time = this.crud.query.createTime[0]
|
||||
this.query.end_time = this.crud.query.createTime[1]
|
||||
}
|
||||
crud.downloadLoading = true
|
||||
download('/api/in/rawAssist/download', this.crud.query).then(result => {
|
||||
downloadFile(result, '入库单据', 'xlsx')
|
||||
crud.downloadLoading = false
|
||||
}).catch(() => {
|
||||
crud.downloadLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user