Explorar o código

付款供应商差价显示

plf %!s(int64=4) %!d(string=hai) anos
pai
achega
13fead7526
Modificáronse 19 ficheiros con 631 adicións e 155 borrados
  1. 2 0
      src/main/java/com/caimei/modules/order/dao/CmPayShopRecordDao.java
  2. 4 1
      src/main/java/com/caimei/modules/order/dao/CmRefundShopDao.java
  3. 26 0
      src/main/java/com/caimei/modules/order/entity/ChangePayShopDifference.java
  4. 19 0
      src/main/java/com/caimei/modules/order/entity/NewShopOrder.java
  5. 13 0
      src/main/java/com/caimei/modules/order/service/CmPayShopService.java
  6. 22 1
      src/main/java/com/caimei/modules/order/service/NewShopOrderService.java
  7. 14 2
      src/main/java/com/caimei/modules/order/web/CmShopOrderController.java
  8. 135 133
      src/main/java/com/caimei/modules/zplm/service/CmBrandAuthService.java
  9. 20 0
      src/main/resources/mappings/modules/order/CmPayShopRecordMapper.xml
  10. 7 0
      src/main/resources/mappings/modules/order/CmRefundShopMapper.xml
  11. 2 0
      src/main/resources/mappings/modules/order/ShopOrderMapper.xml
  12. 9 1
      src/main/webapp/WEB-INF/views/modules/order/checkPaymentOrder.jsp
  13. 3 3
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopChangeRecond.jsp
  14. 7 1
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopCheck.jsp
  15. 7 1
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopDetail.jsp
  16. 24 9
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopForm.jsp
  17. 9 3
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopList.jsp
  18. 170 0
      src/main/webapp/WEB-INF/views/modules/order/differencePriceRemark.jsp
  19. 138 0
      src/main/webapp/WEB-INF/views/modules/order/otherRemark.jsp

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

@@ -54,4 +54,6 @@ public interface CmPayShopRecordDao extends CrudDao<CmPayShopRecord> {
     void insertShopOtherFee(ChangePayShopOther payShopOther);
 
     void insertDifference(ChangePayShopDifference payShopDifference);
+
+    List<ChangePayShopDifference> findShopDifference(Integer shopOrderId);
 }

+ 4 - 1
src/main/java/com/caimei/modules/order/dao/CmRefundShopDao.java

@@ -1,11 +1,12 @@
 package com.caimei.modules.order.dao;
 
+import com.caimei.modules.order.entity.CmRefundShop;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
-import com.caimei.modules.order.entity.CmRefundShop;
 
 /**
  * 退款表--供应商退款给采美DAO接口
+ *
  * @author lwt
  * @version 2019-07-01
  */
@@ -13,4 +14,6 @@ import com.caimei.modules.order.entity.CmRefundShop;
 public interface CmRefundShopDao extends CrudDao<CmRefundShop> {
 
     void updateByDelFlag(Integer refundShopId);
+
+    CmRefundShop findByRefundShopId(Integer refundShopId);
 }

+ 26 - 0
src/main/java/com/caimei/modules/order/entity/ChangePayShopDifference.java

@@ -79,6 +79,16 @@ public class ChangePayShopDifference implements Serializable {
      */
     private BigDecimal refundBalanceAmount;
 
+    /**
+     * 系统用户名称
+     */
+    private String systemName;
+
+    /**
+     * 退款数据
+     */
+    private CmRefundShop refundShop;
+
     public Integer getId() {
         return id;
     }
@@ -198,4 +208,20 @@ public class ChangePayShopDifference implements Serializable {
     public void setRefundType(Integer refundType) {
         this.refundType = refundType;
     }
+
+    public String getSystemName() {
+        return systemName;
+    }
+
+    public void setSystemName(String systemName) {
+        this.systemName = systemName;
+    }
+
+    public CmRefundShop getRefundShop() {
+        return refundShop;
+    }
+
+    public void setRefundShop(CmRefundShop refundShop) {
+        this.refundShop = refundShop;
+    }
 }

+ 19 - 0
src/main/java/com/caimei/modules/order/entity/NewShopOrder.java

@@ -4,6 +4,7 @@ import com.caimei.modules.product.entity.CmPromotion;
 import com.thinkgem.jeesite.common.persistence.DataEntity;
 
 import java.beans.Transient;
+import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.util.List;
 
@@ -82,6 +83,8 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
     private String sendOutStatus; //发货状态:1待发货、2部分发货、3已发货
     private String[] ps;    //付款状态集合
     private Integer zeroCostFlag;   //子订单0成本标识
+    private Integer differenceType; //差价类型:1 少付;2 多付
+    private BigDecimal differencePrice;  //补差价金额
     //-------------        虚拟字段   ----------------------------
     private String shopName;            //供应商
     private String commercialCode;      //分账方,子商户商编
@@ -1064,4 +1067,20 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
     public void setCommercialCode(String commercialCode) {
         this.commercialCode = commercialCode;
     }
+
+    public Integer getDifferenceType() {
+        return differenceType;
+    }
+
+    public void setDifferenceType(Integer differenceType) {
+        this.differenceType = differenceType;
+    }
+
+    public BigDecimal getDifferencePrice() {
+        return differencePrice;
+    }
+
+    public void setDifferencePrice(BigDecimal differencePrice) {
+        this.differencePrice = differencePrice;
+    }
 }

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

@@ -166,6 +166,13 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                 }
                 so.setNewOrderProducts(orderProductList);
                 so.setWaitPayShop((so.getShouldPayShopAmount() == null ? 0D : so.getShouldPayShopAmount()) - (so.getPayedShopAmount() == null ? 0D : so.getPayedShopAmount()));
+                if (so.getDifferenceType() != null && so.getDifferenceType() == 1) {
+                    BigDecimal waitPayShop = MathUtil.add(so.getWaitPayShop(), so.getDifferencePrice());
+                    so.setWaitPayShop(waitPayShop.doubleValue());
+                } else if (so.getDifferenceType() != null && so.getDifferenceType() == 2) {
+                    BigDecimal waitPayShop = MathUtil.sub(so.getWaitPayShop(), so.getDifferencePrice());
+                    so.setWaitPayShop(waitPayShop.doubleValue());
+                }
 
                 //统计该子订单的主的收款金额和收款状态
                 NewOrder newOrder = newOrderDao.get(so.getOrderID().toString());
@@ -484,6 +491,12 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
             BigDecimal payedFee = MathUtil.add(MathUtil.add(record.getPayAmount(), wipePayment), shopOrder.getPayedShopAmount());
             // 总共要付的金额
             BigDecimal shouldPayFee = BigDecimal.valueOf(shopOrder.getShouldPayShopAmount());
+            //判断是否有差价金额
+            if (shopOrder.getDifferenceType() != null && shopOrder.getDifferenceType() == 1) {
+                shouldPayFee = MathUtil.add(shouldPayFee, shopOrder.getDifferencePrice());
+            } else if (shopOrder.getDifferenceType() != null && shopOrder.getDifferenceType() == 2) {
+                shouldPayFee = MathUtil.sub(shouldPayFee, shopOrder.getDifferencePrice());
+            }
             if (MathUtil.compare(payedFee, shouldPayFee) == -1) {
                 // (本次付款金额 + 抹平金额 + 原来已经付过的金额)  < 总共要付的金额
                 shopOrder.setPayStatus("2");

+ 22 - 1
src/main/java/com/caimei/modules/order/service/NewShopOrderService.java

@@ -569,7 +569,7 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
                 if (user != null) {
                     other.setSystemName(user.getName());
                 }
-                if (StringUtils.isNotBlank(other.getRemarkImage())){
+                if (StringUtils.isNotBlank(other.getRemarkImage())) {
                     String[] remarkImages = other.getRemarkImage().split(",");
                     other.setRemarkImages(remarkImages);
                 }
@@ -577,4 +577,25 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
         }
         return shopOtherList;
     }
+
+    public List<ChangePayShopDifference> differencePriceRemark(Integer shopOrderId) {
+        List<ChangePayShopDifference> differenceList = cmPayShopRecordDao.findShopDifference(shopOrderId);
+        if (differenceList != null && differenceList.size() > 0) {
+            differenceList.forEach(difference -> {
+                if (difference.getType() == 2 && difference.getRefundShopId() > 0) {
+                    CmRefundShop refundShop = cmRefundShopDao.findByRefundShopId(difference.getRefundShopId());
+                    difference.setRefundShop(refundShop);
+                }
+                User user = UserUtils.get(difference.getModifyUserId().toString());
+                if (user != null) {
+                    difference.setSystemName(user.getName());
+                }
+                if (StringUtils.isNotBlank(difference.getRemarkImage())) {
+                    String[] remarkImages = difference.getRemarkImage().split(",");
+                    difference.setRemarkImages(remarkImages);
+                }
+            });
+        }
+        return differenceList;
+    }
 }

+ 14 - 2
src/main/java/com/caimei/modules/order/web/CmShopOrderController.java

@@ -7,7 +7,6 @@ import com.caimei.modules.order.service.NewShopOrderService;
 import com.caimei.modules.user.entity.CmUserOrganize;
 import com.caimei.modules.user.service.CmUserOrganizeService;
 import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.supcan.treelist.cols.Col;
 import com.thinkgem.jeesite.common.utils.StringUtils;
 import com.thinkgem.jeesite.common.web.BaseController;
 import org.apache.commons.collections.CollectionUtils;
@@ -206,7 +205,20 @@ public class CmShopOrderController extends BaseController {
     @RequestMapping("shopOtherRemark")
     public String shopOtherRemark(Integer shopOrderId, Model model) {
         List<ChangePayShopOther> shopOtherList = newShopOrderService.shopOtherRemark(shopOrderId);
-        return "";
+        model.addAttribute("shopOtherList", shopOtherList);
+        model.addAttribute("shopOrderId", shopOrderId);
+        return "modules/order/otherRemark";
+    }
+
+    /**
+     * 供应商差价备注
+     */
+    @RequestMapping("differencePriceRemark")
+    public String differencePriceRemark(Integer shopOrderId, Model model) {
+        List<ChangePayShopDifference> differenceList = newShopOrderService.differencePriceRemark(shopOrderId);
+        model.addAttribute("differenceList", differenceList);
+        model.addAttribute("shopOrderId", shopOrderId);
+        return "modules/order/differencePriceRemark";
     }
 }
 

+ 135 - 133
src/main/java/com/caimei/modules/zplm/service/CmBrandAuthService.java

@@ -29,151 +29,153 @@ import javax.annotation.Resource;
 
 /**
  * 品牌授权Service
+ *
  * @author Aslee
  * @version 2021-03-24
  */
 @Service
 @Transactional(readOnly = true)
 public class CmBrandAuthService extends CrudService<CmBrandAuthDao, CmBrandAuth> {
-	@Resource
-	CmBrandAuthDao cmBrandAuthDao;
+    @Resource
+    CmBrandAuthDao cmBrandAuthDao;
 
-	public CmBrandAuth get(String id) {
-		return super.get(id);
-	}
-	
-	public List<CmBrandAuth> findList(CmBrandAuth cmBrandAuth) {
-		return super.findList(cmBrandAuth);
-	}
-	
-	public Page<CmBrandAuth> findPage(Page<CmBrandAuth> page, CmBrandAuth cmBrandAuth) {
-		return super.findPage(page, cmBrandAuth);
-	}
-	
-	@Transactional(readOnly = false)
-	public void save(CmBrandAuth cmBrandAuth) {
-		//新增授权时,若授权有代理商且选择了文件代理声明,需要更新文件的授权Id
-		Boolean updateFileFlag = false;
-		if (StringUtils.isBlank(cmBrandAuth.getId())) {
-			updateFileFlag = true;
-		}
-		//保存图片
-		String logo = cmBrandAuth.getAuthLogo();
-		String statementImage = cmBrandAuth.getStatementImage();
-		if(StringUtils.isNotBlank(logo) && !logo.startsWith("http")){
-			cmBrandAuth.setAuthLogo(UploadPicUtils.saveImageToServer(logo, null));
-		}
-		if(StringUtils.isNotBlank(statementImage) && !statementImage.startsWith("http")){
-			cmBrandAuth.setStatementImage(UploadPicUtils.saveImageToServer(statementImage, null));
-		}
-		if (cmBrandAuth.getIsNewRecord()) {
-			cmBrandAuth.setCreateBy(UserUtils.getUser());
-			cmBrandAuth.setCreateTime(new Date());
-		}
-		//更新品牌授权logo
+    public CmBrandAuth get(String id) {
+        return super.get(id);
+    }
+
+    public List<CmBrandAuth> findList(CmBrandAuth cmBrandAuth) {
+        return super.findList(cmBrandAuth);
+    }
+
+    public Page<CmBrandAuth> findPage(Page<CmBrandAuth> page, CmBrandAuth cmBrandAuth) {
+        return super.findPage(page, cmBrandAuth);
+    }
+
+    @Transactional(readOnly = false)
+    public void save(CmBrandAuth cmBrandAuth) {
+        //新增授权时,若授权有代理商且选择了文件代理声明,需要更新文件的授权Id
+        Boolean updateFileFlag = false;
+        if (StringUtils.isBlank(cmBrandAuth.getId())) {
+            updateFileFlag = true;
+        }
+        //保存图片
+        String logo = cmBrandAuth.getAuthLogo();
+        String statementImage = cmBrandAuth.getStatementImage();
+        if (StringUtils.isNotBlank(logo) && !logo.startsWith("http")) {
+            cmBrandAuth.setAuthLogo(UploadPicUtils.saveImageToServer(logo));
+        }
+        if (StringUtils.isNotBlank(statementImage) && !statementImage.startsWith("http")) {
+            cmBrandAuth.setStatementImage(UploadPicUtils.saveImageToServer(statementImage));
+        }
+        if (cmBrandAuth.getIsNewRecord()) {
+            cmBrandAuth.setCreateBy(UserUtils.getUser());
+            cmBrandAuth.setCreateTime(new Date());
+        }
+        //更新品牌授权logo
         cmBrandAuthDao.updateBrandAuthLogo(cmBrandAuth.getBrandId(), cmBrandAuth.getAuthLogo());
-		//保存品牌授权
-		super.save(cmBrandAuth);
-		//有代理商且选择了文件代理声明的情况下
-		if (cmBrandAuth.getAgentFlag() == 1 && cmBrandAuth.getStatementType() == 4) {
-			//新增授权时,更新代理声明文件
-			if (updateFileFlag) {
-				Integer statementFileId = cmBrandAuth.getStatementFileId();
-				if (statementFileId != null) {
-					CmBrandAuthFile cmBrandAuthFile = new CmBrandAuthFile();
-					cmBrandAuthFile.setId(statementFileId);
-					cmBrandAuthFile.setBrandAuthId(Integer.parseInt(cmBrandAuth.getId()));
-					cmBrandAuthDao.updateStatementFile(cmBrandAuthFile);
-				}
-			}
-			//修改授权情况下,不需要更新
-		} else {
-			// 没有选择文件代理声明的情况下,若存在原来的文件,删除代理声明文件
-			deleteFileByAuthId(cmBrandAuth.getId());
-		}
-	}
-	
-	@Transactional(readOnly = false)
-	public void delete(CmBrandAuth cmBrandAuth) {
-		//删除授权商品参数
-		cmBrandAuthDao.deleteParamsByAuthId(cmBrandAuth.getId());
-		//删除授权商品
-		cmBrandAuthDao.deleteProductsByAuthId(cmBrandAuth.getId());
-		//删除代理声明文件
-		if (cmBrandAuth.getAgentFlag() == 1 && cmBrandAuth.getStatementType() == 4) {
-			deleteFileByAuthId(cmBrandAuth.getId());
-		}
-		super.delete(cmBrandAuth);
-	}
+        //保存品牌授权
+        super.save(cmBrandAuth);
+        //有代理商且选择了文件代理声明的情况下
+        if (cmBrandAuth.getAgentFlag() == 1 && cmBrandAuth.getStatementType() == 4) {
+            //新增授权时,更新代理声明文件
+            if (updateFileFlag) {
+                Integer statementFileId = cmBrandAuth.getStatementFileId();
+                if (statementFileId != null) {
+                    CmBrandAuthFile cmBrandAuthFile = new CmBrandAuthFile();
+                    cmBrandAuthFile.setId(statementFileId);
+                    cmBrandAuthFile.setBrandAuthId(Integer.parseInt(cmBrandAuth.getId()));
+                    cmBrandAuthDao.updateStatementFile(cmBrandAuthFile);
+                }
+            }
+            //修改授权情况下,不需要更新
+        } else {
+            // 没有选择文件代理声明的情况下,若存在原来的文件,删除代理声明文件
+            deleteFileByAuthId(cmBrandAuth.getId());
+        }
+    }
 
-	/**
-	 * 代理声明文件上传
-	 * @param fileName
-	 * @return
-	 */
+    @Transactional(readOnly = false)
+    public void delete(CmBrandAuth cmBrandAuth) {
+        //删除授权商品参数
+        cmBrandAuthDao.deleteParamsByAuthId(cmBrandAuth.getId());
+        //删除授权商品
+        cmBrandAuthDao.deleteProductsByAuthId(cmBrandAuth.getId());
+        //删除代理声明文件
+        if (cmBrandAuth.getAgentFlag() == 1 && cmBrandAuth.getStatementType() == 4) {
+            deleteFileByAuthId(cmBrandAuth.getId());
+        }
+        super.delete(cmBrandAuth);
+    }
 
-	@Transactional(readOnly = false)
+    /**
+     * 代理声明文件上传
+     *
+     * @param fileName
+     * @return
+     */
+
+    @Transactional(readOnly = false)
     public Map<String, Object> uploadFile(String brandAuthId, MultipartFile multipartFile, String fileName) {
-		Map<String, Object> map = new HashMap<>();
-		String fileAllName = multipartFile.getOriginalFilename();
-		String fileType = fileAllName.substring(fileAllName.lastIndexOf(".") + 1);
-		String uuid = UUID.randomUUID().toString().replaceAll("-", "");
-		String filePath = uuid + "." + fileType;
-		String contentType = OSSUtils.getContentType(fileAllName);
-		try {
-			//保存本地
-			File file = OSSUtils.ossUpload(multipartFile);
-			//判断文件的唯一性,转换成16进制md5值
-			String md5Hex = DigestUtils.md5Hex(new FileInputStream(file));
-			CmBrandAuthFile searchFile = new CmBrandAuthFile();
-			searchFile.setBrandAuthId(StringUtils.isBlank(brandAuthId) ? null : Integer.parseInt(brandAuthId));
-			searchFile.setMd5Hex(md5Hex);
-			// 查找该授权下是否已存在相同文件
-			CmBrandAuthFile cmBrandAuthFile = cmBrandAuthDao.findStatementFile(searchFile);
-			String url = "";
-			if (cmBrandAuthFile == null) {
-				logger.info("默认路径>>>" + file.getAbsolutePath());
-				// 修改情况下,如果原来已经选择了文件代理声明,并且旧文件与新文件不同,需要将旧文件删除
-				deleteFileByAuthId(brandAuthId);
-				//将新文件上传oss
-				url = OSSUtils.ossUpload(filePath, file, contentType);
-				//删除本地文件
-				OSSUtils.deleteFile(file);
-				//保存关联关系
-				cmBrandAuthFile = new CmBrandAuthFile();
-				cmBrandAuthFile.setBrandAuthId(searchFile.getBrandAuthId());
-				cmBrandAuthFile.setName(fileName);
-				cmBrandAuthFile.setOssName(filePath);
-				cmBrandAuthFile.setMd5Hex(md5Hex);
-				cmBrandAuthFile.setUploadTime(new Date());
-				cmBrandAuthDao.insertStatementFile(cmBrandAuthFile);
-			} else {
-				//删除本地文件
-				OSSUtils.deleteFile(file);
-			}
+        Map<String, Object> map = new HashMap<>();
+        String fileAllName = multipartFile.getOriginalFilename();
+        String fileType = fileAllName.substring(fileAllName.lastIndexOf(".") + 1);
+        String uuid = UUID.randomUUID().toString().replaceAll("-", "");
+        String filePath = uuid + "." + fileType;
+        String contentType = OSSUtils.getContentType(fileAllName);
+        try {
+            //保存本地
+            File file = OSSUtils.ossUpload(multipartFile);
+            //判断文件的唯一性,转换成16进制md5值
+            String md5Hex = DigestUtils.md5Hex(new FileInputStream(file));
+            CmBrandAuthFile searchFile = new CmBrandAuthFile();
+            searchFile.setBrandAuthId(StringUtils.isBlank(brandAuthId) ? null : Integer.parseInt(brandAuthId));
+            searchFile.setMd5Hex(md5Hex);
+            // 查找该授权下是否已存在相同文件
+            CmBrandAuthFile cmBrandAuthFile = cmBrandAuthDao.findStatementFile(searchFile);
+            String url = "";
+            if (cmBrandAuthFile == null) {
+                logger.info("默认路径>>>" + file.getAbsolutePath());
+                // 修改情况下,如果原来已经选择了文件代理声明,并且旧文件与新文件不同,需要将旧文件删除
+                deleteFileByAuthId(brandAuthId);
+                //将新文件上传oss
+                url = OSSUtils.ossUpload(filePath, file, contentType);
+                //删除本地文件
+                OSSUtils.deleteFile(file);
+                //保存关联关系
+                cmBrandAuthFile = new CmBrandAuthFile();
+                cmBrandAuthFile.setBrandAuthId(searchFile.getBrandAuthId());
+                cmBrandAuthFile.setName(fileName);
+                cmBrandAuthFile.setOssName(filePath);
+                cmBrandAuthFile.setMd5Hex(md5Hex);
+                cmBrandAuthFile.setUploadTime(new Date());
+                cmBrandAuthDao.insertStatementFile(cmBrandAuthFile);
+            } else {
+                //删除本地文件
+                OSSUtils.deleteFile(file);
+            }
 
-			map.put("success", true);
-			map.put("msg", "操作成功");
-			map.put("url", url);
-			map.put("statementFile", cmBrandAuthFile);
-		} catch (Exception e) {
-			e.printStackTrace();
-			map.put("success", false);
-			map.put("msg", "操作失败");
-			logger.info("上传异常!!!");
-		}
-		return map;
+            map.put("success", true);
+            map.put("msg", "操作成功");
+            map.put("url", url);
+            map.put("statementFile", cmBrandAuthFile);
+        } catch (Exception e) {
+            e.printStackTrace();
+            map.put("success", false);
+            map.put("msg", "操作失败");
+            logger.info("上传异常!!!");
+        }
+        return map;
     }
 
-	private void deleteFileByAuthId(String brandAuthId) {
-		CmBrandAuthFile oldFile = cmBrandAuthDao.findStatementFileByAuthId(brandAuthId);
-		if (oldFile != null) {
-			Integer num = cmBrandAuthDao.findStatementFileByMd5Hex(oldFile.getMd5Hex());
-			if (num == 1) {
-				//删除oss服务器上的文件
-				OSSUtils.deleteSingleFile(oldFile.getOssName());
-			}
-			cmBrandAuthDao.deleteStatementFile(oldFile.getId());
-		}
-	}
+    private void deleteFileByAuthId(String brandAuthId) {
+        CmBrandAuthFile oldFile = cmBrandAuthDao.findStatementFileByAuthId(brandAuthId);
+        if (oldFile != null) {
+            Integer num = cmBrandAuthDao.findStatementFileByMd5Hex(oldFile.getMd5Hex());
+            if (num == 1) {
+                //删除oss服务器上的文件
+                OSSUtils.deleteSingleFile(oldFile.getOssName());
+            }
+            cmBrandAuthDao.deleteStatementFile(oldFile.getId());
+        }
+    }
 }

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

@@ -227,6 +227,7 @@
 		  `id`,
 		  `shopOrderId`,
 		  `shopOtherFee`,
+		  modifyUserId,
 		  `bankAccountName`,
 		  `bankAccount`,
 		  `bankName`,
@@ -269,4 +270,23 @@
 			#{remarkImage}, NOW()
 		  )
 	</insert>
+
+	<select id="findShopDifference" resultType="com.caimei.modules.order.entity.ChangePayShopDifference">
+		SELECT
+		  `id`,
+		  `shopOrderId`,
+		  `modifyUserId`,
+		  `refundShopId`,
+		  `differencePrice`,
+		  `type`,
+		  `remark`,
+		  `remarkImage`,
+		  `updateTime`
+		FROM
+		  `cm_change_pay_shop_difference`
+		WHERE
+		  shopOrderId = #{shopOrderId}
+		ORDER BY
+		  updateTime
+	</select>
 </mapper>

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

@@ -167,4 +167,11 @@
 		UPDATE cm_refund_shop SET delFlag = 1 WHERE id = #{refundShopId}
 	</update>
 
+	<select id="findByRefundShopId" resultType="com.caimei.modules.order.entity.CmRefundShop">
+		SELECT
+		<include refid="cmRefundShopColumns"/>
+		FROM cm_refund_shop a
+		<include refid="cmRefundShopJoins"/>
+		WHERE a.id = #{refundShopId}
+	</select>
 </mapper>

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

@@ -67,6 +67,8 @@
     		a.costType AS costType,
     		a.modifyShouldPayNote AS modifyShouldPayNote,
     		a.orderPromotionsId AS orderPromotionsId,
+    		a.differenceType AS differenceType,
+    		a.differencePrice AS differencePrice,
     		proportional AS proportional,
     		a.promotionFullReduction As promotionFullReduction,
     		a.zeroCostFlag AS zeroCostFlag

+ 9 - 1
src/main/webapp/WEB-INF/views/modules/order/checkPaymentOrder.jsp

@@ -309,7 +309,15 @@
                                 <fmt:formatNumber value="${so.refundAmount}" type="number" pattern="#,##0.00"/>
                             </c:if>
                         </td>
-                        <td colspan="2"><fmt:formatNumber value="${so.shouldPayShopAmount}" type="number" pattern="#,##0.00"/></td>
+                        <td colspan="2">
+                            <fmt:formatNumber value="${so.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>
+                            <c:if test="${so.differenceType eq 1}">
+                                <font color="red">(需补差价¥${so.differencePrice})</font>
+                            </c:if>
+                            <c:if test="${so.differenceType eq 2}">
+                                <font color="red">(需退差价¥${so.differencePrice})</font>
+                            </c:if>
+                        </td>
                         <td colspan="3"><fmt:formatNumber value="${so.shopTaxFee}" type="number" pattern="#,##0.00"/></td>
                         <td class="product-freight"><fmt:formatNumber value="${so.shopPostFee}" type="number" pattern="#,##0.00"/></td>
                         <td><fmt:formatNumber value="${so.shopOtherFee}" type="number" pattern="#,##0.00"/></td>

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

@@ -103,9 +103,9 @@
 <form:form id="inputForm" modelAttribute="newShopOrder" action="${ctx}/shopOrder/payShopRemark?shopOrderId=${shopOrderId}" method="post"
            class="form-horizontal">
         <ul class="nav nav-tabs" id="myTab">
-                <li class="active"><a href="">修改成本备注</a></li>
-                <li><a href="">修改付第三方备注</a></li>
-                <li><a href="">修改供应商差价备注</a></li>
+                <li class="active"><a href="${ctx}/shopOrder/payShopRemark?shopOrderId=${shopOrderId}">修改成本备注</a></li>
+                <li><a href="${ctx}/shopOrder/shopOtherRemark?shopOrderId=${shopOrderId}">修改付第三方备注</a></li>
+                <li><a href="${ctx}/shopOrder/differencePriceRemark?shopOrderId=${shopOrderId}">修改供应商差价备注</a></li>
         </ul>
         <c:if test="${not empty payShopRecondList}">
             <c:forEach items="${payShopRecondList}" var="payShopRecond">

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

@@ -169,7 +169,13 @@
 						<td colspan="2" class="payCm-t"></td>
 						<td colspan="3" class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/></td>
 						<td colspan="2" class="supplier-fee">
-							<div>应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>,
+							<div>应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>
+								<c:if test="${s.differenceType eq 1}">
+									<font color="red">(需补差价¥${s.differencePrice})</font>
+								</c:if>
+								<c:if test="${s.differenceType eq 2}">
+									<font color="red">(需退差价¥${s.differencePrice})</font>
+								</c:if>,
 								 已付:<fmt:formatNumber value="${s.payedShopAmount}" type="number" pattern="#,##0.00"/>
 							</div>
 							<div>

+ 7 - 1
src/main/webapp/WEB-INF/views/modules/order/cmPayShopDetail.jsp

@@ -180,7 +180,13 @@
 					<td colspan="2" class="payCm-t"></td>
 					<td colspan="3" class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/></td>
 					<td colspan="2" class="supplier-fee">
-						<div>应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>,
+						<div>应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>
+							<c:if test="${s.differenceType eq 1}">
+								<font color="red">(需补差价¥${s.differencePrice})</font>
+							</c:if>
+							<c:if test="${s.differenceType eq 2}">
+								<font color="red">(需退差价¥${s.differencePrice})</font>
+							</c:if>,
 							 已付:<fmt:formatNumber value="${s.payedShopAmount}" type="number" pattern="#,##0.00"/>
 						</div>
 						<div>

+ 24 - 9
src/main/webapp/WEB-INF/views/modules/order/cmPayShopForm.jsp

@@ -22,7 +22,6 @@
 	.pay-table th{background:#f9f9f9}
 	.pay-table tr:first-child th{background:#eee !important}
 	.pay-table td{background:#fff !important}
-	/*.supplier-fee{text-align:left !important;padding-top:20px !important;padding-left:20px !important}*/
 	.need-to-pay{width:90px}
 	.payment-form-bottom label{width:140px}
 	.used-amount{width:80px;margin-top:6px}
@@ -194,9 +193,15 @@
 					<td colspan="2" class="payCm-t"></td>
 					<td colspan="3" class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/></td>
 					<td colspan="2" class="supplier-fee">
-						<div><span class="nowrap">应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" pattern="#,##0.00"/>,</span>
+						<div><span class="nowrap">应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" pattern="#,##0.00"/>
+							<c:if test="${s.differenceType eq 1}">
+								<font color="red">(需补差价¥${s.differencePrice})</font>
+							</c:if>
+							<c:if test="${s.differenceType eq 2}">
+								<font color="red">(需退差价¥${s.differencePrice})</font>
+							</c:if>,</span>
 							 <span class="nowrap">已付:${s.payedShopAmount},</span></div>
-						<div><span class="nowrap">待付:<input type="number" value="<fmt:formatNumber value="${s.waitPayShop}" pattern="0.00"/>" class="need-to-pay" data-pay="${s.shouldPayShopAmount}" data-payed="${s.payedShopAmount}"></span></div>
+						<div><span class="nowrap">待付:<input type="number" value="<fmt:formatNumber value="${s.waitPayShop}" pattern="0.00"/>" class="need-to-pay" data-type="${s.differenceType}" data-difference="${s.differencePrice}" data-pay="${s.shouldPayShopAmount}" data-payed="${s.payedShopAmount}"></span></div>
 						<input type="hidden" name="payInfo" class="payInfo" data-shoporderid="${s.shopOrderID}" value="${s.shopOrderID}_${s.waitPayShop}_0">
 						<label class="wipeBtn"><input class="wipeFee" type="checkbox" value="0"><span>付款抹平:<em class="red wipeText">¥0.00</em></span></label>
 					</td>
@@ -391,14 +396,19 @@
 			var thisEle = $(this),
 				wrapper = thisEle.parents(".supplier-fee"),
 				shouldPay = thisEle.attr('data-pay')*1,
+				differencePrice = thisEle.attr('data-difference')*1,
+				differenceType = thisEle.attr('data-type'),
 				alreadyPaid = thisEle.attr('data-payed')*1;
 			if(thisEle.val().length>8){
 				thisEle.val(thisEle.val().slice(0,8));
 			}
-			if((thisEle.val() > shouldPay - alreadyPaid) || thisEle.val() < 0) {
-				thisEle.val((shouldPay - alreadyPaid).toFixed(2));
+			if (differenceType == 2){
+				differencePrice = -differencePrice;
+			}
+			if((thisEle.val() > shouldPay - alreadyPaid + differencePrice) || thisEle.val() < 0) {
+				thisEle.val((shouldPay - alreadyPaid + differencePrice).toFixed(2));
 			}
-			var wipe = parseFloat((shouldPay - alreadyPaid - thisEle.val()).toFixed(12));
+			var wipe = parseFloat((shouldPay - alreadyPaid - thisEle.val() + differencePrice).toFixed(12));
 			if (wipe>0) {
 				wrapper.find('.wipeBtn').show();
 			}else{
@@ -440,14 +450,19 @@
 		var thisEle = $(this),
 			wrapper = thisEle.parents(".supplier-fee"),
 			shouldPay = thisEle.attr('data-pay')*1,
+			differencePrice = thisEle.attr('data-difference')*1,
+			differenceType = thisEle.attr('data-type'),
 			alreadyPaid = thisEle.attr('data-payed')*1;
 		if(thisEle.val().length>8){
 			thisEle.val(thisEle.val().slice(0,8));
 		}
-		if((thisEle.val() > shouldPay - alreadyPaid) || thisEle.val() < 0) {
-			thisEle.val((shouldPay - alreadyPaid).toFixed(2));
+		if (differenceType == 2){
+			differencePrice = -differencePrice;
+		}
+		if((thisEle.val() > shouldPay - alreadyPaid + differencePrice) || thisEle.val() < 0) {
+			thisEle.val((shouldPay - alreadyPaid + differencePrice).toFixed(2));
 		}
-		var wipe = parseFloat((shouldPay - alreadyPaid - thisEle.val()).toFixed(12));
+		var wipe = parseFloat((shouldPay - alreadyPaid - thisEle.val() + differencePrice).toFixed(12));
 		if (wipe>0) {
 			wrapper.find('.wipeBtn').show();
 		}else{

+ 9 - 3
src/main/webapp/WEB-INF/views/modules/order/cmPayShopList.jsp

@@ -485,9 +485,15 @@
                         <c:if test="${s.payStatus == 3}"><font color="green">已付款</font></c:if></td>
                     <td colspan="3" class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number"
                                                                     pattern="#,##0.00"/></td>
-                    <td class="supplier-fee"><font color="#E15616"><fmt:formatNumber value="${s.shouldPayShopAmount}"
-                                                                                     type="number"
-                                                                                     pattern="#,##0.00"/></font></td>
+                    <td class="supplier-fee">
+                        <font color="#E15616"><fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/></font>
+                        <c:if test="${s.differenceType eq 1}">
+                            <font color="red">(需补差价¥${s.differencePrice})</font>
+                        </c:if>
+                        <c:if test="${s.differenceType eq 2}">
+                            <font color="red">(需退差价¥${s.differencePrice})</font>
+                        </c:if>
+                    </td>
                     <input type="hidden" class="payedShopAmount" value="${s.payedShopAmount}">
                     <input type="hidden" class="productAmount" value="${s.productAmount}">
                     <input type="hidden" class="costType" value="${s.costType}">

+ 170 - 0
src/main/webapp/WEB-INF/views/modules/order/differencePriceRemark.jsp

@@ -0,0 +1,170 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+    <title>付款修改记录</title>
+    <meta name="decorator" content="default"/>
+    <style type="text/css">
+        .table th {text-align: center}
+        .table td {text-align: center}
+        .pay-table th {
+            background: #f9f9f9;
+        }
+        .pay-table tr:first-child th {
+            background: #eee !important;
+        }
+        .pay-table td {
+            background: #fff !important;
+        }
+
+        .form-horizontal .controls {
+            margin-left: 0;
+        }
+
+        .dateInput input {
+            width: 150px;
+        }
+
+        .clause span {
+            margin-left: 30px;
+        }
+
+        #productTable th {
+            text-align: center;
+            white-space: nowrap;
+        }
+
+        #productTable td {
+            text-align: center;
+            white-space: nowrap;
+        }
+        .conList .btn:nth-of-type(1){
+            margin-left: 25px;
+        }
+        .upload-content .conList .btn:nth-of-type(1) {
+            width: 90px;
+            height: 100px;
+            border: 2px solid #eee;
+            background: #fff;
+            position: relative;
+        }
+        .upload-content .conList .btn:nth-of-type(1)>div {
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%);
+            color: #666;
+        }
+        .upload-content .conList .btn:nth-of-type(1) span {
+            font-size: 35px;
+        }
+        .upload-content .conList .btn:nth-of-type(1) h5 {
+            color: #666;
+        }
+    </style>
+    <script type="text/javascript">
+        $(document).ready(function() {
+            $("#inputForm").validate({
+                ignore:"",
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $("#messageBox").text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+
+        });
+        function page(n,s){
+            $("#pageNo").val(n);
+            $("#pageSize").val(s);
+            $("#searchForm").submit();
+            return false;
+        }
+
+        //初始化默认清除本地本地Item数据
+
+    </script>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li><a href="${ctx}/order/cmPayShop">付款列表</a></li>
+    <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
+    <li class="active"><a href="${ctx}/shopOrder/payShopRemark?shopOrderId=${shopOrderId}">付款备注</a></li>
+</ul>
+
+<ul class="nav nav-tabs" id="myTab">
+    <li><a href="${ctx}/shopOrder/payShopRemark?shopOrderId=${shopOrderId}">修改成本备注</a></li>
+    <li><a href="${ctx}/shopOrder/shopOtherRemark?shopOrderId=${shopOrderId}">修改付第三方备注</a></li>
+    <li class="active"><a href="${ctx}/shopOrder/differencePriceRemark?shopOrderId=${shopOrderId}">修改供应商差价备注</a></li>
+</ul>
+<c:if test="${not empty differenceList}">
+    <c:forEach items="${differenceList}" var="difference">
+        <div style="margin-left: 35px">
+            <div style="font-weight: bold;width: 100%;float: left;"><span style="float: left;">${difference.systemName}</span><span style="float: left;margin-left:10px;"><fmt:formatDate value="${difference.updateTime}" pattern="yyyy-MM-dd HH:mm"/></span></div>
+            <br><br>
+            <div>
+                <ul>差价类型:${difference.type eq 1 ? "少付":"多付"}</ul>
+                <ul>差价金额:${difference.differencePrice}</ul>
+                <c:if test="${not empty difference.refundShop}">
+                    <ul>接收退款方式:</ul>
+                    <div style="margin-left: 100px">
+                        <div class="refund-wrapper">
+                            <c:if test="${difference.refundShop.refundWay == '1'||difference.refundShop.refundWay == '3'}">
+                                线下转账:
+                                <c:if test="${difference.refundShop.refundType == '1'}">
+                                    建设银行7297
+                                </c:if>
+                                <c:if test="${difference.refundShop.refundType == '2'}">
+                                    中信银行0897
+                                </c:if>
+                                <c:if test="${difference.refundShop.refundType == '3'}">
+                                    中信银行7172
+                                </c:if>
+                                <c:if test="${difference.refundShop.refundType == '4'}">
+                                    广发银行0115
+                                </c:if>
+                                <c:if test="${difference.refundShop.refundType == '5'}">
+                                    广发银行5461
+                                </c:if>
+                                <c:if test="${difference.refundShop.refundType == '6'}">
+                                    虚拟银行0000
+                                </c:if>
+                                ,¥${difference.refundShop.refundAmount}
+                            </c:if>
+                        </div>
+                        <div class="refund-wrapper">
+                            <c:if test="${difference.refundShop.refundWay == '2'||difference.refundShop.refundWay == '3'}">
+                                余额账户:¥${difference.refundShop.refundBalanceAmount}
+                            </c:if>
+                        </div>
+                    </div><br>
+                </c:if>
+                <ul>备注内容:${difference.remark}</ul>
+                <ul>图片:
+                    <c:forEach items="${difference.remarkImages}" var="image">
+                        <img src="${image}" style="height: 100px;width: 100px">
+                    </c:forEach>
+                </ul>
+            </div>
+        </div>
+        <hr>
+    </c:forEach>
+</c:if>
+<c:if test="${empty differenceList}">
+    <p style="text-align: center;"><font  color="#1e90ff">暂无备注数据……</font></p>
+</c:if>
+<div>
+    <input id="btnCancel" class="btn" type="button" value="返回" onclick="history.go(-1)"/>
+</div>
+<script>
+</script>
+</body>
+</html>

+ 138 - 0
src/main/webapp/WEB-INF/views/modules/order/otherRemark.jsp

@@ -0,0 +1,138 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+    <title>付款修改记录</title>
+    <meta name="decorator" content="default"/>
+    <style type="text/css">
+        .table th {text-align: center}
+        .table td {text-align: center}
+        .pay-table th {
+            background: #f9f9f9;
+        }
+        .pay-table tr:first-child th {
+            background: #eee !important;
+        }
+        .pay-table td {
+            background: #fff !important;
+        }
+
+        .form-horizontal .controls {
+            margin-left: 0;
+        }
+
+        .dateInput input {
+            width: 150px;
+        }
+
+        .clause span {
+            margin-left: 30px;
+        }
+
+        #productTable th {
+            text-align: center;
+            white-space: nowrap;
+        }
+
+        #productTable td {
+            text-align: center;
+            white-space: nowrap;
+        }
+        .conList .btn:nth-of-type(1){
+            margin-left: 25px;
+        }
+        .upload-content .conList .btn:nth-of-type(1) {
+            width: 90px;
+            height: 100px;
+            border: 2px solid #eee;
+            background: #fff;
+            position: relative;
+        }
+        .upload-content .conList .btn:nth-of-type(1)>div {
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%);
+            color: #666;
+        }
+        .upload-content .conList .btn:nth-of-type(1) span {
+            font-size: 35px;
+        }
+        .upload-content .conList .btn:nth-of-type(1) h5 {
+            color: #666;
+        }
+    </style>
+    <script type="text/javascript">
+        $(document).ready(function() {
+            $("#inputForm").validate({
+                ignore:"",
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $("#messageBox").text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+
+        });
+        function page(n,s){
+            $("#pageNo").val(n);
+            $("#pageSize").val(s);
+            $("#searchForm").submit();
+            return false;
+        }
+
+        //初始化默认清除本地本地Item数据
+
+    </script>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li><a href="${ctx}/order/cmPayShop">付款列表</a></li>
+    <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
+    <li class="active"><a href="${ctx}/shopOrder/payShopRemark?shopOrderId=${shopOrderId}">付款备注</a></li>
+</ul>
+
+    <ul class="nav nav-tabs" id="myTab">
+        <li><a href="${ctx}/shopOrder/payShopRemark?shopOrderId=${shopOrderId}">修改成本备注</a></li>
+        <li class="active"><a href="${ctx}/shopOrder/shopOtherRemark?shopOrderId=${shopOrderId}">修改付第三方备注</a></li>
+        <li><a href="${ctx}/shopOrder/differencePriceRemark?shopOrderId=${shopOrderId}">修改供应商差价备注</a></li>
+    </ul>
+    <c:if test="${not empty shopOtherList}">
+        <c:forEach items="${shopOtherList}" var="shopOther">
+            <div style="margin-left: 35px">
+                <div style="font-weight: bold;width: 100%;float: left;"><span style="float: left;">${shopOther.systemName}</span><span style="float: left;margin-left:10px;"><fmt:formatDate value="${shopOther.updateTime}" pattern="yyyy-MM-dd HH:mm"/></span></div>
+                <br><br>
+                <div>
+                    <ul>付第三方:${shopOther.shopOtherFee}</ul>
+                    <ul>开户名:${shopOther.bankAccountName}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;账号:${shopOther.bankAccount}</ul>
+                    <ul>开户行:${shopOther.bankName}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;账户类型:${shopOther.type eq 0 ? "公账":"私账"}</ul>
+                    <ul>备注内容:${shopOther.remark}</ul>
+                    <ul>图片:
+                        <c:forEach items="${shopOther.remarkImages}" var="image">
+                            <img src="${image}" style="height: 100px;width: 100px">
+                        </c:forEach>
+                    </ul>
+                </div>
+            </div>
+            <hr>
+        </c:forEach>
+    </c:if>
+    <c:if test="${empty shopOtherList}">
+        <p style="text-align: center;"><font  color="#1e90ff">暂无备注数据……</font></p>
+    </c:if>
+    <div>
+        <input id="btnCancel" class="btn" type="button" value="返回" onclick="history.go(-1)"/>
+    </div>
+<script>
+</script>
+</body>
+</html>
+