Duan_xu před 2 roky
rodič
revize
632f6e1ed2

+ 4 - 0
src/main/java/com/caimei/modules/user/dao/NewCmShopDao.java

@@ -51,9 +51,13 @@ public interface NewCmShopDao extends CrudDao<NewCmShop> {
 
     void Removethelast(CmDiscernReceipt cmDiscernReceipt);
 
+    void addthelast(CmDiscernReceipt cmDiscernReceipt);
+
     void cmreceipt(CmDiscernReceipt cmDiscernReceipt);
 
     CmDiscernReceipt cmrectiptlist(Integer shopID);
 
     Integer cmrectCount(Integer shopID);
+
+    Integer therectip();
 }

+ 12 - 2
src/main/java/com/caimei/modules/user/service/NewCmShopService.java

@@ -354,11 +354,16 @@ public class NewCmShopService extends CrudService<NewCmShopDao, NewCmShop> {
         newCmShopDao.Removethelastfee(cmDiscernReceipt);
     }
 
-  @Transactional(readOnly = false)
+    @Transactional(readOnly = false)
     public void Removethelast(CmDiscernReceipt cmDiscernReceipt) {
         newCmShopDao.Removethelast(cmDiscernReceipt);
     }
 
+    @Transactional(readOnly = false)
+    public void addthelast(CmDiscernReceipt cmDiscernReceipt) {
+        newCmShopDao.addthelast(cmDiscernReceipt);
+    }
+
     @Transactional(readOnly = false)
     public void cmreceipt(CmDiscernReceipt cmDiscernReceipt) {
         newCmShopDao.cmreceipt(cmDiscernReceipt);
@@ -366,11 +371,16 @@ public class NewCmShopService extends CrudService<NewCmShopDao, NewCmShop> {
 
     @Transactional(readOnly = false)
     public CmDiscernReceipt cmrectiptlist(Integer shopID) {
-       return newCmShopDao.cmrectiptlist(shopID);
+        return newCmShopDao.cmrectiptlist(shopID);
     }
     @Transactional(readOnly = false)
     public Integer cmrectCount(Integer shopID) {
         return newCmShopDao.cmrectCount(shopID);
     }
 
+    @Transactional(readOnly = false)
+    public Integer therectip() {
+        return newCmShopDao.therectip();
+    }
+
 }

+ 27 - 26
src/main/java/com/caimei/modules/user/web/NewCmShopController.java

@@ -216,10 +216,10 @@ public class NewCmShopController extends BaseController {
             Date receipttime = formatter.parse(receiptDate);
 //如果没有缴费记录
             if(null==cmDiscern){
-            //缴纳时间加一年==到期时间
-            calendar.setTime(receipttime);
-            calendar.add(Calendar.YEAR, 1);
-            dateStrings= formatter.format(calendar.getTime());
+                //缴纳时间加一年==到期时间
+                calendar.setTime(receipttime);
+                calendar.add(Calendar.YEAR, 1);
+                dateStrings= formatter.format(calendar.getTime());
                 calendars.setTime(receipttime);
                 calendars.add(Calendar.DATE, 1);
                 validityDate= formatter.format(calendars.getTime());
@@ -231,7 +231,7 @@ public class NewCmShopController extends BaseController {
                 logger.info("dateStrings>>>>>"+dateStrings);
                 newCmShopService.cmreceipt(cmDiscernReceipt);
             }
-            if(null!=cmDiscern) {
+            if(null!=cmDiscern && cmDiscern.getReceStatct()!=2 && cmDiscern.getReceStatct()!=1) {
                 Integer count=newCmShopService.cmrectCount(discernReceipt.getList().get(i).getShopID());
                 System.out.println("count>>"+count+"size>>"+discernReceipt.getList().size());
                 String receipt=cmDiscern.getExpirationDate();
@@ -246,22 +246,22 @@ public class NewCmShopController extends BaseController {
                 calendar.add(Calendar.YEAR, 1);
                 dateStrings= formatter.format(calendar.getTime());
                 if(!cmDiscern.getReceiptID().equals(discernReceipt.getList().get(i).getReceiptID())){
-        if(count != discernReceipt.getList().size()){
-                num = receipt.compareTo(dateString);
-                logger.info(">>>>>>"+num);
-                if(num>0){
-                    cmDiscernReceipt.setReceiptID(discernReceipt.getList().get(i).getReceiptID());
-                    cmDiscernReceipt.setValidityDate(cmDiscern.getExpirationDate());
-                    cmDiscernReceipt.setExpirationDate(dateStrings);
-                    newCmShopService.cmreceipt(cmDiscernReceipt);
-               } else {
-                    cmDiscernReceipt.setReceiptID(discernReceipt.getList().get(i).getReceiptID());
-                    cmDiscernReceipt.setValidityDate(validityDate);
-                    cmDiscernReceipt.setExpirationDate(dateStrings);
-                    newCmShopService.cmreceipt(cmDiscernReceipt);
+                    if(count != discernReceipt.getList().size()){
+                        num = receipt.compareTo(dateString);
+                        logger.info(">>>>>>"+num);
+                        if(num>0){
+                            cmDiscernReceipt.setReceiptID(discernReceipt.getList().get(i).getReceiptID());
+                            cmDiscernReceipt.setValidityDate(cmDiscern.getExpirationDate());
+                            cmDiscernReceipt.setExpirationDate(dateStrings);
+                            newCmShopService.cmreceipt(cmDiscernReceipt);
+                        } else {
+                            cmDiscernReceipt.setReceiptID(discernReceipt.getList().get(i).getReceiptID());
+                            cmDiscernReceipt.setValidityDate(validityDate);
+                            cmDiscernReceipt.setExpirationDate(dateStrings);
+                            newCmShopService.cmreceipt(cmDiscernReceipt);
+                        }
+                    }
                 }
-        }
-}
             }
 
             cmDiscernReceipt.setReceiptID(discernReceipt.getList().get(i).getReceiptID());
@@ -270,7 +270,7 @@ public class NewCmShopController extends BaseController {
             System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"+"1:"+date+"2:"+dateStrings+"3:"+dateString);
         }
         Page<CmDiscernReceipt>discernReceip = newCmShopService.maintenanceList(new Page<CmDiscernReceipt>(request, response, 20),cmDiscernReceipt);
-            model.addAttribute("CmDiscernReceipt", cmDiscernReceipt);
+        model.addAttribute("CmDiscernReceipt", cmDiscernReceipt);
         model.addAttribute("discernReceipt", discernReceip);
         return "modules/user/maintenanceList";
     }
@@ -285,8 +285,9 @@ public class NewCmShopController extends BaseController {
 
         //获取操作时间
         sysLog.setOperationtime(new Date());
+        newCmShopService.addthelast(cmDiscernReceipt);
+        cmDiscernReceipt.setReceiptID(newCmShopService.therectip().toString());
         newCmShopService.cmreceipt(cmDiscernReceipt);
-
         //获取操作员
         SystemAuthorizingRealm.Principal principal = UserUtils.getPrincipal();
         System.out.println("操作员" + principal.getName());
@@ -399,7 +400,7 @@ public class NewCmShopController extends BaseController {
                 sysLog.setContact(newCmShops.getLinkMan());
                 sysLog.setInstitutionName(newCmShops.getName());
                 sysLog.setOperationtype("审核");
-                    sysLog.setActioncontent("审核失败");
+                sysLog.setActioncontent("审核失败");
                 if (!"".equals(sysLog.getActioncontent())) {
                     if (sysLog.getInstitutionName() != null && sysLog.getContact() != null) {
                         int i = cmOperationalLogService.insert(sysLog);
@@ -904,7 +905,7 @@ public class NewCmShopController extends BaseController {
             }
         }
 
-         if (!newCmShop.getBusinessScope().equals(newCmShops.getBusinessScope())) {
+        if (!newCmShop.getBusinessScope().equals(newCmShops.getBusinessScope())) {
             list.add("修改了医疗类型");
         }
 
@@ -921,7 +922,7 @@ public class NewCmShopController extends BaseController {
                 list.add("新增了微信公众号");
             }
         }
-            if (!newCmShop.getWxOfficialAccount().equals(newCmShops.getWxOfficialAccount())) {
+        if (!newCmShop.getWxOfficialAccount().equals(newCmShops.getWxOfficialAccount())) {
             list.add("修改了微信公众号");
         }
 
@@ -938,7 +939,7 @@ public class NewCmShopController extends BaseController {
                 list.add("新增了营业执照编号");
             }
         }
-      if (!newCmShop.getSocialCreditCode().equals(newCmShops.getSocialCreditCode())) {
+        if (!newCmShop.getSocialCreditCode().equals(newCmShops.getSocialCreditCode())) {
             list.add("修改了营业执照编号");
         }
 

+ 19 - 2
src/main/resources/mappings/modules/user/NewCmShopMapper.xml

@@ -456,7 +456,7 @@
                 AND (a.receiptDate &lt; #{endTime} OR a.receiptDate = #{endTime})
             </if>
             and a.receiptDate is not null
-            ORDER BY c.dateStrings DESC
+            ORDER BY a.receiptDate DESC
         </where>
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
@@ -470,6 +470,13 @@
         values (#{shopID}, #{receStatct}, #{receiptDate}, 1, 1)
     </insert>
 
+    <select id="therectip" resultType="Integer">
+        SELECT id FROM cm_discern_receipt WHERE receStatct=2
+        ORDER BY id DESC
+        LIMIT 1
+    </select>
+
+
     <update id="Removethelast">
         update cm_discern_receipt
         set newReceiptType=1,
@@ -477,6 +484,13 @@
         where id = #{receiptID}
     </update>
 
+    <insert id="addthelast">
+        insert cm_discern_receipt
+       (receiptDate,newReceiptType,
+            receStatct,delFlag,shopID)
+            value (now(),1,2,1,#{shopID})
+    </insert>
+
     <insert id="cmreceipt">
         insert into cm_receipt
             (validityDate, dateStrings, receiptID)
@@ -485,7 +499,7 @@
 
     <select id="cmrectiptlist" resultType="com.caimei.modules.order.entity.CmDiscernReceipt">
         SELECT r.receiptID as receiptID,r.dateStrings  as expirationDate,
-               r.validityDate as validityDate
+               r.validityDate as validityDate,c.receStatct as receStatct
         FROM cm_receipt r
                  LEFT JOIN cm_discern_receipt c ON c.id = r.receiptID
                  LEFT JOIN shop s ON s.shopID = c.shopID
@@ -506,3 +520,6 @@
     </select>
 
 </mapper>
+
+
+

+ 12 - 12
src/main/webapp/WEB-INF/views/modules/user/maintenanceList.jsp

@@ -179,19 +179,19 @@
 	<div class="ul-form">
 		<div class="flex-wrap">
 
-				<label>操作时间:</label>
-				<form:input path="startTime" type="text" maxlength="20" class="input-mini Wdate" value="${startTime}"
-							onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
-				-
-				<form:input path="endTime" type="text" maxlength="20" class="input-mini Wdate" value="${endTime}"
-							onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+			<label>操作时间:</label>
+			<form:input path="startTime" type="text" maxlength="20" class="input-mini Wdate" value="${startTime}"
+						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+			-
+			<form:input path="endTime" type="text" maxlength="20" class="input-mini Wdate" value="${endTime}"
+						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
 
 			&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
-			&nbsp;&nbsp;<input class="btn btn-primary" onclick="offocea(${CmDiscernReceipt.shopID},'${CmDiscernReceipt.shopName}','${CmDiscernReceipt.linkMan}')" type="button" value="免除上架费"/>
-			</div>
-<%--		shopId, receStatct, receiptDate--%>
-		<strong>供应商:${CmDiscernReceipt.shopName}</strong>
+			&nbsp;&nbsp;<input class="btn btn-primary" onclick="offocea(${CmDiscernReceipt.receiptID},${CmDiscernReceipt.shopID},'${CmDiscernReceipt.shopName}','${CmDiscernReceipt.linkMan}')" type="button" value="免除上架费"/>
 		</div>
+			<%--		shopId, receStatct, receiptDate--%>
+		<strong>供应商:${CmDiscernReceipt.shopName}</strong>
+	</div>
 	</div>
 </form:form>
 <sys:message content="${message}"/>
@@ -244,11 +244,11 @@
 </table>
 <div class="pagination">${discernReceipt}</div>
 <script>
-	function offocea(shopID,shopName,linkMan) {
+	function offocea(receiptID,shopID,shopName,linkMan) {
 		$.jBox.confirm("确定为该供应商免除上架费吗?","提示",function(v,h,f){
 
 			if(v === 1){
-				window.location.href="${ctx}/user/newCmShop/Removethelastfee?shopID="+shopID+"&shopName="+shopName+"&linkMan="+linkMan;
+				window.location.href="${ctx}/user/newCmShop/Removethelastfee?receiptID="+receiptID+"&shopID="+shopID+"&shopName="+shopName+"&linkMan="+linkMan;
 			}
 		} ,{ buttons: {  '确定': 1,'取消':2}});
 	}