Commit f3561fa6 authored by 卜远杰's avatar 卜远杰

添加入库和产品详情查看

parent 366b16dd
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<div class="box-body"> <div class="box-body">
</div> </div>
<div class="form-group form-md-line-input col-md-12"> <!--<div class="form-group form-md-line-input col-md-12">
<label>上级分类</label> <label>上级分类</label>
<div class="input-group"> <div class="input-group">
<input type="text" id="parentId" name="parentId" value="$!{data.parentId}" <input type="text" id="parentId" name="parentId" value="$!{data.parentId}"
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
class="btn btn-info btn-flat">选择</button> class="btn btn-info btn-flat">选择</button>
</span> </span>
</div> </div>
</div> </div>-->
<div class="form-group form-md-line-input col-md-12"> <div class="form-group form-md-line-input col-md-12">
<label>产品分类名称</label> <label>产品分类名称</label>
......
...@@ -73,14 +73,91 @@ ...@@ -73,14 +73,91 @@
<!-- general form elements disabled --> <!-- general form elements disabled -->
<div class="box box-primary"> <div class="box box-primary">
<form role="form" id="myForm"> <form role="form" id="myForm">
<input name="id" value="$!{data.id}" hidden="true"/> <input name="id" value="$!{data.id}" hidden="true"/>
<div class="box-body"> <div class="box-body">
</div> </div>
<div class="form-group form-md-line-input col-md-12">
<label>产品详情编码</label>
<input type="text" required class="form-control pull-right"
value="$!{data.productDetailNumber}" maxlength="500" readonly
name="productDetailNumber" placeholder="产品详情编码"
>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>物料编码</label>
<input type="text" required class="form-control pull-right"
value="$!{data.materielNumber}" maxlength="500" readonly
name="materielNumber" placeholder="物料编码"
>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>产品编码</label>
<input type="text" required class="form-control pull-right"
value="$!{data.productNumber}" maxlength="500" readonly
name="productNumber" placeholder="产品编码"
>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>产品名称</label>
<input type="text" required class="form-control pull-right"
value="$!{data.productName}" maxlength="500" readonly
name="productName" placeholder="产品名称"
>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>产品分类编码</label>
<input type="text" required class="form-control pull-right"
value="$!{data.productClassifyNumber}" maxlength="500" readonly
name="productClassifyNumber" placeholder="产品分类编码"
>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>入库编码</label>
<input type="text" required class="form-control pull-right"
value="$!{data.intoWareroomNumber}" maxlength="500" readonly
name="intoWareroomNumber" placeholder="入库编码"
>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>出库编码</label>
<input type="text" required class="form-control pull-right"
value="$!{data.outWareroomNumber}" maxlength="500" readonly
name="outWareroomNumber" placeholder="出库编码"
>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>订单编码</label>
<input type="text" required class="form-control pull-right"
value="$!{data.orderNumber}" maxlength="500" readonly
name="orderNumber" placeholder="订单编码"
>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>物流编码</label>
<input type="text" required class="form-control pull-right"
value="$!{data.logisticsNumber}" maxlength="500" readonly
name="logisticsNumber" placeholder="物流编码"
>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>是否出售</label>
<input type="text" required class="form-control pull-right"
value="$!{data.whetherSell}" maxlength="500" readonly
name="whetherSell" placeholder="是否出售"
>
</div>
<div class="box-footer"> <div class="box-footer">
#if($shiro.hasPermission("qy:productDetail:edit"))
<input class="btn btn-primary" id="save" value="保存" type="submit">
#end
<a href="#springUrl('/a/productDetail/list')" class="btn btn-default">取消</a> <a href="#springUrl('/a/productDetail/list')" class="btn btn-default">取消</a>
</div> </div>
</form> </form>
...@@ -136,7 +213,7 @@ ...@@ -136,7 +213,7 @@
bindEvent(); bindEvent();
}; };
var bindEvent = function () { var bindEvent = function () {
$("#myForm").validate({ $("#myForm").validate({
rules: {}, rules: {},
messages: {}, messages: {},
......
...@@ -105,8 +105,9 @@ ...@@ -105,8 +105,9 @@
<td>订单编码</td> <td>订单编码</td>
<td>物流编码</td> <td>物流编码</td>
<td>是否出售</td> <td>是否出售</td>
<th>创建时间</th> <td>入库时间</td>
<th>操作</th> <td>出库时间</td>
<td>操作</td>
</tr> </tr>
</thead> </thead>
<tbody id="tablebody"> <tbody id="tablebody">
...@@ -227,6 +228,9 @@ ...@@ -227,6 +228,9 @@
{ {
"mData": "createTime" "mData": "createTime"
}, },
{
"mData":"outWareroomTime"
},
{ {
"mData": "id" "mData": "id"
}], }],
...@@ -245,11 +249,22 @@ ...@@ -245,11 +249,22 @@
} }
},{ },{
"aTargets": [12], "aTargets": [12],
"mData": "outWareroomTime",
"mRender": function (a, b, c, d) {
if(a == null || a == ""){
return "";
}else{
return formatDates(a, "yyyy-MM-dd HH:mm:ss");
}
}
},{
"aTargets": [13],
"mData": "id", "mData": "id",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
var html = '#if($shiro.hasPermission("qy:productDetail:edit"))';// var html = '#if($shiro.hasPermission("qy:productDetail:edit"))';//
// html += '<a href="#springUrl("/a/productIntoWareroom/form?id=' + a + '")" data-id="' + a + '" data-action="view" class="btn green">修改</a>'; html += '<a href="#springUrl("/a/productDetail/form?id=' + a + '")" data-id="' + a + '" data-action="view" class="btn green">查看</a>';
html += '<a href="javascript:void(0);" data-id="' + a + '" data-action="remove" onclick="removeData(' + a + ')" class="btn red">删除</a>'; //html += '<a href="javascript:void(0);" data-id="' + a + '" data-action="remove" onclick="removeData(' + a + ')" class="btn red">删除</a>';
html += '#end'; html += '#end';
return html; return html;
} }
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<result column="description" property="description"/> <result column="description" property="description"/>
<result column="create_by" property="createBy"/> <result column="create_by" property="createBy"/>
<result column="update_by" property="updateBy"/> <result column="update_by" property="updateBy"/>
<result column="out_wareroom_time" property="outWareroomTime"/>
</resultMap> </resultMap>
<sql id="sqlWhere"> <sql id="sqlWhere">
...@@ -70,7 +71,8 @@ ...@@ -70,7 +71,8 @@
update_time, update_time,
description, description,
create_by, create_by,
update_by update_by,
out_wareroom_time
</sql> </sql>
...@@ -100,7 +102,8 @@ ...@@ -100,7 +102,8 @@
now(), now(),
#{description, jdbcType=VARCHAR}, #{description, jdbcType=VARCHAR},
#{createBy, jdbcType=BIGINT}, #{createBy, jdbcType=BIGINT},
#{updateBy, jdbcType=BIGINT} #{updateBy, jdbcType=BIGINT},
#{outWareroomTime, jdbc=DATETIME}
) )
</insert> </insert>
...@@ -183,6 +186,9 @@ ...@@ -183,6 +186,9 @@
<if test="updateBy != null"> <if test="updateBy != null">
update_by = #{updateBy, jdbcType=BIGINT}, update_by = #{updateBy, jdbcType=BIGINT},
</if> </if>
<if test="outWareroomTime != null">
out_wareroom_time = #{outWareroomTime, jdbcType=TIMESTAMP},
</if>
</set> </set>
where id=#{id,jdbcType=BIGINT} where id=#{id,jdbcType=BIGINT}
</update> </update>
......
...@@ -47,6 +47,11 @@ public class ProductDetail implements Serializable { ...@@ -47,6 +47,11 @@ public class ProductDetail implements Serializable {
/* 是否出售 */ /* 是否出售 */
@ExportConfig(value = "是否出售", width = 100, showLevel = 1) @ExportConfig(value = "是否出售", width = 100, showLevel = 1)
private String whetherSell; private String whetherSell;
/**
* 出库时间
*/
@ExportConfig(value = "出库时间", width = 100, showLevel = 1)
private Date outWareroomTime;
/* 所属的账号 */ /* 所属的账号 */
private Long accountsId; private Long accountsId;
/* 删除标识 */ /* 删除标识 */
......
...@@ -77,11 +77,56 @@ ...@@ -77,11 +77,56 @@
<div class="box-body"> <div class="box-body">
</div> </div>
<div class="form-group form-md-line-input col-md-12">
<label>入库编码</label>
<input type="text" required class="form-control pull-right"
value="$!{data.intoWareroomNumber}" maxlength="500" readonly
name="intoWareroomNumber" placeholder="入库编码"
>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>产品分类编码</label>
<input type="text" required class="form-control pull-right"
value="$!{data.productClassifyNumber}" maxlength="500" readonly
name="productClassifyNumber" placeholder="产品分类编码"
>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>产品SKU码</label>
<input type="text" required class="form-control pull-right"
value="$!{data.productSkuNumber}" maxlength="500" readonly
name="productSkuNumber" placeholder="产品SKU码"
>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>产品编码</label>
<input type="text" required class="form-control pull-right"
value="$!{data.productNumber}" maxlength="500" readonly
name="productNumber" placeholder="产品编码"
>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>产品名称</label>
<input type="text" required class="form-control pull-right"
value="$!{data.productName}" maxlength="500" readonly
name="productName" placeholder="产品名称"
>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>产品数量</label>
<input type="text" required class="form-control pull-right"
value="$!{data.productAmount}" maxlength="500" readonly
name="productAmount" placeholder="产品数量"
>
</div>
<div class="box-footer"> <div class="box-footer">
#if($shiro.hasPermission("qy:productIntoWareroom:edit")) <a href="#springUrl('/a/productIntoWareroom/list')" class="btn btn-default">返回</a>
<input class="btn btn-primary" id="save" value="保存" type="submit">
#end
<a href="#springUrl('/a/productIntoWareroom/list')" class="btn btn-default">取消</a>
</div> </div>
</form> </form>
<!-- /.box-body --> <!-- /.box-body -->
......
...@@ -111,11 +111,11 @@ ...@@ -111,11 +111,11 @@
<tr> <tr>
<td hidden="true">Id</td> <td hidden="true">Id</td>
<td>入库编码</td> <td>入库编码</td>
<td>品分类编码</td> <td>品分类编码</td>
<td>品SKU码</td> <td>品SKU码</td>
<td>品编码</td> <td>品编码</td>
<td>品名称</td> <td>品名称</td>
<td>品数量</td> <td>品数量</td>
<th>创建时间</th> <th>创建时间</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
...@@ -256,8 +256,8 @@ ...@@ -256,8 +256,8 @@
"mData": "id", "mData": "id",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
var html = '#if($shiro.hasPermission("qy:productIntoWareroom:edit"))';// var html = '#if($shiro.hasPermission("qy:productIntoWareroom:edit"))';//
// html += '<a href="#springUrl("/a/productIntoWareroom/form?id=' + a + '")" data-id="' + a + '" data-action="view" class="btn green">修改</a>'; html += '<a href="#springUrl("/a/productIntoWareroom/form?id=' + a + '")" data-id="' + a + '" data-action="view" class="btn green">查看</a>';
html += '<a href="javascript:void(0);" data-id="' + a + '" data-action="remove" onclick="removeData(' + a + ')" class="btn red">删除</a>'; // html += '<a href="javascript:void(0);" data-id="' + a + '" data-action="remove" onclick="removeData(' + a + ')" class="btn red">删除</a>';
html += '#end'; html += '#end';
return html; return html;
} }
......
...@@ -118,9 +118,9 @@ ...@@ -118,9 +118,9 @@
<td>服用数量</td> <td>服用数量</td>
<td>库存</td> <td>库存</td>
<td>价格</td> <td>价格</td>
<th>是否为处方药</th> <td>是否为处方药</td>
<th>创建时间</th> <td>创建时间</td>
<th>操作</th> <td>操作</td>
</tr> </tr>
</thead> </thead>
<tbody id="tablebody"> <tbody id="tablebody">
......
...@@ -95,10 +95,8 @@ public class ProductServiceImpl extends GenericServiceImpl<Product> implements P ...@@ -95,10 +95,8 @@ public class ProductServiceImpl extends GenericServiceImpl<Product> implements P
// 2、 生成入库单 // 2、 生成入库单
ProductIntoWareroom productIntoWareroom = new ProductIntoWareroom(); ProductIntoWareroom productIntoWareroom = new ProductIntoWareroom();
productIntoWareroom.setAccountsId(product.getAccountsId()); productIntoWareroom.setAccountsId(product.getAccountsId());
//todo 入库单编号
String ruKuNumber = codingruleUtils.getNumber(product.getAccountsId(),ProductIntoWareroom.class.getName()); String ruKuNumber = codingruleUtils.getNumber(product.getAccountsId(),ProductIntoWareroom.class.getName());
productIntoWareroom.setIntoWareroomNumber(ruKuNumber); productIntoWareroom.setIntoWareroomNumber(ruKuNumber);
//todo 商品SKU码
productIntoWareroom.setProductSkuNumber("SKU"); productIntoWareroom.setProductSkuNumber("SKU");
productIntoWareroom.setProductNumber(product.getProductNumber()); productIntoWareroom.setProductNumber(product.getProductNumber());
productIntoWareroom.setProductName(product.getProductName()); productIntoWareroom.setProductName(product.getProductName());
...@@ -114,9 +112,7 @@ public class ProductServiceImpl extends GenericServiceImpl<Product> implements P ...@@ -114,9 +112,7 @@ public class ProductServiceImpl extends GenericServiceImpl<Product> implements P
for (int i = 0; i < product.getStock().intValue(); i++){ for (int i = 0; i < product.getStock().intValue(); i++){
productDetail = new ProductDetail(); productDetail = new ProductDetail();
productDetail.setAccountsId(product.getAccountsId()); productDetail.setAccountsId(product.getAccountsId());
//todo 产品详情编码
productDetail.setProductDetailNumber(codingruleUtils.getNumber(product.getAccountsId(),ProductDetail.class.getName())); productDetail.setProductDetailNumber(codingruleUtils.getNumber(product.getAccountsId(),ProductDetail.class.getName()));
//todo 物料编码
productDetail.setMaterielNumber(codingruleUtils.getNumber(product.getAccountsId(),"com.cftech.productmaterie.model.Materie")); productDetail.setMaterielNumber(codingruleUtils.getNumber(product.getAccountsId(),"com.cftech.productmaterie.model.Materie"));
productDetail.setProductNumber(product.getProductNumber()); productDetail.setProductNumber(product.getProductNumber());
productDetail.setProductName(product.getProductName()); productDetail.setProductName(product.getProductName());
......
...@@ -243,7 +243,12 @@ public class ProductController { ...@@ -243,7 +243,12 @@ public class ProductController {
//服用数量 //服用数量
product.setTakeAmount(rowData.get(13)); product.setTakeAmount(rowData.get(13));
//库存 //库存
product.setStock(Long.valueOf(rowData.get(14))); if(StringUtils.isEmpty(rowData.get(14)) || rowData.get(14).contains("-")){
sbClassify.append(rowData.get(1));
return;
}else{
product.setStock(Long.valueOf(rowData.get(14)));
}
//价格 //价格
product.setPrice(Double.valueOf(rowData.get(15))); product.setPrice(Double.valueOf(rowData.get(15)));
//是否为处方药 //是否为处方药
...@@ -258,7 +263,12 @@ public class ProductController { ...@@ -258,7 +263,12 @@ public class ProductController {
} }
retJson.put("errorNo", "0"); retJson.put("errorNo", "0");
retJson.put("errorMsg", "导入成功"); if(sbClassify.length()>0){
retJson.put("errorMsg", "部分导入失败,产品编码有:"+sbClassify.toString()+"; 失败原因:库存不能为空或者为负数");
}else{
retJson.put("errorMsg", "导入成功");
}
return retJson; return retJson;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment