Pu Zhibing
2 天以前 5dacdee9b54c78372b68140e2b068d03a620eab9
ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAgreementController.java
@@ -3,22 +3,21 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.core.base.controller.BaseController;
import com.stylefeng.guns.core.beetl.ShiroExtUtil;
import com.stylefeng.guns.core.shiro.ShiroKit;
import com.stylefeng.guns.core.log.LogObjectHolder;
import com.stylefeng.guns.core.util.DateUtil;
import com.stylefeng.guns.core.util.ToolUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.beans.factory.annotation.Autowired;
import com.stylefeng.guns.core.log.LogObjectHolder;
import org.springframework.web.bind.annotation.RequestParam;
import com.stylefeng.guns.modular.system.model.TAgreement;
import com.stylefeng.guns.modular.system.service.ITAgreementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
 * 用户端协议管理控制器
@@ -29,12 +28,15 @@
@Controller
@RequestMapping("/tAgreement")
public class TAgreementController extends BaseController {
    private String PREFIX = "/system/tAgreement/";
    @Autowired
    private ITAgreementService tAgreementService;
    @Resource
    private ShiroExtUtil shiroExtUtil;
    /**
     * 跳转到用户端协议管理首页
     */
@@ -211,7 +213,7 @@
        TAgreement agreement = tAgreementService.selectById(id);
        agreement.setContent(context);
        agreement.setUpdateTime(new Date());
        agreement.setUpdateUser(ShiroExtUtil.getUser().getId());
        agreement.setUpdateUser(shiroExtUtil.getUser().getId());
        tAgreementService.updateById(agreement);
        return SUCCESS_TIP;
    }
@@ -350,31 +352,31 @@
    @RequestMapping(value = "/addOrUpdateIntimateAgreement")
    @ResponseBody
    public Object addOrUpdateIntimateAgreement(TAgreement tAgreement) {
        if (tAgreement.getId() == 0){
        if (tAgreement.getId() == 0) {
            tAgreement.setId(null);
            tAgreement.setInsertUser(ShiroExtUtil.getUser().getName());
            tAgreement.setInsertUser(shiroExtUtil.getUser().getName());
            tAgreement.setUseType(1);
            tAgreement.setType(16);
            tAgreement.setFlag("1");
            tAgreement.setInsertTime(DateUtil.parseTime(DateUtil.getTime()));
            tAgreement.setUpdateUser(ShiroExtUtil.getUser().getId());
            tAgreement.setUpdateUser(shiroExtUtil.getUser().getId());
            ///     过滤富文本的特殊字符
            String content = tAgreement.getContent();
            content = content.replaceAll("& lt;", "<").replaceAll("& gt;", ">");
            content = content.replaceAll("\\(", "& #40;").replaceAll("\\)", "& #41;");
            tAgreement.setContent(content);
            tAgreementService.insert(tAgreement);
        }else {
            tAgreement.setUpdateUser(ShiroExtUtil.getUser().getId());
            tAgreement.setUpdateUser(shiroExtUtil.getUser().getId());
            tAgreement.setUpdateTime(DateUtil.parseTime(DateUtil.getTime()));
            tAgreement.setFlag("2");
            ///     过滤富文本的特殊字符
            String content = tAgreement.getContent();
            content = content.replaceAll("& lt;", "<").replaceAll("& gt;", ">");
            content = content.replaceAll("\\(", "& #40;").replaceAll("\\)", "& #41;");
            tAgreement.setContent(content);
            tAgreementService.updateById(tAgreement);