浏览代码

Merge remote-tracking branch 'origin/developerMysql' into developer

zhijiezhao 1 年之前
父节点
当前提交
4a3c03e79d
共有 53 个文件被更改,包括 32 次插入7147 次删除
  1. 0 15
      src/main/java/com/caimei/modules/bulkpurchase/dao/BpOrderRemarkDao.java
  2. 0 44
      src/main/java/com/caimei/modules/bulkpurchase/service/BpOrderRemarkService.java
  3. 0 118
      src/main/java/com/caimei/modules/bulkpurchase/web/BpOrderRemarkController.java
  4. 0 139
      src/main/java/com/caimei/modules/bulkpurchase/web/CmFinanceChargeController.java
  5. 0 132
      src/main/java/com/caimei/modules/bulkpurchase/web/CmFinanceReceiptsController.java
  6. 0 374
      src/main/java/com/caimei/modules/bulkpurchase/web/ContractController.java
  7. 0 920
      src/main/java/com/caimei/modules/bulkpurchase/web/ContractOrderController.java
  8. 0 80
      src/main/java/com/caimei/modules/bulkpurchase/web/ProductPrivilegeController.java
  9. 0 6
      src/main/java/com/caimei/modules/cmpage/web/CmPageCentreController.java
  10. 0 2
      src/main/java/com/caimei/modules/order/dao/CmReceiptOrderRelationDao.java
  11. 0 15
      src/main/java/com/caimei/modules/product/dao/ActTypeDao.java
  12. 0 19
      src/main/java/com/caimei/modules/product/dao/ProductCustomClassificationDao.java
  13. 9 28
      src/main/java/com/caimei/modules/product/dao/ProductDao.java
  14. 0 51
      src/main/java/com/caimei/modules/product/entity/ProductCustomClassification.java
  15. 0 18
      src/main/java/com/caimei/modules/product/service/ActTypeService.java
  16. 2 4
      src/main/java/com/caimei/modules/product/service/CmTinytypeService.java
  17. 0 53
      src/main/java/com/caimei/modules/product/service/ProductCustomClassificationService.java
  18. 0 83
      src/main/java/com/caimei/modules/product/service/ProductService.java
  19. 0 27
      src/main/java/com/caimei/modules/product/web/ProductActController.java
  20. 2 785
      src/main/java/com/caimei/modules/product/web/ProductController.java
  21. 0 80
      src/main/java/com/caimei/modules/product/web/ProductCustomClassificationController.java
  22. 0 57
      src/main/java/com/caimei/modules/product/web/ProductNewController.java
  23. 0 301
      src/main/java/com/caimei/modules/product/web/ProductsClassifyController.java
  24. 2 0
      src/main/java/com/caimei/modules/user/dao/ClubChangeSpReviewDao.java
  25. 0 83
      src/main/resources/mappings/modules/bulkpurchase/BpOrderCirculationMapper.xml
  26. 0 90
      src/main/resources/mappings/modules/bulkpurchase/BpOrderProductRemarkMapper.xml
  27. 0 82
      src/main/resources/mappings/modules/bulkpurchase/BpOrderRemarkMapper.xml
  28. 0 140
      src/main/resources/mappings/modules/bulkpurchase/BpOrderStagesShopMapper.xml
  29. 0 138
      src/main/resources/mappings/modules/bulkpurchase/BpOrderUserinfoMapper.xml
  30. 0 313
      src/main/resources/mappings/modules/bulkpurchase/CmFinanceChargeMapper.xml
  31. 0 175
      src/main/resources/mappings/modules/bulkpurchase/CmFinanceChargeStagesMapper.xml
  32. 0 319
      src/main/resources/mappings/modules/bulkpurchase/CmFinanceReceiptsMapper.xml
  33. 0 141
      src/main/resources/mappings/modules/bulkpurchase/ContractMapper.xml
  34. 0 345
      src/main/resources/mappings/modules/bulkpurchase/ContractOrderMapper.xml
  35. 0 264
      src/main/resources/mappings/modules/bulkpurchase/OrderProductMapper.xml
  36. 0 83
      src/main/resources/mappings/modules/bulkpurchase/OrderStagesMapper.xml
  37. 0 44
      src/main/resources/mappings/modules/bulkpurchase/OrderStagesProductMapper.xml
  38. 0 96
      src/main/resources/mappings/modules/bulkpurchase/ProductPrivilegeMapper.xml
  39. 0 223
      src/main/resources/mappings/modules/bulkpurchase/PurchaseProductMapper.xml
  40. 0 79
      src/main/resources/mappings/modules/bulkpurchase/ReceiptListMapper.xml
  41. 0 69
      src/main/resources/mappings/modules/bulkpurchase/ShouldPayMapper.xml
  42. 0 202
      src/main/resources/mappings/modules/bulkpurchase/TransactionMapper.xml
  43. 0 4
      src/main/resources/mappings/modules/order/CmReceiptOrderRelationMapper.xml
  44. 0 6
      src/main/resources/mappings/modules/order/OrderProductMapper.xml
  45. 0 75
      src/main/resources/mappings/modules/product/ActTypeMapper.xml
  46. 0 157
      src/main/resources/mappings/modules/product/CmSecondHandRecommendMapper.xml
  47. 0 249
      src/main/resources/mappings/modules/product/CmSecondHandTransactionMapper.xml
  48. 0 14
      src/main/resources/mappings/modules/product/CmTinytypeMapper.xml
  49. 0 101
      src/main/resources/mappings/modules/product/ProductCustomClassificationMapper.xml
  50. 0 163
      src/main/resources/mappings/modules/product/ProductMapper.xml
  51. 17 17
      src/main/resources/mappings/modules/user/CmUserMapper.xml
  52. 0 66
      src/main/webapp/WEB-INF/views/modules/product/productCustomClassificationForm.jsp
  53. 0 58
      src/main/webapp/WEB-INF/views/modules/product/productCustomClassificationList.jsp

+ 0 - 15
src/main/java/com/caimei/modules/bulkpurchase/dao/BpOrderRemarkDao.java

@@ -1,15 +0,0 @@
-package com.caimei.modules.bulkpurchase.dao;
-
-import com.thinkgem.jeesite.common.persistence.CrudDao;
-import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
-import com.caimei.modules.bulkpurchase.entity.BpOrderRemark;
-
-/**
- * 大宗采购订单备注DAO接口
- * @author LiJun
- * @version 2018-04-12
- */
-@MyBatisDao
-public interface BpOrderRemarkDao extends CrudDao<BpOrderRemark> {
-	
-}

+ 0 - 44
src/main/java/com/caimei/modules/bulkpurchase/service/BpOrderRemarkService.java

@@ -1,44 +0,0 @@
-package com.caimei.modules.bulkpurchase.service;
-
-import java.util.List;
-
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.service.CrudService;
-import com.caimei.modules.bulkpurchase.entity.BpOrderRemark;
-import com.caimei.modules.bulkpurchase.dao.BpOrderRemarkDao;
-
-/**
- * 大宗采购订单备注Service
- * @author LiJun
- * @version 2018-04-12
- */
-@Service
-@Transactional(readOnly = true)
-public class BpOrderRemarkService extends CrudService<BpOrderRemarkDao, BpOrderRemark> {
-
-	public BpOrderRemark get(String id) {
-		return super.get(id);
-	}
-	
-	public List<BpOrderRemark> findList(BpOrderRemark bpOrderRemark) {
-		return super.findList(bpOrderRemark);
-	}
-	
-	public Page<BpOrderRemark> findPage(Page<BpOrderRemark> page, BpOrderRemark bpOrderRemark) {
-		return super.findPage(page, bpOrderRemark);
-	}
-	
-	@Transactional(readOnly = false)
-	public void save(BpOrderRemark bpOrderRemark) {
-		super.save(bpOrderRemark);
-	}
-	
-	@Transactional(readOnly = false)
-	public void delete(BpOrderRemark bpOrderRemark) {
-		super.delete(bpOrderRemark);
-	}
-	
-}

+ 0 - 118
src/main/java/com/caimei/modules/bulkpurchase/web/BpOrderRemarkController.java

@@ -1,118 +0,0 @@
-package com.caimei.modules.bulkpurchase.web;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import com.caimei.modules.bulkpurchase.entity.BpOrderProductRemark;
-import com.google.common.collect.Maps;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.servlet.mvc.support.RedirectAttributes;
-
-import com.thinkgem.jeesite.common.config.Global;
-import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.web.BaseController;
-import com.thinkgem.jeesite.common.utils.StringUtils;
-import com.caimei.modules.bulkpurchase.entity.BpOrderRemark;
-import com.caimei.modules.bulkpurchase.service.BpOrderRemarkService;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 大宗采购订单备注Controller
- * @author LiJun
- * @version 2018-04-12
- */
-@Controller
-@RequestMapping(value = "${adminPath}/bulkpurchase/bpOrderRemark")
-public class BpOrderRemarkController extends BaseController {
-
-	@Autowired
-	private BpOrderRemarkService bpOrderRemarkService;
-	
-	@ModelAttribute
-	public BpOrderRemark get(@RequestParam(required=false) String id) {
-		BpOrderRemark entity = null;
-		if (StringUtils.isNotBlank(id)){
-			entity = bpOrderRemarkService.get(id);
-		}
-		if (entity == null){
-			entity = new BpOrderRemark();
-		}
-		return entity;
-	}
-	
-	@RequiresPermissions("bulkpurchase:bpOrderRemark:view")
-	@RequestMapping(value = {"list", ""})
-	public String list(BpOrderRemark bpOrderRemark, HttpServletRequest request, HttpServletResponse response, Model model) {
-		Page<BpOrderRemark> page = bpOrderRemarkService.findPage(new Page<BpOrderRemark>(request, response), bpOrderRemark); 
-		model.addAttribute("page", page);
-		return "modules/bulkpurchase/bpOrderRemarkList";
-	}
-
-	@RequiresPermissions("bulkpurchase:bpOrderRemark:view")
-	@RequestMapping(value = "form")
-	public String form(BpOrderRemark bpOrderRemark, Model model) {
-		model.addAttribute("bpOrderRemark", bpOrderRemark);
-		return "modules/bulkpurchase/bpOrderRemarkForm";
-	}
-
-	@RequiresPermissions("bulkpurchase:bpOrderRemark:edit")
-	@RequestMapping(value = "save")
-	public String save(BpOrderRemark bpOrderRemark, Model model, RedirectAttributes redirectAttributes) {
-		if (!beanValidator(model, bpOrderRemark)){
-			return form(bpOrderRemark, model);
-		}
-		bpOrderRemarkService.save(bpOrderRemark);
-		addMessage(redirectAttributes, "保存大宗采购订单备注成功");
-		return "redirect:"+Global.getAdminPath()+"/bulkpurchase/bpOrderRemark/?repage";
-	}
-	
-	@RequiresPermissions("bulkpurchase:bpOrderRemark:delete")
-	@RequestMapping(value = "delete")
-	public String delete(BpOrderRemark bpOrderRemark, RedirectAttributes redirectAttributes) {
-		bpOrderRemarkService.delete(bpOrderRemark);
-		addMessage(redirectAttributes, "删除大宗采购订单备注成功");
-		return "redirect:"+Global.getAdminPath()+"/bulkpurchase/bpOrderRemark/?repage";
-	}
-
-	//订单备注
-	@RequestMapping(value = "remarksView")
-	public String remarksView(Integer orderId, HttpServletRequest request, HttpServletResponse response, Model model) {
-		//通过商品ID获取对应备注信息
-		BpOrderRemark remark = new BpOrderRemark();
-		remark.setOrderId(orderId);
-		List<BpOrderRemark> remarksList = bpOrderRemarkService.findList(remark);
-		//设置展示信息
-		model.addAttribute("remarksList",remarksList);
-		return "modules/bulkpurchase/cmOrderRemarksForm";
-	}
-
-
-	@ResponseBody
-	@RequestMapping(value="addRemarks")
-	public Map<String, Object> addRemarks(String remarks, Integer orderId, HttpServletRequest request, HttpServletResponse response){
-		Map<String, Object> map = Maps.newLinkedHashMap();
-		try {
-			//保存备注信息
-			BpOrderRemark remark = new BpOrderRemark();
-			remark.setOrderId(orderId);
-			remark.setRemarks(remarks);
-			bpOrderRemarkService.save(remark);
-			map.put("success",true);
-			map.put("msg", "修改成功");
-		} catch (Exception e) {
-			logger.debug(e.toString(),e);
-			map.put("success",false);
-			map.put("msg", "修改失败");
-		}
-		return map;
-	}
-}

+ 0 - 139
src/main/java/com/caimei/modules/bulkpurchase/web/CmFinanceChargeController.java

@@ -1,139 +0,0 @@
-package com.caimei.modules.bulkpurchase.web;
-
-import com.caimei.modules.bulkpurchase.entity.CmFinanceCharge;
-import com.caimei.modules.bulkpurchase.entity.CmFinanceChargeStages;
-import com.caimei.modules.bulkpurchase.entity.OrderProduct;
-import com.caimei.modules.bulkpurchase.entity.OrderStages;
-import com.caimei.modules.bulkpurchase.service.CmFinanceChargeService;
-import com.caimei.modules.bulkpurchase.service.CmFinanceChargeStagesService;
-import com.caimei.modules.bulkpurchase.service.OrderProductService;
-import com.caimei.modules.bulkpurchase.service.OrderStagesService;
-import com.thinkgem.jeesite.common.config.Global;
-import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.utils.StringUtils;
-import com.thinkgem.jeesite.common.web.BaseController;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.servlet.mvc.support.RedirectAttributes;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.util.List;
-
-/**
- * 出账信息Controller
- * @author LiJun
- * @version 2017-06-04
- */
-@Controller
-@RequestMapping(value = "${adminPath}/bulkpurchase/cmFinanceCharge")
-public class CmFinanceChargeController extends BaseController {
-
-	@Autowired
-	private CmFinanceChargeService cmFinanceChargeService;
-
-	@Autowired
-	private OrderProductService orderProductService;
-
-	@Autowired
-	private OrderStagesService orderStagesService;
-	@Autowired
-	private CmFinanceChargeStagesService cmFinanceChargeStagesService;
-	
-	@ModelAttribute
-	public CmFinanceCharge get(@RequestParam(required=false) String id) {
-		CmFinanceCharge entity = null;
-		if (StringUtils.isNotBlank(id)){
-			entity = cmFinanceChargeService.get(id);
-		}
-		if (entity == null){
-			entity = new CmFinanceCharge();
-		}
-		return entity;
-	}
-	
-	@RequiresPermissions("bulkpurchase:cmFinanceCharge:view")
-	@RequestMapping(value = {"list", ""})
-	public String list(CmFinanceCharge cmFinanceCharge, HttpServletRequest request, HttpServletResponse response, Model model) {
-		if(StringUtils.isNotEmpty(cmFinanceCharge.getStartTime())){
-			model.addAttribute("startTime", cmFinanceCharge.getStartTime());
-			cmFinanceCharge.setStartTime(cmFinanceCharge.getStartTime()+" 00:00:00");
-		}
-		if(StringUtils.isNotEmpty(cmFinanceCharge.getEndTime())){
-			model.addAttribute("endTime", cmFinanceCharge.getEndTime());
-			cmFinanceCharge.setEndTime(cmFinanceCharge.getEndTime()+" 23:59:59");
-		}
-		Page page = new Page<CmFinanceCharge>(request, response) ;
-		page.setOrderBy(" a.id DESC , a.createDate DESC ");
-		Page<CmFinanceCharge> FCPage = cmFinanceChargeService.findPage(page, cmFinanceCharge);
-
-		List<CmFinanceCharge> list = FCPage.getList();
-		// 将进账信息列中的产品id展示为产品名
-		for(CmFinanceCharge financeCharge:list){
-			String productIds = financeCharge.getProductIds();
-			if (null != financeCharge.getStagesId()){
-				OrderStages orderStages = orderStagesService.get(financeCharge.getStagesId()+"");
-				financeCharge.setProductName("第 "+orderStages.getNum()+" 期");
-				//应付供应商
-				List<CmFinanceCharge> cmFinanceChargeList = FCPage.getList();
-				for (CmFinanceCharge charge : cmFinanceChargeList) {
-					CmFinanceChargeStages chargeStages = new CmFinanceChargeStages();
-					chargeStages.setChargeId(Integer.parseInt(charge.getId()));
-					List<CmFinanceChargeStages> chargeStagesList =  cmFinanceChargeStagesService.findList(chargeStages);
-					if (CollectionUtils.isNotEmpty(chargeStagesList)){
-						charge.setCmFinanceChargeStagesList(chargeStagesList);
-					}
-				}
-			}else {
-				String productIdString = StringUtils.replace(productIds, ",", ",");
-				String[] productIdsArray = StringUtils.split(productIdString, ",");
-
-				if ( null != productIdsArray && productIdsArray.length > 0) {
-					StringBuffer productNameBuffer = new StringBuffer();
-					for (String productId : productIdsArray) {
-						OrderProduct OrderProduct = orderProductService.getProductNameByOrderproductId(productId);
-						if (null != OrderProduct) {
-							productNameBuffer.append(OrderProduct.getName() + "  ");
-						}
-					}
-					financeCharge.setProductName(productNameBuffer.toString());
-				}
-			}
-		}
-		model.addAttribute("page", FCPage);
-		return "modules/bulkpurchase/cmFinanceChargeList";
-	}
-
-	@RequiresPermissions("bulkpurchase:cmFinanceCharge:view")
-	@RequestMapping(value = "form")
-	public String form(CmFinanceCharge cmFinanceCharge, Model model) {
-		model.addAttribute("cmFinanceCharge", cmFinanceCharge);
-		return "modules/bulkpurchase/cmFinanceChargeForm";
-	}
-
-	@RequiresPermissions("bulkpurchase:cmFinanceCharge:edit")
-	@RequestMapping(value = "save")
-	public String save(CmFinanceCharge cmFinanceCharge, Model model, RedirectAttributes redirectAttributes) {
-		if (!beanValidator(model, cmFinanceCharge)){
-			return form(cmFinanceCharge, model);
-		}
-		cmFinanceChargeService.save(cmFinanceCharge);
-		addMessage(redirectAttributes, "保存出账信息成功");
-		return "redirect:"+Global.getAdminPath()+"/bulkpurchase/cmFinanceCharge/?repage";
-	}
-	
-	@RequiresPermissions("bulkpurchase:cmFinanceCharge:delete")
-	@RequestMapping(value = "delete")
-	public String delete(CmFinanceCharge cmFinanceCharge, RedirectAttributes redirectAttributes) {
-		cmFinanceChargeService.delete(cmFinanceCharge);
-		addMessage(redirectAttributes, "删除出账信息成功");
-		return "redirect:"+Global.getAdminPath()+"/bulkpurchase/cmFinanceCharge/?repage";
-	}
-
-}

+ 0 - 132
src/main/java/com/caimei/modules/bulkpurchase/web/CmFinanceReceiptsController.java

@@ -1,132 +0,0 @@
-package com.caimei.modules.bulkpurchase.web;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import com.caimei.modules.bulkpurchase.entity.OrderStages;
-import com.caimei.modules.bulkpurchase.service.OrderStagesService;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.servlet.mvc.support.RedirectAttributes;
-
-import com.thinkgem.jeesite.common.config.Global;
-import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.web.BaseController;
-import com.thinkgem.jeesite.common.utils.StringUtils;
-import com.caimei.modules.bulkpurchase.entity.CmFinanceReceipts;
-import com.caimei.modules.bulkpurchase.service.CmFinanceReceiptsService;
-
-import java.util.List;
-import com.caimei.modules.bulkpurchase.service.OrderProductService;
-import com.caimei.modules.bulkpurchase.entity.OrderProduct;
-
-/**
- * 进账信息Controller
- * @author 李俊
- * @version 2017-06-04
- */
-@Controller
-@RequestMapping(value = "${adminPath}/bulkpurchase/cmFinanceReceipts")
-public class CmFinanceReceiptsController extends BaseController {
-
-	@Autowired
-	private CmFinanceReceiptsService cmFinanceReceiptsService;
-
-	@Autowired
-	private OrderProductService orderProductService;
-
-	@Autowired
-	private OrderStagesService orderStagesService;
-
-
-	@ModelAttribute
-	public CmFinanceReceipts get(@RequestParam(required=false) String id) {
-		CmFinanceReceipts entity = null;
-		if (StringUtils.isNotBlank(id)){
-			entity = cmFinanceReceiptsService.get(id);
-		}
-		if (entity == null){
-			entity = new CmFinanceReceipts();
-		}
-		return entity;
-	}
-
-	@RequiresPermissions("bulkpurchase:cmFinanceReceipts:view")
-	@RequestMapping(value = {"list", ""})
-	public String list(CmFinanceReceipts cmFinanceReceipts, HttpServletRequest request, HttpServletResponse response, Model model) {
-		if(StringUtils.isNotEmpty(cmFinanceReceipts.getStartTime())){
-			model.addAttribute("startTime", cmFinanceReceipts.getStartTime());
-			cmFinanceReceipts.setStartTime(cmFinanceReceipts.getStartTime()+" 00:00:00");
-		}
-		if(StringUtils.isNotEmpty(cmFinanceReceipts.getEndTime())){
-			model.addAttribute("endTime", cmFinanceReceipts.getEndTime());
-			cmFinanceReceipts.setEndTime(cmFinanceReceipts.getEndTime()+" 23:59:59");
-		}
-		Page<CmFinanceReceipts> FRPage = cmFinanceReceiptsService.findPage(new Page<CmFinanceReceipts>(request, response), cmFinanceReceipts);
-		List<CmFinanceReceipts> list = FRPage.getList();
-		// 将进账信息列中的产品id展示为产品名
-		for(CmFinanceReceipts FinanceReceipts:list){
-			String productIds = FinanceReceipts.getProductIds();
-			String productIdString = StringUtils.replace(productIds, ",", ",");
-			String[] productIdsArray = StringUtils.split(productIdString,",");
-
-			if(productIdsArray.length >0){
-				StringBuffer productNameBuffer = new StringBuffer();
-				for(String productId : productIdsArray){
-					OrderProduct OrderProduct = orderProductService.getProductNameByOrderproductId(productId);
-					if(null != OrderProduct){
-						productNameBuffer.append(OrderProduct.getName()+ "  ");
-					}
-				}
-				FinanceReceipts.setProductName(productNameBuffer.toString());
-			}
-
-			// 分期ID找到对应的分期描述设置作为产品名显示(如果是分期订单的则使用分期描述作为产品名)
-			String stagesId = FinanceReceipts.getStagesId();
-			if(StringUtils.isNotEmpty(stagesId)){
-				OrderStages os = new OrderStages();
-				os.setId(FinanceReceipts.getStagesId());
-				// 通过分期ID只能获取对应的一条
-				List<OrderStages> orderStagesList = orderStagesService.findList(os);
-				if(CollectionUtils.isNotEmpty(orderStagesList)){
-					FinanceReceipts.setProductName(orderStagesList.get(0).getDescription());
-				}
-			}
-		}
-		model.addAttribute("page", FRPage);
-		return "modules/bulkpurchase/cmFinanceReceiptsList";
-	}
-
-	@RequiresPermissions("bulkpurchase:cmFinanceReceipts:view")
-	@RequestMapping(value = "form")
-	public String form(CmFinanceReceipts cmFinanceReceipts, Model model) {
-		model.addAttribute("cmFinanceReceipts", cmFinanceReceipts);
-		return "modules/bulkpurchase/cmFinanceReceiptsForm";
-	}
-
-	@RequiresPermissions("bulkpurchase:cmFinanceReceipts:edit")
-	@RequestMapping(value = "save")
-	public String save(CmFinanceReceipts cmFinanceReceipts, Model model, RedirectAttributes redirectAttributes) {
-		if (!beanValidator(model, cmFinanceReceipts)){
-			return form(cmFinanceReceipts, model);
-		}
-		cmFinanceReceiptsService.save(cmFinanceReceipts);
-		addMessage(redirectAttributes, "保存进账信息成功");
-		return "redirect:"+Global.getAdminPath()+"/bulkpurchase/cmFinanceReceipts/?repage";
-	}
-
-	@RequiresPermissions("bulkpurchase:cmFinanceReceipts:delete")
-	@RequestMapping(value = "delete")
-	public String delete(CmFinanceReceipts cmFinanceReceipts, RedirectAttributes redirectAttributes) {
-		cmFinanceReceiptsService.delete(cmFinanceReceipts);
-		addMessage(redirectAttributes, "删除进账信息成功");
-		return "redirect:"+Global.getAdminPath()+"/bulkpurchase/cmFinanceReceipts/?repage";
-	}
-
-}

+ 0 - 374
src/main/java/com/caimei/modules/bulkpurchase/web/ContractController.java

@@ -1,374 +0,0 @@
-package com.caimei.modules.bulkpurchase.web;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import com.alibaba.fastjson.JSONObject;
-import com.caimei.modules.bulkpurchase.entity.CmClub;
-import com.caimei.modules.bulkpurchase.service.CmClubService;
-import com.caimei.modules.bulkpurchase.entity.PurchaseProduct;
-
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-import com.caimei.modules.bulkpurchase.service.PurchaseProductService;
-
-import com.caimei.modules.bulkpurchase.entity.ProductPrivilege;
-import com.caimei.modules.bulkpurchase.service.ProductPrivilegeService;
-import com.thinkgem.jeesite.common.utils.DateUtils;
-import com.thinkgem.jeesite.common.utils.ObjectUtils;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.mvc.support.RedirectAttributes;
-
-import com.thinkgem.jeesite.common.config.Global;
-import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.web.BaseController;
-import com.thinkgem.jeesite.common.utils.StringUtils;
-import com.caimei.modules.bulkpurchase.entity.Contract;
-import com.caimei.modules.bulkpurchase.service.ContractService;
-
-/**
- * 采购信息Controller
- *
- * @author jiangjunwen
- * @version 2017-03-27
- */
-@Controller
-@RequestMapping(value = "${adminPath}/bulkpurchase/contract")
-public class ContractController extends BaseController {
-
-    @Autowired
-    private ContractService contractService;
-    @Autowired
-    private ProductPrivilegeService productPrivilegeService;
-    @Autowired
-    private PurchaseProductService purchaseProductService;
-    @Autowired
-    private CmClubService cmClubService;
-
-    @ModelAttribute
-    public Contract get(@RequestParam(required = false) String id) {
-        Contract entity = null;
-        if (StringUtils.isNotBlank(id)) {
-            entity = contractService.get(id);
-        }
-        if (entity == null) {
-            entity = new Contract();
-        }
-        return entity;
-    }
-
-
-    @RequiresPermissions("bulkpurchase:contract:view")
-    @RequestMapping(value = {"list", ""})
-    public String list(Contract contract, HttpServletRequest request, HttpServletResponse response, Model model) {
-        Page<Contract> page = contractService.findPage(new Page<Contract>(request, response), contract);
-        model.addAttribute("page", page);
-        return "modules/bulkpurchase/contractList";
-    }
-
-
-    @RequiresPermissions("bulkpurchase:contract:view")
-    @RequestMapping(value = "form")
-    public String form(Contract contract, Model model) {
-        if(StringUtils.isEmpty(contract.getId())){
-            contract.setCreateDate(new Date());
-        }
-        model.addAttribute("contract", contract);
-        if(StringUtils.equals("1",contract.getFlag())){//1:采购编辑页面,2采购新增页面
-            return "modules/bulkpurchase/contractView";
-        }
-        return "modules/bulkpurchase/contractForm";
-    }
-
-    @RequestMapping(value = "PutSession")
-    @ResponseBody
-    public Map<String, Object> putSession(@RequestParam("items") String items, HttpServletRequest request) {
-        Map<String, Object> map = new HashMap<>();
-        try {
-            PurchaseProduct purchaseProduct = JSONObject.parseObject(items, PurchaseProduct.class);
-            HttpSession session = request.getSession();
-            session.setAttribute("purchaseProduct", purchaseProduct);
-            map.put("message", "更新成功");
-        } catch (Exception e) {
-            map.put("message", "添加失败");
-        }
-        return map;
-    }
-
-    @RequestMapping(value = "PutEditSession")
-    @ResponseBody
-    public Map<String, Object> PutEditSession(@RequestParam("items") String items, HttpServletRequest request) {
-        Map<String, Object> map = new HashMap<>();
-        try {
-            PurchaseProduct purchaseProduct = JSONObject.parseObject(items, PurchaseProduct.class);
-            HttpSession session = request.getSession();
-            session.setAttribute("purchaseEditProduct", purchaseProduct);
-        } catch (Exception e) {
-            map.put("message", "添加失败");
-        }
-        return map;
-    }
-
-
-    @RequestMapping(value = "addShop")
-    public String addShop(Contract contract, HttpServletRequest request, Model model) {
-        List<PurchaseProduct> purchaseProduct1 = contract.getPurchaseProduct();
-        HttpSession session = request.getSession();
-        PurchaseProduct purchaseProduct = (PurchaseProduct) session.getAttribute("purchaseProduct");
-        session.removeAttribute("purchaseProduct");
-        if (null == purchaseProduct1 && null != purchaseProduct) {
-            List<PurchaseProduct> list = new ArrayList<>();
-            list.add(purchaseProduct);
-            contract.setPurchaseProduct(list);
-
-            model.addAttribute("contract", contract);
-            if(StringUtils.equals("1",contract.getFlag())){//1:采购编辑页面,2采购新增页面
-                return "modules/bulkpurchase/contractView";
-            }
-            return "modules/bulkpurchase/contractForm";
-        }
-        if (null != purchaseProduct1 && null != purchaseProduct) {
-            int i = 0;
-            for (PurchaseProduct product : purchaseProduct1) {
-                if (product.getProductId().equals(purchaseProduct.getProductId())) {
-                    model.addAttribute("message", "商品已存在");
-                    i = 1;
-                    break;
-                }
-
-            }
-            if (i == 0) {
-                purchaseProduct1.add(purchaseProduct);
-            }
-            List<PurchaseProduct> list = new ArrayList<>();
-            List<PurchaseProduct> purchaseProducts = contract.getPurchaseProduct();
-            for (int j= 0; j < purchaseProducts.size(); j++) {
-                String shopName = purchaseProducts.get(j).getShopName();
-                String[] split = shopName.split(",");
-                purchaseProduct1.get(j).setShopName(split[0]);
-                list.add(purchaseProducts.get(j));
-            }
-
-            contract.setPurchaseProduct(list);
-            model.addAttribute("contract", contract);
-            if(StringUtils.equals("1",contract.getFlag())){//1:采购编辑页面,2采购新增页面
-                return "modules/bulkpurchase/contractView";
-            }
-            return "modules/bulkpurchase/contractForm";
-        }
-        if ((null == purchaseProduct1 && null == purchaseProduct) || (null != purchaseProduct1 && null == purchaseProduct)) {
-            List<PurchaseProduct> list = new ArrayList<>();
-
-            List<PurchaseProduct> purchaseProducts = contract.getPurchaseProduct();
-            if(!CollectionUtils.isEmpty(purchaseProducts)){
-                for (int j= 0; j < purchaseProducts.size(); j++) {
-                    String shopName = purchaseProducts.get(j).getShopName();
-                    String[] split = shopName.split(",");
-                    purchaseProduct1.get(j).setShopName(split[0]);
-                    list.add(purchaseProducts.get(j));
-                }
-            }
-
-
-            model.addAttribute("contract", contract);
-            if(StringUtils.equals("1",contract.getFlag())){//1:采购编辑页面,2采购新增页面
-                return "modules/bulkpurchase/contractView";
-            }
-            return "modules/bulkpurchase/contractForm";
-        }
-
-        if(StringUtils.equals("1",contract.getFlag())){//1:采购编辑页面,2采购新增页面
-            return "modules/bulkpurchase/contractView";
-        }
-        return "modules/bulkpurchase/contractForm";
-    }
-
-    @RequestMapping(value = "deleteShop")
-    public String deleteShop(Contract contract, HttpServletRequest request, Model model) {
-        HttpSession session = request.getSession();
-        PurchaseProduct purchaseProduct = (PurchaseProduct) session.getAttribute("purchaseProduct");
-        session.removeAttribute("purchaseProduct");
-        List<PurchaseProduct> purchaseProductList = contract.getPurchaseProduct();
-        for (int i = 0; i < purchaseProductList.size(); i++) {
-            PurchaseProduct product = purchaseProductList.get(i);
-            if (product.getProductId().equals(purchaseProduct.getProductId())) {
-                purchaseProductList.remove(i);
-
-                //为修改采购时删除之前酒的采购商品数据(清除list同时也需要删除数据)
-                if(StringUtils.isNotEmpty(product.getId())){
-                    //清除对象的时候把数据库中数据也删除
-                    Date date = new Date();
-                    SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
-                    String str = sdf.format(date);
-                    product.setDelFlag(str);
-                    product.setContractId(Long.parseLong(contract.getId()));
-                    purchaseProductService.save(product);
-
-                    //如果该采购商品存在赠送品也需要删除
-                    List<ProductPrivilege> productPrivilege = product.getProductPrivilege();
-                    if(CollectionUtils.isNotEmpty(productPrivilege)){
-                        ProductPrivilege privilege = new ProductPrivilege();
-                        privilege.setContractProductId(Long.parseLong(product.getId()));
-                            productPrivilegeService.delete(privilege);
-                    }
-                }
-                model.addAttribute("message", "删除成功");
-                break;
-            }
-        }
-        model.addAttribute("contract", contract);
-        if(StringUtils.equals("1",contract.getFlag())){//1:采购编辑页面,2采购新增页面
-            return "modules/bulkpurchase/contractView";
-        }
-        return "modules/bulkpurchase/contractForm";
-    }
-
-    @RequestMapping(value = "putEditToSession")
-    @ResponseBody
-    public String putEditToSession(@RequestParam("items") String item, HttpServletRequest request, Model model) {
-        try {
-            PurchaseProduct purchaseProduct = JSONObject.parseObject(item, PurchaseProduct.class);
-            request.getSession().setAttribute("purchaseEditProduct",purchaseProduct);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return "true";
-    }
-    @RequestMapping(value = "editShop")
-    public String editShop(Contract contract, HttpServletRequest request, Model model) {
-        HttpSession session = request.getSession();
-
-        PurchaseProduct purchaseProduct = (PurchaseProduct) session.getAttribute("purchaseEditProduct");
-        session.removeAttribute("purchaseProduct");
-        if (null == purchaseProduct) {
-            List<PurchaseProduct> list = new ArrayList<>();
-            List<PurchaseProduct> purchaseProduct1 = contract.getPurchaseProduct();
-            for (int i = 0; i < purchaseProduct1.size(); i++) {
-                String shopName = purchaseProduct1.get(i).getShopName();
-                String[] split = shopName.split(",");
-                purchaseProduct1.get(i).setShopName(split[0]);
-                list.add(purchaseProduct1.get(i));
-            }
-
-            contract.setPurchaseProduct(list);
-
-            model.addAttribute("contract", contract);
-            if(StringUtils.equals("1",contract.getFlag())){//1:采购编辑页面,2采购新增页面
-                return "modules/bulkpurchase/contractView";
-            }
-            return "modules/bulkpurchase/contractForm";
-        }
-        session.removeAttribute("purchaseEditProduct");
-        List<PurchaseProduct> purchaseProduct1 = contract.getPurchaseProduct();
-        for (int i = 0; i < purchaseProduct1.size(); i++) {
-            if (purchaseProduct1.get(i).getProductId().equals(purchaseProduct.getProductId())) {
-                purchaseProduct1.remove(i);
-                purchaseProduct1.add(i, purchaseProduct);
-                model.addAttribute("message", "更新成功");
-                break;
-            }
-        }
-        List<PurchaseProduct> list = new ArrayList<>();
-        for (int i = 0; i < purchaseProduct1.size(); i++) {
-            String shopName = purchaseProduct1.get(i).getShopName();
-            String[] split = shopName.split(",");
-            purchaseProduct1.get(i).setShopName(split[0]);
-            list.add(purchaseProduct1.get(i));
-        }
-        contract.setPurchaseProduct(list);
-        model.addAttribute("contract", contract);
-        if(StringUtils.equals("1",contract.getFlag())){//1:采购编辑页面,2采购新增页面
-            return "modules/bulkpurchase/contractView";
-        }
-        return "modules/bulkpurchase/contractForm";
-    }
-
-    @RequiresPermissions("bulkpurchase:contract:edit")
-    @RequestMapping(value = "save")
-    public String save(Contract contract, Model model, RedirectAttributes redirectAttributes) {
-        if (!beanValidator(model, contract)) {
-            return form(contract, model);
-        }
-        try {
-            contractService.save(contract);
-            addMessage(redirectAttributes, "保存采购成功");
-            return "redirect:" + Global.getAdminPath() + "/bulkpurchase/contract";
-        } catch (Exception e) {
-            List<PurchaseProduct> purchaseProduct = contract.getPurchaseProduct();
-            if(CollectionUtils.isEmpty(purchaseProduct)){
-                model.addAttribute("message", "保存失败,商品不能为空");
-            }else{
-                CmClub cmClub = contract.getCmClub();
-                String id = cmClub.getId();
-                if(StringUtils.isEmpty(id)){
-                    model.addAttribute("message", "保存失败,会所不能为空");
-                }
-            }
-
-            return form(contract, model);
-        }
-
-    }
-
-    @RequestMapping("new/{contractVal}")
-    public String toNewWindow(@PathVariable("contractVal") String contractVal, Model model) {
-        Contract contract = JSONObject.parseObject(contractVal, Contract.class);
-        model.addAttribute("contract", contract);
-        return "modules/bulkpurchase/contractForm";
-    }
-
-
-    @RequiresPermissions("bulkpurchase:contract:delete")
-    @RequestMapping(value = "delete")
-    public String delete(Contract contract, RedirectAttributes redirectAttributes) {
-        contract.setDelFlag(DateUtils.formatDate(new Date(), "yyyyMMddHHmmssSSSS"));
-        contractService.delete(contract);
-        addMessage(redirectAttributes, "删除采购信息成功");
-        return "redirect:" + Global.getAdminPath() + "/bulkpurchase/contract/?repage";
-    }
-
-    @RequestMapping(value = "getContract")
-    public String getContract(Contract contract, Model model) {
-        Contract returnContract = contractService.get(contract);
-        long contractId = Long.parseLong(returnContract.getId());
-        CmClub cmClub = cmClubService.findClubById(contract.getClubId());
-        returnContract.setCmClub(cmClub);
-        List<PurchaseProduct> list = purchaseProductService.getPurchaseProductByCtId(contractId);
-        if (null != list) {
-            returnContract.setPurchaseProduct(list);
-            for (PurchaseProduct purchaseProduct : list) {
-                List<ProductPrivilege> productPrivileges = productPrivilegeService.findListByProductId(purchaseProduct.getId());
-                if (null != productPrivileges) {
-                    purchaseProduct.setProductPrivilege(productPrivileges);
-                }
-            }
-        }
-        Date createDate = contract.getCreateDate();
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-        String format = simpleDateFormat.format(createDate);
-        returnContract.setStartTime(format);
-        model.addAttribute("contract", returnContract);
-        return "modules/bulkpurchase/contractView";
-    }
-
-    @RequestMapping(value = "checkNo")
-    @ResponseBody
-    public String checkNo(@RequestParam(value = "no") String no, @RequestParam(value = "oldNo", required = false) String oldNo) {
-        if (no == oldNo) {
-            return "true";
-        }
-        List<Contract> contracts = contractService.getContractByNo(no);
-        if (CollectionUtils.isEmpty(contracts)) {
-            return "true";
-        } else {
-            return "false";
-        }
-    }
-}

+ 0 - 920
src/main/java/com/caimei/modules/bulkpurchase/web/ContractOrderController.java

@@ -1,920 +0,0 @@
-package com.caimei.modules.bulkpurchase.web;
-
-import com.alibaba.fastjson.JSONArray;
-import com.caimei.modules.bulkpurchase.entity.*;
-import com.caimei.modules.bulkpurchase.service.*;
-import com.caimei.modules.common.utils.ExcelUtil;
-import com.caimei.modules.product.dao.ProductDao;
-import com.caimei.modules.product.entity.BuyerProductHistoryPrice;
-import com.caimei.modules.product.entity.BuyerProductPrice;
-import com.caimei.modules.product.entity.Product;
-import com.caimei.modules.product.service.BuyerProductHistoryPriceService;
-import com.caimei.modules.product.service.BuyerProductPriceService;
-import com.caimei.modules.project.dao.ClubDao;
-import com.caimei.modules.project.model.ClubModel;
-import com.caimei.modules.sys.utils.MailUtils;
-import com.caimei.utils.AppUtils;
-import com.caimei.utils.MathUtil;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.thinkgem.jeesite.common.config.Global;
-import com.thinkgem.jeesite.common.mapper.JsonMapper;
-import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.utils.DateUtils;
-import com.thinkgem.jeesite.common.utils.StringUtils;
-import com.thinkgem.jeesite.common.web.BaseController;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.servlet.mvc.support.RedirectAttributes;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.UnsupportedEncodingException;
-import java.math.BigDecimal;
-import java.net.URLEncoder;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 采购订单Controller
- *
- * @author jiangjunwen
- * @version 2017-04-07
- */
-@Controller
-@RequestMapping(value = "${adminPath}/bulkpurchase/contractOrder")
-public class ContractOrderController extends BaseController {
-    @Autowired
-    private ContractService contractService;
-    @Autowired
-    private ContractOrderService contractOrderService;
-    @Autowired
-    private BpOrderUserinfoService bpOrderUserinfoService;
-    @Autowired
-    private OrderProductService orderProductService;
-    @Autowired
-    private OrderInvoiceService orderInvoiceService;
-    @Autowired
-    private OrderStagesService orderStagesService;
-    @Autowired
-    private OrderStagesProductService orderStagesProductService;
-    @Autowired
-    private CmFinanceChargeService cmFinanceChargeService;
-    @Autowired
-    private BuyerProductPriceService buyerProductPriceService;
-    @Autowired
-    private BuyerProductHistoryPriceService buyerProductHistoryPriceService;
-    @Autowired
-    private ClubDao clubDao;
-    @Autowired
-    private ProductDao productDao;
-    @Autowired
-    private BpClauseService bpClauseService;
-
-    @ModelAttribute
-    public ContractOrder get(@RequestParam(required = false) String id) {
-        ContractOrder entity = null;
-        if (StringUtils.isNotBlank(id)) {
-            entity = contractOrderService.get(id);
-        }
-        if (entity == null) {
-            entity = new ContractOrder();
-        }
-        return entity;
-    }
-
-    @RequiresPermissions("contractorder:contractOrder:export")
-    @RequestMapping(value = "exportOrderList")
-    public void exportOrderList(ContractOrder contractOrder, RedirectAttributes redirectAttributes, HttpServletResponse response) {
-        //获取订单数据
-        StringBuffer sb = new StringBuffer();
-        sb.append("大宗采购订单列表(");
-        sb.append(contractOrder.getStartTime());
-        sb.append("-");
-        sb.append(contractOrder.getEndTime());
-        sb.append(").xls");
-        String fileName = sb.toString();
-        String template = Global.getConfig("export.template");
-        String templateFileName = template+"/bporderlist_template.xls";
-        // 导出订单列表
-        contractOrder.setStartTime(contractOrder.getStartTime() + " 00:00:00");
-        contractOrder.setEndTime(contractOrder.getEndTime() + " 23:59:59");
-        List<BpOrderVo> orderVoList = Lists.newArrayList();
-        try {
-            //查询在这个时间段内的订单列表
-            contractOrder.setConfirmFlag("1");
-            contractOrder.setOrderStopFlag("0");
-            List<ContractOrder> contractOrders = contractOrderService.findList(contractOrder);
-            for (ContractOrder order : contractOrders) {
-                BigDecimal totalPayShop = new BigDecimal(0);
-                Double alreadyPayShop = 0d;//已支付供应商
-                Double alreadyPayCm = 0d;//已付采美佣金
-                //如果是分期订单  id为307,381,386,526,537 或 日期> 2018-04-16 00:00:00
-                Date date = DateUtils.parseDate("2018-04-16 00:00:00");
-                String stagesOrderStr = "307,381,386,526,537";
-                if (StringUtils.equals("1", order.getStagesFlag()) && (order.getCreateDate().compareTo(date) > 0 || stagesOrderStr.lastIndexOf(order.getId() + "") != -1)) {
-                    List<OrderStages> orderStagesList = orderStagesService.findStagesByOrderId(order.getId());
-                    if (CollectionUtils.isNotEmpty(orderStagesList)) {
-                        for (OrderStages orderStages : orderStagesList) {
-                            BpOrderVo orderVo = new BpOrderVo();
-                            // 判读是否是应付审核过
-                            List<CmFinanceCharge> cmFinanceChargeList = cmFinanceChargeService.findListByStagesId(orderStages.getId());
-                            if (CollectionUtils.isNotEmpty(cmFinanceChargeList)) {
-                                CmFinanceCharge cmFinanceCharge = cmFinanceChargeList.get(0);//sql获取总已付值
-                                //没有审核通过且没收到款
-                                if (new BigDecimal(cmFinanceCharge.getTotalStagesShopPay()).compareTo(BigDecimal.ZERO) == 0 && new BigDecimal(cmFinanceCharge.getTotalStagesCmPay()).compareTo(BigDecimal.ZERO) == 0 && !StringUtils.equals("1", orderStages.getPayStatus())) {
-                                    continue;
-                                }
-                                orderVo.setAlreadyPayCm(cmFinanceCharge.getTotalStagesCmPay());//本期已付采美
-                                orderVo.setShouldPayShop(orderStages.getShopFee().toString());//本期应付供应商
-                                orderVo.setUnPayShop(MathUtil.sub(orderStages.getShopFee(), cmFinanceCharge.getTotalStagesShopPay()).toString());//本期未付供应商
-                            } else {
-                                //没有申请 且没收到款
-                                if (!StringUtils.equals("1", orderStages.getPayStatus())) {
-                                    continue;
-                                } else {
-                                    orderVo.setAlreadyPayCm("0.00");
-                                    orderVo.setShouldPayShop(orderStages.getShopFee().toString());//本期应付供应商
-                                    orderVo.setUnPayShop(orderStages.getShopFee().toString());//本期未付供应商
-                                }
-                            }
-                            orderVo.setStagesNum(orderStages.getNum() + "");
-                            orderVo.setName(order.getName());
-                            orderVo.setNo(order.getNo());
-                            orderVo.setOrderId(Integer.parseInt(order.getId()));
-                            orderVo.setOrderTime(order.getCreateDate());
-                            orderVo.setPayTotalFee(orderStages.getFee());
-                            orderVo.setReceived(StringUtils.equals("1", orderStages.getPayStatus()) ? orderStages.getFee() : "0.00");
-                            orderVo.setUncollected(StringUtils.equals("1", orderStages.getPayStatus()) ? "0.00" : orderStages.getFee());
-                            orderVo.setStagesFlag("1");
-                            orderVoList.add(orderVo);
-                        }
-                    }
-                } else {
-                    List<OrderProduct> orderProduct = orderProductService.getWithorderId(order.getId() + "");
-                    if (CollectionUtils.isNotEmpty(orderProduct)) {
-                        for (OrderProduct op : orderProduct) {
-                            List<CmFinanceCharge> cmFinanceChargeList = cmFinanceChargeService.findListByProductId(op.getId() + "");
-                            //该订单商品的总的应付供应商
-                            Double totalShopFee = Double.parseDouble(op.getShopFee());
-                            totalPayShop = MathUtil.add(totalPayShop, op.getShopFee());
-                            //该订单商品已付供应商
-                            Double shopPayFee = 0.00d;
-                            if (null != cmFinanceChargeList && cmFinanceChargeList.size() > 0) {
-                                for (CmFinanceCharge cfc : cmFinanceChargeList) {
-                                    if (StringUtils.equals("3", cfc.getStatus())) {
-                                        //该订单商品应付供应商全部审核通过才有采美佣金
-                                        shopPayFee += Double.parseDouble(cfc.getShopFee());
-                                        alreadyPayShop += Double.parseDouble(cfc.getShopFee());
-                                    }
-                                }
-                            }
-                            Double fee = totalShopFee - shopPayFee;
-                            if (fee <= 0.01) {//使用0.01:考虑计算过程中存在小数点误差
-                                // 不存在未付供应商则参加这个商品加入采美已付计算
-                                alreadyPayCm += Double.parseDouble(op.getCmFee());//(如果这个商品的已付供应商已付完表示采美也同时已付)
-                            }
-                        }
-                    }
-                    //如果没有收到款、且未付给供应商 则不查询导出展示
-                    if (new BigDecimal(order.getReceived()).compareTo(BigDecimal.ZERO) == 0 && alreadyPayShop == 0) {
-                        continue;
-                    }
-                    BpOrderVo orderVo = new BpOrderVo();
-                    orderVo.setStagesFlag("0");
-                    orderVo.setName(order.getName());
-                    orderVo.setNo(order.getNo());
-                    orderVo.setOrderId(Integer.parseInt(order.getId()));
-                    orderVo.setOrderTime(order.getCreateDate());
-                    orderVo.setPayTotalFee(order.getPayTotalFee());
-                    orderVo.setReceived(order.getReceived());
-                    orderVo.setUncollected(order.getUncollected());
-                    orderVo.setShouldPayShop(totalPayShop.toString());
-                    orderVo.setUnPayShop(MathUtil.sub(totalPayShop, alreadyPayShop).toString());
-                    orderVo.setAlreadyPayCm(alreadyPayCm + "");
-                    orderVoList.add(orderVo);
-                }
-            }
-            new ExcelUtil().createExcel(templateFileName, orderVoList, fileName, response);
-        } catch (Exception e) {
-            addMessage(redirectAttributes, "订单列表信息导出失败!" + e.getMessage());
-            e.printStackTrace();
-        }
-    }
-
-    @RequiresPermissions("contractorder:contractOrder:view")
-    @RequestMapping(value = {"list", "all", ""})
-    public String list(ContractOrder contractOrder, HttpServletRequest request, HttpServletResponse response, Model model) {
-        if (StringUtils.equals("null", contractOrder.getContractId())) {
-            contractOrder.setContractId(null);
-        }
-        if (StringUtils.isNotEmpty(contractOrder.getStartTime())) {
-            model.addAttribute("startTime", contractOrder.getStartTime());
-            contractOrder.setStartTime(contractOrder.getStartTime() + " 00:00:00");
-        }
-        if (StringUtils.isNotEmpty(contractOrder.getEndTime())) {
-            model.addAttribute("endTime", contractOrder.getEndTime());
-            contractOrder.setEndTime(contractOrder.getEndTime() + " 23:59:59");
-        }
-        Page<ContractOrder> page = contractOrderService.findPage(new Page<ContractOrder>(request, response), contractOrder);
-        for (ContractOrder co : page.getList()) {
-            String received = co.getReceived();
-            String uncollected = co.getUncollected();
-            String stagesReceived = co.getStagesReceived();
-            String stagesUncollected = co.getStagesUncollected();
-            if (StringUtils.isEmpty(received)) {
-                co.setReceived("0.00");
-            }
-            if (StringUtils.isEmpty(uncollected)) {
-                co.setUncollected("0.00");
-            }
-            if (StringUtils.isEmpty(stagesReceived)) {
-                co.setStagesReceived("0.00");
-            }
-            if (StringUtils.isEmpty(stagesUncollected)) {
-                co.setStagesUncollected("0.00");
-            }
-            Double alreadyPay = 0d;//已支付
-            Double cmShopPay = 0d;//应付采美佣金
-            boolean flag = false;
-
-            //如果是分期订单  id为307,381,386,526,537 或 日期> 2018-04-16 00:00:00
-            Date date = DateUtils.parseDate("2018-04-16 00:00:00");
-            String stagesOrderStr = "307,381,386,526,537";
-            if (StringUtils.equals("1", co.getStagesFlag()) && (co.getCreateDate().compareTo(date) > 0 || stagesOrderStr.lastIndexOf(co.getId() + "") != -1)) {
-                List<OrderStages> orderStagesList = orderStagesService.findStagesByOrderId(co.getId());
-                if (CollectionUtils.isNotEmpty(orderStagesList)) {
-                    for (OrderStages orderStages : orderStagesList) {
-                        List<CmFinanceCharge> cmFinanceChargeList = cmFinanceChargeService.findListByStagesId(orderStages.getId());
-                        if (CollectionUtils.isNotEmpty(cmFinanceChargeList)) {
-                            CmFinanceCharge cmFinanceCharge = cmFinanceChargeList.get(0);//sql获取总已付值
-                            cmShopPay += Double.parseDouble(cmFinanceCharge.getTotalStagesCmPay());
-                            alreadyPay += (Double.parseDouble(cmFinanceCharge.getTotalStagesShopPay()) + Double.parseDouble(cmFinanceCharge.getTotalStagesOtherPay()));
-                        }
-                    }
-                }
-                //总已付 =  总已付采美 + 总已付三方 + 总已供付应商
-                alreadyPay += cmShopPay;
-            } else {
-                List<OrderProduct> orderProduct = orderProductService.getWithorderId(co.getId() + "");
-                if (CollectionUtils.isNotEmpty(orderProduct)) {
-                    for (OrderProduct op : orderProduct) {
-                        List<CmFinanceCharge> cmFinanceChargeList = cmFinanceChargeService.findListByProductId(op.getId() + "");
-                        if (null != cmFinanceChargeList && cmFinanceChargeList.size() > 0) {
-                            alreadyPay = getAlreadyPay(cmFinanceChargeList, flag, alreadyPay);
-                        }
-
-                        //获取这个订单商品的总的应付供应商
-                        Double totalShopFee = Double.parseDouble(op.getShopFee());
-                        //已付供应商的总数
-                        Double shopPayFee = 0.00d;
-                        if (null != cmFinanceChargeList && cmFinanceChargeList.size() > 0) {
-                            for (CmFinanceCharge cfc : cmFinanceChargeList) {
-                                if (StringUtils.equals("3", cfc.getStatus())) {
-                                    //应付供应商全部审核通过才有采美佣金
-                                    shopPayFee += Double.parseDouble(cfc.getShopFee());
-                                }
-                            }
-                        }
-                        Double fee = totalShopFee - shopPayFee;
-                        if (fee <= 0.01) {//使用0.01:考虑计算过程中存在小数点误差
-                            // 不存在未付供应商则参加这个商品加入采美已付计算
-                            cmShopPay += Double.parseDouble(op.getCmFee());//(如果这个商品的已付供应商已付完表示采美也同时已付)
-                        }
-                    }
-                }
-            }
-            co.setAlreadyPayCm(String.format("%.2f", cmShopPay));//采美总已付
-            co.setUnPay(String.format("%.2f", Double.parseDouble(co.getPayTotalFee()) - alreadyPay));//未支付
-            co.setAlreadyPay(String.format("%.2f", alreadyPay));//已支付
-
-        }
-        model.addAttribute("contractId", contractOrder.getContractId());
-        model.addAttribute("page", page);
-        return "modules/bulkpurchase/contractOrderList";
-    }
-
-    //获取已付金额
-    private Double getAlreadyPay(List<CmFinanceCharge> cmFinanceChargeList, boolean flag, Double alreadyPay) {
-        for (int i = 0; i < cmFinanceChargeList.size(); i++) {  //一个产品多个出账记录
-            if ("3".equals(cmFinanceChargeList.get(i).getStatus())) {
-                flag = true;
-                alreadyPay += Double.parseDouble(cmFinanceChargeList.get(i).getShopFee()) + Double.parseDouble(cmFinanceChargeList.get(i).getOtherFee());
-            } else {
-                alreadyPay += 0;
-            }
-            if (flag == true && i == (cmFinanceChargeList.size() - 1)) {
-                //存在审核通过的应付金额  则+应付采美金额+税费
-                alreadyPay += Double.parseDouble(cmFinanceChargeList.get(i).getCmFee()) + Double.parseDouble(cmFinanceChargeList.get(i).getTaxRateFee());
-            }
-        }
-        return alreadyPay;
-    }
-
-    @RequiresPermissions("contractorder:contractOrder:view")
-    @RequestMapping(value = "form")
-    public String form(ContractOrder contractOrder, Model model, HttpServletRequest request) {
-        if (StringUtils.isEmpty(contractOrder.getId())) {//新增
-            contractOrder.setOrderSource("4");//来源设置为后台
-            request.getSession().removeAttribute("orderProducts");
-            //获取会所信息,即默认订单客户
-            BpOrderUserinfo bpOrderUserinfo = bpOrderUserinfoService.selectUserInfoById(contractOrder.getContractId() + "");
-            //获取采购基本信息
-            Contract contract = contractService.get(contractOrder.getContractId().toString());
-            contractOrder.setContract(contract);
-            contractOrder.setFreePostFlag(contract.getFreePostFlag().toString());//设置包邮信息
-            contractOrder.setBpOrderUserinfo(bpOrderUserinfo);
-            contractOrder.setNo("CMBP" + DateUtils.formatDate(new Date(), "yyyyMMddHHmmssSSSS"));
-
-        } else {//修改
-            //获取订单客户
-            BpOrderUserinfo bpOrderUserinfo = bpOrderUserinfoService.getWithorderId(contractOrder.getId());
-            if (null != bpOrderUserinfo) {
-                contractOrder.setBpOrderUserinfo(bpOrderUserinfo);
-            }
-            //获取订单商品
-            List<OrderProduct> list = orderProductService.getWithorderId(contractOrder.getId());
-            if (CollectionUtils.isNotEmpty(list)) {
-                contractOrder.setOrderProduct(list);
-                request.getSession().removeAttribute("orderProducts");
-                request.getSession().setAttribute("orderProducts", list);
-            }
-            //获取订单发票
-            OrderInvoice orderInvoice = orderInvoiceService.getWithorderId(contractOrder.getId());
-            if (null != orderInvoice) {
-                contractOrder.setOrderInvoice(orderInvoice);
-            }
-            String contractId = contractOrder.getContractId();
-            if (StringUtils.isNotEmpty(contractId)) {
-                //获取采购基本信息(针对V1.2.0之前版本存在合同订单)
-                Contract contract = contractService.get(contractId);
-                contractOrder.setContract(contract);
-            }
-        }
-        model.addAttribute("contractOrder", contractOrder);
-        return "modules/bulkpurchase/contractOrderForm";
-    }
-
-    @RequiresPermissions("contractorder:contractOrder:edit")
-    @RequestMapping(value = "save")
-    public String save(ContractOrder contractOrder, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
-        if (!beanValidator(model, contractOrder)) {
-            return form(contractOrder, model, request);
-        }
-
-        if (null == contractOrder.getOrderProduct()) {
-            model.addAttribute("message", "保存失败商品不能为空");
-            return form(contractOrder, model, request);
-        } else {
-            List<OrderProduct> orderProductList = Lists.newArrayList();
-            for (OrderProduct orderProduct : contractOrder.getOrderProduct()) {
-                if (StringUtils.isNotEmpty(orderProduct.getEnabledStatus())) {
-                    OrderProduct o = (OrderProduct) JsonMapper.fromJsonString(orderProduct.getEnabledStatus(), OrderProduct.class);
-                    orderProductList.add(o);
-                }
-            }
-            if (CollectionUtils.isNotEmpty(orderProductList)) {
-                contractOrder.setOrderProduct(orderProductList);
-            }
-        }
-        //后台添加订单状态为0;未付款
-        if (StringUtils.isEmpty(contractOrder.getStatus())) {
-            contractOrder.setStatus("0");
-        }
-
-        //如果是[5:外单]类型则订单状态直接为交易完成
-        if (StringUtils.equals("5", contractOrder.getOrderSource())) {
-            contractOrder.setConfirmFlag("1");//标记为确认订单
-        }
-
-        if (StringUtils.equals("1", contractOrder.getStagesFlag())) {//分期信息处理
-            List<OrderStages> list = Lists.newArrayList();
-            for (OrderStages orderStages : contractOrder.getOrderStages()) {
-                if (StringUtils.isNotEmpty(orderStages.getEnabledStatus())) {
-//                    OrderStages o = (OrderStages) JsonMapper.fromJsonString(orderStages.getEnabledStatus(),OrderStages.class);
-                    //未选择商品确认时 显示"" 、
-                    if ("\"\"".equals(orderStages.getEnabledStatus())) {
-                        orderStages.setEnabledStatus("[]");
-                    }
-                    List<OrderStagesProduct> orderStagesProducts = JSONArray.parseArray(orderStages.getEnabledStatus(), OrderStagesProduct.class);
-                    orderStages.setOrderStagesProductList(orderStagesProducts);
-                    list.add(orderStages);
-                }
-            }
-            if (CollectionUtils.isNotEmpty(list)) {
-                contractOrder.setOrderStages(list);
-            }
-        } else {
-            contractOrder.setStagesRemarks(null);
-            contractOrder.setStagesFlag("0");
-        }
-        if(StringUtils.equals("1",contractOrder.getStagesFlag()) || StringUtils.equals("1",contractOrder.getCooFreeFlag())){
-           //如果是分期订单
-            contractOrder.setCooFreeFlag("0");
-            contractOrder.setCooFreeRate(0);
-            contractOrder.setCooFreeAmount("0.00");
-        }
-        //保存订单
-        contractOrderService.save(contractOrder);
-
-        if (StringUtils.isNotEmpty(contractOrder.getId())) {
-            //订单重新保存后则修改订单商品需供应商确认
-            orderProductService.updateShopConfigFlag(contractOrder.getId());
-        }
-
-        addMessage(redirectAttributes, "保存订单成功");
-        return "redirect:" + Global.getAdminPath() + "/bulkpurchase/contractOrder/list?contractId=" + contractOrder.getContractId();
-    }
-
-    // 非分期订单确认
-    @RequiresPermissions("contractorder:contractOrder:edit")
-    @RequestMapping(value = "saveConfirmFlag")
-    public String saveConfirmFlag(ContractOrder contractOrder, Model model) {
-        model.addAttribute("contractOrder", contractOrder);
-
-        //增加快照条款内容
-        Long clauseId = contractOrder.getClauseId();
-        String clauseContent = contractOrder.getClauseContent();
-        BpClause bpClause = bpClauseService.get(String.valueOf(clauseId));
-        if(StringUtils.isEmpty(clauseContent) && null != bpClause){//第一次保存数据则按照条款表设置,后面再保存可能存在修改过快照,此时存在条款内容不允许修改
-            contractOrder.setClauseName(bpClause.getName());
-            contractOrder.setClauseContent(bpClause.getContent());
-        }
-
-        contractOrder.setConfirmFlag("1");//设置为已确认订单
-        contractOrderService.saveConfirmFlag(contractOrder);
-
-        //确认订单时处理买家商品价格库信息
-        Long clubId = contractOrder.getClubId();
-        ClubModel clubByUserId = clubDao.getClubByUserId(Integer.parseInt(clubId.toString()));
-        List<OrderProduct> orderProduct = contractOrder.getOrderProduct();
-        if(CollectionUtils.isNotEmpty(orderProduct) && orderProduct.size() > 0){
-            for(OrderProduct op:orderProduct){
-                String buyAgainFlag = op.getBuyAgainFlag();
-                //对于可以复购的商品添加买家商品价格,提供再次购买商品使用(如果不存在没有改买家商品价格则不能购买该商品)
-                if(StringUtils.isNotEmpty(buyAgainFlag) && StringUtils.equals("1",buyAgainFlag)){
-                    //1.买家用户最新价格(最多只存在一条表buyer_product_price)
-                    BuyerProductPrice buyerProductPrice = new BuyerProductPrice();//通过用户ID和商品ID确定唯一买家最新价格
-                    if(null != clubByUserId){
-                        buyerProductPrice.setUserId(clubByUserId.getUserID());
-                    }
-                    buyerProductPrice.setProductId(Integer.parseInt(op.getProductId().toString()));
-                    List<BuyerProductPrice> list = buyerProductPriceService.findList(buyerProductPrice);
-                    if(CollectionUtils.isNotEmpty(list) && list.size() == 1 ){
-                        //更新数据
-                        BuyerProductPrice buyerProductPrice1 = list.get(0);
-                        buyerProductPrice1.setTaxRate(op.getTaxRate());//税率
-                        buyerProductPrice1.setConfirmFlag("0");//确认标识 0否 1已确认
-                        buyerProductPrice1.setSingleShopFee(op.getShopFee1());//应付供应商成本
-                        buyerProductPrice1.setDiscountPrice(op.getDiscountPrice());
-                        buyerProductPrice1.setUpdateDate(new Date());
-                        buyerProductPriceService.save(buyerProductPrice1);
-                    }else if(CollectionUtils.isEmpty(list)){
-                        //插入新数据
-                        buyerProductPrice.setTaxRate(op.getTaxRate());//税率
-                        buyerProductPrice.setConfirmFlag("0");//确认标识 0否 1已确认
-                        buyerProductPrice.setSingleShopFee(op.getShopFee1());//应付供应商成本
-                        buyerProductPrice.setDiscountPrice(op.getDiscountPrice());
-                        buyerProductPrice.setUpdateDate(new Date());
-                        buyerProductPriceService.save(buyerProductPrice);
-                    }else{
-                        logger.info("买家价格列表信息异常");
-                        return "redirect:" + Global.getAdminPath() + "/bulkpurchase/contractOrder";
-                    }
-
-                    //2.买家价格历史库(表buyer_product_history_price)
-                    //用户商品单价≤成本价/用户商品单价≤应付供应商成本(不写入历史价格,在同意价格后再添加)
-                    Product product = productDao.get(op.getProductId().toString());
-                    if(null != product){
-                        String costPrice = product.getCostPrice();//成本价
-                        String discountPrice = op.getDiscountPrice();//折后单价
-                        String singleShopFee = op.getShopFee1();//单个应付供应商
-                        //如果存在价格差并从未确认过则红色提示(用户商品单价≤成本价或用户商品单价≤应付供应商成本)
-                        double discountPriceDouble = Double.parseDouble(discountPrice);
-                        double singleShopFeeDouble = Double.parseDouble(singleShopFee);
-                        boolean isRed1 = false;//默认不显示红色
-                        boolean isRed2 = false;//默认不显示红色
-                        //1.单价≤成本价
-                        if(StringUtils.isNotEmpty(costPrice)){//如果成本价是空则不需要比
-                            double costPriceDouble = Double.parseDouble(costPrice);
-                            if(discountPriceDouble <= costPriceDouble){
-                                isRed1 = true;//列表价格差异红色警告0:无警告、1:有警告
-                            }
-                        }
-
-                        //2.商品单价≤应付供应商成本
-                        if(discountPriceDouble <= singleShopFeeDouble){
-                                isRed2 = true;//列表价格差异红色警告0:无警告、1:有警告
-                        }
-
-                        //1和2存在一个红色就发送邮件提示客服(2088892826@qq.com、512431995@qq.com)
-                        if(isRed1 || isRed2){
-                            //发送邮件提示
-                            Thread thread = new Thread(){
-                                public void run(){
-                                    try {
-                                        String photoServer = Global.getConfig("user.mails");//获取邮件地址
-                                        String[] split = photoServer.split(",");
-                                        for(String mailAdd:split) {
-                                            StringBuffer info = new StringBuffer();
-                                            info.append("【采美365】您好!用户(id=" + clubByUserId.getUserID() + ")");//用户(id=1001)的[]商品价格过小提示,可在采美后台中的[采美365-商品管理-新商品管理中]通过搜索对应商品ID,查看对应商品的[买家价格库]查看对应用户ID的商品价格(已标记红色提示)可以通过同意价格等操作来处理。
-                                            info.append("的[" + op.getProductId() + "]商品价格过小提示,可在采美后台中的[采美365-商品管理-新商品管理中]通过搜索对应商品ID,查看对应商品的[买家价格库]查看对应用户ID的商品价格(已标记红色提示)可以通过同意价格等操作来处理。");
-                                            MailUtils.sendMail(mailAdd, "用户商品价格库价格低于成本价或应付供应商", String.valueOf(info));
-                                            logger.info("已发送邮件提示!!");
-                                        }
-                                    }catch (Exception e){
-                                        logger.info("发送邮件异常",e.getMessage());
-                                    }
-                                }
-                            };
-                            thread.start();
-                        }else{
-                            //不存在红色提示,则不需要同意价格,直接写入历史价格
-                            BuyerProductHistoryPrice buyerProductHistoryPrice  = new BuyerProductHistoryPrice();
-                            buyerProductHistoryPrice.setProductId(Integer.parseInt(op.getProductId().toString()));
-                            if(null != clubByUserId){
-                                buyerProductHistoryPrice.setUserId(clubByUserId.getUserID());
-                            }
-                            BuyerProductHistoryPrice bphp  = buyerProductHistoryPrice;
-                            bphp.setDelFlag("1");//禁用老的历史记录
-                            buyerProductHistoryPriceService.updateDelFlag(bphp);
-                            buyerProductHistoryPrice.setDelFlag("0");
-                            buyerProductHistoryPrice.setDiscountPrice(op.getDiscountPrice());
-                            buyerProductHistoryPrice.setSingleShopFee(op.getShopFee1());
-                            buyerProductHistoryPrice.setTaxRate(op.getTaxRate());
-                            buyerProductHistoryPriceService.save(buyerProductHistoryPrice);
-                        }
-                    }
-                }
-            }
-        }
-
-        // flag=1订单查询页面的订单详情,删除等入口-
-        if (StringUtils.equals("1", contractOrder.getFlag())) {
-            return "redirect:" + Global.getAdminPath() + "/bulkpurchase/contractOrder";
-        }
-
-        // flag=2采购信息的页面订单详情,删除等入口
-        if (StringUtils.equals("2", contractOrder.getFlag())) {
-            return "redirect:" + Global.getAdminPath() + "/bulkpurchase/contractOrder?contractId=" + contractOrder.getContractId();
-        }
-        return "redirect:" + Global.getAdminPath() + "/bulkpurchase/contractOrder";
-    }
-
-    // 分期订单确认
-    @RequiresPermissions("contractorder:contractOrder:edit")
-    @RequestMapping(value = "saveStagesConfirmFlag")
-    public String saveStagesConfirmFlag(ContractOrder contractOrder, RedirectAttributes redirectAttributes) {
-//        model.addAttribute("contractOrder",contractOrder);
-        //获取当前订单的确认订单状态(0未确认 1已确认 2买家确认 3 供应商确认)
-        List<ContractOrder> list = contractOrderService.findList(contractOrder);
-        if (CollectionUtils.isNotEmpty(list)) {
-            ContractOrder order = list.get(0);//通过订单ID查询能够确定一个订单
-            /**获取订单分期信息  获取订单商品信息  判断金额商品数量是否分配 */
-            BigDecimal totalShouldPay = new BigDecimal(0);  //订单应付金额
-            BigDecimal stagesTotalFee = new BigDecimal(0);  //分期总金额
-            Integer num = 0;//购买数
-            Integer presentNum = 0;//商品赠品数
-            Integer alreadyNum = 0;//已分配商品数
-
-            List<OrderStages> orderStagesList = orderStagesService.findStagesByOrderId(order.getId());
-            OrderProduct orderProduct = new OrderProduct();
-            orderProduct.setOrderId(Long.parseLong(order.getId()));
-            List<OrderProduct> products = orderProductService.findAllList(orderProduct);
-
-            //分期订单 判断分期金额与商品数量分配情况
-            if ("1".equals(order.getStagesFlag())) {
-                if (null != products && products.size() > 0) {
-                    for (int i = 0; i < products.size(); i++) {
-                        //应付总额
-                        totalShouldPay = MathUtil.add(totalShouldPay, products.get(i).getShouldPayFee());
-                        //商品购买数
-                        num += Integer.parseInt(products.get(i).getNum());
-                        //赠品数
-                        if (null != products.get(i).getPresentNum()) {
-                            presentNum += Integer.parseInt(products.get(i).getPresentNum());
-                        }
-                    }
-                }
-                if (null != orderStagesList && orderStagesList.size() > 0) {
-                    for (int i = 0; i < orderStagesList.size(); i++) {
-                        //分期金额
-                        stagesTotalFee = MathUtil.add(stagesTotalFee, orderStagesList.get(i).getFee());
-                        List<OrderStagesProduct> stagesProducts = orderStagesProductService.findStagesProductBuyStagesId(orderStagesList.get(i).getId());
-                        //分期商品数
-                        if (null != stagesProducts && stagesProducts.size() > 0) {
-                            for (int j = 0; j < stagesProducts.size(); j++) {
-                                alreadyNum += stagesProducts.get(j).getProductNum();
-                            }
-                        }
-                    }
-                }
-                BigDecimal notNum = MathUtil.sub(totalShouldPay, stagesTotalFee);
-                /**未满足  分期设置未完成*/
-                if ((num + presentNum - alreadyNum) != 0 || notNum.compareTo(BigDecimal.ZERO) != 0) {
-                    addMessage(redirectAttributes, order.getId() + " 剩下分期金额(¥ " + notNum + " ),商品数( " + (num + presentNum - alreadyNum) + " )未分配,不能确认订单");
-                    return "redirect:" + Global.getAdminPath() + "/bulkpurchase/contractOrder/";
-                }
-            }
-
-            String confirmFlag = order.getConfirmFlag();
-            if (StringUtils.equals("0", confirmFlag)) {//会所与供应商都没有确认-----设置确认状态为供应已确认
-                contractOrder.setConfirmFlag("3");
-                contractOrderService.saveConfirmFlag(contractOrder);
-            }
-            if (StringUtils.equals("2", confirmFlag)) {//会所已确认-----设置确认状态为已确认
-                contractOrder.setConfirmFlag("1");
-                contractOrderService.saveConfirmFlag(contractOrder);
-            }
-        }
-        // flag=1订单查询页面的订单详情,删除等入口-
-        if (StringUtils.equals("1", contractOrder.getFlag())) {
-            return "redirect:" + Global.getAdminPath() + "/bulkpurchase/contractOrder";
-        }
-
-        // flag=2采购信息的页面订单详情,删除等入口
-        if (StringUtils.equals("2", contractOrder.getFlag())) {
-            return "redirect:" + Global.getAdminPath() + "/bulkpurchase/contractOrder?contractId=" + contractOrder.getContractId();
-        }
-        return "redirect:" + Global.getAdminPath() + "/bulkpurchase/contractOrder";
-    }
-
-    @RequiresPermissions("contractorder:contractOrder:delete")
-    @RequestMapping(value = "delete")
-    public String delete(ContractOrder contractOrder, RedirectAttributes redirectAttributes) {
-        contractOrder.setDelFlag(DateUtils.formatDate(new Date(), "yyyyMMddHHmmssSSSS"));
-        contractOrderService.delete(contractOrder);
-        addMessage(redirectAttributes, "删除订单成功");
-        return "redirect:" + Global.getAdminPath() + "/bulkpurchase/contractOrder/";
-    }
-
-    @RequiresPermissions("contractorder:contractOrder:delete")
-    @RequestMapping(value = "deleteAll")
-    public String deleteAll(ContractOrder contractOrder, RedirectAttributes redirectAttributes) {
-        contractOrderService.delete(contractOrder);
-        addMessage(redirectAttributes, "删除订单成功");
-        return "redirect:" + Global.getAdminPath() + "/bulkpurchase/contractOrder/all?repage";
-    }
-
-    @RequestMapping(value = "putProductToOrder")
-    public String putProductToOrder(ContractOrder contractOrder, HttpServletRequest request, Model model) {
-        List<OrderProduct> orderProducts = (List<OrderProduct>) request.getSession().getAttribute("orderProducts");//添加的商品
-        List<OrderProduct> orderProduct = contractOrder.getOrderProduct();//传过来的订单商品
-        if (null == orderProducts && null == orderProduct) {
-            Double userMoney = contractService.getUserMoneyByClubId(contractOrder.getContractId());
-            contractOrder.setBalancePayFee(userMoney + "");
-            model.addAttribute("contractOrder", contractOrder);
-            return "modules/bulkpurchase/contractOrderForm";
-        }
-        BigDecimal productCount = new BigDecimal("0");
-        BigDecimal presentCount = new BigDecimal("0");
-        BigDecimal addedValueTax = new BigDecimal("0");
-        BigDecimal productTotalFee = new BigDecimal("0");
-        BigDecimal orderProductShopFee = new BigDecimal("0");
-        BigDecimal orderProductOtherFee = new BigDecimal("0");
-        BigDecimal orderProductCmFee = new BigDecimal("0");
-        for (OrderProduct product : orderProducts) {
-            BigDecimal num = new BigDecimal(product.getNum());
-            productCount = productCount.add(num);
-            BigDecimal presentNum = new BigDecimal(product.getPresentNum());
-            presentCount = presentCount.add(presentNum);
-            BigDecimal totalFee = new BigDecimal(product.getTotalFee());
-            productTotalFee = productTotalFee.add(totalFee);
-        }
-
-        contractOrder.setPayTotalFee(productTotalFee.doubleValue() + "");
-        contractOrder.setProductTotalFee(productTotalFee.doubleValue() + "");
-        contractOrder.setOrderTotalFee(productTotalFee.doubleValue() + "");
-        contractOrder.setBalancePayFee(0 + "");
-        contractOrder.setPresentCount(presentCount.doubleValue() + "");
-        contractOrder.setProductCount(productCount.doubleValue() + "");
-        //每次选择商品后折扣需要重新输入计算
-        contractOrder.setDiscount("0");
-//            if (null != contractOrder.getDiscount() && !contractOrder.getDiscount().equals("")) {
-//                BigDecimal discount = new BigDecimal(contractOrder.getDiscount());
-//                contractOrder.setPayTotalFee(productTotalFee.subtract(discount).doubleValue() + "");
-//            } else {
-        contractOrder.setPayTotalFee(productTotalFee.doubleValue() + "");
-//            }
-        contractOrder.setOrderProduct(orderProducts);
-        Double userMoney = contractService.getUserMoneyByClubId(contractOrder.getContractId());
-        contractOrder.setBalancePayFee(userMoney + "");
-        model.addAttribute("contractOrder", contractOrder);
-        return "modules/bulkpurchase/contractOrderForm";
-    }
-
-
-    @RequestMapping(value = "PutSession")
-    @ResponseBody
-    public Map<String, Object> PutSession(@RequestParam("items") String items, HttpServletRequest request) {
-        Map<String, Object> map = new HashMap<>();
-        try {
-            List<OrderProduct> orderProducts = JSONArray.parseArray(items, OrderProduct.class);
-            request.getSession().removeAttribute("orderProducts");
-            request.getSession().setAttribute("orderProducts", orderProducts);
-            map.put("success", "true");
-            map.put("msg", "添加成功");
-        } catch (Exception e) {
-            map.put("success", "false");
-            map.put("msg", "添加失败");
-        }
-        return map;
-    }
-
-    @RequestMapping(value = "setProductTotalFee")
-    @ResponseBody
-    public String setProductTotalFee(ContractOrder contractOrder, Model model) {
-        String discount = contractOrder.getDiscount();
-        int i = Integer.parseInt(discount);
-        int pay = Integer.parseInt(contractOrder.getPayTotalFee()) - i;
-        if (pay < 0) {
-            model.addAttribute("message", "您输入的折扣超出了订单总额,请注意");
-        } else {
-            contractOrder.setPayTotalFee(pay + "");
-        }
-        model.addAttribute("contractOrder", contractOrder);
-        return "";
-
-    }
-
-    // 保存订单终止信息
-    @RequiresPermissions("contractorder:contractOrder:edit")
-    @RequestMapping(value = "saveOrderStopInfo")
-    public String saveOrderStopInfo(ContractOrder contractOrder, Model model) {
-        model.addAttribute("contractOrder", contractOrder);
-
-        contractOrder.setOrderStopFlag("1");//设置为终止状态
-        contractOrderService.saveOrderStopInfo(contractOrder);
-
-        // flag=1订单查询页面的订单详情,删除、终止等入口-
-        if (StringUtils.equals("1", contractOrder.getFlag())) {
-            return "redirect:" + Global.getAdminPath() + "/bulkpurchase/contractOrder";
-        }
-
-        // flag=2采购信息的页面订单详情,删除、终止等入口
-        if (StringUtils.equals("2", contractOrder.getFlag())) {
-            return "redirect:" + Global.getAdminPath() + "/bulkpurchase/contractOrder?contractId=" + contractOrder.getContractId();
-        }
-        return "redirect:" + Global.getAdminPath() + "/bulkpurchase/contractOrder";
-    }
-
-    /**
-     * 导出订单信息
-     *
-     * @param contractOrder
-     * @return
-     */
-    @RequiresPermissions("contractorder:contractOrder:export")
-    @RequestMapping(value = "exportOrderInfo")
-    public void exportOrderInfo(ContractOrder contractOrder, RedirectAttributes redirectAttributes, HttpServletResponse response) {
-        //获取订单数据
-        String fileName = contractOrder.getId() + "-" + contractOrder.getName() + "-采美365网购订单.xls";
-        String template = Global.getConfig("export.template");
-        String templateFileName = template+"/bpstages_template.xls";
-        try {
-            OrderProduct orderProduct = new OrderProduct();
-            orderProduct.setOrderId(Long.parseLong(contractOrder.getId()));
-            List<OrderProduct> products = orderProductService.findAllList(orderProduct);
-            for (OrderProduct orderProduct2 : products) {
-                //如果 =0 则设置为 0  方便页面判断
-                BigDecimal totalPay = new BigDecimal(orderProduct2.getTotalFee());
-                if (totalPay.compareTo(BigDecimal.ZERO) == 0) {
-                    orderProduct2.setTotalFee("0");
-                }
-                //设置税费
-                if (null == orderProduct2.getAddedValueTax() || "".equals(orderProduct2.getAddedValueTax()) || new BigDecimal(orderProduct2.getAddedValueTax()).compareTo(BigDecimal.ZERO) == 0) {
-                    orderProduct2.setAddedValueTax("0");
-                }
-                String image = orderProduct2.getImage();
-                //设置图片完整路径
-                orderProduct2.setImage(AppUtils.getProductImageURL(image, 0, Global.getConfig("wwwServer")));
-            }
-            List<OrderProduct> products1 = orderProductService.findByOrderIdGroupByShopId(Integer.parseInt(contractOrder.getId()));
-            StringBuffer shopNameInfo = new StringBuffer();
-            //设置供应商信息
-            for (OrderProduct orderProduct1 : products1) {
-                shopNameInfo.append(orderProduct1.getShopName() + "、");
-            }
-            shopNameInfo.setLength(shopNameInfo.length() - 1);
-            contractOrder.setShopNameInfo(shopNameInfo.toString());
-            //设置订单商品信息
-            contractOrder.setOrderProduct(products);
-            BigDecimal stagesTotalFee = new BigDecimal(0);
-            StringBuffer buffer = new StringBuffer();
-            if ("1".equals(contractOrder.getStagesFlag())) {
-                List<OrderStages> stagesList = orderStagesService.findStagesByOrderId(contractOrder.getId());
-                //获取商品信息
-                for (OrderStages stages : stagesList) {
-                    List<OrderStagesProduct> stagesProducts = orderStagesProductService.findStagesProductBuyStagesId(stages.getId());
-                    if (null != stagesProducts && stagesProducts.size() > 0) {
-                        for (OrderStagesProduct stagesProduct : stagesProducts) {
-                            buffer.append(stagesProduct.getProductNum() + "-个(" + stagesProduct.getProductName() + ")、");
-                        }
-                    }
-                    //设置商品信息
-                    stages.setProductInfo(buffer.toString());
-                    //清空
-                    buffer.setLength(0);
-                    //设置分期总金额
-                    stagesTotalFee = MathUtil.round(MathUtil.add(stagesTotalFee, stages.getFee()), 2);
-                }
-                contractOrder.setStagesTotalFee(MathUtil.round(stagesTotalFee, 2));
-                contractOrder.setOrderStages(stagesList);
-            }
-            //设置list数据
-            List<ContractOrder> list = Lists.newArrayList();
-            contractOrder.setClauseContent(StringUtils.replaceHtml(contractOrder.getClauseContent()));
-            list.add(contractOrder);
-            new ExcelUtil().createExcel(templateFileName, list, fileName, response);
-        } catch (Exception e) {
-            addMessage(redirectAttributes, "订单信息导出失败!" + e.getMessage());
-            e.printStackTrace();
-        }
-    }
-
-
-    // 保存订单条款信息
-    @RequestMapping(value = "editclausecontent")
-    public String editclausecontent(ContractOrder contractOrder, Model model) {
-        model.addAttribute("contractOrder", contractOrder);
-        return "modules/bulkpurchase/contractOrderClause";
-
-    }
-
-    @RequestMapping(value = "saveClause")
-    public String saveClause(ContractOrder contractOrder, RedirectAttributes redirectAttributes, HttpServletRequest request) {
-        String clauseContent = request.getParameter("clauseContent");
-        String clauseName = request.getParameter("clauseName");
-        contractOrder.setClauseContent(clauseContent);
-        contractOrder.setClauseName(clauseName);
-        contractOrderService.updateClauseContent(contractOrder);
-        if (StringUtils.isNotEmpty(contractOrder.getId())) {
-            //订单重新保存后则修改订单商品需供应商确认
-            orderProductService.updateShopConfigFlag(contractOrder.getId());
-        }
-        return "redirect:" + Global.getAdminPath() + "/bulkpurchase/contractOrder";
-
-    }
-
-    // URL编码utf-8
-    @RequestMapping(value = "enCode")
-    @ResponseBody
-    public Map<String, Object> enCode(@RequestParam("redirectUrl") String redirectUrl) {
-        String enCodeRedirectUrl = "";
-        Map<String, Object> map = new HashMap<>();
-        try {
-            enCodeRedirectUrl = URLEncoder.encode(redirectUrl, "UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            logger.error("URL编码异常", e);
-            e.printStackTrace();
-        }
-        map.put("enCodeRedirectUrl", enCodeRedirectUrl);
-        map.put("msg", "添加成功");
-        return map;
-    }
-
-
-    //进账确认编辑
-    @RequestMapping(value = "orderStatusEdit")
-    public String orderStatusEdit(@RequestParam(required = true) String orderId, Model model) {
-        model.addAttribute("orderId", orderId);
-        ContractOrder contractOrder = contractOrderService.get(orderId);
-        if (null != contractOrder) {
-            model.addAttribute("orderStatus", contractOrder.getStatus());
-        }
-        model.addAttribute("updateDate", new Date());
-        return "modules/bulkpurchase/updateOrderStatusForm";
-    }
-
-    //保存订单状态
-    @ResponseBody
-    @RequestMapping(value = "saveOrderStatus")
-    public Map<String, Object> saveOrderStatus(String orderStatus, Date updateDate, String orderId) {
-        Map<String, Object> map = Maps.newLinkedHashMap();
-        try {
-            ContractOrder contractOrder = contractOrderService.get(orderId);
-            if (null != contractOrder) {
-                contractOrder.setStatus(orderStatus);//设置订单状态
-                contractOrder.setUpdateDate(updateDate);
-            }
-            contractOrderService.updateOrderStatusInfo(contractOrder);
-            map.put("success", true);
-            map.put("msg", "确认修改");
-        } catch (Exception e) {
-            logger.debug(e.toString(), e);
-            map.put("success", false);
-            map.put("msg", "修改失败");
-        }
-        return map;
-    }
-
-}

+ 0 - 80
src/main/java/com/caimei/modules/bulkpurchase/web/ProductPrivilegeController.java

@@ -1,80 +0,0 @@
-package com.caimei.modules.bulkpurchase.web;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.servlet.mvc.support.RedirectAttributes;
-
-import com.thinkgem.jeesite.common.config.Global;
-import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.web.BaseController;
-import com.thinkgem.jeesite.common.utils.StringUtils;
-import com.caimei.modules.bulkpurchase.entity.ProductPrivilege;
-import com.caimei.modules.bulkpurchase.service.ProductPrivilegeService;
-
-/**
- * 赠送优惠信息Controller
- * @author jiangjunwen
- * @version 2017-03-31
- */
-@Controller
-@RequestMapping(value = "${adminPath}/bulkpurchase/productPrivilege")
-public class ProductPrivilegeController extends BaseController {
-
-	@Autowired
-	private ProductPrivilegeService productPrivilegeService;
-	
-	@ModelAttribute
-	public ProductPrivilege get(@RequestParam(required=false) String id) {
-		ProductPrivilege entity = null;
-		if (StringUtils.isNotBlank(id)){
-			entity = productPrivilegeService.get(id);
-		}
-		if (entity == null){
-			entity = new ProductPrivilege();
-		}
-		return entity;
-	}
-	
-	@RequiresPermissions("productprivilege:productPrivilege:view")
-	@RequestMapping(value = {"list", ""})
-	public String list(ProductPrivilege productPrivilege, HttpServletRequest request, HttpServletResponse response, Model model) {
-		Page<ProductPrivilege> page = productPrivilegeService.findPage(new Page<ProductPrivilege>(request, response), productPrivilege); 
-		model.addAttribute("page", page);
-		return "modules/bulkpurchase/productPrivilegeList";
-	}
-
-	@RequiresPermissions("productprivilege:productPrivilege:view")
-	@RequestMapping(value = "form")
-	public String form(ProductPrivilege productPrivilege, Model model) {
-		model.addAttribute("productPrivilege", productPrivilege);
-		return "modules/bulkpurchase/productPrivilegeForm";
-	}
-
-	@RequiresPermissions("productprivilege:productPrivilege:edit")
-	@RequestMapping(value = "save")
-	public String save(ProductPrivilege productPrivilege, Model model, RedirectAttributes redirectAttributes) {
-		if (!beanValidator(model, productPrivilege)){
-			return form(productPrivilege, model);
-		}
-		productPrivilegeService.save(productPrivilege);
-		addMessage(redirectAttributes, "保存赠送优惠信息成功");
-		return "redirect:"+Global.getAdminPath()+"/bulkpurchase/productPrivilege/?repage";
-	}
-	
-	@RequiresPermissions("productprivilege:productPrivilege:delete")
-	@RequestMapping(value = "delete")
-	public String delete(ProductPrivilege productPrivilege, RedirectAttributes redirectAttributes) {
-		productPrivilegeService.delete(productPrivilege);
-		addMessage(redirectAttributes, "删除赠送优惠信息成功");
-		return "redirect:"+Global.getAdminPath()+"/bulkpurchase/productPrivilege/?repage";
-	}
-
-}

+ 0 - 6
src/main/java/com/caimei/modules/cmpage/web/CmPageCentreController.java

@@ -9,7 +9,6 @@ import com.caimei.modules.hehe.entity.CmHeheProduct;
 import com.caimei.modules.newhome.entity.NewPageFloorContent;
 import com.caimei.modules.opensearch.GenerateUtils;
 import com.caimei.modules.product.entity.ActType;
-import com.caimei.modules.product.service.ActTypeService;
 import com.caimei.redis.RedisService;
 import com.google.common.collect.Maps;
 import com.thinkgem.jeesite.common.config.Global;
@@ -50,9 +49,6 @@ public class CmPageCentreController extends BaseController {
     @Autowired
     private CmImageService cmImageService;
 
-    @Autowired
-    private ActTypeService actTypeService;
-
     @Resource
     private CmHeheProductDao cmHeheProductDao;
 
@@ -182,8 +178,6 @@ public class CmPageCentreController extends BaseController {
         Page<CmImage> page = cmImageService.findPage(new Page<CmImage>(request, response), cmImage);
         model.addAttribute("page", page);
         model.addAttribute("type", cmImage.getType());
-        List<ActType> typeList = actTypeService.findList(new ActType());
-        model.addAttribute("typeList", typeList);
         return "modules/cmpage/pageList_multiselect";
     }
 

+ 0 - 2
src/main/java/com/caimei/modules/order/dao/CmReceiptOrderRelationDao.java

@@ -37,7 +37,5 @@ public interface CmReceiptOrderRelationDao extends CrudDao<CmReceiptOrderRelatio
 
     String findUserId(Integer orderId);
 
-    void insertOnlineRefund(OnlineRefundVo onlineRefundVo);
-
     List<CmReceiptOrderRelation> findByShopOrderIds(@Param("shopOrderIds")List<Integer> shopOrderIds);
 }

+ 0 - 15
src/main/java/com/caimei/modules/product/dao/ActTypeDao.java

@@ -1,15 +0,0 @@
-package com.caimei.modules.product.dao;
-
-import com.caimei.modules.product.entity.ActType;
-import com.thinkgem.jeesite.common.persistence.CrudDao;
-import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
-
-/**
- * ${DESCRIPTION}
- *
- * @author LG
- * @create 2017-05-10
- **/
-@MyBatisDao
-public interface ActTypeDao extends CrudDao<ActType> {
-}

+ 0 - 19
src/main/java/com/caimei/modules/product/dao/ProductCustomClassificationDao.java

@@ -1,19 +0,0 @@
-package com.caimei.modules.product.dao;
-
-import com.thinkgem.jeesite.common.persistence.CrudDao;
-import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
-import com.caimei.modules.product.entity.ProductCustomClassification;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * 商品自定义分类DAO接口
- * @author lwt
- * @version 2018-11-19
- */
-@MyBatisDao
-public interface ProductCustomClassificationDao extends CrudDao<ProductCustomClassification> {
-
-	List<ProductCustomClassification> findCustomClassification(@Param("productID") Integer productID);
-}

+ 9 - 28
src/main/java/com/caimei/modules/product/dao/ProductDao.java

@@ -14,9 +14,6 @@ import java.util.Map;
 @MyBatisDao
 public interface ProductDao extends CrudDao<Product> {
 
-    List<ActType> getAllActType();
-
-
     int saveSort(@Param("sort") String sort, @Param("id") String id);
 
     int findLadderPriceByNum(@Param("productID") String productID);
@@ -27,21 +24,21 @@ public interface ProductDao extends CrudDao<Product> {
      * @param product
      * @return
      */
-    public List<Product> getSupplierProductList(Product product);
+    List<Product> getSupplierProductList(Product product);
 
     /**
      * 获取所有已添加存在的小程序商品集合
      *
      * @return
      */
-    public List<Integer> getAllExistsProductList(@Param("organizeID") String organizeID);
+     List<Integer> getAllExistsProductList(@Param("organizeID") String organizeID);
 
     List<Product> findListBuyMall(Product product);
 
 
     void deleteProduct(@Param("id") String id, @Param("DateTime") Long DateTime);
 
-    public List<Product> getrecommendProductList(Product product);
+     List<Product> getrecommendProductList(Product product);
 
     int insertAddProduct(@Param("productID") Integer productID, @Param("tinyTypeID") Integer tinyTypeID);
 
@@ -51,7 +48,7 @@ public interface ProductDao extends CrudDao<Product> {
      * @param giftProduct
      * @return
      */
-    public List<GiftProduct> getGiftProductInfo(GiftProduct giftProduct);
+     List<GiftProduct> getGiftProductInfo(GiftProduct giftProduct);
 
     /**
      * 后去商品购买库存
@@ -59,28 +56,26 @@ public interface ProductDao extends CrudDao<Product> {
      * @param productId
      * @return
      */
-    public Sku getProductSku(@Param("productId") Integer productId);
+     Sku getProductSku(@Param("productId") Integer productId);
 
     /**
      * 更新赠送
      *
      * @return
      */
-    public int updateGiftProudct(GiftProduct giftProduct);
+     int updateGiftProudct(GiftProduct giftProduct);
 
     /**
      * 删除赠送
      *
      * @return
      */
-    public int insertGiftProudct(GiftProduct giftProduct);
-
+     int insertGiftProudct(GiftProduct giftProduct);
 
-    public int insertProductPriceRecord(ProductPriceRecord productPriceRecord);
 
-    /*    public int updateCRMFlag(String enabledStatus, String[] ids);*/
+     int insertProductPriceRecord(ProductPriceRecord productPriceRecord);
 
-    public int updatePostFlag(String enabledStatus, String[] ids);
+     int updatePostFlag(String enabledStatus, String[] ids);
 
     public String findProductBigTypeByProductID(Integer productID);
 
@@ -92,22 +87,8 @@ public interface ProductDao extends CrudDao<Product> {
 
     Map<String, Object> getProductTypeNameAndID(@Param("tinyTypeID") Integer tinyTypeID);
 
-    void deleteCustomClassification(@Param("productID") Integer productID);
-
-    void insertCustomClassification(ProductCustomClassification obj);
-
-    List<Product> relatedProductList(Product product);
-
-    void deleteProductCustomClassification(@Param("productID") Integer productID, @Param("tinyTypeID") Integer tinyTypeID);
-
-    List<Product> toAddProductCustomClassificationList(Product product);
-
     List<Product> toAddProductList(Product product);
 
-    List<ProductCustomClassification> getProductTypes(@Param("productID") Integer productID);
-
-    List<Product> findRecommendActivityListPage(Product product);
-
     List<ProductBigType> findBigTypeList(ProductBigType productBigType);
 
     List<ProductSmallType> findSmallTypeList(ProductSmallType productSmallType);

+ 0 - 51
src/main/java/com/caimei/modules/product/entity/ProductCustomClassification.java

@@ -1,51 +0,0 @@
-package com.caimei.modules.product.entity;
-
-import com.thinkgem.jeesite.common.persistence.DataEntity;
-
-/**
- * 商品自定义分类
- *
- * @author Lwt
- * @create 2018-11-19
- **/
-public class ProductCustomClassification extends DataEntity<ProductCustomClassification> {
-
-    private static final long serialVersionUID = 1L;
-
-    private Integer productID;
-    private Integer bigTypeID;
-    private Integer smallTypeID;
-    private Integer tinyTypeID;
-
-    public Integer getProductID() {
-        return productID;
-    }
-
-    public void setProductID(Integer productID) {
-        this.productID = productID;
-    }
-
-    public Integer getBigTypeID() {
-        return bigTypeID;
-    }
-
-    public void setBigTypeID(Integer bigTypeID) {
-        this.bigTypeID = bigTypeID;
-    }
-
-    public Integer getSmallTypeID() {
-        return smallTypeID;
-    }
-
-    public void setSmallTypeID(Integer smallTypeID) {
-        this.smallTypeID = smallTypeID;
-    }
-
-    public Integer getTinyTypeID() {
-        return tinyTypeID;
-    }
-
-    public void setTinyTypeID(Integer tinyTypeID) {
-        this.tinyTypeID = tinyTypeID;
-    }
-}

+ 0 - 18
src/main/java/com/caimei/modules/product/service/ActTypeService.java

@@ -1,18 +0,0 @@
-package com.caimei.modules.product.service;
-
-import com.caimei.modules.product.dao.ActTypeDao;
-import com.caimei.modules.product.entity.ActType;
-import com.thinkgem.jeesite.common.service.CrudService;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-/**
- * ${DESCRIPTION}
- *
- * @author LG
- * @create 2017-05-10
- **/
-@Service
-@Transactional(readOnly = true)
-public class ActTypeService extends CrudService<ActTypeDao, ActType> {
-}

+ 2 - 4
src/main/java/com/caimei/modules/product/service/CmTinytypeService.java

@@ -35,13 +35,11 @@ public class CmTinytypeService extends CrudService<CmTinytypeDao, CmTinytype> {
 	public CmTinytype get(String tinyTypeID) {
 		return super.get(tinyTypeID);
 	}
+
 	public List<CmTinytype> getByCode(String tinyTypeCode,String smallTypeCode) {
 		return cmTinytypeDao.getByCode(tinyTypeCode,smallTypeCode);
 	}
-	@Transactional(readOnly = false)
-	public void mutiUpdateCode(String newTinyTypeId){
-		cmTinytypeDao.mutiUpdateCode(newTinyTypeId);
-	}
+
 	public List<CmTinytype> findList(CmTinytype cmTinytype) {
 		return super.findList(cmTinytype);
 	}

+ 0 - 53
src/main/java/com/caimei/modules/product/service/ProductCustomClassificationService.java

@@ -1,53 +0,0 @@
-package com.caimei.modules.product.service;
-
-import java.util.List;
-
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.service.CrudService;
-import com.caimei.modules.product.entity.ProductCustomClassification;
-import com.caimei.modules.product.dao.ProductCustomClassificationDao;
-
-import javax.annotation.Resource;
-
-/**
- * 商品自定义分类Service
- * @author lwt
- * @version 2018-11-19
- */
-@Service
-@Transactional(readOnly = true)
-public class ProductCustomClassificationService extends CrudService<ProductCustomClassificationDao, ProductCustomClassification> {
-
-	@Resource
-	private ProductCustomClassificationDao productCustomClassificationDao;
-
-	public ProductCustomClassification get(String id) {
-		return super.get(id);
-	}
-	
-	public List<ProductCustomClassification> findList(ProductCustomClassification productCustomClassification) {
-		return super.findList(productCustomClassification);
-	}
-	
-	public Page<ProductCustomClassification> findPage(Page<ProductCustomClassification> page, ProductCustomClassification productCustomClassification) {
-		return super.findPage(page, productCustomClassification);
-	}
-	
-	@Transactional(readOnly = false)
-	public void save(ProductCustomClassification productCustomClassification) {
-		super.save(productCustomClassification);
-	}
-	
-	@Transactional(readOnly = false)
-	public void delete(ProductCustomClassification productCustomClassification) {
-		super.delete(productCustomClassification);
-	}
-
-	@Transactional(readOnly = false)
-	public List<ProductCustomClassification> findCustomClassification(Integer productID) {
-		return productCustomClassificationDao.findCustomClassification(productID);
-	}
-}

+ 0 - 83
src/main/java/com/caimei/modules/product/service/ProductService.java

@@ -109,11 +109,6 @@ public class ProductService extends CrudService<ProductDao, Product> {
         super.delete(product);
     }
 
-    public List<ActType> getAllActType() {
-        return productDao.getAllActType();
-    }
-
-
     public List<Product> getSupplierProductList(Product product) {
         return productDao.getSupplierProductList(product);
     }
@@ -148,14 +143,6 @@ public class ProductService extends CrudService<ProductDao, Product> {
         return productDao.insertGiftProudct(giftProduct);
     }
 
-    public int insertProductPriceRecord(ProductPriceRecord productPriceRecord) {
-        return productDao.insertProductPriceRecord(productPriceRecord);
-    }
-
-//    @Transactional(readOnly = false)
-//    public void updateCRMFlag(String status, String[] ids) {
-//        productDao.updateCRMFlag(status, ids);
-//    }
 
     @Transactional(readOnly = false)
     public void updatePostFlag(String status, String[] ids) {
@@ -178,71 +165,12 @@ public class ProductService extends CrudService<ProductDao, Product> {
         return productDao.getProductTypeNameAndID(tinyTypeID);
     }
 
-    public JsonModel editProductCustomClassification(Integer productID, String[] ids) throws Exception {
-        try {
-            productDao.deleteCustomClassification(productID);
-            for (String id : ids) {
-                Map<String, Object> map = productDao.getProductTypeNameAndID(Integer.valueOf(id));
-                ProductCustomClassification obj = new ProductCustomClassification();
-                obj.setProductID(productID);
-                obj.setBigTypeID(Integer.valueOf(map.get("bigTypeID").toString()));
-                obj.setSmallTypeID(Integer.valueOf(map.get("smallTypeID").toString()));
-                obj.setTinyTypeID(Integer.valueOf(map.get("tinyTypeID").toString()));
-                obj.setCreateDate(new Date());
-                obj.setUpdateDate(new Date());
-                productDao.insertCustomClassification(obj);
-            }
-            return JsonModel.newInstance().success();
-        } catch (Exception e) {
-            throw e;
-        }
-    }
-
-    public Page<Product> relatedProductList(Page<Product> page, Product product) {
-        product.setPage(page);
-        page.setList(productDao.relatedProductList(product));
-        return page;
-    }
-
-    public void deleteProductCustomClassification(Integer productID, Integer tinyTypeID) throws Exception {
-        try {
-            productDao.deleteProductCustomClassification(productID, tinyTypeID);
-        } catch (Exception e) {
-            e.printStackTrace();
-            throw e;
-        }
-
-    }
-
-    public Page<Product> toAddProductCustomClassificationList(Page<Product> page, Product product) {
-        product.setPage(page);
-        page.setList(productDao.toAddProductCustomClassificationList(product));
-        for (Product p : page.getList()) {
-            Map<String, Object> map = productDao.getProductTypeNameAndID(p.getTinyTypeID());
-            String s = map.get("bigTypeName").toString() + "-" + map.get("smallTypeName").toString() + map.get("tinyTypeName").toString();
-            p.setDefaultTypeName(s);
-        }
-        return page;
-    }
-
     public Page<Product> toAddProductList(Page<Product> page, Product product) {
         product.setPage(page);
         page.setList(productDao.toAddProductList(product));
         return page;
     }
 
-    public void addProductCustomClassification(Integer productID, Integer tinyTypeID) {
-        Map<String, Object> map = productDao.getProductTypeNameAndID(tinyTypeID);
-        ProductCustomClassification obj = new ProductCustomClassification();
-        obj.setProductID(productID);
-        obj.setBigTypeID(Integer.valueOf(map.get("bigTypeID").toString()));
-        obj.setSmallTypeID(Integer.valueOf(map.get("smallTypeID").toString()));
-        obj.setTinyTypeID(Integer.valueOf(map.get("tinyTypeID").toString()));
-        obj.setCreateDate(new Date());
-        obj.setUpdateDate(new Date());
-        productDao.insertCustomClassification(obj);
-    }
-
     public void addProduct(Integer productID, Integer tinyTypeID) {
         productDao.insertAddProduct(productID, tinyTypeID);
     }
@@ -256,17 +184,6 @@ public class ProductService extends CrudService<ProductDao, Product> {
         productDao.deleteProduct(id, DateTime);
     }
 
-    public List<ProductCustomClassification> getProductTypes(Integer productID) {
-        return productDao.getProductTypes(productID);
-    }
-
-    public Page<Product> findRecommendActivityListPage(Page<Product> productPage, Product product) {
-        product.setPage(productPage);
-        List<Product> list = productDao.findRecommendActivityListPage(product);
-        return productPage.setList(list);
-
-    }
-
     public List<ProductBigType> findBigTypeList(ProductBigType productBigType) {
         return productDao.findBigTypeList(productBigType);
     }

+ 0 - 27
src/main/java/com/caimei/modules/product/web/ProductActController.java

@@ -2,7 +2,6 @@ package com.caimei.modules.product.web;
 
 import com.caimei.modules.product.dao.ProductDao;
 import com.caimei.modules.product.entity.Product;
-import com.caimei.modules.product.entity.ProductCustomClassification;
 import com.caimei.modules.product.service.*;
 import com.caimei.utils.AppUtils;
 import com.google.common.collect.Maps;
@@ -41,8 +40,6 @@ public class ProductActController extends BaseController {
     private ProductService productService;
     @Autowired
     private ProductDao productDao;
-    @Resource
-    private ProductCustomClassificationService productCustomClassificationService;
 
     @ModelAttribute
     public Product get(@RequestParam(required = false) String id) {
@@ -63,31 +60,7 @@ public class ProductActController extends BaseController {
         List<Product> list = page.getList();
         if(CollectionUtils.isNotEmpty(list)){
             for(Product p :list){
-//                String actStatus= p.getActStatus();
-//                if(null != actStatus && StringUtils.equals("1",actStatus)){//活动商品
-//                    Date beginTime = p.getBeginTime();
-//                    Date endTime = p.getEndTime();
-//                    Date now = new Date();
-//                    //活动状态 1:即将开始 2:进行中 3:已结束
-//                    if(null != beginTime && null != endTime && (endTime.getTime() > beginTime.getTime() ) && (beginTime.getTime() > now.getTime())){//活动开始时间小于当前时间
-//                        // 即将开始
-//                        p.setActStatus("1");
-//                    }
-//                    if(null != beginTime && null != endTime && (now.getTime() > endTime.getTime()) && (endTime.getTime() > beginTime.getTime())) {//活动结束时间小于结束时间
-//                        // 已结束
-//                        p.setActStatus("3");
-//                    }
-//                    if(null != beginTime && null != endTime && (endTime.getTime() > now.getTime() ) && (beginTime.getTime() < now.getTime())) { //当前时间小于活动开始,小于活动结束时间
-//                        //进行中
-//                        p.setActStatus("2");
-//                    }
-//                }
                 p.setMainImage(AppUtils.getImageURL("product", p.getMainImage(), 0, ""));
-                //自定义分类
-                List<ProductCustomClassification> typeList = productCustomClassificationService.findCustomClassification(Integer.valueOf(p.getId()));
-                if (CollectionUtils.isNotEmpty(typeList)) {
-                    p.setCustomClass(true); // 有自定义分类
-                }
             }
         }
         model.addAttribute("page", page);

+ 2 - 785
src/main/java/com/caimei/modules/product/web/ProductController.java

@@ -66,16 +66,8 @@ public class ProductController extends BaseController{
     private BuyerProductHistoryPriceService buyerProductHistoryPriceService;
     @Autowired
     private ProductDao productDao;
-    @Resource
-    private CmProductRecommendService cmProductRecommendService;
     @Autowired
     private CmUserOrganizeService cmUserOrganizeService;
-    @Resource
-    private ProductCustomClassificationService productCustomClassificationService;
-	@Autowired
-	private AreaService areaService;
-    @Autowired
-    private CmMallProductLadderPriceDao cmMallProductLadderPriceDao;
 
     @ModelAttribute
     public Product get(@RequestParam(required=false) String id) {
@@ -102,9 +94,7 @@ public class ProductController extends BaseController{
     public String productPageMulti(Product product,String type,HttpServletRequest request, HttpServletResponse response, Model model) {
         if(StringUtils.equals(type, "homeProduct")){
             product.getSqlMap().put("dsf", " AND productID NOT IN (SELECT productID FROM crm_home_product b WHERE b.productId=a.productID) ");
-        }/*else if(StringUtils.equals(type, "smallType")){
-            model.addAttribute("crmSmallTypeId", product.getCrmSmallTypeId());
-        }*/
+        }
         Page<Product> page = productService.findPage(new Page<Product>(request, response), product);
         model.addAttribute("type", type);
         model.addAttribute("page", page);
@@ -118,30 +108,7 @@ public class ProductController extends BaseController{
         List<Product> list = page.getList();
         if(CollectionUtils.isNotEmpty(list)){
             for(Product p :list){
-                String actFlag = p.getActFlag();
-//                if(null != actFlag && StringUtils.equals("1",actFlag)){//活动商品
-//                    Date beginTime = p.getBeginTime();
-//                    Date endTime = p.getEndTime();
-//                    Date now = new Date();
-//                    //活动状态 1:即将开始 2:进行中 3:已结束
-//                    if(null != beginTime && null != endTime && (endTime.getTime() > beginTime.getTime() ) && (beginTime.getTime() > now.getTime())){//活动开始时间小于当前时间
-//                        // 即将开始
-//                        p.setActStatus("1");
-//                    }
-//                    if(null != beginTime && null != endTime && (now.getTime() > endTime.getTime()) && (endTime.getTime() > beginTime.getTime())) {//活动结束时间小于结束时间
-//                        // 已结束
-//                        p.setActStatus("3");
-//                    }
-//                    if(null != beginTime && null != endTime && (endTime.getTime() > now.getTime() ) && (beginTime.getTime() < now.getTime())) { //当前时间小于活动开始,小于活动结束时间
-//                        //进行中
-//                        p.setActStatus("2");
-//                    }
-//                }
                 p.setMainImage(AppUtils.getImageURL("product", p.getMainImage(), 0, ""));
-                //自定义分类
-                List<ProductCustomClassification> typeList = productCustomClassificationService.findCustomClassification(Integer.valueOf(p.getId()));
-                if (CollectionUtils.isNotEmpty(typeList))
-                    p.setCustomClass(true); // 有自定义分类
             }
         }
 
@@ -149,134 +116,6 @@ public class ProductController extends BaseController{
         return "modules/product/productList";
     }
 
-/*    @RequiresPermissions("product:product:view")
-    @RequestMapping("activity/list")
-    public String actlist(Product product, HttpServletRequest request, HttpServletResponse response, Model model) {
-        Page<Product> page = productService.findActListPage(new Page<Product>(request, response), product);
-        List<Product> list = page.getList();
-        if(CollectionUtils.isNotEmpty(list)){
-            for(Product p :list){
-                String actStatus= p.getActStatus();
-                if(null != actStatus && StringUtils.equals("1",actStatus)){//活动商品
-                    Date beginTime = p.getBeginTime();
-                    Date endTime = p.getEndTime();
-                    Date now = new Date();
-                    //活动状态 1:即将开始 2:进行中 3:已结束
-                    if(null != beginTime && null != endTime && (endTime.getTime() > beginTime.getTime() ) && (beginTime.getTime() > now.getTime())){//活动开始时间小于当前时间
-                        // 即将开始
-                        p.setActStatus("1");
-                    }
-                    if(null != beginTime && null != endTime && (now.getTime() > endTime.getTime()) && (endTime.getTime() > beginTime.getTime())) {//活动结束时间小于结束时间
-                        // 已结束
-                        p.setActStatus("3");
-                    }
-                    if(null != beginTime && null != endTime && (endTime.getTime() > now.getTime() ) && (beginTime.getTime() < now.getTime())) { //当前时间小于活动开始,小于活动结束时间
-                        //进行中
-                        p.setActStatus("2");
-                    }
-                }
-                p.setMainImage(AppUtils.getImageURL("product", p.getMainImage(), 0, ""));
-                //自定义分类
-                List<ProductCustomClassification> typeList = productCustomClassificationService.findCustomClassification(Integer.valueOf(p.getId()));
-                if (CollectionUtils.isNotEmpty(typeList)) {
-                    p.setCustomClass(true); // 有自定义分类
-                }
-            }
-        }
-        model.addAttribute("page", page);
-        return "modules/product/actList";
-    }
-
-    @RequiresPermissions("product:product:view")
-    @RequestMapping("activity/addPage")
-    public String addActPage(Product product, Model model) {
-        model.addAttribute("product", product);
-        return "modules/product/addActPage";
-    }
-
-    @RequestMapping(value = "activity/toAdd")
-    public String toAddProduct3(Product product, Page page, Model model, HttpServletRequest request, HttpServletResponse response) {
-        page = productService.findPage(new Page<Product>(request, response), product);
-        model.addAttribute("page", page);
-        return "modules/product/actSelectProduct";
-    }
-
-    @ResponseBody
-    @RequestMapping(value = "activity/saveTemp")
-    public Map<String, Object> saveTemp() {
-        Map<String, Object> map = Maps.newLinkedHashMap();
-        map.put("success", true);
-        map.put("msg", "添加成功");
-        return map;
-    }
-
-
-    @RequiresPermissions("product:product:view")
-    @RequestMapping("activity/saveAdd")
-    public String addActProduct(Product product){
-        try {
-            Product actProduct = new Product();
-            actProduct.setId(product.getId());
-            actProduct.setProductID(product.getProductID());
-            actProduct.setActStatus("1");
-            actProduct.setActPrice1(product.getActPrice1());
-            actProduct.setBeginTime(product.getBeginTime());
-            actProduct.setEndTime(product.getEndTime());
-            productDao.updateActive(actProduct);
-            return "redirect:"+ Global.getAdminPath()+"/product/activity/list";
-        } catch (Exception e) {
-            logger.debug(e.toString(), e);
-            return "redirect:"+ Global.getAdminPath()+"/product/activity/addPage";
-        }
-    }
-
-    @RequiresPermissions("product:product:view")
-    @RequestMapping("activity/delete")
-    public  String addActProduct(Integer id){
-        try {
-            Product actProduct = new Product();
-            actProduct.setId(id.toString());
-            actProduct.setProductID(id);
-            actProduct.setActStatus("0");
-            *//*actProduct.setActPrice1(null);
-            actProduct.setBeginTime(null);
-            actProduct.setEndTime(null);*//*
-            productDao.updateActive(actProduct);
-        } catch (Exception e) {
-            logger.debug(e.toString(), e);
-        }
-        return "redirect:"+ Global.getAdminPath()+"/product/activity/list";
-    }*/
-
-    /*@ResponseBody
-    @RequestMapping(value = {"/addPreferred"})
-    public Map<String, Object> addPreferred(Integer productId, Integer preferredFlag) {
-        Map<String, Object> map = Maps.newLinkedHashMap();
-        try {
-            Product product = new Product();
-            product.setProductID(productId);
-            product.setPreferredFlag(preferredFlag);
-            productService.updatePreferred(product);
-            map.put("success", true);
-            map.put("msg", "操作成功");
-        } catch (Exception e) {
-            logger.debug(e.toString(), e);
-            map.put("success", false);
-            map.put("msg", "操作失败");
-        }
-        return map;
-    }*/
-
-    /*@RequestMapping(value = {"/preferredPage"})
-    public String preferredPage(CmPageModules cmPageModules, Model model) {
-        CmPageModules modules =  cmUserOrganizeService.getCmPageModulesInfoByOrganizeID(cmPageModules.getOrganizeID(), null);
-        //获取组织列表
-        List<CmUserOrganize> cmUserOrganizeList = cmUserOrganizeService.findList(new CmUserOrganize());
-        model.addAttribute("cmUserOrganizeList", cmUserOrganizeList);
-        model.addAttribute("cmPageModules", modules);
-        return "modules/applets/setHomePage";
-    }*/
-
     @RequestMapping(value = "saveUserOrganizeModules")
     public String saveUserOrganizeModules(CmPageModules cmPageModules, Model model, HttpServletRequest request, HttpServletResponse response) {
         Integer organizeID = cmPageModules.getOrganizeID();
@@ -322,38 +161,6 @@ public class ProductController extends BaseController{
         return "redirect:"+ Global.getAdminPath()+"/product/new/list";
     }
 
-/*    @RequiresPermissions("product:product:view")
-    @RequestMapping(value = "productEdit")
-    public String editProduct(Product product, Model model) {
-        if( null != product.getProductID()){
-            ProductDetailInfo productDetailInfo = productService.getProductDetailInfo(product.getProductID());
-            List<ProductLadderPrice> ladderPriceList = productService.findLadderPrice(product.getProductID());
-            if (null != productDetailInfo) {
-                product.setDetailInfo(productDetailInfo.getDetailInfo());
-                product.setServiceInfo(productDetailInfo.getServiceInfo());
-                product.setOrderInfo(productDetailInfo.getOrderInfo());
-            }
-            product.setLadderPriceList(ladderPriceList);
-        }
-        List<CmBrand> brandList = productService.findBrandList();
-        Map<String, Object> classify = productService.findClassify(1);
-        List<Province> provinceList = areaService.loadProvince();
-        model.addAttribute("brandList", brandList);
-        model.addAttribute("classify", classify);
-		model.addAttribute("provinceList", provinceList);
-        model.addAttribute("product", product);
-        return "modules/product/productEdit";
-    }*/
-
-    /*@RequiresPermissions("product:product:edit")
-    @RequestMapping(value = "productSave")
-    public String productSave(Product product, ProductDetailInfo productDetailInfo, RedirectAttributes redirectAttributes) {
-    	productDetailInfo.setProductID(product.getProductID());
-        productService.saveProduct(product, productDetailInfo);
-        addMessage(redirectAttributes, "保存商品成功");
-        return "redirect:" + Global.getAdminPath() + "/product/list/";
-    }*/
-
     @RequiresPermissions("product:product:view")
     @RequestMapping(value = "form")
     public String form(Product product, Model model) {
@@ -731,30 +538,6 @@ public class ProductController extends BaseController{
         return "modules/bulkpurchase/productRedPriceList";
     }
 
-    /**
-     * 商品参加活动
-     * @param product
-     * @param model
-     * @return
-     */
-    @RequiresPermissions("product:product:view")
-    @RequestMapping(value = "joinAct")
-    public String joinAct(Product product, Model model) {
-        model.addAttribute("product", product);
-//        Date beginTime = product.getBeginTime();
-//        Date endTime = product.getEndTime();
-//        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-//        if(null != beginTime && null != endTime){
-//            String beginTimeStr = sdf.format(beginTime);
-//            String endTimeStr = sdf.format(endTime);
-//            product.setBeginTimeStr(beginTimeStr);
-//            product.setEndTimeStr(endTimeStr);
-//        }
-        List<ActType> actTypeList = productService.getAllActType();
-        model.addAttribute("actTypeList", actTypeList);
-        return "modules/product/productJoinActForm";
-    }
-
     /**
      * 取消商品参加活动	 * @param product
      * @return
@@ -984,338 +767,6 @@ public class ProductController extends BaseController{
         return jsonModel;
     }
 
-
-//    /**
-//     * 参加{买赠,买送,满减}活动
-//     * @param param 包含(活动类型:actType(1:满赠、2:买赠、3满减、4表示团购、5:热卖)、fullGiftProductId(参与活动商品ID))
-//     *              开始时间beginTime  结束时间endTime 市1:满赠、2:买赠、3满减场价normalPrice 活动普通价actPrice0   活动会员价actPrice1  满金额fullAmount   减金额reduceAmount
-//     *              满数量fullNumber  赠送商品giftProducts(格式[{"id":1,"num":80},{"id":2,"num":100}])
-//     * @return
-//     */
-//    @ResponseBody
-//    @RequestMapping("joinActivity")
-//    public JsonModel joinActivity(String param) {
-//        JsonModel jsonModel=new JsonModel();
-//        if (com.caimei.utils.StringUtils.isBlank(param)) {
-//            jsonModel.error(CodeMsg.PARAMETER_NULL_ERRO.getCode(), CodeMsg.PARAMETER_NULL_ERRO.getMsg());
-//            return jsonModel;
-//        }
-//        Map<String, Object> map = Maps.newHashMap();
-//        try {
-//            map = (Map<String, Object>) JsonMapper.getInstance().fromJsonString(param, Map.class);
-//            if (MapUtils.isEmpty(map)) {
-//                jsonModel.error("参数不能为空");
-//                return jsonModel;
-//            }
-//            if(null==map.get("actType")|| StringUtils.isEmpty(String.valueOf(map.get("actType")))){
-//                jsonModel.error("活动类型 参数为空");
-//                return jsonModel;
-//            }
-//            if(null==map.get("fullGiftProductId")|| StringUtils.isEmpty(String.valueOf(map.get("fullGiftProductId")))){
-//                jsonModel.error("商品ID参数为空");
-//                return jsonModel;
-//            }
-//            if(null==map.get("beginTime") || StringUtils.isEmpty(String.valueOf(map.get("beginTime")))){
-//                jsonModel.error("开始时间参数为空");
-//                return jsonModel;
-//            }
-//            if(null==map.get("endTime")|| StringUtils.isEmpty(String.valueOf(map.get("endTime")))){
-//                jsonModel.error("结束时间参数为空");
-//                return jsonModel;
-//            }
-//            if(null==map.get("normalPrice")|| StringUtils.isEmpty(String.valueOf(map.get("normalPrice")))){
-//                jsonModel.error("市场价参数为空");
-//                return jsonModel;
-//            }
-//            if(null==map.get("actPrice0")|| StringUtils.isEmpty(String.valueOf(map.get("actPrice0")))){
-//                jsonModel.error("普通价参数为空");
-//                return jsonModel;
-//            }
-//            if(null==map.get("actPrice1") || StringUtils.isEmpty(String.valueOf(map.get("actPrice1")))){
-//                jsonModel.error("会员价参数为空");
-//                return jsonModel;
-//            }
-//            Integer actType = (Integer)map.get("actType");
-//            Integer fullGiftProductId = Integer.parseInt(map.get("fullGiftProductId").toString());
-//
-//            SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
-//            String start = map.get("beginTime") +" 00:00:00";
-//            String end = map.get("endTime") +" 23:59:59";
-//            Date beginTime=sdf.parse(start);
-//            Date endTime=sdf.parse(end);
-//            Float normalPrice = Float.parseFloat(map.get("normalPrice").toString());
-//            Float actPrice0 = Float.parseFloat(map.get("actPrice0").toString());
-//            Float actPrice1 = Float.parseFloat(map.get("actPrice1").toString());
-//
-//            Product productInfo = productService.get(String.valueOf(fullGiftProductId));
-//            if("1".equals(actType.toString())){//1满赠
-//                Product product = productInfo;
-//                if(null==map.get("fullAmount") || StringUtils.isEmpty(String.valueOf(map.get("fullAmount")))){
-//                    jsonModel.error("满含金额为空");
-//                    return jsonModel;
-//                }
-////                Float fullAmount = Float.parseFloat(map.get("fullAmount").toString());
-////                product.setActFullGiftAmount(fullAmount);
-//                //保存商品参加活动信息
-//                saveJoinActivity(product,productInfo,actType,beginTime,endTime,normalPrice,actPrice0,actPrice1,fullGiftProductId);
-//                //保存赠送商品信息
-//                if (null == map.get("giftProducts") || StringUtils.isEmpty(String.valueOf(map.get("giftProducts")))) {
-//                    jsonModel.error("赠送商品不能为空");
-//                    return jsonModel;
-//                }
-//                List<Map<String,Object>> products = (List<Map<String, Object>>) map.get("giftProducts");//需要赠送的商品
-//                for (Map<String,Object> m:products) {
-//                    Integer giftProductId = Integer.parseInt(m.get("id").toString());
-//                    Integer giftProductNum = Integer.parseInt(m.get("num").toString());
-//                    jsonModel = savejoinProductGift(String.valueOf(actType), fullGiftProductId, giftProductId, giftProductNum);
-//                    if("1".equals(jsonModel.getErrcode())){
-//                        //存在异常
-//                        return jsonModel;
-//                    }
-//                }
-//            }else if("2".equals(actType.toString())){//2买赠
-//                Product product = productInfo;;
-//                if(null==map.get("fullNumber")  || StringUtils.isEmpty(String.valueOf(map.get("fullNumber")))){
-//                    jsonModel.error("满送数量为空");
-//                    return jsonModel;
-//                }
-//                Integer fullNumber = Integer.parseInt(map.get("fullNumber").toString());
-//                product.setActBuyGiftNum(fullNumber);
-//                //保存商品参加活动信息
-//                saveJoinActivity(product,productInfo,actType,beginTime,endTime,normalPrice,actPrice0,actPrice1,fullGiftProductId);
-//                //保存赠送商品信息
-//                if (null == map.get("giftProducts") || StringUtils.isEmpty(String.valueOf(map.get("giftProducts")))) {
-//                    jsonModel.error("赠送商品不能为空");
-//                    return jsonModel;
-//                }
-//                List<Map<String,Object>> products = (List<Map<String, Object>>) map.get("giftProducts");//需要赠送的商品
-//                for (Map<String,Object> m:products) {
-//                    Integer giftProductId = Integer.parseInt(m.get("id").toString());
-//                    Integer giftProductNum = Integer.parseInt(m.get("num").toString());
-//                    jsonModel = savejoinProductGift(String.valueOf(actType), fullGiftProductId, giftProductId, giftProductNum);
-//                    if("1".equals(jsonModel.getErrcode())){
-//                        //存在异常
-//                        return jsonModel;
-//                    }
-//                }
-//            }else if("3".equals(actType.toString())){//3满减
-//                if(null==map.get("reduceAmount")|| StringUtils.isEmpty(String.valueOf(map.get("reduceAmount")))){
-//                    jsonModel.error("满减金额为空");
-//                    return jsonModel;
-//                }
-//                if(null==map.get("fullAmount")|| StringUtils.isEmpty(String.valueOf(map.get("fullAmount")))){
-//                    jsonModel.error("满减金额为空");
-//                    return jsonModel;
-//                }
-//                Float reduceAmount = Float.parseFloat(map.get("reduceAmount").toString());
-//                Float fullAmount = Float.parseFloat(map.get("fullAmount").toString());
-//                Product product = productInfo;
-//                product.setActFullReduceAmount(fullAmount);//满减金额(达到该金额后可享直减)--满减
-//                product.setActReduceAmount(reduceAmount);//购买直减金额(达到满金额后)
-//                //保存商品参加活动信息
-//                saveJoinActivity(product,productInfo,actType,beginTime,endTime,normalPrice,actPrice0,actPrice1,fullGiftProductId);
-//            }else if("4".equals(actType.toString())){//表示团购
-//                Product product = productInfo;
-//                //保存商品参加活动信息
-//                saveJoinActivity(product,productInfo,actType,beginTime,endTime,normalPrice,actPrice0,actPrice1,fullGiftProductId);
-//
-//
-//            }else if("5".equals(actType.toString())){//表示热卖
-//                Product product = productInfo;
-//                //保存商品参加活动信息
-//                saveJoinActivity(product,productInfo,actType,beginTime,endTime,normalPrice,actPrice0,actPrice1,fullGiftProductId);
-//
-//            }else{
-//                jsonModel.error("活动类型错误");
-//                return jsonModel;
-//            }
-//            jsonModel.success();
-//        }catch (Exception e){
-//            jsonModel.error(CodeMsg.COMMON_ERRO.getCode(),CodeMsg.COMMON_ERRO.getMsg());
-//            logger.error(e.toString(),e);
-//        }
-//        return jsonModel;
-//    }
-//
-
-//    /**
-//     * 满减、满赠、买赠 通用方法
-//     * @param product
-//     * @param productInfo
-//     * @param actType 1:满赠、2:买赠、3满减、4团购、5热卖
-//     * @param beginTime
-//     * @param endTime
-//     * @param normalPrice
-//     * @param actPrice0
-//     * @param actPrice1
-//     * @param fullGiftProductId
-//     */
-//    public void saveJoinActivity(Product product, Product productInfo, Integer actType, Date beginTime, Date endTime, Float normalPrice, Float actPrice0, Float actPrice1, Integer fullGiftProductId){
-//        //活动类型(1000热卖  1001团购  1002分期  1003满减   1004满增  1005买增)
-//        if("1".equals(actType.toString())){
-//            product.setActType("1004");
-//        }
-//        if("2".equals(actType.toString())){
-//            product.setActType("1005");
-//        }
-//        if("3".equals(actType.toString())){
-//            product.setActType("1003");
-//        }
-//        if("4".equals(actType.toString())){
-//            product.setActType("1001");
-//        }
-//        if("5".equals(actType.toString())){
-//            product.setActType("1000");
-//        }
-//        product.setActFlag("1");//是否活动商品:1是,空或0不是
-////		product.setValidFlag(ProductStatus.WAIT_CHECK.getCode());
-//        product.setBeginTime(beginTime);
-//        product.setEndTime(endTime);
-//        product.setNormalPrice(normalPrice);
-//        product.setActPrice0(actPrice0);
-//        product.setActPrice1(actPrice1);
-//        product.setUpdateTime(DateUtils.getDate());
-//
-//        //保存商品价格修改记录
-//        ProductPriceRecord record = new ProductPriceRecord();
-//        if(null != productInfo && actPrice0.equals(productInfo.getPrice0()) && actPrice1.equals(productInfo.getPrice1())) {
-//            record = null;
-//        } else {
-//            Product p = productService.get(String.valueOf(fullGiftProductId));
-//            record.setPrice0(actPrice0);
-//            record.setPrice1(actPrice1);
-//            record.setShopID(productInfo.getShopID());
-//            record.setUpdateTime(DateUtils.getDate());
-//            record.setProductID(fullGiftProductId);
-//        }
-//        //保存加入购物车
-//        productService.save(product);
-//        if(record != null) {
-//            productService.insertProductPriceRecord(record);
-//        }
-//    }
-
-
-//    /**
-//     * 保存赠送商品公用方法
-//     * @param actType actType  活动类型,1:满赠、2:买赠
-//     * @param fullGiftProductId 参与满、买赠商品ID
-//     * @param giftProductId  赠送商品ID
-//     * @Param giftProductNum 赠送商品数量
-//     * @return
-//     */
-//    public JsonModel savejoinProductGift(String actType,Integer fullGiftProductId,Integer giftProductId,Integer giftProductNum) {
-//        JsonModel jsonModel=new JsonModel();
-//        try{
-//            Product productInfo = productService.get(String.valueOf(giftProductId));
-//            GiftProduct giftProduct = new GiftProduct();//需要通过满赠、活动类型、赠送商品ID来唯一确认(标记删除也需要)
-//            giftProduct.setActType(actType);
-//            giftProduct.setFullGiftProductId(fullGiftProductId);
-//            giftProduct.setGiftProductId(giftProductId);
-//            List<GiftProduct> giftProductInfo = productService.getGiftProductInfo(giftProduct);
-//            if(CollectionUtils.isNotEmpty(giftProductInfo) && giftProductInfo.size() == 1){
-//                //执行更新
-//                giftProduct = giftProductInfo.get(0);
-//                if(null != productInfo){
-//                    giftProduct.setProductName(productInfo.getName());
-//                }
-//
-//                giftProduct.setGiftProductNum(giftProductNum);
-//                giftProduct.setUpdateBy(UserUtils.getUser());
-//                giftProduct.setUpdateDate(new Date());
-//                giftProduct.setDelFlag("0");//存在更新标记删除的,复用删除数据
-//                //保存数据
-//                productService.updateGiftProudct(giftProduct);
-//
-//            }else if(CollectionUtils.isEmpty(giftProductInfo)){
-//                //执行插入
-//                if(null != productInfo){
-//                    giftProduct.setProductName(productInfo.getName());
-//                }
-//                giftProduct.setGiftProductNum(giftProductNum);
-//                giftProduct.setCreateBy(UserUtils.getUser());
-//                giftProduct.setCreateDate(new Date());
-//                giftProduct.setUpdateBy(UserUtils.getUser());
-//                giftProduct.setUpdateDate(new Date());
-//                giftProduct.setDelFlag("0");
-//                //保存数据
-//                productService.insertGiftProudct(giftProduct);
-//            }else{
-//                jsonModel.error("赠品信息异常");
-//                return jsonModel;
-//            }
-//            jsonModel.success();
-//        }catch (Exception e){
-//            jsonModel.error(CodeMsg.COMMON_ERRO.getCode(),CodeMsg.COMMON_ERRO.getMsg());
-//            logger.error(e.toString(),e);
-//        }
-//        return jsonModel;
-//    }
-
-
-//    /**
-//     * 移除赠送商品
-//     * @param actType  活动类型,1:满赠、2:买赠
-//     * @param fullGiftProductId  满赠商品的ID
-//     * @param giftProductId 赠送商品的ID
-//     * @return
-//     */
-//    @ResponseBody
-//    @RequestMapping("joinActProductInfo")
-//    public JsonModel joinActProductInfo(String actType,Integer fullGiftProductId,Integer giftProductId) {
-//        JsonModel jsonModel=new JsonModel();
-//        com.thinkgem.jeesite.modules.sys.entity.User user = UserUtils.getUser();
-//        try{
-//            Product productInfo = productService.get(String.valueOf(giftProductId));
-//            GiftProduct giftProduct = new GiftProduct();//需要通过满赠、活动类型、赠送商品ID来唯一确认(标记删除也需要)
-//            giftProduct.setActType(actType);
-//            giftProduct.setFullGiftProductId(fullGiftProductId);
-//            giftProduct.setGiftProductId(giftProductId);
-//            List<GiftProduct> giftProductInfo = productService.getGiftProductInfo(giftProduct);
-//            if(CollectionUtils.isNotEmpty(giftProductInfo) && giftProductInfo.size() == 1){
-//                //执行更新
-//                giftProduct = giftProductInfo.get(0);
-//                giftProduct.setUpdateBy(UserUtils.getUser());
-//                giftProduct.setUpdateDate(new Date());
-//                giftProduct.setDelFlag(DateUtils.getDateTime());//标记暂时移除
-//                //保存数据
-//                productService.updateGiftProudct(giftProduct);
-//            }
-//            jsonModel.success();
-//        }catch (Exception e){
-//            jsonModel.error(CodeMsg.COMMON_ERRO.getCode(),CodeMsg.COMMON_ERRO.getMsg());
-//            logger.error(e.toString(),e);
-//        }
-//        return jsonModel;
-//    }
-
-//    /**
-//     * 1开启 0 不启用
-//     * @param enabledStatus
-//     * @param ids
-//     * @param supplierIDs
-//     * @param request
-//     * @param response
-//     * @return
-//     */
-//    @RequiresPermissions("product:product:edit")
-//    @ResponseBody
-//    @RequestMapping(value="updateCRMFlag")
-//    public Map<String, Object> updateCRMFlag(String enabledStatus, String[] ids, String [] supplierIDs, HttpServletRequest request, HttpServletResponse response){
-//        Map<String, Object> map = Maps.newLinkedHashMap();
-//        try {
-//            productService.updateCRMFlag(enabledStatus,ids);
-//            map.put("success",true);
-//            map.put("msg", "修改成功");
-//        } catch (Exception e) {
-//            logger.debug(e.toString(),e);
-//            map.put("success",false);
-//            map.put("msg", "修改失败");
-//        }
-//        return map;
-//    }
-
-
     /**
      * 是否包邮 0包邮 1不包邮
      * @param enabledStatus
@@ -1359,27 +810,6 @@ public class ProductController extends BaseController{
         return map;
     }
 
-
-    @ResponseBody
-    @RequestMapping(value="getBigTypeList")
-    public JsonModel getBigTypeList(Integer bigTypeID, Integer productID) {
-        JsonModel jsonModel = JsonModel.newInstance();
-        List<ProductBigType> data = productService.getBigTypeList(bigTypeID);
-        if (productID != null) {
-            List<ProductCustomClassification> types = productService.getProductTypes(productID);
-            for (ProductCustomClassification p : types) {
-                for (ProductBigType b : data) {
-                    if (p.getBigTypeID().intValue() == b.getBigTypeID()) {
-                        b.setCheck(true);
-                    }
-                }
-            }
-        }
-        return jsonModel.success(data);
-    }
-
-
-
     @ResponseBody
     @RequestMapping(value="getProductTypeNameAndID")
     public JsonModel getProductTypeNameAndID(Integer tinyTypeID) {
@@ -1388,147 +818,11 @@ public class ProductController extends BaseController{
         return jsonModel.success(data);
     }
 
-    /** request params ====>  {id: productID, typeIDs : 1_2_3_4.....自定义分类不能超过5个}
-     * @param product 商品
-     * @param typeIDs  最小分类的 tinyID
-     * @return
-     */
-    @ResponseBody
-    @RequestMapping(value="editProductCustomClassification")
-    public JsonModel editProductCustomClassification(Product product, String typeIDs) {
-        logger.info("typeIDs: " + typeIDs);
-        JsonModel jsonModel = JsonModel.newInstance();
-        if (product.getId() == null)
-            return jsonModel.error("商品不存在");
-        if (StringUtils.isEmpty(typeIDs)) {
-            return jsonModel.error("分类信息异常");
-        }
-        String[] ids = typeIDs.split("_");
-        List<String> list = new ArrayList<>();
-        for (String s : ids) {
-            if (!list.contains(s) && !"".equals(s))
-                list.add(s);
-        }
-        ids = list.toArray(new String[list.size()]);
-        if (ids.length > 5) {
-            return jsonModel.error("自定义分类不能超过5个");
-        }
-        try {
-            jsonModel = productService.editProductCustomClassification(Integer.valueOf(product.getId()), ids);
-        } catch (Exception e){
-            jsonModel.error("数据异常");
-        }
-        return jsonModel;
-    }
-
-    @ResponseBody
-    @RequestMapping(value="getSmallTypeList")
-    public JsonModel getSmallTypeList(Integer bigTypeID, Integer smallTypeID, Integer productID) {
-        JsonModel jsonModel = JsonModel.newInstance();
-        List<ProductSmallType> data = productService.getSmallTypeList(bigTypeID, smallTypeID);
-        if (productID != null) {
-            List<ProductCustomClassification> types = productService.getProductTypes(productID);
-            for (ProductCustomClassification p : types) {
-                for (ProductSmallType b : data) {
-                    if (p.getSmallTypeID().intValue() == b.getSmallTypeID()) {
-                        b.setCheck(true);
-                    }
-                }
-            }
-        }
-        return jsonModel.success(data);
-    }
-
-    @ResponseBody
-    @RequestMapping(value="getTinyTypeList")
-    public JsonModel getTinyTypeList(Integer smallTypeID, Integer tinyTypeID, Integer productID) {
-        JsonModel jsonModel = JsonModel.newInstance();
-        List<ProducTinyType> data = productService.getTinyTypeList(smallTypeID, tinyTypeID);
-        if (productID != null) {
-            List<ProductCustomClassification> types = productService.getProductTypes(productID);
-            for (ProductCustomClassification p : types) {
-                for (ProducTinyType b : data) {
-                    if (p.getTinyTypeID().intValue() == b.getTinyTypeID()) {
-                        b.setCheck(true);
-                    }
-                }
-            }
-        }
-        return jsonModel.success(data);
-    }
-
-    /**
-     * 最小分类的相关商品
-     * @return
-     */
-    @RequestMapping(value="relatedProductList")
-    public String relatedProductList(Product product, HttpServletRequest request, HttpServletResponse response, Model model) {
-        Page<Product> page = productService.relatedProductList(new Page<Product>(request, response), product);
-        if(null!= page && null != page.getList()){
-            List<Product> list = page.getList();
-            for(Product p:list){
-                p.setMainImage(AppUtils.getImageURL("product", p.getMainImage(), 0, ""));
-            }
-        }
-        model.addAttribute("page", page);
-        model.addAttribute("tinyTypeID", product.getTinyTypeID());
-        return "modules/product/relatedProductList";
-    }
-
-    /**
-     * 删除自定义分类  params productID tinyTypeID
-     * @return
-     */
-    @ResponseBody
-    @RequestMapping(value="deleteProductCustomClassification")
-    public JsonModel deleteProductCustomClassification(Integer productID, Integer tinyTypeID) {
-        JsonModel jsonModel = JsonModel.newInstance();
-        try{
-            productService.deleteProductCustomClassification(productID, tinyTypeID);
-            jsonModel.success();
-        } catch (Exception e){
-            jsonModel.error("数据异常");
-        }
-        return jsonModel;
-    }
-
-    /**
-     * 细分类下 添加自定义分类商品的商品选择列表
-     * @return
-     */
-    @ResponseBody
-    @RequestMapping(value="toAddProductCustomClassificationList")
-    public JsonModel toAddProductCustomClassificationList(Product product, Model model, HttpServletRequest request, HttpServletResponse response) {
-        JsonModel jsonModel = JsonModel.newInstance();
-        Page<Product> page = productService.toAddProductCustomClassificationList(new Page<Product>(request, response), product);
-        if(null!= page && null != page.getList()){
-            List<Product> list = page.getList();
-            for(Product p:list){
-                p.setMainImage(AppUtils.getImageURL("product", p.getMainImage(), 0, ""));
-            }
-        }
-        return jsonModel.success(page);
-    }
-
-    /**
-     * 添加商品至自定义分类
-     * @param productID
-     * @param tinyTypeID
-     * @return
-     */
-    @RequestMapping(value="addProductCustomClassification")
-    public String addProductCustomClassification(Integer productID, Integer tinyTypeID, RedirectAttributes redirectAttributes) {
-        productService.addProductCustomClassification(productID, tinyTypeID);
-        addMessage(redirectAttributes, "保存商品信息成功");
-        return "redirect:"+ Global.getAdminPath()+"/product/relatedProductList?tinyTypeID="+tinyTypeID;
-    }
-
     @ResponseBody
     @RequestMapping(value="getProductTypes")
     public JsonModel getProductTypes(Integer productID) {
         JsonModel jsonModel = JsonModel.newInstance();
-        List<ProductCustomClassification> data = productService.getProductTypes(productID);
-        return jsonModel.success(data);
+        return jsonModel.success();
     }
 
 
@@ -1562,83 +856,6 @@ public class ProductController extends BaseController{
         return  map;
     }
 
-/*    *//**
-     * 相关商品推荐
-     * @return
-     *//*
-    @RequestMapping(value="productRecommend")
-    public String productRecommend(Integer productID, Integer bigTypeID, Integer smallTypeID, Integer tinyTypeID,
-                                   String productName, String shopName, String recommendType,
-                                   HttpServletRequest request, HttpServletResponse response, Model model) {
-        Product product = productService.get(String.valueOf(productID));
-        List<CmProductRecommend> recommendList;
-        int manualRecommend; //记录手动推荐时数据库中相关商品的数量
-        if ("1".equals(product.getRecommendType())) {
-            recommendList = productService.findProductRecommendList(productID);
-            manualRecommend = recommendList.size();
-        }  else {
-            recommendList = productService.findRecommendBySys(product);
-            manualRecommend = productService.findProductRecommendCount(productID);
-        }
-        List<CmProductRecommend> list = productService.findProductList(bigTypeID, smallTypeID,
-                tinyTypeID, productName, shopName);
-        for (CmProductRecommend l : list) {
-            l.setImg(AppUtils.getImageURL("product", l.getImg(), 0, ""));
-            for (CmProductRecommend cpr : recommendList) {
-                if (cpr.getRecommendProductID().intValue() == l.getProductID()) {
-                    l.setSort(cpr.getSort());
-                    l.setCheck(true);
-                    break;
-                }
-            }
-        }
-        for (CmProductRecommend cpr : recommendList) {
-            cpr.setImg(AppUtils.getImageURL("product", cpr.getImg(), 0, ""));
-        }
-        if (StringUtils.isEmpty(recommendType))
-            model.addAttribute("recommendType", product.getRecommendType());
-        else
-            model.addAttribute("recommendType", recommendType);
-        model.addAttribute("product", product);
-        model.addAttribute("recommendList", recommendList);
-        model.addAttribute("list", list);
-        model.addAttribute("bigTypeID", bigTypeID);
-        model.addAttribute("smallTypeID", smallTypeID);
-        model.addAttribute("tinyTypeID", tinyTypeID);
-        model.addAttribute("productName", productName);
-        model.addAttribute("shopName", shopName);
-        //最多只能添加15条相关商品
-        model.addAttribute("full", recommendList.size() >= 15 ? 1 : 0);
-        model.addAttribute("dbProductNum", manualRecommend);
-
-        return "/modules/product/recommendProductList";
-    }
-
-    *//**g
-     * 保存相关商品推荐
-     * @param params  [productID:sort, .....]
-     * @return
-     *//*
-    @RequestMapping(value="addProductRecommend")
-    public String addProductRecommend(String productID, String[] params, String recommendType) {
-        productService.updateRecommendType(productID, recommendType);
-        if (params != null) {
-            for (String base : params) {
-                cmProductRecommendService.addRecommendProduct(productID, base.split(":")[0], base.split(":")[1]);
-            }
-        }
-        return "redirect:"+Global.getAdminPath()+"/product/productRecommend/?productID=" + productID;
-    }
-
-    *//**
-     * 保存相关商品推荐
-     * @return
-     *//*
-    @RequestMapping(value="deleteProductRecommend")
-    public String deleteProductRecommend(String productID, String id) {
-        cmProductRecommendService.deleteProductRecommend(id);
-        return "redirect:"+Global.getAdminPath()+"/product/productRecommend/?productID=" + productID;
-    }*/
     /**
      * 获取产品推荐排序
      */

+ 0 - 80
src/main/java/com/caimei/modules/product/web/ProductCustomClassificationController.java

@@ -1,80 +0,0 @@
-package com.caimei.modules.product.web;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.servlet.mvc.support.RedirectAttributes;
-
-import com.thinkgem.jeesite.common.config.Global;
-import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.web.BaseController;
-import com.thinkgem.jeesite.common.utils.StringUtils;
-import com.caimei.modules.product.entity.ProductCustomClassification;
-import com.caimei.modules.product.service.ProductCustomClassificationService;
-
-/**
- * 商品自定义分类Controller
- * @author lwt
- * @version 2018-11-19
- */
-@Controller
-@RequestMapping(value = "${adminPath}/product/productCustomClassification")
-public class ProductCustomClassificationController extends BaseController {
-
-	@Autowired
-	private ProductCustomClassificationService productCustomClassificationService;
-	
-	@ModelAttribute
-	public ProductCustomClassification get(@RequestParam(required=false) String id) {
-		ProductCustomClassification entity = null;
-		if (StringUtils.isNotBlank(id)){
-			entity = productCustomClassificationService.get(id);
-		}
-		if (entity == null){
-			entity = new ProductCustomClassification();
-		}
-		return entity;
-	}
-	
-	@RequiresPermissions("product:productCustomClassification:view")
-	@RequestMapping(value = {"list", ""})
-	public String list(ProductCustomClassification productCustomClassification, HttpServletRequest request, HttpServletResponse response, Model model) {
-		Page<ProductCustomClassification> page = productCustomClassificationService.findPage(new Page<ProductCustomClassification>(request, response), productCustomClassification); 
-		model.addAttribute("page", page);
-		return "modules/product/productCustomClassificationList";
-	}
-
-	@RequiresPermissions("product:productCustomClassification:view")
-	@RequestMapping(value = "form")
-	public String form(ProductCustomClassification productCustomClassification, Model model) {
-		model.addAttribute("productCustomClassification", productCustomClassification);
-		return "modules/product/productCustomClassificationForm";
-	}
-
-	@RequiresPermissions("product:productCustomClassification:edit")
-	@RequestMapping(value = "save")
-	public String save(ProductCustomClassification productCustomClassification, Model model, RedirectAttributes redirectAttributes) {
-		if (!beanValidator(model, productCustomClassification)){
-			return form(productCustomClassification, model);
-		}
-		productCustomClassificationService.save(productCustomClassification);
-		addMessage(redirectAttributes, "保存商品自定义分类成功");
-		return "redirect:"+Global.getAdminPath()+"/product/productCustomClassification/?repage";
-	}
-	
-	@RequiresPermissions("product:productCustomClassification:delete")
-	@RequestMapping(value = "delete")
-	public String delete(ProductCustomClassification productCustomClassification, RedirectAttributes redirectAttributes) {
-		productCustomClassificationService.delete(productCustomClassification);
-		addMessage(redirectAttributes, "删除商品自定义分类成功");
-		return "redirect:"+Global.getAdminPath()+"/product/productCustomClassification/?repage";
-	}
-
-}

+ 0 - 57
src/main/java/com/caimei/modules/product/web/ProductNewController.java

@@ -73,8 +73,6 @@ public class ProductNewController extends BaseController {
     private ProductNewService productNewService;
     @Autowired
     private CmUserOrganizeService cmUserOrganizeService;
-    @Resource
-    private ProductCustomClassificationService productCustomClassificationService;
     @Autowired
     private AreaService areaService;
     @Resource
@@ -202,12 +200,6 @@ public class ProductNewController extends BaseController {
         if (CollectionUtils.isNotEmpty(list)) {
             for (Product p : list) {
                 p.setMainImage(AppUtils.getImageURL("product", p.getMainImage(), 0, ""));
-                //自定义分类
-                List<ProductCustomClassification> typeList = productCustomClassificationService.findCustomClassification(Integer.valueOf(p.getId()));
-                if (CollectionUtils.isNotEmpty(typeList)) {
-                    // 有自定义分类
-                    p.setCustomClass(true);
-                }
                 //获取品牌信息
                 Integer brandID = p.getBrandID();
                 CmBrand brand = new CmBrand();
@@ -633,55 +625,6 @@ public class ProductNewController extends BaseController {
         return "modules/product-new/fastEdit";
     }
 
-    /**
-     * 已废弃
-     */
-    @RequiresPermissions("product:product:view")
-    @RequestMapping(value = "setCategory")
-    public String setCategory(Product product, Model model) {
-        if (null == product.getProductID()) {
-            return "redirect:" + Global.getAdminPath() + "/product/new/list/";
-        }
-        model.addAttribute("product", product);
-
-        Map<String, Object> classify = productService.findClassify(1);
-        model.addAttribute("classify", classify);
-
-        List<ProductCustomClassification> customClassify = productService.getProductTypes(product.getProductID());
-        model.addAttribute("customClassify", customClassify);
-
-        return "modules/product-new/setCategory";
-    }
-
-
-    @RequiresPermissions("product:product:edit")
-    @ResponseBody
-    @RequestMapping(value = "saveCustom")
-    public JsonModel saveCustom(Integer productId, String typeIDs) {
-        logger.info("typeIDs: " + typeIDs);
-        JsonModel jsonModel = JsonModel.newInstance();
-        if (StringUtils.isEmpty(typeIDs)) {
-            return jsonModel.error("分类信息异常");
-        }
-        String[] ids = typeIDs.split(",");
-        List<String> list = new ArrayList<>();
-        for (String s : ids) {
-            if (!list.contains(s) && !"".equals(s)) {
-                list.add(s);
-            }
-        }
-        ids = list.toArray(new String[list.size()]);
-        if (ids.length > 5) {
-            return jsonModel.error("自定义分类不能超过5个");
-        }
-        try {
-            jsonModel = productService.editProductCustomClassification(productId, ids);
-            cleanRedisCache();
-        } catch (Exception e) {
-            jsonModel.error("数据异常");
-        }
-        return jsonModel;
-    }
 
     @RequiresPermissions("product:product:edit")
     @RequestMapping(value = "fastSave")

+ 0 - 301
src/main/java/com/caimei/modules/product/web/ProductsClassifyController.java

@@ -1,301 +0,0 @@
-//package com.caimei.modules.product.web;
-//
-//import com.alibaba.fastjson.JSON;
-//import com.alibaba.fastjson.JSONArray;
-//import com.caimei.dfs.image.beens.ImageUploadInfo;
-//import com.caimei.modules.common.utils.UploadUtils;
-//import com.caimei.modules.opensearch.CoreServiceUitls;
-//import com.caimei.modules.product.entity.CmMallProductsClassify;
-//import com.caimei.modules.product.entity.Product;
-//import com.caimei.modules.product.service.ProductsClassifyService;
-//import com.caimei.modules.sys.utils.UploadImageUtils;
-//import com.caimei.utils.AppUtils;
-//import com.google.common.collect.Maps;
-//import com.thinkgem.jeesite.common.config.Global;
-//import com.thinkgem.jeesite.common.persistence.Page;
-//import com.thinkgem.jeesite.common.utils.Encodes;
-//import com.thinkgem.jeesite.common.utils.StringUtils;
-//import com.thinkgem.jeesite.common.web.BaseController;
-//import org.apache.commons.collections.CollectionUtils;
-//import org.apache.shiro.authz.annotation.RequiresPermissions;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.stereotype.Controller;
-//import org.springframework.ui.Model;
-//import org.springframework.web.bind.annotation.ModelAttribute;
-//import org.springframework.web.bind.annotation.RequestMapping;
-//import org.springframework.web.bind.annotation.RequestParam;
-//import org.springframework.web.bind.annotation.ResponseBody;
-//import org.springframework.web.servlet.mvc.support.RedirectAttributes;
-//
-//import javax.servlet.http.HttpServletRequest;
-//import javax.servlet.http.HttpServletResponse;
-//import java.util.Date;
-//import java.util.List;
-//import java.util.Map;
-//import java.util.regex.Pattern;
-//
-///**
-// * Description
-// * <p>
-// * 采美小程序商品分类
-// *
-// * @author : plf
-// * @date : 2020/4/16
-// */
-//@Controller
-//@RequestMapping(value = "${adminPath}/product/classify")
-//public class ProductsClassifyController extends BaseController {
-//    @Autowired
-//    private ProductsClassifyService productsClassifyService;
-//    @Autowired
-//    private CoreServiceUitls coreServiceUitls;
-//
-//    @ModelAttribute
-//    public CmMallProductsClassify get(@RequestParam(required = false) String id) {
-//        CmMallProductsClassify entity = null;
-//        if (StringUtils.isNotBlank(id)) {
-//            entity = productsClassifyService.get(id);
-//        }
-//        if (entity == null) {
-//            entity = new CmMallProductsClassify();
-//        }
-//        return entity;
-//    }
-//
-//    /**
-//     * 分类列表
-//     */
-//    @RequiresPermissions("product:productsClassify:view")
-//    @RequestMapping(value = {"list", ""})
-//    public String list(CmMallProductsClassify cmMallProductsClassify, HttpServletRequest request, HttpServletResponse response, Model model) {
-//        Page<CmMallProductsClassify> page = productsClassifyService.findPage(new Page<CmMallProductsClassify>(request, response), cmMallProductsClassify);
-//        for (CmMallProductsClassify productsClassify : page.getList()) {
-//            List<Product> productsList = productsClassifyService.findProductsList(productsClassify.getId());
-//            if (productsList != null && productsList.size() > 0) {
-//                productsClassify.setContainsProduct("1");
-//            }
-//        }
-//        model.addAttribute("page", page);
-//        return "modules/product/productsClassifyList";
-//    }
-//
-//    /**
-//     * 添加回显
-//     */
-//    @RequiresPermissions("product:productsClassify:view")
-//    @RequestMapping(value = "form")
-//    public String form(CmMallProductsClassify cmMallProductsClassify, Model model) {
-//        model.addAttribute("cmMallProductsClassify", cmMallProductsClassify);
-//        return "modules/product/productsClassifyForm";
-//    }
-//
-//    /**
-//     * 保存编辑分类
-//     */
-//    @RequiresPermissions("product:productsClassify:edit")
-//    @RequestMapping(value = "save")
-//    public String save(CmMallProductsClassify cmMallProductsClassify, Model model, RedirectAttributes redirectAttributes) {
-//        if (!beanValidator(model, cmMallProductsClassify)) {
-//            return form(cmMallProductsClassify, model);
-//        }
-//        //保存商品名字不能重复
-//        List<CmMallProductsClassify> productsClassifyListByName = productsClassifyService.getProductsClassifyListByName(cmMallProductsClassify);
-//        if (CollectionUtils.isNotEmpty(productsClassifyListByName) && productsClassifyListByName.size() > 0) {
-//            addMessage(model, "分类名称不能重复");
-//            return form(cmMallProductsClassify, model);
-//        }
-//        //判断该商品是是否选择的是停用,如果停用判断该分类下是否存在商品
-//        if (StringUtils.equals("2", cmMallProductsClassify.getStatus())) {
-//            List<Product> productList = productsClassifyService.findProductsList(cmMallProductsClassify.getId());
-//            if (CollectionUtils.isNotEmpty(productList)) {
-//                addMessage(model, "该分类中还存在商品,请把该分类的商品转移到别的分类后,再停用该分类");
-//                return form(cmMallProductsClassify, model);
-//            }
-//        }
-//
-//        Date date = new Date();
-//        if (StringUtils.isEmpty(cmMallProductsClassify.getId())) {//是新增
-//            cmMallProductsClassify.setAddTime(date);
-//            cmMallProductsClassify.setDelFlag("0");
-//        }
-//        cmMallProductsClassify.setUpdateTime(date);
-//        //修改图片全路径
-//        ImageUploadInfo saveImageSerivce = new ImageUploadInfo();
-//        String photoServer = Global.getConfig("photoServer");
-//        String classifyImage = cmMallProductsClassify.getClassifyImage();
-//        if (StringUtils.isNotBlank(classifyImage) && !classifyImage.startsWith("http:") && !classifyImage.startsWith("https:")) {
-//            classifyImage = Encodes.urlDecode(classifyImage);
-//            String realPath = UploadImageUtils.getAbsolutePath(classifyImage);
-//            int pointerIndex = realPath.lastIndexOf(".");
-//            try {
-//                saveImageSerivce = UploadUtils.saveImageSerivce(realPath, pointerIndex, realPath);
-//                cmMallProductsClassify.setClassifyImage(photoServer + saveImageSerivce.getSource());
-//            } catch (Exception e) {
-//                logger.error("图片上传错误:" + e.toString(), e);
-//            }
-//        }
-//        productsClassifyService.save(cmMallProductsClassify);
-//        Product product = new Product();
-//        //product.setClassifyId(Integer.parseInt(cmMallProductsClassify.getId()));
-//        List<Product> productList = productsClassifyService.productList(product);
-//        for (Product p : productList) {
-//            // 更新索引
-//            coreServiceUitls.updateProductIndex(p.getProductID());
-//        }
-//        addMessage(redirectAttributes, "保存成功");
-//        return "redirect:" + Global.getAdminPath() + "/product/classify/list";
-//    }
-//
-//    /**
-//     * 停启用分类
-//     */
-//    @RequestMapping(value = "onClassify")
-//    public String onClassify(CmMallProductsClassify cmMallProductsClassify, HttpServletRequest request, HttpServletResponse response, Model model) {
-//        if ("1".equals(cmMallProductsClassify.getStatus())) {
-//            cmMallProductsClassify.setStatus("2");//1启用,2停用
-//        } else {
-//            cmMallProductsClassify.setStatus("1");//1启用,2停用
-//        }
-//        cmMallProductsClassify.setUpdateDate(new Date());
-//        productsClassifyService.updateStatus(cmMallProductsClassify);//更新会所表数据
-//
-//        //跳转列表页面
-//        CmMallProductsClassify productsClassify = new CmMallProductsClassify();
-//        productsClassify.setOrganizeID(cmMallProductsClassify.getOrganizeID());
-//        Page<CmMallProductsClassify> page = productsClassifyService.findPage(new Page<CmMallProductsClassify>(request, response), productsClassify);
-//        model.addAttribute("page", page);
-//        return "modules/product/productsClassifyList";
-//    }
-//
-//    /**
-//     * 批量更新排序
-//     */
-//    @RequestMapping(value = "batchSaveSort")
-//    @ResponseBody
-//    public Map<String, Object> batchSaveSort(String newProducSorttList, HttpServletRequest request, Model model, RedirectAttributes redirectAttributes) {
-//        Map<String, Object> map = Maps.newLinkedHashMap();
-//        try {
-//            String[] newPageLists = newProducSorttList.split(",");
-//            for (String list : newPageLists) {
-//                String[] split = list.split("-");
-//                if (split.length == 1 || split.length < 1) {
-//                    map.put("success", false);
-//                    map.put("msg", "排序值不能为空!");
-//                    return map;
-//                }
-//                String s = split[1];//判断是否是数字,或者为空
-//                if (StringUtils.isNotEmpty(s)) {
-//                    if (isInteger(s)) {
-//                        if (StringUtils.equals("0", s)) {
-//                            map.put("success", false);
-//                            map.put("msg", "排序值只能填写大于等于1的整数");
-//                            return map;
-//                        }
-//                        String id = split[0];
-//                        String sort = split[1];
-//                        productsClassifyService.saveSort(sort, id);
-//                    } else {
-//                        map.put("success", false);
-//                        map.put("msg", "排序值只能为数字");
-//                        return map;
-//                    }
-//                } else {
-//                    map.put("success", false);
-//                    map.put("msg", "排序值不能为空!");
-//                    return map;
-//                }
-//            }
-//            map.put("success", true);
-//            map.put("msg", "更新排序成功");
-//            return map;
-//        } catch (Exception e) {
-//            map.put("success", false);
-//            map.put("msg", "更新排序失败");
-//            return map;
-//        }
-//    }
-//
-//    /**
-//     * 商品列表
-//     */
-//    @RequestMapping("/productList")
-//    public String productList(Product product, Page page, Model model) {
-//        if (page == null) page = new Page();
-//        if (0 == page.getPageSize() || -1 == page.getPageSize()) page.setPageSize(30);
-//        product.setPage(page);
-//        List<Product> productList = productsClassifyService.productList(product);
-//        for (Product p : productList) {
-//            p.setMainImage(AppUtils.getImageURL("product", p.getMainImage(), 0, ""));
-//        }
-//        //CmMallProductsClassify classify = productsClassifyService.get(product.getClassifyId().toString());
-//        page.setList(productList);
-//        model.addAttribute("page", page);
-//        //model.addAttribute("classify", classify);
-//        //model.addAttribute("classifyId", product.getClassifyId());
-//        return "modules/product/productsList";
-//    }
-//
-//    public static boolean isInteger(String str) {
-//        Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
-//        return pattern.matcher(str).matches();
-//    }
-//
-//    /**
-//     * 添加商品页面数据
-//     */
-//    @RequestMapping(value = "toAddProduct")
-//    public String toAddProduct(Product product, Page page, Model model) {
-//        if (0 == page.getPageSize() || -1 == page.getPageSize()) page.setPageSize(30);
-//        if (0 == page.getPageNo()) page.setPageNo(1);
-//        product.setPage(page);
-////        List<Integer> ids = productsClassifyService.findClassifyId(product.getClassifyId());
-////        product.setIds(ids);
-//        List<Product> productList = productsClassifyService.findAddProduct(product);
-//        String wwwServer = Global.getConfig("wwwServer");
-//        for (Product p : productList) {
-//            p.setMainImage(AppUtils.getImageURL("product", p.getMainImage(), 0, wwwServer));
-//        }
-//        page.setList(productList);
-//        model.addAttribute("page", page);
-//        return "modules/product/toAddProduct";
-//    }
-//
-//    /**
-//     * 添加商品
-//     */
-//    @ResponseBody
-//    @RequestMapping(value = "saveAddProductInfo")
-//    public Map<String, Object> saveAddProductInfo(Product product) {
-//        Map<String, Object> map = Maps.newLinkedHashMap();
-//        try {
-//            JSONArray parse = (JSONArray) JSON.parse(product.getItemsList());
-//            if (null != parse && parse.size() > 0) {
-//                for (int j = 0; j < parse.size(); j++) {
-//                    String productID = (String) parse.get(j);//获取商品ID
-//                    product.setProductID(Integer.valueOf(productID));
-//                    //product.setClassifyAddTime(new Date());
-//                    productsClassifyService.insertProductsToClassify(product);
-//                    // 更新索引,暂时不走搜索
-//                    //searchUitls.updateProductIndex(product.getProductID());
-//                }
-//            }
-//            map.put("success", true);
-//            map.put("msg", "添加成功");
-//        } catch (Exception e) {
-//            logger.debug(e.toString(), e);
-//            map.put("success", false);
-//            map.put("msg", "添加失败");
-//        }
-//        return map;
-//    }
-//
-//    @RequestMapping("/delectClassifyProduct")
-//    public String delectClassifyProduct(Product product, RedirectAttributes redirectAttributes) {
-//        //productsClassifyService.delectClassifyProduct(product.getProductID(), product.getClassifyId());
-//        // 更新索引
-//        //searchUitls.updateProductIndex(product.getProductID());
-//        addMessage(redirectAttributes, "删除成功");
-//        //return "redirect:" + Global.getAdminPath() + "/product/classify/productList?classifyId=" + product.getClassifyId();
-//        return "redirect:" + Global.getAdminPath() + "/product/classify/productList";
-//    }
-//}

+ 2 - 0
src/main/java/com/caimei/modules/user/dao/ClubChangeSpReviewDao.java

@@ -13,7 +13,9 @@ import java.util.Date;
  */
 @MyBatisDao
 public interface ClubChangeSpReviewDao extends CrudDao<ClubChangeSp> {
+
     int updateCheckStatusById(ClubChangeSp clubChangeSp);
+
     ClubChangeSp getClubChangeSpById(Integer clubChangeSpRecordID);
 
 }

+ 0 - 83
src/main/resources/mappings/modules/bulkpurchase/BpOrderCirculationMapper.xml

@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.bulkpurchase.dao.BpOrderCirculationDao">
-
-	<sql id="bpOrderCirculationColumns">
-		a.userId AS "userId",
-		a.addTime AS "addTime",
-		a.buyerRole AS "buyerRole",
-		a.shopRole AS "shopRole",
-		a.updateTime AS "updateTime",
-		(SELECT (u.mobile) FROM user u where u.userID = a.userId) as "mobile",
-		(SELECT (u.userName) FROM user u where u.userID = a.userId) as "userName",
-		(SELECT (c.c_userTypeName) FROM user u LEFT JOIN c_usertype c ON(u.registerUserTypeID = c.c_userTypeID) where u.userID = a.userId)  as "userTypeName"
-	</sql>
-	
-	<sql id="bpOrderCirculationJoins">
-	</sql>
-    
-	<select id="get" resultType="BpOrderCirculation">
-		SELECT 
-			<include refid="bpOrderCirculationColumns"/>
-		FROM bp_order_circulation a
-		<include refid="bpOrderCirculationJoins"/>
-		WHERE a.userId = #{userId}
-	</select>
-	
-	<select id="findAllList" resultType="BpOrderCirculation">
-		SELECT 
-			<include refid="bpOrderCirculationColumns"/>
-		FROM bp_order_circulation a
-		left join user u1 on u1.userID = a.userId
-		<include refid="bpOrderCirculationJoins"/>
-		<where>
-			<if test="userId != '' and userId != null">
-				a.userId = #{userId}
-			</if>
-			<if test="mobile != '' and mobile != null">
-				and u1.mobile = #{mobile}
-			</if>
-			<if test="userName != '' and userName != null">
-				and u1.userName like concat('%', #{userName}, '%')
-			</if>
-			<if test="userType != '' and userType != null">
-				and u1.registerUserTypeID = #{userType}
-			</if>
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.addTime desc
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="BpOrderCirculation"  keyProperty="userId" useGeneratedKeys="true">
-		INSERT INTO bp_order_circulation(
-			userId,
-			addTime,
-			buyerRole,
-			shopRole
-		) VALUES (
-			#{userId},
-			#{addTime},
-			#{buyerRole},
-			#{shopRole}
-		)
-	</insert>
-	
-	<delete id="delete">
-		DELETE FROM bp_order_circulation
-		WHERE userId = #{userId}
-	</delete>
-
-	<update id="update">
-		update bp_order_circulation set
-		buyerRole = #{buyerRole},
-		shopRole = #{shopRole},
-		updateTime = #{updateTime}
-		where userId = #{userId}
-	</update>
-</mapper>

+ 0 - 90
src/main/resources/mappings/modules/bulkpurchase/BpOrderProductRemarkMapper.xml

@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.bulkpurchase.dao.BpOrderProductRemarkDao">
-    
-	<sql id="bpOrderProductRemarkColumns">
-		su.id AS "id",
-		su.no AS "no",
-		a.stagesId AS "stagesId",
-		a.orderProductId AS "orderProductId",
-		a.remarks AS "remarks",
-		a.createBy AS "createBy.id",
-		a.createDate AS "createDate",
-		su.name AS  "sysUserName"
-	</sql>
-	
-	<sql id="bpOrderProductRemarkJoins">
-	</sql>
-    
-	<select id="get" resultType="BpOrderProductRemark">
-		SELECT 
-			<include refid="bpOrderProductRemarkColumns"/>
-		FROM bp_order_product_remark a
-		LEFT JOIN sys_user su ON su.id = a.createBy
-		<include refid="bpOrderProductRemarkJoins"/>
-		WHERE a.id = #{id}
-		ORDER BY a.createDate
-	</select>
-	
-	<select id="findList" resultType="BpOrderProductRemark">
-		SELECT 
-			<include refid="bpOrderProductRemarkColumns"/>
-		FROM bp_order_product_remark a
-		LEFT JOIN sys_user su ON su.id = a.createBy
-		<include refid="bpOrderProductRemarkJoins"/>
-		<where>
-			
-			<if test="orderProductId != null and orderProductId != ''">
-				AND a.orderProductId = #{orderProductId}
-			</if>
-			<if test="stagesId != null and stagesId != ''">
-				AND a.stagesId = #{stagesId}
-			</if>
-		</where>
-		ORDER BY a.createDate
-	</select>
-	
-	<select id="findAllList" resultType="BpOrderProductRemark">
-		SELECT 
-			<include refid="bpOrderProductRemarkColumns"/>
-		FROM bp_order_product_remark a
-		LEFT JOIN sys_user su ON su.id = a.createBy
-		<include refid="bpOrderProductRemarkJoins"/>
-		<where>
-			
-		</where>
-		ORDER BY a.createDate
-	</select>
-	
-	<insert id="insert" parameterType="BpOrderProductRemark"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO bp_order_product_remark(
-			orderProductId,
-			stagesId,
-			remarks,
-			createBy,
-			createDate
-		) VALUES (
-			#{orderProductId},
-			#{stagesId},
-			#{remarks},
-			#{createBy.id},
-			#{createDate}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE bp_order_product_remark SET 	
-			orderProductId = #{orderProductId},
-			stagesId = #{stagesId},
-			remarks = #{remarks},
-			createBy = #{createBy.id},
-			createDate = #{createDate}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM bp_order_product_remark
-		WHERE id = #{id}
-	</delete>
-	
-</mapper>

+ 0 - 82
src/main/resources/mappings/modules/bulkpurchase/BpOrderRemarkMapper.xml

@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.bulkpurchase.dao.BpOrderRemarkDao">
-    
-	<sql id="bpOrderRemarkColumns">
-		su.id AS "id",
-		su.no AS "no",
-		a.orderId AS "orderId",
-		a.remarks AS "remarks",
-		a.createBy AS "createBy.id",
-		a.createDate AS "createDate",
-		su.name AS  "sysUserName"
-	</sql>
-	
-	<sql id="bpOrderRemarkJoins">
-	</sql>
-    
-	<select id="get" resultType="BpOrderRemark">
-		SELECT 
-			<include refid="bpOrderRemarkColumns"/>
-		FROM bp_order_remark a
-		LEFT JOIN sys_user su ON su.id = a.createBy
-		<include refid="bpOrderRemarkJoins"/>
-		WHERE a.id = #{id}
-		ORDER BY a.createDate
-	</select>
-	
-	<select id="findList" resultType="BpOrderRemark">
-		SELECT 
-			<include refid="bpOrderRemarkColumns"/>
-		FROM bp_order_remark a
-		LEFT JOIN sys_user su ON su.id = a.createBy
-		<include refid="bpOrderRemarkJoins"/>
-		<where>
-			<if test="orderId != null and orderId != ''">
-				AND a.orderId = #{orderId}
-			</if>
-		</where>
-		ORDER BY a.createDate
-	</select>
-	
-	<select id="findAllList" resultType="BpOrderRemark">
-		SELECT 
-			<include refid="bpOrderRemarkColumns"/>
-		FROM bp_order_remark a
-		LEFT JOIN sys_user su ON su.id = a.createBy
-		<include refid="bpOrderRemarkJoins"/>
-		<where>
-			
-		</where>		
-		ORDER BY a.createDate
-	</select>
-	
-	<insert id="insert" parameterType="BpOrderRemark"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO bp_order_remark(
-			orderId,
-			remarks,
-			createBy,
-			createDate
-		) VALUES (
-			#{orderId},
-			#{remarks},
-			#{createBy.id},
-			#{createDate}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE bp_order_remark SET 	
-			orderId = #{orderId},
-			remarks = #{remarks},
-			createBy = #{createBy.id},
-			createDate = #{createDate}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM bp_order_remark
-		WHERE id = #{id}
-	</delete>
-	
-</mapper>

+ 0 - 140
src/main/resources/mappings/modules/bulkpurchase/BpOrderStagesShopMapper.xml

@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.bulkpurchase.dao.BpOrderStagesShopDao">
-    
-	<sql id="bpOrderStagesShopColumns">
-		a.id AS "id",
-		a.stagesId AS "stagesId",
-		a.orderId AS "orderId",
-		a.stagesNum AS "stagesNum",
-		a.shopId AS "shopId",
-		a.shopFee AS "shopFee",
-		a.delFlag AS "delFlag",
-		a.addTime AS "addTime",
-		a.updateBy AS "updateBy.id",
-		a.updateDate AS "updateDate",
-		a.createBy AS "createBy.id",
-		a.createDate AS "createDate",
-		(SELECT name FROM shop where shopID = a.shopId ) AS "shopName"
-	</sql>
-	
-	<sql id="bpOrderStagesShopJoins">
-	</sql>
-    
-	<select id="get" resultType="BpOrderStagesShop">
-		SELECT 
-			<include refid="bpOrderStagesShopColumns"/>
-		FROM bp_order_stages_shop a
-		<include refid="bpOrderStagesShopJoins"/>
-		WHERE a.id = #{id} AND delFlag = 0
-	</select>
-
-	<select id="findByStagesId" resultType="BpOrderStagesShop">
-		SELECT
-		<include refid="bpOrderStagesShopColumns"/>
-		FROM bp_order_stages_shop a
-		<include refid="bpOrderStagesShopJoins"/>
-		WHERE a.stagesId = #{stagesId} AND delFlag = 0
-	</select>
-
-	<select id="findList" resultType="BpOrderStagesShop">
-		SELECT 
-			<include refid="bpOrderStagesShopColumns"/>
-		FROM bp_order_stages_shop a
-		<include refid="bpOrderStagesShopJoins"/>
-		<where>
-			a.delFlag = '0'
-			<if test="id != null and id != ''">
-				AND a.id = #{id}
-			</if>
-			<if test="stagesId != null and stagesId != ''">
-				AND a.stagesId = #{stagesId}
-			</if>
-			<if test="orderId != null and orderId != ''">
-				AND a.orderId = #{orderId}
-			</if>
-			<if test="stagesNum != null and stagesNum != ''">
-				AND a.stagesNum = #{stagesNum}
-			</if>
-			<if test="shopId != null and shopId != ''">
-				AND a.shopId = #{shopId}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="BpOrderStagesShop">
-		SELECT 
-			<include refid="bpOrderStagesShopColumns"/>
-		FROM bp_order_stages_shop a
-		<include refid="bpOrderStagesShopJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="BpOrderStagesShop"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO bp_order_stages_shop(
-			stagesId,
-			orderId,
-			stagesNum,
-			shopId,
-			shopFee,
-			delFlag,
-			addTime,
-			updateBy,
-			updateDate,
-			createBy,
-			createDate
-		) VALUES (
-			#{stagesId},
-			#{orderId},
-			#{stagesNum},
-			#{shopId},
-			#{shopFee},
-			#{delFlag},
-			#{addTime},
-			#{updateBy.id},
-			#{updateDate},
-			#{createBy.id},
-			#{createDate}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE bp_order_stages_shop SET 	
-			orderId = #{orderId},
-			stagesNum = #{stagesNum},
-			shopId = #{shopId},
-			shopFee = #{shopFee},
-			delFlag = #{delFlag},
-			updateBy = #{updateBy.id},
-			updateDate = #{updateDate},
-			createBy = #{createBy.id},
-			createDate = #{createDate}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM bp_order_stages_shop
-		WHERE id = #{id}
-	</delete>
-
-	<delete id="deleteByOrderId">
-		DELETE FROM bp_order_stages_shop WHERE orderId = #{orderId}
-	</delete>
-	
-</mapper>

+ 0 - 138
src/main/resources/mappings/modules/bulkpurchase/BpOrderUserinfoMapper.xml

@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.bulkpurchase.dao.BpOrderUserinfoDao">
-	<resultMap id="userInfo" type="BpOrderUserinfo">
-		<result column="clubID" property="clubId"/>
-		<result column="name" property="name"/>
-		<result column="zipCode" property="postalCode"/>
-		<result column="contractPhone" property="phone"/>
-		<result column="contractMobile" property="mobile"/>
-		<result column="linkMan" property="shouHuoRen"/>
-		<result column="town" property="town"/>
-		<result column="province" property="province"/>
-		<result column="city" property="city"/>
-		<result column="address" property="address"/>
-	</resultMap>
-
-	<sql id="bpOrderUserinfoColumns">
-		a.id AS "id",
-		a.orderId AS "orderId",
-		a.clubId AS "clubId",
-		a.userId AS "userId",
-		a.name AS "name",
-		a.shouHuoRen AS "shouHuoRen",
-		a.mobile AS "mobile",
-		a.phone AS "phone",
-		a.postalCode AS "postalCode",
-		a.province AS "province",
-		a.city AS "city",
-		a.town AS "town",
-		a.address AS "address"
-	</sql>
-	
-	<sql id="bpOrderUserinfoJoins">
-	</sql>
-    
-	<select id="get" resultType="BpOrderUserinfo">
-		SELECT 
-			<include refid="bpOrderUserinfoColumns"/>
-		FROM bp_order_userinfo a
-		<include refid="bpOrderUserinfoJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="BpOrderUserinfo">
-		SELECT 
-			<include refid="bpOrderUserinfoColumns"/>
-		FROM bp_order_userinfo a
-		<include refid="bpOrderUserinfoJoins"/>
-		<where>
-			
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="BpOrderUserinfo">
-		SELECT 
-			<include refid="bpOrderUserinfoColumns"/>
-		FROM bp_order_userinfo a
-		<include refid="bpOrderUserinfoJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="BpOrderUserinfo"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO bp_order_userinfo(
-			orderId,
-			clubId,
-			userId,
-			name,
-			shouHuoRen,
-			mobile,
-			phone,
-			postalCode,
-			province,
-			city,
-			town,
-			address
-		) VALUES (
-			#{orderId},
-			#{clubId},
-			#{userId},
-			#{name},
-			#{shouHuoRen},
-			#{mobile},
-			#{phone},
-			#{postalCode},
-			#{province},
-			#{city},
-			#{town},
-			#{address}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE bp_order_userinfo SET 	
-			name = #{name},
-			shouHuoRen = #{shouHuoRen},
-			mobile = #{mobile},
-			phone = #{phone},
-			postalCode = #{postalCode},
-			province = #{province},
-			city = #{city},
-			town = #{town},
-			address = #{address}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM bp_order_userinfo
-		WHERE id = #{id}
-	</delete>
-	<select id="selectUserInfoById" parameterType="String" resultMap="userInfo">
-			 SELECT a.*,a.linkMan shouHuoRen ,a.contractMobile mobile ,a.contractPhone phone , b.name town ,c.name city ,d.name province FROM town b LEFT JOIN city c
-			 ON b.cityID=c.cityID JOIN province d ON c.`provinceID` =d.`provinceID`
-			  JOIN club a ON a.townID =b.townID WHERE  `clubID` =(SELECT clubid FROM bp_contract f WHERE f.`id`=#{id})
-	</select>
-	
-	<select id="findCityByUserId" resultType="hashMap">
-		SELECT `provinceName`,`cityName`,`townName`FROM`useraddress` WHERE`userInfoID`=#{userId}
-	</select>
-	<select id="getWithorderId" resultType="BpOrderUserinfo">
-		SELECT  * from bp_order_userinfo where orderId =#{orderId}
-	</select>
-</mapper>

+ 0 - 313
src/main/resources/mappings/modules/bulkpurchase/CmFinanceChargeMapper.xml

@@ -1,313 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.bulkpurchase.dao.CmFinanceChargeDao">
-    
-	<sql id="cmFinanceChargeColumns">
-		a.id AS "id",
-		a.orderNo AS "orderNo",
-		a.divideRequestNo AS "divideRequestNo",
-		a.stagesId AS "stagesId",
-		a.productIds AS "productIds",
-		a.transactionType AS "transactionType",
-		a.totalAmount AS "totalAmount",
-		a.deductionAmount AS "deductionAmount",
-		a.chargeAmount AS "chargeAmount",
-		a.chargeStatus AS "chargeStatus",
-		a.taxRateFee AS "taxRateFee",
-		a.cmFee AS "cmFee",
-		a.shopFee AS "shopFee",
-		a.otherFee AS "otherFee",
-		a.shopName AS "shopName",
-		a.applyDate AS "applyDate",
-		a.auditDate AS "auditDate",
-		a.createBy AS "createBy.id",
-		a.createDate AS "createDate",
-		a.updateBy AS "updateBy.id",
-		a.updateDate AS "updateDate",
-		a.status AS "status",
-		(SELECT IFNULL(sum(b.shopFee),0) FROM cm_finance_charge b WHERE b.productIds=a.productIds AND b.status=3 AND b.delFlag = 0) AS "totalShopPay",
-		(SELECT IFNULL(sum(b.otherFee),0) FROM cm_finance_charge b WHERE b.productIds=a.productIds AND b.status=3 AND b.delFlag = 0) AS "totalOtherPay",
-		(SELECT IFNULL(sum(b.otherFee),0) FROM cm_finance_charge b WHERE b.stagesId=a.stagesId AND b.status=3 AND b.delFlag = 0) AS "totalStagesOtherPay",
-		(SELECT IFNULL(sum(b.cmFee),0) FROM cm_finance_charge b WHERE b.stagesId=a.stagesId AND b.status=3 AND b.delFlag = 0) AS "totalStagesCmPay",
-		(SELECT IFNULL(sum(b.shopFee),0) FROM cm_finance_charge b WHERE b.stagesId=a.stagesId AND b.status=3 AND b.delFlag = 0) AS "totalStagesShopPay",
-		a.delFlag AS "delFlag"
-	</sql>
-
-	<sql id="cmFinanceChargeColumns2">
-		a.id AS "id",
-		a.orderNo AS "orderNo",
-		a.stagesId AS "stagesId",
-		a.productIds AS "productIds",
-		a.transactionType AS "transactionType",
-		a.totalAmount AS "totalAmount",
-		a.deductionAmount AS "deductionAmount",
-		a.chargeAmount AS "chargeAmount",
-		a.chargeStatus AS "chargeStatus",
-		a.taxRateFee AS "taxRateFee",
-		a.cmFee AS "cmFee",
-		a.shopFee AS "shopFee",
-		a.otherFee AS "otherFee",
-		a.shopName AS "shopName",
-		a.applyDate AS "applyDate",
-		a.auditDate AS "auditDate",
-		a.createBy AS "createBy.id",
-		a.createDate AS "createDate",
-		a.updateBy AS "updateBy.id",
-		a.updateDate AS "updateDate",
-		a.status AS "status",
-		(SELECT IFNULL(sum(b.otherFee),0) FROM cm_finance_charge b WHERE b.stagesId=a.stagesId AND b.status=3 AND b.delFlag = 0) AS "totalStagesOtherPay",
-		(SELECT IFNULL(sum(b.cmFee),0) FROM cm_finance_charge b WHERE b.stagesId=a.stagesId AND b.status=3 AND b.delFlag = 0) AS "totalStagesCmPay",
-		(SELECT IFNULL(sum(b.shopFee),0) FROM cm_finance_charge b WHERE b.stagesId=a.stagesId AND b.status=3 AND b.delFlag = 0) AS "totalStagesShopPay",
-		a.delFlag AS "delFlag"
-	</sql>
-
-	<sql id="cmFinanceChargeJoins">
-	</sql>
-    
-	<select id="get" resultType="CmFinanceCharge">
-		SELECT 
-			<include refid="cmFinanceChargeColumns"/>
-		FROM cm_finance_charge a
-		<include refid="cmFinanceChargeJoins"/>
-		WHERE a.id = #{id}
-	</select>
-
-	<select id="getMaxPrimaryKey" resultType="Long">
-		SELECT max(id) FROM cm_finance_charge
-	</select>
-
-	<select id="findListByProductId" resultType="CmFinanceCharge">
-		SELECT
-		<include refid="cmFinanceChargeColumns"/>
-		FROM cm_finance_charge a
-		<include refid="cmFinanceChargeJoins"/>
-		<where>
-
-			<if test="productId != null and productId != ''">
-				a.productIds = #{productId}
-			</if>
-			AND delFlag = 0
-		</where>
-		ORDER BY a.id ASC
-	</select>
-
-	<!--查找分期应付-->
-	<select id="findListByStagesId" resultType="CmFinanceCharge">
-		SELECT
-		<include refid="cmFinanceChargeColumns2"/>
-		FROM cm_finance_charge a
-		<include refid="cmFinanceChargeJoins"/>
-		WHERE a.stagesId = #{stagesId} AND delFlag = 0
-		ORDER BY a.id ASC
-	</select>
-
-	<!--查找所有分期已付-->
-	<select id="findListByOrderNo" resultType="CmFinanceCharge">
-		SELECT
-		<include refid="cmFinanceChargeColumns2"/>
-		FROM cm_finance_charge a
-		<include refid="cmFinanceChargeJoins"/>
-		WHERE a.orderNo LIKE concat('%',#{orderNo},'%') AND delFlag = 0
-		ORDER BY a.id ASC
-	</select>
-
-	<!--获取这个商品的所有已付记录-->
-	<select id="findListGroupByproductIds" resultType="CmFinanceCharge">
-		SELECT *
-		FROM cm_finance_charge
-		WHERE
-		productIds = #{productId}
-		AND delFlag = 0
-		AND status = 3
-	</select>
-
-
-	<select id="findShopPayByProductId" resultType="java.lang.Double">
-		SELECT
-		sum(shopFee)
-		FROM cm_finance_charge
-		where
-		productIds = #{productId}
-		AND delFlag = 0
-		AND status = 3
-	</select>
-
-	<select id="findOtherPayByProductId" resultType="java.lang.Double">
-		SELECT
-		sum(otherFee)
-		FROM cm_finance_charge
-		where
-		productIds = #{productId}
-		AND delFlag = 0
-		AND status = 3
-	</select>
-
-	<select id="findList" resultType="CmFinanceCharge">
-		SELECT 
-			<include refid="cmFinanceChargeColumns"/>
-		FROM cm_finance_charge a
-		<include refid="cmFinanceChargeJoins"/>
-		<where>
-			
-			<if test="id != null and id != ''">
-				AND a.id = #{id}
-			</if>
-			<if test="stagesId != null and stagesId != ''">
-				AND a.stagesId = #{stagesId}
-			</if>
-			<if test="orderNo != null and orderNo != ''">
-				AND a.orderNo LIKE concat('%',#{orderNo},'%')
-			</if>
-			<if test="transactionType != null and transactionType != ''">
-				AND a.transactionType = #{transactionType}
-			</if>
-			<if test="startTime != null and startTime != ''">
-				AND a.auditDate <![CDATA[  >=  ]]> #{startTime}
-			</if>
-			<if test="endTime != null and endTime != ''">
-				AND a.auditDate <![CDATA[   <=  ]]> #{endTime}
-			</if>
-			<if test="status != null and status != ''">
-				AND a.status = #{status}
-			</if>
-			AND delFlag = 0
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.id ASC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="CmFinanceCharge">
-		SELECT 
-			<include refid="cmFinanceChargeColumns"/>
-		FROM cm_finance_charge a
-		<include refid="cmFinanceChargeJoins"/>
-		<where>
-			<if test="startTime != null and startTime != ''">
-				AND a.auditDate <![CDATA[  >=  ]]> #{startTime}
-			</if>
-			<if test="endTime != null and endTime != ''">
-				AND a.auditDate <![CDATA[   <=  ]]> #{endTime}
-			</if>
-			AND delFlag = 0
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.id ASC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="CmFinanceCharge"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cm_finance_charge(
-			orderNo,
-			divideRequestNo,
-			stagesId,
-			productIds,
-			transactionType,
-			totalAmount,
-			deductionAmount,
-			chargeAmount,
-			chargeStatus,
-			taxRateFee,
-			cmFee,
-			shopFee,
-			otherFee,
-			shopName,
-			applyDate,
-			auditDate,
-			createBy,
-			createDate,
-			updateBy,
-			updateDate,
-			status,
-			delFlag
-		) VALUES (
-			#{orderNo},
-			#{divideRequestNo},
-			#{stagesId},
-			#{productIds},
-			#{transactionType},
-			#{totalAmount},
-			#{deductionAmount},
-			#{chargeAmount},
-			#{chargeStatus},
-			#{taxRateFee},
-			#{cmFee},
-			#{shopFee},
-			#{otherFee},
-			#{shopName},
-			#{applyDate},
-			#{auditDate},
-			#{createBy.id},
-			#{createDate},
-			#{updateBy.id},
-			#{updateDate},
-			#{status},
-			#{delFlag}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cm_finance_charge SET 	
-			orderNo = #{orderNo},
-			divideRequestNo = #{divideRequestNo},
-			stagesId = #{stagesId},
-			productIds = #{productIds},
-			transactionType = #{transactionType},
-			totalAmount = #{totalAmount},
-			deductionAmount = #{deductionAmount},
-			chargeAmount = #{chargeAmount},
-			chargeStatus = #{chargeStatus},
-			taxRateFee = #{taxRateFee},
-			cmFee = #{cmFee},
-			shopFee = #{shopFee},
-			otherFee = #{otherFee},
-			shopName = #{shopName},
-			applyDate = #{applyDate},
-			auditDate = #{auditDate},
-			updateBy = #{updateBy.id},
-			updateDate = #{updateDate},
-			status = #{status},
-			delFlag = #{delFlag}
-		WHERE id = #{id}
-	</update>
-
-	<update id="updateRece">
-		UPDATE cm_finance_charge SET
-		orderNo = #{orderNo},
-		stagesId = #{stagesId},
-		productIds = #{productIds},
-		transactionType = #{transactionType},
-		totalAmount = #{totalAmount},
-		deductionAmount = #{deductionAmount},
-		chargeAmount = #{chargeAmount},
-		chargeStatus = #{chargeStatus},
-		taxRateFee = #{taxRateFee},
-		cmFee = #{cmFee},
-		shopFee = #{shopFee},
-		otherFee = #{otherFee},
-		shopName = #{shopName},
-		applyDate = #{applyDate},
-		auditDate = #{auditDate},
-		updateBy = #{updateBy.id},
-		updateDate = #{updateDate},
-		status = #{status},
-		delFlag = #{delFlag}
-		WHERE id = #{id}
-	</update>
-
-	<delete id="delete">
-		DELETE FROM cm_finance_charge
-		WHERE id = #{id}
-	</delete>
-	
-</mapper>

+ 0 - 175
src/main/resources/mappings/modules/bulkpurchase/CmFinanceChargeStagesMapper.xml

@@ -1,175 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.bulkpurchase.dao.CmFinanceChargeStagesDao">
-    
-	<sql id="cmFinanceChargeStagesColumns">
-		a.id AS "id",
-		a.chargeId AS "chargeId",
-		a.stagesId AS "stagesId",
-		a.orderNo AS "orderNo",
-		a.shopId AS "shopId",
-		a.shopFee AS "shopFee",
-		a.delFlag AS "delFlag",
-		a.addTime AS "addTime",
-		a.updateBy AS "updateBy.id",
-		a.updateDate AS "updateDate",
-		a.createBy AS "createBy.id",
-		a.createDate AS "createDate",
-		(SELECT name FROM shop WHERE shopID = a.shopId) AS "shopName"
-	</sql>
-	
-	<sql id="cmFinanceChargeStagesJoins">
-	</sql>
-    
-	<select id="get" resultType="CmFinanceChargeStages">
-		SELECT 
-			<include refid="cmFinanceChargeStagesColumns"/>
-		FROM cm_finance_charge_stages a
-		<include refid="cmFinanceChargeStagesJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	<!--获取某次申请的应付某个供应商信息-->
-	<select id="getByChargeAndShop" resultType="CmFinanceChargeStages">
-		SELECT
-		<include refid="cmFinanceChargeStagesColumns"/>
-		FROM cm_finance_charge_stages a
-		<include refid="cmFinanceChargeStagesJoins"/>
-		WHERE a.chargeId = #{chargeId} AND a.shopId = #{shopId} AND delFlag = 0
-	</select>
-	<!--获取该期已申请过的付该供应商多少-->
-	<select id="getSumByStagesId" resultType="java.lang.Double">
-		SELECT
-		IFNULL(sum(a.shopFee),0)
-		FROM cm_finance_charge_stages a LEFT JOIN cm_finance_charge b ON a.chargeId = b.id
-		<include refid="cmFinanceChargeStagesJoins"/>
-		<where>
-			<if test="stagesId != null and stagesId != ''">
-				AND a.stagesId = #{stagesId}
-			</if>
-			<if test="shopId != null and shopId != ''">
-				AND a.shopId = #{shopId}
-			</if>
-			<if test="status != null and status != ''">
-				AND b.status = #{status}
-			</if>
-			AND a.delFlag = 0
-		</where>
-	</select>
-	<!--获取某次已申请过的付该供应商多少-->
-	<select id="getSumByChargeId" resultType="java.lang.Double">
-		SELECT
-			<include refid="cmFinanceChargeStagesColumns"/>
-		FROM cm_finance_charge_stages a
-		<include refid="cmFinanceChargeStagesJoins"/>
-		WHERE a.chargeId = #{chargeId} AND a.shopId = #{shopId} AND delFlag = 0
-	</select>
-
-	<!--修改应付时 设置无效-->
-	<update id="updateByChargeId">
-		UPDATE cm_finance_charge_stages SET
-		updateBy = #{updateBy.id},
-		updateDate = #{updateDate},
-		delFlag = #{delFlag}
-		WHERE chargeId = #{chargeId}
-	</update>
-
-	<select id="findList" resultType="CmFinanceChargeStages">
-		SELECT 
-			<include refid="cmFinanceChargeStagesColumns"/>
-		FROM cm_finance_charge_stages a
-		<include refid="cmFinanceChargeStagesJoins"/>
-		<where>
-			
-			<if test="id != null and id != ''">
-				AND a.id = #{id}
-			</if>
-			<if test="chargeId != null and chargeId != ''">
-				AND a.chargeId = #{chargeId}
-			</if>
-			<if test="stagesId != null and stagesId != ''">
-				AND a.stagesId = #{stagesId}
-			</if>
-			<if test="orderNo != null and orderNo != ''">
-				AND a.orderNo = #{orderNo}
-			</if>
-			<if test="shopId != null and shopId != ''">
-				AND a.shopId = #{shopId}
-			</if>
-				AND a.delFlag = 0
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="CmFinanceChargeStages">
-		SELECT 
-			<include refid="cmFinanceChargeStagesColumns"/>
-		FROM cm_finance_charge_stages a
-		<include refid="cmFinanceChargeStagesJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="CmFinanceChargeStages"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cm_finance_charge_stages(
-			chargeId,
-			stagesId,
-			orderNo,
-			shopId,
-			shopFee,
-			delFlag,
-			addTime,
-			updateBy,
-			updateDate,
-			createBy,
-			createDate
-		) VALUES (
-			#{chargeId},
-			#{stagesId},
-			#{orderNo},
-			#{shopId},
-			#{shopFee},
-			#{delFlag},
-			#{addTime},
-			#{updateBy.id},
-			#{updateDate},
-			#{createBy.id},
-			#{createDate}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cm_finance_charge_stages SET 	
-			chargeId = #{chargeId},
-			stagesId = #{stagesId},
-			orderNo = #{orderNo},
-			shopId = #{shopId},
-			shopFee = #{shopFee},
-			delFlag = #{delFlag},
-			addTime = #{addTime},
-			updateBy = #{updateBy.id},
-			updateDate = #{updateDate},
-			createBy = #{createBy.id},
-			createDate = #{createDate}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM cm_finance_charge_stages
-		WHERE id = #{id}
-	</delete>
-
-</mapper>

+ 0 - 319
src/main/resources/mappings/modules/bulkpurchase/CmFinanceReceiptsMapper.xml

@@ -1,319 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.bulkpurchase.dao.CmFinanceReceiptsDao">
-    
-	<sql id="cmFinanceReceiptsColumns">
-		a.id AS "id",
-		a.orderNo AS "orderNo",
-		a.orderId AS "orderId",
-		a.transactionNum AS "transactionNum",
-		a.title AS "title",
-		a.productIds AS "productIds",
-		a.transactionWay AS "transactionWay",
-		a.transactionType AS "transactionType",
-		a.payType AS "payType",
-		a.totalAmount AS "totalAmount",
-		a.deductionAmount AS "deductionAmount",
-		a.shouldPayAmount AS "shouldPayAmount",
-		a.receiptsDate AS "receiptsDate",
-		a.auditDate AS "auditDate",
-		a.createBy AS "createBy.id",
-		a.createDate AS "createDate",
-		a.updateBy AS "updateBy.id",
-		a.updateDate AS "updateDate",
-		a.status AS "status",
-		a.delFlag AS "delFlag",
-		a.stagesId AS "stagesId"
-	</sql>
-	
-	<sql id="cmFinanceReceiptsJoins">
-	</sql>
-    
-	<select id="get" resultType="CmFinanceReceipts">
-		SELECT 
-			<include refid="cmFinanceReceiptsColumns"/>
-		FROM cm_finance_receipts a
-		<include refid="cmFinanceReceiptsJoins"/>
-		WHERE a.id = #{id}
-		AND  delFlag=0
-	</select>
-
-	<select id="getFinanceReceiptsByOrderNo" resultType="CmFinanceReceipts">
-		SELECT
-		<include refid="cmFinanceReceiptsColumns"/>
-		FROM cm_finance_receipts a
-		<include refid="cmFinanceReceiptsJoins"/>
-		WHERE a.orderNo  LIKE concat('%',#{orderNo},'%')
-		AND  delFlag=0
-	</select>
-	
-	<select id="findList" resultType="CmFinanceReceipts">
-		SELECT 
-			<include refid="cmFinanceReceiptsColumns"/>
-		FROM cm_finance_receipts a
-		<include refid="cmFinanceReceiptsJoins"/>
-		<where>
-			
-			<if test="id != null and id != ''">
-				AND a.id = #{id}
-			</if>
-			<if test="orderNo != null and orderNo != ''">
-				AND a.orderNo LIKE concat('%',#{orderNo},'%')
-			</if>
-			<if test="transactionNum != null and transactionNum != ''">
-				AND a.transactionNum = #{transactionNum}
-			</if>
-			<if test="stagesId != null and stagesId != ''">
-				AND a.stagesId = #{stagesId}
-			</if>
-			<if test="transactionType != null and transactionType != ''">
-				AND a.transactionType = #{transactionType}
-			</if>
-			<if test="startTime != null and startTime != ''">
-				AND a.receiptsDate <![CDATA[  >=  ]]> #{startTime}
-			</if>
-			<if test="endTime != null and endTime != ''">
-				AND a.receiptsDate <![CDATA[   <=  ]]> #{endTime}
-			</if>
-			<if test="status != null and status != ''">
-				AND a.status = #{status}
-			</if>
-			AND  delFlag=0
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.orderId DESC,a.createDate DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="CmFinanceReceipts">
-		SELECT 
-			<include refid="cmFinanceReceiptsColumns"/>
-		FROM cm_finance_receipts a
-		<include refid="cmFinanceReceiptsJoins"/>
-		<where>
-			AND  delFlag=0
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.id DESC,a.createDate DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="CmFinanceReceipts"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cm_finance_receipts(
-			orderNo,
-			orderId,
-			transactionNum,
-			title,
-			productIds,
-			transactionWay,
-			transactionType,
-			payType,
-			totalAmount,
-			deductionAmount,
-			shouldPayAmount,
-			receiptsDate,
-			auditDate,
-			createBy,
-			createDate,
-			updateBy,
-			updateDate,
-			status,
-			stagesId
-		) VALUES (
-			#{orderNo},
-			#{orderId},
-			#{transactionNum},
-			#{title},
-			#{productIds},
-			#{transactionWay},
-			#{transactionType},
-			#{payType},
-			#{totalAmount},
-			#{deductionAmount},
-			#{shouldPayAmount},
-			#{receiptsDate},
-			#{auditDate},
-			#{createBy.id},
-			#{createDate},
-			#{updateBy.id},
-			#{updateDate},
-			#{status},
-			#{stagesId}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cm_finance_receipts SET 	
-			orderNo = #{orderNo},
-			orderId = #{orderId},
-			transactionNum = #{transactionNum},
-			title = #{title},
-			productIds = #{productIds},
-			transactionWay = #{transactionWay},
-			transactionType = #{transactionType},
-			payType = #{payType},
-			totalAmount = #{totalAmount},
-			deductionAmount = #{deductionAmount},
-			shouldPayAmount = #{shouldPayAmount},
-			receiptsDate = #{receiptsDate},
-			auditDate = #{auditDate},
-			updateBy = #{updateBy.id},
-			updateDate = #{updateDate},
-			status = #{status}
-		WHERE id = #{id}
-	</update>
-
-	<update id="updateReviewStatusPass">
-		UPDATE cm_finance_receipts SET
-		status = #{reStatus},
-		auditDate = #{reviewDate}
-		WHERE orderId = #{orderId}
-		AND productIds LIKE concat('%',#{orderProductId},'%')
-	</update>
-
-	<update id="updateReviewStatusPassById">
-		UPDATE cm_finance_receipts SET
-		status = #{reStatus},
-		auditDate = #{reviewDate}
-		WHERE id = #{receiptsId}
-	</update>
-
-	<update id="updateReviewStatusFail">
-		UPDATE cm_finance_receipts SET
-		status = #{reStatus}
-		WHERE orderId = #{orderId}
-		AND productIds LIKE concat('%',#{orderProductId},'%')
-	</update>
-
-	<update id="updateReviewStatusFailById">
-		UPDATE cm_finance_receipts SET
-		status = #{reStatus}
-		WHERE id = #{receiptsId}
-	</update>
-
-
-	<update id="deleteFinanceReceipts">
-		UPDATE cm_finance_receipts SET delFlag=1
-		WHERE orderId = #{orderId}
-		AND productIds = #{orderProductId}
-	</update>
-
-	<update id="deleteFinanceReceiptsById">
-		UPDATE cm_finance_receipts SET delFlag=1
-		WHERE id = #{receiptsId}
-	</update>
-
-
-	<update id="delete">
-		UPDATE cm_finance_receipts SET delFlag=1
-		WHERE id = #{id}
-	</update>
-	<!--分期订单-应付供应商 -->
-	<select id="findListByStagesId" resultType="CmFinanceReceipts">
-		SELECT
-		<include refid="cmFinanceReceiptsColumns"/>
-		FROM cm_finance_receipts a
-		<include refid="cmFinanceReceiptsJoins"/>
-		<where>
-			AND  a.delFlag=0
-			<if test="stagesId != null and stagesId != ''">
-				AND a.stagesId = #{stagesId}
-			</if>
-			<if test="orderId != null and orderId != ''">
-				AND a.orderId = #{orderId}
-			</if>
-			<if test="status != null and status != ''">
-				AND a.status != #{status}
-			</if>
-		</where>
-		ORDER  BY  a.id DESC
-	</select>
-
-	<select id="findListByProductIds" resultType="CmFinanceReceipts">
-		SELECT
-		<include refid="cmFinanceReceiptsColumns"/>
-		FROM cm_finance_receipts a
-		<include refid="cmFinanceReceiptsJoins"/>
-		<where>
-			AND  a.delFlag=0
-			<if test="productIds != null and productIds != ''">
-			AND a.productIds LIKE concat('%',#{productIds},'%')
-			</if>
-			<if test="orderId != null and orderId != ''">
-			AND a.orderId = #{orderId}
-			</if>
-			<if test="status != null and status != ''">
-				AND a.status != #{status}
-			</if>
-		</where>
-		ORDER  BY  a.id DESC
-	</select>
-
-	<update id="updateRecord">
-		UPDATE cm_finance_receipts SET
-		status = #{status},
-		transactionNum = #{transactionNum},
-		payType = #{payType},
-		receiptsDate = #{receiptsDate}
-		WHERE productIds = #{productIds}
-			AND orderId = #{orderId}
-		<if test="stagesId != null and stagesId != ''">
-			AND stagesId = #{stagesId}
-		</if>
-	</update>
-
-	<update id="updateStatus">
-		UPDATE cm_finance_receipts SET
-		<if test="status != null and status != ''">
-		status = #{status},
-		</if>
-		<if test="transactionNum != null and transactionNum != ''">
-		transactionNum = #{transactionNum},
-		</if>
-		<if test="payType != null and payType != ''">
-		payType = #{payType},
-		</if>
-		<if test="receiptsDate != null and receiptsDate != ''">
-		receiptsDate = #{receiptsDate},
-		</if>
-		<if test="auditDate != null and auditDate != ''">
-		auditDate = #{auditDate}
-		</if>
-		WHERE
-		<if test="stagesId != null and stagesId != ''">
-			stagesId = #{stagesId}
-		</if>
-		<if test="orderId != null and orderId != ''">
-			AND orderId = #{orderId}
-		</if>
-
-	</update>
-
-	<update id="updateDeleteFlag">
-		UPDATE cm_finance_receipts SET delFlag=1
-		WHERE
-		<if test="orderId != null and orderId != ''">
-		orderId = #{orderId}
-		</if>
-		<if test="productIds != null and productIds != ''">
-			AND productIds = #{productIds}
-		</if>
-		<if test="stagesId != null and stagesId != ''">
-			AND stagesId = #{stagesId}
-		</if>
-		<if test="id != null and id != ''">
-			AND id = #{id}
-		</if>
-	</update>
-
-</mapper>

+ 0 - 141
src/main/resources/mappings/modules/bulkpurchase/ContractMapper.xml

@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.bulkpurchase.dao.ContractDao">
-    
-	<sql id="contractColumns">
-		a.id AS "id",
-		a.name AS "name",
-		a.no AS "no",
-		a.clubId AS "clubId",
-		b.name AS "clubName",
-		a.stipulateFee AS "stipulateFee",
-		a.createBy AS "createBy.id",
-		a.createDate AS "createDate",
-		a.updateBy AS "updateBy.id",
-		a.updateDate AS "updateDate",
-		a.remarks AS "remarks",
-		a.freePostFlag AS "freePostFlag",
-		a.delFlag As "delFlag",
-		(SELECT count(1) FROM bp_product bp WHERE bp.contractId=a.id AND bp.delFlag=0) AS "productsSum",
-		(SELECT count(1) FROM bp_order bo WHERE bo.contractId=a.id AND bo.delFlag=0 ) AS "orderSum",
-		(SELECT count(1) FROM bp_order bo WHERE bo.contractId=a.id AND bo.delFlag=0 AND (bo.status != null OR bo.status != 0 )) AS "achieveOrederSum"
-	</sql>
-
-	
-	<sql id="contractJoins">
-		  LEFT JOIN  club b ON  b.clubID=a.clubId
-	</sql>
-    
-	<select id="get" resultType="Contract">
-		SELECT 
-			<include refid="contractColumns"/>
-		FROM bp_contract a
-		<include refid="contractJoins"/>
-		WHERE a.id = #{id}
-	</select>
-
-	<select id="findList" resultType="Contract">
-		SELECT 
-			<include refid="contractColumns"/>
-		FROM bp_contract a
-		<include refid="contractJoins"/>
-		<where>
-			<if test="id != null and id != ''">
-				AND a.id = #{id}
-			</if>
-			<if test="name != null and name != ''">
-				AND a.name LIKE concat('%',#{name},'%')
-			</if>
-			<if test="clubName != null and clubName != ''">
-				AND b.name LIKE concat('%',#{clubName},'%')
-			</if>
-			<if test="no != null and no != ''">
-				AND a.no = #{no}
-			</if>
-			<if test="clubId != null and clubId != ''">
-				AND a.clubId = #{clubId}
-			</if>
-			<if test="startTime != null and startTime != ''">
-				AND DATE_FORMAT(a.createDate,'%Y-%m-%d')=#{startTime}
-			</if>
-			AND a.delFlag = #{DEL_FLAG_NORMAL}
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER  BY  a.createDate DESC
-			</otherwise>
-		</choose>
-	</select>
-	<select id="findAllList" resultType="Contract">
-		SELECT 
-			<include refid="contractColumns"/>
-		FROM bp_contract a
-		<include refid="contractJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="Contract"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO bp_contract(
-			name,
-			no,
-			clubId,
-			stipulateFee,
-			createDate,
-			remarks,
-			createBy,
-			updateBy,
-			updateDate,
-			delFlag,
-			freePostFlag
-		) VALUES (
-			#{name},
-			#{no},
-			#{clubId},
-			#{stipulateFee},
-			#{createDate},
-			#{remarks},
-			#{createBy.id},
-			#{updateBy.id},
-			#{updateDate},
-			#{delFlag},
-			#{freePostFlag}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE bp_contract SET 	
-			name = #{name},
-			no = #{no},
-			clubId = #{clubId},
-			stipulateFee = #{stipulateFee},
-			remarks = #{remarks},
-			updateBy = #{updateBy.id},
-			updateDate = #{updateDate}
-		WHERE id = #{id}
-	</update>
-	
-	<update id="delete">
-		UPDATE bp_contract set delFlag=#{delFlag} WHERE id = #{id}
-	</update>
-	<select id="getFreePostFlagByContracId" resultType="Integer">
-		SELECT `freePostFlag` FROM `bp_contract` WHERE id=#{id}
-	</select>
-	<select id="getUserMoneyByClubId" resultType="Double">
-		SELECT userMoney FROM `user` WHERE userid =(SELECT userId FROM club b left join   bp_contract c on b.clubid=c.clubid where c.id =#{id})
-	</select>
-	<select id="getContractByNo" resultType="Contract">
-		SELECT  * from bp_contract where no=#{no}
-	</select>
-</mapper>

+ 0 - 345
src/main/resources/mappings/modules/bulkpurchase/ContractOrderMapper.xml

@@ -1,345 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.bulkpurchase.dao.ContractOrderDao">
-    
-	<sql id="contractOrderColumns">
-		a.id AS "id",
-		a.clubId AS "clubId",
-		b.name AS "name",
-		a.contractId AS "contractId",
-		a.no AS "no",
-		a.status AS "status",
-		a.payWay AS "payWay",
-		a.orderSource AS "orderSource",
-		a.remarks AS "remarks",
-		a.createDate AS "createDate",
-		a.productCount AS "productCount",
-		a.presentCount AS "presentCount",
-		a.productTotalFee AS "productTotalFee",
-		a.orderTotalFee AS "orderTotalFee",
-		a.payTotalFee AS "payTotalFee",
-		a.balancePayFee AS "balancePayFee",
-		a.freePostFlag AS "freePostFlag",
-		a.freight AS "freight",
-		a.discount AS "discount",
-		a.cooFreeFlag AS "cooFreeFlag",
-		a.cooFreeRate AS "cooFreeRate",
-		a.cooFreeAmount AS "cooFreeAmount",
-		a.delFlag AS "delFlag",
-		(SELECT count(1) FROM  bp_order_product bop WHERE  bop.orderId=a.id) AS "num" ,
-		bou.shouHuoRen AS "shouHuoRen",
-		a.confirmFlag AS "confirmFlag",
-		a.stagesFlag AS "stagesFlag",
-		a.stagesRemarks AS "stagesRemarks",
-		a.clauseId AS "clauseId",
-		a.spId AS "spId",
-		(SELECT COUNT(1) FROM bp_order_stages bos WHERE bos.orderId = a.id ) AS "stagesNum",
-		a.orderStopFlag AS "orderStopFlag",
-		a.orderStopRemarks AS "orderStopRemarks",
-		a.clauseContent AS "clauseContent",
-		a.clauseName AS "clauseName",
-		(SELECT clauseType FROM bp_clause bp WHERE bp.Id = a.clauseId ) AS "clauseType",
-		(SELECT IFNULL(sum(shouldPayFee),0) FROM bp_order_product WHERE orderId=a.id AND payStatus=1) AS "received",
-		(SELECT IFNULL(sum(shouldPayFee),0) FROM bp_order_product WHERE orderId=a.id AND (payStatus=0 OR payStatus is NULL )) AS "uncollected",
-		(SELECT IFNULL(sum(fee),0) FROM bp_order_stages WHERE orderId=a.id AND payStatus=1) AS "stagesReceived",
-		(SELECT IFNULL(sum(fee),0) FROM bp_order_stages WHERE orderId=a.id AND (payStatus=0 OR payStatus is NULL )) AS "stagesUncollected",
-		a.refundsAmount AS "refundsAmount",
-		a.orderStatusFlag AS "orderStatusFlag",
-		a.buyAgainFlag AS "buyAgainFlag"
-	</sql>
-
-	<sql id="contractOrderJoins">
-		LEFT JOIN club b ON b.clubID=a.clubId
-		LEFT JOIN bp_order_userinfo bou ON bou.orderId=a.id
-	</sql>
-
-	<select id="get" resultType="ContractOrder">
-		SELECT
-			<include refid="contractOrderColumns"/>
-		FROM bp_order a
-		<include refid="contractOrderJoins"/>
-		WHERE a.id = #{id}
-	</select>
-
-	<select id="findList" resultType="ContractOrder">
-		SELECT
-			<include refid="contractOrderColumns"/>
-		FROM bp_order a
-		<include refid="contractOrderJoins"/>
-		<where>
-			<if test="contractId != null and contractId != ''">
-			AND a.contractId = #{contractId}
-			</if>
-
-			<if test="id != null and id != ''">
-				AND a.id = #{id}
-			</if>
-		    <if test="no != null and no != ''">
-				AND a.no = #{no}
-			</if>
-			<if test="status != null and status != ''">
-				AND a.status = #{status}
-			</if>
-			<if test="name != null and name != ''">
-				AND b.name LIKE concat('%',#{name},'%')
-			</if>
-			<if test="orderSource != null and orderSource != ''">
-				AND a.orderSource = #{orderSource}
-			</if>
-			<if test="orderStatusFlag != null and orderStatusFlag != ''">
-				AND a.orderStatusFlag = #{orderStatusFlag}
-			</if>
-			<if test="createDate != null and createDate != ''">
-				AND a.createDate = #{createDate}
-			</if>
-			<if test="orderStopFlag != null and orderStopFlag != ''">
-				<if test="orderStopFlag == 0">
-					AND (a.orderStopFlag = #{orderStopFlag} OR a.orderStopFlag IS NULL)
-				</if>
-				<if test="orderStopFlag == 1">
-					AND a.orderStopFlag = #{orderStopFlag}
-				</if>
-			</if>
-			<if test="stagesFlag != null and stagesFlag != ''">
-				<if test="stagesFlag == 0">
-					AND (a.stagesFlag = #{stagesFlag} OR a.stagesFlag IS NULL)
-				</if>
-				<if test="stagesFlag == 1">
-					AND a.stagesFlag = #{stagesFlag}
-				</if>
-			</if>
-			<if test="startTime != null and startTime != ''">
-				AND a.createDate <![CDATA[  >=  ]]> #{startTime}
-			</if>
-			<if test="endTime != null and endTime != ''">
-				AND a.createDate <![CDATA[   <=  ]]> #{endTime}
-			</if>
-				AND a.delFlag = 0
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY case WHEN a.orderStatusFlag = 2 then 0 else 1 END,a.id DESC,a.createDate DESC
-			</otherwise>
-		</choose>
-	</select>
-
-	<select id="findAllList" resultType="ContractOrder">
-		SELECT
-			<include refid="contractOrderColumns"/>
-		FROM bp_order a
-		<include refid="contractOrderJoins"/>
-		<where>
-
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY case WHEN a.orderStatusFlag = 2 then 0 else 1 END,a.id DESC,a.createDate DESC
-			</otherwise>
-		</choose>
-	</select>
-
-	<insert id="insert" parameterType="ContractOrder"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO bp_order(
-			clubId,
-			contractId,
-			no,
-			status,
-			payWay,
-			orderSource,
-			buyAgainFlag,
-			remarks,
-			createDate,
-			productCount,
-			presentCount,
-			productTotalFee,
-			orderTotalFee,
-			payTotalFee,
-			balancePayFee,
-			freePostFlag,
-			freight,
-			discount,
-			cooFreeFlag,
-			cooFreeRate,
-			cooFreeAmount,
-			delFlag,
-			confirmFlag,
-			stagesFlag,
-			stagesRemarks,
-			clauseId,
-			clauseName,
-			clauseContent,
-			orderStopFlag,
-			orderStopRemarks
-		) VALUES (
-			#{clubId},
-			#{contractId},
-			#{no},
-			#{status},
-			#{payWay},
-			#{orderSource},
-			#{buyAgainFlag},
-			#{remarks},
-			#{createDate},
-			#{productCount},
-			#{presentCount},
-			#{productTotalFee},
-			#{orderTotalFee},
-			#{payTotalFee},
-			#{balancePayFee},
-			#{freePostFlag},
-			#{freight},
-			#{discount},
-			#{cooFreeFlag},
-			#{cooFreeRate},
-			#{cooFreeAmount},
-			#{delFlag},
-			#{confirmFlag},
-			#{stagesFlag},
-			#{stagesRemarks},
-			#{clauseId},
-			#{clauseName},
-			#{clauseContent},
-			#{orderStopFlag},
-			#{orderStopRemarks}
-		)
-	</insert>
-
-	<update id="update">
-		UPDATE bp_order SET
-			clubId = #{clubId},
-			contractId = #{contractId},
-			no = #{no},
-			status = #{status},
-			payWay = #{payWay},
-			orderSource = #{orderSource},
-			remarks = #{remarks},
-			createDate = #{createDate},
-			productCount = #{productCount},
-			presentCount = #{presentCount},
-			productTotalFee = #{productTotalFee},
-			orderTotalFee = #{orderTotalFee},
-			payTotalFee = #{payTotalFee},
-			balancePayFee = #{balancePayFee},
-			freePostFlag = #{freePostFlag},
-			freight = #{freight},
-			discount = #{discount},
-			cooFreeFlag = #{cooFreeFlag},
-			cooFreeRate = #{cooFreeRate},
-			cooFreeAmount = #{cooFreeAmount},
-			delFlag = #{delFlag},
-			confirmFlag = #{confirmFlag},
-			stagesFlag = #{stagesFlag},
-			stagesRemarks = #{stagesRemarks},
-			clauseId = #{clauseId},
-			clauseName = #{clauseName},
-			clauseContent = #{clauseContent},
-			orderStopFlag = #{orderStopFlag},
-			orderStopRemarks = #{orderStopRemarks}
-		WHERE id = #{id}
-	</update>
-
-	<update id="delete">
-		UPDATE bp_order SET delFlag = #{delFlag} WHERE id = #{id}
-	</update>
-	<select id="findAllPage" resultType="contractOrder">
-		SELECT a.* ,COUNT(b.id) num,
-		c.name name,c.shouHuoRen shouHuoRen
-		FROM `bp_order` a LEFT JOIN
-		`bp_order_product` b ON a.id =b.`orderId`
-		JOIN `bp_order_userinfo` c
-		ON a.id =c.`orderId`
-		<where>
-			<if test="contractId != null and contractId != ''">
-				AND a.contractId = #{contractId}
-			</if>
-			<if test="id != null and id != ''">
-				AND a.id = #{id}
-			</if>
-			<if test="status != null and status != ''">
-				AND a.status = #{status}
-			</if>
-			<if test="orderSource != null and orderSource != ''">
-				AND a.orderSource = #{orderSource}
-			</if>
-			<if test="orderStatusFlag != null and orderStatusFlag != ''">
-				AND a.orderStatusFlag = #{orderStatusFlag}
-			</if>
-			<if test="startTime != null and startTime != ''  ">
-				AND a.createDate <![CDATA[  >=  ]]> #{startTime}
-			</if>
-			<if test="endTime !=null and endTime != ''">
-				AND a.createDate <![CDATA[   <=  ]]>#{endTime}
-			</if>
-			<if test="delFlag != null and delFlag != ''">
-				AND a.delFlag = 0
-			</if>
-			<if test="name!=null and name!=''">
-				AND a.id in (select orderid from `bp_order_userinfo` where  `name` LIKE
-				<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>)
-			</if>
-			AND b.delFlag = 0
-		</where>
-		GROUP BY a.id
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY case WHEN a.orderStatusFlag = 2 then 0 else 1 END,a.id DESC,a.createDate DESC
-			</otherwise>
-		</choose>
-	</select>
-	<!--<select id="selectFreePostFlag" resultType="Integer">
-		select freePostFlag from
-	</select>-->
-<select id="findCountList" resultType="Integer">
-	SELECT count(1) from bp_order where contractId = #{contractId}
-</select>
-	<select id="findCompleteList" resultType="Integer">
-		SELECT count(1) from bp_order where status = 5
-	</select>
-
-	<update id="saveConfirmFlag">
-		UPDATE bp_order SET
-		confirmFlag = #{confirmFlag} ,
-		clauseName = #{clauseName} ,
-		clauseContent = #{clauseContent}
-		WHERE id = #{id}
-	</update>
-
-	<update id="updateOrderStatus">
-		UPDATE bp_order SET status = #{orderStatus} WHERE id = #{orderId}
-	</update>
-
-	<update id="updateClauseContent">
-		UPDATE bp_order SET clauseContent = #{clauseContent},clauseName= #{clauseName}WHERE id = #{id}
-	</update>
-
-	<update id="saveOrderStopInfo">
-		UPDATE bp_order SET
-		orderStopFlag = #{orderStopFlag},
-		orderStopRemarks = #{orderStopRemarks}
-		WHERE id = #{id}
-	</update>
-	<update id="saveOrderStatusFlag">
-		UPDATE bp_order SET
-		orderStatusFlag = #{orderStatusFlag},
-		refundsAmount = #{refundsAmount}
-		WHERE id = #{id}
-	</update>
-
-	<update id="updateOrderStatusInfo">
-		UPDATE bp_order SET
-		status = #{status},
-		updateDate = #{updateDate}
-		WHERE id = #{id}
-	</update>
-</mapper>

+ 0 - 264
src/main/resources/mappings/modules/bulkpurchase/OrderProductMapper.xml

@@ -1,264 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.bulkpurchase.dao.OrderProductDao">
-    <resultMap id="ResultorderProduct" type="OrderProduct">
-		<result property="productId" column="productId"/>
-		<result column="id" property="contractProductId"/>
-		<result  column="shopName" property="shopName"/>
-		<result column="shopId" property="shopId"/>
-		<result column="price1" property="price"/>
-		<result column="discount" property="discount"/>
-		<result  column="discountPrice" property="discountPrice"/>
-		<result column="taxRate" property="taxRate"/>
-		<result  column="addedValueTax" property="addedValueTax"/>
-		<result  column="totalAddedValueTax" property="totalAddedValueTax"/>
-		<result column="stipulateFlag" property="stipulateFlag"/>
-		<result column="name" property="name"/>
-		<result column="image" property="image"/>
-		<result column="contractId" property="contractId"/>
-		<result column="shopFee" property="shopFee"/>
-		<result column="otherFee" property="otherFee"/>
-		<result column="cmFee" property="cmFee"/>
-
-	</resultMap>
-	<sql id="orderProductColumns">
-		a.id AS "id",
-		a.orderId AS "orderId",
-		a.contractProductId AS "contractProductId",
-		a.num AS "num",
-		a.presentNum AS "presentNum",
-		a.totalFee AS "totalFee",
-		a.productId AS "productId",
-		a.name AS "name",
-		a.image AS "image",
-		a.productNo AS "productNo",
-		a.price AS "price",
-		a.contractId AS "contractId",
-		a.shopId AS "shopId",
-		a.shopName AS "shopName",
-		a.discount AS "discount",
-		a.discountPrice AS "discountPrice",
-		a.taxRate AS "taxRate",
-		a.addedValueTax AS "addedValueTax",
-		a.totalAddedValueTax AS "totalAddedValueTax",
-		a.stipulateFlag AS "stipulateFlag",
-		a.shopFee AS "shopFee",
-		a.otherFee AS "otherFee",
-		a.cmFee AS "cmFee",
-		a.shouldPayFee AS "shouldPayFee",
-		a.payDate AS "payDate",
-		a.payStatus AS "payStatus",
-		a.buyAgainFlag AS "buyAgainFlag"
-	</sql>
-
-	<sql id="orderProductJoins">
-	</sql>
-
-	<select id="get" resultType="OrderProduct">
-		SELECT
-			<include refid="orderProductColumns"/>
-		FROM bp_order_product a
-		<include refid="orderProductJoins"/>
-		WHERE a.id = #{id}
-	</select>
-
-	<select id="findList" resultMap="ResultorderProduct">
-	SELECT a.* ,b.name ,b.price,c.`name` shopName
-	FROM  `bp_product`  a LEFT JOIN product b ON a.`productId` =b.`productID` JOIN shop c ON a.`shopId` = c.`shopID`
-	WHERE  1=1
-		<if test="contractId != null and contractId != ''">
-			AND a.contractId=#{contractId}
-		</if>
-		AND a.delFlag = 0
-		and b.productCategory  = 1
-		ORDER  BY a.id DESC
-	</select>
-
-	<select id="findAllList" resultType="OrderProduct">
-		SELECT
-			<include refid="orderProductColumns"/>
-		FROM bp_order_product a
-		<include refid="orderProductJoins"/>
-		<where>
-			<if test="orderId != null and orderId != ''">
-				AND a.orderId = #{orderId}
-			</if>
-			<if test="contractId!=null and contractId!=''">
-				contractId=#{contractId}
-			</if>
-			<if test="shopId != null and shopId != ''">
-				AND a.shopId=#{shopId}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-
-	<insert id="insert" parameterType="OrderProduct"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO bp_order_product(
-			orderId,
-			contractProductId,
-			num,
-			presentNum,
-			totalFee,
-			productId,
-			name,
-			image,
-			productNo,
-			price,
-			contractId,
-			shopId,
-			shopName,
-			discount,
-			discountPrice,
-			taxRate,
-			addedValueTax,
-			totalAddedValueTax,
-			stipulateFlag,
-			shopFee,
-			otherFee,
-			cmFee,
-			shopFee1,
-			otherFee1,
-			cmFee1,
-			shouldPayFee,
-			buyAgainFlag
-		) VALUES (
-			#{orderId},
-			#{contractProductId},
-			#{num},
-			#{presentNum},
-			#{totalFee},
-			#{productId},
-			#{name},
-			#{image},
-			#{productNo},
-			#{price},
-			#{contractId},
-			#{shopId},
-			#{shopName},
-			#{discount},
-			#{discountPrice},
-			#{taxRate},
-			#{addedValueTax},
-			#{totalAddedValueTax},
-			#{stipulateFlag},
-			#{shopFee},
-			#{otherFee},
-			#{cmFee},
-			#{shopFee1},
-			#{otherFee1},
-			#{cmFee1},
-			#{shouldPayFee},
-			#{buyAgainFlag}
-		)
-	</insert>
-
-	<update id="update">
-		UPDATE bp_order_product SET
-			orderId = #{orderId},
-			contractProductId = #{contractProductId},
-			num = #{num},
-			presentNum = #{presentNum},
-			totalFee = #{totalFee},
-			productId = #{productId},
-			name = #{name},
-			image = #{image},
-			productNo = #{productNo},
-			price = #{price},
-			contractId = #{contractId},
-			shopId = #{shopId},
-			shopName = #{shopName},
-			discount = #{discount},
-			discountPrice = #{discountPrice},
-			taxRate = #{taxRate},
-			addedValueTax = #{addedValueTax},
-			totalAddedValueTax = #{totalAddedValueTax},
-			stipulateFlag = #{stipulateFlag},
-			shopFee = #{shopFee},
-			otherFee = #{otherFee},
-			cmFee = #{cmFee},
-			shouldPayFee = #{shouldPayFee},
-			buyAgainFlag = #{buyAgainFlag}
-		WHERE id = #{id}
-	</update>
-
-	<select id="findStipulateFee" resultType="Integer">
-		SELECT stipulateFee FROM `bp_contract` WHERE `id`=#{contractId}
-	</select>
-	<delete id="delete">
-		DELETE FROM bp_order_product WHERE id = #{id}
-	</delete>
-
-	<update id="deleteByOrderId">
-		DELETE FROM bp_order_product WHERE orderId=#{orderId}
-	</update>
-
-	<update id="updatePayStatus">
-		UPDATE bp_order_product SET
-			payStatus = #{payStatus},
-			payDate = #{orderPayDate}
-		WHERE id = #{orderProductId}
-	</update>
-
-	<select id="getWithorderId" resultType="OrderProduct">
-		SELECT  a.* ,b.shopFee "shopBppFee",b.otherFee "otherBppFee",b.cmFee "cmBppFee",s.ledgerNo AS "ledgerNo"
-		from bp_order_product a
-		LEFT JOIN bp_product b ON b.id=a.contractProductId
-		LEFT JOIN shop s on s.shopID = a.shopId
-		where a.orderId =#{orderId}
-	</select>
-
-	<!--通过订单ID获取订单商品并以供应商分组-->
-	<select id="getWithorderIdGroupByShopId" resultType="OrderProduct">
-		SELECT  a.*
-		from bp_order_product a
-		where a.orderId =#{orderId}
-		GROUP BY a.shopId
-	</select>
-
-	<select id="getTotalPay" resultType="java.lang.Double">
-		SELECT  sum(ROUND(shopFee, 2))
-		from bp_order_product
-		where orderId =#{orderId}
-		AND shopId =#{shopId}
-	</select>
-
-	<!--通过订单ID统计订单商品表中对应第三方的应付总额-->
-	<select id="totalOtherFee" resultType="java.lang.Double">
-		SELECT  sum(ROUND(otherFee, 2))
-		from bp_order_product
-		where orderId =#{orderId}
-	</select>
-
-	<select id="getCmTotalPay" resultType="java.lang.Double">
-		SELECT  sum(cmFee)
-		from bp_order_product
-		where orderId =#{orderId}
-	</select>
-
-	<select id="getProductNameByOrderproductId" resultType="OrderProduct">
-        SELECT `name` from bp_order_product  where id =#{ProductId}
-	</select>
-
-	<select id="findByOrderIdGroupByShopId" resultType="OrderProduct">
-		SELECT
-		<include refid="orderProductColumns"/>
-		FROM bp_order_product a
-		<include refid="orderProductJoins"/>
-		WHERE a.orderId=#{orderId} GROUP BY a.shopId;
-	</select>
-
-
-	<update id="updateShopConfigFlag">
-		UPDATE bp_order_product SET
-		confirmProductFlag = 0
-		WHERE orderId = #{orderId}
-	</update>
-
-</mapper>

+ 0 - 83
src/main/resources/mappings/modules/bulkpurchase/OrderStagesMapper.xml

@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.bulkpurchase.dao.OrderStagesDao">
-
-	<select id="get" resultType="OrderStages">
-		SELECT *
-		FROM bp_order_stages a
-		WHERE  a.id=#{id}
-	</select>
-	
-	<select id="findStagesByOrderId" resultType="OrderStages">
-		SELECT *
-		FROM bp_order_stages bos
-		<where>
-			<if test="orderId != null and orderId != ''">
-			   AND bos.orderId = #{orderId}
-			</if>
-		</where>		
-				ORDER BY bos.id ASC
-	</select>
-
-	<select id="findList" resultType="com.caimei.modules.bulkpurchase.entity.OrderStages">
-		SELECT *
-		FROM bp_order_stages bos
-		<where>
-			<if test="orderId != null and orderId != ''">
-				AND bos.orderId = #{orderId}
-			</if>
-			<if test="id != null and id != ''">
-				AND  bos.id = #{id}
-			</if>
-		</where>
-		ORDER BY bos.id ASC
-	</select>
-
-	<update id="updateStatus">
-		UPDATE bp_order_stages SET
-		payStatus = #{payStatus},
-		payDate = #{payDate}
-		WHERE 1=1
-		<if test="id != null and id != ''">
-	    AND id = #{id}
-		</if>
-		<if test="orderId != null and orderId != ''">
-	    AND orderId = #{orderId}
-		</if>
-	</update>
-
-	<delete id="deleteByOrderId">
-		DELETE FROM bp_order_stages WHERE orderId = #{orderId}
-	</delete>
-
-	<insert id="insert" parameterType="com.caimei.modules.bulkpurchase.entity.OrderStages" keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO bp_order_stages(
-			orderId,
-			num,
-			description,
-			fee,
-			cmFee,
-			otherFee,
-			shopFee,
-			date,
-			updateDate,
-			serviceProviderId,
-			clubId,
-			clauseId
-		) VALUES (
-			#{orderId},
-			#{num},
-			#{description},
-			#{fee},
-			#{cmFee},
-			#{otherFee},
-			#{shopFee},
-			#{date},
-			#{updateDate},
-			#{serviceProviderId},
-			#{clubId},
-			#{clauseId}
-		)
-	</insert>
-
-</mapper>

+ 0 - 44
src/main/resources/mappings/modules/bulkpurchase/OrderStagesProductMapper.xml

@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.bulkpurchase.dao.OrderStagesProductDao">
-
-	<select id="get" resultType="OrderStagesProduct">
-		SELECT *
-		FROM bp_order_stages_product a
-		WHERE a.id=#{id}
-	</select>
-	
-	<select id="findStagesProductBuyStagesId" resultType="com.caimei.modules.bulkpurchase.entity.OrderStagesProduct">
-		SELECT *
-		FROM bp_order_stages_product bosp
-		<where>
-			<if test="stagesId != null and stagesId != ''">
-			   AND bosp.stagesId = #{stagesId}
-			</if>
-		</where>		
-				ORDER BY bosp.id ASC
-	</select>
-
-	<delete id="deleteByOrderId">
-		DELETE FROM bp_order_stages_product WHERE orderId = #{orderId}
-	</delete>
-
-	<insert id="insert" parameterType="com.caimei.modules.bulkpurchase.entity.OrderStagesProduct" keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO bp_order_stages_product(
-		stagesId,
-		orderId,
-		stagesNum,
-		productId,
-		productName,
-		productNum
-		) VALUES (
-		#{stagesId},
-		#{orderId},
-		#{stagesNum},
-		#{productId},
-		#{productName},
-		#{productNum}
-		)
-	</insert>
-
-</mapper>

+ 0 - 96
src/main/resources/mappings/modules/bulkpurchase/ProductPrivilegeMapper.xml

@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.bulkpurchase.dao.ProductPrivilegeDao">
-
-    <sql id="productPrivilegeColumns">
-		a.id AS "id",
-		a.contractProductId AS "contractProductId",
-		a.purchase AS "purchase",
-		a.present AS "present",
-		a.vailFlag AS "vailFlag"
-	</sql>
-
-    <sql id="productPrivilegeJoins">
-    </sql>
-
-    <select id="get" resultType="ProductPrivilege">
-        SELECT
-        <include refid="productPrivilegeColumns"/>
-        FROM bp_product_privilege a
-        <include refid="productPrivilegeJoins"/>
-        WHERE a.id = #{id}
-    </select>
-
-    <select id="findList" resultType="ProductPrivilege">
-        SELECT
-        <include refid="productPrivilegeColumns"/>
-        FROM bp_product_privilege a
-        <include refid="productPrivilegeJoins"/>
-        <where>
-
-            <if test="id != null and id != ''">
-                AND a.id = #{id}
-            </if>
-            <if test="contractProductId != null and contractProductId != ''">
-                AND a.contractProductId = #{contractProductId}
-            </if>
-        </where>
-        <choose>
-            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
-                ORDER BY ${page.orderBy}
-            </when>
-            <otherwise>
-            </otherwise>
-        </choose>
-    </select>
-
-    <select id="findAllList" resultType="ProductPrivilege">
-        SELECT
-        <include refid="productPrivilegeColumns"/>
-        FROM bp_product_privilege a
-        <include refid="productPrivilegeJoins"/>
-        <where>
-
-        </where>
-        <choose>
-            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
-                ORDER BY ${page.orderBy}
-            </when>
-            <otherwise>
-            </otherwise>
-        </choose>
-    </select>
-
-    <insert id="insert" parameterType="ProductPrivilege" keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO bp_product_privilege(
-			contractProductId,
-			purchase,
-			present,
-			vailFlag
-		) VALUES (
-			#{contractProductId},
-			#{purchase},
-			#{present},
-			#{vailFlag}
-		)
-	</insert>
-
-    <update id="update">
-		UPDATE bp_product_privilege SET 	
-			contractProductId = #{contractProductId},
-			purchase = #{purchase},
-			present = #{present},
-			vailFlag = #{vailFlag}
-		WHERE id = #{id}
-	</update>
-
-    <delete id="delete">
-		DELETE FROM bp_product_privilege
-		WHERE contractProductId = #{contractProductId}
-	</delete>
-    <select id="findListByProductId" resultType="ProductPrivilege">
-		SELECT * FROM `bp_product_privilege` WHERE `contractProductId` =#{contractProductId}
-	</select>
-
-
-</mapper>

+ 0 - 223
src/main/resources/mappings/modules/bulkpurchase/PurchaseProductMapper.xml

@@ -1,223 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.bulkpurchase.dao.PurchaseProductDao">
-
-    <resultMap id="resultShop" type="PurchaseProduct">
-        <result column="productID" property="productId"/>
-        <result column="name" property="purchaseProductName"/>
-        <result column="shopName" property="shopName"/>
-        <result column="shopID" property="shopId"/>
-        <result column="price" property="price"/>
-    </resultMap>
-    <sql id="purchaseProductColumns">
-        a.id AS "id",
-		a.contractId AS "contractId",
-		a.productId AS "productId",
-		a.discount AS "discount",
-		a.discountPrice AS "discountPrice",
-		a.taxRate AS "taxRate",
-		a.addedValueTax AS "addedValueTax",
-		a.stipulateFlag AS "stipulateFlag",
-		a.delFlag AS "delFlag",
-		a.shopFee AS "shopFee",
-		a.otherFee AS "otherFee",
-		a.cmFee AS "cmFee"
-    </sql>
-
-
-    <sql id="purchaseProductJoins">
-    </sql>
-
-
-    <select id="get" resultType="PurchaseProduct">
-        SELECT
-        <include refid="purchaseProductColumns"/>
-        FROM bp_product a
-        <include refid="purchaseProductJoins"/>
-        WHERE a.id = #{id}
-    </select>
-    <select id="findProductList" resultType="PurchaseProduct">
-
-    </select>
-
-    <select id="findList" resultType="PurchaseProduct">
-        SELECT b.name shopName ,b.`shopID` shopId,a.name purchaseProductName,
-        a.`productID` productId,a.productCode productNo,a.mainImage image,a.includedTax AS includedTax,a.machineType,
-        a.invoiceType AS invoiceType, a.taxPoint AS taxRate, a.supplierTaxPoint AS supplierTaxRate, a.commodityType,
-        if(csp.id is not null and csu.id is not null and csp.status=0,1,0) as svipPriceFlag
-        FROM product a LEFT JOIN shop b ON b.shopID=a.shopID
-        left join cm_svip_product csp on a.productID = csp.productId
-        left join cm_svip_user csu on csu.userId = #{userId} and csu.delFlag = '0' and now() <![CDATA[ < ]]> csu.endTime
-        <where>
-            <if test="purchaseProductName != null and purchaseProductName != ''">
-                AND a.name LIKE concat('%',#{purchaseProductName},'%')
-            </if>
-            <if test="productId != null and productId != ''">
-                AND a.productID = #{productId}
-            </if>
-            <if test="shopName != null and shopName != ''">
-                AND b.name like concat('%',#{shopName},'%')
-            </if>
-            and (a.validFlag=2 or a.validFlag = 9)
-            AND a.productID != 999
-            and a.productCategory = 1
-        </where>
-        <choose>
-            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
-                ORDER BY ${page.orderBy}
-            </when>
-            <otherwise>
-            </otherwise>
-        </choose>
-    </select>
-    <select id="findAllList" resultType="PurchaseProduct">
-        SELECT
-        <include refid="purchaseProductColumns"/>
-        FROM bp_product a
-        <include refid="purchaseProductJoins"/>
-        <where>
-            a.delFlag = 0
-        </where>
-        <choose>
-            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
-                ORDER BY ${page.orderBy}
-            </when>
-            <otherwise>
-            </otherwise>
-        </choose>
-    </select>
-
-    <insert id="insert" parameterType="PurchaseProduct" keyProperty="id" useGeneratedKeys="true">
-        INSERT INTO bp_product(id,
-                               contractId,
-                               productId,
-                               shopId,
-                               discount,
-                               discountPrice,
-                               taxRate,
-                               addedValueTax,
-                               stipulateFlag,
-                               delFlag,
-                               shopFee,
-                               otherFee,
-                               cmFee)
-        VALUES (#{id},
-                #{contractId},
-                #{productId},
-                #{shopId},
-                #{discount},
-                #{discountPrice},
-                #{taxRate},
-                #{addedValueTax},
-                #{stipulateFlag},
-                #{delFlag},
-                #{shopFee},
-                #{otherFee},
-                #{cmFee})
-    </insert>
-    <select id="getPurchaseProductByCtId" resultMap="resultShop">
-        SELECT a.*,
-               b.name                                                                                 shopName,
-               c.name,
-               (select price from cm_sku where productId = c.productID order by price asc limit 1) as "price"
-        FROM bp_product a
-                 LEFT JOIN shop b ON a.shopId = b.`shopID`
-                 JOIN product c ON a.productId = c.productid
-        WHERE a.`contractId` = #{contractId}
-          AND a.delFlag = 0
-          and c.productCategory = 1
-    </select>
-    <update id="update">
-        UPDATE bp_product
-        SET contractId    = #{contractId},
-            productId     = #{productId},
-            shopId        = #{shopId},
-            discount      = #{discount},
-            discountPrice = #{discountPrice},
-            taxRate       = #{taxRate},
-            addedValueTax = #{addedValueTax},
-            stipulateFlag = #{stipulateFlag},
-            delFlag       = #{delFlag},
-            shopFee       = #{shopFee},
-            otherFee      = #{otherFee},
-            cmFee         = #{cmFee}
-        WHERE id = #{id}
-    </update>
-
-    <delete id="delete">
-        DELETE
-        FROM bp_product
-        WHERE id = #{id}
-    </delete>
-    <select id="findCount" resultType="Integer">
-        SELECT count(1)
-        FROM `bp_product`
-        where contractId = #{contractId}
-          AND delFlag = 0
-    </select>
-    <select id="findSencondProductPage" resultType="com.caimei.modules.bulkpurchase.entity.PurchaseProduct">
-        SELECT b.name as shopName ,b.`shopID` as shopId,a.name purchaseProductName,
-        cs.price,a.`productID` as productId,a.productCode productNo,a.mainImage image
-        ,cs.costCheckFlag,cs.costPrice,cs.costProportional, cs.normalPrice
-        ,a.productCategory as "productCategory",cshd.secondHandType as "secondHandType",cs.ladderPriceFlag
-        ,a.includedTax,a.invoiceType
-        FROM product a LEFT JOIN shop b ON b.shopID=a.shopID
-        left join cm_sku cs on a.productID=cs.productId
-        left join cm_second_hand_detail cshd on cshd.productID = a.productID
-        <where>
-            <if test="purchaseProductName != null and purchaseProductName != ''">
-                AND a.name LIKE concat('%',#{purchaseProductName},'%')
-            </if>
-            <if test="productId != null and productId != ''">
-                AND a.productID = #{productId}
-            </if>
-            <if test="shopName != null and shopName != ''">
-                AND b.name like concat('%',#{shopName},'%')是否含税
-            </if>
-            and a.validFlag=2
-            AND a.productID != 999
-            and a.productCategory = 2
-            and cshd.sold != 1
-        </where>
-        <!--		<choose>
-                    <when test="page !=null and page.orderBy != null and page.orderBy != ''">
-                        ORDER BY ${page.orderBy}
-                    </when>
-                    <otherwise>
-                    </otherwise>
-                </choose>-->
-    </select>
-    <select id="findLadderPriceList" resultType="com.caimei.po.ProductLadderPrice">
-        SELECT *
-        FROM product_ladder_price
-        WHERE productId = #{productId}
-          AND buyNum is NOT null
-          AND buyPrice is NOT null
-          AND delFlag = 0
-        ORDER BY ladderNum ASC
-    </select>
-    <select id="checkSvipProduct" resultType="java.lang.Integer">
-        select if(csp.id is not null and csu.id is not null and csp.status=0, 1, 0) as svipPriceFlag
-        from cm_svip_product csp
-                 left join cm_svip_user csu
-                           on csu.userId = #{userId} and csu.delFlag = '0' and now() <![CDATA[ < ]]> csu.endTime
-        where csp.productId = #{productId};
-    </select>
-    <select id="getSvipProduct" resultType="com.caimei.modules.svip.entity.CmSvipProduct">
-        select ccs.priceType,
-               if(csp.id is not null and csu.id is not null and csp.status=0, 1, 0) as svipPriceFlag
-        from cm_svip_product csp
-                 left join cm_svip_user csu
-                           on csu.userId = #{userId} and csu.delFlag = '0' and now() <![CDATA[ < ]]> csu.endTime
-        left join (select csps.productId,csps.priceType from cm_svip_product_sku csps left join cm_sku cs on csps.skuId=cs.skuId
-            where csps.productId=#{productId} order by cs.price asc limit 1) ccs on csp.productId=ccs.productId
-        where csp.productId = #{productId};
-    </select>
-    <select id="findVipSku" resultType="com.caimei.modules.product.entity.CmSku">
-        select discountPrice,discount,priceType
-        from cm_svip_product_sku csps
-        left join cm_sku cs on csps.productId = cs.productId
-        where csps.productId=#{productId}
-        order by cs.price asc limit 1
-    </select>
-</mapper>

+ 0 - 79
src/main/resources/mappings/modules/bulkpurchase/ReceiptListMapper.xml

@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.bulkpurchase.dao.ReceiptListDao">
-    
-	<sql id="receiptListColumns">
-		bp.id AS "orderId",
-		bp.no AS "orderNo",
-		bp.createDate AS "createDate",
-		bp.clubId AS "clubId",
-		bp.payTotalFee AS "payTotalFee",
-		(SELECT sum(shouldPayFee) FROM bp_order_product WHERE orderId=bp.id AND payStatus=1) AS "received",
-		(SELECT sum(shouldPayFee) FROM bp_order_product WHERE orderId=bp.id AND payStatus=0) AS "uncollected",
-		(SELECT count(1) FROM  bp_order_product bop WHERE  bop.orderId=bp.id) AS "productTypeNum" ,
-		(SELECT count(1) FROM bp_order_product WHERE orderId=bp.id and payStatus=0) AS "unProductTypeNum",
-		(SELECT count(1) FROM cm_finance_receipts WHERE orderId = bp.id AND (`status` = 2 OR `status` =4) AND delFlag = 0) AS "reviewProductTypeNum",
--- 		(SELECT count(1) FROM cm_finance_receipts WHERE orderId = bp.id AND `status` = 4 AND delFlag = 0) AS "reviewFailureNum",
--- 		(SELECT count(1) FROM cm_finance_receipts WHERE orderId = bp.id AND `status` = 3 AND delFlag = 0) AS "reviewFailureNum",
-        (SELECT count(1) FROM bp_order  bo WHERE bo.id = bp.id  AND (bo.status != 0) AND (delFlag = 0) AND (bo.status is NOT NULL)) AS "reviewFailureNum",
-		c.name AS "clubName",
-		c.address AS "ClubAddress",
-		c.contractMobile AS "ClubMobile",
-		(SELECT COUNT(1) FROM bp_order_stages bos WHERE bos.orderId = bp.id ) AS "stagesNum",
-		(SELECT COUNT(1) FROM bp_order_stages bos WHERE bos.orderId = bp.id AND bos.payStatus = 0) AS "unStagesNum",
-		(SELECT count(1) FROM cm_finance_receipts WHERE orderId = bp.id AND (`status` = 2 OR `status` =4) AND delFlag = 0)AS "reviewStagesNum",
-		bp.stagesFlag AS "stagesFlag",
-		(SELECT sum(fee) FROM bp_order_stages WHERE orderId=bp.id AND payStatus=1) AS "stagesReceived",
-		(SELECT sum(fee) FROM bp_order_stages WHERE orderId=bp.id AND payStatus=0) AS "stagesUncollected",
-		bp.orderStopFlag AS "orderStopFlag",
-		bp.orderStopRemarks AS "orderStopRemarks",
-		bp.stagesRemarks AS "stagesRemarks"
-	</sql>
-
-	<sql id="cmFinanceReceiptsJoins">
-	</sql>
-    
-	<select id="get" resultType="ReceiptList">
-		SELECT 
-			<include refid="receiptListColumns"/>
-		FROM bp_order bp LEFT JOIN club c ON c.clubId = bp.clubId
-		<include refid="cmFinanceReceiptsJoins"/>
-		WHERE bp.id = #{orderId}
-	</select>
-	
-	<select id="findList" resultType="ReceiptList">
-		SELECT 
-			<include refid="receiptListColumns"/>
-		FROM bp_order bp LEFT JOIN club c ON c.clubId = bp.clubId
-		<where>
-
-			<if test="orderId != null and orderId != ''">
-				AND bp.id = #{orderId}
-			</if>
-			<if test="orderNo != null and orderNo != ''">
-				AND bp.no = #{orderNo}
-			</if>
-			<if test="clubName != null and clubName != ''">
-				AND c.name LIKE concat('%',#{clubName},'%')
-			</if>
-			<if test="startTime != null and startTime != ''">
-				AND bp.createDate <![CDATA[  >=  ]]> #{startTime}
-			</if>
-			<if test="endTime != null and endTime != ''">
-				AND bp.createDate <![CDATA[   <=  ]]> #{endTime}
-			</if>
-			    AND bp.delFlag = 0
-				AND bp.confirmFlag = 1
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY bp.id DESC,bp.createDate DESC
-			</otherwise>
-		</choose>
-	</select>
-
-
-</mapper>

+ 0 - 69
src/main/resources/mappings/modules/bulkpurchase/ShouldPayMapper.xml

@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.bulkpurchase.dao.ShouldPayDao">
-    
-	<sql id="shouldPayColumns">
-		bp.id AS "orderId",
-		bp.no AS "orderNo",
-		bp.stagesFlag AS "stagesFlag",
-		bp.createDate AS "createDate",
-		bp.clubId AS "clubId",
-		bp.payTotalFee AS "payTotalFee",
-		(SELECT IFNULL(count(1),0) FROM  bp_order_product WHERE orderId=bp.id) AS "productTypeNum" ,
-		(SELECT IFNULL(count(1),0) FROM  cm_finance_charge WHERE LEFT (orderNo,22)=bp.no and status=2) AS "applyPayProductNum",
-		c.name AS "clubName",
-		c.address AS "clubAddress",
-		c.contractMobile1 AS "clubMobile",
-		(SELECT sum(fee) FROM bp_order_stages WHERE orderId=bp.id AND payStatus=1) AS "stagesReceived",
-		(SELECT sum(fee) FROM bp_order_stages WHERE orderId=bp.id AND payStatus=0) AS "stagesUncollected",
-		bp.orderStopFlag AS "orderStopFlag",
-		bp.orderStopRemarks AS "orderStopRemarks",
-		bp.stagesRemarks AS "stagesRemarks"
-	</sql>
-
-	<sql id="shouldPayJoins">
-	</sql>
-    
-	<select id="get" resultType="ShouldPay">
-		SELECT 
-		<include refid="shouldPayColumns"/>
-		FROM bp_order bp
-		LEFT JOIN club c ON c.clubId = bp.clubId
-		WHERE bp.id = #{orderId}
-	</select>
-	
-	<select id="findList" resultType="ShouldPay">
-		SELECT 
-			<include refid="shouldPayColumns"/>
-		FROM bp_order bp LEFT JOIN club c ON c.clubId = bp.clubId
-		<where>
-			
-			<if test="orderId != null and orderId != ''">
-				AND bp.id = #{orderId}
-			</if>
-			<if test="orderNo != null and orderNo != ''">
-				AND bp.no LIKE concat('%',#{orderNo},'%')
-			</if>
-			<if test="clubName != null and clubName != ''">
-				AND c.name LIKE concat('%',#{clubName},'%')
-			</if>
-			<if test="startTime != null and startTime != ''">
-				AND bp.createDate <![CDATA[  >=  ]]> #{startTime}
-			</if>
-			<if test="endTime != null and endTime != ''">
-				AND bp.createDate <![CDATA[   <=  ]]> #{endTime}
-			</if>
-			    AND bp.delFlag = 0
-				AND bp.confirmFlag = 1
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY bp.id DESC,bp.createDate DESC
-			</otherwise>
-		</choose>
-	</select>
-
-</mapper>

+ 0 - 202
src/main/resources/mappings/modules/bulkpurchase/TransactionMapper.xml

@@ -1,202 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.bulkpurchase.dao.TransactionDao">
-    
-	<sql id="transactionColumns">
-		a.transactionID AS "transactionID",
-		a.transactionWayID AS "transactionWayID",
-		a.transactionTypeID AS "transactionTypeID",
-		a.payTypeID AS "payTypeID",
-		a.title AS "title",
-		a.amount AS "amount",
-		a.actualAmount AS "actualAmount",
-		a.addTime AS "addTime",
-		a.payTime AS "payTime",
-		a.transactionNum AS "transactionNum",
-		a.relateID AS "relateID",
-		a.status AS "status",
-		a.auditTime AS "auditTime",
-		a.auditNote AS "auditNote",
-		a.auditSystemUserID AS "auditSystemUserID",
-		a.auditUserName AS "auditUserName",
-		a.userID AS "userID",
-		a.formData AS "formData",
-		a.bankID AS "bankID",
-		a.bankCode AS "bankCode",
-		a.info AS "info",
-		a.rePayFlag AS "rePayFlag",
-		a.dealRePayFlag AS "dealRePayFlag",
-		a.kuaiQianPayTypeID AS "kuaiQianPayTypeID",
-		a.refundAmount AS "refundAmount",
-		a.muiltFlag AS "muiltFlag",
-		a.relateIDs AS "relateIDs",
-		a.proberlem AS "proberlem",
-		a.kuaiQianPayerID AS "kuaiQianPayerID",
-		a.totalAmount AS "totalAmount",
-		a.useBalanceAmount AS "useBalanceAmount",
-		a.useBeanAmount AS "useBeanAmount",
-		a.discountFee AS "discountFee",
-		a.finalFee AS "finalFee",
-		a.paySource AS "paySource"
-	</sql>
-	
-	<sql id="transactionJoins">
-	</sql>
-    
-	<select id="get" resultType="Transaction">
-		SELECT 
-			<include refid="transactionColumns"/>
-		FROM transaction a
-		<include refid="transactionJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="Transaction">
-		SELECT 
-			<include refid="transactionColumns"/>
-		FROM transaction a
-		<include refid="transactionJoins"/>
-		where
-		a.status  != 1
-		AND (a.transactionTypeID = 99 OR a.transactionTypeID = 100 OR  a.transactionTypeID = 101)
-	</select>
-	
-	<select id="findAllList" resultType="Transaction">
-		SELECT 
-			<include refid="transactionColumns"/>
-		FROM transaction a
-		<include refid="transactionJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="Transaction"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO transaction(
-			transactionID,
-			transactionWayID,
-			transactionTypeID,
-			payTypeID,
-			title,
-			amount,
-			actualAmount,
-			addTime,
-			payTime,
-			transactionNum,
-			relateID,
-			status,
-			auditTime,
-			auditNote,
-			auditSystemUserID,
-			auditUserName,
-			userID,
-			formData,
-			bankID,
-			bankCode,
-			info,
-			rePayFlag,
-			dealRePayFlag,
-			kuaiQianPayTypeID,
-			refundAmount,
-			muiltFlag,
-			relateIDs,
-			proberlem,
-			kuaiQianPayerID,
-			totalAmount,
-			useBalanceAmount,
-			useBeanAmount,
-			discountFee,
-			finalFee,
-			paySource
-		) VALUES (
-			#{transactionID},
-			#{transactionWayID},
-			#{transactionTypeID},
-			#{payTypeID},
-			#{title},
-			#{amount},
-			#{actualAmount},
-			#{addTime},
-			#{payTime},
-			#{transactionNum},
-			#{relateID},
-			#{status},
-			#{auditTime},
-			#{auditNote},
-			#{auditSystemUserID},
-			#{auditUserName},
-			#{userID},
-			#{formData},
-			#{bankID},
-			#{bankCode},
-			#{info},
-			#{rePayFlag},
-			#{dealRePayFlag},
-			#{kuaiQianPayTypeID},
-			#{refundAmount},
-			#{muiltFlag},
-			#{relateIDs},
-			#{proberlem},
-			#{kuaiQianPayerID},
-			#{totalAmount},
-			#{useBalanceAmount},
-			#{useBeanAmount},
-			#{discountFee},
-			#{finalFee},
-			#{paySource}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE transaction SET 	
-			transactionID = #{transactionID},
-			transactionWayID = #{transactionWayID},
-			transactionTypeID = #{transactionTypeID},
-			payTypeID = #{payTypeID},
-			title = #{title},
-			amount = #{amount},
-			actualAmount = #{actualAmount},
-			addTime = #{addTime},
-			payTime = #{payTime},
-			transactionNum = #{transactionNum},
-			relateID = #{relateID},
-			status = #{status},
-			auditTime = #{auditTime},
-			auditNote = #{auditNote},
-			auditSystemUserID = #{auditSystemUserID},
-			auditUserName = #{auditUserName},
-			userID = #{userID},
-			formData = #{formData},
-			bankID = #{bankID},
-			bankCode = #{bankCode},
-			info = #{info},
-			rePayFlag = #{rePayFlag},
-			dealRePayFlag = #{dealRePayFlag},
-			kuaiQianPayTypeID = #{kuaiQianPayTypeID},
-			refundAmount = #{refundAmount},
-			muiltFlag = #{muiltFlag},
-			relateIDs = #{relateIDs},
-			proberlem = #{proberlem},
-			kuaiQianPayerID = #{kuaiQianPayerID},
-			totalAmount = #{totalAmount},
-			useBalanceAmount = #{useBalanceAmount},
-			useBeanAmount = #{useBeanAmount},
-			discountFee = #{discountFee},
-			finalFee = #{finalFee},
-			paySource = #{paySource}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM transaction
-		WHERE id = #{id}
-	</delete>
-	
-</mapper>

+ 0 - 4
src/main/resources/mappings/modules/order/CmReceiptOrderRelationMapper.xml

@@ -71,10 +71,6 @@
 			#{delFlag}
 		)
 	</insert>
-	<insert id="insertOnlineRefund">
-		INSERT INTO cm_online_refund (userId, orderRequestNo, orderId, amount, refundType)
-		VALUES (#{userId}, #{orderRequestNo}, #{orderId}, #{amount}, #{balanceRefundOrderId}, #{refundType})
-	</insert>
 
 	<update id="update">
 		UPDATE cm_receipt_order_relation SET

+ 0 - 6
src/main/resources/mappings/modules/order/OrderProductMapper.xml

@@ -413,12 +413,6 @@
         where orderProductID = #{orderProductID,jdbcType=INTEGER}
     </update>
 
-    <select id="findStipulateFee" resultType="Integer">
-        SELECT stipulateFee
-        FROM `bp_contract`
-        WHERE `id` = #{contractId}
-    </select>
-
     <delete id="delete">
         DELETE
         FROM cm_order_product

+ 0 - 75
src/main/resources/mappings/modules/product/ActTypeMapper.xml

@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.product.dao.ActTypeDao">
-    
-	<sql id="bigTypeColumns">
-		a.actTypeID AS "id",
-		a.name AS "name",
-		a.image AS "image",
-		a.validFlag AS "validFlag",
-		a.sortIndex AS "sortIndex"
-	</sql>
-	
-	<sql id="bigTypeJoins">
-	</sql>
-    
-	<select id="get" resultType="ActType">
-		SELECT 
-			<include refid="bigTypeColumns"/>
-		FROM acttype a
-		<include refid="bigTypeJoins"/>
-		WHERE a.actTypeID = #{id}
-	</select>
-	
-	<select id="findList" resultType="ActType">
-		SELECT 
-			<include refid="bigTypeColumns"/>
-		FROM acttype a
-		<include refid="bigTypeJoins"/>
-		<where>
-			<if test="id != null and id != ''">
-				AND a.actTypeID = #{id}
-			</if>
-			<if test="name != null and name != ''">
-				AND a.name LIKE concat('%',#{name},'%')
-			</if>
-			<if test="validFlag != null and validFlag != ''">
-				AND a.validFlag = #{validFlag}
-			</if>
-
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="BigType">
-
-	</select>
-	
-	<insert id="insert" parameterType="ActType"  keyProperty="id" useGeneratedKeys="true">
-
-	</insert>
-	
-	<update id="update">
-
-	</update>
-	
-	<update id="delete">
-		UPDATE crm_big_type a SET a.delFlag= #{DEL_FLAG_DELETE}
-		WHERE id = #{id}
-	</update>
-	
-	<update id="updateEnabledStatusByIds">
-		UPDATE crm_big_type a SET a.enabledStatus = #{param1} 
-		WHERE  a.id IN
-	 	<foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >
-	       #{id}
-	 	</foreach>
-	</update>
-	
-</mapper>

+ 0 - 157
src/main/resources/mappings/modules/product/CmSecondHandRecommendMapper.xml

@@ -1,157 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.product.dao.CmSecondHandRecommendDao">
-    
-	<sql id="cmSecondHandRecommendColumns">
-		a.id AS "id",
-		a.secondHandProductID AS "secondHandProductID",
-		a.productType AS "productType",
-		a.recommendProductID AS "recommendProductID",
-		a.sort AS "sort",
-		a.delFlag AS "delFlag"
-	</sql>
-	
-	<sql id="cmSecondHandRecommendJoins">
-	</sql>
-    
-	<select id="get" resultType="CmSecondHandRecommend">
-		SELECT 
-			<include refid="cmSecondHandRecommendColumns"/>
-		FROM cm_second_hand_recommend a
-		<include refid="cmSecondHandRecommendJoins"/>
-		WHERE a.id = #{id} order by a.sort desc
-	</select>
-
-	<select id="findByRecommendProductID" resultType="CmSecondHandRecommend">
-		SELECT
-		<include refid="cmSecondHandRecommendColumns"/>
-		FROM cm_second_hand_recommend a
-		<include refid="cmSecondHandRecommendJoins"/>
-		WHERE a.secondHandProductID = #{secondHandProductID}
-		and a.productType = #{productType}
-		and a.recommendProductID = #{recommendProductID}
-	</select>
-
-	<select id="getSecondHandRecommend" resultType="CmSecondHandRecommendVo">
-		select a.id AS id,
-		2 AS type,
-		a.productName AS name,
-		a.image1 AS img
-		from cm_second_hand_transaction a
-		where a.id = #{id}
-		AND a.productStatus = '1'
-	</select>
-
-	<select id="querySecondHandRecommend" resultType="CmSecondHandRecommendVo">
-		select a.id AS id,
-		2 AS type,
-		a.productName AS name,
-		a.image1 AS img
-		from cm_second_hand_transaction a
-		<where>
-			<if test="id != null and id != ''">
-				a.id = #{id}
-			</if>
-			<if test="productName != null and productName != ''">
-				and a.productName like concat('%', #{productName}, '%')
-			</if>
-			AND a.productStatus = '1'
-		</where>
-	</select>
-
-	<select id="findRecommendList" resultType="CmSecondHandRecommend">
-		SELECT
-		<include refid="cmSecondHandRecommendColumns"/>
-			FROM cm_second_hand_recommend a
-		<include refid="cmSecondHandRecommendJoins"/>
-		WHERE a.secondHandProductID = #{id}
-		order by a.sort asc
-	</select>
-	
-	<select id="findList" resultType="CmSecondHandRecommend">
-		SELECT 
-			<include refid="cmSecondHandRecommendColumns"/>
-		FROM cm_second_hand_recommend a
-		<include refid="cmSecondHandRecommendJoins"/>
-		<where>
-			
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="CmSecondHandRecommend">
-		SELECT 
-			<include refid="cmSecondHandRecommendColumns"/>
-		FROM cm_second_hand_recommend a
-		<include refid="cmSecondHandRecommendJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="CmSecondHandRecommend"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cm_second_hand_recommend(
-			secondHandProductID,
-			productType,
-			recommendProductID,
-			sort,
-			delFlag
-		) VALUES (
-			#{secondHandProductID},
-			#{productType},
-			#{recommendProductID},
-			#{sort},
-			#{delFlag}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cm_second_hand_recommend SET 	
-			secondHandProductID = #{secondHandProductID},
-			productType = #{productType},
-			recommendProductID = #{recommendProductID},
-			sort = #{sort},
-			delFlag = #{delFlag}
-		WHERE id = #{id}
-	</update>
-
-	<update id="updateSort">
-		UPDATE cm_second_hand_recommend SET
-			sort = #{sort}
-		WHERE id = #{id}
-	</update>
-
-	<update id="updateRecommendProduct">
-		UPDATE cm_second_hand_recommend SET
-			sort = #{sort}
-		WHERE secondHandProductID = #{secondHandProductID}
-		and productType = #{productType}
-		and recommendProductID = #{recommendProductID}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM cm_second_hand_recommend
-		WHERE id = #{id}
-	</delete>
-
-	<delete id="deleteRecommend">
-		DELETE FROM cm_second_hand_recommend
-		WHERE secondHandProductID = #{secondHandProductID}
-		and productType = #{productType}
-		and recommendProductID = #{recommendProductID}
-	</delete>
-	
-</mapper>

+ 0 - 249
src/main/resources/mappings/modules/product/CmSecondHandTransactionMapper.xml

@@ -1,249 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.product.dao.CmSecondHandTransactionDao">
-
-	<sql id="cmSecondHandTransactionColumns">
-		a.id AS "id",
-		a.userId AS "userId",
-		ifnull(a.type,0) AS "type",
-		ifnull(a.sold,0) AS "sold",
-		ifnull(a.viewingNum,0) AS "viewingNum",
-		a.transactionType AS "transactionType",
-		a.productType AS "productType",
-		a.productName AS "productName",
-		a.productQuality AS "productQuality",
-		a.address AS "address",
-		a.contactName AS "contactName",
-		a.contactMobile AS "contactMobile",
-		a.fixedYears AS "fixedYears",
-		a.mechanismName AS "mechanismName",
-		a.image1 AS "image1",
-		a.image2 AS "image2",
-		a.image3 AS "image3",
-		a.image4 AS "image4",
-		a.image5 AS "image5",
-		a.productDetails AS "productDetails",
-		date_format(a.submitDate, '%Y-%m-%d %H:%i:%s') AS submitDate,
-		date_format(a.updateDate, '%Y-%m-%d %H:%i:%s') AS updateDate,
-		a.operationType AS operationType,
-		a.payStatus AS payStatus,
-		a.productStatus AS productStatus,
-		a.payAmount AS payAmount,
-		a.provinceCityDistrict AS provinceCityDistrict,
-		a.townId AS townId,
-		a.brandId AS brandId,
-		(case when a.brandId != '-1' then
-			(select cb.name from cm_brand cb where cb.id = a.brandId)
-			else
-			 a.brandName
-			 end
-		) AS brandName,
-		a.useBalanceAmount AS useBalanceAmount,
-		a.revieweReason AS revieweReason,
-		a.payFormData AS payFormData,
-		date_format(a.reviewedDate, '%Y-%m-%d %H:%i:%s') AS reviewedDate,
-		date_format(a.onLineDate, '%Y-%m-%d %H:%i:%s') AS onLineDate,
-		a.reviewerUserID AS reviewerUserID,
-		a.source AS source,
-		(select su.name from sys_user su where su.id = a.reviewerUserID) AS reviewerUserName
-	</sql>
-
-	<sql id="cmSecondHandTransactionJoins">
-	</sql>
-
-	<select id="get" resultType="CmSecondHandTransaction">
-		SELECT
-			<include refid="cmSecondHandTransactionColumns"/>
-		FROM cm_second_hand_transaction a
-		<include refid="cmSecondHandTransactionJoins"/>
-		WHERE a.id = #{id}
-	</select>
-
-	<select id="brandList" resultType="com.caimei.modules.brand.entity.CmBrand">
-		select b.id AS id, b.name AS name from cm_brand b
-		where b.status = '1' and b.delFlag = '0' and b.description is not null and b.description != ''
-		order by b.sort
-	</select>
-
-	<select id="findList" resultType="CmSecondHandTransaction">
-		SELECT
-			<include refid="cmSecondHandTransactionColumns"/>
-		,u.userName AS "userName"
-		FROM cm_second_hand_transaction a
-		LEFT JOIN  user  u ON u.userId = a.userId
-		<include refid="cmSecondHandTransactionJoins"/>
-		<where>
-			<if test="id != null and id != ''">
-				AND a.id = #{id}
-			</if>
-			<if test="brandId != null and brandId != ''">
-				AND a.brandId = #{brandId}
-			</if>
-			<if test="transactionType != null and transactionType != ''">
-				AND a.transactionType = #{transactionType}
-			</if>
-			<if test="productType != null and productType != ''">
-				AND a.productType = #{productType}
-			</if>
-			<if test="productName != null and productName != ''">
-				AND a.productName LIKE concat('%',#{productName},'%')
-			</if>
-			<if test="payStatus != null and payStatus != ''">
-				AND a.payStatus = #{payStatus}
-			</if>
-			<if test="source != null and source != ''">
-				AND a.source = #{source}
-			</if>
-			<if test="productStatus != null and productStatus != ''">
-				AND a.productStatus = #{productStatus}
-			</if>
-			<if test="operationType != null and operationType != ''">
-				AND a.operationType = #{operationType}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			order by a.submitDate desc
-			</otherwise>
-		</choose>
-	</select>
-
-	<select id="findAllList" resultType="CmSecondHandTransaction">
-		SELECT
-			<include refid="cmSecondHandTransactionColumns"/>
-		FROM cm_second_hand_transaction a
-		<include refid="cmSecondHandTransactionJoins"/>
-		<where>
-
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-
-	<insert id="insert" parameterType="CmSecondHandTransaction"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cm_second_hand_transaction(
-			userId,
-			type,
-			sold,
-			viewingNum,
-			productType,
-			productName,
-			productQuality,
-			address,
-			townId,
-			contactName,
-			contactMobile,
-			fixedYears,
-			mechanismName,
-			image1,
-			image2,
-			image3,
-			image4,
-			image5,
-			productDetails,
-			submitDate,
-			payStatus,
-			productStatus,
-			payAmount,
-			provinceCityDistrict,
-			brandId,
-			brandName,
-			useBalanceAmount,
-			revieweReason,
-			payFormData,
-			reviewedDate,
-			onLineDate,
-			updateDate,
-			reviewerUserID,
-			source
-		) VALUES (
-			#{userId},
-			#{type},
-			#{sold},
-			#{viewingNum},
-			#{productType},
-			#{productName},
-			#{productQuality},
-			#{address},
-			#{townId},
-			#{contactName},
-			#{contactMobile},
-			#{fixedYears},
-			#{mechanismName},
-			#{image1},
-			#{image2},
-			#{image3},
-			#{image4},
-			#{image5},
-			#{productDetails},
-			#{submitDate},
-			#{payStatus},
-			#{productStatus},
-			#{payAmount},
-			#{provinceCityDistrict},
-			#{brandId},
-			#{brandName},
-			#{useBalanceAmount},
-			#{revieweReason},
-			#{payFormData},
-			#{reviewedDate},
-			#{onLineDate},
-			#{updateDate},
-			#{reviewerUserID},
-			#{source}
-		)
-	</insert>
-
-	<update id="update">
-		UPDATE cm_second_hand_transaction SET
-			userId = #{userId},
-			type = #{type},
-			sold = #{sold},
-			viewingNum = #{viewingNum},
-			productType = #{productType},
-			productName = #{productName},
-			productQuality = #{productQuality},
-			address = #{address},
-			townId = #{townId},
-			contactName = #{contactName},
-			contactMobile = #{contactMobile},
-			fixedYears = #{fixedYears},
-			mechanismName = #{mechanismName},
-			image1 = #{image1},
-			image2 = #{image2},
-			image3 = #{image3},
-			image4 = #{image4},
-			image5 = #{image5},
-			productDetails = #{productDetails},
-			submitDate = #{submitDate},
-			payStatus = #{payStatus},
-			productStatus = #{productStatus},
-			payAmount = #{payAmount},
-			provinceCityDistrict = #{provinceCityDistrict},
-			brandId = #{brandId},
-			brandName = #{brandName},
-			useBalanceAmount = #{useBalanceAmount},
-			revieweReason = #{revieweReason},
-			payFormData = #{payFormData},
-			reviewedDate = #{reviewedDate},
-			onLineDate = #{onLineDate},
-			updateDate = #{updateDate},
-			reviewerUserID = #{reviewerUserID},
-			source = #{source}
-		WHERE id = #{id}
-	</update>
-
-	<delete id="delete">
-		DELETE FROM cm_second_hand_transaction
-		WHERE id = #{id}
-	</delete>
-
-</mapper>

+ 0 - 14
src/main/resources/mappings/modules/product/CmTinytypeMapper.xml

@@ -15,21 +15,10 @@
 		a.addTime AS "addTime"
 	</sql>
 
-	<!--事务过程 修改分类 批量更新商品编码 存储过程名称 caimei4developer.update_productcode_tiny-->
-	<select id="mutiUpdateCode" parameterType="java.lang.String" statementType="CALLABLE">
-		{call caimei.update_productcode_tiny(
-		#{newTinyTypeId,jdbcType=VARCHAR,mode=IN}
-		)}
-	</select>
-
-	<sql id="cmTinytypeJoins">
-	</sql>
-
 	<select id="get" resultType="CmTinytype">
 		SELECT
 			<include refid="cmTinytypeColumns"/>
 		FROM tinytype a
-		<include refid="cmTinytypeJoins"/>
 		WHERE a.tinyTypeID = #{tinyTypeID}
 	</select>
 
@@ -37,7 +26,6 @@
 		SELECT
 		<include refid="cmTinytypeColumns"/>
 		FROM tinytype a
-		<include refid="cmTinytypeJoins"/>
 		WHERE a.tinyTypeCode = #{param1} AND a.smallTypeID = #{param2}
 	</select>
 
@@ -45,7 +33,6 @@
 		SELECT
 			<include refid="cmTinytypeColumns"/>
 		FROM tinytype a
-		<include refid="cmTinytypeJoins"/>
 		<where>
 			<!-- validFlag = '1' -->
 			<if test="name != null and name != ''">
@@ -84,7 +71,6 @@
 		SELECT
 			<include refid="cmTinytypeColumns"/>
 		FROM tinytype a
-		<include refid="cmTinytypeJoins"/>
 		<where>
 
 		</where>

+ 0 - 101
src/main/resources/mappings/modules/product/ProductCustomClassificationMapper.xml

@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.product.dao.ProductCustomClassificationDao">
-    
-	<sql id="productCustomClassificationColumns">
-		a.id AS "id",
-		a.productID AS "productID",
-		a.bigTypeID AS "bigTypeID",
-		a.smallTypeID AS "smallTypeID",
-		a.tinyTypeID AS "tinyTypeID",
-		a.createDate AS "createDate",
-		a.updateDate AS "updateDate"
-	</sql>
-	
-	<sql id="productCustomClassificationJoins">
-	</sql>
-    
-	<select id="get" resultType="ProductCustomClassification">
-		SELECT 
-			<include refid="productCustomClassificationColumns"/>
-		FROM product_custom_classification a
-		<include refid="productCustomClassificationJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="ProductCustomClassification">
-		SELECT 
-			<include refid="productCustomClassificationColumns"/>
-		FROM product_custom_classification a
-		<include refid="productCustomClassificationJoins"/>
-		<where>
-			
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="ProductCustomClassification">
-		SELECT 
-			<include refid="productCustomClassificationColumns"/>
-		FROM product_custom_classification a
-		<include refid="productCustomClassificationJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="ProductCustomClassification"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO product_custom_classification(
-			id,
-			productID,
-			bigTypeID,
-			smallTypeID,
-			tinyTypeID,
-			createDate,
-			updateDate
-		) VALUES (
-			#{id},
-			#{productID},
-			#{bigTypeID},
-			#{smallTypeID},
-			#{tinyTypeID},
-			#{createDate},
-			#{updateDate}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE product_custom_classification SET 	
-			productID = #{productID},
-			bigTypeID = #{bigTypeID},
-			smallTypeID = #{smallTypeID},
-			tinyTypeID = #{tinyTypeID},
-			createDate = #{createDate},
-			updateDate = #{updateDate}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM product_custom_classification
-		WHERE id = #{id}
-	</delete>
-
-	<select id="findCustomClassification" resultType="com.caimei.modules.product.entity.ProductCustomClassification">
-		select <include refid="productCustomClassificationColumns"/>
-		from product_custom_classification a where a.productID = #{productID}
-	</select>
-	
-</mapper>

+ 0 - 163
src/main/resources/mappings/modules/product/ProductMapper.xml

@@ -622,14 +622,6 @@
         WHERE id = #{id}
     </update>
 
-
-    <select id="getAllActType" resultType="com.caimei.po.ActType">
-        SELECT *
-        FROM acttype
-        where validFlag = 1
-    </select>
-
-
     <select id="getSupplierProductList" resultType="com.caimei.modules.product.entity.Product">
         SELECT
         *
@@ -781,14 +773,6 @@
                 #{updateTime})
     </insert>
 
-    <!--	<update id="updateCRMFlag">-->
-    <!--		UPDATE product a SET a.displayOnCRMFlag = #{param1}-->
-    <!--		WHERE  a.productID IN-->
-    <!--		<foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >-->
-    <!--			#{id}-->
-    <!--		</foreach>-->
-    <!--	</update>-->
-
     <update id="deleteActive">
         UPDATE product a
         SET a.actFlag = 0
@@ -854,29 +838,6 @@
         where t.tinyTypeID = #{tinyTypeID}
     </select>
 
-    <delete id="deleteCustomClassification">
-        delete
-        from product_custom_classification
-        where productID = #{productID}
-    </delete>
-
-    <insert id="insertCustomClassification"
-            parameterType="com.caimei.modules.product.entity.ProductCustomClassification" keyProperty="userId"
-            useGeneratedKeys="true">
-        INSERT INTO product_custom_classification(productID,
-                                                  bigTypeID,
-                                                  smallTypeID,
-                                                  tinyTypeID,
-                                                  createDate,
-                                                  updateDate)
-        VALUES (#{productID},
-                #{bigTypeID},
-                #{smallTypeID},
-                #{tinyTypeID},
-                #{createDate},
-                #{updateDate})
-    </insert>
-
     <insert id="insertAddProduct">
         INSERT INTO cm_search_recommend_product(productID,
                                                 tinyTypeID,
@@ -1123,40 +1084,6 @@
         ORDER BY csrp.sort DESC
     </select>
 
-
-    <select id="relatedProductList" resultType="product">
-        select
-        <include refid="productColumns"/>,
-        b.name AS brandName,
-        (case when a.tinyTypeID = #{tinyTypeID} then '1' else '0' end) AS defaultType
-        FROM product a
-        <include refid="productJoins"/>
-        left join brand b on b.brandID = a.brandID
-        WHERE (a.productID
-        IN (select productID from product_custom_classification where tinyTypeID = #{tinyTypeID})
-        OR a.tinyTypeID = #{tinyTypeID})
-        <if test="name != null and name != ''">
-            AND a.name like concat('%', #{name} ,'%')
-        </if>
-        <if test="validFlag !=null and validFlag !=''">
-            AND a.validFlag=#{validFlag}
-        </if>
-        <if test="shopName != null and shopName != ''">
-            AND s.name like concat('%', #{shopName} ,'%')
-        </if>
-        <if test="brandName != null and brandName != ''">
-            AND b.name like concat('%', #{brandName} ,'%')
-        </if>
-        AND a.validFlag != 0
-        and a.productCategory = 1
-    </select>
-
-    <delete id="deleteProductCustomClassification">
-        delete
-        from product_custom_classification
-        where productID = #{productID}
-          and tinyTypeID = #{tinyTypeID}
-    </delete>
     <delete id="deleteLadderPriceByProductId">
         DELETE
         FROM product_ladder_price
@@ -1196,32 +1123,6 @@
         select productId from cm_sku where skuId=#{productId}
     </select>
 
-    <select id="toAddProductCustomClassificationList" resultType="product">
-        select
-        <include refid="productColumns"/>,
-        b.name AS brandName
-        FROM product a
-        <include refid="productJoins"/>
-        left join cm_brand b on b.id = a.brandID
-        WHERE a.tinyTypeID != #{tinyTypeID}
-        and not exists
-        (select pcc.id from product_custom_classification pcc where pcc.productID = a.productID and pcc.tinyTypeID =
-        #{tinyTypeID})
-        and a.validFlag = '2'
-        and (select count(id) from product_custom_classification pcc where pcc.productID = a.productID) <![CDATA[ < ]]>
-        5
-        <if test="name != null and name != ''">
-            and a.name like concat('%', #{name} ,'%')
-        </if>
-        <if test="shopName != null and shopName != ''">
-            AND s.name like concat('%', #{shopName} ,'%')
-        </if>
-        <if test="brandName != null and brandName != ''">
-            AND b.name like concat('%', #{brandName} ,'%')
-        </if>
-    </select>
-
-
     <select id="toAddProductList" resultType="product">
         select
         a.*,
@@ -1246,70 +1147,6 @@
         and a.productCategory = 1
     </select>
 
-    <select id="getProductTypes" resultType="com.caimei.modules.product.entity.ProductCustomClassification">
-        select *
-        from product_custom_classification
-        where productID = #{productID}
-    </select>
-
-
-    <select id="findRecommendActivityListPage" resultType="Product">
-        SELECT
-        <include refid="productColumns"/>
-        FROM product a
-        <include refid="ActivityJoins"/>
-        <where>
-            <if test="id !=null and id !=''">
-                AND a.productID=#{id}
-            </if>
-            <if test="tinyTypeID != null and tinyTypeID != ''">
-                AND a.tinyTypeID = #{tinyTypeID}
-            </if>
-            <if test="smallTypeID != null and smallTypeID != ''">
-                AND a.smallTypeID = #{smallTypeID}
-            </if>
-            <if test="bigTypeID != null and bigTypeID != ''">
-                AND a.bigTypeID = #{bigTypeID}
-            </if>
-            <if test="shopID != null and shopID != ''">
-                AND a.shopID = #{shopID}
-            </if>
-            <if test="name != null and name != ''">
-                AND a.name LIKE
-                <if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
-                <if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
-                <if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
-            </if>
-            <if test="shopName != null and shopName != ''">
-                AND s.name LIKE
-                <if test="dbName == 'oracle'">'%'||#{shopName}||'%'</if>
-                <if test="dbName == 'mssql'">'%'+#{shopName}+'%'</if>
-                <if test="dbName == 'mysql'">concat('%',#{shopName},'%')</if>
-            </if>
-            <if test="actFlag !=null and actFlag !=''">
-                AND a.actFlag=#{actFlag}
-            </if>
-
-
-            <if test="sqlMap !=null and sqlMap !=''">
-                ${sqlMap.dsf}
-            </if>
-            AND a.validFlag = 2
-            AND (a.actType != 3 or a.`actType` IS NULL or (a.actType = 3 and STR_TO_DATE(a.endTime,'%Y-%m-%d %H:%i')
-            <![CDATA[  <  ]]> STR_TO_DATE(SYSDATE(),'%Y-%m-%d %H:%i')))
-            AND a.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
-            and a.productCategory = 1
-        </where>
-        <choose>
-            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
-                ORDER BY ${page.orderBy}
-            </when>
-            <otherwise>
-                order by case WHEN a.validFlag = 1 then 0 else 1 END asc,a.productID desc
-            </otherwise>
-        </choose>
-    </select>
-
     <select id="findGroupActivityListPage" resultType="Product">
         SELECT
         <include refid="productColumns"/>

+ 17 - 17
src/main/resources/mappings/modules/user/CmUserMapper.xml

@@ -497,7 +497,7 @@
 
 	<update id="updateEmployeePermission">
 		UPDATE user SET userPermission = #{userPermission}
-		WHERE userID != #{companyUserID} AND auditStatus = '1'
+		WHERE userID = #{companyUserID} AND auditStatus = '1'
 	</update>
 
 
@@ -511,22 +511,22 @@
 		WHERE userID = #{userID}
 	</update>
 
-	<update id="initEmployeeInfo">
-		UPDATE user SET
-		    userIdentity = '0',
-		    userPermission = '1',
-		    registerUserTypeID = '10' ,
-		    auditStatus = NULL ,
-		    auditTime = NULL ,
-		    userName = realName,
-		    name = NULL ,
-			clubID = NULL ,
-			clubStatus = NULL ,
-			shopID = NULL ,
-			manufacturerStatus = NULL ,
-			tipStatus = '1'
-		WHERE userID != #{companyUserID}
-	</update>
+<!--	<update id="initEmployeeInfo">-->
+<!--		UPDATE user SET-->
+<!--		    userIdentity = '0',-->
+<!--		    userPermission = '1',-->
+<!--		    registerUserTypeID = '10' ,-->
+<!--		    auditStatus = NULL ,-->
+<!--		    auditTime = NULL ,-->
+<!--		    userName = realName,-->
+<!--		    name = NULL ,-->
+<!--			clubID = NULL ,-->
+<!--			clubStatus = NULL ,-->
+<!--			shopID = NULL ,-->
+<!--			manufacturerStatus = NULL ,-->
+<!--			tipStatus = '1'-->
+<!--		WHERE userID = #{companyUserID}-->
+<!--	</update>-->
 
 	<update id="updateAbleUserMoney">
 		UPDATE user SET

+ 0 - 66
src/main/webapp/WEB-INF/views/modules/product/productCustomClassificationForm.jsp

@@ -1,66 +0,0 @@
-<%@ page contentType="text/html;charset=UTF-8" %>
-<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
-<html>
-<head>
-	<title>商品自定义分类管理</title>
-	<meta name="decorator" content="default"/>
-	<script type="text/javascript">
-		$(document).ready(function() {
-			//$("#name").focus();
-			$("#inputForm").validate({
-				submitHandler: function(form){
-					loading('正在提交,请稍等...');
-					form.submit();
-				},
-				errorContainer: "#messageBox",
-				errorPlacement: function(error, element) {
-					$("#messageBox").text("输入有误,请先更正。");
-					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
-						error.appendTo(element.parent().parent());
-					} else {
-						error.insertAfter(element);
-					}
-				}
-			});
-		});
-	</script>
-</head>
-<body>
-	<ul class="nav nav-tabs">
-		<li><a href="${ctx}/product/productCustomClassification/">商品自定义分类列表</a></li>
-		<li class="active"><a href="${ctx}/product/productCustomClassification/form?id=${productCustomClassification.id}">商品自定义分类<shiro:hasPermission name="product:productCustomClassification:edit">${not empty productCustomClassification.id?'编辑':'添加'}</shiro:hasPermission><shiro:lacksPermission name="product:productCustomClassification:edit">查看</shiro:lacksPermission></a></li>
-	</ul><br/>
-	<form:form id="inputForm" modelAttribute="productCustomClassification" action="${ctx}/product/productCustomClassification/save" method="post" class="form-horizontal">
-		<form:hidden path="id"/>
-		<sys:message content="${message}"/>		
-		<div class="control-group">
-			<label class="control-label">商品ID:</label>
-			<div class="controls">
-				<form:input path="productID" htmlEscape="false" maxlength="11" class="input-xlarge  digits"/>
-			</div>
-		</div>
-		<div class="control-group">
-			<label class="control-label">一级分类Id:</label>
-			<div class="controls">
-				<form:input path="bigTypeID" htmlEscape="false" maxlength="11" class="input-xlarge "/>
-			</div>
-		</div>
-		<div class="control-group">
-			<label class="control-label">二级分类Id:</label>
-			<div class="controls">
-				<form:input path="smallTypeID" htmlEscape="false" maxlength="11" class="input-xlarge "/>
-			</div>
-		</div>
-		<div class="control-group">
-			<label class="control-label">三级分类Id:</label>
-			<div class="controls">
-				<form:input path="tinyTypeID" htmlEscape="false" maxlength="11" class="input-xlarge "/>
-			</div>
-		</div>
-		<div class="form-actions">
-			<shiro:hasPermission name="product:productCustomClassification:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
-			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
-		</div>
-	</form:form>
-</body>
-</html>

+ 0 - 58
src/main/webapp/WEB-INF/views/modules/product/productCustomClassificationList.jsp

@@ -1,58 +0,0 @@
-<%@ page contentType="text/html;charset=UTF-8" %>
-<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
-<html>
-<head>
-	<title>商品自定义分类管理</title>
-	<meta name="decorator" content="default"/>
-	<style type="text/css">
-		.table th{text-align: center;}
-		.table td{text-align: center;}
-	</style>
-	<script type="text/javascript">
-		$(document).ready(function() {
-			
-		});
-		function page(n,s){
-			$("#pageNo").val(n);
-			$("#pageSize").val(s);
-			$("#searchForm").submit();
-        	return false;
-        }
-	</script>
-</head>
-<body>
-	<ul class="nav nav-tabs">
-		<li class="active"><a href="${ctx}/product/productCustomClassification/">商品自定义分类列表</a></li>
-		<shiro:hasPermission name="product:productCustomClassification:edit"><li><a href="${ctx}/product/productCustomClassification/form">商品自定义分类添加</a></li></shiro:hasPermission>
-	</ul>
-	<form:form id="searchForm" modelAttribute="productCustomClassification" action="${ctx}/product/productCustomClassification/" method="post" class="breadcrumb form-search">
-		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
-		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
-		<div class="ul-form">
-			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
-			<div class="clearfix"></div>
-		</div>
-	</form:form>
-	<sys:message content="${message}"/>
-	<table id="contentTable" class="table table-striped table-bordered table-condensed">
-		<thead>
-			<tr>
-				<shiro:hasPermission name="product:productCustomClassification:edit"><th>操作</th></shiro:hasPermission>
-			</tr>
-		</thead>
-		<tbody>
-		<c:forEach items="${page.list}" var="productCustomClassification">
-			<tr>
-				<shiro:hasPermission name="product:productCustomClassification:edit"><td>
-    				<a href="${ctx}/product/productCustomClassification/form?id=${productCustomClassification.id}">编辑</a>
-    				<shiro:hasPermission name="product:productCustomClassification:delete">
-					<a href="${ctx}/product/productCustomClassification/delete?id=${productCustomClassification.id}" onclick="return confirmx('确认要删除该商品自定义分类吗?', this.href)">删除</a>
-					</shiro:hasPermission>
-				</td></shiro:hasPermission>
-			</tr>
-		</c:forEach>
-		</tbody>
-	</table>
-	<div class="pagination">${page}</div>
-</body>
-</html>