效期预警导出

master
e 2019-01-18 17:05:38 +08:00
parent e3630b7917
commit d277aa65b8
6 changed files with 157 additions and 16 deletions

View File

@ -1159,6 +1159,8 @@ public class WmImNoticeHController extends BaseController {
CellStyle cs3 = wb.createCellStyle(); CellStyle cs3 = wb.createCellStyle();
CellStyle cs4 = wb.createCellStyle(); CellStyle cs4 = wb.createCellStyle();
CellStyle cs5 = wb.createCellStyle(); CellStyle cs5 = wb.createCellStyle();
CellStyle cs5r = wb.createCellStyle();
CellStyle cs51 = wb.createCellStyle(); CellStyle cs51 = wb.createCellStyle();
CellStyle cs52 = wb.createCellStyle(); CellStyle cs52 = wb.createCellStyle();
// 创建两种字体 // 创建两种字体
@ -1220,6 +1222,18 @@ public class WmImNoticeHController extends BaseController {
cs5.setBorderTop(CellStyle.BORDER_THIN); cs5.setBorderTop(CellStyle.BORDER_THIN);
cs5.setBorderBottom(CellStyle.BORDER_THIN); cs5.setBorderBottom(CellStyle.BORDER_THIN);
cs5.setWrapText(true); cs5.setWrapText(true);
cs5r.setFont(f2);
cs5r.setBorderLeft(CellStyle.BORDER_THIN);
cs5r.setBorderRight(CellStyle.BORDER_THIN);
cs5r.setBorderTop(CellStyle.BORDER_THIN);
cs5r.setBorderBottom(CellStyle.BORDER_THIN);
cs5r.setWrapText(true);
cs5r.setAlignment(CellStyle.ALIGN_RIGHT);
cs51.setFont(f2); cs51.setFont(f2);
cs51.setBorderLeft(CellStyle.BORDER_THIN); cs51.setBorderLeft(CellStyle.BORDER_THIN);
cs51.setBorderRight(CellStyle.BORDER_THIN); cs51.setBorderRight(CellStyle.BORDER_THIN);
@ -1378,6 +1392,17 @@ public class WmImNoticeHController extends BaseController {
String[] columnNamest = { "序号", "商品编码", "商品名称", "生产日期", "货温","单位", "数量", "毛重KG","托盘数","备注" }; String[] columnNamest = { "序号", "商品编码", "商品名称", "生产日期", "货温","单位", "数量", "毛重KG","托盘数","备注" };
columnNames = columnNamest; columnNames = columnNamest;
} }
try{
if("hr".equals(ResourceUtil.getConfigByName("wm.ckd"))){
String[] columnNames1 = { "序号", "商品编码", "商品名称", "生产日期", "货温","单位", "数量", "毛重KG","体积cm³","备注" };
if(ResourceUtil.getConfigByName("systuopan").equals("yes")){
String[] columnNamest1 = { "序号", "商品编码", "商品名称", "生产日期", "货温","单位", "数量", "毛重KG","托盘数","备注" };
columnNames1 = columnNamest1;
}
columnNames = columnNames1;
}
}catch ( Exception e){
}
for (int i = 0; i < columnNames.length; i++) { for (int i = 0; i < columnNames.length; i++) {
Cell cell = rowColumnName.createCell(i); Cell cell = rowColumnName.createCell(i);
cell.setCellValue(columnNames[i]); cell.setCellValue(columnNames[i]);
@ -1412,9 +1437,10 @@ public class WmImNoticeHController extends BaseController {
try { try {
Cell cell4 = rowColumnValue.createCell(3);// 生产日期 Cell cell4 = rowColumnValue.createCell(3);// 生产日期
cell4.setCellStyle(cs5); cell4.setCellStyle(cs5r);
cell4.setCellValue(result.get(i).get("pro_data") cell4.setCellValue(result.get(i).get("pro_data")
.toString()); .toString());
} catch (Exception e) { } catch (Exception e) {
// TODO: handle exception // TODO: handle exception
@ -1482,6 +1508,17 @@ public class WmImNoticeHController extends BaseController {
Cell cell10 = rowColumnValue.createCell(9);// 备注 Cell cell10 = rowColumnValue.createCell(9);// 备注
try{
if("hr".equals(ResourceUtil.getConfigByName("wm.rkd"))) {
try{
// cell10.setCellValue(wmUtil.getstock(result.get(i).get("goods_id").toString()));
}catch (Exception e){
}
}
}catch (Exception e){
}
cell10.setCellStyle(cs5); cell10.setCellStyle(cs5);
cerconNo++; cerconNo++;

View File

@ -1143,6 +1143,8 @@ public class WmOmNoticeHController extends BaseController {
CellStyle cs3 = wb.createCellStyle(); CellStyle cs3 = wb.createCellStyle();
CellStyle cs4 = wb.createCellStyle(); CellStyle cs4 = wb.createCellStyle();
CellStyle cs5 = wb.createCellStyle(); CellStyle cs5 = wb.createCellStyle();
CellStyle cs5r = wb.createCellStyle();
CellStyle cs51 = wb.createCellStyle(); CellStyle cs51 = wb.createCellStyle();
CellStyle cs52 = wb.createCellStyle(); CellStyle cs52 = wb.createCellStyle();
// 创建两种字体 // 创建两种字体
@ -1204,6 +1206,15 @@ public class WmOmNoticeHController extends BaseController {
cs5.setBorderTop(CellStyle.BORDER_THIN); cs5.setBorderTop(CellStyle.BORDER_THIN);
cs5.setBorderBottom(CellStyle.BORDER_THIN); cs5.setBorderBottom(CellStyle.BORDER_THIN);
cs5.setWrapText(true); cs5.setWrapText(true);
cs5r.setFont(f2);
cs5r.setBorderLeft(CellStyle.BORDER_THIN);
cs5r.setBorderRight(CellStyle.BORDER_THIN);
cs5r.setBorderTop(CellStyle.BORDER_THIN);
cs5r.setBorderBottom(CellStyle.BORDER_THIN);
cs5r.setWrapText(true);
cs5r.setAlignment(CellStyle.ALIGN_RIGHT);
cs51.setFont(f2); cs51.setFont(f2);
cs51.setBorderLeft(CellStyle.BORDER_THIN); cs51.setBorderLeft(CellStyle.BORDER_THIN);
cs51.setBorderRight(CellStyle.BORDER_THIN); cs51.setBorderRight(CellStyle.BORDER_THIN);
@ -1228,7 +1239,7 @@ public class WmOmNoticeHController extends BaseController {
// String tsql = "SELECT wq.pro_data,wq.base_unit,wq.rec_deg, mg.goods_code, mg.goods_id,mg.shp_ming_cheng,cast(sum(wq.base_goodscount) as signed) as goods_count,cast(sum(wq.tin_tj) as signed) tin_tj ,cast(sum(wq.tin_zhl) as signed) tin_zhl " // String tsql = "SELECT wq.pro_data,wq.base_unit,wq.rec_deg, mg.goods_code, mg.goods_id,mg.shp_ming_cheng,cast(sum(wq.base_goodscount) as signed) as goods_count,cast(sum(wq.tin_tj) as signed) tin_tj ,cast(sum(wq.tin_zhl) as signed) tin_zhl "
// +" FROM wm_om_qm_i wq,mv_goods mg where wq.om_notice_id = ? " // +" FROM wm_om_qm_i wq,mv_goods mg where wq.om_notice_id = ? "
// +" and wq.goods_id = mg.goods_code group by wq.om_notice_id, mg.goods_code,wq.pro_data"; // +" and wq.goods_id = mg.goods_code group by wq.om_notice_id, mg.goods_code,wq.pro_data";
String tsql = "SELECT wq.goods_pro_data as pro_data,wq.base_unit, mg.goods_code, mg.goods_id,mg.shp_ming_cheng,cast(sum(wq.base_goodscount) as signed) as goods_count,mg.chl_shl,cast(mg.ti_ji_cm/mg.chl_shl as signed) tin_tj ,cast(mg.zhl_kg/mg.chl_shl as signed) tin_zhl " String tsql = "SELECT wq.goods_pro_data as pro_data,wq.base_unit, mg.goods_code, mg.goods_id,mg.shp_ming_cheng,cast(sum(wq.base_goodscount) as signed) as goods_count,mg.chl_shl,cast(mg.ti_ji_cm/mg.chl_shl as signed) tin_tj ,(mg.zhl_kg/mg.chl_shl ) as tin_zhl "
+" FROM wm_to_down_goods wq,mv_goods mg where wq.order_id = ? " +" FROM wm_to_down_goods wq,mv_goods mg where wq.order_id = ? "
+" and wq.goods_id = mg.goods_code group by wq.order_id, mg.goods_code,wq.goods_pro_data"; +" and wq.goods_id = mg.goods_code group by wq.order_id, mg.goods_code,wq.goods_pro_data";
@ -1238,7 +1249,7 @@ public class WmOmNoticeHController extends BaseController {
int size = result.size(); int size = result.size();
if(size<1){ if(size<1){
tsql = "SELECT wq.pro_data,wq.base_unit, mg.goods_code, mg.goods_id,mg.shp_ming_cheng,cast(sum(wq.base_goodscount) as signed) as goods_count,mg.chl_shl,cast(mg.ti_ji_cm/mg.chl_shl as signed) tin_tj ,cast(mg.zhl_kg/mg.chl_shl as signed) tin_zhl " tsql = "SELECT wq.pro_data,wq.base_unit, mg.goods_code, mg.goods_id,mg.shp_ming_cheng,cast(sum(wq.base_goodscount) as signed) as goods_count,mg.chl_shl,cast(mg.ti_ji_cm/mg.chl_shl as signed) tin_tj , (mg.zhl_kg/mg.chl_shl) as tin_zhl "
+" FROM wm_om_qm_i wq,mv_goods mg where wq.om_notice_id = ? " +" FROM wm_om_qm_i wq,mv_goods mg where wq.om_notice_id = ? "
+" and wq.goods_id = mg.goods_code group by wq.om_notice_id, mg.goods_code,wq.pro_data"; +" and wq.goods_id = mg.goods_code group by wq.om_notice_id, mg.goods_code,wq.pro_data";
result = systemService result = systemService
@ -1361,6 +1372,17 @@ public class WmOmNoticeHController extends BaseController {
Row rowColumnName = sheet.createRow((short) page*20+8); // 列名 Row rowColumnName = sheet.createRow((short) page*20+8); // 列名
String[] columnNames = { "序号", "商品编码", "商品名称", "生产日期", "品质","箱数", "拆零数", "毛重/KG","体积/cm³","备注" }; String[] columnNames = { "序号", "商品编码", "商品名称", "生产日期", "品质","箱数", "拆零数", "毛重/KG","体积/cm³","备注" };
try{
if("hr".equals(ResourceUtil.getConfigByName("wm.ckd"))){
// String[] columnNames1 = { "序号", "商品编码", "商品名称", "生产日期", "品质","箱数", "拆零数", "毛重/KG","库存","备注" };
String[] columnNames1 = { "序号", "商品编码", "商品名称", "生产日期", "品质","箱数", "拆零数", "毛重/KG","体积/cm³","备注" };
columnNames = columnNames1;
}
}catch ( Exception e){
}
for (int i = 0; i < columnNames.length; i++) { for (int i = 0; i < columnNames.length; i++) {
Cell cell = rowColumnName.createCell(i); Cell cell = rowColumnName.createCell(i);
@ -1395,9 +1417,14 @@ public class WmOmNoticeHController extends BaseController {
cell3.setCellStyle(cs5); cell3.setCellStyle(cs5);
try { try {
Cell cell4 = rowColumnValue.createCell(3);// 生产日期 Cell cell4 = rowColumnValue.createCell(3);// 生产日期
cell4.setCellValue(result.get(i).get("pro_data") cell4.setCellValue(result.get(i).get("pro_data")
.toString()); .toString());
cell4.setCellStyle(cs5);
cell4.setCellStyle(cs5r);
} catch (Exception e) { } catch (Exception e) {
// TODO: handle exception // TODO: handle exception
@ -1448,19 +1475,35 @@ public class WmOmNoticeHController extends BaseController {
} }
cell8.setCellStyle(cs5); cell8.setCellStyle(cs5);
Cell cell9 = rowColumnValue.createCell(8);// 体积 Cell cell9 = rowColumnValue.createCell(8);// 体积
// try {
// double tij = Double.parseDouble(result.get(i).get("tin_tj")
// .toString()) * Double.parseDouble(result.get(i).get("goods_count").toString());
//
//
// cell9.setCellValue(tij);
//
// } catch (Exception e) {
// // TODO: handle exception
// }
try{ try{
double tij = Double.parseDouble(result.get(i).get("tin_tj") if("hr".equals(ResourceUtil.getConfigByName("wm.ckd"))) {
.toString()) * Double.parseDouble(result.get(i).get("goods_count").toString()); try{
// cell9.setCellValue(wmUtil.getstock(result.get(i).get("goods_id").toString()));
cell9.setCellValue(tij);
}catch (Exception e){ }catch (Exception e){
// TODO: handle exception
} }
}
}catch (Exception e){
}
cell9.setCellStyle(cs5); cell9.setCellStyle(cs5);
Cell cell10 = rowColumnValue.createCell(9);// 备注 Cell cell10 = rowColumnValue.createCell(9);// 备注
cell10.setCellStyle(cs5); cell10.setCellStyle(cs5);
cerconNo++; cerconNo++;

View File

@ -307,6 +307,38 @@ public class wmUtil {
return flag; return flag;
} }
public static String getstock(String goodsid) {
String goodsqua = "0";
try {
String goods = null;
if (!StringUtil.isEmpty(goodsid)) {
if (goodsid.endsWith("l")) {
goods = goodsid.substring(0, goodsid.length() - 1);
System.out.print("11111111I" + goods);
} else {
goods = goodsid;
System.out.print("22222" + goods);
}
}
SystemService systemService = ApplicationContextUtil.getContext().getBean(SystemService.class);
String tsql = " select cast(sum(ws.base_goodscount) as signed) as goods_qua"
+ " from wv_stock ws where "
+ " ws.goods_id = ? "
+ " group by ws.goods_id";
List<Map<String, Object>> result = systemService.findForJdbc(tsql, goods);
if (result.size() > 0) {
goodsqua = result.get(0).get("goods_qua").toString();
}
}catch (Exception e){
}
return goodsqua;
}
public static boolean checkstcoka(String binid,String tinid,String goodsid,String prodate,String basecount) { public static boolean checkstcoka(String binid,String tinid,String goodsid,String prodate,String basecount) {
boolean flag = false; boolean flag = false;
try { try {

View File

@ -40,7 +40,7 @@
<t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="wmToDownGoodsController.do?doUpdate" tiptype="1" > <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="wmToDownGoodsController.do?doUpdate" tiptype="1" >
<input type="hidden" id="btn_sub" class="btn_sub"/> <input type="hidden" id="btn_sub" class="btn_sub"/>
<input type="hidden" name="id" value='${wmToDownGoodsPage.id}' > <input type="hidden" name="id" value='${wmToDownGoodsPage.id}' >
<input id="createDate" name="createDate" type="hidden" value="${wmToDownGoodsPage.createDate }"/> <%--<input id="createDate" name="createDate" type="hidden" value="${wmToDownGoodsPage.createDate }"/>--%>
<input id="createBy" name="createBy" type="hidden" value="${wmToDownGoodsPage.createBy }"/> <input id="createBy" name="createBy" type="hidden" value="${wmToDownGoodsPage.createBy }"/>
<input id="createName" name="createName" type="hidden" value="${wmToDownGoodsPage.createName }"/> <input id="createName" name="createName" type="hidden" value="${wmToDownGoodsPage.createName }"/>
<input id="updateBy" name="updateBy" type="hidden" value="${wmToDownGoodsPage.updateBy }"/> <input id="updateBy" name="updateBy" type="hidden" value="${wmToDownGoodsPage.updateBy }"/>
@ -56,6 +56,19 @@
<div class="con-wrapper" id="con-wrapper1" style="display: block;"> <div class="con-wrapper" id="con-wrapper1" style="display: block;">
<div class="row form-wrapper"> <div class="row form-wrapper">
<div class="row show-grid"> <div class="row show-grid">
<div class="col-xs-3 text-center">
<b>创建日期:</b>
</div>
<div class="col-xs-3">
<input id="createDate" name="createDate" onClick="WdatePicker()" type="text" class="form-control"
ignore="ignore"
value='${wmToUpGoodsPage.createDate}' />
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">创建日期</label>
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center"> <div class="col-xs-3 text-center">
<b>商品编码:</b> <b>商品编码:</b>
</div> </div>

View File

@ -7,7 +7,7 @@
<t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"></t:dgCol> <t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="创建人名称" field="createName" hidden="true" queryMode="single" width="80"></t:dgCol> <t:dgCol title="创建人名称" field="createName" hidden="true" queryMode="single" width="80"></t:dgCol>
<t:dgCol title="创建人登录名称" field="createBy" hidden="true" queryMode="single" width="120"></t:dgCol> <t:dgCol title="创建人登录名称" field="createBy" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="创建日期" field="createDate" hidden="true" formatter="yyyy-MM-dd" queryMode="single" width="80"></t:dgCol> <t:dgCol title="创建日期" field="createDate" formatter="yyyy-MM-dd" queryMode="single" width="80"></t:dgCol>
<t:dgCol title="更新人名称" field="updateName" hidden="true" queryMode="single" width="120"></t:dgCol> <t:dgCol title="更新人名称" field="updateName" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="更新人登录名称" field="updateBy" hidden="true" queryMode="single" width="120"></t:dgCol> <t:dgCol title="更新人登录名称" field="updateBy" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="更新日期" field="updateDate" formatter="yyyy-MM-dd" hidden="true" queryMode="single" width="120"></t:dgCol> <t:dgCol title="更新日期" field="updateDate" formatter="yyyy-MM-dd" hidden="true" queryMode="single" width="120"></t:dgCol>

View File

@ -50,6 +50,22 @@
<!-- tab内容 --> <!-- tab内容 -->
<div class="con-wrapper" id="con-wrapper1" style="display: block;"> <div class="con-wrapper" id="con-wrapper1" style="display: block;">
<div class="row form-wrapper"> <div class="row form-wrapper">
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>创建日期:</b>
</div>
<div class="col-xs-3">
<input id="createDate" name="createDate" onClick="WdatePicker()" type="text" class="form-control"
ignore="ignore"
value='${wmToUpGoodsPage.createDate}' />
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">创建日期</label>
</div>
</div>
<div class="row show-grid"> <div class="row show-grid">
<div class="col-xs-3 text-center"> <div class="col-xs-3 text-center">
<b>商品编码:</b> <b>商品编码:</b>
@ -111,7 +127,7 @@
<b>生产日期:</b> <b>生产日期:</b>
</div> </div>
<div class="col-xs-3"> <div class="col-xs-3">
<input id="goodsProData" name="goodsProData" type="text" class="form-control" <input id="goodsProData" name="goodsProData" onClick="WdatePicker()" type="text" class="form-control"
ignore="ignore" ignore="ignore"
value='${wmToUpGoodsPage.goodsProData}' /> value='${wmToUpGoodsPage.goodsProData}' />
<span class="Validform_checktip" style="float:left;height:0px;"></span> <span class="Validform_checktip" style="float:left;height:0px;"></span>