Commit 08e62f79 authored by 谢希宇's avatar 谢希宇

Aidea product update by Strive Date 2020-11-02

parent ad465898
......@@ -447,46 +447,36 @@
<select id="orderFall" resultType="com.cftech.order.model.OrderMobile">
SELECT
t.id,
t.number,
t.pay_status AS payStatus,
t.total_amount AS totalAmount,
t.pay_time AS payTime,
t.trade_no AS tradeNo,
t.courier_number AS courierNumber,
t.order_cancel AS orderCancel,
t.status,
t.create_time AS createTime,
s.address_name AS addressName,
a.areaname AS province,
b.areaname AS city,
c.areaname AS area
FROM
t.id,
t.number,
t.pay_status AS payStatus,
t.total_amount AS totalAmount,
t.pay_time AS payTime,
t.trade_no AS tradeNo,
t.courier_number AS courierNumber,
t.order_cancel AS orderCancel,
t.status,
t.create_time AS createTime,
s.address_name AS addressName,
a.areaname AS province,
b.areaname AS city,
c.areaname AS area
FROM
t_order t LEFT JOIN t_shipping_address s ON t.openid = s.open_id
LEFT JOIN area a ON s.province_id = a.areaid
LEFT JOIN area b ON s.city_id = b.areaid
LEFT JOIN area c ON s.area_id = c.areaid
WHERE t.del_flag=0 AND s.whether = 1
<if test="number">
AND t.number =#{number},
AND t.number =#{number}
</if>
<if test="id">
AND t.id =#{id}
</if>
<if test="openid">
AND t.openid =#{openid}
</if>
<if test="status!=null and status ==0">
AND t.status =#{status}
</if>
<if test="status!=null and status ==1">
AND t.status =#{status}
</if>
<if test="status!=null and status ==2">
AND t.status =#{status}
</if>
<if test="status!=null and status ==3">
AND t.status =#{status}
</if>
<if test="status!=null and status ==4">
<if test="status!=null">
AND t.status =#{status}
</if>
</select>
......
......@@ -21,8 +21,10 @@ import sun.util.resources.cldr.gv.LocaleNames_gv;
@CrossOrigin
@RequestMapping("mobile/auth/product")
public class MobileProductController {
@Autowired
private ProductService productService;
/**
* @Author Licc
* @Description 根据id查询商品详情
......
......@@ -14,6 +14,7 @@ import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort;
import net.sf.json.JSONArray;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
......
......@@ -57,6 +57,7 @@ public class MaterialUploadController {
@Autowired
private MaterialUploadService materialUploadService;
@Autowired
private CosconfigService cosconfigService;
......@@ -159,11 +160,13 @@ public class MaterialUploadController {
public JSONObject upload(HttpServletRequest request, Long cosconfigId, Long categoryId, MultipartHttpServletRequest mhsr) {
JSONObject rtnJson = new JSONObject();
Long userid = UserUtils.getUser().getId();
if (cosconfigId != 0) {
cosconfig = cosconfigService.fetchById(cosconfigId);
} else {
//全部本地存储
cosconfig = null;
}
// if (cosconfigId != 0) {
// cosconfig = cosconfigService.fetchById(cosconfigId);
// } else {
// cosconfig = null;
// }
List<MultipartFile> files = mhsr.getFiles("upfile");
for (MultipartFile file : files) {
......@@ -246,7 +249,7 @@ public class MaterialUploadController {
cosconfig = cosconfigService.fetchById(cosconfigId);
MultipartFile imgArr = mhsr.getFile("qqfile");
//未取标题使用uuid作为名称
String titlePrefix = StringUtils.isBlank(material.getTitle())? UUID.randomUUID().toString().replaceAll("-",""):material.getTitle();
String titlePrefix = StringUtils.isBlank(material.getTitle()) ? UUID.randomUUID().toString().replaceAll("-", "") : material.getTitle();
int number = 0;
Map<String, Object> params = new HashMap<String, Object>();
params.put("titlePrefix", titlePrefix);
......
......@@ -91,9 +91,9 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A
rtnJson.put("errorNo","0");
rtnJson.put("errorMsg",addressVOS);
}
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
rtnJson.put("errorNO","1");
rtnJson.put("errorNO", "1");
}
return rtnJson;
}
......@@ -104,6 +104,7 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A
public JSONObject addressAdd(Address address) {
JSONObject rtnJson = new JSONObject();
Address newAddress = new Address();
try {
if (StringUtils.isEmpty(address.getOpenId())) {
rtnJson.put("errorNo", "1");
......@@ -126,35 +127,28 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A
return rtnJson;
}
MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(address.getAppId());
address.setOpenId(address.getOpenId());
address.setAccountsId(address.getAccountsId());
address.setDelFlag(false);
address.setAddressName(address.getAddressName());
address.setPhone(address.getPhone());
address.setAddress(address.getAddress());
address.setProvinceId(address.getProvinceId());
address.setCityId(address.getCityId());
address.setAreaId(address.getAreaId());
newAddress.setOpenId(address.getOpenId());
newAddress.setAccountsId(address.getAccountsId());
newAddress.setAddressName(address.getAddressName());
newAddress.setPhone(address.getPhone());
newAddress.setAddress(address.getAddress());
newAddress.setProvinceId(address.getProvinceId());
newAddress.setCityId(address.getCityId());
newAddress.setAreaId(address.getAreaId());
if ("1".equals(address.getWhether().toString())) {
address.setWhether(address.getWhether());
Long whether = address.getWhether();
String openId = address.getOpenId();
Integer list = addressMapper.whetherList(openId);
if ( list!=null) {
HashMap<String, Object> param = new HashMap<>();
param.put("whether", whether);
param.put("openId", openId);
int i = addressMapper.updateWhether(param);
if (i == 0) {
rtnJson.put("errorNo", "1");
rtnJson.put("errorMsg", "新增失败");
}
}
param.put("whether", address.getWhether());
param.put("openId", address.getOpenId());
//更新粉丝所有默认
addressMapper.updateWhether(param);
//增加默认
addressMapper.save(address);
rtnJson.put("errorNo","0");
rtnJson.put("errorMsg","新增成功");
rtnJson.put("errorNo", "0");
} else {
addressMapper.save(address);
rtnJson.put("errorNo", "0");
rtnJson.put("errorMsg", "新增成功");
}
}catch (Exception e){
e.printStackTrace();
......@@ -237,7 +231,6 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A
rtnJson.put("errorMsg", "id不能为空");
return rtnJson;
}
MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId);
int delete = addressMapper.delete(id);
if (delete > 0) {
rtnJson.put("errorNo", "0");
......
......@@ -26,10 +26,10 @@ import java.util.List;
@CrossOrigin
@RequestMapping("mobile/auth/address")
public class MobileAddressController {
@Autowired
private AddressService addressService;
/**
* @return
* @Description 个人收货地址数据回填
......
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