Browse Source

上架费

huangzhiguo 1 year ago
parent
commit
31b3f7a646

+ 8 - 2
src/main/java/com/caimei365/commodity/service/impl/ProcurementServiceImpl.java

@@ -42,8 +42,6 @@ public class ProcurementServiceImpl implements ProcurementService {
     // 发起与参与关联
     @Resource AdditionalService additionalService;
 
-    private static final SimpleDateFormat saveFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-    private static final SimpleDateFormat returnFormat = new SimpleDateFormat("yyyy-MM-dd");
 
     /**
      * 所有集采
@@ -55,6 +53,7 @@ public class ProcurementServiceImpl implements ProcurementService {
      */
     @Override
     public ResponseJson<PageInfo<ProcurementDto>> findList(int pageNo, int pageSize, Integer userId, Integer status) {
+        SimpleDateFormat returnFormat = new SimpleDateFormat("yyyy-MM-dd");
 //        PageHelper.startPage(pageNo, pageSize);
         List<ProcurementDto> procurementList = new ArrayList<>();
         // 我参与的
@@ -131,6 +130,8 @@ public class ProcurementServiceImpl implements ProcurementService {
      */
     @Override
     public ResponseJson<Map<String, Object>> detailProcurement(String id, Integer userId) {
+        SimpleDateFormat returnFormat = new SimpleDateFormat("yyyy-MM-dd");
+
         Map<String, Object> map = new HashMap<>();
         // 我参与的
         List<ProcurePo> involvedList = procureService.findInvolvedList(userId.toString());
@@ -221,6 +222,8 @@ public class ProcurementServiceImpl implements ProcurementService {
      */
     @Override
     public ResponseJson<List<ProcurementDto>> myProcurement(Integer userId, Integer procurementType) {
+        SimpleDateFormat returnFormat = new SimpleDateFormat("yyyy-MM-dd");
+
         List<ProcurementDto> procurementList = new ArrayList<>();
         // 参与者记录
         List<AdditionalPo> additionalPos = additionalService.findList();
@@ -320,6 +323,7 @@ public class ProcurementServiceImpl implements ProcurementService {
      */
     @Override
     public ResponseJson<ProcurementDto> editData(String id, Integer userId, Integer procurementType) {
+        SimpleDateFormat saveFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         ProcurementDto procurementDto = new ProcurementDto();
         List<ProcurePo> involvedList = new ArrayList<>();
         if (0 == procurementType) {
@@ -367,6 +371,7 @@ public class ProcurementServiceImpl implements ProcurementService {
      */
     @Override
     public ResponseJson saveProcurement(ProcurementDto procurementDto) throws Exception {
+        SimpleDateFormat saveFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         ProcurePo procurePo = new ProcurePo();
         // 初始化数据
         procurePo.setUserId(procurementDto.getUserId());
@@ -406,6 +411,7 @@ public class ProcurementServiceImpl implements ProcurementService {
      */
     @Override
     public ResponseJson participateProcurement(ProcurementDto procurementDto,Integer status) throws Exception {
+        SimpleDateFormat saveFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         ProcurePo procurePo = new ProcurePo();
         String id=procurementDto.getId();
         if (status ==1) {

+ 4 - 1
src/main/java/com/caimei365/commodity/service/impl/ShopServiceImpl.java

@@ -126,11 +126,14 @@ public class ShopServiceImpl implements ShopService {
         map.put("productPage", productPage);
         int featuredNum = shopMapper.getMainProductsCount(shopId);
         map.put("featuredNum", featuredNum);
+        // 上架费数量
         Integer listingFeeCount = shopMapper.listingFee(shopId);
+        // 过期数量
         Integer listingfeeExpireCount = shopMapper.listingfeeExpire(shopId);
+        // 是否免除上架费
         Integer receStatctCount = shopMapper.receStatct(shopId);
         Integer listingFee = 0;
-        if (listingFeeCount > 0 && listingfeeExpireCount > 0) {
+        if (listingFeeCount > 0 && listingfeeExpireCount > 0 && listingFeeCount == listingfeeExpireCount) {
             if (receStatctCount <= 0) {
                 listingFee = 1;//1是有上架费或者过期并且没有免除上架费
             }