Commit 2c3ba5fa authored by 谢希宇's avatar 谢希宇

Merge branch 'master' of http://106.14.62.141:8081/sa_aidea/aidea

parents 62f2746b 50cef96d
...@@ -4,6 +4,10 @@ package com.cftech.consultsheet.dao; ...@@ -4,6 +4,10 @@ package com.cftech.consultsheet.dao;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cftech.consultsheet.model.ConsultSheet; import com.cftech.consultsheet.model.ConsultSheet;
import com.cftech.core.generic.GenericDao; import com.cftech.core.generic.GenericDao;
import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort;
import java.util.List;
/** /**
* 咨询单Mapper * 咨询单Mapper
...@@ -15,4 +19,5 @@ public interface ConsultSheetMapper extends GenericDao<ConsultSheet> { ...@@ -15,4 +19,5 @@ public interface ConsultSheetMapper extends GenericDao<ConsultSheet> {
JSONObject updateDate(int consultId, String status, String description); JSONObject updateDate(int consultId, String status, String description);
JSONObject updateStatus(ConsultSheet consultSheet); JSONObject updateStatus(ConsultSheet consultSheet);
List<ConsultSheet> fetchSearchByPage(Conds conds, Sort sort, int page, int pageSize, Long id);
} }
\ No newline at end of file
...@@ -147,17 +147,20 @@ ...@@ -147,17 +147,20 @@
SELECT COUNT(1) FROM t_aidea_consult_sheet a SELECT COUNT(1) FROM t_aidea_consult_sheet a
LEFT JOIN t_qyuser b ON b.id = a.doctor_id LEFT JOIN t_qyuser b ON b.id = a.doctor_id
LEFT JOIN t_qyuser c ON c.id = a.customer_id LEFT JOIN t_qyuser c ON c.id = a.customer_id
LEFT JOIN `user` u ON u.userid = b.id
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
</select> </select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap"> <select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap">
SELECT SELECT
<include refid="sqlColumns"/> <include refid="sqlColumns"/>
FROM t_aidea_consult_sheet a FROM t_aidea_consult_sheet a
LEFT JOIN t_qyuser b ON b.id = a.doctor_id LEFT JOIN t_qyuser b ON b.id = a.doctor_id
LEFT JOIN t_qyuser c ON c.id = a.customer_id LEFT JOIN t_qyuser c ON c.id = a.customer_id
LEFT JOIN `user` u ON u.userid = b.id
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
<if test="id!=null"> ${id} = b.id </if>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if> <if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if> <if test="limit>0">limit #{offset},#{limit}</if>
</select> </select>
......
...@@ -5,6 +5,9 @@ import com.alibaba.fastjson.JSONObject; ...@@ -5,6 +5,9 @@ import com.alibaba.fastjson.JSONObject;
import com.cftech.consultsheet.model.ConsultSheet; import com.cftech.consultsheet.model.ConsultSheet;
import com.cftech.core.generic.GenericService; import com.cftech.core.generic.GenericService;
import com.cftech.core.sql.Conds; import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort;
import java.util.List;
/** /**
* 咨询单Service * 咨询单Service
...@@ -14,7 +17,7 @@ import com.cftech.core.sql.Conds; ...@@ -14,7 +17,7 @@ import com.cftech.core.sql.Conds;
*/ */
public interface ConsultSheetService extends GenericService<ConsultSheet> { public interface ConsultSheetService extends GenericService<ConsultSheet> {
List<ConsultSheet> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize ,Long id);
} }
...@@ -7,10 +7,16 @@ import com.cftech.consultsheet.model.ConsultSheet; ...@@ -7,10 +7,16 @@ import com.cftech.consultsheet.model.ConsultSheet;
import com.cftech.consultsheet.service.ConsultSheetService; import com.cftech.consultsheet.service.ConsultSheetService;
import com.cftech.core.generic.GenericDao; import com.cftech.core.generic.GenericDao;
import com.cftech.core.generic.GenericServiceImpl; import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* 咨询单ServiceImpl * 咨询单ServiceImpl
* *
...@@ -30,5 +36,14 @@ return consultSheetMapper; ...@@ -30,5 +36,14 @@ return consultSheetMapper;
} }
@Override
public List<ConsultSheet> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize, Long id) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("conds", conds);
params.put("offset", page > 0 ? page : 0);
params.put("limit", pageSize > 0 ? pageSize : 0);
params.put("sort", sort);
params.put("id",id);
return consultSheetMapper.fetchSearchByPage(params);
}
} }
\ No newline at end of file
...@@ -11,6 +11,7 @@ import com.cftech.core.scope.OrderType; ...@@ -11,6 +11,7 @@ import com.cftech.core.scope.OrderType;
import com.cftech.core.sql.Conds; import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort; import com.cftech.core.sql.Sort;
import com.cftech.core.util.Constants; import com.cftech.core.util.Constants;
import com.cftech.sys.model.User;
import com.cftech.sys.security.UserUtils; import com.cftech.sys.security.UserUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -152,8 +153,11 @@ public class ConsultSheetController { ...@@ -152,8 +153,11 @@ public class ConsultSheetController {
@RequestMapping(value = "/listData") @RequestMapping(value = "/listData")
@ResponseBody @ResponseBody
public JSONObject listData(int iDisplayStart, int iDisplayLength, ConsultSheet consultSheet, HttpServletRequest request) { public JSONObject listData(int iDisplayStart, int iDisplayLength, ConsultSheet consultSheet, HttpServletRequest request) {
Long id = UserUtils.getUser().getUserid();
Long accountsId = UserUtils.getmpaccounts(request); Long accountsId = UserUtils.getmpaccounts(request);
Conds conds = new Conds(); Conds conds = new Conds();
if (!StringUtils.isEmpty(consultSheet.getUserName())){ if (!StringUtils.isEmpty(consultSheet.getUserName())){
conds.like("a.user_name",consultSheet.getUserName()); conds.like("a.user_name",consultSheet.getUserName());
} }
...@@ -165,7 +169,7 @@ public class ConsultSheetController { ...@@ -165,7 +169,7 @@ public class ConsultSheetController {
conds.equal("a.accounts_id", accountsId); conds.equal("a.accounts_id", accountsId);
Sort sort = new Sort("a.create_time", OrderType.DESC); Sort sort = new Sort("a.create_time", OrderType.DESC);
List<ConsultSheet> list = consultSheetService.fetchSearchByPage(conds, sort, iDisplayStart, iDisplayLength); List<ConsultSheet> list = consultSheetService.fetchSearchBy(conds, sort, iDisplayStart, iDisplayLength,id);
Integer counts = consultSheetService.count(conds); Integer counts = consultSheetService.count(conds);
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
rtnJson.put("iTotalRecords", counts); rtnJson.put("iTotalRecords", counts);
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<module>product-into-wareroom-module-web</module> <module>product-into-wareroom-module-web</module>
<module>product-module</module> <module>product-module</module>
<module>product-module-web</module> <module>product-module-web</module>
</modules> </modules>
<dependencies> <dependencies>
......
...@@ -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: {},
......
...@@ -99,14 +99,17 @@ ...@@ -99,14 +99,17 @@
<td>物料编码</td> <td>物料编码</td>
<td>产品编码</td> <td>产品编码</td>
<td>产品名称</td> <td>产品名称</td>
<td>产品图片</td>
<td>产品分类编码</td> <td>产品分类编码</td>
<td>产品分类名称</td>
<td>入库编码</td> <td>入库编码</td>
<td>出库编码</td> <td>出库编码</td>
<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">
...@@ -211,8 +214,12 @@ ...@@ -211,8 +214,12 @@
"mData":"productNumber" "mData":"productNumber"
},{ },{
"mData":"productName" "mData":"productName"
},{
"mData":"productImg"
},{ },{
"mData":"productClassifyNumber" "mData":"productClassifyNumber"
},{
"mData":"classifyName"
},{ },{
"mData":"intoWareroomNumber" "mData":"intoWareroomNumber"
},{ },{
...@@ -227,6 +234,9 @@ ...@@ -227,6 +234,9 @@
{ {
"mData": "createTime" "mData": "createTime"
}, },
{
"mData":"outWareroomTime"
},
{ {
"mData": "id" "mData": "id"
}], }],
...@@ -235,21 +245,39 @@ ...@@ -235,21 +245,39 @@
'visible': false, 'visible': false,
'targets': [0] 'targets': [0]
}, },
{
"aTargets":[5 ],
"mData":"productImg",
"mRender":function (a, b, c, d){
return "<img src='"+a+"' style='width: 80px;height: 80px;'>";
}
},
{ {
"aTargets": [11], "aTargets": [13],
"mData": "createTime", "mData": "createTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return formatDates(a, "yyyy-MM-dd HH:mm:ss"); return formatDates(a, "yyyy-MM-dd HH:mm:ss");
} }
},{ },{
"aTargets": [12], "aTargets": [14],
"mData": "outWareroomTime",
"mRender": function (a, b, c, d) {
if(a == null || a == ""){
return "";
}else{
return formatDates(a, "yyyy-MM-dd HH:mm:ss");
}
}
},{
"aTargets": [15],
"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, jdbcType=TIMESTAMP}
) )
</insert> </insert>
...@@ -112,15 +115,41 @@ ...@@ -112,15 +115,41 @@
</select> </select>
<select id="count" parameterType="java.util.Map" resultType="java.lang.Integer"> <select id="count" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT COUNT(1) FROM t_aidea_product_detail SELECT COUNT(1) FROM t_aidea_product_detail d
LEFT JOIN t_aidea_product p on d.product_number = p.product_number and p.del_flag = 0
LEFT JOIN t_aidea_product_classify c on d.product_classify_number = c.classify_number and c.del_flag = 0
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
</select> </select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap"> <select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap">
SELECT SELECT
<include refid="sqlColumns"/> d.id id,
FROM t_aidea_product_detail d.product_detail_number productDetailNumber,
d.materiel_number materielNumber,
d.product_number productNumber,
d.product_name productName,
d.product_classify_number productClassifyNumber,
d.into_wareroom_number intoWareroomNumber,
d.out_wareroom_number outWareroomNumber,
d.order_number orderNumber,
d.logistics_number logisticsNumber,
d.whether_sell whetherSell,
d.accounts_id accountsId,
d.del_flag delFlag,
d.STATUS,
d.create_time createTime,
d.update_time updateTime,
d.description description,
d.create_by createBy,
d.update_by updateBy,
d.out_wareroom_time outWareroomTime,
p.product_img productImg,
c.classify_name classifyName
FROM
t_aidea_product_detail d
LEFT JOIN t_aidea_product p on d.product_number = p.product_number and p.del_flag = 0
LEFT JOIN t_aidea_product_classify c on d.product_classify_number = c.classify_number and c.del_flag = 0
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if> <if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if> <if test="limit>0">limit #{offset},#{limit}</if>
...@@ -183,6 +212,9 @@ ...@@ -183,6 +212,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,19 @@ public class ProductDetail implements Serializable { ...@@ -47,6 +47,19 @@ 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 String productImg;
/**
* 产品分类名称
*/
private String classifyName;
/* 所属的账号 */ /* 所属的账号 */
private Long accountsId; private Long accountsId;
/* 删除标识 */ /* 删除标识 */
......
...@@ -103,12 +103,12 @@ public class ProductDetailController { ...@@ -103,12 +103,12 @@ public class ProductDetailController {
public JSONObject listData(int iDisplayStart, int iDisplayLength, ProductDetail productDetail, HttpServletRequest request) { public JSONObject listData(int iDisplayStart, int iDisplayLength, ProductDetail productDetail, HttpServletRequest request) {
Long accountsId = UserUtils.getmpaccounts(request); Long accountsId = UserUtils.getmpaccounts(request);
Conds conds = new Conds(); Conds conds = new Conds();
conds.equal("del_flag", Constants.DEL_FLAG_0); conds.equal("d.del_flag", Constants.DEL_FLAG_0);
conds.equal("accounts_id", accountsId); conds.equal("d.accounts_id", accountsId);
if(!StringUtils.isEmpty(productDetail.getProductName())){ if(!StringUtils.isEmpty(productDetail.getProductName())){
conds.equal("product_name",productDetail.getProductName()); conds.equal("d.product_name",productDetail.getProductName());
} }
Sort sort = new Sort("create_time", OrderType.DESC); Sort sort = new Sort("d.create_time", OrderType.DESC);
List<ProductDetail> list = productDetailService.fetchSearchByPage(conds, sort, iDisplayStart, iDisplayLength); List<ProductDetail> list = productDetailService.fetchSearchByPage(conds, sort, iDisplayStart, iDisplayLength);
Integer counts = productDetailService.count(conds); Integer counts = productDetailService.count(conds);
......
...@@ -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">
......
...@@ -125,6 +125,10 @@ public class Product implements Serializable { ...@@ -125,6 +125,10 @@ public class Product implements Serializable {
*产品图片 *产品图片
*/ */
private String productImg; private String productImg;
/**
* 入库编码
*/
private String ruKuNumber;
/* 所属的账号 */ /* 所属的账号 */
private Long accountsId; private Long accountsId;
/* 删除标识 */ /* 删除标识 */
......
...@@ -95,10 +95,7 @@ public class ProductServiceImpl extends GenericServiceImpl<Product> implements P ...@@ -95,10 +95,7 @@ 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 入库单编号 productIntoWareroom.setIntoWareroomNumber(product.getRuKuNumber());
String ruKuNumber = codingruleUtils.getNumber(product.getAccountsId(),ProductIntoWareroom.class.getName());
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,14 +111,12 @@ public class ProductServiceImpl extends GenericServiceImpl<Product> implements P ...@@ -114,14 +111,12 @@ 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());
productDetail.setProductClassifyNumber(product.getClassifyNumber()); productDetail.setProductClassifyNumber(product.getClassifyNumber());
productDetail.setIntoWareroomNumber(ruKuNumber); productDetail.setIntoWareroomNumber(product.getRuKuNumber());
productDetail.setWhetherSell("否"); productDetail.setWhetherSell("否");
productDetail.setCreateBy(product.getCreateBy()); productDetail.setCreateBy(product.getCreateBy());
productDetail.setUpdateBy(product.getUpdateBy()); productDetail.setUpdateBy(product.getUpdateBy());
......
...@@ -11,6 +11,7 @@ import com.cftech.core.sql.Sort; ...@@ -11,6 +11,7 @@ import com.cftech.core.sql.Sort;
import com.cftech.core.util.Constants; import com.cftech.core.util.Constants;
import com.cftech.productclassify.model.Productclassify; import com.cftech.productclassify.model.Productclassify;
import com.cftech.productclassify.service.ProductclassifyService; import com.cftech.productclassify.service.ProductclassifyService;
import com.cftech.productintowareroom.model.ProductIntoWareroom;
import com.cftech.sys.security.PermissionSign; import com.cftech.sys.security.PermissionSign;
import com.cftech.sys.security.UserUtils; import com.cftech.sys.security.UserUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -186,6 +187,7 @@ public class ProductController { ...@@ -186,6 +187,7 @@ public class ProductController {
StringBuffer sbClassify = new StringBuffer(); StringBuffer sbClassify = new StringBuffer();
boolean classify = true; boolean classify = true;
Long accountId = UserUtils.getmpaccounts(request); Long accountId = UserUtils.getmpaccounts(request);
String ruKuNumber = codingruleUtils.getNumber(accountId, ProductIntoWareroom.class.getName());
if (file == null) { if (file == null) {
retJson.put("errorNo", "1"); retJson.put("errorNo", "1");
retJson.put("errorMsg", "未选择导入文件"); retJson.put("errorMsg", "未选择导入文件");
...@@ -243,11 +245,20 @@ public class ProductController { ...@@ -243,11 +245,20 @@ 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))); if(!StringUtils.isEmpty(rowData.get(15))){
product.setPrice(Double.valueOf(rowData.get(15)));
}
//是否为处方药 //是否为处方药
product.setIsRs(rowData.get(16)); product.setIsRs(rowData.get(16));
//生成本次导入的入库编码
product.setRuKuNumber(ruKuNumber);
product.setCreateBy(UserUtils.getUser().getId()); product.setCreateBy(UserUtils.getUser().getId());
product.setUpdateBy(UserUtils.getUser().getId()); product.setUpdateBy(UserUtils.getUser().getId());
productService.saveProduct(product); productService.saveProduct(product);
...@@ -258,7 +269,12 @@ public class ProductController { ...@@ -258,7 +269,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;
} }
......
...@@ -143,16 +143,16 @@ ...@@ -143,16 +143,16 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-4"> <!-- <div class="col-md-4">-->
<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="row"> <!-- <div class="row">-->
<div class="col-md-12"> <!-- <div class="col-md-12">-->
<img id="qrcordDisplay" style='width: 160px;height: 160px;'> <!-- <img id="qrcordDisplay" style='width: 160px;height: 160px;'>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
</div> </div>
<input type="text" style="display: none" name="_csrf" value="${_csrf.token}"/> <input type="text" style="display: none" name="_csrf" value="${_csrf.token}"/>
<input type="text" style="display: none" name="_csrf_header" value="${_csrf.headerName}"/> <input type="text" style="display: none" name="_csrf_header" value="${_csrf.headerName}"/>
......
...@@ -77,7 +77,7 @@ public abstract class GenericServiceImpl<T> implements GenericService<T> { ...@@ -77,7 +77,7 @@ public abstract class GenericServiceImpl<T> implements GenericService<T> {
/** /**
* 生成page对象,并且初始化页数 * 生成page对象,并且初始化页数
* *
* @param page 当前页数 * @param pageNo 当前页数
* @param pageSize 每页显示条数 * @param pageSize 每页显示条数
* @param totalSize 总记录数 * @param totalSize 总记录数
* @return page * @return page
......
...@@ -15,6 +15,12 @@ ...@@ -15,6 +15,12 @@
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<url>http://maven.apache.org</url> <url>http://maven.apache.org</url>
<dependencies> <dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>com.cftech</groupId> <groupId>com.cftech</groupId>
<artifactId>shipping-address-module</artifactId> <artifactId>shipping-address-module</artifactId>
......
...@@ -268,6 +268,18 @@ ...@@ -268,6 +268,18 @@
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<type>jar</type> <type>jar</type>
</dependency>--> </dependency>-->
<dependency>
<groupId>com.cftech</groupId>
<artifactId>shipping-address-web</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
<!--<dependency>
<groupId>com.cftech</groupId>
<artifactId>order-module-web</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>-->
</dependencies> </dependencies>
<build> <build>
<finalName>portal-web</finalName> <finalName>portal-web</finalName>
......
...@@ -220,7 +220,8 @@ ...@@ -220,7 +220,8 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div> <button type="button" class="btn btn-info" id="addQyAccounts" style="display:none">添加企业号</button>
<button type="button" class="btn btn-info" id="addAccounts">添加公众号</button> <button type="button" class="btn btn-info" id="addAccounts">添加公众号</button>
</div> </div>
<div class="box-footer"> <div class="box-footer">
......
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