Commit 564e454d authored by 卜远杰's avatar 卜远杰

商品详情增加图片展示

parent 45e02fac
......@@ -22,9 +22,7 @@
<module>product-into-wareroom-module-web</module>
<module>product-module</module>
<module>product-module-web</module>
<module>order-module</module>
<module>order-module-web</module>
<module>order-module</module>
</modules>
<dependencies>
......
......@@ -99,7 +99,9 @@
<td>物料编码</td>
<td>产品编码</td>
<td>产品名称</td>
<td>产品图片</td>
<td>产品分类编码</td>
<td>产品分类名称</td>
<td>入库编码</td>
<td>出库编码</td>
<td>订单编码</td>
......@@ -212,8 +214,12 @@
"mData":"productNumber"
},{
"mData":"productName"
},{
"mData":"productImg"
},{
"mData":"productClassifyNumber"
},{
"mData":"classifyName"
},{
"mData":"intoWareroomNumber"
},{
......@@ -239,16 +245,23 @@
'visible': false,
'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",
"mRender": function (a, b, c, d) {
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 == ""){
......@@ -259,7 +272,7 @@
}
},{
"aTargets": [13],
"aTargets": [15],
"mData": "id",
"mRender": function (a, b, c, d) {
var html = '#if($shiro.hasPermission("qy:productDetail:edit"))';//
......
......@@ -103,7 +103,7 @@
#{description, jdbcType=VARCHAR},
#{createBy, jdbcType=BIGINT},
#{updateBy, jdbcType=BIGINT},
#{outWareroomTime, jdbc=DATETIME}
#{outWareroomTime, jdbcType=TIMESTAMP}
)
</insert>
......@@ -115,15 +115,41 @@
</select>
<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"/>
</select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap">
SELECT
<include refid="sqlColumns"/>
FROM t_aidea_product_detail
d.id id,
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"/>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if>
......
......@@ -52,6 +52,14 @@ public class ProductDetail implements Serializable {
*/
@ExportConfig(value = "出库时间", width = 100, showLevel = 1)
private Date outWareroomTime;
/**
* 产品图片
*/
private String productImg;
/**
* 产品分类名称
*/
private String classifyName;
/* 所属的账号 */
private Long accountsId;
/* 删除标识 */
......
......@@ -103,12 +103,12 @@ public class ProductDetailController {
public JSONObject listData(int iDisplayStart, int iDisplayLength, ProductDetail productDetail, HttpServletRequest request) {
Long accountsId = UserUtils.getmpaccounts(request);
Conds conds = new Conds();
conds.equal("del_flag", Constants.DEL_FLAG_0);
conds.equal("accounts_id", accountsId);
conds.equal("d.del_flag", Constants.DEL_FLAG_0);
conds.equal("d.accounts_id", accountsId);
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);
Integer counts = productDetailService.count(conds);
......
......@@ -125,6 +125,10 @@ public class Product implements Serializable {
*产品图片
*/
private String productImg;
/**
* 入库编码
*/
private String ruKuNumber;
/* 所属的账号 */
private Long accountsId;
/* 删除标识 */
......
......@@ -95,8 +95,7 @@ public class ProductServiceImpl extends GenericServiceImpl<Product> implements P
// 2、 生成入库单
ProductIntoWareroom productIntoWareroom = new ProductIntoWareroom();
productIntoWareroom.setAccountsId(product.getAccountsId());
String ruKuNumber = codingruleUtils.getNumber(product.getAccountsId(),ProductIntoWareroom.class.getName());
productIntoWareroom.setIntoWareroomNumber(ruKuNumber);
productIntoWareroom.setIntoWareroomNumber(product.getRuKuNumber());
productIntoWareroom.setProductSkuNumber("SKU");
productIntoWareroom.setProductNumber(product.getProductNumber());
productIntoWareroom.setProductName(product.getProductName());
......@@ -117,7 +116,7 @@ public class ProductServiceImpl extends GenericServiceImpl<Product> implements P
productDetail.setProductNumber(product.getProductNumber());
productDetail.setProductName(product.getProductName());
productDetail.setProductClassifyNumber(product.getClassifyNumber());
productDetail.setIntoWareroomNumber(ruKuNumber);
productDetail.setIntoWareroomNumber(product.getRuKuNumber());
productDetail.setWhetherSell("否");
productDetail.setCreateBy(product.getCreateBy());
productDetail.setUpdateBy(product.getUpdateBy());
......
......@@ -11,6 +11,7 @@ import com.cftech.core.sql.Sort;
import com.cftech.core.util.Constants;
import com.cftech.productclassify.model.Productclassify;
import com.cftech.productclassify.service.ProductclassifyService;
import com.cftech.productintowareroom.model.ProductIntoWareroom;
import com.cftech.sys.security.PermissionSign;
import com.cftech.sys.security.UserUtils;
import lombok.extern.slf4j.Slf4j;
......@@ -186,6 +187,7 @@ public class ProductController {
StringBuffer sbClassify = new StringBuffer();
boolean classify = true;
Long accountId = UserUtils.getmpaccounts(request);
String ruKuNumber = codingruleUtils.getNumber(accountId, ProductIntoWareroom.class.getName());
if (file == null) {
retJson.put("errorNo", "1");
retJson.put("errorMsg", "未选择导入文件");
......@@ -250,9 +252,13 @@ public class ProductController {
product.setStock(Long.valueOf(rowData.get(14)));
}
//价格
if(!StringUtils.isEmpty(rowData.get(15))){
product.setPrice(Double.valueOf(rowData.get(15)));
}
//是否为处方药
product.setIsRs(rowData.get(16));
//生成本次导入的入库编码
product.setRuKuNumber(ruKuNumber);
product.setCreateBy(UserUtils.getUser().getId());
product.setUpdateBy(UserUtils.getUser().getId());
productService.saveProduct(product);
......
......@@ -274,12 +274,12 @@
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
<dependency>
<!--<dependency>
<groupId>com.cftech</groupId>
<artifactId>order-module-web</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
</dependency>-->
</dependencies>
<build>
<finalName>portal-web</finalName>
......
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