Ver código fonte

Merge branch 'developer' into developerE

JiangChongBo 2 anos atrás
pai
commit
36a7896c2a

+ 9 - 0
src/main/java/com/caimei/modules/cibe/entity/Shop.java

@@ -89,6 +89,15 @@ public class Shop extends DataEntity<Shop> {
 	private boolean storeStatus = false; //是否存在数据库
 	private String delShopIds;//删除的商店id,以,隔开
 	private List<Integer> delShopIdList;//删除的商品id列表
+	private Integer shopType;
+
+	public Integer getShopType() {
+		return shopType;
+	}
+
+	public void setShopType(Integer shopType) {
+		this.shopType = shopType;
+	}
 
 	public Integer getShopID() {
 		return shopID;

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

@@ -42,6 +42,8 @@ public interface CmPayShopRecordDao extends CrudDao<CmPayShopRecord> {
 
     void applyCompileSave(CmPayShop cmPayShop);
 
+    void applyCompileRecordSave(CmPayShop cmPayShop);
+
     Double sumWipePayment(@Param("shopOrderID") Integer shopOrderID);
 
     Double sumWipePaymentNoStatus(@Param("shopOrderID") Integer shopOrderID);

+ 3 - 0
src/main/java/com/caimei/modules/order/service/CmPayShopService.java

@@ -27,6 +27,7 @@ import com.thinkgem.jeesite.common.utils.Encodes;
 import com.thinkgem.jeesite.common.utils.StringUtils;
 import com.thinkgem.jeesite.modules.sys.entity.User;
 import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -45,6 +46,7 @@ import java.util.stream.Collectors;
  * @author lwt
  * @version 2019-07-01
  */
+@Slf4j
 @Service
 @Transactional(readOnly = true)
 public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
@@ -896,6 +898,7 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
     @Transactional(readOnly = false)
     public void applyCompileSave(CmPayShop cmPayShop) {
         cmPayShopRecordDao.applyCompileSave(cmPayShop);
+        cmPayShopRecordDao.applyCompileRecordSave(cmPayShop);
     }
 
     @Transactional(readOnly = false)

+ 5 - 1
src/main/java/com/caimei/modules/product/dao/CmSecondHandDetailDao.java

@@ -33,9 +33,13 @@ public interface CmSecondHandDetailDao extends CrudDao<CmSecondHandDetail> {
 
     List<Integer> findFlieTypes(Integer productID);
 
-    Integer findShopId(String cardNumber);
+    Integer findShopId(Integer productId);
 
     Integer insertShop(Shop shopVo);
 
     CmSecondHandDetail selectContactDockingPeople(String shopOrderNo);
+
+    void updateShop(Shop shopVo);
+
+    void updateShopType(Integer productID);
 }

+ 1 - 1
src/main/java/com/caimei/modules/product/entity/Product.java

@@ -88,7 +88,7 @@ public class Product extends DataEntity<Product> {
     private String productDetail; //普通机构商品详情1同资质机构商品详情,2用普通机构商品详情
     private String splitCode; //  该商品分账商户号
     //-----------------  虚拟字段 ----
-    private Integer shopType; //供应商类别,普通1,新品供应商2,二手供应商3
+    private Integer shopType; //供应商类别,0未审核的二手供应商,普通1,新品供应商2,二手供应商3
     private boolean customClass = false;  //是否有自定义分类
     private String brandName;//品牌名称
     private String otherBrandName;//其他手填品牌名称

+ 12 - 3
src/main/java/com/caimei/modules/product/service/CmSecondHandDetailService.java

@@ -121,12 +121,21 @@ public class CmSecondHandDetailService extends CrudService<CmSecondHandDetailDao
         }
     }
 
-    public Integer findSecondShop(String cardNumber) {
-        return cmSecondHandDetailDao.findShopId(cardNumber);
+    public Integer findSecondShop(Integer productId) {
+        return cmSecondHandDetailDao.findShopId(productId);
     }
 
     @Transactional(readOnly = false)
     public void insertShop(Shop shopVo) {
-        cmSecondHandDetailDao.insertShop(shopVo);
+        if (null != shopVo.getShopID() && shopVo.getShopID() > 0) {
+            cmSecondHandDetailDao.updateShop(shopVo);
+        } else {
+            cmSecondHandDetailDao.insertShop(shopVo);
+        }
+    }
+
+    @Transactional(readOnly = false)
+    public void updateShopType(Integer productID) {
+        cmSecondHandDetailDao.updateShopType(productID);
     }
 }

+ 39 - 37
src/main/java/com/caimei/modules/product/web/CmSecondHandDetailController.java

@@ -190,12 +190,13 @@ public class CmSecondHandDetailController extends BaseController {
 
         cmSecondHandDetailService.setValue(cmSecondHandDetail);
         List<SplitCode> splitCodeList = productNewDao.findSecondSplitCode(cmSecondHandDetail.getId());
-        model.addAttribute("splitCodeList",splitCodeList);
+        model.addAttribute("splitCodeList", splitCodeList);
         model.addAttribute("cmSecondHandDetail", cmSecondHandDetail);
         return "modules/product/cmSecondHandDetailForm";
     }
+
     @RequestMapping(value = "cmSecondDetailForm")
-    public String cmSecondDetailForm(CmSecondHandDetail cmSecondHandDetail,HttpServletRequest request, Model model, RedirectAttributes redirectAttributes) {
+    public String cmSecondDetailForm(CmSecondHandDetail cmSecondHandDetail, HttpServletRequest request, Model model, RedirectAttributes redirectAttributes) {
         // 解析二手商品小分类
         List<BigType> bigTypeList = new ArrayList<>();
         String instrumentType = cmSecondHandDetail.getInstrumentType();
@@ -284,7 +285,7 @@ public class CmSecondHandDetailController extends BaseController {
 
         cmSecondHandDetailService.setValue(cmSecondHandDetail);
         List<SplitCode> splitCodeList = productNewDao.findSecondSplitCode(cmSecondHandDetail.getId());
-        model.addAttribute("splitCodeList",splitCodeList);
+        model.addAttribute("splitCodeList", splitCodeList);
         model.addAttribute("cmSecondHandDetail", cmSecondHandDetail);
         return "modules/product/cmSecondDetailForm";
     }
@@ -296,50 +297,52 @@ public class CmSecondHandDetailController extends BaseController {
             return form(cmSecondHandDetail, model);
         }
         String cardNumber = cmSecondHandDetail.getCardNumber();
-        if(StringUtils.isBlank(cardNumber) && cmSecondHandDetail.getAnnounType()!=null && cmSecondHandDetail.getAnnounType()!=2){
-            addMessage(redirectAttributes,"请填写收款卡号");
-            model.addAttribute("cmSecondHandDetail",cmSecondHandDetail);
+        if (StringUtils.isBlank(cardNumber) && cmSecondHandDetail.getAnnounType() != null && cmSecondHandDetail.getAnnounType() != 2) {
+            addMessage(redirectAttributes, "请填写收款卡号");
+            model.addAttribute("cmSecondHandDetail", cmSecondHandDetail);
             return "redirect:" + Global.getAdminPath() + "/product/new/list?searchProductCategory=2";
         }
-        //根据银行卡判断是否注册过特殊二手供应商,有则挂在之前的供应商名下,否则注册新供应商
-        Integer shopId = cmSecondHandDetailService.findSecondShop(cmSecondHandDetail.getCardNumber());
+        Integer shopId = cmSecondHandDetailService.findSecondShop(cmSecondHandDetail.getProductID());
+        //保存为特殊二手供应商
+        Shop shopVo = new Shop();
+        shopVo.setShopID(shopId);
+        //1个人,2公司
+        String name = "1".equals(cmSecondHandDetail.getPublishIdentity()) ? cmSecondHandDetail.getContactName() : cmSecondHandDetail.getCompanyName();
+        shopVo.setName(name);
+        shopVo.setLinkMan(cmSecondHandDetail.getContactName());
+        shopVo.setContractMobile(cmSecondHandDetail.getContactMobile());
+        shopVo.setCardNumber(cmSecondHandDetail.getCardNumber());
+        if (cmSecondHandDetail.getBanOfDeposit() != null) {
+            shopVo.setBanOfDeposit(cmSecondHandDetail.getBanOfDeposit());
+        }
+        if (cmSecondHandDetail.getAccountName() != null) {
+            shopVo.setAccountName(cmSecondHandDetail.getAccountName());
+        }
+        if (cmSecondHandDetail.getAccountType() != null) {
+            shopVo.setAccountType(cmSecondHandDetail.getAccountType());
+        }
+        String validFlag = cmSecondHandDetail.getValidFlag();
+        if (StringUtils.isNotBlank(validFlag) && "2".equals(validFlag)) {
+            shopVo.setShopType(3);
+        } else {
+            shopVo.setShopType(0);
+        }
+        cmSecondHandDetailService.insertShop(shopVo);
         if (null == shopId) {
-            //保存为特殊二手供应商
-            Shop shopVo = new Shop();
-            //1个人,2公司
-            String name = "1".equals(cmSecondHandDetail.getPublishIdentity()) ? cmSecondHandDetail.getContactName() : cmSecondHandDetail.getCompanyName();
-            shopVo.setName(name);
-            shopVo.setLinkMan(cmSecondHandDetail.getContactName());
-            shopVo.setContractMobile(cmSecondHandDetail.getContactMobile());
-            shopVo.setCardNumber(cmSecondHandDetail.getCardNumber());
-            if (cmSecondHandDetail.getBanOfDeposit() != null) {
-                shopVo.setBanOfDeposit(cmSecondHandDetail.getBanOfDeposit());
-            }
-            if (cmSecondHandDetail.getAccountName() != null){
-                shopVo.setAccountName(cmSecondHandDetail.getAccountName());
-            }
-
-            if (cmSecondHandDetail.getAccountType()!= null) {
-                shopVo.setAccountType(cmSecondHandDetail.getAccountType());
-            }
-            cmSecondHandDetailService.insertShop(shopVo);
             shopId = shopVo.getShopID();
         }
-        String[] ids=null;
-        List<String> fileTypes =null;
-        if(cmSecondHandDetail.getAnnounType()!=null && cmSecondHandDetail.getAnnounType()!=2){
-         ids = request.getParameterValues("ids");
-         fileTypes = Arrays.asList(ids);
+        String[] ids = null;
+        List<String> fileTypes = null;
+        if (cmSecondHandDetail.getAnnounType() != null && cmSecondHandDetail.getAnnounType() != 2) {
+            ids = request.getParameterValues("ids");
+            fileTypes = Arrays.asList(ids);
         }
 
-        String validFlag = cmSecondHandDetail.getValidFlag();
         Date date = new Date();
         String dateStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date);
         // 保存二手商品关键信息
         Product product = new Product();
-        System.out.println(cmSecondHandDetail.getAnnounType());
         product.setAnnounType(cmSecondHandDetail.getAnnounType());
-
         product.setProductID(cmSecondHandDetail.getProductID());
         product.setBrandID(cmSecondHandDetail.getBrandID());
         // 二手商品类型
@@ -468,10 +471,9 @@ public class CmSecondHandDetailController extends BaseController {
             String imageUrl = getImageUrl(licenseImage);
             cmSecondHandDetail.setLicenseImage(imageUrl);
         }
-//        cmSecondHandDetail.setAnnounType(2);
         // 保存二手详细信息
         cmSecondHandDetailService.save(cmSecondHandDetail);
-        if(cmSecondHandDetail.getAnnounType()!=null && cmSecondHandDetail.getAnnounType()!=2) {
+        if (cmSecondHandDetail.getAnnounType() != null && cmSecondHandDetail.getAnnounType() != 2) {
             cmSecondHandDetailService.saveFileType(product.getProductID(), cmSecondHandDetail.getId(), fileTypes);
         }
         if (null != product.getProductID()) {

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

@@ -995,8 +995,11 @@ public class ProductNewController extends BaseController {
             // 更新二手商品上架信息
             Date date = new Date();
             if ("8".equals(validFlag)) {
+                //审核未通过
                 cmSecondHandDetailService.updateRevieweInfo(date, null, productID);
             } else {
+                //把shoptype置为3
+                cmSecondHandDetailService.updateShopType(productID);
                 cmSecondHandDetailService.updateRevieweInfo(date, date, productID);
             }
             cleanRedisCache();

+ 1 - 1
src/main/java/com/caimei/modules/user/entity/NewCmShop.java

@@ -80,7 +80,7 @@ public class NewCmShop extends DataEntity<NewCmShop> {
     private List<SplitCode> splitCodes; //分账方,子商户商编
     private String splitCode;  //列表页回显
     private String socialCreditCode; //统一社会信用代码
-    private Integer shopType;//供应商类别,普通1,新品供应商2,二手供应商3
+    private Integer shopType;//供应商类别 0未审核的二手供应商,普通1,新品供应商2,二手供应商3
     private String cardNumber; //收款卡号
     private Integer chargeSupport;//线上支付手续费:默认1采美承担,2供应商承担
     /**

+ 3 - 0
src/main/resources/mappings/modules/order/CmPayShopRecordMapper.xml

@@ -228,6 +228,9 @@
 	<update id="applyCompileSave" parameterType="com.caimei.modules.order.entity.CmPayShop">
 		UPDATE cm_pay_shop SET payType = #{payType},payTime = #{payTime} WHERE id = #{id}
 	</update>
+	<update id="applyCompileRecordSave">
+		update cm_pay_shop_record SET payType = #{payType},payTime = #{payTime} WHERE payShopID = #{id}
+	</update>
 
 	<select id="findShopOtherFee" resultType="com.caimei.modules.order.entity.ChangePayShopOther">
 		SELECT

+ 19 - 5
src/main/resources/mappings/modules/product/CmSecondHandDetailMapper.xml

@@ -121,9 +121,9 @@
 		where productId = #{productID}
 	</select>
     <select id="findShopId" resultType="java.lang.Integer">
-		select shopId from shop
-		where shopType = 3
-		  AND cardNumber = #{cardNumber}
+		select shopId
+		from product
+		where productID = #{productId}
 	</select>
     <insert id="insert" parameterType="CmSecondHandDetail"  keyProperty="id" useGeneratedKeys="true">
 		INSERT INTO cm_second_hand_detail(
@@ -213,7 +213,7 @@
 	</insert>
 	<insert id="insertShop" keyColumn="shopID" keyProperty="shopID" useGeneratedKeys="true">
 		insert into shop (name,linkMan,contractMobile,cardNumber,accountType,banOfDeposit,accountName,addTime,status,shopType)
-		values (#{name},#{linkMan},#{contractMobile},#{cardNumber},#{accountType},#{banOfDeposit},#{accountName},now(),90,3)
+		values (#{name},#{linkMan},#{contractMobile},#{cardNumber},#{accountType},#{banOfDeposit},#{accountName},now(),90,#{shopType})
 	</insert>
 	<select id="selectContactDockingPeople" resultType="CmSecondHandDetail">
 		select contactName,dockingPeopleName from cm_second_hand_detail
@@ -298,5 +298,19 @@
 	<update id="updatSecondHnadBySold">
 		UPDATE cm_second_hand_detail SET sold =  0 WHERE productID = #{productID}
 	</update>
-
+	<update id="updateShop">
+		update shop set name=#{name},
+		                linkMan=#{linkMan},
+		                contractMobile=#{contractMobile},
+		                cardNumber=#{cardNumber},
+		                accountType=#{accountType},
+		                banOfDeposit=#{banOfDeposit},
+		                accountName=#{accountName}
+		where shopID = #{shopID}
+	</update>
+	<update id="updateShopType">
+		update shop
+		set shopType=3
+		where shopID=(select shopID from product where productID=#{productID})
+	</update>
 </mapper>

+ 2 - 1
src/main/webapp/WEB-INF/views/modules/order/cmPayShopCheck.jsp

@@ -603,7 +603,8 @@
             <span id="transferPayFee" style="font-weight: bold; font-size:18px"><fmt:formatNumber
                     value="${cmPayShop.transferPayFee}" pattern="#,##0.00"/> </span>
             <label>付款银行:</label><span>
-					<select name="payType" style="width: 200px">
+					<select name="payType" class="input-medium required" style="width: 200px">
+                        <option value="">请选择</option>
                         <c:forEach  items="${offlineCollections}" var="offlineCollections" varStatus="index">
                             <option value="${offlineCollections.type}">${offlineCollections.bankAccount}</option>
                         </c:forEach>

+ 12 - 12
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherCheck.jsp

@@ -589,18 +589,18 @@
             <label style="font-weight: bold; font-size:18px">转账支付:</label>
             <span id="transferPayFee" style="font-weight: bold; font-size:18px"><fmt:formatNumber value="${cmPayShop.transferPayFee}" pattern="#,##0.00"/> </span>
             <label>付款银行:</label><span>
-            <c:forEach  items="${offlineCollections}" var="offlineCollections" varStatus="index">
-                <option value="${offlineCollections.type}">${offlineCollections.bankAccount}</option>
-            </c:forEach>
-					<%--<select name="payType">
-						<option value="1">建设银行7297</option>
-						<option value="2">中信银行0897</option>
-						<option value="3">中信银行7172</option>
-						<option value="4">广发银行0115</option>
-						<option value="5">广发银行5461</option>
-						<option value="7">华夏银行2400</option>
-						<option value="8">中国银行9452</option>
-					</select>--%>
+<%--                <select name="payType" class="input-medium" style="width: 200px">
+                    <option value="">请选择</option>
+                    <c:forEach items="${offlineCollections}" var="offlineCollections">
+                        <option value="${offlineCollections.type}">${offlineCollections.bankAccount}</option>
+                    </c:forEach>
+                </select>--%>
+					<select name="payType" style="width: 200px">
+						<option value="">请选择</option>
+                        <c:forEach items="${offlineCollections}" var="offlineCollections">
+                            <option value="${offlineCollections.type}">${offlineCollections.bankAccount}</option>
+                        </c:forEach>
+					</select>
 				</span>
             <label>付款时间:</label>
             <span>${cmPayShop.payTime}</span>

+ 8 - 4
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherEdit.jsp

@@ -78,16 +78,20 @@
         </div>
         <div>
             <label>付款银行:</label><span>
-					 <form:select path="payType" class="input-medium required">
-                         <form:option value="" label="请选择"/>
+					 <select name="payType" class="input-medium required" style="width: 200px">
+                         <option value="">请选择</option>
+                         <c:forEach  items="${offlineCollections}" var="offlineCollections" varStatus="index">
+                             <option value="${offlineCollections.type}">${offlineCollections.bankAccount}</option>
+                         </c:forEach>
+                     </select>
+                         <%--<form:option value="" label="请选择"/>
                          <form:option value="1" label="建设银行7297"/>
                          <form:option value="2" label="中信银行0897"/>
                          <form:option value="3" label="中信银行7172"/>
                          <form:option value="4" label="广发银行0115"/>
                          <form:option value="5" label="广发银行5461"/>
                          <form:option value="7" label="华夏银行2400"/>
-                         <form:option value="8" label="中国银行9452"/>
-                     </form:select>
+                         <form:option value="8" label="中国银行9452"/>--%>
 				</span>
             <label>付款时间:</label>
             <span><form:input path="payTime" type="text" maxlength="20" class="input-medium Wdate" value="${cmPayShop.payTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/></span>

+ 3 - 2
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherPrintDetail.jsp

@@ -716,7 +716,8 @@
                     <c:if test="${not empty cmPayShop.payType }">
                         <label>付款银行:</label>
                         <span id="payType">
-							<c:if test="${cmPayShop.payType eq 1}">
+                            ${cmPayShop.bankNameType}
+							<%--<c:if test="${cmPayShop.payType eq 1}">
                                 建设银行7297
                             </c:if>
 							<c:if test="${cmPayShop.payType eq 2}">
@@ -733,7 +734,7 @@
                             </c:if>
 							<c:if test="${cmPayShop.payType eq 7}">
                                 华夏银行2400
-                            </c:if>
+                            </c:if>--%>
 						</span>
                     </c:if>
                     <c:if test="${cmPayShop.status != '0'}">

+ 3 - 2
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherPrintDetails.jsp

@@ -495,7 +495,8 @@
                 <c:if test="${not empty cmPayShop.payType }">
                     <label>付款银行:</label>
                     <span id="payType">
-						<c:if test="${cmPayShop.payType eq 1}">
+                        ${cmPayShop.bankNameType}
+						<%--<c:if test="${cmPayShop.payType eq 1}">
                             建设银行7297
                         </c:if>
 						<c:if test="${cmPayShop.payType eq 2}">
@@ -512,7 +513,7 @@
                         </c:if>
                         <c:if test="${cmPayShop.payType eq 7}">
                             华夏银行2400
-                        </c:if>
+                        </c:if>--%>
 					</span>
                 </c:if>
                 <label>付款时间:</label>