Commit 44795c45 authored by wangyihao's avatar wangyihao

修改

parent 5be36c18
......@@ -3,7 +3,8 @@ package cn.com.fqy;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
@EnableScheduling
@SpringBootApplication
@MapperScan(basePackages = "cn.com.fqy.core.dao")
public class StoreMgtApplication {
......
......@@ -8,6 +8,7 @@ import javax.annotation.Resource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import cn.com.fqy.common.Operator;
import cn.com.fqy.common.ResultInfo;
......@@ -15,7 +16,7 @@ import cn.com.fqy.common.constants.Constant;
import cn.com.fqy.core.model.Query;
import cn.com.fqy.core.model.Store;
import cn.com.fqy.core.service.StoreService;
@Component
public class StoreTimeTask {
private static final Log log = LogFactory.getLog(StoreTimeTask.class);
......
package cn.com.fqy.controller.mapi;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
......@@ -21,7 +24,7 @@ import cn.com.fqy.core.service.DataDictItemService;
*
*/
@Controller
@RequestMapping("config")
@RequestMapping("h5/config")
public class ConfigController extends BaseController{
@Resource
......@@ -39,16 +42,24 @@ public class ConfigController extends BaseController{
*/
@RequestMapping("getDataDictsStore")
@ResponseBody
public ResultInfo<List<DataDictItem>> getDataDictsStore(){
ResultInfo<List<DataDictItem>> result = new ResultInfo<>();
public ResultInfo<List<Map<String,Object>>> getDataDictsStore(){
ResultInfo<List<Map<String,Object>>> result = new ResultInfo<>();
List<Map<String,Object>> listQuery = new ArrayList<>();
DataDictItem dataDictItem = new DataDictItem();
dataDictItem.setIsAvailable(1);
dataDictItem.setIsDeleted(0);
dataDictItem.setDataDictCatCode("CONSUME_INTERVAL");
List<DataDictItem> list = dataDictItemService.getDataDictItemList(new Query(dataDictItem));
if (list.size()>0) {
List<DataDictItem> stoList = dataDictItemService.getDataDictItemList(new Query(dataDictItem));
if (stoList.size()>0 && stoList != null) {
for(DataDictItem list:stoList) {
Map<String,Object> map = new HashMap<>();
map.put("dataDictItemId", list.getDataDictItemId());
map.put("itemValue", list.getItemValue());
listQuery.add(map);
}
result.setCode("1");
result.setData(list);
result.setData(listQuery);
}else {
result.setCode("0");
result.setMsg("暂无数据");
......@@ -66,16 +77,23 @@ public class ConfigController extends BaseController{
*/
@RequestMapping("getDataDictsHight")
@ResponseBody
public ResultInfo<List<DataDictItem>> getDataDictsHight(){
ResultInfo<List<DataDictItem>> result = new ResultInfo<>();
public ResultInfo<List<Map<String,Object>>> getDataDictsHight(){
ResultInfo<List<Map<String,Object>>> result = new ResultInfo<>();
List<Map<String,Object>> listQuery = new ArrayList<>();
DataDictItem dataDictItem = new DataDictItem();
dataDictItem.setIsAvailable(1);
dataDictItem.setIsDeleted(0);
dataDictItem.setDataDictCatCode("WORKER_HEIGHT");
List<DataDictItem> list = dataDictItemService.getDataDictItemList(new Query(dataDictItem));
if (list.size()>0) {
List<DataDictItem> higList = dataDictItemService.getDataDictItemList(new Query(dataDictItem));
if (higList.size()>0 && higList != null) {
for(DataDictItem list:higList) {
Map<String,Object> map = new HashMap<>();
map.put("dataDictItemId", list.getDataDictItemId());
map.put("itemValue", list.getItemValue());
listQuery.add(map);
}
result.setCode("1");
result.setData(list);
result.setData(listQuery);
}else {
result.setCode("0");
result.setMsg("暂无数据");
......@@ -92,16 +110,23 @@ public class ConfigController extends BaseController{
*/
@RequestMapping("getDataDictsAge")
@ResponseBody
public ResultInfo<List<DataDictItem>> getDataDictsAge(){
ResultInfo<List<DataDictItem>> result = new ResultInfo<>();
public ResultInfo<List<Map<String,Object>>> getDataDictsAge(){
ResultInfo<List<Map<String,Object>>> result = new ResultInfo<>();
List<Map<String,Object>> listQuery = new ArrayList<>();
DataDictItem dataDictItem = new DataDictItem();
dataDictItem.setIsAvailable(1);
dataDictItem.setIsDeleted(0);
dataDictItem.setDataDictCatCode("WORKER_AGE");
List<DataDictItem> list = dataDictItemService.getDataDictItemList(new Query(dataDictItem));
if (list.size()>0) {
List<DataDictItem> ageList = dataDictItemService.getDataDictItemList(new Query(dataDictItem));
if (ageList.size()>0 && ageList != null) {
for(DataDictItem list:ageList) {
Map<String,Object> map = new HashMap<>();
map.put("dataDictItemId", list.getDataDictItemId());
map.put("itemValue", list.getItemValue());
listQuery.add(map);
}
result.setCode("1");
result.setData(list);
result.setData(listQuery);
}else {
result.setCode("0");
result.setMsg("暂无数据");
......
package cn.com.fqy.controller.mapi;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
......@@ -42,15 +44,22 @@ public class IndexController {
*/
@RequestMapping("getAdvertList")
@ResponseBody
public ResultInfo<List<Advert>> getAdvertList() {
ResultInfo<List<Advert>> resultInfo = new ResultInfo<List<Advert>>();
public ResultInfo<List<Map<String,Object>>> getAdvertList() {
ResultInfo<List<Map<String,Object>>> resultInfo = new ResultInfo<>();
List<Map<String,Object>> listQuery = new ArrayList<>();
Advert advert = new Advert();
advert.setIsAvailable(1); // 可用
Query q = new Query(advert);
PageFinder<Advert> pageResult = advertService.getAdvertPagedList(q);
if (null != pageResult && pageResult.getData().size() > 0) {
List<Advert> result = pageResult.getData();
resultInfo.setData(result);
List<Advert> advList = advertService.getAdvertList(new Query(advert));
if (null != advList && advList.size() > 0) {
for(Advert list:advList) {
Map<String,Object> map = new HashMap<>();
map.put("advertId", list.getAdvertId());
map.put("advertPicUrl", list.getAdvertPicUrl());
map.put("advertContent", list.getAdvertContent());
map.put("advertTitle", list.getAdvertTitle());
listQuery.add(map);
}
resultInfo.setData(listQuery);
resultInfo.setCode(Constant.SUCCESS);
resultInfo.setMsg("请求成功");
} else {
......@@ -67,16 +76,23 @@ public class IndexController {
@ResponseBody
public ResultInfo<List<Store>> getStoreList() {
ResultInfo<List<Store>> resultInfo = new ResultInfo<List<Store>>();
List<Store> listQuery = new ArrayList<>();
Store store = new Store();
store.setIsDeleted(0); // 未删除
store.setIsAvailable(1); // 店铺启用状态
store.setIsAuditing(1); // 店铺启用状态
store.setIsShopping(1); // 店铺展示状态
store.setIsRecommend(1); // 店铺推荐状态
Query q = new Query(store);
PageFinder<Store> pageResult = storeService.getStorePagedList(q);
if (null != pageResult && pageResult.getData().size() > 0) {
List<Store> result = pageResult.getData();
resultInfo.setData(result);
List<Store> stoList= storeService.getStoreList(new Query(store));
if (null != stoList && stoList.size() > 0) {
int number =0;
if(stoList.size()>3) {
number =3;
}else {
number=stoList.size();
}
for(int i=0;i<number;i++) {
listQuery.add(stoList.get(i));
}
resultInfo.setData(listQuery);
resultInfo.setCode(Constant.SUCCESS);
resultInfo.setMsg("请求成功");
} else {
......@@ -93,16 +109,25 @@ public class IndexController {
@ResponseBody
public ResultInfo<List<Worker>> getWorkerList() {
ResultInfo<List<Worker>> resultInfo = new ResultInfo<List<Worker>>();
List<Worker> listQuery = new ArrayList<>();
Worker worker = new Worker();
worker.setIsDeleted(0); // 未删除
worker.setIsAuditing(1);// 已审核
worker.setIsShopping(1);// 已展示
worker.setIsRecommend(1);// 已推荐
Query q = new Query(worker);
PageFinder<Worker> pageResult = workerService.getWorkerPagedList(q);
if (null != pageResult && pageResult.getData().size() > 0) {
List<Worker> result = pageResult.getData();
resultInfo.setData(result);
worker.setIsShopping(1); // 员工展示状态
worker.setIsAuditing(1);
List<Worker> workerList = workerService.getWorkerList(new Query(worker));
if (null != workerList && workerList.size() > 0) {
int number =0;
if(workerList.size()>9) {
number =9;
}else {
number=workerList.size();
}
for(int i=0;i<number;i++) {
listQuery.add(workerList.get(i));
}
resultInfo.setData(listQuery);
resultInfo.setCode(Constant.SUCCESS);
resultInfo.setMsg("请求成功");
} else {
......@@ -135,7 +160,7 @@ public class IndexController {
ResultInfo<List<Store>> resultInfo = new ResultInfo<>();
List<Store> listQuery = new ArrayList<>();
store.setIsDeleted(0); // 未删除
store.setIsAvailable(1); // 店铺启用状态
store.setIsAuditing(1); // 店铺启用状态
store.setIsShopping(1); // 店铺展示状态
int firstNumber = 0;
int lastNUmber = 0;
......@@ -182,7 +207,8 @@ public class IndexController {
ResultInfo<List<Worker>> resultInfo = new ResultInfo<>();
List<Worker> listQuery = new ArrayList<>();
worker.setIsDeleted(0); // 未删除
worker.setIsShopping(1); // 店铺展示状态
worker.setIsShopping(1); // 员工展示状态
worker.setIsAuditing(1);
int firstNumber = 0;
int lastNUmber = 0;
int firstNumber1 = 0;
......
......@@ -283,8 +283,9 @@ CITY_NAME,CITY_ID,PROVINCE_ID,COUNTY_ID
<select id="queryAll" parameterType="Query" resultMap="Store">
select <include refid="CommonColumnlist"/> from T_STORE
<where>
<include refid="listCommonWhere"/>
<include refid="listCommonWhere1"/>
</where>
ORDER BY SERIAL_NUMBER ASC,CLICKS DESC
</select>
<select id="pageList" parameterType="Query" resultMap="Store">
......
......@@ -257,8 +257,9 @@ UPDATE_TIME,OPERATOR_ID,OPERATOR_TYPE,SERIAL_NUMBER,IS_DELETED,STORE_NAME
<select id="queryAll" parameterType="Query" resultMap="Worker">
select <include refid="CommonColumnlist"/> from T_WORKER
<where>
<include refid="listCommonWhere"/>
<include refid="listCommonWhere1"/>
</where>
ORDER BY SERIAL_NUMBER ASC,CLICKS DESC
</select>
<select id="pageList" parameterType="Query" resultMap="Worker">
......
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