Pārlūkot izejas kodu

1.学校地址管理允许修改功能
2.志愿者任务后台管理功能
3.志愿者任务参与者列表管理

yanliming 1 gadu atpakaļ
vecāks
revīzija
954fb387f5

+ 6 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/AddressInfo.java

@@ -55,5 +55,11 @@ public class AddressInfo {
 
 	@ApiModelProperty(value = "类型(1:爱心人士地址,2,学校地址)")
 	private String type;
+
+	@ApiModelProperty(value = "地区ID(用于回显)")
+	private String regionValue;
+
+	@ApiModelProperty(value = "地区ID(用于回显)")
+	private String[] regionValueArr;
 	
 		}

+ 6 - 1
common/src/main/resources/mapper/base/AddressInfo.xml

@@ -16,6 +16,7 @@
 			<result property="updateTime" column="update_time" />
 			<result property="delFlag" column="del_flag" />
 			<result property="type" column="type_" />
+			<result property="regionValue" column="region_value" />
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.AddressInfo">
 	<!--
@@ -25,7 +26,7 @@
 	-->
 	<![CDATA[
 		insert into base_address_info
-	    (id_,recipients_,phone_,region_,detail_address,reg_user_id,create_by,create_time,update_by,update_time,del_flag,type_)
+	    (id_,recipients_,phone_,region_,detail_address,reg_user_id,create_by,create_time,update_by,update_time,del_flag,type_,region_value)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -40,6 +41,7 @@
 ,#{updateTime,jdbcType= TIMESTAMP }
 ,#{delFlag,jdbcType= NUMERIC }
 ,#{type,jdbcType=VARCHAR}
+,#{regionValue,jdbcType=VARCHAR}
 		)
 	]]>
 	</insert>
@@ -82,6 +84,9 @@
 			<if test="type!=null">
 				type_=#{type,jdbcType=VARCHAR},
 			</if>
+			<if test="regionValue!=null">
+				region_value=#{regionValue,jdbcType=VARCHAR},
+			</if>
 		</set>
 	where id_=#{id}
 	</update>

+ 2 - 2
common/src/main/resources/mapper/base/VolunteerSignRecord.xml

@@ -90,8 +90,8 @@
 		]]>
 		<where>
 			del_flag=false
-			<if test="searchParams.id != null">
-				and ID_ like #{searchParams.id}
+			<if test="searchParams.volunteerTasksId != null">
+				and volunteer_tasks_id = #{searchParams.volunteerTasksId}
 			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">

+ 2 - 2
common/src/main/resources/mapper/base/VolunteerTasks.xml

@@ -95,8 +95,8 @@
 		]]>
 		<where>
 			del_flag=false
-			<if test="searchParams.id != null">
-				and ID_ like #{searchParams.id}
+			<if test="searchParams.introduce != null">
+				and introduce_ like #{searchParams.introduce}
 			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">

+ 10 - 0
web/src/main/java/com/jpsoft/employment/modules/base/controller/AddressInfoController.java

@@ -80,6 +80,11 @@ public class AddressInfoController {
 
             if (addressInfo != null) {
 
+                if(StringUtils.isNotEmpty(addressInfo.getRegionValue())){
+                    String[] arr = addressInfo.getRegionValue().split(",");
+                    addressInfo.setRegionValueArr(arr);
+                }
+
                 msgResult.setResult(true);
                 msgResult.setData(addressInfo);
             } else {
@@ -105,6 +110,11 @@ public class AddressInfoController {
         try {
 		    addressInfo.setUpdateBy(subject);
             addressInfo.setUpdateTime(new Date());
+
+            if(addressInfo.getRegionValueArr().length > 0){
+                String value = StringUtils.join(addressInfo.getRegionValueArr(),",");
+                addressInfo.setRegionValue(value);
+            }
 		
             int affectCount = addressInfoService.update(addressInfo);
 

+ 4 - 4
web/src/main/java/com/jpsoft/employment/modules/base/controller/VolunteerSignRecordController.java

@@ -19,7 +19,7 @@ import java.text.SimpleDateFormat;
 import java.util.*;
 
 @RestController
-@RequestMapping("/volunteerSignRecord")
+@RequestMapping("/base/volunteerSignRecord")
 public class VolunteerSignRecordController {
     private Logger logger = LoggerFactory.getLogger(getClass());
 
@@ -196,7 +196,7 @@ public class VolunteerSignRecordController {
     @ApiOperation(value="列表")
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     public MessageResult<Map> pageList(
-            String id,
+            String volunteerTasksId,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             HttpServletRequest request){
@@ -212,8 +212,8 @@ public class VolunteerSignRecordController {
         List<Sort> sortList = new ArrayList<>();
         sortList.add(new Sort("create_time","desc"));
 
-        if (StringUtils.isNotEmpty(id)) {
-            searchParams.put("id","%" + id + "%");
+        if (StringUtils.isNotEmpty(volunteerTasksId)) {
+            searchParams.put("volunteerTasksId",volunteerTasksId);
         }
 
 

+ 4 - 4
web/src/main/java/com/jpsoft/employment/modules/base/controller/VolunteerTasksController.java

@@ -18,7 +18,7 @@ import java.text.SimpleDateFormat;
 import java.util.*;
 
 @RestController
-@RequestMapping("/volunteerTasks")
+@RequestMapping("/base/volunteerTasks")
 public class VolunteerTasksController {
     private Logger logger = LoggerFactory.getLogger(getClass());
 
@@ -195,7 +195,7 @@ public class VolunteerTasksController {
     @ApiOperation(value="列表")
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     public MessageResult<Map> pageList(
-            String id,
+            String introduce,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             HttpServletRequest request){
@@ -211,8 +211,8 @@ public class VolunteerTasksController {
         List<Sort> sortList = new ArrayList<>();
         sortList.add(new Sort("create_time","desc"));
 
-        if (StringUtils.isNotEmpty(id)) {
-            searchParams.put("id","%" + id + "%");
+        if (StringUtils.isNotEmpty(introduce)) {
+            searchParams.put("introduce",introduce + "%");
         }
 
 

+ 42 - 0
web/src/main/java/com/jpsoft/employment/modules/base/controller/WishInfoUserRecordController.java

@@ -364,4 +364,46 @@ public class WishInfoUserRecordController {
 
         return msgResult;
     }
+
+
+
+    @ApiOperation(value="保存发货时间")
+    @RequestMapping(value = "updateDeliveryTime",method = RequestMethod.POST)
+    public MessageResult<Map> updateDeliveryTime(String id,String deliveryTime, HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        try {
+            Date now = new Date();
+            WishInfoUserRecord wishInfoUserRecord = wishInfoUserRecordService.get(id);
+
+            if(StringUtils.isNotEmpty(deliveryTime)){
+                SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
+                wishInfoUserRecord.setDeliveryTime(sdf.parse(deliveryTime));
+                wishInfoUserRecord.setUpdateBy(subject);
+                wishInfoUserRecord.setUpdateTime(new Date());
+            }
+
+            int affectCount = wishInfoUserRecordService.update(wishInfoUserRecord);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
 }