Browse Source

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

kaick 1 year ago
parent
commit
ea7c097327
100 changed files with 564 additions and 11475 deletions
  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. 3 3
      src/main/java/com/caimei/modules/order/entity/CmDiscernReceipt.java
  12. 2 2
      src/main/java/com/caimei/modules/order/entity/ReceiptRecordVo.java
  13. 25 0
      src/main/java/com/caimei/modules/permission/PermissionController.java
  14. 0 16
      src/main/java/com/caimei/modules/permission/dao/ReceiptUserPermissionDao.java
  15. 0 75
      src/main/java/com/caimei/modules/permission/entity/ReceiptUserPermission.java
  16. 0 52
      src/main/java/com/caimei/modules/permission/service/ReceiptUserPermissionService.java
  17. 0 112
      src/main/java/com/caimei/modules/permission/web/ReceiptUserPermissionController.java
  18. 0 15
      src/main/java/com/caimei/modules/product/dao/ActTypeDao.java
  19. 0 6
      src/main/java/com/caimei/modules/product/dao/CmSecondHandRecommendDao.java
  20. 0 19
      src/main/java/com/caimei/modules/product/dao/ProductCustomClassificationDao.java
  21. 9 28
      src/main/java/com/caimei/modules/product/dao/ProductDao.java
  22. 0 51
      src/main/java/com/caimei/modules/product/entity/ProductCustomClassification.java
  23. 0 18
      src/main/java/com/caimei/modules/product/service/ActTypeService.java
  24. 0 7
      src/main/java/com/caimei/modules/product/service/CmSecondHandTransactionService.java
  25. 2 4
      src/main/java/com/caimei/modules/product/service/CmTinytypeService.java
  26. 0 53
      src/main/java/com/caimei/modules/product/service/ProductCustomClassificationService.java
  27. 0 83
      src/main/java/com/caimei/modules/product/service/ProductService.java
  28. 0 27
      src/main/java/com/caimei/modules/product/web/ProductActController.java
  29. 2 785
      src/main/java/com/caimei/modules/product/web/ProductController.java
  30. 0 80
      src/main/java/com/caimei/modules/product/web/ProductCustomClassificationController.java
  31. 0 57
      src/main/java/com/caimei/modules/product/web/ProductNewController.java
  32. 0 301
      src/main/java/com/caimei/modules/product/web/ProductsClassifyController.java
  33. 2 0
      src/main/java/com/caimei/modules/user/dao/ClubChangeSpReviewDao.java
  34. 0 36
      src/main/java/com/caimei/modules/weisha/dao/CmOrganizeProductDao.java
  35. 1 2
      src/main/java/com/caimei/modules/weisha/dao/CmOrganizeStoreDao.java
  36. 1 38
      src/main/java/com/caimei/modules/weisha/service/CmOrganizeProductService.java
  37. 4 27
      src/main/java/com/caimei/modules/weisha/service/CmOrganizeStoreService.java
  38. 0 62
      src/main/java/com/caimei/modules/weisha/web/CmMallOrganizeController.java
  39. 0 27
      src/main/java/com/caimei/modules/weisha/web/CmOrganizeProductController.java
  40. 106 149
      src/main/java/com/caimei/modules/weisha/web/CmOrganizeStoreController.java
  41. 0 161
      src/main/resources/mappings/modules/activity/FreeShippingMapper.xml
  42. 0 116
      src/main/resources/mappings/modules/activity/FreeShippingTypeMapper.xml
  43. 0 111
      src/main/resources/mappings/modules/activity/LaserMapper.xml
  44. 0 102
      src/main/resources/mappings/modules/advisory/CmAdvisoryMapper.xml
  45. 0 129
      src/main/resources/mappings/modules/banner/CrmBannerMapper.xml
  46. 0 165
      src/main/resources/mappings/modules/brand/BrandAgentMapper.xml
  47. 0 120
      src/main/resources/mappings/modules/brand/BrandIdentificationCodeMapper.xml
  48. 0 239
      src/main/resources/mappings/modules/brand/BrandProductMapper.xml
  49. 0 169
      src/main/resources/mappings/modules/brand/BrandProductsMapper.xml
  50. 0 148
      src/main/resources/mappings/modules/brand/BrandPurchaserMapper.xml
  51. 0 184
      src/main/resources/mappings/modules/brand/BrandSupplierMapper.xml
  52. 0 76
      src/main/resources/mappings/modules/brand/ProductModelMapper.xml
  53. 0 75
      src/main/resources/mappings/modules/brand/ShopModelMapper.xml
  54. 0 83
      src/main/resources/mappings/modules/bulkpurchase/BpOrderCirculationMapper.xml
  55. 0 90
      src/main/resources/mappings/modules/bulkpurchase/BpOrderProductRemarkMapper.xml
  56. 0 82
      src/main/resources/mappings/modules/bulkpurchase/BpOrderRemarkMapper.xml
  57. 0 140
      src/main/resources/mappings/modules/bulkpurchase/BpOrderStagesShopMapper.xml
  58. 0 138
      src/main/resources/mappings/modules/bulkpurchase/BpOrderUserinfoMapper.xml
  59. 0 313
      src/main/resources/mappings/modules/bulkpurchase/CmFinanceChargeMapper.xml
  60. 0 175
      src/main/resources/mappings/modules/bulkpurchase/CmFinanceChargeStagesMapper.xml
  61. 0 319
      src/main/resources/mappings/modules/bulkpurchase/CmFinanceReceiptsMapper.xml
  62. 0 106
      src/main/resources/mappings/modules/bulkpurchase/CmRefundsRecordMapper.xml
  63. 0 28
      src/main/resources/mappings/modules/bulkpurchase/CommissionsMapper.xml
  64. 0 141
      src/main/resources/mappings/modules/bulkpurchase/ContractMapper.xml
  65. 0 345
      src/main/resources/mappings/modules/bulkpurchase/ContractOrderMapper.xml
  66. 0 264
      src/main/resources/mappings/modules/bulkpurchase/OrderProductMapper.xml
  67. 0 83
      src/main/resources/mappings/modules/bulkpurchase/OrderStagesMapper.xml
  68. 0 44
      src/main/resources/mappings/modules/bulkpurchase/OrderStagesProductMapper.xml
  69. 0 96
      src/main/resources/mappings/modules/bulkpurchase/ProductPrivilegeMapper.xml
  70. 0 223
      src/main/resources/mappings/modules/bulkpurchase/PurchaseProductMapper.xml
  71. 0 79
      src/main/resources/mappings/modules/bulkpurchase/ReceiptListMapper.xml
  72. 0 69
      src/main/resources/mappings/modules/bulkpurchase/ShouldPayMapper.xml
  73. 0 202
      src/main/resources/mappings/modules/bulkpurchase/TransactionMapper.xml
  74. 0 143
      src/main/resources/mappings/modules/cibe/CibeBlessingCompoMapper.xml
  75. 0 107
      src/main/resources/mappings/modules/cibe/CibePrizeMapper.xml
  76. 0 113
      src/main/resources/mappings/modules/cibe/CibeProductTypeMapper.xml
  77. 0 150
      src/main/resources/mappings/modules/cibe/CibeShopMapper.xml
  78. 0 96
      src/main/resources/mappings/modules/cibe/CibeSpecialMobileMapper.xml
  79. 0 127
      src/main/resources/mappings/modules/cibe/CibeUserMapper.xml
  80. 0 93
      src/main/resources/mappings/modules/cmme/dict/CmmeSysDictMapper.xml
  81. 0 124
      src/main/resources/mappings/modules/cmme/product/CmmeBigtypeMapper.xml
  82. 0 114
      src/main/resources/mappings/modules/cmme/product/CmmeMainproductMapper.xml
  83. 4 4
      src/main/resources/mappings/modules/order/CmDiscernReceiptMapper.xml
  84. 0 4
      src/main/resources/mappings/modules/order/CmReceiptOrderRelationMapper.xml
  85. 2 2
      src/main/resources/mappings/modules/order/CmRefundShopMapper.xml
  86. 0 1
      src/main/resources/mappings/modules/order/OrderMapper.xml
  87. 0 6
      src/main/resources/mappings/modules/order/OrderProductMapper.xml
  88. 0 115
      src/main/resources/mappings/modules/permission/ReceiptUserPermissionMapper.xml
  89. 0 75
      src/main/resources/mappings/modules/product/ActTypeMapper.xml
  90. 4 39
      src/main/resources/mappings/modules/product/CmSecondHandRecommendMapper.xml
  91. 0 249
      src/main/resources/mappings/modules/product/CmSecondHandTransactionMapper.xml
  92. 0 14
      src/main/resources/mappings/modules/product/CmTinytypeMapper.xml
  93. 0 101
      src/main/resources/mappings/modules/product/ProductCustomClassificationMapper.xml
  94. 0 163
      src/main/resources/mappings/modules/product/ProductMapper.xml
  95. 0 207
      src/main/resources/mappings/modules/user/CmGclubMapper.xml.bak
  96. 17 17
      src/main/resources/mappings/modules/user/CmUserMapper.xml
  97. 110 117
      src/main/resources/mappings/modules/weisha/CmMallOrganizeMapper.xml
  98. 23 14
      src/main/resources/mappings/modules/weisha/CmMallUserMapper.xml
  99. 0 139
      src/main/resources/mappings/modules/weisha/CmOrganizeBuyerMapper.xml
  100. 247 361
      src/main/resources/mappings/modules/weisha/CmOrganizeProductMapper.xml

+ 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);
 }

+ 3 - 3
src/main/java/com/caimei/modules/order/entity/CmDiscernReceipt.java

@@ -24,9 +24,9 @@ public class    CmDiscernReceipt extends DataEntity<CmDiscernReceipt> {
     private String receiptAmount;        // 收款金额(线上一次性付款和支付金额一致)
     private String handlingFee;        // 手续费(个别银行存在手续费)
     private String confirmType;        // 确认订单类型:1小额抹平确认,2大额抹平确认,3大额退款余额,4确认关联
-    private Long confirmUserPermissionID;        // 确认人权限ID(对应receipt_user_permission表)
-    private Long reviewUserPermissionID;        // 审核人权限ID(对应receipt_user_permission表)
-    private Long cancelUserPermissionID;        // 撤销人权限ID(对应receipt_user_permission表)
+    private Long confirmUserPermissionID;        // 确认人权限ID(对应cm_receipt_user表)
+    private Long reviewUserPermissionID;        // 审核人权限ID(对应cm_receipt_user表)
+    private Long cancelUserPermissionID;        // 撤销人权限ID(对应cm_receipt_user表)
     private String transactionNum;        // 交易号--[线上字段]
     private String bankID;        // 银行Id--[线上字段]
     private String bankCode;        // 银行卡号--[线上字段]

+ 2 - 2
src/main/java/com/caimei/modules/order/entity/ReceiptRecordVo.java

@@ -16,10 +16,10 @@ public class ReceiptRecordVo {
     private Double receiptAmount; //收款金额
     private String payWay;        // 用户付款方式:1线上,2线下
     private String transactionNum;        // 交易号--[线上字段]
-    private Long confirmUserPermissionID;        // 确认人权限ID(对应receipt_user_permission表)
+    private Long confirmUserPermissionID;        // 确认人权限ID(对应cm_receipt_user表)
     private String confirmUserName;   //确认人名称
 
-    private Long reviewUserPermissionID;        // 审核人权限ID(对应receipt_user_permission表)
+    private Long reviewUserPermissionID;        // 审核人权限ID(对应cm_receipt_user表)
     private String reviewUserName;  //审核人名称
     private String confirmDate;        // 确认时间
     private String reviewDate;        // 审核时间

+ 25 - 0
src/main/java/com/caimei/modules/permission/PermissionController.java

@@ -0,0 +1,25 @@
+package com.caimei.modules.permission;
+
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import com.thinkgem.jeesite.common.web.BaseController;
+
+
+/**
+ * @author Administrator
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/permission/receiptUserPermission")
+public class PermissionController extends BaseController {
+
+
+    @RequiresPermissions("permission:receiptUserPermission:view")
+    @RequestMapping(value = {"list", ""})
+    public String list() {
+        return "modules/permission/receiptNoticePermissionList";
+    }
+
+}

+ 0 - 16
src/main/java/com/caimei/modules/permission/dao/ReceiptUserPermissionDao.java

@@ -1,16 +0,0 @@
-package com.caimei.modules.permission.dao;
-
-import com.thinkgem.jeesite.common.persistence.CrudDao;
-import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
-import com.caimei.modules.permission.entity.ReceiptUserPermission;
-
-/**
- * 权限表DAO接口
- * @author lwt
- * @version 2019-06-18
- */
-@MyBatisDao
-public interface ReceiptUserPermissionDao extends CrudDao<ReceiptUserPermission> {
-
-    ReceiptUserPermission findDupBean(ReceiptUserPermission receiptUserPermission);
-}

+ 0 - 75
src/main/java/com/caimei/modules/permission/entity/ReceiptUserPermission.java

@@ -1,75 +0,0 @@
-package com.caimei.modules.permission.entity;
-
-import com.thinkgem.jeesite.common.persistence.DataEntity;
-import org.hibernate.validator.constraints.Length;
-
-/**
- * 权限表Entity
- *
- * @author lwt
- * @version 2019-06-18
- */
-public class ReceiptUserPermission extends DataEntity<ReceiptUserPermission> {
-
-    private static final long serialVersionUID = 1L;
-    private String userType;        // 用户类型:1收款通知权限(财务人员使用),2收款确认权限,3收款审核权限 4、返佣管理权限
-    private String name;        // 名称
-    private String mobile;        // 授权人手机号
-    private String openid;        // 微信openid
-    /**
-     * 用户身份
-     */
-    private String userIdentity;
-
-    public ReceiptUserPermission() {
-        super();
-    }
-
-    public ReceiptUserPermission(String id) {
-        super(id);
-    }
-
-    @Length(min = 0, max = 1, message = "用户类型:1收款通知权限(财务人员使用),2收款确认权限,3收款审核权限 4、返佣管理权限长度必须介于 0 和 1 之间")
-    public String getUserType() {
-        return userType;
-    }
-
-    public void setUserType(String userType) {
-        this.userType = userType;
-    }
-
-    @Length(min = 0, max = 50, message = "名称长度必须介于 0 和 50 之间")
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    @Length(min = 0, max = 11, message = "授权人手机号长度必须介于 0 和 11 之间")
-    public String getMobile() {
-        return mobile;
-    }
-
-    public void setMobile(String mobile) {
-        this.mobile = mobile;
-    }
-
-    @Length(min = 0, max = 255, message = "微信openid长度必须介于 0 和 255 之间")
-    public String getOpenid() {
-        return openid;
-    }
-
-    public void setOpenid(String openid) {
-        this.openid = openid;
-    }
-
-	public String getUserIdentity() {
-		return userIdentity;
-	}
-
-	public void setUserIdentity(String userIdentity) {
-		this.userIdentity = userIdentity;
-	}
-}

+ 0 - 52
src/main/java/com/caimei/modules/permission/service/ReceiptUserPermissionService.java

@@ -1,52 +0,0 @@
-package com.caimei.modules.permission.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.permission.entity.ReceiptUserPermission;
-import com.caimei.modules.permission.dao.ReceiptUserPermissionDao;
-
-import javax.annotation.Resource;
-
-/**
- * 权限表Service
- * @author lwt
- * @version 2019-06-18
- */
-@Service
-@Transactional(readOnly = true)
-public class ReceiptUserPermissionService extends CrudService<ReceiptUserPermissionDao, ReceiptUserPermission> {
-
-	@Resource
-	private ReceiptUserPermissionDao receiptUserPermissionDao;
-
-	public ReceiptUserPermission get(String id) {
-		return super.get(id);
-	}
-	
-	public List<ReceiptUserPermission> findList(ReceiptUserPermission receiptUserPermission) {
-		return super.findList(receiptUserPermission);
-	}
-	
-	public Page<ReceiptUserPermission> findPage(Page<ReceiptUserPermission> page, ReceiptUserPermission receiptUserPermission) {
-		return super.findPage(page, receiptUserPermission);
-	}
-	
-	@Transactional(readOnly = false)
-	public void save(ReceiptUserPermission receiptUserPermission) {
-		super.save(receiptUserPermission);
-	}
-	
-	@Transactional(readOnly = false)
-	public void delete(ReceiptUserPermission receiptUserPermission) {
-		super.delete(receiptUserPermission);
-	}
-
-	public ReceiptUserPermission findDupBean(ReceiptUserPermission receiptUserPermission) {
-		return receiptUserPermissionDao.findDupBean(receiptUserPermission);
-	}
-}

+ 0 - 112
src/main/java/com/caimei/modules/permission/web/ReceiptUserPermissionController.java

@@ -1,112 +0,0 @@
-package com.caimei.modules.permission.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.permission.entity.ReceiptUserPermission;
-import com.caimei.modules.permission.service.ReceiptUserPermissionService;
-
-/**
- * 权限表Controller
- * @author lwt
- * @version 2019-06-18
- */
-@Controller
-@RequestMapping(value = "${adminPath}/permission/receiptUserPermission")
-public class ReceiptUserPermissionController extends BaseController {
-
-	@Autowired
-	private ReceiptUserPermissionService receiptUserPermissionService;
-	
-	@ModelAttribute
-	public ReceiptUserPermission get(@RequestParam(required=false) String id) {
-		ReceiptUserPermission entity = null;
-		if (StringUtils.isNotBlank(id)){
-			entity = receiptUserPermissionService.get(id);
-		}
-		if (entity == null){
-			entity = new ReceiptUserPermission();
-		}
-		return entity;
-	}
-	
-	@RequiresPermissions("permission:receiptUserPermission:view")
-	@RequestMapping(value = {"list", ""})
-	public String list(ReceiptUserPermission receiptUserPermission, HttpServletRequest request, HttpServletResponse response, Model model) {
-		if (StringUtils.isNotBlank(receiptUserPermission.getOpenid()))
-			receiptUserPermission.setOpenid(receiptUserPermission.getOpenid().trim());
-		Page<ReceiptUserPermission> page = receiptUserPermissionService.findPage(new Page<ReceiptUserPermission>(request, response), receiptUserPermission); 
-		model.addAttribute("page", page);
-		if ("1".equals(receiptUserPermission.getUserType()))
-			return "modules/permission/receiptNoticePermissionList";
-		if ("2".equals(receiptUserPermission.getUserType()))
-			return "modules/permission/receiptConfirmPermissionList";
-		if ("3".equals(receiptUserPermission.getUserType()))
-			return "modules/permission/receiptReviewPermissionList";
-		if ("4".equals(receiptUserPermission.getUserType()))
-			return "modules/permission/rebateManagePermissionList";
-		if ("5".equals(receiptUserPermission.getUserType())){
-			return "modules/permission/shopRefundPermissionList";
-		}
-		return "";
-	}
-
-	@RequiresPermissions("permission:receiptUserPermission:view")
-	@RequestMapping(value = "form")
-	public String form(ReceiptUserPermission receiptUserPermission, Model model) {
-		model.addAttribute("receiptUserPermission", receiptUserPermission);
-		if ("1".equals(receiptUserPermission.getUserType()))
-			return "modules/permission/receiptNoticePermissionForm";
-		if ("2".equals(receiptUserPermission.getUserType()))
-			return "modules/permission/receiptConfirmPermissionForm";
-		if ("3".equals(receiptUserPermission.getUserType()))
-			return "modules/permission/receiptReviewPermissionForm";
-		if ("4".equals(receiptUserPermission.getUserType()))
-			return "modules/permission/rebateManagePermissionForm";
-		if ("5".equals(receiptUserPermission.getUserType())){
-			return "modules/permission/shopRefundPermissionForm";
-		}
-		return "";
-	}
-
-	@RequiresPermissions("permission:receiptUserPermission:edit")
-	@RequestMapping(value = "save")
-	public String save(ReceiptUserPermission receiptUserPermission, Model model, RedirectAttributes redirectAttributes) {
-		receiptUserPermission.setOpenid(receiptUserPermission.getOpenid().trim());
-		if (!beanValidator(model, receiptUserPermission)){
-			return form(receiptUserPermission, model);
-		}
-		if (StringUtils.isEmpty(receiptUserPermission.getId())) {
-			ReceiptUserPermission b = receiptUserPermissionService.findDupBean(receiptUserPermission);
-			if (b != null) {
-				model.addAttribute("message", "数据验证失败:<br/>微信openID已存在<br/>");
-				return form(receiptUserPermission, model);
-			}
-		}
-		receiptUserPermissionService.save(receiptUserPermission);
-		addMessage(redirectAttributes, "保存权限表成功");
-		return "redirect:"+Global.getAdminPath()+"/permission/receiptUserPermission/?userType="+receiptUserPermission.getUserType()+"&repage";
-	}
-	
-	@RequiresPermissions("permission:receiptUserPermission:delete")
-	@RequestMapping(value = "delete")
-	public String delete(ReceiptUserPermission receiptUserPermission, RedirectAttributes redirectAttributes) {
-		receiptUserPermissionService.delete(receiptUserPermission);
-		addMessage(redirectAttributes, "删除权限表成功");
-		return "redirect:"+Global.getAdminPath()+"/permission/receiptUserPermission/?userType="+receiptUserPermission.getUserType()+"&repage";
-	}
-
-}

+ 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 - 6
src/main/java/com/caimei/modules/product/dao/CmSecondHandRecommendDao.java

@@ -1,6 +1,5 @@
 package com.caimei.modules.product.dao;
 
-import com.caimei.modules.product.entity.CmSecondHandRecommendVo;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
 import com.caimei.modules.product.entity.CmSecondHandRecommend;
@@ -18,11 +17,6 @@ public interface CmSecondHandRecommendDao extends CrudDao<CmSecondHandRecommend>
 
     List<CmSecondHandRecommend> findRecommendList(@Param("id") String id);
 
-    CmSecondHandRecommendVo getSecondHandRecommend(@Param("id") String id);
-
-    List<CmSecondHandRecommendVo> querySecondHandRecommend(@Param("id") String queryProductID,
-                                                           @Param("productName") String queryProductName);
-
     CmSecondHandRecommend findByRecommendProductID(@Param("secondHandProductID") String secondHandProductID,
                                                    @Param("productType") String productType,
                                                    @Param("recommendProductID") String recommendProductID);

+ 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> {
-}

+ 0 - 7
src/main/java/com/caimei/modules/product/service/CmSecondHandTransactionService.java

@@ -237,11 +237,4 @@ public class CmSecondHandTransactionService extends CrudService<CmSecondHandTran
 		return cmSecondHandRecommendDao.findRecommendList(id);
 	}
 
-	public CmSecondHandRecommendVo getSecondHandRecommend(String id) {
-		return cmSecondHandRecommendDao.getSecondHandRecommend(id);
-	}
-
-	public List<CmSecondHandRecommendVo> querySecondHandRecommend(String queryProductID, String queryProductName) {
-		return cmSecondHandRecommendDao.querySecondHandRecommend(queryProductID, queryProductName);
-	}
 }

+ 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 - 36
src/main/java/com/caimei/modules/weisha/dao/CmOrganizeProductDao.java

@@ -108,36 +108,6 @@ public interface CmOrganizeProductDao extends CrudDao<CmOrganizeProduct> {
     CmOrganizeProduct findProductByProductId(String productId);
 
 
-    /**
-     * 更新商品上架状态
-     * @param id
-     * @param status
-     */
-    void updateStatus(@Param("id")Integer id, @Param("status")Integer status);
-
-    /**
-     * 获取商品阶梯价格列表
-     * @param productId
-     * @return
-     */
-    List<OrganizeProductLadderPrice> findLadderPrice(String productId);
-
-    /**
-     * 更新商品阶梯价格
-     * @param organizeProductLadderPrice
-     */
-    void updateLadderPrice(OrganizeProductLadderPrice organizeProductLadderPrice);
-    /**
-     * 插入商品阶梯价格
-     * @param organizeProductLadderPrice
-     */
-    void insertLadderPrice(OrganizeProductLadderPrice organizeProductLadderPrice);
-    /**
-     * 删除商品阶梯价格
-     * @param ladderId
-     */
-    void deleteLadderPriceById(String ladderId);
-
     /**
      * 查询对应采美商品的阶梯价格列表
      * @param productId
@@ -145,10 +115,4 @@ public interface CmOrganizeProductDao extends CrudDao<CmOrganizeProduct> {
      */
     List<OrganizeProductLadderPrice> findFormerLadderPriceList(String productId);
 
-    /**
-     * 更新阶梯价格标识
-     * @param productId
-     * @param ladderPriceFlag
-     */
-    void updateLadderPriceFlag(@Param("productId") String productId,@Param("ladderPriceFlag") int ladderPriceFlag);
 }

+ 1 - 2
src/main/java/com/caimei/modules/weisha/dao/CmOrganizeStoreDao.java

@@ -20,11 +20,10 @@ public interface CmOrganizeStoreDao extends CrudDao<CmOrganizeStore> {
     void cleanWx(@Param("userId") Integer userId);
 
     void clubStatus(@Param("id") Integer id,@Param("status") Integer status);
+
     void userStatus(@Param("id") Integer id,@Param("status") Integer status);
 
     CmOrganizeStore getclubInfo(CmOrganizeStore cmOrganizeStore);
 
-    List<CmOrganizeStore> findListByMobile(CmOrganizeStore cmOrganizeStore);
-
     String findOrganizeNameById(Integer organizeId);
 }

+ 1 - 38
src/main/java/com/caimei/modules/weisha/service/CmOrganizeProductService.java

@@ -31,42 +31,10 @@ import javax.annotation.Resource;
 @Service
 @Transactional(readOnly = true)
 public class CmOrganizeProductService extends CrudService<CmOrganizeProductDao, CmOrganizeProduct> {
+
 	@Resource
 	private CmOrganizeProductDao cmOrganizeProductDao;
-	@Resource
-	private CmOrganizePromotionDao cmOrganizePromotionDao;
 
-	public CmOrganizeProduct get(String id) {
-		return super.get(id);
-	}
-
-	public List<CmOrganizeProduct> findList(CmOrganizeProduct cmOrganizeProduct) {
-		return super.findList(cmOrganizeProduct);
-	}
-
-	public Page<CmOrganizeProduct> findPage(Page<CmOrganizeProduct> page, CmOrganizeProduct cmOrganizeProduct) {
-		cmOrganizeProduct.setPage(page);
-		List<CmOrganizeProduct> productList = cmOrganizeProductDao.findList(cmOrganizeProduct);
-		DecimalFormat decimalFormat = new DecimalFormat("0000");
-		productList.forEach(product->{
-			product.setProductImage(AppUtils.getImageURL("product", product.getProductImage(), 0, ""));
-			//格式化组织商品Id
-			product.setId(decimalFormat.format(Integer.parseInt(product.getId())));
-			//比例成本价加上机构税费处理
-			//若为含税,则成本为:售价*比例
-			//若为不含税,则成本为:(售价+售价*机构税率)*比例
-			//若为未知,则成本为:售价*比例
-			if (2 == product.getCostType()) {
-				if (0 == product.getIncludedTax() && 3 != product.getInvoiceType()) {
-					product.setCostPrice((product.getPrice()+product.getPrice()*product.getClubTaxPoint()*0.01)*product.getCostProportional()*0.01);
-				} else {
-					product.setCostPrice(product.getPrice()*product.getCostProportional());
-				}
-			}
-		});
-		page.setList(productList);
-		return page;
-	}
 	public Page<CmOrganizeProduct> organizeProductList(Page<CmOrganizeProduct> page, CmOrganizeProduct cmOrganizeProduct) {
 		cmOrganizeProduct.setPage(page);
 		// 商品信息
@@ -235,11 +203,6 @@ public class CmOrganizeProductService extends CrudService<CmOrganizeProductDao,
 
 	}
 
-	@Transactional(readOnly = false)
-	public void updateStatus(Integer id, Integer status) {
-		cmOrganizeProductDao.updateStatus(id, status);
-	}
-
 	/**
 	 * 组织商品编辑回显
 	 * @param id

+ 4 - 27
src/main/java/com/caimei/modules/weisha/service/CmOrganizeStoreService.java

@@ -1,19 +1,17 @@
 package com.caimei.modules.weisha.service;
 
-import java.util.List;
 
 import com.caimei.utils.AppKeys;
 import com.caimei.utils.AppUtils;
 import com.thinkgem.jeesite.common.config.Global;
-import org.springframework.beans.factory.annotation.Autowired;
 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.weisha.entity.CmOrganizeStore;
 import com.caimei.modules.weisha.dao.CmOrganizeStoreDao;
 
+import javax.annotation.Resource;
+
 /**
  * 采美组织门店Service
  * @author Aslee
@@ -23,29 +21,8 @@ import com.caimei.modules.weisha.dao.CmOrganizeStoreDao;
 @Transactional(readOnly = true)
 public class CmOrganizeStoreService extends CrudService<CmOrganizeStoreDao, CmOrganizeStore> {
 
-	@Autowired private CmOrganizeStoreDao cmOrganizeStoreDao;
-
-	public CmOrganizeStore get(String id) {
-		return super.get(id);
-	}
-
-	public List<CmOrganizeStore> findList(CmOrganizeStore cmOrganizeStore) {
-		return super.findList(cmOrganizeStore);
-	}
-
-	public Page<CmOrganizeStore> findPage(Page<CmOrganizeStore> page, CmOrganizeStore cmOrganizeStore) {
-		return super.findPage(page, cmOrganizeStore);
-	}
-
-	@Transactional(readOnly = false)
-	public void save(CmOrganizeStore cmOrganizeStore) {
-		super.save(cmOrganizeStore);
-	}
-
-	@Transactional(readOnly = false)
-	public void delete(CmOrganizeStore cmOrganizeStore) {
-		super.delete(cmOrganizeStore);
-	}
+	@Resource
+	private CmOrganizeStoreDao cmOrganizeStoreDao;
 
 
 	public CmOrganizeStore gtClubInfo(CmOrganizeStore cmOrganizeStore) {

+ 0 - 62
src/main/java/com/caimei/modules/weisha/web/CmMallOrganizeController.java

@@ -83,15 +83,9 @@ public class CmMallOrganizeController extends BaseController {
             return form(cmMallOrganize, model);
         }
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        String currentDate = sdf.format(new Date());
         CmUser cmUser = new CmUser();
-//        NewCmClub newCmClub = new NewCmClub();
         if (StringUtils.isNotEmpty(cmMallOrganize.getId())) {
             cmUser = cmUserDao.findUserByOrganizeId(Integer.parseInt(cmMallOrganize.getId()));
-            /*if(cmUser!=null){
-                //获取会所资料信息
-                newCmClub = newCmClubService.getclubByUserId(cmUser.getUserID());
-            }*/
         }
         //判断该会所手机号是否已存在
         cmUser.setBindMobile(cmMallOrganize.getMobile());
@@ -101,62 +95,6 @@ public class CmMallOrganizeController extends BaseController {
             return form(cmMallOrganize, model);
         }
         cmMallOrganizeService.save(cmMallOrganize);
-        /*if (cmUser != null&&newCmClub!=null) {
-            //添加用户信息(新增或修改通用)
-            cmUser.setUserOrganizeID(Integer.parseInt(cmMallOrganize.getId()));
-            cmUser.setName(cmMallOrganize.getOrganizeName());
-            cmUser.setLinkMan(cmMallOrganize.getOrganizeLinkName());
-            cmUser.setUserName(cmMallOrganize.getOrganizeLinkName());
-            newCmClub.setName(cmMallOrganize.getOrganizeName());
-            newCmClub.setLinkMan(cmMallOrganize.getOrganizeLinkName());
-            newCmClub.setContractMobile(cmMallOrganize.getMobile());
-            if (StringUtil.isNotBlank(cmMallOrganize.getOrganizeName())) {
-                //添加用户新增信息
-                if (null == cmUser.getUserID()) {//新增
-                    cmUser.setClubStatus("1".equals(cmMallOrganize.getStatus()) ? "90" : "91");
-                    cmUser.setRegisterUserTypeID("4");//设置为会所
-                    cmUser.setUserIdentity(4);
-                    cmUser.setServiceProviderStatus("90");//设置默认协销状态
-                    cmUser.setServiceProviderID("1342");
-                    cmUser.setAuditTime(currentDate);
-                    cmUser.setAuditStatus("1");//审核通过
-                    cmUser.setAuditNote("后台添加用户系统默认审核通过");
-                    cmUser.setRegisterTime(currentDate);
-                    cmUser.setLoginTime(currentDate);
-                    cmUser.setAccount(cmMallOrganize.getMobile() + RandomCodeGenerator.generateAccount(2));
-                    cmUser.setPassword("weisha");
-                    cmUser.setBindMobile(cmMallOrganize.getMobile());
-                    cmUser.setUserMoney(0d);
-                    cmUser.setAbleUserMoney(0d);
-                    cmUser.setValidFlag("1");
-                    cmUser.setAgreeFlag("1");
-                    cmUser.setUserPermission(5);
-                    cmUserService.insert(cmUser);//插入新的用户数据
-                }
-                //添加会所表信息
-                if (null == newCmClub.getClubID()) {
-                    newCmClub.setStatus("1".equals(cmMallOrganize.getStatus()) ? 90 : 91);
-                    newCmClub.setUserID(cmUser.getUserID());
-                    newCmClub.setDefaultServiceProviderID(AppKeys.DEFAULT_SPID);
-                    newCmClub.setSpID(AppKeys.DEFAULT_SPID);
-                    newCmClub.setMainServiceProviderID(AppKeys.DEFAULT_SPID);
-                    newCmClub.setAddTime(currentDate);
-                    newCmClub.setDefaultServiceProviderUpdTime(currentDate);
-                    newCmClubService.insert(newCmClub);
-
-                    //更新用户绑定关系
-                    cmUser.setClubID(String.valueOf(newCmClub.getClubID()));
-                    String nick = cmUser.getUserID() + "_" + RandomCodeGenerator.generateCodeString(4).toLowerCase();
-
-                    //更新会所绑定关系
-                    newCmClub.setUserID(cmUser.getUserID());
-                }
-                cmUserService.update(cmUser);//更新用户表数据(编辑数据,或新增数据更新)
-
-                newCmClubService.update(newCmClub);//更新会所表数据(编辑数据,或新增数据更新)
-            }
-        }*/
-
         addMessage(redirectAttributes, "保存组织成功");
         return "redirect:" + Global.getAdminPath() + "/weisha/cmMallOrganize/?repage";
     }

+ 0 - 27
src/main/java/com/caimei/modules/weisha/web/CmOrganizeProductController.java

@@ -46,18 +46,6 @@ public class CmOrganizeProductController extends BaseController {
 	@Autowired
 	private CmMallOrganizeService cmMallOrganizeService;
 
-	@ModelAttribute
-	public CmOrganizeProduct get(@RequestParam(required=false) String id) {
-		CmOrganizeProduct entity = null;
-		if (StringUtils.isNotBlank(id)){
-			entity = cmOrganizeProductService.get(id);
-		}
-		if (entity == null){
-			entity = new CmOrganizeProduct();
-		}
-		return entity;
-	}
-
 	@RequestMapping(value = {"list", ""})
 	public String list(CmOrganizeProduct cmOrganizeProduct, HttpServletRequest request, HttpServletResponse response, Model model) {
 		Page<CmOrganizeProduct> page = cmOrganizeProductService.organizeProductList(new Page<CmOrganizeProduct>(request, response), cmOrganizeProduct);
@@ -155,19 +143,4 @@ public class CmOrganizeProductController extends BaseController {
 		map.put("info", "添加组织商品成功");
 		return map;
 	}
-
-	/**
-	 * 修改商品上架状态
-	 *
-	 * @return
-	 */
-	@RequestMapping(value = "updateStatus")
-	@ResponseBody
-	public Map<String,Object> updateStatus(Integer id, Integer status) {
-		cmOrganizeProductService.updateStatus(id, status);
-		HashMap<String, Object> map = new HashMap<>();
-		map.put("success", true);
-		map.put("msg", (status == 1 ? "上架" : "下架") + "组织商品成功");
-		return map;
-	}
 }

+ 106 - 149
src/main/java/com/caimei/modules/weisha/web/CmOrganizeStoreController.java

@@ -9,14 +9,12 @@ import com.caimei.modules.common.entity.City;
 import com.caimei.modules.common.entity.Province;
 import com.caimei.modules.common.entity.Town;
 import com.caimei.modules.weisha.dao.CmOrganizeStoreDao;
-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;
@@ -26,11 +24,11 @@ import com.thinkgem.jeesite.common.utils.StringUtils;
 import com.caimei.modules.weisha.entity.CmOrganizeStore;
 import com.caimei.modules.weisha.service.CmOrganizeStoreService;
 
-import java.util.Date;
 import java.util.List;
 
 /**
  * 采美组织门店Controller
+ *
  * @author Aslee
  * @version 2021-06-29
  */
@@ -38,151 +36,110 @@ import java.util.List;
 @RequestMapping(value = "${adminPath}/weisha/cmOrganizeStore")
 public class CmOrganizeStoreController extends BaseController {
 
-	@Autowired
-	private CmOrganizeStoreService cmOrganizeStoreService;
-
-	@Resource
-	private CmOrganizeStoreDao cmOrganizeStoreDao;
-
-	@Autowired
-	private AreaDao areaDao;
-
-
-	@ModelAttribute
-	public CmOrganizeStore get(@RequestParam(required=false) String id) {
-		CmOrganizeStore entity = null;
-		if (StringUtils.isNotBlank(id)){
-			entity = cmOrganizeStoreService.get(id);
-		}
-		if (entity == null){
-			entity = new CmOrganizeStore();
-		}
-		return entity;
-	}
-
-	@RequestMapping(value = {"list", ""})
-	public String list(CmOrganizeStore cmOrganizeStore, HttpServletRequest request, HttpServletResponse response, Model model) {
-		if (null != cmOrganizeStore.getStartTime() && !"".equals(cmOrganizeStore.getStartTime()) && !cmOrganizeStore.getStartTime().endsWith("00:00:00")) {
-			model.addAttribute("startTime", cmOrganizeStore.getStartTime());
-			cmOrganizeStore.setStartTime(cmOrganizeStore.getStartTime().trim() + " 00:00:00");
-		}
-		if (null != cmOrganizeStore.getEndTime() && !"".equals(cmOrganizeStore.getEndTime()) && !cmOrganizeStore.getEndTime().endsWith("23:59:59")) {
-			model.addAttribute("endTime", cmOrganizeStore.getEndTime());
-			cmOrganizeStore.setEndTime(cmOrganizeStore.getEndTime().trim() + " 23:59:59");
-		}
-		Page<CmOrganizeStore> page = cmOrganizeStoreService.findPage(new Page<CmOrganizeStore>(request, response), cmOrganizeStore);
-		List<Integer> organizeUser = cmOrganizeStoreDao.getOrganizeUser(cmOrganizeStore.getOrganizeId());
-		page.getList().forEach(p -> {
-			if (organizeUser.contains(p.getUserId())) {
-				p.setIsWx(1);
-			} else {
-				p.setIsWx(0);
-			}
-		});
-		model.addAttribute("page", page);
-		String organizeName = cmOrganizeStoreDao.findOrganizeNameById(cmOrganizeStore.getOrganizeId());
-		model.addAttribute("organizeName", organizeName);
-		return "modules/weisha/cmOrganizeStoreList";
-	}
-
-	@RequestMapping(value = "form")
-	public String form(CmOrganizeStore cmOrganizeStore, Model model) {
-		model.addAttribute("cmOrganizeStore", cmOrganizeStore);
-		Integer provinceId = cmOrganizeStore.getProvinceId();
-		Integer townId = cmOrganizeStore.getTownId();
-		Integer cityId = cmOrganizeStore.getCityId();
-		//控制编辑异常时候的会显地址下拉框
-		if (null != provinceId && provinceId > 0) {
-			Province province = areaDao.loadProvinceById(provinceId);
-			cmOrganizeStore.setProvinceName(province.getName());
-		}
-		if (null != cityId && cityId > 0) {
-			City city = areaDao.loadCityById(cityId);
-			cmOrganizeStore.setCityName(city.getName());
-		}
-		if (null != townId && townId > 0) {
-			Town town = areaDao.loadTownByID(townId);
-			cmOrganizeStore.setTownName(town.getName());
-		}
-		return "modules/weisha/cmOrganizeStoreForm";
-	}
-
-	@RequestMapping(value = "formGet")
-	public String formGet(CmOrganizeStore cmOrganizeStore, Model model) {
-//		model.addAttribute("cmOrganizeStore", cmOrganizeStore);
-		CmOrganizeStore clubInfo = cmOrganizeStoreService.gtClubInfo(cmOrganizeStore);
-
-		model.addAttribute("clubInfo", clubInfo);
-		/*Integer provinceId = cmOrganizeStore.getProvinceId();
-		Integer townId = cmOrganizeStore.getTownId();
-		Integer cityId = cmOrganizeStore.getCityId();
-		//控制编辑异常时候的会显地址下拉框
-		if (null != provinceId && provinceId > 0) {
-			Province province = areaDao.loadProvinceById(provinceId);
-			cmOrganizeStore.setProvinceName(province.getName());
-		}
-		if (null != cityId && cityId > 0) {
-			City city = areaDao.loadCityById(cityId);
-			cmOrganizeStore.setCityName(city.getName());
-		}
-		if (null != townId && townId > 0) {
-			Town town = areaDao.loadTownByID(townId);
-			cmOrganizeStore.setTownName(town.getName());
-		}*/
-		return "modules/weisha/cmOrganizeStoreFormGet";
-	}
-
-	@RequestMapping(value = "/cleanWx")
-	public String cleanWx(CmOrganizeStore cmOrganizeStore) {
-		// 解绑微信 设置删除
-		cmOrganizeStoreDao.cleanWx(cmOrganizeStore.getUserId());
-//		return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeStorelist";
-		return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeStore/?repage&organizeId=" + cmOrganizeStore.getOrganizeId();
-
-	}
-	@RequestMapping(value = "status")
-	public String status(CmOrganizeStore cmOrganizeStore) {
-		// 机构 上线、下线
-		cmOrganizeStoreDao.clubStatus(cmOrganizeStore.getUserId(),cmOrganizeStore.getStatus());
-		cmOrganizeStoreDao.userStatus(cmOrganizeStore.getUserId(),cmOrganizeStore.getStatus());
-		return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeStore/?repage&organizeId=" + cmOrganizeStore.getOrganizeId();
-
-	}
-
-	@RequestMapping(value = "save")
-	public String save(CmOrganizeStore cmOrganizeStore, Model model, RedirectAttributes redirectAttributes) {
-		if (!beanValidator(model, cmOrganizeStore)){
-			return form(cmOrganizeStore, model);
-		}
-		// 判断手机号是否存在
-		List<CmOrganizeStore> storeList = cmOrganizeStoreDao.findListByMobile(cmOrganizeStore);
-		if (null != storeList && storeList.size() > 0) {
-			addMessage(model, "手机号重复,请更换手机号");
-			return form(cmOrganizeStore, model);
-		}
-		if (null == cmOrganizeStore.getOrganizeId()) {
-			addMessage(model, "组织id不能为空");
-			return form(cmOrganizeStore, model);
-		}
-		if (StringUtils.isEmpty(cmOrganizeStore.getId())) {
-			cmOrganizeStore.setAddTime(new Date());
-			cmOrganizeStore.setStatus(1);
-		}
-		cmOrganizeStoreService.save(cmOrganizeStore);
-		return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeStore/?repage&organizeId=" + cmOrganizeStore.getOrganizeId();
-	}
-
-	@RequestMapping(value = "delete")
-	public String delete(CmOrganizeStore cmOrganizeStore, RedirectAttributes redirectAttributes) {
-		cmOrganizeStoreService.delete(cmOrganizeStore);
-		addMessage(redirectAttributes, "删除门店成功");
-		return "redirect:"+Global.getAdminPath()+"/weisha/cmOrganizeStore/?repage";
-	}
-	@RequestMapping(value = "update")
-	public String update(CmOrganizeStore cmOrganizeStore, RedirectAttributes redirectAttributes) {
-		cmOrganizeStoreService.delete(cmOrganizeStore);
-		addMessage(redirectAttributes, "删除门店成功");
-		return "redirect:"+Global.getAdminPath()+"/weisha/cmOrganizeStore/?repage";
-	}
+    @Resource
+    private CmOrganizeStoreService cmOrganizeStoreService;
+
+    @Resource
+    private CmOrganizeStoreDao cmOrganizeStoreDao;
+
+    @Resource(name = "areaMapper")
+    private AreaDao areaDao;
+
+
+    @ModelAttribute
+    public CmOrganizeStore get(@RequestParam(required = false) String id) {
+        CmOrganizeStore entity = null;
+        if (StringUtils.isNotBlank(id)) {
+            entity = cmOrganizeStoreService.get(id);
+        }
+        if (entity == null) {
+            entity = new CmOrganizeStore();
+        }
+        return entity;
+    }
+
+    @RequestMapping(value = {"list", ""})
+    public String list(CmOrganizeStore cmOrganizeStore, HttpServletRequest request, HttpServletResponse response, Model model) {
+        if (null != cmOrganizeStore.getStartTime() && !"".equals(cmOrganizeStore.getStartTime()) && !cmOrganizeStore.getStartTime().endsWith("00:00:00")) {
+            model.addAttribute("startTime", cmOrganizeStore.getStartTime());
+            cmOrganizeStore.setStartTime(cmOrganizeStore.getStartTime().trim() + " 00:00:00");
+        }
+        if (null != cmOrganizeStore.getEndTime() && !"".equals(cmOrganizeStore.getEndTime()) && !cmOrganizeStore.getEndTime().endsWith("23:59:59")) {
+            model.addAttribute("endTime", cmOrganizeStore.getEndTime());
+            cmOrganizeStore.setEndTime(cmOrganizeStore.getEndTime().trim() + " 23:59:59");
+        }
+        Page<CmOrganizeStore> page = cmOrganizeStoreService.findPage(new Page<CmOrganizeStore>(request, response), cmOrganizeStore);
+        List<Integer> organizeUser = cmOrganizeStoreDao.getOrganizeUser(cmOrganizeStore.getOrganizeId());
+        page.getList().forEach(p -> {
+            if (organizeUser.contains(p.getUserId())) {
+                p.setIsWx(1);
+            } else {
+                p.setIsWx(0);
+            }
+        });
+        model.addAttribute("page", page);
+        String organizeName = cmOrganizeStoreDao.findOrganizeNameById(cmOrganizeStore.getOrganizeId());
+        model.addAttribute("organizeName", organizeName);
+        return "modules/weisha/cmOrganizeStoreList";
+    }
+
+    @RequestMapping(value = "form")
+    public String form(CmOrganizeStore cmOrganizeStore, Model model) {
+        model.addAttribute("cmOrganizeStore", cmOrganizeStore);
+        Integer provinceId = cmOrganizeStore.getProvinceId();
+        Integer townId = cmOrganizeStore.getTownId();
+        Integer cityId = cmOrganizeStore.getCityId();
+        //控制编辑异常时候的会显地址下拉框
+        if (null != provinceId && provinceId > 0) {
+            Province province = areaDao.loadProvinceById(provinceId);
+            cmOrganizeStore.setProvinceName(province.getName());
+        }
+        if (null != cityId && cityId > 0) {
+            City city = areaDao.loadCityById(cityId);
+            cmOrganizeStore.setCityName(city.getName());
+        }
+        if (null != townId && townId > 0) {
+            Town town = areaDao.loadTownByID(townId);
+            cmOrganizeStore.setTownName(town.getName());
+        }
+        return "modules/weisha/cmOrganizeStoreForm";
+    }
+
+    @RequestMapping(value = "formGet")
+    public String formGet(CmOrganizeStore cmOrganizeStore, Model model) {
+        CmOrganizeStore clubInfo = cmOrganizeStoreService.gtClubInfo(cmOrganizeStore);
+        model.addAttribute("clubInfo", clubInfo);
+        return "modules/weisha/cmOrganizeStoreFormGet";
+    }
+
+    @RequestMapping(value = "/cleanWx")
+    public String cleanWx(CmOrganizeStore cmOrganizeStore) {
+        // 解绑微信 设置删除
+        cmOrganizeStoreDao.cleanWx(cmOrganizeStore.getUserId());
+        return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeStore/?repage&organizeId=" + cmOrganizeStore.getOrganizeId();
+    }
+
+    @RequestMapping(value = "status")
+    public String status(CmOrganizeStore cmOrganizeStore) {
+        // 机构 上线、下线
+        cmOrganizeStoreDao.clubStatus(cmOrganizeStore.getUserId(), cmOrganizeStore.getStatus());
+        cmOrganizeStoreDao.userStatus(cmOrganizeStore.getUserId(), cmOrganizeStore.getStatus());
+        return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeStore/?repage&organizeId=" + cmOrganizeStore.getOrganizeId();
+
+    }
+
+    @RequestMapping(value = "delete")
+    public String delete(CmOrganizeStore cmOrganizeStore, RedirectAttributes redirectAttributes) {
+        cmOrganizeStoreService.delete(cmOrganizeStore);
+        addMessage(redirectAttributes, "删除门店成功");
+        return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeStore/?repage";
+    }
+
+    @RequestMapping(value = "update")
+    public String update(CmOrganizeStore cmOrganizeStore, RedirectAttributes redirectAttributes) {
+        cmOrganizeStoreService.delete(cmOrganizeStore);
+        addMessage(redirectAttributes, "删除门店成功");
+        return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeStore/?repage";
+    }
 
 }

+ 0 - 161
src/main/resources/mappings/modules/activity/FreeShippingMapper.xml

@@ -1,161 +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.activity.dao.FreeShippingDao">
-    
-     <resultMap  id="CountResultMap" type="com.caimei.modules.activity.model.FreeShippingCount">
-		<result column="total" property="total" />
-		<result column="unused" property="unused"/>
-		<result column="used" property="used" />
-		<result column="unpay" property="unpay" />
- 	</resultMap>
-    
-	<select id="usedCount" resultMap="CountResultMap">
-		select count(1) total,
-		sum(case  a.`status` WHEN 0 then 1 ELSE 0 end) unused,
-		sum(case  a.`status` WHEN 1 then 1 ELSE 0 end) used,
-		sum(case  s.`status` WHEN 0 then 1 ELSE 0 end) unpay
-		from activity_free_shipping a
-		LEFT JOIN (select * FROM shoporder  WHERE STATUS &lt;&gt; '6') s ON s.freePostageTicketID = a.id
-		
-		<!-- select count(1) total,
-		sum(case WHEN a.`status`='0' then 1 ELSE 0 end) unused,
-		sum(case WHEN (a.`status`='1' AND s.`status` &lt;&gt; '6' ) then 1 ELSE 0 end) used,
-		sum(case WHEN s.`status`= '0' then 1 ELSE 0 end) unpay
-		from activity_free_shipping a
-		LEFT JOIN shoporder s ON (s.freePostageTicketID=a.id AND s.status &lt;&gt; '6') -->
-	</select>
-	
-	<sql id="freeShippingColumns">
-		a.id AS "id",
-		a.type_id AS "freeShippingtTpe.id",
-		a.user_id AS "userId",
-		a.club_id AS "clubId",
-		a.status AS "status",
-		a.spId,
-		a.enabled_status AS "enabledStatus",
-		a.create_date AS "createDate",
-		b.start_time AS "freeShippingtTpe.startTime",
-		b.end_time AS "freeShippingtTpe.endTime",
-		c.name AS "clubName",
-		c.contractMobile AS "clubMobile",
-		u.userName AS "userName",
-		u.userLevelID AS "userLevelType",
-		s.shopOrderID AS "shopOrederNo",
-		s.status AS "shopOrderStatus",
-		sp.`name` AS "spName",
-		sp.serviceLevelID AS "spLevelId",
-		sp.contractMobile AS "spMobile"
-
-	</sql>
-	
-	<sql id="freeShippingJoins">
-		LEFT JOIN activity_free_shipping_type b ON b.id=a.type_id
-		LEFT JOIN club c ON c.clubID=a.club_id
-		LEFT JOIN user u ON u.userID = a.user_id
-		LEFT JOIN (select * FROM shoporder  WHERE STATUS &lt;&gt; '6') s ON s.freePostageTicketID = a.id
-		LEFT JOIN serviceprovider sp ON sp.serviceProviderID=a.spId
-	</sql>
-    
-	<select id="get" resultType="FreeShipping">
-		SELECT 
-			<include refid="freeShippingColumns"/>
-		FROM activity_free_shipping a
-		<include refid="freeShippingJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="FreeShipping">
-		SELECT 
-			<include refid="freeShippingColumns"/>
-		FROM activity_free_shipping a
-		<include refid="freeShippingJoins"/>
-		<where>
-			<if test="userName != null and userName != ''">
-				AND u.userName LIKE concat('%',#{userName},'%')
-			</if>
-			<if test="clubId != null and clubId != ''">
-				AND c.clubID =#{clubId}
-			</if>
-			<if test="clubName != null and clubName != ''">
-				AND c.name LIKE concat('%',#{clubName},'%')
-			</if>
-			<if test="clubMobile != null and clubMobile != ''">
-				AND c.contractMobile LIKE concat('%',#{clubMobile},'%')
-			</if>
-			<if test="status != null and status != ''">
-				AND a.status = #{status}
-			</if>
-			<if test="enabledStatus != null and enabledStatus != ''">
-				AND a.enabled_status = #{enabledStatus}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.status ASC,
-				a.create_date DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="FreeShipping">
-		SELECT 
-			<include refid="freeShippingColumns"/>
-		FROM activity_free_shipping a
-		<include refid="freeShippingJoins"/>
-		<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="FreeShipping"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO activity_free_shipping(
-			type_id,
-			user_id,
-			club_id,
-			status,
-			enabled_status,
-			create_date
-		) VALUES (
-			#{freeShippingtTpe.id},
-			#{userId},
-			#{clubId},
-			#{status},
-			#{enabledStatus},
-			#{createDate}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE activity_free_shipping SET 	
-			type_id = #{freeShippingtTpe.id},
-			user_id = #{userId},
-			club_id = #{clubId},
-			status = #{status},
-			enabled_status = #{enabledStatus}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM activity_free_shipping
-		WHERE id = #{id}
-	</delete>
-	
-		<update id="updateEnabledStatusByIds">
-		UPDATE activity_free_shipping a SET a.enabled_status = #{param1} 
-		WHERE  a.id IN
-	 	<foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >
-	       #{id}
-	 	</foreach>
-	</update>
-	
-</mapper>

+ 0 - 116
src/main/resources/mappings/modules/activity/FreeShippingTypeMapper.xml

@@ -1,116 +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.activity.dao.FreeShippingTypeDao">
-    
-	<sql id="freeShippingTypeColumns">
-		a.id AS "id",
-		a.scope AS "scope",
-		a.number AS "number",
-		a.start_time AS "startTime",
-		a.end_time AS "endTime",
-		a.info AS "info",
-		a.images AS "images",
-		a.crm_images AS "crmImages",
-		a.status AS "status",
-		a.enabled_status AS "enabledStatus",
-		a.update_by AS "updateBy.id",
-		a.update_date AS "updateDate"
-	</sql>
-	
-	<sql id="freeShippingTypeJoins">
-	</sql>
-    
-	<select id="get" resultType="FreeShippingType">
-		SELECT 
-			<include refid="freeShippingTypeColumns"/>
-		FROM activity_free_shipping_type a
-		<include refid="freeShippingTypeJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="FreeShippingType">
-		SELECT 
-			<include refid="freeShippingTypeColumns"/>
-		FROM activity_free_shipping_type a
-		<include refid="freeShippingTypeJoins"/>
-		<where>
-			
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="FreeShippingType">
-		SELECT 
-			<include refid="freeShippingTypeColumns"/>
-		FROM activity_free_shipping_type a
-		<include refid="freeShippingTypeJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="FreeShippingType"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO activity_free_shipping_type(
-			scope,
-			number,
-			start_time,
-			end_time,
-			info,
-			images,
-			crm_images,
-			status,
-			enabled_status,
-			update_by,
-			update_date
-		) VALUES (
-			#{scope},
-			#{number},
-			#{startTime},
-			#{endTime},
-			#{info},
-			#{images},
-			#{crmImages},
-			#{status},
-			#{enabledStatus},
-			#{updateBy.id},
-			#{updateDate}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE activity_free_shipping_type SET 	
-			scope = #{scope},
-			number = #{number},
-			start_time = #{startTime},
-			end_time = #{endTime},
-			info = #{info},
-			images = #{images},
-			crm_images = #{crmImages},
-			status = #{status},
-			enabled_status = #{enabledStatus},
-			update_by = #{updateBy.id},
-			update_date = #{updateDate}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM activity_free_shipping_type
-		WHERE id = #{id}
-	</delete>
-	
-</mapper>

+ 0 - 111
src/main/resources/mappings/modules/activity/LaserMapper.xml

@@ -1,111 +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.activity.dao.LaserDao">
-    
-	<sql id="laserColumns">
-		a.id AS "id",
-		a.title AS "title",
-		a.image AS "image",
-		a.sortIndex AS "sortIndex",
-		a.enabledStatus AS "enabledStatus",
-		a.createDate AS "createDate"
-	</sql>
-	
-	<sql id="laserJoins">
-	</sql>
-    
-	<select id="get" resultType="Laser">
-		SELECT 
-			<include refid="laserColumns"/>
-		FROM activity_laser a
-		<include refid="laserJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="Laser">
-		SELECT 
-			<include refid="laserColumns"/>
-		FROM activity_laser a
-		<include refid="laserJoins"/>
-		<where>
-			
-			<if test="title != null and title != ''">
-				AND a.title LIKE 
-					<if test="dbName == 'oracle'">'%'||#{title}||'%'</if>
-					<if test="dbName == 'mssql'">'%'+#{title}+'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{title},'%')</if>
-			</if>
-			<if test="enabledStatus != null and enabledStatus != ''">
-				AND a.enabledStatus = #{enabledStatus}
-			</if>
-		</where>
-		<choose>
-			<when test="sqlMap.orderBy !=null and sqlMap.orderBy !=''">
-				${sqlMap.orderBy}
-			</when>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.enabledStatus DESC,a.createDate DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="Laser">
-		SELECT 
-			<include refid="laserColumns"/>
-		FROM activity_laser a
-		<include refid="laserJoins"/>
-		<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="Laser"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO activity_laser(
-			title,
-			image,
-			sortIndex,
-			enabledStatus,
-			createDate
-		) VALUES (
-			#{title},
-			#{image},
-			#{sortIndex},
-			#{enabledStatus},
-			#{createDate}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE activity_laser SET 	
-			title = #{title},
-			image = #{image},
-			sortIndex = #{sortIndex},
-			enabledStatus = #{enabledStatus},
-			createDate = #{createDate}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM activity_laser
-		WHERE id = #{id}
-	</delete>
-	
-	<update id="updateEnabledStatusByIds">
-		UPDATE activity_laser a SET a.enabledStatus = #{param1} 
-		WHERE  a.id IN
-	 	<foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >
-	       #{id}
-	 	</foreach>
-	</update>
-	
-</mapper>

+ 0 - 102
src/main/resources/mappings/modules/advisory/CmAdvisoryMapper.xml

@@ -1,102 +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.advisory.dao.CmAdvisoryDao">
-    
-	<sql id="cmAdvisoryColumns">
-		a.id AS "id",
-		a.name AS "name",
-		a.mobile AS "mobile",
-		a.commitTime AS "commitTime",
-		a.delFlag AS "delFlag"
-	</sql>
-	
-	<sql id="cmAdvisoryJoins">
-	</sql>
-    
-	<select id="get" resultType="CmAdvisory">
-		SELECT 
-			<include refid="cmAdvisoryColumns"/>
-		FROM cm_advisory a
-		<include refid="cmAdvisoryJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="CmAdvisory">
-		SELECT 
-			<include refid="cmAdvisoryColumns"/>
-		FROM cm_advisory a
-		<include refid="cmAdvisoryJoins"/>
-		<where>
-			
-			<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="mobile != null and mobile != ''">
-				AND a.mobile = #{mobile}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.commitTime DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="CmAdvisory">
-		SELECT 
-			<include refid="cmAdvisoryColumns"/>
-		FROM cm_advisory a
-		<include refid="cmAdvisoryJoins"/>
-		<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="CmAdvisory"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cm_advisory(
-			id,
-			name,
-			mobile,
-			commitTime,
-			delFlag
-		) VALUES (
-			#{id},
-			#{name},
-			#{mobile},
-			#{commitTime},
-			#{delFlag}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cm_advisory SET 	
-			name = #{name},
-			mobile = #{mobile},
-			commitTime = #{commitTime},
-			delFlag = #{delFlag}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM cm_advisory
-		WHERE id = #{id}
-	</delete>
-
-	<select id="findUser" resultType="com.caimei.modules.user.entity.CmUser">
-		SELECT * FROM USER WHERE bindMobile = #{mobile}  AND validFlag='1'
-	</select>
-	
-</mapper>

+ 0 - 129
src/main/resources/mappings/modules/banner/CrmBannerMapper.xml

@@ -1,129 +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.banner.dao.CrmBannerDao">
-    
-	<sql id="crmBannerColumns">
-		a.id AS "id",
-		a.title AS "title",
-		a.link AS "link",
-		a.appLink AS "appLink",
-		a.image AS "image",
-		a.sort AS "sort",
-		a.enabledStatus AS "enabledStatus",
-		a.createBy AS "createBy.id",
-		a.createDate AS "createDate",
-		a.updateBy AS "updateBy.id",
-		a.updateDate AS "updateDate"
-	</sql>
-	
-	<sql id="crmBannerJoins">
-	</sql>
-    
-	<select id="get" resultType="CrmBanner">
-		SELECT 
-			<include refid="crmBannerColumns"/>
-		FROM crm_banner a
-		<include refid="crmBannerJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="CrmBanner">
-		SELECT 
-			<include refid="crmBannerColumns"/>
-		FROM crm_banner a
-		<include refid="crmBannerJoins"/>
-		<where>
-			
-			<if test="id != null and id != ''">
-				AND a.id = #{id}
-			</if>
-			<if test="title != null and title != ''">
-				AND a.title LIKE CONCAT('%',#{title},'%')
-			</if>
-			<if test="enabledStatus != null and enabledStatus != ''">
-				AND a.enabledStatus = #{enabledStatus}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.enabledStatus DESC,a.createDate DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="CrmBanner">
-		SELECT 
-			<include refid="crmBannerColumns"/>
-		FROM crm_banner a
-		<include refid="crmBannerJoins"/>
-		<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="CrmBanner"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO crm_banner(
-			title,
-			link,
-			appLink,
-			image,
-			sort,
-			enabledStatus,
-			createBy,
-			createDate,
-			updateBy,
-			updateDate
-		) VALUES (
-			#{title},
-			#{link},
-			#{appLink},
-			#{image},
-			#{sort},
-			#{enabledStatus},
-			#{createBy.id},
-			#{createDate},
-			#{updateBy.id},
-			#{updateDate}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE crm_banner SET 	
-			title = #{title},
-			link = #{link},
-			appLink = #{appLink},
-			image = #{image},
-			sort = #{sort},
-			enabledStatus = #{enabledStatus},
-			updateBy = #{updateBy.id},
-			updateDate = #{updateDate}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM crm_banner
-		WHERE id = #{id}
-	</delete>
-	
-	<update id="updateEnabledStatusByIds">
-		UPDATE crm_banner a SET a.enabledStatus = #{param1} 
-		WHERE  a.id IN
-	 	<foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >
-	       #{id}
-	 	</foreach>
-	</update>
-	
-	<select id="countEnabledStatus" resultType="java.lang.Integer">
-		SELECT count(1) FROM  crm_banner a WHERE a.enabledStatus = #{param1}
-	</select>
-</mapper>

+ 0 - 165
src/main/resources/mappings/modules/brand/BrandAgentMapper.xml

@@ -1,165 +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.brand.dao.BrandAgentDao">
-
-	<sql id="brandAgentColumns">
-		a.id AS "id",
-		a.name AS "name",
-		a.business_license AS "businessLicense",
-		a.business_address AS "businessAddress",
-		a.business_phone AS "businessPhone",
-		a.legal_representaive AS "legalRepresentaive",
-		a.registered_capital AS "registeredCapital",
-		a.enterprise_type AS "enterpriseType",
-		a.business_scope AS "businessScope",
-		a.enabled_status AS "enabledStatus",
-		a.create_by AS "createBy.id",
-		a.create_date AS "createDate",
-		a.update_by AS "updateBy.id",
-		a.update_date AS "updateDate"
-	</sql>
-
-	<sql id="brandAgentColumnsWithProductCount">
-		a.id AS "id",
-		a.name AS "name",
-		a.business_license AS "businessLicense",
-		a.business_address AS "businessAddress",
-		a.business_phone AS "businessPhone",
-		a.legal_representaive AS "legalRepresentaive",
-		a.registered_capital AS "registeredCapital",
-		a.enterprise_type AS "enterpriseType",
-		a.business_scope AS "businessScope",
-		a.enabled_status AS "enabledStatus",
-		a.create_by AS "createBy.id",
-		a.create_date AS "createDate",
-		a.update_by AS "updateBy.id",
-		a.update_date AS "updateDate",
-		COUNT(b.id) AS "productTotalCount",
-		COUNT(DISTINCT c.productID) AS "productTypeCount"
-	</sql>
-
-	<sql id="brandAgentJoins">
-	</sql>
-
-	<sql id="brandAgentJoinsWithProductCount">
-		LEFT JOIN brand_product b ON a.id = b.agent_id
-		LEFT JOIN product c ON b.productID = c.productID
-	</sql>
-
-	<select id="get" resultType="BrandAgent">
-		SELECT
-			<include refid="brandAgentColumns"/>
-		FROM brand_agent a
-		<include refid="brandAgentJoins"/>
-		WHERE a.id = #{id}
-	</select>
-
-	<select id="findList" resultType="BrandAgent">
-		SELECT
-			<include refid="brandAgentColumnsWithProductCount"/>
-		FROM brand_agent a
-		<include refid="brandAgentJoinsWithProductCount"/>
-		<where>
-			<if test="id != null and id != ''">
-				AND a.id = #{id}
-			</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="enabledStatus != null and enabledStatus != ''">
-				AND a.enabled_status = #{enabledStatus}
-			</if>
-			and c.productCategory = 1
-		</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 a.enabled_status DESC,a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-
-	<select id="findAllList" resultType="BrandAgent">
-		SELECT
-			<include refid="brandAgentColumns"/>
-		FROM brand_agent a
-		<include refid="brandAgentJoins"/>
-		<where>
-
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-
-	<insert id="insert" parameterType="BrandAgent"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO brand_agent(
-			name,
-			business_license,
-			business_address,
-			business_phone,
-			legal_representaive,
-			registered_capital,
-			enterprise_type,
-			business_scope,
-			enabled_status,
-			create_by,
-			create_date,
-			update_by,
-			update_date
-		) VALUES (
-			#{name},
-			#{businessLicense},
-			#{businessAddress},
-			#{businessPhone},
-			#{legalRepresentaive},
-			#{registeredCapital},
-			#{enterpriseType},
-			#{businessScope},
-			#{enabledStatus},
-			#{createBy.id},
-			#{createDate},
-			#{updateBy.id},
-			#{updateDate}
-		)
-	</insert>
-
-	<update id="update">
-		UPDATE brand_agent SET
-			name = #{name},
-			business_license = #{businessLicense},
-			business_address = #{businessAddress},
-			business_phone = #{businessPhone},
-			legal_representaive = #{legalRepresentaive},
-			registered_capital = #{registeredCapital},
-			enterprise_type = #{enterpriseType},
-			business_scope = #{businessScope},
-			enabled_status = #{enabledStatus},
-			update_by = #{updateBy.id},
-			update_date = #{updateDate}
-		WHERE id = #{id}
-	</update>
-
-	<delete id="delete">
-		DELETE FROM brand_agent
-		WHERE id = #{id}
-	</delete>
-
-	<update id="changeStatus" parameterType="Map">
-		UPDATE brand_agent SET
-			enabled_status = #{enabledStatus}
-		WHERE id = #{id}
-	</update>
-
-</mapper>

+ 0 - 120
src/main/resources/mappings/modules/brand/BrandIdentificationCodeMapper.xml

@@ -1,120 +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.brand.dao.BrandIdentificationCodeDao">
-    
-	<sql id="brandIdentificationCodeColumns">
-		a.id AS "id",
-		a.identificationcode AS "identificationCode",
-		a.brandproductid AS "brandProductID",
-		a.createtime AS "createTime"
-	</sql>
-	
-	<sql id="brandIdentificationCodeJoins">
-	</sql>
-    
-	<select id="get" resultType="BrandIdentificationCode">
-		SELECT 
-			<include refid="brandIdentificationCodeColumns"/>
-		FROM brand_identification_code a
-		<include refid="brandIdentificationCodeJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="BrandIdentificationCode">
-		SELECT 
-			<include refid="brandIdentificationCodeColumns"/>
-		FROM brand_identification_code a
-		<include refid="brandIdentificationCodeJoins"/>
-		<where>
-			
-			<if test="identificationCode != null and identificationCode != ''">
-				AND a.identificationcode LIKE 
-					<if test="dbName == 'oracle'">'%'||#{identificationCode}||'%'</if>
-					<if test="dbName == 'mssql'">'%'+#{identificationCode}+'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{identificationCode},'%')</if>
-			</if>
-			<if test="status != null and status != ''">
-				<if test="status == -1">
-					AND a.brandProductID IS NOT NULL
-				</if>
-				<if test="status == 1">
-					AND a.brandProductID IS NULL
-				</if>
-			</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="BrandIdentificationCode">
-		SELECT 
-			<include refid="brandIdentificationCodeColumns"/>
-		FROM brand_identification_code a
-		<include refid="brandIdentificationCodeJoins"/>
-		<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="BrandIdentificationCode"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO brand_identification_code(
-			identificationcode,
-			brandproductid,
-			createtime
-		) VALUES (
-			#{identificationCode},
-			#{brandProductID},
-			#{createTime}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE brand_identification_code SET 	
-				identificationcode = #{identificationCode},
-				brandProductID = #{brandProductID},
-				createTime = #{createTime}
-		WHERE id = #{id}
-	</update>
-	
-	<update id="useCode">
-		UPDATE brand_identification_code SET 	
-				brandProductID = #{brandProductID}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM brand_identification_code
-		WHERE id = #{id}
-	</delete>
-	
-	<select id="getUnusedNum" resultType="Long">
-		SELECT COUNT(id) as unUsedNum
-		FROM brand_identification_code
-		WHERE brandProductID IS NULL
-	</select>
-	
-	<select id="getIdentificationCode" resultType="BrandIdentificationCode">
-		SELECT * FROM brand_identification_code
-		WHERE brandProductID IS NULL
-		ORDER BY id ASC
-		LIMIT 1
-	</select>
-	
-	<select id="getByCode" resultType="BrandIdentificationCode">
-		SELECT * FROM brand_identification_code
-		WHERE identificationCode = #{code}
-	</select>
-	
-</mapper>

+ 0 - 239
src/main/resources/mappings/modules/brand/BrandProductMapper.xml

@@ -1,239 +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.brand.dao.BrandProductDao">
-    
-	<sql id="brandProductColumns">
-		a.id AS "id",
-		a.productID AS "productID",
-		a.supplier_id AS "brandSupplier.id",
-		a.agent_id AS "brandAgent.id",
-		a.purchaser_id AS "brandPurchaser.id",
-		a.file_number AS "fileNumber",
-		a.license_start_date AS "licenseStartDate",
-		a.license_end_date AS "licenseEndDate",
-		a.name AS "name",
-		a.license_name AS "licenseName",
-		a.sn AS "sn",
-		a.factory_date AS "factoryDate",
-		a.service_life AS "serviceLife",
-		a.purpose AS "purpose",
-		a.images AS "images",
-		a.large_Images AS "largeImages",
-		a.parameter AS "parameter",
-		a.parameter_images AS "parameterImages",
-		a.parameter_Large_Images AS "parameterLargeImages",
-		a.show_Agent AS "showAgent",
-		a.show_Purchaser AS "showPurchaser",
-		a.enabled_status AS "enabledStatus",
-		a.scan_num AS "scanNum",
-		a.query_num AS "queryNum",
-		a.create_by AS "createBy.id",
-		a.create_date AS "createDate",
-		a.update_by AS "updateBy.id",
-		a.update_date AS "updateDate",
-		a.identification_code AS "identificationCode"
-	</sql>
-	
-	<sql id="brandProductJoins">
-	</sql>
-    
-	<select id="get" resultType="BrandProduct">
-		SELECT 
-			<include refid="brandProductColumns"/>
-		FROM brand_product a
-		<include refid="brandProductJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="BrandProduct">
-		SELECT 
-			<include refid="brandProductColumns"/>
-		FROM brand_product a
-		<include refid="brandProductJoins"/>
-		<where>
-			<if test="productID != null and productID != ''">
-				AND a.productID = #{productID}
-			</if>
-			<if test="name != null and name != ''">
-				AND a.name LIKE CONCAT('%',#{name},'%')
-			</if>
-			<if test="sn != null and sn != ''">
-				AND a.sn = #{sn}
-			</if>
-			<if test="enabledStatus != null and enabledStatus != ''">
-				AND a.enabled_status = #{enabledStatus}
-			</if>
-			<if test="brandAgent != null and brandAgent.id != null and brandAgent.id != ''">
-				AND a.agent_id = #{brandAgent.id}
-			</if>
-			<if test="brandSupplier !=null and brandSupplier.id != null and brandSupplier.id != ''">
-				AND a.supplier_id = #{brandSupplier.id}
-			</if>
-			<if test="brandPurchaser != null and brandPurchaser.id != null and brandPurchaser.id != ''">
-				AND a.purchaser_id = #{brandPurchaser.id}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.enabled_status DESC,a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="BrandProduct">
-		SELECT 
-			<include refid="brandProductColumns"/>
-		FROM brand_product a
-		<include refid="brandProductJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="BrandProduct"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO brand_product(
-			productID,
-			supplier_id,
-			agent_id,
-			purchaser_id,
-			file_number,
-			license_start_date,
-			license_end_date,
-			name,
-			license_name,
-			sn,
-			factory_date,
-			service_life,
-			purpose,
-			images,
-			large_Images,
-			parameter,
-			parameter_images,
-			parameter_Large_Images,
-			show_Agent,
-			show_Purchaser,
-			enabled_status,
-			scan_num,
-			query_num,
-			create_by,
-			create_date,
-			update_by,
-			update_date,
-			identification_code
-		) VALUES (
-			#{productID},
-			#{brandSupplier.id},
-			#{brandAgent.id},
-			#{brandPurchaser.id},
-			#{fileNumber},
-			#{licenseStartDate},
-			#{licenseEndDate},
-			#{name},
-			#{licenseName},
-			#{sn},
-			#{factoryDate},
-			#{serviceLife},
-			#{purpose},
-			#{images},
-			#{largeImages},
-			#{parameter},
-			#{parameterImages},
-			#{parameterLargeImages},
-			#{showAgent},
-			#{showPurchaser},
-			#{enabledStatus},
-			#{scanNum},
-			#{queryNum},
-			#{createBy.id},
-			#{createDate},
-			#{updateBy.id},
-			#{updateDate},
-			#{identificationCode}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE brand_product SET 	
-			productid = #{productID},
-			supplier_id = #{brandSupplier.id},
-			agent_id = #{brandAgent.id},
-			purchaser_id = #{brandPurchaser.id},
-			file_number = #{fileNumber},
-			license_start_date = #{licenseStartDate},
-			license_end_date = #{licenseEndDate},
-			name = #{name},
-			license_name = #{licenseName},
-			sn = #{sn},
-			factory_date = #{factoryDate},
-			service_life = #{serviceLife},
-			purpose = #{purpose},
-			images = #{images},
-			large_Images = #{largeImages},
-			parameter = #{parameter},
-			parameter_images = #{parameterImages},
-			parameter_Large_Images = #{parameterLargeImages},
-			show_Agent = #{showAgent},
-			show_Purchaser = #{showPurchaser},
-			enabled_status = #{enabledStatus},
-			scan_num = #{scanNum},
-			query_num = #{queryNum},
-			update_by = #{updateBy.id},
-			update_date = #{updateDate},
-			identification_code = #{identificationCode}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM brand_product
-		WHERE id = #{id}
-	</delete>
-	
-	<update id="changeStatus" parameterType="Map">
-		UPDATE brand_product SET enabled_status = #{enabledStatus} 
-		WHERE 
-		<if test="supplierID != null and supplierID != ''">
-			supplier_id = #{supplierID}
-		</if>
-		<if test="id != null and id != ''">
-			id = #{id}
-		</if>
-	</update>
-	
-	<update id="updateEnabledStatusByIds" parameterType="Map">
-		UPDATE brand_product a SET a.enabled_status = #{param1} 
-		WHERE  a.id IN
-	 	<foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >
-	       #{id}
-	 	</foreach>
-	</update>
-	
-	<select id="getProductCount" resultType="BrandProduct">
-		SELECT 
-			<include refid="brandProductColumns"/>
-		FROM brand_product a
-		<include refid="brandProductJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-</mapper>

+ 0 - 169
src/main/resources/mappings/modules/brand/BrandProductsMapper.xml

@@ -1,169 +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.brand.dao.BrandProductsDao">
-    
-	<sql id="brandProductsColumns">
-		a.id AS "id",
-		a.name AS "name",
-		a.sn AS "sn",
-		a.images AS "images",
-		a.largeImages AS "largeImages",
-		a.parameter AS "parameter",
-		a.parameterImages AS "parameterImages",
-		a.parameterLargeImages AS "parameterLargeImages",
-		a.purchase AS "purchase",
-		a.scanNum AS "scanNum",
-		a.queryNum AS "queryNum",
-		a.identificationCode AS "identificationCode",
-		a.enabledStatus AS "enabledStatus",
-		a.createBy AS "createBy.id",
-		a.createDate AS "createDate",
-		a.updateBy AS "updateBy.id",
-		a.updateDate AS "updateDate"
-	</sql>
-	
-	<sql id="brandProductsJoins">
-	</sql>
-    
-	<select id="get" resultType="BrandProducts">
-		SELECT 
-			<include refid="brandProductsColumns"/>
-		FROM brand_products a
-		<include refid="brandProductsJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="BrandProducts">
-		SELECT 
-			<include refid="brandProductsColumns"/>
-		FROM brand_products a
-		<include refid="brandProductsJoins"/>
-		<where>
-			
-			<if test="id != null and id != ''">
-				AND a.id = #{id}
-			</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="sn != null and sn != ''">
-				AND a.sn = #{sn}
-			</if>
-			<if test="enabledStatus != null and enabledStatus != ''">
-				AND a.enabledStatus = #{enabledStatus}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.enabledStatus DESC,a.createDate DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="BrandProducts">
-		SELECT 
-			<include refid="brandProductsColumns"/>
-		FROM brand_products a
-		<include refid="brandProductsJoins"/>
-		<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="BrandProducts"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO brand_products(
-			name,
-			sn,
-			images,
-			largeImages,
-			parameter,
-			parameterImages,
-			parameterLargeImages,
-			purchase,
-			identificationCode,
-			enabledStatus,
-			createBy,
-			createDate,
-			updateBy,
-			updateDate
-		) VALUES (
-			#{name},
-			#{sn},
-			#{images},
-			#{largeImages},
-			#{parameter},
-			#{parameterImages},
-			#{parameterLargeImages},
-			#{purchase},
-			#{identificationCode},
-			#{enabledStatus},
-			#{createBy.id},
-			#{createDate},
-			#{updateBy.id},
-			#{updateDate}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE brand_products SET 	
-			name = #{name},
-			sn = #{sn},
-			images = #{images},
-			largeImages = #{largeImages},
-			parameter = #{parameter},
-			parameterImages = #{parameterImages},
-			parameterLargeImages = #{parameterLargeImages},
-			purchase = #{purchase},
-			scanNum = #{scanNum},
-			queryNum = #{queryNum},
-			identificationCode = #{identificationCode},
-			enabledStatus = #{enabledStatus},
-			createBy = #{createBy.id},
-			createDate = #{createDate},
-			updateBy = #{updateBy.id},
-			updateDate = #{updateDate}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM brand_products
-		WHERE id = #{id}
-	</delete>
-	
-	<update id="updateEnabledStatusByIds" parameterType="Map">
-		UPDATE brand_products a SET a.enabledStatus = #{param1} 
-		WHERE  a.id IN
-	 	<foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >
-	       #{id}
-	 	</foreach>
-	</update>
-	
-	<select id="findBySn" resultType="BrandProducts">
-		SELECT 
-			<include refid="brandProductsColumns"/>
-		FROM brand_products a
-		<include refid="brandProductsJoins"/>
-		WHERE a.sn = #{param1}
-	</select>
-	<select id="findByIdentificationCode" resultType="BrandProducts">
-		SELECT 
-			<include refid="brandProductsColumns"/>
-		FROM brand_products a
-		<include refid="brandProductsJoins"/>
-		WHERE a.identificationCode = #{param1}
-	</select>
-	
-</mapper>

+ 0 - 148
src/main/resources/mappings/modules/brand/BrandPurchaserMapper.xml

@@ -1,148 +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.brand.dao.BrandPurchaserDao">
-
-	<sql id="brandPurchaserColumns">
-		a.id AS "id",
-		a.name AS "name",
-		a.purchase_date AS "purchaseDate",
-		a.intro AS "intro",
-		a.publicty_material_images AS "publictyMaterialImages",
-		a.large_Images AS "largeImages",
-		a.enabled_status AS "enabledStatus",
-		a.create_by AS "createBy.id",
-		a.create_date AS "createDate",
-		a.update_by AS "updateBy.id",
-		a.update_date AS "updateDate"
-	</sql>
-
-	<sql id="brandPurchaserColumnsWithProductCount">
-		a.id AS "id",
-		a.name AS "name",
-		a.purchase_date AS "purchaseDate",
-		a.intro AS "intro",
-		a.publicty_material_images AS "publictyMaterialImages",
-		a.large_Images AS "largeImages",
-		a.enabled_status AS "enabledStatus",
-		a.create_by AS "createBy.id",
-		a.create_date AS "createDate",
-		a.update_by AS "updateBy.id",
-		a.update_date AS "updateDate",
-		COUNT(b.id) AS "productTotalCount",
-		COUNT(DISTINCT c.productID) AS "productTypeCount"
-	</sql>
-
-	<sql id="brandPurchaserJoins">
-	</sql>
-
-	<sql id="brandPurchaserJoinsWithProductCount">
-		LEFT JOIN brand_product b ON a.id = b.purchaser_id
-		LEFT JOIN product c ON b.productID = c.productID
-	</sql>
-
-	<select id="get" resultType="BrandPurchaser">
-		SELECT
-			<include refid="brandPurchaserColumns"/>
-		FROM brand_purchaser a
-		<include refid="brandPurchaserJoins"/>
-		WHERE a.id = #{id}
-	</select>
-
-	<select id="findList" resultType="BrandPurchaser">
-		SELECT
-			<include refid="brandPurchaserColumnsWithProductCount"/>
-		FROM brand_purchaser a
-		<include refid="brandPurchaserJoinsWithProductCount"/>
-		<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="enabledStatus != null and enabledStatus != ''">
-				AND a.enabled_status = #{enabledStatus}
-			</if>
-			and c.productCategory = 1
-		</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 a.enabled_status DESC,a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-
-	<select id="findAllList" resultType="BrandPurchaser">
-		SELECT
-			<include refid="brandPurchaserColumns"/>
-		FROM brand_purchaser a
-		<include refid="brandPurchaserJoins"/>
-		<where>
-
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-
-	<insert id="insert" parameterType="BrandPurchaser"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO brand_purchaser(
-			name,
-			purchase_date,
-			intro,
-			publicty_material_images,
-			large_Images,
-			enabled_status,
-			create_by,
-			create_date,
-			update_by,
-			update_date
-		) VALUES (
-			#{name},
-			#{purchaseDate},
-			#{intro},
-			#{publictyMaterialImages},
-			#{largeImages},
-			#{enabledStatus},
-			#{createBy.id},
-			#{createDate},
-			#{updateBy.id},
-			#{updateDate}
-		)
-	</insert>
-
-	<update id="update">
-		UPDATE brand_purchaser SET
-			name = #{name},
-			purchase_date = #{purchaseDate},
-			intro = #{intro},
-			publicty_material_images = #{publictyMaterialImages},
-			large_Images = #{largeImages},
-			enabled_status = #{enabledStatus},
-			update_by = #{updateBy.id},
-			update_date = #{updateDate}
-		WHERE id = #{id}
-	</update>
-
-	<delete id="delete">
-		DELETE FROM brand_purchaser
-		WHERE id = #{id}
-	</delete>
-
-	<update id="changeStatus" parameterType="Map">
-		UPDATE brand_purchaser SET
-			enabled_status = #{enabledStatus}
-		WHERE id = #{id}
-	</update>
-
-</mapper>

+ 0 - 184
src/main/resources/mappings/modules/brand/BrandSupplierMapper.xml

@@ -1,184 +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.brand.dao.BrandSupplierDao">
-
-	<sql id="brandSupplierColumns">
-		a.id AS "id",
-		a.shopid AS "shopID",
-		a.logo AS "LOGO",
-		a.name AS "name",
-		a.business_license AS "businessLicense",
-		a.business_address AS "businessAddress",
-		a.business_phone AS "businessPhone",
-		a.legal_representaive AS "legalRepresentaive",
-		a.registered_capital AS "registeredCapital",
-		a.enterprise_type AS "enterpriseType",
-		a.business_scope AS "businessScope",
-		a.enabled_status AS "enabledStatus",
-		a.create_by AS "createBy.id",
-		a.create_date AS "createDate",
-		a.update_by AS "updateBy.id",
-		a.update_date AS "updateDate"
-	</sql>
-
-	<sql id="brandSupplierColumnsWithProductCount">
-		a.id AS "id",
-		a.shopid AS "shopID",
-		a.logo AS "LOGO",
-		a.name AS "name",
-		a.business_license AS "businessLicense",
-		a.business_address AS "businessAddress",
-		a.business_phone AS "businessPhone",
-		a.legal_representaive AS "legalRepresentaive",
-		a.registered_capital AS "registeredCapital",
-		a.enterprise_type AS "enterpriseType",
-		a.business_scope AS "businessScope",
-		a.enabled_status AS "enabledStatus",
-		a.create_by AS "createBy.id",
-		a.create_date AS "createDate",
-		a.update_by AS "updateBy.id",
-		a.update_date AS "updateDate",
-		COUNT(b.id) AS "productTotalCount",
-		COUNT(DISTINCT c.productID) AS "productTypeCount"
-	</sql>
-
-	<sql id="brandSupplierJoins">
-	</sql>
-
-	<sql id="brandSupplierJoinsWithProductCount">
-		LEFT JOIN brand_product b ON a.id = b.supplier_id
-		LEFT JOIN product c ON b.productID = c.productID
-	</sql>
-
-	<select id="get" resultType="BrandSupplier">
-		SELECT
-			<include refid="brandSupplierColumns"/>, b.name AS shopName
-
-		FROM brand_supplier a LEFT JOIN shop b ON a.shopID = b.shopID
-		<include refid="brandSupplierJoins"/>
-		WHERE a.id = #{id}
-	</select>
-
-	<select id="findList" resultType="BrandSupplier">
-		SELECT
-			<include refid="brandSupplierColumnsWithProductCount"/>
-		FROM brand_supplier a
-		<include refid="brandSupplierJoinsWithProductCount"/>
-		<where>
-
-			<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="enabledStatus != null and enabledStatus != ''">
-				AND a.enabled_status = #{enabledStatus}
-			</if>
-			and c.productCategory = 1
-		</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 a.enabled_status DESC,a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-
-	<select id="findAllList" resultType="BrandSupplier">
-		SELECT
-			<include refid="brandSupplierColumns"/>
-		FROM brand_supplier a
-		<include refid="brandSupplierJoins"/>
-		<where>
-
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-
-	<insert id="insert" parameterType="BrandSupplier"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO brand_supplier(
-			shopid,
-			logo,
-			name,
-			business_license,
-			business_address,
-			business_phone,
-			legal_representaive,
-			registered_capital,
-			enterprise_type,
-			business_scope,
-			enabled_status,
-			create_by,
-			create_date,
-			update_by,
-			update_date
-		) VALUES (
-			#{shopID},
-			#{LOGO},
-			#{name},
-			#{businessLicense},
-			#{businessAddress},
-			#{businessPhone},
-			#{legalRepresentaive},
-			#{registeredCapital},
-			#{enterpriseType},
-			#{businessScope},
-			#{enabledStatus},
-			#{createBy.id},
-			#{createDate},
-			#{updateBy.id},
-			#{updateDate}
-		)
-	</insert>
-
-	<update id="update">
-		UPDATE brand_supplier SET
-			shopid = #{shopID},
-			logo = #{LOGO},
-			name = #{name},
-			business_license = #{businessLicense},
-			business_address = #{businessAddress},
-			business_phone = #{businessPhone},
-			legal_representaive = #{legalRepresentaive},
-			registered_capital = #{registeredCapital},
-			enterprise_type = #{enterpriseType},
-			business_scope = #{businessScope},
-			enabled_status = #{enabledStatus},
-			update_by = #{updateBy.id},
-			update_date = #{updateDate}
-		WHERE id = #{id}
-	</update>
-
-	<delete id="delete">
-		DELETE FROM brand_supplier
-		WHERE id = #{id}
-	</delete>
-
-	<update id="changeStatus" parameterType="Map">
-		UPDATE brand_supplier SET enabled_status = #{enabledStatus}
-		WHERE id = #{id}
-	</update>
-
-	<update id="updateEnabledStatusByIds" parameterType="Map">
-		UPDATE brand_supplier a SET a.enabled_status = #{param1}
-		WHERE  a.id IN
-	 	<foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >
-	       #{id}
-	 	</foreach>
-	</update>
-
-</mapper>

+ 0 - 76
src/main/resources/mappings/modules/brand/ProductModelMapper.xml

@@ -1,76 +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.brand.dao.ProductModelDao">
-
-	<sql id="aColumns">
-		a.productID AS "productID",
-		a.name AS "productName",
-		a.shopID AS "shopID",
-		b.name AS "shopName"
-	</sql>
-
-	<sql id="aJoins">
-		LEFT JOIN shop b ON b.shopID=a.shopID
-	</sql>
-
-	<select id="get" resultType="ProductModel">
-		SELECT
-			<include refid="aColumns"/>
-		FROM product a
-		<include refid="aJoins"/>
-		WHERE a.productID = #{productID}
-	</select>
-
-	<select id="findList" resultType="ProductModel">
-		SELECT
-			<include refid="aColumns"/>
-		FROM product a
-		<include refid="aJoins"/>
-		<where>
-			<if test="productID != null and productID != ''">
-				AND a.productID = #{productID}
-			</if>
-			<if test="productName != null and productName != ''">
-				AND a.name LIKE concat('%',#{productName},'%')
-			</if>
-				AND a.validFlag ='2'
-				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 a.productID DESC
-			</otherwise>
-		</choose>
-	</select>
-
-	<select id="findAllList" resultType="ProductModel">
-		SELECT
-			<include refid="aColumns"/>
-		FROM product a
-		<include refid="aJoins"/>
-		<where>
-			a.productCategory = 1
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.productID DESC
-			</otherwise>
-		</choose>
-	</select>
-
-	<insert id="insert">
-	</insert>
-
-	<update id="update">
-	</update>
-
-	<delete id="delete">
-	</delete>
-
-</mapper>

+ 0 - 75
src/main/resources/mappings/modules/brand/ShopModelMapper.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.brand.dao.ShopModelDao">
-    
-	<sql id="aColumns">
-		a.shopID AS "shopID",
-		a.name AS "shopName",
-		a.logo AS "logo",
-		a.ledgerNo as "ledgerNo"
-	</sql>
-	
-	<sql id="aJoins">
-		
-	</sql>
-    
-	<select id="get" resultType="ShopModel">
-		SELECT 
-			<include refid="aColumns"/>
-		FROM shop a
-		<include refid="aJoins"/>
-		WHERE a.shopID = #{shopID}
-	</select>
-	
-	<select id="findList" resultType="ShopModel">
-		SELECT 
-			<include refid="aColumns"/>
-		FROM shop a
-		<include refid="aJoins"/>
-		<where>
-			<if test="shopID != null and shopID != ''">
-				AND a.shopID = #{shopID}
-			</if>
-			<if test="shopName != null and shopName != ''">
-				AND a.name LIKE concat('%',#{shopName},'%')
-			</if>
-			AND a.status IN (9,10,90)
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.shopID DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="ShopModel">
-		SELECT 
-			<include refid="aColumns"/>
-		FROM shop a
-		<include refid="aJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.productID DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert">
-	</insert>
-	
-	<update id="update">
-	</update>
-	
-	<delete id="delete">
-	</delete>
-	
-</mapper>

+ 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 - 106
src/main/resources/mappings/modules/bulkpurchase/CmRefundsRecordMapper.xml

@@ -1,106 +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.CmRefundsRecordDao">
-    
-	<sql id="cmRefundsRecordColumns">
-		a.id AS "id",
-		a.orderId AS "orderId",
-		a.userId AS "userId",
-		a.userType AS "userType",
-		a.orderType AS "orderType",
-		a.recordContent AS "recordContent",
-		a.recordDate AS "recordDate"
-	</sql>
-	
-	<sql id="cmRefundsRecordJoins">
-	</sql>
-    
-	<select id="get" resultType="CmRefundsRecord">
-		SELECT 
-			<include refid="cmRefundsRecordColumns"/>
-		FROM cm_refunds_record a
-		<include refid="cmRefundsRecordJoins"/>
-		WHERE a.id = #{id}
-		order BY a.recordDate DESC
-	</select>
-	
-	<select id="findList" resultType="CmRefundsRecord">
-		SELECT 
-			<include refid="cmRefundsRecordColumns"/>
-		FROM cm_refunds_record a
-		<include refid="cmRefundsRecordJoins"/>
-		<where>
-			
-			<if test="userId != null and userId != ''">
-				AND a.userId = #{userId}
-			</if>
-			<if test="orderId != null and orderId != ''">
-				AND a.orderId = #{orderId}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-		order BY a.recordDate DESC
-	</select>
-	
-	<select id="findAllList" resultType="CmRefundsRecord">
-		SELECT 
-			<include refid="cmRefundsRecordColumns"/>
-		FROM cm_refunds_record a
-		<include refid="cmRefundsRecordJoins"/>
-		<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="CmRefundsRecord"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cm_refunds_record(
-			id,
-			orderId,
-			userId,
-			userType,
-			orderType,
-			recordContent,
-			recordDate
-		) VALUES (
-			#{id},
-			#{orderId},
-			#{userId},
-			#{userType},
-			#{orderType},
-			#{recordContent},
-			#{recordDate}
-		)
-	</insert>
-	
-	<update id="update">
-	UPDATE cm_refunds_record SET
-	orderId = #{orderId},
-	userId = #{userId},
-	userType = #{userType},
-	orderType = #{orderType},
-	recordContent = #{recordContent},
-	recordDate = #{recordDate}
-	WHERE id = #{id}
-    </update>
-
-
-	
-	<delete id="delete">
-		DELETE FROM cm_refunds_record
-		WHERE id = #{id}
-	</delete>
-	
-</mapper>

+ 0 - 28
src/main/resources/mappings/modules/bulkpurchase/CommissionsMapper.xml

@@ -1,28 +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.CommissionsDao">
-
-<select id="findList" resultType="com.caimei.modules.bulkpurchase.entity.Commissions">
-    SELECT id,orderid,`name`,`addtime`,sales,script
-    FROM `sales_commissions`
-    WHERE orderid=#{orderId}
-    ORDER BY `addtime` DESC
-</select>
-
-
-    <insert id="insert" parameterType="com.caimei.modules.bulkpurchase.entity.Commissions" keyProperty="id"
-            useGeneratedKeys="true">
-        INSERT INTO `sales_commissions`
-        (orderid,
-         name,
-         `addtime`,
-         `sales`,
-         script)
-        VALUES (#{orderId},
-                #{name},
-                #{addTime},
-                #{sales},
-                #{script})
-    </insert>
-
-</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 - 143
src/main/resources/mappings/modules/cibe/CibeBlessingCompoMapper.xml

@@ -1,143 +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.cibe.dao.CibeBlessingCompoDao">
-    
-	<sql id="cibeBlessingCompoColumns">
-		a.id AS "id",
-		a.userId AS "userId",
-		a.mobile AS "mobile",
-		a.blessNum AS "blessNum",
-		a.blessCode AS "blessCode",
-		a.getWay AS "getWay",
-		a.getTime AS "getTime",
-		a.activeNum AS "activeNum",
-		a.activeStartTime AS "activeStartTime",
-		a.activeEndTime AS "activeEndTime",
-		a.openStatus AS "openStatus",
-		a.prizeType AS "prizeType",
-		a.prizeDescribe AS "prizeDescribe",
-		a.money AS "money",
-		a.goPrize AS "goPrize"
-	</sql>
-	
-	<sql id="cibeBlessingCompoJoins">
-	</sql>
-    
-	<select id="get" resultType="CibeBlessingCompo">
-		SELECT 
-			<include refid="cibeBlessingCompoColumns"/>
-		FROM cibe_blessing_compo a
-		<include refid="cibeBlessingCompoJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="CibeBlessingCompo">
-		SELECT
-		a.*,cu.userType AS "userType",cu.userName AS "userName",cu.address AS "address"
-		FROM cibe_blessing_compo a
-		LEFT JOIN cibe_user cu ON cu.userId = a.userId
-		<where>
-			
-			<if test="userId != null and userId != ''">
-				AND a.userId = #{userId}
-			</if>
-			<if test="mobile != null and mobile != ''">
-				AND a.mobile = #{mobile}
-			</if>
-			<if test="blessCode != null and blessCode != ''">
-				AND a.blessCode = #{blessCode}
-			</if>
-			<if test="getWay != null and getWay != ''">
-				AND a.getWay = #{getWay}
-			</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="CibeBlessingCompo">
-		SELECT 
-			<include refid="cibeBlessingCompoColumns"/>
-		FROM cibe_blessing_compo a
-		<include refid="cibeBlessingCompoJoins"/>
-		<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="CibeBlessingCompo"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cibe_blessing_compo(
-			userId,
-			mobile,
-			blessNum,
-			blessCode,
-			getWay,
-			getTime,
-			activeNum,
-			activeStartTime,
-			activeEndTime,
-			openStatus,
-			prizeType,
-			prizeDescribe,
-			money,
-			goPrize
-		) VALUES (
-			#{userId},
-			#{mobile},
-			#{blessNum},
-			#{blessCode},
-			#{getWay},
-			#{getTime},
-			#{activeNum},
-			#{activeStartTime},
-			#{activeEndTime},
-			#{openStatus},
-			#{prizeType},
-			#{prizeDescribe},
-			#{money},
-			#{goPrize}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cibe_blessing_compo SET 	
-			mobile = #{mobile},
-			blessNum = #{blessNum},
-			blessCode = #{blessCode},
-			getWay = #{getWay},
-			getTime = #{getTime},
-			activeNum = #{activeNum},
-			activeStartTime = #{activeStartTime},
-			activeEndTime = #{activeEndTime},
-			openStatus = #{openStatus},
-			prizeType = #{prizeType},
-			prizeDescribe = #{prizeDescribe},
-			money = #{money},
-			goPrize = #{goPrize}
-		WHERE id = #{id}
-	</update>
-
-	<update id="updateLottery">
-		UPDATE cibe_blessing_compo SET
-		goPrize = 1
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM cibe_blessing_compo
-		WHERE id = #{id}
-	</delete>
-	
-</mapper>

+ 0 - 107
src/main/resources/mappings/modules/cibe/CibePrizeMapper.xml

@@ -1,107 +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.cibe.dao.CibePrizeDao">
-    
-	<sql id="cibePrizeColumns">
-		a.id AS "id",
-		a.userId AS "userId",
-		a.prizeType AS "prizeType",
-		a.prizeCode AS "prizeCode",
-		a.mobile AS "mobile",
-		a.addTime AS "addTime"
-	</sql>
-	
-	<sql id="cibePrizeJoins">
-	</sql>
-    
-	<select id="get" resultType="CibePrize">
-		SELECT 
-			<include refid="cibePrizeColumns"/>
-		FROM cibe_prize a
-		<include refid="cibePrizeJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="CibePrize">
-		SELECT 
-			<include refid="cibePrizeColumns"/>
-		FROM cibe_prize a
-		<include refid="cibePrizeJoins"/>
-		<where>
-			
-			<if test="id != null and id != ''">
-				AND a.id = #{id}
-			</if>
-			<if test="userId != null and userId != ''">
-				AND a.userId = #{userId}
-			</if>
-			<if test="prizeType != null and prizeType != ''">
-				AND a.prizeType = #{prizeType}
-			</if>
-			<if test="mobile != null and mobile != ''">
-				AND a.mobile = LIKE
-				<if test="dbName == 'oracle'">'%'||#{mobile}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{mobile}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{mobile},'%')</if>
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY addTime DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="CibePrize">
-		SELECT 
-			<include refid="cibePrizeColumns"/>
-		FROM cibe_prize a
-		<include refid="cibePrizeJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY addTime DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="CibePrize"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cibe_prize(
-			userId,
-			prizeType,
-			prizeCode,
-			mobile,
-			addTime
-		) VALUES (
-			#{userId},
-			#{prizeType},
-			#{prizeCode},
-			#{mobile},
-			#{addTime}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cibe_prize SET 	
-			userId = #{userId},
-			prizeType = #{prizeType},
-			prizeCode = #{prizeCode},
-			mobile = #{mobile},
-			addTime = #{addTime}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM cibe_prize
-		WHERE id = #{id}
-	</delete>
-	
-</mapper>

+ 0 - 113
src/main/resources/mappings/modules/cibe/CibeProductTypeMapper.xml

@@ -1,113 +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.cibe.dao.CibeProductTypeDao">
-    
-	<sql id="cibeProductTypeColumns">
-		a.id AS "id",
-		a.productType AS "productType",
-		a.shopIDs AS "shopIDs",
-		a.enabledStatus AS "enabledStatus",
-		a.addTime AS "addTime",
-		a.updateTime AS "updateTime",
-		a.sortIndex AS "sortIndex"
-	</sql>
-	
-	<sql id="cibeProductTypeJoins">
-	</sql>
-    
-	<select id="get" resultType="CibeProductType">
-		SELECT 
-			<include refid="cibeProductTypeColumns"/>
-		FROM cibe_product_type a
-		<include refid="cibeProductTypeJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="CibeProductType">
-		SELECT 
-			<include refid="cibeProductTypeColumns"/>
-		FROM cibe_product_type a
-		<include refid="cibeProductTypeJoins"/>
-		<where>
-			
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.enabledStatus DESC ,a.sortIndex DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="CibeProductType">
-		SELECT 
-			<include refid="cibeProductTypeColumns"/>
-		FROM cibe_product_type a
-		<include refid="cibeProductTypeJoins"/>
-		<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="CibeProductType"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cibe_product_type(
-			productType,
-			shopIDs,
-			enabledStatus,
-			addTime,
-			updateTime,
-			sortIndex
-		) VALUES (
-			#{productType},
-			#{shopIDs},
-			#{enabledStatus},
-			#{addTime},
-			#{updateTime},
-			#{sortIndex}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cibe_product_type SET 	
-			productType = #{productType},
-			shopIDs = #{shopIDs},
-			enabledStatus = #{enabledStatus},
-			addTime = #{addTime},
-			updateTime = #{updateTime},
-			sortIndex = #{sortIndex}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM cibe_product_type
-		WHERE id = #{id}
-	</delete>
-
-
-	<!--判断商品分类名称唯一-->
-	<select id="getByProductType" resultType="CibeProductType">
-		SELECT
-		*
-		FROM cibe_product_type a
-		WHERE
-		a.productType = #{productType}
-		<if test="id != null and id != ''">
-			AND a.id != #{id}
-		</if>
-	</select>
-
-	<!--修改状态-->
-	<update id="updateEnabledStatusById">
-		UPDATE cibe_product_type a SET a.enabledStatus = #{enabledStatus}
-		WHERE  a.id = #{id}
-	</update>
-</mapper>

+ 0 - 150
src/main/resources/mappings/modules/cibe/CibeShopMapper.xml

@@ -1,150 +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.cibe.dao.CibeShopDao">
-    
-	<sql id="cibeShopColumns">
-		a.id AS "id",
-		a.shopId AS "shopId",
-		a.shopName AS "shopName",
-		a.sname AS "sname",
-		a.exhibitionLocation AS "exhibitionLocation",
-		a.showKey AS "showKey",
-		a.searchKey AS "searchKey",
-		a.brandManufacturers AS "brandManufacturers",
-		a.sortIndex AS "sortIndex"
-	</sql>
-	
-	<sql id="cibeShopJoins">
-	</sql>
-    
-	<select id="get" resultType="CibeShop">
-		SELECT 
-			<include refid="cibeShopColumns"/>
-		FROM cibe_shop a
-		<include refid="cibeShopJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="CibeShop">
-		SELECT 
-			<include refid="cibeShopColumns"/>
-		FROM cibe_shop a
-		<include refid="cibeShopJoins"/>
-		<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="CibeShop">
-		SELECT 
-			<include refid="cibeShopColumns"/>
-		FROM cibe_shop a
-		<include refid="cibeShopJoins"/>
-		<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="CibeShop"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cibe_shop(
-			id,
-			shopId,
-			shopName,
-			sname,
-			exhibitionLocation,
-			showKey,
-			searchKey,
-			brandManufacturers,
-			sortIndex
-		) VALUES (
-			#{id},
-			#{shopId},
-			#{shopName},
-			#{sname},
-			#{exhibitionLocation},
-			#{showKey},
-			#{searchKey},
-			#{brandManufacturers},
-			#{sortIndex}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cibe_shop SET 	
-			shopId = #{shopId},
-			shopName = #{shopName},
-			sname = #{sname},
-			exhibitionLocation = #{exhibitionLocation},
-			showKey = #{showKey},
-			searchKey = #{searchKey},
-			brandManufacturers = #{brandManufacturers},
-			sortIndex = #{sortIndex}
-		WHERE id = #{id}
-	</update>
-
-	<delete id="deleteAll">
-		DELETE FROM cibe_shop
-	</delete>
-
-	<delete id="delete">
-		DELETE FROM cibe_shop
-		WHERE id = #{id}
-	</delete>
-
-	<update id="updateSname">
-		UPDATE cibe_shop SET
-		sname = #{sname}
-		WHERE id = #{id}
-	</update>
-
-	<!--获取采美供应商详情-->
-	<select id="getShopInfo" resultType="com.caimei.modules.cibe.entity.Shop">
-		SELECT
-		*
-		FROM shop
-		WHERE shopID = #{shopId}
-	</select>
-
-	<!--获取供应商资质认证-->
-	<select id="getShopCert" resultType="com.caimei.modules.cibe.entity.ShopCert">
-		SELECT
-		*
-		FROM shopcert
-		WHERE shopID = #{shopId}
-	</select>
-
-	<!--通过供应商ID串获取供应商-->
-	<select id="findCibeShopByShopIDs" resultType="com.caimei.modules.cibe.entity.CibeShop" parameterType="com.caimei.modules.cibe.entity.CibeProductType">
-		SELECT
-		*
-		FROM cibe_shop
-		WHERE  ${sqlMap.shopIDs}
-	</select>
-
-
-	<select id="getLocation" resultType="com.caimei.modules.cibe.entity.CibeShop">
-		SELECT
-		<include refid="cibeShopColumns"/>
-		FROM cibe_shop a
-		<include refid="cibeShopJoins"/>
-		WHERE
-		a.exhibitionLocation = #{location}
-		<if test="id != null and id != ''">
-			AND a.id != #{id}
-		</if>
-	</select>
-</mapper>

+ 0 - 96
src/main/resources/mappings/modules/cibe/CibeSpecialMobileMapper.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.cibe.dao.CibeSpecialMobileDao">
-    
-	<sql id="cibeSpecialMobileColumns">
-		a.id AS "id",
-		a.mobile AS "mobile",
-		a.addTime AS "addTime",
-		a.state AS "state"
-	</sql>
-	
-	<sql id="cibeSpecialMobileJoins">
-	</sql>
-    
-	<select id="get" resultType="CibeSpecialMobile">
-		SELECT 
-			<include refid="cibeSpecialMobileColumns"/>
-		FROM cibe_special_mobile a
-		<include refid="cibeSpecialMobileJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="CibeSpecialMobile">
-		SELECT 
-			<include refid="cibeSpecialMobileColumns"/>
-		FROM cibe_special_mobile a
-		<include refid="cibeSpecialMobileJoins"/>
-		<where>
-			
-			<if test="mobile != null and mobile != ''">
-				AND a.mobile = #{mobile}
-			</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="CibeSpecialMobile">
-		SELECT 
-			<include refid="cibeSpecialMobileColumns"/>
-		FROM cibe_special_mobile a
-		<include refid="cibeSpecialMobileJoins"/>
-		<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="CibeSpecialMobile"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cibe_special_mobile(
-			mobile,
-			addTime,
-			state
-		) VALUES (
-			#{mobile},
-			#{addTime},
-			#{state}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cibe_special_mobile SET 	
-			mobile = #{mobile},
-			addTime = #{addTime},
-			state = #{state}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM cibe_special_mobile
-		WHERE id = #{id}
-	</delete>
-
-	<select id="getMobile" resultType="CibeSpecialMobile">
-		SELECT
-		*
-		FROM cibe_special_mobile a
-		<where>
-			   a.mobile = #{mobile}
-			<if test="id != null and id != ''">
-				AND a.id != #{id}
-			</if>
-		</where>
-	</select>
-</mapper>

+ 0 - 127
src/main/resources/mappings/modules/cibe/CibeUserMapper.xml

@@ -1,127 +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.cibe.dao.CibeUserDao">
-    
-	<sql id="cibeUserColumns">
-		a.id AS "id",
-		a.userId AS "userId",
-		a.userName AS "userName",
-		a.mobile AS "mobile",
-		a.address AS "address",
-		a.userType AS "userType",
-		a.openid AS "openid",
-		a.prizeId AS "prizeId",
-		a.prizeType AS "prizeType",
-		a.prizeCode AS "prizeCode",
-		a.prizeTime AS "prizeTime"
-	</sql>
-	
-	<sql id="cibeUserJoins">
-	</sql>
-    
-	<select id="get" resultType="CibeUser">
-		SELECT 
-			<include refid="cibeUserColumns"/>
-		FROM cibe_user a
-		<include refid="cibeUserJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="CibeUser">
-		SELECT 
-			<include refid="cibeUserColumns"/>
-		FROM cibe_user a
-		<include refid="cibeUserJoins"/>
-		<where>
-			<if test="userId != null and userId != ''">
-				AND a.userId = #{userId}
-			</if>
-			<if test="userName != null and userName != ''">
-				AND a.userName LIKE 
-					<if test="dbName == 'oracle'">'%'||#{userName}||'%'</if>
-					<if test="dbName == 'mssql'">'%'+#{userName}+'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{userName},'%')</if>
-			</if>
-			<if test="mobile != null and mobile != ''">
-				AND a.mobile LIKE
-				<if test="dbName == 'oracle'">'%'||#{mobile}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{mobile}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{mobile},'%')</if>
-			</if>
-			<if test="prizeType != null and prizeType != ''">
-				AND a.prizeType = #{prizeType}
-			</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="CibeUser">
-		SELECT 
-			<include refid="cibeUserColumns"/>
-		FROM cibe_user a
-		<include refid="cibeUserJoins"/>
-		<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="CibeUser"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cibe_user(
-			userId,
-			userName,
-			mobile,
-			address,
-			userType,
-			openid,
-			prizeId,
-			prizeType,
-			prizeCode,
-			prizeTime
-		) VALUES (
-			#{userId},
-			#{userName},
-			#{mobile},
-			#{address},
-			#{userType},
-			#{openid},
-			#{prizeId},
-			#{prizeType},
-			#{prizeCode},
-			#{prizeTime}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cibe_user SET 	
-			userId = #{userId},
-			userName = #{userName},
-			mobile = #{mobile},
-			address = #{address},
-			userType = #{userType},
-			openid = #{openid},
-			prizeId = #{prizeId},
-			prizeType = #{prizeType},
-			prizeCode = #{prizeCode},
-			prizeTime = #{prizeTime}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM cibe_user
-		WHERE id = #{id}
-	</delete>
-	
-</mapper>

+ 0 - 93
src/main/resources/mappings/modules/cmme/dict/CmmeSysDictMapper.xml

@@ -1,93 +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.cmme.modules.dict.dao.CmmeSysDictDao">
-    
-	<select id="get" resultType="CmmeSysDict">
-		SELECT 
-			*
-		FROM cmme_sys_dict
-		WHERE id = #{id}
-	</select>
-	
-	<select id="findList" resultType="CmmeSysDict">
-		SELECT
-		*
-		FROM cmme_sys_dict
-		WHERE del_flag = #{DEL_FLAG_NORMAL}
-		<if test="type != null and type != ''">
-			AND type = #{type}
-		</if>
-		<if test="description != null and description != ''">
-			AND description LIKE
-			<if test="dbName == 'oracle'">'%'||#{description}||'%'</if>
-			<if test="dbName == 'mssql'">'%'+#{description}+'%'</if>
-			<if test="dbName == 'mysql'">CONCAT('%', #{description}, '%')</if>
-		</if>
-		ORDER BY type, sort, update_date DESC
-	</select>
-	
-	<select id="findAllList" resultType="CmmeSysDict">
-		SELECT
-		*
-		FROM cmme_sys_dict
-		WHERE del_flag = #{DEL_FLAG_NORMAL}
-		ORDER BY type, sort, update_date DESC
-	</select>
-
-	<select id="findTypeList" resultType="string">
-		SELECT
-		type
-		FROM cmme_sys_dict
-		WHERE del_flag = #{DEL_FLAG_NORMAL}
-		GROUP BY type
-		ORDER BY type
-	</select>
-
-
-	<insert id="insert" parameterType="CmmeSysDict"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cmme_sys_dict(
-			value,
-			label,
-			type,
-			description,
-			sort,
-			create_by,
-			create_date,
-			update_by,
-			update_date,
-			remarks,
-			del_flag
-		) VALUES (
-			#{value},
-			#{label},
-			#{type},
-			#{description},
-			#{sort},
-			#{createBy.id},
-			#{createDate},
-			#{updateBy.id},
-			#{updateDate},
-			#{remarks},
-			#{delFlag}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cmme_sys_dict SET
-			value = #{value},
-			label = #{label},
-			type = #{type},
-			description = #{description},
-			sort = #{sort},
-			update_by = #{updateBy.id},
-			update_date = #{updateDate},
-			remarks = #{remarks}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM cmme_sys_dict
-		WHERE id = #{id}
-	</delete>
-	
-</mapper>

+ 0 - 124
src/main/resources/mappings/modules/cmme/product/CmmeBigtypeMapper.xml

@@ -1,124 +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.cmme.modules.product.dao.CmmeBigtypeDao">
-    
-	<sql id="cmmeBigtypeColumns">
-		a.bigTypeID AS "bigTypeID",
-		a.name AS "name",
-		a.bigTypeCode AS "bigTypeCode",
-		a.validFlag AS "validFlag",
-		a.sortIndex AS "sortIndex"
-	</sql>
-	
-	<sql id="cmmeBigtypeJoins">
-	</sql>
-    
-	<select id="get" resultType="CmmeBigtype">
-		SELECT 
-			<include refid="cmmeBigtypeColumns"/>
-		FROM cmme_bigtype a
-		<include refid="cmmeBigtypeJoins"/>
-		WHERE a.bigTypeID = #{id}
-	</select>
-
-	<!--由于分类ID必须不唯一则重复编辑的时候查看不等于自己ID的code是否重复-->
-	<select id="getByCode" resultType="CmmeBigtype">
-		SELECT
-		<include refid="cmmeBigtypeColumns"/>
-		FROM cmme_bigtype a
-		<include refid="cmmeBigtypeJoins"/>
-		WHERE
-		a.bigTypeCode = #{bigTypeCode}
-		<if test="bigTypeID != null and bigTypeID != ''">
-		AND a.bigTypeID != #{bigTypeID}
-		</if>
-	</select>
-
-	<select id="getByName" resultType="CmmeBigtype">
-		SELECT
-		<include refid="cmmeBigtypeColumns"/>
-		FROM cmme_bigtype a
-		<include refid="cmmeBigtypeJoins"/>
-		WHERE
-		a.name = #{name}
-		<if test="bigTypeID != null and bigTypeID != ''">
-			AND a.bigTypeID != #{bigTypeID}
-		</if>
-	</select>
-
-
-	<select id="findList" resultType="CmmeBigtype">
-		SELECT 
-			<include refid="cmmeBigtypeColumns"/>
-		FROM cmme_bigtype a
-		<include refid="cmmeBigtypeJoins"/>
-		<where>
-			
-			<if test="bigTypeID != null and bigTypeID != ''">
-				AND a.bigTypeID = #{bigTypeID}
-			</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="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="CmmeBigtype">
-		SELECT 
-			<include refid="cmmeBigtypeColumns"/>
-		FROM cmme_bigtype a
-		<include refid="cmmeBigtypeJoins"/>
-		<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="CmmeBigtype"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cmme_bigtype(
-			name,
-			bigTypeCode,
-			validFlag,
-			sortIndex
-		) VALUES (
-			#{name},
-			#{bigTypeCode},
-			#{validFlag},
-			#{sortIndex}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cmme_bigtype SET 	
-			name = #{name},
-			bigTypeCode = #{bigTypeCode},
-			validFlag = #{validFlag},
-			sortIndex = #{sortIndex}
-		WHERE bigTypeID = #{bigTypeID}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM cmme_bigtype
-		WHERE bigTypeID = #{bigTypeID}
-	</delete>
-	
-</mapper>

+ 0 - 114
src/main/resources/mappings/modules/cmme/product/CmmeMainproductMapper.xml

@@ -1,114 +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.cmme.modules.product.dao.CmmeMainproductDao">
-    
-	<sql id="cmmeMainproductColumns">
-		a.mainProductID AS "mainProductID",
-		a.productID AS "productID",
-		a.shopID AS "shopID",
-		a.productIndex AS "productIndex",
-		a.productMainImage AS "productMainImage",
-		a.productName AS "productName",
-		a.validFlag AS "validFlag"
-	</sql>
-	
-	<sql id="cmmeMainproductJoins">
-	</sql>
-    
-	<select id="get" resultType="CmmeMainproduct">
-		SELECT 
-			<include refid="cmmeMainproductColumns"/>
-		FROM cmme_mainproduct a
-		<include refid="cmmeMainproductJoins"/>
-		WHERE a.mainProductID = #{id} AND validFlag = 1
-	</select>
-
-	<select id="getByProductID" resultType="CmmeMainproduct">
-		SELECT
-		<include refid="cmmeMainproductColumns"/>
-		FROM cmme_mainproduct a
-		<include refid="cmmeMainproductJoins"/>
-		WHERE a.productID = #{productID} AND validFlag = 1
-	</select>
-
-	<select id="findList" resultType="CmmeMainproduct">
-		SELECT 
-			<include refid="cmmeMainproductColumns"/>
-		FROM cmme_mainproduct a
-		<include refid="cmmeMainproductJoins"/>
-		<where>
-			
-			<if test="mainProductID != null and mainProductID != ''">
-				AND a.mainProductID = #{mainProductID}
-			</if>
-			<if test="productID != null and productID != ''">
-				AND a.productID = #{productID}
-			</if>
-			<if test="shopID != null and shopID != ''">
-				AND a.shopID = #{shopID}
-			</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="CmmeMainproduct">
-		SELECT 
-			<include refid="cmmeMainproductColumns"/>
-		FROM cmme_mainproduct a
-		<include refid="cmmeMainproductJoins"/>
-		<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="CmmeMainproduct"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cmme_mainproduct(
-			productID,
-			shopID,
-			productIndex,
-			productMainImage,
-			productName,
-			validFlag
-		) VALUES (
-			#{productID},
-			#{shopID},
-			#{productIndex},
-			#{productMainImage},
-			#{productName},
-			#{validFlag}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cmme_mainproduct SET 	
-			productID = #{productID},
-			shopID = #{shopID},
-			productIndex = #{productIndex},
-			productMainImage = #{productMainImage},
-			productName = #{productName},
-			validFlag = #{validFlag}
-		WHERE mainProductID = #{mainProductID}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM cmme_mainproduct
-		WHERE mainProductID = #{id}
-	</delete>
-	
-</mapper>

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

@@ -112,7 +112,7 @@
         -- 	relationType值为1是为子订单ID,为2时为主订单ID)
         SELECT
         <include refid="cmDiscernReceiptColumns"/>,
-        cr.orderID AS orderID,
+        cso_s.orderID AS orderID,
         cso_s.shopOrderNo as shopOrderNos,
         cso.shopOrderId as shopOrderId,
         cof.bankAccount AS bankNameType,
@@ -645,7 +645,7 @@
         cdr.shopName as shopName
 	    from
 		cm_discern_receipt cdr
-		left join receipt_user_permission rup on cdr.confirmUserPermissionID = rup.id
+		left join cm_receipt_user rup on cdr.confirmUserPermissionID = rup.id
         LEFT JOIN cm_offline_collection cof ON cdr.payType = cof.type
 		where cdr.id = #{receiptID}
 	</select>
@@ -724,11 +724,11 @@
         cdr.transactionNum AS transactionNum,
         cror.mbOrderId AS mbOrderId,
         cdr.confirmUserPermissionID AS confirmUserPermissionID,
-        (select rup.name from receipt_user_permission rup where rup.id = cdr.confirmUserPermissionID) AS
+        (select rup.name from cm_receipt_user rup where rup.id = cdr.confirmUserPermissionID) AS
         confirmUserName,
         cdr.confirmDate AS confirmDate,
         cdr.reviewUserPermissionID AS reviewUserPermissionID,
-        (select rup.name from receipt_user_permission rup where rup.id = cdr.reviewUserPermissionID) AS reviewUserName,
+        (select rup.name from cm_receipt_user rup where rup.id = cdr.reviewUserPermissionID) AS reviewUserName,
         cdr.reviewDate AS reviewDate,
         cdr.cancelUserPermissionID AS cancelUserPermissionID,
         (select su.name from sys_user su where su.id = cdr.cancelUserPermissionID) AS cancelUserName,

+ 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

+ 2 - 2
src/main/resources/mappings/modules/order/CmRefundShopMapper.xml

@@ -26,7 +26,7 @@
 		FROM cm_refund_shop a
 		<include refid="cmRefundShopJoins"/>
 		left join shop s on s.shopID = a.shopID
-		left join receipt_user_permission up on up.id = a.operator
+		left join cm_receipt_user up on up.id = a.operator
 		WHERE a.id = #{id}
 		AND a.delFlag='0'
 	</select>
@@ -42,7 +42,7 @@
 		LEFT JOIN cm_refund_shop_record crsr ON crsr.refundShopID = a.id
 		left join shop s on s.shopID = a.shopID
 		left join sys_user u on u.id = a.operator
-		left join receipt_user_permission up on up.id = a.operator
+		left join cm_receipt_user up on up.id = a.operator
 		<where>
 			<if test="organizeID != null and organizeID != 9999 and organizeID != 0 ">
 				AND a.id IN (

+ 0 - 1
src/main/resources/mappings/modules/order/OrderMapper.xml

@@ -67,7 +67,6 @@
 		a.affirmPaymentFlag AS affirmPaymentFlag,
 		a.rebateFlag AS rebateFlag,
 		a.zeroCostFlag AS zeroCostFlag,
-		a.organizeStoreId as organizeStoreId,
 		a.couponAmount as couponAmount,
         a.svipFullReduction as svipFullReduction,
         (a.discountFee + a.promotionFullReduction + a.couponAmount) as discountAmount,

+ 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 - 115
src/main/resources/mappings/modules/permission/ReceiptUserPermissionMapper.xml

@@ -1,115 +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.permission.dao.ReceiptUserPermissionDao">
-    
-	<sql id="receiptUserPermissionColumns">
-		a.id AS "id",
-		a.userType AS "userType",
-		a.userIdentity AS "userIdentity",
-		a.name AS "name",
-		a.mobile AS "mobile",
-		a.openid AS "openid",
-		a.delFlag AS "delFlag"
-	</sql>
-	
-	<sql id="receiptUserPermissionJoins">
-	</sql>
-    
-	<select id="get" resultType="ReceiptUserPermission">
-		SELECT 
-			<include refid="receiptUserPermissionColumns"/>
-		FROM receipt_user_permission a
-		<include refid="receiptUserPermissionJoins"/>
-		WHERE a.id = #{id}
-	</select>
-
-	<select id="findDupBean" resultType="ReceiptUserPermission">
-		SELECT
-		<include refid="receiptUserPermissionColumns"/>
-		FROM receipt_user_permission a
-		where a.openid = #{openid} and a.userType = #{userType}
-	</select>
-	
-	<select id="findList" resultType="ReceiptUserPermission">
-		SELECT 
-			<include refid="receiptUserPermissionColumns"/>
-		FROM receipt_user_permission a
-		<include refid="receiptUserPermissionJoins"/>
-		<where>
-			<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="userType != null and userType != ''">
-				AND a.userType = #{userType}
-			</if>
-			<if test="mobile != null and mobile != ''">
-				AND a.mobile = #{mobile}
-			</if>
-			<if test="openid != null and openid != ''">
-				AND a.openid = #{openid}
-			</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="ReceiptUserPermission">
-		SELECT 
-			<include refid="receiptUserPermissionColumns"/>
-		FROM receipt_user_permission a
-		<include refid="receiptUserPermissionJoins"/>
-		<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="ReceiptUserPermission"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO receipt_user_permission(
-			userType,
-			userIdentity,
-			name,
-			mobile,
-			openid,
-			delFlag
-		) VALUES (
-			#{userType},
-			#{userIdentity},
-			#{name},
-			#{mobile},
-			#{openid},
-			#{delFlag}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE receipt_user_permission SET 	
-			userType = #{userType},
-			userIdentity = #{userIdentity},
-			name = #{name},
-			mobile = #{mobile},
-			openid = #{openid},
-			delFlag = #{delFlag}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM receipt_user_permission
-		WHERE id = #{id}
-	</delete>
-	
-</mapper>

+ 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>

+ 4 - 39
src/main/resources/mappings/modules/product/CmSecondHandRecommendMapper.xml

@@ -10,60 +10,27 @@
 		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 id="findByRecommendProductID" resultType="com.caimei.modules.product.entity.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 id="findRecommendList" resultType="com.caimei.modules.product.entity.CmSecondHandRecommend">
 		SELECT
 		<include refid="cmSecondHandRecommendColumns"/>
 			FROM cm_second_hand_recommend a
-		<include refid="cmSecondHandRecommendJoins"/>
 		WHERE a.secondHandProductID = #{id}
 		order by a.sort asc
 	</select>
@@ -72,7 +39,6 @@
 		SELECT 
 			<include refid="cmSecondHandRecommendColumns"/>
 		FROM cm_second_hand_recommend a
-		<include refid="cmSecondHandRecommendJoins"/>
 		<where>
 			
 		</where>
@@ -89,7 +55,6 @@
 		SELECT 
 			<include refid="cmSecondHandRecommendColumns"/>
 		FROM cm_second_hand_recommend a
-		<include refid="cmSecondHandRecommendJoins"/>
 		<where>
 			
 		</where>		
@@ -101,7 +66,7 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<insert id="insert" parameterType="CmSecondHandRecommend"  keyProperty="id" useGeneratedKeys="true">
 		INSERT INTO cm_second_hand_recommend(
 			secondHandProductID,
@@ -153,5 +118,5 @@
 		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"/>

+ 0 - 207
src/main/resources/mappings/modules/user/CmGclubMapper.xml.bak

@@ -1,207 +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.user.dao.CmGclubDao">
-
-	<sql id="cmGclubColumns">
-		a.gclubID AS "gclubID",
-		a.name AS "name",
-		a.contacts AS "contacts",
-		a.cellphone AS "cellphone",
-		a.telphone AS "telphone",
-		a.post AS "post",
-		a.address AS "address",
-		a.scale AS "scale",
-		a.empnum AS "empnum",
-		a.mainpro AS "mainpro",
-		a.remark AS "remark",
-		a.image AS "image",
-		a.regStatus AS "regStatus",
-		a.addTime AS "addTime",
-		a.loginTime AS "loginTime",
-		a.provinceID AS "provinceID",
-		a.cityID AS "cityID",
-		a.townID AS "townID",
-		a.agreement AS "agreement",
-		a.flag AS "flag",
-		a.userID AS "userID",
-		a.clubstatus AS "clubstatus",
-		a.BUSINESSLICENSEIMAGE AS "BUSINESSLICENSEIMAGE",
-		a.LASTMODIFY AS "LASTMODIFY",
-		a.inviterBindID AS "inviterBindID",
-		a.inviterName AS "inviterName",
-		a.headpic AS "headpic",
-		a.mainServiceProviderID AS "mainServiceProviderID",
-		a.scanTime AS "scanTime",
-		a.checkTime AS "checkTime",
-		a.spID AS "spID"
-	</sql>
-
-	<sql id="cmGclubJoins">
-	</sql>
-
-	<select id="get" resultType="CmGclub">
-		SELECT
-		<include refid="cmGclubColumns"/>
-		FROM gclub a
-		<include refid="cmGclubJoins"/>
-		WHERE a.gclubID = #{id}
-	</select>
-
-	<select id="findList" resultType="CmGclub">
-		SELECT
-		<include refid="cmGclubColumns"/>
-		FROM gclub a
-		<include refid="cmGclubJoins"/>
-		<where>
-			<if test="gclubID != null and gclubID != ''">
-				AND a.gclubID = #{id}
-			</if>
-			<if test="userID != null and userID != ''">
-				AND a.userID = #{userID}
-			</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="CmGclub">
-		SELECT
-		<include refid="cmGclubColumns"/>
-		FROM gclub a
-		<include refid="cmGclubJoins"/>
-		<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="CmGclub"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO gclub(
-		name,
-		contacts,
-		cellphone,
-		telphone,
-		post,
-		address,
-		scale,
-		empnum,
-		mainpro,
-		remark,
-		image,
-		regStatus,
-		addTime,
-		loginTime,
-		provinceID,
-		cityID,
-		townID,
-		agreement,
-		flag,
-		userID,
-		clubstatus,
-		BUSINESSLICENSEIMAGE,
-		LASTMODIFY,
-		inviterBindID,
-		inviterName,
-		headpic,
-		mainServiceProviderID,
-		scanTime,
-		checkTime,
-		spID
-		) VALUES (
-		#{name},
-		#{contacts},
-		#{cellphone},
-		#{telphone},
-		#{post},
-		#{address},
-		#{scale},
-		#{empnum},
-		#{mainpro},
-		#{remark},
-		#{image},
-		#{regStatus},
-		#{addTime},
-		#{loginTime},
-		#{provinceID},
-		#{cityID},
-		#{townID},
-		#{agreement},
-		#{flag},
-		#{userID},
-		#{clubstatus},
-		#{BUSINESSLICENSEIMAGE},
-		#{LASTMODIFY},
-		#{inviterBindID},
-		#{inviterName},
-		#{headpic},
-		#{mainServiceProviderID},
-		#{scanTime},
-		#{checkTime},
-		#{spID}
-		)
-	</insert>
-
-	<update id="update">
-		UPDATE gclub SET
-		name = #{name},
-		contacts = #{contacts},
-		cellphone = #{cellphone},
-		telphone = #{telphone},
-		post = #{post},
-		address = #{address},
-		scale = #{scale},
-		empnum = #{empnum},
-		mainpro = #{mainpro},
-		remark = #{remark},
-		image = #{image},
-		regStatus = #{regStatus},
-		addTime = #{addTime},
-		loginTime = #{loginTime},
-		provinceID = #{provinceID},
-		cityID = #{cityID},
-		townID = #{townID},
-		agreement = #{agreement},
-		flag = #{flag},
-		userID = #{userID},
-		clubstatus = #{clubstatus},
-		BUSINESSLICENSEIMAGE = #{BUSINESSLICENSEIMAGE},
-		LASTMODIFY = #{LASTMODIFY},
-		inviterBindID = #{inviterBindID},
-		inviterName = #{inviterName},
-		headpic = #{headpic},
-		mainServiceProviderID = #{mainServiceProviderID},
-		scanTime = #{scanTime},
-		checkTime = #{checkTime},
-		spID = #{spID}
-		WHERE gclubID = #{id}
-	</update>
-
-	<delete id="delete">
-		DELETE FROM gclub
-		WHERE gclubID = #{id}
-	</delete>
-
-	<update id="updateByUserId">
-		UPDATE gclub SET
-		regStatus = #{regStatus},
-		flag = #{flag},
-		LASTMODIFY = #{LASTMODIFY},
-		inviterBindID = #{inviterBindID},
-		inviterName = #{inviterName},
-		mainServiceProviderID = #{mainServiceProviderID},
-		spID = #{spID}
-		WHERE userID = #{userID}
-	</update>
-
-</mapper>

+ 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

+ 110 - 117
src/main/resources/mappings/modules/weisha/CmMallOrganizeMapper.xml

@@ -2,8 +2,8 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.modules.weisha.dao.CmMallOrganizeDao">
 
-	<sql id="cmMallOrganizeColumns">
-		a.id AS "id",
+    <sql id="cmMallOrganizeColumns">
+        a.id AS "id",
 		a.organizeName AS "organizeName",
 		a.organizeLinkName AS "organizeLinkName",
 		a.mobile AS "mobile",
@@ -17,129 +17,122 @@
 		a.updateTime AS "updateTime",
 		a.addTime AS "addTime",
 		a.delFlag AS "delFlag"
-	</sql>
+    </sql>
 
-	<sql id="cmMallOrganizeJoins">
-	</sql>
 
-	<select id="get" resultType="CmMallOrganize">
-		SELECT
-			<include refid="cmMallOrganizeColumns"/>
-		FROM cm_mall_organize a
-		<include refid="cmMallOrganizeJoins"/>
-		WHERE a.id = #{id}
-	</select>
+    <select id="get" resultType="CmMallOrganize">
+        SELECT
+        <include refid="cmMallOrganizeColumns"/>
+        FROM cm_mall_organize a
+        WHERE a.id = #{id}
+    </select>
 
-	<select id="findList" resultType="CmMallOrganize">
-		SELECT
-			<include refid="cmMallOrganizeColumns"/>
-		FROM cm_mall_organize a
-		<include refid="cmMallOrganizeJoins"/>
-		<where>
-			id > 3
-			<if test="organizeName != null and organizeName != ''">
-				AND a.organizeName LIKE concat('%',#{organizeName},'%')
-			</if>
-			<if test="organizeLinkName != null and organizeLinkName != ''">
-				AND a.organizeLinkName = #{organizeLinkName}
-			</if>
-			<if test="mobile != null and mobile != ''">
-				AND a.mobile = #{mobile}
-			</if>
-			<if test="status != null and status != ''">
-				AND a.status = #{status}
-			</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>
+    <select id="findList" resultType="CmMallOrganize">
+        SELECT
+        <include refid="cmMallOrganizeColumns"/>
+        FROM cm_mall_organize a
+        <where>
+            id > 3
+            <if test="organizeName != null and organizeName != ''">
+                AND a.organizeName LIKE concat('%',#{organizeName},'%')
+            </if>
+            <if test="organizeLinkName != null and organizeLinkName != ''">
+                AND a.organizeLinkName = #{organizeLinkName}
+            </if>
+            <if test="mobile != null and mobile != ''">
+                AND a.mobile = #{mobile}
+            </if>
+            <if test="status != null and status != ''">
+                AND a.status = #{status}
+            </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>
 
-	<select id="findAllList" resultType="CmMallOrganize">
-		SELECT
-			<include refid="cmMallOrganizeColumns"/>
-		FROM cm_mall_organize a
-		<include refid="cmMallOrganizeJoins"/>
-		<where>
+    <select id="findAllList" resultType="CmMallOrganize">
+        SELECT
+        <include refid="cmMallOrganizeColumns"/>
+        FROM cm_mall_organize a
+        <where>
 
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
+        </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="CmMallOrganize"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cm_mall_organize(
-			organizeName,
-			organizeLinkName,
-			mobile,
-			status,
-			contactNumber,
-			systemName,
-			systemImage,
-			introduction,
-			afterSale,
-			shoppingNotes,
-			updateTime,
-			addTime,
-			delFlag
-		) VALUES (
-			#{organizeName},
-			#{organizeLinkName},
-			#{mobile},
-			#{status},
-			#{contactNumber},
-			#{systemName},
-			#{systemImage},
-			#{introduction},
-			#{afterSale},
-			#{shoppingNotes},
-			NOW(),
-			NOW(),
-			0
-		)
-	</insert>
+    <insert id="insert" parameterType="CmMallOrganize" keyProperty="id" useGeneratedKeys="true">
+        INSERT INTO cm_mall_organize
+        (organizeName,
+         organizeLinkName,
+         mobile,
+         status,
+         contactNumber,
+         systemName,
+         systemImage,
+         introduction,
+         afterSale,
+         shoppingNotes,
+         updateTime,
+         addTime,
+         delFlag)
+        VALUES (#{organizeName},
+                #{organizeLinkName},
+                #{mobile},
+                #{status},
+                #{contactNumber},
+                #{systemName},
+                #{systemImage},
+                #{introduction},
+                #{afterSale},
+                #{shoppingNotes},
+                NOW(),
+                NOW(),
+                0)
+    </insert>
 
-	<update id="update">
-		UPDATE cm_mall_organize SET
-			organizeName = #{organizeName},
-			organizeLinkName = #{organizeLinkName},
-			mobile = #{mobile},
-			status = #{status},
-			contactNumber = #{contactNumber},
-			systemName = #{systemName},
-			systemImage = #{systemImage},
-			introduction = #{introduction},
-			afterSale = #{afterSale},
-			shoppingNotes = #{shoppingNotes},
-			updateTime = NOW()
-		WHERE id = #{id}
-	</update>
+    <update id="update">
+        UPDATE cm_mall_organize
+        SET organizeName     = #{organizeName},
+            organizeLinkName = #{organizeLinkName},
+            mobile           = #{mobile},
+            status           = #{status},
+            contactNumber    = #{contactNumber},
+            systemName       = #{systemName},
+            systemImage      = #{systemImage},
+            introduction     = #{introduction},
+            afterSale        = #{afterSale},
+            shoppingNotes    = #{shoppingNotes},
+            updateTime       = NOW()
+        WHERE id = #{id}
+    </update>
 
-	<update id="updateByStatus">
-		UPDATE cm_mall_organize SET
-			status = #{status},
-			updateTime = NOW()
-		WHERE id = #{organizeId}
-	</update>
+    <update id="updateByStatus">
+        UPDATE cm_mall_organize
+        SET status     = #{status},
+            updateTime = NOW()
+        WHERE id = #{organizeId}
+    </update>
 
-	<select id="findOrganizeMobileOnly" resultType="com.caimei.modules.weisha.entity.CmMallOrganize">
-		SELECT
-		<include refid="cmMallOrganizeColumns"/>
-		FROM cm_mall_organize a
-		WHERE a.mobile = #{mobile} AND a.delFlag = 0
-		<if test="id != null">
-			AND a.id != #{id}
-		</if>
-	</select>
+    <select id="findOrganizeMobileOnly" resultType="com.caimei.modules.weisha.entity.CmMallOrganize">
+        SELECT
+        <include refid="cmMallOrganizeColumns"/>
+        FROM cm_mall_organize a
+        WHERE a.mobile = #{mobile} AND a.delFlag = 0
+        <if test="id != null">
+            AND a.id != #{id}
+        </if>
+    </select>
 
 </mapper>

+ 23 - 14
src/main/resources/mappings/modules/weisha/CmMallUserMapper.xml

@@ -3,8 +3,11 @@
 <mapper namespace="com.caimei.modules.weisha.dao.CmMallUserDao">
 
     <select id="get" resultType="com.caimei.modules.weisha.entity.CmMallOrganize">
-        select * from cm_mall_organize where id = #{id}
+        select *
+        from cm_mall_organize
+        where id = #{id}
     </select>
+
     <select id="getMallUser" resultType="com.caimei.modules.weisha.entity.CmMallUser">
         SELECT
         id,
@@ -35,35 +38,41 @@
             </if>
         </where>
     </select>
+
     <update id="updateproduct">
         update cm_mall_admin_user
         set status = #{validFlag}
         where id = #{id}
     </update>
+
     <select id="getMallUserById" resultType="com.caimei.modules.weisha.entity.CmMallUser">
-        SELECT
-            id,
-            organizeID,
-            account,
-            accountName,
-            password,
-            salt,
-            addTime,
-            updateTime
+        SELECT id,
+               organizeID,
+               account,
+               accountName,
+               password,
+               salt,
+               addTime,
+               updateTime
         FROM cm_mall_admin_user
         where id = #{id}
     </select>
+
     <select id="getRepeat" resultType="java.lang.Integer">
         select id from cm_mall_admin_user where account =#{account}
         <if test="id != null and id != ''">
-         and  id != #{id}
+            and id != #{id}
         </if>
-                                                limit 1
+        limit 1
     </select>
+
     <insert id="insertMallUser">
-        INSERT INTO cm_mall_admin_user(account, accountName, PASSWORD, salt, organizeID, status, personnelType, ADDTIME, updateTime, delFlag)
-        VALUES(#{account}, #{accountName}, #{password}, #{salt}, #{organizeId}, #{status}, #{personnelType}, #{addTime}, #{updateTime}, #{delFlag})
+        INSERT INTO cm_mall_admin_user(account, accountName, PASSWORD, salt, organizeID, status, personnelType, ADDTIME,
+                                       updateTime, delFlag)
+        VALUES (#{account}, #{accountName}, #{password}, #{salt}, #{organizeId}, #{status}, #{personnelType},
+                #{addTime}, #{updateTime}, #{delFlag})
     </insert>
+
     <update id="updateMallUser">
         update cm_mall_admin_user
         <set>

+ 0 - 139
src/main/resources/mappings/modules/weisha/CmOrganizeBuyerMapper.xml

@@ -1,139 +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.weisha.dao.CmOrganizeBuyerDao">
-    
-	<sql id="cmOrganizeBuyerColumns">
-		a.id AS "id",
-		a.organizeId AS "organizeId",
-		a.name AS "name",
-		a.mobile AS "mobile",
-		a.invitationCode AS "invitationCode",
-		a.status AS "status",
-		a.nickName AS "nickName",
-		a.openid AS "openid",
-		a.addTime AS "addTime",
-		a.invitationCodeTime AS "invitationCodeTime",
-		a.bindTime AS "bindTime",
-		a.updateTime AS "updateTime",
-		a.delFlag AS "delFlag"
-	</sql>
-	
-	<sql id="cmOrganizeBuyerJoins">
-	</sql>
-    
-	<select id="get" resultType="CmOrganizeBuyer">
-		SELECT 
-			<include refid="cmOrganizeBuyerColumns"/>
-		FROM cm_organize_buyer a
-		<include refid="cmOrganizeBuyerJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="CmOrganizeBuyer">
-		SELECT 
-			<include refid="cmOrganizeBuyerColumns"/>
-		FROM cm_organize_buyer a
-		<where>
-			a.delFlag = 0
-			AND a.organizeId = #{organizeId}
-			<if test="name != null and name != ''">
-				AND a.name LIKE 
-					<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
-			</if>
-			<if test="mobile != null and mobile != ''">
-				AND a.mobile = #{mobile}
-			</if>
-			<if test="status != null and status != ''">
-				AND a.status = #{status}
-			</if>
-			<if test="startTime != null">
-				AND a.addTime <![CDATA[ > ]]> #{startTime}
-			</if>
-			<if test="endTime != null">
-				AND a.addTime <![CDATA[ < ]]> #{endTime}
-			</if>
-			<if test="invitationCode != null and invitationCode != ''">
-				AND a.invitationCode = #{invitationCode}
-			</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>
-	
-	<select id="findAllList" resultType="CmOrganizeBuyer">
-		SELECT 
-			<include refid="cmOrganizeBuyerColumns"/>
-		FROM cm_organize_buyer a
-		<include refid="cmOrganizeBuyerJoins"/>
-		<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="CmOrganizeBuyer"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cm_organize_buyer(
-			organizeId,
-			name,
-			mobile,
-			invitationCode,
-			status,
-			nickName,
-			openid,
-			addTime,
-			invitationCodeTime,
-			bindTime,
-			updateTime,
-			delFlag
-		) VALUES (
-			#{organizeId},
-			#{name},
-			#{mobile},
-			#{invitationCode},
-			#{status},
-			#{nickName},
-			#{openid},
-			#{addTime},
-			#{invitationCodeTime},
-			#{bindTime},
-			#{updateTime},
-			#{delFlag}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cm_organize_buyer SET
-			name = #{name},
-			mobile = #{mobile},
-			invitationCode = #{invitationCode},
-			status = #{status},
-			nickName = #{nickName},
-			openid = #{openid},
-			invitationCodeTime = #{invitationCodeTime},
-			bindTime = #{bindTime},
-			updateTime = #{updateTime},
-			delFlag = #{delFlag}
-		WHERE id = #{id}
-	</update>
-
-	<select id="findByMobile" resultType="com.caimei.modules.weisha.entity.CmOrganizeBuyer">
-		SELECT
-			<include refid="cmOrganizeBuyerColumns"/>
-		FROM cm_organize_buyer a
-		WHERE a.mobile = #{mobile} AND delFlag = 0
-	</select>
-	
-</mapper>

+ 247 - 361
src/main/resources/mappings/modules/weisha/CmOrganizeProductMapper.xml

@@ -2,8 +2,8 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.modules.weisha.dao.CmOrganizeProductDao">
 
-	<sql id="cmOrganizeProductColumns">
-		a.id AS "id",
+    <sql id="cmOrganizeProductColumns">
+        a.id AS "id",
 		a.organizeId AS "organizeId",
 		a.productId AS "productId",
 		a.ladderPriceFlag AS "ladderPriceFlag",
@@ -21,375 +21,261 @@
 		a.delFlag AS "delFlag",
 		p.name AS "productName",
 		p.mainImage AS "productImage",
-# 		p.unit,
 		s.name AS "shopName"
-	</sql>
+    </sql>
 
-	<sql id="cmOrganizeProductJoins">
-		left join product p on a.productId = p.productID
+    <sql id="cmOrganizeProductJoins">
+        left join product p on a.productId = p.productID
 		left join shop s on p.shopID = s.shopID
-	</sql>
+    </sql>
 
-	<select id="get" resultType="CmOrganizeProduct">
-		SELECT
-			<include refid="cmOrganizeProductColumns"/>
-		FROM cm_organize_product a
-		<include refid="cmOrganizeProductJoins"/>
-		WHERE a.id = #{id}
-	</select>
+    <select id="getOrganizeProductList" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
+        SELECT
+        cmop.id,
+        cmop.productID,
+        p.name as productName,
+        p.mainImage as productImage,
+        s.name as shopName,
+        cmop.validFlag as status,
+        p.includedTax,
+        p.invoiceType,
+        cmop.addTime,
+        cmps.minBuyNumber
+        FROM cm_mall_organize_products cmop
+        LEFT JOIN product p ON p.productId = cmop.productId
+        LEFT JOIN shop s ON s.shopID = p.shopID
+        LEFT JOIN cm_mall_product_sku cmps ON cmop.productID=cmps.productId
+        <where>
+            cmop.delFlag = 0
+            <if test="productId != null and productId != ''">
+                AND cmop.productId = #{productId}
+            </if>
+            <if test="productName != null and productName != ''">
+                and p.name like concat('%',#{productName},'%')
+            </if>
+            <if test="shopName != null and shopName != ''">
+                and s.name like concat('%',#{shopName},'%')
+            </if>
+            <if test="includedTax != null">
+                AND p.includedTax = #{includedTax}
+            </if>
+            <if test="status != null and status != ''">
+                AND cmop.validFlag = #{status}
+            </if>
+            <if test="invoiceType != null">
+                AND p.invoiceType = #{invoiceType}
+            </if>
+            <if test="organizeId != null">
+                AND cmop.organizeID = #{organizeId}
+            </if>
+        </where>
+        GROUP BY cmop.id
+        order by cmop.addTime desc
+    </select>
 
-	<select id="findList" resultType="CmOrganizeProduct">
-		SELECT
-			<include refid="cmOrganizeProductColumns"/>
-		FROM cm_organize_product a
-		<include refid="cmOrganizeProductJoins"/>
-		<where>
-			a.delFlag = 0
-			and p.productCategory = 1
-			<if test="id != null and id != ''">
-				AND a.id = #{id}
-			</if>
-			<if test="productName != null and productName != ''">
-				and p.name like concat('%',#{productName},'%')
-			</if>
-			<if test="shopName != null and shopName != ''">
-				and s.name like concat('%',#{shopName},'%')
-			</if>
-			<if test="includedTax != null">
-				AND a.includedTax = #{includedTax}
-			</if>
-			<if test="invoiceType != null">
-				AND a.invoiceType = #{invoiceType}
-			</if>
-			<if test="status != null">
-				AND a.status = #{status}
-			</if>
-			<if test="organizeId != null">
-				AND a.organizeId = #{organizeId}
-			</if>
-		</where>
-		order by a.addTime desc
-	</select>
+    <select id="getOrganizeSku" resultType="com.caimei.modules.weisha.entity.CmOrganizeSku">
+        SELECT
+        cmps.id,
+        cmps.productId,
+        cmps.id,
+        cmps.skuId,
+        cmps.minBuyNumber,
+        cmps.price,
+        cs.unit,
+        cs.price as clubPrice,
+        cs.costCheckFlag as costCheckFlag,
+        cs.costPrice as costPrice,
+        cs.costProportional as costProportional,
+        cs.minBuyNumber AS cmMinBuyNumber,
+        cmps.organizePercent,
+        cmps.shopPercent,
+        cmps.cmPercent
+        FROM cm_mall_product_sku cmps
+        LEFT JOIN cm_sku cs ON cmps.skuId = cs.skuId
+        <where>
+            <if test="productIds.size() > 0">
+                cmps.productId in
+                <foreach collection="productIds" item="productId" open="(" separator="," close=")">
+                    #{productId}
+                </foreach>
+            </if>
+        </where>
+    </select>
 
-	<select id="findAllList" resultType="CmOrganizeProduct">
-		SELECT
-			<include refid="cmOrganizeProductColumns"/>
-		FROM cm_organize_product a
-		<include refid="cmOrganizeProductJoins"/>
-		<where>
+    <update id="updateproduct">
+        update cm_mall_organize_products
+        set validFlag = #{validFlag}
+        where id = #{id}
+    </update>
 
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	<select id="getOrganizeProductList" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
-		SELECT
-			cmop.id,
-			cmop.productID,
-			p.name as productName,
-			p.mainImage as productImage,
-			s.name as shopName,
-			cmop.validFlag as status,
-			p.includedTax,
-			p.invoiceType,
-			cmop.addTime,
-		    cmps.minBuyNumber
-		FROM cm_mall_organize_products cmop
-				 LEFT JOIN product p ON p.productId = cmop.productId
-				 LEFT JOIN shop s ON s.shopID = p.shopID
-				 LEFT JOIN cm_mall_product_sku cmps ON  cmop.productID=cmps.productId
-		<where>
-			cmop.delFlag = 0
-			<if test="productId != null and productId != ''">
-				AND cmop.productId = #{productId}
-			</if>
-			<if test="productName != null and productName != ''">
-				and p.name like concat('%',#{productName},'%')
-			</if>
-			<if test="shopName != null and shopName != ''">
-				and s.name like concat('%',#{shopName},'%')
-			</if>
-			<if test="includedTax != null">
-				AND p.includedTax = #{includedTax}
-			</if>
-			<if test="status != null and status != ''">
-				AND cmop.validFlag = #{status}
-			</if>
-			<if test="invoiceType != null">
-				AND p.invoiceType = #{invoiceType}
-			</if>
-			<if test="organizeId != null">
-				AND cmop.organizeID = #{organizeId}
-			</if>
-		</where>
-		GROUP BY cmop.id
-		order by cmop.addTime desc
-	</select>
-	<select id="getOrganizeSku" resultType="com.caimei.modules.weisha.entity.CmOrganizeSku">
-		SELECT
-		    cmps.id,
-			cmps.productId,
-			cmps.id,
-			cmps.skuId,
-			cmps.minBuyNumber,
-			cmps.price,
-			cs.unit,
-			cs.price as clubPrice,
-			cs.costCheckFlag as costCheckFlag,
-			cs.costPrice as costPrice,
-			cs.costProportional as costProportional,
-			cs.minBuyNumber AS cmMinBuyNumber,
-		   cmps.organizePercent,
-		   cmps.shopPercent,
-		   cmps.cmPercent
-		FROM cm_mall_product_sku cmps
-				 LEFT JOIN cm_sku cs ON cmps.skuId = cs.skuId
-		<where>
-			<if test="productIds.size() > 0">
-				cmps.productId in
-				<foreach collection="productIds" item="productId" open="(" separator="," close=")">
-					#{productId}
-				</foreach>
-			</if>
-		</where>
-	</select>
-	<update id="updateproduct">
-		update cm_mall_organize_products
-		set validFlag = #{validFlag}
-		where id = #{id}
-	</update>
-	<select id="findProductList" resultType="com.caimei.modules.product.entity.Product">
-		select p.productID, p.mainImage, p.name,
-		       s.name as shopName, IF(cmop.productId is not null, 0, 1) as validFlag,k.price
-		from product p
-			 left join cm_mall_organize_products cmop on p.productID = cmop.productId and cmop.organizeId = #{organizeId} and cmop.delFlag = 0
-			 left join shop s on p.shopID = s.shopID
-		 	 left join cm_sku k on p.productID = k.productId
-		<where>
-			p.productCategory = 1  AND p.validFlag not in ( 0,1,8 )  and s.shopType != 2  and  cmop.productId is null
-			AND p.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
-			AND p.productID NOT IN (6060, 6061, 6062, 6063, 6064,6065, 6066, 6067, 6068, 6069)
-			<if test="productID != null">
-				AND p.productID = #{productID}
-			</if>
-			<if test="name != null and name != ''">
-				AND p.name LIKE concat('%',#{name},'%')
-			</if>
-			<if test="shopName != null and shopName != ''">
-				AND s.name LIKE concat('%',#{shopName},'%')
-			</if>
-		</where>
-		GROUP BY p.productID
-		order by price asc
-	</select>
-	<select id="findProductByProductId" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
-		select productID as productId, # ladderPriceFlag, price as price,
-		 	   ifnull(includedTax,2) as includedTax,invoiceType,taxPoint as clubTaxPoint,supplierTaxPoint as shopTaxPoint # minBuyNumber,
-		       # costCheckFlag as costType,
-		       # costPrice,costProportional
-		from product
-		where productID = #{productId}
-	</select>
-	<select id="findLadderPrice" resultType="com.caimei.modules.weisha.entity.OrganizeProductLadderPrice">
-		select * from organize_product_ladder_price where productId = #{productId}
-	</select>
-	<select id="findFormerLadderPriceList"
-			resultType="com.caimei.modules.weisha.entity.OrganizeProductLadderPrice">
-		select ladderNum,buyNum,buyPrice from product_ladder_price where productId = #{productId}
-	</select>
-	<select id="getOrganizeInfo" resultType="com.caimei.modules.weisha.entity.CmMallOrganize">
-		select a.id AS "id",
-			   a.organizeName AS "organizeName",
-			   a.organizeLinkName AS "organizeLinkName",
-			   a.mobile AS "mobile",
-			   a.status AS "status",
-			   a.contactNumber AS "contactNumber",
-			   a.systemName AS "systemName",
-			   a.systemImage AS "systemImage",
-			   a.introduction AS "introduction",
-			   a.afterSale AS "afterSale",
-			   a.shoppingNotes AS "shoppingNotes",
-			   a.updateTime AS "updateTime",
-			   a.addTime AS "addTime",
-			   a.delFlag AS "delFlag"
-			   from cm_mall_organize a
-			where a.id = #{id}
-	</select>
-	<select id="getShopInfo" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
-		SELECT
-			p.productId,
-			p.name AS productName,
-			s.name AS shopName
-		FROM product p
-		LEFT JOIN shop s ON p.shopId = s.shopId
-		<where>
-			<if test="productIds.size()>0">
-				productId in
-				<foreach collection="productIds" item="productId" open="(" separator="," close=")">
-					#{productId}
-				</foreach>
-			</if>
-		</where>
-	</select>
-	<select id="getSkuInfo" resultType="com.caimei.modules.product.entity.CmSku">
-		SELECT
-			skuId,
-			productId,
-			normalPrice,
-			price,
-			costPrice,
-			ladderPriceFlag,
-			minBuyNumber
-		FROM cm_sku
-		where productId = #{productId}
-		order by normalPrice
-	</select>
-	<insert id="insertMallProduct" parameterType="CmOrganizeProduct"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO  cm_mall_organize_products (organizeID, productID, normalPrice, costPrice, ladderPriceFlag, retailPrice, minBuyNumber, validFlag, ADDTIME, updateTime, delFlag)
-		VALUES(#{organizeId}, #{productId}, #{normalPrice}, #{costPrice}, #{ladderPriceFlag}, #{retailPrice}, #{minBuyNumber}, #{status},#{addTime}, #{updateTime}, #{delFlag})
-	</insert>
-	<insert id="insertMallSku">
-		INSERT INTO cm_mall_product_sku(skuId, productId, mallProductId, minBuyNumber, price)
-		VALUES (#{skuId}, #{productId}, #{mallProductId}, #{minBuyNumber}, #{price})
-	</insert>
-	<update id="updateMallProduct">
-		update cm_mall_organize_products
-		<set>
-			<if test="retailPrice != null and retailPrice != ''">
-				retailPrice = #{retailPrice},
-			</if>
-			<if test="minBuyNumber != null and minBuyNumber != ''">
-				minBuyNumber = #{minBuyNumber}
-			</if>
-		</set>
-		where id =#{id}
-	</update>
-	<update id="updateMallProductSku">
-		update cm_mall_product_sku
-		<set>
-			<if test="price != null and price != ''">
-				price = #{price},
-			</if>
-			<if test="minBuyNumber != null and minBuyNumber != ''">
-				minBuyNumber = #{minBuyNumber},
-			</if>
-			<if test="organizePercent != null and organizePercent != ''">
-				organizePercent = #{organizePercent},
-			</if>
-			<if test="shopPercent != null and shopPercent != ''">
-				shopPercent = #{shopPercent},
-			</if>
-			<if test="cmPercent != null and cmPercent != ''">
-				cmPercent = #{cmPercent}
-			</if>
-		</set>
-		where id =#{id}
-	</update>
-	<select id="getProductInfo" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
-		SELECT cmop.id,
-		       cmop.organizeID AS organizeId,
-			   p.productID AS productId,
-			   p.mainImage AS productImage,
-			   p.name AS productName,
-			   s.name AS shopName,
-			   IF(cmop.productId IS NOT NULL, 0, 1) AS validFlag,
-			   p.includedTax,
-			   p.invoiceType,
-			   p.taxPoint,
-			   p.supplierTaxPoint
-		FROM product p
-				 LEFT JOIN cm_mall_organize_products cmop ON p.productID = cmop.productId
-				 LEFT JOIN shop s ON p.shopID = s.shopID
-		WHERE p.productCategory = 1  AND cmop.id = #{id}
-	</select>
-	<update id="deleteProduct">
-		update cm_mall_organize_products
-		set delFlag = 1
-		where id = #{id}
-	</update>
-	<insert id="insert" parameterType="CmOrganizeProduct"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cm_organize_product(
-			organizeId,
-			productId,
-			ladderPriceFlag,
-			price,
-			includedTax,
-			invoiceType,
-			clubTaxPoint,
-			shopTaxPoint,
-			minBuyNumber,
-			costType,
-			costPrice,
-			costProportional,
-			addTime
-		) VALUES (
-			#{organizeId},
-			#{productId},
-			#{ladderPriceFlag},
-			#{price},
-			#{includedTax},
-			#{invoiceType},
-		    #{clubTaxPoint},
-		    #{shopTaxPoint},
-			#{minBuyNumber},
-			#{costType},
-			#{costPrice},
-			#{costProportional},
-			#{addTime}
-		)
-	</insert>
-	<insert id="insertLadderPrice">
-		insert into organize_product_ladder_price(
-		    productId, ladderNum, buyNum, buyPrice
-		) values (#{productId},#{ladderNum},#{buyNum},#{buyPrice})
+    <select id="findProductList" resultType="com.caimei.modules.product.entity.Product">
+        select p.productID, p.mainImage, p.name,
+        s.name as shopName, IF(cmop.productId is not null, 0, 1) as validFlag,k.price
+        from product p
+        left join cm_mall_organize_products cmop on p.productID = cmop.productId and cmop.organizeId = #{organizeId} and cmop.delFlag = 0
+        left join shop s on p.shopID = s.shopID
+        left join cm_sku k on p.productID = k.productId
+        <where>
+            p.productCategory = 1 AND p.validFlag not in ( 0,1,8 ) and s.shopType != 2 and cmop.productId is null
+            AND p.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
+            AND p.productID NOT IN (6060, 6061, 6062, 6063, 6064,6065, 6066, 6067, 6068, 6069)
+            <if test="productID != null">
+                AND p.productID = #{productID}
+            </if>
+            <if test="name != null and name != ''">
+                AND p.name LIKE concat('%',#{name},'%')
+            </if>
+            <if test="shopName != null and shopName != ''">
+                AND s.name LIKE concat('%',#{shopName},'%')
+            </if>
+        </where>
+        GROUP BY p.productID
+        order by price asc
+    </select>
 
-	</insert>
+    <select id="findProductByProductId" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
+        select productID              as productId,
+               ifnull(includedTax, 2) as includedTax,
+               invoiceType,
+               taxPoint               as clubTaxPoint,
+               supplierTaxPoint       as shopTaxPoint
+        from product
+        where productID = #{productId}
+    </select>
 
-	<update id="update">
-		UPDATE cm_organize_product SET
-			ladderPriceFlag = #{ladderPriceFlag},
-			price = #{price},
-			includedTax = #{includedTax},
-			invoiceType = #{invoiceType},
-		    clubTaxPoint = #{clubTaxPoint},
-		    shopTaxPoint = #{shopTaxPoint},
-			minBuyNumber = #{minBuyNumber},
-			costType = #{costType},
-			costPrice = #{costPrice},
-			costProportional = #{costProportional},
-			status = #{status},
-			addTime = #{addTime},
-			delFlag = #{delFlag}
-		WHERE id = #{id}
-	</update>
+    <select id="findFormerLadderPriceList"
+            resultType="com.caimei.modules.weisha.entity.OrganizeProductLadderPrice">
+        select ladderNum, buyNum, buyPrice
+        from product_ladder_price
+        where productId = #{productId}
+    </select>
 
-	<update id="updateStatus">
-		UPDATE cm_organize_product SET
-			status = #{status}
-		WHERE id = #{id}
-	</update>
-	<update id="updateLadderPrice">
-		update organize_product_ladder_price
-		set productId = #{productId},ladderNum = #{ladderNum},buyNum=#{buyNum},buyPrice=#{buyPrice}
-		where id = #{id}
-	</update>
-	<update id="updateLadderPriceFlag">
-		update cm_organize_product set ladderPriceFlag = #{ladderPriceFlag} where id = #{productId}
-	</update>
+    <select id="getOrganizeInfo" resultType="com.caimei.modules.weisha.entity.CmMallOrganize">
+        select a.id               AS "id",
+               a.organizeName     AS "organizeName",
+               a.organizeLinkName AS "organizeLinkName",
+               a.mobile           AS "mobile",
+               a.status           AS "status",
+               a.contactNumber    AS "contactNumber",
+               a.systemName       AS "systemName",
+               a.systemImage      AS "systemImage",
+               a.introduction     AS "introduction",
+               a.afterSale        AS "afterSale",
+               a.shoppingNotes    AS "shoppingNotes",
+               a.updateTime       AS "updateTime",
+               a.addTime          AS "addTime",
+               a.delFlag          AS "delFlag"
+        from cm_mall_organize a
+        where a.id = #{id}
+    </select>
+
+    <select id="getShopInfo" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
+        SELECT
+        p.productId,
+        p.name AS productName,
+        s.name AS shopName
+        FROM product p
+        LEFT JOIN shop s ON p.shopId = s.shopId
+        <where>
+            <if test="productIds.size()>0">
+                productId in
+                <foreach collection="productIds" item="productId" open="(" separator="," close=")">
+                    #{productId}
+                </foreach>
+            </if>
+        </where>
+    </select>
+
+    <select id="getSkuInfo" resultType="com.caimei.modules.product.entity.CmSku">
+        SELECT skuId,
+               productId,
+               normalPrice,
+               price,
+               costPrice,
+               ladderPriceFlag,
+               minBuyNumber
+        FROM cm_sku
+        where productId = #{productId}
+        order by normalPrice
+    </select>
+
+    <insert id="insertMallProduct" parameterType="CmOrganizeProduct" keyProperty="id" useGeneratedKeys="true">
+        INSERT INTO cm_mall_organize_products (organizeID, productID, normalPrice, costPrice, ladderPriceFlag,
+                                               retailPrice, minBuyNumber, validFlag, ADDTIME, updateTime, delFlag)
+        VALUES (#{organizeId}, #{productId}, #{normalPrice}, #{costPrice}, #{ladderPriceFlag}, #{retailPrice},
+                #{minBuyNumber}, #{status}, #{addTime}, #{updateTime}, #{delFlag})
+    </insert>
+
+    <insert id="insertMallSku">
+        INSERT INTO cm_mall_product_sku(skuId, productId, mallProductId, minBuyNumber, price)
+        VALUES (#{skuId}, #{productId}, #{mallProductId}, #{minBuyNumber}, #{price})
+    </insert>
+
+    <update id="updateMallProduct">
+        update cm_mall_organize_products
+        <set>
+            <if test="retailPrice != null and retailPrice != ''">
+                retailPrice = #{retailPrice},
+            </if>
+            <if test="minBuyNumber != null and minBuyNumber != ''">
+                minBuyNumber = #{minBuyNumber}
+            </if>
+        </set>
+        where id =#{id}
+    </update>
+
+    <update id="updateMallProductSku">
+        update cm_mall_product_sku
+        <set>
+            <if test="price != null and price != ''">
+                price = #{price},
+            </if>
+            <if test="minBuyNumber != null and minBuyNumber != ''">
+                minBuyNumber = #{minBuyNumber},
+            </if>
+            <if test="organizePercent != null and organizePercent != ''">
+                organizePercent = #{organizePercent},
+            </if>
+            <if test="shopPercent != null and shopPercent != ''">
+                shopPercent = #{shopPercent},
+            </if>
+            <if test="cmPercent != null and cmPercent != ''">
+                cmPercent = #{cmPercent}
+            </if>
+        </set>
+        where id =#{id}
+    </update>
+
+    <select id="getProductInfo" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
+        SELECT cmop.id,
+               cmop.organizeID                      AS organizeId,
+               p.productID                          AS productId,
+               p.mainImage                          AS productImage,
+               p.name                               AS productName,
+               s.name                               AS shopName,
+               IF(cmop.productId IS NOT NULL, 0, 1) AS validFlag,
+               p.includedTax,
+               p.invoiceType,
+               p.taxPoint,
+               p.supplierTaxPoint
+        FROM product p
+                 LEFT JOIN cm_mall_organize_products cmop ON p.productID = cmop.productId
+                 LEFT JOIN shop s ON p.shopID = s.shopID
+        WHERE p.productCategory = 1
+          AND cmop.id = #{id}
+    </select>
+
+    <update id="deleteProduct">
+        update cm_mall_organize_products
+        set delFlag = 1
+        where id = #{id}
+    </update>
+
+    <delete id="deleteMallProductSku">
+        delete
+        from cm_mall_product_sku
+        where mallProductId = #{id}
+    </delete>
 
-	<delete id="delete">
-		UPDATE cm_organize_product set delFlag = 1 where id = #{id}
-	</delete>
-	<delete id="deleteMallProductSku">
-		delete from  cm_mall_product_sku where mallProductId = #{id}
-	</delete>
-	<delete id="deleteLadderPriceById">
-		delete from organize_product_ladder_price where id = #{ladderId}
-	</delete>
 
 </mapper>

Some files were not shown because too many files changed in this diff