记得上下班打卡 | git大法好,push需谨慎

Commit cc7e2517 authored by Administrator's avatar Administrator 🎨

Merge branch 'pre' into 'master'

Pre

See merge request !148
parents f65081e2 9f4118ab
......@@ -20,26 +20,65 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">二维码地址:</label>
<div class="col-sm-8">
<input name="url" class="form-control" type="text" required>
<input id="fileinput10" type="file">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">生成数量</label>
<label class="col-sm-3 control-label is-required">图片地址</label>
<div class="col-sm-8">
<input name="count" class="form-control" type="number" required>
<input id="iptUrl" name="url" class="form-control" type="text" required readonly>
</div>
</div>
</form>
<div class="cover_pop" style="display: none">
<div class="pop_inner">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<div class="file-loading">
<input id="fileinput-demo-1" type="file" name="file" data-browse-on-zone-click="true"
data-msg-placeholder="Select {files} for upload...">
<input hidden id="coverImg" name="coverImg">
</div>
</div>
<div class="pop_btns">
<div class="confirm_btn" onclick="popBtn(1)">确认</div>
<div class="confirm_btn confirm_cancel" onclick="popBtn(0)">取消</div>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: bootstrap-fileinput-js"/>
<script th:inline="javascript">
var prefix = ctx + "sweet/active";
var platformUrl = [[${platformUrl}]];
$("#form-roadShow-edit").validate({
focusCleanup: true
});
$("#fileinput10").change((e) => {
if (!e.target.files[0]) {
return
}
var formData = new FormData();
formData.append("file", e.target.files[0]);
$.ajax({
url: "http://devplatform.zhengzai.tv" + "/platform/basicServices/alOss/upload",//路径是你控制器中上传图片的方法,下面controller里面我会写到
data: formData,
cache: false,
contentType: false,
processData: false,
type: 'POST',
success: function (res) {
console.log(res, 'res')
let imgPath = 'https://img.zhengzai.tv/' + res.data.ossPath;
$("#iptUrl").val(imgPath);
}
});
})
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/addQrCode", $('#form-qrcode-add').serialize());
......
......@@ -40,20 +40,20 @@ public class SweetAdminQrCodeServiceImpl implements ISweetAdminQrCodeService {
public Boolean addQrCode(CreateActiveQrCodeParam createActiveTypeParam) {
try {
SweetQrCode bean = SweetQrCode.getNew();
int count = sweetQrCodeMapper.selectCount(Wrappers.lambdaQuery(SweetQrCode.class).eq(SweetQrCode::getType, createActiveTypeParam.getType()));
for (int i = 0; i < createActiveTypeParam.getCount(); i++) {
int swat = count + i + 1;
String qrCodeId = IDGenerator.nextMilliId();
bean.setQrCodeId(qrCodeId);
bean.setUrl(createActiveTypeParam.getUrl().concat("&swat=") + swat);
bean.setReadNum(0);
bean.setShowNum(0);
bean.setType(createActiveTypeParam.getType());
sweetQrCodeMapper.insert(bean);
//初始化 展示次数 读取次数
sweetRedisAdminUtils.initQrCodeShowNum(createActiveTypeParam.getType(), qrCodeId);
sweetRedisAdminUtils.initQrCodeReadNum(createActiveTypeParam.getType(), qrCodeId);
}
// int count = sweetQrCodeMapper.selectCount(Wrappers.lambdaQuery(SweetQrCode.class).eq(SweetQrCode::getType, createActiveTypeParam.getType()));
// for (int i = 0; i < createActiveTypeParam.getCount(); i++) {
// int swat = count + i + 1;
String qrCodeId = IDGenerator.nextMilliId();
bean.setQrCodeId(qrCodeId);
bean.setUrl(createActiveTypeParam.getUrl());
bean.setReadNum(0);
bean.setShowNum(0);
bean.setType(createActiveTypeParam.getType());
sweetQrCodeMapper.insert(bean);
//初始化 展示次数 读取次数
sweetRedisAdminUtils.initQrCodeShowNum(createActiveTypeParam.getType(), qrCodeId);
sweetRedisAdminUtils.initQrCodeReadNum(createActiveTypeParam.getType(), qrCodeId);
// }
//纪录实体类List
sweetRedisAdminUtils.setQrCodeDetails(createActiveTypeParam.getType(), sweetQrCodeMapper.selectList(Wrappers.lambdaQuery(SweetQrCode.class).eq(SweetQrCode::getType, createActiveTypeParam.getType())));
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment