Commit 3356a92b authored by 谢希宇's avatar 谢希宇

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

parents b421ea1d 88a7e017
...@@ -274,8 +274,8 @@ ...@@ -274,8 +274,8 @@
"aTargets": [2], "aTargets": [2],
"mData": "userName", "mData": "userName",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(a){ if(c){
return a; return c.userName.slice(0, 1) + '*' + c.userName.slice(2, 3);
}else{ }else{
return null; return null;
} }
...@@ -295,10 +295,11 @@ ...@@ -295,10 +295,11 @@
}, },
{ {
"aTargets": [4], "aTargets": [4],
"mData": "iphone", "mData": "phone",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(a){ if(c){
return a; return c.phone.slice(0, 3) + '****' + c.phone.slice(7);
}else{ }else{
return null; return null;
} }
...@@ -405,9 +406,6 @@ ...@@ -405,9 +406,6 @@
}else{ }else{
html += '#if($shiro.hasPermission("qy:consultSheet:view"))<a href="#springUrl("/a/consultSheet/form?id=' + a + '")" class="btn green">查看</a> #end'; html += '#if($shiro.hasPermission("qy:consultSheet:view"))<a href="#springUrl("/a/consultSheet/form?id=' + a + '")" class="btn green">查看</a> #end';
} }
return html return html
} }
} }
......
...@@ -156,8 +156,9 @@ ...@@ -156,8 +156,9 @@
<!-- AdminLTE for demo purposes --> <!-- AdminLTE for demo purposes -->
<script src="common/js/cfapp.js"></script> <script src="common/js/cfapp.js"></script>
<script> <script>
var csrf='${_csrf.token}'; var csrf = '${_csrf.token}';
var csrf_header='${_csrf.headerName}'; var csrf_header = '${_csrf.headerName}';
function formatDates(now) { function formatDates(now) {
var now = new Date(now); var now = new Date(now);
var year = now.getFullYear(); var year = now.getFullYear();
...@@ -233,7 +234,7 @@ ...@@ -233,7 +234,7 @@
} }
, ,
{ {
"mData": "payStatus" "mData": "status"
} }
, ,
{ {
...@@ -308,16 +309,20 @@ ...@@ -308,16 +309,20 @@
, ,
{ {
"aTargets": [7], "aTargets": [7],
"mData": "payStatus", "mData": "status",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if (a == '0') { if (a == '0') {
return "未付款"; return "待确认";
} else if (a == '1') { } else if (a == '1') {
return "付款"; return "付款";
} else if (a == '2') { } else if (a == '2') {
return "待发货";
} else if (a == '3') {
return "待收货";
} else if (a == '4') {
return "已完成";
} else if (a == '5') {
return "已取消"; return "已取消";
} else {
return "";
} }
} }
}, },
...@@ -360,6 +365,7 @@ ...@@ -360,6 +365,7 @@
html += '<li><a href="#springUrl("/a/order/form?id=' + a + '")">查看</a></li>'; html += '<li><a href="#springUrl("/a/order/form?id=' + a + '")">查看</a></li>';
html += '<li><a href="#springUrl("/a/order/findorderDetail?id=' + a + '&isDetail=y")">查看需求清单明细</a></li>'; html += '<li><a href="#springUrl("/a/order/findorderDetail?id=' + a + '&isDetail=y")">查看需求清单明细</a></li>';
html += '<li><a href="#springUrl("/a/order/sendOut?id=' + a + '")">订单出库</a></li>'; html += '<li><a href="#springUrl("/a/order/sendOut?id=' + a + '")">订单出库</a></li>';
html += '<li><a onclick="updateStatus(' + a + ')">关闭</a></li>';
html += '</ul>'; html += '</ul>';
html += '#end'; html += '#end';
return html; return html;
...@@ -388,6 +394,51 @@ ...@@ -388,6 +394,51 @@
Cfapp.init(); Cfapp.init();
function updateStatus(id) {
Cfapp.confirm({
message: "是否确认关闭",
btntext: "确定",
btncanceltext: "取消",
success: function () {
updateStatu(id)
},
cancel: function () {
location.href = "#springUrl('/a/order/list')";
}
});
}
function updateStatu(id) {
var url = "#springUrl('/a/order/updateStatus')"
$.ajax({
url: url,
type: "GET",
data: {id:id},
success: function (rsp) {
console.log(rsp);
if (rsp.errorNo == "0") {
Cfapp.alert({
message: "关闭成功",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/order/list')";
}
});
} else {
Cfapp.alert({
message: "关闭成功",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/order/list')";
}
});
}
}
});
}
function removeData(data) { function removeData(data) {
Cfapp.confirm({ Cfapp.confirm({
message: "确定要删除吗", message: "确定要删除吗",
...@@ -397,7 +448,7 @@ ...@@ -397,7 +448,7 @@
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "#springUrl('/a/order/delete')", url: "#springUrl('/a/order/delete')",
data: {_csrf:csrf,_csrf_header:csrf_header,id: data}, data: {_csrf: csrf, _csrf_header: csrf_header, id: data},
dataType: "json", dataType: "json",
success: function (data) { success: function (data) {
if (data.errorNo == 0) { if (data.errorNo == 0) {
......
package com.cftech.order.dao; package com.cftech.order.dao;
import com.alibaba.fastjson.JSONObject;
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.order.model.*; import com.cftech.order.model.*;
...@@ -20,6 +19,7 @@ import java.util.Map; ...@@ -20,6 +19,7 @@ import java.util.Map;
public interface OrderMapper extends GenericDao<Order> { public interface OrderMapper extends GenericDao<Order> {
Integer deleteAll(@Param("id") Long id); Integer deleteAll(@Param("id") Long id);
Integer updateStatus(@Param("id") Long id);
List<Order> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize, Long id); List<Order> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize, Long id);
...@@ -58,4 +58,12 @@ public interface OrderMapper extends GenericDao<Order> { ...@@ -58,4 +58,12 @@ public interface OrderMapper extends GenericDao<Order> {
* @Param * @Param
**/ **/
List<ProductMobile> orderDetill(@Param("orderId") Long orderId); List<ProductMobile> orderDetill(@Param("orderId") Long orderId);
/**
* @return
* @Author Licc
* @Description 根据订单ID查询订单详情
* @Date 10:46 2020/11/1
* @Param
**/
OrderSizeVO orderSize(@Param("openid") String openid);
} }
\ No newline at end of file
...@@ -444,6 +444,15 @@ ...@@ -444,6 +444,15 @@
</set> </set>
where id= #{id} where id= #{id}
</update> </update>
<update id="updateStatus" parameterType="java.lang.Long">
update t_order
<set>
<if test="id!=null">
status = 5
</if>
</set>
where id= #{id}
</update>
<select id="orderFall" resultType="com.cftech.order.model.OrderMobile"> <select id="orderFall" resultType="com.cftech.order.model.OrderMobile">
SELECT SELECT
...@@ -490,5 +499,9 @@ WHERE t.del_flag=0 ...@@ -490,5 +499,9 @@ WHERE t.del_flag=0
<if test="orderId!=null"> <if test="orderId!=null">
and t.order_id =#{orderId} and t.order_id =#{orderId}
</if> </if>
</select>
<select id="orderSize" resultType="com.cftech.order.model.OrderSizeVO" >
</select> </select>
</mapper> </mapper>
\ No newline at end of file
package com.cftech.order.model;
import lombok.Data;
/**
* @author :licc
* @date :Created in 2020/11/3 19:10
* @description:
*/
@Data
public class OrderSizeVO {
/*待确认数量*/
private Long confirm;
/*待发货数量*/
private Long delivered;
/*待收货数量*/
private Long received;
/*已完成数量*/
private Long completed;
/*已完成数量*/
private Long cancelled;
}
...@@ -28,7 +28,7 @@ public interface OrderService extends GenericService<Order> { ...@@ -28,7 +28,7 @@ public interface OrderService extends GenericService<Order> {
List<ProductOrder> listProduct(); List<ProductOrder> listProduct();
OrderFromVO fetchId(Serializable id); OrderFromVO fetchId(Serializable id);
List<OrderFromVO> fetchProductId(Serializable id); List<OrderFromVO> fetchProductId(Serializable id);
Integer updateStatus(Long id);
JSONObject newlyAdded(String datas, Long accountsId); JSONObject newlyAdded(String datas, Long accountsId);
JSONObject deleteAll(Long id); JSONObject deleteAll(Long id);
/** /**
...@@ -39,5 +39,13 @@ public interface OrderService extends GenericService<Order> { ...@@ -39,5 +39,13 @@ public interface OrderService extends GenericService<Order> {
* @return * @return
**/ **/
JSONObject confirm(String openid,Long status,Long id); JSONObject confirm(String openid,Long status,Long id);
/**
* @Author Licc
* @Description 订单数量
* @Date 19:05 2020/11/3
* @Param
* @return
**/
JSONObject orderSize(String openid);
} }
...@@ -70,6 +70,11 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -70,6 +70,11 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
return orderMapper.fetchProductId(id); return orderMapper.fetchProductId(id);
} }
@Override
public Integer updateStatus(Long id) {
return orderMapper.updateStatus(id);
}
@Transactional @Transactional
@Override @Override
public com.alibaba.fastjson.JSONObject newlyAdded(String datas, Long accountsId) { public com.alibaba.fastjson.JSONObject newlyAdded(String datas, Long accountsId) {
...@@ -164,8 +169,6 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -164,8 +169,6 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
} }
} }
//com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(orderMobiles)); //com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(orderMobiles));
object.put("orderMobiles", orderMobiles); object.put("orderMobiles", orderMobiles);
rtnJson.put("errorNo","0"); rtnJson.put("errorNo","0");
rtnJson.put("data",object); rtnJson.put("data",object);
...@@ -177,4 +180,22 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -177,4 +180,22 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
return rtnJson; return rtnJson;
} }
@Override
public com.alibaba.fastjson.JSONObject orderSize(String openid) {
com.alibaba.fastjson.JSONObject rtnJson = new com.alibaba.fastjson.JSONObject();
try{
OrderSizeVO productMobiles = orderMapper.orderSize(openid);
if (productMobiles!=null){
rtnJson.put("errorNo","0");
rtnJson.put("data",productMobiles);
return rtnJson;
}
rtnJson.put("errorNo","1");
}catch (Exception e){
e.printStackTrace();
rtnJson.put("errorNo", "1");
}
return rtnJson;
}
} }
\ No newline at end of file
...@@ -33,4 +33,26 @@ public class MobileOrderController { ...@@ -33,4 +33,26 @@ public class MobileOrderController {
public JSONObject confirm(String openid,Long status,Long id){ public JSONObject confirm(String openid,Long status,Long id){
return orderService.confirm(openid,status,id); return orderService.confirm(openid,status,id);
} }
// /**
// * @Author Licc
// * @Description 订单数量
// * @Date 19:03 2020/11/3
// * @Param
// * @return
// **/
// @RequestMapping(value = "/orderSize",method = {RequestMethod.POST},produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
// public JSONObject orderSize(String openid){
// return orderService.orderSize(openid);
// }
// /**
// * @Author Licc
// * @Description 根据搜索条件查询订单
// * @Date 19:40 2020/11/3
// * @Param
// * @return
// **/
// @RequestMapping(value = "/orderSize",method = {RequestMethod.POST},produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
// public JSONObject orderSize(String openid){
// return orderService.orderSize(openid);
// }
} }
...@@ -184,7 +184,7 @@ public class OrderController { ...@@ -184,7 +184,7 @@ public class OrderController {
orderVO.setCourierNumber(order.getCourierNumber()); orderVO.setCourierNumber(order.getCourierNumber());
orderVO.setTradeNo(order.getTradeNo()); orderVO.setTradeNo(order.getTradeNo());
orderVO.setCreateTime(simpleDateFormat.format(order.getCreateTime())); orderVO.setCreateTime(simpleDateFormat.format(order.getCreateTime()));
orderVO.setPayStatus(order.getPayStatus().equals("0") ? "未付款" : order.getPayStatus().equals("1") ? "已付款" : "已取消"); orderVO.setPayStatus(order.getPayStatus().equals("0") ? "待确认" : order.getPayStatus().equals("1") ? "待付款" : order.getPayStatus().equals("2") ? "待发货" :order.getPayStatus().equals("3") ? "待收货":order.getPayStatus().equals("4") ? "已完成" :"已取消");
orderVOS.add(orderVO); orderVOS.add(orderVO);
} }
ExcelKit.$Export(OrderVO.class, response).toExcel(orderVOS, "订单管理信息"); ExcelKit.$Export(OrderVO.class, response).toExcel(orderVOS, "订单管理信息");
...@@ -239,4 +239,16 @@ public class OrderController { ...@@ -239,4 +239,16 @@ public class OrderController {
return orderService.deleteAll(id); return orderService.deleteAll(id);
} }
@RequestMapping("/updateStatus")
@ResponseBody
public JSONObject updateStatus(Long id,HttpServletRequest request ,Model model) {
JSONObject rtnJson = new JSONObject();
Integer integer = orderService.updateStatus(id);
if (integer>0){
rtnJson.put("errorNo","0");
return rtnJson;
}
rtnJson.put("errorNo","1");
return rtnJson;
}
} }
...@@ -223,6 +223,10 @@ ...@@ -223,6 +223,10 @@
t.format, t.format,
t.product_number AS productNumber, t.product_number AS productNumber,
t.accounts_id AS accountsId, t.accounts_id AS accountsId,
t.is_rs AS isRs,
t.size AS size,
t.isreading AS isreading,
t.reading AS reading,
c.classify_name AS classifyName c.classify_name AS classifyName
FROM t_aidea_product t LEFT JOIN t_aidea_product_classify c FROM t_aidea_product t LEFT JOIN t_aidea_product_classify c
ON c.id = t.classify_id WHERE t.del_flag=0 ON c.id = t.classify_id WHERE t.del_flag=0
......
...@@ -25,4 +25,8 @@ public class ProductclassifyVO { ...@@ -25,4 +25,8 @@ public class ProductclassifyVO {
private String commonName; private String commonName;
/*规格*/ /*规格*/
private String format; private String format;
private String isRs;
private Long size;
private Long isreading;
private Long reading;
} }
...@@ -17,8 +17,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -17,8 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
*/ */
@Slf4j @Slf4j
@RestController @RestController
@CrossOrigin @RequestMapping("/mobile/auth/productclassify")
@RequestMapping("mobile/auth/productclassify")
public class MobileclassifyController { public class MobileclassifyController {
@Autowired @Autowired
private com.cftech.productclassify.service.ProductclassifyService ProductclassifyService; private com.cftech.productclassify.service.ProductclassifyService ProductclassifyService;
......
...@@ -208,7 +208,22 @@ ...@@ -208,7 +208,22 @@
name="price" placeholder="价格" name="price" placeholder="价格"
> >
</div> </div>
<input type="hidden" id="redingType" name="redingType" value="$!{data.isreading}"/>
<input type="hidden" id="sizeType" name="sizeType" value="$!{data.size}"/>
<div class="form-group form-md-line-input col-md-12">
<label>是否展示销量</label>
<select id="isreading" name="isreading" class="form-control pull-right">
<option id="redingYes" name="redingYes" value="1" ></option>
<option id="redingNo" name="redingNo" value="0" ></option>
</select>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>是否好药推荐</label>
<select id="size" name="size" class="form-control pull-right">
<option id="sizeYes" name="sizeYes" value="1" ></option>
<option id="sizeNo" name="sizeNo" value="0" ></option>
</select>
</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>
<select name="isRs" class="form-control pull-right"> <select name="isRs" class="form-control pull-right">
...@@ -284,6 +299,20 @@ ...@@ -284,6 +299,20 @@
<!-- END PAGE LEVEL PLUGINS --> <!-- END PAGE LEVEL PLUGINS -->
<script> <script>
$().ready(function () { $().ready(function () {
let redingType = $("#redingType").val();
let redingYes = $("#redingYes").val();
if (redingType==redingYes){
$("#redingYes").attr("selected","selected")
}else{
$("#redingNo").attr("selected","selected")
}
let sizeType = $("#sizeType").val();
let sizeYes = $("#sizeYes").val();
if (sizeType==sizeYes){
$("#sizeYes").attr("selected","selected")
}else{
$("#sizeNo").attr("selected","selected")
}
Cfapp.init(); Cfapp.init();
recdTypeAdd.init(); recdTypeAdd.init();
initPicsSel(); initPicsSel();
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
<result column="product_img_detail" property="productImgDetail"/> <result column="product_img_detail" property="productImgDetail"/>
<result column="is_rs" property="isRs"/> <result column="is_rs" property="isRs"/>
<result column="reading" property="reading"/> <result column="reading" property="reading"/>
<result column="size" property="size"/>
<result column="isreading" property="isreading"/>
</resultMap> </resultMap>
<sql id="sqlWhere"> <sql id="sqlWhere">
...@@ -88,7 +90,9 @@ ...@@ -88,7 +90,9 @@
product_number, product_number,
product_img_detail, product_img_detail,
is_rs, is_rs,
reading reading,
size,
isreading
</sql> </sql>
<sql id="productList"> <sql id="productList">
...@@ -113,7 +117,9 @@ ...@@ -113,7 +117,9 @@
t.product_number AS productNumber, t.product_number AS productNumber,
t.accounts_id AS accountsId, t.accounts_id AS accountsId,
c.classify_name AS classifyName, c.classify_name AS classifyName,
t.product_img_detail AS productImgDetail t.product_img_detail AS productImgDetail,
t.reading,
t.isreading
</sql> </sql>
<insert id="save" parameterType="com.cftech.product.model.Product" useGeneratedKeys="true" <insert id="save" parameterType="com.cftech.product.model.Product" useGeneratedKeys="true"
...@@ -336,6 +342,12 @@ ...@@ -336,6 +342,12 @@
<if test="reading != null"> <if test="reading != null">
reading = #{reading , jdbcType=VARCHAR}, reading = #{reading , jdbcType=VARCHAR},
</if> </if>
<if test="size != null">
size = #{size, jdbcType=BIGINT},
</if>
<if test="isreading != null">
isreading = #{isreading , jdbcType=BIGINT}
</if>
</set> </set>
where id=#{id,jdbcType=BIGINT} where id=#{id,jdbcType=BIGINT}
</update> </update>
......
...@@ -144,7 +144,8 @@ public class Product implements Serializable { ...@@ -144,7 +144,8 @@ public class Product implements Serializable {
private Date createTime; private Date createTime;
/* 更新时间 */ /* 更新时间 */
private Date updateTime; private Date updateTime;
private Long isreading;
private Long size;
/* 创建人 */ /* 创建人 */
private Long createBy; private Long createBy;
/* 更新人 */ /* 更新人 */
......
...@@ -48,14 +48,13 @@ public class ProductVO { ...@@ -48,14 +48,13 @@ public class ProductVO {
private String isRs; private String isRs;
/*产品编码*/ /*产品编码*/
private String productNumber; private String productNumber;
/*accounts_id*/ /*accounts_id*/
private Long accountsId; private Long accountsId;
/*分类名称*/ /*分类名称*/
private String classifyName; private String classifyName;
/*产品详情图*/ /*产品详情图*/
private String productImgDetail; private String productImgDetail;
/*是否展示销量*/
private Long isreading;
} }
...@@ -244,9 +244,15 @@ ...@@ -244,9 +244,15 @@
value=""> value="">
</div> </div>
<div class="col-xs-2"> <div class="col-xs-2">
<input type="text" class="form-control" <div class="input-group date">
placeholder="栏目名称" name="columnName" <div class="input-group-addon">
value=""> <i class="fa fa-calendar"></i>
</div>
<input type="text" class="form-control pull-right datepicker"
value="$!{startTime}"
name="startTime" placeholder="发布时间"
readonly="readonly">
</div>
</div> </div>
<div> <div>
<input type="text" class="form-control" name="column" style="display: none;"> <input type="text" class="form-control" name="column" style="display: none;">
...@@ -277,6 +283,7 @@ ...@@ -277,6 +283,7 @@
<th>创建时间</th> <th>创建时间</th>
<th>是否推荐文章</th> <th>是否推荐文章</th>
<th>是否推荐banner图</th> <th>是否推荐banner图</th>
<th>是否发布文章</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
</thead> </thead>
...@@ -419,8 +426,6 @@ ...@@ -419,8 +426,6 @@
htmlStr += '<option value="' + tagObj.id + '">' + tagObj.name + '</option>'; htmlStr += '<option value="' + tagObj.id + '">' + tagObj.name + '</option>';
} }
} }
; ;
$('#taglist').html(htmlStr); $('#taglist').html(htmlStr);
...@@ -789,6 +794,10 @@ ...@@ -789,6 +794,10 @@
, ,
{ {
"mData": "whetherBanner" "mData": "whetherBanner"
}
,
{
"mData": "article"
}, },
{ {
"mData": "id" "mData": "id"
...@@ -840,6 +849,19 @@ ...@@ -840,6 +849,19 @@
}, },
{ {
"aTargets": [6], "aTargets": [6],
"mData": "article",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
var html = ''
if (a == 1) {
html += '<input type="checkbox" id="article" name="article" value="' + a + '" checked="true" onchange="onArticle(event)">';
} else {
html += '<input type="checkbox" id="article" name="article" value="' + a + '" onchange="onArticle(event)">';
}
return html;
}
},
{
"aTargets": [7],
"mData": "id", "mData": "id",
"mRender": function (a, b, c, d) {//a表示id对应的值,c表示当前记录行对象 "mRender": function (a, b, c, d) {//a表示id对应的值,c表示当前记录行对象
...@@ -884,6 +906,47 @@ ...@@ -884,6 +906,47 @@
} }
function onArticle(e) {
if (e.target.value == 1) {
Cfapp.confirm({
message: "是否确认取消推荐文章",
btntext: "确定",
btncanceltext: "取消",
success: function () {
if (e.target.value == '0') {
e.target.value = '1'
} else if (e.target.value == '1') {
e.target.value = '0'
}
save()
},
cancel: function () {
location.href = "#springUrl('/a/cfarticle/list')";
}
});
} else if (e.target.value == 0){
Cfapp.confirm({
message: "是否确认推荐文章",
btntext: "确定",
btncanceltext: "取消",
success: function () {
if (e.target.value == '0') {
e.target.value = '1'
} else if (e.target.value == '1') {
e.target.value = '0'
}
save()
},
cancel: function () {
location.href = "#springUrl('/a/cfarticle/list')";
}
});
}
}
function onBanner(e) { function onBanner(e) {
if (e.target.value == 1) { if (e.target.value == 1) {
Cfapp.confirm({ Cfapp.confirm({
...@@ -898,7 +961,12 @@ ...@@ -898,7 +961,12 @@
} }
}); });
} else { } else {
b(e) if (e.target.value == '0') {
e.target.value = '1'
} else if (e.target.value == '1') {
e.target.value = '0'
}
save()
} }
} }
...@@ -984,7 +1052,7 @@ ...@@ -984,7 +1052,7 @@
success: function () { success: function () {
select(e) select(e)
$('#myModal').modal('show') $('#myModal').modal('show')
} , },
cancel: function () { cancel: function () {
location.href = "#springUrl('/a/cfarticle/list')"; location.href = "#springUrl('/a/cfarticle/list')";
} }
...@@ -1005,11 +1073,13 @@ ...@@ -1005,11 +1073,13 @@
const id = $(item).find('[name="id"]').val() const id = $(item).find('[name="id"]').val()
const recommended = $(item).find('[name="recommended"]').val() const recommended = $(item).find('[name="recommended"]').val()
const whetherBanner = $(item).find('[name="whetherBanner"]').val() const whetherBanner = $(item).find('[name="whetherBanner"]').val()
const article = $(item).find('[name="article"]').val()
datas.push({ datas.push({
id: id, id: id,
recommended: recommended, recommended: recommended,
whetherBanner: whetherBanner whetherBanner: whetherBanner,
article : article
}) })
}) })
...@@ -1019,7 +1089,7 @@ ...@@ -1019,7 +1089,7 @@
url: url, url: url,
type: "POST", type: "POST",
dateType: 'json', dateType: 'json',
data: {_csrf_header: csrfheader.value, _csrf: csrftoken.value,datas: JSON.stringify(datas)}, data: {_csrf_header: csrfheader.value, _csrf: csrftoken.value, datas: JSON.stringify(datas)},
success: function (rsp) { success: function (rsp) {
console.log(rsp); console.log(rsp);
if (rsp.errorNo == "0") { if (rsp.errorNo == "0") {
...@@ -1131,7 +1201,6 @@ ...@@ -1131,7 +1201,6 @@
} }
</script> </script>
</body> </body>
......
...@@ -8,6 +8,7 @@ import com.cftech.cms.cfarticle.model.columnVO; ...@@ -8,6 +8,7 @@ import com.cftech.cms.cfarticle.model.columnVO;
import com.cftech.core.generic.GenericDao; import com.cftech.core.generic.GenericDao;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -40,7 +41,7 @@ public interface CfarticleMapper extends GenericDao<Cfarticle> { ...@@ -40,7 +41,7 @@ public interface CfarticleMapper extends GenericDao<Cfarticle> {
List<Cfarticle> fetchSearchByPageInOrder(Map<String,Object> params); List<Cfarticle> fetchSearchByPageInOrder(Map<String,Object> params);
int countReview(Map<String,Object> params); int countReview(Map<String,Object> params);
Integer updatecom(@Param("id") Long id, @Param("recommended")Long recommended, @Param("whetherBanner")Long whetherBanner); Integer updatecom(@Param("id") Long id, @Param("recommended")Long recommended, @Param("whetherBanner")Long whetherBanner, @Param("article")Long article, @Param("updateTime" )String updateTime);
/** /**
* @Author Licc * @Author Licc
* @Description 药品库推荐数据回填 * @Description 药品库推荐数据回填
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
<result column="recommended" property="recommended"/> <result column="recommended" property="recommended"/>
<result column="whether_banner" property="whetherBanner"/> <result column="whether_banner" property="whetherBanner"/>
<result column="size" property="size"/> <result column="size" property="size"/>
<result column="article" property="article"/>
</resultMap> </resultMap>
<sql id="sqlWhere"> <sql id="sqlWhere">
...@@ -56,7 +57,7 @@ ...@@ -56,7 +57,7 @@
</sql> </sql>
<sql id="sqlColumns"> <sql id="sqlColumns">
id, id,
title, title,
bigimg, bigimg,
smallimg, smallimg,
...@@ -79,7 +80,8 @@ ...@@ -79,7 +80,8 @@
recommended, recommended,
whether_banner, whether_banner,
reading, reading,
size size,
article
</sql> </sql>
...@@ -110,10 +112,12 @@ ...@@ -110,10 +112,12 @@
#{contentSourceUrl, jdbcType=VARCHAR}, #{contentSourceUrl, jdbcType=VARCHAR},
#{author, jdbcType=VARCHAR}, #{author, jdbcType=VARCHAR},
#{isUrl, jdbcType=TINYINT}, #{isUrl, jdbcType=TINYINT},
#{recommended, jdbcType=BIGINT}, #{type, jdbcType=VARCHAR},
#{whether_banner, jdbcType=BIGINT}, 0,
0,
#{reading, jdbcType=BIGINT}, #{reading, jdbcType=BIGINT},
#{size, jdbcType=BIGINT} #{size, jdbcType=BIGINT},
0
) )
</insert> </insert>
...@@ -204,6 +208,7 @@ ...@@ -204,6 +208,7 @@
t.recommended, t.recommended,
t.whether_banner, t.whether_banner,
t.size, t.size,
t.article,
co.remarks, co.remarks,
co.name columnName co.name columnName
FROM wx_cms_cfarticle t FROM wx_cms_cfarticle t
...@@ -317,7 +322,10 @@ ...@@ -317,7 +322,10 @@
reading = #{reading, jdbcType=BIGINT}, reading = #{reading, jdbcType=BIGINT},
</if> </if>
<if test="size != null"> <if test="size != null">
size = #{size, jdbcType=BIGINT} size = #{size, jdbcType=BIGINT},
</if>
<if test="article != null">
article = #{article, jdbcType=BIGINT}
</if> </if>
</set> </set>
...@@ -334,7 +342,13 @@ ...@@ -334,7 +342,13 @@
recommended = #{recommended}, recommended = #{recommended},
</if> </if>
<if test="whetherBanner!=null"> <if test="whetherBanner!=null">
whether_banner = #{whetherBanner} whether_banner = #{whetherBanner},
</if>
<if test="article!=null">
article = #{article},
</if>
<if test="updateTime!=null">
update_time= #{updateTime}
</if> </if>
</set> </set>
where id = #{id} where id = #{id}
...@@ -408,6 +422,7 @@ SELECT count(*) FROM wx_cms_cfarticle WHERE whether_banner= 1 ...@@ -408,6 +422,7 @@ SELECT count(*) FROM wx_cms_cfarticle WHERE whether_banner= 1
t.whether_banner, t.whether_banner,
t.size, t.size,
t.reading, t.reading,
t.article,
co.remarks co.remarks
FROM wx_cms_cfarticle t FROM wx_cms_cfarticle t
left join wx_cms_column co on co.id = t.`column` left join wx_cms_column co on co.id = t.`column`
...@@ -417,7 +432,7 @@ SELECT count(*) FROM wx_cms_cfarticle WHERE whether_banner= 1 ...@@ -417,7 +432,7 @@ SELECT count(*) FROM wx_cms_cfarticle WHERE whether_banner= 1
</if> </if>
</select> </select>
<select id="column" resultType="com.cftech.cms.cfarticle.model.columnVO"> <select id="column" resultType="com.cftech.cms.cfarticle.model.columnVO">
SELECT SELECT
id, id,
number, number,
name, name,
...@@ -426,7 +441,7 @@ SELECT count(*) FROM wx_cms_cfarticle WHERE whether_banner= 1 ...@@ -426,7 +441,7 @@ SELECT count(*) FROM wx_cms_cfarticle WHERE whether_banner= 1
status, status,
create_time AS createTime, create_time AS createTime,
description description
FROM wx_cms_column FROM wx_cms_column
WHERE del_flag = 0 WHERE del_flag = 0
</select> </select>
<select id="columnDetails" resultType="com.cftech.cms.cfarticle.model.CfarticleVO" > <select id="columnDetails" resultType="com.cftech.cms.cfarticle.model.CfarticleVO" >
...@@ -438,6 +453,7 @@ bigimg, ...@@ -438,6 +453,7 @@ bigimg,
smallimg, smallimg,
content, content,
create_time AS createTime, create_time AS createTime,
update_time AS updatetime,
reading, reading,
recommended, recommended,
whether_banner AS whetherBanner, whether_banner AS whetherBanner,
......
...@@ -79,8 +79,11 @@ public class Cfarticle implements Serializable { ...@@ -79,8 +79,11 @@ public class Cfarticle implements Serializable {
private Long whetherBanner; private Long whetherBanner;
/* 封面微信ID */ /* 封面微信ID */
private String thumbMediaId; private String thumbMediaId;
private Long reading; private Long reading;
private Long article;
......
...@@ -33,6 +33,7 @@ public class CfarticleVO { ...@@ -33,6 +33,7 @@ public class CfarticleVO {
/* 创建时间 */ /* 创建时间 */
private Date createTime; private Date createTime;
private Date updateTime;
/*阅读量*/ /*阅读量*/
private Long reading; private Long reading;
/*是否置顶文章*/ /*是否置顶文章*/
......
...@@ -22,8 +22,10 @@ public class columnVO { ...@@ -22,8 +22,10 @@ public class columnVO {
private String status; private String status;
/*栏目编码*/ /*栏目编码*/
private String createTime; private String createTime;
private String updateTime;
/*备注*/ /*备注*/
private String description; private String description;
private Long article;
} }
...@@ -20,6 +20,8 @@ import org.springframework.beans.factory.annotation.Qualifier; ...@@ -20,6 +20,8 @@ import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -87,7 +89,10 @@ public class CfarticleServiceImpl extends GenericServiceImpl<Cfarticle> implemen ...@@ -87,7 +89,10 @@ public class CfarticleServiceImpl extends GenericServiceImpl<Cfarticle> implemen
long id = jsonObject.getLong("id"); long id = jsonObject.getLong("id");
long recommended = jsonObject.getLong("recommended"); long recommended = jsonObject.getLong("recommended");
long whetherBanner = jsonObject.getLong("whetherBanner"); long whetherBanner = jsonObject.getLong("whetherBanner");
Integer integer = cfarticleMapper.updatecom(id, recommended, whetherBanner); long article = jsonObject.getLong("article");
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String updateTime = format.format(new Date());
Integer integer = cfarticleMapper.updatecom(id, recommended, whetherBanner,article,updateTime);
if (integer > 0) { if (integer > 0) {
rtnJson.put("errorNo", "0"); rtnJson.put("errorNo", "0");
rtnJson.put("errorMsg", "修改成功"); rtnJson.put("errorMsg", "修改成功");
......
...@@ -222,7 +222,7 @@ public class CfarticleController { ...@@ -222,7 +222,7 @@ public class CfarticleController {
@RequiresPermissions(value = CFARTICLE_VIEW) @RequiresPermissions(value = CFARTICLE_VIEW)
@RequestMapping(value = "/listData",method = {RequestMethod.GET,RequestMethod.POST}) @RequestMapping(value = "/listData",method = {RequestMethod.GET,RequestMethod.POST})
@ResponseBody @ResponseBody
public JSONObject listData(int iDisplayStart, int iDisplayLength, Cfarticle cfarticle, HttpServletRequest request,String columnName) { public JSONObject listData(int iDisplayStart, int iDisplayLength, Cfarticle cfarticle, HttpServletRequest request,String columnName,String startTime) {
Long accountsId = UserUtils.getmpaccounts(request); Long accountsId = UserUtils.getmpaccounts(request);
Conds conds = new Conds(); Conds conds = new Conds();
conds.equal("t.del_flag", Constants.DEL_FLAG_0); conds.equal("t.del_flag", Constants.DEL_FLAG_0);
...@@ -244,6 +244,8 @@ public class CfarticleController { ...@@ -244,6 +244,8 @@ public class CfarticleController {
} }
if (!StringUtils.isEmpty(cfarticle.getType())) { if (!StringUtils.isEmpty(cfarticle.getType())) {
conds.equal("t.type", cfarticle.getType()); conds.equal("t.type", cfarticle.getType());
}if (!StringUtils.isEmpty(startTime)) {
conds.equal("t.update_time", startTime);
} }
Sort sort = new Sort("t.create_time", OrderType.DESC); Sort sort = new Sort("t.create_time", OrderType.DESC);
......
...@@ -299,13 +299,13 @@ ...@@ -299,13 +299,13 @@
"aTargets":[4], "aTargets":[4],
"mData":"phone", "mData":"phone",
"mRender":function(a,b,c,d){ "mRender":function(a,b,c,d){
return a; return c.phone.slice(0, 1) + '*' + c.phone.slice(2, 3);
} }
},{ },{
"aTargets":[5], "aTargets":[5],
"mData":"name", "mData":"name",
"mRender":function(a,b,c,d){ "mRender":function(a,b,c,d){
return a; return c.name.slice(0, 3) + '****' + c.name.slice(7);
} }
},{ },{
"aTargets":[6], "aTargets":[6],
......
...@@ -16,7 +16,6 @@ import org.springframework.web.bind.annotation.*; ...@@ -16,7 +16,6 @@ import org.springframework.web.bind.annotation.*;
*/ */
@Slf4j @Slf4j
@RestController @RestController
@CrossOrigin
@RequestMapping("mobile/auth/member") @RequestMapping("mobile/auth/member")
public class MobileMemberController { public class MobileMemberController {
......
...@@ -274,7 +274,7 @@ ...@@ -274,7 +274,7 @@
"aTargets": [2], "aTargets": [2],
"mData": "addressName", "mData": "addressName",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a; return c.addressName.slice(0, 1) + '*' + c.addressName.slice(2, 3);
} }
}, },
{ {
...@@ -292,7 +292,7 @@ ...@@ -292,7 +292,7 @@
"aTargets": [4], "aTargets": [4],
"mData": "phone", "mData": "phone",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a; return c.phone.slice(0, 1) + '*' + c.phone.slice(2, 3);
} }
}, },
{ {
......
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