Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
This commit is contained in:
@@ -91,6 +91,15 @@ public class ISysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> imp
|
||||
@SneakyThrows
|
||||
public void create(Map userDetail) {
|
||||
SysUser sysUser = new SysUser();
|
||||
//userDetail 中 createTime是string类型BeanUtils.populate不支持解析或者使用MapStruct
|
||||
ConvertUtils.register((m, o) -> {
|
||||
try {
|
||||
if (o == null){ return null; }
|
||||
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(o.toString());
|
||||
}catch (Exception ex){
|
||||
return new Date();
|
||||
}
|
||||
}, Date.class);
|
||||
BeanUtils.populate(sysUser,userDetail);
|
||||
// 默认密码 123456
|
||||
if (ObjectUtil.isEmpty(sysUser.getPassword())) {
|
||||
|
||||
@@ -4,6 +4,7 @@ package org.nl.wms.pda.st.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.druid.sql.visitor.functions.If;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -57,6 +58,8 @@ public class PdaCheckServiceImpl implements PdaCheckService {
|
||||
@Override
|
||||
public JSONObject checkQueryDtl(JSONObject whereJson) {
|
||||
|
||||
WQLObject dtlTab = WQLObject.getWQLObject("ST_IVT_CheckDtl");
|
||||
|
||||
String box_no = whereJson.getString("box_no");
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
@@ -64,6 +67,15 @@ public class PdaCheckServiceImpl implements PdaCheckService {
|
||||
map.put("check_code", whereJson.getString("check_code"));
|
||||
if (ObjectUtil.isNotEmpty(box_no)) map.put("storagevehicle_code","%"+box_no+"%");
|
||||
|
||||
JSONObject jsonDtl = dtlTab.query("check_code = '" + whereJson.getString("check_code") + "' and storagevehicle_code = '" + box_no + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonDtl)) {
|
||||
throw new BadRequestException("此箱号不在此盘点单中:"+box_no);
|
||||
} else {
|
||||
if (!StrUtil.equals(jsonDtl.getString("status"), "1")) {
|
||||
throw new BadRequestException("此箱号已盘点");
|
||||
}
|
||||
}
|
||||
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_CHECK").addParamMap(map).process().getResultJSONArray(0);
|
||||
|
||||
// 已盘点数: 不等于生成状态
|
||||
|
||||
@@ -1,17 +1,22 @@
|
||||
package org.nl.wms.st.returns.rest;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.st.outbill.service.impl.CheckOutBillServiceImpl;
|
||||
import org.nl.wms.st.returns.service.InAndOutReturnService;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
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
|
||||
@@ -62,4 +67,11 @@ public class InAndOutReturnlController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
public void download(HttpServletResponse response, @RequestParam Map whereJson) throws IOException {
|
||||
JSONArray outBillDis = SpringContextHolder.getBean(CheckOutBillServiceImpl.class).getOutBillDis(whereJson);
|
||||
inAndOutReturnService.download(outBillDis, 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 InAndOutReturnService {
|
||||
@@ -24,4 +26,6 @@ public interface InAndOutReturnService {
|
||||
|
||||
void disupload(JSONObject whereJson);
|
||||
|
||||
void download(JSONArray arr, HttpServletResponse response) throws IOException;
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.utils.FileUtil;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.system.service.user.ISysUserService;
|
||||
import org.nl.system.service.user.dao.SysUser;
|
||||
@@ -32,9 +33,9 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.support.TransactionCallbackWithoutResult;
|
||||
import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* PC端出入库新增
|
||||
@@ -675,6 +676,40 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(JSONArray array, HttpServletResponse response) throws IOException {
|
||||
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
JSONObject json = array.getJSONObject(i);
|
||||
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
|
||||
map.put("物料编码", json.getString("material_code"));
|
||||
map.put("物料名称", json.getString("material_name"));
|
||||
map.put("子卷批次号", json.getString("pcsn"));
|
||||
map.put("sap批次", json.getString("sap_pcsn"));
|
||||
map.put("箱号", json.getString("box_no"));
|
||||
map.put("重量", json.getString("real_qty"));
|
||||
map.put("仓位", json.getString("struct_code"));
|
||||
|
||||
String statusName = "";
|
||||
if (StrUtil.equals(json.getString("work_status"), "00")) {
|
||||
statusName = "未生成";
|
||||
} else if (StrUtil.equals(json.getString("work_status"), "01")) {
|
||||
statusName = "生成";
|
||||
} else if (StrUtil.equals(json.getString("work_status"), "02")) {
|
||||
statusName = "执行中";
|
||||
} else if (StrUtil.equals(json.getString("work_status"), "99")) {
|
||||
statusName = "完成";
|
||||
}
|
||||
map.put("状态", statusName);
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upload(JSONObject whereJson) {
|
||||
//出库分配表
|
||||
|
||||
@@ -208,6 +208,18 @@
|
||||
>
|
||||
不回传
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-thumb"
|
||||
size="mini"
|
||||
:loading="showDtlLoading"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="downdtl"
|
||||
>
|
||||
导出
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
@@ -267,6 +279,8 @@ import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import ViewDialog from '@/views/wms/st/inAndOutReturn/ViewDialog'
|
||||
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
||||
import { download } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
|
||||
export default {
|
||||
name: 'Return',
|
||||
@@ -295,7 +309,8 @@ export default {
|
||||
mstrow: {},
|
||||
fullscreenLoading: false,
|
||||
storlist: [],
|
||||
billtypelist: []
|
||||
billtypelist: [],
|
||||
showDtlLoading: false
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
@@ -453,6 +468,18 @@ export default {
|
||||
} else if (row.upload_sap === '1') {
|
||||
return '是'
|
||||
}
|
||||
},
|
||||
downdtl() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (this.currentRow !== null) {
|
||||
crud.downloadLoading = true
|
||||
download('/api/inandoutreturn/download', { 'iostorinv_id': _selectData[0].iostorinv_id }).then(result => {
|
||||
downloadFile(result, '出入库单据明细', 'xlsx')
|
||||
crud.downloadLoading = false
|
||||
}).catch(() => {
|
||||
crud.downloadLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user